@treasuredata/tdx 0.14.2 → 0.14.4

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 (149) 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/api-command.js +1 -1
  8. package/dist/commands/auth-command.d.ts.map +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-command.js.map +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.d.ts.map +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-command.js.map +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-command.js +1 -1
  22. package/dist/commands/job-command.js +1 -1
  23. package/dist/commands/journey-command.js +1 -1
  24. package/dist/commands/journey-validate-command.js +1 -1
  25. package/dist/commands/llm-command.js +1 -1
  26. package/dist/commands/llm-proxy.js +1 -1
  27. package/dist/commands/parent-segment-command.js +1 -1
  28. package/dist/commands/profile-command.js +1 -1
  29. package/dist/commands/profiles-command.js +1 -1
  30. package/dist/commands/query-command.js +1 -1
  31. package/dist/commands/segment-command.js +1 -1
  32. package/dist/commands/segment-create-command.js +1 -1
  33. package/dist/commands/segment-fields-command.js +1 -1
  34. package/dist/commands/segment-pull-command.js +1 -1
  35. package/dist/commands/segment-push-command.js +1 -1
  36. package/dist/commands/segment-update-command.js +1 -1
  37. package/dist/commands/segment-use-command.js +1 -1
  38. package/dist/commands/segment-validate-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/tables.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.d.ts +15 -0
  54. package/dist/core/profile.d.ts.map +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/profile.js.map +1 -1
  57. package/dist/core/project-config.js +1 -1
  58. package/dist/core/session.js +1 -1
  59. package/dist/core/user-cache.js +1 -1
  60. package/dist/core/version.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/proxy/anthropic-adapter.js +1 -1
  63. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  66. package/dist/proxy/context-signature.js +1 -1
  67. package/dist/proxy/conversation-utils.js +1 -1
  68. package/dist/proxy/passthrough-server.d.ts +13 -2
  69. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/passthrough-server.js.map +1 -1
  72. package/dist/proxy/server.js +1 -1
  73. package/dist/proxy/session-cache.js +1 -1
  74. package/dist/proxy/sse-usage-parser.js +1 -1
  75. package/dist/sdk/agent/agent-config.js +1 -1
  76. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  77. package/dist/sdk/agent/agent-yaml.js +1 -1
  78. package/dist/sdk/api.js +1 -1
  79. package/dist/sdk/client/cdp-api-client.js +1 -1
  80. package/dist/sdk/client/endpoints.js +1 -1
  81. package/dist/sdk/client/engage-api-client.js +1 -1
  82. package/dist/sdk/client/http-client.js +1 -1
  83. package/dist/sdk/client/llm-api-client.js +1 -1
  84. package/dist/sdk/client/rate-limiter.js +1 -1
  85. package/dist/sdk/client/td-api-client.js +1 -1
  86. package/dist/sdk/client/trino-api-client.js +1 -1
  87. package/dist/sdk/client/workflow-client.js +1 -1
  88. package/dist/sdk/connection-validator.js +1 -1
  89. package/dist/sdk/connection.js +1 -1
  90. package/dist/sdk/engage.js +1 -1
  91. package/dist/sdk/errors.js +1 -1
  92. package/dist/sdk/index.js +1 -1
  93. package/dist/sdk/io/index.js +1 -1
  94. package/dist/sdk/io/node-filesystem.js +1 -1
  95. package/dist/sdk/job.js +1 -1
  96. package/dist/sdk/journey.js +1 -1
  97. package/dist/sdk/llm/chat-cache.js +1 -1
  98. package/dist/sdk/llm/index.js +1 -1
  99. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  100. package/dist/sdk/llm/model-aliases.js +1 -1
  101. package/dist/sdk/llm/model-factors.js +1 -1
  102. package/dist/sdk/query/index.js +1 -1
  103. package/dist/sdk/query/sql-parser.js +1 -1
  104. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  105. package/dist/sdk/segment/fields-display.js +1 -1
  106. package/dist/sdk/segment/file-discovery.js +1 -1
  107. package/dist/sdk/segment/journey-utils.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-workflow.js +1 -1
  113. package/dist/sdk/segment/resolution-context.js +1 -1
  114. package/dist/sdk/segment/segment-path-parser.js +1 -1
  115. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  116. package/dist/sdk/segment/target-resolution.js +1 -1
  117. package/dist/sdk/segment/tdx-config.js +1 -1
  118. package/dist/sdk/segment/validate-files.js +1 -1
  119. package/dist/sdk/segment/yaml-validator.js +1 -1
  120. package/dist/sdk/segment.js +1 -1
  121. package/dist/sdk/types/index.js +1 -1
  122. package/dist/sdk/types/progress.js +1 -1
  123. package/dist/sdk/user.js +1 -1
  124. package/dist/sdk/util/format-detector.js +1 -1
  125. package/dist/sdk/util/formatters.js +1 -1
  126. package/dist/sdk/util/index.js +1 -1
  127. package/dist/sdk/util/tree-formatter.js +1 -1
  128. package/dist/sdk/workflow/clone-workflow.js +1 -1
  129. package/dist/sdk/workflow/index.js +1 -1
  130. package/dist/sdk/workflow/pull-workflow.js +1 -1
  131. package/dist/sdk/workflow/push-workflow.js +1 -1
  132. package/dist/sdk/workflow/tdx-config.js +1 -1
  133. package/dist/sdk/workflow/workflow-utils.js +1 -1
  134. package/dist/utils/async.js +1 -1
  135. package/dist/utils/colors.js +1 -1
  136. package/dist/utils/diff.js +1 -1
  137. package/dist/utils/file-permissions.js +1 -1
  138. package/dist/utils/json-loader.js +1 -1
  139. package/dist/utils/option-validation.js +1 -1
  140. package/dist/utils/port.js +1 -1
  141. package/dist/utils/process.js +1 -1
  142. package/dist/utils/prompt.js +1 -1
  143. package/dist/utils/spinner.js +1 -1
  144. package/dist/utils/sse-parser.js +1 -1
  145. package/dist/utils/string-utils.js +1 -1
  146. package/dist/utils/table-ref-parser.js +1 -1
  147. package/dist/utils/tdx-logger.js +1 -1
  148. package/dist/utils/version-check.js +1 -1
  149. package/package.json +1 -1
