@treasuredata/tdx 2026.3.18 → 2026.3.19

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 (201) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0xe0c385=a30_0x25eb;(function(_0x30f32f,_0x4b8277){const _0x1f9a56=a30_0x25eb,_0x35cd63=_0x30f32f();while(!![]){try{const _0x209176=parseInt(_0x1f9a56(0x22c))/0x1*(parseInt(_0x1f9a56(0x259))/0x2)+parseInt(_0x1f9a56(0x1f1))/0x3*(-parseInt(_0x1f9a56(0x293))/0x4)+parseInt(_0x1f9a56(0x2a9))/0x5*(-parseInt(_0x1f9a56(0x279))/0x6)+-parseInt(_0x1f9a56(0x17a))/0x7+-parseInt(_0x1f9a56(0x2a5))/0x8+parseInt(_0x1f9a56(0x271))/0x9*(-parseInt(_0x1f9a56(0x2c4))/0xa)+parseInt(_0x1f9a56(0x220))/0xb;if(_0x209176===_0x4b8277)break;else _0x35cd63['push'](_0x35cd63['shift']());}catch(_0x4373e3){_0x35cd63['push'](_0x35cd63['shift']());}}}(a30_0x54a6,0xd9729));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a30_0x48f6b9 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a30_0x1e4d2a from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a30_0xe0c385(0x1c7),LEGACY_PARENT_SEGMENT_DIR=a30_0xe0c385(0x2ac);function openBrowser(_0x1f199f){const _0x1dd29c=a30_0xe0c385,_0x524a84=process[_0x1dd29c(0x270)],_0x29276f=_0x524a84==='darwin'?'open':_0x524a84===_0x1dd29c(0x21c)?_0x1dd29c(0x22e):_0x1dd29c(0x233);spawn(_0x29276f,[_0x1f199f],{'detached':!![],'stdio':_0x1dd29c(0x177)})[_0x1dd29c(0x256)]();}function migrateLegacyDirectory(){const _0x202cee=a30_0xe0c385;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x28fc4a=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x28fc4a['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x202cee(0x247)](a30_0x1e4d2a[_0x202cee(0x19a)](_0x202cee(0x1ef)+LEGACY_PARENT_SEGMENT_DIR+_0x202cee(0x1dc)+PARENT_SEGMENT_DIR+_0x202cee(0x2e6))),console['error'](a30_0x1e4d2a[_0x202cee(0x2df)](_0x202cee(0x2e5)+LEGACY_PARENT_SEGMENT_DIR+_0x202cee(0x26d))),![];console[_0x202cee(0x247)](a30_0x1e4d2a['yellow'](_0x202cee(0x294)+LEGACY_PARENT_SEGMENT_DIR+_0x202cee(0x2e9)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x202cee(0x247)](a30_0x1e4d2a['green'](_0x202cee(0x2be)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x11446b){const _0x5e3c1b=_0x11446b instanceof Error?_0x11446b[_0x202cee(0x173)]:String(_0x11446b);return console['error'](a30_0x1e4d2a['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x5e3c1b+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a30_0xe0c385(0x1a0)](_0x45f1d0){const _0x2dce9b=a30_0xe0c385;return migrateLegacyDirectory(),super[_0x2dce9b(0x1a0)](_0x45f1d0);}}function resolveYamlFile(_0x3e9300){const _0x55cce1=a30_0xe0c385;if(_0x3e9300['endsWith'](_0x55cce1(0x1b5))||_0x3e9300[_0x55cce1(0x29d)](_0x55cce1(0x19b)))return _0x3e9300;return a30_0x48f6b9[_0x55cce1(0x240)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3e9300)+_0x55cce1(0x1b5));}function a30_0x54a6(){const _0x4952c4=['string','/\x20→\x20','errors','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','displayAttributesStats','\x20\x20\x20\x20\x20\x20','getParentSQL','Creating','log','type','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x27\x20with\x20ID:\x20','segment:parent:create','column','idStitching','push','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','keys','\x20RT\x20configuration\x20is\x20valid','Site:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','⚡\x20Enabled','elapsedTimeMillis','\x27\x20and\x20run\x20workflow?','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','\x20--enriched','displayMasterInfo','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','coveragePercent','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','format','message','segment','FINISHED','customerGroup','ignore','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','true','7523698ZXSSvC','schemaError','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','timezone','toLocaleString','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','page_view','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','\x20total','json','runParent','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','interval','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','tdx\x20ps\x20preview\x20','allValid','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','addAttributes','match','\x20kill','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','displayRealtimeInfo','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','limit','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','customersWithEvents','yellow','.yaml','Customers:','SQL\x20query:\x0a','Behavior:','Fetching\x20current\x20configuration\x20for\x20\x27','run','segment:parent:push','processedRows','✔\x20No\x20changes\x20-\x20\x27','behaviorsFile','\x22\x20}','map','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Options\x20(one\x20required):\x0a','.customers)','rowCount','Attributes','Attributes:','\x0aChanges\x20to\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','segment:parent:validate','Error:\x20--behavior\x20requires\x20a\x20name\x0a','single','audienceId','No\x20personalization\x20services\x20configured','test','.yml','Listing\x20parent\x20segments...','enabled','status','Table:\x20','\x20Opening\x20','cyan','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Aborted.','Next\x20steps:','Output\x20Database:','getBehaviorNames','totalEvents','parent_id','\x20to\x20push\x20the\x20configuration','workflowAttemptId','ps:rt:list','foreignKey','parent_segments','segment:parent:run','repeat','Attempt:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x22,\x20\x22type\x22:\x20\x22','customerGroupFile','\x20is\x20already\x20up\x20to\x20date','table','resolveParentId','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','%)\x20','\x20+\x20[','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Create\x20parent\x20segment\x20\x27','\x20\x201.\x20Edit\x20','matchedCount','Personalization:','ID\x20Stitching:','Fetching\x20customers\x20schema...','query','/\x20and\x20','Coverage:','Listing\x20parent\x20segments\x20matching\x20\x27','listFields','td_client_id','Error\x20parsing\x20YAML:\x20','displayBehaviorsStats','\x20\x20\x20','Created','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','site','\x20--attribute\x20\x22','/app/workflows/','web','\x0aNew\x20parent\x20segment\x20\x27','\x20[Job\x20ID:\x20','segment:parent:sql','session','✔\x20Created\x20parent\x20segment\x20\x27','\x0a⚠️\x20\x20Both\x20','displayPreviewHints','276ettyYH','Validate:','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','attribute','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','toLowerCase','Source:','YAML\x20file:\x20','primaryKey','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','personalization_services','output','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','dirname','✔\x20Found\x20','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','formatSchemaJson','Executing\x20parent\x20segment\x20query...','Output\x20file:\x20','RT\x202.0:','Rows:','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','preview','Fetching\x20behavior\x20list...','\x20parent\x20segment','\x27...','\x20section','apply','setJobId','Database:\x20','realtime','columns','text','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','customers','getParentFull','Join\x20on:','events','\x20Added\x20personalization\x20template\x20to\x20','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','pullParentYaml','information_schema','win32','displaySummary','Behaviors','\x20--interval\x20','77650441ukFFMN','listParents','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','previewParentYaml','/{name}.yml\x0a','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x20rows\x20','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','SELECT\x20*\x20FROM\x20','sort','31658EJezHz','database','start','tdx\x20ps\x20push\x20','stop','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Master\x20+\x20Attributes','xdg-open','Session:','Join:','last_page_viewed','reduce','Validating\x20configuration...','Parent\x20segment:\x20','Show\x20parent\x20segment\x20details','Creating\x20parent\x20segment\x20\x27','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','filter','master','join','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','To\x20cancel:','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','realtime:','label','error','jobId','customerPercent','Master\x20Table','Errors:','\x0aChanges\x20to\x20apply\x20to\x20\x27','number','Columns:','👥\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','behaviors','column_type','/sessions/','\x0a✔\x20Workflow\x20started','unref','\x20--behavior\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','6ldHkzb','workflowSessionId','List\x20available\x20fields\x20for\x20segmentation','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','varchar','valid','Options:\x0a','replace','trigger_event','localeCompare','Enriched:','schemaValid','stitchingKeys','ps:pz:list','\x20\x20Database:\x20','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','yes','stats','displayColumns','/\x20directory.\x0a','\x20parent\x20segment\x20\x27','jsonl','platform','27TLvPlZ','sampleData','Error:','\x20--attribute\x20\x22<name>\x22','bold','\x20\x20\x20\x20','personalizationServices','getOutputDatabaseName','6PIYNWL','verbose','pushParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','displayValidateResults','\x20rows)','\x20RT-enabled\x20parent\x20segment','\x5c$&','\x20service','\x20=\x20','\x20to\x20configure\x20your\x20personalization\x20service','/app/dw/parentSegments/','Error\x20reading\x20file:\x20','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x27\x20is\x20already\x20up\x20to\x20date','behavior','\x0a\x20\x20\x20\x20]','segment:parent:fields','Updating','Fetching\x20parent\x20segment\x20\x27','Get\x20SQL\x20query\x20for\x20parent\x20segment','parentSegment','sourceTableValid','Analyzing\x20changes...','use','\x0a\x20\x20\x20\x20}','50584eLKbOQ','\x0a⚠️\x20\x20Migrating:\x20','behavior_','ps:pz:init','Fetching\x20SQL\x20for\x20\x27','Apply\x20changes\x20to\x20\x27','scheduleOption','✔\x20Updated\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','Status:','endsWith','list','execute','workflowId','`\x20to\x20download\x20the\x20configuration\x20first','name','Error:\x20Parent\x20segment\x20name\x20is\x20required','Pattern:\x20','10428592gcRzVj','No\x20parent\x20segments\x20found','utf-8','Schema\x20saved\x20to\x20','8276065rUuqSk','collectSchema','description','parent_segment','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','RT\x202.0\x20Validate:','Listing\x20RT-enabled\x20parent\x20segments...','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Updating\x20parent\x20segment\x20\x27','realtime_enabled','Attribute:','population','\x0a\x20\x20]\x0a}\x0a','\x20configured','enriched','scheduleType','red','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','segment:parent:show','length','Master:','✔\x20Renamed\x20directory\x20to\x20','displaySampleData','\x20\x20Columns:\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20\x202.\x20Run\x20','Events:','3554690xAfqDD','personalization','toFixed','\x20\x20Note:\x20','trim','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','\x0aNo\x20sample\x20data\x20available','segment:parent:desc','double','Available\x20behaviors:','column_name','Personalization\x20service\x20description','segment:parent:list','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Preview:','sourceTableError','green','attributesFile','createParent','joinKey','addAttributesFile','data','\x0aError:','using\x20the\x20default\x20path:\x20','all','-1d','segment:parent:update','dim','\x20\x20\x20\x20-\x20','segment:parent:preview','Overwrite\x20\x27','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','/\x20directories\x20exist.','attributes'];a30_0x54a6=function(){return _0x4952c4;};return a30_0x54a6();}function formatProgressMessage(_0x5ab982){const _0x131cf8=a30_0xe0c385,_0x21a4f3=_0x5ab982[_0x131cf8(0x191)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x21a4f3){const [,_0x457331,_0x1e3877,_0x4f190a='']=_0x21a4f3;return a30_0x1e4d2a[_0x131cf8(0x2df)](_0x457331+':')+'\x20'+_0x1e3877+a30_0x1e4d2a[_0x131cf8(0x2df)](_0x4f190a);}return a30_0x1e4d2a[_0x131cf8(0x2df)](_0x5ab982);}function showFileNotFoundError(_0x424649,_0x17d5b2){const _0x4c4b1f=a30_0xe0c385;console[_0x4c4b1f(0x247)](a30_0x1e4d2a[_0x4c4b1f(0x2b9)]('Error:\x20File\x20not\x20found:\x20'+_0x424649+'\x0a')),console[_0x4c4b1f(0x247)](a30_0x1e4d2a[_0x4c4b1f(0x1bb)](_0x4c4b1f(0x171)+_0x17d5b2+_0x4c4b1f(0x2a1)));}function displayRealtimeValidation(_0x319ed8){const _0x365f4e=a30_0xe0c385;if(!_0x319ed8[_0x365f4e(0x210)])return;const _0x2fdaea=_0x319ed8[_0x365f4e(0x210)],_0x163c1e=_0x2fdaea[_0x365f4e(0x1b7)]?a30_0x1e4d2a['green'](_0x365f4e(0x169)):a30_0x1e4d2a[_0x365f4e(0x19a)]('⚡\x20Not\x20enabled');console[_0x365f4e(0x247)]('\x0a'+a30_0x1e4d2a[_0x365f4e(0x2df)](_0x365f4e(0x204))+'\x20'+_0x163c1e);if(_0x2fdaea[_0x365f4e(0x217)]&&_0x2fdaea[_0x365f4e(0x217)][_0x365f4e(0x2bc)]>0x0){console[_0x365f4e(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x365f4e(0x2df)](_0x365f4e(0x2c3))+'\x20'+_0x2fdaea[_0x365f4e(0x217)]['length']+'\x20configured');for(const _0x585b06 of _0x2fdaea[_0x365f4e(0x217)]){const _0x1aef56=_0x585b06[_0x365f4e(0x28f)]===![]?a30_0x1e4d2a[_0x365f4e(0x2b9)]('✘'):a30_0x1e4d2a['green']('✔');console[_0x365f4e(0x247)](_0x365f4e(0x276)+_0x1aef56+'\x20'+_0x585b06['name']),_0x585b06[_0x365f4e(0x2d3)]&&console['error'](_0x365f4e(0x159)+a30_0x1e4d2a[_0x365f4e(0x2b9)](_0x585b06[_0x365f4e(0x2d3)]));}}if(_0x2fdaea[_0x365f4e(0x2e7)]&&_0x2fdaea[_0x365f4e(0x2e7)][_0x365f4e(0x2bc)]>0x0){console[_0x365f4e(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x365f4e(0x2df)](_0x365f4e(0x1ac))+'\x20'+_0x2fdaea[_0x365f4e(0x2e7)][_0x365f4e(0x2bc)]+_0x365f4e(0x2b6));for(const _0x4d0feb of _0x2fdaea['attributes']){const _0x125910=_0x4d0feb[_0x365f4e(0x25f)]?a30_0x1e4d2a[_0x365f4e(0x2d4)]('✔'):a30_0x1e4d2a[_0x365f4e(0x2b9)]('✘');console[_0x365f4e(0x247)](_0x365f4e(0x276)+_0x125910+'\x20'+_0x4d0feb[_0x365f4e(0x2a2)]+'\x20'+a30_0x1e4d2a[_0x365f4e(0x2df)]('('+_0x4d0feb[_0x365f4e(0x15d)]+')'));}}if(_0x2fdaea['idStitching']){const _0x3e192f=_0x2fdaea[_0x365f4e(0x162)]['stitchingKeys']?.[_0x365f4e(0x2bc)]?_0x365f4e(0x1d3)+_0x2fdaea[_0x365f4e(0x162)][_0x365f4e(0x266)][_0x365f4e(0x240)](',\x20')+']':'';console['error']('\x20\x20'+a30_0x1e4d2a['dim'](_0x365f4e(0x1d9))+'\x20'+_0x2fdaea[_0x365f4e(0x162)][_0x365f4e(0x1f9)]+_0x3e192f);}if(_0x2fdaea['personalizationServices']&&_0x2fdaea[_0x365f4e(0x277)][_0x365f4e(0x2bc)]>0x0){console[_0x365f4e(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x365f4e(0x2df)](_0x365f4e(0x1d8))+'\x20'+_0x2fdaea[_0x365f4e(0x277)]['length']+_0x365f4e(0x281)+(_0x2fdaea[_0x365f4e(0x277)][_0x365f4e(0x2bc)]!==0x1?'s':''));for(const _0x3d57d8 of _0x2fdaea[_0x365f4e(0x277)]){console[_0x365f4e(0x247)](_0x365f4e(0x2e0)+_0x3d57d8[_0x365f4e(0x2a2)]);}}}function showParentSegmentNotSetError(_0x100eb0){const _0x2834aa=a30_0xe0c385;console[_0x2834aa(0x247)](a30_0x1e4d2a[_0x2834aa(0x19a)](_0x2834aa(0x1a7))),console[_0x2834aa(0x247)](_0x100eb0);}function a30_0x25eb(_0x8ef474,_0x331501){_0x8ef474=_0x8ef474-0x158;const _0x54a65e=a30_0x54a6();let _0x25eb5b=_0x54a65e[_0x8ef474];return _0x25eb5b;}export class ParentSegmentListCommand extends BaseCommand{['name']=a30_0xe0c385(0x2d0);['description']='List\x20parent\x20segments';async[a30_0xe0c385(0x29f)](_0x28be0f){const _0x343217=a30_0xe0c385,{options:_0x4986cc,args:_0x2699df,tdx:_0x448748}=_0x28be0f,_0x312998=_0x2699df[0x0];_0x4986cc[_0x343217(0x27a)]&&(console[_0x343217(0x247)](_0x343217(0x167)+_0x4986cc[_0x343217(0x1e6)]),_0x312998&&console['error'](_0x343217(0x2a4)+_0x312998));const _0x535eff=await withSpinner(_0x312998?_0x343217(0x1de)+_0x312998+'\x27...':_0x343217(0x1b6),()=>_0x448748[_0x343217(0x174)][_0x343217(0x221)](),{'verbose':_0x4986cc[_0x343217(0x27a)]});let _0x2a3a98=_0x535eff['data'];if(_0x312998){const _0xd3767a=_0x312998['replace'](/[.+^${}()|[\]\\]/g,_0x343217(0x280))[_0x343217(0x261)](/\*/g,'.*')['replace'](/\?/g,'.'),_0xbb7956=new RegExp('^'+_0xd3767a+'$','i');_0x2a3a98=_0x2a3a98['filter'](_0x37ee4c=>_0xbb7956[_0x343217(0x1b4)](_0x37ee4c['attributes'][_0x343217(0x2a2)]));}_0x2a3a98[_0x343217(0x22b)]((_0x310ab3,_0x2399c1)=>_0x310ab3[_0x343217(0x2e7)][_0x343217(0x2a2)]['localeCompare'](_0x2399c1['attributes'][_0x343217(0x2a2)])),console[_0x343217(0x247)](_0x343217(0x1ff)+_0x2a3a98[_0x343217(0x2bc)]+_0x343217(0x20a)+(_0x2a3a98['length']!==0x1?'s':''));const _0x440526=_0x2efcd3=>{const _0x2cc3c2=_0x343217;return getConsoleNextUrl(_0x4986cc['site'],_0x2cc3c2(0x284)+_0x2efcd3);};if(_0x4986cc[_0x343217(0x172)]===_0x343217(0x187)||_0x4986cc[_0x343217(0x172)]===_0x343217(0x26f)){const _0x11531a=_0x2a3a98[_0x343217(0x1a6)](_0x37a746=>({..._0x37a746,'url':_0x440526(_0x37a746['id'])}));await handleSDKOutput(_0x11531a,_0x4986cc);}else{if(_0x2a3a98[_0x343217(0x2bc)]===0x0)_0x312998?console[_0x343217(0x15c)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x312998):console[_0x343217(0x15c)](_0x343217(0x2a6));else for(const _0x438c61 of _0x2a3a98){const _0x3833b2=_0x438c61[_0x343217(0x2e7)][_0x343217(0x2b4)]?a30_0x1e4d2a[_0x343217(0x2df)]('\x20('+formatRows(_0x438c61[_0x343217(0x2e7)][_0x343217(0x2b4)])+')'):'',_0x29f95a=hyperlink(_0x438c61[_0x343217(0x2e7)][_0x343217(0x2a2)],_0x440526(_0x438c61['id']));console[_0x343217(0x15c)](_0x343217(0x24f)+_0x29f95a+_0x3833b2);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a30_0xe0c385(0x2a2)]=a30_0xe0c385(0x160);['description']=a30_0xe0c385(0x222);async['execute'](_0x9cfd79){const _0x4189ce=a30_0xe0c385,{options:_0x5b8e81,args:_0x13cfe4,tdx:_0x297c4e}=_0x9cfd79;console[_0x4189ce(0x247)](_0x4189ce(0x250)+_0x4189ce(0x18f)+_0x4189ce(0x2c1));const _0x4ec65e=_0x5b8e81;if(_0x13cfe4[_0x4189ce(0x2bc)]===0x0)return console['error'](a30_0x1e4d2a['red'](_0x4189ce(0x2a3))),console[_0x4189ce(0x247)](_0x4189ce(0x1bc)),0x1;const _0x4d1808=_0x13cfe4[0x0];if(!_0x4ec65e[_0x4189ce(0x22d)]||!_0x4ec65e[_0x4189ce(0x1cf)])return console[_0x4189ce(0x247)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console['error'](_0x4189ce(0x1bc)),0x1;_0x4ec65e[_0x4189ce(0x27a)]&&(console['error'](_0x4189ce(0x167)+_0x4ec65e[_0x4189ce(0x1e6)]),console[_0x4189ce(0x247)]('Name:\x20'+_0x4d1808),console[_0x4189ce(0x247)](_0x4189ce(0x20f)+_0x4ec65e[_0x4189ce(0x22d)]),console[_0x4189ce(0x247)](_0x4189ce(0x1b9)+_0x4ec65e[_0x4189ce(0x1cf)]));const _0xf4e70c=await loadJSONFromOptions(_0x4ec65e[_0x4189ce(0x2e7)],_0x4ec65e[_0x4189ce(0x2d5)]),_0x5054cd=await loadJSONFromOptions(_0x4ec65e[_0x4189ce(0x252)],_0x4ec65e[_0x4189ce(0x1a4)]),_0x5e16b9=await loadJSONFromOptions(_0x4ec65e[_0x4189ce(0x176)],_0x4ec65e[_0x4189ce(0x1cd)]),_0x4a0579={'name':_0x4d1808,'description':_0x4ec65e[_0x4189ce(0x2ab)],'scheduleType':_0x4ec65e[_0x4189ce(0x2b8)],'scheduleOption':_0x4ec65e[_0x4189ce(0x299)],'timezone':_0x4ec65e[_0x4189ce(0x17f)],'master':{'parentDatabaseName':_0x4ec65e[_0x4189ce(0x22d)],'parentTableName':_0x4ec65e[_0x4189ce(0x1cf)]},'attributes':_0xf4e70c,'behaviors':_0x5054cd,'customerGroup':_0x5e16b9},_0x47c2c2=await withSpinner(_0x4189ce(0x23b)+_0x4d1808+'\x27...',()=>_0x297c4e[_0x4189ce(0x174)][_0x4189ce(0x2d6)](_0x4a0579),{'verbose':_0x5b8e81[_0x4189ce(0x27a)]}),_0x2f2007=_0x47c2c2['data'];return console['error'](_0x4189ce(0x1ee)+_0x2f2007[_0x4189ce(0x2a2)]+_0x4189ce(0x15f)+_0x2f2007['id']),await handleSDKOutput([_0x2f2007],_0x5b8e81),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a30_0xe0c385(0x2a2)]=a30_0xe0c385(0x2de);[a30_0xe0c385(0x2ab)]=a30_0xe0c385(0x198);async['execute'](_0x398d60){const _0x294be4=a30_0xe0c385,{options:_0x25ac3d,args:_0x1aca22,tdx:_0x2f6286}=_0x398d60;console[_0x294be4(0x247)](_0x294be4(0x1d1)+_0x294be4(0x18f)+_0x294be4(0x2c1));const _0x1487ac=_0x25ac3d;if(_0x1aca22[_0x294be4(0x2bc)]===0x0)return console['error'](a30_0x1e4d2a[_0x294be4(0x2b9)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x294be4(0x247)](_0x294be4(0x1fd)),0x1;const _0x5da512=_0x1aca22[0x0];_0x1487ac[_0x294be4(0x27a)]&&(console['error'](_0x294be4(0x167)+_0x1487ac[_0x294be4(0x1e6)]),console[_0x294be4(0x247)]('Parent\x20segment:\x20'+_0x5da512));const _0x5a6a06=await withSpinner(_0x294be4(0x19f)+_0x5da512+'\x27...',()=>_0x2f6286[_0x294be4(0x174)][_0x294be4(0x215)](_0x5da512),{'verbose':_0x1487ac['verbose']}),_0x2e97e6=_0x5a6a06[_0x294be4(0x2d9)],_0x28eb38=await loadJSONFromOptions(_0x1487ac[_0x294be4(0x190)],_0x1487ac[_0x294be4(0x2d8)]),_0x503667=await loadJSONFromOptions(_0x1487ac['addBehaviors'],_0x1487ac['addBehaviorsFile']),_0x299595={'name':_0x2e97e6[_0x294be4(0x2a2)],'description':_0x1487ac[_0x294be4(0x2ab)]!==undefined?_0x1487ac[_0x294be4(0x2ab)]:_0x2e97e6[_0x294be4(0x2ab)],'scheduleType':_0x1487ac['scheduleType']!==undefined?_0x1487ac[_0x294be4(0x2b8)]:_0x2e97e6[_0x294be4(0x2b8)],'scheduleOption':_0x1487ac[_0x294be4(0x299)]!==undefined?_0x1487ac[_0x294be4(0x299)]:_0x2e97e6['scheduleOption'],'timezone':_0x1487ac[_0x294be4(0x17f)]!==undefined?_0x1487ac[_0x294be4(0x17f)]:_0x2e97e6[_0x294be4(0x17f)],'master':_0x2e97e6[_0x294be4(0x23f)],'attributes':_0x28eb38?[..._0x2e97e6[_0x294be4(0x2e7)]||[],..._0x28eb38]:_0x2e97e6[_0x294be4(0x2e7)],'behaviors':_0x503667?[..._0x2e97e6[_0x294be4(0x252)]||[],..._0x503667]:_0x2e97e6[_0x294be4(0x252)],'customerGroup':_0x2e97e6['customerGroup']},_0x5a54d5=await withSpinner(_0x294be4(0x2b1)+_0x5da512+_0x294be4(0x20b),()=>_0x2f6286[_0x294be4(0x174)]['updateParent'](_0x5da512,_0x299595),{'verbose':_0x1487ac[_0x294be4(0x27a)]}),_0x10820c=_0x5a54d5[_0x294be4(0x2d9)];return console[_0x294be4(0x247)](_0x294be4(0x29a)+_0x10820c[_0x294be4(0x2a2)]+'\x27'),await handleSDKOutput([_0x10820c],_0x1487ac),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']='segment:parent:pull';[a30_0xe0c385(0x2ab)]=a30_0xe0c385(0x226);async['execute'](_0x14eda1){const _0x3d2f29=a30_0xe0c385,{options:_0x2cf7c9,args:_0x1bd4eb,tdx:_0x3422f8}=_0x14eda1,_0x34f641=_0x2cf7c9,_0x8486dd=_0x1bd4eb[0x0]||_0x2cf7c9[_0x3d2f29(0x28e)];if(!_0x8486dd)return showParentSegmentNotSetError(_0x3d2f29(0x2c9)+_0x3d2f29(0x2ba)),0x1;if(_0x34f641[_0x3d2f29(0x291)]&&_0x34f641['output'])return console[_0x3d2f29(0x247)](a30_0x1e4d2a[_0x3d2f29(0x2b9)](_0x3d2f29(0x189))),console[_0x3d2f29(0x247)](a30_0x1e4d2a['dim']('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x3d2f29(0x247)](a30_0x1e4d2a[_0x3d2f29(0x2df)](_0x3d2f29(0x2db)+PARENT_SEGMENT_DIR+_0x3d2f29(0x225))),console[_0x3d2f29(0x247)](a30_0x1e4d2a['cyan']('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x2b23c1=_0x34f641[_0x3d2f29(0x1fc)]||a30_0x48f6b9[_0x3d2f29(0x240)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x8486dd)+_0x3d2f29(0x1b5));_0x34f641[_0x3d2f29(0x27a)]&&(console[_0x3d2f29(0x247)](_0x3d2f29(0x167)+_0x34f641[_0x3d2f29(0x1e6)]),console[_0x3d2f29(0x247)](_0x3d2f29(0x239)+_0x8486dd),console[_0x3d2f29(0x247)](_0x3d2f29(0x203)+_0x2b23c1));const _0x522d6e=await withSpinner(_0x3d2f29(0x28c)+_0x8486dd+_0x3d2f29(0x20b),()=>_0x3422f8[_0x3d2f29(0x174)][_0x3d2f29(0x21a)](_0x8486dd),{'verbose':_0x34f641[_0x3d2f29(0x27a)]}),_0x506270=_0x522d6e['data'];if(existsSync(_0x2b23c1)){const _0x5f3de0=readFileSync(_0x2b23c1,_0x3d2f29(0x2a7)),_0x274e30=generateDiff(_0x5f3de0,_0x506270);if(!hasChanges(_0x274e30))console[_0x3d2f29(0x247)](a30_0x1e4d2a[_0x3d2f29(0x2d4)]('✔')+'\x20No\x20changes\x20-\x20'+a30_0x1e4d2a[_0x3d2f29(0x1bb)](_0x2b23c1)+_0x3d2f29(0x1ce));else{console[_0x3d2f29(0x247)](_0x3d2f29(0x1ad)+_0x2b23c1+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x3d2f29(0x247)](formatDiffWithColors(_0x274e30)),console[_0x3d2f29(0x247)]('─'[_0x3d2f29(0x1c9)](0x3c));if(!_0x34f641['yes']){if(!isInteractive())return console[_0x3d2f29(0x247)](a30_0x1e4d2a[_0x3d2f29(0x2b9)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3d2f29(0x247)](a30_0x1e4d2a[_0x3d2f29(0x2df)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x583ded=await confirmKey(_0x3d2f29(0x2e2)+_0x2b23c1+'\x27?');if(!_0x583ded)return console['error'](a30_0x1e4d2a['yellow'](_0x3d2f29(0x1bd))),0x1;}writeFileSync(_0x2b23c1,_0x506270,_0x3d2f29(0x2a7)),console[_0x3d2f29(0x247)](a30_0x1e4d2a[_0x3d2f29(0x2d4)]('✔')+_0x3d2f29(0x241)+a30_0x1e4d2a[_0x3d2f29(0x1bb)](_0x2b23c1));}}else{const _0x38a920=a30_0x48f6b9[_0x3d2f29(0x1fe)](_0x2b23c1);!existsSync(_0x38a920)&&mkdirSync(_0x38a920,{'recursive':!![]}),writeFileSync(_0x2b23c1,_0x506270,'utf-8'),console[_0x3d2f29(0x247)](a30_0x1e4d2a[_0x3d2f29(0x2d4)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a30_0x1e4d2a[_0x3d2f29(0x1bb)](_0x2b23c1));}return saveSessionContext({'parent_segment':_0x8486dd},_0x34f641[_0x3d2f29(0x1ed)]),console[_0x3d2f29(0x247)](a30_0x1e4d2a['green']('✔')+'\x20Context\x20set:\x20'+a30_0x1e4d2a[_0x3d2f29(0x2df)](_0x3d2f29(0x2ac))+_0x3d2f29(0x282)+a30_0x1e4d2a[_0x3d2f29(0x1bb)](_0x8486dd)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a30_0xe0c385(0x2a2)]=a30_0xe0c385(0x1a1);[a30_0xe0c385(0x2ab)]=a30_0xe0c385(0x17e);async['execute'](_0x312611){const _0x10ff54=a30_0xe0c385,{options:_0x25b490,args:_0x54f6c7,tdx:_0x53cd48}=_0x312611,_0xc25a0d=_0x25b490,_0x5f053d=_0x54f6c7[0x0]||_0x25b490[_0x10ff54(0x28e)];if(!_0x5f053d)return showParentSegmentNotSetError(_0x10ff54(0x23d)+_0x10ff54(0x227)),0x1;const _0x4f6f88=resolveYamlFile(_0x5f053d);if(!existsSync(_0x4f6f88))return showFileNotFoundError(_0x4f6f88,_0x5f053d),0x1;_0xc25a0d['verbose']&&(console['error'](_0x10ff54(0x167)+_0xc25a0d[_0x10ff54(0x1e6)]),console[_0x10ff54(0x247)](_0x10ff54(0x1f8)+_0x4f6f88));let _0x22692a;try{_0x22692a=readFileSync(_0x4f6f88,_0x10ff54(0x2a7));}catch(_0x580efa){const _0x49232d=_0x580efa instanceof Error?_0x580efa[_0x10ff54(0x173)]:String(_0x580efa);return console[_0x10ff54(0x247)](_0x10ff54(0x285)+_0x49232d),0x1;}const _0x3dbf51=await withSpinner(_0x10ff54(0x290),()=>_0x53cd48[_0x10ff54(0x174)][_0x10ff54(0x27b)](_0x22692a),{'verbose':_0xc25a0d[_0x10ff54(0x27a)]}),_0x5af5e9=_0x3dbf51[_0x10ff54(0x2d9)],{isNew:_0x12a32e,name:_0x47dff9,hasChanges:_0x533ffc,diffFormatted:_0x231ced}=_0x5af5e9;if(!_0x533ffc)return console[_0x10ff54(0x247)](_0x10ff54(0x1a3)+_0x47dff9+_0x10ff54(0x287)),0x0;_0x12a32e?console[_0x10ff54(0x247)](_0x10ff54(0x1ea)+_0x47dff9+'\x27:'):console[_0x10ff54(0x247)](_0x10ff54(0x24c)+_0x47dff9+'\x27:');console[_0x10ff54(0x247)]('─'[_0x10ff54(0x1c9)](0x3c)),console[_0x10ff54(0x247)](_0x231ced),console[_0x10ff54(0x247)]('─'[_0x10ff54(0x1c9)](0x3c));const _0x127be2=_0x12a32e?_0x10ff54(0x1d5)+_0x47dff9+'\x27?':_0x10ff54(0x298)+_0x47dff9+'\x27?';if(!_0xc25a0d[_0x10ff54(0x26a)]){if(!isInteractive())return console[_0x10ff54(0x247)](a30_0x1e4d2a[_0x10ff54(0x2b9)](_0x10ff54(0x2da)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x10ff54(0x247)](a30_0x1e4d2a[_0x10ff54(0x2df)](_0x10ff54(0x18a))),0x1;const _0x1ef3b0=await confirmKey(_0x127be2);if(!_0x1ef3b0)return console[_0x10ff54(0x247)](a30_0x1e4d2a[_0x10ff54(0x19a)](_0x10ff54(0x1bd))),0x1;}const _0x4b1c18=_0x12a32e?_0x10ff54(0x15b):_0x10ff54(0x28b),_0x11ee4a=await withSpinner(_0x4b1c18+'\x20parent\x20segment\x20\x27'+_0x47dff9+_0x10ff54(0x20b),()=>_0x5af5e9[_0x10ff54(0x20d)](),{'verbose':_0xc25a0d[_0x10ff54(0x27a)]}),_0x2a6007=_0x11ee4a[_0x10ff54(0x2d9)],_0x17b35d=getConsoleNextUrl(_0xc25a0d[_0x10ff54(0x1e6)],_0x10ff54(0x284)+_0x2a6007['id']),_0x1f7990=_0x12a32e?_0x10ff54(0x1e4):'Updated';return console['error']('✔\x20'+_0x1f7990+_0x10ff54(0x26e)+_0x2a6007[_0x10ff54(0x2a2)]+'\x27'),console['error']('\x20\x20'+_0x17b35d),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a30_0xe0c385(0x1af);[a30_0xe0c385(0x2ab)]=a30_0xe0c385(0x18c);async[a30_0xe0c385(0x29f)](_0xbd3fc9){const _0x300f9e=a30_0xe0c385,{options:_0x292cf4,args:_0x4b4abf,tdx:_0x2546a9}=_0xbd3fc9,_0x52b2a1=_0x292cf4,_0x4d29f7=_0x4b4abf[0x0]||_0x292cf4[_0x300f9e(0x28e)];if(!_0x4d29f7)return showParentSegmentNotSetError(_0x300f9e(0x185)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x300f9e(0x260)+_0x300f9e(0x207)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x300f9e(0x1f3)),0x1;const _0x1175ad=resolveYamlFile(_0x4d29f7);if(!existsSync(_0x1175ad))return showFileNotFoundError(_0x1175ad,_0x4d29f7),0x1;_0x52b2a1[_0x300f9e(0x27a)]&&(console[_0x300f9e(0x247)]('Site:\x20'+_0x52b2a1[_0x300f9e(0x1e6)]),console['error']('YAML\x20file:\x20'+_0x1175ad));let _0x4ad21d;try{_0x4ad21d=readFileSync(_0x1175ad,_0x300f9e(0x2a7));}catch(_0x35b8e1){const _0x43a529=_0x35b8e1 instanceof Error?_0x35b8e1[_0x300f9e(0x173)]:String(_0x35b8e1);return console[_0x300f9e(0x247)](_0x300f9e(0x285)+_0x43a529),0x1;}const _0x2fbdf6=createCommandSpinner(a30_0x1e4d2a[_0x300f9e(0x2df)](_0x300f9e(0x238)),{'verbose':_0x52b2a1[_0x300f9e(0x27a)]});_0x2fbdf6[_0x300f9e(0x22e)]();const _0x570e19={'onProgress':_0x20c94c=>{const _0x53c82a=_0x300f9e;_0x2fbdf6[_0x53c82a(0x212)]=formatProgressMessage(_0x20c94c);}};if(_0x52b2a1['master'])_0x570e19[_0x300f9e(0x23f)]=!![];if(_0x52b2a1[_0x300f9e(0x2b7)])_0x570e19[_0x300f9e(0x2b7)]=!![];_0x52b2a1[_0x300f9e(0x1f4)]&&(_0x570e19[_0x300f9e(0x1f4)]=_0x52b2a1['attribute']);_0x52b2a1[_0x300f9e(0x288)]&&(_0x570e19[_0x300f9e(0x288)]=_0x52b2a1['behavior']);if(_0x52b2a1[_0x300f9e(0x18b)])_0x570e19[_0x300f9e(0x18b)]=_0x52b2a1[_0x300f9e(0x18b)];let _0x42c9a3;try{_0x42c9a3=await _0x2546a9[_0x300f9e(0x174)]['validateParentYaml'](_0x4ad21d,_0x570e19),_0x2fbdf6['stop']();}catch(_0x3c3257){_0x2fbdf6[_0x300f9e(0x230)]();throw _0x3c3257;}const _0x5c04f8=_0x52b2a1['interval']||_0x300f9e(0x2dd);return this['displayValidateResults'](_0x42c9a3,_0x570e19,_0x1175ad,_0x5c04f8),_0x42c9a3[_0x300f9e(0x18e)]?0x0:0x1;}[a30_0xe0c385(0x27d)](_0x54e17d,_0x375b59,_0x1f8e1b,_0xb8d2dc){const _0x1ff283=a30_0xe0c385;console[_0x1ff283(0x247)]('\x0a'+a30_0x1e4d2a['bold'](_0x1ff283(0x1f2))+'\x20'+_0x54e17d['name']),console[_0x1ff283(0x247)]('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x54e17d);if(typeof _0x375b59['attribute']==='string'){this['displayAttributesStats'](_0x54e17d),this[_0x1ff283(0x21d)](_0x54e17d),this[_0x1ff283(0x1f0)](_0x1f8e1b,_0xb8d2dc,_0x1ff283(0x1f4),_0x375b59['attribute']);return;}if(_0x375b59[_0x1ff283(0x1f4)]===!![]){this['displayAttributesStats'](_0x54e17d),this[_0x1ff283(0x21d)](_0x54e17d),this[_0x1ff283(0x1f0)](_0x1f8e1b,_0xb8d2dc,_0x1ff283(0x2e7));return;}if(typeof _0x375b59[_0x1ff283(0x288)]===_0x1ff283(0x2e8)){this['displayBehaviorsStats'](_0x54e17d,_0xb8d2dc),this[_0x1ff283(0x21d)](_0x54e17d),this[_0x1ff283(0x1f0)](_0x1f8e1b,_0xb8d2dc,_0x1ff283(0x288),_0x375b59['behavior']);return;}if(_0x375b59['behavior']===!![]){this['displayBehaviorsStats'](_0x54e17d,_0xb8d2dc),this[_0x1ff283(0x21d)](_0x54e17d),this[_0x1ff283(0x1f0)](_0x1f8e1b,_0xb8d2dc,_0x1ff283(0x252));return;}this[_0x1ff283(0x158)](_0x54e17d),this[_0x1ff283(0x1e2)](_0x54e17d,_0xb8d2dc),this[_0x1ff283(0x194)](_0x54e17d),this[_0x1ff283(0x21d)](_0x54e17d),this[_0x1ff283(0x1f0)](_0x1f8e1b,_0xb8d2dc,_0x1ff283(0x2dc));}['displayRealtimeInfo'](_0x21d6c4){displayRealtimeValidation(_0x21d6c4);}[a30_0xe0c385(0x1f0)](_0x134742,_0x4a3fa7,_0x3949f8,_0x2928fc){const _0x4ea999=a30_0xe0c385;console[_0x4ea999(0x247)]('\x0a'+a30_0x1e4d2a[_0x4ea999(0x2df)]('To\x20view\x20sample\x20data:'));const _0x3a942b=_0x4a3fa7!==_0x4ea999(0x2dd)?_0x4ea999(0x21f)+_0x4a3fa7:'';if(_0x3949f8===_0x4ea999(0x1f4)&&_0x2928fc)console['error']('\x20\x20'+a30_0x1e4d2a[_0x4ea999(0x2df)]('tdx\x20ps\x20preview\x20'+_0x134742+_0x4ea999(0x1e7)+_0x2928fc+'\x22'+_0x3a942b));else{if(_0x3949f8===_0x4ea999(0x288)&&_0x2928fc)console[_0x4ea999(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x4ea999(0x2df)](_0x4ea999(0x18d)+_0x134742+_0x4ea999(0x257)+_0x2928fc+'\x22'+_0x3a942b));else(_0x3949f8===_0x4ea999(0x2e7)||_0x3949f8==='all')&&console['error']('\x20\x20'+a30_0x1e4d2a[_0x4ea999(0x2df)](_0x4ea999(0x18d)+_0x134742+_0x4ea999(0x274)+_0x3a942b));}(_0x3949f8==='behaviors'||_0x3949f8===_0x4ea999(0x2dc))&&console[_0x4ea999(0x247)]('\x20\x20'+a30_0x1e4d2a['dim'](_0x4ea999(0x18d)+_0x134742+'\x20--behavior\x20\x22<name>\x22'+_0x3a942b)),_0x3949f8===_0x4ea999(0x2dc)&&console[_0x4ea999(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x4ea999(0x2df)](_0x4ea999(0x18d)+_0x134742+_0x4ea999(0x16d)+_0x3a942b));}[a30_0xe0c385(0x16e)](_0x4b4e9e){const _0x1c70b8=a30_0xe0c385,{master:_0x5c1b58}=_0x4b4e9e,_0x1d8ff7=_0x5c1b58[_0x1c70b8(0x265)]?a30_0x1e4d2a[_0x1c70b8(0x2d4)]('✔'):a30_0x1e4d2a[_0x1c70b8(0x2b9)]('✘');console[_0x1c70b8(0x247)]('\x0a'+a30_0x1e4d2a[_0x1c70b8(0x2df)](_0x1c70b8(0x24a))),console[_0x1c70b8(0x247)](_0x1d8ff7+'\x20'+a30_0x1e4d2a[_0x1c70b8(0x275)](_0x5c1b58[_0x1c70b8(0x22d)]+'.'+_0x5c1b58[_0x1c70b8(0x1cf)])),_0x5c1b58[_0x1c70b8(0x265)]?_0x5c1b58[_0x1c70b8(0x1aa)]!==undefined&&console[_0x1c70b8(0x247)]('\x20\x20'+a30_0x1e4d2a['dim'](_0x1c70b8(0x205))+'\x20'+a30_0x1e4d2a[_0x1c70b8(0x1bb)](formatRows(_0x5c1b58['rowCount']))):console[_0x1c70b8(0x247)]('\x20\x20'+a30_0x1e4d2a['red'](_0x1c70b8(0x273))+'\x20'+_0x5c1b58[_0x1c70b8(0x17b)]);}[a30_0xe0c385(0x158)](_0x11b076){const _0x2c9431=a30_0xe0c385;if(_0x11b076[_0x2c9431(0x2e7)][_0x2c9431(0x2bc)]===0x0)return;console[_0x2c9431(0x247)]('\x0a'+a30_0x1e4d2a['dim'](_0x2c9431(0x1ab)));for(const _0x28b6ab of _0x11b076[_0x2c9431(0x2e7)]){const _0xe7857d=_0x28b6ab[_0x2c9431(0x265)]?a30_0x1e4d2a['green']('✔'):a30_0x1e4d2a['red']('✘');let _0x54b6af='';if(_0x28b6ab[_0x2c9431(0x265)]&&_0x28b6ab[_0x2c9431(0x1d7)]!==undefined&&_0x28b6ab[_0x2c9431(0x170)]!==undefined){const _0x1328d3=_0x28b6ab[_0x2c9431(0x170)][_0x2c9431(0x2c6)](0x1),_0x593f1a=_0x28b6ab[_0x2c9431(0x170)]>=0x50?a30_0x1e4d2a[_0x2c9431(0x2d4)]:_0x28b6ab[_0x2c9431(0x170)]>=0x32?a30_0x1e4d2a[_0x2c9431(0x19a)]:a30_0x1e4d2a[_0x2c9431(0x2b9)];_0x54b6af='\x20'+a30_0x1e4d2a[_0x2c9431(0x2df)](_0x2c9431(0x1dd))+'\x20'+_0x593f1a(_0x1328d3+'%')+'\x20('+formatRows(_0x28b6ab[_0x2c9431(0x1d7)])+_0x2c9431(0x27e);}console['error'](_0xe7857d+'\x20'+a30_0x1e4d2a['bold'](_0x28b6ab[_0x2c9431(0x2a2)])+_0x54b6af),console['error']('\x20\x20'+a30_0x1e4d2a[_0x2c9431(0x2df)](_0x2c9431(0x1f7))+'\x20'+a30_0x1e4d2a['bold'](_0x28b6ab['database']+'.'+_0x28b6ab[_0x2c9431(0x1cf)]));const _0x3dcbd0=_0x28b6ab[_0x2c9431(0x2d7)]===_0x28b6ab['foreignKey']?a30_0x1e4d2a['dim']('Join\x20on:')+'\x20'+_0x28b6ab['joinKey']:a30_0x1e4d2a['dim']('Join:')+'\x20'+_0x28b6ab['joinKey']+_0x2c9431(0x282)+_0x28b6ab[_0x2c9431(0x1c6)];console[_0x2c9431(0x247)]('\x20\x20'+_0x3dcbd0),console[_0x2c9431(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x2c9431(0x2df)](_0x2c9431(0x24e))),this[_0x2c9431(0x26c)](_0x28b6ab[_0x2c9431(0x211)]),!_0x28b6ab[_0x2c9431(0x265)]&&console['error']('\x20\x20'+a30_0x1e4d2a[_0x2c9431(0x2b9)]('Error:')+'\x20'+_0x28b6ab[_0x2c9431(0x17b)]);}}[a30_0xe0c385(0x1e2)](_0x36d4e3,_0x32fa6b){const _0x49720e=a30_0xe0c385;if(_0x36d4e3[_0x49720e(0x252)]['length']===0x0)return;console['error']('\x0a'+a30_0x1e4d2a['dim'](_0x49720e(0x21e))+'\x20'+a30_0x1e4d2a[_0x49720e(0x2df)]('('+_0x32fa6b+')'));for(const _0x5b4739 of _0x36d4e3['behaviors']){const _0x5d7bd2=_0x5b4739[_0x49720e(0x265)]?a30_0x1e4d2a[_0x49720e(0x2d4)]('✔'):a30_0x1e4d2a[_0x49720e(0x2b9)]('✘');let _0xedffa8='';if(_0x5b4739[_0x49720e(0x265)]&&_0x5b4739[_0x49720e(0x199)]!==undefined&&_0x5b4739['totalEvents']!==undefined){const _0x4e043a=_0x5b4739[_0x49720e(0x249)]?.[_0x49720e(0x2c6)](0x1)||'?',_0x5e55cc=(_0x5b4739[_0x49720e(0x249)]??0x0)>=0x32?a30_0x1e4d2a[_0x49720e(0x2d4)]:(_0x5b4739[_0x49720e(0x249)]??0x0)>=0x14?a30_0x1e4d2a['yellow']:a30_0x1e4d2a['red'];_0xedffa8='\x20'+a30_0x1e4d2a[_0x49720e(0x2df)](_0x49720e(0x19c))+'\x20'+_0x5e55cc(formatRows(_0x5b4739[_0x49720e(0x199)]))+'\x20('+_0x4e043a+_0x49720e(0x1d2)+a30_0x1e4d2a[_0x49720e(0x2df)](_0x49720e(0x2c3))+'\x20'+a30_0x1e4d2a['cyan'](formatRows(_0x5b4739[_0x49720e(0x1c1)]));}console['error'](_0x5d7bd2+'\x20'+a30_0x1e4d2a[_0x49720e(0x275)](_0x5b4739['name'])+_0xedffa8),console['error']('\x20\x20'+a30_0x1e4d2a[_0x49720e(0x2df)](_0x49720e(0x1f7))+'\x20'+a30_0x1e4d2a[_0x49720e(0x275)](_0x5b4739[_0x49720e(0x22d)]+'.'+_0x5b4739['table']));const _0x381006=_0x5b4739[_0x49720e(0x2d7)]===_0x5b4739['foreignKey']?a30_0x1e4d2a[_0x49720e(0x2df)](_0x49720e(0x216))+'\x20'+_0x5b4739[_0x49720e(0x2d7)]:a30_0x1e4d2a['dim'](_0x49720e(0x235))+'\x20'+_0x5b4739['joinKey']+_0x49720e(0x282)+_0x5b4739[_0x49720e(0x1c6)];console['error']('\x20\x20'+_0x381006),console[_0x49720e(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x49720e(0x2df)](_0x49720e(0x24e))),this[_0x49720e(0x26c)](_0x5b4739[_0x49720e(0x211)]),!_0x5b4739[_0x49720e(0x265)]&&console[_0x49720e(0x247)]('\x20\x20'+a30_0x1e4d2a['red']('Error:')+'\x20'+_0x5b4739['schemaError']);}}[a30_0xe0c385(0x26c)](_0x97bea3){const _0xd98a8c=a30_0xe0c385;for(const _0x2430ed of _0x97bea3){_0x2430ed[_0xd98a8c(0x246)]===_0x2430ed[_0xd98a8c(0x161)]||_0x2430ed['column']==='*'?console[_0xd98a8c(0x247)](_0xd98a8c(0x2e0)+_0x2430ed['label']):console[_0xd98a8c(0x247)]('\x20\x20\x20\x20-\x20'+_0x2430ed['label']+'\x20'+a30_0x1e4d2a[_0xd98a8c(0x2df)]('('+_0x2430ed[_0xd98a8c(0x161)]+')'));}}[a30_0xe0c385(0x21d)](_0x73ee21){const _0xba80ab=a30_0xe0c385;console[_0xba80ab(0x247)]('─'['repeat'](0x3c));if(_0x73ee21[_0xba80ab(0x2ea)][_0xba80ab(0x2bc)]>0x0){console['error']('\x0a'+a30_0x1e4d2a[_0xba80ab(0x2b9)]('Errors:'));for(const _0x5b1c83 of _0x73ee21[_0xba80ab(0x2ea)]){console[_0xba80ab(0x247)]('\x20\x20'+a30_0x1e4d2a[_0xba80ab(0x2b9)]('•')+'\x20'+_0x5b1c83);}}_0x73ee21[_0xba80ab(0x18e)]&&console['error']('\x0a'+a30_0x1e4d2a['green']('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a30_0xe0c385(0x2a2)]=a30_0xe0c385(0x2e1);[a30_0xe0c385(0x2ab)]=a30_0xe0c385(0x243);async['execute'](_0x8b10dc){const _0x9c81ba=a30_0xe0c385,{options:_0x149e22,args:_0x5a6064,tdx:_0xbfd0cb}=_0x8b10dc,_0x294d83=_0x149e22,_0x115029=_0x5a6064[0x0]||_0x149e22[_0x9c81ba(0x28e)];if(!_0x115029)return showParentSegmentNotSetError(_0x9c81ba(0x15e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x9c81ba(0x1a8)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x9c81ba(0x1ae)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x9c81ba(0x1f3)),0x1;if(!_0x294d83['master']&&!_0x294d83[_0x9c81ba(0x1f4)]&&!_0x294d83[_0x9c81ba(0x288)]&&!_0x294d83[_0x9c81ba(0x2b7)])return console[_0x9c81ba(0x247)](a30_0x1e4d2a[_0x9c81ba(0x2b9)](_0x9c81ba(0x25d))),console[_0x9c81ba(0x247)](_0x9c81ba(0x2ad)),console[_0x9c81ba(0x247)]('Options:'),console['error'](_0x9c81ba(0x1f5)),console[_0x9c81ba(0x247)](_0x9c81ba(0x2b0)),console[_0x9c81ba(0x247)](_0x9c81ba(0x219)),console[_0x9c81ba(0x247)](_0x9c81ba(0x193)),0x1;const _0x1f05b1=resolveYamlFile(_0x115029);if(!existsSync(_0x1f05b1))return showFileNotFoundError(_0x1f05b1,_0x115029),0x1;_0x294d83[_0x9c81ba(0x27a)]&&(console[_0x9c81ba(0x247)](_0x9c81ba(0x167)+_0x294d83[_0x9c81ba(0x1e6)]),console['error'](_0x9c81ba(0x1f8)+_0x1f05b1));let _0x443154;try{_0x443154=readFileSync(_0x1f05b1,_0x9c81ba(0x2a7));}catch(_0x216b54){const _0x2a7c1c=_0x216b54 instanceof Error?_0x216b54[_0x9c81ba(0x173)]:String(_0x216b54);return console['error'](_0x9c81ba(0x285)+_0x2a7c1c),0x1;}let _0x96f84b;try{_0x96f84b=parseDef(_0x443154);}catch(_0x24be69){const _0x31155f=_0x24be69 instanceof Error?_0x24be69[_0x9c81ba(0x173)]:String(_0x24be69);return console[_0x9c81ba(0x247)](a30_0x1e4d2a[_0x9c81ba(0x2b9)](_0x9c81ba(0x1e1)+_0x31155f)),0x1;}if(_0x294d83[_0x9c81ba(0x1f4)]===!![]||_0x294d83[_0x9c81ba(0x1f4)]===''){const _0x20bad0=_0x96f84b[_0x9c81ba(0x2e7)]?.[_0x9c81ba(0x1a6)](_0x2fe0cd=>_0x2fe0cd[_0x9c81ba(0x2a2)])||[];if(_0x20bad0['length']===0x0)console['error'](a30_0x1e4d2a[_0x9c81ba(0x2b9)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console['error'](a30_0x1e4d2a[_0x9c81ba(0x2b9)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console['error']('Available\x20attributes:');for(const _0x1c4d6b of _0x20bad0){console[_0x9c81ba(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x9c81ba(0x1bb)](_0x1c4d6b));}console['error'](_0x9c81ba(0x2d1)+_0x115029+_0x9c81ba(0x1e7)+_0x20bad0[0x0]+'\x22');}return 0x1;}if(_0x294d83[_0x9c81ba(0x288)]===!![]||_0x294d83[_0x9c81ba(0x288)]===''){const _0x2de00b=_0x96f84b[_0x9c81ba(0x252)]?.[_0x9c81ba(0x1a6)](_0x28d18d=>_0x28d18d[_0x9c81ba(0x2a2)])||[];if(_0x2de00b[_0x9c81ba(0x2bc)]===0x0)console[_0x9c81ba(0x247)](a30_0x1e4d2a[_0x9c81ba(0x2b9)](_0x9c81ba(0x2eb)));else{console[_0x9c81ba(0x247)](a30_0x1e4d2a[_0x9c81ba(0x2b9)](_0x9c81ba(0x1b0))),console[_0x9c81ba(0x247)](_0x9c81ba(0x2cd));for(const _0x209b37 of _0x2de00b){console[_0x9c81ba(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x9c81ba(0x1bb)](_0x209b37));}console['error'](_0x9c81ba(0x2d1)+_0x115029+'\x20--behavior\x20\x22'+_0x2de00b[0x0]+'\x22');}return 0x1;}const _0x1065e6=createCommandSpinner(a30_0x1e4d2a[_0x9c81ba(0x2df)]('Fetching\x20sample\x20data...'),{'verbose':_0x294d83['verbose']});_0x1065e6[_0x9c81ba(0x22e)]();const _0x3d3f3b={'onProgress':_0x72c2dd=>{_0x1065e6['text']=formatProgressMessage(_0x72c2dd);}};if(_0x294d83[_0x9c81ba(0x23f)])_0x3d3f3b['master']=!![];if(_0x294d83[_0x9c81ba(0x1f4)]&&typeof _0x294d83[_0x9c81ba(0x1f4)]===_0x9c81ba(0x2e8))_0x3d3f3b[_0x9c81ba(0x1f4)]=_0x294d83['attribute'];if(_0x294d83[_0x9c81ba(0x288)]&&typeof _0x294d83[_0x9c81ba(0x288)]===_0x9c81ba(0x2e8))_0x3d3f3b[_0x9c81ba(0x288)]=_0x294d83[_0x9c81ba(0x288)];if(_0x294d83[_0x9c81ba(0x2b7)])_0x3d3f3b[_0x9c81ba(0x2b7)]=!![];if(_0x294d83[_0x9c81ba(0x18b)])_0x3d3f3b['interval']=_0x294d83[_0x9c81ba(0x18b)];let _0x40948c;try{_0x40948c=await _0xbfd0cb[_0x9c81ba(0x174)][_0x9c81ba(0x224)](_0x443154,_0x3d3f3b),_0x1065e6[_0x9c81ba(0x230)]();}catch(_0x4fa2af){_0x1065e6[_0x9c81ba(0x230)]();throw _0x4fa2af;}return await this['displayPreviewResults'](_0x40948c,{'master':_0x294d83[_0x9c81ba(0x23f)],'attribute':typeof _0x294d83[_0x9c81ba(0x1f4)]===_0x9c81ba(0x2e8)?_0x294d83['attribute']:undefined,'behavior':typeof _0x294d83[_0x9c81ba(0x288)]===_0x9c81ba(0x2e8)?_0x294d83[_0x9c81ba(0x288)]:undefined,'enriched':_0x294d83[_0x9c81ba(0x2b7)]}),_0x40948c['allValid']?0x0:0x1;}async['displayPreviewResults'](_0x384c37,_0x40ee29){const _0xd7eb52=a30_0xe0c385;console['error']('\x0a'+a30_0x1e4d2a[_0xd7eb52(0x275)](_0xd7eb52(0x2d2))+'\x20'+_0x384c37[_0xd7eb52(0x2a2)]),console[_0xd7eb52(0x247)]('═'['repeat'](0x3c));if(_0x40ee29[_0xd7eb52(0x23f)]&&_0x384c37[_0xd7eb52(0x272)]){const _0x62f515=a30_0x1e4d2a[_0xd7eb52(0x2df)](_0xd7eb52(0x2bd))+'\x20'+a30_0x1e4d2a[_0xd7eb52(0x275)](_0x384c37['master'][_0xd7eb52(0x22d)]+'.'+_0x384c37[_0xd7eb52(0x23f)]['table']);await this[_0xd7eb52(0x2bf)](_0x62f515,_0x384c37[_0xd7eb52(0x272)]);}else{if(_0x40ee29[_0xd7eb52(0x1f4)]&&_0x384c37['sampleData']){const _0x19b867=a30_0x1e4d2a[_0xd7eb52(0x2df)](_0xd7eb52(0x2b3))+'\x20'+a30_0x1e4d2a[_0xd7eb52(0x275)](_0x40ee29[_0xd7eb52(0x1f4)]);await this['displaySampleData'](_0x19b867,_0x384c37[_0xd7eb52(0x272)]);}else{if(_0x40ee29['behavior']&&_0x384c37['sampleData']){const _0x472a96=a30_0x1e4d2a[_0xd7eb52(0x2df)](_0xd7eb52(0x19e))+'\x20'+a30_0x1e4d2a[_0xd7eb52(0x275)](_0x40ee29[_0xd7eb52(0x288)]);await this[_0xd7eb52(0x2bf)](_0x472a96,_0x384c37[_0xd7eb52(0x272)]);}else{if(_0x40ee29[_0xd7eb52(0x2b7)]&&_0x384c37['sampleData']){const _0xc98738=a30_0x1e4d2a[_0xd7eb52(0x2df)](_0xd7eb52(0x264))+'\x20'+a30_0x1e4d2a[_0xd7eb52(0x275)](_0xd7eb52(0x232));await this[_0xd7eb52(0x2bf)](_0xc98738,_0x384c37[_0xd7eb52(0x272)]);}else!_0x384c37[_0xd7eb52(0x272)]&&console[_0xd7eb52(0x247)](_0xd7eb52(0x2ca));}}}if(_0x384c37[_0xd7eb52(0x2ea)][_0xd7eb52(0x2bc)]>0x0){console[_0xd7eb52(0x247)]('─'[_0xd7eb52(0x1c9)](0x3c)),console['error']('\x0a'+a30_0x1e4d2a[_0xd7eb52(0x2b9)](_0xd7eb52(0x24b)));for(const _0x55d5bc of _0x384c37[_0xd7eb52(0x2ea)]){console[_0xd7eb52(0x247)]('\x20\x20'+a30_0x1e4d2a[_0xd7eb52(0x2b9)]('•')+'\x20'+_0x55d5bc);}}}async['displaySampleData'](_0x26805d,_0x5c5759){const _0x401bd3=a30_0xe0c385;if(_0x5c5759[_0x401bd3(0x2bc)]===0x0){console[_0x401bd3(0x247)]('\x0a'+_0x26805d),console[_0x401bd3(0x247)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x401bd3(0x247)]('\x0a'+_0x26805d);const _0x31afe5=Object[_0x401bd3(0x165)](_0x5c5759[0x0])['map'](_0x3c3079=>({'name':_0x3c3079,'type':typeof _0x5c5759[0x0][_0x3c3079]===_0x401bd3(0x24d)?_0x401bd3(0x2cc):_0x401bd3(0x25e)})),_0x196ecb={'queryId':_0x401bd3(0x208),'columns':_0x31afe5,'data':_0x5c5759,'stats':{'state':_0x401bd3(0x175),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5c5759[_0x401bd3(0x2bc)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x43d980=formatAsTable(_0x196ecb,_0x5c5759[_0x401bd3(0x2bc)],!![]);await writeOutput(_0x43d980,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a30_0xe0c385(0x2a2)]=a30_0xe0c385(0x1c8);[a30_0xe0c385(0x2ab)]=a30_0xe0c385(0x229);async[a30_0xe0c385(0x29f)](_0x40b832){const _0x1d6705=a30_0xe0c385,{options:_0x5a95d8,args:_0x451cf1,tdx:_0x1af237}=_0x40b832,_0x54f73d=_0x5a95d8,_0x46bcc6=_0x451cf1[0x0]||_0x5a95d8[_0x1d6705(0x28e)];if(!_0x46bcc6)return showParentSegmentNotSetError(_0x1d6705(0x2e3)+_0x1d6705(0x196)),0x1;const _0x5223c8=resolveYamlFile(_0x46bcc6);if(existsSync(_0x5223c8)){_0x54f73d[_0x1d6705(0x27a)]&&console[_0x1d6705(0x247)]('Found\x20YAML\x20file:\x20'+_0x5223c8);let _0x4b1074;try{_0x4b1074=readFileSync(_0x5223c8,_0x1d6705(0x2a7));}catch(_0xe08728){const _0x34297c=_0xe08728 instanceof Error?_0xe08728[_0x1d6705(0x173)]:String(_0xe08728);return console['error']('Error\x20reading\x20file:\x20'+_0x34297c),0x1;}const _0x59c03b=await withSpinner(_0x1d6705(0x290),()=>_0x1af237['segment'][_0x1d6705(0x27b)](_0x4b1074),{'verbose':_0x54f73d['verbose']}),_0x133298=_0x59c03b['data'],{isNew:_0x19496e,name:_0xe90836,hasChanges:_0x125e43,diffFormatted:_0x342340}=_0x133298;if(_0x125e43){_0x19496e?console[_0x1d6705(0x247)](_0x1d6705(0x1ea)+_0xe90836+'\x27:'):console[_0x1d6705(0x247)](_0x1d6705(0x24c)+_0xe90836+'\x27:');console[_0x1d6705(0x247)]('─'[_0x1d6705(0x1c9)](0x3c)),console['error'](_0x342340),console['error']('─'[_0x1d6705(0x1c9)](0x3c));const _0x3077bf=_0x19496e?_0x1d6705(0x1d5)+_0xe90836+_0x1d6705(0x16b):_0x1d6705(0x298)+_0xe90836+_0x1d6705(0x16b);if(!_0x54f73d['yes']){if(!isInteractive())return console['error'](a30_0x1e4d2a[_0x1d6705(0x2b9)](_0x1d6705(0x2da)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1d6705(0x247)](a30_0x1e4d2a['dim'](_0x1d6705(0x18a))),0x1;const _0x2bb412=await confirmKey(_0x3077bf);if(!_0x2bb412)return console[_0x1d6705(0x247)](a30_0x1e4d2a[_0x1d6705(0x19a)]('Aborted.')),0x1;}const _0x116d53=_0x19496e?_0x1d6705(0x15b):_0x1d6705(0x28b);await withSpinner(_0x116d53+_0x1d6705(0x26e)+_0xe90836+'\x27...',()=>_0x133298[_0x1d6705(0x20d)](),{'verbose':_0x54f73d[_0x1d6705(0x27a)]});const _0x2aae8d=_0x19496e?_0x1d6705(0x1e4):'Updated';console[_0x1d6705(0x247)]('✔\x20'+_0x2aae8d+_0x1d6705(0x26e)+_0xe90836+'\x27');}else console['error'](_0x1d6705(0x1a3)+_0xe90836+'\x27\x20is\x20up\x20to\x20date');}const _0x1c0c42=await withSpinner(_0x1d6705(0x181)+_0x46bcc6+_0x1d6705(0x20b),()=>_0x1af237[_0x1d6705(0x174)][_0x1d6705(0x188)](_0x46bcc6),{'verbose':_0x54f73d['verbose']}),_0x13f2ab=_0x1c0c42[_0x1d6705(0x2d9)],_0x1f5445=getConsoleUrl(_0x54f73d[_0x1d6705(0x1e6)],_0x1d6705(0x1e8)+_0x13f2ab[_0x1d6705(0x2a0)]+_0x1d6705(0x254)+_0x13f2ab['workflowSessionId']+'/attempt/'+_0x13f2ab['workflowAttemptId']);return console[_0x1d6705(0x247)](_0x1d6705(0x255)),console[_0x1d6705(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x1d6705(0x2df)]('Audience\x20ID:')+'\x20'+_0x13f2ab[_0x1d6705(0x1b2)]),console[_0x1d6705(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x1d6705(0x2df)](_0x1d6705(0x29c))+'\x20'+_0x13f2ab[_0x1d6705(0x1b8)]),console[_0x1d6705(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x1d6705(0x2df)](_0x1d6705(0x234))+'\x20'+_0x13f2ab[_0x1d6705(0x25a)]),console[_0x1d6705(0x247)]('\x20\x20'+a30_0x1e4d2a[_0x1d6705(0x2df)](_0x1d6705(0x1ca))+'\x20'+_0x13f2ab['workflowAttemptId']),console[_0x1d6705(0x247)]('\x20\x20'+_0x1f5445),console['error']('\x0a'+a30_0x1e4d2a[_0x1d6705(0x2df)](_0x1d6705(0x242))+'\x20tdx\x20wf\x20attempt\x20'+_0x13f2ab[_0x1d6705(0x1c4)]+_0x1d6705(0x192)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a30_0xe0c385(0x28a);[a30_0xe0c385(0x2ab)]=a30_0xe0c385(0x25b);async[a30_0xe0c385(0x29f)](_0x17fa8a){const _0x2b767b=a30_0xe0c385,{options:_0x4374f9,args:_0x23139c,tdx:_0x5c55c8}=_0x17fa8a,_0x52179c=_0x23139c[0x0]||_0x4374f9[_0x2b767b(0x28e)];if(!_0x52179c)return showParentSegmentNotSetError(_0x2b767b(0x16c)+_0x2b767b(0x27c)),0x1;_0x4374f9[_0x2b767b(0x27a)]&&(console[_0x2b767b(0x247)](_0x2b767b(0x167)+_0x4374f9['site']),console[_0x2b767b(0x247)](_0x2b767b(0x239)+_0x52179c));const _0x42df9d=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x52179c+'\x27...',()=>_0x5c55c8[_0x2b767b(0x174)][_0x2b767b(0x1df)](_0x52179c),{'verbose':_0x4374f9[_0x2b767b(0x27a)]}),_0x3db615=_0x42df9d['data'];console['error']('✔\x20Found\x20'+_0x3db615['length']+'\x20field'+(_0x3db615['length']!==0x1?'s':''));if(_0x4374f9[_0x2b767b(0x187)]||_0x4374f9['jsonl'])return await handleSDKOutput(_0x3db615,_0x4374f9),0x0;return displayFieldsHumanReadable(_0x3db615,_0x52179c),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']='segment:parent:view';[a30_0xe0c385(0x2ab)]=a30_0xe0c385(0x23a);async[a30_0xe0c385(0x29f)](_0x1ef8e1){const _0x2dad4c=a30_0xe0c385,{options:_0xbd0b93,args:_0x7dc5a9,tdx:_0x4ec264}=_0x1ef8e1,_0x5e3556=_0xbd0b93,_0x3ef234=_0x7dc5a9[0x0]||_0xbd0b93['parentSegment'];if(!_0x3ef234)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+_0x2dad4c(0x1cb)+_0x2dad4c(0x260)+_0x2dad4c(0x244)),0x1;_0xbd0b93[_0x2dad4c(0x27a)]&&(console[_0x2dad4c(0x247)](_0x2dad4c(0x167)+_0xbd0b93[_0x2dad4c(0x1e6)]),console[_0x2dad4c(0x247)](_0x2dad4c(0x239)+_0x3ef234));const _0x1aca3a=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x3ef234+_0x2dad4c(0x20b),()=>_0x4ec264[_0x2dad4c(0x174)]['getParentFull'](_0x3ef234),{'verbose':_0xbd0b93[_0x2dad4c(0x27a)]}),_0x537b9a=_0x1aca3a[_0x2dad4c(0x2d9)];if(_0x5e3556[_0x2dad4c(0x1e9)]){const _0x2848a4=getConsoleNextUrl(_0x5e3556['site'],'/app/dw/parentSegments/'+_0x537b9a['id']);return console[_0x2dad4c(0x247)](a30_0x1e4d2a[_0x2dad4c(0x2d4)]('✔')+_0x2dad4c(0x1ba)+a30_0x1e4d2a[_0x2dad4c(0x1bb)](_0x2848a4)),openBrowser(_0x2848a4),0x0;}return await handleSingleObjectOutput(_0x537b9a,_0xbd0b93),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a30_0xe0c385(0x2a2)]=a30_0xe0c385(0x2cb);[a30_0xe0c385(0x2ab)]=a30_0xe0c385(0x195);async[a30_0xe0c385(0x29f)](_0x2e5dbc){const _0xa0191e=a30_0xe0c385,{options:_0x51cc9d,args:_0x17d48d,tdx:_0xf92e80}=_0x2e5dbc,_0x399abc=_0x51cc9d,_0x1c0d99=_0x17d48d[0x0]||_0x51cc9d['parentSegment'];if(!_0x1c0d99)return showParentSegmentNotSetError(_0xa0191e(0x29b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+'\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path'),0x1;_0x51cc9d[_0xa0191e(0x27a)]&&(console[_0xa0191e(0x247)](_0xa0191e(0x167)+_0x51cc9d[_0xa0191e(0x1e6)]),console[_0xa0191e(0x247)](_0xa0191e(0x239)+_0x1c0d99));const _0x14c5df=await withSpinner(_0xa0191e(0x23c)+_0x1c0d99+'\x27...',()=>_0xf92e80[_0xa0191e(0x174)][_0xa0191e(0x1d0)](_0x1c0d99),{'verbose':_0x51cc9d['verbose']}),_0x31b7d5=_0x14c5df[_0xa0191e(0x2d9)],_0x4fc8c8=_0xf92e80[_0xa0191e(0x174)][_0xa0191e(0x278)](_0x31b7d5);if(_0x399abc[_0xa0191e(0x1fc)]){const _0x198e79=await this[_0xa0191e(0x2aa)](_0x2e5dbc,_0x1c0d99,_0x31b7d5,_0x4fc8c8),_0x165f06=this[_0xa0191e(0x201)](_0x198e79);writeFileSync(_0x399abc['output'],_0x165f06);const _0xc84fb=_0x198e79[_0xa0191e(0x214)][_0xa0191e(0x211)][_0xa0191e(0x2bc)]+_0x198e79[_0xa0191e(0x252)][_0xa0191e(0x237)]((_0x53fc52,_0x3da58d)=>_0x53fc52+_0x3da58d[_0xa0191e(0x211)][_0xa0191e(0x2bc)],0x0),_0x56c755=_0x198e79[_0xa0191e(0x252)][_0xa0191e(0x23e)](_0x586e6d=>_0x586e6d[_0xa0191e(0x211)][_0xa0191e(0x2bc)]===0x0)[_0xa0191e(0x2bc)];return console[_0xa0191e(0x15c)](_0xa0191e(0x2a8)+_0x399abc[_0xa0191e(0x1fc)]),console[_0xa0191e(0x15c)](_0xa0191e(0x268)+_0x4fc8c8),console[_0xa0191e(0x15c)]('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x198e79[_0xa0191e(0x252)][_0xa0191e(0x2bc)]+'\x20behaviors'),console['log'](_0xa0191e(0x2c0)+_0xc84fb+_0xa0191e(0x186)),_0x56c755>0x0&&console['log'](_0xa0191e(0x2c7)+_0x56c755+_0xa0191e(0x16f)),0x0;}console[_0xa0191e(0x247)]('\x0a'+a30_0x1e4d2a[_0xa0191e(0x275)](_0xa0191e(0x1bf))+'\x20'+a30_0x1e4d2a['cyan'](_0x4fc8c8));const _0x1dde37=await withSpinner('Fetching\x20customers\x20schema...',()=>_0xf92e80[_0xa0191e(0x174)][_0xa0191e(0x15a)](_0x31b7d5),{'verbose':_0x51cc9d['verbose']});console['error']('\x0a'+a30_0x1e4d2a[_0xa0191e(0x275)](_0xa0191e(0x214))+'\x20'+a30_0x1e4d2a[_0xa0191e(0x2df)]('('+_0x4fc8c8+_0xa0191e(0x1a9)));const _0x411eb1=await executeSchemaQuery(_0x1dde37[_0xa0191e(0x2d9)],_0xf92e80,_0x51cc9d);await handleQueryOutput(_0x411eb1,_0x51cc9d);const _0x1b236f=await withSpinner('Fetching\x20behavior\x20list...',()=>_0xf92e80[_0xa0191e(0x174)][_0xa0191e(0x1c0)](_0x31b7d5),{'verbose':_0x51cc9d['verbose']});for(const _0x2af428 of _0x1b236f['data']){const _0x5b03a0=_0xa0191e(0x295)+_0x2af428[_0xa0191e(0x1f6)]()[_0xa0191e(0x261)](/\s+/g,'_'),_0x277e81='SELECT\x20*\x20FROM\x20'+_0x4fc8c8+'.'+_0x5b03a0;console['error']('\x0a'+a30_0x1e4d2a[_0xa0191e(0x275)](_0x2af428)+'\x20'+a30_0x1e4d2a[_0xa0191e(0x2df)]('('+_0x4fc8c8+'.'+_0x5b03a0+')'));try{const _0x34e21e=await executeSchemaQuery(_0x277e81,_0xf92e80,_0x51cc9d);await handleQueryOutput(_0x34e21e,_0x51cc9d);}catch{console[_0xa0191e(0x247)](a30_0x1e4d2a[_0xa0191e(0x19a)](_0xa0191e(0x213)));}}return 0x0;}async[a30_0xe0c385(0x2aa)](_0x52f854,_0x2006b8,_0x2cba4f,_0x598d13){const _0x4be832=a30_0xe0c385,{options:_0x11e2af,tdx:_0x1b46a6}=_0x52f854,_0x237160=await withSpinner(_0x4be832(0x1da),()=>_0x1b46a6[_0x4be832(0x174)][_0x4be832(0x15a)](_0x2cba4f),{'verbose':_0x11e2af[_0x4be832(0x27a)]}),_0x47d624=await executeSchemaQuery(_0x237160[_0x4be832(0x2d9)],_0x1b46a6,_0x11e2af),_0x170091=_0x47d624['data']['map'](_0x43362a=>({'name':_0x43362a[_0x4be832(0x2ce)],'type':_0x43362a[_0x4be832(0x253)]})),_0x7031f9=await withSpinner(_0x4be832(0x209),()=>_0x1b46a6['segment']['getBehaviorNames'](_0x2cba4f),{'verbose':_0x11e2af[_0x4be832(0x27a)]}),_0x2df595=[];for(const _0xb684da of _0x7031f9[_0x4be832(0x2d9)]){const _0x5585f2=_0x4be832(0x295)+_0xb684da[_0x4be832(0x1f6)]()[_0x4be832(0x261)](/\s+/g,'_'),_0x56373a=_0x4be832(0x22a)+_0x598d13+'.'+_0x5585f2;let _0xd36624=[];try{const _0x1a7f75=await executeSchemaQuery(_0x56373a,_0x1b46a6,_0x11e2af);_0xd36624=_0x1a7f75['data'][_0x4be832(0x1a6)](_0x441f97=>({'name':_0x441f97[_0x4be832(0x2ce)],'type':_0x441f97[_0x4be832(0x253)]}));}catch{}_0x2df595[_0x4be832(0x163)]({'table':_0x5585f2,'columns':_0xd36624});}return{'database':_0x598d13,'parent_segment':_0x2006b8,'parent_id':_0x2cba4f,'customers':{'table':_0x4be832(0x214),'columns':_0x170091},'behaviors':_0x2df595};}[a30_0xe0c385(0x201)](_0x28a48b){const _0x12c00f=a30_0xe0c385,_0x488b50=_0x1b2c33=>{const _0x5d6580=a30_0x25eb;if(_0x1b2c33[_0x5d6580(0x2bc)]===0x0)return'[]';const _0x137bb4=_0x1b2c33['map'](_0x3e5c24=>_0x5d6580(0x223)+_0x3e5c24[_0x5d6580(0x2a2)]+_0x5d6580(0x1cc)+_0x3e5c24[_0x5d6580(0x15d)]+_0x5d6580(0x1a5));return'[\x0a'+_0x137bb4['join'](',\x0a')+_0x5d6580(0x289);},_0xb5b02f=_0x28a48b['behaviors'][_0x12c00f(0x1a6)](_0x400888=>{const _0x52ce29=_0x12c00f;return _0x52ce29(0x183)+_0x400888[_0x52ce29(0x1cf)]+_0x52ce29(0x200)+_0x488b50(_0x400888[_0x52ce29(0x211)])[_0x52ce29(0x261)](/^/gm,'\x20\x20')[_0x52ce29(0x2c8)]()+_0x52ce29(0x292);})[_0x12c00f(0x240)](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x28a48b[_0x12c00f(0x22d)]+_0x12c00f(0x17d)+_0x28a48b[_0x12c00f(0x2ac)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x28a48b[_0x12c00f(0x1c2)]+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x28a48b[_0x12c00f(0x214)][_0x12c00f(0x1cf)]+_0x12c00f(0x184)+_0x488b50(_0x28a48b[_0x12c00f(0x214)]['columns'])[_0x12c00f(0x261)](/^/gm,'\x20\x20')['trim']()+_0x12c00f(0x286)+_0xb5b02f+_0x12c00f(0x2b5);}}export class ParentSegmentSQLCommand extends BaseCommand{[a30_0xe0c385(0x2a2)]=a30_0xe0c385(0x1ec);[a30_0xe0c385(0x2ab)]=a30_0xe0c385(0x28d);async[a30_0xe0c385(0x29f)](_0x5b3e1b){const _0x126752=a30_0xe0c385,{options:_0xc5d429,args:_0x7dcf1a,tdx:_0x5bcd54}=_0x5b3e1b,_0x29b7df=_0x7dcf1a[0x0]||_0xc5d429['parentSegment'];if(!_0x29b7df)return showParentSegmentNotSetError(_0x126752(0x269)+_0x126752(0x1fa)),0x1;_0xc5d429[_0x126752(0x27a)]&&(console[_0x126752(0x247)](_0x126752(0x167)+_0xc5d429[_0x126752(0x1e6)]),console[_0x126752(0x247)]('Parent\x20segment:\x20'+_0x29b7df));const _0x104f65=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x29b7df+_0x126752(0x20b),()=>_0x5bcd54['segment']['resolveParentId'](_0x29b7df),{'verbose':_0xc5d429[_0x126752(0x27a)]}),_0x56fb38=_0x104f65[_0x126752(0x2d9)],_0x26030d=await withSpinner(_0x126752(0x297)+_0x29b7df+_0x126752(0x20b),()=>_0x5bcd54['segment'][_0x126752(0x15a)](_0x56fb38),{'verbose':_0xc5d429['verbose']}),_0x3b8f26=_0x26030d[_0x126752(0x2d9)];return _0xc5d429[_0x126752(0x172)]===_0x126752(0x187)||_0xc5d429[_0x126752(0x172)]===_0x126752(0x26f)?await handleSDKOutput([{'sql':_0x3b8f26}],_0xc5d429):console[_0x126752(0x15c)](_0x3b8f26),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a30_0xe0c385(0x2a2)]=a30_0xe0c385(0x2bb);[a30_0xe0c385(0x2ab)]=a30_0xe0c385(0x231);async[a30_0xe0c385(0x29f)](_0x3cf109){const _0x21b34b=a30_0xe0c385,{options:_0x741e86,args:_0x33af7e,tdx:_0x59c274}=_0x3cf109,_0x3a39bc=_0x33af7e[0x0]||_0x741e86[_0x21b34b(0x28e)];if(!_0x3a39bc)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'+_0x21b34b(0x164)),0x1;_0x741e86['verbose']&&(console[_0x21b34b(0x247)](_0x21b34b(0x167)+_0x741e86['site']),console[_0x21b34b(0x247)](_0x21b34b(0x239)+_0x3a39bc));const _0x5eaadc=await withSpinner(_0x21b34b(0x23c)+_0x3a39bc+_0x21b34b(0x20b),()=>_0x59c274[_0x21b34b(0x174)][_0x21b34b(0x1d0)](_0x3a39bc),{'verbose':_0x741e86[_0x21b34b(0x27a)]}),_0x2b53ff=_0x5eaadc[_0x21b34b(0x2d9)],_0x1e3b6e=await withSpinner(_0x21b34b(0x297)+_0x3a39bc+_0x21b34b(0x20b),()=>_0x59c274[_0x21b34b(0x174)][_0x21b34b(0x15a)](_0x2b53ff),{'verbose':_0x741e86[_0x21b34b(0x27a)]});let _0x5840db=_0x1e3b6e[_0x21b34b(0x2d9)];const _0x40f4f8=resolveLimit(_0x741e86[_0x21b34b(0x197)],DEFAULT_DISPLAY_LIMIT),_0xb5ed30=/\bLIMIT\s+\d+/i[_0x21b34b(0x1b4)](_0x5840db);!_0xb5ed30&&(_0x5840db=_0x5840db[_0x21b34b(0x2c8)]()[_0x21b34b(0x261)](/;+$/,''),_0x5840db='SELECT\x20*\x20FROM\x20(\x0a'+_0x5840db+_0x21b34b(0x168)+_0x40f4f8);_0x741e86['verbose']&&console[_0x21b34b(0x247)](_0x21b34b(0x19d)+_0x5840db);const _0x12fbc3=await withProgressSpinner(_0x21b34b(0x202),async _0xfe76c4=>{const _0x1b2c74=_0x21b34b,_0x35a493=await _0x59c274[_0x1b2c74(0x1db)][_0x1b2c74(0x29f)](_0x5840db,{'catalog':'td','schema':_0x1b2c74(0x21b),'onJobId':_0x1a684a=>{const _0x21613e=_0x1b2c74;_0xfe76c4[_0x21613e(0x20e)](_0x1a684a);}});return _0x35a493;},{'verbose':_0x741e86[_0x21b34b(0x27a)]}),_0x14ad4e=_0x12fbc3[_0x21b34b(0x2d9)],_0x2e8b2d=_0x14ad4e[_0x21b34b(0x248)]?_0x21b34b(0x1eb)+_0x14ad4e[_0x21b34b(0x248)]+']':'';return console[_0x21b34b(0x247)](_0x21b34b(0x2e4)+_0x14ad4e['stats'][_0x21b34b(0x1a2)][_0x21b34b(0x180)]()+_0x21b34b(0x228)+('in\x20'+formatElapsed(_0x14ad4e[_0x21b34b(0x26b)][_0x21b34b(0x16a)])+_0x2e8b2d)),await handleQueryOutput(_0x14ad4e,_0x741e86),0x0;}}export class PSRtListCommand extends BaseCommand{['name']=a30_0xe0c385(0x1c5);[a30_0xe0c385(0x2ab)]=a30_0xe0c385(0x1d4);async[a30_0xe0c385(0x29f)](_0x2a81c4){const _0x39a581=a30_0xe0c385,{options:_0xeaba65,args:_0x24b55e,tdx:_0x4eb35f}=_0x2a81c4,_0x46131b=_0x24b55e[0x0],_0x397609=await withSpinner(_0x46131b?_0x39a581(0x206)+_0x46131b+_0x39a581(0x20b):_0x39a581(0x2af),()=>_0x4eb35f[_0x39a581(0x210)][_0x39a581(0x29e)](),{'verbose':_0xeaba65[_0x39a581(0x27a)]});let _0x5e95d7=_0x397609['data'][_0x39a581(0x23e)](_0x3f6c6e=>_0x3f6c6e[_0x39a581(0x2b2)]);if(_0x46131b){const _0x19be8b=_0x46131b[_0x39a581(0x261)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x39a581(0x261)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4e63c7=new RegExp('^'+_0x19be8b+'$','i');_0x5e95d7=_0x5e95d7['filter'](_0x35aa26=>_0x4e63c7[_0x39a581(0x1b4)](_0x35aa26[_0x39a581(0x2a2)]));}_0x5e95d7['sort']((_0x2323d5,_0x3cf444)=>_0x2323d5[_0x39a581(0x2a2)][_0x39a581(0x263)](_0x3cf444[_0x39a581(0x2a2)])),console[_0x39a581(0x247)](_0x39a581(0x1ff)+_0x5e95d7[_0x39a581(0x2bc)]+_0x39a581(0x27f)+(_0x5e95d7[_0x39a581(0x2bc)]!==0x1?'s':''));const _0x3b57c1=_0x159e28=>{const _0x5c176e=_0x39a581;return getConsoleNextUrl(_0xeaba65['site'],_0x5c176e(0x284)+_0x159e28);};if(_0xeaba65[_0x39a581(0x172)]===_0x39a581(0x187)||_0xeaba65['format']==='jsonl'){const _0x382e3b=_0x5e95d7[_0x39a581(0x1a6)](_0x36ae5e=>({..._0x36ae5e,'url':_0x3b57c1(_0x36ae5e['id'])}));await handleSDKOutput(_0x382e3b,_0xeaba65);}else{if(_0x5e95d7[_0x39a581(0x2bc)]===0x0)console[_0x39a581(0x15c)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x27eb71 of _0x5e95d7){const _0x72bb4a=_0x27eb71['population']?a30_0x1e4d2a['dim']('\x20('+formatRows(_0x27eb71[_0x39a581(0x2b4)])+')'):'',_0x47bc8d=hyperlink(_0x27eb71[_0x39a581(0x2a2)],_0x3b57c1(_0x27eb71['id']));console[_0x39a581(0x15c)]('⚡\x20'+_0x47bc8d+_0x72bb4a);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a30_0xe0c385(0x2a2)]='ps:rt:validate';[a30_0xe0c385(0x2ab)]='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async[a30_0xe0c385(0x29f)](_0x586657){const _0x28bf59=a30_0xe0c385,{options:_0x4c71db,args:_0x54b5f0,tdx:_0x522b28}=_0x586657,_0x21f211=_0x54b5f0[0x0]||_0x4c71db[_0x28bf59(0x28e)];if(!_0x21f211)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment'),0x1;const _0x57415f=resolveYamlFile(_0x21f211);if(!existsSync(_0x57415f))return showFileNotFoundError(_0x57415f,_0x21f211),0x1;let _0x39cb4d;try{_0x39cb4d=readFileSync(_0x57415f,'utf-8');}catch(_0x42673e){const _0x54a0fc=_0x42673e instanceof Error?_0x42673e[_0x28bf59(0x173)]:String(_0x42673e);return console['error'](_0x28bf59(0x285)+_0x54a0fc),0x1;}const _0x92d990=createCommandSpinner(a30_0x1e4d2a[_0x28bf59(0x2df)]('Validating\x20RT\x20configuration...'),{'verbose':_0x4c71db['verbose']});_0x92d990[_0x28bf59(0x22e)]();const _0x4d5939={'realtime':!![],'onProgress':_0x52dbe7=>{_0x92d990['text']=formatProgressMessage(_0x52dbe7);}};let _0x5bd323;try{_0x5bd323=await _0x522b28[_0x28bf59(0x174)]['validateParentYaml'](_0x39cb4d,_0x4d5939),_0x92d990[_0x28bf59(0x230)]();}catch(_0x50cffd){_0x92d990[_0x28bf59(0x230)]();throw _0x50cffd;}console[_0x28bf59(0x247)]('\x0a'+a30_0x1e4d2a[_0x28bf59(0x275)](_0x28bf59(0x2ae))+'\x20'+_0x5bd323[_0x28bf59(0x2a2)]),console[_0x28bf59(0x247)]('═'[_0x28bf59(0x1c9)](0x3c)),displayRealtimeValidation(_0x5bd323),console['error']('─'[_0x28bf59(0x1c9)](0x3c));if(_0x5bd323[_0x28bf59(0x2ea)]['length']>0x0){console['error']('\x0a'+a30_0x1e4d2a[_0x28bf59(0x2b9)]('Errors:'));for(const _0x46d499 of _0x5bd323[_0x28bf59(0x2ea)]){console['error']('\x20\x20'+a30_0x1e4d2a[_0x28bf59(0x2b9)]('•')+'\x20'+_0x46d499);}}return _0x5bd323[_0x28bf59(0x18e)]&&console[_0x28bf59(0x247)]('\x0a'+a30_0x1e4d2a['green']('✔')+_0x28bf59(0x166)),_0x5bd323['allValid']?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{[a30_0xe0c385(0x2a2)]=a30_0xe0c385(0x267);['description']=a30_0xe0c385(0x1e5);async[a30_0xe0c385(0x29f)](_0x5b60f4){const _0x2c9d60=a30_0xe0c385,{options:_0x8e7096,args:_0x4184cc,tdx:_0x188f6d}=_0x5b60f4,_0x518550=_0x4184cc[0x0]||_0x8e7096[_0x2c9d60(0x28e)];if(!_0x518550)return showParentSegmentNotSetError(_0x2c9d60(0x178)+_0x2c9d60(0x25c)),0x1;const _0x4a3cfd=await withSpinner(_0x2c9d60(0x23c)+_0x518550+_0x2c9d60(0x20b),()=>_0x188f6d[_0x2c9d60(0x174)][_0x2c9d60(0x1d0)](_0x518550),{'verbose':_0x8e7096[_0x2c9d60(0x27a)]}),_0x27d3f0=_0x4a3cfd[_0x2c9d60(0x2d9)],_0x1eab2d=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0x518550+'\x27...',()=>_0x188f6d[_0x2c9d60(0x2c5)]['list'](_0x27d3f0),{'verbose':_0x8e7096[_0x2c9d60(0x27a)]}),_0x15417c=_0x1eab2d[_0x2c9d60(0x2d9)];console[_0x2c9d60(0x247)](_0x2c9d60(0x1ff)+_0x15417c[_0x2c9d60(0x2bc)]+'\x20personalization\x20service'+(_0x15417c[_0x2c9d60(0x2bc)]!==0x1?'s':''));if(_0x8e7096[_0x2c9d60(0x172)]===_0x2c9d60(0x187)||_0x8e7096['format']==='jsonl')await handleSDKOutput(_0x15417c,_0x8e7096);else{if(_0x15417c['length']===0x0)console[_0x2c9d60(0x15c)](_0x2c9d60(0x1b3)),console[_0x2c9d60(0x247)](a30_0x1e4d2a[_0x2c9d60(0x1bb)](_0x2c9d60(0x251)));else for(const _0x542e76 of _0x15417c){const _0x4bd452=_0x542e76['sections']?.['length']||0x0,_0x26b0da=_0x542e76[_0x2c9d60(0x262)]?a30_0x1e4d2a[_0x2c9d60(0x2df)]('\x20trigger='+_0x542e76[_0x2c9d60(0x262)]):'',_0x46bf8d=a30_0x1e4d2a[_0x2c9d60(0x2df)]('\x20('+_0x4bd452+_0x2c9d60(0x20c)+(_0x4bd452!==0x1?'s':'')+')');console[_0x2c9d60(0x15c)]('\x20\x20'+_0x542e76[_0x2c9d60(0x2a2)]+_0x26b0da+_0x46bf8d),_0x542e76['description']&&console['log'](_0x2c9d60(0x276)+a30_0x1e4d2a[_0x2c9d60(0x2df)](_0x542e76[_0x2c9d60(0x2ab)]));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a30_0xe0c385(0x2a2)]=a30_0xe0c385(0x296);[a30_0xe0c385(0x2ab)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a30_0xe0c385(0x29f)](_0x325ae2){const _0x1923ba=a30_0xe0c385,{options:_0x53e59a,args:_0x33d0e5}=_0x325ae2,_0x7c3eae=_0x33d0e5[0x0]||_0x53e59a[_0x1923ba(0x28e)];if(!_0x7c3eae)return showParentSegmentNotSetError(_0x1923ba(0x17c)+_0x1923ba(0x258)),0x1;const _0x2a0599=resolveYamlFile(_0x7c3eae);if(!existsSync(_0x2a0599))return showFileNotFoundError(_0x2a0599,_0x7c3eae),0x1;let _0x59676a;try{_0x59676a=readFileSync(_0x2a0599,_0x1923ba(0x2a7));}catch(_0x185222){const _0x15c7ad=_0x185222 instanceof Error?_0x185222[_0x1923ba(0x173)]:String(_0x185222);return console[_0x1923ba(0x247)](_0x1923ba(0x285)+_0x15c7ad),0x1;}let _0x3e358a;try{_0x3e358a=parseDef(_0x59676a);}catch(_0x3b724a){const _0x21d941=_0x3b724a instanceof Error?_0x3b724a['message']:String(_0x3b724a);return console[_0x1923ba(0x247)](a30_0x1e4d2a[_0x1923ba(0x2b9)](_0x1923ba(0x1e1)+_0x21d941)),0x1;}if(_0x3e358a['personalization_services']&&_0x3e358a['personalization_services'][_0x1923ba(0x2bc)]>0x0)return console[_0x1923ba(0x247)](a30_0x1e4d2a[_0x1923ba(0x19a)]('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0x2a0599)),console[_0x1923ba(0x247)](a30_0x1e4d2a[_0x1923ba(0x2df)](_0x1923ba(0x1e3)+_0x3e358a[_0x1923ba(0x1fb)][_0x1923ba(0x2bc)]+'\x20service(s)\x20configured')),0x1;!_0x3e358a['realtime']&&(_0x3e358a[_0x1923ba(0x210)]={'events':[{'name':_0x1923ba(0x182),'source_table':'<database>.<table>'}],'attributes':[{'name':'last_page_viewed','type':_0x1923ba(0x1b1)}],'id_stitching':{'primary_key':_0x3e358a['master'][_0x1923ba(0x1cf)]===_0x1923ba(0x214)?_0x1923ba(0x1e0):'user_id'}});_0x3e358a['personalization_services']=[{'name':'My\x20Service','description':_0x1923ba(0x2cf),'trigger_event':_0x1923ba(0x182),'sections':[{'name':'Default','criteria':_0x1923ba(0x179),'attributes':[_0x1923ba(0x236)]}]}];const _0xee7865=serializeDef(_0x3e358a);return writeFileSync(_0x2a0599,_0xee7865,_0x1923ba(0x2a7)),console[_0x1923ba(0x247)](a30_0x1e4d2a[_0x1923ba(0x2d4)]('✔')+_0x1923ba(0x218)+a30_0x1e4d2a[_0x1923ba(0x1bb)](_0x2a0599)),(!_0x3e358a[_0x1923ba(0x210)]||_0x59676a['indexOf'](_0x1923ba(0x245))===-0x1)&&console[_0x1923ba(0x247)](a30_0x1e4d2a[_0x1923ba(0x2d4)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x1923ba(0x247)]('\x0a'+a30_0x1e4d2a[_0x1923ba(0x2df)](_0x1923ba(0x1be))),console[_0x1923ba(0x247)](_0x1923ba(0x1d6)+_0x2a0599+_0x1923ba(0x283)),console[_0x1923ba(0x247)](_0x1923ba(0x2c2)+a30_0x1e4d2a[_0x1923ba(0x2df)](_0x1923ba(0x22f)+_0x7c3eae)+_0x1923ba(0x1c3)),0x0;}}
1
+ const a30_0x1cb568=a30_0x5c8f;(function(_0x35eade,_0xbfd5ec){const _0x3d845c=a30_0x5c8f,_0x3186ae=_0x35eade();while(!![]){try{const _0x55bd73=parseInt(_0x3d845c(0x2a1))/0x1*(parseInt(_0x3d845c(0x186))/0x2)+parseInt(_0x3d845c(0x14d))/0x3*(parseInt(_0x3d845c(0x20e))/0x4)+-parseInt(_0x3d845c(0x24e))/0x5+parseInt(_0x3d845c(0x1bf))/0x6*(parseInt(_0x3d845c(0x118))/0x7)+parseInt(_0x3d845c(0x1fb))/0x8+-parseInt(_0x3d845c(0x129))/0x9*(parseInt(_0x3d845c(0x161))/0xa)+parseInt(_0x3d845c(0x282))/0xb*(-parseInt(_0x3d845c(0x269))/0xc);if(_0x55bd73===_0xbfd5ec)break;else _0x3186ae['push'](_0x3186ae['shift']());}catch(_0x3b2594){_0x3186ae['push'](_0x3186ae['shift']());}}}(a30_0x466f,0x96898));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a30_0x58e066 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a30_0x134bc9 from'chalk';function a30_0x5c8f(_0x4ab819,_0x3db516){_0x4ab819=_0x4ab819-0x115;const _0x466f4b=a30_0x466f();let _0x5c8f2c=_0x466f4b[_0x4ab819];return _0x5c8f2c;}import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a30_0x1cb568(0x194),LEGACY_PARENT_SEGMENT_DIR=a30_0x1cb568(0x1cc);function openBrowser(_0x1db17e){const _0x3836dc=a30_0x1cb568,_0xe251ac=process[_0x3836dc(0x28f)],_0x3254e6=_0xe251ac===_0x3836dc(0x28c)?'open':_0xe251ac===_0x3836dc(0x29e)?_0x3836dc(0x185):_0x3836dc(0x237);spawn(_0x3254e6,[_0x1db17e],{'detached':!![],'stdio':_0x3836dc(0x1d1)})[_0x3836dc(0x188)]();}function migrateLegacyDirectory(){const _0xd3c13c=a30_0x1cb568;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x26cf63=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x26cf63[_0xd3c13c(0x12b)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xd3c13c(0x19a)](a30_0x134bc9['yellow'](_0xd3c13c(0x14a)+LEGACY_PARENT_SEGMENT_DIR+_0xd3c13c(0x264)+PARENT_SEGMENT_DIR+_0xd3c13c(0x222))),console[_0xd3c13c(0x19a)](a30_0x134bc9[_0xd3c13c(0x1d0)](_0xd3c13c(0x202)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0xd3c13c(0x19a)](a30_0x134bc9['yellow'](_0xd3c13c(0x1ce)+LEGACY_PARENT_SEGMENT_DIR+_0xd3c13c(0x256)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a30_0x134bc9[_0xd3c13c(0x1eb)](_0xd3c13c(0x2a0)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x379546){const _0x15d52f=_0x379546 instanceof Error?_0x379546['message']:String(_0x379546);return console['error'](a30_0x134bc9[_0xd3c13c(0x224)](_0xd3c13c(0x196)+_0x15d52f+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x57b186){const _0x41a1bd=a30_0x1cb568;return migrateLegacyDirectory(),super[_0x41a1bd(0x298)](_0x57b186);}}function resolveYamlFile(_0x56d314){const _0x9f73e1=a30_0x1cb568;if(_0x56d314['endsWith'](_0x9f73e1(0x117))||_0x56d314['endsWith'](_0x9f73e1(0x18b)))return _0x56d314;return a30_0x58e066['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x56d314)+_0x9f73e1(0x117));}function formatProgressMessage(_0x296d7b){const _0x50d42c=a30_0x1cb568,_0x21a6b2=_0x296d7b[_0x50d42c(0x18c)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x21a6b2){const [,_0x4b35a1,_0x376f47,_0x1622aa='']=_0x21a6b2;return a30_0x134bc9['dim'](_0x4b35a1+':')+'\x20'+_0x376f47+a30_0x134bc9[_0x50d42c(0x1d0)](_0x1622aa);}return a30_0x134bc9[_0x50d42c(0x1d0)](_0x296d7b);}function showFileNotFoundError(_0x393a44,_0x2f8e1e){const _0x1ccfc0=a30_0x1cb568;console[_0x1ccfc0(0x19a)](a30_0x134bc9[_0x1ccfc0(0x224)](_0x1ccfc0(0x25a)+_0x393a44+'\x0a')),console['error'](a30_0x134bc9[_0x1ccfc0(0x276)](_0x1ccfc0(0x1b8)+_0x2f8e1e+_0x1ccfc0(0x1a2)));}function displayRealtimeValidation(_0x3e04a1){const _0x1673d3=a30_0x1cb568;if(!_0x3e04a1[_0x1673d3(0x13a)])return;const _0x37125b=_0x3e04a1['realtime'],_0x110dc8=_0x37125b[_0x1673d3(0x1e0)]?a30_0x134bc9[_0x1673d3(0x1eb)]('⚡\x20Enabled'):a30_0x134bc9[_0x1673d3(0x155)](_0x1673d3(0x204));console[_0x1673d3(0x19a)]('\x0a'+a30_0x134bc9[_0x1673d3(0x1d0)](_0x1673d3(0x167))+'\x20'+_0x110dc8);if(_0x37125b[_0x1673d3(0x123)]&&_0x37125b['events'][_0x1673d3(0x23d)]>0x0){console[_0x1673d3(0x19a)]('\x20\x20'+a30_0x134bc9['dim'](_0x1673d3(0x1d4))+'\x20'+_0x37125b[_0x1673d3(0x123)][_0x1673d3(0x23d)]+_0x1673d3(0x253));for(const _0x2c9b3e of _0x37125b[_0x1673d3(0x123)]){const _0x429b10=_0x2c9b3e[_0x1673d3(0x258)]===![]?a30_0x134bc9['red']('✘'):a30_0x134bc9['green']('✔');console[_0x1673d3(0x19a)]('\x20\x20\x20\x20'+_0x429b10+'\x20'+_0x2c9b3e[_0x1673d3(0x1de)]),_0x2c9b3e[_0x1673d3(0x240)]&&console[_0x1673d3(0x19a)](_0x1673d3(0x145)+a30_0x134bc9[_0x1673d3(0x224)](_0x2c9b3e['sourceTableError']));}}if(_0x37125b[_0x1673d3(0x286)]&&_0x37125b[_0x1673d3(0x286)][_0x1673d3(0x23d)]>0x0){console['error']('\x20\x20'+a30_0x134bc9[_0x1673d3(0x1d0)](_0x1673d3(0x127))+'\x20'+_0x37125b[_0x1673d3(0x286)]['length']+_0x1673d3(0x253));for(const _0x484d29 of _0x37125b[_0x1673d3(0x286)]){const _0x13550a=_0x484d29[_0x1673d3(0x1a8)]?a30_0x134bc9[_0x1673d3(0x1eb)]('✔'):a30_0x134bc9['red']('✘');console[_0x1673d3(0x19a)](_0x1673d3(0x1fd)+_0x13550a+'\x20'+_0x484d29[_0x1673d3(0x1de)]+'\x20'+a30_0x134bc9['dim']('('+_0x484d29[_0x1673d3(0x11d)]+')'));}}if(_0x37125b[_0x1673d3(0x275)]){const _0x3f9ab4=_0x37125b[_0x1673d3(0x275)][_0x1673d3(0x1ef)]?.[_0x1673d3(0x23d)]?_0x1673d3(0x1fa)+_0x37125b[_0x1673d3(0x275)][_0x1673d3(0x1ef)]['join'](',\x20')+']':'';console[_0x1673d3(0x19a)]('\x20\x20'+a30_0x134bc9[_0x1673d3(0x1d0)](_0x1673d3(0x20f))+'\x20'+_0x37125b[_0x1673d3(0x275)][_0x1673d3(0x229)]+_0x3f9ab4);}if(_0x37125b[_0x1673d3(0x163)]&&_0x37125b[_0x1673d3(0x163)][_0x1673d3(0x23d)]>0x0){console[_0x1673d3(0x19a)]('\x20\x20'+a30_0x134bc9[_0x1673d3(0x1d0)](_0x1673d3(0x12d))+'\x20'+_0x37125b['personalizationServices'][_0x1673d3(0x23d)]+_0x1673d3(0x19f)+(_0x37125b['personalizationServices'][_0x1673d3(0x23d)]!==0x1?'s':''));for(const _0x52e91b of _0x37125b[_0x1673d3(0x163)]){console['error']('\x20\x20\x20\x20-\x20'+_0x52e91b[_0x1673d3(0x1de)]);}}}function showParentSegmentNotSetError(_0x119795){const _0x31d568=a30_0x1cb568;console[_0x31d568(0x19a)](a30_0x134bc9[_0x31d568(0x155)](_0x31d568(0x192))),console[_0x31d568(0x19a)](_0x119795);}export class ParentSegmentListCommand extends BaseCommand{[a30_0x1cb568(0x1de)]='segment:parent:list';[a30_0x1cb568(0x1e6)]=a30_0x1cb568(0x1f9);async['execute'](_0x38c7f3){const _0x3339b6=a30_0x1cb568,{options:_0x4fd9b5,args:_0x5588b9,tdx:_0x5288ab}=_0x38c7f3,_0x2fca97=_0x5588b9[0x0];_0x4fd9b5['verbose']&&(console[_0x3339b6(0x19a)](_0x3339b6(0x1ca)+_0x4fd9b5[_0x3339b6(0x29a)]),_0x2fca97&&console[_0x3339b6(0x19a)]('Pattern:\x20'+_0x2fca97));const _0x58e462=await withSpinner(_0x2fca97?_0x3339b6(0x128)+_0x2fca97+'\x27...':_0x3339b6(0x130),()=>_0x5288ab[_0x3339b6(0x1d6)][_0x3339b6(0x24a)](),{'verbose':_0x4fd9b5[_0x3339b6(0x218)]});let _0x20c6cd=_0x58e462[_0x3339b6(0x150)];if(_0x2fca97){const _0x565cac=_0x2fca97[_0x3339b6(0x1e3)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x3339b6(0x1e3)](/\*/g,'.*')[_0x3339b6(0x1e3)](/\?/g,'.'),_0x239231=new RegExp('^'+_0x565cac+'$','i');_0x20c6cd=_0x20c6cd['filter'](_0x51431b=>_0x239231[_0x3339b6(0x23b)](_0x51431b[_0x3339b6(0x286)][_0x3339b6(0x1de)]));}_0x20c6cd[_0x3339b6(0x25c)]((_0xfc8711,_0x21d858)=>_0xfc8711[_0x3339b6(0x286)][_0x3339b6(0x1de)][_0x3339b6(0x1e1)](_0x21d858[_0x3339b6(0x286)][_0x3339b6(0x1de)])),console['error'](_0x3339b6(0x1c0)+_0x20c6cd[_0x3339b6(0x23d)]+_0x3339b6(0x1dc)+(_0x20c6cd[_0x3339b6(0x23d)]!==0x1?'s':''));const _0x41cd3a=_0x3ed01f=>{const _0x3e34f0=_0x3339b6;return getConsoleNextUrl(_0x4fd9b5[_0x3e34f0(0x29a)],_0x3e34f0(0x291)+_0x3ed01f);};if(_0x4fd9b5[_0x3339b6(0x20c)]===_0x3339b6(0x124)||_0x4fd9b5[_0x3339b6(0x20c)]===_0x3339b6(0x20b)){const _0x1f15ba=_0x20c6cd['map'](_0x39e88e=>({..._0x39e88e,'url':_0x41cd3a(_0x39e88e['id'])}));await handleSDKOutput(_0x1f15ba,_0x4fd9b5);}else{if(_0x20c6cd[_0x3339b6(0x23d)]===0x0)_0x2fca97?console[_0x3339b6(0x151)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x2fca97):console[_0x3339b6(0x151)](_0x3339b6(0x14f));else for(const _0xee8be of _0x20c6cd){const _0x3263e2=_0xee8be[_0x3339b6(0x286)]['population']?a30_0x134bc9['dim']('\x20('+formatRows(_0xee8be['attributes'][_0x3339b6(0x1ec)])+')'):'',_0x3687d3=hyperlink(_0xee8be['attributes'][_0x3339b6(0x1de)],_0x41cd3a(_0xee8be['id']));console[_0x3339b6(0x151)](_0x3339b6(0x210)+_0x3687d3+_0x3263e2);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a30_0x1cb568(0x1de)]=a30_0x1cb568(0x179);['description']=a30_0x1cb568(0x24d);async['execute'](_0x2aad24){const _0x2ad02f=a30_0x1cb568,{options:_0x5a39ab,args:_0x523c28,tdx:_0x5a96d7}=_0x2aad24;console[_0x2ad02f(0x19a)](_0x2ad02f(0x1dd)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x2ad02f(0x23f));const _0x4264b6=_0x5a39ab;if(_0x523c28['length']===0x0)return console['error'](a30_0x134bc9[_0x2ad02f(0x224)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x2ad02f(0x19a)](_0x2ad02f(0x16d)),0x1;const _0x30205f=_0x523c28[0x0];if(!_0x4264b6[_0x2ad02f(0x260)]||!_0x4264b6['table'])return console[_0x2ad02f(0x19a)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console['error'](_0x2ad02f(0x16d)),0x1;_0x4264b6[_0x2ad02f(0x218)]&&(console['error'](_0x2ad02f(0x1ca)+_0x4264b6[_0x2ad02f(0x29a)]),console['error']('Name:\x20'+_0x30205f),console[_0x2ad02f(0x19a)](_0x2ad02f(0x205)+_0x4264b6[_0x2ad02f(0x260)]),console[_0x2ad02f(0x19a)]('Table:\x20'+_0x4264b6[_0x2ad02f(0x13d)]));const _0x16aab6=await loadJSONFromOptions(_0x4264b6[_0x2ad02f(0x286)],_0x4264b6[_0x2ad02f(0x244)]),_0x5d19ad=await loadJSONFromOptions(_0x4264b6[_0x2ad02f(0x154)],_0x4264b6[_0x2ad02f(0x21f)]),_0x24a0e9=await loadJSONFromOptions(_0x4264b6[_0x2ad02f(0x197)],_0x4264b6[_0x2ad02f(0x137)]),_0x163dcc={'name':_0x30205f,'description':_0x4264b6[_0x2ad02f(0x1e6)],'scheduleType':_0x4264b6['scheduleType'],'scheduleOption':_0x4264b6[_0x2ad02f(0x279)],'timezone':_0x4264b6[_0x2ad02f(0x28b)],'master':{'parentDatabaseName':_0x4264b6['database'],'parentTableName':_0x4264b6[_0x2ad02f(0x13d)]},'attributes':_0x16aab6,'behaviors':_0x5d19ad,'customerGroup':_0x24a0e9},_0x2b5acd=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x30205f+_0x2ad02f(0x190),()=>_0x5a96d7[_0x2ad02f(0x1d6)]['createParent'](_0x163dcc),{'verbose':_0x5a39ab[_0x2ad02f(0x218)]}),_0x314f78=_0x2b5acd[_0x2ad02f(0x150)];return console[_0x2ad02f(0x19a)](_0x2ad02f(0x27b)+_0x314f78[_0x2ad02f(0x1de)]+_0x2ad02f(0x148)+_0x314f78['id']),await handleSDKOutput([_0x314f78],_0x5a39ab),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a30_0x1cb568(0x171);[a30_0x1cb568(0x1e6)]=a30_0x1cb568(0x1f6);async[a30_0x1cb568(0x1a1)](_0x4b8ce9){const _0x3c8a93=a30_0x1cb568,{options:_0x38b224,args:_0x4fa1dc,tdx:_0x305487}=_0x4b8ce9;console[_0x3c8a93(0x19a)](_0x3c8a93(0x15e)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x3c8a93(0x23f));const _0x403ffa=_0x38b224;if(_0x4fa1dc[_0x3c8a93(0x23d)]===0x0)return console[_0x3c8a93(0x19a)](a30_0x134bc9[_0x3c8a93(0x224)](_0x3c8a93(0x1b4))),console[_0x3c8a93(0x19a)](_0x3c8a93(0x14e)),0x1;const _0x372c36=_0x4fa1dc[0x0];_0x403ffa[_0x3c8a93(0x218)]&&(console[_0x3c8a93(0x19a)](_0x3c8a93(0x1ca)+_0x403ffa[_0x3c8a93(0x29a)]),console[_0x3c8a93(0x19a)]('Parent\x20segment:\x20'+_0x372c36));const _0x3c4189=await withSpinner(_0x3c8a93(0x172)+_0x372c36+'\x27...',()=>_0x305487['segment'][_0x3c8a93(0x17d)](_0x372c36),{'verbose':_0x403ffa['verbose']}),_0x49dbc0=_0x3c4189[_0x3c8a93(0x150)],_0x39c1c2=await loadJSONFromOptions(_0x403ffa[_0x3c8a93(0x1cf)],_0x403ffa['addAttributesFile']),_0x3396eb=await loadJSONFromOptions(_0x403ffa[_0x3c8a93(0x230)],_0x403ffa['addBehaviorsFile']),_0x37f6f4={'name':_0x49dbc0[_0x3c8a93(0x1de)],'description':_0x403ffa[_0x3c8a93(0x1e6)]!==undefined?_0x403ffa[_0x3c8a93(0x1e6)]:_0x49dbc0[_0x3c8a93(0x1e6)],'scheduleType':_0x403ffa[_0x3c8a93(0x24c)]!==undefined?_0x403ffa['scheduleType']:_0x49dbc0[_0x3c8a93(0x24c)],'scheduleOption':_0x403ffa[_0x3c8a93(0x279)]!==undefined?_0x403ffa[_0x3c8a93(0x279)]:_0x49dbc0[_0x3c8a93(0x279)],'timezone':_0x403ffa[_0x3c8a93(0x28b)]!==undefined?_0x403ffa[_0x3c8a93(0x28b)]:_0x49dbc0['timezone'],'master':_0x49dbc0['master'],'attributes':_0x39c1c2?[..._0x49dbc0[_0x3c8a93(0x286)]||[],..._0x39c1c2]:_0x49dbc0[_0x3c8a93(0x286)],'behaviors':_0x3396eb?[..._0x49dbc0[_0x3c8a93(0x154)]||[],..._0x3396eb]:_0x49dbc0[_0x3c8a93(0x154)],'customerGroup':_0x49dbc0['customerGroup']},_0x981912=await withSpinner(_0x3c8a93(0x24b)+_0x372c36+_0x3c8a93(0x190),()=>_0x305487[_0x3c8a93(0x1d6)]['updateParent'](_0x372c36,_0x37f6f4),{'verbose':_0x403ffa[_0x3c8a93(0x218)]}),_0x13e605=_0x981912['data'];return console[_0x3c8a93(0x19a)](_0x3c8a93(0x14c)+_0x13e605[_0x3c8a93(0x1de)]+'\x27'),await handleSDKOutput([_0x13e605],_0x403ffa),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a30_0x1cb568(0x1de)]='segment:parent:pull';['description']='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a30_0x1cb568(0x1a1)](_0xd22673){const _0x50cc41=a30_0x1cb568,{options:_0x24c737,args:_0x543f82,tdx:_0x5d4fb8}=_0xd22673,_0x4d6bf=_0x24c737,_0x291cf7=_0x543f82[0x0]||_0x24c737[_0x50cc41(0x169)];if(!_0x291cf7)return showParentSegmentNotSetError(_0x50cc41(0x158)+_0x50cc41(0x1c3)),0x1;if(_0x4d6bf[_0x50cc41(0x1af)]&&_0x4d6bf[_0x50cc41(0x295)])return console['error'](a30_0x134bc9['red'](_0x50cc41(0x1b3))),console[_0x50cc41(0x19a)](a30_0x134bc9['dim'](_0x50cc41(0x23a))),console['error'](a30_0x134bc9[_0x50cc41(0x1d0)](_0x50cc41(0x11b)+PARENT_SEGMENT_DIR+_0x50cc41(0x15c))),console[_0x50cc41(0x19a)](a30_0x134bc9[_0x50cc41(0x276)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x2b9d50=_0x4d6bf['output']||a30_0x58e066[_0x50cc41(0x257)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x291cf7)+_0x50cc41(0x117));_0x4d6bf['verbose']&&(console[_0x50cc41(0x19a)](_0x50cc41(0x1ca)+_0x4d6bf[_0x50cc41(0x29a)]),console[_0x50cc41(0x19a)]('Parent\x20segment:\x20'+_0x291cf7),console[_0x50cc41(0x19a)](_0x50cc41(0x1e5)+_0x2b9d50));const _0x4bc454=await withSpinner(_0x50cc41(0x132)+_0x291cf7+_0x50cc41(0x190),()=>_0x5d4fb8[_0x50cc41(0x1d6)]['pullParentYaml'](_0x291cf7),{'verbose':_0x4d6bf[_0x50cc41(0x218)]}),_0x222b63=_0x4bc454[_0x50cc41(0x150)];if(existsSync(_0x2b9d50)){const _0x236248=readFileSync(_0x2b9d50,_0x50cc41(0x24f)),_0x102ab0=generateDiff(_0x236248,_0x222b63);if(!hasChanges(_0x102ab0))console[_0x50cc41(0x19a)](a30_0x134bc9[_0x50cc41(0x1eb)]('✔')+_0x50cc41(0x139)+a30_0x134bc9['cyan'](_0x2b9d50)+_0x50cc41(0x226));else{console[_0x50cc41(0x19a)](_0x50cc41(0x277)+_0x2b9d50+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x50cc41(0x19a)](formatDiffWithColors(_0x102ab0)),console[_0x50cc41(0x19a)]('─'[_0x50cc41(0x259)](0x3c));if(!_0x4d6bf[_0x50cc41(0x136)]){if(!isInteractive())return console[_0x50cc41(0x19a)](a30_0x134bc9[_0x50cc41(0x224)](_0x50cc41(0x17e)),_0x50cc41(0x289)),console[_0x50cc41(0x19a)](a30_0x134bc9[_0x50cc41(0x1d0)](_0x50cc41(0x126))),0x1;const _0x1bfd5d=await confirmKey(_0x50cc41(0x19b)+_0x2b9d50+'\x27?');if(!_0x1bfd5d)return console[_0x50cc41(0x19a)](a30_0x134bc9[_0x50cc41(0x155)](_0x50cc41(0x162))),0x1;}writeFileSync(_0x2b9d50,_0x222b63,_0x50cc41(0x24f)),console[_0x50cc41(0x19a)](a30_0x134bc9[_0x50cc41(0x1eb)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a30_0x134bc9['cyan'](_0x2b9d50));}}else{const _0xc3ed81=a30_0x58e066[_0x50cc41(0x208)](_0x2b9d50);!existsSync(_0xc3ed81)&&mkdirSync(_0xc3ed81,{'recursive':!![]}),writeFileSync(_0x2b9d50,_0x222b63,_0x50cc41(0x24f)),console[_0x50cc41(0x19a)](a30_0x134bc9[_0x50cc41(0x1eb)]('✔')+_0x50cc41(0x1e4)+a30_0x134bc9[_0x50cc41(0x276)](_0x2b9d50));}return saveSessionContext({'parent_segment':_0x291cf7},_0x4d6bf[_0x50cc41(0x13b)]),console[_0x50cc41(0x19a)](a30_0x134bc9[_0x50cc41(0x1eb)]('✔')+_0x50cc41(0x236)+a30_0x134bc9['dim']('parent_segment')+_0x50cc41(0x12c)+a30_0x134bc9['cyan'](_0x291cf7)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a30_0x1cb568(0x1de)]='segment:parent:push';[a30_0x1cb568(0x1e6)]=a30_0x1cb568(0x125);async['execute'](_0x39e146){const _0xf024c4=a30_0x1cb568,{options:_0x3165b3,args:_0x1d23ba,tdx:_0x6ff201}=_0x39e146,_0x30eb68=_0x3165b3,_0x4d4488=_0x1d23ba[0x0]||_0x3165b3[_0xf024c4(0x169)];if(!_0x4d4488)return showParentSegmentNotSetError(_0xf024c4(0x1b6)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x5e6e3e=resolveYamlFile(_0x4d4488);if(!existsSync(_0x5e6e3e))return showFileNotFoundError(_0x5e6e3e,_0x4d4488),0x1;_0x30eb68[_0xf024c4(0x218)]&&(console['error']('Site:\x20'+_0x30eb68['site']),console[_0xf024c4(0x19a)](_0xf024c4(0x176)+_0x5e6e3e));let _0x4f941d;try{_0x4f941d=readFileSync(_0x5e6e3e,_0xf024c4(0x24f));}catch(_0x15192a){const _0xed4fa0=_0x15192a instanceof Error?_0x15192a[_0xf024c4(0x22e)]:String(_0x15192a);return console['error'](_0xf024c4(0x11f)+_0xed4fa0),0x1;}const _0x16b2f8=await withSpinner(_0xf024c4(0x23e),()=>_0x6ff201[_0xf024c4(0x1d6)][_0xf024c4(0x177)](_0x4f941d),{'verbose':_0x30eb68[_0xf024c4(0x218)]}),_0x3d107d=_0x16b2f8[_0xf024c4(0x150)],{isNew:_0x55c869,name:_0xf56fe1,hasChanges:_0x1adc77,diffFormatted:_0x12fc4e}=_0x3d107d;if(!_0x1adc77)return console[_0xf024c4(0x19a)]('✔\x20No\x20changes\x20-\x20\x27'+_0xf56fe1+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x55c869?console[_0xf024c4(0x19a)](_0xf024c4(0x26e)+_0xf56fe1+'\x27:'):console[_0xf024c4(0x19a)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0xf56fe1+'\x27:');console[_0xf024c4(0x19a)]('─'[_0xf024c4(0x259)](0x3c)),console[_0xf024c4(0x19a)](_0x12fc4e),console[_0xf024c4(0x19a)]('─'[_0xf024c4(0x259)](0x3c));const _0x456452=_0x55c869?_0xf024c4(0x272)+_0xf56fe1+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0xf56fe1+'\x27?';if(!_0x30eb68[_0xf024c4(0x136)]){if(!isInteractive())return console[_0xf024c4(0x19a)](a30_0x134bc9[_0xf024c4(0x224)]('\x0aError:'),_0xf024c4(0x289)),console['error'](a30_0x134bc9['dim'](_0xf024c4(0x126))),0x1;const _0x308551=await confirmKey(_0x456452);if(!_0x308551)return console['error'](a30_0x134bc9[_0xf024c4(0x155)](_0xf024c4(0x162))),0x1;}const _0x55acb6=_0x55c869?_0xf024c4(0x288):_0xf024c4(0x241),_0x46e193=await withSpinner(_0x55acb6+_0xf024c4(0x203)+_0xf56fe1+_0xf024c4(0x190),()=>_0x3d107d[_0xf024c4(0x228)](),{'verbose':_0x30eb68[_0xf024c4(0x218)]}),_0x2d9210=_0x46e193['data'],_0x28d9d1=getConsoleNextUrl(_0x30eb68[_0xf024c4(0x29a)],'/app/dw/parentSegments/'+_0x2d9210['id']),_0x4c1468=_0x55c869?_0xf024c4(0x12f):_0xf024c4(0x1c7);return console[_0xf024c4(0x19a)]('✔\x20'+_0x4c1468+_0xf024c4(0x203)+_0x2d9210['name']+'\x27'),console['error']('\x20\x20'+_0x28d9d1),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a30_0x1cb568(0x1de)]=a30_0x1cb568(0x247);[a30_0x1cb568(0x1e6)]=a30_0x1cb568(0x268);async['execute'](_0x495471){const _0x4d2c64=a30_0x1cb568,{options:_0xf01b3b,args:_0x55e066,tdx:_0xba60ff}=_0x495471,_0x319ebf=_0xf01b3b,_0x137972=_0x55e066[0x0]||_0xf01b3b['parentSegment'];if(!_0x137972)return showParentSegmentNotSetError(_0x4d2c64(0x27c)+_0x4d2c64(0x187)+'Options:\x0a'+_0x4d2c64(0x1b0)+_0x4d2c64(0x13e)+_0x4d2c64(0x209)),0x1;const _0x3dfef7=resolveYamlFile(_0x137972);if(!existsSync(_0x3dfef7))return showFileNotFoundError(_0x3dfef7,_0x137972),0x1;_0x319ebf[_0x4d2c64(0x218)]&&(console[_0x4d2c64(0x19a)]('Site:\x20'+_0x319ebf[_0x4d2c64(0x29a)]),console['error']('YAML\x20file:\x20'+_0x3dfef7));let _0x2a339b;try{_0x2a339b=readFileSync(_0x3dfef7,'utf-8');}catch(_0x103324){const _0x1937ca=_0x103324 instanceof Error?_0x103324[_0x4d2c64(0x22e)]:String(_0x103324);return console[_0x4d2c64(0x19a)](_0x4d2c64(0x11f)+_0x1937ca),0x1;}const _0x4869cd=createCommandSpinner(a30_0x134bc9['dim'](_0x4d2c64(0x22f)),{'verbose':_0x319ebf['verbose']});_0x4869cd[_0x4d2c64(0x185)]();const _0x5da1b9={'onProgress':_0x1e24d1=>{const _0x21d181=_0x4d2c64;_0x4869cd[_0x21d181(0x16b)]=formatProgressMessage(_0x1e24d1);}};if(_0x319ebf[_0x4d2c64(0x1be)])_0x5da1b9[_0x4d2c64(0x1be)]=!![];if(_0x319ebf['enriched'])_0x5da1b9[_0x4d2c64(0x1ac)]=!![];_0x319ebf[_0x4d2c64(0x239)]&&(_0x5da1b9[_0x4d2c64(0x239)]=_0x319ebf[_0x4d2c64(0x239)]);_0x319ebf[_0x4d2c64(0x214)]&&(_0x5da1b9[_0x4d2c64(0x214)]=_0x319ebf[_0x4d2c64(0x214)]);if(_0x319ebf['interval'])_0x5da1b9['interval']=_0x319ebf[_0x4d2c64(0x183)];let _0x52c41f;try{_0x52c41f=await _0xba60ff[_0x4d2c64(0x1d6)]['validateParentYaml'](_0x2a339b,_0x5da1b9),_0x4869cd[_0x4d2c64(0x251)]();}catch(_0x512c47){_0x4869cd[_0x4d2c64(0x251)]();throw _0x512c47;}const _0x885e04=_0x319ebf[_0x4d2c64(0x183)]||_0x4d2c64(0x211);return this[_0x4d2c64(0x181)](_0x52c41f,_0x5da1b9,_0x3dfef7,_0x885e04),_0x52c41f[_0x4d2c64(0x267)]?0x0:0x1;}[a30_0x1cb568(0x181)](_0x163d0f,_0x4af8d3,_0x4058ab,_0x1435bd){const _0x227cba=a30_0x1cb568;console[_0x227cba(0x19a)]('\x0a'+a30_0x134bc9[_0x227cba(0x144)](_0x227cba(0x1f3))+'\x20'+_0x163d0f[_0x227cba(0x1de)]),console[_0x227cba(0x19a)]('═'[_0x227cba(0x259)](0x3c)),this[_0x227cba(0x1e7)](_0x163d0f);if(typeof _0x4af8d3['attribute']==='string'){this[_0x227cba(0x263)](_0x163d0f),this['displaySummary'](_0x163d0f),this[_0x227cba(0x266)](_0x4058ab,_0x1435bd,_0x227cba(0x239),_0x4af8d3[_0x227cba(0x239)]);return;}if(_0x4af8d3[_0x227cba(0x239)]===!![]){this[_0x227cba(0x263)](_0x163d0f),this['displaySummary'](_0x163d0f),this['displayPreviewHints'](_0x4058ab,_0x1435bd,_0x227cba(0x286));return;}if(typeof _0x4af8d3['behavior']===_0x227cba(0x200)){this[_0x227cba(0x1a7)](_0x163d0f,_0x1435bd),this['displaySummary'](_0x163d0f),this[_0x227cba(0x266)](_0x4058ab,_0x1435bd,_0x227cba(0x214),_0x4af8d3[_0x227cba(0x214)]);return;}if(_0x4af8d3[_0x227cba(0x214)]===!![]){this[_0x227cba(0x1a7)](_0x163d0f,_0x1435bd),this['displaySummary'](_0x163d0f),this[_0x227cba(0x266)](_0x4058ab,_0x1435bd,_0x227cba(0x154));return;}this[_0x227cba(0x263)](_0x163d0f),this[_0x227cba(0x1a7)](_0x163d0f,_0x1435bd),this[_0x227cba(0x1b2)](_0x163d0f),this[_0x227cba(0x147)](_0x163d0f),this[_0x227cba(0x266)](_0x4058ab,_0x1435bd,'all');}[a30_0x1cb568(0x1b2)](_0x3fc94a){displayRealtimeValidation(_0x3fc94a);}[a30_0x1cb568(0x266)](_0x5a2cea,_0x10a680,_0x5795d5,_0x31c508){const _0x32c021=a30_0x1cb568;console[_0x32c021(0x19a)]('\x0a'+a30_0x134bc9['dim'](_0x32c021(0x29c)));const _0x3e7e66=_0x10a680!==_0x32c021(0x211)?_0x32c021(0x1aa)+_0x10a680:'';if(_0x5795d5===_0x32c021(0x239)&&_0x31c508)console[_0x32c021(0x19a)]('\x20\x20'+a30_0x134bc9[_0x32c021(0x1d0)](_0x32c021(0x168)+_0x5a2cea+_0x32c021(0x195)+_0x31c508+'\x22'+_0x3e7e66));else{if(_0x5795d5===_0x32c021(0x214)&&_0x31c508)console[_0x32c021(0x19a)]('\x20\x20'+a30_0x134bc9[_0x32c021(0x1d0)](_0x32c021(0x168)+_0x5a2cea+_0x32c021(0x250)+_0x31c508+'\x22'+_0x3e7e66));else(_0x5795d5==='attributes'||_0x5795d5===_0x32c021(0x27f))&&console[_0x32c021(0x19a)]('\x20\x20'+a30_0x134bc9[_0x32c021(0x1d0)](_0x32c021(0x168)+_0x5a2cea+_0x32c021(0x206)+_0x3e7e66));}(_0x5795d5==='behaviors'||_0x5795d5==='all')&&console[_0x32c021(0x19a)]('\x20\x20'+a30_0x134bc9[_0x32c021(0x1d0)](_0x32c021(0x168)+_0x5a2cea+_0x32c021(0x21b)+_0x3e7e66)),_0x5795d5==='all'&&console[_0x32c021(0x19a)]('\x20\x20'+a30_0x134bc9[_0x32c021(0x1d0)](_0x32c021(0x168)+_0x5a2cea+_0x32c021(0x184)+_0x3e7e66));}['displayMasterInfo'](_0x376744){const _0x165b2c=a30_0x1cb568,{master:_0x41436c}=_0x376744,_0x1ee9e0=_0x41436c[_0x165b2c(0x281)]?a30_0x134bc9[_0x165b2c(0x1eb)]('✔'):a30_0x134bc9[_0x165b2c(0x224)]('✘');console[_0x165b2c(0x19a)]('\x0a'+a30_0x134bc9['dim'](_0x165b2c(0x1ee))),console[_0x165b2c(0x19a)](_0x1ee9e0+'\x20'+a30_0x134bc9[_0x165b2c(0x144)](_0x41436c[_0x165b2c(0x260)]+'.'+_0x41436c['table'])),_0x41436c[_0x165b2c(0x281)]?_0x41436c['rowCount']!==undefined&&console[_0x165b2c(0x19a)]('\x20\x20'+a30_0x134bc9[_0x165b2c(0x1d0)](_0x165b2c(0x297))+'\x20'+a30_0x134bc9[_0x165b2c(0x276)](formatRows(_0x41436c['rowCount']))):console[_0x165b2c(0x19a)]('\x20\x20'+a30_0x134bc9[_0x165b2c(0x224)](_0x165b2c(0x16f))+'\x20'+_0x41436c[_0x165b2c(0x180)]);}[a30_0x1cb568(0x263)](_0x339949){const _0x5cfbbf=a30_0x1cb568;if(_0x339949[_0x5cfbbf(0x286)][_0x5cfbbf(0x23d)]===0x0)return;console[_0x5cfbbf(0x19a)]('\x0a'+a30_0x134bc9[_0x5cfbbf(0x1d0)](_0x5cfbbf(0x16c)));for(const _0x429ab1 of _0x339949[_0x5cfbbf(0x286)]){const _0x3fe8fc=_0x429ab1['schemaValid']?a30_0x134bc9['green']('✔'):a30_0x134bc9['red']('✘');let _0x4c61b9='';if(_0x429ab1[_0x5cfbbf(0x281)]&&_0x429ab1['matchedCount']!==undefined&&_0x429ab1[_0x5cfbbf(0x292)]!==undefined){const _0x5d42bc=_0x429ab1['coveragePercent'][_0x5cfbbf(0x296)](0x1),_0xcc71ba=_0x429ab1[_0x5cfbbf(0x292)]>=0x50?a30_0x134bc9['green']:_0x429ab1['coveragePercent']>=0x32?a30_0x134bc9[_0x5cfbbf(0x155)]:a30_0x134bc9['red'];_0x4c61b9='\x20'+a30_0x134bc9['dim'](_0x5cfbbf(0x26b))+'\x20'+_0xcc71ba(_0x5d42bc+'%')+'\x20('+formatRows(_0x429ab1[_0x5cfbbf(0x1df)])+_0x5cfbbf(0x140);}console[_0x5cfbbf(0x19a)](_0x3fe8fc+'\x20'+a30_0x134bc9[_0x5cfbbf(0x144)](_0x429ab1[_0x5cfbbf(0x1de)])+_0x4c61b9),console[_0x5cfbbf(0x19a)]('\x20\x20'+a30_0x134bc9[_0x5cfbbf(0x1d0)]('Source:')+'\x20'+a30_0x134bc9['bold'](_0x429ab1[_0x5cfbbf(0x260)]+'.'+_0x429ab1['table']));const _0x20924c=_0x429ab1[_0x5cfbbf(0x23c)]===_0x429ab1[_0x5cfbbf(0x17a)]?a30_0x134bc9['dim'](_0x5cfbbf(0x25f))+'\x20'+_0x429ab1[_0x5cfbbf(0x23c)]:a30_0x134bc9[_0x5cfbbf(0x1d0)](_0x5cfbbf(0x22d))+'\x20'+_0x429ab1[_0x5cfbbf(0x23c)]+'\x20=\x20'+_0x429ab1['foreignKey'];console[_0x5cfbbf(0x19a)]('\x20\x20'+_0x20924c),console[_0x5cfbbf(0x19a)]('\x20\x20'+a30_0x134bc9[_0x5cfbbf(0x1d0)](_0x5cfbbf(0x1bb))),this[_0x5cfbbf(0x1f0)](_0x429ab1[_0x5cfbbf(0x198)]),!_0x429ab1[_0x5cfbbf(0x281)]&&console['error']('\x20\x20'+a30_0x134bc9[_0x5cfbbf(0x224)](_0x5cfbbf(0x16f))+'\x20'+_0x429ab1[_0x5cfbbf(0x180)]);}}[a30_0x1cb568(0x1a7)](_0x12431a,_0x42c975){const _0x47e1c3=a30_0x1cb568;if(_0x12431a['behaviors']['length']===0x0)return;console[_0x47e1c3(0x19a)]('\x0a'+a30_0x134bc9['dim'](_0x47e1c3(0x1cd))+'\x20'+a30_0x134bc9[_0x47e1c3(0x1d0)]('('+_0x42c975+')'));for(const _0x12edbe of _0x12431a[_0x47e1c3(0x154)]){const _0x3b8193=_0x12edbe[_0x47e1c3(0x281)]?a30_0x134bc9[_0x47e1c3(0x1eb)]('✔'):a30_0x134bc9[_0x47e1c3(0x224)]('✘');let _0x2bf19c='';if(_0x12edbe[_0x47e1c3(0x281)]&&_0x12edbe[_0x47e1c3(0x1da)]!==undefined&&_0x12edbe[_0x47e1c3(0x26a)]!==undefined){const _0x239c3c=_0x12edbe[_0x47e1c3(0x119)]?.[_0x47e1c3(0x296)](0x1)||'?',_0x1476a2=(_0x12edbe[_0x47e1c3(0x119)]??0x0)>=0x32?a30_0x134bc9[_0x47e1c3(0x1eb)]:(_0x12edbe[_0x47e1c3(0x119)]??0x0)>=0x14?a30_0x134bc9[_0x47e1c3(0x155)]:a30_0x134bc9['red'];_0x2bf19c='\x20'+a30_0x134bc9[_0x47e1c3(0x1d0)](_0x47e1c3(0x1a4))+'\x20'+_0x1476a2(formatRows(_0x12edbe[_0x47e1c3(0x1da)]))+'\x20('+_0x239c3c+_0x47e1c3(0x143)+a30_0x134bc9['dim'](_0x47e1c3(0x1d4))+'\x20'+a30_0x134bc9['cyan'](formatRows(_0x12edbe[_0x47e1c3(0x26a)]));}console[_0x47e1c3(0x19a)](_0x3b8193+'\x20'+a30_0x134bc9['bold'](_0x12edbe['name'])+_0x2bf19c),console[_0x47e1c3(0x19a)]('\x20\x20'+a30_0x134bc9[_0x47e1c3(0x1d0)]('Source:')+'\x20'+a30_0x134bc9[_0x47e1c3(0x144)](_0x12edbe['database']+'.'+_0x12edbe['table']));const _0x46cc04=_0x12edbe[_0x47e1c3(0x23c)]===_0x12edbe[_0x47e1c3(0x17a)]?a30_0x134bc9['dim'](_0x47e1c3(0x25f))+'\x20'+_0x12edbe['joinKey']:a30_0x134bc9['dim'](_0x47e1c3(0x22d))+'\x20'+_0x12edbe[_0x47e1c3(0x23c)]+_0x47e1c3(0x12c)+_0x12edbe['foreignKey'];console[_0x47e1c3(0x19a)]('\x20\x20'+_0x46cc04),console['error']('\x20\x20'+a30_0x134bc9[_0x47e1c3(0x1d0)]('Columns:')),this[_0x47e1c3(0x1f0)](_0x12edbe['columns']),!_0x12edbe[_0x47e1c3(0x281)]&&console['error']('\x20\x20'+a30_0x134bc9[_0x47e1c3(0x224)]('Error:')+'\x20'+_0x12edbe[_0x47e1c3(0x180)]);}}[a30_0x1cb568(0x1f0)](_0x4e3274){const _0xc7d834=a30_0x1cb568;for(const _0x2ff10c of _0x4e3274){_0x2ff10c['label']===_0x2ff10c['column']||_0x2ff10c['column']==='*'?console[_0xc7d834(0x19a)](_0xc7d834(0x157)+_0x2ff10c[_0xc7d834(0x261)]):console[_0xc7d834(0x19a)](_0xc7d834(0x157)+_0x2ff10c[_0xc7d834(0x261)]+'\x20'+a30_0x134bc9['dim']('('+_0x2ff10c[_0xc7d834(0x213)]+')'));}}['displaySummary'](_0x201e67){const _0x40032f=a30_0x1cb568;console[_0x40032f(0x19a)]('─'['repeat'](0x3c));if(_0x201e67['errors']['length']>0x0){console[_0x40032f(0x19a)]('\x0a'+a30_0x134bc9[_0x40032f(0x224)](_0x40032f(0x1f8)));for(const _0x15a069 of _0x201e67[_0x40032f(0x28d)]){console[_0x40032f(0x19a)]('\x20\x20'+a30_0x134bc9[_0x40032f(0x224)]('•')+'\x20'+_0x15a069);}}_0x201e67[_0x40032f(0x267)]&&console[_0x40032f(0x19a)]('\x0a'+a30_0x134bc9['green']('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a30_0x1cb568(0x1de)]='segment:parent:preview';[a30_0x1cb568(0x1e6)]=a30_0x1cb568(0x19c);async[a30_0x1cb568(0x1a1)](_0x4f933c){const _0x39eec8=a30_0x1cb568,{options:_0x1d11cc,args:_0x149f13,tdx:_0x337351}=_0x4f933c,_0x280e5e=_0x1d11cc,_0x4ca939=_0x149f13[0x0]||_0x1d11cc['parentSegment'];if(!_0x4ca939)return showParentSegmentNotSetError(_0x39eec8(0x249)+_0x39eec8(0x1f4)+'Options\x20(one\x20required):\x0a'+_0x39eec8(0x193)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x39eec8(0x133)+_0x39eec8(0x15b)+_0x39eec8(0x209)),0x1;if(!_0x280e5e[_0x39eec8(0x1be)]&&!_0x280e5e['attribute']&&!_0x280e5e[_0x39eec8(0x214)]&&!_0x280e5e[_0x39eec8(0x1ac)])return console['error'](a30_0x134bc9[_0x39eec8(0x224)](_0x39eec8(0x1fc))),console[_0x39eec8(0x19a)](_0x39eec8(0x11a)),console[_0x39eec8(0x19a)](_0x39eec8(0x12a)),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x39eec8(0x19a)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x39eec8(0x19a)](_0x39eec8(0x20a)),console[_0x39eec8(0x19a)](_0x39eec8(0x116)),0x1;const _0x42b45c=resolveYamlFile(_0x4ca939);if(!existsSync(_0x42b45c))return showFileNotFoundError(_0x42b45c,_0x4ca939),0x1;_0x280e5e[_0x39eec8(0x218)]&&(console['error'](_0x39eec8(0x1ca)+_0x280e5e['site']),console[_0x39eec8(0x19a)](_0x39eec8(0x176)+_0x42b45c));let _0x9d0391;try{_0x9d0391=readFileSync(_0x42b45c,_0x39eec8(0x24f));}catch(_0x51470a){const _0x3d58a0=_0x51470a instanceof Error?_0x51470a[_0x39eec8(0x22e)]:String(_0x51470a);return console[_0x39eec8(0x19a)](_0x39eec8(0x11f)+_0x3d58a0),0x1;}let _0x40c516;try{_0x40c516=parseDef(_0x9d0391);}catch(_0x5e53d5){const _0xb407bd=_0x5e53d5 instanceof Error?_0x5e53d5[_0x39eec8(0x22e)]:String(_0x5e53d5);return console[_0x39eec8(0x19a)](a30_0x134bc9[_0x39eec8(0x224)](_0x39eec8(0x141)+_0xb407bd)),0x1;}if(_0x280e5e[_0x39eec8(0x239)]===!![]||_0x280e5e['attribute']===''){const _0x194fe5=_0x40c516[_0x39eec8(0x286)]?.['map'](_0x4e67f5=>_0x4e67f5['name'])||[];if(_0x194fe5[_0x39eec8(0x23d)]===0x0)console[_0x39eec8(0x19a)](a30_0x134bc9[_0x39eec8(0x224)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x39eec8(0x19a)](a30_0x134bc9[_0x39eec8(0x224)](_0x39eec8(0x21c))),console[_0x39eec8(0x19a)]('Available\x20attributes:');for(const _0x1cbfb5 of _0x194fe5){console[_0x39eec8(0x19a)]('\x20\x20'+a30_0x134bc9[_0x39eec8(0x276)](_0x1cbfb5));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x4ca939+_0x39eec8(0x195)+_0x194fe5[0x0]+'\x22');}return 0x1;}if(_0x280e5e[_0x39eec8(0x214)]===!![]||_0x280e5e[_0x39eec8(0x214)]===''){const _0x3c5ef3=_0x40c516[_0x39eec8(0x154)]?.['map'](_0x76a99a=>_0x76a99a[_0x39eec8(0x1de)])||[];if(_0x3c5ef3[_0x39eec8(0x23d)]===0x0)console[_0x39eec8(0x19a)](a30_0x134bc9[_0x39eec8(0x224)](_0x39eec8(0x22a)));else{console[_0x39eec8(0x19a)](a30_0x134bc9[_0x39eec8(0x224)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x39eec8(0x19a)]('Available\x20behaviors:');for(const _0x20af28 of _0x3c5ef3){console[_0x39eec8(0x19a)]('\x20\x20'+a30_0x134bc9[_0x39eec8(0x276)](_0x20af28));}console[_0x39eec8(0x19a)](_0x39eec8(0x16a)+_0x4ca939+'\x20--behavior\x20\x22'+_0x3c5ef3[0x0]+'\x22');}return 0x1;}const _0x10e1c6=createCommandSpinner(a30_0x134bc9[_0x39eec8(0x1d0)](_0x39eec8(0x1d9)),{'verbose':_0x280e5e['verbose']});_0x10e1c6[_0x39eec8(0x185)]();const _0x2b4a81={'onProgress':_0x209e6c=>{_0x10e1c6['text']=formatProgressMessage(_0x209e6c);}};if(_0x280e5e[_0x39eec8(0x1be)])_0x2b4a81[_0x39eec8(0x1be)]=!![];if(_0x280e5e[_0x39eec8(0x239)]&&typeof _0x280e5e[_0x39eec8(0x239)]===_0x39eec8(0x200))_0x2b4a81[_0x39eec8(0x239)]=_0x280e5e[_0x39eec8(0x239)];if(_0x280e5e[_0x39eec8(0x214)]&&typeof _0x280e5e[_0x39eec8(0x214)]===_0x39eec8(0x200))_0x2b4a81[_0x39eec8(0x214)]=_0x280e5e[_0x39eec8(0x214)];if(_0x280e5e[_0x39eec8(0x1ac)])_0x2b4a81[_0x39eec8(0x1ac)]=!![];if(_0x280e5e[_0x39eec8(0x183)])_0x2b4a81[_0x39eec8(0x183)]=_0x280e5e[_0x39eec8(0x183)];let _0x591530;try{_0x591530=await _0x337351['segment']['previewParentYaml'](_0x9d0391,_0x2b4a81),_0x10e1c6[_0x39eec8(0x251)]();}catch(_0x4bc0ae){_0x10e1c6[_0x39eec8(0x251)]();throw _0x4bc0ae;}return await this[_0x39eec8(0x178)](_0x591530,{'master':_0x280e5e[_0x39eec8(0x1be)],'attribute':typeof _0x280e5e[_0x39eec8(0x239)]===_0x39eec8(0x200)?_0x280e5e[_0x39eec8(0x239)]:undefined,'behavior':typeof _0x280e5e[_0x39eec8(0x214)]===_0x39eec8(0x200)?_0x280e5e['behavior']:undefined,'enriched':_0x280e5e[_0x39eec8(0x1ac)]}),_0x591530[_0x39eec8(0x267)]?0x0:0x1;}async[a30_0x1cb568(0x178)](_0x1104fe,_0x34d0b9){const _0x540e55=a30_0x1cb568;console['error']('\x0a'+a30_0x134bc9[_0x540e55(0x144)](_0x540e55(0x221))+'\x20'+_0x1104fe['name']),console[_0x540e55(0x19a)]('═'[_0x540e55(0x259)](0x3c));if(_0x34d0b9[_0x540e55(0x1be)]&&_0x1104fe[_0x540e55(0x13f)]){const _0x35d396=a30_0x134bc9[_0x540e55(0x1d0)]('Master:')+'\x20'+a30_0x134bc9['bold'](_0x1104fe[_0x540e55(0x1be)][_0x540e55(0x260)]+'.'+_0x1104fe[_0x540e55(0x1be)][_0x540e55(0x13d)]);await this[_0x540e55(0x234)](_0x35d396,_0x1104fe[_0x540e55(0x13f)]);}else{if(_0x34d0b9[_0x540e55(0x239)]&&_0x1104fe[_0x540e55(0x13f)]){const _0x4b74ed=a30_0x134bc9[_0x540e55(0x1d0)](_0x540e55(0x21d))+'\x20'+a30_0x134bc9[_0x540e55(0x144)](_0x34d0b9['attribute']);await this['displaySampleData'](_0x4b74ed,_0x1104fe['sampleData']);}else{if(_0x34d0b9[_0x540e55(0x214)]&&_0x1104fe['sampleData']){const _0x3333d5=a30_0x134bc9[_0x540e55(0x1d0)](_0x540e55(0x1d7))+'\x20'+a30_0x134bc9[_0x540e55(0x144)](_0x34d0b9[_0x540e55(0x214)]);await this[_0x540e55(0x234)](_0x3333d5,_0x1104fe['sampleData']);}else{if(_0x34d0b9[_0x540e55(0x1ac)]&&_0x1104fe[_0x540e55(0x13f)]){const _0x329ecd=a30_0x134bc9[_0x540e55(0x1d0)](_0x540e55(0x18f))+'\x20'+a30_0x134bc9[_0x540e55(0x144)](_0x540e55(0x215));await this['displaySampleData'](_0x329ecd,_0x1104fe['sampleData']);}else!_0x1104fe[_0x540e55(0x13f)]&&console[_0x540e55(0x19a)](_0x540e55(0x1db));}}}if(_0x1104fe[_0x540e55(0x28d)][_0x540e55(0x23d)]>0x0){console['error']('─'[_0x540e55(0x259)](0x3c)),console[_0x540e55(0x19a)]('\x0a'+a30_0x134bc9[_0x540e55(0x224)](_0x540e55(0x1f8)));for(const _0x5dca6b of _0x1104fe['errors']){console[_0x540e55(0x19a)]('\x20\x20'+a30_0x134bc9[_0x540e55(0x224)]('•')+'\x20'+_0x5dca6b);}}}async['displaySampleData'](_0x560337,_0x5402ea){const _0x5e2485=a30_0x1cb568;if(_0x5402ea[_0x5e2485(0x23d)]===0x0){console[_0x5e2485(0x19a)]('\x0a'+_0x560337),console[_0x5e2485(0x19a)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x5e2485(0x19a)]('\x0a'+_0x560337);const _0x5bd31e=Object[_0x5e2485(0x238)](_0x5402ea[0x0])[_0x5e2485(0x191)](_0x29e9d5=>({'name':_0x29e9d5,'type':typeof _0x5402ea[0x0][_0x29e9d5]==='number'?_0x5e2485(0x1a6):'varchar'})),_0x2e49b8={'queryId':'preview','columns':_0x5bd31e,'data':_0x5402ea,'stats':{'state':_0x5e2485(0x1d8),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5402ea[_0x5e2485(0x23d)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x19fc41=formatAsTable(_0x2e49b8,_0x5402ea[_0x5e2485(0x23d)],!![]);await writeOutput(_0x19fc41,undefined,_0x5e2485(0x13d));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a30_0x1cb568(0x1de)]=a30_0x1cb568(0x245);['description']=a30_0x1cb568(0x29f);async[a30_0x1cb568(0x1a1)](_0x300a1b){const _0x50a38b=a30_0x1cb568,{options:_0xa52f19,args:_0x37d0ee,tdx:_0xee5715}=_0x300a1b,_0x4e6503=_0xa52f19,_0x48bc54=_0x37d0ee[0x0]||_0xa52f19[_0x50a38b(0x169)];if(!_0x48bc54)return showParentSegmentNotSetError(_0x50a38b(0x22b)+_0x50a38b(0x1ea)),0x1;const _0x4f4521=resolveYamlFile(_0x48bc54);if(existsSync(_0x4f4521)){_0x4e6503['verbose']&&console['error']('Found\x20YAML\x20file:\x20'+_0x4f4521);let _0x51120f;try{_0x51120f=readFileSync(_0x4f4521,_0x50a38b(0x24f));}catch(_0xca9a0b){const _0x4652eb=_0xca9a0b instanceof Error?_0xca9a0b[_0x50a38b(0x22e)]:String(_0xca9a0b);return console[_0x50a38b(0x19a)]('Error\x20reading\x20file:\x20'+_0x4652eb),0x1;}const _0x279b84=await withSpinner(_0x50a38b(0x23e),()=>_0xee5715[_0x50a38b(0x1d6)][_0x50a38b(0x177)](_0x51120f),{'verbose':_0x4e6503[_0x50a38b(0x218)]}),_0x3c622a=_0x279b84[_0x50a38b(0x150)],{isNew:_0x1d0c4f,name:_0x26ed92,hasChanges:_0x1e2573,diffFormatted:_0x87b690}=_0x3c622a;if(_0x1e2573){_0x1d0c4f?console[_0x50a38b(0x19a)](_0x50a38b(0x26e)+_0x26ed92+'\x27:'):console[_0x50a38b(0x19a)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x26ed92+'\x27:');console[_0x50a38b(0x19a)]('─'[_0x50a38b(0x259)](0x3c)),console[_0x50a38b(0x19a)](_0x87b690),console[_0x50a38b(0x19a)]('─'[_0x50a38b(0x259)](0x3c));const _0x40ab29=_0x1d0c4f?_0x50a38b(0x272)+_0x26ed92+_0x50a38b(0x227):_0x50a38b(0x28a)+_0x26ed92+_0x50a38b(0x227);if(!_0x4e6503['yes']){if(!isInteractive())return console[_0x50a38b(0x19a)](a30_0x134bc9[_0x50a38b(0x224)](_0x50a38b(0x17e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x50a38b(0x19a)](a30_0x134bc9[_0x50a38b(0x1d0)](_0x50a38b(0x126))),0x1;const _0x551d1b=await confirmKey(_0x40ab29);if(!_0x551d1b)return console[_0x50a38b(0x19a)](a30_0x134bc9[_0x50a38b(0x155)](_0x50a38b(0x162))),0x1;}const _0x46d886=_0x1d0c4f?_0x50a38b(0x288):_0x50a38b(0x241);await withSpinner(_0x46d886+'\x20parent\x20segment\x20\x27'+_0x26ed92+_0x50a38b(0x190),()=>_0x3c622a[_0x50a38b(0x228)](),{'verbose':_0x4e6503[_0x50a38b(0x218)]});const _0x282d4e=_0x1d0c4f?'Created':_0x50a38b(0x1c7);console[_0x50a38b(0x19a)]('✔\x20'+_0x282d4e+_0x50a38b(0x203)+_0x26ed92+'\x27');}else console[_0x50a38b(0x19a)](_0x50a38b(0x29d)+_0x26ed92+_0x50a38b(0x1f5));}const _0x2d2cd0=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x48bc54+_0x50a38b(0x190),()=>_0xee5715[_0x50a38b(0x1d6)]['runParent'](_0x48bc54),{'verbose':_0x4e6503['verbose']}),_0x56da4d=_0x2d2cd0['data'],_0x541347=getConsoleUrl(_0x4e6503[_0x50a38b(0x29a)],'/app/workflows/'+_0x56da4d[_0x50a38b(0x1c6)]+_0x50a38b(0x26d)+_0x56da4d[_0x50a38b(0x160)]+_0x50a38b(0x15d)+_0x56da4d[_0x50a38b(0x15a)]);return console[_0x50a38b(0x19a)](_0x50a38b(0x299)),console['error']('\x20\x20'+a30_0x134bc9[_0x50a38b(0x1d0)](_0x50a38b(0x17b))+'\x20'+_0x56da4d['audienceId']),console[_0x50a38b(0x19a)]('\x20\x20'+a30_0x134bc9[_0x50a38b(0x1d0)](_0x50a38b(0x290))+'\x20'+_0x56da4d['status']),console[_0x50a38b(0x19a)]('\x20\x20'+a30_0x134bc9[_0x50a38b(0x1d0)](_0x50a38b(0x293))+'\x20'+_0x56da4d[_0x50a38b(0x160)]),console['error']('\x20\x20'+a30_0x134bc9[_0x50a38b(0x1d0)](_0x50a38b(0x26f))+'\x20'+_0x56da4d[_0x50a38b(0x15a)]),console[_0x50a38b(0x19a)]('\x20\x20'+_0x541347),console[_0x50a38b(0x19a)]('\x0a'+a30_0x134bc9[_0x50a38b(0x1d0)](_0x50a38b(0x11e))+_0x50a38b(0x207)+_0x56da4d['workflowAttemptId']+_0x50a38b(0x1fe)),0x0;}}function a30_0x466f(){const _0x1c8032=['Error\x20parsing\x20YAML:\x20','ps:rt:list','%)\x20','bold','\x20\x20\x20\x20\x20\x20','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','displaySummary','\x27\x20with\x20ID:\x20','<database>.<table>','\x0a⚠️\x20\x20Both\x20','jobId','✔\x20Updated\x20parent\x20segment\x20\x27','9fEbmuB','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','No\x20parent\x20segments\x20found','data','log','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','behavior_','behaviors','yellow','No\x20personalization\x20services\x20configured','\x20\x20\x20\x20-\x20','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Get\x20SQL\x20query\x20for\x20parent\x20segment','workflowAttemptId','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','/{name}.yml\x0a','/attempt/','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','user_id','workflowSessionId','10yrFkdS','Aborted.','personalizationServices','Executing\x20parent\x20segment\x20query...','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','\x20to\x20push\x20the\x20configuration','RT\x202.0:','tdx\x20ps\x20preview\x20','parentSegment','\x0aUsage:\x20tdx\x20ps\x20preview\x20','text','Attributes','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','last_page_viewed','Error:','collectSchema','segment:parent:update','Fetching\x20current\x20configuration\x20for\x20\x27','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','ps:pz:init','YAML\x20file:\x20','pushParentYaml','displayPreviewResults','segment:parent:create','foreignKey','Audience\x20ID:','Fetching\x20behavior\x20list...','getParentFull','\x0aError:','segment:parent:sql','schemaError','displayValidateResults','\x20field','interval','\x20--enriched','start','4KcBhZd','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','unref','RT\x202.0\x20Validate:','list','.yaml','match','✔\x20Query\x20completed:\x20Processed\x20','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Enriched:','\x27...','map','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','parent_segments','\x20--attribute\x20\x22','✘\x20Failed\x20to\x20rename\x20directory:\x20','customerGroup','columns','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','error','Overwrite\x20\x27','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','stats','My\x20Service','\x20service','sections','execute','`\x20to\x20download\x20the\x20configuration\x20first','List\x20available\x20fields\x20for\x20segmentation','Customers:','\x20\x20\x20','double','displayBehaviorsStats','valid','indexOf','\x20--interval\x20','limit','enriched','\x5c$&','Listing\x20personalization\x20services\x20for\x20\x27','use','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20service(s)\x20configured','displayRealtimeInfo','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','Options:\x0a','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','page_view','SQL\x20query:\x0a','Columns:','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Listing\x20RT-enabled\x20parent\x20segments...','master','13998EScLsY','✔\x20Found\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','ps:pz:list','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20rows\x20','trim','workflowId','Updated','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','true','Site:\x20','parent_id','parent_segment','Behaviors','\x0a⚠️\x20\x20Migrating:\x20','addAttributes','dim','ignore','\x0a\x20\x20\x20\x20}','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Events:','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','Behavior:','FINISHED','Fetching\x20sample\x20data...','customersWithEvents','\x0aNo\x20sample\x20data\x20available','\x20parent\x20segment','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','name','matchedCount','enabled','localeCompare','\x20\x20Note:\x20','replace','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Output\x20file:\x20','description','displayMasterInfo','ps:rt:validate','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','green','population','Fetching\x20customers\x20schema...','Master\x20Table','stitchingKeys','displayColumns','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','\x20Added\x20RT\x202.0\x20template\x20section','Validate:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','\x27\x20is\x20up\x20to\x20date','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x0a\x20\x20]\x0a}\x0a','Errors:','List\x20parent\x20segments','\x20+\x20[','5308672yQrPJP','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','\x20\x20\x20\x20','\x20kill','query','string','personalization','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x20parent\x20segment\x20\x27','⚡\x20Not\x20enabled','Database:\x20','\x20--attribute\x20\x22<name>\x22','\x20tdx\x20wf\x20attempt\x20','dirname','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','jsonl','format','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','769948jVEytm','ID\x20Stitching:','👥\x20','-1d','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','column','behavior','Master\x20+\x20Attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','\x20\x202.\x20Run\x20','verbose','setJobId','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20--behavior\x20\x22<name>\x22','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Attribute:','processedRows','behaviorsFile','getParentSQL','Preview:','/\x20directories\x20exist.','{\x0a\x20\x20\x22database\x22:\x20\x22','red','tdx\x20ps\x20push\x20','\x20is\x20already\x20up\x20to\x20date','\x27\x20and\x20run\x20workflow?','apply','primaryKey','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x20\x20Columns:\x20','Join:','message','Validating\x20configuration...','addBehaviors','personalization_services','customers','Fetching\x20SQL\x20for\x20\x27','displaySampleData','column_name','\x20Context\x20set:\x20','xdg-open','keys','attribute','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','test','joinKey','length','Analyzing\x20changes...','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','sourceTableError','Updating','SELECT\x20*\x20FROM\x20(\x0a','SELECT\x20*\x20FROM\x20','attributesFile','segment:parent:run','\x20\x20Database:\x20','segment:parent:validate','Default','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','listParents','Updating\x20parent\x20segment\x20\x27','scheduleType','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','2298020giHdYI','utf-8','\x20--behavior\x20\x22','stop','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','\x20configured','\x20section','trigger_event','/\x20→\x20','join','sourceTableValid','repeat','Error:\x20File\x20not\x20found:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','sort','\x20[Job\x20ID:\x20','toLocaleString','Join\x20on:','database','label','.customers)','displayAttributesStats','/\x20and\x20','resolveParentId','displayPreviewHints','allValid','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','19256844gKMFPh','totalEvents','Coverage:','getBehaviorNames','/sessions/','\x0aNew\x20parent\x20segment\x20\x27','Attempt:','Output\x20Database:','\x20trigger=','Create\x20parent\x20segment\x20\x27','push','information_schema','idStitching','cyan','\x0aChanges\x20to\x20\x27','Personalization\x20service\x20description','scheduleOption','Parent\x20segment:\x20','✔\x20Created\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','realtime_enabled','Show\x20parent\x20segment\x20schema\x20(column\x20types)','all','getOutputDatabaseName','schemaValid','11eQfRXu','td_client_id','formatSchemaJson','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','attributes','\x20RT\x20configuration\x20is\x20valid','Creating','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Apply\x20changes\x20to\x20\x27','timezone','darwin','errors','single','platform','Status:','/app/dw/parentSegments/','coveragePercent','Session:','\x20to\x20configure\x20your\x20personalization\x20service','output','toFixed','Rows:','run','\x0a✔\x20Workflow\x20started','site','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','To\x20view\x20sample\x20data:','✔\x20No\x20changes\x20-\x20\x27','win32','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','✔\x20Renamed\x20directory\x20to\x20','331678EFiGyU','reduce','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','.yml','2681ENVxiE','customerPercent','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','using\x20the\x20default\x20path:\x20','validateParentYaml','type','To\x20cancel:','Error\x20reading\x20file:\x20','web','Next\x20steps:','\x20RT-enabled\x20parent\x20segment','events','json','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Attributes:','Listing\x20parent\x20segments\x20matching\x20\x27','1052991DJAXcK','Options:','isDirectory','\x20=\x20','Personalization:','elapsedTimeMillis','Created','Listing\x20parent\x20segments...','filter','Fetching\x20parent\x20segment\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','No\x20RT-enabled\x20parent\x20segments\x20found','Validating\x20RT\x20configuration...','yes','customerGroupFile','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','\x20No\x20changes\x20-\x20','realtime','session','column_type','table','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','sampleData','\x20rows)'];a30_0x466f=function(){return _0x1c8032;};return a30_0x466f();}export class ParentSegmentFieldsCommand extends BaseCommand{['name']='segment:parent:fields';[a30_0x1cb568(0x1e6)]=a30_0x1cb568(0x1a3);async[a30_0x1cb568(0x1a1)](_0x38e720){const _0x2e0d1e=a30_0x1cb568,{options:_0x5b7e50,args:_0x5b99d4,tdx:_0x3600d6}=_0x38e720,_0x1d7410=_0x5b99d4[0x0]||_0x5b7e50[_0x2e0d1e(0x169)];if(!_0x1d7410)return showParentSegmentNotSetError(_0x2e0d1e(0x1d5)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0x5b7e50[_0x2e0d1e(0x218)]&&(console[_0x2e0d1e(0x19a)](_0x2e0d1e(0x1ca)+_0x5b7e50[_0x2e0d1e(0x29a)]),console['error'](_0x2e0d1e(0x27a)+_0x1d7410));const _0x284bbf=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x1d7410+_0x2e0d1e(0x190),()=>_0x3600d6[_0x2e0d1e(0x1d6)]['listFields'](_0x1d7410),{'verbose':_0x5b7e50[_0x2e0d1e(0x218)]}),_0x4f6584=_0x284bbf[_0x2e0d1e(0x150)];console[_0x2e0d1e(0x19a)]('✔\x20Found\x20'+_0x4f6584['length']+_0x2e0d1e(0x182)+(_0x4f6584[_0x2e0d1e(0x23d)]!==0x1?'s':''));if(_0x5b7e50[_0x2e0d1e(0x124)]||_0x5b7e50[_0x2e0d1e(0x20b)])return await handleSDKOutput(_0x4f6584,_0x5b7e50),0x0;return displayFieldsHumanReadable(_0x4f6584,_0x1d7410),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a30_0x1cb568(0x1de)]='segment:parent:view';[a30_0x1cb568(0x1e6)]='Show\x20parent\x20segment\x20details';async[a30_0x1cb568(0x1a1)](_0x14904d){const _0x457c18=a30_0x1cb568,{options:_0x57ea71,args:_0x80a6a2,tdx:_0x9d0e60}=_0x14904d,_0x1a49ac=_0x57ea71,_0x5c5fd0=_0x80a6a2[0x0]||_0x57ea71[_0x457c18(0x169)];if(!_0x5c5fd0)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+_0x457c18(0x1b7)+_0x457c18(0x1b5)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x57ea71[_0x457c18(0x218)]&&(console['error'](_0x457c18(0x1ca)+_0x57ea71[_0x457c18(0x29a)]),console[_0x457c18(0x19a)](_0x457c18(0x27a)+_0x5c5fd0));const _0x2fc173=await withSpinner(_0x457c18(0x132)+_0x5c5fd0+_0x457c18(0x190),()=>_0x9d0e60[_0x457c18(0x1d6)][_0x457c18(0x17d)](_0x5c5fd0),{'verbose':_0x57ea71[_0x457c18(0x218)]}),_0x13ab22=_0x2fc173[_0x457c18(0x150)];if(_0x1a49ac[_0x457c18(0x120)]){const _0x3c88aa=getConsoleNextUrl(_0x1a49ac[_0x457c18(0x29a)],'/app/dw/parentSegments/'+_0x13ab22['id']);return console[_0x457c18(0x19a)](a30_0x134bc9[_0x457c18(0x1eb)]('✔')+'\x20Opening\x20'+a30_0x134bc9[_0x457c18(0x276)](_0x3c88aa)),openBrowser(_0x3c88aa),0x0;}return await handleSingleObjectOutput(_0x13ab22,_0x57ea71),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a30_0x1cb568(0x1de)]='segment:parent:desc';[a30_0x1cb568(0x1e6)]=a30_0x1cb568(0x27e);async[a30_0x1cb568(0x1a1)](_0x2a3ebe){const _0xcfe4c0=a30_0x1cb568,{options:_0x5cb43c,args:_0x5d129d,tdx:_0x250887}=_0x2a3ebe,_0xc8abf2=_0x5cb43c,_0x255263=_0x5d129d[0x0]||_0x5cb43c[_0xcfe4c0(0x169)];if(!_0x255263)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a'+_0xcfe4c0(0x1c1)+_0xcfe4c0(0x1b5)+_0xcfe4c0(0x285)),0x1;_0x5cb43c[_0xcfe4c0(0x218)]&&(console[_0xcfe4c0(0x19a)]('Site:\x20'+_0x5cb43c[_0xcfe4c0(0x29a)]),console['error'](_0xcfe4c0(0x27a)+_0x255263));const _0x272c27=await withSpinner(_0xcfe4c0(0x173)+_0x255263+_0xcfe4c0(0x190),()=>_0x250887[_0xcfe4c0(0x1d6)][_0xcfe4c0(0x265)](_0x255263),{'verbose':_0x5cb43c[_0xcfe4c0(0x218)]}),_0x22a6a5=_0x272c27[_0xcfe4c0(0x150)],_0xe33727=_0x250887[_0xcfe4c0(0x1d6)][_0xcfe4c0(0x280)](_0x22a6a5);if(_0xc8abf2[_0xcfe4c0(0x295)]){const _0x4cbb79=await this[_0xcfe4c0(0x170)](_0x2a3ebe,_0x255263,_0x22a6a5,_0xe33727),_0x20c146=this[_0xcfe4c0(0x284)](_0x4cbb79);writeFileSync(_0xc8abf2[_0xcfe4c0(0x295)],_0x20c146);const _0x3adf0e=_0x4cbb79['customers'][_0xcfe4c0(0x198)][_0xcfe4c0(0x23d)]+_0x4cbb79['behaviors'][_0xcfe4c0(0x115)]((_0x2a2874,_0x213aaa)=>_0x2a2874+_0x213aaa[_0xcfe4c0(0x198)][_0xcfe4c0(0x23d)],0x0),_0x12e305=_0x4cbb79['behaviors'][_0xcfe4c0(0x131)](_0x1014b1=>_0x1014b1[_0xcfe4c0(0x198)][_0xcfe4c0(0x23d)]===0x0)['length'];return console[_0xcfe4c0(0x151)]('Schema\x20saved\x20to\x20'+_0xc8abf2['output']),console[_0xcfe4c0(0x151)](_0xcfe4c0(0x246)+_0xe33727),console[_0xcfe4c0(0x151)]('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x4cbb79[_0xcfe4c0(0x154)][_0xcfe4c0(0x23d)]+'\x20behaviors'),console[_0xcfe4c0(0x151)](_0xcfe4c0(0x22c)+_0x3adf0e+'\x20total'),_0x12e305>0x0&&console[_0xcfe4c0(0x151)](_0xcfe4c0(0x1e2)+_0x12e305+_0xcfe4c0(0x165)),0x0;}console[_0xcfe4c0(0x19a)]('\x0a'+a30_0x134bc9[_0xcfe4c0(0x144)](_0xcfe4c0(0x270))+'\x20'+a30_0x134bc9['cyan'](_0xe33727));const _0x3ce615=await withSpinner(_0xcfe4c0(0x1ed),()=>_0x250887[_0xcfe4c0(0x1d6)][_0xcfe4c0(0x220)](_0x22a6a5),{'verbose':_0x5cb43c[_0xcfe4c0(0x218)]});console['error']('\x0a'+a30_0x134bc9[_0xcfe4c0(0x144)](_0xcfe4c0(0x232))+'\x20'+a30_0x134bc9[_0xcfe4c0(0x1d0)]('('+_0xe33727+_0xcfe4c0(0x262)));const _0x51c7f4=await executeSchemaQuery(_0x3ce615[_0xcfe4c0(0x150)],_0x250887,_0x5cb43c);await handleQueryOutput(_0x51c7f4,_0x5cb43c);const _0x216a85=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x250887[_0xcfe4c0(0x1d6)][_0xcfe4c0(0x26c)](_0x22a6a5),{'verbose':_0x5cb43c['verbose']});for(const _0x19afc5 of _0x216a85['data']){const _0x141cfc='behavior_'+_0x19afc5['toLowerCase']()[_0xcfe4c0(0x1e3)](/\s+/g,'_'),_0x28157d=_0xcfe4c0(0x243)+_0xe33727+'.'+_0x141cfc;console[_0xcfe4c0(0x19a)]('\x0a'+a30_0x134bc9[_0xcfe4c0(0x144)](_0x19afc5)+'\x20'+a30_0x134bc9[_0xcfe4c0(0x1d0)]('('+_0xe33727+'.'+_0x141cfc+')'));try{const _0x3e924b=await executeSchemaQuery(_0x28157d,_0x250887,_0x5cb43c);await handleQueryOutput(_0x3e924b,_0x5cb43c);}catch{console[_0xcfe4c0(0x19a)](a30_0x134bc9[_0xcfe4c0(0x155)](_0xcfe4c0(0x152)));}}return 0x0;}async[a30_0x1cb568(0x170)](_0x38191a,_0x186413,_0x4ad438,_0x1559e3){const _0x4bc42=a30_0x1cb568,{options:_0x34cc04,tdx:_0x5a13a7}=_0x38191a,_0x304ee8=await withSpinner(_0x4bc42(0x1ed),()=>_0x5a13a7[_0x4bc42(0x1d6)][_0x4bc42(0x220)](_0x4ad438),{'verbose':_0x34cc04['verbose']}),_0x3c5dff=await executeSchemaQuery(_0x304ee8['data'],_0x5a13a7,_0x34cc04),_0x55518b=_0x3c5dff[_0x4bc42(0x150)]['map'](_0x105d2c=>({'name':_0x105d2c[_0x4bc42(0x235)],'type':_0x105d2c[_0x4bc42(0x13c)]})),_0x195340=await withSpinner(_0x4bc42(0x17c),()=>_0x5a13a7[_0x4bc42(0x1d6)][_0x4bc42(0x26c)](_0x4ad438),{'verbose':_0x34cc04['verbose']}),_0xe2d0d8=[];for(const _0x13a0b5 of _0x195340[_0x4bc42(0x150)]){const _0x46f4ab=_0x4bc42(0x153)+_0x13a0b5['toLowerCase']()[_0x4bc42(0x1e3)](/\s+/g,'_'),_0x21cc98=_0x4bc42(0x243)+_0x1559e3+'.'+_0x46f4ab;let _0x17f94e=[];try{const _0x571456=await executeSchemaQuery(_0x21cc98,_0x5a13a7,_0x34cc04);_0x17f94e=_0x571456['data'][_0x4bc42(0x191)](_0x50cb6a=>({'name':_0x50cb6a[_0x4bc42(0x235)],'type':_0x50cb6a[_0x4bc42(0x13c)]}));}catch{}_0xe2d0d8[_0x4bc42(0x273)]({'table':_0x46f4ab,'columns':_0x17f94e});}return{'database':_0x1559e3,'parent_segment':_0x186413,'parent_id':_0x4ad438,'customers':{'table':_0x4bc42(0x232),'columns':_0x55518b},'behaviors':_0xe2d0d8};}[a30_0x1cb568(0x284)](_0x5e34ea){const _0x3ce811=a30_0x1cb568,_0x919a44=_0x44f29e=>{const _0x4ebb3d=a30_0x5c8f;if(_0x44f29e[_0x4ebb3d(0x23d)]===0x0)return'[]';const _0x58d806=_0x44f29e[_0x4ebb3d(0x191)](_0x27b039=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x27b039[_0x4ebb3d(0x1de)]+'\x22,\x20\x22type\x22:\x20\x22'+_0x27b039[_0x4ebb3d(0x11d)]+'\x22\x20}');return'[\x0a'+_0x58d806[_0x4ebb3d(0x257)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x7900d1=_0x5e34ea[_0x3ce811(0x154)][_0x3ce811(0x191)](_0x3afb65=>{const _0x218b55=_0x3ce811;return _0x218b55(0x138)+_0x3afb65[_0x218b55(0x13d)]+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x919a44(_0x3afb65[_0x218b55(0x198)])[_0x218b55(0x1e3)](/^/gm,'\x20\x20')[_0x218b55(0x1c5)]()+_0x218b55(0x1d2);})[_0x3ce811(0x257)](',\x0a');return _0x3ce811(0x223)+_0x5e34ea['database']+_0x3ce811(0x20d)+_0x5e34ea[_0x3ce811(0x1cc)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x5e34ea[_0x3ce811(0x1cb)]+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x5e34ea[_0x3ce811(0x232)][_0x3ce811(0x13d)]+_0x3ce811(0x252)+_0x919a44(_0x5e34ea[_0x3ce811(0x232)][_0x3ce811(0x198)])[_0x3ce811(0x1e3)](/^/gm,'\x20\x20')[_0x3ce811(0x1c5)]()+_0x3ce811(0x1c8)+_0x7900d1+_0x3ce811(0x1f7);}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a30_0x1cb568(0x17f);[a30_0x1cb568(0x1e6)]=a30_0x1cb568(0x159);async[a30_0x1cb568(0x1a1)](_0x1f4738){const _0x345284=a30_0x1cb568,{options:_0xcea5cf,args:_0x45885d,tdx:_0xdff03c}=_0x1f4738,_0xddea02=_0x45885d[0x0]||_0xcea5cf[_0x345284(0x169)];if(!_0xddea02)return showParentSegmentNotSetError(_0x345284(0x18e)+_0x345284(0x1d3)),0x1;_0xcea5cf[_0x345284(0x218)]&&(console[_0x345284(0x19a)](_0x345284(0x1ca)+_0xcea5cf[_0x345284(0x29a)]),console[_0x345284(0x19a)](_0x345284(0x27a)+_0xddea02));const _0x482475=await withSpinner(_0x345284(0x173)+_0xddea02+_0x345284(0x190),()=>_0xdff03c[_0x345284(0x1d6)][_0x345284(0x265)](_0xddea02),{'verbose':_0xcea5cf[_0x345284(0x218)]}),_0x38c735=_0x482475['data'],_0x55fe77=await withSpinner(_0x345284(0x233)+_0xddea02+_0x345284(0x190),()=>_0xdff03c[_0x345284(0x1d6)][_0x345284(0x220)](_0x38c735),{'verbose':_0xcea5cf['verbose']}),_0x43909e=_0x55fe77[_0x345284(0x150)];return _0xcea5cf[_0x345284(0x20c)]===_0x345284(0x124)||_0xcea5cf[_0x345284(0x20c)]===_0x345284(0x20b)?await handleSDKOutput([{'sql':_0x43909e}],_0xcea5cf):console[_0x345284(0x151)](_0x43909e),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a30_0x1cb568(0x1de)]='segment:parent:show';[a30_0x1cb568(0x1e6)]=a30_0x1cb568(0x21a);async[a30_0x1cb568(0x1a1)](_0x1b098d){const _0x22ac90=a30_0x1cb568,{options:_0x1670d0,args:_0x30c291,tdx:_0x211514}=_0x1b098d,_0x5435b4=_0x30c291[0x0]||_0x1670d0[_0x22ac90(0x169)];if(!_0x5435b4)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'+_0x22ac90(0x25b)),0x1;_0x1670d0[_0x22ac90(0x218)]&&(console[_0x22ac90(0x19a)](_0x22ac90(0x1ca)+_0x1670d0[_0x22ac90(0x29a)]),console['error'](_0x22ac90(0x27a)+_0x5435b4));const _0x44995f=await withSpinner(_0x22ac90(0x173)+_0x5435b4+'\x27...',()=>_0x211514[_0x22ac90(0x1d6)][_0x22ac90(0x265)](_0x5435b4),{'verbose':_0x1670d0[_0x22ac90(0x218)]}),_0x51759f=_0x44995f[_0x22ac90(0x150)],_0x7984ef=await withSpinner(_0x22ac90(0x233)+_0x5435b4+'\x27...',()=>_0x211514[_0x22ac90(0x1d6)][_0x22ac90(0x220)](_0x51759f),{'verbose':_0x1670d0[_0x22ac90(0x218)]});let _0x171676=_0x7984ef[_0x22ac90(0x150)];const _0x406f49=resolveLimit(_0x1670d0[_0x22ac90(0x1ab)],DEFAULT_DISPLAY_LIMIT),_0x28da92=/\bLIMIT\s+\d+/i[_0x22ac90(0x23b)](_0x171676);!_0x28da92&&(_0x171676=_0x171676[_0x22ac90(0x1c5)]()[_0x22ac90(0x1e3)](/;+$/,''),_0x171676=_0x22ac90(0x242)+_0x171676+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x406f49);_0x1670d0[_0x22ac90(0x218)]&&console[_0x22ac90(0x19a)](_0x22ac90(0x1ba)+_0x171676);const _0x2faf95=await withProgressSpinner(_0x22ac90(0x164),async _0x2997f3=>{const _0x5e1965=_0x22ac90,_0x53c003=await _0x211514[_0x5e1965(0x1ff)][_0x5e1965(0x1a1)](_0x171676,{'catalog':'td','schema':_0x5e1965(0x274),'onJobId':_0x3510ad=>{const _0x58c7d2=_0x5e1965;_0x2997f3[_0x58c7d2(0x219)](_0x3510ad);}});return _0x53c003;},{'verbose':_0x1670d0[_0x22ac90(0x218)]}),_0x1ffb8d=_0x2faf95['data'],_0x124b25=_0x1ffb8d[_0x22ac90(0x14b)]?_0x22ac90(0x25d)+_0x1ffb8d[_0x22ac90(0x14b)]+']':'';return console[_0x22ac90(0x19a)](_0x22ac90(0x18d)+_0x1ffb8d['stats'][_0x22ac90(0x21e)][_0x22ac90(0x25e)]()+_0x22ac90(0x1c4)+('in\x20'+formatElapsed(_0x1ffb8d[_0x22ac90(0x19d)][_0x22ac90(0x12e)])+_0x124b25)),await handleQueryOutput(_0x1ffb8d,_0x1670d0),0x0;}}export class PSRtListCommand extends BaseCommand{['name']=a30_0x1cb568(0x142);['description']=a30_0x1cb568(0x1e9);async[a30_0x1cb568(0x1a1)](_0x523a6c){const _0x228bb2=a30_0x1cb568,{options:_0x19d672,args:_0x35f6a3,tdx:_0x16b281}=_0x523a6c,_0x3474f9=_0x35f6a3[0x0],_0x2f9941=await withSpinner(_0x3474f9?_0x228bb2(0x1bc)+_0x3474f9+_0x228bb2(0x190):_0x228bb2(0x1bd),()=>_0x16b281['realtime']['list'](),{'verbose':_0x19d672[_0x228bb2(0x218)]});let _0x3a61a9=_0x2f9941[_0x228bb2(0x150)][_0x228bb2(0x131)](_0x5879a1=>_0x5879a1[_0x228bb2(0x27d)]);if(_0x3474f9){const _0x1efed5=_0x3474f9[_0x228bb2(0x1e3)](/[.+^${}()|[\]\\]/g,_0x228bb2(0x1ad))[_0x228bb2(0x1e3)](/\*/g,'.*')[_0x228bb2(0x1e3)](/\?/g,'.'),_0x125152=new RegExp('^'+_0x1efed5+'$','i');_0x3a61a9=_0x3a61a9['filter'](_0x55249d=>_0x125152[_0x228bb2(0x23b)](_0x55249d[_0x228bb2(0x1de)]));}_0x3a61a9[_0x228bb2(0x25c)]((_0x3d7a64,_0x571ce6)=>_0x3d7a64['name'][_0x228bb2(0x1e1)](_0x571ce6[_0x228bb2(0x1de)])),console['error']('✔\x20Found\x20'+_0x3a61a9[_0x228bb2(0x23d)]+_0x228bb2(0x122)+(_0x3a61a9[_0x228bb2(0x23d)]!==0x1?'s':''));const _0x3e7d03=_0x356085=>{const _0x14c17b=_0x228bb2;return getConsoleNextUrl(_0x19d672[_0x14c17b(0x29a)],'/app/dw/parentSegments/'+_0x356085);};if(_0x19d672['format']===_0x228bb2(0x124)||_0x19d672[_0x228bb2(0x20c)]==='jsonl'){const _0x11cb4a=_0x3a61a9[_0x228bb2(0x191)](_0x2867fb=>({..._0x2867fb,'url':_0x3e7d03(_0x2867fb['id'])}));await handleSDKOutput(_0x11cb4a,_0x19d672);}else{if(_0x3a61a9[_0x228bb2(0x23d)]===0x0)console[_0x228bb2(0x151)](_0x228bb2(0x134));else for(const _0x2c63e1 of _0x3a61a9){const _0x4dbf72=_0x2c63e1[_0x228bb2(0x1ec)]?a30_0x134bc9[_0x228bb2(0x1d0)]('\x20('+formatRows(_0x2c63e1[_0x228bb2(0x1ec)])+')'):'',_0x5ec475=hyperlink(_0x2c63e1[_0x228bb2(0x1de)],_0x3e7d03(_0x2c63e1['id']));console['log']('⚡\x20'+_0x5ec475+_0x4dbf72);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a30_0x1cb568(0x1de)]=a30_0x1cb568(0x1e8);[a30_0x1cb568(0x1e6)]='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async[a30_0x1cb568(0x1a1)](_0x16dcb7){const _0x5fd7bb=a30_0x1cb568,{options:_0x5c4e29,args:_0x53995c,tdx:_0x4bc0b7}=_0x16dcb7,_0x5db9a6=_0x53995c[0x0]||_0x5c4e29[_0x5fd7bb(0x169)];if(!_0x5db9a6)return showParentSegmentNotSetError(_0x5fd7bb(0x212)+_0x5fd7bb(0x174)),0x1;const _0x43228a=resolveYamlFile(_0x5db9a6);if(!existsSync(_0x43228a))return showFileNotFoundError(_0x43228a,_0x5db9a6),0x1;let _0x276fa1;try{_0x276fa1=readFileSync(_0x43228a,'utf-8');}catch(_0x3e0d4f){const _0x2fd404=_0x3e0d4f instanceof Error?_0x3e0d4f[_0x5fd7bb(0x22e)]:String(_0x3e0d4f);return console[_0x5fd7bb(0x19a)](_0x5fd7bb(0x11f)+_0x2fd404),0x1;}const _0x1cf076=createCommandSpinner(a30_0x134bc9['dim'](_0x5fd7bb(0x135)),{'verbose':_0x5c4e29[_0x5fd7bb(0x218)]});_0x1cf076[_0x5fd7bb(0x185)]();const _0x3dbbaf={'realtime':!![],'onProgress':_0x47d7b1=>{const _0x121f47=_0x5fd7bb;_0x1cf076[_0x121f47(0x16b)]=formatProgressMessage(_0x47d7b1);}};let _0x2dc41d;try{_0x2dc41d=await _0x4bc0b7[_0x5fd7bb(0x1d6)][_0x5fd7bb(0x11c)](_0x276fa1,_0x3dbbaf),_0x1cf076[_0x5fd7bb(0x251)]();}catch(_0x52c7c4){_0x1cf076[_0x5fd7bb(0x251)]();throw _0x52c7c4;}console['error']('\x0a'+a30_0x134bc9[_0x5fd7bb(0x144)](_0x5fd7bb(0x189))+'\x20'+_0x2dc41d[_0x5fd7bb(0x1de)]),console['error']('═'['repeat'](0x3c)),displayRealtimeValidation(_0x2dc41d),console[_0x5fd7bb(0x19a)]('─'[_0x5fd7bb(0x259)](0x3c));if(_0x2dc41d[_0x5fd7bb(0x28d)]['length']>0x0){console[_0x5fd7bb(0x19a)]('\x0a'+a30_0x134bc9[_0x5fd7bb(0x224)](_0x5fd7bb(0x1f8)));for(const _0x3b59c6 of _0x2dc41d[_0x5fd7bb(0x28d)]){console['error']('\x20\x20'+a30_0x134bc9[_0x5fd7bb(0x224)]('•')+'\x20'+_0x3b59c6);}}return _0x2dc41d['allValid']&&console[_0x5fd7bb(0x19a)]('\x0a'+a30_0x134bc9['green']('✔')+_0x5fd7bb(0x287)),_0x2dc41d[_0x5fd7bb(0x267)]?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{['name']=a30_0x1cb568(0x1c2);['description']=a30_0x1cb568(0x29b);async[a30_0x1cb568(0x1a1)](_0x4b9979){const _0x3842ab=a30_0x1cb568,{options:_0x56b573,args:_0x193659,tdx:_0x5419d5}=_0x4b9979,_0x594ace=_0x193659[0x0]||_0x56b573[_0x3842ab(0x169)];if(!_0x594ace)return showParentSegmentNotSetError(_0x3842ab(0x199)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment'),0x1;const _0x1c8588=await withSpinner(_0x3842ab(0x173)+_0x594ace+_0x3842ab(0x190),()=>_0x5419d5[_0x3842ab(0x1d6)][_0x3842ab(0x265)](_0x594ace),{'verbose':_0x56b573[_0x3842ab(0x218)]}),_0x19d594=_0x1c8588['data'],_0x5b47fd=await withSpinner(_0x3842ab(0x1ae)+_0x594ace+_0x3842ab(0x190),()=>_0x5419d5[_0x3842ab(0x201)][_0x3842ab(0x18a)](_0x19d594),{'verbose':_0x56b573[_0x3842ab(0x218)]}),_0x21f400=_0x5b47fd['data'];console[_0x3842ab(0x19a)](_0x3842ab(0x1c0)+_0x21f400[_0x3842ab(0x23d)]+'\x20personalization\x20service'+(_0x21f400[_0x3842ab(0x23d)]!==0x1?'s':''));if(_0x56b573['format']===_0x3842ab(0x124)||_0x56b573[_0x3842ab(0x20c)]===_0x3842ab(0x20b))await handleSDKOutput(_0x21f400,_0x56b573);else{if(_0x21f400[_0x3842ab(0x23d)]===0x0)console[_0x3842ab(0x151)](_0x3842ab(0x156)),console[_0x3842ab(0x19a)](a30_0x134bc9[_0x3842ab(0x276)](_0x3842ab(0x1f1)));else for(const _0x6a1079 of _0x21f400){const _0x39c34d=_0x6a1079[_0x3842ab(0x1a0)]?.['length']||0x0,_0x5dfcb0=_0x6a1079[_0x3842ab(0x255)]?a30_0x134bc9[_0x3842ab(0x1d0)](_0x3842ab(0x271)+_0x6a1079[_0x3842ab(0x255)]):'',_0x89b0e5=a30_0x134bc9[_0x3842ab(0x1d0)]('\x20('+_0x39c34d+_0x3842ab(0x254)+(_0x39c34d!==0x1?'s':'')+')');console[_0x3842ab(0x151)]('\x20\x20'+_0x6a1079['name']+_0x5dfcb0+_0x89b0e5),_0x6a1079['description']&&console[_0x3842ab(0x151)](_0x3842ab(0x1fd)+a30_0x134bc9[_0x3842ab(0x1d0)](_0x6a1079[_0x3842ab(0x1e6)]));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a30_0x1cb568(0x1de)]=a30_0x1cb568(0x175);[a30_0x1cb568(0x1e6)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a30_0x1cb568(0x1a1)](_0x412c78){const _0x22bf25=a30_0x1cb568,{options:_0x58e91c,args:_0x5301fb}=_0x412c78,_0x39616d=_0x5301fb[0x0]||_0x58e91c[_0x22bf25(0x169)];if(!_0x39616d)return showParentSegmentNotSetError(_0x22bf25(0x146)+_0x22bf25(0x216)),0x1;const _0x45970e=resolveYamlFile(_0x39616d);if(!existsSync(_0x45970e))return showFileNotFoundError(_0x45970e,_0x39616d),0x1;let _0x4baef5;try{_0x4baef5=readFileSync(_0x45970e,'utf-8');}catch(_0x593d38){const _0x49b29c=_0x593d38 instanceof Error?_0x593d38[_0x22bf25(0x22e)]:String(_0x593d38);return console['error'](_0x22bf25(0x11f)+_0x49b29c),0x1;}let _0x3649de;try{_0x3649de=parseDef(_0x4baef5);}catch(_0x2ce6e9){const _0x244c5c=_0x2ce6e9 instanceof Error?_0x2ce6e9[_0x22bf25(0x22e)]:String(_0x2ce6e9);return console['error'](a30_0x134bc9['red'](_0x22bf25(0x141)+_0x244c5c)),0x1;}if(_0x3649de[_0x22bf25(0x231)]&&_0x3649de[_0x22bf25(0x231)]['length']>0x0)return console[_0x22bf25(0x19a)](a30_0x134bc9[_0x22bf25(0x155)]('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0x45970e)),console[_0x22bf25(0x19a)](a30_0x134bc9[_0x22bf25(0x1d0)](_0x22bf25(0x1a5)+_0x3649de[_0x22bf25(0x231)][_0x22bf25(0x23d)]+_0x22bf25(0x1b1))),0x1;!_0x3649de['realtime']&&(_0x3649de[_0x22bf25(0x13a)]={'events':[{'name':'page_view','source_table':_0x22bf25(0x149)}],'attributes':[{'name':_0x22bf25(0x16e),'type':_0x22bf25(0x28e)}],'id_stitching':{'primary_key':_0x3649de[_0x22bf25(0x1be)][_0x22bf25(0x13d)]===_0x22bf25(0x232)?_0x22bf25(0x283):_0x22bf25(0x15f)}});_0x3649de[_0x22bf25(0x231)]=[{'name':_0x22bf25(0x19e),'description':_0x22bf25(0x278),'trigger_event':_0x22bf25(0x1b9),'sections':[{'name':_0x22bf25(0x248),'criteria':_0x22bf25(0x1c9),'attributes':[_0x22bf25(0x16e)]}]}];const _0x510482=serializeDef(_0x3649de);return writeFileSync(_0x45970e,_0x510482,_0x22bf25(0x24f)),console[_0x22bf25(0x19a)](a30_0x134bc9[_0x22bf25(0x1eb)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a30_0x134bc9['cyan'](_0x45970e)),(!_0x3649de[_0x22bf25(0x13a)]||_0x4baef5[_0x22bf25(0x1a9)]('realtime:')===-0x1)&&console['error'](a30_0x134bc9['green']('✔')+_0x22bf25(0x1f2)),console['error']('\x0a'+a30_0x134bc9['dim'](_0x22bf25(0x121))),console[_0x22bf25(0x19a)]('\x20\x201.\x20Edit\x20'+_0x45970e+_0x22bf25(0x294)),console[_0x22bf25(0x19a)](_0x22bf25(0x217)+a30_0x134bc9[_0x22bf25(0x1d0)](_0x22bf25(0x225)+_0x39616d)+_0x22bf25(0x166)),0x0;}}
@@ -1 +1 @@
1
- function a31_0xc694(_0x122579,_0x5a0956){_0x122579=_0x122579-0x70;const _0x44439d=a31_0x4443();let _0xc694d2=_0x44439d[_0x122579];return _0xc694d2;}const a31_0x15bc93=a31_0xc694;(function(_0x63ce3,_0x9f8eb3){const _0x47e095=a31_0xc694,_0x295d96=_0x63ce3();while(!![]){try{const _0x161a97=-parseInt(_0x47e095(0xd1))/0x1*(-parseInt(_0x47e095(0xb7))/0x2)+parseInt(_0x47e095(0x72))/0x3+parseInt(_0x47e095(0xc2))/0x4+parseInt(_0x47e095(0xd8))/0x5+-parseInt(_0x47e095(0x9f))/0x6*(parseInt(_0x47e095(0xd3))/0x7)+parseInt(_0x47e095(0x97))/0x8+parseInt(_0x47e095(0xb4))/0x9*(-parseInt(_0x47e095(0xab))/0xa);if(_0x161a97===_0x9f8eb3)break;else _0x295d96['push'](_0x295d96['shift']());}catch(_0x275dd7){_0x295d96['push'](_0x295d96['shift']());}}}(a31_0x4443,0x4d3d2));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import*as a31_0x665b8f from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a31_0x4443(){const _0x2a678=['Set\x20session\x20profile','apiKey','\x20API\x20key\x20is\x20valid\x20(User:\x20','Setup\x20cancelled','llm_agent','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','66xRDsLq','jobs','profile:use','llm_project','error','oauth','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','tdx:\x20profile\x20create','tdx:\x20profile\x20set','red','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','ERROR','630XfUkKH','test','select','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','method','Enter\x20description\x20(optional):','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','default','\x27\x20requires\x20API\x20key\x20validation.','89595sndttX','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','Operation\x20cancelled','292PkMigc','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','split','text','session','\x27\x20does\x20not\x20exist.\x20Create\x20it?','profile:remove','message','Changing\x20site\x20to\x20\x27','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','length','313504VxEvfJ','Removal\x20cancelled','bold','profile','tdx:\x20profile\x20remove','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Default\x20profile\x20set\x20to:\x20','getUserInfo','Unknown\x20key\x20\x27','Validating\x20API\x20key...','\x20\x20tdx\x20--profile\x20','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','Failed\x20to\x20remove\x20profile:\x20','log','\x0aAvailable\x20profiles:','4038uujhqi','\x27.\x0a\x0aValid\x20keys:\x20','357056cyTCab','validate','Set\x20a\x20profile\x20configuration\x20value','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','2659160WGoHKN','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Session\x20profile\x20set\x20to:\x20','profileName','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','site','create','Enter\x20profile\x20name:','email','logLevel','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','599376BFrJCM','\x0aSetup\x20cancelled','includes','name','description','\x20API\x20key\x20removed\x20from\x20system\x20keychain','Enter\x20your\x20TD\x20API\x20key:','apikey','/app/mp/ak','confirm','status','execute','VALID_KEYS','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','config','yellow','Profile\x20\x27','dim','API\x20key\x20cannot\x20be\x20empty','✗\x20Validation\x20failed:\x20','profile:create','Profile\x20name\x20cannot\x20be\x20empty','\x20Profile\x20\x27','\x27\x20created','\x0aOperation\x20cancelled','join','\x27\x20does\x20not\x20exist.','password','parent_segment','\x27\x20removed\x20from\x20configuration','warn','\x20\x20(no\x20profiles\x20found)','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','green','trim','Create\x20a\x20new\x20profile','Remove\x20a\x20profile','840600SpmhKk','OAuth\x20(browser\x20login)'];a31_0x4443=function(){return _0x2a678;};return a31_0x4443();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a31_0x16b456 from'prompts';import a31_0x4cb704 from'chalk';function validateProfileName(_0x36013c){const _0x3fea3c=a31_0xc694;if(!_0x36013c||!_0x36013c[_0x3fea3c(0x94)]())return _0x3fea3c(0x87);const _0x31bc59=_0x36013c[_0x3fea3c(0x94)]();if(!/^[a-zA-Z0-9_-]+$/[_0x3fea3c(0xac)](_0x31bc59))return _0x3fea3c(0xae);if(profileExists(_0x31bc59))return'Profile\x20\x27'+_0x31bc59+_0x3fea3c(0xb8);return!![];}export class ProfileCreateCommand extends BaseCommand{['name']=a31_0x15bc93(0x86);[a31_0x15bc93(0x76)]=a31_0x15bc93(0x95);async[a31_0x15bc93(0x7d)](_0x3229ce){const _0x208a6c=a31_0x15bc93,{options:_0x55b1ef,args:_0x3b8dd3}=_0x3229ce;console[_0x208a6c(0xcf)](a31_0x4cb704['bold'](_0x208a6c(0xa6)));let _0xd8c981;if(_0x3b8dd3[_0x208a6c(0xc1)]>0x0&&_0x3b8dd3[0x0]){const _0x15e16c=_0x3b8dd3[0x0][_0x208a6c(0x94)](),_0x2359ac=validateProfileName(_0x15e16c);if(_0x2359ac!==!![])return console[_0x208a6c(0xa3)](a31_0x4cb704['red'](_0x2359ac)),0x1;_0xd8c981=_0x15e16c;}else{const _0x544afd=await a31_0x16b456({'type':_0x208a6c(0xba),'name':_0x208a6c(0xdb),'message':_0x208a6c(0xdf),'validate':validateProfileName});if(!_0x544afd['profileName'])return console['log'](_0x208a6c(0x73)),0x1;_0xd8c981=_0x544afd[_0x208a6c(0xdb)][_0x208a6c(0x94)]();}const _0x589001=await a31_0x16b456({'type':_0x208a6c(0xba),'name':_0x208a6c(0x76),'message':_0x208a6c(0xb0)}),_0x407253=_0x589001[_0x208a6c(0x76)]?.[_0x208a6c(0x94)]()||undefined,_0x478fb7=_0x55b1ef['site']||'us01',_0x33d65f=await promptSiteSelection(_0x478fb7,_0xd8c981,_0x208a6c(0x9c));if(!_0x33d65f)return 0x1;const _0x624e96=resolveSite(_0x33d65f);if(isOAuthSupported(_0x624e96)){const _0x46da51=await a31_0x16b456({'type':_0x208a6c(0xad),'name':_0x208a6c(0xaf),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x208a6c(0x98),'value':_0x208a6c(0xa4)},{'title':'API\x20Key','value':_0x208a6c(0x79)}]});if(!_0x46da51['method'])return console[_0x208a6c(0xcf)](_0x208a6c(0x73)),0x1;if(_0x46da51['method']==='oauth'){if(_0x407253){const _0x19669e={'site':_0x624e96,'description':_0x407253};saveProfileToUserConfig(_0xd8c981,_0x19669e);}return await runOAuthLoginFlow(_0x624e96,_0xd8c981,_0x55b1ef[_0x208a6c(0x70)]??LogLevel[_0x208a6c(0xaa)]),0x0;}}console['log'](_0x208a6c(0xa5)+_0x624e96),console[_0x208a6c(0xcf)](_0x208a6c(0xd6)),console[_0x208a6c(0xcf)]('\x20\x20'+getConsoleUrl(_0x624e96,_0x208a6c(0x7a)));const _0x4543bb=await a31_0x16b456({'type':_0x208a6c(0x8d),'name':_0x208a6c(0x9a),'message':_0x208a6c(0x78),'validate':_0x424168=>{const _0x573347=_0x208a6c;if(!_0x424168||!_0x424168['trim']())return _0x573347(0x84);return!![];}});if(!_0x4543bb['apiKey'])return console[_0x208a6c(0xcf)](_0x208a6c(0x73)),0x1;const _0x5696b4=_0x4543bb[_0x208a6c(0x9a)];console[_0x208a6c(0xcf)](_0x208a6c(0xcb));try{const _0xe77b25=TDX['create']({'site':_0x624e96,'apiKey':_0x5696b4['trim'](),'logLevel':_0x55b1ef[_0x208a6c(0x70)]??LogLevel[_0x208a6c(0xaa)]}),_0x473134=await _0xe77b25[_0x208a6c(0xa0)]['getUserInfo']();console[_0x208a6c(0xcf)](a31_0x4cb704[_0x208a6c(0x93)]('✓')+_0x208a6c(0x9b)+_0x473134[_0x208a6c(0xe0)]+')');const _0x3adee0=await isKeychainAvailable();_0x3adee0?(await saveAPIKeyAsync(_0x5696b4[_0x208a6c(0x94)](),_0x624e96,_0xd8c981),console[_0x208a6c(0xcf)](a31_0x4cb704[_0x208a6c(0x93)]('✓')+_0x208a6c(0xdc)+_0xd8c981+')')):(console[_0x208a6c(0x90)](a31_0x4cb704[_0x208a6c(0x81)](_0x208a6c(0xd9))),console[_0x208a6c(0x90)](a31_0x4cb704['yellow'](_0x208a6c(0xc7))));const _0x2ffe6a={'site':_0x624e96,..._0x407253&&{'description':_0x407253}};return saveProfileToUserConfig(_0xd8c981,_0x2ffe6a),console['log'](a31_0x4cb704[_0x208a6c(0x93)]('✓')+_0x208a6c(0x88)+_0xd8c981+_0x208a6c(0x89)),console[_0x208a6c(0xcf)](),console[_0x208a6c(0xcf)](_0x208a6c(0x92)),console['log'](_0x208a6c(0xcc)+_0xd8c981+_0x208a6c(0xc0)),console[_0x208a6c(0xcf)](_0x208a6c(0xcc)+_0xd8c981+_0x208a6c(0xd7)),0x0;}catch(_0x554fa4){if(_0x554fa4 instanceof HTTPClientError&&_0x554fa4[_0x208a6c(0x7c)]===0x191)return printAuthError(_0x554fa4),0x1;return console[_0x208a6c(0xa3)](a31_0x4cb704[_0x208a6c(0xa8)](_0x208a6c(0x85)+(_0x554fa4 instanceof Error?_0x554fa4[_0x208a6c(0xbe)]:String(_0x554fa4)))),console['error']('Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.'),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a31_0x15bc93(0x75)]=a31_0x15bc93(0xbd);[a31_0x15bc93(0x76)]=a31_0x15bc93(0x96);[a31_0x15bc93(0xd4)](_0x3967d6){const _0x16567d=a31_0x15bc93,{args:_0x24a793}=_0x3967d6;if(_0x24a793[_0x16567d(0xc1)]===0x0)return _0x16567d(0x71);return undefined;}async[a31_0x15bc93(0x7d)](_0x4cb690){const _0x14ec0e=a31_0x15bc93,{args:_0x493dc4}=_0x4cb690,_0x4fce8d=_0x493dc4[0x0];console[_0x14ec0e(0xcf)](a31_0x4cb704[_0x14ec0e(0xc4)](_0x14ec0e(0xc6)));if(!profileExists(_0x4fce8d)){console[_0x14ec0e(0xa3)](a31_0x4cb704['red'](_0x14ec0e(0x82)+_0x4fce8d+_0x14ec0e(0x8c))),console[_0x14ec0e(0xcf)]('\x0aAvailable\x20profiles:');const _0x4053f9=listProfiles();if(_0x4053f9[_0x14ec0e(0xc1)]===0x0)console['log'](_0x14ec0e(0x91));else for(const _0x3fd913 of _0x4053f9){console[_0x14ec0e(0xcf)]('\x20\x20-\x20'+_0x3fd913[_0x14ec0e(0x75)]);}return 0x1;}const _0x33b927=await a31_0x16b456({'type':_0x14ec0e(0x7b),'name':_0x14ec0e(0x7b),'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0x4fce8d+'\x27?','initial':![]});if(!_0x33b927['confirm'])return console[_0x14ec0e(0xcf)](_0x14ec0e(0xc3)),0x0;try{removeProfileFromUserConfig(_0x4fce8d),console[_0x14ec0e(0xcf)](a31_0x4cb704[_0x14ec0e(0x93)]('✓')+_0x14ec0e(0x88)+_0x4fce8d+_0x14ec0e(0x8f));}catch(_0x4a348e){return console['error'](a31_0x4cb704[_0x14ec0e(0xa8)](_0x14ec0e(0xce)+(_0x4a348e instanceof Error?_0x4a348e[_0x14ec0e(0xbe)]:String(_0x4a348e)))),0x1;}const _0x477a57=await isKeychainAvailable();if(_0x477a57){const _0x565d44=await deleteKeychainAPIKey(_0x4fce8d);_0x565d44&&console[_0x14ec0e(0xcf)](a31_0x4cb704[_0x14ec0e(0x93)]('✓')+_0x14ec0e(0x77));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a31_0x15bc93(0x75)]='profile:set';[a31_0x15bc93(0x76)]=a31_0x15bc93(0xd5);static [a31_0x15bc93(0x7e)]=[a31_0x15bc93(0xdd),'database',a31_0x15bc93(0x8e),a31_0x15bc93(0xa2),a31_0x15bc93(0x9d),a31_0x15bc93(0x76)];['validate'](_0x18108e){const _0x36fe20=a31_0x15bc93,{args:_0x28dafb,options:_0x56c13b}=_0x18108e,_0x36a1fc=_0x56c13b['profile']||getActiveProfile();if(!_0x36a1fc)return _0x36fe20(0xcd);if(_0x28dafb[_0x36fe20(0xc1)]===0x0)return _0x36fe20(0x7f)+ProfileSetCommand['VALID_KEYS'][_0x36fe20(0x8b)](',\x20');const _0x12e5ef=_0x28dafb[0x0];if(!_0x12e5ef['includes']('='))return _0x36fe20(0xb1)+ProfileSetCommand['VALID_KEYS'][_0x36fe20(0x8b)](',\x20');const [_0x4268e0]=_0x12e5ef['split']('=',0x2);if(!ProfileSetCommand[_0x36fe20(0x7e)][_0x36fe20(0x74)](_0x4268e0))return _0x36fe20(0xca)+_0x4268e0+_0x36fe20(0xd2)+ProfileSetCommand[_0x36fe20(0x7e)]['join'](',\x20');return undefined;}async[a31_0x15bc93(0x7d)](_0x63925d){const _0x18dddb=a31_0x15bc93,{args:_0x1f48c0,options:_0xa878d0}=_0x63925d,_0x47417d=_0xa878d0[_0x18dddb(0xc5)]||getActiveProfile(),[_0x1856b3,..._0x8c2f4e]=_0x1f48c0[0x0][_0x18dddb(0xb9)]('='),_0x293265=_0x8c2f4e[_0x18dddb(0x8b)]('=');console[_0x18dddb(0xcf)](a31_0x4cb704[_0x18dddb(0xc4)](_0x18dddb(0xa7)));if(!profileExists(_0x47417d)){const _0x1f5225=await a31_0x16b456({'type':_0x18dddb(0x7b),'name':_0x18dddb(0xde),'message':_0x18dddb(0x82)+_0x47417d+_0x18dddb(0xbc),'initial':!![]});if(!_0x1f5225[_0x18dddb(0xde)])return console[_0x18dddb(0xcf)](_0x18dddb(0xb6)),0x1;}const _0x582850=loadProfile(_0x47417d),_0x476844=_0x582850?.[_0x18dddb(0x80)]||{};if(_0x1856b3==='site'){const _0x48c0cb=resolveSite(_0x293265);console[_0x18dddb(0xcf)](_0x18dddb(0xbf)+_0x48c0cb+_0x18dddb(0xb3)),console[_0x18dddb(0xcf)](_0x18dddb(0xa9)),console[_0x18dddb(0xcf)]('\x20\x20'+getConsoleUrl(_0x48c0cb,_0x18dddb(0x7a)));const _0x275279=await a31_0x16b456({'type':_0x18dddb(0x8d),'name':_0x18dddb(0x9a),'message':_0x18dddb(0xb5),'validate':_0x5e84f0=>{const _0x197a5b=_0x18dddb;if(!_0x5e84f0||!_0x5e84f0[_0x197a5b(0x94)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x275279[_0x18dddb(0x9a)])return console[_0x18dddb(0xcf)](_0x18dddb(0x8a)),0x1;console[_0x18dddb(0xcf)](_0x18dddb(0xcb));try{const _0x466363=TDX[_0x18dddb(0xde)]({'site':_0x48c0cb,'apiKey':_0x275279[_0x18dddb(0x9a)][_0x18dddb(0x94)](),'logLevel':_0xa878d0[_0x18dddb(0x70)]??LogLevel[_0x18dddb(0xaa)]}),_0x215fed=await _0x466363[_0x18dddb(0xa0)][_0x18dddb(0xc9)]();console[_0x18dddb(0xcf)](a31_0x4cb704['green']('✓')+_0x18dddb(0x9b)+_0x215fed['email']+')');const _0x1f2b49=await isKeychainAvailable();_0x1f2b49?(await saveAPIKeyAsync(_0x275279['apiKey'][_0x18dddb(0x94)](),_0x48c0cb,_0x47417d),console[_0x18dddb(0xcf)](a31_0x4cb704[_0x18dddb(0x93)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain')):console[_0x18dddb(0x90)](a31_0x4cb704['yellow'](_0x18dddb(0xd9))),_0x476844['site']=_0x48c0cb;}catch(_0x144d43){if(_0x144d43 instanceof HTTPClientError&&_0x144d43[_0x18dddb(0x7c)]===0x191)return printAuthError(_0x144d43),0x1;return console[_0x18dddb(0xa3)](a31_0x4cb704['red']('✗\x20Validation\x20failed:\x20'+(_0x144d43 instanceof Error?_0x144d43['message']:String(_0x144d43)))),console[_0x18dddb(0xa3)]('Site\x20was\x20not\x20changed.'),0x1;}}else _0x476844[_0x1856b3]=_0x293265||undefined;return saveProfileToUserConfig(_0x47417d,_0x476844),console[_0x18dddb(0xcf)](a31_0x4cb704[_0x18dddb(0x93)]('✓')+_0x18dddb(0x88)+_0x47417d+'\x27\x20updated:\x20'+_0x1856b3+'='+(_0x293265||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{[a31_0x15bc93(0x75)]=a31_0x15bc93(0xa1);[a31_0x15bc93(0x76)]=a31_0x15bc93(0x99);['validate'](_0x2a2ebf){const _0x2d873a=a31_0x15bc93,{args:_0x312519}=_0x2a2ebf;if(_0x312519[_0x2d873a(0xc1)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]';return undefined;}async[a31_0x15bc93(0x7d)](_0x250a62){const _0x425f97=a31_0x15bc93,{args:_0x15cdd9,options:_0x1e91be}=_0x250a62,_0x436842=_0x15cdd9[0x0],_0xded941=_0x1e91be[_0x425f97(0xb2)];cleanExpiredSessions();if(!profileExists(_0x436842)){console[_0x425f97(0xa3)](a31_0x4cb704[_0x425f97(0xa8)](_0x425f97(0x82)+_0x436842+_0x425f97(0x8c))),console[_0x425f97(0xcf)](_0x425f97(0xd0));const _0x195155=listProfiles();if(_0x195155['length']===0x0)console[_0x425f97(0xcf)](_0x425f97(0x91));else for(const _0x416343 of _0x195155){console[_0x425f97(0xcf)]('\x20\x20-\x20'+_0x416343[_0x425f97(0x75)]);}return 0x1;}if(_0xded941){const _0x4e2f71=a31_0x665b8f[_0x425f97(0x8b)](getConfigDir(),'tdx.json');return saveActiveProfileToUserConfig(_0x436842),console['log'](_0x425f97(0xc8)+a31_0x4cb704[_0x425f97(0x93)](_0x436842)),console[_0x425f97(0xcf)](a31_0x4cb704[_0x425f97(0x83)]('\x0aSaved\x20to:\x20'+_0x4e2f71)),0x0;}const _0x370799=getSessionID(_0x1e91be[_0x425f97(0xbb)]);return saveSessionContext({'profile':_0x436842},_0x1e91be[_0x425f97(0xbb)]),console[_0x425f97(0xcf)](_0x425f97(0xda)+a31_0x4cb704[_0x425f97(0x93)](_0x436842)+'\x20'+a31_0x4cb704['dim']('(session:\x20'+_0x370799+')')),console[_0x425f97(0xcf)](a31_0x4cb704['dim'](_0x425f97(0x9e)+_0x436842+'\x20--default\x27\x20to\x20save\x20permanently')),0x0;}}
1
+ const a31_0x1afa80=a31_0x549d;function a31_0x549d(_0x104f49,_0x47fddf){_0x104f49=_0x104f49-0x179;const _0x2843cf=a31_0x2843();let _0x549d6d=_0x2843cf[_0x104f49];return _0x549d6d;}(function(_0x262fbd,_0x2f15b7){const _0x937dfe=a31_0x549d,_0x3557f2=_0x262fbd();while(!![]){try{const _0x2c4b6a=-parseInt(_0x937dfe(0x1a4))/0x1*(-parseInt(_0x937dfe(0x192))/0x2)+-parseInt(_0x937dfe(0x1da))/0x3*(parseInt(_0x937dfe(0x182))/0x4)+-parseInt(_0x937dfe(0x1a7))/0x5+parseInt(_0x937dfe(0x1e6))/0x6*(parseInt(_0x937dfe(0x1c5))/0x7)+-parseInt(_0x937dfe(0x17c))/0x8+parseInt(_0x937dfe(0x18f))/0x9*(parseInt(_0x937dfe(0x18a))/0xa)+parseInt(_0x937dfe(0x1c2))/0xb;if(_0x2c4b6a===_0x2f15b7)break;else _0x3557f2['push'](_0x3557f2['shift']());}catch(_0x3be6b5){_0x3557f2['push'](_0x3557f2['shift']());}}}(a31_0x2843,0xb974d));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import*as a31_0x460357 from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{runOAuthLoginFlow}from'./auth-login-command.js';function a31_0x2843(){const _0x27ca7c=['apikey','/app/mp/ak','Enter\x20your\x20TD\x20API\x20key:','\x20\x20-\x20','create','logLevel','profile','6720758NJimHa','\x27\x20created','\x27\x20does\x20not\x20exist.','21pUEicQ','red','VALID_KEYS','llm_project','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','tdx:\x20profile\x20remove','\x20\x20(no\x20profiles\x20found)','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','tdx:\x20profile\x20create','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','profile:create','config','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','API\x20Key','oauth','length','Set\x20a\x20profile\x20configuration\x20value','name','getUserInfo','3VUVHkj','message','select','Set\x20session\x20profile','llm_agent','error','yellow','green','\x20API\x20key\x20removed\x20from\x20system\x20keychain','log','\x20\x20tdx\x20--profile\x20','\x0aSetup\x20cancelled','1892322hDHgPM','\x27\x20requires\x20API\x20key\x20validation.','bold','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','trim','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','apiKey','706112XDUQFm','session','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','Profile\x20name\x20cannot\x20be\x20empty','(session:\x20','OAuth\x20(browser\x20login)','5869144qXjLgF','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','ERROR','\x20API\x20key\x20is\x20valid\x20(User:\x20','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','text','Session\x20profile\x20set\x20to:\x20','✗\x20Validation\x20failed:\x20','1070yvzQgs','warn','Validating\x20API\x20key...','\x0aAvailable\x20profiles:','status','49221WpksFq','Default\x20profile\x20set\x20to:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','1282342gfyPqz','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x20--default\x27\x20to\x20save\x20permanently','site','includes','jobs','Enter\x20profile\x20name:','email','tdx:\x20profile\x20set','profile:remove','Profile\x20\x27','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','test','us01','(cleared)','tdx.json','execute','Failed\x20to\x20remove\x20profile:\x20','1PvkdQH','Site\x20was\x20not\x20changed.','\x20Profile\x20\x27','2341570TRyYUq','confirm','default','dim','method','API\x20key\x20cannot\x20be\x20empty','Operation\x20cancelled','\x0aSaved\x20to:\x20','password','\x27\x20does\x20not\x20exist.\x20Create\x20it?','parent_segment','Unknown\x20key\x20\x27','\x27.\x0a\x0aValid\x20keys:\x20','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','profileName','validate','description','join','Setup\x20cancelled','\x20API\x20key\x20saved\x20to\x20system\x20keychain'];a31_0x2843=function(){return _0x27ca7c;};return a31_0x2843();}import{isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a31_0x2a910c from'prompts';import a31_0x4ea699 from'chalk';function validateProfileName(_0x2ce396){const _0x3b4d08=a31_0x549d;if(!_0x2ce396||!_0x2ce396['trim']())return _0x3b4d08(0x17f);const _0x129711=_0x2ce396[_0x3b4d08(0x179)]();if(!/^[a-zA-Z0-9_-]+$/[_0x3b4d08(0x19e)](_0x129711))return'Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore';if(profileExists(_0x129711))return _0x3b4d08(0x19c)+_0x129711+_0x3b4d08(0x186);return!![];}export class ProfileCreateCommand extends BaseCommand{['name']=a31_0x1afa80(0x1d1);[a31_0x1afa80(0x1b7)]='Create\x20a\x20new\x20profile';async[a31_0x1afa80(0x1a2)](_0x47e3db){const _0x4a37e0=a31_0x1afa80,{options:_0x5d849d,args:_0x5235b5}=_0x47e3db;console[_0x4a37e0(0x1e3)](a31_0x4ea699[_0x4a37e0(0x1e8)](_0x4a37e0(0x1ce)));let _0x39358b;if(_0x5235b5[_0x4a37e0(0x1d6)]>0x0&&_0x5235b5[0x0]){const _0xeb3123=_0x5235b5[0x0]['trim'](),_0x113d78=validateProfileName(_0xeb3123);if(_0x113d78!==!![])return console['error'](a31_0x4ea699['red'](_0x113d78)),0x1;_0x39358b=_0xeb3123;}else{const _0x986828=await a31_0x2a910c({'type':_0x4a37e0(0x187),'name':_0x4a37e0(0x1b5),'message':_0x4a37e0(0x198),'validate':validateProfileName});if(!_0x986828[_0x4a37e0(0x1b5)])return console['log'](_0x4a37e0(0x1e5)),0x1;_0x39358b=_0x986828[_0x4a37e0(0x1b5)][_0x4a37e0(0x179)]();}const _0x210dc1=await a31_0x2a910c({'type':_0x4a37e0(0x187),'name':'description','message':'Enter\x20description\x20(optional):'}),_0x5020e2=_0x210dc1[_0x4a37e0(0x1b7)]?.[_0x4a37e0(0x179)]()||undefined,_0x414240=_0x5d849d[_0x4a37e0(0x195)]||_0x4a37e0(0x19f),_0x3ad4f8=await promptSiteSelection(_0x414240,_0x39358b,_0x4a37e0(0x1b9));if(!_0x3ad4f8)return 0x1;const _0x1aa38f=resolveSite(_0x3ad4f8);if(isOAuthSupported(_0x1aa38f)){const _0x33ca02=await a31_0x2a910c({'type':_0x4a37e0(0x1dc),'name':_0x4a37e0(0x1ab),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x4a37e0(0x181),'value':'oauth'},{'title':_0x4a37e0(0x1d4),'value':_0x4a37e0(0x1bb)}]});if(!_0x33ca02[_0x4a37e0(0x1ab)])return console[_0x4a37e0(0x1e3)]('\x0aSetup\x20cancelled'),0x1;if(_0x33ca02[_0x4a37e0(0x1ab)]===_0x4a37e0(0x1d5)){if(_0x5020e2){const _0x1353ff={'site':_0x1aa38f,'description':_0x5020e2};saveProfileToUserConfig(_0x39358b,_0x1353ff);}return await runOAuthLoginFlow(_0x1aa38f,_0x39358b,_0x5d849d[_0x4a37e0(0x1c0)]??LogLevel[_0x4a37e0(0x184)]),0x0;}}console[_0x4a37e0(0x1e3)](_0x4a37e0(0x183)+_0x1aa38f),console[_0x4a37e0(0x1e3)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x4a37e0(0x1e3)]('\x20\x20'+getConsoleUrl(_0x1aa38f,'/app/mp/ak'));const _0x5d629c=await a31_0x2a910c({'type':_0x4a37e0(0x1af),'name':_0x4a37e0(0x17b),'message':_0x4a37e0(0x1bd),'validate':_0x4489b2=>{const _0x3c0a4c=_0x4a37e0;if(!_0x4489b2||!_0x4489b2['trim']())return _0x3c0a4c(0x1ac);return!![];}});if(!_0x5d629c['apiKey'])return console[_0x4a37e0(0x1e3)]('\x0aSetup\x20cancelled'),0x1;const _0x3a72fd=_0x5d629c[_0x4a37e0(0x17b)];console[_0x4a37e0(0x1e3)](_0x4a37e0(0x18c));try{const _0x44d553=TDX[_0x4a37e0(0x1bf)]({'site':_0x1aa38f,'apiKey':_0x3a72fd[_0x4a37e0(0x179)](),'logLevel':_0x5d849d[_0x4a37e0(0x1c0)]??LogLevel[_0x4a37e0(0x184)]}),_0x261e47=await _0x44d553['jobs'][_0x4a37e0(0x1d9)]();console[_0x4a37e0(0x1e3)](a31_0x4ea699[_0x4a37e0(0x1e1)]('✓')+_0x4a37e0(0x185)+_0x261e47['email']+')');const _0x54a845=await isKeychainAvailable();_0x54a845?(await saveAPIKeyAsync(_0x3a72fd['trim'](),_0x1aa38f,_0x39358b),console[_0x4a37e0(0x1e3)](a31_0x4ea699['green']('✓')+_0x4a37e0(0x1cd)+_0x39358b+')')):(console[_0x4a37e0(0x18b)](a31_0x4ea699[_0x4a37e0(0x1e0)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a31_0x4ea699['yellow'](_0x4a37e0(0x1cc))));const _0x5b92f1={'site':_0x1aa38f,..._0x5020e2&&{'description':_0x5020e2}};return saveProfileToUserConfig(_0x39358b,_0x5b92f1),console[_0x4a37e0(0x1e3)](a31_0x4ea699[_0x4a37e0(0x1e1)]('✓')+_0x4a37e0(0x1a6)+_0x39358b+_0x4a37e0(0x1c3)),console[_0x4a37e0(0x1e3)](),console['log'](_0x4a37e0(0x1c9)),console[_0x4a37e0(0x1e3)](_0x4a37e0(0x1e4)+_0x39358b+_0x4a37e0(0x1d3)),console[_0x4a37e0(0x1e3)]('\x20\x20tdx\x20--profile\x20'+_0x39358b+_0x4a37e0(0x1d0)),0x0;}catch(_0x4a0ce7){if(_0x4a0ce7 instanceof HTTPClientError&&_0x4a0ce7[_0x4a37e0(0x18e)]===0x191)return printAuthError(_0x4a0ce7),0x1;return console[_0x4a37e0(0x1df)](a31_0x4ea699[_0x4a37e0(0x1c6)](_0x4a37e0(0x189)+(_0x4a0ce7 instanceof Error?_0x4a0ce7[_0x4a37e0(0x1db)]:String(_0x4a0ce7)))),console['error'](_0x4a37e0(0x17a)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a31_0x1afa80(0x1d8)]=a31_0x1afa80(0x19b);['description']='Remove\x20a\x20profile';[a31_0x1afa80(0x1b6)](_0x366036){const _0x431594=a31_0x1afa80,{args:_0x313c6a}=_0x366036;if(_0x313c6a['length']===0x0)return _0x431594(0x1e9);return undefined;}async[a31_0x1afa80(0x1a2)](_0x119d62){const _0x34ffc2=a31_0x1afa80,{args:_0x18db5c}=_0x119d62,_0x58534e=_0x18db5c[0x0];console['log'](a31_0x4ea699[_0x34ffc2(0x1e8)](_0x34ffc2(0x1ca)));if(!profileExists(_0x58534e)){console[_0x34ffc2(0x1df)](a31_0x4ea699[_0x34ffc2(0x1c6)](_0x34ffc2(0x19c)+_0x58534e+_0x34ffc2(0x1c4))),console[_0x34ffc2(0x1e3)](_0x34ffc2(0x18d));const _0x38328f=listProfiles();if(_0x38328f[_0x34ffc2(0x1d6)]===0x0)console[_0x34ffc2(0x1e3)](_0x34ffc2(0x1cb));else for(const _0x12950c of _0x38328f){console['log']('\x20\x20-\x20'+_0x12950c['name']);}return 0x1;}const _0xb5c589=await a31_0x2a910c({'type':_0x34ffc2(0x1a8),'name':_0x34ffc2(0x1a8),'message':_0x34ffc2(0x191)+_0x58534e+'\x27?','initial':![]});if(!_0xb5c589[_0x34ffc2(0x1a8)])return console['log']('Removal\x20cancelled'),0x0;try{removeProfileFromUserConfig(_0x58534e),console[_0x34ffc2(0x1e3)](a31_0x4ea699[_0x34ffc2(0x1e1)]('✓')+_0x34ffc2(0x1a6)+_0x58534e+'\x27\x20removed\x20from\x20configuration');}catch(_0x21bd1f){return console[_0x34ffc2(0x1df)](a31_0x4ea699[_0x34ffc2(0x1c6)](_0x34ffc2(0x1a3)+(_0x21bd1f instanceof Error?_0x21bd1f['message']:String(_0x21bd1f)))),0x1;}const _0x1edb4e=await isKeychainAvailable();if(_0x1edb4e){const _0x128ba7=await deleteKeychainAPIKey(_0x58534e);_0x128ba7&&console['log'](a31_0x4ea699['green']('✓')+_0x34ffc2(0x1e2));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{['name']='profile:set';['description']=a31_0x1afa80(0x1d7);static [a31_0x1afa80(0x1c7)]=['site','database',a31_0x1afa80(0x1b1),a31_0x1afa80(0x1c8),a31_0x1afa80(0x1de),a31_0x1afa80(0x1b7)];[a31_0x1afa80(0x1b6)](_0x5f2545){const _0x884d00=a31_0x1afa80,{args:_0xb56908,options:_0x4122ab}=_0x5f2545,_0x3aa4f6=_0x4122ab[_0x884d00(0x1c1)]||getActiveProfile();if(!_0x3aa4f6)return'No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>';if(_0xb56908['length']===0x0)return _0x884d00(0x17e)+ProfileSetCommand[_0x884d00(0x1c7)][_0x884d00(0x1b8)](',\x20');const _0x59e906=_0xb56908[0x0];if(!_0x59e906[_0x884d00(0x196)]('='))return _0x884d00(0x193)+ProfileSetCommand[_0x884d00(0x1c7)][_0x884d00(0x1b8)](',\x20');const [_0x3fac11]=_0x59e906['split']('=',0x2);if(!ProfileSetCommand[_0x884d00(0x1c7)][_0x884d00(0x196)](_0x3fac11))return _0x884d00(0x1b2)+_0x3fac11+_0x884d00(0x1b3)+ProfileSetCommand[_0x884d00(0x1c7)]['join'](',\x20');return undefined;}async[a31_0x1afa80(0x1a2)](_0x2ed6dc){const _0x3c4738=a31_0x1afa80,{args:_0x2c032d,options:_0x1be0cc}=_0x2ed6dc,_0x462cac=_0x1be0cc[_0x3c4738(0x1c1)]||getActiveProfile(),[_0x4d015f,..._0x4dbb6e]=_0x2c032d[0x0]['split']('='),_0x3fd442=_0x4dbb6e['join']('=');console[_0x3c4738(0x1e3)](a31_0x4ea699['bold'](_0x3c4738(0x19a)));if(!profileExists(_0x462cac)){const _0x5f4194=await a31_0x2a910c({'type':_0x3c4738(0x1a8),'name':_0x3c4738(0x1bf),'message':'Profile\x20\x27'+_0x462cac+_0x3c4738(0x1b0),'initial':!![]});if(!_0x5f4194[_0x3c4738(0x1bf)])return console['log'](_0x3c4738(0x1ad)),0x1;}const _0x236210=loadProfile(_0x462cac),_0x3bb152=_0x236210?.[_0x3c4738(0x1d2)]||{};if(_0x4d015f==='site'){const _0x5df017=resolveSite(_0x3fd442);console[_0x3c4738(0x1e3)]('Changing\x20site\x20to\x20\x27'+_0x5df017+_0x3c4738(0x1e7)),console[_0x3c4738(0x1e3)](_0x3c4738(0x1b4)),console[_0x3c4738(0x1e3)]('\x20\x20'+getConsoleUrl(_0x5df017,_0x3c4738(0x1bc)));const _0x4a60a8=await a31_0x2a910c({'type':_0x3c4738(0x1af),'name':_0x3c4738(0x17b),'message':_0x3c4738(0x19d),'validate':_0x39033f=>{const _0x5a1279=_0x3c4738;if(!_0x39033f||!_0x39033f['trim']())return _0x5a1279(0x1ac);return!![];}});if(!_0x4a60a8[_0x3c4738(0x17b)])return console[_0x3c4738(0x1e3)]('\x0aOperation\x20cancelled'),0x1;console[_0x3c4738(0x1e3)](_0x3c4738(0x18c));try{const _0x4423ba=TDX[_0x3c4738(0x1bf)]({'site':_0x5df017,'apiKey':_0x4a60a8['apiKey'][_0x3c4738(0x179)](),'logLevel':_0x1be0cc[_0x3c4738(0x1c0)]??LogLevel[_0x3c4738(0x184)]}),_0x5416e3=await _0x4423ba[_0x3c4738(0x197)][_0x3c4738(0x1d9)]();console[_0x3c4738(0x1e3)](a31_0x4ea699[_0x3c4738(0x1e1)]('✓')+_0x3c4738(0x185)+_0x5416e3[_0x3c4738(0x199)]+')');const _0x443db4=await isKeychainAvailable();_0x443db4?(await saveAPIKeyAsync(_0x4a60a8[_0x3c4738(0x17b)][_0x3c4738(0x179)](),_0x5df017,_0x462cac),console[_0x3c4738(0x1e3)](a31_0x4ea699[_0x3c4738(0x1e1)]('✓')+_0x3c4738(0x1ba))):console[_0x3c4738(0x18b)](a31_0x4ea699[_0x3c4738(0x1e0)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x3bb152['site']=_0x5df017;}catch(_0x27f401){if(_0x27f401 instanceof HTTPClientError&&_0x27f401[_0x3c4738(0x18e)]===0x191)return printAuthError(_0x27f401),0x1;return console[_0x3c4738(0x1df)](a31_0x4ea699[_0x3c4738(0x1c6)]('✗\x20Validation\x20failed:\x20'+(_0x27f401 instanceof Error?_0x27f401[_0x3c4738(0x1db)]:String(_0x27f401)))),console[_0x3c4738(0x1df)](_0x3c4738(0x1a5)),0x1;}}else _0x3bb152[_0x4d015f]=_0x3fd442||undefined;return saveProfileToUserConfig(_0x462cac,_0x3bb152),console[_0x3c4738(0x1e3)](a31_0x4ea699[_0x3c4738(0x1e1)]('✓')+'\x20Profile\x20\x27'+_0x462cac+'\x27\x20updated:\x20'+_0x4d015f+'='+(_0x3fd442||_0x3c4738(0x1a0))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a31_0x1afa80(0x1d8)]='profile:use';['description']=a31_0x1afa80(0x1dd);[a31_0x1afa80(0x1b6)](_0x28e518){const _0x4f3df5=a31_0x1afa80,{args:_0x3a3964}=_0x28e518;if(_0x3a3964[_0x4f3df5(0x1d6)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]';return undefined;}async['execute'](_0x1fb511){const _0x1df42a=a31_0x1afa80,{args:_0xede106,options:_0x3d270f}=_0x1fb511,_0x4722a3=_0xede106[0x0],_0x2315ed=_0x3d270f[_0x1df42a(0x1a9)];cleanExpiredSessions();if(!profileExists(_0x4722a3)){console[_0x1df42a(0x1df)](a31_0x4ea699['red'](_0x1df42a(0x19c)+_0x4722a3+'\x27\x20does\x20not\x20exist.')),console[_0x1df42a(0x1e3)](_0x1df42a(0x18d));const _0x39f65b=listProfiles();if(_0x39f65b[_0x1df42a(0x1d6)]===0x0)console[_0x1df42a(0x1e3)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x2fee11 of _0x39f65b){console[_0x1df42a(0x1e3)](_0x1df42a(0x1be)+_0x2fee11[_0x1df42a(0x1d8)]);}return 0x1;}if(_0x2315ed){const _0x55d391=a31_0x460357[_0x1df42a(0x1b8)](getConfigDir(),_0x1df42a(0x1a1));return saveActiveProfileToUserConfig(_0x4722a3),console[_0x1df42a(0x1e3)](_0x1df42a(0x190)+a31_0x4ea699[_0x1df42a(0x1e1)](_0x4722a3)),console['log'](a31_0x4ea699[_0x1df42a(0x1aa)](_0x1df42a(0x1ae)+_0x55d391)),0x0;}const _0x57f0f6=getSessionID(_0x3d270f[_0x1df42a(0x17d)]);return saveSessionContext({'profile':_0x4722a3},_0x3d270f[_0x1df42a(0x17d)]),console[_0x1df42a(0x1e3)](_0x1df42a(0x188)+a31_0x4ea699['green'](_0x4722a3)+'\x20'+a31_0x4ea699[_0x1df42a(0x1aa)](_0x1df42a(0x180)+_0x57f0f6+')')),console['log'](a31_0x4ea699[_0x1df42a(0x1aa)](_0x1df42a(0x1cf)+_0x4722a3+_0x1df42a(0x194))),0x0;}}
@@ -1 +1 @@
1
- const a32_0x13cf56=a32_0x358c;(function(_0x16c1b3,_0x140616){const _0x2ea931=a32_0x358c,_0x239fcc=_0x16c1b3();while(!![]){try{const _0x4a31d8=parseInt(_0x2ea931(0x154))/0x1*(parseInt(_0x2ea931(0x14b))/0x2)+parseInt(_0x2ea931(0x152))/0x3*(-parseInt(_0x2ea931(0x14d))/0x4)+parseInt(_0x2ea931(0x159))/0x5*(parseInt(_0x2ea931(0x14f))/0x6)+-parseInt(_0x2ea931(0x149))/0x7+parseInt(_0x2ea931(0x158))/0x8*(-parseInt(_0x2ea931(0x157))/0x9)+parseInt(_0x2ea931(0x14e))/0xa*(parseInt(_0x2ea931(0x155))/0xb)+parseInt(_0x2ea931(0x153))/0xc*(parseInt(_0x2ea931(0x15a))/0xd);if(_0x4a31d8===_0x140616)break;else _0x239fcc['push'](_0x239fcc['shift']());}catch(_0x439d00){_0x239fcc['push'](_0x239fcc['shift']());}}}(a32_0x1ba4,0xe5a76));function a32_0x358c(_0x51fe69,_0x320db5){_0x51fe69=_0x51fe69-0x141;const _0x1ba4d5=a32_0x1ba4();let _0x358cd7=_0x1ba4d5[_0x51fe69];return _0x358cd7;}function a32_0x1ba4(){const _0x5d939a=['description','log','profiles','name','\x20\x20Global:\x20~/.config/tdx/tdx.json','site','dim','4855172lcSdMA','map','34352TKbjVf','message','428QevjSN','10aMuVnV','6mphhcP','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','List\x20all\x20available\x20profiles','32148jIjGpy','1248oQPfPv','46xMpTzq','2183049VWCssH','config','9IuAHcq','5465728lddMnX','654775AcAIDd','293072iOZVxh','error','green','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','Error:\x20'];a32_0x1ba4=function(){return _0x5d939a;};return a32_0x1ba4();}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import a32_0x43af82 from'chalk';export class ProfilesCommand extends BaseCommand{['name']=a32_0x13cf56(0x144);[a32_0x13cf56(0x142)]=a32_0x13cf56(0x151);async['execute'](_0x1d0a88){const _0x22db81=a32_0x13cf56,{options:_0x38e033}=_0x1d0a88;try{const _0x5e7434=listProfiles(),_0x554ce8=getActiveProfile();if(_0x5e7434['length']===0x0)return console['log'](_0x22db81(0x150)),console[_0x22db81(0x143)](_0x22db81(0x15d)),console[_0x22db81(0x143)](_0x22db81(0x146)),0x0;const _0xb0ba60=_0x5e7434[_0x22db81(0x14a)](_0x183130=>{const _0x3f21c9=_0x22db81,_0x136f69=_0x183130[_0x3f21c9(0x145)]===_0x554ce8,_0x57771b=getProfileParams(_0x183130['config']);return{'name':_0x183130[_0x3f21c9(0x145)],'active':_0x136f69,'scope':_0x183130['scope'],'description':_0x183130[_0x3f21c9(0x156)][_0x3f21c9(0x142)]||'','params':_0x57771b};});if(isStructuredFormat(_0x38e033))await handleSDKOutput(_0xb0ba60,_0x38e033);else for(const _0x8316f4 of _0x5e7434){const _0x1d9ad6=_0x8316f4[_0x22db81(0x145)]===_0x554ce8?a32_0x43af82[_0x22db81(0x15c)]('\x20✓'):'',_0x3f51e2=_0x8316f4[_0x22db81(0x156)][_0x22db81(0x147)]?a32_0x43af82[_0x22db81(0x148)]('\x20'+_0x8316f4[_0x22db81(0x156)][_0x22db81(0x147)]):'',_0x23b4c2=_0x8316f4['config'][_0x22db81(0x142)]?a32_0x43af82[_0x22db81(0x148)]('\x20\x20'+_0x8316f4[_0x22db81(0x156)][_0x22db81(0x142)]):'';console[_0x22db81(0x143)]('👤\x20'+_0x8316f4[_0x22db81(0x145)]+_0x1d9ad6+_0x3f51e2+_0x23b4c2);}return 0x0;}catch(_0x112d8c){return _0x112d8c instanceof Error&&console[_0x22db81(0x15b)](_0x22db81(0x141)+_0x112d8c[_0x22db81(0x14c)]),0x1;}}}
1
+ const a32_0x34dfb8=a32_0x17ee;(function(_0x43995a,_0x2f47e2){const _0x3bc4fd=a32_0x17ee,_0x375816=_0x43995a();while(!![]){try{const _0x2064b6=parseInt(_0x3bc4fd(0x191))/0x1*(parseInt(_0x3bc4fd(0x198))/0x2)+-parseInt(_0x3bc4fd(0x196))/0x3+-parseInt(_0x3bc4fd(0x188))/0x4+parseInt(_0x3bc4fd(0x19c))/0x5*(parseInt(_0x3bc4fd(0x18c))/0x6)+parseInt(_0x3bc4fd(0x195))/0x7*(-parseInt(_0x3bc4fd(0x185))/0x8)+-parseInt(_0x3bc4fd(0x19e))/0x9*(-parseInt(_0x3bc4fd(0x193))/0xa)+parseInt(_0x3bc4fd(0x18a))/0xb;if(_0x2064b6===_0x2f47e2)break;else _0x375816['push'](_0x375816['shift']());}catch(_0x4e124a){_0x375816['push'](_0x375816['shift']());}}}(a32_0x1b97,0x360f3));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a32_0x17ee(_0x49dc16,_0x105982){_0x49dc16=_0x49dc16-0x184;const _0x1b977e=a32_0x1b97();let _0x17ee8d=_0x1b977e[_0x49dc16];return _0x17ee8d;}function a32_0x1b97(){const _0x2cfdda=['error','8057621PUvkwv','message','16566rvYkhA','config','scope','green','\x20\x20Global:\x20~/.config/tdx/tdx.json','1BIXwej','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','998950NWGbmi','site','14QXmzDF','658554vwRtfw','👤\x20','12020JRSCUU','length','dim','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','25pcLwWo','log','27wvzBnK','description','map','execute','868936GWTLBU','List\x20all\x20available\x20profiles','name','1575328QzUWDC'];a32_0x1b97=function(){return _0x2cfdda;};return a32_0x1b97();}import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import a32_0x2f1c02 from'chalk';export class ProfilesCommand extends BaseCommand{[a32_0x34dfb8(0x187)]='profiles';['description']=a32_0x34dfb8(0x186);async[a32_0x34dfb8(0x184)](_0x60ba9e){const _0x50ee2d=a32_0x34dfb8,{options:_0x319568}=_0x60ba9e;try{const _0x412c36=listProfiles(),_0x2fcabd=getActiveProfile();if(_0x412c36[_0x50ee2d(0x199)]===0x0)return console[_0x50ee2d(0x19d)](_0x50ee2d(0x192)),console[_0x50ee2d(0x19d)](_0x50ee2d(0x19b)),console[_0x50ee2d(0x19d)](_0x50ee2d(0x190)),0x0;const _0xdeaa54=_0x412c36[_0x50ee2d(0x1a0)](_0x38471a=>{const _0x575fc1=_0x50ee2d,_0x56fa06=_0x38471a[_0x575fc1(0x187)]===_0x2fcabd,_0x1817be=getProfileParams(_0x38471a[_0x575fc1(0x18d)]);return{'name':_0x38471a[_0x575fc1(0x187)],'active':_0x56fa06,'scope':_0x38471a[_0x575fc1(0x18e)],'description':_0x38471a[_0x575fc1(0x18d)][_0x575fc1(0x19f)]||'','params':_0x1817be};});if(isStructuredFormat(_0x319568))await handleSDKOutput(_0xdeaa54,_0x319568);else for(const _0x5a1289 of _0x412c36){const _0x27531c=_0x5a1289['name']===_0x2fcabd?a32_0x2f1c02[_0x50ee2d(0x18f)]('\x20✓'):'',_0x4e2c69=_0x5a1289[_0x50ee2d(0x18d)][_0x50ee2d(0x194)]?a32_0x2f1c02[_0x50ee2d(0x19a)]('\x20'+_0x5a1289[_0x50ee2d(0x18d)]['site']):'',_0x57d1c2=_0x5a1289[_0x50ee2d(0x18d)][_0x50ee2d(0x19f)]?a32_0x2f1c02[_0x50ee2d(0x19a)]('\x20\x20'+_0x5a1289[_0x50ee2d(0x18d)]['description']):'';console[_0x50ee2d(0x19d)](_0x50ee2d(0x197)+_0x5a1289[_0x50ee2d(0x187)]+_0x27531c+_0x4e2c69+_0x57d1c2);}return 0x0;}catch(_0x3fca6e){return _0x3fca6e instanceof Error&&console[_0x50ee2d(0x189)]('Error:\x20'+_0x3fca6e[_0x50ee2d(0x18b)]),0x1;}}}
@@ -1 +1 @@
1
- function a33_0x4e57(){const _0xd993b8=['processedRows','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','file','setJobId','No\x20SQL\x20provided','originalMessage','\x20splits','\x0aAll\x20results\x20saved\x20to\x20','Schema:\x20','45159bEDrYY','information_schema','Executing\x20query\x20[','8653295iDHSOP','push','86854epNNOU','site','Statement\x20','catalog','...','jobId','Executing\x20statement\x20','elapsedTimeMillis','stats','completedSplits','database','in\x20','state','error','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','setExtra','\x20rows\x20','Site:\x20','6656572ljOpbQ','execute','message','23742464kebEBF','name','args','408lKOxFI','verbose','query','2929329umcuUA','totalSplits','Run\x20Trino\x20queries\x20(streaming)','\x20[Job\x20ID:\x20','Executing\x20query...','output','length','Query\x20completed:\x20Processed\x20','setPhase','15660DDgPcb'];a33_0x4e57=function(){return _0xd993b8;};return a33_0x4e57();}const a33_0x13b3c0=a33_0x50f7;(function(_0x5b935a,_0x4a8f26){const _0x2c16fc=a33_0x50f7,_0x41611a=_0x5b935a();while(!![]){try{const _0x4c8109=parseInt(_0x2c16fc(0x1b3))/0x1+parseInt(_0x2c16fc(0x1b8))/0x2+parseInt(_0x2c16fc(0x1a0))/0x3+-parseInt(_0x2c16fc(0x197))/0x4+parseInt(_0x2c16fc(0x1a9))/0x5*(-parseInt(_0x2c16fc(0x19d))/0x6)+-parseInt(_0x2c16fc(0x1b6))/0x7+parseInt(_0x2c16fc(0x19a))/0x8;if(_0x4c8109===_0x4a8f26)break;else _0x41611a['push'](_0x41611a['shift']());}catch(_0x323fea){_0x41611a['push'](_0x41611a['shift']());}}}(a33_0x4e57,0xe07ed));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';function a33_0x50f7(_0x511320,_0xb7e0aa){_0x511320=_0x511320-0x191;const _0x4e571d=a33_0x4e57();let _0x50f76f=_0x4e571d[_0x511320];return _0x50f76f;}import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a33_0x13b3c0(0x19b)]='query';['description']=a33_0x13b3c0(0x1a2);async['execute'](_0xaf268c){const _0x43d6d9=a33_0x13b3c0,{options:_0x1d5694,args:_0x4d2dbf,tdx:_0x5b0f37}=_0xaf268c,_0xd51b0={..._0x1d5694,'limitStructuredFormats':!![]},_0x5c0884=_0x4d2dbf[0x0],_0x442a26=_0x1d5694[_0x43d6d9(0x1ac)];let _0xa342b6;try{if(_0x442a26)_0xa342b6=readSqlStatementsFromFile(_0x442a26);else{if(_0x5c0884==='-')_0xa342b6=await readSqlStatementsFromStdin();else{if(_0x5c0884&&isSqlFilePath(_0x5c0884))_0xa342b6=readSqlStatementsFromFile(_0x5c0884);else{if(_0x5c0884)_0xa342b6=splitSqlStatements(_0x5c0884);else throw new Error(_0x43d6d9(0x1ae));}}}}catch(_0x5b8373){return console[_0x43d6d9(0x192)]('Error:\x20'+_0x5b8373['message']),0x1;}const _0x3786c5=_0x1d5694[_0x43d6d9(0x1c2)]||_0x43d6d9(0x1b4),_0x2e8426=_0x1d5694[_0x43d6d9(0x1bb)];try{const _0x159a90=[],_0x249a5a=!!_0x1d5694[_0x43d6d9(0x1a5)];for(let _0x43ba60=0x0;_0x43ba60<_0xa342b6[_0x43d6d9(0x1a6)];_0x43ba60++){const _0x5ef660=_0xa342b6[_0x43ba60],_0x3e4783=_0x43ba60+0x1,_0x3eae97=_0xa342b6[_0x43d6d9(0x1a6)],_0x51ca1d=_0x3eae97>0x1;_0x1d5694[_0x43d6d9(0x19e)]&&(console[_0x43d6d9(0x192)]('\x0a'+(_0x51ca1d?_0x43d6d9(0x1ba)+_0x3e4783+'/'+_0x3eae97+':':'')),console[_0x43d6d9(0x192)](_0x43d6d9(0x196)+_0x1d5694[_0x43d6d9(0x1b9)]),console[_0x43d6d9(0x192)]('Catalog:\x20'+(_0x2e8426||'td')),console['error'](_0x43d6d9(0x1b2)+_0x3786c5),console[_0x43d6d9(0x192)]('SQL:\x20'+_0x5ef660));const _0x23590c=_0x51ca1d?_0x43d6d9(0x1be)+_0x3e4783+'/'+_0x3eae97+_0x43d6d9(0x1bc):_0x43d6d9(0x1a4);try{const _0x4a3546=await withProgressSpinner(_0x23590c,async _0xc1c694=>{const _0xe6935c=_0x43d6d9,_0x427272=await _0x5b0f37[_0xe6935c(0x19f)][_0xe6935c(0x198)](_0x5ef660,{'catalog':_0x2e8426,'schema':_0x3786c5,'onJobId':_0xdbbcd=>{const _0x1cfc72=_0xe6935c;_0xc1c694[_0x1cfc72(0x1ad)](_0xdbbcd);},'onProgress':_0xf72971=>{const _0x331719=_0xe6935c;_0xc1c694[_0x331719(0x1a8)](_0x331719(0x1b5)+_0xf72971[_0x331719(0x191)]+']'),_0xc1c694[_0x331719(0x194)](formatRows(_0xf72971[_0x331719(0x1aa)])+'\x20rows\x20'+_0xf72971[_0x331719(0x1c1)]+'/'+_0xf72971[_0x331719(0x1a1)]+_0x331719(0x1b0));}});return _0x427272;},{'verbose':_0x1d5694[_0x43d6d9(0x19e)]}),_0x42427f=_0x4a3546['data'],_0x4aeb0e=_0x42427f[_0x43d6d9(0x1bd)]?_0x43d6d9(0x1a3)+_0x42427f[_0x43d6d9(0x1bd)]+']':'',_0x33591e=_0x51ca1d?_0x43d6d9(0x1ba)+_0x3e4783+'/'+_0x3eae97+'\x20-\x20':'';console[_0x43d6d9(0x192)]('✔\x20'+_0x33591e+_0x43d6d9(0x1a7)+formatRows(_0x42427f[_0x43d6d9(0x1c0)][_0x43d6d9(0x1aa)])+_0x43d6d9(0x195)+(_0x43d6d9(0x1c3)+formatElapsed(_0x42427f[_0x43d6d9(0x1c0)][_0x43d6d9(0x1bf)])+_0x4aeb0e));if(_0x51ca1d&&_0x249a5a){const _0xab0f81=resolveOutputOptions(_0xd51b0),_0x5b740f=await formatQueryOutput(_0x42427f,_0xab0f81);_0x159a90[_0x43d6d9(0x1b7)](_0x5b740f);}else await handleQueryOutput(_0x42427f,_0xd51b0);}catch(_0x28225d){const _0x370a5f=_0x51ca1d?'Statement\x20'+_0x3e4783+'/'+_0x3eae97+':\x0a':'',_0x20dcc1=_0x28225d instanceof SDKError?_0x28225d[_0x43d6d9(0x1af)]:_0x28225d[_0x43d6d9(0x199)];return console['error'](''+_0x370a5f+_0x20dcc1),0x1;}}if(_0xa342b6['length']>0x1&&_0x249a5a&&_0x159a90[_0x43d6d9(0x1a6)]>0x0){const _0x50f623=_0x159a90['join']('\x0a');writeFileSync(_0x1d5694['output'],_0x50f623),console[_0x43d6d9(0x192)](_0x43d6d9(0x1b1)+_0x1d5694[_0x43d6d9(0x1a5)]);}return 0x0;}catch(_0x1cd623){throw _0x1cd623;}}['validate'](_0x10bed4){const _0x3d89e6=a33_0x13b3c0,_0x4cfb92=_0x10bed4[_0x3d89e6(0x19c)][0x0],_0x1ad97e=_0x10bed4['options'][_0x3d89e6(0x1ac)];if(!_0x4cfb92&&!_0x1ad97e)return _0x3d89e6(0x193);if(_0x4cfb92&&_0x1ad97e)return _0x3d89e6(0x1ab);return undefined;}}
1
+ const a33_0x1bfecd=a33_0x40d9;(function(_0x437936,_0x5d2e95){const _0x4d3724=a33_0x40d9,_0xe778c5=_0x437936();while(!![]){try{const _0x517550=parseInt(_0x4d3724(0x1d8))/0x1+parseInt(_0x4d3724(0x1bb))/0x2*(-parseInt(_0x4d3724(0x1b6))/0x3)+-parseInt(_0x4d3724(0x1cd))/0x4*(-parseInt(_0x4d3724(0x1dd))/0x5)+parseInt(_0x4d3724(0x1d5))/0x6+-parseInt(_0x4d3724(0x1c4))/0x7+parseInt(_0x4d3724(0x1c1))/0x8*(-parseInt(_0x4d3724(0x1c5))/0x9)+-parseInt(_0x4d3724(0x1bc))/0xa;if(_0x517550===_0x5d2e95)break;else _0xe778c5['push'](_0xe778c5['shift']());}catch(_0x520129){_0xe778c5['push'](_0xe778c5['shift']());}}}(a33_0x105a,0x985f1));function a33_0x105a(){const _0x5bf9af=['setExtra','setJobId','file','totalSplits','7263804QtHzxU','in\x20','output','187250PtAHZr','completedSplits','Executing\x20query...','Query\x20completed:\x20Processed\x20','length','3588215RkHzwS','\x20splits','elapsedTimeMillis','jobId','description','catalog','push','message','query','args','Executing\x20query\x20[','33567OUzZgc','originalMessage','Catalog:\x20','\x0aAll\x20results\x20saved\x20to\x20','Error:\x20','178tipwty','989830YJcrnL','options','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','Executing\x20statement\x20','execute','16BHtKhq','verbose','Schema:\x20','2262722uSFkNw','330138NNpuob','setPhase','\x20[Job\x20ID:\x20','join','processedRows','database','error','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','4YuQGSv','Site:\x20','stats','\x20rows\x20'];a33_0x105a=function(){return _0x5bf9af;};return a33_0x105a();}import{BaseCommand}from'./command.js';function a33_0x40d9(_0xb3d6ca,_0x54fa45){_0xb3d6ca=_0xb3d6ca-0x1b0;const _0x105a90=a33_0x105a();let _0x40d98f=_0x105a90[_0xb3d6ca];return _0x40d98f;}import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{['name']='query';[a33_0x1bfecd(0x1e1)]='Run\x20Trino\x20queries\x20(streaming)';async[a33_0x1bfecd(0x1c0)](_0x2934fd){const _0x50eaae=a33_0x1bfecd,{options:_0x53355a,args:_0x51ee1c,tdx:_0x1b0fa6}=_0x2934fd,_0xdf026f={..._0x53355a,'limitStructuredFormats':!![]},_0x31e641=_0x51ee1c[0x0],_0x442b83=_0x53355a[_0x50eaae(0x1d3)];let _0x1eec7b;try{if(_0x442b83)_0x1eec7b=readSqlStatementsFromFile(_0x442b83);else{if(_0x31e641==='-')_0x1eec7b=await readSqlStatementsFromStdin();else{if(_0x31e641&&isSqlFilePath(_0x31e641))_0x1eec7b=readSqlStatementsFromFile(_0x31e641);else{if(_0x31e641)_0x1eec7b=splitSqlStatements(_0x31e641);else throw new Error('No\x20SQL\x20provided');}}}}catch(_0x2f1031){return console['error'](_0x50eaae(0x1ba)+_0x2f1031[_0x50eaae(0x1b2)]),0x1;}const _0x327cd4=_0x53355a[_0x50eaae(0x1ca)]||'information_schema',_0x1b57c4=_0x53355a[_0x50eaae(0x1b0)];try{const _0x117467=[],_0x5ac56e=!!_0x53355a[_0x50eaae(0x1d7)];for(let _0xc39cee=0x0;_0xc39cee<_0x1eec7b['length'];_0xc39cee++){const _0x3f7dd6=_0x1eec7b[_0xc39cee],_0x58159b=_0xc39cee+0x1,_0x1bb171=_0x1eec7b['length'],_0x540507=_0x1bb171>0x1;_0x53355a[_0x50eaae(0x1c2)]&&(console[_0x50eaae(0x1cb)]('\x0a'+(_0x540507?'Statement\x20'+_0x58159b+'/'+_0x1bb171+':':'')),console[_0x50eaae(0x1cb)](_0x50eaae(0x1ce)+_0x53355a['site']),console[_0x50eaae(0x1cb)](_0x50eaae(0x1b8)+(_0x1b57c4||'td')),console[_0x50eaae(0x1cb)](_0x50eaae(0x1c3)+_0x327cd4),console[_0x50eaae(0x1cb)]('SQL:\x20'+_0x3f7dd6));const _0x3fec73=_0x540507?_0x50eaae(0x1bf)+_0x58159b+'/'+_0x1bb171+'...':_0x50eaae(0x1da);try{const _0x5b2e36=await withProgressSpinner(_0x3fec73,async _0x2a9260=>{const _0x166725=_0x50eaae,_0x5d5784=await _0x1b0fa6[_0x166725(0x1b3)][_0x166725(0x1c0)](_0x3f7dd6,{'catalog':_0x1b57c4,'schema':_0x327cd4,'onJobId':_0x4f2d7e=>{const _0x3c2d03=_0x166725;_0x2a9260[_0x3c2d03(0x1d2)](_0x4f2d7e);},'onProgress':_0x114ca4=>{const _0xee4022=_0x166725;_0x2a9260[_0xee4022(0x1c6)](_0xee4022(0x1b5)+_0x114ca4['state']+']'),_0x2a9260[_0xee4022(0x1d1)](formatRows(_0x114ca4[_0xee4022(0x1c9)])+_0xee4022(0x1d0)+_0x114ca4[_0xee4022(0x1d9)]+'/'+_0x114ca4[_0xee4022(0x1d4)]+_0xee4022(0x1de));}});return _0x5d5784;},{'verbose':_0x53355a[_0x50eaae(0x1c2)]}),_0x5149e7=_0x5b2e36['data'],_0x2b485b=_0x5149e7[_0x50eaae(0x1e0)]?_0x50eaae(0x1c7)+_0x5149e7[_0x50eaae(0x1e0)]+']':'',_0x4b6b79=_0x540507?'Statement\x20'+_0x58159b+'/'+_0x1bb171+'\x20-\x20':'';console[_0x50eaae(0x1cb)]('✔\x20'+_0x4b6b79+_0x50eaae(0x1db)+formatRows(_0x5149e7[_0x50eaae(0x1cf)][_0x50eaae(0x1c9)])+_0x50eaae(0x1d0)+(_0x50eaae(0x1d6)+formatElapsed(_0x5149e7['stats'][_0x50eaae(0x1df)])+_0x2b485b));if(_0x540507&&_0x5ac56e){const _0x1b54cf=resolveOutputOptions(_0xdf026f),_0x1bd149=await formatQueryOutput(_0x5149e7,_0x1b54cf);_0x117467[_0x50eaae(0x1b1)](_0x1bd149);}else await handleQueryOutput(_0x5149e7,_0xdf026f);}catch(_0x15cf94){const _0x48be60=_0x540507?'Statement\x20'+_0x58159b+'/'+_0x1bb171+':\x0a':'',_0x41d56f=_0x15cf94 instanceof SDKError?_0x15cf94[_0x50eaae(0x1b7)]:_0x15cf94['message'];return console[_0x50eaae(0x1cb)](''+_0x48be60+_0x41d56f),0x1;}}if(_0x1eec7b[_0x50eaae(0x1dc)]>0x1&&_0x5ac56e&&_0x117467['length']>0x0){const _0x175e0d=_0x117467[_0x50eaae(0x1c8)]('\x0a');writeFileSync(_0x53355a[_0x50eaae(0x1d7)],_0x175e0d),console[_0x50eaae(0x1cb)](_0x50eaae(0x1b9)+_0x53355a[_0x50eaae(0x1d7)]);}return 0x0;}catch(_0x43b8f5){throw _0x43b8f5;}}['validate'](_0x496d49){const _0x1bbae0=a33_0x1bfecd,_0xc98ef8=_0x496d49[_0x1bbae0(0x1b4)][0x0],_0x483648=_0x496d49[_0x1bbae0(0x1bd)][_0x1bbae0(0x1d3)];if(!_0xc98ef8&&!_0x483648)return _0x1bbae0(0x1be);if(_0xc98ef8&&_0x483648)return _0x1bbae0(0x1cc);return undefined;}}