@treasuredata/tdx 2026.3.51 → 2026.3.52

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 (218) 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/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/utils.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.js +1 -1
  79. package/dist/proxy/passthrough-server.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/agent/tool-target-registry.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/cas/cas-api-client.js +1 -1
  92. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  93. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  94. package/dist/sdk/cas/index.js +1 -1
  95. package/dist/sdk/cas/pull-workflow.js +1 -1
  96. package/dist/sdk/cas/push-workflow.js +1 -1
  97. package/dist/sdk/client/cdp-api-client.js +1 -1
  98. package/dist/sdk/client/delivery-api-client.js +1 -1
  99. package/dist/sdk/client/endpoints.js +1 -1
  100. package/dist/sdk/client/engage-api-client.js +1 -1
  101. package/dist/sdk/client/http-client.js +1 -1
  102. package/dist/sdk/client/llm-api-client.js +1 -1
  103. package/dist/sdk/client/oauth-refresh.js +1 -1
  104. package/dist/sdk/client/rate-limiter.js +1 -1
  105. package/dist/sdk/client/td-api-client.js +1 -1
  106. package/dist/sdk/client/trino-api-client.js +1 -1
  107. package/dist/sdk/client/workflow-client.js +1 -1
  108. package/dist/sdk/connection-validator.js +1 -1
  109. package/dist/sdk/connection.js +1 -1
  110. package/dist/sdk/delivery.js +1 -1
  111. package/dist/sdk/engage/campaign-pull.js +1 -1
  112. package/dist/sdk/engage/campaign-push.js +1 -1
  113. package/dist/sdk/engage/campaign-validator.js +1 -1
  114. package/dist/sdk/engage/campaign-yaml.js +1 -1
  115. package/dist/sdk/engage/template-pull.js +1 -1
  116. package/dist/sdk/engage/template-push.js +1 -1
  117. package/dist/sdk/engage/template-validator.js +1 -1
  118. package/dist/sdk/engage/template-yaml.js +1 -1
  119. package/dist/sdk/engage/types/campaign-def.js +1 -1
  120. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  121. package/dist/sdk/engage/types/template-schema.js +1 -1
  122. package/dist/sdk/engage.js +1 -1
  123. package/dist/sdk/errors.js +1 -1
  124. package/dist/sdk/index.js +1 -1
  125. package/dist/sdk/io/index.js +1 -1
  126. package/dist/sdk/io/node-filesystem.js +1 -1
  127. package/dist/sdk/job.js +1 -1
  128. package/dist/sdk/journey.js +1 -1
  129. package/dist/sdk/llm/chat-cache.js +1 -1
  130. package/dist/sdk/llm/index.js +1 -1
  131. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  132. package/dist/sdk/llm/model-factors.js +1 -1
  133. package/dist/sdk/personalization.js +1 -1
  134. package/dist/sdk/policy.js +1 -1
  135. package/dist/sdk/query/index.js +1 -1
  136. package/dist/sdk/query/sql-parser.js +1 -1
  137. package/dist/sdk/realtime.js +1 -1
  138. package/dist/sdk/schedule.js +1 -1
  139. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  140. package/dist/sdk/segment/fields-display.js +1 -1
  141. package/dist/sdk/segment/file-discovery.js +1 -1
  142. package/dist/sdk/segment/journey-utils.js +1 -1
  143. package/dist/sdk/segment/journey-validator.js +1 -1
  144. package/dist/sdk/segment/journey-yaml.js +1 -1
  145. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  146. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  147. package/dist/sdk/segment/pull-workflow.js +1 -1
  148. package/dist/sdk/segment/push-recovery.js +1 -1
  149. package/dist/sdk/segment/push-workflow.js +1 -1
  150. package/dist/sdk/segment/resolution-context.js +1 -1
  151. package/dist/sdk/segment/segment-path-parser.js +1 -1
  152. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  153. package/dist/sdk/segment/segment-validator.js +1 -1
  154. package/dist/sdk/segment/target-resolution.js +1 -1
  155. package/dist/sdk/segment/tdx-config.js +1 -1
  156. package/dist/sdk/segment/types/activation-schema.js +1 -1
  157. package/dist/sdk/segment/types/journey-def.js +1 -1
  158. package/dist/sdk/segment/types/journey-schema.js +1 -1
  159. package/dist/sdk/segment/types/segment-def.js +1 -1
  160. package/dist/sdk/segment/types/segment-schema.js +1 -1
  161. package/dist/sdk/segment/validate-files.js +1 -1
  162. package/dist/sdk/segment/yaml-validator.js +1 -1
  163. package/dist/sdk/segment.js +1 -1
  164. package/dist/sdk/types/index.js +1 -1
  165. package/dist/sdk/types/progress.js +1 -1
  166. package/dist/sdk/types/workspace.js +1 -1
  167. package/dist/sdk/user.js +1 -1
  168. package/dist/sdk/util/format-detector.js +1 -1
  169. package/dist/sdk/util/formatters.js +1 -1
  170. package/dist/sdk/util/index.js +1 -1
  171. package/dist/sdk/util/paginate.js +1 -1
  172. package/dist/sdk/util/tree-formatter.js +1 -1
  173. package/dist/sdk/workflow/archive-validation.js +1 -1
  174. package/dist/sdk/workflow/clone-workflow.js +1 -1
  175. package/dist/sdk/workflow/index.js +1 -1
  176. package/dist/sdk/workflow/pull-workflow.js +1 -1
  177. package/dist/sdk/workflow/push-workflow.js +1 -1
  178. package/dist/sdk/workflow/tdx-config.js +1 -1
  179. package/dist/sdk/workflow/workflow-utils.js +1 -1
  180. package/dist/sdk/workspace/frontmatter.js +1 -1
  181. package/dist/sdk/workspace/git.js +1 -1
  182. package/dist/sdk/workspace/index.js +1 -1
  183. package/dist/sdk/workspace/templates.js +1 -1
  184. package/dist/sdk/workspace/weekly.js +1 -1
  185. package/dist/sdk/workspace/wikilinks.js +1 -1
  186. package/dist/test-utils/command-runner.js +1 -1
  187. package/dist/test-utils/factories.js +1 -1
  188. package/dist/test-utils/fixtures.js +1 -1
  189. package/dist/test-utils/http-mock.js +1 -1
  190. package/dist/test-utils/index.js +1 -1
  191. package/dist/utils/async.js +1 -1
  192. package/dist/utils/colors.js +1 -1
  193. package/dist/utils/diff.js +1 -1
  194. package/dist/utils/file-permissions.js +1 -1
  195. package/dist/utils/file-reader.js +1 -1
  196. package/dist/utils/github-releases.js +1 -1
  197. package/dist/utils/global-cache.js +1 -1
  198. package/dist/utils/json-loader.js +1 -1
  199. package/dist/utils/local-cache.js +1 -1
  200. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  201. package/dist/utils/logger/formatters/index.js +1 -1
  202. package/dist/utils/logger/handlers/console-handler.js +1 -1
  203. package/dist/utils/logger/handlers/file-handler.js +1 -1
  204. package/dist/utils/logger/handlers/index.js +1 -1
  205. package/dist/utils/logger/handlers/null-handler.js +1 -1
  206. package/dist/utils/logger/index.js +1 -1
  207. package/dist/utils/logger/logger.js +1 -1
  208. package/dist/utils/logger/types.js +1 -1
  209. package/dist/utils/option-validation.js +1 -1
  210. package/dist/utils/process.js +1 -1
  211. package/dist/utils/prompt.js +1 -1
  212. package/dist/utils/spinner.js +1 -1
  213. package/dist/utils/sse-parser.js +1 -1
  214. package/dist/utils/string-utils.js +1 -1
  215. package/dist/utils/table-ref-parser.js +1 -1
  216. package/dist/utils/tdx-logger.js +1 -1
  217. package/dist/utils/version-check.js +1 -1
  218. package/package.json +1 -1
