@treasuredata/tdx 0.8.3 → 0.8.5

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 (176) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/client/cdp-api-client.d.ts +59 -1
  10. package/dist/client/cdp-api-client.d.ts.map +1 -1
  11. package/dist/client/cdp-api-client.js +1 -1
  12. package/dist/client/cdp-api-client.js.map +1 -1
  13. package/dist/client/engage-api-client.js +1 -1
  14. package/dist/client/http-client.js +1 -1
  15. package/dist/client/llm-api-client.js +1 -1
  16. package/dist/client/rate-limiter.js +1 -1
  17. package/dist/client/td-api-client.js +1 -1
  18. package/dist/client/trino-api-client.js +1 -1
  19. package/dist/client/workflow-client.js +1 -1
  20. package/dist/commands/activations.js +1 -1
  21. package/dist/commands/api-command.js +1 -1
  22. package/dist/commands/auth-command.js +1 -1
  23. package/dist/commands/auth-command.js.map +1 -1
  24. package/dist/commands/chat-command.js +1 -1
  25. package/dist/commands/claude-command.d.ts.map +1 -1
  26. package/dist/commands/claude-command.js +1 -1
  27. package/dist/commands/claude-command.js.map +1 -1
  28. package/dist/commands/claude-statusline-command.js +1 -1
  29. package/dist/commands/claude-usage-command.js +1 -1
  30. package/dist/commands/command.js +1 -1
  31. package/dist/commands/connection-command.js +1 -1
  32. package/dist/commands/context-command.js +1 -1
  33. package/dist/commands/databases.js +1 -1
  34. package/dist/commands/describe.js +1 -1
  35. package/dist/commands/engage-command.js +1 -1
  36. package/dist/commands/job-command.js +1 -1
  37. package/dist/commands/journey-command.d.ts +53 -0
  38. package/dist/commands/journey-command.d.ts.map +1 -0
  39. package/dist/commands/journey-command.js +1 -0
  40. package/dist/commands/journey-command.js.map +1 -0
  41. package/dist/commands/llm-command.js +1 -1
  42. package/dist/commands/llm-proxy.d.ts.map +1 -1
  43. package/dist/commands/llm-proxy.js +1 -1
  44. package/dist/commands/llm-proxy.js.map +1 -1
  45. package/dist/commands/parent-segment-command.d.ts.map +1 -1
  46. package/dist/commands/parent-segment-command.js +1 -1
  47. package/dist/commands/parent-segment-command.js.map +1 -1
  48. package/dist/commands/profiles-command.js +1 -1
  49. package/dist/commands/query-command.d.ts.map +1 -1
  50. package/dist/commands/query-command.js +1 -1
  51. package/dist/commands/query-command.js.map +1 -1
  52. package/dist/commands/segment-command.d.ts.map +1 -1
  53. package/dist/commands/segment-command.js +1 -1
  54. package/dist/commands/segment-command.js.map +1 -1
  55. package/dist/commands/segment-create-command.js +1 -1
  56. package/dist/commands/segment-fields-command.js +1 -1
  57. package/dist/commands/segment-pull-command.d.ts.map +1 -1
  58. package/dist/commands/segment-pull-command.js +1 -1
  59. package/dist/commands/segment-pull-command.js.map +1 -1
  60. package/dist/commands/segment-push-command.d.ts.map +1 -1
  61. package/dist/commands/segment-push-command.js +1 -1
  62. package/dist/commands/segment-push-command.js.map +1 -1
  63. package/dist/commands/segment-update-command.js +1 -1
  64. package/dist/commands/segment-use-command.js +1 -1
  65. package/dist/commands/segments.d.ts.map +1 -1
  66. package/dist/commands/segments.js +1 -1
  67. package/dist/commands/segments.js.map +1 -1
  68. package/dist/commands/show.js +1 -1
  69. package/dist/commands/tables.js +1 -1
  70. package/dist/commands/use-command.js +1 -1
  71. package/dist/commands/user-command.js +1 -1
  72. package/dist/commands/workflow-command.js +1 -1
  73. package/dist/core/auth.js +1 -1
  74. package/dist/core/config.js +1 -1
  75. package/dist/core/connection-cache.js +1 -1
  76. package/dist/core/credential-cache.js +1 -1
  77. package/dist/core/global-context.js +1 -1
  78. package/dist/core/keychain.js +1 -1
  79. package/dist/core/profile.js +1 -1
  80. package/dist/core/project-config.js +1 -1
  81. package/dist/core/session.js +1 -1
  82. package/dist/core/user-cache.js +1 -1
  83. package/dist/index.js +1 -1
  84. package/dist/proxy/anthropic-adapter.d.ts +10 -2
  85. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  86. package/dist/proxy/anthropic-adapter.js +1 -1
  87. package/dist/proxy/anthropic-adapter.js.map +1 -1
  88. package/dist/proxy/claude-usage-tracker.js +1 -1
  89. package/dist/proxy/context-signature.js +1 -1
  90. package/dist/proxy/conversation-utils.js +1 -1
  91. package/dist/proxy/server.js +1 -1
  92. package/dist/proxy/session-cache.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/connection.js +1 -1
  95. package/dist/sdk/engage.js +1 -1
  96. package/dist/sdk/errors.d.ts +29 -0
  97. package/dist/sdk/errors.d.ts.map +1 -1
  98. package/dist/sdk/errors.js +1 -1
  99. package/dist/sdk/errors.js.map +1 -1
  100. package/dist/sdk/index.d.ts +7 -0
  101. package/dist/sdk/index.d.ts.map +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/index.js.map +1 -1
  104. package/dist/sdk/job.js +1 -1
  105. package/dist/sdk/journey.d.ts +82 -0
  106. package/dist/sdk/journey.d.ts.map +1 -0
  107. package/dist/sdk/journey.js +1 -0
  108. package/dist/sdk/journey.js.map +1 -0
  109. package/dist/sdk/llm.js +1 -1
  110. package/dist/sdk/query.js +1 -1
  111. package/dist/sdk/segment/child-segment-yaml.d.ts +35 -6
  112. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  113. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  114. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  115. package/dist/sdk/segment/journey-yaml.d.ts +616 -0
  116. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -0
  117. package/dist/sdk/segment/journey-yaml.js +1 -0
  118. package/dist/sdk/segment/journey-yaml.js.map +1 -0
  119. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  120. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  121. package/dist/sdk/segment.js +1 -1
  122. package/dist/sdk/user.js +1 -1
  123. package/dist/sdk/workflow.js +1 -1
  124. package/dist/types/cdp.d.ts +253 -0
  125. package/dist/types/cdp.d.ts.map +1 -1
  126. package/dist/types/endpoints.js +1 -1
  127. package/dist/types/index.d.ts +2 -1
  128. package/dist/types/index.d.ts.map +1 -1
  129. package/dist/types/index.js +1 -1
  130. package/dist/utils/agent-ref-parser.js +1 -1
  131. package/dist/utils/async.js +1 -1
  132. package/dist/utils/chat-cache.js +1 -1
  133. package/dist/utils/colors.js +1 -1
  134. package/dist/utils/command-output.js +1 -1
  135. package/dist/utils/constants.js +1 -1
  136. package/dist/utils/diff.js +1 -1
  137. package/dist/utils/fields-display.js +1 -1
  138. package/dist/utils/file-permissions.js +1 -1
  139. package/dist/utils/format-detector.js +1 -1
  140. package/dist/utils/formatters.js +1 -1
  141. package/dist/utils/json-loader.js +1 -1
  142. package/dist/utils/llm-backup-utils.js +1 -1
  143. package/dist/utils/model-aliases.js +1 -1
  144. package/dist/utils/model-factors.js +1 -1
  145. package/dist/utils/option-validation.js +1 -1
  146. package/dist/utils/port.js +1 -1
  147. package/dist/utils/process.d.ts +6 -0
  148. package/dist/utils/process.d.ts.map +1 -1
  149. package/dist/utils/process.js +1 -1
  150. package/dist/utils/process.js.map +1 -1
  151. package/dist/utils/prompt.js +1 -1
  152. package/dist/utils/segment-path-parser.d.ts +8 -2
  153. package/dist/utils/segment-path-parser.d.ts.map +1 -1
  154. package/dist/utils/segment-path-parser.js +1 -1
  155. package/dist/utils/segment-path-parser.js.map +1 -1
  156. package/dist/utils/segment-ref-parser.js +1 -1
  157. package/dist/utils/spinner.js +1 -1
  158. package/dist/utils/sql-parser.d.ts +37 -1
  159. package/dist/utils/sql-parser.d.ts.map +1 -1
  160. package/dist/utils/sql-parser.js +1 -1
  161. package/dist/utils/sql-parser.js.map +1 -1
  162. package/dist/utils/sse-parser.js +1 -1
  163. package/dist/utils/string-utils.d.ts +12 -0
  164. package/dist/utils/string-utils.d.ts.map +1 -1
  165. package/dist/utils/string-utils.js +1 -1
  166. package/dist/utils/string-utils.js.map +1 -1
  167. package/dist/utils/table-ref-parser.js +1 -1
  168. package/dist/utils/tdx-config.js +1 -1
  169. package/dist/utils/tdx-logger.js +1 -1
  170. package/dist/utils/tree-formatter.d.ts +4 -0
  171. package/dist/utils/tree-formatter.d.ts.map +1 -1
  172. package/dist/utils/tree-formatter.js +1 -1
  173. package/dist/utils/tree-formatter.js.map +1 -1
  174. package/dist/utils/version-check.js +1 -1
  175. package/dist/utils/workflow-utils.js +1 -1
  176. package/package.json +3 -3