@@ -1 +1 @@
1
- const a21_0x371304=a21_0x4582;(function(_0xf9f2d9,_0x26c042){const _0x27b330=a21_0x4582,_0x1d4107=_0xf9f2d9();while(!![]){try{const _0x234f3b=parseInt(_0x27b330(0x1b5))/0x1*(parseInt(_0x27b330(0x1d4))/0x2)+-parseInt(_0x27b330(0x24a))/0x3+parseInt(_0x27b330(0x16b))/0x4+parseInt(_0x27b330(0x26b))/0x5*(parseInt(_0x27b330(0x252))/0x6)+parseInt(_0x27b330(0x18e))/0x7*(parseInt(_0x27b330(0x26e))/0x8)+parseInt(_0x27b330(0x25d))/0x9*(parseInt(_0x27b330(0x1c6))/0xa)+-parseInt(_0x27b330(0x18f))/0xb*(parseInt(_0x27b330(0x156))/0xc);if(_0x234f3b===_0x26c042)break;else _0x1d4107['push'](_0x1d4107['shift']());}catch(_0x1c1677){_0x1d4107['push'](_0x1d4107['shift']());}}}(a21_0x5c7b,0x41860));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a21_0x232a1d 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}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a21_0x2d58e5 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a21_0x371304(0x1a2);function openBrowser(_0x3d68ff){const _0x24bc5f=a21_0x371304,_0x1295d5=process['platform'],_0x53f65d=_0x1295d5===_0x24bc5f(0x1d9)?_0x24bc5f(0x238):_0x1295d5==='win32'?'start':'xdg-open';spawn(_0x53f65d,[_0x3d68ff],{'detached':!![],'stdio':_0x24bc5f(0x255)})[_0x24bc5f(0x15c)]();}function migrateLegacyDirectory(){const _0x2dce74=a21_0x371304;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2bf24b=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2bf24b['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a21_0x2d58e5[_0x2dce74(0x274)](_0x2dce74(0x22d)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x2dce74(0x1b6))),console[_0x2dce74(0x258)](a21_0x2d58e5[_0x2dce74(0x24e)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x2dce74(0x21d))),![];console[_0x2dce74(0x258)](a21_0x2d58e5['yellow'](_0x2dce74(0x167)+LEGACY_PARENT_SEGMENT_DIR+_0x2dce74(0x223)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a21_0x2d58e5[_0x2dce74(0x19d)](_0x2dce74(0x15f)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x3c0daf){const _0x5a57e3=_0x3c0daf instanceof Error?_0x3c0daf['message']:String(_0x3c0daf);return console[_0x2dce74(0x258)](a21_0x2d58e5[_0x2dce74(0x21b)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x5a57e3+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x316a23){return migrateLegacyDirectory(),super['run'](_0x316a23);}}function resolveYamlFile(_0x5f4266){const _0x3b41b8=a21_0x371304;if(_0x5f4266[_0x3b41b8(0x217)](_0x3b41b8(0x157))||_0x5f4266[_0x3b41b8(0x217)](_0x3b41b8(0x247)))return _0x5f4266;return a21_0x232a1d[_0x3b41b8(0x1cc)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5f4266)+_0x3b41b8(0x157));}function formatProgressMessage(_0x20afaa){const _0x830fd2=a21_0x371304,_0x4038df=_0x20afaa[_0x830fd2(0x1bb)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x4038df){const [,_0x3bf249,_0x1fcf55,_0x5bdfa6='']=_0x4038df;return a21_0x2d58e5[_0x830fd2(0x24e)](_0x3bf249+':')+'\x20'+_0x1fcf55+a21_0x2d58e5[_0x830fd2(0x24e)](_0x5bdfa6);}return a21_0x2d58e5[_0x830fd2(0x24e)](_0x20afaa);}function showFileNotFoundError(_0x2706a7,_0x4e22e4){const _0x56a604=a21_0x371304;console[_0x56a604(0x258)](a21_0x2d58e5[_0x56a604(0x21b)](_0x56a604(0x1c1)+_0x2706a7+'\x0a')),console['error'](a21_0x2d58e5[_0x56a604(0x278)](_0x56a604(0x261)+_0x4e22e4+_0x56a604(0x168)));}function showParentSegmentNotSetError(_0x5dc4f7){const _0x15eea7=a21_0x371304;console[_0x15eea7(0x258)](a21_0x2d58e5[_0x15eea7(0x274)](_0x15eea7(0x251))),console['error'](_0x5dc4f7);}export class ParentSegmentListCommand extends BaseCommand{[a21_0x371304(0x1a9)]=a21_0x371304(0x1e2);['description']=a21_0x371304(0x1d0);async[a21_0x371304(0x228)](_0x7dd73c){const _0x13d31a=a21_0x371304,{options:_0x777a78,args:_0x4a2aae,tdx:_0x3b0522}=_0x7dd73c,_0x30ae65=_0x4a2aae[0x0];_0x777a78[_0x13d31a(0x16f)]&&(console[_0x13d31a(0x258)](_0x13d31a(0x20b)+_0x777a78[_0x13d31a(0x1a4)]),_0x30ae65&&console['error'](_0x13d31a(0x21e)+_0x30ae65));const _0x4d1d46=await withSpinner(_0x30ae65?_0x13d31a(0x26c)+_0x30ae65+_0x13d31a(0x269):_0x13d31a(0x17f),()=>_0x3b0522['segment'][_0x13d31a(0x1a7)](),{'verbose':_0x777a78['verbose']});let _0x3b41b9=_0x4d1d46[_0x13d31a(0x1e3)];if(_0x30ae65){const _0x5e7dca=_0x30ae65[_0x13d31a(0x1af)](/[.+^${}()|[\]\\]/g,_0x13d31a(0x189))[_0x13d31a(0x1af)](/\*/g,'.*')[_0x13d31a(0x1af)](/\?/g,'.'),_0x23532f=new RegExp('^'+_0x5e7dca+'$','i');_0x3b41b9=_0x3b41b9[_0x13d31a(0x1b7)](_0x33365a=>_0x23532f[_0x13d31a(0x15b)](_0x33365a[_0x13d31a(0x232)]['name']));}_0x3b41b9['sort']((_0x56b444,_0x3c4a98)=>_0x56b444[_0x13d31a(0x232)][_0x13d31a(0x1a9)]['localeCompare'](_0x3c4a98[_0x13d31a(0x232)]['name'])),console[_0x13d31a(0x258)]('✔\x20Found\x20'+_0x3b41b9[_0x13d31a(0x224)]+_0x13d31a(0x222)+(_0x3b41b9['length']!==0x1?'s':''));const _0x4eca2e=_0x594e41=>{const _0x92a9f4=_0x13d31a;return getConsoleNextUrl(_0x777a78['site'],_0x92a9f4(0x1df)+_0x594e41);};if(_0x777a78[_0x13d31a(0x1da)]===_0x13d31a(0x1ae)||_0x777a78[_0x13d31a(0x1da)]===_0x13d31a(0x173)){const _0x4f2732=_0x3b41b9['map'](_0x13569f=>({..._0x13569f,'url':_0x4eca2e(_0x13569f['id'])}));await handleSDKOutput(_0x4f2732,_0x777a78);}else{if(_0x3b41b9['length']===0x0)_0x30ae65?console[_0x13d31a(0x1ef)](_0x13d31a(0x263)+_0x30ae65):console[_0x13d31a(0x1ef)](_0x13d31a(0x214));else for(const _0x12660f of _0x3b41b9){const _0x54b112=_0x12660f[_0x13d31a(0x232)]['population']?a21_0x2d58e5['dim']('\x20('+formatRows(_0x12660f[_0x13d31a(0x232)]['population'])+')'):'',_0x4b022c=hyperlink(_0x12660f[_0x13d31a(0x232)][_0x13d31a(0x1a9)],_0x4eca2e(_0x12660f['id']));console['log'](_0x13d31a(0x246)+_0x4b022c+_0x54b112);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a21_0x371304(0x1a9)]=a21_0x371304(0x25f);[a21_0x371304(0x243)]=a21_0x371304(0x260);async[a21_0x371304(0x228)](_0x371572){const _0x199cdc=a21_0x371304,{options:_0xa12687,args:_0x2af57f,tdx:_0x48ce10}=_0x371572;console['error'](_0x199cdc(0x1cb)+_0x199cdc(0x174)+_0x199cdc(0x24f));const _0x549f72=_0xa12687;if(_0x2af57f[_0x199cdc(0x224)]===0x0)return console[_0x199cdc(0x258)](a21_0x2d58e5[_0x199cdc(0x21b)](_0x199cdc(0x206))),console[_0x199cdc(0x258)](_0x199cdc(0x17b)),0x1;const _0x54a87f=_0x2af57f[0x0];if(!_0x549f72[_0x199cdc(0x1a0)]||!_0x549f72[_0x199cdc(0x1b0)])return console[_0x199cdc(0x258)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x199cdc(0x258)](_0x199cdc(0x17b)),0x1;_0x549f72[_0x199cdc(0x16f)]&&(console[_0x199cdc(0x258)](_0x199cdc(0x20b)+_0x549f72['site']),console[_0x199cdc(0x258)]('Name:\x20'+_0x54a87f),console[_0x199cdc(0x258)](_0x199cdc(0x194)+_0x549f72['database']),console[_0x199cdc(0x258)](_0x199cdc(0x256)+_0x549f72['table']));const _0x1b5b91=await loadJSONFromOptions(_0x549f72[_0x199cdc(0x232)],_0x549f72[_0x199cdc(0x19e)]),_0x5b08d5=await loadJSONFromOptions(_0x549f72[_0x199cdc(0x158)],_0x549f72[_0x199cdc(0x1e5)]),_0x5fd1f6=await loadJSONFromOptions(_0x549f72[_0x199cdc(0x22a)],_0x549f72[_0x199cdc(0x166)]),_0x206e92={'name':_0x54a87f,'description':_0x549f72[_0x199cdc(0x243)],'scheduleType':_0x549f72[_0x199cdc(0x200)],'scheduleOption':_0x549f72[_0x199cdc(0x1c5)],'timezone':_0x549f72[_0x199cdc(0x1bc)],'master':{'parentDatabaseName':_0x549f72['database'],'parentTableName':_0x549f72[_0x199cdc(0x1b0)]},'attributes':_0x1b5b91,'behaviors':_0x5b08d5,'customerGroup':_0x5fd1f6},_0x2922a5=await withSpinner(_0x199cdc(0x24c)+_0x54a87f+_0x199cdc(0x269),()=>_0x48ce10[_0x199cdc(0x18c)][_0x199cdc(0x231)](_0x206e92),{'verbose':_0xa12687[_0x199cdc(0x16f)]}),_0x513eff=_0x2922a5[_0x199cdc(0x1e3)];return console['error'](_0x199cdc(0x175)+_0x513eff[_0x199cdc(0x1a9)]+_0x199cdc(0x1f3)+_0x513eff['id']),await handleSDKOutput([_0x513eff],_0xa12687),0x0;}}function a21_0x5c7b(){const _0x264009=['darwin','format','Created','Join\x20on:','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x0a✔\x20Workflow\x20started','/app/dw/parentSegments/','addAttributesFile','segment:parent:run','segment:parent:list','data','\x20field','behaviorsFile','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','totalEvents','setJobId','/attempt/','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Fetching\x20parent\x20segment\x20\x27','\x20=\x20','\x27\x20and\x20run\x20workflow?','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','log','all','\x0aChanges\x20to\x20apply\x20to\x20\x27','segment:parent:fields','\x27\x20with\x20ID:\x20','displaySampleData','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','behavior','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Errors:','\x0aNew\x20parent\x20segment\x20\x27','displayValidateResults','getParentSQL','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','✔\x20Found\x20','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','joinKey','scheduleType','\x20--attribute\x20\x22','resolveParentId','\x20Configuration\x20is\x20valid','text','\x0aNo\x20sample\x20data\x20available','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20kill','dirname','elapsedTimeMillis','Events:','Site:\x20','pushParentYaml','Fetching\x20SQL\x20for\x20\x27','To\x20view\x20sample\x20data:','\x20No\x20changes\x20-\x20','\x0aChanges\x20to\x20\x27','segment:parent:desc','displayColumns','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','No\x20parent\x20segments\x20found','\x20rows\x20','Attempt:','endsWith','Error:','string','customerPercent','red','Create\x20parent\x20segment\x20\x27','/\x20directory.\x0a','Pattern:\x20','web','To\x20cancel:','information_schema','\x20parent\x20segment','/\x20→\x20','length','displayPreviewResults','Show\x20parent\x20segment\x20details','Master:','execute','Validate:','customerGroup','stop','displayAttributesStats','\x0a⚠️\x20\x20Both\x20','yes','runParent','\x20parent\x20segment\x20\x27','createParent','attributes','column','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','addAttributes','Master\x20Table','segment:parent:validate','open','Error\x20parsing\x20YAML:\x20','\x20tdx\x20wf\x20attempt\x20','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','repeat','Customers:','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20is\x20already\x20up\x20to\x20date','map','Available\x20attributes:','/app/workflows/','description','Creating','\x20--interval\x20','👥\x20','.yaml','Output\x20file:\x20','listFields','1333845otXFmu','\x20\x20\x20\x20-\x20','Creating\x20parent\x20segment\x20\x27','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','dim','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','72jQCXkc','Preview:','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','ignore','Table:\x20','Get\x20SQL\x20query\x20for\x20parent\x20segment','error','Analyzing\x20changes...','\x20--behavior\x20\x22<name>\x22','\x20--behavior\x20\x22','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','72jiGDZF','utf-8','segment:parent:create','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Source:','No\x20parent\x20segments\x20match\x20pattern:\x20','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','coveragePercent','errors','master','displayPreviewHints','\x27...','Master\x20+\x20Attributes','153150xUvQWV','Listing\x20parent\x20segments\x20matching\x20\x27','parentSegment','8IfgBUN','columns','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Error\x20reading\x20file:\x20','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Updated','yellow','output','Options\x20(one\x20required):\x0a','-1d','cyan','sampleData','segment:parent:preview','Parent\x20segment:\x20','addBehaviors','✔\x20No\x20changes\x20-\x20\x27','interval','Error:\x20--attribute\x20requires\x20a\x20name\x0a','workflowAttemptId','toLocaleString','SQL\x20query:\x0a','\x20--attribute\x20\x22<name>\x22','2870520WrZGKw','.yml','behaviors','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Apply\x20changes\x20to\x20\x27','test','unref','validateParentYaml','preview','✔\x20Renamed\x20directory\x20to\x20','rowCount','workflowId','stats','customersWithEvents','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','customerGroupFile','\x0a⚠️\x20\x20Migrating:\x20','`\x20to\x20download\x20the\x20configuration\x20first','\x20Context\x20set:\x20','✔\x20Updated\x20parent\x20segment\x20\x27','589716CAmvcL','segment:parent:update','toFixed','/sessions/','verbose','pullParentYaml','\x27\x20is\x20up\x20to\x20date','matchedCount','jsonl','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','✔\x20Created\x20parent\x20segment\x20\x27','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x20rows)','audienceId','Attributes','message','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','allValid','Session:','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Listing\x20parent\x20segments...','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','FINISHED','Executing\x20parent\x20segment\x20query...','double','Columns:','Validating\x20configuration...','Found\x20YAML\x20file:\x20','displayBehaviorsStats','\x27\x20is\x20already\x20up\x20to\x20date','\x5c$&','Resolving\x20parent\x20segment\x20\x27','Options:\x0a','segment','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','2023910QqRjGI','33XlVwOD','Fetching\x20sample\x20data...','Coverage:','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Database:\x20','%)\x20','start','foreignKey','Status:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','segment:parent:push','limit','green','attributesFile','attribute','database','getParentFull','parent_segment','segment:parent:pull','site','schemaError','previewParentYaml','listParents','YAML\x20file:\x20','name','in\x20','tdx\x20segment\x20parent\x20preview\x20','varchar','enriched','json','replace','table','List\x20available\x20fields\x20for\x20segmentation','Updating\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','143926ZCJXzE','/\x20directories\x20exist.','filter','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Aborted.','number','match','timezone','\x20\x20No\x20sample\x20data\x20available','\x20Opening\x20','label','schemaValid','Error:\x20File\x20not\x20found:\x20','using\x20the\x20default\x20path:\x20','bold','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','scheduleOption','603230oIbKHH','apply','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','join','Join:','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','displaySummary','List\x20parent\x20segments','updateParent','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','jobId','2fIapSL','Overwrite\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','trim','workflowSessionId'];a21_0x5c7b=function(){return _0x264009;};return a21_0x5c7b();}export class ParentSegmentUpdateCommand extends BaseCommand{[a21_0x371304(0x1a9)]=a21_0x371304(0x16c);[a21_0x371304(0x243)]=a21_0x371304(0x25c);async['execute'](_0x5d8bb9){const _0x2e0d46=a21_0x371304,{options:_0x2469fd,args:_0x3c968a,tdx:_0xf629df}=_0x5d8bb9;console[_0x2e0d46(0x258)](_0x2e0d46(0x199)+_0x2e0d46(0x174)+_0x2e0d46(0x24f));const _0x4a4612=_0x2469fd;if(_0x3c968a[_0x2e0d46(0x224)]===0x0)return console[_0x2e0d46(0x258)](a21_0x2d58e5[_0x2e0d46(0x21b)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x2e0d46(0x258)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x4857ec=_0x3c968a[0x0];_0x4a4612[_0x2e0d46(0x16f)]&&(console['error'](_0x2e0d46(0x20b)+_0x4a4612[_0x2e0d46(0x1a4)]),console[_0x2e0d46(0x258)](_0x2e0d46(0x27b)+_0x4857ec));const _0x5cd6db=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x4857ec+_0x2e0d46(0x269),()=>_0xf629df[_0x2e0d46(0x18c)][_0x2e0d46(0x1a1)](_0x4857ec),{'verbose':_0x4a4612[_0x2e0d46(0x16f)]}),_0x174fb3=_0x5cd6db[_0x2e0d46(0x1e3)],_0x159324=await loadJSONFromOptions(_0x4a4612[_0x2e0d46(0x235)],_0x4a4612[_0x2e0d46(0x1e0)]),_0x308217=await loadJSONFromOptions(_0x4a4612[_0x2e0d46(0x27c)],_0x4a4612['addBehaviorsFile']),_0x2856f2={'name':_0x174fb3[_0x2e0d46(0x1a9)],'description':_0x4a4612[_0x2e0d46(0x243)]!==undefined?_0x4a4612['description']:_0x174fb3[_0x2e0d46(0x243)],'scheduleType':_0x4a4612[_0x2e0d46(0x200)]!==undefined?_0x4a4612[_0x2e0d46(0x200)]:_0x174fb3[_0x2e0d46(0x200)],'scheduleOption':_0x4a4612['scheduleOption']!==undefined?_0x4a4612[_0x2e0d46(0x1c5)]:_0x174fb3[_0x2e0d46(0x1c5)],'timezone':_0x4a4612['timezone']!==undefined?_0x4a4612[_0x2e0d46(0x1bc)]:_0x174fb3['timezone'],'master':_0x174fb3['master'],'attributes':_0x159324?[..._0x174fb3[_0x2e0d46(0x232)]||[],..._0x159324]:_0x174fb3[_0x2e0d46(0x232)],'behaviors':_0x308217?[..._0x174fb3['behaviors']||[],..._0x308217]:_0x174fb3[_0x2e0d46(0x158)],'customerGroup':_0x174fb3[_0x2e0d46(0x22a)]},_0x111d87=await withSpinner(_0x2e0d46(0x1b2)+_0x4857ec+_0x2e0d46(0x269),()=>_0xf629df[_0x2e0d46(0x18c)][_0x2e0d46(0x1d1)](_0x4857ec,_0x2856f2),{'verbose':_0x4a4612[_0x2e0d46(0x16f)]}),_0x1fda2b=_0x111d87[_0x2e0d46(0x1e3)];return console[_0x2e0d46(0x258)](_0x2e0d46(0x16a)+_0x1fda2b['name']+'\x27'),await handleSDKOutput([_0x1fda2b],_0x4a4612),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a21_0x371304(0x1a3);[a21_0x371304(0x243)]=a21_0x371304(0x192);async[a21_0x371304(0x228)](_0x257e1e){const _0x341e14=a21_0x371304,{options:_0x275b23,args:_0x3d52bd,tdx:_0x5e5e38}=_0x257e1e,_0x382208=_0x275b23,_0x5bbe73=_0x3d52bd[0x0]||_0x275b23[_0x341e14(0x26d)];if(!_0x5bbe73)return showParentSegmentNotSetError(_0x341e14(0x1ce)+_0x341e14(0x193)),0x1;if(_0x382208['use']&&_0x382208['output'])return console[_0x341e14(0x258)](a21_0x2d58e5[_0x341e14(0x21b)](_0x341e14(0x1c8))),console['error'](a21_0x2d58e5['dim'](_0x341e14(0x17e))),console[_0x341e14(0x258)](a21_0x2d58e5[_0x341e14(0x24e)](_0x341e14(0x1c2)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x341e14(0x258)](a21_0x2d58e5['cyan'](_0x341e14(0x18d))),0x1;const _0x27916b=_0x382208[_0x341e14(0x275)]||a21_0x232a1d[_0x341e14(0x1cc)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5bbe73)+'.yml');_0x382208[_0x341e14(0x16f)]&&(console[_0x341e14(0x258)](_0x341e14(0x20b)+_0x382208[_0x341e14(0x1a4)]),console[_0x341e14(0x258)]('Parent\x20segment:\x20'+_0x5bbe73),console[_0x341e14(0x258)](_0x341e14(0x248)+_0x27916b));const _0x51fde9=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x5bbe73+_0x341e14(0x269),()=>_0x5e5e38['segment'][_0x341e14(0x170)](_0x5bbe73),{'verbose':_0x382208[_0x341e14(0x16f)]}),_0x473103=_0x51fde9['data'];if(existsSync(_0x27916b)){const _0x484599=readFileSync(_0x27916b,'utf-8'),_0xd16574=generateDiff(_0x484599,_0x473103);if(!hasChanges(_0xd16574))console[_0x341e14(0x258)](a21_0x2d58e5[_0x341e14(0x19d)]('✔')+_0x341e14(0x20f)+a21_0x2d58e5[_0x341e14(0x278)](_0x27916b)+_0x341e14(0x23f));else{console[_0x341e14(0x258)](_0x341e14(0x210)+_0x27916b+'\x27:'),console[_0x341e14(0x258)]('─'[_0x341e14(0x23c)](0x3c)),console['error'](formatDiffWithColors(_0xd16574)),console[_0x341e14(0x258)]('─'[_0x341e14(0x23c)](0x3c));if(!_0x382208[_0x341e14(0x22e)]){const _0x103a67=await confirmKey(_0x341e14(0x1d5)+_0x27916b+'\x27?');if(!_0x103a67)return console[_0x341e14(0x258)](_0x341e14(0x1b9)),0x1;}writeFileSync(_0x27916b,_0x473103,'utf-8'),console[_0x341e14(0x258)](a21_0x2d58e5[_0x341e14(0x19d)]('✔')+_0x341e14(0x1f7)+a21_0x2d58e5[_0x341e14(0x278)](_0x27916b));}}else{const _0x1e89d3=a21_0x232a1d[_0x341e14(0x208)](_0x27916b);!existsSync(_0x1e89d3)&&mkdirSync(_0x1e89d3,{'recursive':!![]}),writeFileSync(_0x27916b,_0x473103,'utf-8'),console['error'](a21_0x2d58e5[_0x341e14(0x19d)]('✔')+_0x341e14(0x1f7)+a21_0x2d58e5[_0x341e14(0x278)](_0x27916b));}return saveSessionContext({'parent_segment':_0x5bbe73},_0x382208['session']),console[_0x341e14(0x258)](a21_0x2d58e5[_0x341e14(0x19d)]('✔')+_0x341e14(0x169)+a21_0x2d58e5['dim'](_0x341e14(0x1a2))+_0x341e14(0x1ec)+a21_0x2d58e5[_0x341e14(0x278)](_0x5bbe73)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a21_0x371304(0x1a9)]=a21_0x371304(0x19b);['description']=a21_0x371304(0x272);async['execute'](_0x4a05a3){const _0x95ab8d=a21_0x371304,{options:_0x52ff82,args:_0x2c2540,tdx:_0x13d605}=_0x4a05a3,_0x157017=_0x52ff82,_0xe732df=_0x2c2540[0x0]||_0x52ff82[_0x95ab8d(0x26d)];if(!_0xe732df)return showParentSegmentNotSetError(_0x95ab8d(0x1fe)+_0x95ab8d(0x1c4)),0x1;const _0x3a628e=resolveYamlFile(_0xe732df);if(!existsSync(_0x3a628e))return showFileNotFoundError(_0x3a628e,_0xe732df),0x1;_0x157017[_0x95ab8d(0x16f)]&&(console[_0x95ab8d(0x258)](_0x95ab8d(0x20b)+_0x157017[_0x95ab8d(0x1a4)]),console[_0x95ab8d(0x258)](_0x95ab8d(0x1a8)+_0x3a628e));let _0x832c12;try{_0x832c12=readFileSync(_0x3a628e,_0x95ab8d(0x25e));}catch(_0x12054e){const _0xcf23ba=_0x12054e instanceof Error?_0x12054e[_0x95ab8d(0x17a)]:String(_0x12054e);return console[_0x95ab8d(0x258)](_0x95ab8d(0x271)+_0xcf23ba),0x1;}const _0x169adc=await withSpinner(_0x95ab8d(0x259),()=>_0x13d605[_0x95ab8d(0x18c)][_0x95ab8d(0x20c)](_0x832c12),{'verbose':_0x157017[_0x95ab8d(0x16f)]}),_0x3e87f5=_0x169adc[_0x95ab8d(0x1e3)],{isNew:_0x284398,name:_0x551d97,hasChanges:_0x3b70a,diffFormatted:_0x348ab6}=_0x3e87f5;if(!_0x3b70a)return console['error'](_0x95ab8d(0x27d)+_0x551d97+_0x95ab8d(0x188)),0x0;_0x284398?console[_0x95ab8d(0x258)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x551d97+'\x27:'):console['error'](_0x95ab8d(0x1f1)+_0x551d97+'\x27:');console[_0x95ab8d(0x258)]('─'[_0x95ab8d(0x23c)](0x3c)),console[_0x95ab8d(0x258)](_0x348ab6),console['error']('─'['repeat'](0x3c));const _0x9abec2=_0x284398?_0x95ab8d(0x21c)+_0x551d97+'\x27?':_0x95ab8d(0x15a)+_0x551d97+'\x27?';if(!_0x157017[_0x95ab8d(0x22e)]){const _0x2d7c2c=await confirmKey(_0x9abec2);if(!_0x2d7c2c)return console['error'](_0x95ab8d(0x1b9)),0x1;}const _0x4866fe=_0x284398?_0x95ab8d(0x244):'Updating',_0x281b50=await withSpinner(_0x4866fe+_0x95ab8d(0x230)+_0x551d97+_0x95ab8d(0x269),()=>_0x3e87f5[_0x95ab8d(0x1c7)](),{'verbose':_0x157017[_0x95ab8d(0x16f)]}),_0x4611ff=_0x281b50['data'],_0x16a82e=getConsoleNextUrl(_0x157017[_0x95ab8d(0x1a4)],_0x95ab8d(0x1df)+_0x4611ff['id']),_0x3e6966=_0x284398?_0x95ab8d(0x1db):_0x95ab8d(0x273);return console[_0x95ab8d(0x258)]('✔\x20'+_0x3e6966+_0x95ab8d(0x230)+_0x4611ff[_0x95ab8d(0x1a9)]+'\x27'),console['error']('\x20\x20'+_0x16a82e),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a21_0x371304(0x1a9)]=a21_0x371304(0x237);[a21_0x371304(0x243)]=a21_0x371304(0x159);async[a21_0x371304(0x228)](_0x52212d){const _0x5a874b=a21_0x371304,{options:_0x489216,args:_0x3dd0ea,tdx:_0x1a7f46}=_0x52212d,_0x5dbf9e=_0x489216,_0x1c1d59=_0x3dd0ea[0x0]||_0x489216['parentSegment'];if(!_0x1c1d59)return showParentSegmentNotSetError(_0x5a874b(0x1f5)+_0x5a874b(0x1b4)+'Options:\x0a'+_0x5a874b(0x1ca)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x5a874b(0x23b)),0x1;const _0xe40865=resolveYamlFile(_0x1c1d59);if(!existsSync(_0xe40865))return showFileNotFoundError(_0xe40865,_0x1c1d59),0x1;_0x5dbf9e[_0x5a874b(0x16f)]&&(console['error'](_0x5a874b(0x20b)+_0x5dbf9e[_0x5a874b(0x1a4)]),console[_0x5a874b(0x258)](_0x5a874b(0x1a8)+_0xe40865));let _0x39b2ba;try{_0x39b2ba=readFileSync(_0xe40865,_0x5a874b(0x25e));}catch(_0x190b68){const _0x5f3f84=_0x190b68 instanceof Error?_0x190b68[_0x5a874b(0x17a)]:String(_0x190b68);return console[_0x5a874b(0x258)](_0x5a874b(0x271)+_0x5f3f84),0x1;}const _0x129af7=createCommandSpinner(a21_0x2d58e5[_0x5a874b(0x24e)](_0x5a874b(0x185)),{'verbose':_0x5dbf9e[_0x5a874b(0x16f)]});_0x129af7[_0x5a874b(0x196)]();const _0x989050={'onProgress':_0x3576d4=>{_0x129af7['text']=formatProgressMessage(_0x3576d4);}};if(_0x5dbf9e[_0x5a874b(0x267)])_0x989050[_0x5a874b(0x267)]=!![];if(_0x5dbf9e['enriched'])_0x989050[_0x5a874b(0x1ad)]=!![];_0x5dbf9e[_0x5a874b(0x19f)]&&(_0x989050[_0x5a874b(0x19f)]=_0x5dbf9e['attribute']);_0x5dbf9e[_0x5a874b(0x1f6)]&&(_0x989050[_0x5a874b(0x1f6)]=_0x5dbf9e[_0x5a874b(0x1f6)]);if(_0x5dbf9e['interval'])_0x989050[_0x5a874b(0x150)]=_0x5dbf9e['interval'];let _0x2217c3;try{_0x2217c3=await _0x1a7f46[_0x5a874b(0x18c)][_0x5a874b(0x15d)](_0x39b2ba,_0x989050),_0x129af7[_0x5a874b(0x22b)]();}catch(_0x53356a){_0x129af7[_0x5a874b(0x22b)]();throw _0x53356a;}const _0x2c9826=_0x5dbf9e[_0x5a874b(0x150)]||_0x5a874b(0x277);return this[_0x5a874b(0x1fa)](_0x2217c3,_0x989050,_0xe40865,_0x2c9826),_0x2217c3[_0x5a874b(0x17c)]?0x0:0x1;}[a21_0x371304(0x1fa)](_0x551ca2,_0x14e943,_0x53059a,_0x4bb917){const _0x16abe8=a21_0x371304;console[_0x16abe8(0x258)]('\x0a'+a21_0x2d58e5['bold'](_0x16abe8(0x229))+'\x20'+_0x551ca2[_0x16abe8(0x1a9)]),console['error']('═'[_0x16abe8(0x23c)](0x3c)),this['displayMasterInfo'](_0x551ca2);if(typeof _0x14e943[_0x16abe8(0x19f)]==='string'){this[_0x16abe8(0x22c)](_0x551ca2),this[_0x16abe8(0x1cf)](_0x551ca2),this[_0x16abe8(0x268)](_0x53059a,_0x4bb917,_0x16abe8(0x19f),_0x14e943[_0x16abe8(0x19f)]);return;}if(_0x14e943[_0x16abe8(0x19f)]===!![]){this[_0x16abe8(0x22c)](_0x551ca2),this['displaySummary'](_0x551ca2),this[_0x16abe8(0x268)](_0x53059a,_0x4bb917,'attributes');return;}if(typeof _0x14e943[_0x16abe8(0x1f6)]===_0x16abe8(0x219)){this[_0x16abe8(0x187)](_0x551ca2,_0x4bb917),this[_0x16abe8(0x1cf)](_0x551ca2),this[_0x16abe8(0x268)](_0x53059a,_0x4bb917,_0x16abe8(0x1f6),_0x14e943[_0x16abe8(0x1f6)]);return;}if(_0x14e943['behavior']===!![]){this[_0x16abe8(0x187)](_0x551ca2,_0x4bb917),this['displaySummary'](_0x551ca2),this[_0x16abe8(0x268)](_0x53059a,_0x4bb917,'behaviors');return;}this['displayAttributesStats'](_0x551ca2),this[_0x16abe8(0x187)](_0x551ca2,_0x4bb917),this[_0x16abe8(0x1cf)](_0x551ca2),this[_0x16abe8(0x268)](_0x53059a,_0x4bb917,_0x16abe8(0x1f0));}[a21_0x371304(0x268)](_0x30d918,_0x540aa6,_0x2e052d,_0x372fbf){const _0x17bc75=a21_0x371304;console[_0x17bc75(0x258)]('\x0a'+a21_0x2d58e5['dim'](_0x17bc75(0x20e)));const _0x3f8784=_0x540aa6!=='-1d'?_0x17bc75(0x245)+_0x540aa6:'';if(_0x2e052d===_0x17bc75(0x19f)&&_0x372fbf)console[_0x17bc75(0x258)]('\x20\x20'+a21_0x2d58e5[_0x17bc75(0x24e)](_0x17bc75(0x1ab)+_0x30d918+_0x17bc75(0x201)+_0x372fbf+'\x22'+_0x3f8784));else{if(_0x2e052d===_0x17bc75(0x1f6)&&_0x372fbf)console[_0x17bc75(0x258)]('\x20\x20'+a21_0x2d58e5[_0x17bc75(0x24e)]('tdx\x20segment\x20parent\x20preview\x20'+_0x30d918+_0x17bc75(0x25b)+_0x372fbf+'\x22'+_0x3f8784));else(_0x2e052d===_0x17bc75(0x232)||_0x2e052d===_0x17bc75(0x1f0))&&console[_0x17bc75(0x258)]('\x20\x20'+a21_0x2d58e5[_0x17bc75(0x24e)](_0x17bc75(0x1ab)+_0x30d918+_0x17bc75(0x155)+_0x3f8784));}(_0x2e052d===_0x17bc75(0x158)||_0x2e052d===_0x17bc75(0x1f0))&&console[_0x17bc75(0x258)]('\x20\x20'+a21_0x2d58e5[_0x17bc75(0x24e)]('tdx\x20segment\x20parent\x20preview\x20'+_0x30d918+_0x17bc75(0x25a)+_0x3f8784)),_0x2e052d===_0x17bc75(0x1f0)&&console[_0x17bc75(0x258)]('\x20\x20'+a21_0x2d58e5[_0x17bc75(0x24e)](_0x17bc75(0x1ab)+_0x30d918+'\x20--enriched'+_0x3f8784));}['displayMasterInfo'](_0x1445a3){const _0x2f40fa=a21_0x371304,{master:_0x28184b}=_0x1445a3,_0x45f154=_0x28184b[_0x2f40fa(0x1c0)]?a21_0x2d58e5['green']('✔'):a21_0x2d58e5['red']('✘');console[_0x2f40fa(0x258)]('\x0a'+a21_0x2d58e5[_0x2f40fa(0x24e)](_0x2f40fa(0x236))),console['error'](_0x45f154+'\x20'+a21_0x2d58e5[_0x2f40fa(0x1c3)](_0x28184b[_0x2f40fa(0x1a0)]+'.'+_0x28184b[_0x2f40fa(0x1b0)])),_0x28184b['schemaValid']?_0x28184b[_0x2f40fa(0x160)]!==undefined&&console[_0x2f40fa(0x258)]('\x20\x20'+a21_0x2d58e5[_0x2f40fa(0x24e)]('Rows:')+'\x20'+a21_0x2d58e5[_0x2f40fa(0x278)](formatRows(_0x28184b['rowCount']))):console['error']('\x20\x20'+a21_0x2d58e5[_0x2f40fa(0x21b)](_0x2f40fa(0x218))+'\x20'+_0x28184b[_0x2f40fa(0x1a5)]);}[a21_0x371304(0x22c)](_0x162132){const _0x466adc=a21_0x371304;if(_0x162132[_0x466adc(0x232)][_0x466adc(0x224)]===0x0)return;console[_0x466adc(0x258)]('\x0a'+a21_0x2d58e5[_0x466adc(0x24e)](_0x466adc(0x179)));for(const _0x389e74 of _0x162132['attributes']){const _0xb0ab80=_0x389e74['schemaValid']?a21_0x2d58e5[_0x466adc(0x19d)]('✔'):a21_0x2d58e5[_0x466adc(0x21b)]('✘');let _0x35ca97='';if(_0x389e74[_0x466adc(0x1c0)]&&_0x389e74[_0x466adc(0x172)]!==undefined&&_0x389e74[_0x466adc(0x265)]!==undefined){const _0x276ccf=_0x389e74[_0x466adc(0x265)][_0x466adc(0x16d)](0x1),_0x4654c0=_0x389e74[_0x466adc(0x265)]>=0x50?a21_0x2d58e5['green']:_0x389e74[_0x466adc(0x265)]>=0x32?a21_0x2d58e5[_0x466adc(0x274)]:a21_0x2d58e5[_0x466adc(0x21b)];_0x35ca97='\x20'+a21_0x2d58e5['dim'](_0x466adc(0x191))+'\x20'+_0x4654c0(_0x276ccf+'%')+'\x20('+formatRows(_0x389e74[_0x466adc(0x172)])+_0x466adc(0x177);}console[_0x466adc(0x258)](_0xb0ab80+'\x20'+a21_0x2d58e5[_0x466adc(0x1c3)](_0x389e74[_0x466adc(0x1a9)])+_0x35ca97),console[_0x466adc(0x258)]('\x20\x20'+a21_0x2d58e5[_0x466adc(0x24e)](_0x466adc(0x262))+'\x20'+a21_0x2d58e5['bold'](_0x389e74[_0x466adc(0x1a0)]+'.'+_0x389e74['table']));const _0xc13429=_0x389e74[_0x466adc(0x1ff)]===_0x389e74['foreignKey']?a21_0x2d58e5[_0x466adc(0x24e)](_0x466adc(0x1dc))+'\x20'+_0x389e74[_0x466adc(0x1ff)]:a21_0x2d58e5[_0x466adc(0x24e)](_0x466adc(0x1cd))+'\x20'+_0x389e74[_0x466adc(0x1ff)]+_0x466adc(0x1ec)+_0x389e74[_0x466adc(0x197)];console[_0x466adc(0x258)]('\x20\x20'+_0xc13429),console[_0x466adc(0x258)]('\x20\x20'+a21_0x2d58e5[_0x466adc(0x24e)](_0x466adc(0x184))),this[_0x466adc(0x212)](_0x389e74['columns']),!_0x389e74[_0x466adc(0x1c0)]&&console['error']('\x20\x20'+a21_0x2d58e5[_0x466adc(0x21b)](_0x466adc(0x218))+'\x20'+_0x389e74['schemaError']);}}[a21_0x371304(0x187)](_0x5cd8ad,_0x420f3b){const _0x4712aa=a21_0x371304;if(_0x5cd8ad['behaviors'][_0x4712aa(0x224)]===0x0)return;console['error']('\x0a'+a21_0x2d58e5[_0x4712aa(0x24e)]('Behaviors')+'\x20'+a21_0x2d58e5[_0x4712aa(0x24e)]('('+_0x420f3b+')'));for(const _0x39a99e of _0x5cd8ad['behaviors']){const _0x892236=_0x39a99e[_0x4712aa(0x1c0)]?a21_0x2d58e5['green']('✔'):a21_0x2d58e5[_0x4712aa(0x21b)]('✘');let _0x12c044='';if(_0x39a99e['schemaValid']&&_0x39a99e[_0x4712aa(0x163)]!==undefined&&_0x39a99e[_0x4712aa(0x1e7)]!==undefined){const _0x16a884=_0x39a99e['customerPercent']?.[_0x4712aa(0x16d)](0x1)||'?',_0xa34c79=(_0x39a99e[_0x4712aa(0x21a)]??0x0)>=0x32?a21_0x2d58e5[_0x4712aa(0x19d)]:(_0x39a99e[_0x4712aa(0x21a)]??0x0)>=0x14?a21_0x2d58e5[_0x4712aa(0x274)]:a21_0x2d58e5[_0x4712aa(0x21b)];_0x12c044='\x20'+a21_0x2d58e5[_0x4712aa(0x24e)](_0x4712aa(0x23d))+'\x20'+_0xa34c79(formatRows(_0x39a99e['customersWithEvents']))+'\x20('+_0x16a884+_0x4712aa(0x195)+a21_0x2d58e5[_0x4712aa(0x24e)](_0x4712aa(0x20a))+'\x20'+a21_0x2d58e5[_0x4712aa(0x278)](formatRows(_0x39a99e[_0x4712aa(0x1e7)]));}console[_0x4712aa(0x258)](_0x892236+'\x20'+a21_0x2d58e5[_0x4712aa(0x1c3)](_0x39a99e[_0x4712aa(0x1a9)])+_0x12c044),console['error']('\x20\x20'+a21_0x2d58e5[_0x4712aa(0x24e)](_0x4712aa(0x262))+'\x20'+a21_0x2d58e5[_0x4712aa(0x1c3)](_0x39a99e[_0x4712aa(0x1a0)]+'.'+_0x39a99e[_0x4712aa(0x1b0)]));const _0xf403dc=_0x39a99e[_0x4712aa(0x1ff)]===_0x39a99e[_0x4712aa(0x197)]?a21_0x2d58e5[_0x4712aa(0x24e)](_0x4712aa(0x1dc))+'\x20'+_0x39a99e[_0x4712aa(0x1ff)]:a21_0x2d58e5[_0x4712aa(0x24e)]('Join:')+'\x20'+_0x39a99e[_0x4712aa(0x1ff)]+_0x4712aa(0x1ec)+_0x39a99e[_0x4712aa(0x197)];console['error']('\x20\x20'+_0xf403dc),console[_0x4712aa(0x258)]('\x20\x20'+a21_0x2d58e5[_0x4712aa(0x24e)](_0x4712aa(0x184))),this[_0x4712aa(0x212)](_0x39a99e[_0x4712aa(0x26f)]),!_0x39a99e[_0x4712aa(0x1c0)]&&console[_0x4712aa(0x258)]('\x20\x20'+a21_0x2d58e5['red'](_0x4712aa(0x218))+'\x20'+_0x39a99e['schemaError']);}}[a21_0x371304(0x212)](_0x3c86af){const _0x5e6e20=a21_0x371304;for(const _0x2e1a07 of _0x3c86af){_0x2e1a07['label']===_0x2e1a07[_0x5e6e20(0x233)]||_0x2e1a07[_0x5e6e20(0x233)]==='*'?console[_0x5e6e20(0x258)](_0x5e6e20(0x24b)+_0x2e1a07[_0x5e6e20(0x1bf)]):console['error'](_0x5e6e20(0x24b)+_0x2e1a07[_0x5e6e20(0x1bf)]+'\x20'+a21_0x2d58e5[_0x5e6e20(0x24e)]('('+_0x2e1a07['column']+')'));}}[a21_0x371304(0x1cf)](_0x1b92d8){const _0x84b147=a21_0x371304;console['error']('─'[_0x84b147(0x23c)](0x3c));if(_0x1b92d8[_0x84b147(0x266)][_0x84b147(0x224)]>0x0){console[_0x84b147(0x258)]('\x0a'+a21_0x2d58e5[_0x84b147(0x21b)](_0x84b147(0x1f8)));for(const _0x1dd8b6 of _0x1b92d8[_0x84b147(0x266)]){console[_0x84b147(0x258)]('\x20\x20'+a21_0x2d58e5['red']('•')+'\x20'+_0x1dd8b6);}}_0x1b92d8[_0x84b147(0x17c)]&&console[_0x84b147(0x258)]('\x0a'+a21_0x2d58e5['green']('✔')+_0x84b147(0x203));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a21_0x371304(0x1a9)]=a21_0x371304(0x27a);[a21_0x371304(0x243)]=a21_0x371304(0x24d);async[a21_0x371304(0x228)](_0x2fb75c){const _0x22f592=a21_0x371304,{options:_0x10c578,args:_0x2ab8a1,tdx:_0x56f380}=_0x2fb75c,_0x5277de=_0x10c578,_0xdfcbb8=_0x2ab8a1[0x0]||_0x10c578[_0x22f592(0x26d)];if(!_0xdfcbb8)return showParentSegmentNotSetError(_0x22f592(0x250)+_0x22f592(0x1d6)+_0x22f592(0x276)+_0x22f592(0x164)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x22f592(0x1ea)+_0x22f592(0x254)+_0x22f592(0x23b)),0x1;if(!_0x5277de['master']&&!_0x5277de[_0x22f592(0x19f)]&&!_0x5277de[_0x22f592(0x1f6)]&&!_0x5277de['enriched'])return console['error'](a21_0x2d58e5[_0x22f592(0x21b)](_0x22f592(0x1b8))),console[_0x22f592(0x258)](_0x22f592(0x1dd)),console[_0x22f592(0x258)]('Options:'),console[_0x22f592(0x258)](_0x22f592(0x213)),console[_0x22f592(0x258)](_0x22f592(0x1d2)),console[_0x22f592(0x258)](_0x22f592(0x19a)),console[_0x22f592(0x258)](_0x22f592(0x1e6)),0x1;const _0x49fec9=resolveYamlFile(_0xdfcbb8);if(!existsSync(_0x49fec9))return showFileNotFoundError(_0x49fec9,_0xdfcbb8),0x1;_0x5277de[_0x22f592(0x16f)]&&(console[_0x22f592(0x258)](_0x22f592(0x20b)+_0x5277de['site']),console['error'](_0x22f592(0x1a8)+_0x49fec9));let _0x1fb1ce;try{_0x1fb1ce=readFileSync(_0x49fec9,_0x22f592(0x25e));}catch(_0x50462e){const _0x40fcaf=_0x50462e instanceof Error?_0x50462e['message']:String(_0x50462e);return console['error']('Error\x20reading\x20file:\x20'+_0x40fcaf),0x1;}let _0x5c5746;try{_0x5c5746=parseDef(_0x1fb1ce);}catch(_0x2b4c37){const _0x26d277=_0x2b4c37 instanceof Error?_0x2b4c37[_0x22f592(0x17a)]:String(_0x2b4c37);return console[_0x22f592(0x258)](a21_0x2d58e5[_0x22f592(0x21b)](_0x22f592(0x239)+_0x26d277)),0x1;}if(_0x5277de['attribute']===!![]||_0x5277de['attribute']===''){const _0x2f716f=_0x5c5746['attributes']?.[_0x22f592(0x240)](_0x17e994=>_0x17e994[_0x22f592(0x1a9)])||[];if(_0x2f716f['length']===0x0)console[_0x22f592(0x258)](a21_0x2d58e5[_0x22f592(0x21b)](_0x22f592(0x165)));else{console[_0x22f592(0x258)](a21_0x2d58e5[_0x22f592(0x21b)](_0x22f592(0x151))),console[_0x22f592(0x258)](_0x22f592(0x241));for(const _0x2cede4 of _0x2f716f){console[_0x22f592(0x258)]('\x20\x20'+a21_0x2d58e5['cyan'](_0x2cede4));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0xdfcbb8+'\x20--attribute\x20\x22'+_0x2f716f[0x0]+'\x22');}return 0x1;}if(_0x5277de[_0x22f592(0x1f6)]===!![]||_0x5277de[_0x22f592(0x1f6)]===''){const _0x715cbe=_0x5c5746[_0x22f592(0x158)]?.['map'](_0xb45716=>_0xb45716['name'])||[];if(_0x715cbe[_0x22f592(0x224)]===0x0)console[_0x22f592(0x258)](a21_0x2d58e5[_0x22f592(0x21b)](_0x22f592(0x1c9)));else{console[_0x22f592(0x258)](a21_0x2d58e5[_0x22f592(0x21b)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x22f592(0x258)]('Available\x20behaviors:');for(const _0x5d72a2 of _0x715cbe){console['error']('\x20\x20'+a21_0x2d58e5[_0x22f592(0x278)](_0x5d72a2));}console[_0x22f592(0x258)](_0x22f592(0x176)+_0xdfcbb8+_0x22f592(0x25b)+_0x715cbe[0x0]+'\x22');}return 0x1;}const _0x5256a7=createCommandSpinner(a21_0x2d58e5[_0x22f592(0x24e)](_0x22f592(0x190)),{'verbose':_0x5277de[_0x22f592(0x16f)]});_0x5256a7['start']();const _0x336197={'onProgress':_0x444de3=>{const _0x4aa948=_0x22f592;_0x5256a7[_0x4aa948(0x204)]=formatProgressMessage(_0x444de3);}};if(_0x5277de[_0x22f592(0x267)])_0x336197[_0x22f592(0x267)]=!![];if(_0x5277de[_0x22f592(0x19f)]&&typeof _0x5277de[_0x22f592(0x19f)]===_0x22f592(0x219))_0x336197[_0x22f592(0x19f)]=_0x5277de[_0x22f592(0x19f)];if(_0x5277de[_0x22f592(0x1f6)]&&typeof _0x5277de[_0x22f592(0x1f6)]===_0x22f592(0x219))_0x336197[_0x22f592(0x1f6)]=_0x5277de[_0x22f592(0x1f6)];if(_0x5277de['enriched'])_0x336197[_0x22f592(0x1ad)]=!![];if(_0x5277de[_0x22f592(0x150)])_0x336197[_0x22f592(0x150)]=_0x5277de[_0x22f592(0x150)];let _0x29ae73;try{_0x29ae73=await _0x56f380[_0x22f592(0x18c)][_0x22f592(0x1a6)](_0x1fb1ce,_0x336197),_0x5256a7['stop']();}catch(_0x5096b7){_0x5256a7['stop']();throw _0x5096b7;}return await this['displayPreviewResults'](_0x29ae73,{'master':_0x5277de[_0x22f592(0x267)],'attribute':typeof _0x5277de[_0x22f592(0x19f)]===_0x22f592(0x219)?_0x5277de['attribute']:undefined,'behavior':typeof _0x5277de[_0x22f592(0x1f6)]===_0x22f592(0x219)?_0x5277de[_0x22f592(0x1f6)]:undefined,'enriched':_0x5277de[_0x22f592(0x1ad)]}),_0x29ae73['allValid']?0x0:0x1;}async[a21_0x371304(0x225)](_0x4b2742,_0x36bfd5){const _0x36ee25=a21_0x371304;console[_0x36ee25(0x258)]('\x0a'+a21_0x2d58e5[_0x36ee25(0x1c3)](_0x36ee25(0x253))+'\x20'+_0x4b2742[_0x36ee25(0x1a9)]),console[_0x36ee25(0x258)]('═'[_0x36ee25(0x23c)](0x3c));if(_0x36bfd5['master']&&_0x4b2742[_0x36ee25(0x279)]){const _0x4d0c2d=a21_0x2d58e5[_0x36ee25(0x24e)](_0x36ee25(0x227))+'\x20'+a21_0x2d58e5[_0x36ee25(0x1c3)](_0x4b2742[_0x36ee25(0x267)]['database']+'.'+_0x4b2742['master'][_0x36ee25(0x1b0)]);await this[_0x36ee25(0x1f4)](_0x4d0c2d,_0x4b2742[_0x36ee25(0x279)]);}else{if(_0x36bfd5['attribute']&&_0x4b2742['sampleData']){const _0x351451=a21_0x2d58e5[_0x36ee25(0x24e)]('Attribute:')+'\x20'+a21_0x2d58e5[_0x36ee25(0x1c3)](_0x36bfd5[_0x36ee25(0x19f)]);await this[_0x36ee25(0x1f4)](_0x351451,_0x4b2742[_0x36ee25(0x279)]);}else{if(_0x36bfd5[_0x36ee25(0x1f6)]&&_0x4b2742[_0x36ee25(0x279)]){const _0x46618d=a21_0x2d58e5[_0x36ee25(0x24e)]('Behavior:')+'\x20'+a21_0x2d58e5['bold'](_0x36bfd5[_0x36ee25(0x1f6)]);await this['displaySampleData'](_0x46618d,_0x4b2742['sampleData']);}else{if(_0x36bfd5[_0x36ee25(0x1ad)]&&_0x4b2742[_0x36ee25(0x279)]){const _0x4b5527=a21_0x2d58e5[_0x36ee25(0x24e)]('Enriched:')+'\x20'+a21_0x2d58e5['bold'](_0x36ee25(0x26a));await this[_0x36ee25(0x1f4)](_0x4b5527,_0x4b2742['sampleData']);}else!_0x4b2742['sampleData']&&console[_0x36ee25(0x258)](_0x36ee25(0x205));}}}if(_0x4b2742[_0x36ee25(0x266)][_0x36ee25(0x224)]>0x0){console[_0x36ee25(0x258)]('─'[_0x36ee25(0x23c)](0x3c)),console['error']('\x0a'+a21_0x2d58e5[_0x36ee25(0x21b)](_0x36ee25(0x1f8)));for(const _0x654e95 of _0x4b2742[_0x36ee25(0x266)]){console[_0x36ee25(0x258)]('\x20\x20'+a21_0x2d58e5['red']('•')+'\x20'+_0x654e95);}}}async['displaySampleData'](_0x216a6c,_0x2418ce){const _0x3aae3a=a21_0x371304;if(_0x2418ce[_0x3aae3a(0x224)]===0x0){console['error']('\x0a'+_0x216a6c),console[_0x3aae3a(0x258)](_0x3aae3a(0x1bd));return;}console[_0x3aae3a(0x258)]('\x0a'+_0x216a6c);const _0x5296d6=Object['keys'](_0x2418ce[0x0])[_0x3aae3a(0x240)](_0x19e407=>({'name':_0x19e407,'type':typeof _0x2418ce[0x0][_0x19e407]===_0x3aae3a(0x1ba)?_0x3aae3a(0x183):_0x3aae3a(0x1ac)})),_0x2e2c94={'queryId':_0x3aae3a(0x15e),'columns':_0x5296d6,'data':_0x2418ce,'stats':{'state':_0x3aae3a(0x181),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2418ce['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0xcf56ee=formatAsTable(_0x2e2c94,_0x2418ce[_0x3aae3a(0x224)],!![]);await writeOutput(_0xcf56ee,undefined,_0x3aae3a(0x1b0));}}function a21_0x4582(_0x4dec3d,_0x121657){_0x4dec3d=_0x4dec3d-0x150;const _0x5c7b91=a21_0x5c7b();let _0x45826a=_0x5c7b91[_0x4dec3d];return _0x45826a;}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a21_0x371304(0x1a9)]=a21_0x371304(0x1e1);['description']='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a21_0x371304(0x228)](_0x13007c){const _0xa9c70=a21_0x371304,{options:_0x5c2a76,args:_0x2847af,tdx:_0x573b82}=_0x13007c,_0x466114=_0x5c2a76,_0x37db41=_0x2847af[0x0]||_0x5c2a76[_0xa9c70(0x26d)];if(!_0x37db41)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x26652d=resolveYamlFile(_0x37db41);if(existsSync(_0x26652d)){_0x466114[_0xa9c70(0x16f)]&&console[_0xa9c70(0x258)](_0xa9c70(0x186)+_0x26652d);let _0x29d768;try{_0x29d768=readFileSync(_0x26652d,'utf-8');}catch(_0x49a268){const _0x7fe329=_0x49a268 instanceof Error?_0x49a268[_0xa9c70(0x17a)]:String(_0x49a268);return console[_0xa9c70(0x258)](_0xa9c70(0x271)+_0x7fe329),0x1;}const _0x55e5f0=await withSpinner(_0xa9c70(0x259),()=>_0x573b82[_0xa9c70(0x18c)][_0xa9c70(0x20c)](_0x29d768),{'verbose':_0x466114['verbose']}),_0x5ba7a2=_0x55e5f0['data'],{isNew:_0x2d1051,name:_0x5a3180,hasChanges:_0x2f91d7,diffFormatted:_0x360f63}=_0x5ba7a2;if(_0x2f91d7){_0x2d1051?console[_0xa9c70(0x258)](_0xa9c70(0x1f9)+_0x5a3180+'\x27:'):console['error'](_0xa9c70(0x1f1)+_0x5a3180+'\x27:');console[_0xa9c70(0x258)]('─'[_0xa9c70(0x23c)](0x3c)),console[_0xa9c70(0x258)](_0x360f63),console[_0xa9c70(0x258)]('─'[_0xa9c70(0x23c)](0x3c));const _0xcb883=_0x2d1051?'Create\x20parent\x20segment\x20\x27'+_0x5a3180+_0xa9c70(0x1ed):'Apply\x20changes\x20to\x20\x27'+_0x5a3180+'\x27\x20and\x20run\x20workflow?';if(!_0x466114[_0xa9c70(0x22e)]){const _0x147fe0=await confirmKey(_0xcb883);if(!_0x147fe0)return console[_0xa9c70(0x258)](_0xa9c70(0x1b9)),0x1;}const _0x17e9c1=_0x2d1051?_0xa9c70(0x244):'Updating';await withSpinner(_0x17e9c1+_0xa9c70(0x230)+_0x5a3180+_0xa9c70(0x269),()=>_0x5ba7a2[_0xa9c70(0x1c7)](),{'verbose':_0x466114['verbose']});const _0x58d9ff=_0x2d1051?_0xa9c70(0x1db):_0xa9c70(0x273);console[_0xa9c70(0x258)]('✔\x20'+_0x58d9ff+_0xa9c70(0x230)+_0x5a3180+'\x27');}else console['error'](_0xa9c70(0x27d)+_0x5a3180+_0xa9c70(0x171));}const _0x374a71=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x37db41+_0xa9c70(0x269),()=>_0x573b82[_0xa9c70(0x18c)][_0xa9c70(0x22f)](_0x37db41),{'verbose':_0x466114[_0xa9c70(0x16f)]}),_0x5a70c4=_0x374a71['data'],_0x2288c7=getConsoleUrl(_0x466114['site'],_0xa9c70(0x242)+_0x5a70c4[_0xa9c70(0x161)]+_0xa9c70(0x16e)+_0x5a70c4[_0xa9c70(0x1d8)]+_0xa9c70(0x1e9)+_0x5a70c4[_0xa9c70(0x152)]);return console[_0xa9c70(0x258)](_0xa9c70(0x1de)),console[_0xa9c70(0x258)]('\x20\x20'+a21_0x2d58e5[_0xa9c70(0x24e)]('Audience\x20ID:')+'\x20'+_0x5a70c4[_0xa9c70(0x178)]),console[_0xa9c70(0x258)]('\x20\x20'+a21_0x2d58e5['dim'](_0xa9c70(0x198))+'\x20'+_0x5a70c4['status']),console[_0xa9c70(0x258)]('\x20\x20'+a21_0x2d58e5['dim'](_0xa9c70(0x17d))+'\x20'+_0x5a70c4[_0xa9c70(0x1d8)]),console[_0xa9c70(0x258)]('\x20\x20'+a21_0x2d58e5[_0xa9c70(0x24e)](_0xa9c70(0x216))+'\x20'+_0x5a70c4[_0xa9c70(0x152)]),console[_0xa9c70(0x258)]('\x20\x20'+_0x2288c7),console[_0xa9c70(0x258)]('\x0a'+a21_0x2d58e5[_0xa9c70(0x24e)](_0xa9c70(0x220))+_0xa9c70(0x23a)+_0x5a70c4[_0xa9c70(0x152)]+_0xa9c70(0x207)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a21_0x371304(0x1a9)]=a21_0x371304(0x1f2);['description']=a21_0x371304(0x1b1);async['execute'](_0x434c76){const _0x5de899=a21_0x371304,{options:_0x43a420,args:_0x1f02ba,tdx:_0x46ab64}=_0x434c76,_0x3adf19=_0x1f02ba[0x0]||_0x43a420[_0x5de899(0x26d)];if(!_0x3adf19)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'+_0x5de899(0x1fc)),0x1;_0x43a420['verbose']&&(console[_0x5de899(0x258)]('Site:\x20'+_0x43a420[_0x5de899(0x1a4)]),console[_0x5de899(0x258)]('Parent\x20segment:\x20'+_0x3adf19));const _0x3462e2=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x3adf19+_0x5de899(0x269),()=>_0x46ab64['segment'][_0x5de899(0x249)](_0x3adf19),{'verbose':_0x43a420['verbose']}),_0x48ad4f=_0x3462e2[_0x5de899(0x1e3)];console['error'](_0x5de899(0x1fd)+_0x48ad4f[_0x5de899(0x224)]+_0x5de899(0x1e4)+(_0x48ad4f['length']!==0x1?'s':''));if(_0x43a420[_0x5de899(0x1ae)]||_0x43a420['jsonl'])return await handleSDKOutput(_0x48ad4f,_0x43a420),0x0;return displayFieldsHumanReadable(_0x48ad4f,_0x3adf19),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a21_0x371304(0x1a9)]='segment:parent:view';[a21_0x371304(0x243)]=a21_0x371304(0x226);async[a21_0x371304(0x228)](_0x5bf4de){const _0x2fe3aa=a21_0x371304,{options:_0x1cae7b,args:_0x3e7ce2,tdx:_0x3e6600}=_0x5bf4de,_0x85de66=_0x1cae7b,_0xb36682=_0x3e7ce2[0x0]||_0x1cae7b[_0x2fe3aa(0x26d)];if(!_0xb36682)return showParentSegmentNotSetError(_0x2fe3aa(0x23e)+_0x2fe3aa(0x1b3)+_0x2fe3aa(0x18b)+_0x2fe3aa(0x180)),0x1;_0x1cae7b[_0x2fe3aa(0x16f)]&&(console['error'](_0x2fe3aa(0x20b)+_0x1cae7b[_0x2fe3aa(0x1a4)]),console[_0x2fe3aa(0x258)](_0x2fe3aa(0x27b)+_0xb36682));const _0xf89353=await withSpinner(_0x2fe3aa(0x1eb)+_0xb36682+_0x2fe3aa(0x269),()=>_0x3e6600[_0x2fe3aa(0x18c)][_0x2fe3aa(0x1a1)](_0xb36682),{'verbose':_0x1cae7b[_0x2fe3aa(0x16f)]}),_0x4c1ef0=_0xf89353[_0x2fe3aa(0x1e3)];if(_0x85de66[_0x2fe3aa(0x21f)]){const _0x2b5caf=getConsoleNextUrl(_0x85de66[_0x2fe3aa(0x1a4)],_0x2fe3aa(0x1df)+_0x4c1ef0['id']);return console['error'](a21_0x2d58e5[_0x2fe3aa(0x19d)]('✔')+_0x2fe3aa(0x1be)+a21_0x2d58e5[_0x2fe3aa(0x278)](_0x2b5caf)),openBrowser(_0x2b5caf),0x0;}return await handleSingleObjectOutput(_0x4c1ef0,_0x1cae7b),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a21_0x371304(0x1a9)]=a21_0x371304(0x211);[a21_0x371304(0x243)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a21_0x371304(0x228)](_0x22c2d5){const _0x36a419=a21_0x371304,{options:_0x3f603a,args:_0x506fec,tdx:_0x7c7e1a}=_0x22c2d5,_0x4f5b92=_0x506fec[0x0]||_0x3f603a['parentSegment'];if(!_0x4f5b92)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment'),0x1;_0x3f603a['verbose']&&(console[_0x36a419(0x258)]('Site:\x20'+_0x3f603a[_0x36a419(0x1a4)]),console[_0x36a419(0x258)](_0x36a419(0x27b)+_0x4f5b92));const _0x72030d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4f5b92+_0x36a419(0x269),()=>_0x7c7e1a[_0x36a419(0x18c)][_0x36a419(0x202)](_0x4f5b92),{'verbose':_0x3f603a['verbose']}),_0x426946=_0x72030d[_0x36a419(0x1e3)],_0x225b4b=await withSpinner(_0x36a419(0x20d)+_0x4f5b92+'\x27...',()=>_0x7c7e1a['segment'][_0x36a419(0x1fb)](_0x426946),{'verbose':_0x3f603a[_0x36a419(0x16f)]}),_0x5d6e83=await executeSchemaQuery(_0x225b4b[_0x36a419(0x1e3)],_0x7c7e1a,_0x3f603a);return await handleQueryOutput(_0x5d6e83,_0x3f603a),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a21_0x371304(0x1a9)]='segment:parent:sql';[a21_0x371304(0x243)]=a21_0x371304(0x257);async[a21_0x371304(0x228)](_0x5c7506){const _0x25f622=a21_0x371304,{options:_0x2fea23,args:_0x5897b0,tdx:_0x3f67d7}=_0x5c7506,_0x524b12=_0x5897b0[0x0]||_0x2fea23[_0x25f622(0x26d)];if(!_0x524b12)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'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x2fea23['verbose']&&(console[_0x25f622(0x258)](_0x25f622(0x20b)+_0x2fea23['site']),console[_0x25f622(0x258)]('Parent\x20segment:\x20'+_0x524b12));const _0x3e84f2=await withSpinner(_0x25f622(0x18a)+_0x524b12+_0x25f622(0x269),()=>_0x3f67d7[_0x25f622(0x18c)]['resolveParentId'](_0x524b12),{'verbose':_0x2fea23[_0x25f622(0x16f)]}),_0x30a1d1=_0x3e84f2[_0x25f622(0x1e3)],_0x248e96=await withSpinner(_0x25f622(0x20d)+_0x524b12+_0x25f622(0x269),()=>_0x3f67d7[_0x25f622(0x18c)][_0x25f622(0x1fb)](_0x30a1d1),{'verbose':_0x2fea23[_0x25f622(0x16f)]}),_0x4de167=_0x248e96['data'];return _0x2fea23['format']===_0x25f622(0x1ae)||_0x2fea23[_0x25f622(0x1da)]===_0x25f622(0x173)?await handleSDKOutput([{'sql':_0x4de167}],_0x2fea23):console[_0x25f622(0x1ef)](_0x4de167),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a21_0x371304(0x1a9)]='segment:parent:show';[a21_0x371304(0x243)]=a21_0x371304(0x264);async[a21_0x371304(0x228)](_0x13896d){const _0x1dc81a=a21_0x371304,{options:_0x8caf03,args:_0x4e7d04,tdx:_0xd240ac}=_0x13896d,_0x4e416b=_0x4e7d04[0x0]||_0x8caf03['parentSegment'];if(!_0x4e416b)return showParentSegmentNotSetError(_0x1dc81a(0x1ee)+_0x1dc81a(0x234)),0x1;_0x8caf03[_0x1dc81a(0x16f)]&&(console[_0x1dc81a(0x258)](_0x1dc81a(0x20b)+_0x8caf03[_0x1dc81a(0x1a4)]),console['error'](_0x1dc81a(0x27b)+_0x4e416b));const _0x50953=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4e416b+_0x1dc81a(0x269),()=>_0xd240ac['segment'][_0x1dc81a(0x202)](_0x4e416b),{'verbose':_0x8caf03[_0x1dc81a(0x16f)]}),_0x355914=_0x50953[_0x1dc81a(0x1e3)],_0x3f382b=await withSpinner(_0x1dc81a(0x20d)+_0x4e416b+_0x1dc81a(0x269),()=>_0xd240ac[_0x1dc81a(0x18c)]['getParentSQL'](_0x355914),{'verbose':_0x8caf03[_0x1dc81a(0x16f)]});let _0x444002=_0x3f382b[_0x1dc81a(0x1e3)];const _0x2ad457=resolveLimit(_0x8caf03[_0x1dc81a(0x19c)],DEFAULT_DISPLAY_LIMIT),_0x2c3814=/\bLIMIT\s+\d+/i[_0x1dc81a(0x15b)](_0x444002);!_0x2c3814&&(_0x444002=_0x444002[_0x1dc81a(0x1d7)]()[_0x1dc81a(0x1af)](/;+$/,''),_0x444002='SELECT\x20*\x20FROM\x20(\x0a'+_0x444002+_0x1dc81a(0x270)+_0x2ad457);_0x8caf03[_0x1dc81a(0x16f)]&&console[_0x1dc81a(0x258)](_0x1dc81a(0x154)+_0x444002);const _0x2396be=await withProgressSpinner(_0x1dc81a(0x182),async _0x39dc0c=>{const _0x2c4ba3=_0x1dc81a,_0x3090fc=await _0xd240ac['query'][_0x2c4ba3(0x228)](_0x444002,{'catalog':'td','schema':_0x2c4ba3(0x221),'onJobId':_0x26e504=>{const _0x368b43=_0x2c4ba3;_0x39dc0c[_0x368b43(0x1e8)](_0x26e504);}});return _0x3090fc;},{'verbose':_0x8caf03[_0x1dc81a(0x16f)]}),_0x1c502f=_0x2396be[_0x1dc81a(0x1e3)],_0x31b31f=_0x1c502f[_0x1dc81a(0x1d3)]?'\x20[Job\x20ID:\x20'+_0x1c502f[_0x1dc81a(0x1d3)]+']':'';return console[_0x1dc81a(0x258)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x1c502f[_0x1dc81a(0x162)]['processedRows'][_0x1dc81a(0x153)]()+_0x1dc81a(0x215)+(_0x1dc81a(0x1aa)+formatElapsed(_0x1c502f['stats'][_0x1dc81a(0x209)])+_0x31b31f)),await handleQueryOutput(_0x1c502f,_0x8caf03),0x0;}}
1
+ const a21_0x52fe5b=a21_0x4595;(function(_0x440ed0,_0xd95c2b){const _0x1746bc=a21_0x4595,_0x5aa4a1=_0x440ed0();while(!![]){try{const _0x2b6904=parseInt(_0x1746bc(0x1f7))/0x1+-parseInt(_0x1746bc(0x2c9))/0x2+parseInt(_0x1746bc(0x271))/0x3*(-parseInt(_0x1746bc(0x205))/0x4)+-parseInt(_0x1746bc(0x24f))/0x5+-parseInt(_0x1746bc(0x2cd))/0x6*(-parseInt(_0x1746bc(0x1ea))/0x7)+-parseInt(_0x1746bc(0x1db))/0x8*(parseInt(_0x1746bc(0x2b4))/0x9)+parseInt(_0x1746bc(0x246))/0xa;if(_0x2b6904===_0xd95c2b)break;else _0x5aa4a1['push'](_0x5aa4a1['shift']());}catch(_0x992603){_0x5aa4a1['push'](_0x5aa4a1['shift']());}}}(a21_0x4a9f,0x98f02));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a21_0x47a985 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}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a21_0x854bff from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a21_0x52fe5b(0x2c0),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x11eece){const _0x52ba8f=a21_0x52fe5b,_0x45bc08=process['platform'],_0x593970=_0x45bc08===_0x52ba8f(0x245)?_0x52ba8f(0x2c6):_0x45bc08===_0x52ba8f(0x2ec)?'start':_0x52ba8f(0x26a);spawn(_0x593970,[_0x11eece],{'detached':!![],'stdio':_0x52ba8f(0x213)})[_0x52ba8f(0x25e)]();}function migrateLegacyDirectory(){const _0x470259=a21_0x52fe5b;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x42f13b=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x42f13b[_0x470259(0x28b)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x470259(0x27e)](a21_0x854bff[_0x470259(0x1de)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x470259(0x2b0)+PARENT_SEGMENT_DIR+_0x470259(0x28e))),console[_0x470259(0x27e)](a21_0x854bff[_0x470259(0x2a1)](_0x470259(0x1ce)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x470259(0x27e)](a21_0x854bff[_0x470259(0x1de)](_0x470259(0x284)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x470259(0x27e)](a21_0x854bff[_0x470259(0x1fd)](_0x470259(0x258)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1fb4ee){const _0x435a11=_0x1fb4ee instanceof Error?_0x1fb4ee[_0x470259(0x1e6)]:String(_0x1fb4ee);return console[_0x470259(0x27e)](a21_0x854bff['red'](_0x470259(0x251)+_0x435a11+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a21_0x52fe5b(0x21c)](_0x237d91){const _0x25c9ca=a21_0x52fe5b;return migrateLegacyDirectory(),super[_0x25c9ca(0x21c)](_0x237d91);}}function resolveYamlFile(_0x28329f){const _0x40b8ac=a21_0x52fe5b;if(_0x28329f[_0x40b8ac(0x212)](_0x40b8ac(0x2e4))||_0x28329f['endsWith'](_0x40b8ac(0x25d)))return _0x28329f;return a21_0x47a985[_0x40b8ac(0x23f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x28329f)+_0x40b8ac(0x2e4));}function formatProgressMessage(_0x10cc55){const _0x94aa66=a21_0x52fe5b,_0x52dd5b=_0x10cc55['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x52dd5b){const [,_0xbc5b6d,_0x50ad44,_0x23f94e='']=_0x52dd5b;return a21_0x854bff[_0x94aa66(0x2a1)](_0xbc5b6d+':')+'\x20'+_0x50ad44+a21_0x854bff['dim'](_0x23f94e);}return a21_0x854bff['dim'](_0x10cc55);}function showFileNotFoundError(_0x399219,_0x174621){const _0x25ee3c=a21_0x52fe5b;console['error'](a21_0x854bff[_0x25ee3c(0x2da)](_0x25ee3c(0x22b)+_0x399219+'\x0a')),console['error'](a21_0x854bff['cyan'](_0x25ee3c(0x2c4)+_0x174621+'`\x20to\x20download\x20the\x20configuration\x20first'));}function showParentSegmentNotSetError(_0x565648){const _0x34c811=a21_0x52fe5b;console[_0x34c811(0x27e)](a21_0x854bff[_0x34c811(0x1de)](_0x34c811(0x273))),console['error'](_0x565648);}export class ParentSegmentListCommand extends BaseCommand{[a21_0x52fe5b(0x221)]='segment:parent:list';['description']=a21_0x52fe5b(0x1df);async[a21_0x52fe5b(0x1fa)](_0x52fa99){const _0x317863=a21_0x52fe5b,{options:_0x508930,args:_0x94812d,tdx:_0x1548c5}=_0x52fa99,_0x11e7a4=_0x94812d[0x0];_0x508930[_0x317863(0x297)]&&(console['error'](_0x317863(0x2db)+_0x508930[_0x317863(0x228)]),_0x11e7a4&&console['error'](_0x317863(0x25a)+_0x11e7a4));const _0x42eb95=await withSpinner(_0x11e7a4?_0x317863(0x1d1)+_0x11e7a4+_0x317863(0x1e3):_0x317863(0x203),()=>_0x1548c5[_0x317863(0x201)][_0x317863(0x256)](),{'verbose':_0x508930['verbose']});let _0x462de5=_0x42eb95['data'];if(_0x11e7a4){const _0x580b71=_0x11e7a4[_0x317863(0x2e8)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x317863(0x2e8)](/\*/g,'.*')[_0x317863(0x2e8)](/\?/g,'.'),_0x29c5c0=new RegExp('^'+_0x580b71+'$','i');_0x462de5=_0x462de5['filter'](_0x400c31=>_0x29c5c0[_0x317863(0x234)](_0x400c31[_0x317863(0x2d7)][_0x317863(0x221)]));}_0x462de5[_0x317863(0x208)]((_0x842dfa,_0xfda354)=>_0x842dfa[_0x317863(0x2d7)][_0x317863(0x221)][_0x317863(0x1ec)](_0xfda354[_0x317863(0x2d7)][_0x317863(0x221)])),console[_0x317863(0x27e)](_0x317863(0x242)+_0x462de5['length']+'\x20parent\x20segment'+(_0x462de5[_0x317863(0x240)]!==0x1?'s':''));const _0x4045b3=_0x522aa2=>{const _0x3e5543=_0x317863;return getConsoleNextUrl(_0x508930[_0x3e5543(0x228)],_0x3e5543(0x2d4)+_0x522aa2);};if(_0x508930[_0x317863(0x262)]===_0x317863(0x278)||_0x508930[_0x317863(0x262)]==='jsonl'){const _0x5e16c2=_0x462de5[_0x317863(0x1d4)](_0x5321b2=>({..._0x5321b2,'url':_0x4045b3(_0x5321b2['id'])}));await handleSDKOutput(_0x5e16c2,_0x508930);}else{if(_0x462de5[_0x317863(0x240)]===0x0)_0x11e7a4?console[_0x317863(0x1f3)](_0x317863(0x279)+_0x11e7a4):console[_0x317863(0x1f3)]('No\x20parent\x20segments\x20found');else for(const _0x23166e of _0x462de5){const _0x5ca0a4=_0x23166e[_0x317863(0x2d7)][_0x317863(0x2aa)]?a21_0x854bff[_0x317863(0x2a1)]('\x20('+formatRows(_0x23166e['attributes']['population'])+')'):'',_0xd31cd9=hyperlink(_0x23166e['attributes'][_0x317863(0x221)],_0x4045b3(_0x23166e['id']));console[_0x317863(0x1f3)]('👥\x20'+_0xd31cd9+_0x5ca0a4);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x290);[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x229);async[a21_0x52fe5b(0x1fa)](_0x507843){const _0x4e6e9a=a21_0x52fe5b,{options:_0x2dbca1,args:_0x5effe7,tdx:_0x9b918d}=_0x507843;console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x252)+_0x4e6e9a(0x2b6)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x38a62a=_0x2dbca1;if(_0x5effe7[_0x4e6e9a(0x240)]===0x0)return console[_0x4e6e9a(0x27e)](a21_0x854bff['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x2a5)),0x1;const _0x3cb678=_0x5effe7[0x0];if(!_0x38a62a['database']||!_0x38a62a[_0x4e6e9a(0x2a3)])return console['error']('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x2a5)),0x1;_0x38a62a[_0x4e6e9a(0x297)]&&(console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x2db)+_0x38a62a[_0x4e6e9a(0x228)]),console[_0x4e6e9a(0x27e)]('Name:\x20'+_0x3cb678),console[_0x4e6e9a(0x27e)]('Database:\x20'+_0x38a62a['database']),console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x210)+_0x38a62a['table']));const _0x50e9a3=await loadJSONFromOptions(_0x38a62a[_0x4e6e9a(0x2d7)],_0x38a62a['attributesFile']),_0x91606d=await loadJSONFromOptions(_0x38a62a[_0x4e6e9a(0x2df)],_0x38a62a[_0x4e6e9a(0x283)]),_0xbfc9fe=await loadJSONFromOptions(_0x38a62a[_0x4e6e9a(0x1e5)],_0x38a62a[_0x4e6e9a(0x243)]),_0x13636c={'name':_0x3cb678,'description':_0x38a62a['description'],'scheduleType':_0x38a62a[_0x4e6e9a(0x26f)],'scheduleOption':_0x38a62a['scheduleOption'],'timezone':_0x38a62a[_0x4e6e9a(0x2af)],'master':{'parentDatabaseName':_0x38a62a[_0x4e6e9a(0x2cf)],'parentTableName':_0x38a62a['table']},'attributes':_0x50e9a3,'behaviors':_0x91606d,'customerGroup':_0xbfc9fe},_0x334b1c=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x3cb678+_0x4e6e9a(0x1e3),()=>_0x9b918d['segment'][_0x4e6e9a(0x222)](_0x13636c),{'verbose':_0x2dbca1[_0x4e6e9a(0x297)]}),_0x34d3cd=_0x334b1c[_0x4e6e9a(0x29c)];return console[_0x4e6e9a(0x27e)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x34d3cd[_0x4e6e9a(0x221)]+_0x4e6e9a(0x25f)+_0x34d3cd['id']),await handleSDKOutput([_0x34d3cd],_0x2dbca1),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a21_0x52fe5b(0x221)]='segment:parent:update';[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x26c);async[a21_0x52fe5b(0x1fa)](_0x182424){const _0x4516aa=a21_0x52fe5b,{options:_0x45b32c,args:_0x3e7689,tdx:_0x2cbe72}=_0x182424;console[_0x4516aa(0x27e)](_0x4516aa(0x291)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x495dc9=_0x45b32c;if(_0x3e7689[_0x4516aa(0x240)]===0x0)return console[_0x4516aa(0x27e)](a21_0x854bff[_0x4516aa(0x2da)](_0x4516aa(0x2ce))),console[_0x4516aa(0x27e)](_0x4516aa(0x214)),0x1;const _0x3af2fe=_0x3e7689[0x0];_0x495dc9[_0x4516aa(0x297)]&&(console[_0x4516aa(0x27e)](_0x4516aa(0x2db)+_0x495dc9[_0x4516aa(0x228)]),console[_0x4516aa(0x27e)](_0x4516aa(0x200)+_0x3af2fe));const _0x4c9ee2=await withSpinner(_0x4516aa(0x20a)+_0x3af2fe+_0x4516aa(0x1e3),()=>_0x2cbe72[_0x4516aa(0x201)][_0x4516aa(0x1d8)](_0x3af2fe),{'verbose':_0x495dc9[_0x4516aa(0x297)]}),_0x50f4da=_0x4c9ee2[_0x4516aa(0x29c)],_0xd23497=await loadJSONFromOptions(_0x495dc9[_0x4516aa(0x216)],_0x495dc9[_0x4516aa(0x2e3)]),_0x5aa8b2=await loadJSONFromOptions(_0x495dc9[_0x4516aa(0x2bd)],_0x495dc9[_0x4516aa(0x1eb)]),_0x4dc8d9={'name':_0x50f4da['name'],'description':_0x495dc9[_0x4516aa(0x211)]!==undefined?_0x495dc9[_0x4516aa(0x211)]:_0x50f4da[_0x4516aa(0x211)],'scheduleType':_0x495dc9[_0x4516aa(0x26f)]!==undefined?_0x495dc9[_0x4516aa(0x26f)]:_0x50f4da['scheduleType'],'scheduleOption':_0x495dc9['scheduleOption']!==undefined?_0x495dc9[_0x4516aa(0x2e6)]:_0x50f4da['scheduleOption'],'timezone':_0x495dc9[_0x4516aa(0x2af)]!==undefined?_0x495dc9[_0x4516aa(0x2af)]:_0x50f4da[_0x4516aa(0x2af)],'master':_0x50f4da[_0x4516aa(0x1f6)],'attributes':_0xd23497?[..._0x50f4da['attributes']||[],..._0xd23497]:_0x50f4da['attributes'],'behaviors':_0x5aa8b2?[..._0x50f4da[_0x4516aa(0x2df)]||[],..._0x5aa8b2]:_0x50f4da[_0x4516aa(0x2df)],'customerGroup':_0x50f4da['customerGroup']},_0x325d28=await withSpinner(_0x4516aa(0x23c)+_0x3af2fe+_0x4516aa(0x1e3),()=>_0x2cbe72['segment'][_0x4516aa(0x2c8)](_0x3af2fe,_0x4dc8d9),{'verbose':_0x495dc9[_0x4516aa(0x297)]}),_0x33125e=_0x325d28['data'];return console[_0x4516aa(0x27e)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x33125e[_0x4516aa(0x221)]+'\x27'),await handleSDKOutput([_0x33125e],_0x495dc9),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x28c);['description']=a21_0x52fe5b(0x2a8);async[a21_0x52fe5b(0x1fa)](_0x302781){const _0x47d4d3=a21_0x52fe5b,{options:_0x4c2fde,args:_0x411f9e,tdx:_0x5f02dc}=_0x302781,_0x275728=_0x4c2fde,_0x59b9d2=_0x411f9e[0x0]||_0x4c2fde[_0x47d4d3(0x1e1)];if(!_0x59b9d2)return showParentSegmentNotSetError(_0x47d4d3(0x2d9)+_0x47d4d3(0x21d)),0x1;if(_0x275728[_0x47d4d3(0x270)]&&_0x275728['output'])return console['error'](a21_0x854bff[_0x47d4d3(0x2da)](_0x47d4d3(0x2b7))),console[_0x47d4d3(0x27e)](a21_0x854bff[_0x47d4d3(0x2a1)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console['error'](a21_0x854bff['dim'](_0x47d4d3(0x202)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x47d4d3(0x27e)](a21_0x854bff[_0x47d4d3(0x2c1)](_0x47d4d3(0x274))),0x1;const _0x408550=_0x275728['output']||a21_0x47a985['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x59b9d2)+_0x47d4d3(0x2e4));_0x275728['verbose']&&(console[_0x47d4d3(0x27e)]('Site:\x20'+_0x275728['site']),console['error']('Parent\x20segment:\x20'+_0x59b9d2),console[_0x47d4d3(0x27e)](_0x47d4d3(0x299)+_0x408550));const _0x36df2b=await withSpinner(_0x47d4d3(0x20f)+_0x59b9d2+_0x47d4d3(0x1e3),()=>_0x5f02dc[_0x47d4d3(0x201)][_0x47d4d3(0x26e)](_0x59b9d2),{'verbose':_0x275728[_0x47d4d3(0x297)]}),_0x3002ec=_0x36df2b[_0x47d4d3(0x29c)];if(existsSync(_0x408550)){const _0x41a3fa=readFileSync(_0x408550,_0x47d4d3(0x2bc)),_0x50233d=generateDiff(_0x41a3fa,_0x3002ec);if(!hasChanges(_0x50233d))console['error'](a21_0x854bff['green']('✔')+_0x47d4d3(0x1f5)+a21_0x854bff[_0x47d4d3(0x2c1)](_0x408550)+'\x20is\x20already\x20up\x20to\x20date');else{console['error']('\x0aChanges\x20to\x20\x27'+_0x408550+'\x27:'),console['error']('─'[_0x47d4d3(0x288)](0x3c)),console[_0x47d4d3(0x27e)](formatDiffWithColors(_0x50233d)),console['error']('─'[_0x47d4d3(0x288)](0x3c));if(!_0x275728[_0x47d4d3(0x2c3)]){const _0x523954=await confirmKey(_0x47d4d3(0x24d)+_0x408550+'\x27?');if(!_0x523954)return console[_0x47d4d3(0x27e)](_0x47d4d3(0x1f0)),0x1;}writeFileSync(_0x408550,_0x3002ec,_0x47d4d3(0x2bc)),console['error'](a21_0x854bff[_0x47d4d3(0x1fd)]('✔')+_0x47d4d3(0x2d5)+a21_0x854bff['cyan'](_0x408550));}}else{const _0x27e361=a21_0x47a985[_0x47d4d3(0x27b)](_0x408550);!existsSync(_0x27e361)&&mkdirSync(_0x27e361,{'recursive':!![]}),writeFileSync(_0x408550,_0x3002ec,'utf-8'),console[_0x47d4d3(0x27e)](a21_0x854bff[_0x47d4d3(0x1fd)]('✔')+_0x47d4d3(0x2d5)+a21_0x854bff[_0x47d4d3(0x2c1)](_0x408550));}return saveSessionContext({'parent_segment':_0x59b9d2},_0x275728[_0x47d4d3(0x227)]),console[_0x47d4d3(0x27e)](a21_0x854bff['green']('✔')+'\x20Context\x20set:\x20'+a21_0x854bff[_0x47d4d3(0x2a1)](_0x47d4d3(0x255))+_0x47d4d3(0x28f)+a21_0x854bff['cyan'](_0x59b9d2)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a21_0x52fe5b(0x1e4);[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x1dc);async[a21_0x52fe5b(0x1fa)](_0x7e2f71){const _0xb054ba=a21_0x52fe5b,{options:_0x381e19,args:_0x46eb5d,tdx:_0x4ca6a7}=_0x7e2f71,_0x270731=_0x381e19,_0x517e44=_0x46eb5d[0x0]||_0x381e19['parentSegment'];if(!_0x517e44)return showParentSegmentNotSetError(_0xb054ba(0x29e)+_0xb054ba(0x2ca)),0x1;const _0x271e75=resolveYamlFile(_0x517e44);if(!existsSync(_0x271e75))return showFileNotFoundError(_0x271e75,_0x517e44),0x1;_0x270731['verbose']&&(console[_0xb054ba(0x27e)](_0xb054ba(0x2db)+_0x270731['site']),console[_0xb054ba(0x27e)](_0xb054ba(0x225)+_0x271e75));let _0x31a676;try{_0x31a676=readFileSync(_0x271e75,_0xb054ba(0x2bc));}catch(_0x5897d1){const _0x18c11a=_0x5897d1 instanceof Error?_0x5897d1[_0xb054ba(0x1e6)]:String(_0x5897d1);return console[_0xb054ba(0x27e)]('Error\x20reading\x20file:\x20'+_0x18c11a),0x1;}const _0x266c94=await withSpinner('Analyzing\x20changes...',()=>_0x4ca6a7['segment'][_0xb054ba(0x296)](_0x31a676),{'verbose':_0x270731['verbose']}),_0x163773=_0x266c94['data'],{isNew:_0x3d71a2,name:_0x1128f6,hasChanges:_0x1b3376,diffFormatted:_0x159bc6}=_0x163773;if(!_0x1b3376)return console[_0xb054ba(0x27e)]('✔\x20No\x20changes\x20-\x20\x27'+_0x1128f6+_0xb054ba(0x2bf)),0x0;_0x3d71a2?console['error'](_0xb054ba(0x23b)+_0x1128f6+'\x27:'):console[_0xb054ba(0x27e)](_0xb054ba(0x22a)+_0x1128f6+'\x27:');console[_0xb054ba(0x27e)]('─'['repeat'](0x3c)),console[_0xb054ba(0x27e)](_0x159bc6),console['error']('─'[_0xb054ba(0x288)](0x3c));const _0x2d1dac=_0x3d71a2?_0xb054ba(0x265)+_0x1128f6+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x1128f6+'\x27?';if(!_0x270731['yes']){const _0x3dc207=await confirmKey(_0x2d1dac);if(!_0x3dc207)return console[_0xb054ba(0x27e)](_0xb054ba(0x1f0)),0x1;}const _0x711bfd=_0x3d71a2?_0xb054ba(0x287):_0xb054ba(0x1ff),_0x53bdac=await withSpinner(_0x711bfd+'\x20parent\x20segment\x20\x27'+_0x1128f6+_0xb054ba(0x1e3),()=>_0x163773[_0xb054ba(0x2cb)](),{'verbose':_0x270731[_0xb054ba(0x297)]}),_0x33ca39=_0x53bdac[_0xb054ba(0x29c)],_0x39ecf0=getConsoleNextUrl(_0x270731[_0xb054ba(0x228)],'/app/dw/parentSegments/'+_0x33ca39['id']),_0x1dd449=_0x3d71a2?_0xb054ba(0x2bb):_0xb054ba(0x207);return console[_0xb054ba(0x27e)]('✔\x20'+_0x1dd449+_0xb054ba(0x2c2)+_0x33ca39['name']+'\x27'),console['error']('\x20\x20'+_0x39ecf0),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x223);[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x233);async['execute'](_0x4acfd9){const _0x4cb219=a21_0x52fe5b,{options:_0x49790a,args:_0x4064a5,tdx:_0x2634f6}=_0x4acfd9,_0x177560=_0x49790a,_0x495bc7=_0x4064a5[0x0]||_0x49790a[_0x4cb219(0x1e1)];if(!_0x495bc7)return showParentSegmentNotSetError(_0x4cb219(0x220)+_0x4cb219(0x226)+_0x4cb219(0x20c)+_0x4cb219(0x23e)+_0x4cb219(0x21f)+_0x4cb219(0x232)),0x1;const _0x1b0141=resolveYamlFile(_0x495bc7);if(!existsSync(_0x1b0141))return showFileNotFoundError(_0x1b0141,_0x495bc7),0x1;_0x177560['verbose']&&(console[_0x4cb219(0x27e)](_0x4cb219(0x2db)+_0x177560['site']),console[_0x4cb219(0x27e)](_0x4cb219(0x225)+_0x1b0141));let _0x23fb4f;try{_0x23fb4f=readFileSync(_0x1b0141,_0x4cb219(0x2bc));}catch(_0x3914e5){const _0x190bc5=_0x3914e5 instanceof Error?_0x3914e5[_0x4cb219(0x1e6)]:String(_0x3914e5);return console[_0x4cb219(0x27e)](_0x4cb219(0x1f8)+_0x190bc5),0x1;}const _0xf39ffe=createCommandSpinner(a21_0x854bff['dim'](_0x4cb219(0x2a2)),{'verbose':_0x177560['verbose']});_0xf39ffe[_0x4cb219(0x1ee)]();const _0x1b787e={'onProgress':_0x35c151=>{_0xf39ffe['text']=formatProgressMessage(_0x35c151);}};if(_0x177560[_0x4cb219(0x1f6)])_0x1b787e[_0x4cb219(0x1f6)]=!![];if(_0x177560['enriched'])_0x1b787e[_0x4cb219(0x2e9)]=!![];_0x177560[_0x4cb219(0x27d)]&&(_0x1b787e[_0x4cb219(0x27d)]=_0x177560[_0x4cb219(0x27d)]);_0x177560['behavior']&&(_0x1b787e[_0x4cb219(0x29d)]=_0x177560[_0x4cb219(0x29d)]);if(_0x177560[_0x4cb219(0x2dc)])_0x1b787e['interval']=_0x177560[_0x4cb219(0x2dc)];let _0x9bc1ea;try{_0x9bc1ea=await _0x2634f6['segment'][_0x4cb219(0x2b2)](_0x23fb4f,_0x1b787e),_0xf39ffe[_0x4cb219(0x268)]();}catch(_0x493cd0){_0xf39ffe[_0x4cb219(0x268)]();throw _0x493cd0;}const _0x755a73=_0x177560[_0x4cb219(0x2dc)]||'-1d';return this['displayValidateResults'](_0x9bc1ea,_0x1b787e,_0x1b0141,_0x755a73),_0x9bc1ea['allValid']?0x0:0x1;}[a21_0x52fe5b(0x26d)](_0x61d64c,_0x24d223,_0x172ca2,_0x2fde0a){const _0x350574=a21_0x52fe5b;console[_0x350574(0x27e)]('\x0a'+a21_0x854bff[_0x350574(0x26b)](_0x350574(0x2f1))+'\x20'+_0x61d64c[_0x350574(0x221)]),console[_0x350574(0x27e)]('═'[_0x350574(0x288)](0x3c)),this[_0x350574(0x248)](_0x61d64c);if(typeof _0x24d223[_0x350574(0x27d)]===_0x350574(0x24b)){this[_0x350574(0x27c)](_0x61d64c),this[_0x350574(0x266)](_0x61d64c),this[_0x350574(0x215)](_0x172ca2,_0x2fde0a,'attribute',_0x24d223['attribute']);return;}if(_0x24d223[_0x350574(0x27d)]===!![]){this['displayAttributesStats'](_0x61d64c),this['displaySummary'](_0x61d64c),this[_0x350574(0x215)](_0x172ca2,_0x2fde0a,_0x350574(0x2d7));return;}if(typeof _0x24d223[_0x350574(0x29d)]===_0x350574(0x24b)){this['displayBehaviorsStats'](_0x61d64c,_0x2fde0a),this[_0x350574(0x266)](_0x61d64c),this[_0x350574(0x215)](_0x172ca2,_0x2fde0a,_0x350574(0x29d),_0x24d223[_0x350574(0x29d)]);return;}if(_0x24d223['behavior']===!![]){this[_0x350574(0x235)](_0x61d64c,_0x2fde0a),this[_0x350574(0x266)](_0x61d64c),this['displayPreviewHints'](_0x172ca2,_0x2fde0a,'behaviors');return;}this[_0x350574(0x27c)](_0x61d64c),this[_0x350574(0x235)](_0x61d64c,_0x2fde0a),this[_0x350574(0x266)](_0x61d64c),this[_0x350574(0x215)](_0x172ca2,_0x2fde0a,_0x350574(0x276));}['displayPreviewHints'](_0x3b8c54,_0x28b698,_0x1c31b6,_0x186f6f){const _0x28a5cf=a21_0x52fe5b;console[_0x28a5cf(0x27e)]('\x0a'+a21_0x854bff['dim'](_0x28a5cf(0x241)));const _0x58a1ad=_0x28b698!==_0x28a5cf(0x2de)?_0x28a5cf(0x219)+_0x28b698:'';if(_0x1c31b6==='attribute'&&_0x186f6f)console['error']('\x20\x20'+a21_0x854bff['dim'](_0x28a5cf(0x2a4)+_0x3b8c54+_0x28a5cf(0x1e0)+_0x186f6f+'\x22'+_0x58a1ad));else{if(_0x1c31b6==='behavior'&&_0x186f6f)console[_0x28a5cf(0x27e)]('\x20\x20'+a21_0x854bff[_0x28a5cf(0x2a1)](_0x28a5cf(0x2a4)+_0x3b8c54+_0x28a5cf(0x231)+_0x186f6f+'\x22'+_0x58a1ad));else(_0x1c31b6===_0x28a5cf(0x2d7)||_0x1c31b6===_0x28a5cf(0x276))&&console[_0x28a5cf(0x27e)]('\x20\x20'+a21_0x854bff[_0x28a5cf(0x2a1)](_0x28a5cf(0x2a4)+_0x3b8c54+_0x28a5cf(0x1fc)+_0x58a1ad));}(_0x1c31b6===_0x28a5cf(0x2df)||_0x1c31b6==='all')&&console['error']('\x20\x20'+a21_0x854bff[_0x28a5cf(0x2a1)]('tdx\x20segment\x20parent\x20preview\x20'+_0x3b8c54+'\x20--behavior\x20\x22<name>\x22'+_0x58a1ad)),_0x1c31b6===_0x28a5cf(0x276)&&console[_0x28a5cf(0x27e)]('\x20\x20'+a21_0x854bff[_0x28a5cf(0x2a1)](_0x28a5cf(0x2a4)+_0x3b8c54+_0x28a5cf(0x224)+_0x58a1ad));}[a21_0x52fe5b(0x248)](_0x418a90){const _0x125413=a21_0x52fe5b,{master:_0xe04aa5}=_0x418a90,_0x586569=_0xe04aa5['schemaValid']?a21_0x854bff[_0x125413(0x1fd)]('✔'):a21_0x854bff[_0x125413(0x2da)]('✘');console[_0x125413(0x27e)]('\x0a'+a21_0x854bff[_0x125413(0x2a1)](_0x125413(0x21e))),console['error'](_0x586569+'\x20'+a21_0x854bff[_0x125413(0x26b)](_0xe04aa5['database']+'.'+_0xe04aa5[_0x125413(0x2a3)])),_0xe04aa5['schemaValid']?_0xe04aa5[_0x125413(0x2ee)]!==undefined&&console[_0x125413(0x27e)]('\x20\x20'+a21_0x854bff[_0x125413(0x2a1)](_0x125413(0x2ef))+'\x20'+a21_0x854bff[_0x125413(0x2c1)](formatRows(_0xe04aa5[_0x125413(0x2ee)]))):console[_0x125413(0x27e)]('\x20\x20'+a21_0x854bff[_0x125413(0x2da)](_0x125413(0x264))+'\x20'+_0xe04aa5['schemaError']);}[a21_0x52fe5b(0x27c)](_0x11ce9c){const _0x3f3c16=a21_0x52fe5b;if(_0x11ce9c[_0x3f3c16(0x2d7)][_0x3f3c16(0x240)]===0x0)return;console[_0x3f3c16(0x27e)]('\x0a'+a21_0x854bff[_0x3f3c16(0x2a1)](_0x3f3c16(0x2f2)));for(const _0x3eb07c of _0x11ce9c['attributes']){const _0x4de414=_0x3eb07c[_0x3f3c16(0x2b8)]?a21_0x854bff['green']('✔'):a21_0x854bff[_0x3f3c16(0x2da)]('✘');let _0x12d29f='';if(_0x3eb07c[_0x3f3c16(0x2b8)]&&_0x3eb07c[_0x3f3c16(0x1f1)]!==undefined&&_0x3eb07c[_0x3f3c16(0x261)]!==undefined){const _0xe8a6a6=_0x3eb07c[_0x3f3c16(0x261)][_0x3f3c16(0x236)](0x1),_0x3d60cb=_0x3eb07c[_0x3f3c16(0x261)]>=0x50?a21_0x854bff[_0x3f3c16(0x1fd)]:_0x3eb07c['coveragePercent']>=0x32?a21_0x854bff[_0x3f3c16(0x1de)]:a21_0x854bff['red'];_0x12d29f='\x20'+a21_0x854bff[_0x3f3c16(0x2a1)]('Coverage:')+'\x20'+_0x3d60cb(_0xe8a6a6+'%')+'\x20('+formatRows(_0x3eb07c['matchedCount'])+_0x3f3c16(0x25c);}console[_0x3f3c16(0x27e)](_0x4de414+'\x20'+a21_0x854bff[_0x3f3c16(0x26b)](_0x3eb07c[_0x3f3c16(0x221)])+_0x12d29f),console[_0x3f3c16(0x27e)]('\x20\x20'+a21_0x854bff[_0x3f3c16(0x2a1)]('Source:')+'\x20'+a21_0x854bff[_0x3f3c16(0x26b)](_0x3eb07c[_0x3f3c16(0x2cf)]+'.'+_0x3eb07c[_0x3f3c16(0x2a3)]));const _0x5c1f91=_0x3eb07c['joinKey']===_0x3eb07c[_0x3f3c16(0x1d5)]?a21_0x854bff[_0x3f3c16(0x2a1)](_0x3f3c16(0x2a0))+'\x20'+_0x3eb07c[_0x3f3c16(0x2d8)]:a21_0x854bff[_0x3f3c16(0x2a1)]('Join:')+'\x20'+_0x3eb07c[_0x3f3c16(0x2d8)]+_0x3f3c16(0x28f)+_0x3eb07c['foreignKey'];console[_0x3f3c16(0x27e)]('\x20\x20'+_0x5c1f91),console['error']('\x20\x20'+a21_0x854bff['dim'](_0x3f3c16(0x1d3))),this['displayColumns'](_0x3eb07c[_0x3f3c16(0x2b1)]),!_0x3eb07c[_0x3f3c16(0x2b8)]&&console[_0x3f3c16(0x27e)]('\x20\x20'+a21_0x854bff[_0x3f3c16(0x2da)](_0x3f3c16(0x264))+'\x20'+_0x3eb07c['schemaError']);}}[a21_0x52fe5b(0x235)](_0x54d7c3,_0x3918bf){const _0x3ae84b=a21_0x52fe5b;if(_0x54d7c3['behaviors']['length']===0x0)return;console[_0x3ae84b(0x27e)]('\x0a'+a21_0x854bff[_0x3ae84b(0x2a1)]('Behaviors')+'\x20'+a21_0x854bff[_0x3ae84b(0x2a1)]('('+_0x3918bf+')'));for(const _0x49f96e of _0x54d7c3[_0x3ae84b(0x2df)]){const _0x293478=_0x49f96e[_0x3ae84b(0x2b8)]?a21_0x854bff[_0x3ae84b(0x1fd)]('✔'):a21_0x854bff[_0x3ae84b(0x2da)]('✘');let _0x2d05ba='';if(_0x49f96e[_0x3ae84b(0x2b8)]&&_0x49f96e['customersWithEvents']!==undefined&&_0x49f96e[_0x3ae84b(0x2e5)]!==undefined){const _0x17b0bb=_0x49f96e['customerPercent']?.[_0x3ae84b(0x236)](0x1)||'?',_0x264027=(_0x49f96e[_0x3ae84b(0x272)]??0x0)>=0x32?a21_0x854bff[_0x3ae84b(0x1fd)]:(_0x49f96e[_0x3ae84b(0x272)]??0x0)>=0x14?a21_0x854bff[_0x3ae84b(0x1de)]:a21_0x854bff['red'];_0x2d05ba='\x20'+a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x2e1))+'\x20'+_0x264027(formatRows(_0x49f96e[_0x3ae84b(0x23d)]))+'\x20('+_0x17b0bb+'%)\x20'+a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x24e))+'\x20'+a21_0x854bff[_0x3ae84b(0x2c1)](formatRows(_0x49f96e[_0x3ae84b(0x2e5)]));}console['error'](_0x293478+'\x20'+a21_0x854bff[_0x3ae84b(0x26b)](_0x49f96e[_0x3ae84b(0x221)])+_0x2d05ba),console[_0x3ae84b(0x27e)]('\x20\x20'+a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x267))+'\x20'+a21_0x854bff[_0x3ae84b(0x26b)](_0x49f96e[_0x3ae84b(0x2cf)]+'.'+_0x49f96e[_0x3ae84b(0x2a3)]));const _0x21058a=_0x49f96e['joinKey']===_0x49f96e[_0x3ae84b(0x1d5)]?a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x2a0))+'\x20'+_0x49f96e['joinKey']:a21_0x854bff['dim'](_0x3ae84b(0x29f))+'\x20'+_0x49f96e[_0x3ae84b(0x2d8)]+_0x3ae84b(0x28f)+_0x49f96e[_0x3ae84b(0x1d5)];console['error']('\x20\x20'+_0x21058a),console[_0x3ae84b(0x27e)]('\x20\x20'+a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x1d3))),this[_0x3ae84b(0x239)](_0x49f96e[_0x3ae84b(0x2b1)]),!_0x49f96e[_0x3ae84b(0x2b8)]&&console[_0x3ae84b(0x27e)]('\x20\x20'+a21_0x854bff[_0x3ae84b(0x2da)]('Error:')+'\x20'+_0x49f96e['schemaError']);}}['displayColumns'](_0x3d0a6e){const _0x26ae2a=a21_0x52fe5b;for(const _0x3a3df4 of _0x3d0a6e){_0x3a3df4[_0x26ae2a(0x2be)]===_0x3a3df4[_0x26ae2a(0x1d6)]||_0x3a3df4['column']==='*'?console[_0x26ae2a(0x27e)](_0x26ae2a(0x230)+_0x3a3df4[_0x26ae2a(0x2be)]):console['error'](_0x26ae2a(0x230)+_0x3a3df4[_0x26ae2a(0x2be)]+'\x20'+a21_0x854bff[_0x26ae2a(0x2a1)]('('+_0x3a3df4[_0x26ae2a(0x1d6)]+')'));}}[a21_0x52fe5b(0x266)](_0x3706e2){const _0x3b0ffb=a21_0x52fe5b;console['error']('─'[_0x3b0ffb(0x288)](0x3c));if(_0x3706e2[_0x3b0ffb(0x24a)][_0x3b0ffb(0x240)]>0x0){console[_0x3b0ffb(0x27e)]('\x0a'+a21_0x854bff[_0x3b0ffb(0x2da)](_0x3b0ffb(0x2c5)));for(const _0x3b8db5 of _0x3706e2[_0x3b0ffb(0x24a)]){console['error']('\x20\x20'+a21_0x854bff[_0x3b0ffb(0x2da)]('•')+'\x20'+_0x3b8db5);}}_0x3706e2[_0x3b0ffb(0x238)]&&console[_0x3b0ffb(0x27e)]('\x0a'+a21_0x854bff[_0x3b0ffb(0x1fd)]('✔')+_0x3b0ffb(0x217));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x275);[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x1d0);async['execute'](_0x3fc93c){const _0x438f62=a21_0x52fe5b,{options:_0x1aab97,args:_0x2bf2c4,tdx:_0x1abaae}=_0x3fc93c,_0x5d01bc=_0x1aab97,_0x2ae92c=_0x2bf2c4[0x0]||_0x1aab97[_0x438f62(0x1e1)];if(!_0x2ae92c)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'+_0x438f62(0x1fb)+_0x438f62(0x28d)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x438f62(0x20b)+_0x438f62(0x1f4)+_0x438f62(0x232)),0x1;if(!_0x5d01bc[_0x438f62(0x1f6)]&&!_0x5d01bc[_0x438f62(0x27d)]&&!_0x5d01bc['behavior']&&!_0x5d01bc[_0x438f62(0x2e9)])return console[_0x438f62(0x27e)](a21_0x854bff[_0x438f62(0x2da)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x438f62(0x27e)](_0x438f62(0x247)),console[_0x438f62(0x27e)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x438f62(0x27e)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x438f62(0x27e)](_0x438f62(0x263)),console['error'](_0x438f62(0x2a7)),0x1;const _0x35288d=resolveYamlFile(_0x2ae92c);if(!existsSync(_0x35288d))return showFileNotFoundError(_0x35288d,_0x2ae92c),0x1;_0x5d01bc[_0x438f62(0x297)]&&(console[_0x438f62(0x27e)]('Site:\x20'+_0x5d01bc['site']),console['error'](_0x438f62(0x225)+_0x35288d));let _0x359ec2;try{_0x359ec2=readFileSync(_0x35288d,_0x438f62(0x2bc));}catch(_0x2512ad){const _0x26a55e=_0x2512ad instanceof Error?_0x2512ad['message']:String(_0x2512ad);return console[_0x438f62(0x27e)](_0x438f62(0x1f8)+_0x26a55e),0x1;}let _0x1f55e2;try{_0x1f55e2=parseDef(_0x359ec2);}catch(_0x3524cc){const _0xd3f164=_0x3524cc instanceof Error?_0x3524cc[_0x438f62(0x1e6)]:String(_0x3524cc);return console[_0x438f62(0x27e)](a21_0x854bff['red'](_0x438f62(0x2d1)+_0xd3f164)),0x1;}if(_0x5d01bc[_0x438f62(0x27d)]===!![]||_0x5d01bc[_0x438f62(0x27d)]===''){const _0x3aaa29=_0x1f55e2[_0x438f62(0x2d7)]?.['map'](_0x3e77bb=>_0x3e77bb['name'])||[];if(_0x3aaa29[_0x438f62(0x240)]===0x0)console[_0x438f62(0x27e)](a21_0x854bff[_0x438f62(0x2da)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x438f62(0x27e)](a21_0x854bff['red']('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x438f62(0x27e)](_0x438f62(0x2ea));for(const _0x8297ad of _0x3aaa29){console[_0x438f62(0x27e)]('\x20\x20'+a21_0x854bff[_0x438f62(0x2c1)](_0x8297ad));}console[_0x438f62(0x27e)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x2ae92c+_0x438f62(0x1e0)+_0x3aaa29[0x0]+'\x22');}return 0x1;}if(_0x5d01bc[_0x438f62(0x29d)]===!![]||_0x5d01bc[_0x438f62(0x29d)]===''){const _0x10a9ee=_0x1f55e2[_0x438f62(0x2df)]?.['map'](_0x4c9ebf=>_0x4c9ebf['name'])||[];if(_0x10a9ee[_0x438f62(0x240)]===0x0)console['error'](a21_0x854bff[_0x438f62(0x2da)](_0x438f62(0x282)));else{console[_0x438f62(0x27e)](a21_0x854bff[_0x438f62(0x2da)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console['error'](_0x438f62(0x298));for(const _0x32d82c of _0x10a9ee){console[_0x438f62(0x27e)]('\x20\x20'+a21_0x854bff[_0x438f62(0x2c1)](_0x32d82c));}console[_0x438f62(0x27e)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x2ae92c+_0x438f62(0x231)+_0x10a9ee[0x0]+'\x22');}return 0x1;}const _0x254857=createCommandSpinner(a21_0x854bff[_0x438f62(0x2a1)](_0x438f62(0x204)),{'verbose':_0x5d01bc[_0x438f62(0x297)]});_0x254857[_0x438f62(0x1ee)]();const _0x33cf31={'onProgress':_0x13fec1=>{const _0x13e790=_0x438f62;_0x254857[_0x13e790(0x24c)]=formatProgressMessage(_0x13fec1);}};if(_0x5d01bc[_0x438f62(0x1f6)])_0x33cf31['master']=!![];if(_0x5d01bc[_0x438f62(0x27d)]&&typeof _0x5d01bc[_0x438f62(0x27d)]==='string')_0x33cf31[_0x438f62(0x27d)]=_0x5d01bc[_0x438f62(0x27d)];if(_0x5d01bc['behavior']&&typeof _0x5d01bc[_0x438f62(0x29d)]===_0x438f62(0x24b))_0x33cf31[_0x438f62(0x29d)]=_0x5d01bc['behavior'];if(_0x5d01bc['enriched'])_0x33cf31[_0x438f62(0x2e9)]=!![];if(_0x5d01bc['interval'])_0x33cf31['interval']=_0x5d01bc[_0x438f62(0x2dc)];let _0x839d97;try{_0x839d97=await _0x1abaae[_0x438f62(0x201)][_0x438f62(0x294)](_0x359ec2,_0x33cf31),_0x254857[_0x438f62(0x268)]();}catch(_0x43bedf){_0x254857['stop']();throw _0x43bedf;}return await this[_0x438f62(0x2dd)](_0x839d97,{'master':_0x5d01bc[_0x438f62(0x1f6)],'attribute':typeof _0x5d01bc['attribute']==='string'?_0x5d01bc[_0x438f62(0x27d)]:undefined,'behavior':typeof _0x5d01bc['behavior']===_0x438f62(0x24b)?_0x5d01bc['behavior']:undefined,'enriched':_0x5d01bc[_0x438f62(0x2e9)]}),_0x839d97['allValid']?0x0:0x1;}async['displayPreviewResults'](_0x2c18ce,_0x3c4be9){const _0x565165=a21_0x52fe5b;console[_0x565165(0x27e)]('\x0a'+a21_0x854bff[_0x565165(0x26b)](_0x565165(0x281))+'\x20'+_0x2c18ce[_0x565165(0x221)]),console['error']('═'['repeat'](0x3c));if(_0x3c4be9[_0x565165(0x1f6)]&&_0x2c18ce[_0x565165(0x2ac)]){const _0x1f3063=a21_0x854bff[_0x565165(0x2a1)](_0x565165(0x2d3))+'\x20'+a21_0x854bff[_0x565165(0x26b)](_0x2c18ce[_0x565165(0x1f6)][_0x565165(0x2cf)]+'.'+_0x2c18ce[_0x565165(0x1f6)]['table']);await this[_0x565165(0x2ed)](_0x1f3063,_0x2c18ce[_0x565165(0x2ac)]);}else{if(_0x3c4be9[_0x565165(0x27d)]&&_0x2c18ce[_0x565165(0x2ac)]){const _0x3cc4a1=a21_0x854bff['dim'](_0x565165(0x20e))+'\x20'+a21_0x854bff[_0x565165(0x26b)](_0x3c4be9[_0x565165(0x27d)]);await this[_0x565165(0x2ed)](_0x3cc4a1,_0x2c18ce[_0x565165(0x2ac)]);}else{if(_0x3c4be9[_0x565165(0x29d)]&&_0x2c18ce[_0x565165(0x2ac)]){const _0x3e0e33=a21_0x854bff[_0x565165(0x2a1)]('Behavior:')+'\x20'+a21_0x854bff['bold'](_0x3c4be9[_0x565165(0x29d)]);await this[_0x565165(0x2ed)](_0x3e0e33,_0x2c18ce[_0x565165(0x2ac)]);}else{if(_0x3c4be9[_0x565165(0x2e9)]&&_0x2c18ce['sampleData']){const _0x442237=a21_0x854bff[_0x565165(0x2a1)]('Enriched:')+'\x20'+a21_0x854bff[_0x565165(0x26b)]('Master\x20+\x20Attributes');await this['displaySampleData'](_0x442237,_0x2c18ce[_0x565165(0x2ac)]);}else!_0x2c18ce[_0x565165(0x2ac)]&&console[_0x565165(0x27e)](_0x565165(0x1e2));}}}if(_0x2c18ce[_0x565165(0x24a)][_0x565165(0x240)]>0x0){console[_0x565165(0x27e)]('─'[_0x565165(0x288)](0x3c)),console[_0x565165(0x27e)]('\x0a'+a21_0x854bff[_0x565165(0x2da)]('Errors:'));for(const _0x358195 of _0x2c18ce['errors']){console[_0x565165(0x27e)]('\x20\x20'+a21_0x854bff['red']('•')+'\x20'+_0x358195);}}}async[a21_0x52fe5b(0x2ed)](_0x47b755,_0x444432){const _0x49a291=a21_0x52fe5b;if(_0x444432[_0x49a291(0x240)]===0x0){console[_0x49a291(0x27e)]('\x0a'+_0x47b755),console[_0x49a291(0x27e)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x49a291(0x27e)]('\x0a'+_0x47b755);const _0x1db3ac=Object['keys'](_0x444432[0x0])[_0x49a291(0x1d4)](_0x4c9c02=>({'name':_0x4c9c02,'type':typeof _0x444432[0x0][_0x4c9c02]==='number'?_0x49a291(0x2d2):_0x49a291(0x218)})),_0x2f4cce={'queryId':_0x49a291(0x2d6),'columns':_0x1db3ac,'data':_0x444432,'stats':{'state':_0x49a291(0x2ae),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x444432[_0x49a291(0x240)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x14fe99=formatAsTable(_0x2f4cce,_0x444432[_0x49a291(0x240)],!![]);await writeOutput(_0x14fe99,undefined,_0x49a291(0x2a3));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x250);[a21_0x52fe5b(0x211)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async['execute'](_0x254c21){const _0xe0c25=a21_0x52fe5b,{options:_0x3602c3,args:_0x1c5024,tdx:_0x149a63}=_0x254c21,_0xdad49a=_0x3602c3,_0x5d2c83=_0x1c5024[0x0]||_0x3602c3[_0xe0c25(0x1e1)];if(!_0x5d2c83)return showParentSegmentNotSetError(_0xe0c25(0x2a9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x227b6b=resolveYamlFile(_0x5d2c83);if(existsSync(_0x227b6b)){_0xdad49a[_0xe0c25(0x297)]&&console['error'](_0xe0c25(0x289)+_0x227b6b);let _0x3172c1;try{_0x3172c1=readFileSync(_0x227b6b,'utf-8');}catch(_0x1c755f){const _0xec8547=_0x1c755f instanceof Error?_0x1c755f[_0xe0c25(0x1e6)]:String(_0x1c755f);return console[_0xe0c25(0x27e)]('Error\x20reading\x20file:\x20'+_0xec8547),0x1;}const _0x109e83=await withSpinner('Analyzing\x20changes...',()=>_0x149a63[_0xe0c25(0x201)][_0xe0c25(0x296)](_0x3172c1),{'verbose':_0xdad49a['verbose']}),_0x5c0eed=_0x109e83['data'],{isNew:_0x4dfb07,name:_0x28cc49,hasChanges:_0x2e726c,diffFormatted:_0x34f0dc}=_0x5c0eed;if(_0x2e726c){_0x4dfb07?console[_0xe0c25(0x27e)](_0xe0c25(0x23b)+_0x28cc49+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x28cc49+'\x27:');console['error']('─'[_0xe0c25(0x288)](0x3c)),console[_0xe0c25(0x27e)](_0x34f0dc),console[_0xe0c25(0x27e)]('─'[_0xe0c25(0x288)](0x3c));const _0x40b7db=_0x4dfb07?_0xe0c25(0x265)+_0x28cc49+'\x27\x20and\x20run\x20workflow?':_0xe0c25(0x1e7)+_0x28cc49+_0xe0c25(0x2b3);if(!_0xdad49a[_0xe0c25(0x2c3)]){const _0x1c8697=await confirmKey(_0x40b7db);if(!_0x1c8697)return console[_0xe0c25(0x27e)]('Aborted.'),0x1;}const _0x10f4d9=_0x4dfb07?'Creating':_0xe0c25(0x1ff);await withSpinner(_0x10f4d9+_0xe0c25(0x2c2)+_0x28cc49+_0xe0c25(0x1e3),()=>_0x5c0eed[_0xe0c25(0x2cb)](),{'verbose':_0xdad49a['verbose']});const _0x4c540d=_0x4dfb07?_0xe0c25(0x2bb):_0xe0c25(0x207);console[_0xe0c25(0x27e)]('✔\x20'+_0x4c540d+_0xe0c25(0x2c2)+_0x28cc49+'\x27');}else console[_0xe0c25(0x27e)](_0xe0c25(0x27a)+_0x28cc49+'\x27\x20is\x20up\x20to\x20date');}const _0x141dad=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x5d2c83+_0xe0c25(0x1e3),()=>_0x149a63[_0xe0c25(0x201)][_0xe0c25(0x2ab)](_0x5d2c83),{'verbose':_0xdad49a[_0xe0c25(0x297)]}),_0x55fb20=_0x141dad[_0xe0c25(0x29c)],_0x392049=getConsoleUrl(_0xdad49a[_0xe0c25(0x228)],_0xe0c25(0x293)+_0x55fb20[_0xe0c25(0x1f9)]+_0xe0c25(0x237)+_0x55fb20[_0xe0c25(0x254)]+_0xe0c25(0x257)+_0x55fb20[_0xe0c25(0x277)]);return console[_0xe0c25(0x27e)](_0xe0c25(0x269)),console[_0xe0c25(0x27e)]('\x20\x20'+a21_0x854bff[_0xe0c25(0x2a1)](_0xe0c25(0x2c7))+'\x20'+_0x55fb20[_0xe0c25(0x2a6)]),console['error']('\x20\x20'+a21_0x854bff['dim'](_0xe0c25(0x1e9))+'\x20'+_0x55fb20[_0xe0c25(0x1d9)]),console[_0xe0c25(0x27e)]('\x20\x20'+a21_0x854bff['dim'](_0xe0c25(0x209))+'\x20'+_0x55fb20[_0xe0c25(0x254)]),console[_0xe0c25(0x27e)]('\x20\x20'+a21_0x854bff['dim'](_0xe0c25(0x21b))+'\x20'+_0x55fb20[_0xe0c25(0x277)]),console[_0xe0c25(0x27e)]('\x20\x20'+_0x392049),console[_0xe0c25(0x27e)]('\x0a'+a21_0x854bff['dim'](_0xe0c25(0x29b))+_0xe0c25(0x23a)+_0x55fb20[_0xe0c25(0x277)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x286);['description']='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x1d4b9f){const _0x4f54d7=a21_0x52fe5b,{options:_0x4661a6,args:_0x3d32f9,tdx:_0x5c0746}=_0x1d4b9f,_0x25fe2f=_0x3d32f9[0x0]||_0x4661a6[_0x4f54d7(0x1e1)];if(!_0x25fe2f)return showParentSegmentNotSetError(_0x4f54d7(0x2e7)+_0x4f54d7(0x244)),0x1;_0x4661a6[_0x4f54d7(0x297)]&&(console['error'](_0x4f54d7(0x2db)+_0x4661a6[_0x4f54d7(0x228)]),console[_0x4f54d7(0x27e)](_0x4f54d7(0x200)+_0x25fe2f));const _0x173a4a=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x25fe2f+_0x4f54d7(0x1e3),()=>_0x5c0746[_0x4f54d7(0x201)][_0x4f54d7(0x2b9)](_0x25fe2f),{'verbose':_0x4661a6['verbose']}),_0x5ee6de=_0x173a4a[_0x4f54d7(0x29c)];console[_0x4f54d7(0x27e)](_0x4f54d7(0x242)+_0x5ee6de['length']+_0x4f54d7(0x1da)+(_0x5ee6de[_0x4f54d7(0x240)]!==0x1?'s':''));if(_0x4661a6[_0x4f54d7(0x278)]||_0x4661a6['jsonl'])return await handleSDKOutput(_0x5ee6de,_0x4661a6),0x0;return displayFieldsHumanReadable(_0x5ee6de,_0x25fe2f),0x0;}}function a21_0x4a9f(){const _0x1573d3=['Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','behaviorsFile','\x0a⚠️\x20\x20Migrating:\x20','Fetching\x20SQL\x20for\x20\x27','segment:parent:fields','Creating','repeat','Found\x20YAML\x20file:\x20','elapsedTimeMillis','isDirectory','segment:parent:pull','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','/\x20directories\x20exist.','\x20=\x20','segment:parent:create','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','getParentSQL','/app/workflows/','previewParentYaml','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','pushParentYaml','verbose','Available\x20behaviors:','Output\x20file:\x20','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','To\x20cancel:','data','behavior','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Join:','Join\x20on:','dim','Validating\x20configuration...','table','tdx\x20segment\x20parent\x20preview\x20','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','audienceId','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','population','runParent','sampleData','trim','FINISHED','timezone','/\x20and\x20','columns','validateParentYaml','\x27\x20and\x20run\x20workflow?','1137186haeXFa','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','schemaValid','listFields','processedRows','Created','utf-8','addBehaviors','label','\x27\x20is\x20already\x20up\x20to\x20date','parent_segments','cyan','\x20parent\x20segment\x20\x27','yes','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Errors:','open','Audience\x20ID:','updateParent','1082912qDUOic','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','apply','jobId','451662ePvYnc','Error:\x20Parent\x20segment\x20name\x20is\x20required','database','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Error\x20parsing\x20YAML:\x20','double','Master:','/app/dw/parentSegments/','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','preview','attributes','joinKey','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','red','Site:\x20','interval','displayPreviewResults','-1d','behaviors','stats','Customers:','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','addAttributesFile','.yml','totalEvents','scheduleOption','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','replace','enriched','Available\x20attributes:','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','win32','displaySampleData','rowCount','Rows:','Executing\x20parent\x20segment\x20query...','Validate:','Attributes','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x20[Job\x20ID:\x20','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Listing\x20parent\x20segments\x20matching\x20\x27','Get\x20SQL\x20query\x20for\x20parent\x20segment','Columns:','map','foreignKey','column','\x20rows\x20','getParentFull','status','\x20field','64uIHdvc','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','query','yellow','List\x20parent\x20segments','\x20--attribute\x20\x22','parentSegment','\x0aNo\x20sample\x20data\x20available','\x27...','segment:parent:push','customerGroup','message','Apply\x20changes\x20to\x20\x27','web','Status:','35FljAMi','addBehaviorsFile','localeCompare','segment:parent:view','start','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','Aborted.','matchedCount','setJobId','log','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20No\x20changes\x20-\x20','master','237429DosxPd','Error\x20reading\x20file:\x20','workflowId','execute','Options\x20(one\x20required):\x0a','\x20--attribute\x20\x22<name>\x22','green','resolveParentId','Updating','Parent\x20segment:\x20','segment','using\x20the\x20default\x20path:\x20','Listing\x20parent\x20segments...','Fetching\x20sample\x20data...','1414028owUFui','Show\x20parent\x20segment\x20details','Updated','sort','Session:','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Options:\x0a','in\x20','Attribute:','Fetching\x20parent\x20segment\x20\x27','Table:\x20','description','endsWith','ignore','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','displayPreviewHints','addAttributes','\x20Configuration\x20is\x20valid','varchar','\x20--interval\x20','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Attempt:','run','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Master\x20Table','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','name','createParent','segment:parent:validate','\x20--enriched','YAML\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','session','site','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x0aChanges\x20to\x20apply\x20to\x20\x27','Error:\x20File\x20not\x20found:\x20','\x20Opening\x20','limit','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20-\x20','\x20--behavior\x20\x22','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','test','displayBehaviorsStats','toFixed','/sessions/','allValid','displayColumns','\x20tdx\x20wf\x20attempt\x20','\x0aNew\x20parent\x20segment\x20\x27','Updating\x20parent\x20segment\x20\x27','customersWithEvents','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','join','length','To\x20view\x20sample\x20data:','✔\x20Found\x20','customerGroupFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','darwin','33291470DFYOMO','Options:','displayMasterInfo','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','errors','string','text','Overwrite\x20\x27','Events:','3518590ECMzyY','segment:parent:run','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','✔\x20Query\x20completed:\x20Processed\x20','workflowSessionId','parent_segment','listParents','/attempt/','✔\x20Renamed\x20directory\x20to\x20','toLocaleString','Pattern:\x20','segment:parent:desc','\x20rows)','.yaml','unref','\x27\x20with\x20ID:\x20','SQL\x20query:\x0a','coveragePercent','format','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Error:','Create\x20parent\x20segment\x20\x27','displaySummary','Source:','stop','\x0a✔\x20Workflow\x20started','xdg-open','bold','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','displayValidateResults','pullParentYaml','scheduleType','use','9adhBZv','customerPercent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','segment:parent:preview','all','workflowAttemptId','json','No\x20parent\x20segments\x20match\x20pattern:\x20','✔\x20No\x20changes\x20-\x20\x27','dirname','displayAttributesStats','attribute','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','segment:parent:sql','Preview:'];a21_0x4a9f=function(){return _0x1573d3;};return a21_0x4a9f();}export class ParentSegmentViewCommand extends BaseCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x1ed);['description']=a21_0x52fe5b(0x206);async[a21_0x52fe5b(0x1fa)](_0x14bf7d){const _0x15b7ed=a21_0x52fe5b,{options:_0x41d102,args:_0x45d6db,tdx:_0x22ca33}=_0x14bf7d,_0x4c896d=_0x41d102,_0x58ab79=_0x45d6db[0x0]||_0x41d102[_0x15b7ed(0x1e1)];if(!_0x58ab79)return showParentSegmentNotSetError(_0x15b7ed(0x2eb)+_0x15b7ed(0x249)+_0x15b7ed(0x20c)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x41d102[_0x15b7ed(0x297)]&&(console[_0x15b7ed(0x27e)]('Site:\x20'+_0x41d102[_0x15b7ed(0x228)]),console[_0x15b7ed(0x27e)]('Parent\x20segment:\x20'+_0x58ab79));const _0x1fcfc9=await withSpinner(_0x15b7ed(0x20f)+_0x58ab79+_0x15b7ed(0x1e3),()=>_0x22ca33[_0x15b7ed(0x201)]['getParentFull'](_0x58ab79),{'verbose':_0x41d102['verbose']}),_0x11d384=_0x1fcfc9[_0x15b7ed(0x29c)];if(_0x4c896d[_0x15b7ed(0x1e8)]){const _0x350441=getConsoleNextUrl(_0x4c896d[_0x15b7ed(0x228)],_0x15b7ed(0x2d4)+_0x11d384['id']);return console['error'](a21_0x854bff['green']('✔')+_0x15b7ed(0x22c)+a21_0x854bff[_0x15b7ed(0x2c1)](_0x350441)),openBrowser(_0x350441),0x0;}return await handleSingleObjectOutput(_0x11d384,_0x41d102),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a21_0x52fe5b(0x25b);['description']=a21_0x52fe5b(0x21a);async[a21_0x52fe5b(0x1fa)](_0x4d3944){const _0x110268=a21_0x52fe5b,{options:_0x3127fd,args:_0x54c277,tdx:_0x5b73f2}=_0x4d3944,_0x2d718b=_0x54c277[0x0]||_0x3127fd[_0x110268(0x1e1)];if(!_0x2d718b)return showParentSegmentNotSetError(_0x110268(0x1ef)+_0x110268(0x27f)),0x1;_0x3127fd[_0x110268(0x297)]&&(console['error'](_0x110268(0x2db)+_0x3127fd[_0x110268(0x228)]),console['error']('Parent\x20segment:\x20'+_0x2d718b));const _0x1274cf=await withSpinner(_0x110268(0x22e)+_0x2d718b+_0x110268(0x1e3),()=>_0x5b73f2[_0x110268(0x201)]['resolveParentId'](_0x2d718b),{'verbose':_0x3127fd[_0x110268(0x297)]}),_0x4e2d32=_0x1274cf[_0x110268(0x29c)],_0x59e8b9=await withSpinner(_0x110268(0x285)+_0x2d718b+_0x110268(0x1e3),()=>_0x5b73f2[_0x110268(0x201)]['getParentSQL'](_0x4e2d32),{'verbose':_0x3127fd[_0x110268(0x297)]}),_0x38e1af=await executeSchemaQuery(_0x59e8b9[_0x110268(0x29c)],_0x5b73f2,_0x3127fd);return await handleQueryOutput(_0x38e1af,_0x3127fd),0x0;}}function a21_0x4595(_0x542d35,_0x4f943f){_0x542d35=_0x542d35-0x1ce;const _0x4a9fbc=a21_0x4a9f();let _0x4595d8=_0x4a9fbc[_0x542d35];return _0x4595d8;}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a21_0x52fe5b(0x280);['description']=a21_0x52fe5b(0x1d2);async['execute'](_0x5de5d1){const _0x3b695d=a21_0x52fe5b,{options:_0x268771,args:_0x56d412,tdx:_0x4fa419}=_0x5de5d1,_0x3cb36e=_0x56d412[0x0]||_0x268771[_0x3b695d(0x1e1)];if(!_0x3cb36e)return showParentSegmentNotSetError(_0x3b695d(0x2b5)+_0x3b695d(0x22f)),0x1;_0x268771[_0x3b695d(0x297)]&&(console[_0x3b695d(0x27e)](_0x3b695d(0x2db)+_0x268771[_0x3b695d(0x228)]),console[_0x3b695d(0x27e)](_0x3b695d(0x200)+_0x3cb36e));const _0x25f0ee=await withSpinner(_0x3b695d(0x22e)+_0x3cb36e+_0x3b695d(0x1e3),()=>_0x4fa419['segment']['resolveParentId'](_0x3cb36e),{'verbose':_0x268771[_0x3b695d(0x297)]}),_0x429c50=_0x25f0ee[_0x3b695d(0x29c)],_0x5c615f=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x3cb36e+'\x27...',()=>_0x4fa419[_0x3b695d(0x201)]['getParentSQL'](_0x429c50),{'verbose':_0x268771['verbose']}),_0x4260f6=_0x5c615f[_0x3b695d(0x29c)];return _0x268771['format']===_0x3b695d(0x278)||_0x268771[_0x3b695d(0x262)]==='jsonl'?await handleSDKOutput([{'sql':_0x4260f6}],_0x268771):console[_0x3b695d(0x1f3)](_0x4260f6),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a21_0x52fe5b(0x221)]='segment:parent:show';[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x29a);async[a21_0x52fe5b(0x1fa)](_0x52d57d){const _0x428f0a=a21_0x52fe5b,{options:_0x3cb695,args:_0xf295e8,tdx:_0x5ede1c}=_0x52d57d,_0x1580d7=_0xf295e8[0x0]||_0x3cb695[_0x428f0a(0x1e1)];if(!_0x1580d7)return showParentSegmentNotSetError(_0x428f0a(0x2e2)+_0x428f0a(0x2d0)),0x1;_0x3cb695[_0x428f0a(0x297)]&&(console[_0x428f0a(0x27e)](_0x428f0a(0x2db)+_0x3cb695[_0x428f0a(0x228)]),console[_0x428f0a(0x27e)](_0x428f0a(0x200)+_0x1580d7));const _0x382c79=await withSpinner(_0x428f0a(0x22e)+_0x1580d7+'\x27...',()=>_0x5ede1c[_0x428f0a(0x201)][_0x428f0a(0x1fe)](_0x1580d7),{'verbose':_0x3cb695[_0x428f0a(0x297)]}),_0xe84d94=_0x382c79['data'],_0xbf5bff=await withSpinner(_0x428f0a(0x285)+_0x1580d7+_0x428f0a(0x1e3),()=>_0x5ede1c[_0x428f0a(0x201)][_0x428f0a(0x292)](_0xe84d94),{'verbose':_0x3cb695[_0x428f0a(0x297)]});let _0x3308a4=_0xbf5bff[_0x428f0a(0x29c)];const _0x248dcf=resolveLimit(_0x3cb695[_0x428f0a(0x22d)],DEFAULT_DISPLAY_LIMIT),_0x598692=/\bLIMIT\s+\d+/i[_0x428f0a(0x234)](_0x3308a4);!_0x598692&&(_0x3308a4=_0x3308a4[_0x428f0a(0x2ad)]()[_0x428f0a(0x2e8)](/;+$/,''),_0x3308a4='SELECT\x20*\x20FROM\x20(\x0a'+_0x3308a4+_0x428f0a(0x295)+_0x248dcf);_0x3cb695[_0x428f0a(0x297)]&&console[_0x428f0a(0x27e)](_0x428f0a(0x260)+_0x3308a4);const _0x2c02ec=await withProgressSpinner(_0x428f0a(0x2f0),async _0x1ce52e=>{const _0x1b4bcd=_0x428f0a,_0x4aa28a=await _0x5ede1c[_0x1b4bcd(0x1dd)][_0x1b4bcd(0x1fa)](_0x3308a4,{'catalog':'td','schema':'information_schema','onJobId':_0x8cc8ec=>{const _0x2ae3b1=_0x1b4bcd;_0x1ce52e[_0x2ae3b1(0x1f2)](_0x8cc8ec);}});return _0x4aa28a;},{'verbose':_0x3cb695['verbose']}),_0x433dc0=_0x2c02ec[_0x428f0a(0x29c)],_0x5c81d8=_0x433dc0[_0x428f0a(0x2cc)]?_0x428f0a(0x1cf)+_0x433dc0['jobId']+']':'';return console[_0x428f0a(0x27e)](_0x428f0a(0x253)+_0x433dc0['stats'][_0x428f0a(0x2ba)][_0x428f0a(0x259)]()+_0x428f0a(0x1d7)+(_0x428f0a(0x20d)+formatElapsed(_0x433dc0[_0x428f0a(0x2e0)][_0x428f0a(0x28a)])+_0x5c81d8)),await handleQueryOutput(_0x433dc0,_0x3cb695),0x0;}}
@@ -1 +1 @@
1
- const a22_0x3a7080=a22_0x3f61;(function(_0x3e29f4,_0x5f4fff){const _0x435400=a22_0x3f61,_0x4765b1=_0x3e29f4();while(!![]){try{const _0xa48013=-parseInt(_0x435400(0x19e))/0x1+parseInt(_0x435400(0x199))/0x2+parseInt(_0x435400(0x1b0))/0x3*(-parseInt(_0x435400(0x19d))/0x4)+parseInt(_0x435400(0x167))/0x5*(parseInt(_0x435400(0x14f))/0x6)+parseInt(_0x435400(0x159))/0x7+-parseInt(_0x435400(0x154))/0x8+-parseInt(_0x435400(0x15d))/0x9*(-parseInt(_0x435400(0x1a5))/0xa);if(_0xa48013===_0x5f4fff)break;else _0x4765b1['push'](_0x4765b1['shift']());}catch(_0x23df64){_0x4765b1['push'](_0x4765b1['shift']());}}}(a22_0x4777,0xaf4c2));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile}from'../core/profile.js';import{saveSessionContext,getCurrentSessionPID,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{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a22_0x1ede00 from'prompts';import a22_0x304a6f from'chalk';function a22_0x3f61(_0x3c9157,_0x524602){_0x3c9157=_0x3c9157-0x141;const _0x47770b=a22_0x4777();let _0x3f61b1=_0x47770b[_0x3c9157];return _0x3f61b1;}function validateProfileName(_0x4a35c0){const _0x3ce07f=a22_0x3f61;if(!_0x4a35c0||!_0x4a35c0['trim']())return'Profile\x20name\x20cannot\x20be\x20empty';const _0x4b6a78=_0x4a35c0[_0x3ce07f(0x18b)]();if(!/^[a-zA-Z0-9_-]+$/[_0x3ce07f(0x15b)](_0x4b6a78))return _0x3ce07f(0x14c);if(profileExists(_0x4b6a78))return _0x3ce07f(0x144)+_0x4b6a78+_0x3ce07f(0x1b2);return!![];}export class ProfileCreateCommand extends BaseCommand{[a22_0x3a7080(0x18e)]=a22_0x3a7080(0x17d);[a22_0x3a7080(0x157)]=a22_0x3a7080(0x14b);async[a22_0x3a7080(0x174)](_0x4152a9){const _0x36fa3e=a22_0x3a7080,{options:_0x25a52c,args:_0x12f883}=_0x4152a9;console[_0x36fa3e(0x178)](a22_0x304a6f[_0x36fa3e(0x192)](_0x36fa3e(0x15a)));let _0x1c878d;if(_0x12f883['length']>0x0&&_0x12f883[0x0]){const _0x486fd3=_0x12f883[0x0][_0x36fa3e(0x18b)](),_0x4fa1f1=validateProfileName(_0x486fd3);if(_0x4fa1f1!==!![])return console[_0x36fa3e(0x145)](a22_0x304a6f['red'](_0x4fa1f1)),0x1;_0x1c878d=_0x486fd3;}else{const _0x11bc15=await a22_0x1ede00({'type':_0x36fa3e(0x177),'name':_0x36fa3e(0x17f),'message':'Enter\x20profile\x20name:','validate':validateProfileName});if(!_0x11bc15['profileName'])return console['log'](_0x36fa3e(0x1a6)),0x1;_0x1c878d=_0x11bc15['profileName'][_0x36fa3e(0x18b)]();}const _0x13a0b4=await a22_0x1ede00({'type':_0x36fa3e(0x177),'name':_0x36fa3e(0x157),'message':'Enter\x20description\x20(optional):'}),_0x3473c1=_0x13a0b4['description']?.[_0x36fa3e(0x18b)]()||undefined,_0x569d1b=_0x25a52c['site']||_0x36fa3e(0x150),_0x5a05db=[{'title':_0x36fa3e(0x17a),'value':_0x36fa3e(0x150)},{'title':'jp\x20\x20\x20-\x20Japan','value':_0x36fa3e(0x180)},{'title':_0x36fa3e(0x1a8),'value':'eu01'},{'title':'ap02\x20-\x20Korea','value':'ap02'}];let _0x492903=_0x5a05db[_0x36fa3e(0x179)](_0x38ddf2=>_0x38ddf2['value']===_0x569d1b);_0x492903===-0x1&&_0x569d1b!==_0x36fa3e(0x150)&&(_0x5a05db['push']({'title':_0x569d1b,'value':_0x569d1b}),_0x492903=_0x5a05db[_0x36fa3e(0x161)]-0x1);_0x5a05db[_0x36fa3e(0x153)]({'title':_0x36fa3e(0x176),'value':'other'});const _0x2798fc=await a22_0x1ede00({'type':_0x36fa3e(0x195),'name':_0x36fa3e(0x141),'message':_0x36fa3e(0x171)+_0x1c878d+'\x27:','choices':_0x5a05db,'initial':_0x492903>=0x0?_0x492903:0x0});if(!_0x2798fc[_0x36fa3e(0x141)])return console[_0x36fa3e(0x178)]('\x0aSetup\x20cancelled'),0x1;let _0x574821;if(_0x2798fc['site']==='other'){const _0x1d54f2=await a22_0x1ede00({'type':_0x36fa3e(0x177),'name':_0x36fa3e(0x147),'message':'Enter\x20site\x20name:','initial':_0x36fa3e(0x150),'validate':_0x44f680=>{const _0x413b98=_0x36fa3e;if(!_0x44f680||!_0x44f680[_0x413b98(0x18b)]())return _0x413b98(0x185);if(!/^[a-z0-9-]+$/[_0x413b98(0x15b)](_0x44f680['trim']()))return _0x413b98(0x181);return!![];}});if(!_0x1d54f2[_0x36fa3e(0x147)])return console[_0x36fa3e(0x178)]('\x0aSetup\x20cancelled'),0x1;_0x574821=_0x1d54f2[_0x36fa3e(0x147)];}else _0x574821=_0x2798fc[_0x36fa3e(0x141)];const _0x34c15a=resolveSite(_0x574821);console[_0x36fa3e(0x178)](_0x36fa3e(0x142)+_0x34c15a),console[_0x36fa3e(0x178)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x36fa3e(0x178)]('\x20\x20'+getConsoleUrl(_0x34c15a,_0x36fa3e(0x15f)));const _0x1ed8c2=await a22_0x1ede00({'type':'password','name':_0x36fa3e(0x162),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x3d7f5a=>{const _0x4bfc89=_0x36fa3e;if(!_0x3d7f5a||!_0x3d7f5a[_0x4bfc89(0x18b)]())return _0x4bfc89(0x193);return!![];}});if(!_0x1ed8c2[_0x36fa3e(0x162)])return console[_0x36fa3e(0x178)](_0x36fa3e(0x1a6)),0x1;const _0x468613=_0x1ed8c2['apiKey'];console['log'](_0x36fa3e(0x190));try{const _0x5699ff=TDX['create']({'site':_0x34c15a,'apiKey':_0x468613[_0x36fa3e(0x18b)](),'logLevel':_0x25a52c[_0x36fa3e(0x152)]??LogLevel[_0x36fa3e(0x1a0)]}),_0x19f711=await _0x5699ff[_0x36fa3e(0x1a2)][_0x36fa3e(0x1a3)]();console[_0x36fa3e(0x178)](a22_0x304a6f['green']('✓')+_0x36fa3e(0x149)+_0x19f711[_0x36fa3e(0x163)]+')');const _0x4d8569=await isKeychainAvailable();_0x4d8569?(await saveAPIKeyAsync(_0x468613[_0x36fa3e(0x18b)](),_0x34c15a,_0x1c878d),console[_0x36fa3e(0x178)](a22_0x304a6f[_0x36fa3e(0x15c)]('✓')+_0x36fa3e(0x164)+_0x1c878d+')')):(console[_0x36fa3e(0x19b)](a22_0x304a6f[_0x36fa3e(0x189)](_0x36fa3e(0x18f))),console[_0x36fa3e(0x19b)](a22_0x304a6f['yellow'](_0x36fa3e(0x170))));const _0xbac608={'site':_0x34c15a,..._0x3473c1&&{'description':_0x3473c1}};return saveProfileToUserConfig(_0x1c878d,_0xbac608),console[_0x36fa3e(0x178)](a22_0x304a6f[_0x36fa3e(0x15c)]('✓')+_0x36fa3e(0x188)+_0x1c878d+_0x36fa3e(0x16b)),console[_0x36fa3e(0x178)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console[_0x36fa3e(0x178)](_0x36fa3e(0x182)+_0x1c878d+_0x36fa3e(0x172)),console[_0x36fa3e(0x178)](_0x36fa3e(0x182)+_0x1c878d+_0x36fa3e(0x1ac)),0x0;}catch(_0x3deb49){if(_0x3deb49 instanceof HTTPClientError&&_0x3deb49[_0x36fa3e(0x17e)]===0x191)return printAuthError(_0x3deb49),0x1;return console['error'](a22_0x304a6f[_0x36fa3e(0x155)](_0x36fa3e(0x183)+(_0x3deb49 instanceof Error?_0x3deb49['message']:String(_0x3deb49)))),console[_0x36fa3e(0x145)](_0x36fa3e(0x173)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a22_0x3a7080(0x18e)]=a22_0x3a7080(0x166);[a22_0x3a7080(0x157)]=a22_0x3a7080(0x186);[a22_0x3a7080(0x16a)](_0x54cf9c){const _0xe32f0a=a22_0x3a7080,{args:_0x50745a}=_0x54cf9c;if(_0x50745a[_0xe32f0a(0x161)]===0x0)return _0xe32f0a(0x196);return undefined;}async[a22_0x3a7080(0x174)](_0x185b28){const _0x394ed6=a22_0x3a7080,{args:_0x54e91e}=_0x185b28,_0x1d662d=_0x54e91e[0x0];console[_0x394ed6(0x178)](a22_0x304a6f[_0x394ed6(0x192)](_0x394ed6(0x19f)));if(!profileExists(_0x1d662d)){console[_0x394ed6(0x145)](a22_0x304a6f[_0x394ed6(0x155)](_0x394ed6(0x144)+_0x1d662d+'\x27\x20does\x20not\x20exist.')),console[_0x394ed6(0x178)](_0x394ed6(0x148));const _0x1d385c=listProfiles();if(_0x1d385c[_0x394ed6(0x161)]===0x0)console[_0x394ed6(0x178)](_0x394ed6(0x17b));else for(const _0x3a7fd4 of _0x1d385c){console[_0x394ed6(0x178)]('\x20\x20-\x20'+_0x3a7fd4[_0x394ed6(0x18e)]);}return 0x1;}const _0x380353=await a22_0x1ede00({'type':_0x394ed6(0x194),'name':_0x394ed6(0x194),'message':_0x394ed6(0x19c)+_0x1d662d+'\x27?','initial':![]});if(!_0x380353[_0x394ed6(0x194)])return console['log'](_0x394ed6(0x175)),0x0;try{removeProfileFromUserConfig(_0x1d662d),console[_0x394ed6(0x178)](a22_0x304a6f[_0x394ed6(0x15c)]('✓')+_0x394ed6(0x188)+_0x1d662d+_0x394ed6(0x1a1));}catch(_0x5b01b7){return console[_0x394ed6(0x145)](a22_0x304a6f['red'](_0x394ed6(0x1aa)+(_0x5b01b7 instanceof Error?_0x5b01b7[_0x394ed6(0x1ab)]:String(_0x5b01b7)))),0x1;}const _0x2b2d70=await isKeychainAvailable();if(_0x2b2d70){const _0x4a0288=await deleteKeychainAPIKey(_0x1d662d);_0x4a0288&&console['log'](a22_0x304a6f[_0x394ed6(0x15c)]('✓')+_0x394ed6(0x156));}return 0x0;}}function a22_0x4777(){const _0x5a5191=['site','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Profile\x20\x27','error','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>','customSite','\x0aAvailable\x20profiles:','\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20API\x20key\x20saved\x20to\x20system\x20keychain','Create\x20a\x20new\x20profile','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','\x27.\x0a\x0aValid\x20keys:\x20','includes','24uMdIVW','us01','Set\x20a\x20profile\x20configuration\x20value','logLevel','push','10540856ltVANS','red','\x20API\x20key\x20removed\x20from\x20system\x20keychain','description','(cleared)','5958330ymJStc','tdx:\x20profile\x20create','test','green','3662037ZXtxaN','VALID_KEYS','/app/mp/ak','Unknown\x20key\x20\x27','length','apiKey','email','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','Changing\x20site\x20to\x20\x27','profile:remove','772465NIEKGt','Operation\x20cancelled','dim','validate','\x27\x20created','password','parent_segment','tdx:\x20profile\x20set','profile','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','execute','Removal\x20cancelled','Enter\x20custom\x20site','text','log','findIndex','us\x20\x20\x20-\x20United\x20States','\x20\x20(no\x20profiles\x20found)','session','profile:create','status','profileName','jp01','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','\x20\x20tdx\x20--profile\x20','✗\x20Validation\x20failed:\x20','\x27\x20does\x20not\x20exist.\x20Create\x20it?','Site\x20name\x20cannot\x20be\x20empty','Remove\x20a\x20profile','\x20\x20-\x20','\x20Profile\x20\x27','yellow','create','trim','Site\x20was\x20not\x20changed.','profile:use','name','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Validating\x20API\x20key...','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','bold','API\x20key\x20cannot\x20be\x20empty','confirm','select','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','config','Session\x20profile\x20set\x20to:\x20','2451550MMSmxS','llm_agent','warn','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','268Rqikxe','427896WDxxaO','tdx:\x20profile\x20remove','ERROR','\x27\x20removed\x20from\x20configuration','jobs','getUserInfo','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>','10AAaAtj','\x0aSetup\x20cancelled','toString','eu\x20\x20\x20-\x20Europe','\x27\x20updated:\x20','Failed\x20to\x20remove\x20profile:\x20','message','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','profile:set','split','database','28581ckpGpI','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.'];a22_0x4777=function(){return _0x5a5191;};return a22_0x4777();}export class ProfileSetCommand extends BaseCommand{['name']=a22_0x3a7080(0x1ad);[a22_0x3a7080(0x157)]=a22_0x3a7080(0x151);static [a22_0x3a7080(0x15e)]=['site',a22_0x3a7080(0x1af),a22_0x3a7080(0x16d),'llm_project',a22_0x3a7080(0x19a),a22_0x3a7080(0x157)];[a22_0x3a7080(0x16a)](_0xa99bd3){const _0x2c3f2e=a22_0x3a7080,{args:_0x4a3957,options:_0x3f30e2}=_0xa99bd3,_0x78fbe6=_0x3f30e2['profile']||getActiveProfile();if(!_0x78fbe6)return _0x2c3f2e(0x1a4);if(_0x4a3957[_0x2c3f2e(0x161)]===0x0)return'Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x2c3f2e(0x15e)]['join'](',\x20');const _0x1f59e3=_0x4a3957[0x0];if(!_0x1f59e3[_0x2c3f2e(0x14e)]('='))return _0x2c3f2e(0x1b1)+ProfileSetCommand[_0x2c3f2e(0x15e)]['join'](',\x20');const [_0x126ddd]=_0x1f59e3['split']('=',0x2);if(!ProfileSetCommand['VALID_KEYS'][_0x2c3f2e(0x14e)](_0x126ddd))return _0x2c3f2e(0x160)+_0x126ddd+_0x2c3f2e(0x14d)+ProfileSetCommand[_0x2c3f2e(0x15e)]['join'](',\x20');return undefined;}async[a22_0x3a7080(0x174)](_0x560bc9){const _0x4e703d=a22_0x3a7080,{args:_0xb878a1,options:_0x22a916}=_0x560bc9,_0x14c659=_0x22a916[_0x4e703d(0x16f)]||getActiveProfile(),[_0x2f60c5,..._0x52f401]=_0xb878a1[0x0][_0x4e703d(0x1ae)]('='),_0x1e141e=_0x52f401['join']('=');console[_0x4e703d(0x178)](a22_0x304a6f[_0x4e703d(0x192)](_0x4e703d(0x16e)));if(!profileExists(_0x14c659)){const _0x36e5f0=await a22_0x1ede00({'type':_0x4e703d(0x194),'name':_0x4e703d(0x18a),'message':'Profile\x20\x27'+_0x14c659+_0x4e703d(0x184),'initial':!![]});if(!_0x36e5f0['create'])return console['log'](_0x4e703d(0x168)),0x1;}const _0x5aa219=loadProfile(_0x14c659),_0x31a1f6=_0x5aa219?.[_0x4e703d(0x197)]||{};if(_0x2f60c5===_0x4e703d(0x141)){const _0x2e85cd=resolveSite(_0x1e141e);console[_0x4e703d(0x178)](_0x4e703d(0x165)+_0x2e85cd+'\x27\x20requires\x20API\x20key\x20validation.'),console[_0x4e703d(0x178)]('\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0x2e85cd,_0x4e703d(0x15f)));const _0x32a977=await a22_0x1ede00({'type':_0x4e703d(0x16c),'name':_0x4e703d(0x162),'message':_0x4e703d(0x191),'validate':_0x105c69=>{const _0x3482a2=_0x4e703d;if(!_0x105c69||!_0x105c69[_0x3482a2(0x18b)]())return _0x3482a2(0x193);return!![];}});if(!_0x32a977[_0x4e703d(0x162)])return console[_0x4e703d(0x178)]('\x0aOperation\x20cancelled'),0x1;console[_0x4e703d(0x178)]('Validating\x20API\x20key...');try{const _0x4685d5=TDX[_0x4e703d(0x18a)]({'site':_0x2e85cd,'apiKey':_0x32a977[_0x4e703d(0x162)][_0x4e703d(0x18b)](),'logLevel':_0x22a916['logLevel']??LogLevel[_0x4e703d(0x1a0)]}),_0x4bd2d3=await _0x4685d5[_0x4e703d(0x1a2)]['getUserInfo']();console[_0x4e703d(0x178)](a22_0x304a6f[_0x4e703d(0x15c)]('✓')+_0x4e703d(0x149)+_0x4bd2d3[_0x4e703d(0x163)]+')');const _0x2fe419=await isKeychainAvailable();_0x2fe419?(await saveAPIKeyAsync(_0x32a977[_0x4e703d(0x162)][_0x4e703d(0x18b)](),_0x2e85cd,_0x14c659),console['log'](a22_0x304a6f[_0x4e703d(0x15c)]('✓')+_0x4e703d(0x14a))):console[_0x4e703d(0x19b)](a22_0x304a6f[_0x4e703d(0x189)](_0x4e703d(0x18f))),_0x31a1f6[_0x4e703d(0x141)]=_0x2e85cd;}catch(_0x1cfc7d){if(_0x1cfc7d instanceof HTTPClientError&&_0x1cfc7d['status']===0x191)return printAuthError(_0x1cfc7d),0x1;return console[_0x4e703d(0x145)](a22_0x304a6f[_0x4e703d(0x155)](_0x4e703d(0x183)+(_0x1cfc7d instanceof Error?_0x1cfc7d['message']:String(_0x1cfc7d)))),console['error'](_0x4e703d(0x18c)),0x1;}}else _0x31a1f6[_0x2f60c5]=_0x1e141e||undefined;return saveProfileToUserConfig(_0x14c659,_0x31a1f6),console[_0x4e703d(0x178)](a22_0x304a6f[_0x4e703d(0x15c)]('✓')+_0x4e703d(0x188)+_0x14c659+_0x4e703d(0x1a9)+_0x2f60c5+'='+(_0x1e141e||_0x4e703d(0x158))),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a22_0x3a7080(0x18d);[a22_0x3a7080(0x157)]='Set\x20session\x20profile';[a22_0x3a7080(0x16a)](_0x4447d3){const _0x27d794=a22_0x3a7080,{args:_0x4befed}=_0x4447d3;if(_0x4befed[_0x27d794(0x161)]===0x0)return _0x27d794(0x146);return undefined;}async[a22_0x3a7080(0x174)](_0xfd3a62){const _0x1e22ef=a22_0x3a7080,{args:_0x4e6de8,options:_0x2b22f1}=_0xfd3a62,_0xab8a03=_0x4e6de8[0x0];cleanExpiredSessions();if(!profileExists(_0xab8a03)){console[_0x1e22ef(0x145)](a22_0x304a6f[_0x1e22ef(0x155)](_0x1e22ef(0x144)+_0xab8a03+'\x27\x20does\x20not\x20exist.')),console['log'](_0x1e22ef(0x148));const _0x525a1b=listProfiles();if(_0x525a1b[_0x1e22ef(0x161)]===0x0)console[_0x1e22ef(0x178)](_0x1e22ef(0x17b));else for(const _0x54271d of _0x525a1b){console['log'](_0x1e22ef(0x187)+_0x54271d['name']);}return 0x1;}const _0x240f83=_0x2b22f1[_0x1e22ef(0x17c)]||getCurrentSessionPID()[_0x1e22ef(0x1a7)]();return saveSessionContext({'profile':_0xab8a03},_0x2b22f1['session']),console[_0x1e22ef(0x178)](_0x1e22ef(0x198)+a22_0x304a6f[_0x1e22ef(0x15c)](_0xab8a03)+'\x20'+a22_0x304a6f[_0x1e22ef(0x169)]('(session:\x20'+_0x240f83+')')),console['log'](a22_0x304a6f['dim'](_0x1e22ef(0x143))),0x0;}}
1
+ const a22_0xa81a40=a22_0x36f4;(function(_0x284c76,_0x349d4f){const _0x1655d7=a22_0x36f4,_0x2cdc31=_0x284c76();while(!![]){try{const _0x141b3f=parseInt(_0x1655d7(0x138))/0x1*(parseInt(_0x1655d7(0x122))/0x2)+-parseInt(_0x1655d7(0x158))/0x3+parseInt(_0x1655d7(0x154))/0x4+parseInt(_0x1655d7(0x160))/0x5*(parseInt(_0x1655d7(0x11b))/0x6)+-parseInt(_0x1655d7(0x149))/0x7*(-parseInt(_0x1655d7(0x153))/0x8)+-parseInt(_0x1655d7(0x166))/0x9*(parseInt(_0x1655d7(0x180))/0xa)+-parseInt(_0x1655d7(0x174))/0xb;if(_0x141b3f===_0x349d4f)break;else _0x2cdc31['push'](_0x2cdc31['shift']());}catch(_0x408443){_0x2cdc31['push'](_0x2cdc31['shift']());}}}(a22_0x4434,0xed5ad));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile}from'../core/profile.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a22_0x4434(){const _0x4693c5=['getUserInfo','message','\x20\x20tdx\x20--profile\x20','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','Profile\x20\x27','jobs','tdx:\x20profile\x20remove','95744NFzPvk','4118484fzaQcJ','findIndex','red','ap02\x20-\x20Korea','2025435HIlYhB','profile:set','text','other','warn','Validating\x20API\x20key...','profile:use','green','525obOUVQ','create','tdx:\x20profile\x20set','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','profileName','parent_segment','9pUjlTV','\x20\x20(no\x20profiles\x20found)','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','Site\x20was\x20not\x20changed.','select','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x20\x20-\x20','config','\x20API\x20key\x20is\x20valid\x20(User:\x20','Operation\x20cancelled','Set\x20session\x20profile','profile:remove','execute','test','8511030mjVcgZ','\x27\x20removed\x20from\x20configuration','logLevel','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>','description','Session\x20profile\x20set\x20to:\x20','✗\x20Validation\x20failed:\x20','API\x20key\x20cannot\x20be\x20empty','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','name','error','\x27.\x0a\x0aValid\x20keys:\x20','10715310xfFMrF','length','status','Changing\x20site\x20to\x20\x27','join','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','email','profile','us\x20\x20\x20-\x20United\x20States','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','Removal\x20cancelled','\x27\x20updated:\x20','tdx:\x20profile\x20create','\x27\x20created','\x27\x20requires\x20API\x20key\x20validation.','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>','39654LTAmUz','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20Profile\x20\x27','profile:create','Enter\x20profile\x20name:','site','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','276770LhsTaA','ap02','session','dim','customSite','(session:\x20','\x0aOperation\x20cancelled','Enter\x20description\x20(optional):','bold','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','\x20API\x20key\x20removed\x20from\x20system\x20keychain','apiKey','jp\x20\x20\x20-\x20Japan','push','Set\x20a\x20profile\x20configuration\x20value','yellow','\x0aAvailable\x20profiles:','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','log','validate','Remove\x20a\x20profile','\x27\x20does\x20not\x20exist.\x20Create\x20it?','5DekWAe','Profile\x20name\x20cannot\x20be\x20empty','split','eu01','includes','\x0aSetup\x20cancelled','confirm','Failed\x20to\x20remove\x20profile:\x20','database','us01','password','\x27\x20does\x20not\x20exist.','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','\x20API\x20key\x20saved\x20to\x20system\x20keychain','trim','VALID_KEYS','630jsEzrp','jp01','llm_project'];a22_0x4434=function(){return _0x4693c5;};return a22_0x4434();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a22_0x296651 from'prompts';import a22_0x373702 from'chalk';function validateProfileName(_0x1236a8){const _0x5cf86d=a22_0x36f4;if(!_0x1236a8||!_0x1236a8[_0x5cf86d(0x147)]())return _0x5cf86d(0x139);const _0x309d23=_0x1236a8[_0x5cf86d(0x147)]();if(!/^[a-zA-Z0-9_-]+$/[_0x5cf86d(0x173)](_0x309d23))return _0x5cf86d(0x17c);if(profileExists(_0x309d23))return'Profile\x20\x27'+_0x309d23+_0x5cf86d(0x18a);return!![];}export class ProfileCreateCommand extends BaseCommand{[a22_0xa81a40(0x17d)]=a22_0xa81a40(0x11e);[a22_0xa81a40(0x178)]='Create\x20a\x20new\x20profile';async['execute'](_0x5a12ee){const _0x49bed3=a22_0xa81a40,{options:_0x1f3480,args:_0x37bd09}=_0x5a12ee;console['log'](a22_0x373702[_0x49bed3(0x12a)](_0x49bed3(0x18d)));let _0x2cba8a;if(_0x37bd09[_0x49bed3(0x181)]>0x0&&_0x37bd09[0x0]){const _0x310876=_0x37bd09[0x0][_0x49bed3(0x147)](),_0x59fddb=validateProfileName(_0x310876);if(_0x59fddb!==!![])return console[_0x49bed3(0x17e)](a22_0x373702[_0x49bed3(0x156)](_0x59fddb)),0x1;_0x2cba8a=_0x310876;}else{const _0x1191bb=await a22_0x296651({'type':_0x49bed3(0x15a),'name':'profileName','message':_0x49bed3(0x11f),'validate':validateProfileName});if(!_0x1191bb[_0x49bed3(0x164)])return console[_0x49bed3(0x134)]('\x0aSetup\x20cancelled'),0x1;_0x2cba8a=_0x1191bb[_0x49bed3(0x164)][_0x49bed3(0x147)]();}const _0x4bf864=await a22_0x296651({'type':_0x49bed3(0x15a),'name':_0x49bed3(0x178),'message':_0x49bed3(0x129)}),_0x587ec7=_0x4bf864[_0x49bed3(0x178)]?.[_0x49bed3(0x147)]()||undefined,_0x227cb0=_0x1f3480[_0x49bed3(0x120)]||_0x49bed3(0x141),_0x1772b7=[{'title':_0x49bed3(0x188),'value':_0x49bed3(0x141)},{'title':_0x49bed3(0x12e),'value':_0x49bed3(0x14a)},{'title':'eu\x20\x20\x20-\x20Europe','value':_0x49bed3(0x13b)},{'title':_0x49bed3(0x157),'value':_0x49bed3(0x123)}];let _0x8a4489=_0x1772b7[_0x49bed3(0x155)](_0x2c75a0=>_0x2c75a0['value']===_0x227cb0);_0x8a4489===-0x1&&_0x227cb0!==_0x49bed3(0x141)&&(_0x1772b7[_0x49bed3(0x12f)]({'title':_0x227cb0,'value':_0x227cb0}),_0x8a4489=_0x1772b7[_0x49bed3(0x181)]-0x1);_0x1772b7[_0x49bed3(0x12f)]({'title':'Enter\x20custom\x20site','value':_0x49bed3(0x15b)});const _0x2ed623=await a22_0x296651({'type':_0x49bed3(0x16a),'name':'site','message':_0x49bed3(0x189)+_0x2cba8a+'\x27:','choices':_0x1772b7,'initial':_0x8a4489>=0x0?_0x8a4489:0x0});if(!_0x2ed623[_0x49bed3(0x120)])return console['log']('\x0aSetup\x20cancelled'),0x1;let _0x30dc61;if(_0x2ed623[_0x49bed3(0x120)]==='other'){const _0x23d131=await a22_0x296651({'type':_0x49bed3(0x15a),'name':_0x49bed3(0x126),'message':'Enter\x20site\x20name:','initial':_0x49bed3(0x141),'validate':_0x44f806=>{const _0x518b20=_0x49bed3;if(!_0x44f806||!_0x44f806[_0x518b20(0x147)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x518b20(0x173)](_0x44f806[_0x518b20(0x147)]()))return _0x518b20(0x144);return!![];}});if(!_0x23d131[_0x49bed3(0x126)])return console[_0x49bed3(0x134)](_0x49bed3(0x13d)),0x1;_0x30dc61=_0x23d131[_0x49bed3(0x126)];}else _0x30dc61=_0x2ed623[_0x49bed3(0x120)];const _0x1e4ba2=resolveSite(_0x30dc61);console[_0x49bed3(0x134)](_0x49bed3(0x168)+_0x1e4ba2),console[_0x49bed3(0x134)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x49bed3(0x134)]('\x20\x20'+getConsoleUrl(_0x1e4ba2,'/app/mp/ak'));const _0x386a41=await a22_0x296651({'type':_0x49bed3(0x142),'name':_0x49bed3(0x12d),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x38f196=>{const _0x3840d2=_0x49bed3;if(!_0x38f196||!_0x38f196[_0x3840d2(0x147)]())return _0x3840d2(0x17b);return!![];}});if(!_0x386a41[_0x49bed3(0x12d)])return console[_0x49bed3(0x134)](_0x49bed3(0x13d)),0x1;const _0xe44cea=_0x386a41[_0x49bed3(0x12d)];console[_0x49bed3(0x134)](_0x49bed3(0x15d));try{const _0x237661=TDX['create']({'site':_0x1e4ba2,'apiKey':_0xe44cea[_0x49bed3(0x147)](),'logLevel':_0x1f3480['logLevel']??LogLevel['ERROR']}),_0x1e6365=await _0x237661['jobs'][_0x49bed3(0x14c)]();console[_0x49bed3(0x134)](a22_0x373702[_0x49bed3(0x15f)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x1e6365[_0x49bed3(0x186)]+')');const _0x16a892=await isKeychainAvailable();_0x16a892?(await saveAPIKeyAsync(_0xe44cea[_0x49bed3(0x147)](),_0x1e4ba2,_0x2cba8a),console[_0x49bed3(0x134)](a22_0x373702['green']('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'+_0x2cba8a+')')):(console[_0x49bed3(0x15c)](a22_0x373702['yellow'](_0x49bed3(0x133))),console[_0x49bed3(0x15c)](a22_0x373702[_0x49bed3(0x131)](_0x49bed3(0x163))));const _0xe2aa7a={'site':_0x1e4ba2,..._0x587ec7&&{'description':_0x587ec7}};return saveProfileToUserConfig(_0x2cba8a,_0xe2aa7a),console[_0x49bed3(0x134)](a22_0x373702[_0x49bed3(0x15f)]('✓')+_0x49bed3(0x11d)+_0x2cba8a+_0x49bed3(0x18e)),console['log'](),console[_0x49bed3(0x134)](_0x49bed3(0x12b)),console[_0x49bed3(0x134)](_0x49bed3(0x14e)+_0x2cba8a+_0x49bed3(0x11c)),console[_0x49bed3(0x134)](_0x49bed3(0x14e)+_0x2cba8a+_0x49bed3(0x121)),0x0;}catch(_0x3106ef){if(_0x3106ef instanceof HTTPClientError&&_0x3106ef[_0x49bed3(0x182)]===0x191)return printAuthError(_0x3106ef),0x1;return console['error'](a22_0x373702['red'](_0x49bed3(0x17a)+(_0x3106ef instanceof Error?_0x3106ef[_0x49bed3(0x14d)]:String(_0x3106ef)))),console[_0x49bed3(0x17e)](_0x49bed3(0x145)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a22_0xa81a40(0x17d)]=a22_0xa81a40(0x171);['description']=a22_0xa81a40(0x136);['validate'](_0x54de16){const _0x43fc63=a22_0xa81a40,{args:_0x410fbe}=_0x54de16;if(_0x410fbe['length']===0x0)return _0x43fc63(0x14f);return undefined;}async[a22_0xa81a40(0x172)](_0x270824){const _0x14f7fd=a22_0xa81a40,{args:_0x3e6436}=_0x270824,_0x31932f=_0x3e6436[0x0];console[_0x14f7fd(0x134)](a22_0x373702[_0x14f7fd(0x12a)](_0x14f7fd(0x152)));if(!profileExists(_0x31932f)){console['error'](a22_0x373702[_0x14f7fd(0x156)](_0x14f7fd(0x150)+_0x31932f+_0x14f7fd(0x143))),console[_0x14f7fd(0x134)](_0x14f7fd(0x132));const _0x28f0f2=listProfiles();if(_0x28f0f2[_0x14f7fd(0x181)]===0x0)console[_0x14f7fd(0x134)](_0x14f7fd(0x167));else for(const _0x1af2f3 of _0x28f0f2){console['log'](_0x14f7fd(0x16c)+_0x1af2f3[_0x14f7fd(0x17d)]);}return 0x1;}const _0x42b51b=await a22_0x296651({'type':_0x14f7fd(0x13e),'name':_0x14f7fd(0x13e),'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0x31932f+'\x27?','initial':![]});if(!_0x42b51b[_0x14f7fd(0x13e)])return console[_0x14f7fd(0x134)](_0x14f7fd(0x18b)),0x0;try{removeProfileFromUserConfig(_0x31932f),console[_0x14f7fd(0x134)](a22_0x373702[_0x14f7fd(0x15f)]('✓')+_0x14f7fd(0x11d)+_0x31932f+_0x14f7fd(0x175));}catch(_0xda011){return console[_0x14f7fd(0x17e)](a22_0x373702[_0x14f7fd(0x156)](_0x14f7fd(0x13f)+(_0xda011 instanceof Error?_0xda011[_0x14f7fd(0x14d)]:String(_0xda011)))),0x1;}const _0x1af25f=await isKeychainAvailable();if(_0x1af25f){const _0x18fc3c=await deleteKeychainAPIKey(_0x31932f);_0x18fc3c&&console[_0x14f7fd(0x134)](a22_0x373702[_0x14f7fd(0x15f)]('✓')+_0x14f7fd(0x12c));}return 0x0;}}function a22_0x36f4(_0x479ed1,_0x42ff23){_0x479ed1=_0x479ed1-0x119;const _0x443484=a22_0x4434();let _0x36f42f=_0x443484[_0x479ed1];return _0x36f42f;}export class ProfileSetCommand extends BaseCommand{[a22_0xa81a40(0x17d)]=a22_0xa81a40(0x159);['description']=a22_0xa81a40(0x130);static [a22_0xa81a40(0x148)]=['site',a22_0xa81a40(0x140),a22_0xa81a40(0x165),a22_0xa81a40(0x14b),'llm_agent',a22_0xa81a40(0x178)];[a22_0xa81a40(0x135)](_0x84efb7){const _0x35d5bf=a22_0xa81a40,{args:_0x189964,options:_0x1b78be}=_0x84efb7,_0x13b27b=_0x1b78be[_0x35d5bf(0x187)]||getActiveProfile();if(!_0x13b27b)return _0x35d5bf(0x11a);if(_0x189964[_0x35d5bf(0x181)]===0x0)return _0x35d5bf(0x16b)+ProfileSetCommand['VALID_KEYS'][_0x35d5bf(0x184)](',\x20');const _0x392c30=_0x189964[0x0];if(!_0x392c30[_0x35d5bf(0x13c)]('='))return'Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand['VALID_KEYS'][_0x35d5bf(0x184)](',\x20');const [_0x124bba]=_0x392c30['split']('=',0x2);if(!ProfileSetCommand[_0x35d5bf(0x148)]['includes'](_0x124bba))return'Unknown\x20key\x20\x27'+_0x124bba+_0x35d5bf(0x17f)+ProfileSetCommand[_0x35d5bf(0x148)][_0x35d5bf(0x184)](',\x20');return undefined;}async[a22_0xa81a40(0x172)](_0x4a967c){const _0x2a7b37=a22_0xa81a40,{args:_0x3c9841,options:_0x53b344}=_0x4a967c,_0x492498=_0x53b344[_0x2a7b37(0x187)]||getActiveProfile(),[_0x23aaba,..._0x19742c]=_0x3c9841[0x0][_0x2a7b37(0x13a)]('='),_0x6072c9=_0x19742c[_0x2a7b37(0x184)]('=');console['log'](a22_0x373702[_0x2a7b37(0x12a)](_0x2a7b37(0x162)));if(!profileExists(_0x492498)){const _0x16cf56=await a22_0x296651({'type':'confirm','name':_0x2a7b37(0x161),'message':_0x2a7b37(0x150)+_0x492498+_0x2a7b37(0x137),'initial':!![]});if(!_0x16cf56[_0x2a7b37(0x161)])return console[_0x2a7b37(0x134)](_0x2a7b37(0x16f)),0x1;}const _0x2f0c80=loadProfile(_0x492498),_0x51be3d=_0x2f0c80?.[_0x2a7b37(0x16d)]||{};if(_0x23aaba===_0x2a7b37(0x120)){const _0x392b97=resolveSite(_0x6072c9);console['log'](_0x2a7b37(0x183)+_0x392b97+_0x2a7b37(0x119)),console['log'](_0x2a7b37(0x185)),console[_0x2a7b37(0x134)]('\x20\x20'+getConsoleUrl(_0x392b97,'/app/mp/ak'));const _0x5674c5=await a22_0x296651({'type':_0x2a7b37(0x142),'name':_0x2a7b37(0x12d),'message':'Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','validate':_0x4cebf4=>{const _0x5e1452=_0x2a7b37;if(!_0x4cebf4||!_0x4cebf4[_0x5e1452(0x147)]())return _0x5e1452(0x17b);return!![];}});if(!_0x5674c5[_0x2a7b37(0x12d)])return console[_0x2a7b37(0x134)](_0x2a7b37(0x128)),0x1;console['log'](_0x2a7b37(0x15d));try{const _0x3a0037=TDX[_0x2a7b37(0x161)]({'site':_0x392b97,'apiKey':_0x5674c5[_0x2a7b37(0x12d)]['trim'](),'logLevel':_0x53b344[_0x2a7b37(0x176)]??LogLevel['ERROR']}),_0x1d6270=await _0x3a0037[_0x2a7b37(0x151)][_0x2a7b37(0x14c)]();console[_0x2a7b37(0x134)](a22_0x373702[_0x2a7b37(0x15f)]('✓')+_0x2a7b37(0x16e)+_0x1d6270['email']+')');const _0x1181ad=await isKeychainAvailable();_0x1181ad?(await saveAPIKeyAsync(_0x5674c5[_0x2a7b37(0x12d)][_0x2a7b37(0x147)](),_0x392b97,_0x492498),console['log'](a22_0x373702['green']('✓')+_0x2a7b37(0x146))):console['warn'](a22_0x373702[_0x2a7b37(0x131)](_0x2a7b37(0x133))),_0x51be3d[_0x2a7b37(0x120)]=_0x392b97;}catch(_0x21f89a){if(_0x21f89a instanceof HTTPClientError&&_0x21f89a[_0x2a7b37(0x182)]===0x191)return printAuthError(_0x21f89a),0x1;return console[_0x2a7b37(0x17e)](a22_0x373702[_0x2a7b37(0x156)](_0x2a7b37(0x17a)+(_0x21f89a instanceof Error?_0x21f89a[_0x2a7b37(0x14d)]:String(_0x21f89a)))),console[_0x2a7b37(0x17e)](_0x2a7b37(0x169)),0x1;}}else _0x51be3d[_0x23aaba]=_0x6072c9||undefined;return saveProfileToUserConfig(_0x492498,_0x51be3d),console['log'](a22_0x373702[_0x2a7b37(0x15f)]('✓')+_0x2a7b37(0x11d)+_0x492498+_0x2a7b37(0x18c)+_0x23aaba+'='+(_0x6072c9||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a22_0xa81a40(0x15e);[a22_0xa81a40(0x178)]=a22_0xa81a40(0x170);[a22_0xa81a40(0x135)](_0x13797b){const _0x252ca3=a22_0xa81a40,{args:_0x494ee6}=_0x13797b;if(_0x494ee6[_0x252ca3(0x181)]===0x0)return _0x252ca3(0x177);return undefined;}async[a22_0xa81a40(0x172)](_0x13c5b7){const _0x220dc5=a22_0xa81a40,{args:_0x2e4d80,options:_0x117dd}=_0x13c5b7,_0x2a1647=_0x2e4d80[0x0];cleanExpiredSessions();if(!profileExists(_0x2a1647)){console['error'](a22_0x373702[_0x220dc5(0x156)](_0x220dc5(0x150)+_0x2a1647+_0x220dc5(0x143))),console[_0x220dc5(0x134)]('\x0aAvailable\x20profiles:');const _0x245bee=listProfiles();if(_0x245bee['length']===0x0)console[_0x220dc5(0x134)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x509b3e of _0x245bee){console[_0x220dc5(0x134)](_0x220dc5(0x16c)+_0x509b3e[_0x220dc5(0x17d)]);}return 0x1;}const _0x470e3d=_0x117dd[_0x220dc5(0x124)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x2a1647},_0x117dd['session']),console['log'](_0x220dc5(0x179)+a22_0x373702[_0x220dc5(0x15f)](_0x2a1647)+'\x20'+a22_0x373702[_0x220dc5(0x125)](_0x220dc5(0x127)+_0x470e3d+')')),console['log'](a22_0x373702[_0x220dc5(0x125)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}}
@@ -1 +1 @@
1
- const a23_0x4e3a6b=a23_0x4b80;(function(_0x2ca0f3,_0xb315fc){const _0x1137d4=a23_0x4b80,_0x8b4547=_0x2ca0f3();while(!![]){try{const _0x4b0042=parseInt(_0x1137d4(0x152))/0x1+-parseInt(_0x1137d4(0x15a))/0x2+parseInt(_0x1137d4(0x15d))/0x3*(-parseInt(_0x1137d4(0x15e))/0x4)+-parseInt(_0x1137d4(0x160))/0x5+-parseInt(_0x1137d4(0x150))/0x6*(parseInt(_0x1137d4(0x155))/0x7)+-parseInt(_0x1137d4(0x153))/0x8*(-parseInt(_0x1137d4(0x166))/0x9)+-parseInt(_0x1137d4(0x161))/0xa*(-parseInt(_0x1137d4(0x167))/0xb);if(_0x4b0042===_0xb315fc)break;else _0x8b4547['push'](_0x8b4547['shift']());}catch(_0x318c7d){_0x8b4547['push'](_0x8b4547['shift']());}}}(a23_0x14f4,0xca03d));import{BaseCommand}from'./command.js';function a23_0x4b80(_0xfda48b,_0x35ba8){_0xfda48b=_0xfda48b-0x150;const _0x14f459=a23_0x14f4();let _0x4b8051=_0x14f459[_0xfda48b];return _0x4b8051;}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a23_0x4e3a6b(0x15c)]=a23_0x4e3a6b(0x151);[a23_0x4e3a6b(0x157)]='List\x20all\x20available\x20profiles';async[a23_0x4e3a6b(0x162)](_0x1cefa2){const _0x89fdcd=a23_0x4e3a6b,{options:_0x11bdeb}=_0x1cefa2;try{const _0xbdd06b=listProfiles(),_0x5d036c=getActiveProfile();if(_0xbdd06b[_0x89fdcd(0x165)]===0x0)return console[_0x89fdcd(0x156)](_0x89fdcd(0x164)),console['log'](_0x89fdcd(0x15b)),console[_0x89fdcd(0x156)](_0x89fdcd(0x154)),0x0;const _0x244747=_0xbdd06b['map'](_0x1780ea=>{const _0x1875e8=_0x89fdcd,_0x193a57=_0x1780ea[_0x1875e8(0x15c)]===_0x5d036c,_0x108724=getProfileParams(_0x1780ea[_0x1875e8(0x158)]);return{'name':_0x1780ea[_0x1875e8(0x15c)],'active':_0x193a57,'scope':_0x1780ea[_0x1875e8(0x159)],'description':_0x1780ea['config'][_0x1875e8(0x157)]||'','params':_0x108724};});return await handleSDKOutput(_0x244747,_0x11bdeb),0x0;}catch(_0x577993){return _0x577993 instanceof Error&&console[_0x89fdcd(0x163)]('Error:\x20'+_0x577993[_0x89fdcd(0x15f)]),0x1;}}}function a23_0x14f4(){const _0x32b1cb=['1057886SCVwZa','8GufwIG','\x20\x20Global:\x20~/.config/tdx/tdx.json','70UhspFO','log','description','config','scope','1281066qsxCRZ','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','name','21027rufnsq','152uPhpFP','message','2748135vgrZta','14195860JSpZAP','execute','error','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','length','2555217Rsqcbu','11JEpRwH','286458fBXGMc','profiles'];a23_0x14f4=function(){return _0x32b1cb;};return a23_0x14f4();}
1
+ function a23_0x1f32(_0x388f24,_0x2cd02e){_0x388f24=_0x388f24-0x12c;const _0x3b4d81=a23_0x3b4d();let _0x1f3201=_0x3b4d81[_0x388f24];return _0x1f3201;}const a23_0x186193=a23_0x1f32;(function(_0x1459d8,_0x31dbc9){const _0xda9960=a23_0x1f32,_0x172460=_0x1459d8();while(!![]){try{const _0x59f15e=-parseInt(_0xda9960(0x143))/0x1*(-parseInt(_0xda9960(0x13a))/0x2)+parseInt(_0xda9960(0x131))/0x3+-parseInt(_0xda9960(0x13e))/0x4+parseInt(_0xda9960(0x13d))/0x5*(parseInt(_0xda9960(0x139))/0x6)+-parseInt(_0xda9960(0x140))/0x7*(-parseInt(_0xda9960(0x13c))/0x8)+parseInt(_0xda9960(0x12f))/0x9+parseInt(_0xda9960(0x137))/0xa*(-parseInt(_0xda9960(0x135))/0xb);if(_0x59f15e===_0x31dbc9)break;else _0x172460['push'](_0x172460['shift']());}catch(_0x5756b7){_0x172460['push'](_0x172460['shift']());}}}(a23_0x3b4d,0xaee11));import{BaseCommand}from'./command.js';function a23_0x3b4d(){const _0xcc1b13=['7OnCFgs','scope','Error:\x20','1ezGBRM','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','length','description','1072026pSZzqf','\x20\x20Global:\x20~/.config/tdx/tdx.json','4064424MTYkbD','config','log','execute','792imIYic','name','258260pEZJZM','map','12pXQYQz','734434xSOOUq','profiles','1691320rwYtAq','3404330fGTBpx','3354036HkFpHz','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'];a23_0x3b4d=function(){return _0xcc1b13;};return a23_0x3b4d();}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{['name']=a23_0x186193(0x13b);[a23_0x186193(0x12e)]='List\x20all\x20available\x20profiles';async[a23_0x186193(0x134)](_0xfba1c4){const _0x47c186=a23_0x186193,{options:_0xccf24e}=_0xfba1c4;try{const _0x5be8a2=listProfiles(),_0x4cbb36=getActiveProfile();if(_0x5be8a2[_0x47c186(0x12d)]===0x0)return console[_0x47c186(0x133)](_0x47c186(0x13f)),console['log'](_0x47c186(0x12c)),console[_0x47c186(0x133)](_0x47c186(0x130)),0x0;const _0x4d41d2=_0x5be8a2[_0x47c186(0x138)](_0x42e976=>{const _0xc535e7=_0x47c186,_0x42629e=_0x42e976[_0xc535e7(0x136)]===_0x4cbb36,_0x207a9d=getProfileParams(_0x42e976[_0xc535e7(0x132)]);return{'name':_0x42e976[_0xc535e7(0x136)],'active':_0x42629e,'scope':_0x42e976[_0xc535e7(0x141)],'description':_0x42e976[_0xc535e7(0x132)][_0xc535e7(0x12e)]||'','params':_0x207a9d};});return await handleSDKOutput(_0x4d41d2,_0xccf24e),0x0;}catch(_0x546945){return _0x546945 instanceof Error&&console['error'](_0x47c186(0x142)+_0x546945['message']),0x1;}}}
@@ -1 +1 @@
1
- const a24_0x56fced=a24_0x215a;(function(_0x3f4d90,_0x2f79d4){const _0x5a260f=a24_0x215a,_0x38e774=_0x3f4d90();while(!![]){try{const _0x49081f=-parseInt(_0x5a260f(0x105))/0x1+parseInt(_0x5a260f(0x12a))/0x2*(parseInt(_0x5a260f(0x108))/0x3)+parseInt(_0x5a260f(0x120))/0x4+-parseInt(_0x5a260f(0x122))/0x5+-parseInt(_0x5a260f(0x10b))/0x6+-parseInt(_0x5a260f(0xff))/0x7*(-parseInt(_0x5a260f(0x127))/0x8)+-parseInt(_0x5a260f(0x117))/0x9*(-parseInt(_0x5a260f(0x10f))/0xa);if(_0x49081f===_0x2f79d4)break;else _0x38e774['push'](_0x38e774['shift']());}catch(_0x5ae90c){_0x38e774['push'](_0x38e774['shift']());}}}(a24_0x2506,0xb8b8a));function a24_0x2506(){const _0x2cc9a9=['Schema:\x20','Catalog:\x20','288vQGfLf','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','elapsedTimeMillis','8564fBBxMB','name','join','Executing\x20statement\x20','stats','Run\x20Trino\x20queries\x20(streaming)','Query\x20completed:\x20Processed\x20','processedRows','completedSplits','SQL:\x20','273931lnVDOn','originalMessage','jobId','\x0aAll\x20results\x20saved\x20to\x20','length','information_schema','1323746ieqbBH','in\x20','setJobId','372qmSuNn','No\x20SQL\x20provided','Executing\x20query\x20[','964074SrpwpG','database','Error:\x20','data','40pgYZNA','state','Site:\x20','verbose','catalog','options','error','description','234288GFnvgO','\x20[Job\x20ID:\x20','...','output','push','Executing\x20query...','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','execute','file','3071188iEjzgD','Statement\x20','2853190GaTZxQ','validate','\x20rows\x20'];a24_0x2506=function(){return _0x2cc9a9;};return a24_0x2506();}import{BaseCommand}from'./command.js';function a24_0x215a(_0x427c49,_0x8f924){_0x427c49=_0x427c49-0xf7;const _0x2506cf=a24_0x2506();let _0x215af3=_0x2506cf[_0x427c49];return _0x215af3;}import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a24_0x56fced(0x12b)]='query';[a24_0x56fced(0x116)]=a24_0x56fced(0xfa);async[a24_0x56fced(0x11e)](_0x5cd2b4){const _0x32c8de=a24_0x56fced,{options:_0x4d6825,args:_0x5451ba,tdx:_0x4e4f1f}=_0x5cd2b4,_0x2a77e3=_0x5451ba[0x0],_0x1830bd=_0x4d6825[_0x32c8de(0x11f)];let _0x434582;try{if(_0x1830bd)_0x434582=readSqlStatementsFromFile(_0x1830bd);else{if(_0x2a77e3==='-')_0x434582=await readSqlStatementsFromStdin();else{if(_0x2a77e3&&isSqlFilePath(_0x2a77e3))_0x434582=readSqlStatementsFromFile(_0x2a77e3);else{if(_0x2a77e3)_0x434582=splitSqlStatements(_0x2a77e3);else throw new Error(_0x32c8de(0x109));}}}}catch(_0x2e7a36){return console[_0x32c8de(0x115)](_0x32c8de(0x10d)+_0x2e7a36['message']),0x1;}const _0x26c652=_0x4d6825[_0x32c8de(0x10c)]||_0x32c8de(0x104),_0x27ace8=_0x4d6825[_0x32c8de(0x113)];try{const _0x3197a8=[],_0x2346e8=!!_0x4d6825[_0x32c8de(0x11a)];for(let _0x12cd0d=0x0;_0x12cd0d<_0x434582[_0x32c8de(0x103)];_0x12cd0d++){const _0x4ca697=_0x434582[_0x12cd0d],_0x3a3896=_0x12cd0d+0x1,_0x362df7=_0x434582['length'],_0x554e4e=_0x362df7>0x1;_0x4d6825['verbose']&&(console[_0x32c8de(0x115)]('\x0a'+(_0x554e4e?_0x32c8de(0x121)+_0x3a3896+'/'+_0x362df7+':':'')),console[_0x32c8de(0x115)](_0x32c8de(0x111)+_0x4d6825['site']),console[_0x32c8de(0x115)](_0x32c8de(0x126)+(_0x27ace8||'td')),console[_0x32c8de(0x115)](_0x32c8de(0x125)+_0x26c652),console[_0x32c8de(0x115)](_0x32c8de(0xfe)+_0x4ca697));const _0x4595e2=_0x554e4e?_0x32c8de(0xf8)+_0x3a3896+'/'+_0x362df7+_0x32c8de(0x119):_0x32c8de(0x11c);try{const _0x337c9a=await withProgressSpinner(_0x4595e2,async _0x428235=>{const _0x3e0851=await _0x4e4f1f['query']['execute'](_0x4ca697,{'catalog':_0x27ace8,'schema':_0x26c652,'onJobId':_0x738f9=>{const _0x2a76b9=a24_0x215a;_0x428235[_0x2a76b9(0x107)](_0x738f9);},'onProgress':_0x5aaef1=>{const _0x520e73=a24_0x215a;_0x428235['setPhase'](_0x520e73(0x10a)+_0x5aaef1[_0x520e73(0x110)]+']'),_0x428235['setExtra'](formatRows(_0x5aaef1[_0x520e73(0xfc)])+'\x20rows\x20'+_0x5aaef1[_0x520e73(0xfd)]+'/'+_0x5aaef1['totalSplits']+'\x20splits');}});return _0x3e0851;},{'verbose':_0x4d6825[_0x32c8de(0x112)]}),_0x4482b2=_0x337c9a[_0x32c8de(0x10e)],_0x2deb17=_0x4482b2[_0x32c8de(0x101)]?_0x32c8de(0x118)+_0x4482b2[_0x32c8de(0x101)]+']':'',_0x2c656e=_0x554e4e?_0x32c8de(0x121)+_0x3a3896+'/'+_0x362df7+'\x20-\x20':'';console['error']('✔\x20'+_0x2c656e+_0x32c8de(0xfb)+formatRows(_0x4482b2[_0x32c8de(0xf9)][_0x32c8de(0xfc)])+_0x32c8de(0x124)+(_0x32c8de(0x106)+formatElapsed(_0x4482b2[_0x32c8de(0xf9)][_0x32c8de(0x129)])+_0x2deb17));if(_0x554e4e&&_0x2346e8){const _0xa9527=resolveOutputOptions(_0x4d6825),_0x934983=await formatQueryOutput(_0x4482b2,_0xa9527);_0x3197a8[_0x32c8de(0x11b)](_0x934983);}else await handleQueryOutput(_0x4482b2,_0x4d6825);}catch(_0x29d506){const _0xad31df=_0x554e4e?'Statement\x20'+_0x3a3896+'/'+_0x362df7+':\x0a':'',_0x675fb5=_0x29d506 instanceof SDKError?_0x29d506[_0x32c8de(0x100)]:_0x29d506['message'];return console['error'](''+_0xad31df+_0x675fb5),0x1;}}if(_0x434582[_0x32c8de(0x103)]>0x1&&_0x2346e8&&_0x3197a8[_0x32c8de(0x103)]>0x0){const _0x1e66ff=_0x3197a8[_0x32c8de(0xf7)]('\x0a');writeFileSync(_0x4d6825[_0x32c8de(0x11a)],_0x1e66ff),console[_0x32c8de(0x115)](_0x32c8de(0x102)+_0x4d6825[_0x32c8de(0x11a)]);}return 0x0;}catch(_0x333743){throw _0x333743;}}[a24_0x56fced(0x123)](_0x12260e){const _0xf81aa6=a24_0x56fced,_0x352b41=_0x12260e['args'][0x0],_0x23a647=_0x12260e[_0xf81aa6(0x114)]['file'];if(!_0x352b41&&!_0x23a647)return _0xf81aa6(0x11d);if(_0x352b41&&_0x23a647)return _0xf81aa6(0x128);return undefined;}}
1
+ const a24_0xafee6c=a24_0xba19;function a24_0x13a4(){const _0x34bf3e=['1098412bqKXys','site','state','Executing\x20query\x20[','6983019izbOOS','output','totalSplits','setJobId','message','length','10beTOqi','stats','...','19914059hhzaOt','5kvmNKd','\x20rows\x20','completedSplits','name','631716kferBt','Error:\x20','6dSKirj','catalog','SQL:\x20','processedRows','No\x20SQL\x20provided','\x20[Job\x20ID:\x20','elapsedTimeMillis','error','Executing\x20query...','args','execute','data','Schema:\x20','Catalog:\x20','query','options','Statement\x20','validate','in\x20','12014512FtFvuu','information_schema','database','\x20-\x20','2ApLksh','file','842463filcHV','Run\x20Trino\x20queries\x20(streaming)','5818127ZkKnAS','setExtra'];a24_0x13a4=function(){return _0x34bf3e;};return a24_0x13a4();}(function(_0xa6bc92,_0x4d22c3){const _0x84c1c7=a24_0xba19,_0x1fc108=_0xa6bc92();while(!![]){try{const _0x24277c=parseInt(_0x84c1c7(0xee))/0x1*(parseInt(_0x84c1c7(0x106))/0x2)+parseInt(_0x84c1c7(0xf0))/0x3+-parseInt(_0x84c1c7(0xf4))/0x4*(-parseInt(_0x84c1c7(0x102))/0x5)+-parseInt(_0x84c1c7(0x108))/0x6*(parseInt(_0x84c1c7(0xf2))/0x7)+parseInt(_0x84c1c7(0xea))/0x8+parseInt(_0x84c1c7(0xf8))/0x9+-parseInt(_0x84c1c7(0xfe))/0xa*(parseInt(_0x84c1c7(0x101))/0xb);if(_0x24277c===_0x4d22c3)break;else _0x1fc108['push'](_0x1fc108['shift']());}catch(_0x492bff){_0x1fc108['push'](_0x1fc108['shift']());}}}(a24_0x13a4,0xc9013));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';function a24_0xba19(_0x529ad1,_0x28d9bc){_0x529ad1=_0x529ad1-0xdc;const _0x13a4f0=a24_0x13a4();let _0xba19e4=_0x13a4f0[_0x529ad1];return _0xba19e4;}import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a24_0xafee6c(0x105)]=a24_0xafee6c(0xe5);['description']=a24_0xafee6c(0xf1);async[a24_0xafee6c(0xe1)](_0x2149ec){const _0x5098e8=a24_0xafee6c,{options:_0x22b08b,args:_0x5c477b,tdx:_0x2c34cb}=_0x2149ec,_0x712abd=_0x5c477b[0x0],_0xfcba14=_0x22b08b[_0x5098e8(0xef)];let _0xeadf8c;try{if(_0xfcba14)_0xeadf8c=readSqlStatementsFromFile(_0xfcba14);else{if(_0x712abd==='-')_0xeadf8c=await readSqlStatementsFromStdin();else{if(_0x712abd&&isSqlFilePath(_0x712abd))_0xeadf8c=readSqlStatementsFromFile(_0x712abd);else{if(_0x712abd)_0xeadf8c=splitSqlStatements(_0x712abd);else throw new Error(_0x5098e8(0x10c));}}}}catch(_0x51c911){return console['error'](_0x5098e8(0x107)+_0x51c911[_0x5098e8(0xfc)]),0x1;}const _0x1e39de=_0x22b08b[_0x5098e8(0xec)]||_0x5098e8(0xeb),_0x244aec=_0x22b08b[_0x5098e8(0x109)];try{const _0x239b00=[],_0x49d048=!!_0x22b08b[_0x5098e8(0xf9)];for(let _0x4ded98=0x0;_0x4ded98<_0xeadf8c[_0x5098e8(0xfd)];_0x4ded98++){const _0x41366f=_0xeadf8c[_0x4ded98],_0x475d2f=_0x4ded98+0x1,_0x19ff6d=_0xeadf8c[_0x5098e8(0xfd)],_0x21f6ff=_0x19ff6d>0x1;_0x22b08b['verbose']&&(console['error']('\x0a'+(_0x21f6ff?_0x5098e8(0xe7)+_0x475d2f+'/'+_0x19ff6d+':':'')),console[_0x5098e8(0xde)]('Site:\x20'+_0x22b08b[_0x5098e8(0xf5)]),console[_0x5098e8(0xde)](_0x5098e8(0xe4)+(_0x244aec||'td')),console[_0x5098e8(0xde)](_0x5098e8(0xe3)+_0x1e39de),console[_0x5098e8(0xde)](_0x5098e8(0x10a)+_0x41366f));const _0x5a5f8c=_0x21f6ff?'Executing\x20statement\x20'+_0x475d2f+'/'+_0x19ff6d+_0x5098e8(0x100):_0x5098e8(0xdf);try{const _0x7d990e=await withProgressSpinner(_0x5a5f8c,async _0x5b4676=>{const _0x158628=_0x5098e8,_0x16ff0c=await _0x2c34cb['query'][_0x158628(0xe1)](_0x41366f,{'catalog':_0x244aec,'schema':_0x1e39de,'onJobId':_0x3082e1=>{const _0x2fa51d=_0x158628;_0x5b4676[_0x2fa51d(0xfb)](_0x3082e1);},'onProgress':_0xc8a564=>{const _0x3734aa=_0x158628;_0x5b4676['setPhase'](_0x3734aa(0xf7)+_0xc8a564[_0x3734aa(0xf6)]+']'),_0x5b4676[_0x3734aa(0xf3)](formatRows(_0xc8a564[_0x3734aa(0x10b)])+_0x3734aa(0x103)+_0xc8a564[_0x3734aa(0x104)]+'/'+_0xc8a564[_0x3734aa(0xfa)]+'\x20splits');}});return _0x16ff0c;},{'verbose':_0x22b08b['verbose']}),_0x499428=_0x7d990e[_0x5098e8(0xe2)],_0x21719d=_0x499428['jobId']?_0x5098e8(0xdc)+_0x499428['jobId']+']':'',_0xd98b59=_0x21f6ff?'Statement\x20'+_0x475d2f+'/'+_0x19ff6d+_0x5098e8(0xed):'';console[_0x5098e8(0xde)]('✔\x20'+_0xd98b59+'Query\x20completed:\x20Processed\x20'+formatRows(_0x499428['stats'][_0x5098e8(0x10b)])+_0x5098e8(0x103)+(_0x5098e8(0xe9)+formatElapsed(_0x499428[_0x5098e8(0xff)][_0x5098e8(0xdd)])+_0x21719d));if(_0x21f6ff&&_0x49d048){const _0x1029a2=resolveOutputOptions(_0x22b08b),_0x190206=await formatQueryOutput(_0x499428,_0x1029a2);_0x239b00['push'](_0x190206);}else await handleQueryOutput(_0x499428,_0x22b08b);}catch(_0xa7f106){const _0x54ae6d=_0x21f6ff?_0x5098e8(0xe7)+_0x475d2f+'/'+_0x19ff6d+':\x0a':'',_0x13637a=_0xa7f106 instanceof SDKError?_0xa7f106['originalMessage']:_0xa7f106[_0x5098e8(0xfc)];return console['error'](''+_0x54ae6d+_0x13637a),0x1;}}if(_0xeadf8c[_0x5098e8(0xfd)]>0x1&&_0x49d048&&_0x239b00[_0x5098e8(0xfd)]>0x0){const _0x4f291a=_0x239b00['join']('\x0a');writeFileSync(_0x22b08b['output'],_0x4f291a),console['error']('\x0aAll\x20results\x20saved\x20to\x20'+_0x22b08b['output']);}return 0x0;}catch(_0x5e1f20){throw _0x5e1f20;}}[a24_0xafee6c(0xe8)](_0x4ae42f){const _0xac285b=a24_0xafee6c,_0x4bb30c=_0x4ae42f[_0xac285b(0xe0)][0x0],_0x29d801=_0x4ae42f[_0xac285b(0xe6)][_0xac285b(0xef)];if(!_0x4bb30c&&!_0x29d801)return'Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options';if(_0x4bb30c&&_0x29d801)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}