@@ -1 +1 @@
1
- const a31_0x26e70d=a31_0x17a7;(function(_0x4c5e11,_0x58632c){const _0x3d7745=a31_0x17a7,_0xcec2c2=_0x4c5e11();while(!![]){try{const _0xfb74fa=-parseInt(_0x3d7745(0x3c2))/0x1*(-parseInt(_0x3d7745(0x337))/0x2)+parseInt(_0x3d7745(0x24f))/0x3+-parseInt(_0x3d7745(0x3b3))/0x4+-parseInt(_0x3d7745(0x1c8))/0x5*(-parseInt(_0x3d7745(0x1c7))/0x6)+parseInt(_0x3d7745(0x21c))/0x7*(-parseInt(_0x3d7745(0x317))/0x8)+parseInt(_0x3d7745(0x3c6))/0x9*(-parseInt(_0x3d7745(0x208))/0xa)+-parseInt(_0x3d7745(0x1db))/0xb*(-parseInt(_0x3d7745(0x268))/0xc);if(_0xfb74fa===_0x58632c)break;else _0xcec2c2['push'](_0xcec2c2['shift']());}catch(_0x54f838){_0xcec2c2['push'](_0xcec2c2['shift']());}}}(a31_0x4e5e,0xd92a7));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x527ba0 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,loadJSON}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 a31_0x15f12b from'chalk';function a31_0x17a7(_0x2a109a,_0x5af6b8){_0x2a109a=_0x2a109a-0x1b9;const _0x4e5e46=a31_0x4e5e();let _0x17a7ef=_0x4e5e46[_0x2a109a];return _0x17a7ef;}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=a31_0x26e70d(0x2d5),LEGACY_PARENT_SEGMENT_DIR=a31_0x26e70d(0x30c);function openBrowser(_0x41ebbd){const _0x5af386=a31_0x26e70d,_0x286d3a=process[_0x5af386(0x1ce)],_0x59c6e4=_0x286d3a===_0x5af386(0x339)?_0x5af386(0x205):_0x286d3a===_0x5af386(0x2b9)?'start':_0x5af386(0x1d3);spawn(_0x59c6e4,[_0x41ebbd],{'detached':!![],'stdio':_0x5af386(0x39f)})[_0x5af386(0x1df)]();}function migrateLegacyDirectory(){const _0x36bd5=a31_0x26e70d;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x5e0252=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x5e0252[_0x36bd5(0x2b3)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x36bd5(0x374)](a31_0x15f12b[_0x36bd5(0x1d0)](_0x36bd5(0x2d6)+LEGACY_PARENT_SEGMENT_DIR+_0x36bd5(0x290)+PARENT_SEGMENT_DIR+_0x36bd5(0x39d))),console[_0x36bd5(0x374)](a31_0x15f12b[_0x36bd5(0x291)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x36bd5(0x1e1))),![];console[_0x36bd5(0x374)](a31_0x15f12b[_0x36bd5(0x1d0)](_0x36bd5(0x388)+LEGACY_PARENT_SEGMENT_DIR+_0x36bd5(0x2c3)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x36bd5(0x374)](a31_0x15f12b['green'](_0x36bd5(0x315)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2d6964){const _0x18acf5=_0x2d6964 instanceof Error?_0x2d6964['message']:String(_0x2d6964);return console[_0x36bd5(0x374)](a31_0x15f12b[_0x36bd5(0x397)](_0x36bd5(0x324)+_0x18acf5+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x26e70d(0x272)](_0x195ba1){return migrateLegacyDirectory(),super['run'](_0x195ba1);}}function resolveYamlFile(_0x264e46){const _0x5f55ea=a31_0x26e70d;if(_0x264e46[_0x5f55ea(0x306)](_0x5f55ea(0x1e3))||_0x264e46[_0x5f55ea(0x306)](_0x5f55ea(0x29a)))return _0x264e46;return a31_0x527ba0[_0x5f55ea(0x2c9)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x264e46)+_0x5f55ea(0x1e3));}function formatProgressMessage(_0x3b9c82){const _0x499e9c=a31_0x26e70d,_0x4b64c1=_0x3b9c82[_0x499e9c(0x257)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x4b64c1){const [,_0x26f650,_0x31d687,_0x53df0a='']=_0x4b64c1;return a31_0x15f12b[_0x499e9c(0x291)](_0x26f650+':')+'\x20'+_0x31d687+a31_0x15f12b['dim'](_0x53df0a);}return a31_0x15f12b[_0x499e9c(0x291)](_0x3b9c82);}function showFileNotFoundError(_0x1d53fe,_0x557e62){const _0x38d83b=a31_0x26e70d;console['error'](a31_0x15f12b[_0x38d83b(0x397)](_0x38d83b(0x23a)+_0x1d53fe+'\x0a')),console['error'](a31_0x15f12b['cyan']('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x557e62+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x39f992){const _0x2f5b1c=a31_0x26e70d;if(!_0x39f992[_0x2f5b1c(0x334)])return;const _0x29797c=_0x39f992[_0x2f5b1c(0x334)],_0x589fd0=_0x29797c[_0x2f5b1c(0x2ae)]?a31_0x15f12b['green'](_0x2f5b1c(0x2f6)):a31_0x15f12b[_0x2f5b1c(0x1d0)]('⚡\x20Not\x20enabled');console[_0x2f5b1c(0x374)]('\x0a'+a31_0x15f12b[_0x2f5b1c(0x291)](_0x2f5b1c(0x3a8))+'\x20'+_0x589fd0);if(_0x29797c[_0x2f5b1c(0x302)]&&_0x29797c[_0x2f5b1c(0x302)][_0x2f5b1c(0x1fe)]>0x0){console[_0x2f5b1c(0x374)]('\x20\x20'+a31_0x15f12b[_0x2f5b1c(0x291)](_0x2f5b1c(0x3bd))+'\x20'+_0x29797c[_0x2f5b1c(0x302)][_0x2f5b1c(0x1fe)]+_0x2f5b1c(0x1f6));for(const _0x221d79 of _0x29797c['events']){const _0x25d1d7=_0x221d79[_0x2f5b1c(0x393)]===![]?a31_0x15f12b[_0x2f5b1c(0x397)]('✘'):a31_0x15f12b[_0x2f5b1c(0x37a)]('✔');console[_0x2f5b1c(0x374)](_0x2f5b1c(0x364)+_0x25d1d7+'\x20'+_0x221d79['name']),_0x221d79[_0x2f5b1c(0x371)]&&console[_0x2f5b1c(0x374)](_0x2f5b1c(0x1c4)+a31_0x15f12b[_0x2f5b1c(0x397)](_0x221d79[_0x2f5b1c(0x371)]));}}if(_0x29797c[_0x2f5b1c(0x38c)]&&_0x29797c[_0x2f5b1c(0x38c)][_0x2f5b1c(0x1fe)]>0x0){console[_0x2f5b1c(0x374)]('\x20\x20'+a31_0x15f12b[_0x2f5b1c(0x291)]('Attributes:')+'\x20'+_0x29797c[_0x2f5b1c(0x38c)][_0x2f5b1c(0x1fe)]+_0x2f5b1c(0x1f6));for(const _0x35c192 of _0x29797c[_0x2f5b1c(0x38c)]){const _0x1b34e3=_0x35c192[_0x2f5b1c(0x2a5)]?a31_0x15f12b['green']('✔'):a31_0x15f12b[_0x2f5b1c(0x397)]('✘');console[_0x2f5b1c(0x374)]('\x20\x20\x20\x20'+_0x1b34e3+'\x20'+_0x35c192[_0x2f5b1c(0x2ea)]+'\x20'+a31_0x15f12b[_0x2f5b1c(0x291)]('('+_0x35c192[_0x2f5b1c(0x1fa)]+')'));}}if(_0x29797c[_0x2f5b1c(0x1f5)]){const _0x40e6ac=_0x29797c[_0x2f5b1c(0x1f5)][_0x2f5b1c(0x206)]?.[_0x2f5b1c(0x1fe)]?_0x2f5b1c(0x321)+_0x29797c[_0x2f5b1c(0x1f5)][_0x2f5b1c(0x206)][_0x2f5b1c(0x2c9)](',\x20')+']':'';console[_0x2f5b1c(0x374)]('\x20\x20'+a31_0x15f12b['dim'](_0x2f5b1c(0x322))+'\x20'+_0x29797c['idStitching']['primaryKey']+_0x40e6ac);}if(_0x29797c[_0x2f5b1c(0x1bb)]&&_0x29797c[_0x2f5b1c(0x1bb)][_0x2f5b1c(0x1fe)]>0x0){console['error']('\x20\x20'+a31_0x15f12b[_0x2f5b1c(0x291)](_0x2f5b1c(0x2e0))+'\x20'+_0x29797c[_0x2f5b1c(0x1bb)]['length']+_0x2f5b1c(0x367)+(_0x29797c[_0x2f5b1c(0x1bb)][_0x2f5b1c(0x1fe)]!==0x1?'s':''));for(const _0x28c996 of _0x29797c[_0x2f5b1c(0x1bb)]){console[_0x2f5b1c(0x374)]('\x20\x20\x20\x20-\x20'+_0x28c996[_0x2f5b1c(0x2ea)]);}}}function showParentSegmentNotSetError(_0x2c5943){const _0x9d8eee=a31_0x26e70d;console[_0x9d8eee(0x374)](a31_0x15f12b[_0x9d8eee(0x1d0)](_0x9d8eee(0x312))),console[_0x9d8eee(0x374)](_0x2c5943);}export class ParentSegmentListCommand extends BaseCommand{['name']=a31_0x26e70d(0x2d2);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x201);async['execute'](_0xb9b563){const _0x497590=a31_0x26e70d,{options:_0x330738,args:_0x3d2f87,tdx:_0x2bb7f2}=_0xb9b563,_0x4c9bcc=_0x3d2f87[0x0];_0x330738[_0x497590(0x27d)]&&(console['error'](_0x497590(0x245)+_0x330738['site']),_0x4c9bcc&&console[_0x497590(0x374)](_0x497590(0x3a3)+_0x4c9bcc));const _0x99d735=await withSpinner(_0x4c9bcc?_0x497590(0x384)+_0x4c9bcc+'\x27...':'Listing\x20parent\x20segments...',()=>_0x2bb7f2[_0x497590(0x2c6)][_0x497590(0x2fd)](),{'verbose':_0x330738['verbose']});let _0x1704eb=_0x99d735[_0x497590(0x308)];if(_0x4c9bcc){const _0x52e935=_0x4c9bcc[_0x497590(0x3a6)](/[.+^${}()|[\]\\]/g,_0x497590(0x20c))['replace'](/\*/g,'.*')[_0x497590(0x3a6)](/\?/g,'.'),_0x400ef1=new RegExp('^'+_0x52e935+'$','i');_0x1704eb=_0x1704eb[_0x497590(0x3b4)](_0x4c64b1=>_0x400ef1[_0x497590(0x20e)](_0x4c64b1[_0x497590(0x38c)]['name']));}_0x1704eb[_0x497590(0x21e)]((_0x5eeb55,_0x321ec7)=>_0x5eeb55[_0x497590(0x38c)][_0x497590(0x2ea)]['localeCompare'](_0x321ec7[_0x497590(0x38c)][_0x497590(0x2ea)])),console['error'](_0x497590(0x38d)+_0x1704eb[_0x497590(0x1fe)]+_0x497590(0x230)+(_0x1704eb[_0x497590(0x1fe)]!==0x1?'s':''));const _0x3bd7df=_0x22ff26=>{const _0x12e7d4=_0x497590;return getConsoleNextUrl(_0x330738[_0x12e7d4(0x389)],_0x12e7d4(0x23c)+_0x22ff26);};if(_0x330738[_0x497590(0x2cf)]===_0x497590(0x3bc)||_0x330738[_0x497590(0x2cf)]===_0x497590(0x22c)){const _0x311b35=_0x1704eb[_0x497590(0x239)](_0x296be9=>({..._0x296be9,'url':_0x3bd7df(_0x296be9['id'])}));await handleSDKOutput(_0x311b35,_0x330738);}else{if(_0x1704eb['length']===0x0)_0x4c9bcc?console['log'](_0x497590(0x1be)+_0x4c9bcc):console[_0x497590(0x3a0)]('No\x20parent\x20segments\x20found');else for(const _0x5b68f8 of _0x1704eb){const _0x4004f9=_0x5b68f8['attributes'][_0x497590(0x333)]?a31_0x15f12b[_0x497590(0x291)]('\x20('+formatRows(_0x5b68f8[_0x497590(0x38c)][_0x497590(0x333)])+')'):'',_0x4f25b4=hyperlink(_0x5b68f8[_0x497590(0x38c)][_0x497590(0x2ea)],_0x3bd7df(_0x5b68f8['id']));console[_0x497590(0x3a0)](_0x497590(0x224)+_0x4f25b4+_0x4004f9);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a31_0x26e70d(0x1ef);[a31_0x26e70d(0x368)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0xe00be5){const _0x5540c9=a31_0x26e70d,{options:_0x517755,args:_0xc9b06c,tdx:_0x13dfe4}=_0xe00be5;console[_0x5540c9(0x374)](_0x5540c9(0x23e)+_0x5540c9(0x2f0)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x3b21dc=_0x517755;if(_0xc9b06c['length']===0x0)return console[_0x5540c9(0x374)](a31_0x15f12b[_0x5540c9(0x397)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console['error'](_0x5540c9(0x222)),0x1;const _0x90bdea=_0xc9b06c[0x0];if(!_0x3b21dc[_0x5540c9(0x398)]||!_0x3b21dc['table'])return console[_0x5540c9(0x374)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x5540c9(0x374)](_0x5540c9(0x222)),0x1;_0x3b21dc[_0x5540c9(0x27d)]&&(console['error'](_0x5540c9(0x245)+_0x3b21dc[_0x5540c9(0x389)]),console[_0x5540c9(0x374)](_0x5540c9(0x2da)+_0x90bdea),console[_0x5540c9(0x374)]('Database:\x20'+_0x3b21dc['database']),console['error'](_0x5540c9(0x33d)+_0x3b21dc[_0x5540c9(0x2bd)]));const _0x2c601b=await loadJSONFromOptions(_0x3b21dc[_0x5540c9(0x38c)],_0x3b21dc['attributesFile']),_0x391598=await loadJSONFromOptions(_0x3b21dc[_0x5540c9(0x3bf)],_0x3b21dc['behaviorsFile']),_0x24b015=await loadJSONFromOptions(_0x3b21dc['customerGroup'],_0x3b21dc[_0x5540c9(0x343)]),_0x4684c5={'name':_0x90bdea,'description':_0x3b21dc['description'],'scheduleType':_0x3b21dc[_0x5540c9(0x2f1)],'scheduleOption':_0x3b21dc[_0x5540c9(0x327)],'timezone':_0x3b21dc['timezone'],'master':{'parentDatabaseName':_0x3b21dc['database'],'parentTableName':_0x3b21dc[_0x5540c9(0x2bd)]},'attributes':_0x2c601b,'behaviors':_0x391598,'customerGroup':_0x24b015},_0xba644a=await withSpinner(_0x5540c9(0x351)+_0x90bdea+_0x5540c9(0x1f3),()=>_0x13dfe4[_0x5540c9(0x2c6)][_0x5540c9(0x214)](_0x4684c5),{'verbose':_0x517755['verbose']}),_0x340bb3=_0xba644a['data'];return console[_0x5540c9(0x374)](_0x5540c9(0x232)+_0x340bb3[_0x5540c9(0x2ea)]+'\x27\x20with\x20ID:\x20'+_0x340bb3['id']),await handleSDKOutput([_0x340bb3],_0x517755),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]='segment:parent:update';[a31_0x26e70d(0x368)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0x4c86c7){const _0x3805f1=a31_0x26e70d,{options:_0x4b0b33,args:_0x10d3ea,tdx:_0x5e9a8f}=_0x4c86c7;console[_0x3805f1(0x374)](_0x3805f1(0x301)+_0x3805f1(0x2f0)+_0x3805f1(0x1cb));const _0x2339eb=_0x4b0b33;if(_0x10d3ea[_0x3805f1(0x1fe)]===0x0)return console['error'](a31_0x15f12b['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console['error']('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x4eefc2=_0x10d3ea[0x0];_0x2339eb[_0x3805f1(0x27d)]&&(console['error']('Site:\x20'+_0x2339eb['site']),console[_0x3805f1(0x374)](_0x3805f1(0x1c1)+_0x4eefc2));const _0x360eed=await withSpinner(_0x3805f1(0x1ca)+_0x4eefc2+_0x3805f1(0x1f3),()=>_0x5e9a8f['segment'][_0x3805f1(0x34e)](_0x4eefc2),{'verbose':_0x2339eb[_0x3805f1(0x27d)]}),_0x477de8=_0x360eed['data'],_0x48a538=await loadJSONFromOptions(_0x2339eb['addAttributes'],_0x2339eb[_0x3805f1(0x252)]),_0x5ccc3b=await loadJSONFromOptions(_0x2339eb['addBehaviors'],_0x2339eb[_0x3805f1(0x31a)]),_0x592c34={'name':_0x477de8['name'],'description':_0x2339eb['description']!==undefined?_0x2339eb[_0x3805f1(0x368)]:_0x477de8[_0x3805f1(0x368)],'scheduleType':_0x2339eb['scheduleType']!==undefined?_0x2339eb[_0x3805f1(0x2f1)]:_0x477de8['scheduleType'],'scheduleOption':_0x2339eb[_0x3805f1(0x327)]!==undefined?_0x2339eb['scheduleOption']:_0x477de8[_0x3805f1(0x327)],'timezone':_0x2339eb[_0x3805f1(0x320)]!==undefined?_0x2339eb[_0x3805f1(0x320)]:_0x477de8['timezone'],'master':_0x477de8['master'],'attributes':_0x48a538?[..._0x477de8[_0x3805f1(0x38c)]||[],..._0x48a538]:_0x477de8[_0x3805f1(0x38c)],'behaviors':_0x5ccc3b?[..._0x477de8[_0x3805f1(0x3bf)]||[],..._0x5ccc3b]:_0x477de8[_0x3805f1(0x3bf)],'customerGroup':_0x477de8[_0x3805f1(0x24c)]},_0x198da8=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x4eefc2+_0x3805f1(0x1f3),()=>_0x5e9a8f[_0x3805f1(0x2c6)][_0x3805f1(0x338)](_0x4eefc2,_0x592c34),{'verbose':_0x2339eb[_0x3805f1(0x27d)]}),_0x40c491=_0x198da8[_0x3805f1(0x308)];return console[_0x3805f1(0x374)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x40c491[_0x3805f1(0x2ea)]+'\x27'),await handleSDKOutput([_0x40c491],_0x2339eb),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x26e70d(0x2ea)]=a31_0x26e70d(0x382);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x216);async[a31_0x26e70d(0x220)](_0x46f6b2){const _0x853c86=a31_0x26e70d,{options:_0xe582de,args:_0x3f47be,tdx:_0x41e076}=_0x46f6b2,_0x34c73d=_0xe582de,_0x3434b2=_0x3f47be[0x0]||_0xe582de[_0x853c86(0x352)];if(!_0x3434b2)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+_0x853c86(0x314)),0x1;if(_0x34c73d[_0x853c86(0x278)]&&_0x34c73d[_0x853c86(0x2be)])return console['error'](a31_0x15f12b[_0x853c86(0x397)](_0x853c86(0x29e))),console[_0x853c86(0x374)](a31_0x15f12b[_0x853c86(0x291)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x853c86(0x374)](a31_0x15f12b[_0x853c86(0x291)](_0x853c86(0x1ff)+PARENT_SEGMENT_DIR+_0x853c86(0x313))),console[_0x853c86(0x374)](a31_0x15f12b[_0x853c86(0x1e6)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x5883b4=_0x34c73d[_0x853c86(0x2be)]||a31_0x527ba0[_0x853c86(0x2c9)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3434b2)+_0x853c86(0x1e3));_0x34c73d[_0x853c86(0x27d)]&&(console[_0x853c86(0x374)](_0x853c86(0x245)+_0x34c73d[_0x853c86(0x389)]),console[_0x853c86(0x374)](_0x853c86(0x1c1)+_0x3434b2),console[_0x853c86(0x374)](_0x853c86(0x20a)+_0x5883b4));const _0x146336=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x3434b2+'\x27...',()=>_0x41e076[_0x853c86(0x2c6)]['pullParentYaml'](_0x3434b2),{'verbose':_0x34c73d[_0x853c86(0x27d)]}),_0x33d9bb=_0x146336[_0x853c86(0x308)];if(existsSync(_0x5883b4)){const _0x157558=readFileSync(_0x5883b4,'utf-8'),_0x53480e=generateDiff(_0x157558,_0x33d9bb);if(!hasChanges(_0x53480e))console[_0x853c86(0x374)](a31_0x15f12b['green']('✔')+_0x853c86(0x2e7)+a31_0x15f12b['cyan'](_0x5883b4)+_0x853c86(0x248));else{console[_0x853c86(0x374)]('\x0aChanges\x20to\x20\x27'+_0x5883b4+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x853c86(0x374)](formatDiffWithColors(_0x53480e)),console[_0x853c86(0x374)]('─'[_0x853c86(0x372)](0x3c));if(!_0x34c73d['yes']){if(!isInteractive())return console[_0x853c86(0x374)](a31_0x15f12b[_0x853c86(0x397)]('\x0aError:'),_0x853c86(0x2b1)),console['error'](a31_0x15f12b['dim'](_0x853c86(0x2a6))),0x1;const _0x2b72e4=await confirmKey(_0x853c86(0x3b2)+_0x5883b4+'\x27?');if(!_0x2b72e4)return console[_0x853c86(0x374)](a31_0x15f12b[_0x853c86(0x1d0)](_0x853c86(0x1ed))),0x1;}writeFileSync(_0x5883b4,_0x33d9bb,_0x853c86(0x2f7)),console[_0x853c86(0x374)](a31_0x15f12b[_0x853c86(0x37a)]('✔')+_0x853c86(0x236)+a31_0x15f12b[_0x853c86(0x1e6)](_0x5883b4));}}else{const _0x597cbf=a31_0x527ba0[_0x853c86(0x233)](_0x5883b4);!existsSync(_0x597cbf)&&mkdirSync(_0x597cbf,{'recursive':!![]}),writeFileSync(_0x5883b4,_0x33d9bb,_0x853c86(0x2f7)),console[_0x853c86(0x374)](a31_0x15f12b[_0x853c86(0x37a)]('✔')+_0x853c86(0x236)+a31_0x15f12b[_0x853c86(0x1e6)](_0x5883b4));}return saveSessionContext({'parent_segment':_0x3434b2},_0x34c73d['session']),console[_0x853c86(0x374)](a31_0x15f12b[_0x853c86(0x37a)]('✔')+_0x853c86(0x2b8)+a31_0x15f12b[_0x853c86(0x291)](_0x853c86(0x30c))+_0x853c86(0x30f)+a31_0x15f12b[_0x853c86(0x1e6)](_0x3434b2)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a31_0x26e70d(0x261);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x259);async[a31_0x26e70d(0x220)](_0x4ba2ec){const _0x11a42d=a31_0x26e70d,{options:_0x3f77e5,args:_0x5cf584,tdx:_0x1dfc28}=_0x4ba2ec,_0x137485=_0x3f77e5,_0x37c037=_0x5cf584[0x0]||_0x3f77e5['parentSegment'];if(!_0x37c037)return showParentSegmentNotSetError(_0x11a42d(0x2bf)+_0x11a42d(0x319)),0x1;const _0x58264b=resolveYamlFile(_0x37c037);if(!existsSync(_0x58264b))return showFileNotFoundError(_0x58264b,_0x37c037),0x1;_0x137485[_0x11a42d(0x27d)]&&(console[_0x11a42d(0x374)](_0x11a42d(0x245)+_0x137485[_0x11a42d(0x389)]),console[_0x11a42d(0x374)](_0x11a42d(0x28a)+_0x58264b));let _0x500978;try{_0x500978=readFileSync(_0x58264b,_0x11a42d(0x2f7));}catch(_0x5da8ea){const _0x4677cd=_0x5da8ea instanceof Error?_0x5da8ea[_0x11a42d(0x2de)]:String(_0x5da8ea);return console[_0x11a42d(0x374)](_0x11a42d(0x20d)+_0x4677cd),0x1;}const _0x42817d=await withSpinner(_0x11a42d(0x2c7),()=>_0x1dfc28['segment'][_0x11a42d(0x348)](_0x500978),{'verbose':_0x137485[_0x11a42d(0x27d)]}),_0x2fb89d=_0x42817d['data'],{isNew:_0x388e6a,name:_0x191231,hasChanges:_0x35a379,diffFormatted:_0x192237}=_0x2fb89d;if(!_0x35a379)return console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0x191231+_0x11a42d(0x35f)),0x0;_0x388e6a?console[_0x11a42d(0x374)](_0x11a42d(0x23f)+_0x191231+'\x27:'):console['error'](_0x11a42d(0x3ab)+_0x191231+'\x27:');console[_0x11a42d(0x374)]('─'['repeat'](0x3c)),console[_0x11a42d(0x374)](_0x192237),console[_0x11a42d(0x374)]('─'[_0x11a42d(0x372)](0x3c));const _0x62a551=_0x388e6a?_0x11a42d(0x37f)+_0x191231+'\x27?':_0x11a42d(0x1d9)+_0x191231+'\x27?';if(!_0x137485[_0x11a42d(0x2fc)]){if(!isInteractive())return console[_0x11a42d(0x374)](a31_0x15f12b['red']('\x0aError:'),_0x11a42d(0x2b1)),console[_0x11a42d(0x374)](a31_0x15f12b[_0x11a42d(0x291)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3ad36f=await confirmKey(_0x62a551);if(!_0x3ad36f)return console['error'](a31_0x15f12b[_0x11a42d(0x1d0)]('Aborted.')),0x1;}const _0x503caf=_0x388e6a?_0x11a42d(0x2a0):_0x11a42d(0x211),_0x592ade=await withSpinner(_0x503caf+_0x11a42d(0x375)+_0x191231+_0x11a42d(0x1f3),()=>_0x2fb89d[_0x11a42d(0x2b2)](),{'verbose':_0x137485[_0x11a42d(0x27d)]}),_0x1ac013=_0x592ade[_0x11a42d(0x308)],_0x1827bb=getConsoleNextUrl(_0x137485['site'],_0x11a42d(0x23c)+_0x1ac013['id']),_0x385396=_0x388e6a?_0x11a42d(0x358):_0x11a42d(0x3c0);return console[_0x11a42d(0x374)]('✔\x20'+_0x385396+_0x11a42d(0x375)+_0x1ac013['name']+'\x27'),console[_0x11a42d(0x374)]('\x20\x20'+_0x1827bb),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']='segment:parent:validate';[a31_0x26e70d(0x368)]=a31_0x26e70d(0x346);async[a31_0x26e70d(0x220)](_0x217ed9){const _0x3bc4af=a31_0x26e70d,{options:_0x223727,args:_0x1bdd08,tdx:_0x5af3ac}=_0x217ed9,_0xd33eb3=_0x223727,_0x4d55fc=_0x1bdd08[0x0]||_0x223727[_0x3bc4af(0x352)];if(!_0x4d55fc)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x3bc4af(0x1dd)+_0x3bc4af(0x2ce)+_0x3bc4af(0x298)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x3bc4af(0x299)),0x1;const _0x46a4a0=resolveYamlFile(_0x4d55fc);if(!existsSync(_0x46a4a0))return showFileNotFoundError(_0x46a4a0,_0x4d55fc),0x1;_0xd33eb3[_0x3bc4af(0x27d)]&&(console[_0x3bc4af(0x374)](_0x3bc4af(0x245)+_0xd33eb3[_0x3bc4af(0x389)]),console[_0x3bc4af(0x374)](_0x3bc4af(0x28a)+_0x46a4a0));let _0xc91caa;try{_0xc91caa=readFileSync(_0x46a4a0,_0x3bc4af(0x2f7));}catch(_0x375baf){const _0x5c3851=_0x375baf instanceof Error?_0x375baf[_0x3bc4af(0x2de)]:String(_0x375baf);return console[_0x3bc4af(0x374)](_0x3bc4af(0x20d)+_0x5c3851),0x1;}const _0x11db4c=createCommandSpinner(a31_0x15f12b[_0x3bc4af(0x291)]('Validating\x20configuration...'),{'verbose':_0xd33eb3['verbose']});_0x11db4c[_0x3bc4af(0x26c)]();const _0x1a4699={'onProgress':_0x213a8b=>{const _0x5275c9=_0x3bc4af;_0x11db4c[_0x5275c9(0x1fc)]=formatProgressMessage(_0x213a8b);}};if(_0xd33eb3[_0x3bc4af(0x223)])_0x1a4699['master']=!![];if(_0xd33eb3[_0x3bc4af(0x22f)])_0x1a4699[_0x3bc4af(0x22f)]=!![];_0xd33eb3['attribute']&&(_0x1a4699['attribute']=_0xd33eb3['attribute']);_0xd33eb3[_0x3bc4af(0x1d7)]&&(_0x1a4699[_0x3bc4af(0x1d7)]=_0xd33eb3[_0x3bc4af(0x1d7)]);if(_0xd33eb3[_0x3bc4af(0x2d0)])_0x1a4699['interval']=_0xd33eb3[_0x3bc4af(0x2d0)];let _0x5a18d1;try{_0x5a18d1=await _0x5af3ac[_0x3bc4af(0x2c6)][_0x3bc4af(0x350)](_0xc91caa,_0x1a4699),_0x11db4c[_0x3bc4af(0x3ad)]();}catch(_0x2ff2bd){_0x11db4c[_0x3bc4af(0x3ad)]();throw _0x2ff2bd;}const _0x306204=_0xd33eb3[_0x3bc4af(0x2d0)]||_0x3bc4af(0x2db);return this[_0x3bc4af(0x340)](_0x5a18d1,_0x1a4699,_0x46a4a0,_0x306204),_0x5a18d1['allValid']?0x0:0x1;}['displayValidateResults'](_0xa3579a,_0x1efc5a,_0xe4c74,_0x377fe3){const _0x2c8884=a31_0x26e70d;console[_0x2c8884(0x374)]('\x0a'+a31_0x15f12b[_0x2c8884(0x297)](_0x2c8884(0x1e4))+'\x20'+_0xa3579a[_0x2c8884(0x2ea)]),console[_0x2c8884(0x374)]('═'[_0x2c8884(0x372)](0x3c)),this[_0x2c8884(0x32e)](_0xa3579a);if(typeof _0x1efc5a[_0x2c8884(0x28f)]==='string'){this['displayAttributesStats'](_0xa3579a),this['displaySummary'](_0xa3579a),this[_0x2c8884(0x1ea)](_0xe4c74,_0x377fe3,_0x2c8884(0x28f),_0x1efc5a[_0x2c8884(0x28f)]);return;}if(_0x1efc5a[_0x2c8884(0x28f)]===!![]){this[_0x2c8884(0x231)](_0xa3579a),this[_0x2c8884(0x22b)](_0xa3579a),this[_0x2c8884(0x1ea)](_0xe4c74,_0x377fe3,_0x2c8884(0x38c));return;}if(typeof _0x1efc5a[_0x2c8884(0x1d7)]===_0x2c8884(0x36c)){this['displayBehaviorsStats'](_0xa3579a,_0x377fe3),this[_0x2c8884(0x22b)](_0xa3579a),this[_0x2c8884(0x1ea)](_0xe4c74,_0x377fe3,_0x2c8884(0x1d7),_0x1efc5a[_0x2c8884(0x1d7)]);return;}if(_0x1efc5a[_0x2c8884(0x1d7)]===!![]){this['displayBehaviorsStats'](_0xa3579a,_0x377fe3),this[_0x2c8884(0x22b)](_0xa3579a),this['displayPreviewHints'](_0xe4c74,_0x377fe3,_0x2c8884(0x3bf));return;}this[_0x2c8884(0x231)](_0xa3579a),this[_0x2c8884(0x1b9)](_0xa3579a,_0x377fe3),this[_0x2c8884(0x2c5)](_0xa3579a),this['displaySummary'](_0xa3579a),this[_0x2c8884(0x1ea)](_0xe4c74,_0x377fe3,_0x2c8884(0x2c0));}['displayRealtimeInfo'](_0x345e42){displayRealtimeValidation(_0x345e42);}[a31_0x26e70d(0x1ea)](_0x5dd872,_0x2ac033,_0x519e28,_0x4d0277){const _0x2cda01=a31_0x26e70d;console[_0x2cda01(0x374)]('\x0a'+a31_0x15f12b[_0x2cda01(0x291)](_0x2cda01(0x262)));const _0x2d47f0=_0x2ac033!==_0x2cda01(0x2db)?_0x2cda01(0x3b5)+_0x2ac033:'';if(_0x519e28===_0x2cda01(0x28f)&&_0x4d0277)console['error']('\x20\x20'+a31_0x15f12b['dim'](_0x2cda01(0x294)+_0x5dd872+_0x2cda01(0x2e9)+_0x4d0277+'\x22'+_0x2d47f0));else{if(_0x519e28===_0x2cda01(0x1d7)&&_0x4d0277)console[_0x2cda01(0x374)]('\x20\x20'+a31_0x15f12b[_0x2cda01(0x291)]('tdx\x20ps\x20preview\x20'+_0x5dd872+_0x2cda01(0x31c)+_0x4d0277+'\x22'+_0x2d47f0));else(_0x519e28===_0x2cda01(0x38c)||_0x519e28===_0x2cda01(0x2c0))&&console[_0x2cda01(0x374)]('\x20\x20'+a31_0x15f12b[_0x2cda01(0x291)]('tdx\x20ps\x20preview\x20'+_0x5dd872+'\x20--attribute\x20\x22<name>\x22'+_0x2d47f0));}(_0x519e28==='behaviors'||_0x519e28===_0x2cda01(0x2c0))&&console[_0x2cda01(0x374)]('\x20\x20'+a31_0x15f12b[_0x2cda01(0x291)]('tdx\x20ps\x20preview\x20'+_0x5dd872+_0x2cda01(0x1de)+_0x2d47f0)),_0x519e28===_0x2cda01(0x2c0)&&console[_0x2cda01(0x374)]('\x20\x20'+a31_0x15f12b['dim'](_0x2cda01(0x294)+_0x5dd872+'\x20--enriched'+_0x2d47f0));}[a31_0x26e70d(0x32e)](_0x18c345){const _0x5abd21=a31_0x26e70d,{master:_0x2095dc}=_0x18c345,_0xb99ec4=_0x2095dc[_0x5abd21(0x28d)]?a31_0x15f12b[_0x5abd21(0x37a)]('✔'):a31_0x15f12b[_0x5abd21(0x397)]('✘');console[_0x5abd21(0x374)]('\x0a'+a31_0x15f12b[_0x5abd21(0x291)](_0x5abd21(0x31d))),console[_0x5abd21(0x374)](_0xb99ec4+'\x20'+a31_0x15f12b['bold'](_0x2095dc[_0x5abd21(0x398)]+'.'+_0x2095dc['table'])),_0x2095dc['schemaValid']?_0x2095dc['rowCount']!==undefined&&console[_0x5abd21(0x374)]('\x20\x20'+a31_0x15f12b[_0x5abd21(0x291)](_0x5abd21(0x1e8))+'\x20'+a31_0x15f12b[_0x5abd21(0x1e6)](formatRows(_0x2095dc[_0x5abd21(0x34c)]))):console[_0x5abd21(0x374)]('\x20\x20'+a31_0x15f12b['red'](_0x5abd21(0x3ae))+'\x20'+_0x2095dc[_0x5abd21(0x234)]);}['displayAttributesStats'](_0xaf9a41){const _0xc4d063=a31_0x26e70d;if(_0xaf9a41['attributes'][_0xc4d063(0x1fe)]===0x0)return;console[_0xc4d063(0x374)]('\x0a'+a31_0x15f12b[_0xc4d063(0x291)](_0xc4d063(0x38a)));for(const _0x23657c of _0xaf9a41['attributes']){const _0x471c09=_0x23657c[_0xc4d063(0x28d)]?a31_0x15f12b[_0xc4d063(0x37a)]('✔'):a31_0x15f12b['red']('✘');let _0x41a94f='';if(_0x23657c[_0xc4d063(0x28d)]&&_0x23657c[_0xc4d063(0x207)]!==undefined&&_0x23657c[_0xc4d063(0x37d)]!==undefined){const _0x47df08=_0x23657c['coveragePercent'][_0xc4d063(0x26a)](0x1),_0xfb54a7=_0x23657c[_0xc4d063(0x37d)]>=0x50?a31_0x15f12b[_0xc4d063(0x37a)]:_0x23657c[_0xc4d063(0x37d)]>=0x32?a31_0x15f12b[_0xc4d063(0x1d0)]:a31_0x15f12b[_0xc4d063(0x397)];_0x41a94f='\x20'+a31_0x15f12b[_0xc4d063(0x291)](_0xc4d063(0x22a))+'\x20'+_0xfb54a7(_0x47df08+'%')+'\x20('+formatRows(_0x23657c[_0xc4d063(0x207)])+'\x20rows)';}console['error'](_0x471c09+'\x20'+a31_0x15f12b['bold'](_0x23657c[_0xc4d063(0x2ea)])+_0x41a94f),console[_0xc4d063(0x374)]('\x20\x20'+a31_0x15f12b[_0xc4d063(0x291)](_0xc4d063(0x379))+'\x20'+a31_0x15f12b[_0xc4d063(0x297)](_0x23657c[_0xc4d063(0x398)]+'.'+_0x23657c[_0xc4d063(0x2bd)]));const _0x232ae8=_0x23657c[_0xc4d063(0x215)]===_0x23657c[_0xc4d063(0x266)]?a31_0x15f12b['dim'](_0xc4d063(0x31b))+'\x20'+_0x23657c[_0xc4d063(0x215)]:a31_0x15f12b[_0xc4d063(0x291)](_0xc4d063(0x329))+'\x20'+_0x23657c['joinKey']+'\x20=\x20'+_0x23657c['foreignKey'];console['error']('\x20\x20'+_0x232ae8),console[_0xc4d063(0x374)]('\x20\x20'+a31_0x15f12b[_0xc4d063(0x291)](_0xc4d063(0x265))),this['displayColumns'](_0x23657c[_0xc4d063(0x273)]),!_0x23657c['schemaValid']&&console[_0xc4d063(0x374)]('\x20\x20'+a31_0x15f12b[_0xc4d063(0x397)](_0xc4d063(0x3ae))+'\x20'+_0x23657c[_0xc4d063(0x234)]);}}[a31_0x26e70d(0x1b9)](_0x596a2e,_0x582dda){const _0x553292=a31_0x26e70d;if(_0x596a2e[_0x553292(0x3bf)][_0x553292(0x1fe)]===0x0)return;console['error']('\x0a'+a31_0x15f12b[_0x553292(0x291)]('Behaviors')+'\x20'+a31_0x15f12b[_0x553292(0x291)]('('+_0x582dda+')'));for(const _0x2bc892 of _0x596a2e[_0x553292(0x3bf)]){const _0x245713=_0x2bc892[_0x553292(0x28d)]?a31_0x15f12b['green']('✔'):a31_0x15f12b[_0x553292(0x397)]('✘');let _0x1bca90='';if(_0x2bc892[_0x553292(0x28d)]&&_0x2bc892[_0x553292(0x2af)]!==undefined&&_0x2bc892['totalEvents']!==undefined){const _0xb2bdb3=_0x2bc892[_0x553292(0x2cd)]?.[_0x553292(0x26a)](0x1)||'?',_0x2b0de2=(_0x2bc892[_0x553292(0x2cd)]??0x0)>=0x32?a31_0x15f12b['green']:(_0x2bc892[_0x553292(0x2cd)]??0x0)>=0x14?a31_0x15f12b[_0x553292(0x1d0)]:a31_0x15f12b[_0x553292(0x397)];_0x1bca90='\x20'+a31_0x15f12b['dim'](_0x553292(0x1e5))+'\x20'+_0x2b0de2(formatRows(_0x2bc892[_0x553292(0x2af)]))+'\x20('+_0xb2bdb3+'%)\x20'+a31_0x15f12b['dim'](_0x553292(0x3bd))+'\x20'+a31_0x15f12b[_0x553292(0x1e6)](formatRows(_0x2bc892[_0x553292(0x2bc)]));}console['error'](_0x245713+'\x20'+a31_0x15f12b[_0x553292(0x297)](_0x2bc892['name'])+_0x1bca90),console[_0x553292(0x374)]('\x20\x20'+a31_0x15f12b[_0x553292(0x291)](_0x553292(0x379))+'\x20'+a31_0x15f12b[_0x553292(0x297)](_0x2bc892[_0x553292(0x398)]+'.'+_0x2bc892[_0x553292(0x2bd)]));const _0x53b4a0=_0x2bc892['joinKey']===_0x2bc892[_0x553292(0x266)]?a31_0x15f12b[_0x553292(0x291)]('Join\x20on:')+'\x20'+_0x2bc892[_0x553292(0x215)]:a31_0x15f12b[_0x553292(0x291)](_0x553292(0x329))+'\x20'+_0x2bc892[_0x553292(0x215)]+_0x553292(0x30f)+_0x2bc892[_0x553292(0x266)];console['error']('\x20\x20'+_0x53b4a0),console[_0x553292(0x374)]('\x20\x20'+a31_0x15f12b['dim'](_0x553292(0x265))),this[_0x553292(0x354)](_0x2bc892['columns']),!_0x2bc892[_0x553292(0x28d)]&&console[_0x553292(0x374)]('\x20\x20'+a31_0x15f12b[_0x553292(0x397)](_0x553292(0x3ae))+'\x20'+_0x2bc892[_0x553292(0x234)]);}}[a31_0x26e70d(0x354)](_0x36e574){const _0x3ab49=a31_0x26e70d;for(const _0x3ee7ab of _0x36e574){_0x3ee7ab[_0x3ab49(0x2f9)]===_0x3ee7ab[_0x3ab49(0x387)]||_0x3ee7ab['column']==='*'?console[_0x3ab49(0x374)](_0x3ab49(0x218)+_0x3ee7ab[_0x3ab49(0x2f9)]):console[_0x3ab49(0x374)](_0x3ab49(0x218)+_0x3ee7ab[_0x3ab49(0x2f9)]+'\x20'+a31_0x15f12b[_0x3ab49(0x291)]('('+_0x3ee7ab[_0x3ab49(0x387)]+')'));}}[a31_0x26e70d(0x22b)](_0x228e51){const _0xc09dd7=a31_0x26e70d;console['error']('─'['repeat'](0x3c));if(_0x228e51[_0xc09dd7(0x35c)][_0xc09dd7(0x1fe)]>0x0){console[_0xc09dd7(0x374)]('\x0a'+a31_0x15f12b[_0xc09dd7(0x397)](_0xc09dd7(0x336)));for(const _0x3f4895 of _0x228e51['errors']){console['error']('\x20\x20'+a31_0x15f12b[_0xc09dd7(0x397)]('•')+'\x20'+_0x3f4895);}}_0x228e51[_0xc09dd7(0x2ef)]&&console[_0xc09dd7(0x374)]('\x0a'+a31_0x15f12b[_0xc09dd7(0x37a)]('✔')+_0xc09dd7(0x1d4));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']='segment:parent:preview';[a31_0x26e70d(0x368)]=a31_0x26e70d(0x2dd);async['execute'](_0x522706){const _0x57d612=a31_0x26e70d,{options:_0x23e82d,args:_0x4cec24,tdx:_0x12a29f}=_0x522706,_0x5b6140=_0x23e82d,_0x570b30=_0x4cec24[0x0]||_0x23e82d[_0x57d612(0x352)];if(!_0x570b30)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+_0x57d612(0x369)+'Options\x20(one\x20required):\x0a'+_0x57d612(0x33b)+_0x57d612(0x335)+_0x57d612(0x29d)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x57d612(0x299)),0x1;if(!_0x5b6140['master']&&!_0x5b6140[_0x57d612(0x28f)]&&!_0x5b6140[_0x57d612(0x1d7)]&&!_0x5b6140[_0x57d612(0x22f)])return console[_0x57d612(0x374)](a31_0x15f12b[_0x57d612(0x397)](_0x57d612(0x202))),console[_0x57d612(0x374)](_0x57d612(0x2ab)),console[_0x57d612(0x374)](_0x57d612(0x2cc)),console['error']('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console['error'](_0x57d612(0x263)),console[_0x57d612(0x374)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x57d612(0x374)](_0x57d612(0x370)),0x1;const _0x27c109=resolveYamlFile(_0x570b30);if(!existsSync(_0x27c109))return showFileNotFoundError(_0x27c109,_0x570b30),0x1;_0x5b6140['verbose']&&(console[_0x57d612(0x374)](_0x57d612(0x245)+_0x5b6140[_0x57d612(0x389)]),console[_0x57d612(0x374)](_0x57d612(0x28a)+_0x27c109));let _0x58eb77;try{_0x58eb77=readFileSync(_0x27c109,'utf-8');}catch(_0x4fb633){const _0x46c0cf=_0x4fb633 instanceof Error?_0x4fb633[_0x57d612(0x2de)]:String(_0x4fb633);return console[_0x57d612(0x374)](_0x57d612(0x20d)+_0x46c0cf),0x1;}let _0x590ae4;try{_0x590ae4=parseDef(_0x58eb77);}catch(_0x396b0f){const _0x220940=_0x396b0f instanceof Error?_0x396b0f['message']:String(_0x396b0f);return console[_0x57d612(0x374)](a31_0x15f12b[_0x57d612(0x397)](_0x57d612(0x21b)+_0x220940)),0x1;}if(_0x5b6140[_0x57d612(0x28f)]===!![]||_0x5b6140[_0x57d612(0x28f)]===''){const _0x4dd377=_0x590ae4[_0x57d612(0x38c)]?.[_0x57d612(0x239)](_0x33bfd8=>_0x33bfd8['name'])||[];if(_0x4dd377['length']===0x0)console['error'](a31_0x15f12b['red'](_0x57d612(0x235)));else{console['error'](a31_0x15f12b['red'](_0x57d612(0x37e))),console['error']('Available\x20attributes:');for(const _0x3d7e3a of _0x4dd377){console[_0x57d612(0x374)]('\x20\x20'+a31_0x15f12b[_0x57d612(0x1e6)](_0x3d7e3a));}console[_0x57d612(0x374)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x570b30+'\x20--attribute\x20\x22'+_0x4dd377[0x0]+'\x22');}return 0x1;}if(_0x5b6140[_0x57d612(0x1d7)]===!![]||_0x5b6140[_0x57d612(0x1d7)]===''){const _0x1cd3be=_0x590ae4[_0x57d612(0x3bf)]?.['map'](_0x1f24b8=>_0x1f24b8['name'])||[];if(_0x1cd3be[_0x57d612(0x1fe)]===0x0)console[_0x57d612(0x374)](a31_0x15f12b[_0x57d612(0x397)](_0x57d612(0x35a)));else{console[_0x57d612(0x374)](a31_0x15f12b[_0x57d612(0x397)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x57d612(0x374)](_0x57d612(0x241));for(const _0x3185a6 of _0x1cd3be){console[_0x57d612(0x374)]('\x20\x20'+a31_0x15f12b[_0x57d612(0x1e6)](_0x3185a6));}console[_0x57d612(0x374)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x570b30+_0x57d612(0x31c)+_0x1cd3be[0x0]+'\x22');}return 0x1;}const _0x974dd0=createCommandSpinner(a31_0x15f12b['dim'](_0x57d612(0x267)),{'verbose':_0x5b6140[_0x57d612(0x27d)]});_0x974dd0[_0x57d612(0x26c)]();const _0x2fd68d={'onProgress':_0x18fad7=>{const _0x2009d=_0x57d612;_0x974dd0[_0x2009d(0x1fc)]=formatProgressMessage(_0x18fad7);}};if(_0x5b6140['master'])_0x2fd68d[_0x57d612(0x223)]=!![];if(_0x5b6140[_0x57d612(0x28f)]&&typeof _0x5b6140[_0x57d612(0x28f)]==='string')_0x2fd68d['attribute']=_0x5b6140['attribute'];if(_0x5b6140[_0x57d612(0x1d7)]&&typeof _0x5b6140['behavior']==='string')_0x2fd68d['behavior']=_0x5b6140[_0x57d612(0x1d7)];if(_0x5b6140[_0x57d612(0x22f)])_0x2fd68d[_0x57d612(0x22f)]=!![];if(_0x5b6140[_0x57d612(0x2d0)])_0x2fd68d[_0x57d612(0x2d0)]=_0x5b6140[_0x57d612(0x2d0)];let _0xc61cfe;try{_0xc61cfe=await _0x12a29f[_0x57d612(0x2c6)][_0x57d612(0x289)](_0x58eb77,_0x2fd68d),_0x974dd0[_0x57d612(0x3ad)]();}catch(_0x413a8b){_0x974dd0['stop']();throw _0x413a8b;}return await this['displayPreviewResults'](_0xc61cfe,{'master':_0x5b6140[_0x57d612(0x223)],'attribute':typeof _0x5b6140[_0x57d612(0x28f)]===_0x57d612(0x36c)?_0x5b6140['attribute']:undefined,'behavior':typeof _0x5b6140[_0x57d612(0x1d7)]===_0x57d612(0x36c)?_0x5b6140[_0x57d612(0x1d7)]:undefined,'enriched':_0x5b6140[_0x57d612(0x22f)]}),_0xc61cfe[_0x57d612(0x2ef)]?0x0:0x1;}async[a31_0x26e70d(0x2c1)](_0x1ca149,_0x4b1346){const _0x174dc9=a31_0x26e70d;console[_0x174dc9(0x374)]('\x0a'+a31_0x15f12b[_0x174dc9(0x297)](_0x174dc9(0x2a4))+'\x20'+_0x1ca149[_0x174dc9(0x2ea)]),console[_0x174dc9(0x374)]('═'['repeat'](0x3c));if(_0x4b1346['master']&&_0x1ca149['sampleData']){const _0x40bd75=a31_0x15f12b[_0x174dc9(0x291)](_0x174dc9(0x27c))+'\x20'+a31_0x15f12b[_0x174dc9(0x297)](_0x1ca149['master'][_0x174dc9(0x398)]+'.'+_0x1ca149[_0x174dc9(0x223)][_0x174dc9(0x2bd)]);await this[_0x174dc9(0x35e)](_0x40bd75,_0x1ca149[_0x174dc9(0x256)]);}else{if(_0x4b1346[_0x174dc9(0x28f)]&&_0x1ca149[_0x174dc9(0x256)]){const _0x227eca=a31_0x15f12b['dim'](_0x174dc9(0x305))+'\x20'+a31_0x15f12b['bold'](_0x4b1346[_0x174dc9(0x28f)]);await this['displaySampleData'](_0x227eca,_0x1ca149[_0x174dc9(0x256)]);}else{if(_0x4b1346[_0x174dc9(0x1d7)]&&_0x1ca149[_0x174dc9(0x256)]){const _0x5ea22e=a31_0x15f12b[_0x174dc9(0x291)]('Behavior:')+'\x20'+a31_0x15f12b['bold'](_0x4b1346[_0x174dc9(0x1d7)]);await this[_0x174dc9(0x35e)](_0x5ea22e,_0x1ca149[_0x174dc9(0x256)]);}else{if(_0x4b1346[_0x174dc9(0x22f)]&&_0x1ca149[_0x174dc9(0x256)]){const _0x2fb4d8=a31_0x15f12b['dim'](_0x174dc9(0x38b))+'\x20'+a31_0x15f12b[_0x174dc9(0x297)]('Master\x20+\x20Attributes');await this[_0x174dc9(0x35e)](_0x2fb4d8,_0x1ca149[_0x174dc9(0x256)]);}else!_0x1ca149[_0x174dc9(0x256)]&&console[_0x174dc9(0x374)](_0x174dc9(0x2dc));}}}if(_0x1ca149[_0x174dc9(0x35c)][_0x174dc9(0x1fe)]>0x0){console['error']('─'[_0x174dc9(0x372)](0x3c)),console['error']('\x0a'+a31_0x15f12b['red']('Errors:'));for(const _0x23c117 of _0x1ca149[_0x174dc9(0x35c)]){console['error']('\x20\x20'+a31_0x15f12b['red']('•')+'\x20'+_0x23c117);}}}async[a31_0x26e70d(0x35e)](_0x5a5b9c,_0x374a09){const _0x436af2=a31_0x26e70d;if(_0x374a09[_0x436af2(0x1fe)]===0x0){console[_0x436af2(0x374)]('\x0a'+_0x5a5b9c),console['error']('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x436af2(0x374)]('\x0a'+_0x5a5b9c);const _0x206669=Object['keys'](_0x374a09[0x0])['map'](_0x2bae36=>({'name':_0x2bae36,'type':typeof _0x374a09[0x0][_0x2bae36]===_0x436af2(0x1c9)?_0x436af2(0x386):_0x436af2(0x1fb)})),_0x202389={'queryId':_0x436af2(0x1dc),'columns':_0x206669,'data':_0x374a09,'stats':{'state':_0x436af2(0x1e2),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x374a09[_0x436af2(0x1fe)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x185124=formatAsTable(_0x202389,_0x374a09[_0x436af2(0x1fe)],!![]);await writeOutput(_0x185124,undefined,_0x436af2(0x2bd));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x26e70d(0x2ea)]=a31_0x26e70d(0x27a);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x3a1);async['execute'](_0x2aee46){const _0x5e20cf=a31_0x26e70d,{options:_0x201091,args:_0x892d9f,tdx:_0x156bdb}=_0x2aee46,_0x20ad6c=_0x201091,_0x26d3c1=_0x892d9f[0x0]||_0x201091[_0x5e20cf(0x352)];if(!_0x26d3c1)return showParentSegmentNotSetError(_0x5e20cf(0x2e6)+_0x5e20cf(0x35d)),0x1;const _0x492bff=resolveYamlFile(_0x26d3c1);if(existsSync(_0x492bff)){_0x20ad6c[_0x5e20cf(0x27d)]&&console[_0x5e20cf(0x374)]('Found\x20YAML\x20file:\x20'+_0x492bff);let _0x4a301a;try{_0x4a301a=readFileSync(_0x492bff,_0x5e20cf(0x2f7));}catch(_0x3f46ff){const _0x4e87ae=_0x3f46ff instanceof Error?_0x3f46ff[_0x5e20cf(0x2de)]:String(_0x3f46ff);return console[_0x5e20cf(0x374)](_0x5e20cf(0x20d)+_0x4e87ae),0x1;}const _0x2e48f3=await withSpinner(_0x5e20cf(0x2c7),()=>_0x156bdb['segment']['pushParentYaml'](_0x4a301a),{'verbose':_0x20ad6c[_0x5e20cf(0x27d)]}),_0x6ac3b2=_0x2e48f3[_0x5e20cf(0x308)],{isNew:_0x55d302,name:_0x389dbf,hasChanges:_0x2c2bc9,diffFormatted:_0xba0d8}=_0x6ac3b2;if(_0x2c2bc9){_0x55d302?console[_0x5e20cf(0x374)](_0x5e20cf(0x23f)+_0x389dbf+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x389dbf+'\x27:');console[_0x5e20cf(0x374)]('─'[_0x5e20cf(0x372)](0x3c)),console[_0x5e20cf(0x374)](_0xba0d8),console['error']('─'[_0x5e20cf(0x372)](0x3c));const _0x78372a=_0x55d302?_0x5e20cf(0x37f)+_0x389dbf+'\x27\x20and\x20run\x20workflow?':_0x5e20cf(0x1d9)+_0x389dbf+_0x5e20cf(0x35b);if(!_0x20ad6c[_0x5e20cf(0x2fc)]){if(!isInteractive())return console[_0x5e20cf(0x374)](a31_0x15f12b['red'](_0x5e20cf(0x328)),_0x5e20cf(0x2b1)),console['error'](a31_0x15f12b['dim'](_0x5e20cf(0x2a6))),0x1;const _0x5c632b=await confirmKey(_0x78372a);if(!_0x5c632b)return console[_0x5e20cf(0x374)](a31_0x15f12b[_0x5e20cf(0x1d0)](_0x5e20cf(0x1ed))),0x1;}const _0x2750e7=_0x55d302?_0x5e20cf(0x2a0):_0x5e20cf(0x211);await withSpinner(_0x2750e7+_0x5e20cf(0x375)+_0x389dbf+'\x27...',()=>_0x6ac3b2['apply'](),{'verbose':_0x20ad6c['verbose']});const _0x3a7dcd=_0x55d302?'Created':_0x5e20cf(0x3c0);console[_0x5e20cf(0x374)]('✔\x20'+_0x3a7dcd+_0x5e20cf(0x375)+_0x389dbf+'\x27');}else console[_0x5e20cf(0x374)](_0x5e20cf(0x347)+_0x389dbf+_0x5e20cf(0x1eb));}const _0x305de9=await withSpinner(_0x5e20cf(0x366)+_0x26d3c1+_0x5e20cf(0x1f3),()=>_0x156bdb[_0x5e20cf(0x2c6)][_0x5e20cf(0x2f5)](_0x26d3c1),{'verbose':_0x20ad6c[_0x5e20cf(0x27d)]}),_0x18e682=_0x305de9[_0x5e20cf(0x308)],_0x39744b=getConsoleUrl(_0x20ad6c[_0x5e20cf(0x389)],_0x5e20cf(0x1e0)+_0x18e682[_0x5e20cf(0x2ed)]+_0x5e20cf(0x344)+_0x18e682[_0x5e20cf(0x359)]+_0x5e20cf(0x3c8)+_0x18e682[_0x5e20cf(0x2e5)]);return console['error'](_0x5e20cf(0x293)),console[_0x5e20cf(0x374)]('\x20\x20'+a31_0x15f12b[_0x5e20cf(0x291)](_0x5e20cf(0x284))+'\x20'+_0x18e682[_0x5e20cf(0x210)]),console['error']('\x20\x20'+a31_0x15f12b[_0x5e20cf(0x291)](_0x5e20cf(0x2a1))+'\x20'+_0x18e682['status']),console[_0x5e20cf(0x374)]('\x20\x20'+a31_0x15f12b['dim'](_0x5e20cf(0x244))+'\x20'+_0x18e682[_0x5e20cf(0x359)]),console['error']('\x20\x20'+a31_0x15f12b['dim'](_0x5e20cf(0x27e))+'\x20'+_0x18e682[_0x5e20cf(0x2e5)]),console[_0x5e20cf(0x374)]('\x20\x20'+_0x39744b),console[_0x5e20cf(0x374)]('\x0a'+a31_0x15f12b[_0x5e20cf(0x291)]('To\x20cancel:')+'\x20tdx\x20wf\x20attempt\x20'+_0x18e682[_0x5e20cf(0x2e5)]+_0x5e20cf(0x243)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a31_0x26e70d(0x1bf);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x39e);async['execute'](_0x38bca2){const _0x332203=a31_0x26e70d,{options:_0x38969e,args:_0x33619f,tdx:_0x23e69e}=_0x38bca2,_0x384679=_0x33619f[0x0]||_0x38969e[_0x332203(0x352)];if(!_0x384679)return showParentSegmentNotSetError(_0x332203(0x31f)+_0x332203(0x2fe)),0x1;_0x38969e[_0x332203(0x27d)]&&(console[_0x332203(0x374)](_0x332203(0x245)+_0x38969e[_0x332203(0x389)]),console['error']('Parent\x20segment:\x20'+_0x384679));const _0x131597=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x384679+_0x332203(0x1f3),()=>_0x23e69e[_0x332203(0x2c6)][_0x332203(0x2b5)](_0x384679),{'verbose':_0x38969e[_0x332203(0x27d)]}),_0x5e50f1=_0x131597[_0x332203(0x308)];console['error'](_0x332203(0x38d)+_0x5e50f1[_0x332203(0x1fe)]+'\x20field'+(_0x5e50f1[_0x332203(0x1fe)]!==0x1?'s':''));if(_0x38969e[_0x332203(0x3bc)]||_0x38969e[_0x332203(0x22c)])return await handleSDKOutput(_0x5e50f1,_0x38969e),0x0;return displayFieldsHumanReadable(_0x5e50f1,_0x384679),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]=a31_0x26e70d(0x255);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x1ee);async[a31_0x26e70d(0x220)](_0x3a5617){const _0x101dbf=a31_0x26e70d,{options:_0x5ccb69,args:_0x3cc503,tdx:_0x1f3a91}=_0x3a5617,_0x4de461=_0x5ccb69,_0x2ba0cf=_0x3cc503[0x0]||_0x5ccb69[_0x101dbf(0x352)];if(!_0x2ba0cf)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'+_0x101dbf(0x25e)+_0x101dbf(0x2ce)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x5ccb69[_0x101dbf(0x27d)]&&(console[_0x101dbf(0x374)](_0x101dbf(0x245)+_0x5ccb69[_0x101dbf(0x389)]),console[_0x101dbf(0x374)](_0x101dbf(0x1c1)+_0x2ba0cf));const _0x39fa47=await withSpinner(_0x101dbf(0x1f4)+_0x2ba0cf+'\x27...',()=>_0x1f3a91[_0x101dbf(0x2c6)][_0x101dbf(0x34e)](_0x2ba0cf),{'verbose':_0x5ccb69[_0x101dbf(0x27d)]}),_0x3fa79d=_0x39fa47[_0x101dbf(0x308)];if(_0x4de461['web']){const _0x271782=getConsoleNextUrl(_0x4de461[_0x101dbf(0x389)],'/app/dw/parentSegments/'+_0x3fa79d['id']);return console['error'](a31_0x15f12b[_0x101dbf(0x37a)]('✔')+_0x101dbf(0x227)+a31_0x15f12b[_0x101dbf(0x1e6)](_0x271782)),openBrowser(_0x271782),0x0;}return await handleSingleObjectOutput(_0x3fa79d,_0x5ccb69),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a31_0x26e70d(0x2f8);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x3b7);async[a31_0x26e70d(0x220)](_0x5e989d){const _0x50aa30=a31_0x26e70d,{options:_0x14cbe2,args:_0x35baa9,tdx:_0x5f536b}=_0x5e989d,_0x187ad4=_0x14cbe2,_0x39dff7=_0x35baa9[0x0]||_0x14cbe2['parentSegment'];if(!_0x39dff7)return showParentSegmentNotSetError(_0x50aa30(0x258)+'\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;_0x14cbe2[_0x50aa30(0x27d)]&&(console[_0x50aa30(0x374)]('Site:\x20'+_0x14cbe2[_0x50aa30(0x389)]),console['error'](_0x50aa30(0x1c1)+_0x39dff7));const _0x1956cf=await withSpinner(_0x50aa30(0x25b)+_0x39dff7+'\x27...',()=>_0x5f536b[_0x50aa30(0x2c6)][_0x50aa30(0x26e)](_0x39dff7),{'verbose':_0x14cbe2[_0x50aa30(0x27d)]}),_0xe935ec=_0x1956cf[_0x50aa30(0x308)],_0xbb8dde=_0x5f536b['segment']['getOutputDatabaseName'](_0xe935ec);if(_0x187ad4[_0x50aa30(0x2be)]){const _0x2afd86=await this['collectSchema'](_0x5e989d,_0x39dff7,_0xe935ec,_0xbb8dde),_0x223692=this[_0x50aa30(0x25f)](_0x2afd86);writeFileSync(_0x187ad4[_0x50aa30(0x2be)],_0x223692);const _0x5113d7=_0x2afd86[_0x50aa30(0x1c2)][_0x50aa30(0x273)][_0x50aa30(0x1fe)]+_0x2afd86[_0x50aa30(0x3bf)][_0x50aa30(0x240)]((_0x5280dc,_0x474dc0)=>_0x5280dc+_0x474dc0[_0x50aa30(0x273)][_0x50aa30(0x1fe)],0x0),_0x3a78ff=_0x2afd86[_0x50aa30(0x3bf)][_0x50aa30(0x3b4)](_0x2ffe63=>_0x2ffe63[_0x50aa30(0x273)][_0x50aa30(0x1fe)]===0x0)[_0x50aa30(0x1fe)];return console[_0x50aa30(0x3a0)]('Schema\x20saved\x20to\x20'+_0x187ad4['output']),console[_0x50aa30(0x3a0)](_0x50aa30(0x303)+_0xbb8dde),console['log']('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x2afd86[_0x50aa30(0x3bf)][_0x50aa30(0x1fe)]+_0x50aa30(0x2a8)),console['log'](_0x50aa30(0x38f)+_0x5113d7+_0x50aa30(0x27f)),_0x3a78ff>0x0&&console[_0x50aa30(0x3a0)](_0x50aa30(0x1fd)+_0x3a78ff+_0x50aa30(0x2b6)),0x0;}console[_0x50aa30(0x374)]('\x0a'+a31_0x15f12b[_0x50aa30(0x297)]('Output\x20Database:')+'\x20'+a31_0x15f12b['cyan'](_0xbb8dde));const _0x23213e=await withSpinner(_0x50aa30(0x330),()=>_0x5f536b[_0x50aa30(0x2c6)][_0x50aa30(0x221)](_0xe935ec),{'verbose':_0x14cbe2[_0x50aa30(0x27d)]});console[_0x50aa30(0x374)]('\x0a'+a31_0x15f12b[_0x50aa30(0x297)](_0x50aa30(0x1c2))+'\x20'+a31_0x15f12b[_0x50aa30(0x291)]('('+_0xbb8dde+_0x50aa30(0x307)));const _0x41ebd6=await executeSchemaQuery(_0x23213e[_0x50aa30(0x308)],_0x5f536b,_0x14cbe2);await handleQueryOutput(_0x41ebd6,_0x14cbe2);const _0x43820d=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x5f536b[_0x50aa30(0x2c6)][_0x50aa30(0x332)](_0xe935ec),{'verbose':_0x14cbe2[_0x50aa30(0x27d)]});for(const _0x172a2a of _0x43820d['data']){const _0x55f65b=_0x50aa30(0x282)+_0x172a2a['toLowerCase']()[_0x50aa30(0x3a6)](/\s+/g,'_'),_0x596fff=_0x50aa30(0x3a9)+_0xbb8dde+'.'+_0x55f65b;console[_0x50aa30(0x374)]('\x0a'+a31_0x15f12b['bold'](_0x172a2a)+'\x20'+a31_0x15f12b[_0x50aa30(0x291)]('('+_0xbb8dde+'.'+_0x55f65b+')'));try{const _0xbe5f0e=await executeSchemaQuery(_0x596fff,_0x5f536b,_0x14cbe2);await handleQueryOutput(_0xbe5f0e,_0x14cbe2);}catch{console[_0x50aa30(0x374)](a31_0x15f12b[_0x50aa30(0x1d0)]('\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)'));}}return 0x0;}async[a31_0x26e70d(0x394)](_0x39e16e,_0x698328,_0x101596,_0x35e437){const _0x4ee0e5=a31_0x26e70d,{options:_0x14d762,tdx:_0x23540e}=_0x39e16e,_0x540f1=await withSpinner(_0x4ee0e5(0x330),()=>_0x23540e[_0x4ee0e5(0x2c6)][_0x4ee0e5(0x221)](_0x101596),{'verbose':_0x14d762[_0x4ee0e5(0x27d)]}),_0x164396=await executeSchemaQuery(_0x540f1[_0x4ee0e5(0x308)],_0x23540e,_0x14d762),_0x3cf404=_0x164396[_0x4ee0e5(0x308)][_0x4ee0e5(0x239)](_0x3b51e4=>({'name':_0x3b51e4['column_name'],'type':_0x3b51e4[_0x4ee0e5(0x316)]})),_0x44eaed=await withSpinner(_0x4ee0e5(0x24e),()=>_0x23540e[_0x4ee0e5(0x2c6)][_0x4ee0e5(0x332)](_0x101596),{'verbose':_0x14d762[_0x4ee0e5(0x27d)]}),_0x5f4a39=[];for(const _0x24c5e2 of _0x44eaed['data']){const _0x1e3626=_0x4ee0e5(0x282)+_0x24c5e2[_0x4ee0e5(0x326)]()['replace'](/\s+/g,'_'),_0x2e598d=_0x4ee0e5(0x3a9)+_0x35e437+'.'+_0x1e3626;let _0x3f713d=[];try{const _0x1a2aec=await executeSchemaQuery(_0x2e598d,_0x23540e,_0x14d762);_0x3f713d=_0x1a2aec['data'][_0x4ee0e5(0x239)](_0x4b2dc4=>({'name':_0x4b2dc4['column_name'],'type':_0x4b2dc4[_0x4ee0e5(0x316)]}));}catch{}_0x5f4a39[_0x4ee0e5(0x32f)]({'table':_0x1e3626,'columns':_0x3f713d});}return{'database':_0x35e437,'parent_segment':_0x698328,'parent_id':_0x101596,'customers':{'table':'customers','columns':_0x3cf404},'behaviors':_0x5f4a39};}[a31_0x26e70d(0x25f)](_0x39616b){const _0xa18df7=a31_0x26e70d,_0x867e3b=_0x29658d=>{const _0x3f0446=a31_0x17a7;if(_0x29658d[_0x3f0446(0x1fe)]===0x0)return'[]';const _0x50441e=_0x29658d[_0x3f0446(0x239)](_0x5510ea=>_0x3f0446(0x341)+_0x5510ea['name']+_0x3f0446(0x381)+_0x5510ea[_0x3f0446(0x1fa)]+_0x3f0446(0x21d));return'[\x0a'+_0x50441e['join'](',\x0a')+_0x3f0446(0x296);},_0x31cd26=_0x39616b['behaviors']['map'](_0xf78640=>{const _0x16e52d=a31_0x17a7;return _0x16e52d(0x361)+_0xf78640[_0x16e52d(0x2bd)]+_0x16e52d(0x36a)+_0x867e3b(_0xf78640[_0x16e52d(0x273)])['replace'](/^/gm,'\x20\x20')[_0x16e52d(0x380)]()+_0x16e52d(0x246);})['join'](',\x0a');return _0xa18df7(0x237)+_0x39616b[_0xa18df7(0x398)]+_0xa18df7(0x275)+_0x39616b['parent_segment']+_0xa18df7(0x356)+_0x39616b[_0xa18df7(0x3b8)]+_0xa18df7(0x2cb)+_0x39616b['customers'][_0xa18df7(0x2bd)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x867e3b(_0x39616b[_0xa18df7(0x1c2)][_0xa18df7(0x273)])[_0xa18df7(0x3a6)](/^/gm,'\x20\x20')[_0xa18df7(0x380)]()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x31cd26+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a31_0x26e70d(0x228);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x1c0);async['execute'](_0x4586fe){const _0x1fa672=a31_0x26e70d,{options:_0x2d571a,args:_0x28fab5,tdx:_0x33c49b}=_0x4586fe,_0x24792a=_0x28fab5[0x0]||_0x2d571a[_0x1fa672(0x352)];if(!_0x24792a)return showParentSegmentNotSetError(_0x1fa672(0x1c3)+_0x1fa672(0x29f)),0x1;_0x2d571a['verbose']&&(console['error']('Site:\x20'+_0x2d571a[_0x1fa672(0x389)]),console[_0x1fa672(0x374)](_0x1fa672(0x1c1)+_0x24792a));const _0x57eb11=await withSpinner(_0x1fa672(0x25b)+_0x24792a+_0x1fa672(0x1f3),()=>_0x33c49b[_0x1fa672(0x2c6)][_0x1fa672(0x26e)](_0x24792a),{'verbose':_0x2d571a[_0x1fa672(0x27d)]}),_0x583207=_0x57eb11['data'],_0x2d3fce=await withSpinner(_0x1fa672(0x2e4)+_0x24792a+_0x1fa672(0x1f3),()=>_0x33c49b['segment']['getParentSQL'](_0x583207),{'verbose':_0x2d571a[_0x1fa672(0x27d)]}),_0xa4d83a=_0x2d3fce[_0x1fa672(0x308)];return _0x2d571a[_0x1fa672(0x2cf)]===_0x1fa672(0x3bc)||_0x2d571a['format']==='jsonl'?await handleSDKOutput([{'sql':_0xa4d83a}],_0x2d571a):console[_0x1fa672(0x3a0)](_0xa4d83a),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]=a31_0x26e70d(0x28b);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x1bd);async[a31_0x26e70d(0x220)](_0x4f33e0){const _0x134fb8=a31_0x26e70d,{options:_0x2f33fa,args:_0xf98b79,tdx:_0x4ea8c5}=_0x4f33e0,_0x43a6fd=_0xf98b79[0x0]||_0x2f33fa[_0x134fb8(0x352)];if(!_0x43a6fd)return showParentSegmentNotSetError(_0x134fb8(0x30d)+_0x134fb8(0x29c)),0x1;_0x2f33fa['verbose']&&(console[_0x134fb8(0x374)]('Site:\x20'+_0x2f33fa[_0x134fb8(0x389)]),console[_0x134fb8(0x374)]('Parent\x20segment:\x20'+_0x43a6fd));const _0xd661e9=await withSpinner(_0x134fb8(0x25b)+_0x43a6fd+_0x134fb8(0x1f3),()=>_0x4ea8c5[_0x134fb8(0x2c6)][_0x134fb8(0x26e)](_0x43a6fd),{'verbose':_0x2f33fa['verbose']}),_0x12c22a=_0xd661e9[_0x134fb8(0x308)],_0x32b8d9=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x43a6fd+'\x27...',()=>_0x4ea8c5[_0x134fb8(0x2c6)][_0x134fb8(0x221)](_0x12c22a),{'verbose':_0x2f33fa[_0x134fb8(0x27d)]});let _0x2024a3=_0x32b8d9[_0x134fb8(0x308)];const _0x3258e8=resolveLimit(_0x2f33fa[_0x134fb8(0x33e)],DEFAULT_DISPLAY_LIMIT),_0xe5494=/\bLIMIT\s+\d+/i[_0x134fb8(0x20e)](_0x2024a3);!_0xe5494&&(_0x2024a3=_0x2024a3[_0x134fb8(0x380)]()[_0x134fb8(0x3a6)](/;+$/,''),_0x2024a3=_0x134fb8(0x21a)+_0x2024a3+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x3258e8);_0x2f33fa[_0x134fb8(0x27d)]&&console[_0x134fb8(0x374)](_0x134fb8(0x37c)+_0x2024a3);const _0x3f4415=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x52bda6=>{const _0x55ea29=_0x134fb8,_0x387465=await _0x4ea8c5[_0x55ea29(0x34d)]['execute'](_0x2024a3,{'catalog':'td','schema':_0x55ea29(0x3af),'onJobId':_0x2b3893=>{_0x52bda6['setJobId'](_0x2b3893);}});return _0x387465;},{'verbose':_0x2f33fa[_0x134fb8(0x27d)]}),_0x4a0d62=_0x3f4415[_0x134fb8(0x308)],_0x137175=_0x4a0d62[_0x134fb8(0x376)]?'\x20[Job\x20ID:\x20'+_0x4a0d62[_0x134fb8(0x376)]+']':'';return console[_0x134fb8(0x374)](_0x134fb8(0x36f)+_0x4a0d62['stats'][_0x134fb8(0x24d)][_0x134fb8(0x2f2)]()+_0x134fb8(0x264)+(_0x134fb8(0x2e8)+formatElapsed(_0x4a0d62[_0x134fb8(0x286)][_0x134fb8(0x1f9)])+_0x137175)),await handleQueryOutput(_0x4a0d62,_0x2f33fa),0x0;}}export class PSRtListCommand extends BaseCommand{['name']=a31_0x26e70d(0x27b);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x2df);async[a31_0x26e70d(0x220)](_0x51cf5e){const _0x2e2dfc=a31_0x26e70d,{options:_0x4a651e,args:_0x180513,tdx:_0x3ebaf3}=_0x51cf5e,_0x338586=_0x180513[0x0],_0xb93a60=await withSpinner(_0x338586?_0x2e2dfc(0x365)+_0x338586+_0x2e2dfc(0x1f3):_0x2e2dfc(0x204),()=>_0x3ebaf3[_0x2e2dfc(0x334)]['list'](),{'verbose':_0x4a651e['verbose']});let _0x417a06=_0xb93a60['data'][_0x2e2dfc(0x3b4)](_0x51d4fe=>_0x51d4fe[_0x2e2dfc(0x325)]);if(_0x338586){const _0x286b72=_0x338586[_0x2e2dfc(0x3a6)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x2e2dfc(0x3a6)](/\*/g,'.*')[_0x2e2dfc(0x3a6)](/\?/g,'.'),_0x388b8b=new RegExp('^'+_0x286b72+'$','i');_0x417a06=_0x417a06['filter'](_0x1de33a=>_0x388b8b[_0x2e2dfc(0x20e)](_0x1de33a['name']));}_0x417a06[_0x2e2dfc(0x21e)]((_0x5dbb89,_0xb7cafa)=>_0x5dbb89[_0x2e2dfc(0x2ea)][_0x2e2dfc(0x200)](_0xb7cafa[_0x2e2dfc(0x2ea)])),console[_0x2e2dfc(0x374)]('✔\x20Found\x20'+_0x417a06[_0x2e2dfc(0x1fe)]+_0x2e2dfc(0x32a)+(_0x417a06['length']!==0x1?'s':''));const _0x2fab6e=_0xd29e7c=>{const _0x2d45c1=_0x2e2dfc;return getConsoleNextUrl(_0x4a651e[_0x2d45c1(0x389)],_0x2d45c1(0x23c)+_0xd29e7c);};if(_0x4a651e[_0x2e2dfc(0x2cf)]===_0x2e2dfc(0x3bc)||_0x4a651e[_0x2e2dfc(0x2cf)]===_0x2e2dfc(0x22c)){const _0x575777=_0x417a06[_0x2e2dfc(0x239)](_0x1abffe=>({..._0x1abffe,'url':_0x2fab6e(_0x1abffe['id'])}));await handleSDKOutput(_0x575777,_0x4a651e);}else{if(_0x417a06[_0x2e2dfc(0x1fe)]===0x0)console[_0x2e2dfc(0x3a0)](_0x2e2dfc(0x2e2));else for(const _0x5c22c3 of _0x417a06){const _0x53905b=_0x5c22c3[_0x2e2dfc(0x333)]?a31_0x15f12b['dim']('\x20('+formatRows(_0x5c22c3[_0x2e2dfc(0x333)])+')'):'',_0x21f89b=hyperlink(_0x5c22c3['name'],_0x2fab6e(_0x5c22c3['id']));console[_0x2e2dfc(0x3a0)]('⚡\x20'+_0x21f89b+_0x53905b);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x26e70d(0x2ea)]='ps:rt:validate';[a31_0x26e70d(0x368)]=a31_0x26e70d(0x1d6);async['execute'](_0x148f86){const _0x5f3b92=a31_0x26e70d,{options:_0x3a3311,args:_0x4e5951,tdx:_0x583229}=_0x148f86,_0x263063=_0x4e5951[0x0]||_0x3a3311['parentSegment'];if(!_0x263063)return showParentSegmentNotSetError(_0x5f3b92(0x209)+_0x5f3b92(0x271)),0x1;const _0x3814ad=resolveYamlFile(_0x263063);if(!existsSync(_0x3814ad))return showFileNotFoundError(_0x3814ad,_0x263063),0x1;let _0x423996;try{_0x423996=readFileSync(_0x3814ad,_0x5f3b92(0x2f7));}catch(_0x5cee4a){const _0x328ee2=_0x5cee4a instanceof Error?_0x5cee4a['message']:String(_0x5cee4a);return console[_0x5f3b92(0x374)](_0x5f3b92(0x20d)+_0x328ee2),0x1;}const _0x292182=createCommandSpinner(a31_0x15f12b['dim']('Validating\x20RT\x20configuration...'),{'verbose':_0x3a3311[_0x5f3b92(0x27d)]});_0x292182['start']();const _0x5da949={'realtime':!![],'onProgress':_0x2b45e1=>{const _0x938e47=_0x5f3b92;_0x292182[_0x938e47(0x1fc)]=formatProgressMessage(_0x2b45e1);}};let _0x50abc7;try{_0x50abc7=await _0x583229[_0x5f3b92(0x2c6)][_0x5f3b92(0x350)](_0x423996,_0x5da949),_0x292182[_0x5f3b92(0x3ad)]();}catch(_0x4ff7b3){_0x292182[_0x5f3b92(0x3ad)]();throw _0x4ff7b3;}console['error']('\x0a'+a31_0x15f12b[_0x5f3b92(0x297)](_0x5f3b92(0x390))+'\x20'+_0x50abc7[_0x5f3b92(0x2ea)]),console[_0x5f3b92(0x374)]('═'[_0x5f3b92(0x372)](0x3c)),displayRealtimeValidation(_0x50abc7),console[_0x5f3b92(0x374)]('─'[_0x5f3b92(0x372)](0x3c));if(_0x50abc7[_0x5f3b92(0x35c)][_0x5f3b92(0x1fe)]>0x0){console['error']('\x0a'+a31_0x15f12b['red'](_0x5f3b92(0x336)));for(const _0x427436 of _0x50abc7['errors']){console[_0x5f3b92(0x374)]('\x20\x20'+a31_0x15f12b['red']('•')+'\x20'+_0x427436);}}return _0x50abc7[_0x5f3b92(0x2ef)]&&console['error']('\x0a'+a31_0x15f12b[_0x5f3b92(0x37a)]('✔')+_0x5f3b92(0x283)),_0x50abc7[_0x5f3b92(0x2ef)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]=a31_0x26e70d(0x304);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x3aa);async[a31_0x26e70d(0x220)](_0x258263){const _0x163ecc=a31_0x26e70d,{options:_0x4a173f,args:_0x52de62,tdx:_0x340b42}=_0x258263,_0x341f94=_0x52de62[0x0]||_0x4a173f[_0x163ecc(0x352)];if(!_0x341f94)return showParentSegmentNotSetError(_0x163ecc(0x225)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment'),0x1;_0x4a173f['verbose']&&(console[_0x163ecc(0x374)](_0x163ecc(0x245)+_0x4a173f[_0x163ecc(0x389)]),console[_0x163ecc(0x374)](_0x163ecc(0x1c1)+_0x341f94));const _0x169929=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x341f94+'\x27...',()=>_0x340b42['segment']['resolveParentId'](_0x341f94),{'verbose':_0x4a173f[_0x163ecc(0x27d)]}),_0x34638f=_0x169929['data'],_0x42015b=await withSpinner(_0x163ecc(0x1f2)+_0x341f94+'\x27...',()=>_0x340b42['realtime']['listJourneys'](_0x34638f),{'verbose':_0x4a173f['verbose']}),_0x4b5e04=_0x42015b['data'];console[_0x163ecc(0x374)](_0x163ecc(0x38d)+_0x4b5e04[_0x163ecc(0x1fe)]+_0x163ecc(0x1f0)+(_0x4b5e04[_0x163ecc(0x1fe)]!==0x1?'s':''));if(_0x4a173f[_0x163ecc(0x2cf)]==='json'||_0x4a173f[_0x163ecc(0x2cf)]===_0x163ecc(0x22c))await handleSDKOutput(_0x4b5e04,_0x4a173f);else{if(_0x4b5e04['length']===0x0)console[_0x163ecc(0x3a0)](_0x163ecc(0x2ac));else for(const _0x2c2cb8 of _0x4b5e04){const _0x71c4fe=_0x2c2cb8[_0x163ecc(0x342)]===_0x163ecc(0x276)?'🚀':'📝',_0x39493f=_0x2c2cb8['paused']?a31_0x15f12b['yellow'](_0x163ecc(0x1d8)):'',_0x6e2995=a31_0x15f12b[_0x163ecc(0x291)]('\x20('+_0x2c2cb8[_0x163ecc(0x2d3)]+_0x163ecc(0x25a)+(_0x2c2cb8[_0x163ecc(0x2d3)]!==0x1?'s':'')+')');console[_0x163ecc(0x3a0)](_0x71c4fe+'\x20'+_0x2c2cb8['name']+_0x39493f+_0x6e2995);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{['name']=a31_0x26e70d(0x212);[a31_0x26e70d(0x368)]='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x26e70d(0x220)](_0x518915){const _0x503fca=a31_0x26e70d,{options:_0x2378e9,args:_0x55a943,tdx:_0x1f8d03}=_0x518915,_0x24edf0=_0x55a943[0x0];if(!_0x24edf0)return console[_0x503fca(0x374)](a31_0x15f12b[_0x503fca(0x397)](_0x503fca(0x28e))),console[_0x503fca(0x374)](_0x503fca(0x2b0)),console[_0x503fca(0x374)](a31_0x15f12b[_0x503fca(0x291)](_0x503fca(0x36e))),0x1;_0x2378e9[_0x503fca(0x27d)]&&(console[_0x503fca(0x374)]('Site:\x20'+_0x2378e9[_0x503fca(0x389)]),console['error'](_0x503fca(0x2a3)+_0x24edf0));const _0x4ea596=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x24edf0+_0x503fca(0x1f3),()=>_0x1f8d03[_0x503fca(0x334)][_0x503fca(0x1c6)](_0x24edf0),{'verbose':_0x2378e9[_0x503fca(0x27d)]}),_0x27d217=_0x4ea596[_0x503fca(0x308)];console[_0x503fca(0x374)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x27d217[_0x503fca(0x2ea)]+'\x27');if(_0x2378e9[_0x503fca(0x2cf)]===_0x503fca(0x3bc)||_0x2378e9[_0x503fca(0x2cf)]==='jsonl')await handleSDKOutput([_0x27d217],_0x2378e9);else{const _0x1e7556=_0x27d217[_0x503fca(0x342)]==='launched'?'🚀':'📝',_0x1bb71f=_0x27d217[_0x503fca(0x37b)]?a31_0x15f12b['yellow'](_0x503fca(0x1d8)):'';console[_0x503fca(0x3a0)](_0x1e7556+'\x20'+_0x27d217['name']+_0x1bb71f);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]='ps:rt:jn:resume';[a31_0x26e70d(0x368)]=a31_0x26e70d(0x2d8);async['execute'](_0x4334f3){const _0x51b844=a31_0x26e70d,{options:_0x3c5501,args:_0x454a97,tdx:_0x6a12bc}=_0x4334f3,_0x50dc33=_0x454a97[0x0];if(!_0x50dc33)return console[_0x51b844(0x374)](a31_0x15f12b[_0x51b844(0x397)](_0x51b844(0x28e))),console[_0x51b844(0x374)](_0x51b844(0x1c5)),console[_0x51b844(0x374)](a31_0x15f12b[_0x51b844(0x291)](_0x51b844(0x36e))),0x1;_0x3c5501[_0x51b844(0x27d)]&&(console['error'](_0x51b844(0x245)+_0x3c5501['site']),console['error']('RT\x20Journey\x20ID:\x20'+_0x50dc33));const _0x42213e=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x50dc33+_0x51b844(0x1f3),()=>_0x6a12bc['realtime']['resumeJourney'](_0x50dc33),{'verbose':_0x3c5501[_0x51b844(0x27d)]}),_0x3e30a9=_0x42213e[_0x51b844(0x308)];console['error'](_0x51b844(0x26f)+_0x3e30a9[_0x51b844(0x2ea)]+'\x27');if(_0x3c5501[_0x51b844(0x2cf)]===_0x51b844(0x3bc)||_0x3c5501[_0x51b844(0x2cf)]===_0x51b844(0x22c))await handleSDKOutput([_0x3e30a9],_0x3c5501);else{const _0x582289=_0x3e30a9[_0x51b844(0x342)]===_0x51b844(0x276)?'🚀':'📝',_0x1a9731=_0x3e30a9[_0x51b844(0x37b)]?a31_0x15f12b[_0x51b844(0x1d0)](_0x51b844(0x1d8)):'';console[_0x51b844(0x3a0)](_0x582289+'\x20'+_0x3e30a9['name']+_0x1a9731);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]=a31_0x26e70d(0x323);['description']=a31_0x26e70d(0x36b);async[a31_0x26e70d(0x220)](_0x586dec){const _0x5254e6=a31_0x26e70d,{options:_0xa26ab7,args:_0x3306ea,tdx:_0x4f0fd8}=_0x586dec,_0x2158b0=_0x3306ea[0x0]||_0xa26ab7[_0x5254e6(0x352)];if(!_0x2158b0)return showParentSegmentNotSetError(_0x5254e6(0x249)+_0x5254e6(0x2d9)),0x1;_0xa26ab7['verbose']&&(console[_0x5254e6(0x374)](_0x5254e6(0x245)+_0xa26ab7[_0x5254e6(0x389)]),console[_0x5254e6(0x374)](_0x5254e6(0x1c1)+_0x2158b0));const _0xa3a6a9=await withSpinner(_0x5254e6(0x25b)+_0x2158b0+_0x5254e6(0x1f3),()=>_0x4f0fd8[_0x5254e6(0x2c6)][_0x5254e6(0x26e)](_0x2158b0),{'verbose':_0xa26ab7[_0x5254e6(0x27d)]}),_0xad487a=_0xa3a6a9[_0x5254e6(0x308)],_0x5f0ace=await withSpinner(_0x5254e6(0x3a5)+_0x2158b0+'\x27...',()=>_0x4f0fd8['realtime'][_0x5254e6(0x310)](_0xad487a),{'verbose':_0xa26ab7[_0x5254e6(0x27d)]}),_0x1c177c=_0x5f0ace[_0x5254e6(0x308)];return console[_0x5254e6(0x374)]('✔\x20Retrieved\x20RT\x20configuration\x20version'),_0xa26ab7[_0x5254e6(0x2cf)]===_0x5254e6(0x3bc)||_0xa26ab7[_0x5254e6(0x2cf)]===_0x5254e6(0x22c)?await handleSDKOutput([_0x1c177c],_0xa26ab7):(console[_0x5254e6(0x3a0)](_0x5254e6(0x2ca)+_0x1c177c['id']),console[_0x5254e6(0x3a0)]('audienceId:\x20'+_0x1c177c[_0x5254e6(0x210)]),console[_0x5254e6(0x3a0)](_0x5254e6(0x2b4)+_0x1c177c[_0x5254e6(0x2eb)]),console['log'](_0x5254e6(0x355)+_0x1c177c[_0x5254e6(0x247)]),console[_0x5254e6(0x3a0)](_0x5254e6(0x3a4)+_0x1c177c[_0x5254e6(0x1d5)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]=a31_0x26e70d(0x362);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x360);async[a31_0x26e70d(0x220)](_0x393330){const _0xe58ba0=a31_0x26e70d,{options:_0x5ea80b,args:_0x3c4e4c,tdx:_0x30ea52}=_0x393330,_0x4842f9=_0x3c4e4c[0x0]||_0x5ea80b['parentSegment'];if(!_0x4842f9)return showParentSegmentNotSetError(_0xe58ba0(0x23b)+_0xe58ba0(0x2ad)),0x1;const _0x53bc39=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4842f9+_0xe58ba0(0x1f3),()=>_0x30ea52[_0xe58ba0(0x2c6)][_0xe58ba0(0x26e)](_0x4842f9),{'verbose':_0x5ea80b[_0xe58ba0(0x27d)]}),_0x53ee03=_0x53bc39['data'],_0x24f49c=await withSpinner(_0xe58ba0(0x226)+_0x4842f9+'\x27...',()=>_0x30ea52[_0xe58ba0(0x2ee)][_0xe58ba0(0x3b0)](_0x53ee03),{'verbose':_0x5ea80b[_0xe58ba0(0x27d)]}),_0x46bbfc=_0x24f49c[_0xe58ba0(0x308)];console['error']('✔\x20Found\x20'+_0x46bbfc[_0xe58ba0(0x1fe)]+_0xe58ba0(0x29b)+(_0x46bbfc['length']!==0x1?'s':''));if(_0x5ea80b[_0xe58ba0(0x2cf)]===_0xe58ba0(0x3bc)||_0x5ea80b[_0xe58ba0(0x2cf)]==='jsonl')await handleSDKOutput(_0x46bbfc,_0x5ea80b);else{if(_0x46bbfc[_0xe58ba0(0x1fe)]===0x0)console[_0xe58ba0(0x3a0)]('No\x20personalization\x20services\x20configured'),console['error'](a31_0x15f12b['cyan'](_0xe58ba0(0x31e)));else for(const _0x305e39 of _0x46bbfc){console[_0xe58ba0(0x3a0)](a31_0x15f12b[_0xe58ba0(0x297)](_0x305e39['name'])+'\x20'+a31_0x15f12b[_0xe58ba0(0x291)](_0xe58ba0(0x300)+_0x305e39['id']+')'));_0x305e39[_0xe58ba0(0x368)]&&console['log']('\x20\x20'+a31_0x15f12b[_0xe58ba0(0x291)](_0x305e39[_0xe58ba0(0x368)]));if(_0x305e39['tokens']&&_0x305e39[_0xe58ba0(0x3c7)][_0xe58ba0(0x1fe)]>0x0)for(const _0x4ec7f3 of _0x305e39[_0xe58ba0(0x3c7)]){const _0x5e9cfd=_0x4ec7f3['allowedIps']?.['length']?_0x4ec7f3[_0xe58ba0(0x383)][_0xe58ba0(0x2c9)](',\x20'):_0xe58ba0(0x238);console[_0xe58ba0(0x3a0)]('\x20\x20'+a31_0x15f12b['cyan']('token:')+'\x20'+_0x4ec7f3[_0xe58ba0(0x2ea)]+'\x20'+a31_0x15f12b[_0xe58ba0(0x291)](_0xe58ba0(0x300)+_0x4ec7f3['id']+')')),console[_0xe58ba0(0x3a0)](_0xe58ba0(0x364)+a31_0x15f12b[_0xe58ba0(0x291)]('allowed\x20IPs:')+'\x20'+_0x5e9cfd);}else console[_0xe58ba0(0x3a0)]('\x20\x20'+a31_0x15f12b[_0xe58ba0(0x291)](_0xe58ba0(0x353)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]=a31_0x26e70d(0x33a);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x1f8);async[a31_0x26e70d(0x220)](_0x3f808c){const _0x33cf9a=a31_0x26e70d,{options:_0x363d37,args:_0x3e6df1,tdx:_0x26c634}=_0x3f808c,_0x38bac6=_0x363d37,_0x5e457b=_0x3e6df1[0x0],_0x4659ed=_0x3e6df1[0x1]||_0x363d37['parentSegment'];if(!_0x5e457b)return console[_0x33cf9a(0x374)](_0x33cf9a(0x395)),console[_0x33cf9a(0x374)](_0x33cf9a(0x396)),console[_0x33cf9a(0x374)](_0x33cf9a(0x260)),0x1;if(!_0x4659ed)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+_0x33cf9a(0x260)),0x1;const _0x27070b=await withSpinner(_0x33cf9a(0x25b)+_0x4659ed+'\x27...',()=>_0x26c634[_0x33cf9a(0x2c6)][_0x33cf9a(0x26e)](_0x4659ed),{'verbose':_0x363d37[_0x33cf9a(0x27d)]}),_0x797650=_0x27070b[_0x33cf9a(0x308)],_0x295552={'name':_0x5e457b,'description':_0x38bac6['description'],'public':_0x38bac6[_0x33cf9a(0x2d1)]},_0xb9759b=await withSpinner(_0x33cf9a(0x1e9)+_0x5e457b+_0x33cf9a(0x1f3),()=>_0x26c634['personalization']['create'](_0x797650,_0x295552),{'verbose':_0x363d37[_0x33cf9a(0x27d)]}),_0x447e1f=_0xb9759b[_0x33cf9a(0x308)];return console[_0x33cf9a(0x374)](_0x33cf9a(0x399)+_0x447e1f[_0x33cf9a(0x2ea)]+_0x33cf9a(0x2d4)+_0x447e1f['id']),await handleSDKOutput([_0x447e1f],_0x363d37),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]=a31_0x26e70d(0x253);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x39c);async[a31_0x26e70d(0x220)](_0x4a6361){const _0x3e0972=a31_0x26e70d,{options:_0x357530,args:_0x2d9a91,tdx:_0x2025bc}=_0x4a6361,_0x3cb2ae=_0x2d9a91[0x0],_0xa415c0=_0x2d9a91[0x1]||_0x357530[_0x3e0972(0x352)];if(!_0x3cb2ae)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console[_0x3e0972(0x374)](_0x3e0972(0x2ba)),console[_0x3e0972(0x374)](_0x3e0972(0x270)),0x1;if(!_0xa415c0)return showParentSegmentNotSetError(_0x3e0972(0x30e)+_0x3e0972(0x270)),0x1;const _0x9a72c7=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xa415c0+_0x3e0972(0x1f3),()=>_0x2025bc[_0x3e0972(0x2c6)][_0x3e0972(0x26e)](_0xa415c0),{'verbose':_0x357530['verbose']}),_0x43b62d=_0x9a72c7[_0x3e0972(0x308)],_0x2b7046=await withSpinner(_0x3e0972(0x254)+_0x3cb2ae+_0x3e0972(0x1f3),()=>_0x2025bc[_0x3e0972(0x2ee)][_0x3e0972(0x20b)](_0x43b62d,_0x3cb2ae),{'verbose':_0x357530[_0x3e0972(0x27d)]}),_0x1e41bb=_0x2b7046[_0x3e0972(0x308)];if(_0x357530[_0x3e0972(0x3bc)]||_0x357530[_0x3e0972(0x22c)])await handleSDKOutput([_0x1e41bb],_0x357530);else{console[_0x3e0972(0x3a0)](a31_0x15f12b[_0x3e0972(0x297)](_0x1e41bb[_0x3e0972(0x2ea)])+'\x20'+a31_0x15f12b[_0x3e0972(0x291)](_0x3e0972(0x300)+_0x1e41bb['id']+')'));_0x1e41bb[_0x3e0972(0x368)]&&console['log']('\x20\x20'+a31_0x15f12b['dim'](_0x1e41bb[_0x3e0972(0x368)]));console['log']('\x20\x20'+a31_0x15f12b[_0x3e0972(0x1e6)](_0x3e0972(0x2f3))+'\x20'+(_0x1e41bb[_0x3e0972(0x2d1)]?_0x3e0972(0x2fc):'no'));if(_0x1e41bb[_0x3e0972(0x3c7)]&&_0x1e41bb[_0x3e0972(0x3c7)][_0x3e0972(0x1fe)]>0x0)for(const _0x1ea28e of _0x1e41bb['tokens']){const _0x9b4664=_0x1ea28e[_0x3e0972(0x383)]?.[_0x3e0972(0x1fe)]?_0x1ea28e['allowedIps'][_0x3e0972(0x2c9)](',\x20'):_0x3e0972(0x238);console[_0x3e0972(0x3a0)]('\x20\x20'+a31_0x15f12b[_0x3e0972(0x1e6)]('token:')+'\x20'+_0x1ea28e['name']+'\x20'+a31_0x15f12b[_0x3e0972(0x291)](_0x3e0972(0x300)+_0x1ea28e['id']+')')),console[_0x3e0972(0x3a0)](_0x3e0972(0x364)+a31_0x15f12b[_0x3e0972(0x291)](_0x3e0972(0x288))+'\x20'+_0x9b4664);}else console[_0x3e0972(0x3a0)]('\x20\x20'+a31_0x15f12b['dim'](_0x3e0972(0x353)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{['name']=a31_0x26e70d(0x2a2);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x2c4);async[a31_0x26e70d(0x220)](_0xd962c7){const _0xc8802f=a31_0x26e70d,{options:_0x31a09d,args:_0xf43d18,tdx:_0x5cfe00}=_0xd962c7,_0x226f2e=_0xf43d18[0x0],_0x3e5d49=_0xf43d18[0x1]||_0x31a09d[_0xc8802f(0x352)];if(!_0x226f2e)return console[_0xc8802f(0x374)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0xc8802f(0x374)](_0xc8802f(0x2a7)),console['error'](_0xc8802f(0x2a9)),0x1;if(!_0x3e5d49)return showParentSegmentNotSetError(_0xc8802f(0x1f1)+_0xc8802f(0x2a9)),0x1;const _0x4ebe59=await withSpinner(_0xc8802f(0x25b)+_0x3e5d49+_0xc8802f(0x1f3),()=>_0x5cfe00[_0xc8802f(0x2c6)][_0xc8802f(0x26e)](_0x3e5d49),{'verbose':_0x31a09d['verbose']}),_0x6ccf05=_0x4ebe59[_0xc8802f(0x308)];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x226f2e+_0xc8802f(0x1f3),()=>_0x5cfe00['personalization'][_0xc8802f(0x295)](_0x6ccf05,_0x226f2e),{'verbose':_0x31a09d['verbose']}),console['error'](_0xc8802f(0x377)+_0x226f2e+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]=a31_0x26e70d(0x22d);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x203);async[a31_0x26e70d(0x220)](_0x3616ad){const _0xf43bd5=a31_0x26e70d,{options:_0x276f3c,args:_0x429311,tdx:_0x14fa7b}=_0x3616ad,_0x56bbd9=_0x276f3c,_0x450a33=_0x429311[0x0],_0xeb576d=_0x429311[0x1]||_0x276f3c['parentSegment'];if(!_0x450a33)return console['error'](_0xf43bd5(0x2e1)),console[_0xf43bd5(0x374)](_0xf43bd5(0x2bb)),console[_0xf43bd5(0x374)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x56bbd9[_0xf43bd5(0x2ea)])return console[_0xf43bd5(0x374)](_0xf43bd5(0x21f)),console['error'](_0xf43bd5(0x2bb)),0x1;if(!_0xeb576d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x28cb71=await withSpinner(_0xf43bd5(0x25b)+_0xeb576d+_0xf43bd5(0x1f3),()=>_0x14fa7b[_0xf43bd5(0x2c6)][_0xf43bd5(0x26e)](_0xeb576d),{'verbose':_0x276f3c['verbose']}),_0x34ede9=_0x28cb71[_0xf43bd5(0x308)],_0xb3c540={'name':_0x56bbd9[_0xf43bd5(0x2ea)]};_0x56bbd9[_0xf43bd5(0x368)]!==undefined&&(_0xb3c540[_0xf43bd5(0x368)]=_0x56bbd9['description']);const _0xf62bd=await withSpinner(_0xf43bd5(0x28c)+_0x450a33+'\x27...',()=>_0x14fa7b['personalization']['patch'](_0x34ede9,_0x450a33,_0xb3c540),{'verbose':_0x276f3c[_0xf43bd5(0x27d)]}),_0x4400f0=_0xf62bd[_0xf43bd5(0x308)];return console[_0xf43bd5(0x374)](_0xf43bd5(0x285)+_0x4400f0[_0xf43bd5(0x2ea)]+'\x27'),await handleSDKOutput([_0x4400f0],_0x276f3c),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']='ps:pz:service:token:create';[a31_0x26e70d(0x368)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a31_0x26e70d(0x220)](_0x213ab1){const _0x1e138f=a31_0x26e70d,{options:_0x45b981,args:_0x541c7d,tdx:_0x2f296f}=_0x213ab1,_0x1e9c48=_0x45b981,_0x6eef2=_0x541c7d[0x0],_0x4e8206=_0x541c7d[0x1],_0x561ec2=_0x541c7d[0x2]||_0x45b981[_0x1e138f(0x352)];if(!_0x6eef2)return console[_0x1e138f(0x374)](_0x1e138f(0x357)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x1e138f(0x374)](_0x1e138f(0x39a)),0x1;if(!_0x4e8206)return console[_0x1e138f(0x374)](_0x1e138f(0x2e1)),console[_0x1e138f(0x374)](_0x1e138f(0x1d1)),console[_0x1e138f(0x374)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x561ec2)return showParentSegmentNotSetError(_0x1e138f(0x3a7)+_0x1e138f(0x39a)),0x1;const _0x2aeb22=await withSpinner(_0x1e138f(0x25b)+_0x561ec2+_0x1e138f(0x1f3),()=>_0x2f296f['segment'][_0x1e138f(0x26e)](_0x561ec2),{'verbose':_0x45b981[_0x1e138f(0x27d)]}),_0x27990c=_0x2aeb22[_0x1e138f(0x308)],_0x54feb9={'name':_0x6eef2};_0x1e9c48[_0x1e138f(0x383)]&&(_0x54feb9[_0x1e138f(0x383)]=_0x1e9c48[_0x1e138f(0x383)][_0x1e138f(0x2ec)](',')[_0x1e138f(0x239)](_0x2a5a56=>_0x2a5a56[_0x1e138f(0x380)]()));_0x1e9c48[_0x1e138f(0x368)]&&(_0x54feb9[_0x1e138f(0x368)]=_0x1e9c48[_0x1e138f(0x368)]);const _0x2ed143=await withSpinner(_0x1e138f(0x32c)+_0x6eef2+_0x1e138f(0x23d)+_0x4e8206+_0x1e138f(0x1f3),()=>_0x2f296f['personalization']['createToken'](_0x27990c,_0x4e8206,_0x54feb9),{'verbose':_0x45b981[_0x1e138f(0x27d)]}),_0x5aab5f=_0x2ed143[_0x1e138f(0x308)];return console['error'](_0x1e138f(0x39b)+_0x5aab5f[_0x1e138f(0x2ea)]+'\x27\x20with\x20ID:\x20'+_0x5aab5f['id']),_0x5aab5f[_0x1e138f(0x217)]&&(console[_0x1e138f(0x374)](a31_0x15f12b[_0x1e138f(0x1d0)]('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console[_0x1e138f(0x374)](a31_0x15f12b[_0x1e138f(0x1e6)](_0x5aab5f[_0x1e138f(0x217)])),console[_0x1e138f(0x374)]('')),await handleSDKOutput([_0x5aab5f],_0x45b981),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]='ps:pz:service:token:delete';[a31_0x26e70d(0x368)]=a31_0x26e70d(0x3a2);async[a31_0x26e70d(0x220)](_0x5bd7fc){const _0x510252=a31_0x26e70d,{options:_0x2f1327,args:_0x4859f9,tdx:_0x560732}=_0x5bd7fc,_0x11523e=_0x4859f9[0x0],_0x5def9a=_0x4859f9[0x1]||_0x2f1327[_0x510252(0x352)];if(!_0x11523e)return console[_0x510252(0x374)](_0x510252(0x318)),console[_0x510252(0x374)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console[_0x510252(0x374)](_0x510252(0x277)),0x1;if(!_0x5def9a)return showParentSegmentNotSetError(_0x510252(0x311)+_0x510252(0x277)),0x1;const _0x45b8ec=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5def9a+_0x510252(0x1f3),()=>_0x560732[_0x510252(0x2c6)]['resolveParentId'](_0x5def9a),{'verbose':_0x2f1327[_0x510252(0x27d)]}),_0xb17dbf=_0x45b8ec['data'],_0x16f295=await withSpinner(_0x510252(0x345),()=>_0x560732[_0x510252(0x2ee)]['list'](_0xb17dbf),{'verbose':_0x2f1327['verbose']}),_0x53e7ee=_0x16f295[_0x510252(0x308)];let _0x5d063f;for(const _0x3c3775 of _0x53e7ee){if(_0x3c3775[_0x510252(0x3c7)]?.['some'](_0x24fcb7=>_0x24fcb7['id']===_0x11523e)){_0x5d063f=_0x3c3775['id'];break;}}if(!_0x5d063f)return console[_0x510252(0x374)](_0x510252(0x3c4)+_0x11523e+_0x510252(0x3be)),0x1;const _0xe39b97=await withSpinner('Deleting\x20token\x20\x27'+_0x11523e+_0x510252(0x1f3),()=>_0x560732[_0x510252(0x2ee)][_0x510252(0x34b)](_0xb17dbf,_0x5d063f,_0x11523e),{'verbose':_0x2f1327[_0x510252(0x27d)]}),_0x2a39cb=_0xe39b97[_0x510252(0x308)];return console[_0x510252(0x374)](_0x510252(0x1ec)+(_0x2a39cb[_0x510252(0x2ea)]||_0x11523e)+'\x27'),await handleSDKOutput([_0x2a39cb],_0x2f1327),0x0;}}function a31_0x4e5e(){const _0x1f5736=['\x20+\x20[','ID\x20Stitching:','ps:rt:configuration_versions','✘\x20Failed\x20to\x20rename\x20directory:\x20','realtime_enabled','toLowerCase','scheduleOption','\x0aError:','Join:','\x20RT-enabled\x20parent\x20segment','single','Creating\x20token\x20\x27','folder-segment','displayMasterInfo','push','Fetching\x20customers\x20schema...','Patching\x20personalization\x20\x27','getBehaviorNames','population','realtime','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Errors:','8qPvBWP','updateParent','darwin','ps:pz:service:create','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','Table:\x20','limit','✔\x20Found\x20personalization\x20\x27','displayValidateResults','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','state','customerGroupFile','/sessions/','Finding\x20service\x20for\x20token...','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','✔\x20No\x20changes\x20-\x20\x27','pushParentYaml','Show\x20a\x20specific\x20realtime\x20personalization','\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','deleteToken','rowCount','query','getParentFull','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','validateParentYaml','Creating\x20parent\x20segment\x20\x27','parentSegment','no\x20tokens\x20configured','displayColumns','eventKind:\x20','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Error:\x20Token\x20name\x20is\x20required','Created','workflowSessionId','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x27\x20and\x20run\x20workflow?','errors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','displaySampleData','\x27\x20is\x20already\x20up\x20to\x20date','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','ps:pz:service:list','createPersonalization','\x20\x20\x20\x20','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20service','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','Get\x20current\x20RT\x20configuration\x20version\x20status','string','payload','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','sourceTableError','repeat','Creating\x20personalization\x20\x27','error','\x20parent\x20segment\x20\x27','jobId','✔\x20Deleted\x20personalization\x20service\x20\x27','\x20\x20\x20','Source:','green','paused','SQL\x20query:\x0a','coveragePercent','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Create\x20parent\x20segment\x20\x27','trim','\x22,\x20\x22type\x22:\x20\x22','segment:parent:pull','allowedIps','Listing\x20parent\x20segments\x20matching\x20\x27','stringify','double','column','\x0a⚠️\x20\x20Migrating:\x20','site','Attributes','Enriched:','attributes','✔\x20Found\x20','\x20to\x20configure\x20your\x20personalization\x20service','\x20\x20Columns:\x20','RT\x202.0\x20Validate:','\x20\x201.\x20Edit\x20','folderId','sourceTableValid','collectSchema','Error:\x20Service\x20name\x20is\x20required','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','red','database','✔\x20Created\x20personalization\x20service\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','✔\x20Created\x20token\x20\x27','Show\x20personalization\x20service\x20details','/\x20directories\x20exist.','List\x20available\x20fields\x20for\x20segmentation','ignore','log','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Pattern:\x20','status:\x20','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','replace','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','RT\x202.0:','SELECT\x20*\x20FROM\x20','List\x20RT\x20journeys','\x0aChanges\x20to\x20apply\x20to\x20\x27','entryCriteria:','stop','Error:','information_schema','list','keyEventCriteria','Overwrite\x20\x27','5461768eKzYGi','filter','\x20--interval\x20','entryCriteria','Show\x20parent\x20segment\x20schema\x20(column\x20types)','parent_id','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','ps:pz:create','Personalization\x20service\x20description','json','Events:','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','behaviors','Updated','true','17597WRqWws','includeSensitive:','Error:\x20Token\x20\x27','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','9WbcQbY','tokens','/attempt/','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','displayBehaviorsStats','My\x20Service','personalizationServices','ps:pz:patch','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','No\x20parent\x20segments\x20match\x20pattern:\x20','segment:parent:fields','Get\x20SQL\x20query\x20for\x20parent\x20segment','Parent\x20segment:\x20','customers','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','pauseJourney','12pSvDfr','684155zvrDju','number','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20Added\x20RT\x202.0\x20template\x20section','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','platform','listPersonalizations','yellow','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','xdg-open','\x20Configuration\x20is\x20valid','status','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','behavior','\x20(paused)','Apply\x20changes\x20to\x20\x27','personalization_services','22gjIiWA','preview','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x20--behavior\x20\x22<name>\x22','unref','/app/workflows/','/\x20directory.\x0a','FINISHED','.yml','Validate:','Customers:','cyan','deletePersonalization','Rows:','Creating\x20personalization\x20service\x20\x27','displayPreviewHints','\x27\x20is\x20up\x20to\x20date','✔\x20Deleted\x20token\x20\x27','Aborted.','Show\x20parent\x20segment\x20details','segment:parent:create','\x20RT\x20journey','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','Listing\x20RT\x20journeys\x20for\x20\x27','\x27...','Fetching\x20parent\x20segment\x20\x27','idStitching','\x20configured','sections:','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','elapsedTimeMillis','type','varchar','text','\x20\x20Note:\x20','length','using\x20the\x20default\x20path:\x20','localeCompare','List\x20parent\x20segments','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','Listing\x20RT-enabled\x20parent\x20segments...','open','stitchingKeys','matchedCount','6677490GIKiCk','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','Output\x20file:\x20','get','\x5c$&','Error\x20reading\x20file:\x20','test','\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}','audienceId','Updating','ps:rt:jn:pause','\x20to\x20push\x20the\x20configuration','createParent','joinKey','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','value','\x20\x20\x20\x20-\x20','keyEventId','SELECT\x20*\x20FROM\x20(\x0a','Error\x20parsing\x20YAML:\x20','7tMUzLs','\x22\x20}','sort','Error:\x20--name\x20is\x20required','execute','getParentSQL','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','master','👥\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a','Listing\x20personalization\x20services\x20for\x20\x27','\x20Opening\x20','segment:parent:sql','<database>.<table>','Coverage:','displaySummary','jsonl','ps:pz:service:update','No\x20personalizations\x20configured','enriched','\x20parent\x20segment','displayAttributesStats','✔\x20Created\x20parent\x20segment\x20\x27','dirname','schemaError','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','{\x0a\x20\x20\x22database\x22:\x20\x22','any','map','Error:\x20File\x20not\x20found:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','/app/dw/parentSegments/','\x27\x20for\x20service\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x0aNew\x20parent\x20segment\x20\x27','reduce','Available\x20behaviors:','Delete\x20a\x20realtime\x20personalization','\x20kill','Session:','Site:\x20','\x0a\x20\x20\x20\x20}','eventKind','\x20is\x20already\x20up\x20to\x20date','Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a','null','sections','customerGroup','processedRows','Fetching\x20behavior\x20list...','1370352ToKiIN','last_page_viewed','page_view','addAttributesFile','ps:pz:service:show','Fetching\x20personalization\x20service\x20\x27','segment:parent:view','sampleData','match','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','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x20stage','Resolving\x20parent\x20segment\x20\x27','Listing\x20personalizations\x20for\x20\x27','✔\x20Updated\x20personalization\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','formatSchemaJson','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','segment:parent:push','To\x20view\x20sample\x20data:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x20rows\x20','Columns:','foreignKey','Fetching\x20sample\x20data...','14724876TVgYEe','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','toFixed','relationships','start','createdAt','resolveParentId','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','\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','run','columns','\x20personalization','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','launched','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','use','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','segment:parent:run','ps:rt:list','Master:','verbose','Attempt:','\x20total','file','updated:','behavior_','\x20RT\x20configuration\x20is\x20valid','Audience\x20ID:','✔\x20Updated\x20personalization\x20service\x20\x27','stats','\x20service(s)\x20configured','allowed\x20IPs:','previewParentYaml','YAML\x20file:\x20','segment:parent:show','Updating\x20personalization\x20service\x20\x27','schemaValid','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','attribute','/\x20and\x20','dim','✔\x20Created\x20personalization\x20\x27','\x0a✔\x20Workflow\x20started','tdx\x20ps\x20preview\x20','delete','\x0a\x20\x20\x20\x20]','bold','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','.yaml','\x20personalization\x20service','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Creating','Status:','ps:pz:service:delete','RT\x20Journey\x20ID:\x20','Preview:','valid','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','\x20behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','getPersonalization','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','No\x20RT\x20journeys\x20found','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','enabled','customersWithEvents','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','apply','isDirectory','identifier:\x20','listFields','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','payload:','\x20Context\x20set:\x20','win32','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','totalEvents','table','output','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','all','displayPreviewResults','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','/\x20→\x20','Delete\x20a\x20personalization\x20service','displayRealtimeInfo','segment','Analyzing\x20changes...','Error:\x20Personalization\x20ID\x20is\x20required','join','id:\x20','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Options:','customerPercent','Options:\x0a','format','interval','public','segment:parent:list','stageCount','\x27\x20with\x20ID:\x20','parent_segments','\x0a⚠️\x20\x20Both\x20','ps:pz:list','Resume\x20activations\x20in\x20an\x20RT\x20journey','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment','Name:\x20','-1d','\x0aNo\x20sample\x20data\x20available','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','message','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Personalization:','Error:\x20Service\x20ID\x20is\x20required','No\x20RT-enabled\x20parent\x20segments\x20found','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','Fetching\x20SQL\x20for\x20\x27','workflowAttemptId','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x20No\x20changes\x20-\x20','in\x20','\x20--attribute\x20\x22','name','identifier','split','workflowId','personalization','allValid','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','scheduleType','toLocaleString','public:','parentFolder','runParent','⚡\x20Enabled','utf-8','segment:parent:desc','label','keyEventId:','created:','yes','listParents','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','(id:\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','events','\x20\x20Database:\x20','ps:rt:jn:list','Attribute:','endsWith','.customers)','data','td_client_id','Update\x20a\x20realtime\x20personalization\x20entity','\x20true','parent_segment','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','\x20=\x20','getCurrentConfigVersion','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','/{name}.yml\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','✔\x20Renamed\x20directory\x20to\x20','column_type','2658224uwMEHo','Error:\x20Token\x20ID\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','addBehaviorsFile','Join\x20on:','\x20--behavior\x20\x22','Master\x20Table','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','timezone'];a31_0x4e5e=function(){return _0x1f5736;};return a31_0x4e5e();}export class PSPzListCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]=a31_0x26e70d(0x2d7);['description']='List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment';async[a31_0x26e70d(0x220)](_0x1bc85c){const _0x5e61e9=a31_0x26e70d,{options:_0x518044,args:_0x439284,tdx:_0x38cfd0}=_0x1bc85c,_0x29e35c=_0x439284[0x0]||_0x518044[_0x5e61e9(0x352)];if(!_0x29e35c)return showParentSegmentNotSetError(_0x5e61e9(0x2c2)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment'),0x1;const _0x2b24ac=await withSpinner(_0x5e61e9(0x25b)+_0x29e35c+_0x5e61e9(0x1f3),()=>_0x38cfd0[_0x5e61e9(0x2c6)][_0x5e61e9(0x26e)](_0x29e35c),{'verbose':_0x518044['verbose']}),_0x450c46=_0x2b24ac[_0x5e61e9(0x308)],_0x404464=await withSpinner(_0x5e61e9(0x25c)+_0x29e35c+'\x27...',()=>_0x38cfd0[_0x5e61e9(0x2ee)][_0x5e61e9(0x1cf)](_0x450c46),{'verbose':_0x518044[_0x5e61e9(0x27d)]}),_0x405c0e=_0x404464[_0x5e61e9(0x308)];console['error'](_0x5e61e9(0x38d)+_0x405c0e[_0x5e61e9(0x1fe)]+_0x5e61e9(0x274)+(_0x405c0e[_0x5e61e9(0x1fe)]!==0x1?'s':''));if(_0x518044['format']===_0x5e61e9(0x3bc)||_0x518044['format']==='jsonl')await handleSDKOutput(_0x405c0e,_0x518044);else{if(_0x405c0e[_0x5e61e9(0x1fe)]===0x0)console[_0x5e61e9(0x3a0)](_0x5e61e9(0x22e));else for(const _0x138289 of _0x405c0e){console[_0x5e61e9(0x3a0)](a31_0x15f12b[_0x5e61e9(0x297)](_0x138289[_0x5e61e9(0x2ea)])+'\x20'+a31_0x15f12b['dim']('(id:\x20'+_0x138289['id']+')'));_0x138289[_0x5e61e9(0x368)]&&console[_0x5e61e9(0x3a0)]('\x20\x20'+a31_0x15f12b[_0x5e61e9(0x291)](_0x138289['description']));const _0x3509c2=_0x138289['sections']?.['length']||0x0;console[_0x5e61e9(0x3a0)]('\x20\x20'+a31_0x15f12b[_0x5e61e9(0x1e6)]('sections:')+'\x20'+_0x3509c2);if(_0x138289[_0x5e61e9(0x24b)]&&_0x138289[_0x5e61e9(0x24b)][_0x5e61e9(0x1fe)]>0x0)for(const _0x40a0d7 of _0x138289[_0x5e61e9(0x24b)]){console['log'](_0x5e61e9(0x218)+_0x40a0d7[_0x5e61e9(0x2ea)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]='ps:pz:show';[a31_0x26e70d(0x368)]=a31_0x26e70d(0x349);async[a31_0x26e70d(0x220)](_0x241032){const _0x4f7999=a31_0x26e70d,{options:_0x24c63c,args:_0x201864,tdx:_0x1b8c92}=_0x241032,_0x14a072=_0x201864[0x0];if(!_0x14a072)return console[_0x4f7999(0x374)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x4f7999(0x374)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x240023=await withSpinner('Getting\x20personalization\x20\x27'+_0x14a072+_0x4f7999(0x1f3),()=>_0x1b8c92['personalization'][_0x4f7999(0x2aa)](_0x14a072),{'verbose':_0x24c63c[_0x4f7999(0x27d)]}),_0x504089=_0x240023[_0x4f7999(0x308)];console[_0x4f7999(0x374)](_0x4f7999(0x33f)+_0x504089[_0x4f7999(0x2ea)]+'\x27');if(_0x24c63c[_0x4f7999(0x2cf)]===_0x4f7999(0x3bc)||_0x24c63c[_0x4f7999(0x2cf)]===_0x4f7999(0x22c))await handleSDKOutput([_0x504089],_0x24c63c);else{console[_0x4f7999(0x3a0)](a31_0x15f12b[_0x4f7999(0x297)](_0x504089[_0x4f7999(0x2ea)])+'\x20'+a31_0x15f12b[_0x4f7999(0x291)](_0x4f7999(0x300)+_0x504089['id']+')'));_0x504089['description']&&console['log']('\x20\x20'+a31_0x15f12b['dim'](_0x504089[_0x4f7999(0x368)]));_0x504089['audienceId']&&console[_0x4f7999(0x3a0)]('\x20\x20'+a31_0x15f12b[_0x4f7999(0x1e6)]('audienceId:')+'\x20'+_0x504089[_0x4f7999(0x210)]);console['log']('\x20\x20'+a31_0x15f12b[_0x4f7999(0x1e6)](_0x4f7999(0x2fb))+'\x20'+_0x504089[_0x4f7999(0x26d)]),console[_0x4f7999(0x3a0)]('\x20\x20'+a31_0x15f12b[_0x4f7999(0x1e6)](_0x4f7999(0x281))+'\x20'+_0x504089['updatedAt']);const _0x509c49=_0x504089[_0x4f7999(0x24b)]?.[_0x4f7999(0x1fe)]||0x0;console[_0x4f7999(0x3a0)]('\x20\x20'+a31_0x15f12b[_0x4f7999(0x1e6)](_0x4f7999(0x1f7))+'\x20'+_0x509c49);if(_0x504089[_0x4f7999(0x24b)]&&_0x504089['sections'][_0x4f7999(0x1fe)]>0x0)for(const _0x1bd51b of _0x504089['sections']){console[_0x4f7999(0x3a0)](_0x4f7999(0x364)+a31_0x15f12b['bold'](_0x1bd51b['name'])+'\x20'+a31_0x15f12b[_0x4f7999(0x291)](_0x4f7999(0x300)+_0x1bd51b['id']+')')),_0x1bd51b[_0x4f7999(0x3b6)]&&(console[_0x4f7999(0x3a0)](_0x4f7999(0x1c4)+a31_0x15f12b[_0x4f7999(0x1e6)](_0x4f7999(0x3ac))+'\x20'+_0x1bd51b[_0x4f7999(0x3b6)][_0x4f7999(0x2ea)]),_0x1bd51b[_0x4f7999(0x3b6)][_0x4f7999(0x3b1)]?.[_0x4f7999(0x219)]&&console[_0x4f7999(0x3a0)]('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x15f12b[_0x4f7999(0x1e6)](_0x4f7999(0x2fa))+'\x20'+_0x1bd51b[_0x4f7999(0x3b6)]['keyEventCriteria'][_0x4f7999(0x219)])),_0x1bd51b['payload']&&console[_0x4f7999(0x3a0)]('\x20\x20\x20\x20\x20\x20'+a31_0x15f12b['cyan'](_0x4f7999(0x2b7))+'\x20'+JSON[_0x4f7999(0x385)](_0x1bd51b[_0x4f7999(0x36d)])),_0x1bd51b['includeSensitive']&&console[_0x4f7999(0x3a0)]('\x20\x20\x20\x20\x20\x20'+a31_0x15f12b[_0x4f7999(0x1e6)](_0x4f7999(0x3c3))+_0x4f7999(0x30b));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]='ps:pz:delete';[a31_0x26e70d(0x368)]=a31_0x26e70d(0x242);async[a31_0x26e70d(0x220)](_0x1acf51){const _0x35c908=a31_0x26e70d,{options:_0xdd3b7a,args:_0x390a74,tdx:_0x38517c}=_0x1acf51,_0xf16873=_0x390a74[0x0];if(!_0xf16873)return console[_0x35c908(0x374)](_0x35c908(0x2c8)),console[_0x35c908(0x374)](_0x35c908(0x1cd)),0x1;return await withSpinner('Deleting\x20personalization\x20\x27'+_0xf16873+_0x35c908(0x1f3),()=>_0x38517c[_0x35c908(0x2ee)][_0x35c908(0x1e7)](_0xf16873),{'verbose':_0xdd3b7a[_0x35c908(0x27d)]}),console[_0x35c908(0x374)]('✔\x20Deleted\x20personalization\x20\x27'+_0xf16873+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']=a31_0x26e70d(0x3ba);['description']='Create\x20a\x20realtime\x20personalization\x20entity';async[a31_0x26e70d(0x220)](_0x524096){const _0x163fc8=a31_0x26e70d,{options:_0x4d59d5,tdx:_0x3bfdeb}=_0x524096,_0x313ac3=_0x4d59d5;let _0x4ec870;if(_0x313ac3[_0x163fc8(0x280)]){_0x4ec870=await loadJSON(_0x313ac3['file'],!![]);if(!_0x4ec870[_0x163fc8(0x26b)]?.[_0x163fc8(0x2f4)])return console[_0x163fc8(0x374)](_0x163fc8(0x33c)),console['error']('Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:'),console['error'](_0x163fc8(0x20f)),0x1;}else{if(!_0x313ac3['name'])return console[_0x163fc8(0x374)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x163fc8(0x374)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x163fc8(0x374)](_0x163fc8(0x279)),0x1;if(_0x313ac3[_0x163fc8(0x368)]===undefined)return console[_0x163fc8(0x374)]('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x163fc8(0x374)](_0x163fc8(0x1d2)),console[_0x163fc8(0x374)](_0x163fc8(0x279)),0x1;if(_0x313ac3[_0x163fc8(0x392)]===undefined)return console[_0x163fc8(0x374)](_0x163fc8(0x3b9)),console[_0x163fc8(0x374)](_0x163fc8(0x2e3)),0x1;let _0xc42049=_0x313ac3[_0x163fc8(0x210)];if(!_0xc42049&&_0x4d59d5[_0x163fc8(0x352)]){const _0x5c5d21=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4d59d5[_0x163fc8(0x352)]+'\x27...',()=>_0x3bfdeb[_0x163fc8(0x2c6)][_0x163fc8(0x26e)](_0x4d59d5[_0x163fc8(0x352)]),{'verbose':_0x4d59d5[_0x163fc8(0x27d)]});_0xc42049=_0x5c5d21['data'];}let _0x312dc7;_0x313ac3[_0x163fc8(0x24b)]&&(_0x312dc7=await loadJSON(_0x313ac3[_0x163fc8(0x24b)],![]));const _0xf5487e=_0x313ac3[_0x163fc8(0x392)]===_0x163fc8(0x24a)?null:{'id':_0x313ac3['folderId'],'type':_0x163fc8(0x32d)};_0x4ec870={'attributes':{'name':_0x313ac3['name'],'description':_0x313ac3[_0x163fc8(0x368)]||null,..._0xc42049!==undefined&&{'audienceId':_0xc42049},..._0x312dc7!==undefined&&{'sections':_0x312dc7}},'relationships':{'parentFolder':{'data':_0xf5487e}}};}const _0x52773c=await withSpinner(_0x163fc8(0x373)+(_0x4ec870['attributes']?.[_0x163fc8(0x2ea)]??'')+'\x27...',()=>_0x3bfdeb[_0x163fc8(0x2ee)][_0x163fc8(0x363)](_0x4ec870),{'verbose':_0x4d59d5[_0x163fc8(0x27d)]}),_0x26262c=_0x52773c[_0x163fc8(0x308)];return console[_0x163fc8(0x374)](_0x163fc8(0x292)+_0x26262c[_0x163fc8(0x2ea)]+_0x163fc8(0x2d4)+_0x26262c['id']),await handleSDKOutput([_0x26262c],_0x4d59d5),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x26e70d(0x2ea)]=a31_0x26e70d(0x1bc);[a31_0x26e70d(0x368)]=a31_0x26e70d(0x30a);async['execute'](_0x29ce8a){const _0x4357a9=a31_0x26e70d,{options:_0x5511ec,args:_0x427a55}=_0x29ce8a,_0x44b62a=_0x5511ec,_0x3cb8f0=_0x427a55[0x0];if(!_0x3cb8f0)return console[_0x4357a9(0x374)](_0x4357a9(0x2c8)),console[_0x4357a9(0x374)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0x4357a9(0x374)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>'),0x1;let _0x3082a9;if(_0x44b62a[_0x4357a9(0x280)])_0x3082a9=await loadJSON(_0x44b62a[_0x4357a9(0x280)],!![]);else{if(!_0x44b62a['name'])return console['error'](_0x4357a9(0x269)),console[_0x4357a9(0x374)](_0x4357a9(0x3c9)),0x1;if(_0x44b62a[_0x4357a9(0x368)]===undefined)return console[_0x4357a9(0x374)](_0x4357a9(0x2ff)),console[_0x4357a9(0x374)](_0x4357a9(0x3c9)),0x1;let _0x49d6c1;_0x44b62a[_0x4357a9(0x24b)]&&(_0x49d6c1=await loadJSON(_0x44b62a[_0x4357a9(0x24b)],![])),_0x3082a9={'attributes':{'name':_0x44b62a[_0x4357a9(0x2ea)],'description':_0x44b62a[_0x4357a9(0x368)]||null,..._0x49d6c1!==undefined&&{'sections':_0x49d6c1}}};}const {tdx:_0x273754}=_0x29ce8a,_0x5cc054=await withSpinner(_0x4357a9(0x331)+_0x3cb8f0+_0x4357a9(0x1f3),()=>_0x273754[_0x4357a9(0x2ee)]['patchPersonalization'](_0x3cb8f0,_0x3082a9),{'verbose':_0x5511ec['verbose']}),_0x4fb239=_0x5cc054['data'];return console[_0x4357a9(0x374)](_0x4357a9(0x25d)+_0x4fb239[_0x4357a9(0x2ea)]+'\x27\x20(id:\x20'+_0x4fb239['id']+')'),await handleSDKOutput([_0x4fb239],_0x5511ec),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x26e70d(0x2ea)]='ps:pz:init';[a31_0x26e70d(0x368)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a31_0x26e70d(0x220)](_0x176cee){const _0x2d6df0=a31_0x26e70d,{options:_0x160842,args:_0x22a989}=_0x176cee,_0x56c121=_0x22a989[0x0]||_0x160842[_0x2d6df0(0x352)];if(!_0x56c121)return showParentSegmentNotSetError(_0x2d6df0(0x34f)+_0x2d6df0(0x34a)),0x1;const _0x774a66=resolveYamlFile(_0x56c121);if(!existsSync(_0x774a66))return showFileNotFoundError(_0x774a66,_0x56c121),0x1;let _0x1b45e2;try{_0x1b45e2=readFileSync(_0x774a66,_0x2d6df0(0x2f7));}catch(_0x576e81){const _0x5d9d2d=_0x576e81 instanceof Error?_0x576e81[_0x2d6df0(0x2de)]:String(_0x576e81);return console[_0x2d6df0(0x374)](_0x2d6df0(0x20d)+_0x5d9d2d),0x1;}let _0x3f45cd;try{_0x3f45cd=parseDef(_0x1b45e2);}catch(_0x316bd5){const _0x158d1f=_0x316bd5 instanceof Error?_0x316bd5[_0x2d6df0(0x2de)]:String(_0x316bd5);return console[_0x2d6df0(0x374)](a31_0x15f12b[_0x2d6df0(0x397)](_0x2d6df0(0x21b)+_0x158d1f)),0x1;}if(_0x3f45cd[_0x2d6df0(0x1da)]&&_0x3f45cd[_0x2d6df0(0x1da)][_0x2d6df0(0x1fe)]>0x0)return console[_0x2d6df0(0x374)](a31_0x15f12b[_0x2d6df0(0x1d0)](_0x2d6df0(0x3c5)+_0x774a66)),console[_0x2d6df0(0x374)](a31_0x15f12b[_0x2d6df0(0x291)](_0x2d6df0(0x378)+_0x3f45cd[_0x2d6df0(0x1da)][_0x2d6df0(0x1fe)]+_0x2d6df0(0x287))),0x1;!_0x3f45cd[_0x2d6df0(0x334)]&&(_0x3f45cd[_0x2d6df0(0x334)]={'events':[{'name':'page_view','source_table':_0x2d6df0(0x229)}],'attributes':[{'name':_0x2d6df0(0x250),'type':_0x2d6df0(0x32b)}],'id_stitching':{'primary_key':_0x3f45cd[_0x2d6df0(0x223)][_0x2d6df0(0x2bd)]===_0x2d6df0(0x1c2)?_0x2d6df0(0x309):'user_id'}});_0x3f45cd[_0x2d6df0(0x1da)]=[{'name':_0x2d6df0(0x1ba),'description':_0x2d6df0(0x3bb),'trigger_event':_0x2d6df0(0x251),'sections':[{'name':'Default','criteria':_0x2d6df0(0x3c1),'attributes':[_0x2d6df0(0x250)]}]}];const _0x100386=serializeDef(_0x3f45cd);return writeFileSync(_0x774a66,_0x100386,'utf-8'),console[_0x2d6df0(0x374)](a31_0x15f12b[_0x2d6df0(0x37a)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x15f12b[_0x2d6df0(0x1e6)](_0x774a66)),(!_0x3f45cd['realtime']||_0x1b45e2['indexOf']('realtime:')===-0x1)&&console[_0x2d6df0(0x374)](a31_0x15f12b[_0x2d6df0(0x37a)]('✔')+_0x2d6df0(0x1cc)),console[_0x2d6df0(0x374)]('\x0a'+a31_0x15f12b[_0x2d6df0(0x291)]('Next\x20steps:')),console[_0x2d6df0(0x374)](_0x2d6df0(0x391)+_0x774a66+_0x2d6df0(0x38e)),console[_0x2d6df0(0x374)]('\x20\x202.\x20Run\x20'+a31_0x15f12b[_0x2d6df0(0x291)]('tdx\x20ps\x20push\x20'+_0x56c121)+_0x2d6df0(0x213)),0x0;}}
1
+ function a31_0x56b2(){const _0x3bd456=['✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Created','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','rowCount','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','last_page_viewed','✔\x20Found\x20','\x20+\x20[','No\x20personalizations\x20configured','\x27\x20is\x20up\x20to\x20date','Events:','✔\x20Retrieved\x20RT\x20configuration\x20version','84415SYxnPA','\x20rows\x20','.customers)','Master\x20Table','customersWithEvents','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','✔\x20Updated\x20parent\x20segment\x20\x27','\x0aError:','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','darwin','addAttributes','ps:rt:list','Creating','toFixed','segment:parent:validate','✔\x20Renamed\x20directory\x20to\x20','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Error:\x20--attribute\x20requires\x20a\x20name\x0a','\x0aNew\x20parent\x20segment\x20\x27','Enriched:','interval','Deleting\x20personalization\x20service\x20\x27','\x20total','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20\x20\x20','\x0a⚠️\x20\x20Both\x20','joinKey','List\x20RT\x20journeys','idStitching','\x20Context\x20set:\x20','segment:parent:fields','\x27\x20for\x20service\x20\x27','Resume\x20activations\x20in\x20an\x20RT\x20journey','sections:','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x27\x20and\x20run\x20workflow?','ps:pz:service:token:create','preview','\x20No\x20changes\x20-\x20','start','\x20service','any','Status:','allValid','\x20\x20Columns:\x20','Patching\x20personalization\x20\x27','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20(paused)','ps:pz:service:delete','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','YAML\x20file:\x20','\x20--interval\x20','Options\x20(one\x20required):\x0a','attribute','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Error:\x20Service\x20ID\x20is\x20required','displayPreviewHints','column','no\x20tokens\x20configured','stop','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','workflowId','allowed\x20IPs:','48nxZyUX','ps:pz:init','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment','333650hRJWnx','Show\x20personalization\x20service\x20details','Error\x20reading\x20file:\x20','<database>.<table>','utf-8','`\x20to\x20download\x20the\x20configuration\x20first','updated:','\x20to\x20configure\x20your\x20personalization\x20service','Creating\x20parent\x20segment\x20\x27','✔\x20Found\x20personalization\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','filter','timezone','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Fetching\x20parent\x20segment\x20\x27','Finding\x20service\x20for\x20token...','single','all','master','jobId','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','/\x20directories\x20exist.','segment:parent:create','identifier','Pause\x20activations\x20in\x20an\x20RT\x20journey','✔\x20No\x20changes\x20-\x20\x27','columns','38jndChL','varchar','\x20parent\x20segment','displayMasterInfo','bold','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','listJourneys','%)\x20','\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\x20No\x20sample\x20data\x20available','Validating\x20configuration...','includeSensitive:','Creating\x20token\x20\x27','addBehaviors','platform','/\x20and\x20','/\x20→\x20','displayRealtimeInfo','Personalization\x20service\x20description','paused','Get\x20current\x20RT\x20configuration\x20version\x20status','Session:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','realtime:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','👥\x20','segment','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','behaviors','data','audienceId','\x20parent\x20segment\x20\x27','Output\x20Database:','customerPercent','Deleting\x20token\x20\x27','ps:pz:service:list','\x27\x20is\x20already\x20up\x20to\x20date','page_view','push','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','ps:pz:list','attributesFile','Error:','Fetching\x20SQL\x20for\x20\x27','\x20\x20\x20\x20\x20\x20','/app/workflows/','✔\x20Query\x20completed:\x20Processed\x20','1348tocnoG','listPersonalizations','limit','\x20=\x20','realtime','Error:\x20Parent\x20segment\x20name\x20is\x20required','ps:pz:delete','endsWith','\x20\x20\x20\x20-\x20','table','displayAttributesStats','Source:','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','schemaValid','\x20--behavior\x20\x22<name>\x22','keyEventCriteria','Listing\x20RT-enabled\x20parent\x20segments...','text','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','/app/dw/parentSegments/','type','✔\x20Created\x20personalization\x20service\x20\x27','trim','ps:pz:create','patch','entryCriteria:','createPersonalization','yes','\x22,\x20\x22type\x22:\x20\x22','attributes','resolveParentId','scheduleType','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','Deleting\x20personalization\x20\x27','join','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','segment:parent:show','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','displaySampleData','Available\x20behaviors:','patchPersonalization','Attribute:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','✘\x20Failed\x20to\x20rename\x20directory:\x20','enriched','workflowSessionId','To\x20view\x20sample\x20data:','✔\x20Created\x20personalization\x20\x27','Attributes:','web','primaryKey','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','Options:\x0a','Get\x20SQL\x20query\x20for\x20parent\x20segment','updateParent','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','includeSensitive','ps:rt:configuration_versions','dirname','Error:\x20Personalization\x20ID\x20is\x20required','relationships','createToken','\x20\x20Database:\x20','3383844hrheII','json','map','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','pauseJourney','Coverage:','Delete\x20a\x20personalization\x20service','column_type','Getting\x20personalization\x20\x27','My\x20Service','valid','1852410rBVozZ','stitchingKeys','\x5c$&','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Next\x20steps:','session','Attempt:','\x20to\x20push\x20the\x20configuration','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','personalizationServices','formatSchemaJson','\x20--attribute\x20\x22','✔\x20Deleted\x20personalization\x20service\x20\x27','true','Aborted.','Join\x20on:','getParentSQL','split','matchedCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','stats','getOutputDatabaseName','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','SELECT\x20*\x20FROM\x20','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Overwrite\x20\x27','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','listParents','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','token:','public','collectSchema','tdx\x20ps\x20preview\x20','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','parent_segments','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','.yaml','entryCriteria','Error:\x20File\x20not\x20found:\x20','message','Show\x20parent\x20segment\x20details','id:\x20','td_client_id','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','test','getCurrentConfigVersion','ps:rt:validate','in\x20','updatedAt','ps:pz:service:show','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','No\x20personalization\x20services\x20configured','payload:','\x20RT\x20configuration\x20is\x20valid','number','list','pushParentYaml','column_name','addBehaviorsFile','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','\x20personalization\x20service','\x20Added\x20personalization\x20template\x20to\x20','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x20\x202.\x20Run\x20','setJobId','Update\x20a\x20realtime\x20personalization\x20entity','foreignKey','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20\x20','Available\x20attributes:','Personalization:','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','No\x20parent\x20segments\x20found','resumeJourney','ps:pz:service:token:delete','Join:','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','sourceTableValid','(id:\x20','log','get','folderId','ps:pz:service:create','\x20configured','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','parentSegment','\x0aChanges\x20to\x20apply\x20to\x20\x27','FINISHED','\x20rows)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','payload','status:\x20','validateParentYaml','schemaError','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','ps:pz:service:update','segment:parent:view','\x27...','-1d','replace','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','errors','description','name','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x0a⚠️\x20\x20Migrating:\x20','22berWFR','personalization','deletePersonalization','coveragePercent','unref','\x20is\x20already\x20up\x20to\x20date','database','\x20Opening\x20','getParentFull','Errors:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Listing\x20parent\x20segments\x20matching\x20\x27','personalization_services','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','Error\x20parsing\x20YAML:\x20','cyan','displayBehaviorsStats','\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','Error:\x20Token\x20name\x20is\x20required','RT\x202.0:','Listing\x20parent\x20segments...','✔\x20Deleted\x20personalization\x20\x27','/attempt/','events','some','Analyzing\x20changes...','sampleData','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','keyEventId:','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Show\x20parent\x20segment\x20schema\x20(column\x20types)','1245UJOcEm','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','No\x20parent\x20segments\x20match\x20pattern:\x20','created:','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','dim','output','\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','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','create','enabled','Rows:','✔\x20Updated\x20personalization\x20\x27','5398rjLxvh','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','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\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','ps:rt:jn:list','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment','length','listFields','1626224aNDHwf','totalEvents','Customers:','\x0a✔\x20Workflow\x20started','✔\x20Deleted\x20token\x20\x27','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','allowedIps','ps:pz:patch','format','run','\x20\x20\x20','elapsedTimeMillis','verbose','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','repeat','Listing\x20personalization\x20services\x20for\x20\x27','string','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','double','\x0a\x20\x20]\x0a}\x0a','/sessions/','\x20true','\x20Configuration\x20is\x20valid','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','state','jsonl','value','Fetching\x20customers\x20schema...','customerGroup','Preview:','.yml','Fetching\x20personalization\x20service\x20\x27','behaviorsFile','\x20field','Behavior:','toLowerCase','segment:parent:list','match','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','realtime_enabled','xdg-open','Behaviors','error','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20Service\x20name\x20is\x20required','behavior','Table:\x20','launched','\x20tdx\x20wf\x20attempt\x20','identifier:\x20','ID\x20Stitching:','Updating\x20parent\x20segment\x20\x27','⚡\x20Not\x20enabled','segment:parent:preview','Output\x20file:\x20','sections','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','eventKind:\x20','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}','\x20kill','yellow','segment:parent:push','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','execute','Resolving\x20parent\x20segment\x20\x27','Updated','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','customers','✔\x20Created\x20parent\x20segment\x20\x27','Create\x20a\x20realtime\x20personalization\x20entity','Delete\x20a\x20realtime\x20personalization','toLocaleString','parent_segment','List\x20available\x20fields\x20for\x20segmentation','isDirectory','apply','displayColumns','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x20\x20Note:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment','label','Attributes','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','getBehaviorNames','scheduleOption','\x0aChanges\x20to\x20\x27','keyEventId','\x27\x20with\x20ID:\x20','Fetching\x20behavior\x20list...','file','population','Listing\x20RT\x20journeys\x20for\x20\x27','Schema\x20saved\x20to\x20','green','customerGroupFile','\x20personalization','Updating\x20personalization\x20service\x20\x27','Apply\x20changes\x20to\x20\x27','eventKind','displaySummary','stringify','Master:','folder-segment','keys','segment:parent:pull','behavior_','Site:\x20','{\x0a\x20\x20\x22database\x22:\x20\x22','\x22\x20}','win32','addAttributesFile','\x0aUsage:\x20tdx\x20ps\x20preview\x20','/\x20directory.\x0a','red','Parent\x20segment:\x20','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Default','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Updating','ps:rt:jn:resume','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','Listing\x20fields\x20for\x20\x27','site','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','sourceTableError','\x20service(s)\x20configured','Columns:','localeCompare','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','63SwSDQQ','displayPreviewResults','tokens','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','RT\x20Journey\x20ID:\x20','Database:\x20','\x20--behavior\x20\x22','Validating\x20RT\x20configuration...','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\x201.\x20Edit\x20','Create\x20parent\x20segment\x20\x27','Error:\x20--behavior\x20requires\x20a\x20name\x0a'];a31_0x56b2=function(){return _0x3bd456;};return a31_0x56b2();}const a31_0x5d5fca=a31_0x182e;(function(_0x264be5,_0x3ba5dd){const _0x289e7e=a31_0x182e,_0x1d56ef=_0x264be5();while(!![]){try{const _0x22a659=parseInt(_0x289e7e(0x12a))/0x1*(parseInt(_0x289e7e(0x237))/0x2)+parseInt(_0x289e7e(0x11c))/0x3*(-parseInt(_0x289e7e(0x267))/0x4)+parseInt(_0x289e7e(0x1d4))/0x5*(-parseInt(_0x289e7e(0x218))/0x6)+-parseInt(_0x289e7e(0x2b1))/0x7+-parseInt(_0x289e7e(0x134))/0x8+-parseInt(_0x289e7e(0x1bb))/0x9*(-parseInt(_0x289e7e(0x21b))/0xa)+parseInt(_0x289e7e(0x321))/0xb*(parseInt(_0x289e7e(0x2a6))/0xc);if(_0x22a659===_0x3ba5dd)break;else _0x1d56ef['push'](_0x1d56ef['shift']());}catch(_0x10f045){_0x1d56ef['push'](_0x1d56ef['shift']());}}}(a31_0x56b2,0x26650));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x4e77fb 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,loadJSON}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 a31_0x45df52 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=a31_0x5d5fca(0x2d5),LEGACY_PARENT_SEGMENT_DIR=a31_0x5d5fca(0x17e);function openBrowser(_0x296e67){const _0x3d2139=a31_0x5d5fca,_0x563896=process[_0x3d2139(0x245)],_0x2447e2=_0x563896===_0x3d2139(0x1dd)?'open':_0x563896===_0x3d2139(0x1a3)?_0x3d2139(0x1fd):_0x3d2139(0x15c);spawn(_0x2447e2,[_0x296e67],{'detached':!![],'stdio':'ignore'})[_0x3d2139(0x325)]();}function migrateLegacyDirectory(){const _0x5c260a=a31_0x5d5fca;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x15d002=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x15d002[_0x5c260a(0x180)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a31_0x45df52[_0x5c260a(0x171)](_0x5c260a(0x1ef)+LEGACY_PARENT_SEGMENT_DIR+_0x5c260a(0x246)+PARENT_SEGMENT_DIR+_0x5c260a(0x231))),console[_0x5c260a(0x15e)](a31_0x45df52[_0x5c260a(0x122)](_0x5c260a(0x2b9)+LEGACY_PARENT_SEGMENT_DIR+_0x5c260a(0x1a6))),![];console['error'](a31_0x45df52[_0x5c260a(0x171)](_0x5c260a(0x320)+LEGACY_PARENT_SEGMENT_DIR+_0x5c260a(0x247)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5c260a(0x15e)](a31_0x45df52[_0x5c260a(0x193)](_0x5c260a(0x1e3)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x3f32fc){const _0x305f9d=_0x3f32fc instanceof Error?_0x3f32fc['message']:String(_0x3f32fc);return console[_0x5c260a(0x15e)](a31_0x45df52[_0x5c260a(0x1a7)](_0x5c260a(0x292)+_0x305f9d+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x5d5fca(0x13d)](_0x548385){const _0x16186c=a31_0x5d5fca;return migrateLegacyDirectory(),super[_0x16186c(0x13d)](_0x548385);}}function resolveYamlFile(_0xc84f22){const _0x3ea537=a31_0x5d5fca;if(_0xc84f22[_0x3ea537(0x26e)](_0x3ea537(0x152))||_0xc84f22[_0x3ea537(0x26e)](_0x3ea537(0x2d7)))return _0xc84f22;return a31_0x4e77fb[_0x3ea537(0x289)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xc84f22)+_0x3ea537(0x152));}function formatProgressMessage(_0x40e2ba){const _0x10a26d=a31_0x5d5fca,_0x29ffbb=_0x40e2ba[_0x10a26d(0x159)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x29ffbb){const [,_0xc71e79,_0x11b4f7,_0x51525b='']=_0x29ffbb;return a31_0x45df52[_0x10a26d(0x122)](_0xc71e79+':')+'\x20'+_0x11b4f7+a31_0x45df52[_0x10a26d(0x122)](_0x51525b);}return a31_0x45df52[_0x10a26d(0x122)](_0x40e2ba);}function showFileNotFoundError(_0x448b01,_0x3c738e){const _0x57356c=a31_0x5d5fca;console['error'](a31_0x45df52[_0x57356c(0x1a7)](_0x57356c(0x2d9)+_0x448b01+'\x0a')),console[_0x57356c(0x15e)](a31_0x45df52[_0x57356c(0x10c)](_0x57356c(0x273)+_0x3c738e+_0x57356c(0x220)));}function displayRealtimeValidation(_0x24c8b2){const _0x3c484f=a31_0x5d5fca;if(!_0x24c8b2[_0x3c484f(0x26b)])return;const _0x20963e=_0x24c8b2[_0x3c484f(0x26b)],_0x3fde0d=_0x20963e[_0x3c484f(0x127)]?a31_0x45df52[_0x3c484f(0x193)]('⚡\x20Enabled'):a31_0x45df52[_0x3c484f(0x171)](_0x3c484f(0x168));console['error']('\x0a'+a31_0x45df52['dim'](_0x3c484f(0x110))+'\x20'+_0x3fde0d);if(_0x20963e[_0x3c484f(0x114)]&&_0x20963e['events'][_0x3c484f(0x132)]>0x0){console[_0x3c484f(0x15e)]('\x20\x20'+a31_0x45df52['dim'](_0x3c484f(0x1d2))+'\x20'+_0x20963e[_0x3c484f(0x114)]['length']+_0x3c484f(0x309));for(const _0x46c5f4 of _0x20963e[_0x3c484f(0x114)]){const _0x1fdd0f=_0x46c5f4[_0x3c484f(0x303)]===![]?a31_0x45df52[_0x3c484f(0x1a7)]('✘'):a31_0x45df52[_0x3c484f(0x193)]('✔');console['error'](_0x3c484f(0x1ee)+_0x1fdd0f+'\x20'+_0x46c5f4[_0x3c484f(0x31e)]),_0x46c5f4[_0x3c484f(0x1b4)]&&console[_0x3c484f(0x15e)](_0x3c484f(0x264)+a31_0x45df52[_0x3c484f(0x1a7)](_0x46c5f4[_0x3c484f(0x1b4)]));}}if(_0x20963e[_0x3c484f(0x284)]&&_0x20963e[_0x3c484f(0x284)][_0x3c484f(0x132)]>0x0){console['error']('\x20\x20'+a31_0x45df52['dim'](_0x3c484f(0x297))+'\x20'+_0x20963e['attributes'][_0x3c484f(0x132)]+_0x3c484f(0x309));for(const _0xd5f5cd of _0x20963e['attributes']){const _0x1d4679=_0xd5f5cd[_0x3c484f(0x2b0)]?a31_0x45df52[_0x3c484f(0x193)]('✔'):a31_0x45df52[_0x3c484f(0x1a7)]('✘');console[_0x3c484f(0x15e)]('\x20\x20\x20\x20'+_0x1d4679+'\x20'+_0xd5f5cd['name']+'\x20'+a31_0x45df52[_0x3c484f(0x122)]('('+_0xd5f5cd[_0x3c484f(0x27b)]+')'));}}if(_0x20963e[_0x3c484f(0x1f2)]){const _0x1c69b1=_0x20963e[_0x3c484f(0x1f2)]['stitchingKeys']?.[_0x3c484f(0x132)]?_0x3c484f(0x1cf)+_0x20963e[_0x3c484f(0x1f2)][_0x3c484f(0x2b2)][_0x3c484f(0x289)](',\x20')+']':'';console['error']('\x20\x20'+a31_0x45df52[_0x3c484f(0x122)](_0x3c484f(0x166))+'\x20'+_0x20963e['idStitching'][_0x3c484f(0x299)]+_0x1c69b1);}if(_0x20963e[_0x3c484f(0x2ba)]&&_0x20963e['personalizationServices'][_0x3c484f(0x132)]>0x0){console['error']('\x20\x20'+a31_0x45df52[_0x3c484f(0x122)](_0x3c484f(0x2f9))+'\x20'+_0x20963e[_0x3c484f(0x2ba)][_0x3c484f(0x132)]+_0x3c484f(0x1fe)+(_0x20963e[_0x3c484f(0x2ba)]['length']!==0x1?'s':''));for(const _0x323185 of _0x20963e[_0x3c484f(0x2ba)]){console[_0x3c484f(0x15e)]('\x20\x20\x20\x20-\x20'+_0x323185[_0x3c484f(0x31e)]);}}}function showParentSegmentNotSetError(_0x4901fd){const _0x493d71=a31_0x5d5fca;console['error'](a31_0x45df52[_0x493d71(0x171)](_0x493d71(0x24d))),console[_0x493d71(0x15e)](_0x4901fd);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x158);[a31_0x5d5fca(0x31d)]='List\x20parent\x20segments';async[a31_0x5d5fca(0x174)](_0x485530){const _0xc50cc9=a31_0x5d5fca,{options:_0x3be8aa,args:_0x4d8f40,tdx:_0x30dc0f}=_0x485530,_0x5b6a55=_0x4d8f40[0x0];_0x3be8aa[_0xc50cc9(0x140)]&&(console[_0xc50cc9(0x15e)](_0xc50cc9(0x1a0)+_0x3be8aa[_0xc50cc9(0x1b2)]),_0x5b6a55&&console[_0xc50cc9(0x15e)]('Pattern:\x20'+_0x5b6a55));const _0x2dae3e=await withSpinner(_0x5b6a55?_0xc50cc9(0x108)+_0x5b6a55+_0xc50cc9(0x318):_0xc50cc9(0x111),()=>_0x30dc0f['segment'][_0xc50cc9(0x2ce)](),{'verbose':_0x3be8aa['verbose']});let _0x13136f=_0x2dae3e['data'];if(_0x5b6a55){const _0x40f2e7=_0x5b6a55[_0xc50cc9(0x31a)](/[.+^${}()|[\]\\]/g,_0xc50cc9(0x2b3))[_0xc50cc9(0x31a)](/\*/g,'.*')[_0xc50cc9(0x31a)](/\?/g,'.'),_0x3b8ecd=new RegExp('^'+_0x40f2e7+'$','i');_0x13136f=_0x13136f[_0xc50cc9(0x226)](_0x6982fd=>_0x3b8ecd[_0xc50cc9(0x2df)](_0x6982fd[_0xc50cc9(0x284)][_0xc50cc9(0x31e)]));}_0x13136f['sort']((_0xcfdc64,_0x43e4c2)=>_0xcfdc64[_0xc50cc9(0x284)][_0xc50cc9(0x31e)][_0xc50cc9(0x1b7)](_0x43e4c2[_0xc50cc9(0x284)][_0xc50cc9(0x31e)])),console[_0xc50cc9(0x15e)](_0xc50cc9(0x1ce)+_0x13136f[_0xc50cc9(0x132)]+_0xc50cc9(0x239)+(_0x13136f['length']!==0x1?'s':''));const _0x11c21d=_0x550a9c=>{return getConsoleNextUrl(_0x3be8aa['site'],'/app/dw/parentSegments/'+_0x550a9c);};if(_0x3be8aa[_0xc50cc9(0x13c)]===_0xc50cc9(0x2a7)||_0x3be8aa[_0xc50cc9(0x13c)]===_0xc50cc9(0x14d)){const _0x17622f=_0x13136f[_0xc50cc9(0x2a8)](_0x38c2b6=>({..._0x38c2b6,'url':_0x11c21d(_0x38c2b6['id'])}));await handleSDKOutput(_0x17622f,_0x3be8aa);}else{if(_0x13136f['length']===0x0)_0x5b6a55?console[_0xc50cc9(0x305)](_0xc50cc9(0x11e)+_0x5b6a55):console[_0xc50cc9(0x305)](_0xc50cc9(0x2fd));else for(const _0x44d712 of _0x13136f){const _0x1577f3=_0x44d712[_0xc50cc9(0x284)]['population']?a31_0x45df52[_0xc50cc9(0x122)]('\x20('+formatRows(_0x44d712[_0xc50cc9(0x284)][_0xc50cc9(0x190)])+')'):'',_0x5eda05=hyperlink(_0x44d712[_0xc50cc9(0x284)]['name'],_0x11c21d(_0x44d712['id']));console['log'](_0xc50cc9(0x251)+_0x5eda05+_0x1577f3);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x232);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x11a);async[a31_0x5d5fca(0x174)](_0x395073){const _0x1924d5=a31_0x5d5fca,{options:_0x3a8b5c,args:_0x19cedf,tdx:_0x3b5835}=_0x395073;console[_0x1924d5(0x15e)](_0x1924d5(0x173)+_0x1924d5(0x23c)+_0x1924d5(0x2fc));const _0xdd2015=_0x3a8b5c;if(_0x19cedf['length']===0x0)return console[_0x1924d5(0x15e)](a31_0x45df52[_0x1924d5(0x1a7)](_0x1924d5(0x26c))),console[_0x1924d5(0x15e)](_0x1924d5(0x228)),0x1;const _0x46ea8f=_0x19cedf[0x0];if(!_0xdd2015['database']||!_0xdd2015[_0x1924d5(0x270)])return console[_0x1924d5(0x15e)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0xdd2015[_0x1924d5(0x140)]&&(console['error'](_0x1924d5(0x1a0)+_0xdd2015[_0x1924d5(0x1b2)]),console[_0x1924d5(0x15e)]('Name:\x20'+_0x46ea8f),console['error'](_0x1924d5(0x1c0)+_0xdd2015[_0x1924d5(0x103)]),console[_0x1924d5(0x15e)](_0x1924d5(0x162)+_0xdd2015[_0x1924d5(0x270)]));const _0x35af6c=await loadJSONFromOptions(_0xdd2015['attributes'],_0xdd2015[_0x1924d5(0x261)]),_0x579dc1=await loadJSONFromOptions(_0xdd2015['behaviors'],_0xdd2015[_0x1924d5(0x154)]),_0x24fccd=await loadJSONFromOptions(_0xdd2015[_0x1924d5(0x150)],_0xdd2015[_0x1924d5(0x194)]),_0x4d106b={'name':_0x46ea8f,'description':_0xdd2015[_0x1924d5(0x31d)],'scheduleType':_0xdd2015['scheduleType'],'scheduleOption':_0xdd2015[_0x1924d5(0x18a)],'timezone':_0xdd2015[_0x1924d5(0x227)],'master':{'parentDatabaseName':_0xdd2015[_0x1924d5(0x103)],'parentTableName':_0xdd2015[_0x1924d5(0x270)]},'attributes':_0x35af6c,'behaviors':_0x579dc1,'customerGroup':_0x24fccd},_0x22f2bc=await withSpinner(_0x1924d5(0x223)+_0x46ea8f+'\x27...',()=>_0x3b5835[_0x1924d5(0x252)]['createParent'](_0x4d106b),{'verbose':_0x3a8b5c[_0x1924d5(0x140)]}),_0x1dc6f9=_0x22f2bc[_0x1924d5(0x255)];return console[_0x1924d5(0x15e)](_0x1924d5(0x17a)+_0x1dc6f9[_0x1924d5(0x31e)]+_0x1924d5(0x18d)+_0x1dc6f9['id']),await handleSDKOutput([_0x1dc6f9],_0x3a8b5c),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]='segment:parent:update';[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x315);async[a31_0x5d5fca(0x174)](_0x289460){const _0x7e4d74=a31_0x5d5fca,{options:_0x37de22,args:_0x2d7e0e,tdx:_0x34ffdd}=_0x289460;console[_0x7e4d74(0x15e)](_0x7e4d74(0x225)+_0x7e4d74(0x23c)+_0x7e4d74(0x2fc));const _0x418e8c=_0x37de22;if(_0x2d7e0e['length']===0x0)return console[_0x7e4d74(0x15e)](a31_0x45df52[_0x7e4d74(0x1a7)](_0x7e4d74(0x26c))),console[_0x7e4d74(0x15e)](_0x7e4d74(0x15a)),0x1;const _0x5b57d9=_0x2d7e0e[0x0];_0x418e8c[_0x7e4d74(0x140)]&&(console['error'](_0x7e4d74(0x1a0)+_0x418e8c[_0x7e4d74(0x1b2)]),console['error'](_0x7e4d74(0x1a8)+_0x5b57d9));const _0x41081f=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x5b57d9+_0x7e4d74(0x318),()=>_0x34ffdd[_0x7e4d74(0x252)][_0x7e4d74(0x105)](_0x5b57d9),{'verbose':_0x418e8c[_0x7e4d74(0x140)]}),_0x1f9ac9=_0x41081f[_0x7e4d74(0x255)],_0x2d2a45=await loadJSONFromOptions(_0x418e8c[_0x7e4d74(0x1de)],_0x418e8c[_0x7e4d74(0x1a4)]),_0x307299=await loadJSONFromOptions(_0x418e8c[_0x7e4d74(0x244)],_0x418e8c[_0x7e4d74(0x2ed)]),_0x32f939={'name':_0x1f9ac9[_0x7e4d74(0x31e)],'description':_0x418e8c[_0x7e4d74(0x31d)]!==undefined?_0x418e8c['description']:_0x1f9ac9[_0x7e4d74(0x31d)],'scheduleType':_0x418e8c[_0x7e4d74(0x286)]!==undefined?_0x418e8c[_0x7e4d74(0x286)]:_0x1f9ac9[_0x7e4d74(0x286)],'scheduleOption':_0x418e8c[_0x7e4d74(0x18a)]!==undefined?_0x418e8c['scheduleOption']:_0x1f9ac9['scheduleOption'],'timezone':_0x418e8c[_0x7e4d74(0x227)]!==undefined?_0x418e8c['timezone']:_0x1f9ac9[_0x7e4d74(0x227)],'master':_0x1f9ac9[_0x7e4d74(0x22d)],'attributes':_0x2d2a45?[..._0x1f9ac9[_0x7e4d74(0x284)]||[],..._0x2d2a45]:_0x1f9ac9[_0x7e4d74(0x284)],'behaviors':_0x307299?[..._0x1f9ac9[_0x7e4d74(0x254)]||[],..._0x307299]:_0x1f9ac9[_0x7e4d74(0x254)],'customerGroup':_0x1f9ac9['customerGroup']},_0x5167a9=await withSpinner(_0x7e4d74(0x167)+_0x5b57d9+'\x27...',()=>_0x34ffdd[_0x7e4d74(0x252)][_0x7e4d74(0x29d)](_0x5b57d9,_0x32f939),{'verbose':_0x418e8c[_0x7e4d74(0x140)]}),_0x34073c=_0x5167a9[_0x7e4d74(0x255)];return console[_0x7e4d74(0x15e)](_0x7e4d74(0x1da)+_0x34073c[_0x7e4d74(0x31e)]+'\x27'),await handleSDKOutput([_0x34073c],_0x418e8c),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x19e);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x302);async[a31_0x5d5fca(0x174)](_0x13f699){const _0xc8e421=a31_0x5d5fca,{options:_0x366c24,args:_0x318b99,tdx:_0x1ea261}=_0x13f699,_0x302d47=_0x366c24,_0x3aa6b7=_0x318b99[0x0]||_0x366c24[_0xc8e421(0x30b)];if(!_0x3aa6b7)return showParentSegmentNotSetError(_0xc8e421(0x1a9)+_0xc8e421(0x1b8)),0x1;if(_0x302d47['use']&&_0x302d47[_0xc8e421(0x123)])return console[_0xc8e421(0x15e)](a31_0x45df52[_0xc8e421(0x1a7)](_0xc8e421(0x205))),console['error'](a31_0x45df52['dim']('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0xc8e421(0x15e)](a31_0x45df52[_0xc8e421(0x122)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0xc8e421(0x15e)](a31_0x45df52[_0xc8e421(0x10c)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x3a1f94=_0x302d47['output']||a31_0x4e77fb[_0xc8e421(0x289)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3aa6b7)+_0xc8e421(0x152));_0x302d47['verbose']&&(console[_0xc8e421(0x15e)]('Site:\x20'+_0x302d47['site']),console[_0xc8e421(0x15e)](_0xc8e421(0x1a8)+_0x3aa6b7),console[_0xc8e421(0x15e)](_0xc8e421(0x16a)+_0x3a1f94));const _0x24ff11=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x3aa6b7+_0xc8e421(0x318),()=>_0x1ea261[_0xc8e421(0x252)]['pullParentYaml'](_0x3aa6b7),{'verbose':_0x302d47[_0xc8e421(0x140)]}),_0x1a91f5=_0x24ff11[_0xc8e421(0x255)];if(existsSync(_0x3a1f94)){const _0x43c19d=readFileSync(_0x3a1f94,_0xc8e421(0x21f)),_0x44208c=generateDiff(_0x43c19d,_0x1a91f5);if(!hasChanges(_0x44208c))console[_0xc8e421(0x15e)](a31_0x45df52[_0xc8e421(0x193)]('✔')+_0xc8e421(0x1fc)+a31_0x45df52[_0xc8e421(0x10c)](_0x3a1f94)+_0xc8e421(0x102));else{console[_0xc8e421(0x15e)](_0xc8e421(0x18b)+_0x3a1f94+'\x27:'),console[_0xc8e421(0x15e)]('─'['repeat'](0x3c)),console['error'](formatDiffWithColors(_0x44208c)),console[_0xc8e421(0x15e)]('─'['repeat'](0x3c));if(!_0x302d47[_0xc8e421(0x282)]){if(!isInteractive())return console[_0xc8e421(0x15e)](a31_0x45df52[_0xc8e421(0x1a7)](_0xc8e421(0x1db)),_0xc8e421(0x1ba)),console['error'](a31_0x45df52[_0xc8e421(0x122)](_0xc8e421(0x1b3))),0x1;const _0x3e036d=await confirmKey(_0xc8e421(0x2cc)+_0x3a1f94+'\x27?');if(!_0x3e036d)return console[_0xc8e421(0x15e)](a31_0x45df52['yellow'](_0xc8e421(0x2bf))),0x1;}writeFileSync(_0x3a1f94,_0x1a91f5,_0xc8e421(0x21f)),console[_0xc8e421(0x15e)](a31_0x45df52[_0xc8e421(0x193)]('✔')+_0xc8e421(0x12d)+a31_0x45df52[_0xc8e421(0x10c)](_0x3a1f94));}}else{const _0x14daab=a31_0x4e77fb[_0xc8e421(0x2a1)](_0x3a1f94);!existsSync(_0x14daab)&&mkdirSync(_0x14daab,{'recursive':!![]}),writeFileSync(_0x3a1f94,_0x1a91f5,'utf-8'),console[_0xc8e421(0x15e)](a31_0x45df52[_0xc8e421(0x193)]('✔')+_0xc8e421(0x12d)+a31_0x45df52[_0xc8e421(0x10c)](_0x3a1f94));}return saveSessionContext({'parent_segment':_0x3aa6b7},_0x302d47[_0xc8e421(0x2b6)]),console[_0xc8e421(0x15e)](a31_0x45df52[_0xc8e421(0x193)]('✔')+_0xc8e421(0x1f3)+a31_0x45df52[_0xc8e421(0x122)](_0xc8e421(0x17e))+_0xc8e421(0x26a)+a31_0x45df52[_0xc8e421(0x10c)](_0x3aa6b7)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x172);['description']=a31_0x5d5fca(0x209);async[a31_0x5d5fca(0x174)](_0x4832bb){const _0x47a7df=a31_0x5d5fca,{options:_0x13626d,args:_0x3e2940,tdx:_0x5d820d}=_0x4832bb,_0x1cec57=_0x13626d,_0x32dc78=_0x3e2940[0x0]||_0x13626d[_0x47a7df(0x30b)];if(!_0x32dc78)return showParentSegmentNotSetError(_0x47a7df(0x2fa)+_0x47a7df(0x250)),0x1;const _0x4e4b3e=resolveYamlFile(_0x32dc78);if(!existsSync(_0x4e4b3e))return showFileNotFoundError(_0x4e4b3e,_0x32dc78),0x1;_0x1cec57[_0x47a7df(0x140)]&&(console[_0x47a7df(0x15e)]('Site:\x20'+_0x1cec57['site']),console[_0x47a7df(0x15e)](_0x47a7df(0x20b)+_0x4e4b3e));let _0x5f3b82;try{_0x5f3b82=readFileSync(_0x4e4b3e,_0x47a7df(0x21f));}catch(_0x56d0e0){const _0x482916=_0x56d0e0 instanceof Error?_0x56d0e0[_0x47a7df(0x2da)]:String(_0x56d0e0);return console[_0x47a7df(0x15e)](_0x47a7df(0x21d)+_0x482916),0x1;}const _0x1f9172=await withSpinner(_0x47a7df(0x116),()=>_0x5d820d['segment'][_0x47a7df(0x2eb)](_0x5f3b82),{'verbose':_0x1cec57[_0x47a7df(0x140)]}),_0x35afa7=_0x1f9172[_0x47a7df(0x255)],{isNew:_0x18c41a,name:_0x2ac8f8,hasChanges:_0x302da6,diffFormatted:_0x5f437b}=_0x35afa7;if(!_0x302da6)return console[_0x47a7df(0x15e)](_0x47a7df(0x235)+_0x2ac8f8+_0x47a7df(0x25c)),0x0;_0x18c41a?console['error'](_0x47a7df(0x1e6)+_0x2ac8f8+'\x27:'):console[_0x47a7df(0x15e)](_0x47a7df(0x30c)+_0x2ac8f8+'\x27:');console[_0x47a7df(0x15e)]('─'[_0x47a7df(0x142)](0x3c)),console[_0x47a7df(0x15e)](_0x5f437b),console[_0x47a7df(0x15e)]('─'[_0x47a7df(0x142)](0x3c));const _0x396b2a=_0x18c41a?_0x47a7df(0x1c5)+_0x2ac8f8+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x2ac8f8+'\x27?';if(!_0x1cec57[_0x47a7df(0x282)]){if(!isInteractive())return console[_0x47a7df(0x15e)](a31_0x45df52[_0x47a7df(0x1a7)](_0x47a7df(0x1db)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x47a7df(0x15e)](a31_0x45df52[_0x47a7df(0x122)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x32804b=await confirmKey(_0x396b2a);if(!_0x32804b)return console[_0x47a7df(0x15e)](a31_0x45df52[_0x47a7df(0x171)](_0x47a7df(0x2bf))),0x1;}const _0x4bf665=_0x18c41a?_0x47a7df(0x1e0):'Updating',_0x1fb205=await withSpinner(_0x4bf665+_0x47a7df(0x257)+_0x2ac8f8+_0x47a7df(0x318),()=>_0x35afa7[_0x47a7df(0x181)](),{'verbose':_0x1cec57['verbose']}),_0xd80aa0=_0x1fb205[_0x47a7df(0x255)],_0x2b8a5a=getConsoleNextUrl(_0x1cec57[_0x47a7df(0x1b2)],_0x47a7df(0x27a)+_0xd80aa0['id']),_0x3fde01=_0x18c41a?_0x47a7df(0x1c9):_0x47a7df(0x176);return console[_0x47a7df(0x15e)]('✔\x20'+_0x3fde01+'\x20parent\x20segment\x20\x27'+_0xd80aa0['name']+'\x27'),console[_0x47a7df(0x15e)]('\x20\x20'+_0x2b8a5a),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x1e2);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x230);async[a31_0x5d5fca(0x174)](_0x43ad6f){const _0x3cff93=a31_0x5d5fca,{options:_0x743b4a,args:_0x9f2781,tdx:_0x139019}=_0x43ad6f,_0x1e76dd=_0x743b4a,_0x4cc78e=_0x9f2781[0x0]||_0x743b4a['parentSegment'];if(!_0x4cc78e)return showParentSegmentNotSetError(_0x3cff93(0x2c5)+_0x3cff93(0x107)+_0x3cff93(0x29b)+_0x3cff93(0x2e5)+_0x3cff93(0x1ad)+_0x3cff93(0x1f8)),0x1;const _0x30f22c=resolveYamlFile(_0x4cc78e);if(!existsSync(_0x30f22c))return showFileNotFoundError(_0x30f22c,_0x4cc78e),0x1;_0x1e76dd[_0x3cff93(0x140)]&&(console[_0x3cff93(0x15e)](_0x3cff93(0x1a0)+_0x1e76dd[_0x3cff93(0x1b2)]),console[_0x3cff93(0x15e)](_0x3cff93(0x20b)+_0x30f22c));let _0x113499;try{_0x113499=readFileSync(_0x30f22c,_0x3cff93(0x21f));}catch(_0x3b533c){const _0x2fbe90=_0x3b533c instanceof Error?_0x3b533c[_0x3cff93(0x2da)]:String(_0x3b533c);return console[_0x3cff93(0x15e)](_0x3cff93(0x21d)+_0x2fbe90),0x1;}const _0x260380=createCommandSpinner(a31_0x45df52[_0x3cff93(0x122)](_0x3cff93(0x241)),{'verbose':_0x1e76dd['verbose']});_0x260380[_0x3cff93(0x1fd)]();const _0x11caee={'onProgress':_0x1724fe=>{_0x260380['text']=formatProgressMessage(_0x1724fe);}};if(_0x1e76dd[_0x3cff93(0x22d)])_0x11caee[_0x3cff93(0x22d)]=!![];if(_0x1e76dd['enriched'])_0x11caee['enriched']=!![];_0x1e76dd[_0x3cff93(0x20e)]&&(_0x11caee['attribute']=_0x1e76dd[_0x3cff93(0x20e)]);_0x1e76dd[_0x3cff93(0x161)]&&(_0x11caee[_0x3cff93(0x161)]=_0x1e76dd[_0x3cff93(0x161)]);if(_0x1e76dd['interval'])_0x11caee[_0x3cff93(0x1e8)]=_0x1e76dd[_0x3cff93(0x1e8)];let _0x2ea52b;try{_0x2ea52b=await _0x139019[_0x3cff93(0x252)][_0x3cff93(0x313)](_0x113499,_0x11caee),_0x260380[_0x3cff93(0x214)]();}catch(_0xf3cf28){_0x260380[_0x3cff93(0x214)]();throw _0xf3cf28;}const _0x43987e=_0x1e76dd[_0x3cff93(0x1e8)]||_0x3cff93(0x319);return this['displayValidateResults'](_0x2ea52b,_0x11caee,_0x30f22c,_0x43987e),_0x2ea52b['allValid']?0x0:0x1;}['displayValidateResults'](_0x4d32c5,_0x20167b,_0x222448,_0x23e641){const _0x42d4a1=a31_0x5d5fca;console[_0x42d4a1(0x15e)]('\x0a'+a31_0x45df52[_0x42d4a1(0x23b)]('Validate:')+'\x20'+_0x4d32c5[_0x42d4a1(0x31e)]),console[_0x42d4a1(0x15e)]('═'[_0x42d4a1(0x142)](0x3c)),this['displayMasterInfo'](_0x4d32c5);if(typeof _0x20167b['attribute']===_0x42d4a1(0x144)){this['displayAttributesStats'](_0x4d32c5),this[_0x42d4a1(0x199)](_0x4d32c5),this[_0x42d4a1(0x211)](_0x222448,_0x23e641,'attribute',_0x20167b[_0x42d4a1(0x20e)]);return;}if(_0x20167b[_0x42d4a1(0x20e)]===!![]){this[_0x42d4a1(0x271)](_0x4d32c5),this[_0x42d4a1(0x199)](_0x4d32c5),this['displayPreviewHints'](_0x222448,_0x23e641,_0x42d4a1(0x284));return;}if(typeof _0x20167b[_0x42d4a1(0x161)]===_0x42d4a1(0x144)){this[_0x42d4a1(0x10d)](_0x4d32c5,_0x23e641),this[_0x42d4a1(0x199)](_0x4d32c5),this[_0x42d4a1(0x211)](_0x222448,_0x23e641,_0x42d4a1(0x161),_0x20167b[_0x42d4a1(0x161)]);return;}if(_0x20167b[_0x42d4a1(0x161)]===!![]){this['displayBehaviorsStats'](_0x4d32c5,_0x23e641),this[_0x42d4a1(0x199)](_0x4d32c5),this[_0x42d4a1(0x211)](_0x222448,_0x23e641,'behaviors');return;}this[_0x42d4a1(0x271)](_0x4d32c5),this[_0x42d4a1(0x10d)](_0x4d32c5,_0x23e641),this[_0x42d4a1(0x248)](_0x4d32c5),this[_0x42d4a1(0x199)](_0x4d32c5),this[_0x42d4a1(0x211)](_0x222448,_0x23e641,_0x42d4a1(0x22c));}['displayRealtimeInfo'](_0x16d04e){displayRealtimeValidation(_0x16d04e);}['displayPreviewHints'](_0x1a834a,_0x34508d,_0xf87f49,_0x5db412){const _0x3e869f=a31_0x5d5fca;console[_0x3e869f(0x15e)]('\x0a'+a31_0x45df52[_0x3e869f(0x122)](_0x3e869f(0x295)));const _0x23d69a=_0x34508d!=='-1d'?_0x3e869f(0x20c)+_0x34508d:'';if(_0xf87f49===_0x3e869f(0x20e)&&_0x5db412)console[_0x3e869f(0x15e)]('\x20\x20'+a31_0x45df52['dim'](_0x3e869f(0x2d3)+_0x1a834a+_0x3e869f(0x2bc)+_0x5db412+'\x22'+_0x23d69a));else{if(_0xf87f49===_0x3e869f(0x161)&&_0x5db412)console[_0x3e869f(0x15e)]('\x20\x20'+a31_0x45df52[_0x3e869f(0x122)](_0x3e869f(0x2d3)+_0x1a834a+_0x3e869f(0x1c1)+_0x5db412+'\x22'+_0x23d69a));else(_0xf87f49===_0x3e869f(0x284)||_0xf87f49==='all')&&console[_0x3e869f(0x15e)]('\x20\x20'+a31_0x45df52['dim'](_0x3e869f(0x2d3)+_0x1a834a+'\x20--attribute\x20\x22<name>\x22'+_0x23d69a));}(_0xf87f49==='behaviors'||_0xf87f49===_0x3e869f(0x22c))&&console[_0x3e869f(0x15e)]('\x20\x20'+a31_0x45df52[_0x3e869f(0x122)](_0x3e869f(0x2d3)+_0x1a834a+_0x3e869f(0x275)+_0x23d69a)),_0xf87f49==='all'&&console[_0x3e869f(0x15e)]('\x20\x20'+a31_0x45df52[_0x3e869f(0x122)]('tdx\x20ps\x20preview\x20'+_0x1a834a+'\x20--enriched'+_0x23d69a));}[a31_0x5d5fca(0x23a)](_0x297d95){const _0x583ac2=a31_0x5d5fca,{master:_0x393763}=_0x297d95,_0x5a1966=_0x393763['schemaValid']?a31_0x45df52['green']('✔'):a31_0x45df52[_0x583ac2(0x1a7)]('✘');console[_0x583ac2(0x15e)]('\x0a'+a31_0x45df52[_0x583ac2(0x122)](_0x583ac2(0x1d7))),console[_0x583ac2(0x15e)](_0x5a1966+'\x20'+a31_0x45df52[_0x583ac2(0x23b)](_0x393763[_0x583ac2(0x103)]+'.'+_0x393763[_0x583ac2(0x270)])),_0x393763[_0x583ac2(0x274)]?_0x393763['rowCount']!==undefined&&console[_0x583ac2(0x15e)]('\x20\x20'+a31_0x45df52[_0x583ac2(0x122)](_0x583ac2(0x128))+'\x20'+a31_0x45df52['cyan'](formatRows(_0x393763[_0x583ac2(0x1cb)]))):console[_0x583ac2(0x15e)]('\x20\x20'+a31_0x45df52[_0x583ac2(0x1a7)](_0x583ac2(0x262))+'\x20'+_0x393763[_0x583ac2(0x314)]);}['displayAttributesStats'](_0x49ce2d){const _0x249c23=a31_0x5d5fca;if(_0x49ce2d[_0x249c23(0x284)][_0x249c23(0x132)]===0x0)return;console[_0x249c23(0x15e)]('\x0a'+a31_0x45df52[_0x249c23(0x122)](_0x249c23(0x187)));for(const _0x366890 of _0x49ce2d[_0x249c23(0x284)]){const _0x1ed8a9=_0x366890[_0x249c23(0x274)]?a31_0x45df52[_0x249c23(0x193)]('✔'):a31_0x45df52[_0x249c23(0x1a7)]('✘');let _0x9afc04='';if(_0x366890[_0x249c23(0x274)]&&_0x366890['matchedCount']!==undefined&&_0x366890[_0x249c23(0x324)]!==undefined){const _0x2644cc=_0x366890['coveragePercent'][_0x249c23(0x1e1)](0x1),_0x19d757=_0x366890[_0x249c23(0x324)]>=0x50?a31_0x45df52['green']:_0x366890[_0x249c23(0x324)]>=0x32?a31_0x45df52[_0x249c23(0x171)]:a31_0x45df52[_0x249c23(0x1a7)];_0x9afc04='\x20'+a31_0x45df52[_0x249c23(0x122)](_0x249c23(0x2ab))+'\x20'+_0x19d757(_0x2644cc+'%')+'\x20('+formatRows(_0x366890[_0x249c23(0x2c3)])+_0x249c23(0x30e);}console['error'](_0x1ed8a9+'\x20'+a31_0x45df52[_0x249c23(0x23b)](_0x366890['name'])+_0x9afc04),console['error']('\x20\x20'+a31_0x45df52[_0x249c23(0x122)](_0x249c23(0x272))+'\x20'+a31_0x45df52[_0x249c23(0x23b)](_0x366890['database']+'.'+_0x366890[_0x249c23(0x270)]));const _0x43f0ba=_0x366890[_0x249c23(0x1f0)]===_0x366890[_0x249c23(0x2f5)]?a31_0x45df52[_0x249c23(0x122)](_0x249c23(0x2c0))+'\x20'+_0x366890[_0x249c23(0x1f0)]:a31_0x45df52['dim'](_0x249c23(0x300))+'\x20'+_0x366890[_0x249c23(0x1f0)]+_0x249c23(0x26a)+_0x366890[_0x249c23(0x2f5)];console[_0x249c23(0x15e)]('\x20\x20'+_0x43f0ba),console[_0x249c23(0x15e)]('\x20\x20'+a31_0x45df52['dim'](_0x249c23(0x1b6))),this[_0x249c23(0x182)](_0x366890[_0x249c23(0x236)]),!_0x366890['schemaValid']&&console['error']('\x20\x20'+a31_0x45df52[_0x249c23(0x1a7)]('Error:')+'\x20'+_0x366890[_0x249c23(0x314)]);}}[a31_0x5d5fca(0x10d)](_0x3e2d4b,_0x3a255a){const _0x18a29d=a31_0x5d5fca;if(_0x3e2d4b['behaviors']['length']===0x0)return;console[_0x18a29d(0x15e)]('\x0a'+a31_0x45df52[_0x18a29d(0x122)](_0x18a29d(0x15d))+'\x20'+a31_0x45df52[_0x18a29d(0x122)]('('+_0x3a255a+')'));for(const _0x396a52 of _0x3e2d4b[_0x18a29d(0x254)]){const _0x21d70c=_0x396a52['schemaValid']?a31_0x45df52['green']('✔'):a31_0x45df52[_0x18a29d(0x1a7)]('✘');let _0x3120e6='';if(_0x396a52[_0x18a29d(0x274)]&&_0x396a52[_0x18a29d(0x1d8)]!==undefined&&_0x396a52['totalEvents']!==undefined){const _0x3bf737=_0x396a52[_0x18a29d(0x259)]?.['toFixed'](0x1)||'?',_0x680974=(_0x396a52[_0x18a29d(0x259)]??0x0)>=0x32?a31_0x45df52['green']:(_0x396a52['customerPercent']??0x0)>=0x14?a31_0x45df52[_0x18a29d(0x171)]:a31_0x45df52[_0x18a29d(0x1a7)];_0x3120e6='\x20'+a31_0x45df52[_0x18a29d(0x122)](_0x18a29d(0x136))+'\x20'+_0x680974(formatRows(_0x396a52[_0x18a29d(0x1d8)]))+'\x20('+_0x3bf737+_0x18a29d(0x23e)+a31_0x45df52['dim'](_0x18a29d(0x1d2))+'\x20'+a31_0x45df52[_0x18a29d(0x10c)](formatRows(_0x396a52[_0x18a29d(0x135)]));}console[_0x18a29d(0x15e)](_0x21d70c+'\x20'+a31_0x45df52[_0x18a29d(0x23b)](_0x396a52['name'])+_0x3120e6),console[_0x18a29d(0x15e)]('\x20\x20'+a31_0x45df52[_0x18a29d(0x122)](_0x18a29d(0x272))+'\x20'+a31_0x45df52[_0x18a29d(0x23b)](_0x396a52[_0x18a29d(0x103)]+'.'+_0x396a52[_0x18a29d(0x270)]));const _0x5ea9e5=_0x396a52[_0x18a29d(0x1f0)]===_0x396a52['foreignKey']?a31_0x45df52[_0x18a29d(0x122)](_0x18a29d(0x2c0))+'\x20'+_0x396a52[_0x18a29d(0x1f0)]:a31_0x45df52[_0x18a29d(0x122)](_0x18a29d(0x300))+'\x20'+_0x396a52[_0x18a29d(0x1f0)]+_0x18a29d(0x26a)+_0x396a52[_0x18a29d(0x2f5)];console[_0x18a29d(0x15e)]('\x20\x20'+_0x5ea9e5),console[_0x18a29d(0x15e)]('\x20\x20'+a31_0x45df52['dim'](_0x18a29d(0x1b6))),this['displayColumns'](_0x396a52[_0x18a29d(0x236)]),!_0x396a52[_0x18a29d(0x274)]&&console['error']('\x20\x20'+a31_0x45df52[_0x18a29d(0x1a7)](_0x18a29d(0x262))+'\x20'+_0x396a52[_0x18a29d(0x314)]);}}['displayColumns'](_0x511215){const _0x6dc5e9=a31_0x5d5fca;for(const _0x2a4d27 of _0x511215){_0x2a4d27[_0x6dc5e9(0x186)]===_0x2a4d27['column']||_0x2a4d27[_0x6dc5e9(0x212)]==='*'?console[_0x6dc5e9(0x15e)](_0x6dc5e9(0x26f)+_0x2a4d27[_0x6dc5e9(0x186)]):console[_0x6dc5e9(0x15e)](_0x6dc5e9(0x26f)+_0x2a4d27[_0x6dc5e9(0x186)]+'\x20'+a31_0x45df52[_0x6dc5e9(0x122)]('('+_0x2a4d27[_0x6dc5e9(0x212)]+')'));}}[a31_0x5d5fca(0x199)](_0x5c70b2){const _0x1dc7d9=a31_0x5d5fca;console['error']('─'[_0x1dc7d9(0x142)](0x3c));if(_0x5c70b2[_0x1dc7d9(0x31c)][_0x1dc7d9(0x132)]>0x0){console['error']('\x0a'+a31_0x45df52[_0x1dc7d9(0x1a7)]('Errors:'));for(const _0x3e22e8 of _0x5c70b2[_0x1dc7d9(0x31c)]){console[_0x1dc7d9(0x15e)]('\x20\x20'+a31_0x45df52[_0x1dc7d9(0x1a7)]('•')+'\x20'+_0x3e22e8);}}_0x5c70b2[_0x1dc7d9(0x201)]&&console['error']('\x0a'+a31_0x45df52[_0x1dc7d9(0x193)]('✔')+_0x1dc7d9(0x14a));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x169);[a31_0x5d5fca(0x31d)]='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async[a31_0x5d5fca(0x174)](_0x35a50a){const _0x4a30b9=a31_0x5d5fca,{options:_0x3f0aea,args:_0x231110,tdx:_0x53f5c6}=_0x35a50a,_0x3989b5=_0x3f0aea,_0x3f4ccc=_0x231110[0x0]||_0x3f0aea[_0x4a30b9(0x30b)];if(!_0x3f4ccc)return showParentSegmentNotSetError(_0x4a30b9(0x24e)+_0x4a30b9(0x31b)+_0x4a30b9(0x20d)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x4a30b9(0x183)+_0x4a30b9(0x2cb)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x3989b5[_0x4a30b9(0x22d)]&&!_0x3989b5[_0x4a30b9(0x20e)]&&!_0x3989b5[_0x4a30b9(0x161)]&&!_0x3989b5['enriched'])return console[_0x4a30b9(0x15e)](a31_0x45df52[_0x4a30b9(0x1a7)](_0x4a30b9(0x30a))),console[_0x4a30b9(0x15e)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x4a30b9(0x15e)]('Options:'),console['error'](_0x4a30b9(0x20f)),console[_0x4a30b9(0x15e)](_0x4a30b9(0x29e)),console[_0x4a30b9(0x15e)](_0x4a30b9(0x28a)),console[_0x4a30b9(0x15e)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x1c161b=resolveYamlFile(_0x3f4ccc);if(!existsSync(_0x1c161b))return showFileNotFoundError(_0x1c161b,_0x3f4ccc),0x1;_0x3989b5[_0x4a30b9(0x140)]&&(console['error'](_0x4a30b9(0x1a0)+_0x3989b5[_0x4a30b9(0x1b2)]),console[_0x4a30b9(0x15e)](_0x4a30b9(0x20b)+_0x1c161b));let _0x20291e;try{_0x20291e=readFileSync(_0x1c161b,'utf-8');}catch(_0x5c913a){const _0x3a123c=_0x5c913a instanceof Error?_0x5c913a[_0x4a30b9(0x2da)]:String(_0x5c913a);return console[_0x4a30b9(0x15e)]('Error\x20reading\x20file:\x20'+_0x3a123c),0x1;}let _0x1cb5e9;try{_0x1cb5e9=parseDef(_0x20291e);}catch(_0x4bc86c){const _0x414b26=_0x4bc86c instanceof Error?_0x4bc86c[_0x4a30b9(0x2da)]:String(_0x4bc86c);return console[_0x4a30b9(0x15e)](a31_0x45df52['red'](_0x4a30b9(0x10b)+_0x414b26)),0x1;}if(_0x3989b5['attribute']===!![]||_0x3989b5[_0x4a30b9(0x20e)]===''){const _0xf2a578=_0x1cb5e9[_0x4a30b9(0x284)]?.[_0x4a30b9(0x2a8)](_0x342185=>_0x342185[_0x4a30b9(0x31e)])||[];if(_0xf2a578['length']===0x0)console[_0x4a30b9(0x15e)](a31_0x45df52['red']('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x4a30b9(0x15e)](a31_0x45df52[_0x4a30b9(0x1a7)](_0x4a30b9(0x1e5))),console[_0x4a30b9(0x15e)](_0x4a30b9(0x2f8));for(const _0x20379c of _0xf2a578){console[_0x4a30b9(0x15e)]('\x20\x20'+a31_0x45df52[_0x4a30b9(0x10c)](_0x20379c));}console[_0x4a30b9(0x15e)](_0x4a30b9(0x1a5)+_0x3f4ccc+_0x4a30b9(0x2bc)+_0xf2a578[0x0]+'\x22');}return 0x1;}if(_0x3989b5[_0x4a30b9(0x161)]===!![]||_0x3989b5[_0x4a30b9(0x161)]===''){const _0x1b544f=_0x1cb5e9[_0x4a30b9(0x254)]?.[_0x4a30b9(0x2a8)](_0x3aa1ab=>_0x3aa1ab[_0x4a30b9(0x31e)])||[];if(_0x1b544f[_0x4a30b9(0x132)]===0x0)console[_0x4a30b9(0x15e)](a31_0x45df52[_0x4a30b9(0x1a7)](_0x4a30b9(0x215)));else{console[_0x4a30b9(0x15e)](a31_0x45df52['red'](_0x4a30b9(0x1c6))),console[_0x4a30b9(0x15e)](_0x4a30b9(0x28e));for(const _0x1c22f6 of _0x1b544f){console[_0x4a30b9(0x15e)]('\x20\x20'+a31_0x45df52[_0x4a30b9(0x10c)](_0x1c22f6));}console[_0x4a30b9(0x15e)](_0x4a30b9(0x1a5)+_0x3f4ccc+_0x4a30b9(0x1c1)+_0x1b544f[0x0]+'\x22');}return 0x1;}const _0x102f2a=createCommandSpinner(a31_0x45df52[_0x4a30b9(0x122)]('Fetching\x20sample\x20data...'),{'verbose':_0x3989b5[_0x4a30b9(0x140)]});_0x102f2a[_0x4a30b9(0x1fd)]();const _0x1d3e17={'onProgress':_0x11804f=>{const _0x4f9c6f=_0x4a30b9;_0x102f2a[_0x4f9c6f(0x278)]=formatProgressMessage(_0x11804f);}};if(_0x3989b5[_0x4a30b9(0x22d)])_0x1d3e17[_0x4a30b9(0x22d)]=!![];if(_0x3989b5[_0x4a30b9(0x20e)]&&typeof _0x3989b5['attribute']===_0x4a30b9(0x144))_0x1d3e17[_0x4a30b9(0x20e)]=_0x3989b5[_0x4a30b9(0x20e)];if(_0x3989b5['behavior']&&typeof _0x3989b5[_0x4a30b9(0x161)]===_0x4a30b9(0x144))_0x1d3e17[_0x4a30b9(0x161)]=_0x3989b5[_0x4a30b9(0x161)];if(_0x3989b5[_0x4a30b9(0x293)])_0x1d3e17[_0x4a30b9(0x293)]=!![];if(_0x3989b5[_0x4a30b9(0x1e8)])_0x1d3e17[_0x4a30b9(0x1e8)]=_0x3989b5[_0x4a30b9(0x1e8)];let _0x4881e8;try{_0x4881e8=await _0x53f5c6[_0x4a30b9(0x252)]['previewParentYaml'](_0x20291e,_0x1d3e17),_0x102f2a[_0x4a30b9(0x214)]();}catch(_0x68fd6){_0x102f2a[_0x4a30b9(0x214)]();throw _0x68fd6;}return await this[_0x4a30b9(0x1bc)](_0x4881e8,{'master':_0x3989b5['master'],'attribute':typeof _0x3989b5['attribute']===_0x4a30b9(0x144)?_0x3989b5[_0x4a30b9(0x20e)]:undefined,'behavior':typeof _0x3989b5[_0x4a30b9(0x161)]===_0x4a30b9(0x144)?_0x3989b5[_0x4a30b9(0x161)]:undefined,'enriched':_0x3989b5[_0x4a30b9(0x293)]}),_0x4881e8[_0x4a30b9(0x201)]?0x0:0x1;}async['displayPreviewResults'](_0x39ded9,_0x39c6ae){const _0x330631=a31_0x5d5fca;console[_0x330631(0x15e)]('\x0a'+a31_0x45df52['bold'](_0x330631(0x151))+'\x20'+_0x39ded9[_0x330631(0x31e)]),console['error']('═'[_0x330631(0x142)](0x3c));if(_0x39c6ae[_0x330631(0x22d)]&&_0x39ded9[_0x330631(0x117)]){const _0x38f25f=a31_0x45df52[_0x330631(0x122)](_0x330631(0x19b))+'\x20'+a31_0x45df52[_0x330631(0x23b)](_0x39ded9[_0x330631(0x22d)][_0x330631(0x103)]+'.'+_0x39ded9[_0x330631(0x22d)][_0x330631(0x270)]);await this['displaySampleData'](_0x38f25f,_0x39ded9[_0x330631(0x117)]);}else{if(_0x39c6ae[_0x330631(0x20e)]&&_0x39ded9[_0x330631(0x117)]){const _0x2afacd=a31_0x45df52[_0x330631(0x122)](_0x330631(0x290))+'\x20'+a31_0x45df52[_0x330631(0x23b)](_0x39c6ae['attribute']);await this[_0x330631(0x28d)](_0x2afacd,_0x39ded9[_0x330631(0x117)]);}else{if(_0x39c6ae['behavior']&&_0x39ded9[_0x330631(0x117)]){const _0x5f2d42=a31_0x45df52['dim'](_0x330631(0x156))+'\x20'+a31_0x45df52['bold'](_0x39c6ae[_0x330631(0x161)]);await this[_0x330631(0x28d)](_0x5f2d42,_0x39ded9[_0x330631(0x117)]);}else{if(_0x39c6ae[_0x330631(0x293)]&&_0x39ded9[_0x330631(0x117)]){const _0x53c71a=a31_0x45df52[_0x330631(0x122)](_0x330631(0x1e7))+'\x20'+a31_0x45df52[_0x330631(0x23b)]('Master\x20+\x20Attributes');await this[_0x330631(0x28d)](_0x53c71a,_0x39ded9[_0x330631(0x117)]);}else!_0x39ded9[_0x330631(0x117)]&&console['error']('\x0aNo\x20sample\x20data\x20available');}}}if(_0x39ded9['errors'][_0x330631(0x132)]>0x0){console[_0x330631(0x15e)]('─'[_0x330631(0x142)](0x3c)),console[_0x330631(0x15e)]('\x0a'+a31_0x45df52[_0x330631(0x1a7)](_0x330631(0x106)));for(const _0x1d6b67 of _0x39ded9[_0x330631(0x31c)]){console[_0x330631(0x15e)]('\x20\x20'+a31_0x45df52[_0x330631(0x1a7)]('•')+'\x20'+_0x1d6b67);}}}async[a31_0x5d5fca(0x28d)](_0x396156,_0xb5726){const _0x58454e=a31_0x5d5fca;if(_0xb5726['length']===0x0){console[_0x58454e(0x15e)]('\x0a'+_0x396156),console[_0x58454e(0x15e)](_0x58454e(0x240));return;}console[_0x58454e(0x15e)]('\x0a'+_0x396156);const _0x49f58f=Object[_0x58454e(0x19d)](_0xb5726[0x0])[_0x58454e(0x2a8)](_0x597a6c=>({'name':_0x597a6c,'type':typeof _0xb5726[0x0][_0x597a6c]===_0x58454e(0x2e9)?_0x58454e(0x146):_0x58454e(0x238)})),_0xf48d22={'queryId':_0x58454e(0x1fb),'columns':_0x49f58f,'data':_0xb5726,'stats':{'state':_0x58454e(0x30d),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xb5726[_0x58454e(0x132)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x34597e=formatAsTable(_0xf48d22,_0xb5726['length'],!![]);await writeOutput(_0x34597e,undefined,_0x58454e(0x270));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']='segment:parent:run';['description']=a31_0x5d5fca(0x1e4);async['execute'](_0x1fea0f){const _0x1f4b71=a31_0x5d5fca,{options:_0x3c041d,args:_0x1cbb65,tdx:_0x2b52b0}=_0x1fea0f,_0x451794=_0x3c041d,_0x1ff781=_0x1cbb65[0x0]||_0x3c041d[_0x1f4b71(0x30b)];if(!_0x1ff781)return showParentSegmentNotSetError(_0x1f4b71(0x16e)+_0x1f4b71(0x287)),0x1;const _0x5f4c8a=resolveYamlFile(_0x1ff781);if(existsSync(_0x5f4c8a)){_0x451794['verbose']&&console['error']('Found\x20YAML\x20file:\x20'+_0x5f4c8a);let _0x58096c;try{_0x58096c=readFileSync(_0x5f4c8a,_0x1f4b71(0x21f));}catch(_0x4d367e){const _0x3ca313=_0x4d367e instanceof Error?_0x4d367e[_0x1f4b71(0x2da)]:String(_0x4d367e);return console['error'](_0x1f4b71(0x21d)+_0x3ca313),0x1;}const _0x10be40=await withSpinner(_0x1f4b71(0x116),()=>_0x2b52b0[_0x1f4b71(0x252)][_0x1f4b71(0x2eb)](_0x58096c),{'verbose':_0x451794[_0x1f4b71(0x140)]}),_0x10ff3e=_0x10be40[_0x1f4b71(0x255)],{isNew:_0x49abf2,name:_0x151186,hasChanges:_0x33b1f6,diffFormatted:_0x59a19d}=_0x10ff3e;if(_0x33b1f6){_0x49abf2?console[_0x1f4b71(0x15e)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x151186+'\x27:'):console[_0x1f4b71(0x15e)](_0x1f4b71(0x30c)+_0x151186+'\x27:');console[_0x1f4b71(0x15e)]('─'[_0x1f4b71(0x142)](0x3c)),console[_0x1f4b71(0x15e)](_0x59a19d),console[_0x1f4b71(0x15e)]('─'[_0x1f4b71(0x142)](0x3c));const _0xddf603=_0x49abf2?_0x1f4b71(0x1c5)+_0x151186+'\x27\x20and\x20run\x20workflow?':_0x1f4b71(0x197)+_0x151186+_0x1f4b71(0x1f9);if(!_0x451794[_0x1f4b71(0x282)]){if(!isInteractive())return console['error'](a31_0x45df52[_0x1f4b71(0x1a7)](_0x1f4b71(0x1db)),_0x1f4b71(0x1ba)),console[_0x1f4b71(0x15e)](a31_0x45df52[_0x1f4b71(0x122)](_0x1f4b71(0x1b3))),0x1;const _0x19960f=await confirmKey(_0xddf603);if(!_0x19960f)return console['error'](a31_0x45df52[_0x1f4b71(0x171)](_0x1f4b71(0x2bf))),0x1;}const _0x33abc2=_0x49abf2?_0x1f4b71(0x1e0):_0x1f4b71(0x1ae);await withSpinner(_0x33abc2+_0x1f4b71(0x257)+_0x151186+_0x1f4b71(0x318),()=>_0x10ff3e[_0x1f4b71(0x181)](),{'verbose':_0x451794['verbose']});const _0x3cad1f=_0x49abf2?_0x1f4b71(0x1c9):_0x1f4b71(0x176);console[_0x1f4b71(0x15e)]('✔\x20'+_0x3cad1f+'\x20parent\x20segment\x20\x27'+_0x151186+'\x27');}else console[_0x1f4b71(0x15e)](_0x1f4b71(0x235)+_0x151186+_0x1f4b71(0x1d1));}const _0x5a697d=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x1ff781+_0x1f4b71(0x318),()=>_0x2b52b0['segment']['runParent'](_0x1ff781),{'verbose':_0x451794[_0x1f4b71(0x140)]}),_0x2f4e43=_0x5a697d[_0x1f4b71(0x255)],_0xcc5e8a=getConsoleUrl(_0x451794[_0x1f4b71(0x1b2)],_0x1f4b71(0x265)+_0x2f4e43[_0x1f4b71(0x216)]+_0x1f4b71(0x148)+_0x2f4e43[_0x1f4b71(0x294)]+_0x1f4b71(0x113)+_0x2f4e43['workflowAttemptId']);return console['error'](_0x1f4b71(0x137)),console['error']('\x20\x20'+a31_0x45df52[_0x1f4b71(0x122)]('Audience\x20ID:')+'\x20'+_0x2f4e43['audienceId']),console[_0x1f4b71(0x15e)]('\x20\x20'+a31_0x45df52[_0x1f4b71(0x122)](_0x1f4b71(0x200))+'\x20'+_0x2f4e43['status']),console[_0x1f4b71(0x15e)]('\x20\x20'+a31_0x45df52['dim'](_0x1f4b71(0x24c))+'\x20'+_0x2f4e43[_0x1f4b71(0x294)]),console[_0x1f4b71(0x15e)]('\x20\x20'+a31_0x45df52[_0x1f4b71(0x122)](_0x1f4b71(0x2b7))+'\x20'+_0x2f4e43['workflowAttemptId']),console['error']('\x20\x20'+_0xcc5e8a),console[_0x1f4b71(0x15e)]('\x0a'+a31_0x45df52['dim']('To\x20cancel:')+_0x1f4b71(0x164)+_0x2f4e43['workflowAttemptId']+_0x1f4b71(0x170)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x1f4);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x17f);async['execute'](_0x267ad2){const _0x6d2eae=a31_0x5d5fca,{options:_0x179ff1,args:_0x35bc2e,tdx:_0x4aa2d2}=_0x267ad2,_0x4058ba=_0x35bc2e[0x0]||_0x179ff1[_0x6d2eae(0x30b)];if(!_0x4058ba)return showParentSegmentNotSetError(_0x6d2eae(0x1c3)+'\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;_0x179ff1[_0x6d2eae(0x140)]&&(console['error']('Site:\x20'+_0x179ff1[_0x6d2eae(0x1b2)]),console[_0x6d2eae(0x15e)](_0x6d2eae(0x1a8)+_0x4058ba));const _0x1f755e=await withSpinner(_0x6d2eae(0x1b1)+_0x4058ba+_0x6d2eae(0x318),()=>_0x4aa2d2['segment'][_0x6d2eae(0x133)](_0x4058ba),{'verbose':_0x179ff1['verbose']}),_0x25319b=_0x1f755e[_0x6d2eae(0x255)];console['error'](_0x6d2eae(0x1ce)+_0x25319b['length']+_0x6d2eae(0x155)+(_0x25319b[_0x6d2eae(0x132)]!==0x1?'s':''));if(_0x179ff1[_0x6d2eae(0x2a7)]||_0x179ff1[_0x6d2eae(0x14d)])return await handleSDKOutput(_0x25319b,_0x179ff1),0x0;return displayFieldsHumanReadable(_0x25319b,_0x4058ba),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x317);['description']=a31_0x5d5fca(0x2db);async[a31_0x5d5fca(0x174)](_0x46adb3){const _0x205978=a31_0x5d5fca,{options:_0x3651c7,args:_0xda716,tdx:_0x29e4af}=_0x46adb3,_0x115f41=_0x3651c7,_0x39b5cb=_0xda716[0x0]||_0x3651c7[_0x205978(0x30b)];if(!_0x39b5cb)return showParentSegmentNotSetError(_0x205978(0x1c8)+_0x205978(0x1d9)+_0x205978(0x29b)+_0x205978(0x12c)),0x1;_0x3651c7[_0x205978(0x140)]&&(console[_0x205978(0x15e)]('Site:\x20'+_0x3651c7[_0x205978(0x1b2)]),console[_0x205978(0x15e)](_0x205978(0x1a8)+_0x39b5cb));const _0x465e27=await withSpinner(_0x205978(0x229)+_0x39b5cb+'\x27...',()=>_0x29e4af['segment'][_0x205978(0x105)](_0x39b5cb),{'verbose':_0x3651c7['verbose']}),_0x2868f4=_0x465e27[_0x205978(0x255)];if(_0x115f41[_0x205978(0x298)]){const _0x23edc8=getConsoleNextUrl(_0x115f41[_0x205978(0x1b2)],_0x205978(0x27a)+_0x2868f4['id']);return console[_0x205978(0x15e)](a31_0x45df52[_0x205978(0x193)]('✔')+_0x205978(0x104)+a31_0x45df52[_0x205978(0x10c)](_0x23edc8)),openBrowser(_0x23edc8),0x0;}return await handleSingleObjectOutput(_0x2868f4,_0x3651c7),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]='segment:parent:desc';[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x11b);async[a31_0x5d5fca(0x174)](_0x2c7c8f){const _0x1c85c7=a31_0x5d5fca,{options:_0x3814d6,args:_0x10cbad,tdx:_0xf6c976}=_0x2c7c8f,_0x477dad=_0x3814d6,_0x3b440b=_0x10cbad[0x0]||_0x3814d6[_0x1c85c7(0x30b)];if(!_0x3b440b)return showParentSegmentNotSetError(_0x1c85c7(0x1ac)+_0x1c85c7(0x124)+_0x1c85c7(0x29b)+_0x1c85c7(0x1ec)),0x1;_0x3814d6['verbose']&&(console['error'](_0x1c85c7(0x1a0)+_0x3814d6['site']),console[_0x1c85c7(0x15e)]('Parent\x20segment:\x20'+_0x3b440b));const _0x162b52=await withSpinner(_0x1c85c7(0x175)+_0x3b440b+_0x1c85c7(0x318),()=>_0xf6c976[_0x1c85c7(0x252)][_0x1c85c7(0x285)](_0x3b440b),{'verbose':_0x3814d6[_0x1c85c7(0x140)]}),_0x143286=_0x162b52[_0x1c85c7(0x255)],_0x2f2c53=_0xf6c976['segment'][_0x1c85c7(0x2c7)](_0x143286);if(_0x477dad['output']){const _0x2fad1f=await this['collectSchema'](_0x2c7c8f,_0x3b440b,_0x143286,_0x2f2c53),_0x58ffb5=this[_0x1c85c7(0x2bb)](_0x2fad1f);writeFileSync(_0x477dad[_0x1c85c7(0x123)],_0x58ffb5);const _0x895ca6=_0x2fad1f[_0x1c85c7(0x179)][_0x1c85c7(0x236)][_0x1c85c7(0x132)]+_0x2fad1f[_0x1c85c7(0x254)]['reduce']((_0x4da6db,_0x476bd9)=>_0x4da6db+_0x476bd9[_0x1c85c7(0x236)][_0x1c85c7(0x132)],0x0),_0x234302=_0x2fad1f[_0x1c85c7(0x254)][_0x1c85c7(0x226)](_0x3640fe=>_0x3640fe['columns'][_0x1c85c7(0x132)]===0x0)[_0x1c85c7(0x132)];return console[_0x1c85c7(0x305)](_0x1c85c7(0x192)+_0x477dad[_0x1c85c7(0x123)]),console['log'](_0x1c85c7(0x2a5)+_0x2f2c53),console[_0x1c85c7(0x305)]('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x2fad1f[_0x1c85c7(0x254)][_0x1c85c7(0x132)]+'\x20behaviors'),console[_0x1c85c7(0x305)](_0x1c85c7(0x202)+_0x895ca6+_0x1c85c7(0x1ea)),_0x234302>0x0&&console['log'](_0x1c85c7(0x184)+_0x234302+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console[_0x1c85c7(0x15e)]('\x0a'+a31_0x45df52[_0x1c85c7(0x23b)](_0x1c85c7(0x258))+'\x20'+a31_0x45df52[_0x1c85c7(0x10c)](_0x2f2c53));const _0x468a6c=await withSpinner(_0x1c85c7(0x14f),()=>_0xf6c976[_0x1c85c7(0x252)][_0x1c85c7(0x2c1)](_0x143286),{'verbose':_0x3814d6[_0x1c85c7(0x140)]});console[_0x1c85c7(0x15e)]('\x0a'+a31_0x45df52['bold'](_0x1c85c7(0x179))+'\x20'+a31_0x45df52[_0x1c85c7(0x122)]('('+_0x2f2c53+_0x1c85c7(0x1d6)));const _0x3f3a6f=await executeSchemaQuery(_0x468a6c['data'],_0xf6c976,_0x3814d6);await handleQueryOutput(_0x3f3a6f,_0x3814d6);const _0x445a07=await withSpinner('Fetching\x20behavior\x20list...',()=>_0xf6c976[_0x1c85c7(0x252)][_0x1c85c7(0x189)](_0x143286),{'verbose':_0x3814d6[_0x1c85c7(0x140)]});for(const _0xabd0af of _0x445a07[_0x1c85c7(0x255)]){const _0x385050='behavior_'+_0xabd0af[_0x1c85c7(0x157)]()['replace'](/\s+/g,'_'),_0x3e6135='SELECT\x20*\x20FROM\x20'+_0x2f2c53+'.'+_0x385050;console['error']('\x0a'+a31_0x45df52['bold'](_0xabd0af)+'\x20'+a31_0x45df52[_0x1c85c7(0x122)]('('+_0x2f2c53+'.'+_0x385050+')'));try{const _0x234450=await executeSchemaQuery(_0x3e6135,_0xf6c976,_0x3814d6);await handleQueryOutput(_0x234450,_0x3814d6);}catch{console['error'](a31_0x45df52['yellow']('\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)'));}}return 0x0;}async[a31_0x5d5fca(0x2d2)](_0x1b10d7,_0x514c72,_0x93c7eb,_0x3b9a95){const _0x18cf21=a31_0x5d5fca,{options:_0x4f1611,tdx:_0x66d424}=_0x1b10d7,_0x313701=await withSpinner(_0x18cf21(0x14f),()=>_0x66d424[_0x18cf21(0x252)][_0x18cf21(0x2c1)](_0x93c7eb),{'verbose':_0x4f1611[_0x18cf21(0x140)]}),_0x203366=await executeSchemaQuery(_0x313701[_0x18cf21(0x255)],_0x66d424,_0x4f1611),_0x140d8e=_0x203366[_0x18cf21(0x255)]['map'](_0x219482=>({'name':_0x219482[_0x18cf21(0x2ec)],'type':_0x219482[_0x18cf21(0x2ad)]})),_0x2678d7=await withSpinner(_0x18cf21(0x18e),()=>_0x66d424[_0x18cf21(0x252)][_0x18cf21(0x189)](_0x93c7eb),{'verbose':_0x4f1611[_0x18cf21(0x140)]}),_0x320358=[];for(const _0x55a674 of _0x2678d7['data']){const _0x59a9ec=_0x18cf21(0x19f)+_0x55a674[_0x18cf21(0x157)]()[_0x18cf21(0x31a)](/\s+/g,'_'),_0x19a399=_0x18cf21(0x2c9)+_0x3b9a95+'.'+_0x59a9ec;let _0x5909d6=[];try{const _0x5be08b=await executeSchemaQuery(_0x19a399,_0x66d424,_0x4f1611);_0x5909d6=_0x5be08b[_0x18cf21(0x255)][_0x18cf21(0x2a8)](_0x22c4d6=>({'name':_0x22c4d6[_0x18cf21(0x2ec)],'type':_0x22c4d6['column_type']}));}catch{}_0x320358[_0x18cf21(0x25e)]({'table':_0x59a9ec,'columns':_0x5909d6});}return{'database':_0x3b9a95,'parent_segment':_0x514c72,'parent_id':_0x93c7eb,'customers':{'table':_0x18cf21(0x179),'columns':_0x140d8e},'behaviors':_0x320358};}[a31_0x5d5fca(0x2bb)](_0x28a03a){const _0x353129=a31_0x5d5fca,_0x1c553a=_0x29f71e=>{const _0x4f6867=a31_0x182e;if(_0x29f71e[_0x4f6867(0x132)]===0x0)return'[]';const _0x14e4e8=_0x29f71e[_0x4f6867(0x2a8)](_0x5c72aa=>_0x4f6867(0x2f6)+_0x5c72aa['name']+_0x4f6867(0x283)+_0x5c72aa[_0x4f6867(0x27b)]+_0x4f6867(0x1a2));return'[\x0a'+_0x14e4e8[_0x4f6867(0x289)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x195ebb=_0x28a03a['behaviors'][_0x353129(0x2a8)](_0x20d734=>{const _0x380c82=_0x353129;return _0x380c82(0x22f)+_0x20d734[_0x380c82(0x270)]+_0x380c82(0x10a)+_0x1c553a(_0x20d734[_0x380c82(0x236)])[_0x380c82(0x31a)](/^/gm,'\x20\x20')[_0x380c82(0x27d)]()+'\x0a\x20\x20\x20\x20}';})[_0x353129(0x289)](',\x0a');return _0x353129(0x1a1)+_0x28a03a[_0x353129(0x103)]+_0x353129(0x2b4)+_0x28a03a[_0x353129(0x17e)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x28a03a['parent_id']+_0x353129(0x208)+_0x28a03a['customers']['table']+_0x353129(0x121)+_0x1c553a(_0x28a03a['customers'][_0x353129(0x236)])[_0x353129(0x31a)](/^/gm,'\x20\x20')[_0x353129(0x27d)]()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x195ebb+_0x353129(0x147);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]='segment:parent:sql';[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x29c);async['execute'](_0x4fe5d8){const _0x2ef17e=a31_0x5d5fca,{options:_0xb20f19,args:_0x287ee1,tdx:_0x165eed}=_0x4fe5d8,_0x4ce72a=_0x287ee1[0x0]||_0xb20f19['parentSegment'];if(!_0x4ce72a)return showParentSegmentNotSetError(_0x2ef17e(0x188)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0xb20f19[_0x2ef17e(0x140)]&&(console[_0x2ef17e(0x15e)](_0x2ef17e(0x1a0)+_0xb20f19[_0x2ef17e(0x1b2)]),console[_0x2ef17e(0x15e)]('Parent\x20segment:\x20'+_0x4ce72a));const _0x994fdc=await withSpinner(_0x2ef17e(0x175)+_0x4ce72a+'\x27...',()=>_0x165eed[_0x2ef17e(0x252)]['resolveParentId'](_0x4ce72a),{'verbose':_0xb20f19['verbose']}),_0x125358=_0x994fdc[_0x2ef17e(0x255)],_0x3f841b=await withSpinner(_0x2ef17e(0x263)+_0x4ce72a+_0x2ef17e(0x318),()=>_0x165eed[_0x2ef17e(0x252)][_0x2ef17e(0x2c1)](_0x125358),{'verbose':_0xb20f19[_0x2ef17e(0x140)]}),_0xb20a07=_0x3f841b[_0x2ef17e(0x255)];return _0xb20f19[_0x2ef17e(0x13c)]===_0x2ef17e(0x2a7)||_0xb20f19[_0x2ef17e(0x13c)]===_0x2ef17e(0x14d)?await handleSDKOutput([{'sql':_0xb20a07}],_0xb20f19):console[_0x2ef17e(0x305)](_0xb20a07),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x28b);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x141);async['execute'](_0x565b14){const _0xa548ac=a31_0x5d5fca,{options:_0x4c3351,args:_0x2e276b,tdx:_0x32ac99}=_0x565b14,_0x578e5b=_0x2e276b[0x0]||_0x4c3351[_0xa548ac(0x30b)];if(!_0x578e5b)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'+_0xa548ac(0x2d6)),0x1;_0x4c3351[_0xa548ac(0x140)]&&(console[_0xa548ac(0x15e)](_0xa548ac(0x1a0)+_0x4c3351[_0xa548ac(0x1b2)]),console[_0xa548ac(0x15e)](_0xa548ac(0x1a8)+_0x578e5b));const _0x1a5d19=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x578e5b+_0xa548ac(0x318),()=>_0x32ac99[_0xa548ac(0x252)][_0xa548ac(0x285)](_0x578e5b),{'verbose':_0x4c3351[_0xa548ac(0x140)]}),_0x1ec88d=_0x1a5d19[_0xa548ac(0x255)],_0x446d72=await withSpinner(_0xa548ac(0x263)+_0x578e5b+_0xa548ac(0x318),()=>_0x32ac99[_0xa548ac(0x252)]['getParentSQL'](_0x1ec88d),{'verbose':_0x4c3351[_0xa548ac(0x140)]});let _0x40c5a6=_0x446d72['data'];const _0x137ef9=resolveLimit(_0x4c3351[_0xa548ac(0x269)],DEFAULT_DISPLAY_LIMIT),_0x5264a8=/\bLIMIT\s+\d+/i[_0xa548ac(0x2df)](_0x40c5a6);!_0x5264a8&&(_0x40c5a6=_0x40c5a6[_0xa548ac(0x27d)]()[_0xa548ac(0x31a)](/;+$/,''),_0x40c5a6=_0xa548ac(0x15f)+_0x40c5a6+_0xa548ac(0x1ed)+_0x137ef9);_0x4c3351['verbose']&&console[_0xa548ac(0x15e)]('SQL\x20query:\x0a'+_0x40c5a6);const _0x6e519=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0xd31b1d=>{const _0x577681=await _0x32ac99['query']['execute'](_0x40c5a6,{'catalog':'td','schema':'information_schema','onJobId':_0x3566b3=>{const _0x3836b3=a31_0x182e;_0xd31b1d[_0x3836b3(0x2f3)](_0x3566b3);}});return _0x577681;},{'verbose':_0x4c3351[_0xa548ac(0x140)]}),_0x2d925a=_0x6e519['data'],_0x4c4810=_0x2d925a['jobId']?'\x20[Job\x20ID:\x20'+_0x2d925a[_0xa548ac(0x22e)]+']':'';return console['error'](_0xa548ac(0x266)+_0x2d925a['stats']['processedRows'][_0xa548ac(0x17d)]()+_0xa548ac(0x1d5)+(_0xa548ac(0x2e2)+formatElapsed(_0x2d925a[_0xa548ac(0x2c6)][_0xa548ac(0x13f)])+_0x4c4810)),await handleQueryOutput(_0x2d925a,_0x4c3351),0x0;}}function a31_0x182e(_0x29ca39,_0x47abba){_0x29ca39=_0x29ca39-0x102;const _0x56b2f0=a31_0x56b2();let _0x182e21=_0x56b2f0[_0x29ca39];return _0x182e21;}export class PSRtListCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x1df);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x118);async[a31_0x5d5fca(0x174)](_0x5211db){const _0x57455c=a31_0x5d5fca,{options:_0x59c872,args:_0x22ce85,tdx:_0x151664}=_0x5211db,_0x57365b=_0x22ce85[0x0],_0x364fc7=await withSpinner(_0x57365b?_0x57455c(0x2c8)+_0x57365b+_0x57455c(0x318):_0x57455c(0x277),()=>_0x151664[_0x57455c(0x26b)][_0x57455c(0x2ea)](),{'verbose':_0x59c872[_0x57455c(0x140)]});let _0x2e5795=_0x364fc7[_0x57455c(0x255)][_0x57455c(0x226)](_0x461eb1=>_0x461eb1[_0x57455c(0x15b)]);if(_0x57365b){const _0x17265f=_0x57365b[_0x57455c(0x31a)](/[.+^${}()|[\]\\]/g,_0x57455c(0x2b3))[_0x57455c(0x31a)](/\*/g,'.*')[_0x57455c(0x31a)](/\?/g,'.'),_0x54c21f=new RegExp('^'+_0x17265f+'$','i');_0x2e5795=_0x2e5795[_0x57455c(0x226)](_0x40f7be=>_0x54c21f[_0x57455c(0x2df)](_0x40f7be['name']));}_0x2e5795['sort']((_0x4ed078,_0x46d9b6)=>_0x4ed078[_0x57455c(0x31e)][_0x57455c(0x1b7)](_0x46d9b6[_0x57455c(0x31e)])),console[_0x57455c(0x15e)](_0x57455c(0x1ce)+_0x2e5795[_0x57455c(0x132)]+'\x20RT-enabled\x20parent\x20segment'+(_0x2e5795[_0x57455c(0x132)]!==0x1?'s':''));const _0x799774=_0x29a299=>{const _0x4980ec=_0x57455c;return getConsoleNextUrl(_0x59c872['site'],_0x4980ec(0x27a)+_0x29a299);};if(_0x59c872['format']===_0x57455c(0x2a7)||_0x59c872[_0x57455c(0x13c)]===_0x57455c(0x14d)){const _0x1cbaa6=_0x2e5795[_0x57455c(0x2a8)](_0x4f090e=>({..._0x4f090e,'url':_0x799774(_0x4f090e['id'])}));await handleSDKOutput(_0x1cbaa6,_0x59c872);}else{if(_0x2e5795[_0x57455c(0x132)]===0x0)console[_0x57455c(0x305)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x4361d9 of _0x2e5795){const _0x5e84b5=_0x4361d9['population']?a31_0x45df52[_0x57455c(0x122)]('\x20('+formatRows(_0x4361d9[_0x57455c(0x190)])+')'):'',_0x14f57a=hyperlink(_0x4361d9[_0x57455c(0x31e)],_0x799774(_0x4361d9['id']));console[_0x57455c(0x305)]('⚡\x20'+_0x14f57a+_0x5e84b5);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x2e1);[a31_0x5d5fca(0x31d)]='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async[a31_0x5d5fca(0x174)](_0x256fcd){const _0x49c196=a31_0x5d5fca,{options:_0x4dbe80,args:_0x32b12f,tdx:_0x14b783}=_0x256fcd,_0x198585=_0x32b12f[0x0]||_0x4dbe80[_0x49c196(0x30b)];if(!_0x198585)return showParentSegmentNotSetError(_0x49c196(0x12e)+_0x49c196(0x10e)),0x1;const _0x5425b7=resolveYamlFile(_0x198585);if(!existsSync(_0x5425b7))return showFileNotFoundError(_0x5425b7,_0x198585),0x1;let _0x5a1261;try{_0x5a1261=readFileSync(_0x5425b7,'utf-8');}catch(_0x190680){const _0x54a94e=_0x190680 instanceof Error?_0x190680[_0x49c196(0x2da)]:String(_0x190680);return console[_0x49c196(0x15e)]('Error\x20reading\x20file:\x20'+_0x54a94e),0x1;}const _0x584e0c=createCommandSpinner(a31_0x45df52[_0x49c196(0x122)](_0x49c196(0x1c2)),{'verbose':_0x4dbe80[_0x49c196(0x140)]});_0x584e0c[_0x49c196(0x1fd)]();const _0x188d40={'realtime':!![],'onProgress':_0x1e98a8=>{_0x584e0c['text']=formatProgressMessage(_0x1e98a8);}};let _0x5d5eb6;try{_0x5d5eb6=await _0x14b783[_0x49c196(0x252)][_0x49c196(0x313)](_0x5a1261,_0x188d40),_0x584e0c['stop']();}catch(_0x116969){_0x584e0c['stop']();throw _0x116969;}console[_0x49c196(0x15e)]('\x0a'+a31_0x45df52[_0x49c196(0x23b)]('RT\x202.0\x20Validate:')+'\x20'+_0x5d5eb6[_0x49c196(0x31e)]),console[_0x49c196(0x15e)]('═'[_0x49c196(0x142)](0x3c)),displayRealtimeValidation(_0x5d5eb6),console[_0x49c196(0x15e)]('─'[_0x49c196(0x142)](0x3c));if(_0x5d5eb6['errors'][_0x49c196(0x132)]>0x0){console['error']('\x0a'+a31_0x45df52[_0x49c196(0x1a7)](_0x49c196(0x106)));for(const _0x14c329 of _0x5d5eb6[_0x49c196(0x31c)]){console[_0x49c196(0x15e)]('\x20\x20'+a31_0x45df52[_0x49c196(0x1a7)]('•')+'\x20'+_0x14c329);}}return _0x5d5eb6[_0x49c196(0x201)]&&console[_0x49c196(0x15e)]('\x0a'+a31_0x45df52[_0x49c196(0x193)]('✔')+_0x49c196(0x2e8)),_0x5d5eb6[_0x49c196(0x201)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x130);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x1f1);async[a31_0x5d5fca(0x174)](_0x4cd300){const _0x243106=a31_0x5d5fca,{options:_0x281a52,args:_0x397bc3,tdx:_0x4f059b}=_0x4cd300,_0x960e19=_0x397bc3[0x0]||_0x281a52['parentSegment'];if(!_0x960e19)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a'+_0x243106(0x21a)),0x1;_0x281a52['verbose']&&(console[_0x243106(0x15e)](_0x243106(0x1a0)+_0x281a52[_0x243106(0x1b2)]),console[_0x243106(0x15e)](_0x243106(0x1a8)+_0x960e19));const _0x4700aa=await withSpinner(_0x243106(0x175)+_0x960e19+'\x27...',()=>_0x4f059b[_0x243106(0x252)][_0x243106(0x285)](_0x960e19),{'verbose':_0x281a52[_0x243106(0x140)]}),_0x50e4c4=_0x4700aa['data'],_0x482550=await withSpinner(_0x243106(0x191)+_0x960e19+_0x243106(0x318),()=>_0x4f059b[_0x243106(0x26b)][_0x243106(0x23d)](_0x50e4c4),{'verbose':_0x281a52[_0x243106(0x140)]}),_0xaeb66d=_0x482550[_0x243106(0x255)];console['error']('✔\x20Found\x20'+_0xaeb66d[_0x243106(0x132)]+'\x20RT\x20journey'+(_0xaeb66d[_0x243106(0x132)]!==0x1?'s':''));if(_0x281a52['format']===_0x243106(0x2a7)||_0x281a52[_0x243106(0x13c)]===_0x243106(0x14d))await handleSDKOutput(_0xaeb66d,_0x281a52);else{if(_0xaeb66d['length']===0x0)console[_0x243106(0x305)]('No\x20RT\x20journeys\x20found');else for(const _0x2263b6 of _0xaeb66d){const _0x2dc298=_0x2263b6[_0x243106(0x14c)]===_0x243106(0x163)?'🚀':'📝',_0x594e93=_0x2263b6[_0x243106(0x24a)]?a31_0x45df52[_0x243106(0x171)](_0x243106(0x206)):'',_0x26e644=a31_0x45df52[_0x243106(0x122)]('\x20('+_0x2263b6['stageCount']+'\x20stage'+(_0x2263b6['stageCount']!==0x1?'s':'')+')');console[_0x243106(0x305)](_0x2dc298+'\x20'+_0x2263b6['name']+_0x594e93+_0x26e644);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]='ps:rt:jn:pause';['description']=a31_0x5d5fca(0x234);async['execute'](_0x1ba19c){const _0x1a721f=a31_0x5d5fca,{options:_0x16e142,args:_0x46d4ea,tdx:_0x56649b}=_0x1ba19c,_0x75a6a1=_0x46d4ea[0x0];if(!_0x75a6a1)return console['error'](a31_0x45df52[_0x1a721f(0x1a7)](_0x1a721f(0x1aa))),console[_0x1a721f(0x15e)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console['error'](a31_0x45df52[_0x1a721f(0x122)](_0x1a721f(0x2cf))),0x1;_0x16e142[_0x1a721f(0x140)]&&(console[_0x1a721f(0x15e)]('Site:\x20'+_0x16e142[_0x1a721f(0x1b2)]),console[_0x1a721f(0x15e)](_0x1a721f(0x1bf)+_0x75a6a1));const _0x8e91e6=await withSpinner(_0x1a721f(0x204)+_0x75a6a1+_0x1a721f(0x318),()=>_0x56649b[_0x1a721f(0x26b)][_0x1a721f(0x2aa)](_0x75a6a1),{'verbose':_0x16e142[_0x1a721f(0x140)]}),_0x119866=_0x8e91e6[_0x1a721f(0x255)];console[_0x1a721f(0x15e)](_0x1a721f(0x1cc)+_0x119866[_0x1a721f(0x31e)]+'\x27');if(_0x16e142[_0x1a721f(0x13c)]===_0x1a721f(0x2a7)||_0x16e142[_0x1a721f(0x13c)]==='jsonl')await handleSDKOutput([_0x119866],_0x16e142);else{const _0x190274=_0x119866['state']===_0x1a721f(0x163)?'🚀':'📝',_0x10979c=_0x119866['paused']?a31_0x45df52[_0x1a721f(0x171)](_0x1a721f(0x206)):'';console['log'](_0x190274+'\x20'+_0x119866[_0x1a721f(0x31e)]+_0x10979c);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']=a31_0x5d5fca(0x1af);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x1f6);async[a31_0x5d5fca(0x174)](_0x40278d){const _0x2114b3=a31_0x5d5fca,{options:_0x2d85d8,args:_0x3f6e21,tdx:_0x2be276}=_0x40278d,_0x1c5b8e=_0x3f6e21[0x0];if(!_0x1c5b8e)return console[_0x2114b3(0x15e)](a31_0x45df52[_0x2114b3(0x1a7)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x2114b3(0x15e)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a'),console[_0x2114b3(0x15e)](a31_0x45df52[_0x2114b3(0x122)](_0x2114b3(0x2cf))),0x1;_0x2d85d8[_0x2114b3(0x140)]&&(console[_0x2114b3(0x15e)](_0x2114b3(0x1a0)+_0x2d85d8['site']),console[_0x2114b3(0x15e)]('RT\x20Journey\x20ID:\x20'+_0x1c5b8e));const _0x366fb9=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x1c5b8e+'\x27...',()=>_0x2be276['realtime'][_0x2114b3(0x2fe)](_0x1c5b8e),{'verbose':_0x2d85d8['verbose']}),_0x10a35e=_0x366fb9[_0x2114b3(0x255)];console['error'](_0x2114b3(0x1c7)+_0x10a35e[_0x2114b3(0x31e)]+'\x27');if(_0x2d85d8[_0x2114b3(0x13c)]===_0x2114b3(0x2a7)||_0x2d85d8[_0x2114b3(0x13c)]==='jsonl')await handleSDKOutput([_0x10a35e],_0x2d85d8);else{const _0x3ca142=_0x10a35e[_0x2114b3(0x14c)]===_0x2114b3(0x163)?'🚀':'📝',_0x4391da=_0x10a35e[_0x2114b3(0x24a)]?a31_0x45df52[_0x2114b3(0x171)](_0x2114b3(0x206)):'';console[_0x2114b3(0x305)](_0x3ca142+'\x20'+_0x10a35e['name']+_0x4391da);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x2a0);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x24b);async[a31_0x5d5fca(0x174)](_0x181eb0){const _0x118cd9=a31_0x5d5fca,{options:_0x1b620d,args:_0x5c7b09,tdx:_0x5251ae}=_0x181eb0,_0x1b72d4=_0x5c7b09[0x0]||_0x1b620d[_0x118cd9(0x30b)];if(!_0x1b72d4)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a'+_0x118cd9(0x185)),0x1;_0x1b620d[_0x118cd9(0x140)]&&(console[_0x118cd9(0x15e)]('Site:\x20'+_0x1b620d[_0x118cd9(0x1b2)]),console[_0x118cd9(0x15e)](_0x118cd9(0x1a8)+_0x1b72d4));const _0x53ff09=await withSpinner(_0x118cd9(0x175)+_0x1b72d4+_0x118cd9(0x318),()=>_0x5251ae[_0x118cd9(0x252)]['resolveParentId'](_0x1b72d4),{'verbose':_0x1b620d[_0x118cd9(0x140)]}),_0x54e9c6=_0x53ff09['data'],_0x508746=await withSpinner('Getting\x20RT\x20configuration\x20version\x20for\x20\x27'+_0x1b72d4+_0x118cd9(0x318),()=>_0x5251ae[_0x118cd9(0x26b)][_0x118cd9(0x2e0)](_0x54e9c6),{'verbose':_0x1b620d['verbose']}),_0x5435b5=_0x508746[_0x118cd9(0x255)];return console[_0x118cd9(0x15e)](_0x118cd9(0x1d3)),_0x1b620d['format']==='json'||_0x1b620d[_0x118cd9(0x13c)]===_0x118cd9(0x14d)?await handleSDKOutput([_0x5435b5],_0x1b620d):(console[_0x118cd9(0x305)](_0x118cd9(0x2dc)+_0x5435b5['id']),console[_0x118cd9(0x305)]('audienceId:\x20'+_0x5435b5[_0x118cd9(0x256)]),console[_0x118cd9(0x305)](_0x118cd9(0x165)+_0x5435b5[_0x118cd9(0x233)]),console[_0x118cd9(0x305)](_0x118cd9(0x16d)+_0x5435b5[_0x118cd9(0x198)]),console['log'](_0x118cd9(0x312)+_0x5435b5['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x25b);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x31f);async['execute'](_0x5ab36e){const _0x57e53a=a31_0x5d5fca,{options:_0x210ee1,args:_0x1ca7f7,tdx:_0x448698}=_0x5ab36e,_0x3b825d=_0x1ca7f7[0x0]||_0x210ee1[_0x57e53a(0x30b)];if(!_0x3b825d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+_0x57e53a(0x2c4)),0x1;const _0x2a4e96=await withSpinner(_0x57e53a(0x175)+_0x3b825d+_0x57e53a(0x318),()=>_0x448698[_0x57e53a(0x252)][_0x57e53a(0x285)](_0x3b825d),{'verbose':_0x210ee1[_0x57e53a(0x140)]}),_0x2a742a=_0x2a4e96[_0x57e53a(0x255)],_0xfec34c=await withSpinner(_0x57e53a(0x143)+_0x3b825d+_0x57e53a(0x318),()=>_0x448698[_0x57e53a(0x322)][_0x57e53a(0x2ea)](_0x2a742a),{'verbose':_0x210ee1[_0x57e53a(0x140)]}),_0x42d841=_0xfec34c[_0x57e53a(0x255)];console[_0x57e53a(0x15e)](_0x57e53a(0x1ce)+_0x42d841['length']+_0x57e53a(0x2ef)+(_0x42d841[_0x57e53a(0x132)]!==0x1?'s':''));if(_0x210ee1[_0x57e53a(0x13c)]===_0x57e53a(0x2a7)||_0x210ee1['format']===_0x57e53a(0x14d))await handleSDKOutput(_0x42d841,_0x210ee1);else{if(_0x42d841[_0x57e53a(0x132)]===0x0)console[_0x57e53a(0x305)](_0x57e53a(0x2e6)),console[_0x57e53a(0x15e)](a31_0x45df52[_0x57e53a(0x10c)](_0x57e53a(0x2de)));else for(const _0x257e92 of _0x42d841){console[_0x57e53a(0x305)](a31_0x45df52[_0x57e53a(0x23b)](_0x257e92['name'])+'\x20'+a31_0x45df52[_0x57e53a(0x122)]('(id:\x20'+_0x257e92['id']+')'));_0x257e92[_0x57e53a(0x31d)]&&console[_0x57e53a(0x305)]('\x20\x20'+a31_0x45df52[_0x57e53a(0x122)](_0x257e92[_0x57e53a(0x31d)]));if(_0x257e92['tokens']&&_0x257e92[_0x57e53a(0x1bd)]['length']>0x0)for(const _0x3a2fef of _0x257e92[_0x57e53a(0x1bd)]){const _0x214f78=_0x3a2fef[_0x57e53a(0x13a)]?.[_0x57e53a(0x132)]?_0x3a2fef[_0x57e53a(0x13a)][_0x57e53a(0x289)](',\x20'):_0x57e53a(0x1ff);console[_0x57e53a(0x305)]('\x20\x20'+a31_0x45df52[_0x57e53a(0x10c)](_0x57e53a(0x2d0))+'\x20'+_0x3a2fef[_0x57e53a(0x31e)]+'\x20'+a31_0x45df52['dim'](_0x57e53a(0x304)+_0x3a2fef['id']+')')),console[_0x57e53a(0x305)](_0x57e53a(0x1ee)+a31_0x45df52[_0x57e53a(0x122)](_0x57e53a(0x217))+'\x20'+_0x214f78);}else console[_0x57e53a(0x305)]('\x20\x20'+a31_0x45df52[_0x57e53a(0x122)](_0x57e53a(0x213)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x308);[a31_0x5d5fca(0x31d)]='Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment';async['execute'](_0x55feec){const _0x37c3e0=a31_0x5d5fca,{options:_0x37c362,args:_0x271578,tdx:_0x4113cd}=_0x55feec,_0x4a5839=_0x37c362,_0x453671=_0x271578[0x0],_0x28e82c=_0x271578[0x1]||_0x37c362[_0x37c3e0(0x30b)];if(!_0x453671)return console['error'](_0x37c3e0(0x160)),console[_0x37c3e0(0x15e)](_0x37c3e0(0x16c)),console[_0x37c3e0(0x15e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x28e82c)return showParentSegmentNotSetError(_0x37c3e0(0x25f)+_0x37c3e0(0x12f)),0x1;const _0x8e504d=await withSpinner(_0x37c3e0(0x175)+_0x28e82c+'\x27...',()=>_0x4113cd['segment'][_0x37c3e0(0x285)](_0x28e82c),{'verbose':_0x37c362[_0x37c3e0(0x140)]}),_0x2022d9=_0x8e504d['data'],_0x3daeda={'name':_0x453671,'description':_0x4a5839[_0x37c3e0(0x31d)],'public':_0x4a5839[_0x37c3e0(0x2d1)]},_0x6bba31=await withSpinner('Creating\x20personalization\x20service\x20\x27'+_0x453671+_0x37c3e0(0x318),()=>_0x4113cd[_0x37c3e0(0x322)][_0x37c3e0(0x126)](_0x2022d9,_0x3daeda),{'verbose':_0x37c362[_0x37c3e0(0x140)]}),_0x362c73=_0x6bba31[_0x37c3e0(0x255)];return console['error'](_0x37c3e0(0x27c)+_0x362c73[_0x37c3e0(0x31e)]+_0x37c3e0(0x18d)+_0x362c73['id']),await handleSDKOutput([_0x362c73],_0x37c362),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x2e4);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x21c);async[a31_0x5d5fca(0x174)](_0x20c547){const _0xfd0902=a31_0x5d5fca,{options:_0x482a66,args:_0x1653e4,tdx:_0x3164eb}=_0x20c547,_0x5a7255=_0x1653e4[0x0],_0x3f8f13=_0x1653e4[0x1]||_0x482a66[_0xfd0902(0x30b)];if(!_0x5a7255)return console[_0xfd0902(0x15e)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0xfd0902(0x15e)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x3f8f13)return showParentSegmentNotSetError(_0xfd0902(0x14b)+_0xfd0902(0x178)),0x1;const _0x5eacc2=await withSpinner(_0xfd0902(0x175)+_0x3f8f13+_0xfd0902(0x318),()=>_0x3164eb[_0xfd0902(0x252)][_0xfd0902(0x285)](_0x3f8f13),{'verbose':_0x482a66[_0xfd0902(0x140)]}),_0x105d68=_0x5eacc2[_0xfd0902(0x255)],_0x526d8b=await withSpinner(_0xfd0902(0x153)+_0x5a7255+_0xfd0902(0x318),()=>_0x3164eb[_0xfd0902(0x322)][_0xfd0902(0x306)](_0x105d68,_0x5a7255),{'verbose':_0x482a66[_0xfd0902(0x140)]}),_0x576976=_0x526d8b[_0xfd0902(0x255)];if(_0x482a66[_0xfd0902(0x2a7)]||_0x482a66['jsonl'])await handleSDKOutput([_0x576976],_0x482a66);else{console[_0xfd0902(0x305)](a31_0x45df52[_0xfd0902(0x23b)](_0x576976['name'])+'\x20'+a31_0x45df52[_0xfd0902(0x122)]('(id:\x20'+_0x576976['id']+')'));_0x576976[_0xfd0902(0x31d)]&&console['log']('\x20\x20'+a31_0x45df52[_0xfd0902(0x122)](_0x576976[_0xfd0902(0x31d)]));console[_0xfd0902(0x305)]('\x20\x20'+a31_0x45df52['cyan']('public:')+'\x20'+(_0x576976[_0xfd0902(0x2d1)]?_0xfd0902(0x282):'no'));if(_0x576976[_0xfd0902(0x1bd)]&&_0x576976['tokens'][_0xfd0902(0x132)]>0x0)for(const _0x41fa49 of _0x576976[_0xfd0902(0x1bd)]){const _0x553700=_0x41fa49['allowedIps']?.[_0xfd0902(0x132)]?_0x41fa49['allowedIps'][_0xfd0902(0x289)](',\x20'):_0xfd0902(0x1ff);console[_0xfd0902(0x305)]('\x20\x20'+a31_0x45df52[_0xfd0902(0x10c)](_0xfd0902(0x2d0))+'\x20'+_0x41fa49[_0xfd0902(0x31e)]+'\x20'+a31_0x45df52[_0xfd0902(0x122)](_0xfd0902(0x304)+_0x41fa49['id']+')')),console[_0xfd0902(0x305)](_0xfd0902(0x1ee)+a31_0x45df52[_0xfd0902(0x122)](_0xfd0902(0x217))+'\x20'+_0x553700);}else console[_0xfd0902(0x305)]('\x20\x20'+a31_0x45df52[_0xfd0902(0x122)](_0xfd0902(0x213)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{['name']=a31_0x5d5fca(0x207);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x2ac);async['execute'](_0x1ca6a8){const _0x2a8763=a31_0x5d5fca,{options:_0x44e084,args:_0x1bd156,tdx:_0x1dabe7}=_0x1ca6a8,_0x58e31=_0x1bd156[0x0],_0x3a4c67=_0x1bd156[0x1]||_0x44e084[_0x2a8763(0x30b)];if(!_0x58e31)return console['error'](_0x2a8763(0x210)),console[_0x2a8763(0x15e)](_0x2a8763(0x1b9)),console['error'](_0x2a8763(0x177)),0x1;if(!_0x3a4c67)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x2a8763(0x177)),0x1;const _0x1a0303=await withSpinner(_0x2a8763(0x175)+_0x3a4c67+_0x2a8763(0x318),()=>_0x1dabe7[_0x2a8763(0x252)]['resolveParentId'](_0x3a4c67),{'verbose':_0x44e084['verbose']}),_0x287981=_0x1a0303[_0x2a8763(0x255)];return await withSpinner(_0x2a8763(0x1e9)+_0x58e31+_0x2a8763(0x318),()=>_0x1dabe7[_0x2a8763(0x322)]['delete'](_0x287981,_0x58e31),{'verbose':_0x44e084[_0x2a8763(0x140)]}),console[_0x2a8763(0x15e)](_0x2a8763(0x2bd)+_0x58e31+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x316);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x1eb);async[a31_0x5d5fca(0x174)](_0x37a77e){const _0x43dbab=a31_0x5d5fca,{options:_0x1b422b,args:_0x495064,tdx:_0x2b0b14}=_0x37a77e,_0x3c6f64=_0x1b422b,_0x888da0=_0x495064[0x0],_0x13efc3=_0x495064[0x1]||_0x1b422b[_0x43dbab(0x30b)];if(!_0x888da0)return console['error'](_0x43dbab(0x210)),console[_0x43dbab(0x15e)](_0x43dbab(0x145)),console['error'](_0x43dbab(0x12b)),0x1;if(!_0x3c6f64[_0x43dbab(0x31e)])return console['error']('Error:\x20--name\x20is\x20required'),console[_0x43dbab(0x15e)](_0x43dbab(0x145)),0x1;if(!_0x13efc3)return showParentSegmentNotSetError(_0x43dbab(0x120)+_0x43dbab(0x12b)),0x1;const _0x2020f3=await withSpinner(_0x43dbab(0x175)+_0x13efc3+_0x43dbab(0x318),()=>_0x2b0b14[_0x43dbab(0x252)][_0x43dbab(0x285)](_0x13efc3),{'verbose':_0x1b422b[_0x43dbab(0x140)]}),_0x297ddc=_0x2020f3['data'],_0x307faa={'name':_0x3c6f64['name']};_0x3c6f64[_0x43dbab(0x31d)]!==undefined&&(_0x307faa[_0x43dbab(0x31d)]=_0x3c6f64[_0x43dbab(0x31d)]);const _0x2f282e=await withSpinner(_0x43dbab(0x196)+_0x888da0+_0x43dbab(0x318),()=>_0x2b0b14[_0x43dbab(0x322)][_0x43dbab(0x27f)](_0x297ddc,_0x888da0,_0x307faa),{'verbose':_0x1b422b[_0x43dbab(0x140)]}),_0x2233fc=_0x2f282e[_0x43dbab(0x255)];return console['error']('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x2233fc[_0x43dbab(0x31e)]+'\x27'),await handleSDKOutput([_0x2233fc],_0x1b422b),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x1fa);['description']=a31_0x5d5fca(0x2d4);async['execute'](_0x23722e){const _0x1482ef=a31_0x5d5fca,{options:_0x1214c4,args:_0x3d9e66,tdx:_0x385ffa}=_0x23722e,_0x4868c6=_0x1214c4,_0x51e8ce=_0x3d9e66[0x0],_0x1e9068=_0x3d9e66[0x1],_0x3b1e52=_0x3d9e66[0x2]||_0x1214c4[_0x1482ef(0x30b)];if(!_0x51e8ce)return console[_0x1482ef(0x15e)](_0x1482ef(0x10f)),console[_0x1482ef(0x15e)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x1482ef(0x15e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x1e9068)return console['error'](_0x1482ef(0x210)),console[_0x1482ef(0x15e)](_0x1482ef(0x28c)),console[_0x1482ef(0x15e)](_0x1482ef(0x279)),0x1;if(!_0x3b1e52)return showParentSegmentNotSetError(_0x1482ef(0x291)+_0x1482ef(0x279)),0x1;const _0x5033b5=await withSpinner(_0x1482ef(0x175)+_0x3b1e52+_0x1482ef(0x318),()=>_0x385ffa['segment']['resolveParentId'](_0x3b1e52),{'verbose':_0x1214c4['verbose']}),_0x1c4ffe=_0x5033b5[_0x1482ef(0x255)],_0x4a9b6e={'name':_0x51e8ce};_0x4868c6['allowedIps']&&(_0x4a9b6e[_0x1482ef(0x13a)]=_0x4868c6['allowedIps'][_0x1482ef(0x2c2)](',')['map'](_0x597cac=>_0x597cac[_0x1482ef(0x27d)]()));_0x4868c6[_0x1482ef(0x31d)]&&(_0x4a9b6e['description']=_0x4868c6[_0x1482ef(0x31d)]);const _0x27c17e=await withSpinner(_0x1482ef(0x243)+_0x51e8ce+_0x1482ef(0x1f5)+_0x1e9068+_0x1482ef(0x318),()=>_0x385ffa['personalization'][_0x1482ef(0x2a4)](_0x1c4ffe,_0x1e9068,_0x4a9b6e),{'verbose':_0x1214c4[_0x1482ef(0x140)]}),_0x5caec4=_0x27c17e[_0x1482ef(0x255)];return console['error']('✔\x20Created\x20token\x20\x27'+_0x5caec4['name']+_0x1482ef(0x18d)+_0x5caec4['id']),_0x5caec4[_0x1482ef(0x14e)]&&(console['error'](a31_0x45df52['yellow'](_0x1482ef(0x2ee))),console[_0x1482ef(0x15e)](a31_0x45df52['cyan'](_0x5caec4['value'])),console[_0x1482ef(0x15e)]('')),await handleSDKOutput([_0x5caec4],_0x1214c4),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x2ff);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x301);async[a31_0x5d5fca(0x174)](_0x5a270a){const _0x3a882b=a31_0x5d5fca,{options:_0x33cd89,args:_0x51600d,tdx:_0xa0badb}=_0x5a270a,_0x259478=_0x51600d[0x0],_0x2c399a=_0x51600d[0x1]||_0x33cd89[_0x3a882b(0x30b)];if(!_0x259478)return console[_0x3a882b(0x15e)]('Error:\x20Token\x20ID\x20is\x20required'),console[_0x3a882b(0x15e)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console[_0x3a882b(0x15e)](_0x3a882b(0x29a)),0x1;if(!_0x2c399a)return showParentSegmentNotSetError(_0x3a882b(0x125)+_0x3a882b(0x29a)),0x1;const _0x2f9f68=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2c399a+_0x3a882b(0x318),()=>_0xa0badb[_0x3a882b(0x252)][_0x3a882b(0x285)](_0x2c399a),{'verbose':_0x33cd89[_0x3a882b(0x140)]}),_0x512cea=_0x2f9f68[_0x3a882b(0x255)],_0x126870=await withSpinner(_0x3a882b(0x22a),()=>_0xa0badb[_0x3a882b(0x322)][_0x3a882b(0x2ea)](_0x512cea),{'verbose':_0x33cd89['verbose']}),_0x59d6d6=_0x126870['data'];let _0x375046;for(const _0xcf84c9 of _0x59d6d6){if(_0xcf84c9[_0x3a882b(0x1bd)]?.[_0x3a882b(0x115)](_0x8ab3e1=>_0x8ab3e1['id']===_0x259478)){_0x375046=_0xcf84c9['id'];break;}}if(!_0x375046)return console['error']('Error:\x20Token\x20\x27'+_0x259478+_0x3a882b(0x1ca)),0x1;const _0x17c726=await withSpinner(_0x3a882b(0x25a)+_0x259478+_0x3a882b(0x318),()=>_0xa0badb[_0x3a882b(0x322)]['deleteToken'](_0x512cea,_0x375046,_0x259478),{'verbose':_0x33cd89['verbose']}),_0x75777d=_0x17c726[_0x3a882b(0x255)];return console[_0x3a882b(0x15e)](_0x3a882b(0x138)+(_0x75777d[_0x3a882b(0x31e)]||_0x259478)+'\x27'),await handleSDKOutput([_0x75777d],_0x33cd89),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x260);['description']=a31_0x5d5fca(0x1be);async[a31_0x5d5fca(0x174)](_0x479f4a){const _0x3155e4=a31_0x5d5fca,{options:_0xb99d46,args:_0x2c1daf,tdx:_0x2f1e4b}=_0x479f4a,_0x2e54a5=_0x2c1daf[0x0]||_0xb99d46[_0x3155e4(0x30b)];if(!_0x2e54a5)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a'+_0x3155e4(0x131)),0x1;const _0x83ddc2=await withSpinner(_0x3155e4(0x175)+_0x2e54a5+_0x3155e4(0x318),()=>_0x2f1e4b[_0x3155e4(0x252)][_0x3155e4(0x285)](_0x2e54a5),{'verbose':_0xb99d46[_0x3155e4(0x140)]}),_0x4e13eb=_0x83ddc2[_0x3155e4(0x255)],_0x436adc=await withSpinner('Listing\x20personalizations\x20for\x20\x27'+_0x2e54a5+'\x27...',()=>_0x2f1e4b[_0x3155e4(0x322)][_0x3155e4(0x268)](_0x4e13eb),{'verbose':_0xb99d46[_0x3155e4(0x140)]}),_0x56d840=_0x436adc[_0x3155e4(0x255)];console[_0x3155e4(0x15e)]('✔\x20Found\x20'+_0x56d840['length']+_0x3155e4(0x195)+(_0x56d840['length']!==0x1?'s':''));if(_0xb99d46['format']===_0x3155e4(0x2a7)||_0xb99d46[_0x3155e4(0x13c)]===_0x3155e4(0x14d))await handleSDKOutput(_0x56d840,_0xb99d46);else{if(_0x56d840['length']===0x0)console['log'](_0x3155e4(0x1d0));else for(const _0x4967b2 of _0x56d840){console[_0x3155e4(0x305)](a31_0x45df52[_0x3155e4(0x23b)](_0x4967b2[_0x3155e4(0x31e)])+'\x20'+a31_0x45df52[_0x3155e4(0x122)]('(id:\x20'+_0x4967b2['id']+')'));_0x4967b2[_0x3155e4(0x31d)]&&console[_0x3155e4(0x305)]('\x20\x20'+a31_0x45df52['dim'](_0x4967b2[_0x3155e4(0x31d)]));const _0x719cf6=_0x4967b2[_0x3155e4(0x16b)]?.[_0x3155e4(0x132)]||0x0;console[_0x3155e4(0x305)]('\x20\x20'+a31_0x45df52[_0x3155e4(0x10c)](_0x3155e4(0x1f7))+'\x20'+_0x719cf6);if(_0x4967b2[_0x3155e4(0x16b)]&&_0x4967b2[_0x3155e4(0x16b)][_0x3155e4(0x132)]>0x0)for(const _0x170fe6 of _0x4967b2[_0x3155e4(0x16b)]){console[_0x3155e4(0x305)](_0x3155e4(0x26f)+_0x170fe6['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]='ps:pz:show';[a31_0x5d5fca(0x31d)]='Show\x20a\x20specific\x20realtime\x20personalization';async[a31_0x5d5fca(0x174)](_0x32a6d0){const _0x407312=a31_0x5d5fca,{options:_0xc0858a,args:_0x1a381f,tdx:_0xc71ac9}=_0x32a6d0,_0x500272=_0x1a381f[0x0];if(!_0x500272)return console['error'](_0x407312(0x2a2)),console[_0x407312(0x15e)](_0x407312(0x2fb)),0x1;const _0x4408d6=await withSpinner(_0x407312(0x2ae)+_0x500272+_0x407312(0x318),()=>_0xc71ac9['personalization']['getPersonalization'](_0x500272),{'verbose':_0xc0858a[_0x407312(0x140)]}),_0x5195f8=_0x4408d6[_0x407312(0x255)];console['error'](_0x407312(0x224)+_0x5195f8[_0x407312(0x31e)]+'\x27');if(_0xc0858a[_0x407312(0x13c)]===_0x407312(0x2a7)||_0xc0858a[_0x407312(0x13c)]===_0x407312(0x14d))await handleSDKOutput([_0x5195f8],_0xc0858a);else{console[_0x407312(0x305)](a31_0x45df52[_0x407312(0x23b)](_0x5195f8[_0x407312(0x31e)])+'\x20'+a31_0x45df52[_0x407312(0x122)](_0x407312(0x304)+_0x5195f8['id']+')'));_0x5195f8[_0x407312(0x31d)]&&console[_0x407312(0x305)]('\x20\x20'+a31_0x45df52[_0x407312(0x122)](_0x5195f8[_0x407312(0x31d)]));_0x5195f8[_0x407312(0x256)]&&console[_0x407312(0x305)]('\x20\x20'+a31_0x45df52[_0x407312(0x10c)]('audienceId:')+'\x20'+_0x5195f8[_0x407312(0x256)]);console[_0x407312(0x305)]('\x20\x20'+a31_0x45df52[_0x407312(0x10c)](_0x407312(0x11f))+'\x20'+_0x5195f8['createdAt']),console[_0x407312(0x305)]('\x20\x20'+a31_0x45df52['cyan'](_0x407312(0x221))+'\x20'+_0x5195f8[_0x407312(0x2e3)]);const _0x257fbb=_0x5195f8[_0x407312(0x16b)]?.[_0x407312(0x132)]||0x0;console[_0x407312(0x305)]('\x20\x20'+a31_0x45df52[_0x407312(0x10c)](_0x407312(0x1f7))+'\x20'+_0x257fbb);if(_0x5195f8[_0x407312(0x16b)]&&_0x5195f8[_0x407312(0x16b)][_0x407312(0x132)]>0x0)for(const _0x296578 of _0x5195f8[_0x407312(0x16b)]){console['log'](_0x407312(0x1ee)+a31_0x45df52[_0x407312(0x23b)](_0x296578[_0x407312(0x31e)])+'\x20'+a31_0x45df52[_0x407312(0x122)](_0x407312(0x304)+_0x296578['id']+')')),_0x296578[_0x407312(0x2d8)]&&(console['log'](_0x407312(0x264)+a31_0x45df52[_0x407312(0x10c)](_0x407312(0x280))+'\x20'+_0x296578['entryCriteria'][_0x407312(0x31e)]),_0x296578['entryCriteria']['keyEventCriteria']?.['keyEventId']&&console[_0x407312(0x305)](_0x407312(0x2f7)+a31_0x45df52[_0x407312(0x10c)](_0x407312(0x119))+'\x20'+_0x296578[_0x407312(0x2d8)][_0x407312(0x276)][_0x407312(0x18c)])),_0x296578['payload']&&console['log']('\x20\x20\x20\x20\x20\x20'+a31_0x45df52[_0x407312(0x10c)](_0x407312(0x2e7))+'\x20'+JSON[_0x407312(0x19a)](_0x296578[_0x407312(0x311)])),_0x296578[_0x407312(0x29f)]&&console[_0x407312(0x305)](_0x407312(0x264)+a31_0x45df52[_0x407312(0x10c)](_0x407312(0x242))+_0x407312(0x149));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{['name']=a31_0x5d5fca(0x26d);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x17c);async[a31_0x5d5fca(0x174)](_0x244ee6){const _0x16de3c=a31_0x5d5fca,{options:_0x31a1f1,args:_0x4a6141,tdx:_0x66cfc9}=_0x244ee6,_0x303044=_0x4a6141[0x0];if(!_0x303044)return console[_0x16de3c(0x15e)](_0x16de3c(0x2a2)),console[_0x16de3c(0x15e)]('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner(_0x16de3c(0x288)+_0x303044+_0x16de3c(0x318),()=>_0x66cfc9[_0x16de3c(0x322)][_0x16de3c(0x323)](_0x303044),{'verbose':_0x31a1f1[_0x16de3c(0x140)]}),console[_0x16de3c(0x15e)](_0x16de3c(0x112)+_0x303044+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x27e);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x17b);async[a31_0x5d5fca(0x174)](_0x1cb300){const _0x3d364a=a31_0x5d5fca,{options:_0x110c1a,tdx:_0x4e291f}=_0x1cb300,_0x48a1c0=_0x110c1a;let _0x1ecf12;if(_0x48a1c0['file']){_0x1ecf12=await loadJSON(_0x48a1c0['file'],!![]);if(!_0x1ecf12[_0x3d364a(0x2a3)]?.['parentFolder'])return console[_0x3d364a(0x15e)]('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0x3d364a(0x15e)](_0x3d364a(0x20a)),console[_0x3d364a(0x15e)](_0x3d364a(0x16f)),0x1;}else{if(!_0x48a1c0['name'])return console[_0x3d364a(0x15e)](_0x3d364a(0x2cd)),console[_0x3d364a(0x15e)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x3d364a(0x15e)](_0x3d364a(0x30f)),0x1;if(_0x48a1c0[_0x3d364a(0x31d)]===undefined)return console[_0x3d364a(0x15e)](_0x3d364a(0x139)),console[_0x3d364a(0x15e)](_0x3d364a(0x253)),console[_0x3d364a(0x15e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x48a1c0[_0x3d364a(0x307)]===undefined)return console['error'](_0x3d364a(0x2f1)),console[_0x3d364a(0x15e)](_0x3d364a(0x1dc)),0x1;let _0x262d0a=_0x48a1c0[_0x3d364a(0x256)];if(!_0x262d0a&&_0x110c1a['parentSegment']){const _0x4f2e95=await withSpinner(_0x3d364a(0x175)+_0x110c1a[_0x3d364a(0x30b)]+_0x3d364a(0x318),()=>_0x4e291f[_0x3d364a(0x252)][_0x3d364a(0x285)](_0x110c1a[_0x3d364a(0x30b)]),{'verbose':_0x110c1a[_0x3d364a(0x140)]});_0x262d0a=_0x4f2e95[_0x3d364a(0x255)];}let _0x4d53c8;_0x48a1c0['sections']&&(_0x4d53c8=await loadJSON(_0x48a1c0[_0x3d364a(0x16b)],![]));const _0x37abf9=_0x48a1c0[_0x3d364a(0x307)]==='null'?null:{'id':_0x48a1c0[_0x3d364a(0x307)],'type':_0x3d364a(0x19c)};_0x1ecf12={'attributes':{'name':_0x48a1c0['name'],'description':_0x48a1c0[_0x3d364a(0x31d)]||null,..._0x262d0a!==undefined&&{'audienceId':_0x262d0a},..._0x4d53c8!==undefined&&{'sections':_0x4d53c8}},'relationships':{'parentFolder':{'data':_0x37abf9}}};}const _0xdd5e2c=await withSpinner('Creating\x20personalization\x20\x27'+(_0x1ecf12[_0x3d364a(0x284)]?.[_0x3d364a(0x31e)]??'')+'\x27...',()=>_0x4e291f[_0x3d364a(0x322)][_0x3d364a(0x281)](_0x1ecf12),{'verbose':_0x110c1a[_0x3d364a(0x140)]}),_0x52f4e7=_0xdd5e2c[_0x3d364a(0x255)];return console[_0x3d364a(0x15e)](_0x3d364a(0x296)+_0x52f4e7[_0x3d364a(0x31e)]+_0x3d364a(0x18d)+_0x52f4e7['id']),await handleSDKOutput([_0x52f4e7],_0x110c1a),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x13b);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x2f4);async['execute'](_0x375807){const _0x58e1a5=a31_0x5d5fca,{options:_0x170a25,args:_0x29d3b8}=_0x375807,_0x294fa5=_0x170a25,_0x5cc350=_0x29d3b8[0x0];if(!_0x5cc350)return console[_0x58e1a5(0x15e)](_0x58e1a5(0x2a2)),console['error'](_0x58e1a5(0x2ca)),console['error'](_0x58e1a5(0x11d)),0x1;let _0x5d961b;if(_0x294fa5[_0x58e1a5(0x18f)])_0x5d961b=await loadJSON(_0x294fa5[_0x58e1a5(0x18f)],!![]);else{if(!_0x294fa5[_0x58e1a5(0x31e)])return console[_0x58e1a5(0x15e)](_0x58e1a5(0x2cd)),console[_0x58e1a5(0x15e)](_0x58e1a5(0x2ca)),0x1;if(_0x294fa5['description']===undefined)return console[_0x58e1a5(0x15e)](_0x58e1a5(0x139)),console[_0x58e1a5(0x15e)](_0x58e1a5(0x2ca)),0x1;let _0xc299b0;_0x294fa5[_0x58e1a5(0x16b)]&&(_0xc299b0=await loadJSON(_0x294fa5[_0x58e1a5(0x16b)],![])),_0x5d961b={'attributes':{'name':_0x294fa5['name'],'description':_0x294fa5[_0x58e1a5(0x31d)]||null,..._0xc299b0!==undefined&&{'sections':_0xc299b0}}};}const {tdx:_0x1f05b9}=_0x375807,_0x46d459=await withSpinner(_0x58e1a5(0x203)+_0x5cc350+_0x58e1a5(0x318),()=>_0x1f05b9[_0x58e1a5(0x322)][_0x58e1a5(0x28f)](_0x5cc350,_0x5d961b),{'verbose':_0x170a25[_0x58e1a5(0x140)]}),_0x4c5845=_0x46d459[_0x58e1a5(0x255)];return console['error'](_0x58e1a5(0x129)+_0x4c5845[_0x58e1a5(0x31e)]+'\x27\x20(id:\x20'+_0x4c5845['id']+')'),await handleSDKOutput([_0x4c5845],_0x170a25),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x5d5fca(0x31e)]=a31_0x5d5fca(0x219);[a31_0x5d5fca(0x31d)]=a31_0x5d5fca(0x310);async[a31_0x5d5fca(0x174)](_0x2855c){const _0x16a3ff=a31_0x5d5fca,{options:_0x192a38,args:_0x1a4f63}=_0x2855c,_0x159edd=_0x1a4f63[0x0]||_0x192a38[_0x16a3ff(0x30b)];if(!_0x159edd)return showParentSegmentNotSetError(_0x16a3ff(0x1b0)+_0x16a3ff(0x23f)),0x1;const _0x3725e9=resolveYamlFile(_0x159edd);if(!existsSync(_0x3725e9))return showFileNotFoundError(_0x3725e9,_0x159edd),0x1;let _0x3f2407;try{_0x3f2407=readFileSync(_0x3725e9,_0x16a3ff(0x21f));}catch(_0x4f8a61){const _0x4c7668=_0x4f8a61 instanceof Error?_0x4f8a61[_0x16a3ff(0x2da)]:String(_0x4f8a61);return console['error'](_0x16a3ff(0x21d)+_0x4c7668),0x1;}let _0x917f34;try{_0x917f34=parseDef(_0x3f2407);}catch(_0x2635db){const _0x1b53de=_0x2635db instanceof Error?_0x2635db[_0x16a3ff(0x2da)]:String(_0x2635db);return console[_0x16a3ff(0x15e)](a31_0x45df52[_0x16a3ff(0x1a7)](_0x16a3ff(0x10b)+_0x1b53de)),0x1;}if(_0x917f34[_0x16a3ff(0x109)]&&_0x917f34['personalization_services']['length']>0x0)return console[_0x16a3ff(0x15e)](a31_0x45df52[_0x16a3ff(0x171)](_0x16a3ff(0x2a9)+_0x3725e9)),console[_0x16a3ff(0x15e)](a31_0x45df52[_0x16a3ff(0x122)](_0x16a3ff(0x13e)+_0x917f34[_0x16a3ff(0x109)][_0x16a3ff(0x132)]+_0x16a3ff(0x1b5))),0x1;!_0x917f34[_0x16a3ff(0x26b)]&&(_0x917f34['realtime']={'events':[{'name':_0x16a3ff(0x25d),'source_table':_0x16a3ff(0x21e)}],'attributes':[{'name':_0x16a3ff(0x1cd),'type':_0x16a3ff(0x22b)}],'id_stitching':{'primary_key':_0x917f34[_0x16a3ff(0x22d)]['table']===_0x16a3ff(0x179)?_0x16a3ff(0x2dd):'user_id'}});_0x917f34['personalization_services']=[{'name':_0x16a3ff(0x2af),'description':_0x16a3ff(0x249),'trigger_event':'page_view','sections':[{'name':_0x16a3ff(0x1ab),'criteria':_0x16a3ff(0x2be),'attributes':[_0x16a3ff(0x1cd)]}]}];const _0x59f9cf=serializeDef(_0x917f34);return writeFileSync(_0x3725e9,_0x59f9cf,_0x16a3ff(0x21f)),console['error'](a31_0x45df52[_0x16a3ff(0x193)]('✔')+_0x16a3ff(0x2f0)+a31_0x45df52[_0x16a3ff(0x10c)](_0x3725e9)),(!_0x917f34[_0x16a3ff(0x26b)]||_0x3f2407['indexOf'](_0x16a3ff(0x24f))===-0x1)&&console[_0x16a3ff(0x15e)](a31_0x45df52[_0x16a3ff(0x193)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x16a3ff(0x15e)]('\x0a'+a31_0x45df52[_0x16a3ff(0x122)](_0x16a3ff(0x2b5))),console[_0x16a3ff(0x15e)](_0x16a3ff(0x1c4)+_0x3725e9+_0x16a3ff(0x222)),console[_0x16a3ff(0x15e)](_0x16a3ff(0x2f2)+a31_0x45df52[_0x16a3ff(0x122)]('tdx\x20ps\x20push\x20'+_0x159edd)+_0x16a3ff(0x2b8)),0x0;}}