@@ -1 +1 @@
1
- const a26_0x4305ea=a26_0x2cbb;(function(_0x1fbd70,_0xb74230){const _0x5080b0=a26_0x2cbb,_0x370cec=_0x1fbd70();while(!![]){try{const _0x5c3062=-parseInt(_0x5080b0(0xd4))/0x1*(parseInt(_0x5080b0(0xa8))/0x2)+parseInt(_0x5080b0(0xa0))/0x3+-parseInt(_0x5080b0(0xdc))/0x4+parseInt(_0x5080b0(0xc0))/0x5*(-parseInt(_0x5080b0(0xb7))/0x6)+-parseInt(_0x5080b0(0xb9))/0x7*(parseInt(_0x5080b0(0xb5))/0x8)+-parseInt(_0x5080b0(0xda))/0x9+-parseInt(_0x5080b0(0xaf))/0xa*(-parseInt(_0x5080b0(0xa4))/0xb);if(_0x5c3062===_0xb74230)break;else _0x370cec['push'](_0x370cec['shift']());}catch(_0x18129e){_0x370cec['push'](_0x370cec['shift']());}}}(a26_0x4631,0x28585));function a26_0x4631(){const _0x3cbd97=['Project\x20\x27','white','21TaXdtY','✓\x20Proxy\x20server\x20stopped','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','\x20\x20\x20\x20}','Resolving\x20project...','2621601xrqNhk','name','386760XSifol','cyan','llm','find','\x20is\x20unavailable,\x20using\x20port\x20','green','\x0a\x0aShutting\x20down\x20proxy\x20server...','\x20\x20}','849378crXKEi','exit','port','llmProject','682110nuZpoo','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','yellow','9990pPMCdN','llm:proxy','SIGINT','created\x20on-demand\x20per\x20model','\x20\x20Site:','close','project','160UrAOrC','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','log','SIGTERM','Server\x20Configuration:','1880ZwkjCk','\x20\x20Agents:','7608auRqBf','\x20\x20\x20\x20\x22env\x22:\x20{','9583eTUQKm','getOrCreateDefaultProject','site','dim','logger','bold','init','1165pkHceD','\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a','description','stop','\x20\x20{','projects','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22','\x0aTesting\x20with\x20Agent\x20SDK:','\x0aClaude\x20Code\x20Configuration:','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','Port\x20','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','logLevel','\x27\x20not\x20found','\x20\x20Address:','attributes','server'];a26_0x4631=function(){return _0x3cbd97;};return a26_0x4631();}import a26_0x36240e from'chalk';function a26_0x2cbb(_0x175973,_0x3c2d8a){_0x175973=_0x175973-0x99;const _0x46313f=a26_0x4631();let _0x2cbb10=_0x46313f[_0x175973];return _0x2cbb10;}import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x4ef6a2,_0x13966a){const _0x73005f=a26_0x2cbb,{tdx:_0x2c2c46,options:_0x338510}=_0x4ef6a2,_0x37baf8=_0x13966a||_0x338510[_0x73005f(0xa3)];if(_0x37baf8){const _0x189edf=await _0x2c2c46['llm'][_0x73005f(0xc5)](),_0x28897b=_0x189edf[_0x73005f(0x9b)](_0x1dbc8b=>_0x1dbc8b[_0x73005f(0xd0)][_0x73005f(0xdb)]===_0x37baf8);if(!_0x28897b)throw new SDKError(ErrorCode['NOT_FOUND'],_0x73005f(0xd2)+_0x37baf8+_0x73005f(0xce),undefined,{'helpText':_0x73005f(0xc9)});return _0x28897b['id'];}const _0x3cb8af=await _0x2c2c46[_0x73005f(0x9a)][_0x73005f(0xba)]();return _0x3cb8af['id'];}export class LLMProxyCommand extends BaseCommand{[a26_0x4305ea(0xdb)]=a26_0x4305ea(0xa9);[a26_0x4305ea(0xc2)]='[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration';[a26_0x4305ea(0xd1)];['logger'];async['execute'](_0x171e01){const _0x4a6b14=a26_0x4305ea,{tdx:_0x2223ce,options:_0x4ecaf2}=_0x171e01;try{const _0x1e0fcd=_0x4ecaf2,_0x1e6359=_0x1e0fcd[_0x4a6b14(0xa2)]||0xfa0,_0x105dca=_0x1e0fcd[_0x4a6b14(0xae)],_0x37de82=await findAvailablePort(_0x1e6359);console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xd9)));const _0x22264f=await getProjectIdOrDefault(_0x171e01,_0x105dca),_0x39b97c=await _0x2223ce[_0x4a6b14(0x9a)]['projects'](),_0x8d0a9a=_0x39b97c[_0x4a6b14(0x9b)](_0x5b4a26=>_0x5b4a26['id']===_0x22264f);this[_0x4a6b14(0xbd)]=new TDXLogger(_0x4ecaf2[_0x4a6b14(0xcd)]),await this[_0x4a6b14(0xbd)][_0x4a6b14(0xbf)](),console[_0x4a6b14(0xb2)](a26_0x36240e['dim']('Starting\x20proxy\x20server...'));_0x37de82!==_0x1e6359&&console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xa7)](_0x4a6b14(0xcb)+_0x1e6359+_0x4a6b14(0x9c)+_0x37de82));this['server']=new ProxyServer({'port':_0x37de82,'projectId':_0x22264f,'tdx':_0x2223ce,'logger':this[_0x4a6b14(0xbd)],'site':_0x4ecaf2[_0x4a6b14(0xbb)]}),await this['server']['start'](),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xa7)]['bold'](_0x4a6b14(0xa6))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xa7)](_0x4a6b14(0xa5))),console['log'](a26_0x36240e[_0x4a6b14(0xa7)](_0x4a6b14(0xcc))),console['log'](a26_0x36240e['green'][_0x4a6b14(0xbe)](_0x4a6b14(0xd7))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0x99)](_0x4a6b14(0xb4))),console['log'](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xcf)),a26_0x36240e['white']('http://0.0.0.0:'+_0x37de82)),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xbc)]('\x20\x20Project:'),a26_0x36240e[_0x4a6b14(0xd3)](_0x8d0a9a?.['attributes'][_0x4a6b14(0xdb)]||_0x22264f)),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xb6)),a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0xab))),console['log'](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xac)),a26_0x36240e[_0x4a6b14(0xd3)](_0x4ecaf2[_0x4a6b14(0xbb)])),console['log'](a26_0x36240e[_0x4a6b14(0x99)](_0x4a6b14(0xc8))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xc1))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0xc4))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0xb8))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0xb1)+_0x37de82+'\x22,')),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0xc6))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0xd8))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xd3)](_0x4a6b14(0x9f))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0x99)](_0x4a6b14(0xc7))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xca))),console[_0x4a6b14(0xb2)](a26_0x36240e[_0x4a6b14(0xbc)]('\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript')),console['log'](a26_0x36240e[_0x4a6b14(0xbc)](_0x4a6b14(0xd6))),console['log'](a26_0x36240e[_0x4a6b14(0xa7)](_0x4a6b14(0xb0)));const _0x4e6c31=async()=>{const _0x510e84=_0x4a6b14;console[_0x510e84(0xb2)](a26_0x36240e[_0x510e84(0xbc)](_0x510e84(0x9e))),this['server']&&await this[_0x510e84(0xd1)][_0x510e84(0xc3)](),this[_0x510e84(0xbd)]&&await this[_0x510e84(0xbd)][_0x510e84(0xad)](),console['log'](a26_0x36240e[_0x510e84(0x9d)](_0x510e84(0xd5))),process[_0x510e84(0xa1)](0x0);};return process['on'](_0x4a6b14(0xaa),_0x4e6c31),process['on'](_0x4a6b14(0xb3),_0x4e6c31),await new Promise(()=>{}),0x0;}catch(_0x1da363){this[_0x4a6b14(0xd1)]&&await this[_0x4a6b14(0xd1)]['stop']();this['logger']&&await this[_0x4a6b14(0xbd)][_0x4a6b14(0xad)]();throw _0x1da363;}}}
1
+ const a27_0x368b25=a27_0xecf5;(function(_0x1fb2d9,_0x327fff){const _0xe41229=a27_0xecf5,_0x2e9557=_0x1fb2d9();while(!![]){try{const _0x4b797d=parseInt(_0xe41229(0x1b3))/0x1+parseInt(_0xe41229(0x198))/0x2*(parseInt(_0xe41229(0x197))/0x3)+parseInt(_0xe41229(0x1c2))/0x4+parseInt(_0xe41229(0x19b))/0x5*(parseInt(_0xe41229(0x1b6))/0x6)+parseInt(_0xe41229(0x19e))/0x7*(-parseInt(_0xe41229(0x18f))/0x8)+-parseInt(_0xe41229(0x1a0))/0x9*(parseInt(_0xe41229(0x190))/0xa)+parseInt(_0xe41229(0x1a5))/0xb;if(_0x4b797d===_0x327fff)break;else _0x2e9557['push'](_0x2e9557['shift']());}catch(_0x518f66){_0x2e9557['push'](_0x2e9557['shift']());}}}(a27_0x24a2,0xaea32));import a27_0x34e2da from'chalk';import{BaseCommand}from'./command.js';import{ProxyServer}from'../proxy/server.js';function a27_0x24a2(){const _0x1e3f7f=['execute','SIGTERM','bold','\x0aTesting\x20with\x20Agent\x20SDK:','log','white','Project\x20\x27','Server\x20Configuration:','find','logger','\x20\x20{','\x20\x20Project:','995288RBpBDc','\x20\x20Address:','Please\x20report\x20issues\x20at:\x20https://github.com/treasure-data/tdx/issues\x0a','853212ypuMLa','\x0a\x0aShutting\x20down\x20proxy\x20server...','llm','stop','✓\x20TD\x20LLM\x20Proxy\x20Server\x20is\x20running!\x0a','attributes','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_MODEL\x22:\x20\x22sonnet\x22,','Press\x20Ctrl+C\x20to\x20stop\x20the\x20server\x0a','\x27\x20not\x20found','\x20\x20Agents:','close','created\x20on-demand\x20per\x20model','1284680icsXFh','name','This\x20proxy\x20server\x20is\x20experimental\x20and\x20may\x20have\x20limitations.','description','cyan','dim','\x0aClaude\x20Code\x20Configuration:','Port\x20','NOT_FOUND','\x20\x20Site:','port','\x20\x20The\x20SDK\x20reads\x20.claude/settings.json\x20for\x20ANTHROPIC_BASE_URL\x0a','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_BASE_URL\x22:\x20\x22http://127.0.0.1:','server','25784dyoPdb','10beDVKG','Resolving\x20project...','exit','site','\x20\x20\x20\x20\x20\x20\x22ANTHROPIC_AUTH_TOKEN\x22:\x20\x22tdx-managed-proxy\x22','✓\x20Proxy\x20server\x20stopped','\x20is\x20unavailable,\x20using\x20port\x20','1668363kJQDjI','2iFVayQ','\x0a⚠️\x20\x20EXPERIMENTAL\x20FEATURE','start','5wrXDje','http://0.0.0.0:','\x20\x20The\x20proxy\x20can\x20also\x20be\x20tested\x20with\x20Claude\x20Agent\x20SDK','2541pqNLwx','projects','7607169UqKMCB','init','green','llmProject','yellow','7872953TOdxHj','Starting\x20proxy\x20server...'];a27_0x24a2=function(){return _0x1e3f7f;};return a27_0x24a2();}import{TDXLogger}from'../utils/tdx-logger.js';function a27_0xecf5(_0x1b52c6,_0x370525){_0x1b52c6=_0x1b52c6-0x18f;const _0x24a243=a27_0x24a2();let _0xecf53e=_0x24a243[_0x1b52c6];return _0xecf53e;}import{SDKError,ErrorCode}from'../sdk/errors.js';import{findAvailablePort}from'../utils/port.js';async function getProjectIdOrDefault(_0x1da8a8,_0x3bdf13){const _0x132090=a27_0xecf5,{tdx:_0x139628,options:_0x213bd0}=_0x1da8a8,_0x49dd76=_0x3bdf13||_0x213bd0[_0x132090(0x1a3)];if(_0x49dd76){const _0x51438a=await _0x139628[_0x132090(0x1b8)][_0x132090(0x19f)](),_0x13d93e=_0x51438a['find'](_0x4597a0=>_0x4597a0[_0x132090(0x1bb)][_0x132090(0x1c3)]===_0x49dd76);if(!_0x13d93e)throw new SDKError(ErrorCode[_0x132090(0x1ca)],_0x132090(0x1ad)+_0x49dd76+_0x132090(0x1be),undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20see\x20available\x20projects'});return _0x13d93e['id'];}const _0x140038=await _0x139628[_0x132090(0x1b8)]['getOrCreateDefaultProject']();return _0x140038['id'];}export class LLMProxyCommand extends BaseCommand{[a27_0x368b25(0x1c3)]='llm:proxy';[a27_0x368b25(0x1c5)]='[EXPERIMENTAL]\x20Start\x20LLM\x20proxy\x20server\x20for\x20Claude\x20Code\x20integration';[a27_0x368b25(0x1cf)];[a27_0x368b25(0x1b0)];async[a27_0x368b25(0x1a7)](_0x1d95ba){const _0xf5164b=a27_0x368b25,{tdx:_0x2c39b0,options:_0x5c13d1}=_0x1d95ba;try{const _0x5777dd=_0x5c13d1,_0x5351f9=_0x5777dd[_0xf5164b(0x1cc)]||0xfa0,_0x3d2955=_0x5777dd['project'],_0x248932=await findAvailablePort(_0x5351f9);console['log'](a27_0x34e2da[_0xf5164b(0x1c7)](_0xf5164b(0x191)));const _0x19cd08=await getProjectIdOrDefault(_0x1d95ba,_0x3d2955),_0x5c52b8=await _0x2c39b0['llm'][_0xf5164b(0x19f)](),_0xf02461=_0x5c52b8[_0xf5164b(0x1af)](_0x5123ff=>_0x5123ff['id']===_0x19cd08);this['logger']=new TDXLogger(_0x5c13d1['logLevel']),await this['logger'][_0xf5164b(0x1a1)](),console['log'](a27_0x34e2da['dim'](_0xf5164b(0x1a6)));_0x248932!==_0x5351f9&&console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1a4)](_0xf5164b(0x1c9)+_0x5351f9+_0xf5164b(0x196)+_0x248932));this[_0xf5164b(0x1cf)]=new ProxyServer({'port':_0x248932,'projectId':_0x19cd08,'tdx':_0x2c39b0,'logger':this[_0xf5164b(0x1b0)],'site':_0x5c13d1[_0xf5164b(0x193)]}),await this[_0xf5164b(0x1cf)][_0xf5164b(0x19a)](),console['log'](a27_0x34e2da['yellow'][_0xf5164b(0x1a9)](_0xf5164b(0x199))),console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1a4)](_0xf5164b(0x1c4))),console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1a4)](_0xf5164b(0x1b5))),console[_0xf5164b(0x1ab)](a27_0x34e2da['green'][_0xf5164b(0x1a9)](_0xf5164b(0x1ba))),console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1c6)](_0xf5164b(0x1ae))),console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1c7)](_0xf5164b(0x1b4)),a27_0x34e2da[_0xf5164b(0x1ac)](_0xf5164b(0x19c)+_0x248932)),console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1c7)](_0xf5164b(0x1b2)),a27_0x34e2da[_0xf5164b(0x1ac)](_0xf02461?.[_0xf5164b(0x1bb)][_0xf5164b(0x1c3)]||_0x19cd08)),console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1c7)](_0xf5164b(0x1bf)),a27_0x34e2da['white'](_0xf5164b(0x1c1))),console['log'](a27_0x34e2da[_0xf5164b(0x1c7)](_0xf5164b(0x1cb)),a27_0x34e2da['white'](_0x5c13d1['site'])),console[_0xf5164b(0x1ab)](a27_0x34e2da['cyan'](_0xf5164b(0x1c8))),console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1c7)]('\x20\x20Create\x20a\x20.claude/settings.local.json\x20file\x20with:\x0a')),console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1ac)](_0xf5164b(0x1b1))),console['log'](a27_0x34e2da[_0xf5164b(0x1ac)]('\x20\x20\x20\x20\x22env\x22:\x20{')),console[_0xf5164b(0x1ab)](a27_0x34e2da['white'](_0xf5164b(0x1ce)+_0x248932+'\x22,')),console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1ac)](_0xf5164b(0x1bc))),console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1ac)](_0xf5164b(0x194))),console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1ac)]('\x20\x20\x20\x20}')),console['log'](a27_0x34e2da[_0xf5164b(0x1ac)]('\x20\x20}')),console[_0xf5164b(0x1ab)](a27_0x34e2da[_0xf5164b(0x1c6)](_0xf5164b(0x1aa))),console[_0xf5164b(0x1ab)](a27_0x34e2da['dim'](_0xf5164b(0x19d))),console[_0xf5164b(0x1ab)](a27_0x34e2da['dim']('\x20\x20https://docs.claude.com/en/docs/agent-sdk/typescript')),console[_0xf5164b(0x1ab)](a27_0x34e2da['dim'](_0xf5164b(0x1cd))),console['log'](a27_0x34e2da['yellow'](_0xf5164b(0x1bd)));const _0x5b3c5a=async()=>{const _0x198113=_0xf5164b;console[_0x198113(0x1ab)](a27_0x34e2da[_0x198113(0x1c7)](_0x198113(0x1b7))),this['server']&&await this[_0x198113(0x1cf)][_0x198113(0x1b9)](),this[_0x198113(0x1b0)]&&await this['logger'][_0x198113(0x1c0)](),console['log'](a27_0x34e2da[_0x198113(0x1a2)](_0x198113(0x195))),process[_0x198113(0x192)](0x0);};return process['on']('SIGINT',_0x5b3c5a),process['on'](_0xf5164b(0x1a8),_0x5b3c5a),await new Promise(()=>{}),0x0;}catch(_0x35e667){this[_0xf5164b(0x1cf)]&&await this[_0xf5164b(0x1cf)][_0xf5164b(0x1b9)]();this[_0xf5164b(0x1b0)]&&await this[_0xf5164b(0x1b0)]['close']();throw _0x35e667;}}}
@@ -1 +1 @@
1
- {"version":3,"file":"llm-proxy.js","sourceRoot":"","sources":["../../src/commands/llm-proxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAuB,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAWrD;;GAEG;AACH,KAAK,UAAU,qBAAqB,CAClC,OAAuB,EACvB,WAAoB;IAEpB,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEjC,mEAAmE;IACnE,MAAM,aAAa,GAA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,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuCxD;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,WAAW;IACtD,QAAQ,CAAC,IAAI,wBAAwB;IACrC,QAAQ,CAAC,WAAW,sCAAsC;IAEpD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA6CxD;AAED;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,WAAW;IACvD,QAAQ,CAAC,IAAI,yBAAyB;IACtC,QAAQ,CAAC,WAAW,uDAAuD;IAErE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA8ExD"}
@@ -1 +1 @@
1
- const a27_0x30a75a=a27_0x35ca;(function(_0x23f6e8,_0x4096c9){const _0x3fcca8=a27_0x35ca,_0x46043c=_0x23f6e8();while(!![]){try{const _0x4bbd72=parseInt(_0x3fcca8(0x230))/0x1+parseInt(_0x3fcca8(0x229))/0x2*(-parseInt(_0x3fcca8(0x2b3))/0x3)+parseInt(_0x3fcca8(0x215))/0x4*(parseInt(_0x3fcca8(0x2ec))/0x5)+parseInt(_0x3fcca8(0x2bb))/0x6*(-parseInt(_0x3fcca8(0x1f4))/0x7)+-parseInt(_0x3fcca8(0x24f))/0x8+parseInt(_0x3fcca8(0x2a7))/0x9+parseInt(_0x3fcca8(0x21c))/0xa;if(_0x4bbd72===_0x4096c9)break;else _0x46043c['push'](_0x46043c['shift']());}catch(_0x498c1c){_0x46043c['push'](_0x46043c['shift']());}}}(a27_0x36e2,0xc0d35));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a27_0xb285cd from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';function a27_0x36e2(){const _0x33b68e=['filter','preview','\x0a⚠️\x20\x20Both\x20','format','bold','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Resolving\x20parent\x20segment\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','sort','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','green','jobId','\x27\x20and\x20run\x20workflow?','Overwrite\x20\x27','ignore','\x20tdx\x20wf\x20attempt\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','allValid','segment:parent:fields','Coverage:','keys','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','Fetching\x20parent\x20segment\x20\x27','label','Error\x20parsing\x20YAML:\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20Configuration\x20is\x20valid','xdg-open','\x27...','join','rowCount','Events:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','population','\x0a✔\x20Workflow\x20started','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first','tdx\x20segment\x20parent\x20preview\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x20is\x20already\x20up\x20to\x20date','Created','win32','text','Site:\x20','Enriched:','parent_segments','joinKey','Usage:\x20tdx\x20ps\x20show\x20[name]\x0a','Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','processedRows','Analyzing\x20changes...','displayValidateResults','Available\x20behaviors:','Errors:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Pattern:\x20','Listing\x20fields\x20for\x20\x27','Join\x20on:','log','output','test','Show\x20parent\x20segment\x20schema\x20(column\x20types)','json','displaySummary','getParentSQL','Attributes','parentSegment','displayPreviewHints','\x20Opening\x20','/app/dw/parentSegments/','updateParent','customersWithEvents','schemaValid','YAML\x20file:\x20','varchar','Executing\x20parent\x20segment\x20query...','scheduleOption','displayPreviewResults','Creating','1993077NXFBVy','Join:','List\x20available\x20fields\x20for\x20segmentation','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','No\x20parent\x20segments\x20found','\x20=\x20','\x27\x20with\x20ID:\x20','columns','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','✘\x20Failed\x20to\x20rename\x20directory:\x20','pullParentYaml','coveragePercent','36609vXtcMS','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','length','runParent','Columns:','errors','✔\x20No\x20changes\x20-\x20\x27','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','6dIPvjE','Attempt:','\x20--behavior\x20\x22','apply','SQL\x20query:\x0a','listFields','matchedCount','Updating','foreignKey','Source:','segment:parent:validate','\x20No\x20changes\x20-\x20','/sessions/','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','toLowerCase','utf-8','Error:\x20--behavior\x20requires\x20a\x20name\x0a','message','Updating\x20parent\x20segment\x20\x27','👥\x20','scheduleType','workflowAttemptId','Error:\x20--attribute\x20requires\x20a\x20name\x0a','previewParentYaml','dim','double','Audience\x20ID:','Database:\x20','\x0aChanges\x20to\x20\x27','\x20--behavior\x20\x22<name>\x22','.yaml','totalEvents','Behavior:','FINISHED','toLocaleString','name','Options:','List\x20parent\x20segments','Show\x20parent\x20segment\x20details','attributes','Listing\x20parent\x20segments...','trim','table','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)','Master\x20Table','\x20[Job\x20ID:\x20','behavior','\x20Context\x20set:\x20','displayMasterInfo','3800675aFJYfM','resolveParentId','Fetching\x20sample\x20data...','\x20parent\x20segment','createParent','segment:parent:create','\x0a⚠️\x20\x20Migrating:\x20','stats','start','jsonl','customerGroupFile','Output\x20file:\x20','`\x20to\x20download\x20the\x20configuration\x20first','segment:parent:show','match','toFixed','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','.yml','platform','pushParentYaml','interval','Preview:','Parent\x20segment:\x20','stop','using\x20the\x20default\x20path:\x20','replace','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','yes','Create\x20parent\x20segment\x20\x27','attribute','data','Apply\x20changes\x20to\x20\x27','\x0aNo\x20sample\x20data\x20available','open','cyan','behaviorsFile','verbose','in\x20','\x20--enriched','yellow','Listing\x20parent\x20segments\x20matching\x20\x27','darwin','SELECT\x20*\x20FROM\x20(\x0a','audienceId','\x20--interval\x20','/\x20→\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','5236882EUiyZi','workflowId','Fetching\x20current\x20configuration\x20for\x20\x27','addAttributes','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','column','segment:parent:desc','displayBehaviorsStats','Customers:','setJobId','schemaError','Available\x20attributes:','enriched','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','✔\x20Found\x20','-1d','error','✔\x20Renamed\x20directory\x20to\x20','\x20kill','\x20\x20\x20\x20-\x20','\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','unref','displaySampleData','Aborted.','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','red','\x20--attribute\x20\x22','\x20\x20No\x20sample\x20data\x20available','sampleData','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','addAttributesFile','isDirectory','4IiUzrp','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','\x0aChanges\x20to\x20apply\x20to\x20\x27','use','workflowSessionId','repeat','segment:parent:run','14147010QXNAxe','getParentFull','Error\x20reading\x20file:\x20','/{name}.yml\x0a','validateParentYaml','database','Updated','session','string','Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a','displayColumns','\x27\x20is\x20already\x20up\x20to\x20date','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','82cCfSao','timezone','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','localeCompare','/\x20directory.\x0a','\x20rows)','1180151rEkWfh','behaviors','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','listParents','\x0aNew\x20parent\x20segment\x20\x27','execute','Error:\x20--database\x20and\x20--table\x20are\x20required','customerPercent','site','Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a','run','description','Behaviors','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment','all','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Fetching\x20SQL\x20for\x20\x27','\x20parent\x20segment\x20\x27','Options\x20(one\x20required):','\x0aUsage:\x20tdx\x20ps\x20preview\x20','✔\x20Query\x20completed:\x20Processed\x20','addBehaviorsFile','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','dirname','addBehaviors','displayAttributesStats','Error:','parent_segment','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','segment:parent:push','12305424qrOCpQ','endsWith','number','\x20rows\x20','query','Attribute:','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Status:','master'];a27_0x36e2=function(){return _0x33b68e;};return a27_0x36e2();}function a27_0x35ca(_0x439e34,_0x59b56f){_0x439e34=_0x439e34-0x1e5;const _0x36e288=a27_0x36e2();let _0x35ca1e=_0x36e288[_0x439e34];return _0x35ca1e;}import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a27_0x44fedf from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a27_0x30a75a(0x284),LEGACY_PARENT_SEGMENT_DIR=a27_0x30a75a(0x24c);function openBrowser(_0xb7f3cb){const _0x5c2927=a27_0x30a75a,_0x428ef7=process[_0x5c2927(0x2fe)],_0x5927c8=_0x428ef7===_0x5c2927(0x1ee)?_0x5c2927(0x1e6):_0x428ef7===_0x5c2927(0x280)?_0x5c2927(0x2f4):_0x5c2927(0x273);spawn(_0x5927c8,[_0xb7f3cb],{'detached':!![],'stdio':_0x5c2927(0x266)})[_0x5c2927(0x20a)]();}function sanitizeFileName(_0x188f75){const _0x34e308=a27_0x30a75a;return _0x188f75[_0x34e308(0x2c9)]()[_0x34e308(0x305)](/[/\\:*?"<>|]/g,'-')[_0x34e308(0x305)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x34e308(0x305)](/^-|-$/g,'');}function migrateLegacyDirectory(){const _0x5a7608=a27_0x30a75a;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x568617=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x568617[_0x5a7608(0x214)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x5a7608(0x205)](a27_0x44fedf['yellow'](_0x5a7608(0x25a)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x5a7608(0x205)](a27_0x44fedf[_0x5a7608(0x2d3)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x5a7608(0x22e))),![];console['error'](a27_0x44fedf['yellow'](_0x5a7608(0x2f2)+LEGACY_PARENT_SEGMENT_DIR+_0x5a7608(0x1f2)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5a7608(0x205)](a27_0x44fedf[_0x5a7608(0x262)](_0x5a7608(0x206)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x512dc7){const _0x368565=_0x512dc7 instanceof Error?_0x512dc7[_0x5a7608(0x2cc)]:String(_0x512dc7);return console['error'](a27_0x44fedf['red'](_0x5a7608(0x2b0)+_0x368565+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x3f789a){const _0x546d6c=a27_0x30a75a;return migrateLegacyDirectory(),super[_0x546d6c(0x23a)](_0x3f789a);}}function resolveYamlFile(_0x3be3f8){const _0x2984f1=a27_0x30a75a;if(_0x3be3f8['endsWith'](_0x2984f1(0x2fd))||_0x3be3f8[_0x2984f1(0x250)](_0x2984f1(0x2d9)))return _0x3be3f8;return a27_0xb285cd[_0x2984f1(0x275)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3be3f8)+'.yml');}function formatProgressMessage(_0x2cf8ff){const _0x4095b3=a27_0x30a75a,_0x809bf0=_0x2cf8ff[_0x4095b3(0x2fa)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x809bf0){const [,_0x3df69c,_0x1a5a3e,_0x1e367c='']=_0x809bf0;return a27_0x44fedf['dim'](_0x3df69c+':')+'\x20'+_0x1a5a3e+a27_0x44fedf[_0x4095b3(0x2d3)](_0x1e367c);}return a27_0x44fedf[_0x4095b3(0x2d3)](_0x2cf8ff);}function showFileNotFoundError(_0x19875f,_0x467aef){const _0x2604f7=a27_0x30a75a;console['error'](a27_0x44fedf[_0x2604f7(0x20e)]('Error:\x20File\x20not\x20found:\x20'+_0x19875f+'\x0a')),console[_0x2604f7(0x205)](a27_0x44fedf[_0x2604f7(0x1e7)](_0x2604f7(0x27d)+_0x467aef+_0x2604f7(0x2f8)));}export class ParentSegmentListCommand extends BaseCommand{[a27_0x30a75a(0x2de)]='segment:parent:list';['description']=a27_0x30a75a(0x2e0);async[a27_0x30a75a(0x235)](_0x301dec){const _0x196d99=a27_0x30a75a,{options:_0x335d33,args:_0x519a2f,tdx:_0x56ea1c}=_0x301dec,_0x2229e9=_0x519a2f[0x0];_0x335d33['verbose']&&(console['error'](_0x196d99(0x282)+_0x335d33[_0x196d99(0x238)]),_0x2229e9&&console[_0x196d99(0x205)](_0x196d99(0x28f)+_0x2229e9));const _0x1fe611=await withSpinner(_0x2229e9?_0x196d99(0x1ed)+_0x2229e9+_0x196d99(0x274):_0x196d99(0x2e3),()=>_0x56ea1c['segment'][_0x196d99(0x233)](),{'verbose':_0x335d33[_0x196d99(0x1e9)]});let _0x57a615=_0x1fe611[_0x196d99(0x30a)];if(_0x2229e9){const _0x4d6f37=_0x2229e9['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x196d99(0x305)](/\*/g,'.*')[_0x196d99(0x305)](/\?/g,'.'),_0x5e2c8e=new RegExp('^'+_0x4d6f37+'$','i');_0x57a615=_0x57a615[_0x196d99(0x258)](_0x3f76ac=>_0x5e2c8e[_0x196d99(0x294)](_0x3f76ac['attributes']['name']));}_0x57a615[_0x196d99(0x260)]((_0x38e090,_0x170b21)=>_0x38e090['attributes'][_0x196d99(0x2de)][_0x196d99(0x22d)](_0x170b21[_0x196d99(0x2e2)][_0x196d99(0x2de)])),console['error'](_0x196d99(0x203)+_0x57a615[_0x196d99(0x2b5)]+_0x196d99(0x2ef)+(_0x57a615[_0x196d99(0x2b5)]!==0x1?'s':''));if(_0x335d33['format']===_0x196d99(0x296)||_0x335d33['format']===_0x196d99(0x2f5))await handleSDKOutput(_0x57a615,_0x335d33);else{if(_0x57a615[_0x196d99(0x2b5)]===0x0)_0x2229e9?console[_0x196d99(0x292)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x2229e9):console[_0x196d99(0x292)](_0x196d99(0x2ab));else for(const _0x3ea2eb of _0x57a615){const _0xbb2b0c=_0x3ea2eb[_0x196d99(0x2e2)]['population']?a27_0x44fedf['dim']('\x20('+formatRows(_0x3ea2eb[_0x196d99(0x2e2)][_0x196d99(0x279)])+')'):'';console[_0x196d99(0x292)](_0x196d99(0x2ce)+_0x3ea2eb['attributes'][_0x196d99(0x2de)]+_0xbb2b0c);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a27_0x30a75a(0x2de)]=a27_0x30a75a(0x2f1);['description']=a27_0x30a75a(0x2af);async[a27_0x30a75a(0x235)](_0x219eba){const _0x10dbca=a27_0x30a75a,{options:_0x4b506a,args:_0x2ec14a,tdx:_0x544b11}=_0x219eba;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x10dbca(0x28e)+_0x10dbca(0x228));const _0xfdd04c=_0x4b506a;if(_0x2ec14a['length']===0x0)return console[_0x10dbca(0x205)](_0x10dbca(0x23d)),console[_0x10dbca(0x205)](_0x10dbca(0x2aa)),0x1;const _0x224523=_0x2ec14a[0x0];if(!_0xfdd04c['database']||!_0xfdd04c['table'])return console[_0x10dbca(0x205)](_0x10dbca(0x236)),console[_0x10dbca(0x205)](_0x10dbca(0x2aa)),0x1;_0xfdd04c[_0x10dbca(0x1e9)]&&(console['error'](_0x10dbca(0x282)+_0xfdd04c[_0x10dbca(0x238)]),console[_0x10dbca(0x205)]('Name:\x20'+_0x224523),console[_0x10dbca(0x205)](_0x10dbca(0x2d6)+_0xfdd04c[_0x10dbca(0x221)]),console[_0x10dbca(0x205)]('Table:\x20'+_0xfdd04c['table']));const _0x233ab4=await loadJSONFromOptions(_0xfdd04c[_0x10dbca(0x2e2)],_0xfdd04c['attributesFile']),_0x5b0aa8=await loadJSONFromOptions(_0xfdd04c['behaviors'],_0xfdd04c[_0x10dbca(0x1e8)]),_0x3ecf4d=await loadJSONFromOptions(_0xfdd04c['customerGroup'],_0xfdd04c[_0x10dbca(0x2f6)]),_0x368fa9={'name':_0x224523,'description':_0xfdd04c[_0x10dbca(0x23b)],'scheduleType':_0xfdd04c[_0x10dbca(0x2cf)],'scheduleOption':_0xfdd04c[_0x10dbca(0x2a4)],'timezone':_0xfdd04c[_0x10dbca(0x22a)],'master':{'parentDatabaseName':_0xfdd04c[_0x10dbca(0x221)],'parentTableName':_0xfdd04c[_0x10dbca(0x2e5)]},'attributes':_0x233ab4,'behaviors':_0x5b0aa8,'customerGroup':_0x3ecf4d},_0x16fad2=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x224523+_0x10dbca(0x274),()=>_0x544b11[_0x10dbca(0x23e)][_0x10dbca(0x2f0)](_0x368fa9),{'verbose':_0x4b506a[_0x10dbca(0x1e9)]}),_0xe539f6=_0x16fad2['data'];return console['error']('✔\x20Created\x20parent\x20segment\x20\x27'+_0xe539f6['name']+_0x10dbca(0x2ad)+_0xe539f6['id']),await handleSDKOutput([_0xe539f6],_0x4b506a),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a27_0x30a75a(0x2de)]='segment:parent:update';[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x232);async[a27_0x30a75a(0x235)](_0xbe24e5){const _0x2425da=a27_0x30a75a,{options:_0x16b2c6,args:_0x209eda,tdx:_0x209392}=_0xbe24e5;console[_0x2425da(0x205)](_0x2425da(0x2c8)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x2425da(0x228));const _0x890642=_0x16b2c6;if(_0x209eda[_0x2425da(0x2b5)]===0x0)return console[_0x2425da(0x205)](_0x2425da(0x23d)),console[_0x2425da(0x205)](_0x2425da(0x212)),0x1;const _0x556617=_0x209eda[0x0];_0x890642[_0x2425da(0x1e9)]&&(console['error'](_0x2425da(0x282)+_0x890642[_0x2425da(0x238)]),console['error'](_0x2425da(0x302)+_0x556617));const _0x188af9=await withSpinner(_0x2425da(0x1f6)+_0x556617+_0x2425da(0x274),()=>_0x209392[_0x2425da(0x23e)][_0x2425da(0x21d)](_0x556617),{'verbose':_0x890642[_0x2425da(0x1e9)]}),_0x1f3f00=_0x188af9[_0x2425da(0x30a)],_0x2c6a51=await loadJSONFromOptions(_0x890642[_0x2425da(0x1f7)],_0x890642[_0x2425da(0x213)]),_0x3bb1ba=await loadJSONFromOptions(_0x890642[_0x2425da(0x249)],_0x890642[_0x2425da(0x246)]),_0x3e0207={'name':_0x1f3f00[_0x2425da(0x2de)],'description':_0x890642[_0x2425da(0x23b)]!==undefined?_0x890642[_0x2425da(0x23b)]:_0x1f3f00[_0x2425da(0x23b)],'scheduleType':_0x890642['scheduleType']!==undefined?_0x890642[_0x2425da(0x2cf)]:_0x1f3f00['scheduleType'],'scheduleOption':_0x890642[_0x2425da(0x2a4)]!==undefined?_0x890642[_0x2425da(0x2a4)]:_0x1f3f00[_0x2425da(0x2a4)],'timezone':_0x890642[_0x2425da(0x22a)]!==undefined?_0x890642['timezone']:_0x1f3f00[_0x2425da(0x22a)],'master':_0x1f3f00[_0x2425da(0x257)],'attributes':_0x2c6a51?[..._0x1f3f00[_0x2425da(0x2e2)]||[],..._0x2c6a51]:_0x1f3f00[_0x2425da(0x2e2)],'behaviors':_0x3bb1ba?[..._0x1f3f00[_0x2425da(0x231)]||[],..._0x3bb1ba]:_0x1f3f00[_0x2425da(0x231)],'customerGroup':_0x1f3f00['customerGroup']},_0x312e1d=await withSpinner(_0x2425da(0x2cd)+_0x556617+_0x2425da(0x274),()=>_0x209392[_0x2425da(0x23e)][_0x2425da(0x29e)](_0x556617,_0x3e0207),{'verbose':_0x890642[_0x2425da(0x1e9)]}),_0x15c430=_0x312e1d[_0x2425da(0x30a)];return console[_0x2425da(0x205)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x15c430['name']+'\x27'),await handleSDKOutput([_0x15c430],_0x890642),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a27_0x30a75a(0x2de)]='segment:parent:pull';[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x255);async[a27_0x30a75a(0x235)](_0x10b570){const _0x1b0bfb=a27_0x30a75a,{options:_0xb9253e,args:_0x2ff880,tdx:_0x27866d}=_0x10b570,_0x51f581=_0xb9253e,_0x31ce8f=_0x2ff880[0x0]||_0xb9253e['parentSegment'];if(!_0x31ce8f)return console[_0x1b0bfb(0x205)](a27_0x44fedf['red'](_0x1b0bfb(0x22c))),console[_0x1b0bfb(0x205)](_0x1b0bfb(0x287)),console['error'](a27_0x44fedf[_0x1b0bfb(0x1e7)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;if(_0x51f581[_0x1b0bfb(0x218)]&&_0x51f581[_0x1b0bfb(0x293)])return console[_0x1b0bfb(0x205)](a27_0x44fedf['red']('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x1b0bfb(0x205)](a27_0x44fedf[_0x1b0bfb(0x2d3)](_0x1b0bfb(0x216))),console[_0x1b0bfb(0x205)](a27_0x44fedf['dim'](_0x1b0bfb(0x304)+PARENT_SEGMENT_DIR+_0x1b0bfb(0x21f))),console[_0x1b0bfb(0x205)](a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x1b0bfb(0x2b4))),0x1;const _0x6583c=_0x51f581[_0x1b0bfb(0x293)]||a27_0xb285cd[_0x1b0bfb(0x275)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x31ce8f)+_0x1b0bfb(0x2fd));_0x51f581[_0x1b0bfb(0x1e9)]&&(console['error']('Site:\x20'+_0x51f581[_0x1b0bfb(0x238)]),console['error'](_0x1b0bfb(0x302)+_0x31ce8f),console[_0x1b0bfb(0x205)](_0x1b0bfb(0x2f7)+_0x6583c));const _0x16a614=await withSpinner(_0x1b0bfb(0x26e)+_0x31ce8f+_0x1b0bfb(0x274),()=>_0x27866d[_0x1b0bfb(0x23e)][_0x1b0bfb(0x2b1)](_0x31ce8f),{'verbose':_0x51f581[_0x1b0bfb(0x1e9)]}),_0x4faa91=_0x16a614[_0x1b0bfb(0x30a)];if(existsSync(_0x6583c)){const _0x586b5d=readFileSync(_0x6583c,'utf-8'),_0x2df525=generateDiff(_0x586b5d,_0x4faa91);if(!hasChanges(_0x2df525))console['error'](a27_0x44fedf['green']('✔')+_0x1b0bfb(0x2c6)+a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x6583c)+_0x1b0bfb(0x27e));else{console[_0x1b0bfb(0x205)](_0x1b0bfb(0x2d7)+_0x6583c+'\x27:'),console[_0x1b0bfb(0x205)]('─'[_0x1b0bfb(0x21a)](0x3c)),console['error'](formatDiffWithColors(_0x2df525)),console[_0x1b0bfb(0x205)]('─'[_0x1b0bfb(0x21a)](0x3c));if(!_0x51f581[_0x1b0bfb(0x307)]){const _0x1468df=await confirmKey(_0x1b0bfb(0x265)+_0x6583c+'\x27?');if(!_0x1468df)return console['error'](_0x1b0bfb(0x20c)),0x1;}writeFileSync(_0x6583c,_0x4faa91,_0x1b0bfb(0x2ca)),console['error'](a27_0x44fedf[_0x1b0bfb(0x262)]('✔')+_0x1b0bfb(0x268)+a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x6583c));}}else{const _0x9194a8=a27_0xb285cd[_0x1b0bfb(0x248)](_0x6583c);!existsSync(_0x9194a8)&&mkdirSync(_0x9194a8,{'recursive':!![]}),writeFileSync(_0x6583c,_0x4faa91,_0x1b0bfb(0x2ca)),console['error'](a27_0x44fedf[_0x1b0bfb(0x262)]('✔')+_0x1b0bfb(0x268)+a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x6583c));}return saveSessionContext({'parent_segment':_0x31ce8f},_0x51f581[_0x1b0bfb(0x223)]),console[_0x1b0bfb(0x205)](a27_0x44fedf['green']('✔')+_0x1b0bfb(0x2ea)+a27_0x44fedf[_0x1b0bfb(0x2d3)](_0x1b0bfb(0x24c))+_0x1b0bfb(0x2ac)+a27_0x44fedf[_0x1b0bfb(0x1e7)](_0x31ce8f)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a27_0x30a75a(0x24e);[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x306);async[a27_0x30a75a(0x235)](_0x485597){const _0x182f14=a27_0x30a75a,{options:_0x21affd,args:_0x1f5540,tdx:_0x4c0f6e}=_0x485597,_0x4e7138=_0x21affd,_0x198d2f=_0x1f5540[0x0]||_0x21affd[_0x182f14(0x29a)];if(!_0x198d2f)return console['error'](a27_0x44fedf[_0x182f14(0x20e)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x182f14(0x205)]('Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a'),console['error'](a27_0x44fedf[_0x182f14(0x1e7)](_0x182f14(0x27b))),0x1;const _0x45fe2c=resolveYamlFile(_0x198d2f);if(!existsSync(_0x45fe2c))return showFileNotFoundError(_0x45fe2c,_0x198d2f),0x1;_0x4e7138[_0x182f14(0x1e9)]&&(console['error'](_0x182f14(0x282)+_0x4e7138[_0x182f14(0x238)]),console['error'](_0x182f14(0x2a1)+_0x45fe2c));let _0x5220d0;try{_0x5220d0=readFileSync(_0x45fe2c,_0x182f14(0x2ca));}catch(_0x400434){const _0x340c86=_0x400434 instanceof Error?_0x400434[_0x182f14(0x2cc)]:String(_0x400434);return console['error'](_0x182f14(0x21e)+_0x340c86),0x1;}const _0x12283d=await withSpinner(_0x182f14(0x28a),()=>_0x4c0f6e[_0x182f14(0x23e)][_0x182f14(0x2ff)](_0x5220d0),{'verbose':_0x4e7138['verbose']}),_0x35f20b=_0x12283d[_0x182f14(0x30a)],{isNew:_0x32ddb0,name:_0x566c53,hasChanges:_0x28dead,diffFormatted:_0x235431}=_0x35f20b;if(!_0x28dead)return console[_0x182f14(0x205)]('✔\x20No\x20changes\x20-\x20\x27'+_0x566c53+_0x182f14(0x227)),0x0;_0x32ddb0?console[_0x182f14(0x205)](_0x182f14(0x234)+_0x566c53+'\x27:'):console['error'](_0x182f14(0x217)+_0x566c53+'\x27:');console['error']('─'[_0x182f14(0x21a)](0x3c)),console[_0x182f14(0x205)](_0x235431),console[_0x182f14(0x205)]('─'['repeat'](0x3c));const _0x210743=_0x32ddb0?_0x182f14(0x308)+_0x566c53+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x566c53+'\x27?';if(!_0x4e7138['yes']){const _0x5e1dea=await confirmKey(_0x210743);if(!_0x5e1dea)return console[_0x182f14(0x205)](_0x182f14(0x20c)),0x1;}const _0x37d0b1=_0x32ddb0?_0x182f14(0x2a6):_0x182f14(0x2c2),_0x953f71=await withSpinner(_0x37d0b1+_0x182f14(0x242)+_0x566c53+_0x182f14(0x274),()=>_0x35f20b[_0x182f14(0x2be)](),{'verbose':_0x4e7138[_0x182f14(0x1e9)]}),_0x3f0c74=_0x953f71[_0x182f14(0x30a)],_0x2ed640=getConsoleNextUrl(_0x4e7138['site'],_0x182f14(0x29d)+_0x3f0c74['id']),_0x1fc621=_0x32ddb0?_0x182f14(0x27f):_0x182f14(0x222);return console['error']('✔\x20'+_0x1fc621+'\x20parent\x20segment\x20\x27'+_0x3f0c74[_0x182f14(0x2de)]+'\x27'),console[_0x182f14(0x205)]('\x20\x20'+_0x2ed640),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a27_0x30a75a(0x2de)]=a27_0x30a75a(0x2c5);[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x1f3);async[a27_0x30a75a(0x235)](_0x5a48c1){const _0x49196e=a27_0x30a75a,{options:_0x194548,args:_0x471aa3,tdx:_0x470d67}=_0x5a48c1,_0x5660f4=_0x194548,_0x3b7536=_0x471aa3[0x0]||_0x194548[_0x49196e(0x29a)];if(!_0x3b7536)return console[_0x49196e(0x205)](a27_0x44fedf['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x49196e(0x205)](_0x49196e(0x225)),console[_0x49196e(0x205)]('Options:'),console[_0x49196e(0x205)](_0x49196e(0x202)),console[_0x49196e(0x205)](_0x49196e(0x2e6)),console[_0x49196e(0x205)](_0x49196e(0x240)),console[_0x49196e(0x205)](a27_0x44fedf[_0x49196e(0x1e7)]('\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;const _0x26d7db=resolveYamlFile(_0x3b7536);if(!existsSync(_0x26d7db))return showFileNotFoundError(_0x26d7db,_0x3b7536),0x1;_0x5660f4[_0x49196e(0x1e9)]&&(console[_0x49196e(0x205)](_0x49196e(0x282)+_0x5660f4[_0x49196e(0x238)]),console[_0x49196e(0x205)](_0x49196e(0x2a1)+_0x26d7db));let _0x547f44;try{_0x547f44=readFileSync(_0x26d7db,'utf-8');}catch(_0x483aa5){const _0x5efa6a=_0x483aa5 instanceof Error?_0x483aa5['message']:String(_0x483aa5);return console[_0x49196e(0x205)](_0x49196e(0x21e)+_0x5efa6a),0x1;}const _0x47db24=createCommandSpinner(a27_0x44fedf['dim']('Validating\x20configuration...'),{'verbose':_0x5660f4[_0x49196e(0x1e9)]});_0x47db24['start']();const _0x8b91bd={'onProgress':_0x907597=>{_0x47db24['text']=formatProgressMessage(_0x907597);}};if(_0x5660f4[_0x49196e(0x257)])_0x8b91bd[_0x49196e(0x257)]=!![];if(_0x5660f4[_0x49196e(0x201)])_0x8b91bd[_0x49196e(0x201)]=!![];_0x5660f4['attribute']&&(_0x8b91bd[_0x49196e(0x309)]=_0x5660f4[_0x49196e(0x309)]);_0x5660f4[_0x49196e(0x2e9)]&&(_0x8b91bd[_0x49196e(0x2e9)]=_0x5660f4[_0x49196e(0x2e9)]);if(_0x5660f4[_0x49196e(0x300)])_0x8b91bd['interval']=_0x5660f4[_0x49196e(0x300)];let _0x4c9760;try{_0x4c9760=await _0x470d67[_0x49196e(0x23e)][_0x49196e(0x220)](_0x547f44,_0x8b91bd),_0x47db24[_0x49196e(0x303)]();}catch(_0x19dbad){_0x47db24[_0x49196e(0x303)]();throw _0x19dbad;}const _0xb334b9=_0x5660f4[_0x49196e(0x300)]||_0x49196e(0x204);return this[_0x49196e(0x28b)](_0x4c9760,_0x8b91bd,_0x26d7db,_0xb334b9),_0x4c9760[_0x49196e(0x269)]?0x0:0x1;}['displayValidateResults'](_0x42e583,_0x23daa2,_0x1f7f73,_0xe5fd9c){const _0x59eb2a=a27_0x30a75a;console[_0x59eb2a(0x205)]('\x0a'+a27_0x44fedf[_0x59eb2a(0x25c)]('Validate:')+'\x20'+_0x42e583[_0x59eb2a(0x2de)]),console['error']('═'[_0x59eb2a(0x21a)](0x3c)),this[_0x59eb2a(0x2eb)](_0x42e583);if(typeof _0x23daa2[_0x59eb2a(0x309)]==='string'){this['displayAttributesStats'](_0x42e583),this[_0x59eb2a(0x297)](_0x42e583),this['displayPreviewHints'](_0x1f7f73,_0xe5fd9c,_0x59eb2a(0x309),_0x23daa2['attribute']);return;}if(_0x23daa2[_0x59eb2a(0x309)]===!![]){this[_0x59eb2a(0x24a)](_0x42e583),this[_0x59eb2a(0x297)](_0x42e583),this['displayPreviewHints'](_0x1f7f73,_0xe5fd9c,_0x59eb2a(0x2e2));return;}if(typeof _0x23daa2[_0x59eb2a(0x2e9)]===_0x59eb2a(0x224)){this[_0x59eb2a(0x1fc)](_0x42e583,_0xe5fd9c),this[_0x59eb2a(0x297)](_0x42e583),this[_0x59eb2a(0x29b)](_0x1f7f73,_0xe5fd9c,'behavior',_0x23daa2['behavior']);return;}if(_0x23daa2[_0x59eb2a(0x2e9)]===!![]){this[_0x59eb2a(0x1fc)](_0x42e583,_0xe5fd9c),this[_0x59eb2a(0x297)](_0x42e583),this['displayPreviewHints'](_0x1f7f73,_0xe5fd9c,'behaviors');return;}this[_0x59eb2a(0x24a)](_0x42e583),this[_0x59eb2a(0x1fc)](_0x42e583,_0xe5fd9c),this[_0x59eb2a(0x297)](_0x42e583),this[_0x59eb2a(0x29b)](_0x1f7f73,_0xe5fd9c,_0x59eb2a(0x23f));}[a27_0x30a75a(0x29b)](_0x131945,_0x17908b,_0x419fe1,_0x4b8d30){const _0x56197a=a27_0x30a75a;console[_0x56197a(0x205)]('\x0a'+a27_0x44fedf[_0x56197a(0x2d3)]('To\x20view\x20sample\x20data:'));const _0x51149a=_0x17908b!=='-1d'?_0x56197a(0x1f1)+_0x17908b:'';if(_0x419fe1==='attribute'&&_0x4b8d30)console[_0x56197a(0x205)]('\x20\x20'+a27_0x44fedf[_0x56197a(0x2d3)]('tdx\x20segment\x20parent\x20preview\x20'+_0x131945+_0x56197a(0x20f)+_0x4b8d30+'\x22'+_0x51149a));else{if(_0x419fe1===_0x56197a(0x2e9)&&_0x4b8d30)console[_0x56197a(0x205)]('\x20\x20'+a27_0x44fedf['dim'](_0x56197a(0x27c)+_0x131945+_0x56197a(0x2bd)+_0x4b8d30+'\x22'+_0x51149a));else(_0x419fe1===_0x56197a(0x2e2)||_0x419fe1===_0x56197a(0x23f))&&console[_0x56197a(0x205)]('\x20\x20'+a27_0x44fedf[_0x56197a(0x2d3)](_0x56197a(0x27c)+_0x131945+'\x20--attribute\x20\x22<name>\x22'+_0x51149a));}(_0x419fe1==='behaviors'||_0x419fe1===_0x56197a(0x23f))&&console[_0x56197a(0x205)]('\x20\x20'+a27_0x44fedf['dim'](_0x56197a(0x27c)+_0x131945+_0x56197a(0x2d8)+_0x51149a)),_0x419fe1==='all'&&console['error']('\x20\x20'+a27_0x44fedf[_0x56197a(0x2d3)](_0x56197a(0x27c)+_0x131945+_0x56197a(0x1eb)+_0x51149a));}['displayMasterInfo'](_0x1de8d9){const _0x3010f1=a27_0x30a75a,{master:_0x2a38ba}=_0x1de8d9,_0x4c88d0=_0x2a38ba[_0x3010f1(0x2a0)]?a27_0x44fedf[_0x3010f1(0x262)]('✔'):a27_0x44fedf[_0x3010f1(0x20e)]('✘');console[_0x3010f1(0x205)]('\x0a'+a27_0x44fedf[_0x3010f1(0x2d3)](_0x3010f1(0x2e7))),console['error'](_0x4c88d0+'\x20'+a27_0x44fedf['bold'](_0x2a38ba[_0x3010f1(0x221)]+'.'+_0x2a38ba['table'])),_0x2a38ba[_0x3010f1(0x2a0)]?_0x2a38ba[_0x3010f1(0x276)]!==undefined&&console[_0x3010f1(0x205)]('\x20\x20'+a27_0x44fedf[_0x3010f1(0x2d3)]('Rows:')+'\x20'+a27_0x44fedf[_0x3010f1(0x1e7)](formatRows(_0x2a38ba[_0x3010f1(0x276)]))):console[_0x3010f1(0x205)]('\x20\x20'+a27_0x44fedf[_0x3010f1(0x20e)](_0x3010f1(0x24b))+'\x20'+_0x2a38ba['schemaError']);}[a27_0x30a75a(0x24a)](_0xb1e83f){const _0x594535=a27_0x30a75a;if(_0xb1e83f[_0x594535(0x2e2)][_0x594535(0x2b5)]===0x0)return;console[_0x594535(0x205)]('\x0a'+a27_0x44fedf[_0x594535(0x2d3)](_0x594535(0x299)));for(const _0x534552 of _0xb1e83f['attributes']){const _0x2f7d4e=_0x534552[_0x594535(0x2a0)]?a27_0x44fedf[_0x594535(0x262)]('✔'):a27_0x44fedf[_0x594535(0x20e)]('✘');let _0x1d5e64='';if(_0x534552['schemaValid']&&_0x534552[_0x594535(0x2c1)]!==undefined&&_0x534552[_0x594535(0x2b2)]!==undefined){const _0x968d34=_0x534552['coveragePercent'][_0x594535(0x2fb)](0x1),_0x370d05=_0x534552[_0x594535(0x2b2)]>=0x50?a27_0x44fedf[_0x594535(0x262)]:_0x534552['coveragePercent']>=0x32?a27_0x44fedf[_0x594535(0x1ec)]:a27_0x44fedf['red'];_0x1d5e64='\x20'+a27_0x44fedf['dim'](_0x594535(0x26b))+'\x20'+_0x370d05(_0x968d34+'%')+'\x20('+formatRows(_0x534552['matchedCount'])+_0x594535(0x22f);}console['error'](_0x2f7d4e+'\x20'+a27_0x44fedf[_0x594535(0x25c)](_0x534552['name'])+_0x1d5e64),console[_0x594535(0x205)]('\x20\x20'+a27_0x44fedf[_0x594535(0x2d3)](_0x594535(0x2c4))+'\x20'+a27_0x44fedf['bold'](_0x534552[_0x594535(0x221)]+'.'+_0x534552[_0x594535(0x2e5)]));const _0x2016aa=_0x534552['joinKey']===_0x534552[_0x594535(0x2c3)]?a27_0x44fedf['dim'](_0x594535(0x291))+'\x20'+_0x534552[_0x594535(0x285)]:a27_0x44fedf[_0x594535(0x2d3)](_0x594535(0x2a8))+'\x20'+_0x534552[_0x594535(0x285)]+_0x594535(0x2ac)+_0x534552[_0x594535(0x2c3)];console[_0x594535(0x205)]('\x20\x20'+_0x2016aa),console[_0x594535(0x205)]('\x20\x20'+a27_0x44fedf['dim'](_0x594535(0x2b7))),this[_0x594535(0x226)](_0x534552[_0x594535(0x2ae)]),!_0x534552[_0x594535(0x2a0)]&&console['error']('\x20\x20'+a27_0x44fedf[_0x594535(0x20e)](_0x594535(0x24b))+'\x20'+_0x534552[_0x594535(0x1ff)]);}}[a27_0x30a75a(0x1fc)](_0x2edd66,_0x1e5b02){const _0x4838fc=a27_0x30a75a;if(_0x2edd66[_0x4838fc(0x231)][_0x4838fc(0x2b5)]===0x0)return;console[_0x4838fc(0x205)]('\x0a'+a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x23c))+'\x20'+a27_0x44fedf[_0x4838fc(0x2d3)]('('+_0x1e5b02+')'));for(const _0x4dbf15 of _0x2edd66[_0x4838fc(0x231)]){const _0xa53356=_0x4dbf15[_0x4838fc(0x2a0)]?a27_0x44fedf[_0x4838fc(0x262)]('✔'):a27_0x44fedf[_0x4838fc(0x20e)]('✘');let _0x3bae14='';if(_0x4dbf15['schemaValid']&&_0x4dbf15['customersWithEvents']!==undefined&&_0x4dbf15[_0x4838fc(0x2da)]!==undefined){const _0x29e1e3=_0x4dbf15['customerPercent']?.[_0x4838fc(0x2fb)](0x1)||'?',_0x1c5e8e=(_0x4dbf15[_0x4838fc(0x237)]??0x0)>=0x32?a27_0x44fedf[_0x4838fc(0x262)]:(_0x4dbf15['customerPercent']??0x0)>=0x14?a27_0x44fedf[_0x4838fc(0x1ec)]:a27_0x44fedf[_0x4838fc(0x20e)];_0x3bae14='\x20'+a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x1fd))+'\x20'+_0x1c5e8e(formatRows(_0x4dbf15[_0x4838fc(0x29f)]))+'\x20('+_0x29e1e3+'%)\x20'+a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x277))+'\x20'+a27_0x44fedf[_0x4838fc(0x1e7)](formatRows(_0x4dbf15['totalEvents']));}console[_0x4838fc(0x205)](_0xa53356+'\x20'+a27_0x44fedf[_0x4838fc(0x25c)](_0x4dbf15['name'])+_0x3bae14),console[_0x4838fc(0x205)]('\x20\x20'+a27_0x44fedf['dim'](_0x4838fc(0x2c4))+'\x20'+a27_0x44fedf[_0x4838fc(0x25c)](_0x4dbf15[_0x4838fc(0x221)]+'.'+_0x4dbf15[_0x4838fc(0x2e5)]));const _0x46aa22=_0x4dbf15['joinKey']===_0x4dbf15[_0x4838fc(0x2c3)]?a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x291))+'\x20'+_0x4dbf15[_0x4838fc(0x285)]:a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x2a8))+'\x20'+_0x4dbf15[_0x4838fc(0x285)]+'\x20=\x20'+_0x4dbf15[_0x4838fc(0x2c3)];console['error']('\x20\x20'+_0x46aa22),console[_0x4838fc(0x205)]('\x20\x20'+a27_0x44fedf[_0x4838fc(0x2d3)](_0x4838fc(0x2b7))),this['displayColumns'](_0x4dbf15['columns']),!_0x4dbf15[_0x4838fc(0x2a0)]&&console[_0x4838fc(0x205)]('\x20\x20'+a27_0x44fedf[_0x4838fc(0x20e)](_0x4838fc(0x24b))+'\x20'+_0x4dbf15[_0x4838fc(0x1ff)]);}}['displayColumns'](_0x19f3b5){const _0x326685=a27_0x30a75a;for(const _0x5570bd of _0x19f3b5){_0x5570bd[_0x326685(0x26f)]===_0x5570bd[_0x326685(0x1fa)]||_0x5570bd[_0x326685(0x1fa)]==='*'?console[_0x326685(0x205)](_0x326685(0x208)+_0x5570bd[_0x326685(0x26f)]):console[_0x326685(0x205)](_0x326685(0x208)+_0x5570bd[_0x326685(0x26f)]+'\x20'+a27_0x44fedf[_0x326685(0x2d3)]('('+_0x5570bd['column']+')'));}}[a27_0x30a75a(0x297)](_0x17bded){const _0x321be5=a27_0x30a75a;console[_0x321be5(0x205)]('─'[_0x321be5(0x21a)](0x3c));if(_0x17bded[_0x321be5(0x2b8)][_0x321be5(0x2b5)]>0x0){console['error']('\x0a'+a27_0x44fedf[_0x321be5(0x20e)]('Errors:'));for(const _0x2c500f of _0x17bded[_0x321be5(0x2b8)]){console[_0x321be5(0x205)]('\x20\x20'+a27_0x44fedf[_0x321be5(0x20e)]('•')+'\x20'+_0x2c500f);}}_0x17bded[_0x321be5(0x269)]&&console[_0x321be5(0x205)]('\x0a'+a27_0x44fedf[_0x321be5(0x262)]('✔')+_0x321be5(0x272));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a27_0x30a75a(0x2de)]='segment:parent:preview';[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x22b);async[a27_0x30a75a(0x235)](_0x47bda4){const _0x42389a=a27_0x30a75a,{options:_0x394aad,args:_0x51bebf,tdx:_0x5a6e85}=_0x47bda4,_0xcfb746=_0x394aad,_0xca4540=_0x51bebf[0x0]||_0x394aad[_0x42389a(0x29a)];if(!_0xca4540)return console[_0x42389a(0x205)](a27_0x44fedf[_0x42389a(0x20e)](_0x42389a(0x22c))),console[_0x42389a(0x205)](_0x42389a(0x271)),console[_0x42389a(0x205)](_0x42389a(0x243)),console[_0x42389a(0x205)](_0x42389a(0x1f8)),console[_0x42389a(0x205)](_0x42389a(0x278)),console['error'](_0x42389a(0x2fc)),console[_0x42389a(0x205)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),console[_0x42389a(0x205)]('\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),console[_0x42389a(0x205)](a27_0x44fedf[_0x42389a(0x1e7)](_0x42389a(0x209))),0x1;if(!_0xcfb746[_0x42389a(0x257)]&&!_0xcfb746['attribute']&&!_0xcfb746[_0x42389a(0x2e9)]&&!_0xcfb746['enriched'])return console[_0x42389a(0x205)](a27_0x44fedf[_0x42389a(0x20e)](_0x42389a(0x1f9))),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x42389a(0x205)](_0x42389a(0x2df)),console[_0x42389a(0x205)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x42389a(0x205)](_0x42389a(0x278)),console[_0x42389a(0x205)](_0x42389a(0x2fc)),console[_0x42389a(0x205)](_0x42389a(0x2ba)),0x1;const _0x116d89=resolveYamlFile(_0xca4540);if(!existsSync(_0x116d89))return showFileNotFoundError(_0x116d89,_0xca4540),0x1;_0xcfb746['verbose']&&(console['error']('Site:\x20'+_0xcfb746['site']),console[_0x42389a(0x205)](_0x42389a(0x2a1)+_0x116d89));let _0x34af0a;try{_0x34af0a=readFileSync(_0x116d89,'utf-8');}catch(_0x2d1093){const _0x3ede24=_0x2d1093 instanceof Error?_0x2d1093[_0x42389a(0x2cc)]:String(_0x2d1093);return console[_0x42389a(0x205)](_0x42389a(0x21e)+_0x3ede24),0x1;}let _0x545212;try{_0x545212=parseYamlString(_0x34af0a);}catch(_0x32d8f8){const _0x351df8=_0x32d8f8 instanceof Error?_0x32d8f8['message']:String(_0x32d8f8);return console[_0x42389a(0x205)](a27_0x44fedf['red'](_0x42389a(0x270)+_0x351df8)),0x1;}if(_0xcfb746['attribute']===!![]||_0xcfb746[_0x42389a(0x309)]===''){const _0x1635da=_0x545212[_0x42389a(0x2e2)]?.['map'](_0x3b51ae=>_0x3b51ae[_0x42389a(0x2de)])||[];if(_0x1635da['length']===0x0)console[_0x42389a(0x205)](a27_0x44fedf['red'](_0x42389a(0x247)));else{console['error'](a27_0x44fedf[_0x42389a(0x20e)](_0x42389a(0x2d1))),console[_0x42389a(0x205)](_0x42389a(0x200));for(const _0x126cf7 of _0x1635da){console[_0x42389a(0x205)]('\x20\x20'+a27_0x44fedf[_0x42389a(0x1e7)](_0x126cf7));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0xca4540+'\x20--attribute\x20\x22'+_0x1635da[0x0]+'\x22');}return 0x1;}if(_0xcfb746[_0x42389a(0x2e9)]===!![]||_0xcfb746[_0x42389a(0x2e9)]===''){const _0x4ba45b=_0x545212['behaviors']?.['map'](_0x255442=>_0x255442['name'])||[];if(_0x4ba45b[_0x42389a(0x2b5)]===0x0)console['error'](a27_0x44fedf['red'](_0x42389a(0x24d)));else{console[_0x42389a(0x205)](a27_0x44fedf[_0x42389a(0x20e)](_0x42389a(0x2cb))),console[_0x42389a(0x205)](_0x42389a(0x28c));for(const _0x49f7bc of _0x4ba45b){console[_0x42389a(0x205)]('\x20\x20'+a27_0x44fedf['cyan'](_0x49f7bc));}console['error'](_0x42389a(0x244)+_0xca4540+_0x42389a(0x2bd)+_0x4ba45b[0x0]+'\x22');}return 0x1;}const _0x187f26=createCommandSpinner(a27_0x44fedf[_0x42389a(0x2d3)](_0x42389a(0x2ee)),{'verbose':_0xcfb746['verbose']});_0x187f26[_0x42389a(0x2f4)]();const _0x4a8a3b={'onProgress':_0x159ef2=>{const _0x5051c1=_0x42389a;_0x187f26[_0x5051c1(0x281)]=formatProgressMessage(_0x159ef2);}};if(_0xcfb746[_0x42389a(0x257)])_0x4a8a3b[_0x42389a(0x257)]=!![];if(_0xcfb746[_0x42389a(0x309)]&&typeof _0xcfb746['attribute']==='string')_0x4a8a3b[_0x42389a(0x309)]=_0xcfb746[_0x42389a(0x309)];if(_0xcfb746[_0x42389a(0x2e9)]&&typeof _0xcfb746[_0x42389a(0x2e9)]==='string')_0x4a8a3b['behavior']=_0xcfb746[_0x42389a(0x2e9)];if(_0xcfb746[_0x42389a(0x201)])_0x4a8a3b[_0x42389a(0x201)]=!![];if(_0xcfb746['interval'])_0x4a8a3b[_0x42389a(0x300)]=_0xcfb746[_0x42389a(0x300)];let _0x48535f;try{_0x48535f=await _0x5a6e85[_0x42389a(0x23e)][_0x42389a(0x2d2)](_0x34af0a,_0x4a8a3b),_0x187f26['stop']();}catch(_0x28e829){_0x187f26[_0x42389a(0x303)]();throw _0x28e829;}return await this[_0x42389a(0x2a5)](_0x48535f,{'master':_0xcfb746[_0x42389a(0x257)],'attribute':typeof _0xcfb746['attribute']==='string'?_0xcfb746[_0x42389a(0x309)]:undefined,'behavior':typeof _0xcfb746[_0x42389a(0x2e9)]===_0x42389a(0x224)?_0xcfb746[_0x42389a(0x2e9)]:undefined,'enriched':_0xcfb746['enriched']}),_0x48535f[_0x42389a(0x269)]?0x0:0x1;}async[a27_0x30a75a(0x2a5)](_0x122d28,_0x3e4aea){const _0x1c784a=a27_0x30a75a;console['error']('\x0a'+a27_0x44fedf['bold'](_0x1c784a(0x301))+'\x20'+_0x122d28[_0x1c784a(0x2de)]),console[_0x1c784a(0x205)]('═'[_0x1c784a(0x21a)](0x3c));if(_0x3e4aea['master']&&_0x122d28['sampleData']){const _0x1d6a3f=a27_0x44fedf[_0x1c784a(0x2d3)]('Master:')+'\x20'+a27_0x44fedf[_0x1c784a(0x25c)](_0x122d28[_0x1c784a(0x257)]['database']+'.'+_0x122d28['master'][_0x1c784a(0x2e5)]);await this[_0x1c784a(0x20b)](_0x1d6a3f,_0x122d28['sampleData']);}else{if(_0x3e4aea[_0x1c784a(0x309)]&&_0x122d28[_0x1c784a(0x211)]){const _0xf481d0=a27_0x44fedf[_0x1c784a(0x2d3)](_0x1c784a(0x254))+'\x20'+a27_0x44fedf[_0x1c784a(0x25c)](_0x3e4aea[_0x1c784a(0x309)]);await this[_0x1c784a(0x20b)](_0xf481d0,_0x122d28[_0x1c784a(0x211)]);}else{if(_0x3e4aea['behavior']&&_0x122d28[_0x1c784a(0x211)]){const _0x15f43c=a27_0x44fedf['dim'](_0x1c784a(0x2db))+'\x20'+a27_0x44fedf['bold'](_0x3e4aea[_0x1c784a(0x2e9)]);await this[_0x1c784a(0x20b)](_0x15f43c,_0x122d28[_0x1c784a(0x211)]);}else{if(_0x3e4aea[_0x1c784a(0x201)]&&_0x122d28['sampleData']){const _0x2892e1=a27_0x44fedf[_0x1c784a(0x2d3)](_0x1c784a(0x283))+'\x20'+a27_0x44fedf[_0x1c784a(0x25c)]('Master\x20+\x20Attributes');await this[_0x1c784a(0x20b)](_0x2892e1,_0x122d28[_0x1c784a(0x211)]);}else!_0x122d28['sampleData']&&console['error'](_0x1c784a(0x1e5));}}}if(_0x122d28['errors'][_0x1c784a(0x2b5)]>0x0){console[_0x1c784a(0x205)]('─'[_0x1c784a(0x21a)](0x3c)),console[_0x1c784a(0x205)]('\x0a'+a27_0x44fedf[_0x1c784a(0x20e)](_0x1c784a(0x28d)));for(const _0x1adaea of _0x122d28['errors']){console[_0x1c784a(0x205)]('\x20\x20'+a27_0x44fedf[_0x1c784a(0x20e)]('•')+'\x20'+_0x1adaea);}}}async['displaySampleData'](_0x8dceb3,_0x55f920){const _0x465127=a27_0x30a75a;if(_0x55f920[_0x465127(0x2b5)]===0x0){console['error']('\x0a'+_0x8dceb3),console[_0x465127(0x205)](_0x465127(0x210));return;}console[_0x465127(0x205)]('\x0a'+_0x8dceb3);const _0xb1f503=Object[_0x465127(0x26c)](_0x55f920[0x0])['map'](_0xff0499=>({'name':_0xff0499,'type':typeof _0x55f920[0x0][_0xff0499]===_0x465127(0x251)?_0x465127(0x2d4):_0x465127(0x2a2)})),_0x36337d={'queryId':_0x465127(0x259),'columns':_0xb1f503,'data':_0x55f920,'stats':{'state':_0x465127(0x2dc),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x55f920[_0x465127(0x2b5)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x21a893=formatAsTable(_0x36337d,_0x55f920[_0x465127(0x2b5)],!![]);await writeOutput(_0x21a893,undefined,_0x465127(0x2e5));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a27_0x30a75a(0x21b);[a27_0x30a75a(0x23b)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a27_0x30a75a(0x235)](_0x392c83){const _0x3a43ad=a27_0x30a75a,{options:_0x1d3756,args:_0x59d3d8,tdx:_0x271b9d}=_0x392c83,_0x977c04=_0x1d3756,_0x32d041=_0x59d3d8[0x0]||_0x1d3756[_0x3a43ad(0x29a)];if(!_0x32d041)return console[_0x3a43ad(0x205)](a27_0x44fedf[_0x3a43ad(0x20e)](_0x3a43ad(0x22c))),console[_0x3a43ad(0x205)]('Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a'),console[_0x3a43ad(0x205)](a27_0x44fedf[_0x3a43ad(0x1e7)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;const _0x26af5f=resolveYamlFile(_0x32d041);if(existsSync(_0x26af5f)){_0x977c04[_0x3a43ad(0x1e9)]&&console[_0x3a43ad(0x205)]('Found\x20YAML\x20file:\x20'+_0x26af5f);let _0x4a41ae;try{_0x4a41ae=readFileSync(_0x26af5f,_0x3a43ad(0x2ca));}catch(_0x4b5e88){const _0x111993=_0x4b5e88 instanceof Error?_0x4b5e88[_0x3a43ad(0x2cc)]:String(_0x4b5e88);return console[_0x3a43ad(0x205)](_0x3a43ad(0x21e)+_0x111993),0x1;}const _0x5b5eb9=await withSpinner(_0x3a43ad(0x28a),()=>_0x271b9d['segment']['pushParentYaml'](_0x4a41ae),{'verbose':_0x977c04[_0x3a43ad(0x1e9)]}),_0x98b980=_0x5b5eb9[_0x3a43ad(0x30a)],{isNew:_0x50862e,name:_0x2a4b8a,hasChanges:_0x160fef,diffFormatted:_0x4830ff}=_0x98b980;if(_0x160fef){_0x50862e?console[_0x3a43ad(0x205)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x2a4b8a+'\x27:'):console[_0x3a43ad(0x205)](_0x3a43ad(0x217)+_0x2a4b8a+'\x27:');console[_0x3a43ad(0x205)]('─'[_0x3a43ad(0x21a)](0x3c)),console[_0x3a43ad(0x205)](_0x4830ff),console[_0x3a43ad(0x205)]('─'[_0x3a43ad(0x21a)](0x3c));const _0x2287c1=_0x50862e?_0x3a43ad(0x308)+_0x2a4b8a+_0x3a43ad(0x264):_0x3a43ad(0x30b)+_0x2a4b8a+_0x3a43ad(0x264);if(!_0x977c04[_0x3a43ad(0x307)]){const _0x366986=await confirmKey(_0x2287c1);if(!_0x366986)return console[_0x3a43ad(0x205)](_0x3a43ad(0x20c)),0x1;}const _0x409840=_0x50862e?_0x3a43ad(0x2a6):_0x3a43ad(0x2c2);await withSpinner(_0x409840+_0x3a43ad(0x242)+_0x2a4b8a+_0x3a43ad(0x274),()=>_0x98b980[_0x3a43ad(0x2be)](),{'verbose':_0x977c04[_0x3a43ad(0x1e9)]});const _0xae1497=_0x50862e?_0x3a43ad(0x27f):'Updated';console['error']('✔\x20'+_0xae1497+_0x3a43ad(0x242)+_0x2a4b8a+'\x27');}else console[_0x3a43ad(0x205)](_0x3a43ad(0x2b9)+_0x2a4b8a+'\x27\x20is\x20up\x20to\x20date');}const _0x2786ab=await withSpinner(_0x3a43ad(0x25d)+_0x32d041+'\x27...',()=>_0x271b9d[_0x3a43ad(0x23e)][_0x3a43ad(0x2b6)](_0x32d041),{'verbose':_0x977c04[_0x3a43ad(0x1e9)]}),_0x2301b5=_0x2786ab[_0x3a43ad(0x30a)],_0x2f7c42=getConsoleUrl(_0x977c04[_0x3a43ad(0x238)],'/app/workflows/'+_0x2301b5[_0x3a43ad(0x1f5)]+_0x3a43ad(0x2c7)+_0x2301b5[_0x3a43ad(0x219)]+'/attempt/'+_0x2301b5['workflowAttemptId']);return console[_0x3a43ad(0x205)](_0x3a43ad(0x27a)),console[_0x3a43ad(0x205)]('\x20\x20'+a27_0x44fedf[_0x3a43ad(0x2d3)](_0x3a43ad(0x2d5))+'\x20'+_0x2301b5[_0x3a43ad(0x1f0)]),console[_0x3a43ad(0x205)]('\x20\x20'+a27_0x44fedf[_0x3a43ad(0x2d3)](_0x3a43ad(0x256))+'\x20'+_0x2301b5['status']),console['error']('\x20\x20'+a27_0x44fedf[_0x3a43ad(0x2d3)]('Session:')+'\x20'+_0x2301b5[_0x3a43ad(0x219)]),console[_0x3a43ad(0x205)]('\x20\x20'+a27_0x44fedf[_0x3a43ad(0x2d3)](_0x3a43ad(0x2bc))+'\x20'+_0x2301b5[_0x3a43ad(0x2d0)]),console['error']('\x20\x20'+_0x2f7c42),console[_0x3a43ad(0x205)]('\x0a'+a27_0x44fedf[_0x3a43ad(0x2d3)]('To\x20cancel:')+_0x3a43ad(0x267)+_0x2301b5[_0x3a43ad(0x2d0)]+_0x3a43ad(0x207)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a27_0x30a75a(0x2de)]=a27_0x30a75a(0x26a);['description']=a27_0x30a75a(0x2a9);async[a27_0x30a75a(0x235)](_0x8a1c10){const _0x43a4cd=a27_0x30a75a,{options:_0x545e4b,args:_0x2c6065,tdx:_0x1670c4}=_0x8a1c10,_0x24e3b2=_0x2c6065[0x0]||_0x545e4b['parentSegment'];if(!_0x24e3b2)return console[_0x43a4cd(0x205)](a27_0x44fedf[_0x43a4cd(0x20e)](_0x43a4cd(0x22c))),console[_0x43a4cd(0x205)](_0x43a4cd(0x26d)),console[_0x43a4cd(0x205)](a27_0x44fedf['cyan'](_0x43a4cd(0x288))),0x1;_0x545e4b[_0x43a4cd(0x1e9)]&&(console[_0x43a4cd(0x205)](_0x43a4cd(0x282)+_0x545e4b[_0x43a4cd(0x238)]),console[_0x43a4cd(0x205)](_0x43a4cd(0x302)+_0x24e3b2));const _0x294f3f=await withSpinner(_0x43a4cd(0x290)+_0x24e3b2+_0x43a4cd(0x274),()=>_0x1670c4[_0x43a4cd(0x23e)][_0x43a4cd(0x2c0)](_0x24e3b2),{'verbose':_0x545e4b[_0x43a4cd(0x1e9)]}),_0x53110d=_0x294f3f['data'];console[_0x43a4cd(0x205)](_0x43a4cd(0x203)+_0x53110d['length']+'\x20field'+(_0x53110d['length']!==0x1?'s':''));if(_0x545e4b[_0x43a4cd(0x296)]||_0x545e4b[_0x43a4cd(0x2f5)])return await handleSDKOutput(_0x53110d,_0x545e4b),0x0;return displayFieldsHumanReadable(_0x53110d,_0x24e3b2),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a27_0x30a75a(0x2de)]='segment:parent:view';[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x2e1);async[a27_0x30a75a(0x235)](_0x296d83){const _0x18d720=a27_0x30a75a,{options:_0x239273,args:_0x263fcf,tdx:_0x55d578}=_0x296d83,_0x5bb925=_0x239273,_0x529b6f=_0x263fcf[0x0]||_0x239273['parentSegment'];if(!_0x529b6f)return console[_0x18d720(0x205)](a27_0x44fedf[_0x18d720(0x20e)](_0x18d720(0x22c))),console[_0x18d720(0x205)]('Usage:\x20tdx\x20ps\x20view\x20[name]\x20[-w]\x0a'),console[_0x18d720(0x205)](_0x18d720(0x2df)),console['error'](_0x18d720(0x20d)),console['error'](a27_0x44fedf['cyan']('\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x239273[_0x18d720(0x1e9)]&&(console[_0x18d720(0x205)](_0x18d720(0x282)+_0x239273[_0x18d720(0x238)]),console[_0x18d720(0x205)](_0x18d720(0x302)+_0x529b6f));const _0x2202ad=await withSpinner(_0x18d720(0x26e)+_0x529b6f+'\x27...',()=>_0x55d578['segment'][_0x18d720(0x21d)](_0x529b6f),{'verbose':_0x239273[_0x18d720(0x1e9)]}),_0x28f0bd=_0x2202ad[_0x18d720(0x30a)];if(_0x5bb925['web']){const _0xcb1cd=getConsoleNextUrl(_0x5bb925['site'],_0x18d720(0x29d)+_0x28f0bd['id']);return console['error'](a27_0x44fedf['green']('✔')+_0x18d720(0x29c)+a27_0x44fedf['cyan'](_0xcb1cd)),openBrowser(_0xcb1cd),0x0;}return await handleSingleObjectOutput(_0x28f0bd,_0x239273),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a27_0x30a75a(0x1fb);[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x295);async[a27_0x30a75a(0x235)](_0x1eb9ef){const _0x4389e8=a27_0x30a75a,{options:_0x3353be,args:_0x1cead5,tdx:_0x2598c8}=_0x1eb9ef,_0x3f6bf2=_0x1cead5[0x0]||_0x3353be[_0x4389e8(0x29a)];if(!_0x3f6bf2)return console[_0x4389e8(0x205)](a27_0x44fedf['red'](_0x4389e8(0x22c))),console[_0x4389e8(0x205)](_0x4389e8(0x239)),console[_0x4389e8(0x205)](a27_0x44fedf[_0x4389e8(0x1e7)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x3353be[_0x4389e8(0x1e9)]&&(console['error'](_0x4389e8(0x282)+_0x3353be[_0x4389e8(0x238)]),console[_0x4389e8(0x205)](_0x4389e8(0x302)+_0x3f6bf2));const _0x155404=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3f6bf2+_0x4389e8(0x274),()=>_0x2598c8['segment'][_0x4389e8(0x2ed)](_0x3f6bf2),{'verbose':_0x3353be[_0x4389e8(0x1e9)]}),_0x449c5a=_0x155404['data'],_0x17a50=await withSpinner(_0x4389e8(0x241)+_0x3f6bf2+_0x4389e8(0x274),()=>_0x2598c8['segment']['getParentSQL'](_0x449c5a),{'verbose':_0x3353be[_0x4389e8(0x1e9)]}),_0x19ee6e=await executeSchemaQuery(_0x17a50[_0x4389e8(0x30a)],_0x2598c8,_0x3353be);return await handleQueryOutput(_0x19ee6e,_0x3353be),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a27_0x30a75a(0x2de)]='segment:parent:sql';[a27_0x30a75a(0x23b)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a27_0x30a75a(0x235)](_0xcf8a97){const _0x33a08a=a27_0x30a75a,{options:_0x7537a2,args:_0x56eb83,tdx:_0x58640d}=_0xcf8a97,_0xdd0e2f=_0x56eb83[0x0]||_0x7537a2[_0x33a08a(0x29a)];if(!_0xdd0e2f)return console[_0x33a08a(0x205)](a27_0x44fedf[_0x33a08a(0x20e)](_0x33a08a(0x22c))),console['error']('Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a'),console[_0x33a08a(0x205)](a27_0x44fedf[_0x33a08a(0x1e7)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`')),0x1;_0x7537a2[_0x33a08a(0x1e9)]&&(console[_0x33a08a(0x205)](_0x33a08a(0x282)+_0x7537a2['site']),console['error'](_0x33a08a(0x302)+_0xdd0e2f));const _0x3c5956=await withSpinner(_0x33a08a(0x25e)+_0xdd0e2f+'\x27...',()=>_0x58640d['segment'][_0x33a08a(0x2ed)](_0xdd0e2f),{'verbose':_0x7537a2['verbose']}),_0x81d5da=_0x3c5956['data'],_0x3f7794=await withSpinner(_0x33a08a(0x241)+_0xdd0e2f+_0x33a08a(0x274),()=>_0x58640d[_0x33a08a(0x23e)][_0x33a08a(0x298)](_0x81d5da),{'verbose':_0x7537a2[_0x33a08a(0x1e9)]}),_0x4fdb87=_0x3f7794[_0x33a08a(0x30a)];return _0x7537a2[_0x33a08a(0x25b)]==='json'||_0x7537a2[_0x33a08a(0x25b)]===_0x33a08a(0x2f5)?await handleSDKOutput([{'sql':_0x4fdb87}],_0x7537a2):console[_0x33a08a(0x292)](_0x4fdb87),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a27_0x30a75a(0x2de)]=a27_0x30a75a(0x2f9);[a27_0x30a75a(0x23b)]=a27_0x30a75a(0x261);async[a27_0x30a75a(0x235)](_0x6f19d0){const _0x2f6df9=a27_0x30a75a,{options:_0x2f2995,args:_0x27f45e,tdx:_0x5d70a1}=_0x6f19d0,_0x107506=_0x27f45e[0x0]||_0x2f2995[_0x2f6df9(0x29a)];if(!_0x107506)return console['error'](a27_0x44fedf[_0x2f6df9(0x20e)](_0x2f6df9(0x22c))),console[_0x2f6df9(0x205)](_0x2f6df9(0x286)),console[_0x2f6df9(0x205)](a27_0x44fedf['cyan'](_0x2f6df9(0x288))),0x1;_0x2f2995['verbose']&&(console[_0x2f6df9(0x205)](_0x2f6df9(0x282)+_0x2f2995['site']),console[_0x2f6df9(0x205)](_0x2f6df9(0x302)+_0x107506));const _0x166eda=await withSpinner(_0x2f6df9(0x25e)+_0x107506+_0x2f6df9(0x274),()=>_0x5d70a1[_0x2f6df9(0x23e)][_0x2f6df9(0x2ed)](_0x107506),{'verbose':_0x2f2995['verbose']}),_0x58bd44=_0x166eda['data'],_0x2a644b=await withSpinner(_0x2f6df9(0x241)+_0x107506+_0x2f6df9(0x274),()=>_0x5d70a1['segment'][_0x2f6df9(0x298)](_0x58bd44),{'verbose':_0x2f2995[_0x2f6df9(0x1e9)]});let _0x37b7a9=_0x2a644b[_0x2f6df9(0x30a)];const _0x26b952=resolveLimit(_0x2f2995['limit'],DEFAULT_DISPLAY_LIMIT),_0x4aedd0=/\bLIMIT\s+\d+/i['test'](_0x37b7a9);!_0x4aedd0&&(_0x37b7a9=_0x37b7a9[_0x2f6df9(0x2e4)]()[_0x2f6df9(0x305)](/;+$/,''),_0x37b7a9=_0x2f6df9(0x1ef)+_0x37b7a9+_0x2f6df9(0x25f)+_0x26b952);_0x2f2995[_0x2f6df9(0x1e9)]&&console[_0x2f6df9(0x205)](_0x2f6df9(0x2bf)+_0x37b7a9);const _0x3a2d80=await withQuerySpinner(_0x2f6df9(0x2a3),async _0x81e43f=>{const _0x405a27=_0x2f6df9,_0x434db4=await _0x5d70a1[_0x405a27(0x253)]['execute'](_0x37b7a9,{'catalog':'td','schema':'information_schema','onJobId':_0x5fd164=>{const _0x4622cb=_0x405a27;_0x81e43f[_0x4622cb(0x1fe)](_0x5fd164);}});return _0x434db4;},{'verbose':_0x2f2995[_0x2f6df9(0x1e9)]}),_0x4a17db=_0x3a2d80['data'],_0x2deced=_0x4a17db[_0x2f6df9(0x263)]?_0x2f6df9(0x2e8)+_0x4a17db[_0x2f6df9(0x263)]+']':'';return console['error'](_0x2f6df9(0x245)+_0x4a17db[_0x2f6df9(0x2f3)][_0x2f6df9(0x289)][_0x2f6df9(0x2dd)]()+_0x2f6df9(0x252)+(_0x2f6df9(0x1ea)+formatElapsed(_0x4a17db[_0x2f6df9(0x2f3)]['elapsedTimeMillis'])+_0x2deced)),await handleQueryOutput(_0x4a17db,_0x2f2995),0x0;}}
1
+ const a28_0x3d9eee=a28_0x5394;(function(_0x4661b4,_0x1fad86){const _0x433fcc=a28_0x5394,_0x47da59=_0x4661b4();while(!![]){try{const _0x7cf1a3=-parseInt(_0x433fcc(0x18f))/0x1*(-parseInt(_0x433fcc(0x1ec))/0x2)+parseInt(_0x433fcc(0x1b7))/0x3+parseInt(_0x433fcc(0x26c))/0x4*(-parseInt(_0x433fcc(0x271))/0x5)+parseInt(_0x433fcc(0x21e))/0x6*(parseInt(_0x433fcc(0x22a))/0x7)+parseInt(_0x433fcc(0x21a))/0x8*(parseInt(_0x433fcc(0x201))/0x9)+-parseInt(_0x433fcc(0x219))/0xa*(-parseInt(_0x433fcc(0x2a2))/0xb)+-parseInt(_0x433fcc(0x1fa))/0xc;if(_0x7cf1a3===_0x1fad86)break;else _0x47da59['push'](_0x47da59['shift']());}catch(_0x762e34){_0x47da59['push'](_0x47da59['shift']());}}}(a28_0xe99e,0x9aaab));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a28_0x2b43c0 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a28_0x5394(_0x29de59,_0x4506c2){_0x29de59=_0x29de59-0x17d;const _0xe99e4d=a28_0xe99e();let _0x53948d=_0xe99e4d[_0x29de59];return _0x53948d;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';function a28_0xe99e(){const _0x10fd5c=['Columns:','List\x20available\x20fields\x20for\x20segmentation','message','\x20No\x20changes\x20-\x20','displayPreviewResults','710973cGFDDe','format','test','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Overwrite\x20\x27','Behavior:','status','schemaValid','✘\x20Failed\x20to\x20rename\x20directory:\x20','string','Attributes','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','segment:parent:desc','Fetching\x20current\x20configuration\x20for\x20\x27','parentSegment','No\x20parent\x20segments\x20found','scheduleOption','filter','Attribute:','\x20--enriched','Create\x20parent\x20segment\x20\x27','displayColumns','FINISHED','2530eraLNz','16lziugt','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','jobId','json','24SwclGv','/app/workflows/','segment:parent:create','\x20--behavior\x20\x22<name>\x22','To\x20view\x20sample\x20data:','\x20--attribute\x20\x22<name>\x22','/{name}.yml\x0a','toFixed','output','👥\x20','previewParentYaml','verbose','342706WPwjmk','yes','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Session:','customersWithEvents','Fetching\x20SQL\x20for\x20\x27','createParent','displayBehaviorsStats','run','Customers:','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','label','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Validate:','cyan','Error\x20parsing\x20YAML:\x20','Source:','\x20Context\x20set:\x20','customerGroupFile','schemaError','Parent\x20segment:\x20','Error:\x20--database\x20and\x20--table\x20are\x20required','Listing\x20parent\x20segments\x20matching\x20\x27','execute','SQL\x20query:\x0a','\x20kill','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x20--behavior\x20\x22','Site:\x20','Error:\x20File\x20not\x20found:\x20','displayAttributesStats','segment','Executing\x20parent\x20segment\x20query...','addAttributes','Found\x20YAML\x20file:\x20','site','table','segment:parent:push','.yaml','Error:\x20--attribute\x20requires\x20a\x20name\x0a','matchedCount','pushParentYaml','interval','\x27...','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','database','isDirectory','length','Created','displaySummary','\x20parent\x20segment','timezone','columns','\x20Opening\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','-1d','Options:','Options\x20(one\x20required):\x0a','\x20parent\x20segment\x20\x27','Table:\x20','double','segment:parent:validate','2356nVWCXK','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','repeat','segment:parent:view','attributes','1810WIaScZ','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','sampleData','use','column','/\x20→\x20','customerGroup','master','text','workflowId','elapsedTimeMillis','To\x20cancel:','getParentSQL','✔\x20Found\x20','/sessions/','preview','log','SELECT\x20*\x20FROM\x20(\x0a','/app/dw/parentSegments/','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Errors:','tdx\x20segment\x20parent\x20preview\x20','Apply\x20changes\x20to\x20\x27','foreignKey','segment:parent:run','segment:parent:pull','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','No\x20parent\x20segments\x20match\x20pattern:\x20','\x20--interval\x20','\x27\x20and\x20run\x20workflow?','dirname','✔\x20No\x20changes\x20-\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','all','rowCount','listParents','Show\x20parent\x20segment\x20details','data','attribute','\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','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','listFields','workflowSessionId','red','Fetching\x20parent\x20segment\x20\x27','processedRows','population','99ZbiYvg','segment:parent:list','\x20rows)','xdg-open','coveragePercent','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20tdx\x20wf\x20attempt\x20','workflowAttemptId','resolveParentId','yellow','behaviors','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','dim','Rows:','displayValidateResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x27\x20is\x20up\x20to\x20date','Aborted.','error','getParentFull','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Join\x20on:','Show\x20parent\x20segment\x20schema\x20(column\x20types)','819659Tvceio','Join:','name','Status:','Error\x20reading\x20file:\x20','updateParent','Updating','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','win32','runParent','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Available\x20behaviors:','jsonl','Resolving\x20parent\x20segment\x20\x27','open','Error:\x20Parent\x20segment\x20name\x20is\x20required','description','displayPreviewHints','localeCompare','Behaviors','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x0aChanges\x20to\x20apply\x20to\x20\x27','Pattern:\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x5c$&','joinKey','limit','addBehaviorsFile','Audience\x20ID:','behaviorsFile','Available\x20attributes:','query','segment:parent:update','\x20[Job\x20ID:\x20','audienceId','endsWith','map','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Creating','2927700GDMHiG','Updated','\x20\x20No\x20sample\x20data\x20available','List\x20parent\x20segments','allValid','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','segment:parent:fields','varchar','\x20rows\x20','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','replace','scheduleType','attributesFile','Get\x20SQL\x20query\x20for\x20parent\x20segment','behavior','Analyzing\x20changes...','\x20\x20\x20\x20-\x20','displayMasterInfo','bold','keys','stop','Error:\x20--behavior\x20requires\x20a\x20name\x0a','errors','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','customerPercent','\x20is\x20already\x20up\x20to\x20date','ignore','/attempt/','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','segment:parent:show','Listing\x20parent\x20segments...','session','displaySampleData','.yml','enriched','Master:','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Error:','\x0a✔\x20Workflow\x20started','utf-8','Preview:','using\x20the\x20default\x20path:\x20','start','Name:\x20','Options:\x0a','toLocaleString','Listing\x20fields\x20for\x20\x27','in\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','/\x20directories\x20exist.','\x27\x20is\x20already\x20up\x20to\x20date','2NPFjEG','\x0aChanges\x20to\x20\x27','YAML\x20file:\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','platform','apply','\x20=\x20','parent_segment','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Updating\x20parent\x20segment\x20\x27','green','Fetching\x20sample\x20data...','15659148DbjckD','\x0aUsage:\x20tdx\x20ps\x20preview\x20'];a28_0xe99e=function(){return _0x10fd5c;};return a28_0xe99e();}import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a28_0x4d9b6e from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a28_0x3d9eee(0x1f5);function openBrowser(_0x5b4fb7){const _0xb4a241=a28_0x3d9eee,_0x297c33=process[_0xb4a241(0x1f2)],_0x3cad34=_0x297c33===_0xb4a241(0x29a)?_0xb4a241(0x19d):_0x297c33===_0xb4a241(0x197)?_0xb4a241(0x1e2):_0xb4a241(0x2a5);spawn(_0x3cad34,[_0x5b4fb7],{'detached':!![],'stdio':_0xb4a241(0x1d2)})['unref']();}function migrateLegacyDirectory(){const _0x5e1cab=a28_0x3d9eee;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0xc5510a=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0xc5510a[_0x5e1cab(0x25c)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x5e1cab(0x18a)](a28_0x4d9b6e[_0x5e1cab(0x181)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x5e1cab(0x1ea))),console[_0x5e1cab(0x18a)](a28_0x4d9b6e[_0x5e1cab(0x184)](_0x5e1cab(0x234)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console['error'](a28_0x4d9b6e[_0x5e1cab(0x181)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x5e1cab(0x276)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a28_0x4d9b6e[_0x5e1cab(0x1f8)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x3849f9){const _0x223bd9=_0x3849f9 instanceof Error?_0x3849f9[_0x5e1cab(0x1fe)]:String(_0x3849f9);return console[_0x5e1cab(0x18a)](a28_0x4d9b6e['red'](_0x5e1cab(0x20a)+_0x223bd9+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a28_0x3d9eee(0x232)](_0x33f448){const _0x4826af=a28_0x3d9eee;return migrateLegacyDirectory(),super[_0x4826af(0x232)](_0x33f448);}}function resolveYamlFile(_0xe01c8b){const _0x1890df=a28_0x3d9eee;if(_0xe01c8b[_0x1890df(0x1b2)]('.yml')||_0xe01c8b[_0x1890df(0x1b2)](_0x1890df(0x251)))return _0xe01c8b;return a28_0x2b43c0['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0xe01c8b)+_0x1890df(0x1d9));}function formatProgressMessage(_0x15235f){const _0x226c42=a28_0x3d9eee,_0xbdb971=_0x15235f['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0xbdb971){const [,_0x2592b9,_0x17edca,_0x2e2952='']=_0xbdb971;return a28_0x4d9b6e[_0x226c42(0x184)](_0x2592b9+':')+'\x20'+_0x17edca+a28_0x4d9b6e[_0x226c42(0x184)](_0x2e2952);}return a28_0x4d9b6e['dim'](_0x15235f);}function showFileNotFoundError(_0x1bcddc,_0x225874){const _0x2b7360=a28_0x3d9eee;console[_0x2b7360(0x18a)](a28_0x4d9b6e[_0x2b7360(0x29e)](_0x2b7360(0x248)+_0x1bcddc+'\x0a')),console[_0x2b7360(0x18a)](a28_0x4d9b6e[_0x2b7360(0x239)](_0x2b7360(0x1a3)+_0x225874+'`\x20to\x20download\x20the\x20configuration\x20first'));}function showParentSegmentNotSetError(_0x36494e){const _0x38805a=a28_0x3d9eee;console[_0x38805a(0x18a)](a28_0x4d9b6e[_0x38805a(0x181)](_0x38805a(0x264))),console[_0x38805a(0x18a)](_0x36494e);}export class ParentSegmentListCommand extends BaseCommand{[a28_0x3d9eee(0x191)]=a28_0x3d9eee(0x2a3);[a28_0x3d9eee(0x19f)]=a28_0x3d9eee(0x1ba);async[a28_0x3d9eee(0x242)](_0x555a58){const _0x137a4a=a28_0x3d9eee,{options:_0x85541a,args:_0x360572,tdx:_0x336f28}=_0x555a58,_0x416eef=_0x360572[0x0];_0x85541a[_0x137a4a(0x229)]&&(console[_0x137a4a(0x18a)](_0x137a4a(0x247)+_0x85541a[_0x137a4a(0x24e)]),_0x416eef&&console[_0x137a4a(0x18a)](_0x137a4a(0x1a5)+_0x416eef));const _0x22689c=await withSpinner(_0x416eef?_0x137a4a(0x241)+_0x416eef+_0x137a4a(0x256):_0x137a4a(0x1d6),()=>_0x336f28[_0x137a4a(0x24a)][_0x137a4a(0x295)](),{'verbose':_0x85541a[_0x137a4a(0x229)]});let _0x595496=_0x22689c[_0x137a4a(0x297)];if(_0x416eef){const _0x47d03d=_0x416eef[_0x137a4a(0x1c2)](/[.+^${}()|[\]\\]/g,_0x137a4a(0x1a7))[_0x137a4a(0x1c2)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x2c3171=new RegExp('^'+_0x47d03d+'$','i');_0x595496=_0x595496[_0x137a4a(0x213)](_0x204531=>_0x2c3171[_0x137a4a(0x203)](_0x204531[_0x137a4a(0x270)][_0x137a4a(0x191)]));}_0x595496['sort']((_0x2507ee,_0x18f68e)=>_0x2507ee[_0x137a4a(0x270)]['name'][_0x137a4a(0x1a1)](_0x18f68e['attributes'][_0x137a4a(0x191)])),console[_0x137a4a(0x18a)]('✔\x20Found\x20'+_0x595496[_0x137a4a(0x25d)]+_0x137a4a(0x260)+(_0x595496['length']!==0x1?'s':''));if(_0x85541a['format']===_0x137a4a(0x21d)||_0x85541a[_0x137a4a(0x202)]==='jsonl')await handleSDKOutput(_0x595496,_0x85541a);else{if(_0x595496[_0x137a4a(0x25d)]===0x0)_0x416eef?console[_0x137a4a(0x281)](_0x137a4a(0x28d)+_0x416eef):console[_0x137a4a(0x281)](_0x137a4a(0x211));else for(const _0x2f554f of _0x595496){const _0x3b514d=_0x2f554f['attributes']['population']?a28_0x4d9b6e[_0x137a4a(0x184)]('\x20('+formatRows(_0x2f554f[_0x137a4a(0x270)][_0x137a4a(0x2a1)])+')'):'';console[_0x137a4a(0x281)](_0x137a4a(0x227)+_0x2f554f['attributes']['name']+_0x3b514d);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a28_0x3d9eee(0x191)]=a28_0x3d9eee(0x220);[a28_0x3d9eee(0x19f)]=a28_0x3d9eee(0x183);async['execute'](_0x3df5ea){const _0x49cc6d=a28_0x3d9eee,{options:_0x365e41,args:_0x2e965c,tdx:_0x5bae83}=_0x3df5ea;console['error'](_0x49cc6d(0x1bc)+_0x49cc6d(0x1e9)+_0x49cc6d(0x17d));const _0x1769fc=_0x365e41;if(_0x2e965c[_0x49cc6d(0x25d)]===0x0)return console[_0x49cc6d(0x18a)](a28_0x4d9b6e[_0x49cc6d(0x29e)](_0x49cc6d(0x19e))),console['error'](_0x49cc6d(0x1dc)),0x1;const _0x37d5aa=_0x2e965c[0x0];if(!_0x1769fc[_0x49cc6d(0x25b)]||!_0x1769fc['table'])return console[_0x49cc6d(0x18a)](_0x49cc6d(0x240)),console['error'](_0x49cc6d(0x1dc)),0x1;_0x1769fc[_0x49cc6d(0x229)]&&(console[_0x49cc6d(0x18a)](_0x49cc6d(0x247)+_0x1769fc['site']),console[_0x49cc6d(0x18a)](_0x49cc6d(0x1e3)+_0x37d5aa),console[_0x49cc6d(0x18a)]('Database:\x20'+_0x1769fc[_0x49cc6d(0x25b)]),console[_0x49cc6d(0x18a)](_0x49cc6d(0x269)+_0x1769fc['table']));const _0x34e7c5=await loadJSONFromOptions(_0x1769fc[_0x49cc6d(0x270)],_0x1769fc[_0x49cc6d(0x1c4)]),_0x42a0fa=await loadJSONFromOptions(_0x1769fc[_0x49cc6d(0x182)],_0x1769fc[_0x49cc6d(0x1ac)]),_0x12543=await loadJSONFromOptions(_0x1769fc[_0x49cc6d(0x277)],_0x1769fc[_0x49cc6d(0x23d)]),_0x3e2772={'name':_0x37d5aa,'description':_0x1769fc[_0x49cc6d(0x19f)],'scheduleType':_0x1769fc[_0x49cc6d(0x1c3)],'scheduleOption':_0x1769fc[_0x49cc6d(0x212)],'timezone':_0x1769fc[_0x49cc6d(0x261)],'master':{'parentDatabaseName':_0x1769fc[_0x49cc6d(0x25b)],'parentTableName':_0x1769fc[_0x49cc6d(0x24f)]},'attributes':_0x34e7c5,'behaviors':_0x42a0fa,'customerGroup':_0x12543},_0x3c2cc2=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x37d5aa+_0x49cc6d(0x256),()=>_0x5bae83[_0x49cc6d(0x24a)][_0x49cc6d(0x230)](_0x3e2772),{'verbose':_0x365e41[_0x49cc6d(0x229)]}),_0x33293d=_0x3c2cc2[_0x49cc6d(0x297)];return console[_0x49cc6d(0x18a)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x33293d['name']+'\x27\x20with\x20ID:\x20'+_0x33293d['id']),await handleSDKOutput([_0x33293d],_0x365e41),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a28_0x3d9eee(0x191)]=a28_0x3d9eee(0x1af);[a28_0x3d9eee(0x19f)]=a28_0x3d9eee(0x235);async[a28_0x3d9eee(0x242)](_0x57075c){const _0x5bb8f8=a28_0x3d9eee,{options:_0x1f959c,args:_0x529571,tdx:_0x5efca2}=_0x57075c;console[_0x5bb8f8(0x18a)](_0x5bb8f8(0x1ef)+_0x5bb8f8(0x1e9)+_0x5bb8f8(0x17d));const _0x335df7=_0x1f959c;if(_0x529571[_0x5bb8f8(0x25d)]===0x0)return console[_0x5bb8f8(0x18a)](a28_0x4d9b6e[_0x5bb8f8(0x29e)](_0x5bb8f8(0x19e))),console['error'](_0x5bb8f8(0x18c)),0x1;const _0x614d64=_0x529571[0x0];_0x335df7[_0x5bb8f8(0x229)]&&(console[_0x5bb8f8(0x18a)](_0x5bb8f8(0x247)+_0x335df7[_0x5bb8f8(0x24e)]),console[_0x5bb8f8(0x18a)]('Parent\x20segment:\x20'+_0x614d64));const _0xeae9b8=await withSpinner(_0x5bb8f8(0x20f)+_0x614d64+_0x5bb8f8(0x256),()=>_0x5efca2['segment'][_0x5bb8f8(0x18b)](_0x614d64),{'verbose':_0x335df7['verbose']}),_0xd665f6=_0xeae9b8[_0x5bb8f8(0x297)],_0x98303c=await loadJSONFromOptions(_0x335df7[_0x5bb8f8(0x24c)],_0x335df7['addAttributesFile']),_0x412b0c=await loadJSONFromOptions(_0x335df7['addBehaviors'],_0x335df7[_0x5bb8f8(0x1aa)]),_0xb5ff66={'name':_0xd665f6[_0x5bb8f8(0x191)],'description':_0x335df7[_0x5bb8f8(0x19f)]!==undefined?_0x335df7['description']:_0xd665f6[_0x5bb8f8(0x19f)],'scheduleType':_0x335df7[_0x5bb8f8(0x1c3)]!==undefined?_0x335df7[_0x5bb8f8(0x1c3)]:_0xd665f6[_0x5bb8f8(0x1c3)],'scheduleOption':_0x335df7[_0x5bb8f8(0x212)]!==undefined?_0x335df7[_0x5bb8f8(0x212)]:_0xd665f6[_0x5bb8f8(0x212)],'timezone':_0x335df7[_0x5bb8f8(0x261)]!==undefined?_0x335df7[_0x5bb8f8(0x261)]:_0xd665f6[_0x5bb8f8(0x261)],'master':_0xd665f6[_0x5bb8f8(0x278)],'attributes':_0x98303c?[..._0xd665f6['attributes']||[],..._0x98303c]:_0xd665f6['attributes'],'behaviors':_0x412b0c?[..._0xd665f6[_0x5bb8f8(0x182)]||[],..._0x412b0c]:_0xd665f6['behaviors'],'customerGroup':_0xd665f6[_0x5bb8f8(0x277)]},_0x4cadb0=await withSpinner(_0x5bb8f8(0x1f7)+_0x614d64+_0x5bb8f8(0x256),()=>_0x5efca2['segment'][_0x5bb8f8(0x194)](_0x614d64,_0xb5ff66),{'verbose':_0x335df7[_0x5bb8f8(0x229)]}),_0x32de89=_0x4cadb0[_0x5bb8f8(0x297)];return console[_0x5bb8f8(0x18a)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x32de89['name']+'\x27'),await handleSDKOutput([_0x32de89],_0x335df7),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a28_0x3d9eee(0x191)]=a28_0x3d9eee(0x28a);['description']=a28_0x3d9eee(0x1a6);async[a28_0x3d9eee(0x242)](_0x1fdc70){const _0x40042b=a28_0x3d9eee,{options:_0x56f1ca,args:_0x1991e7,tdx:_0x95866}=_0x1fdc70,_0x596c66=_0x56f1ca,_0x44a18f=_0x1991e7[0x0]||_0x56f1ca[_0x40042b(0x210)];if(!_0x44a18f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x596c66[_0x40042b(0x274)]&&_0x596c66[_0x40042b(0x226)])return console['error'](a28_0x4d9b6e[_0x40042b(0x29e)](_0x40042b(0x20d))),console[_0x40042b(0x18a)](a28_0x4d9b6e['dim']('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x40042b(0x18a)](a28_0x4d9b6e['dim'](_0x40042b(0x1e1)+PARENT_SEGMENT_DIR+_0x40042b(0x224))),console[_0x40042b(0x18a)](a28_0x4d9b6e[_0x40042b(0x239)](_0x40042b(0x1f6))),0x1;const _0x141147=_0x596c66[_0x40042b(0x226)]||a28_0x2b43c0['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x44a18f)+_0x40042b(0x1d9));_0x596c66[_0x40042b(0x229)]&&(console['error'](_0x40042b(0x247)+_0x596c66['site']),console[_0x40042b(0x18a)](_0x40042b(0x23f)+_0x44a18f),console['error']('Output\x20file:\x20'+_0x141147));const _0x426917=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x44a18f+_0x40042b(0x256),()=>_0x95866[_0x40042b(0x24a)]['pullParentYaml'](_0x44a18f),{'verbose':_0x596c66[_0x40042b(0x229)]}),_0x338884=_0x426917[_0x40042b(0x297)];if(existsSync(_0x141147)){const _0x3020c4=readFileSync(_0x141147,_0x40042b(0x1df)),_0x4cf19b=generateDiff(_0x3020c4,_0x338884);if(!hasChanges(_0x4cf19b))console[_0x40042b(0x18a)](a28_0x4d9b6e['green']('✔')+_0x40042b(0x1ff)+a28_0x4d9b6e['cyan'](_0x141147)+_0x40042b(0x1d1));else{console[_0x40042b(0x18a)](_0x40042b(0x1ed)+_0x141147+'\x27:'),console[_0x40042b(0x18a)]('─'['repeat'](0x3c)),console[_0x40042b(0x18a)](formatDiffWithColors(_0x4cf19b)),console['error']('─'['repeat'](0x3c));if(!_0x596c66['yes']){const _0x1b4a18=await confirmKey(_0x40042b(0x206)+_0x141147+'\x27?');if(!_0x1b4a18)return console['error'](_0x40042b(0x189)),0x1;}writeFileSync(_0x141147,_0x338884,'utf-8'),console[_0x40042b(0x18a)](a28_0x4d9b6e[_0x40042b(0x1f8)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a28_0x4d9b6e[_0x40042b(0x239)](_0x141147));}}else{const _0x3c8a85=a28_0x2b43c0[_0x40042b(0x290)](_0x141147);!existsSync(_0x3c8a85)&&mkdirSync(_0x3c8a85,{'recursive':!![]}),writeFileSync(_0x141147,_0x338884,_0x40042b(0x1df)),console[_0x40042b(0x18a)](a28_0x4d9b6e[_0x40042b(0x1f8)]('✔')+_0x40042b(0x1f1)+a28_0x4d9b6e[_0x40042b(0x239)](_0x141147));}return saveSessionContext({'parent_segment':_0x44a18f},_0x596c66[_0x40042b(0x1d7)]),console[_0x40042b(0x18a)](a28_0x4d9b6e[_0x40042b(0x1f8)]('✔')+_0x40042b(0x23c)+a28_0x4d9b6e['dim']('parent_segment')+_0x40042b(0x1f4)+a28_0x4d9b6e[_0x40042b(0x239)](_0x44a18f)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a28_0x3d9eee(0x191)]=a28_0x3d9eee(0x250);[a28_0x3d9eee(0x19f)]=a28_0x3d9eee(0x28c);async[a28_0x3d9eee(0x242)](_0x2ab28e){const _0x317403=a28_0x3d9eee,{options:_0x2f9545,args:_0x12b916,tdx:_0x544fec}=_0x2ab28e,_0x3129aa=_0x2f9545,_0x2f2f24=_0x12b916[0x0]||_0x2f9545[_0x317403(0x210)];if(!_0x2f2f24)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x317403(0x284)),0x1;const _0x32e7bc=resolveYamlFile(_0x2f2f24);if(!existsSync(_0x32e7bc))return showFileNotFoundError(_0x32e7bc,_0x2f2f24),0x1;_0x3129aa['verbose']&&(console[_0x317403(0x18a)](_0x317403(0x247)+_0x3129aa[_0x317403(0x24e)]),console['error'](_0x317403(0x1ee)+_0x32e7bc));let _0x3c39c4;try{_0x3c39c4=readFileSync(_0x32e7bc,_0x317403(0x1df));}catch(_0x4f9295){const _0x5ead03=_0x4f9295 instanceof Error?_0x4f9295['message']:String(_0x4f9295);return console[_0x317403(0x18a)]('Error\x20reading\x20file:\x20'+_0x5ead03),0x1;}const _0x5a06dc=await withSpinner(_0x317403(0x1c7),()=>_0x544fec[_0x317403(0x24a)][_0x317403(0x254)](_0x3c39c4),{'verbose':_0x3129aa[_0x317403(0x229)]}),_0x2f7e29=_0x5a06dc['data'],{isNew:_0x3d4835,name:_0x45d2cf,hasChanges:_0x1a5efa,diffFormatted:_0x445d44}=_0x2f7e29;if(!_0x1a5efa)return console[_0x317403(0x18a)]('✔\x20No\x20changes\x20-\x20\x27'+_0x45d2cf+_0x317403(0x1eb)),0x0;_0x3d4835?console[_0x317403(0x18a)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x45d2cf+'\x27:'):console[_0x317403(0x18a)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x45d2cf+'\x27:');console[_0x317403(0x18a)]('─'[_0x317403(0x26e)](0x3c)),console['error'](_0x445d44),console[_0x317403(0x18a)]('─'[_0x317403(0x26e)](0x3c));const _0x5076ed=_0x3d4835?_0x317403(0x216)+_0x45d2cf+'\x27?':_0x317403(0x287)+_0x45d2cf+'\x27?';if(!_0x3129aa[_0x317403(0x22b)]){const _0x2c0b15=await confirmKey(_0x5076ed);if(!_0x2c0b15)return console[_0x317403(0x18a)](_0x317403(0x189)),0x1;}const _0x42146d=_0x3d4835?'Creating':'Updating',_0x22582c=await withSpinner(_0x42146d+_0x317403(0x268)+_0x45d2cf+'\x27...',()=>_0x2f7e29[_0x317403(0x1f3)](),{'verbose':_0x3129aa['verbose']}),_0x49b462=_0x22582c[_0x317403(0x297)],_0x48a6e3=getConsoleNextUrl(_0x3129aa['site'],_0x317403(0x283)+_0x49b462['id']),_0x18d536=_0x3d4835?_0x317403(0x25e):_0x317403(0x1b8);return console[_0x317403(0x18a)]('✔\x20'+_0x18d536+_0x317403(0x268)+_0x49b462[_0x317403(0x191)]+'\x27'),console[_0x317403(0x18a)]('\x20\x20'+_0x48a6e3),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a28_0x3d9eee(0x191)]=a28_0x3d9eee(0x26b);[a28_0x3d9eee(0x19f)]=a28_0x3d9eee(0x1bd);async[a28_0x3d9eee(0x242)](_0x5291fa){const _0x41f891=a28_0x3d9eee,{options:_0x26cda0,args:_0x2c07b7,tdx:_0x4d9415}=_0x5291fa,_0xb41d20=_0x26cda0,_0x37723f=_0x2c07b7[0x0]||_0x26cda0[_0x41f891(0x210)];if(!_0x37723f)return showParentSegmentNotSetError(_0x41f891(0x1c1)+_0x41f891(0x245)+_0x41f891(0x1e4)+_0x41f891(0x1f0)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x5cca51=resolveYamlFile(_0x37723f);if(!existsSync(_0x5cca51))return showFileNotFoundError(_0x5cca51,_0x37723f),0x1;_0xb41d20[_0x41f891(0x229)]&&(console[_0x41f891(0x18a)](_0x41f891(0x247)+_0xb41d20[_0x41f891(0x24e)]),console[_0x41f891(0x18a)]('YAML\x20file:\x20'+_0x5cca51));let _0x3f0013;try{_0x3f0013=readFileSync(_0x5cca51,_0x41f891(0x1df));}catch(_0x4fb463){const _0x10da59=_0x4fb463 instanceof Error?_0x4fb463['message']:String(_0x4fb463);return console[_0x41f891(0x18a)](_0x41f891(0x193)+_0x10da59),0x1;}const _0x2e4122=createCommandSpinner(a28_0x4d9b6e[_0x41f891(0x184)]('Validating\x20configuration...'),{'verbose':_0xb41d20[_0x41f891(0x229)]});_0x2e4122['start']();const _0x1a40ae={'onProgress':_0x26da68=>{_0x2e4122['text']=formatProgressMessage(_0x26da68);}};if(_0xb41d20['master'])_0x1a40ae[_0x41f891(0x278)]=!![];if(_0xb41d20[_0x41f891(0x1da)])_0x1a40ae[_0x41f891(0x1da)]=!![];_0xb41d20['attribute']&&(_0x1a40ae[_0x41f891(0x298)]=_0xb41d20[_0x41f891(0x298)]);_0xb41d20['behavior']&&(_0x1a40ae[_0x41f891(0x1c6)]=_0xb41d20[_0x41f891(0x1c6)]);if(_0xb41d20[_0x41f891(0x255)])_0x1a40ae['interval']=_0xb41d20[_0x41f891(0x255)];let _0x2c431c;try{_0x2c431c=await _0x4d9415['segment']['validateParentYaml'](_0x3f0013,_0x1a40ae),_0x2e4122['stop']();}catch(_0x3e55b0){_0x2e4122[_0x41f891(0x1cc)]();throw _0x3e55b0;}const _0x46fe8a=_0xb41d20[_0x41f891(0x255)]||_0x41f891(0x265);return this[_0x41f891(0x186)](_0x2c431c,_0x1a40ae,_0x5cca51,_0x46fe8a),_0x2c431c[_0x41f891(0x1bb)]?0x0:0x1;}[a28_0x3d9eee(0x186)](_0x22c6e5,_0x9fef18,_0x20b499,_0x59f2ca){const _0x4338f5=a28_0x3d9eee;console['error']('\x0a'+a28_0x4d9b6e['bold'](_0x4338f5(0x238))+'\x20'+_0x22c6e5[_0x4338f5(0x191)]),console[_0x4338f5(0x18a)]('═'[_0x4338f5(0x26e)](0x3c)),this[_0x4338f5(0x1c9)](_0x22c6e5);if(typeof _0x9fef18['attribute']==='string'){this[_0x4338f5(0x249)](_0x22c6e5),this[_0x4338f5(0x25f)](_0x22c6e5),this[_0x4338f5(0x1a0)](_0x20b499,_0x59f2ca,'attribute',_0x9fef18['attribute']);return;}if(_0x9fef18['attribute']===!![]){this[_0x4338f5(0x249)](_0x22c6e5),this[_0x4338f5(0x25f)](_0x22c6e5),this[_0x4338f5(0x1a0)](_0x20b499,_0x59f2ca,'attributes');return;}if(typeof _0x9fef18[_0x4338f5(0x1c6)]===_0x4338f5(0x20b)){this[_0x4338f5(0x231)](_0x22c6e5,_0x59f2ca),this[_0x4338f5(0x25f)](_0x22c6e5),this[_0x4338f5(0x1a0)](_0x20b499,_0x59f2ca,_0x4338f5(0x1c6),_0x9fef18['behavior']);return;}if(_0x9fef18[_0x4338f5(0x1c6)]===!![]){this[_0x4338f5(0x231)](_0x22c6e5,_0x59f2ca),this['displaySummary'](_0x22c6e5),this[_0x4338f5(0x1a0)](_0x20b499,_0x59f2ca,_0x4338f5(0x182));return;}this['displayAttributesStats'](_0x22c6e5),this['displayBehaviorsStats'](_0x22c6e5,_0x59f2ca),this[_0x4338f5(0x25f)](_0x22c6e5),this[_0x4338f5(0x1a0)](_0x20b499,_0x59f2ca,_0x4338f5(0x293));}[a28_0x3d9eee(0x1a0)](_0x113bcc,_0x392345,_0x1e9b17,_0x4e8330){const _0x254880=a28_0x3d9eee;console[_0x254880(0x18a)]('\x0a'+a28_0x4d9b6e[_0x254880(0x184)](_0x254880(0x222)));const _0x595025=_0x392345!=='-1d'?_0x254880(0x28e)+_0x392345:'';if(_0x1e9b17===_0x254880(0x298)&&_0x4e8330)console[_0x254880(0x18a)]('\x20\x20'+a28_0x4d9b6e['dim'](_0x254880(0x286)+_0x113bcc+'\x20--attribute\x20\x22'+_0x4e8330+'\x22'+_0x595025));else{if(_0x1e9b17===_0x254880(0x1c6)&&_0x4e8330)console[_0x254880(0x18a)]('\x20\x20'+a28_0x4d9b6e['dim'](_0x254880(0x286)+_0x113bcc+_0x254880(0x246)+_0x4e8330+'\x22'+_0x595025));else(_0x1e9b17===_0x254880(0x270)||_0x1e9b17==='all')&&console[_0x254880(0x18a)]('\x20\x20'+a28_0x4d9b6e[_0x254880(0x184)](_0x254880(0x286)+_0x113bcc+_0x254880(0x223)+_0x595025));}(_0x1e9b17===_0x254880(0x182)||_0x1e9b17===_0x254880(0x293))&&console[_0x254880(0x18a)]('\x20\x20'+a28_0x4d9b6e['dim'](_0x254880(0x286)+_0x113bcc+_0x254880(0x221)+_0x595025)),_0x1e9b17===_0x254880(0x293)&&console[_0x254880(0x18a)]('\x20\x20'+a28_0x4d9b6e['dim'](_0x254880(0x286)+_0x113bcc+_0x254880(0x215)+_0x595025));}[a28_0x3d9eee(0x1c9)](_0x5435c9){const _0x61a09a=a28_0x3d9eee,{master:_0x44e7b2}=_0x5435c9,_0x11277b=_0x44e7b2[_0x61a09a(0x209)]?a28_0x4d9b6e[_0x61a09a(0x1f8)]('✔'):a28_0x4d9b6e[_0x61a09a(0x29e)]('✘');console['error']('\x0a'+a28_0x4d9b6e[_0x61a09a(0x184)]('Master\x20Table')),console[_0x61a09a(0x18a)](_0x11277b+'\x20'+a28_0x4d9b6e[_0x61a09a(0x1ca)](_0x44e7b2[_0x61a09a(0x25b)]+'.'+_0x44e7b2['table'])),_0x44e7b2[_0x61a09a(0x209)]?_0x44e7b2['rowCount']!==undefined&&console[_0x61a09a(0x18a)]('\x20\x20'+a28_0x4d9b6e[_0x61a09a(0x184)](_0x61a09a(0x185))+'\x20'+a28_0x4d9b6e[_0x61a09a(0x239)](formatRows(_0x44e7b2[_0x61a09a(0x294)]))):console['error']('\x20\x20'+a28_0x4d9b6e[_0x61a09a(0x29e)]('Error:')+'\x20'+_0x44e7b2['schemaError']);}[a28_0x3d9eee(0x249)](_0x2dac8f){const _0x24e886=a28_0x3d9eee;if(_0x2dac8f[_0x24e886(0x270)]['length']===0x0)return;console['error']('\x0a'+a28_0x4d9b6e[_0x24e886(0x184)](_0x24e886(0x20c)));for(const _0x4963a0 of _0x2dac8f[_0x24e886(0x270)]){const _0x1afecc=_0x4963a0['schemaValid']?a28_0x4d9b6e[_0x24e886(0x1f8)]('✔'):a28_0x4d9b6e[_0x24e886(0x29e)]('✘');let _0x87c3ac='';if(_0x4963a0[_0x24e886(0x209)]&&_0x4963a0[_0x24e886(0x253)]!==undefined&&_0x4963a0['coveragePercent']!==undefined){const _0x1cad1e=_0x4963a0[_0x24e886(0x2a6)][_0x24e886(0x225)](0x1),_0x5ea577=_0x4963a0[_0x24e886(0x2a6)]>=0x50?a28_0x4d9b6e['green']:_0x4963a0[_0x24e886(0x2a6)]>=0x32?a28_0x4d9b6e['yellow']:a28_0x4d9b6e[_0x24e886(0x29e)];_0x87c3ac='\x20'+a28_0x4d9b6e[_0x24e886(0x184)]('Coverage:')+'\x20'+_0x5ea577(_0x1cad1e+'%')+'\x20('+formatRows(_0x4963a0['matchedCount'])+_0x24e886(0x2a4);}console[_0x24e886(0x18a)](_0x1afecc+'\x20'+a28_0x4d9b6e[_0x24e886(0x1ca)](_0x4963a0[_0x24e886(0x191)])+_0x87c3ac),console[_0x24e886(0x18a)]('\x20\x20'+a28_0x4d9b6e[_0x24e886(0x184)](_0x24e886(0x23b))+'\x20'+a28_0x4d9b6e['bold'](_0x4963a0[_0x24e886(0x25b)]+'.'+_0x4963a0[_0x24e886(0x24f)]));const _0x47969d=_0x4963a0['joinKey']===_0x4963a0[_0x24e886(0x288)]?a28_0x4d9b6e[_0x24e886(0x184)](_0x24e886(0x18d))+'\x20'+_0x4963a0['joinKey']:a28_0x4d9b6e[_0x24e886(0x184)]('Join:')+'\x20'+_0x4963a0[_0x24e886(0x1a8)]+_0x24e886(0x1f4)+_0x4963a0[_0x24e886(0x288)];console['error']('\x20\x20'+_0x47969d),console['error']('\x20\x20'+a28_0x4d9b6e[_0x24e886(0x184)]('Columns:')),this[_0x24e886(0x217)](_0x4963a0[_0x24e886(0x262)]),!_0x4963a0[_0x24e886(0x209)]&&console[_0x24e886(0x18a)]('\x20\x20'+a28_0x4d9b6e[_0x24e886(0x29e)](_0x24e886(0x1dd))+'\x20'+_0x4963a0[_0x24e886(0x23e)]);}}[a28_0x3d9eee(0x231)](_0x22dac,_0x5892e4){const _0x254104=a28_0x3d9eee;if(_0x22dac[_0x254104(0x182)][_0x254104(0x25d)]===0x0)return;console['error']('\x0a'+a28_0x4d9b6e[_0x254104(0x184)](_0x254104(0x1a2))+'\x20'+a28_0x4d9b6e[_0x254104(0x184)]('('+_0x5892e4+')'));for(const _0x52fae9 of _0x22dac['behaviors']){const _0x3fb768=_0x52fae9[_0x254104(0x209)]?a28_0x4d9b6e[_0x254104(0x1f8)]('✔'):a28_0x4d9b6e[_0x254104(0x29e)]('✘');let _0x51b380='';if(_0x52fae9[_0x254104(0x209)]&&_0x52fae9[_0x254104(0x22e)]!==undefined&&_0x52fae9['totalEvents']!==undefined){const _0x5dcdce=_0x52fae9['customerPercent']?.[_0x254104(0x225)](0x1)||'?',_0x4cb8e2=(_0x52fae9[_0x254104(0x1d0)]??0x0)>=0x32?a28_0x4d9b6e[_0x254104(0x1f8)]:(_0x52fae9[_0x254104(0x1d0)]??0x0)>=0x14?a28_0x4d9b6e[_0x254104(0x181)]:a28_0x4d9b6e[_0x254104(0x29e)];_0x51b380='\x20'+a28_0x4d9b6e[_0x254104(0x184)](_0x254104(0x233))+'\x20'+_0x4cb8e2(formatRows(_0x52fae9[_0x254104(0x22e)]))+'\x20('+_0x5dcdce+'%)\x20'+a28_0x4d9b6e[_0x254104(0x184)]('Events:')+'\x20'+a28_0x4d9b6e[_0x254104(0x239)](formatRows(_0x52fae9['totalEvents']));}console[_0x254104(0x18a)](_0x3fb768+'\x20'+a28_0x4d9b6e[_0x254104(0x1ca)](_0x52fae9[_0x254104(0x191)])+_0x51b380),console['error']('\x20\x20'+a28_0x4d9b6e[_0x254104(0x184)](_0x254104(0x23b))+'\x20'+a28_0x4d9b6e[_0x254104(0x1ca)](_0x52fae9[_0x254104(0x25b)]+'.'+_0x52fae9[_0x254104(0x24f)]));const _0x47047f=_0x52fae9[_0x254104(0x1a8)]===_0x52fae9[_0x254104(0x288)]?a28_0x4d9b6e[_0x254104(0x184)]('Join\x20on:')+'\x20'+_0x52fae9['joinKey']:a28_0x4d9b6e['dim'](_0x254104(0x190))+'\x20'+_0x52fae9[_0x254104(0x1a8)]+_0x254104(0x1f4)+_0x52fae9[_0x254104(0x288)];console[_0x254104(0x18a)]('\x20\x20'+_0x47047f),console[_0x254104(0x18a)]('\x20\x20'+a28_0x4d9b6e['dim'](_0x254104(0x1fc))),this[_0x254104(0x217)](_0x52fae9[_0x254104(0x262)]),!_0x52fae9[_0x254104(0x209)]&&console[_0x254104(0x18a)]('\x20\x20'+a28_0x4d9b6e[_0x254104(0x29e)](_0x254104(0x1dd))+'\x20'+_0x52fae9[_0x254104(0x23e)]);}}[a28_0x3d9eee(0x217)](_0x17ca7c){const _0x41aef1=a28_0x3d9eee;for(const _0x5b27de of _0x17ca7c){_0x5b27de[_0x41aef1(0x236)]===_0x5b27de[_0x41aef1(0x275)]||_0x5b27de[_0x41aef1(0x275)]==='*'?console[_0x41aef1(0x18a)](_0x41aef1(0x1c8)+_0x5b27de[_0x41aef1(0x236)]):console['error'](_0x41aef1(0x1c8)+_0x5b27de['label']+'\x20'+a28_0x4d9b6e['dim']('('+_0x5b27de[_0x41aef1(0x275)]+')'));}}['displaySummary'](_0x4d04d2){const _0x2c42bc=a28_0x3d9eee;console[_0x2c42bc(0x18a)]('─'['repeat'](0x3c));if(_0x4d04d2['errors'][_0x2c42bc(0x25d)]>0x0){console['error']('\x0a'+a28_0x4d9b6e[_0x2c42bc(0x29e)]('Errors:'));for(const _0x1486ca of _0x4d04d2[_0x2c42bc(0x1ce)]){console[_0x2c42bc(0x18a)]('\x20\x20'+a28_0x4d9b6e[_0x2c42bc(0x29e)]('•')+'\x20'+_0x1486ca);}}_0x4d04d2[_0x2c42bc(0x1bb)]&&console[_0x2c42bc(0x18a)]('\x0a'+a28_0x4d9b6e[_0x2c42bc(0x1f8)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a28_0x3d9eee(0x191)]='segment:parent:preview';['description']='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async['execute'](_0x2b5e66){const _0x586ece=a28_0x3d9eee,{options:_0x18918d,args:_0x46628c,tdx:_0x3a6a3a}=_0x2b5e66,_0x36fb1b=_0x18918d,_0x30b71f=_0x46628c[0x0]||_0x18918d[_0x586ece(0x210)];if(!_0x30b71f)return showParentSegmentNotSetError(_0x586ece(0x22c)+_0x586ece(0x26d)+_0x586ece(0x267)+_0x586ece(0x237)+_0x586ece(0x258)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x586ece(0x21b)+_0x586ece(0x25a)),0x1;if(!_0x36fb1b[_0x586ece(0x278)]&&!_0x36fb1b[_0x586ece(0x298)]&&!_0x36fb1b[_0x586ece(0x1c6)]&&!_0x36fb1b['enriched'])return console[_0x586ece(0x18a)](a28_0x4d9b6e[_0x586ece(0x29e)](_0x586ece(0x199))),console['error'](_0x586ece(0x1e8)),console[_0x586ece(0x18a)](_0x586ece(0x266)),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console['error']('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x586ece(0x18a)](_0x586ece(0x196)),console[_0x586ece(0x18a)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x220342=resolveYamlFile(_0x30b71f);if(!existsSync(_0x220342))return showFileNotFoundError(_0x220342,_0x30b71f),0x1;_0x36fb1b[_0x586ece(0x229)]&&(console[_0x586ece(0x18a)](_0x586ece(0x247)+_0x36fb1b[_0x586ece(0x24e)]),console[_0x586ece(0x18a)]('YAML\x20file:\x20'+_0x220342));let _0x41c9f3;try{_0x41c9f3=readFileSync(_0x220342,_0x586ece(0x1df));}catch(_0x494f27){const _0x59f78f=_0x494f27 instanceof Error?_0x494f27[_0x586ece(0x1fe)]:String(_0x494f27);return console['error'](_0x586ece(0x193)+_0x59f78f),0x1;}let _0x2c9d8f;try{_0x2c9d8f=parseYamlString(_0x41c9f3);}catch(_0x5b1a44){const _0x4bf8a4=_0x5b1a44 instanceof Error?_0x5b1a44[_0x586ece(0x1fe)]:String(_0x5b1a44);return console['error'](a28_0x4d9b6e[_0x586ece(0x29e)](_0x586ece(0x23a)+_0x4bf8a4)),0x1;}if(_0x36fb1b[_0x586ece(0x298)]===!![]||_0x36fb1b[_0x586ece(0x298)]===''){const _0x2f48d4=_0x2c9d8f[_0x586ece(0x270)]?.[_0x586ece(0x1b3)](_0x4cc2be=>_0x4cc2be[_0x586ece(0x191)])||[];if(_0x2f48d4[_0x586ece(0x25d)]===0x0)console[_0x586ece(0x18a)](a28_0x4d9b6e[_0x586ece(0x29e)](_0x586ece(0x257)));else{console['error'](a28_0x4d9b6e['red'](_0x586ece(0x252))),console[_0x586ece(0x18a)](_0x586ece(0x1ad));for(const _0xc08e4b of _0x2f48d4){console[_0x586ece(0x18a)]('\x20\x20'+a28_0x4d9b6e[_0x586ece(0x239)](_0xc08e4b));}console['error'](_0x586ece(0x1fb)+_0x30b71f+'\x20--attribute\x20\x22'+_0x2f48d4[0x0]+'\x22');}return 0x1;}if(_0x36fb1b['behavior']===!![]||_0x36fb1b[_0x586ece(0x1c6)]===''){const _0x237c45=_0x2c9d8f['behaviors']?.[_0x586ece(0x1b3)](_0x3d0bec=>_0x3d0bec[_0x586ece(0x191)])||[];if(_0x237c45[_0x586ece(0x25d)]===0x0)console[_0x586ece(0x18a)](a28_0x4d9b6e[_0x586ece(0x29e)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console['error'](a28_0x4d9b6e[_0x586ece(0x29e)](_0x586ece(0x1cd))),console[_0x586ece(0x18a)](_0x586ece(0x19a));for(const _0x2576e8 of _0x237c45){console[_0x586ece(0x18a)]('\x20\x20'+a28_0x4d9b6e['cyan'](_0x2576e8));}console[_0x586ece(0x18a)](_0x586ece(0x1fb)+_0x30b71f+_0x586ece(0x246)+_0x237c45[0x0]+'\x22');}return 0x1;}const _0x33c75b=createCommandSpinner(a28_0x4d9b6e[_0x586ece(0x184)](_0x586ece(0x1f9)),{'verbose':_0x36fb1b[_0x586ece(0x229)]});_0x33c75b['start']();const _0x2b78e5={'onProgress':_0x3e47d8=>{const _0x40aad9=_0x586ece;_0x33c75b[_0x40aad9(0x279)]=formatProgressMessage(_0x3e47d8);}};if(_0x36fb1b[_0x586ece(0x278)])_0x2b78e5[_0x586ece(0x278)]=!![];if(_0x36fb1b[_0x586ece(0x298)]&&typeof _0x36fb1b[_0x586ece(0x298)]===_0x586ece(0x20b))_0x2b78e5[_0x586ece(0x298)]=_0x36fb1b[_0x586ece(0x298)];if(_0x36fb1b['behavior']&&typeof _0x36fb1b['behavior']===_0x586ece(0x20b))_0x2b78e5[_0x586ece(0x1c6)]=_0x36fb1b[_0x586ece(0x1c6)];if(_0x36fb1b[_0x586ece(0x1da)])_0x2b78e5[_0x586ece(0x1da)]=!![];if(_0x36fb1b['interval'])_0x2b78e5['interval']=_0x36fb1b[_0x586ece(0x255)];let _0x4e21cd;try{_0x4e21cd=await _0x3a6a3a[_0x586ece(0x24a)][_0x586ece(0x228)](_0x41c9f3,_0x2b78e5),_0x33c75b[_0x586ece(0x1cc)]();}catch(_0x4c4e3f){_0x33c75b[_0x586ece(0x1cc)]();throw _0x4c4e3f;}return await this[_0x586ece(0x200)](_0x4e21cd,{'master':_0x36fb1b['master'],'attribute':typeof _0x36fb1b[_0x586ece(0x298)]===_0x586ece(0x20b)?_0x36fb1b[_0x586ece(0x298)]:undefined,'behavior':typeof _0x36fb1b['behavior']===_0x586ece(0x20b)?_0x36fb1b[_0x586ece(0x1c6)]:undefined,'enriched':_0x36fb1b['enriched']}),_0x4e21cd['allValid']?0x0:0x1;}async[a28_0x3d9eee(0x200)](_0x36e1f6,_0x18d226){const _0x2ff76f=a28_0x3d9eee;console[_0x2ff76f(0x18a)]('\x0a'+a28_0x4d9b6e[_0x2ff76f(0x1ca)](_0x2ff76f(0x1e0))+'\x20'+_0x36e1f6[_0x2ff76f(0x191)]),console[_0x2ff76f(0x18a)]('═'[_0x2ff76f(0x26e)](0x3c));if(_0x18d226[_0x2ff76f(0x278)]&&_0x36e1f6[_0x2ff76f(0x273)]){const _0x4caa0b=a28_0x4d9b6e[_0x2ff76f(0x184)](_0x2ff76f(0x1db))+'\x20'+a28_0x4d9b6e[_0x2ff76f(0x1ca)](_0x36e1f6[_0x2ff76f(0x278)][_0x2ff76f(0x25b)]+'.'+_0x36e1f6[_0x2ff76f(0x278)]['table']);await this[_0x2ff76f(0x1d8)](_0x4caa0b,_0x36e1f6[_0x2ff76f(0x273)]);}else{if(_0x18d226[_0x2ff76f(0x298)]&&_0x36e1f6[_0x2ff76f(0x273)]){const _0xdfb92a=a28_0x4d9b6e[_0x2ff76f(0x184)](_0x2ff76f(0x214))+'\x20'+a28_0x4d9b6e[_0x2ff76f(0x1ca)](_0x18d226[_0x2ff76f(0x298)]);await this[_0x2ff76f(0x1d8)](_0xdfb92a,_0x36e1f6[_0x2ff76f(0x273)]);}else{if(_0x18d226[_0x2ff76f(0x1c6)]&&_0x36e1f6[_0x2ff76f(0x273)]){const _0x38cb5f=a28_0x4d9b6e[_0x2ff76f(0x184)](_0x2ff76f(0x207))+'\x20'+a28_0x4d9b6e['bold'](_0x18d226[_0x2ff76f(0x1c6)]);await this[_0x2ff76f(0x1d8)](_0x38cb5f,_0x36e1f6[_0x2ff76f(0x273)]);}else{if(_0x18d226[_0x2ff76f(0x1da)]&&_0x36e1f6[_0x2ff76f(0x273)]){const _0x52c540=a28_0x4d9b6e[_0x2ff76f(0x184)]('Enriched:')+'\x20'+a28_0x4d9b6e[_0x2ff76f(0x1ca)]('Master\x20+\x20Attributes');await this[_0x2ff76f(0x1d8)](_0x52c540,_0x36e1f6[_0x2ff76f(0x273)]);}else!_0x36e1f6[_0x2ff76f(0x273)]&&console[_0x2ff76f(0x18a)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x36e1f6[_0x2ff76f(0x1ce)]['length']>0x0){console[_0x2ff76f(0x18a)]('─'[_0x2ff76f(0x26e)](0x3c)),console[_0x2ff76f(0x18a)]('\x0a'+a28_0x4d9b6e[_0x2ff76f(0x29e)](_0x2ff76f(0x285)));for(const _0x2588b8 of _0x36e1f6[_0x2ff76f(0x1ce)]){console[_0x2ff76f(0x18a)]('\x20\x20'+a28_0x4d9b6e[_0x2ff76f(0x29e)]('•')+'\x20'+_0x2588b8);}}}async[a28_0x3d9eee(0x1d8)](_0x5364d1,_0x1a633c){const _0x3882cb=a28_0x3d9eee;if(_0x1a633c[_0x3882cb(0x25d)]===0x0){console[_0x3882cb(0x18a)]('\x0a'+_0x5364d1),console['error'](_0x3882cb(0x1b9));return;}console['error']('\x0a'+_0x5364d1);const _0x8f77b7=Object[_0x3882cb(0x1cb)](_0x1a633c[0x0])[_0x3882cb(0x1b3)](_0x5b9a7e=>({'name':_0x5b9a7e,'type':typeof _0x1a633c[0x0][_0x5b9a7e]==='number'?_0x3882cb(0x26a):_0x3882cb(0x1bf)})),_0x1630b6={'queryId':_0x3882cb(0x280),'columns':_0x8f77b7,'data':_0x1a633c,'stats':{'state':_0x3882cb(0x218),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1a633c['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x41c20e=formatAsTable(_0x1630b6,_0x1a633c[_0x3882cb(0x25d)],!![]);await writeOutput(_0x41c20e,undefined,_0x3882cb(0x24f));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a28_0x3d9eee(0x191)]=a28_0x3d9eee(0x289);['description']=a28_0x3d9eee(0x1b4);async[a28_0x3d9eee(0x242)](_0x3e7971){const _0x5831f0=a28_0x3d9eee,{options:_0x3f907f,args:_0x563c05,tdx:_0x28c94e}=_0x3e7971,_0x45b6f8=_0x3f907f,_0x496fbd=_0x563c05[0x0]||_0x3f907f[_0x5831f0(0x210)];if(!_0x496fbd)return showParentSegmentNotSetError(_0x5831f0(0x204)+_0x5831f0(0x259)),0x1;const _0x2e2156=resolveYamlFile(_0x496fbd);if(existsSync(_0x2e2156)){_0x45b6f8[_0x5831f0(0x229)]&&console[_0x5831f0(0x18a)](_0x5831f0(0x24d)+_0x2e2156);let _0x108b04;try{_0x108b04=readFileSync(_0x2e2156,'utf-8');}catch(_0x32f2b6){const _0x45e8d6=_0x32f2b6 instanceof Error?_0x32f2b6[_0x5831f0(0x1fe)]:String(_0x32f2b6);return console[_0x5831f0(0x18a)](_0x5831f0(0x193)+_0x45e8d6),0x1;}const _0xd2ff0c=await withSpinner(_0x5831f0(0x1c7),()=>_0x28c94e[_0x5831f0(0x24a)][_0x5831f0(0x254)](_0x108b04),{'verbose':_0x45b6f8[_0x5831f0(0x229)]}),_0x3355a2=_0xd2ff0c[_0x5831f0(0x297)],{isNew:_0x11f9ba,name:_0x5c5386,hasChanges:_0x1bfc50,diffFormatted:_0x5c1e5b}=_0x3355a2;if(_0x1bfc50){_0x11f9ba?console[_0x5831f0(0x18a)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x5c5386+'\x27:'):console[_0x5831f0(0x18a)](_0x5831f0(0x1a4)+_0x5c5386+'\x27:');console['error']('─'[_0x5831f0(0x26e)](0x3c)),console[_0x5831f0(0x18a)](_0x5c1e5b),console[_0x5831f0(0x18a)]('─'[_0x5831f0(0x26e)](0x3c));const _0x9fc65f=_0x11f9ba?_0x5831f0(0x216)+_0x5c5386+'\x27\x20and\x20run\x20workflow?':_0x5831f0(0x287)+_0x5c5386+_0x5831f0(0x28f);if(!_0x45b6f8[_0x5831f0(0x22b)]){const _0x415889=await confirmKey(_0x9fc65f);if(!_0x415889)return console['error']('Aborted.'),0x1;}const _0x3e0bdc=_0x11f9ba?_0x5831f0(0x1b6):_0x5831f0(0x195);await withSpinner(_0x3e0bdc+'\x20parent\x20segment\x20\x27'+_0x5c5386+_0x5831f0(0x256),()=>_0x3355a2['apply'](),{'verbose':_0x45b6f8[_0x5831f0(0x229)]});const _0x4cc8ed=_0x11f9ba?_0x5831f0(0x25e):_0x5831f0(0x1b8);console['error']('✔\x20'+_0x4cc8ed+_0x5831f0(0x268)+_0x5c5386+'\x27');}else console[_0x5831f0(0x18a)](_0x5831f0(0x291)+_0x5c5386+_0x5831f0(0x188));}const _0x3e5873=await withSpinner(_0x5831f0(0x292)+_0x496fbd+_0x5831f0(0x256),()=>_0x28c94e['segment'][_0x5831f0(0x198)](_0x496fbd),{'verbose':_0x45b6f8[_0x5831f0(0x229)]}),_0x3da636=_0x3e5873['data'],_0x24b5bf=getConsoleUrl(_0x45b6f8[_0x5831f0(0x24e)],_0x5831f0(0x21f)+_0x3da636[_0x5831f0(0x27a)]+_0x5831f0(0x27f)+_0x3da636[_0x5831f0(0x29d)]+_0x5831f0(0x1d3)+_0x3da636[_0x5831f0(0x17f)]);return console[_0x5831f0(0x18a)](_0x5831f0(0x1de)),console['error']('\x20\x20'+a28_0x4d9b6e[_0x5831f0(0x184)](_0x5831f0(0x1ab))+'\x20'+_0x3da636[_0x5831f0(0x1b1)]),console[_0x5831f0(0x18a)]('\x20\x20'+a28_0x4d9b6e['dim'](_0x5831f0(0x192))+'\x20'+_0x3da636[_0x5831f0(0x208)]),console[_0x5831f0(0x18a)]('\x20\x20'+a28_0x4d9b6e[_0x5831f0(0x184)](_0x5831f0(0x22d))+'\x20'+_0x3da636[_0x5831f0(0x29d)]),console[_0x5831f0(0x18a)]('\x20\x20'+a28_0x4d9b6e[_0x5831f0(0x184)]('Attempt:')+'\x20'+_0x3da636['workflowAttemptId']),console[_0x5831f0(0x18a)]('\x20\x20'+_0x24b5bf),console[_0x5831f0(0x18a)]('\x0a'+a28_0x4d9b6e[_0x5831f0(0x184)](_0x5831f0(0x27c))+_0x5831f0(0x17e)+_0x3da636[_0x5831f0(0x17f)]+_0x5831f0(0x244)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a28_0x3d9eee(0x1be);[a28_0x3d9eee(0x19f)]=a28_0x3d9eee(0x1fd);async[a28_0x3d9eee(0x242)](_0xc6ceea){const _0x75e4bf=a28_0x3d9eee,{options:_0xf83ef6,args:_0x11eb84,tdx:_0x40add3}=_0xc6ceea,_0x5b2ac3=_0x11eb84[0x0]||_0xf83ef6[_0x75e4bf(0x210)];if(!_0x5b2ac3)return showParentSegmentNotSetError(_0x75e4bf(0x1d4)+_0x75e4bf(0x299)),0x1;_0xf83ef6['verbose']&&(console[_0x75e4bf(0x18a)]('Site:\x20'+_0xf83ef6['site']),console[_0x75e4bf(0x18a)](_0x75e4bf(0x23f)+_0x5b2ac3));const _0x35f8eb=await withSpinner(_0x75e4bf(0x1e6)+_0x5b2ac3+_0x75e4bf(0x256),()=>_0x40add3[_0x75e4bf(0x24a)][_0x75e4bf(0x29c)](_0x5b2ac3),{'verbose':_0xf83ef6[_0x75e4bf(0x229)]}),_0x560625=_0x35f8eb[_0x75e4bf(0x297)];console[_0x75e4bf(0x18a)](_0x75e4bf(0x27e)+_0x560625[_0x75e4bf(0x25d)]+'\x20field'+(_0x560625['length']!==0x1?'s':''));if(_0xf83ef6[_0x75e4bf(0x21d)]||_0xf83ef6[_0x75e4bf(0x19b)])return await handleSDKOutput(_0x560625,_0xf83ef6),0x0;return displayFieldsHumanReadable(_0x560625,_0x5b2ac3),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a28_0x3d9eee(0x26f);[a28_0x3d9eee(0x19f)]=a28_0x3d9eee(0x296);async[a28_0x3d9eee(0x242)](_0x1eeeb8){const _0x337838=a28_0x3d9eee,{options:_0x9773c8,args:_0x3ff586,tdx:_0x506e3e}=_0x1eeeb8,_0x14d4a0=_0x9773c8,_0x32c5ff=_0x3ff586[0x0]||_0x9773c8[_0x337838(0x210)];if(!_0x32c5ff)return showParentSegmentNotSetError(_0x337838(0x1cf)+_0x337838(0x187)+_0x337838(0x1e4)+_0x337838(0x28b)),0x1;_0x9773c8[_0x337838(0x229)]&&(console[_0x337838(0x18a)](_0x337838(0x247)+_0x9773c8[_0x337838(0x24e)]),console[_0x337838(0x18a)](_0x337838(0x23f)+_0x32c5ff));const _0x3d4caf=await withSpinner(_0x337838(0x29f)+_0x32c5ff+_0x337838(0x256),()=>_0x506e3e[_0x337838(0x24a)]['getParentFull'](_0x32c5ff),{'verbose':_0x9773c8[_0x337838(0x229)]}),_0x3eb297=_0x3d4caf[_0x337838(0x297)];if(_0x14d4a0['web']){const _0x5e85b0=getConsoleNextUrl(_0x14d4a0['site'],'/app/dw/parentSegments/'+_0x3eb297['id']);return console[_0x337838(0x18a)](a28_0x4d9b6e[_0x337838(0x1f8)]('✔')+_0x337838(0x263)+a28_0x4d9b6e[_0x337838(0x239)](_0x5e85b0)),openBrowser(_0x5e85b0),0x0;}return await handleSingleObjectOutput(_0x3eb297,_0x9773c8),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a28_0x3d9eee(0x20e);[a28_0x3d9eee(0x19f)]=a28_0x3d9eee(0x18e);async['execute'](_0x3217a0){const _0x57aed4=a28_0x3d9eee,{options:_0x9ffac4,args:_0xced21e,tdx:_0x22e491}=_0x3217a0,_0x3559a6=_0xced21e[0x0]||_0x9ffac4[_0x57aed4(0x210)];if(!_0x3559a6)return showParentSegmentNotSetError(_0x57aed4(0x272)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment'),0x1;_0x9ffac4[_0x57aed4(0x229)]&&(console['error'](_0x57aed4(0x247)+_0x9ffac4[_0x57aed4(0x24e)]),console['error'](_0x57aed4(0x23f)+_0x3559a6));const _0x1f2d0e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3559a6+_0x57aed4(0x256),()=>_0x22e491[_0x57aed4(0x24a)][_0x57aed4(0x180)](_0x3559a6),{'verbose':_0x9ffac4[_0x57aed4(0x229)]}),_0xd9f45=_0x1f2d0e[_0x57aed4(0x297)],_0x4b12d4=await withSpinner(_0x57aed4(0x22f)+_0x3559a6+_0x57aed4(0x256),()=>_0x22e491['segment'][_0x57aed4(0x27d)](_0xd9f45),{'verbose':_0x9ffac4['verbose']}),_0x11bb9a=await executeSchemaQuery(_0x4b12d4[_0x57aed4(0x297)],_0x22e491,_0x9ffac4);return await handleQueryOutput(_0x11bb9a,_0x9ffac4),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a28_0x3d9eee(0x191)]='segment:parent:sql';[a28_0x3d9eee(0x19f)]=a28_0x3d9eee(0x1c5);async['execute'](_0x16cbfb){const _0x4d73f8=a28_0x3d9eee,{options:_0x2fc8b4,args:_0x10d437,tdx:_0x327e60}=_0x16cbfb,_0x24b5d7=_0x10d437[0x0]||_0x2fc8b4['parentSegment'];if(!_0x24b5d7)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'+_0x4d73f8(0x29b)),0x1;_0x2fc8b4[_0x4d73f8(0x229)]&&(console[_0x4d73f8(0x18a)](_0x4d73f8(0x247)+_0x2fc8b4[_0x4d73f8(0x24e)]),console[_0x4d73f8(0x18a)](_0x4d73f8(0x23f)+_0x24b5d7));const _0xd07083=await withSpinner(_0x4d73f8(0x19c)+_0x24b5d7+_0x4d73f8(0x256),()=>_0x327e60[_0x4d73f8(0x24a)][_0x4d73f8(0x180)](_0x24b5d7),{'verbose':_0x2fc8b4[_0x4d73f8(0x229)]}),_0x1ed03f=_0xd07083[_0x4d73f8(0x297)],_0x212fbe=await withSpinner(_0x4d73f8(0x22f)+_0x24b5d7+_0x4d73f8(0x256),()=>_0x327e60[_0x4d73f8(0x24a)][_0x4d73f8(0x27d)](_0x1ed03f),{'verbose':_0x2fc8b4[_0x4d73f8(0x229)]}),_0x17793e=_0x212fbe['data'];return _0x2fc8b4['format']===_0x4d73f8(0x21d)||_0x2fc8b4[_0x4d73f8(0x202)]===_0x4d73f8(0x19b)?await handleSDKOutput([{'sql':_0x17793e}],_0x2fc8b4):console[_0x4d73f8(0x281)](_0x17793e),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a28_0x3d9eee(0x1d5);['description']='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a28_0x3d9eee(0x242)](_0x136673){const _0x2cb18a=a28_0x3d9eee,{options:_0x317e66,args:_0x46e483,tdx:_0x36dc0b}=_0x136673,_0x3fff1f=_0x46e483[0x0]||_0x317e66[_0x2cb18a(0x210)];if(!_0x3fff1f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0x2cb18a(0x1b5)),0x1;_0x317e66[_0x2cb18a(0x229)]&&(console['error'](_0x2cb18a(0x247)+_0x317e66[_0x2cb18a(0x24e)]),console[_0x2cb18a(0x18a)]('Parent\x20segment:\x20'+_0x3fff1f));const _0x1f3208=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3fff1f+'\x27...',()=>_0x36dc0b[_0x2cb18a(0x24a)]['resolveParentId'](_0x3fff1f),{'verbose':_0x317e66[_0x2cb18a(0x229)]}),_0x6d562c=_0x1f3208['data'],_0x343dbd=await withSpinner(_0x2cb18a(0x22f)+_0x3fff1f+_0x2cb18a(0x256),()=>_0x36dc0b['segment'][_0x2cb18a(0x27d)](_0x6d562c),{'verbose':_0x317e66[_0x2cb18a(0x229)]});let _0x274b94=_0x343dbd[_0x2cb18a(0x297)];const _0x14a94d=resolveLimit(_0x317e66[_0x2cb18a(0x1a9)],DEFAULT_DISPLAY_LIMIT),_0x407841=/\bLIMIT\s+\d+/i[_0x2cb18a(0x203)](_0x274b94);!_0x407841&&(_0x274b94=_0x274b94['trim']()['replace'](/;+$/,''),_0x274b94=_0x2cb18a(0x282)+_0x274b94+_0x2cb18a(0x205)+_0x14a94d);_0x317e66[_0x2cb18a(0x229)]&&console['error'](_0x2cb18a(0x243)+_0x274b94);const _0xe851b6=await withQuerySpinner(_0x2cb18a(0x24b),async _0x1b56c2=>{const _0x2bf89e=_0x2cb18a,_0x4d53ce=await _0x36dc0b[_0x2bf89e(0x1ae)][_0x2bf89e(0x242)](_0x274b94,{'catalog':'td','schema':'information_schema','onJobId':_0x4f52c2=>{_0x1b56c2['setJobId'](_0x4f52c2);}});return _0x4d53ce;},{'verbose':_0x317e66[_0x2cb18a(0x229)]}),_0xdaf921=_0xe851b6['data'],_0x1bb142=_0xdaf921[_0x2cb18a(0x21c)]?_0x2cb18a(0x1b0)+_0xdaf921[_0x2cb18a(0x21c)]+']':'';return console[_0x2cb18a(0x18a)]('✔\x20Query\x20completed:\x20Processed\x20'+_0xdaf921['stats'][_0x2cb18a(0x2a0)][_0x2cb18a(0x1e5)]()+_0x2cb18a(0x1c0)+(_0x2cb18a(0x1e7)+formatElapsed(_0xdaf921['stats'][_0x2cb18a(0x27b)])+_0x1bb142)),await handleQueryOutput(_0xdaf921,_0x317e66),0x0;}}