@treasuredata/tdx 2026.4.10 → 2026.4.12

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 (232) 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.d.ts +1 -0
  68. package/dist/core/profile.d.ts.map +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/profile.js.map +1 -1
  71. package/dist/core/project-config.js +1 -1
  72. package/dist/core/session.js +1 -1
  73. package/dist/core/user-cache.js +1 -1
  74. package/dist/core/version.js +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/mcp/server.js +1 -1
  77. package/dist/mcp/tools/index.js +1 -1
  78. package/dist/mcp/tools/tdx-run.js +1 -1
  79. package/dist/mcp/tools/tdx-search.js +1 -1
  80. package/dist/mcp/tools/work-create-item.js +1 -1
  81. package/dist/mcp/utils.js +1 -1
  82. package/dist/proxy/claude-usage-tracker.js +1 -1
  83. package/dist/proxy/passthrough-server.js +1 -1
  84. package/dist/proxy/sse-usage-parser.js +1 -1
  85. package/dist/sdk/agent/agent-config.js +1 -1
  86. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  87. package/dist/sdk/agent/agent-yaml.js +1 -1
  88. package/dist/sdk/agent/test/evaluator.js +1 -1
  89. package/dist/sdk/agent/test/executor.js +1 -1
  90. package/dist/sdk/agent/test/index.js +1 -1
  91. package/dist/sdk/agent/test/output.js +1 -1
  92. package/dist/sdk/agent/test/parser.js +1 -1
  93. package/dist/sdk/agent/tool-target-registry.js +1 -1
  94. package/dist/sdk/api.js +1 -1
  95. package/dist/sdk/cas/cas-api-client.js +1 -1
  96. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  97. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  98. package/dist/sdk/cas/index.js +1 -1
  99. package/dist/sdk/cas/pull-workflow.js +1 -1
  100. package/dist/sdk/cas/push-workflow.js +1 -1
  101. package/dist/sdk/client/cdp-api-client.js +1 -1
  102. package/dist/sdk/client/delivery-api-client.js +1 -1
  103. package/dist/sdk/client/endpoints.js +1 -1
  104. package/dist/sdk/client/engage-api-client.js +1 -1
  105. package/dist/sdk/client/http-client.js +1 -1
  106. package/dist/sdk/client/llm-api-client.js +1 -1
  107. package/dist/sdk/client/oauth-refresh.js +1 -1
  108. package/dist/sdk/client/rate-limiter.js +1 -1
  109. package/dist/sdk/client/td-api-client.js +1 -1
  110. package/dist/sdk/client/trino-api-client.js +1 -1
  111. package/dist/sdk/client/workflow-client.js +1 -1
  112. package/dist/sdk/connection-validator.js +1 -1
  113. package/dist/sdk/connection.js +1 -1
  114. package/dist/sdk/delivery.js +1 -1
  115. package/dist/sdk/engage/campaign-pull.js +1 -1
  116. package/dist/sdk/engage/campaign-push.js +1 -1
  117. package/dist/sdk/engage/campaign-validator.js +1 -1
  118. package/dist/sdk/engage/campaign-yaml.js +1 -1
  119. package/dist/sdk/engage/template-pull.js +1 -1
  120. package/dist/sdk/engage/template-push.js +1 -1
  121. package/dist/sdk/engage/template-validator.js +1 -1
  122. package/dist/sdk/engage/template-yaml.js +1 -1
  123. package/dist/sdk/engage/types/campaign-def.js +1 -1
  124. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  125. package/dist/sdk/engage/types/template-schema.js +1 -1
  126. package/dist/sdk/engage.js +1 -1
  127. package/dist/sdk/errors.js +1 -1
  128. package/dist/sdk/index.js +1 -1
  129. package/dist/sdk/io/index.js +1 -1
  130. package/dist/sdk/io/node-filesystem.js +1 -1
  131. package/dist/sdk/job.js +1 -1
  132. package/dist/sdk/journey.d.ts +6 -0
  133. package/dist/sdk/journey.d.ts.map +1 -1
  134. package/dist/sdk/journey.js +1 -1
  135. package/dist/sdk/journey.js.map +1 -1
  136. package/dist/sdk/llm/chat-cache.js +1 -1
  137. package/dist/sdk/llm/index.js +1 -1
  138. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  139. package/dist/sdk/llm/model-factors.js +1 -1
  140. package/dist/sdk/personalization.js +1 -1
  141. package/dist/sdk/policy.js +1 -1
  142. package/dist/sdk/query/index.js +1 -1
  143. package/dist/sdk/query/sql-parser.js +1 -1
  144. package/dist/sdk/realtime.js +1 -1
  145. package/dist/sdk/schedule.js +1 -1
  146. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  147. package/dist/sdk/segment/fields-display.js +1 -1
  148. package/dist/sdk/segment/file-discovery.js +1 -1
  149. package/dist/sdk/segment/journey-utils.js +1 -1
  150. package/dist/sdk/segment/journey-validator.js +1 -1
  151. package/dist/sdk/segment/journey-yaml.js +1 -1
  152. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  153. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  154. package/dist/sdk/segment/pull-workflow.js +1 -1
  155. package/dist/sdk/segment/push-recovery.js +1 -1
  156. package/dist/sdk/segment/push-workflow.js +1 -1
  157. package/dist/sdk/segment/resolution-context.js +1 -1
  158. package/dist/sdk/segment/segment-path-parser.js +1 -1
  159. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  160. package/dist/sdk/segment/segment-validator.js +1 -1
  161. package/dist/sdk/segment/target-resolution.js +1 -1
  162. package/dist/sdk/segment/tdx-config.js +1 -1
  163. package/dist/sdk/segment/types/activation-schema.js +1 -1
  164. package/dist/sdk/segment/types/journey-def.js +1 -1
  165. package/dist/sdk/segment/types/journey-schema.js +1 -1
  166. package/dist/sdk/segment/types/segment-def.js +1 -1
  167. package/dist/sdk/segment/types/segment-schema.js +1 -1
  168. package/dist/sdk/segment/validate-files.js +1 -1
  169. package/dist/sdk/segment/yaml-validator.js +1 -1
  170. package/dist/sdk/segment.js +1 -1
  171. package/dist/sdk/types/index.js +1 -1
  172. package/dist/sdk/types/progress.js +1 -1
  173. package/dist/sdk/types/workspace.d.ts +2 -0
  174. package/dist/sdk/types/workspace.d.ts.map +1 -1
  175. package/dist/sdk/types/workspace.js +1 -1
  176. package/dist/sdk/user.js +1 -1
  177. package/dist/sdk/util/format-detector.js +1 -1
  178. package/dist/sdk/util/formatters.js +1 -1
  179. package/dist/sdk/util/index.js +1 -1
  180. package/dist/sdk/util/paginate.js +1 -1
  181. package/dist/sdk/util/tree-formatter.js +1 -1
  182. package/dist/sdk/workflow/archive-validation.js +1 -1
  183. package/dist/sdk/workflow/clone-workflow.js +1 -1
  184. package/dist/sdk/workflow/index.js +1 -1
  185. package/dist/sdk/workflow/pull-workflow.js +1 -1
  186. package/dist/sdk/workflow/push-workflow.js +1 -1
  187. package/dist/sdk/workflow/tdx-config.js +1 -1
  188. package/dist/sdk/workflow/workflow-utils.js +1 -1
  189. package/dist/sdk/workspace/access-tracker.js +1 -1
  190. package/dist/sdk/workspace/frontmatter.js +1 -1
  191. package/dist/sdk/workspace/git.js +1 -1
  192. package/dist/sdk/workspace/index.d.ts.map +1 -1
  193. package/dist/sdk/workspace/index.js +1 -1
  194. package/dist/sdk/workspace/index.js.map +1 -1
  195. package/dist/sdk/workspace/templates.d.ts.map +1 -1
  196. package/dist/sdk/workspace/templates.js +1 -1
  197. package/dist/sdk/workspace/templates.js.map +1 -1
  198. package/dist/sdk/workspace/weekly.js +1 -1
  199. package/dist/sdk/workspace/wikilinks.js +1 -1
  200. package/dist/test-utils/command-runner.js +1 -1
  201. package/dist/test-utils/factories.js +1 -1
  202. package/dist/test-utils/fixtures.js +1 -1
  203. package/dist/test-utils/http-mock.js +1 -1
  204. package/dist/test-utils/index.js +1 -1
  205. package/dist/utils/async.js +1 -1
  206. package/dist/utils/colors.js +1 -1
  207. package/dist/utils/diff.js +1 -1
  208. package/dist/utils/file-permissions.js +1 -1
  209. package/dist/utils/file-reader.js +1 -1
  210. package/dist/utils/github-releases.js +1 -1
  211. package/dist/utils/global-cache.js +1 -1
  212. package/dist/utils/json-loader.js +1 -1
  213. package/dist/utils/local-cache.js +1 -1
  214. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  215. package/dist/utils/logger/formatters/index.js +1 -1
  216. package/dist/utils/logger/handlers/console-handler.js +1 -1
  217. package/dist/utils/logger/handlers/file-handler.js +1 -1
  218. package/dist/utils/logger/handlers/index.js +1 -1
  219. package/dist/utils/logger/handlers/null-handler.js +1 -1
  220. package/dist/utils/logger/index.js +1 -1
  221. package/dist/utils/logger/logger.js +1 -1
  222. package/dist/utils/logger/types.js +1 -1
  223. package/dist/utils/option-validation.js +1 -1
  224. package/dist/utils/process.js +1 -1
  225. package/dist/utils/prompt.js +1 -1
  226. package/dist/utils/spinner.js +1 -1
  227. package/dist/utils/sse-parser.js +1 -1
  228. package/dist/utils/string-utils.js +1 -1
  229. package/dist/utils/table-ref-parser.js +1 -1
  230. package/dist/utils/tdx-logger.js +1 -1
  231. package/dist/utils/version-check.js +1 -1
  232. package/package.json +1 -1
@@ -1 +1 @@
1
- const a31_0xe8811a=a31_0x28cc;(function(_0x399502,_0x593542){const _0x27b4f1=a31_0x28cc,_0x2afb40=_0x399502();while(!![]){try{const _0x2bd6fe=parseInt(_0x27b4f1(0x1ee))/0x1+-parseInt(_0x27b4f1(0x26c))/0x2+parseInt(_0x27b4f1(0x2a8))/0x3*(-parseInt(_0x27b4f1(0x112))/0x4)+parseInt(_0x27b4f1(0x2f0))/0x5*(-parseInt(_0x27b4f1(0x1a1))/0x6)+-parseInt(_0x27b4f1(0x1ba))/0x7*(parseInt(_0x27b4f1(0x141))/0x8)+parseInt(_0x27b4f1(0x2df))/0x9+parseInt(_0x27b4f1(0x124))/0xa;if(_0x2bd6fe===_0x593542)break;else _0x2afb40['push'](_0x2afb40['shift']());}catch(_0x4e1bf5){_0x2afb40['push'](_0x2afb40['shift']());}}}(a31_0x1ad1,0x2b2f6));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0xc9ebda 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';function a31_0x1ad1(){const _0xaa1fd4=['allowed\x20IPs:','includeSensitive','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','push','41577QLUCxW','ps:pz:show','To\x20view\x20sample\x20data:','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','pullParentYaml','enabled','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','Join:','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20personalization','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','getParentSQL','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','relationships','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','✘\x20Failed\x20to\x20rename\x20directory:\x20','toFixed','segment','ps:pz:service:show','sort','any','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','message','Source:','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','sections','Updating','Listing\x20RT-enabled\x20parent\x20segments...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','personalization','entryCriteria','getPersonalization','✔\x20Updated\x20personalization\x20\x27','processedRows','payload:','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','displayValidateResults','Fetching\x20customers\x20schema...','/{name}.yml\x0a','Options:\x0a','tokens','Show\x20personalization\x20service\x20details','idStitching','\x20to\x20push\x20the\x20configuration','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','Pattern:\x20','Error:','in\x20','\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}','Show\x20a\x20specific\x20realtime\x20personalization','paused','type','execute','\x20Configuration\x20is\x20valid','SELECT\x20*\x20FROM\x20(\x0a','\x22,\x20\x22type\x22:\x20\x22','\x27...','attribute','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Error:\x20--behavior\x20requires\x20a\x20name\x0a','(id:\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x5c$&','\x27\x20(id:\x20','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Aborted.','public:','\x0aChanges\x20to\x20\x27','/\x20and\x20','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','Master:','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','addBehaviorsFile','Found\x20YAML\x20file:\x20','delete','\x20rows\x20','\x20RT\x20journey','\x20\x202.\x20Run\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','runParent','\x20Opening\x20','stats','behaviors','\x20is\x20already\x20up\x20to\x20date','✔\x20Found\x20','query','Output\x20Database:','.customers)','displayPreviewHints','listParents','✔\x20Deleted\x20token\x20\x27','\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','previewParentYaml','Behavior:','parent_segments','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','launched','✔\x20Created\x20personalization\x20\x27','log','json','Coverage:','-1d','⚡\x20Enabled','ps:rt:jn:pause','Deleting\x20personalization\x20\x27','\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','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','status:\x20','localeCompare','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Listing\x20personalization\x20services\x20for\x20\x27','name','ps:pz:service:create','public','limit','Attributes:','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','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','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','Events:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Listing\x20parent\x20segments...','test','641492xqxPOH','sourceTableValid','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','addAttributesFile','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','ID\x20Stitching:','Deleting\x20token\x20\x27','realtime_enabled','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x0aError:','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','audienceId:\x20','attributesFile','displaySampleData','✔\x20Retrieved\x20RT\x20configuration\x20version','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','listPersonalizations','ps:rt:validate','Output\x20file:\x20','workflowId','audienceId:','List\x20available\x20fields\x20for\x20segmentation','start','totalEvents','\x20[Job\x20ID:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','attributes','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','session','segment:parent:validate','RT\x20Journey\x20ID:\x20','column_name','varchar','repeat','No\x20parent\x20segments\x20found','✔\x20Created\x20personalization\x20service\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x20\x20Tables:\x201\x20customers\x20+\x20','parent_segment','Errors:','/app/dw/parentSegments/','run','jsonl','✔\x20No\x20changes\x20-\x20\x27','joinKey','ps:rt:list','Behaviors','utf-8','\x20RT-enabled\x20parent\x20segment','Error:\x20Parent\x20segment\x20name\x20is\x20required','get','Name:\x20','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Attributes','Error:\x20Token\x20\x27','indexOf','522597dTouCY','schemaValid','\x20\x20\x20\x20-\x20','description','✔\x20Created\x20parent\x20segment\x20\x27','Validate:','\x20\x20\x20','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','replace','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x27\x20with\x20ID:\x20','No\x20RT-enabled\x20parent\x20segments\x20found','Patching\x20personalization\x20\x27','validateParentYaml','includeSensitive:','segment:parent:run','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','rowCount','enriched','Delete\x20a\x20realtime\x20personalization','collectSchema','/\x20directory.\x0a','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Updated','.yml','updateParent','Personalization\x20service\x20description','segment:parent:update','\x20rows)','Enriched:','Created','No\x20personalizations\x20configured','displayBehaviorsStats','label','deletePersonalization','displayMasterInfo','RT\x202.0\x20Validate:','primaryKey','master','Preview:','trim','ps:pz:service:delete','\x20=\x20','\x27\x20and\x20run\x20workflow?','\x20\x20\x20\x20','jobId','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Available\x20behaviors:','Apply\x20changes\x20to\x20\x27','Audience\x20ID:','valid','Pause\x20activations\x20in\x20an\x20RT\x20journey','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','xdg-open','2067156CLjdIk','\x20total','interval','Fetching\x20SQL\x20for\x20\x27','behavior','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20No\x20changes\x20-\x20','personalizationServices','endsWith','tdx\x20ps\x20preview\x20','parent_id','dirname','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','ps:pz:init','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','reduce','15ggLmpW','Creating','\x0a⚠️\x20\x20Migrating:\x20','\x20configured','red','isDirectory','pauseJourney','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','dim','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','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','ps:rt:configuration_versions','Error\x20reading\x20file:\x20','customerGroup','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','folder-segment','Update\x20a\x20realtime\x20personalization\x20entity','\x20--behavior\x20\x22','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','ps:pz:patch','all','sections:','allValid','Fetching\x20sample\x20data...','\x20\x20\x20\x20\x20\x20','coveragePercent','\x0aNew\x20parent\x20segment\x20\x27','Overwrite\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','customerGroupFile','\x0aChanges\x20to\x20apply\x20to\x20\x27','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','state','Validating\x20RT\x20configuration...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','keyEventId','columns','Table:\x20','/attempt/','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Fetching\x20current\x20configuration\x20for\x20\x27','null','\x22\x20}','✔\x20Deleted\x20personalization\x20service\x20\x27','join','\x20to\x20configure\x20your\x20personalization\x20service','token:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','pushParentYaml','information_schema','table','✔\x20Renamed\x20directory\x20to\x20','Error:\x20Token\x20ID\x20is\x20required','error','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Error:\x20Service\x20ID\x20is\x20required','Finding\x20service\x20for\x20token...','segment:parent:show','page_view','displayPreviewResults','file','timezone','verbose','realtime','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x27\x20is\x20already\x20up\x20to\x20date','Listing\x20personalizations\x20for\x20\x27','8DqbEkR','data','\x20service','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','createToken','Error:\x20--database\x20and\x20--table\x20are\x20required','Status:','Creating\x20token\x20\x27','use','Fetching\x20parent\x20segment\x20\x27','displayRealtimeInfo','\x20tdx\x20wf\x20attempt\x20','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','string','no\x20tokens\x20configured','\x20personalization\x20service','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','segment:parent:sql','9838060WVtaoE','Fetching\x20behavior\x20list...','apply','customerPercent','Personalization:','tdx\x20ps\x20push\x20','Session:','Show\x20parent\x20segment\x20schema\x20(column\x20types)','segment:parent:push','schemaError','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','list','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','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','\x0a✔\x20Workflow\x20started','workflowAttemptId','listFields','✔\x20Deleted\x20personalization\x20\x27','displayAttributesStats','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Attribute:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','Attempt:','\x20\x20Note:\x20','parentSegment','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','✔\x20Updated\x20parent\x20segment\x20\x27','status','segment:parent:create','80NfZxAg','SELECT\x20*\x20FROM\x20','resolveParentId','behavior_','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Rows:','/app/workflows/','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','keyEventCriteria','single','format','\x20\x201.\x20Edit\x20','\x0a⚠️\x20\x20Both\x20','\x20Added\x20personalization\x20template\x20to\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','database','population','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Options\x20(one\x20required):\x0a','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','true','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','toLowerCase','\x20Added\x20RT\x202.0\x20template\x20section','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x0a\x20\x20\x20\x20]','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','foreignKey','To\x20cancel:','customers','patch','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','bold','sourceTableError','events','getOutputDatabaseName','addBehaviors','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Customers:','personalization_services','Show\x20parent\x20segment\x20details','output','customersWithEvents','\x20--attribute\x20\x22<name>\x22','YAML\x20file:\x20','Resume\x20activations\x20in\x20an\x20RT\x20journey','\x27\x20for\x20service\x20\x27','cyan','stringify','Parent\x20segment:\x20','displayColumns','Getting\x20personalization\x20\x27','SQL\x20query:\x0a','some','getParentFull','split','map','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','platform','\x27\x20is\x20up\x20to\x20date','/\x20→\x20','Get\x20current\x20RT\x20configuration\x20version\x20status','folderId','deleteToken','filter','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','errors','Creating\x20personalization\x20\x27','scheduleOption','Creating\x20parent\x20segment\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Resolving\x20parent\x20segment\x20\x27','/sessions/','👥\x20','audienceId','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','using\x20the\x20default\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\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','\x20\x20Database:\x20','addAttributes','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Error:\x20Personalization\x20ID\x20is\x20required','✔\x20Found\x20personalization\x20\x27','displaySummary','column_type','getBehaviorNames','Creating\x20personalization\x20service\x20\x27','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','created:','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','403134rMqLhx','length','identifier','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','open','yellow','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','ps:rt:jn:list','ps:pz:delete','<database>.<table>','keyEventId:','%)\x20','realtime:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','darwin','workflowSessionId','\x20RT\x20configuration\x20is\x20valid','entryCriteria:','segment:parent:list','Updating\x20personalization\x20service\x20\x27','stageCount','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','sampleData','unref','145229owCVeH','\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','last_page_viewed','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','text','\x20--attribute\x20\x22','Master\x20Table','\x20service(s)\x20configured','value','Analyzing\x20changes...','Listing\x20RT\x20journeys\x20for\x20\x27','segment:parent:preview','Default','payload','keys','List\x20RT\x20journeys','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','Deleting\x20personalization\x20service\x20\x27','⚡\x20Not\x20enabled','toLocaleString','\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','\x20+\x20[','\x20(paused)','td_client_id','yes','createPersonalization','Error\x20parsing\x20YAML:\x20','formatSchemaJson','site','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','ps:pz:create','\x20Context\x20set:\x20','patchPersonalization','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','allowedIps','segment:parent:fields','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','column','number','updated:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','stop','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','✔\x20Created\x20token\x20\x27','scheduleType','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Site:\x20','Create\x20parent\x20segment\x20\x27'];a31_0x1ad1=function(){return _0xaa1fd4;};return a31_0x1ad1();}import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';function a31_0x28cc(_0x48296,_0x300887){_0x48296=_0x48296-0xfe;const _0x1ad1c4=a31_0x1ad1();let _0x28cc9a=_0x1ad1c4[_0x48296];return _0x28cc9a;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x4d24f3 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_0xe8811a(0x24f),LEGACY_PARENT_SEGMENT_DIR=a31_0xe8811a(0x296);function openBrowser(_0x382c65){const _0x553f78=a31_0xe8811a,_0x275983=process[_0x553f78(0x180)],_0x31da0e=_0x275983===_0x553f78(0x1b0)?_0x553f78(0x1a6):_0x275983==='win32'?_0x553f78(0x283):_0x553f78(0x2de);spawn(_0x31da0e,[_0x382c65],{'detached':!![],'stdio':'ignore'})[_0x553f78(0x1b9)]();}function migrateLegacyDirectory(){const _0x11a27c=a31_0xe8811a;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x39f095=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x39f095[_0x11a27c(0x2f5)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x11a27c(0x104)](a31_0x4d24f3[_0x11a27c(0x1a7)](_0x11a27c(0x14f)+LEGACY_PARENT_SEGMENT_DIR+_0x11a27c(0x234)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x11a27c(0x104)](a31_0x4d24f3[_0x11a27c(0x2f8)](_0x11a27c(0x16b)+LEGACY_PARENT_SEGMENT_DIR+_0x11a27c(0x2be))),![];console[_0x11a27c(0x104)](a31_0x4d24f3['yellow'](_0x11a27c(0x2f2)+LEGACY_PARENT_SEGMENT_DIR+_0x11a27c(0x182)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x11a27c(0x104)](a31_0x4d24f3['green'](_0x11a27c(0x102)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0xf34599){const _0x26aaa3=_0xf34599 instanceof Error?_0xf34599[_0x11a27c(0x205)]:String(_0xf34599);return console[_0x11a27c(0x104)](a31_0x4d24f3[_0x11a27c(0x2f4)](_0x11a27c(0x1fe)+_0x26aaa3+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0xe8811a(0x299)](_0x38ba4e){const _0x366a8d=a31_0xe8811a;return migrateLegacyDirectory(),super[_0x366a8d(0x299)](_0x38ba4e);}}function resolveYamlFile(_0x5488e3){const _0x242ba4=a31_0xe8811a;if(_0x5488e3[_0x242ba4(0x2e7)](_0x242ba4(0x2c1))||_0x5488e3[_0x242ba4(0x2e7)]('.yaml'))return _0x5488e3;return a31_0xc9ebda[_0x242ba4(0x31f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5488e3)+'.yml');}function formatProgressMessage(_0x26fc3b){const _0x52c1ab=a31_0xe8811a,_0x9ba4e5=_0x26fc3b['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x9ba4e5){const [,_0x2e4bc1,_0x25afb9,_0x1fedd8='']=_0x9ba4e5;return a31_0x4d24f3[_0x52c1ab(0x2f8)](_0x2e4bc1+':')+'\x20'+_0x25afb9+a31_0x4d24f3['dim'](_0x1fedd8);}return a31_0x4d24f3['dim'](_0x26fc3b);}function showFileNotFoundError(_0x221c3d,_0x222ea3){const _0x23d3d4=a31_0xe8811a;console[_0x23d3d4(0x104)](a31_0x4d24f3[_0x23d3d4(0x2f4)]('Error:\x20File\x20not\x20found:\x20'+_0x221c3d+'\x0a')),console[_0x23d3d4(0x104)](a31_0x4d24f3[_0x23d3d4(0x175)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x222ea3+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x58d8aa){const _0x5bf396=a31_0xe8811a;if(!_0x58d8aa['realtime'])return;const _0x48db8b=_0x58d8aa[_0x5bf396(0x10e)],_0x455d74=_0x48db8b[_0x5bf396(0x1f3)]?a31_0x4d24f3[_0x5bf396(0x2af)](_0x5bf396(0x257)):a31_0x4d24f3[_0x5bf396(0x1a7)](_0x5bf396(0x1cc));console['error']('\x0a'+a31_0x4d24f3[_0x5bf396(0x2f8)]('RT\x202.0:')+'\x20'+_0x455d74);if(_0x48db8b[_0x5bf396(0x168)]&&_0x48db8b[_0x5bf396(0x168)][_0x5bf396(0x1a2)]>0x0){console[_0x5bf396(0x104)]('\x20\x20'+a31_0x4d24f3['dim'](_0x5bf396(0x268))+'\x20'+_0x48db8b[_0x5bf396(0x168)][_0x5bf396(0x1a2)]+'\x20configured');for(const _0x3dcb41 of _0x48db8b[_0x5bf396(0x168)]){const _0x268da7=_0x3dcb41[_0x5bf396(0x26d)]===![]?a31_0x4d24f3['red']('✘'):a31_0x4d24f3[_0x5bf396(0x2af)]('✔');console['error'](_0x5bf396(0x2d5)+_0x268da7+'\x20'+_0x3dcb41[_0x5bf396(0x260)]),_0x3dcb41['sourceTableError']&&console[_0x5bf396(0x104)]('\x20\x20\x20\x20\x20\x20'+a31_0x4d24f3[_0x5bf396(0x2f4)](_0x3dcb41[_0x5bf396(0x167)]));}}if(_0x48db8b[_0x5bf396(0x289)]&&_0x48db8b[_0x5bf396(0x289)][_0x5bf396(0x1a2)]>0x0){console[_0x5bf396(0x104)]('\x20\x20'+a31_0x4d24f3['dim'](_0x5bf396(0x264))+'\x20'+_0x48db8b[_0x5bf396(0x289)]['length']+_0x5bf396(0x2f3));for(const _0x50cf85 of _0x48db8b[_0x5bf396(0x289)]){const _0x116595=_0x50cf85[_0x5bf396(0x2db)]?a31_0x4d24f3['green']('✔'):a31_0x4d24f3[_0x5bf396(0x2f4)]('✘');console['error'](_0x5bf396(0x2d5)+_0x116595+'\x20'+_0x50cf85[_0x5bf396(0x260)]+'\x20'+a31_0x4d24f3[_0x5bf396(0x2f8)]('('+_0x50cf85['type']+')'));}}if(_0x48db8b['idStitching']){const _0xcaa1ed=_0x48db8b[_0x5bf396(0x21a)]['stitchingKeys']?.['length']?_0x5bf396(0x1cf)+_0x48db8b['idStitching']['stitchingKeys'][_0x5bf396(0x31f)](',\x20')+']':'';console[_0x5bf396(0x104)]('\x20\x20'+a31_0x4d24f3[_0x5bf396(0x2f8)](_0x5bf396(0x272))+'\x20'+_0x48db8b['idStitching'][_0x5bf396(0x2ce)]+_0xcaa1ed);}if(_0x48db8b[_0x5bf396(0x2e6)]&&_0x48db8b[_0x5bf396(0x2e6)]['length']>0x0){console['error']('\x20\x20'+a31_0x4d24f3[_0x5bf396(0x2f8)](_0x5bf396(0x128))+'\x20'+_0x48db8b[_0x5bf396(0x2e6)][_0x5bf396(0x1a2)]+_0x5bf396(0x114)+(_0x48db8b[_0x5bf396(0x2e6)]['length']!==0x1?'s':''));for(const _0x1ba09c of _0x48db8b[_0x5bf396(0x2e6)]){console[_0x5bf396(0x104)](_0x5bf396(0x2aa)+_0x1ba09c['name']);}}}function showParentSegmentNotSetError(_0x5f3896){const _0x46ac8d=a31_0xe8811a;console[_0x46ac8d(0x104)](a31_0x4d24f3['yellow'](_0x46ac8d(0x2b0))),console[_0x46ac8d(0x104)](_0x5f3896);}export class ParentSegmentListCommand extends BaseCommand{['name']=a31_0xe8811a(0x1b4);[a31_0xe8811a(0x2ab)]='List\x20parent\x20segments';async[a31_0xe8811a(0x224)](_0xe8bcf9){const _0x206725=a31_0xe8811a,{options:_0x4830f2,args:_0x47bae4,tdx:_0x46f19b}=_0xe8bcf9,_0x4197d0=_0x47bae4[0x0];_0x4830f2['verbose']&&(console[_0x206725(0x104)](_0x206725(0x1e8)+_0x4830f2[_0x206725(0x1d6)]),_0x4197d0&&console[_0x206725(0x104)](_0x206725(0x21d)+_0x4197d0));const _0x57795a=await withSpinner(_0x4197d0?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x4197d0+_0x206725(0x228):_0x206725(0x26a),()=>_0x46f19b[_0x206725(0x200)][_0x206725(0x24a)](),{'verbose':_0x4830f2[_0x206725(0x10d)]});let _0x4edcd6=_0x57795a[_0x206725(0x113)];if(_0x4197d0){const _0xbc74e9=_0x4197d0[_0x206725(0x2b1)](/[.+^${}()|[\]\\]/g,_0x206725(0x22e))[_0x206725(0x2b1)](/\*/g,'.*')[_0x206725(0x2b1)](/\?/g,'.'),_0x54572f=new RegExp('^'+_0xbc74e9+'$','i');_0x4edcd6=_0x4edcd6[_0x206725(0x186)](_0x211e0c=>_0x54572f['test'](_0x211e0c[_0x206725(0x289)]['name']));}_0x4edcd6[_0x206725(0x202)]((_0x2cf43b,_0x206051)=>_0x2cf43b[_0x206725(0x289)][_0x206725(0x260)][_0x206725(0x25d)](_0x206051['attributes'][_0x206725(0x260)])),console[_0x206725(0x104)]('✔\x20Found\x20'+_0x4edcd6[_0x206725(0x1a2)]+'\x20parent\x20segment'+(_0x4edcd6[_0x206725(0x1a2)]!==0x1?'s':''));const _0x3adcdd=_0x408bb2=>{const _0x5124e7=_0x206725;return getConsoleNextUrl(_0x4830f2['site'],_0x5124e7(0x298)+_0x408bb2);};if(_0x4830f2['format']===_0x206725(0x254)||_0x4830f2['format']===_0x206725(0x29a)){const _0x46501e=_0x4edcd6['map'](_0x15efbb=>({..._0x15efbb,'url':_0x3adcdd(_0x15efbb['id'])}));await handleSDKOutput(_0x46501e,_0x4830f2);}else{if(_0x4edcd6[_0x206725(0x1a2)]===0x0)_0x4197d0?console[_0x206725(0x253)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x4197d0):console[_0x206725(0x253)](_0x206725(0x291));else for(const _0x519051 of _0x4edcd6){const _0x780ace=_0x519051[_0x206725(0x289)][_0x206725(0x154)]?a31_0x4d24f3[_0x206725(0x2f8)]('\x20('+formatRows(_0x519051[_0x206725(0x289)][_0x206725(0x154)])+')'):'',_0x4634a8=hyperlink(_0x519051['attributes'][_0x206725(0x260)],_0x3adcdd(_0x519051['id']));console['log'](_0x206725(0x18f)+_0x4634a8+_0x780ace);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x140);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x115);async[a31_0xe8811a(0x224)](_0x48d1de){const _0x12a22e=a31_0xe8811a,{options:_0x3d077c,args:_0xcd7f1c,tdx:_0x122b24}=_0x48d1de;console[_0x12a22e(0x104)](_0x12a22e(0x191)+_0x12a22e(0x269)+_0x12a22e(0x213));const _0x5758f6=_0x3d077c;if(_0xcd7f1c['length']===0x0)return console[_0x12a22e(0x104)](a31_0x4d24f3['red'](_0x12a22e(0x2a1))),console[_0x12a22e(0x104)](_0x12a22e(0x294)),0x1;const _0x136c57=_0xcd7f1c[0x0];if(!_0x5758f6[_0x12a22e(0x153)]||!_0x5758f6[_0x12a22e(0x101)])return console['error'](_0x12a22e(0x117)),console[_0x12a22e(0x104)](_0x12a22e(0x294)),0x1;_0x5758f6['verbose']&&(console[_0x12a22e(0x104)](_0x12a22e(0x1e8)+_0x5758f6[_0x12a22e(0x1d6)]),console[_0x12a22e(0x104)](_0x12a22e(0x2a3)+_0x136c57),console['error']('Database:\x20'+_0x5758f6[_0x12a22e(0x153)]),console[_0x12a22e(0x104)](_0x12a22e(0x318)+_0x5758f6['table']));const _0x1ef626=await loadJSONFromOptions(_0x5758f6[_0x12a22e(0x289)],_0x5758f6[_0x12a22e(0x279)]),_0x4a5cbd=await loadJSONFromOptions(_0x5758f6[_0x12a22e(0x243)],_0x5758f6['behaviorsFile']),_0x5810f0=await loadJSONFromOptions(_0x5758f6[_0x12a22e(0x2fd)],_0x5758f6[_0x12a22e(0x30e)]),_0x39147d={'name':_0x136c57,'description':_0x5758f6[_0x12a22e(0x2ab)],'scheduleType':_0x5758f6['scheduleType'],'scheduleOption':_0x5758f6[_0x12a22e(0x18a)],'timezone':_0x5758f6[_0x12a22e(0x10c)],'master':{'parentDatabaseName':_0x5758f6['database'],'parentTableName':_0x5758f6[_0x12a22e(0x101)]},'attributes':_0x1ef626,'behaviors':_0x4a5cbd,'customerGroup':_0x5810f0},_0x44186f=await withSpinner(_0x12a22e(0x18b)+_0x136c57+_0x12a22e(0x228),()=>_0x122b24[_0x12a22e(0x200)]['createParent'](_0x39147d),{'verbose':_0x3d077c[_0x12a22e(0x10d)]}),_0x1a5d34=_0x44186f[_0x12a22e(0x113)];return console[_0x12a22e(0x104)](_0x12a22e(0x2ac)+_0x1a5d34[_0x12a22e(0x260)]+_0x12a22e(0x2b3)+_0x1a5d34['id']),await handleSDKOutput([_0x1a5d34],_0x3d077c),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a31_0xe8811a(0x2c4);['description']=a31_0xe8811a(0x2a4);async['execute'](_0x2e5264){const _0x2d0ad1=a31_0xe8811a,{options:_0x7d13f3,args:_0x578566,tdx:_0x5dce0d}=_0x2e5264;console['error'](_0x2d0ad1(0x208)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x2d0ad1(0x213));const _0x8840d=_0x7d13f3;if(_0x578566[_0x2d0ad1(0x1a2)]===0x0)return console[_0x2d0ad1(0x104)](a31_0x4d24f3[_0x2d0ad1(0x2f4)](_0x2d0ad1(0x2a1))),console[_0x2d0ad1(0x104)](_0x2d0ad1(0x1a0)),0x1;const _0x47a253=_0x578566[0x0];_0x8840d[_0x2d0ad1(0x10d)]&&(console['error'](_0x2d0ad1(0x1e8)+_0x8840d['site']),console[_0x2d0ad1(0x104)](_0x2d0ad1(0x177)+_0x47a253));const _0x50f900=await withSpinner(_0x2d0ad1(0x31b)+_0x47a253+_0x2d0ad1(0x228),()=>_0x5dce0d[_0x2d0ad1(0x200)][_0x2d0ad1(0x17c)](_0x47a253),{'verbose':_0x8840d[_0x2d0ad1(0x10d)]}),_0x262dd8=_0x50f900[_0x2d0ad1(0x113)],_0x2880f7=await loadJSONFromOptions(_0x8840d[_0x2d0ad1(0x196)],_0x8840d[_0x2d0ad1(0x26f)]),_0x1a1249=await loadJSONFromOptions(_0x8840d[_0x2d0ad1(0x16a)],_0x8840d[_0x2d0ad1(0x239)]),_0x153df0={'name':_0x262dd8[_0x2d0ad1(0x260)],'description':_0x8840d[_0x2d0ad1(0x2ab)]!==undefined?_0x8840d['description']:_0x262dd8[_0x2d0ad1(0x2ab)],'scheduleType':_0x8840d[_0x2d0ad1(0x1e6)]!==undefined?_0x8840d[_0x2d0ad1(0x1e6)]:_0x262dd8['scheduleType'],'scheduleOption':_0x8840d[_0x2d0ad1(0x18a)]!==undefined?_0x8840d['scheduleOption']:_0x262dd8['scheduleOption'],'timezone':_0x8840d['timezone']!==undefined?_0x8840d[_0x2d0ad1(0x10c)]:_0x262dd8[_0x2d0ad1(0x10c)],'master':_0x262dd8[_0x2d0ad1(0x2cf)],'attributes':_0x2880f7?[..._0x262dd8[_0x2d0ad1(0x289)]||[],..._0x2880f7]:_0x262dd8[_0x2d0ad1(0x289)],'behaviors':_0x1a1249?[..._0x262dd8['behaviors']||[],..._0x1a1249]:_0x262dd8['behaviors'],'customerGroup':_0x262dd8[_0x2d0ad1(0x2fd)]},_0x40d113=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x47a253+_0x2d0ad1(0x228),()=>_0x5dce0d['segment'][_0x2d0ad1(0x2c2)](_0x47a253,_0x153df0),{'verbose':_0x8840d[_0x2d0ad1(0x10d)]}),_0x4535f9=_0x40d113[_0x2d0ad1(0x113)];return console[_0x2d0ad1(0x104)](_0x2d0ad1(0x13e)+_0x4535f9[_0x2d0ad1(0x260)]+'\x27'),await handleSDKOutput([_0x4535f9],_0x8840d),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]='segment:parent:pull';['description']='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a31_0xe8811a(0x224)](_0x441702){const _0x27ac51=a31_0xe8811a,{options:_0x5ac53a,args:_0x4ada1d,tdx:_0x7df8d6}=_0x441702,_0x3732d3=_0x5ac53a,_0x4ca81a=_0x4ada1d[0x0]||_0x5ac53a[_0x27ac51(0x13c)];if(!_0x4ca81a)return showParentSegmentNotSetError(_0x27ac51(0x1fb)+_0x27ac51(0x193)),0x1;if(_0x3732d3[_0x27ac51(0x11a)]&&_0x3732d3[_0x27ac51(0x16f)])return console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x2f4)](_0x27ac51(0x275))),console['error'](a31_0x4d24f3[_0x27ac51(0x2f8)](_0x27ac51(0x27c))),console['error'](a31_0x4d24f3[_0x27ac51(0x2f8)](_0x27ac51(0x192)+PARENT_SEGMENT_DIR+_0x27ac51(0x216))),console[_0x27ac51(0x104)](a31_0x4d24f3['cyan'](_0x27ac51(0x1f7))),0x1;const _0x5ebfe3=_0x3732d3[_0x27ac51(0x16f)]||a31_0xc9ebda[_0x27ac51(0x31f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4ca81a)+'.yml');_0x3732d3[_0x27ac51(0x10d)]&&(console[_0x27ac51(0x104)](_0x27ac51(0x1e8)+_0x3732d3[_0x27ac51(0x1d6)]),console[_0x27ac51(0x104)](_0x27ac51(0x177)+_0x4ca81a),console['error'](_0x27ac51(0x27f)+_0x5ebfe3));const _0x46e41f=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x4ca81a+'\x27...',()=>_0x7df8d6[_0x27ac51(0x200)][_0x27ac51(0x1f2)](_0x4ca81a),{'verbose':_0x3732d3[_0x27ac51(0x10d)]}),_0x166dbf=_0x46e41f[_0x27ac51(0x113)];if(existsSync(_0x5ebfe3)){const _0xbf99d=readFileSync(_0x5ebfe3,_0x27ac51(0x29f)),_0x9497da=generateDiff(_0xbf99d,_0x166dbf);if(!hasChanges(_0x9497da))console[_0x27ac51(0x104)](a31_0x4d24f3['green']('✔')+_0x27ac51(0x2e5)+a31_0x4d24f3[_0x27ac51(0x175)](_0x5ebfe3)+_0x27ac51(0x244));else{console['error'](_0x27ac51(0x233)+_0x5ebfe3+'\x27:'),console[_0x27ac51(0x104)]('─'[_0x27ac51(0x290)](0x3c)),console[_0x27ac51(0x104)](formatDiffWithColors(_0x9497da)),console[_0x27ac51(0x104)]('─'['repeat'](0x3c));if(!_0x3732d3['yes']){if(!isInteractive())return console['error'](a31_0x4d24f3['red'](_0x27ac51(0x276)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x2f8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x41067a=await confirmKey(_0x27ac51(0x30c)+_0x5ebfe3+'\x27?');if(!_0x41067a)return console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x1a7)](_0x27ac51(0x231))),0x1;}writeFileSync(_0x5ebfe3,_0x166dbf,'utf-8'),console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x2af)]('✔')+_0x27ac51(0x22d)+a31_0x4d24f3[_0x27ac51(0x175)](_0x5ebfe3));}}else{const _0x13a648=a31_0xc9ebda[_0x27ac51(0x2ea)](_0x5ebfe3);!existsSync(_0x13a648)&&mkdirSync(_0x13a648,{'recursive':!![]}),writeFileSync(_0x5ebfe3,_0x166dbf,_0x27ac51(0x29f)),console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x2af)]('✔')+_0x27ac51(0x22d)+a31_0x4d24f3['cyan'](_0x5ebfe3));}return saveSessionContext({'parent_segment':_0x4ca81a},_0x3732d3[_0x27ac51(0x28b)]),console['error'](a31_0x4d24f3[_0x27ac51(0x2af)]('✔')+_0x27ac51(0x1d9)+a31_0x4d24f3[_0x27ac51(0x2f8)](_0x27ac51(0x296))+_0x27ac51(0x2d3)+a31_0x4d24f3['cyan'](_0x4ca81a)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x12c);[a31_0xe8811a(0x2ab)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0x10935f){const _0x4ffbac=a31_0xe8811a,{options:_0x37bd82,args:_0x4c5afa,tdx:_0x33c72b}=_0x10935f,_0x37951d=_0x37bd82,_0x42dffc=_0x4c5afa[0x0]||_0x37bd82[_0x4ffbac(0x13c)];if(!_0x42dffc)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x4ffbac(0x31a)),0x1;const _0x4fb7c3=resolveYamlFile(_0x42dffc);if(!existsSync(_0x4fb7c3))return showFileNotFoundError(_0x4fb7c3,_0x42dffc),0x1;_0x37951d[_0x4ffbac(0x10d)]&&(console['error'](_0x4ffbac(0x1e8)+_0x37951d[_0x4ffbac(0x1d6)]),console[_0x4ffbac(0x104)](_0x4ffbac(0x172)+_0x4fb7c3));let _0x39e905;try{_0x39e905=readFileSync(_0x4fb7c3,_0x4ffbac(0x29f));}catch(_0x22c7e9){const _0x4e6efc=_0x22c7e9 instanceof Error?_0x22c7e9[_0x4ffbac(0x205)]:String(_0x22c7e9);return console[_0x4ffbac(0x104)]('Error\x20reading\x20file:\x20'+_0x4e6efc),0x1;}const _0x1ad64b=await withSpinner('Analyzing\x20changes...',()=>_0x33c72b[_0x4ffbac(0x200)][_0x4ffbac(0xff)](_0x39e905),{'verbose':_0x37951d[_0x4ffbac(0x10d)]}),_0x2cd78d=_0x1ad64b[_0x4ffbac(0x113)],{isNew:_0x1a8ba5,name:_0xeeac11,hasChanges:_0x42cb30,diffFormatted:_0x3660de}=_0x2cd78d;if(!_0x42cb30)return console['error'](_0x4ffbac(0x29b)+_0xeeac11+_0x4ffbac(0x110)),0x0;_0x1a8ba5?console[_0x4ffbac(0x104)](_0x4ffbac(0x30b)+_0xeeac11+'\x27:'):console[_0x4ffbac(0x104)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0xeeac11+'\x27:');console[_0x4ffbac(0x104)]('─'['repeat'](0x3c)),console[_0x4ffbac(0x104)](_0x3660de),console[_0x4ffbac(0x104)]('─'[_0x4ffbac(0x290)](0x3c));const _0xb4dcf2=_0x1a8ba5?'Create\x20parent\x20segment\x20\x27'+_0xeeac11+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0xeeac11+'\x27?';if(!_0x37951d['yes']){if(!isInteractive())return console[_0x4ffbac(0x104)](a31_0x4d24f3[_0x4ffbac(0x2f4)]('\x0aError:'),_0x4ffbac(0x17f)),console[_0x4ffbac(0x104)](a31_0x4d24f3['dim'](_0x4ffbac(0x18c))),0x1;const _0x1fb097=await confirmKey(_0xb4dcf2);if(!_0x1fb097)return console[_0x4ffbac(0x104)](a31_0x4d24f3[_0x4ffbac(0x1a7)](_0x4ffbac(0x231))),0x1;}const _0x97f7b9=_0x1a8ba5?_0x4ffbac(0x2f1):'Updating',_0x2de5dc=await withSpinner(_0x97f7b9+'\x20parent\x20segment\x20\x27'+_0xeeac11+_0x4ffbac(0x228),()=>_0x2cd78d[_0x4ffbac(0x126)](),{'verbose':_0x37951d[_0x4ffbac(0x10d)]}),_0x4865d1=_0x2de5dc[_0x4ffbac(0x113)],_0x5b9d2e=getConsoleNextUrl(_0x37951d[_0x4ffbac(0x1d6)],_0x4ffbac(0x298)+_0x4865d1['id']),_0x5d341c=_0x1a8ba5?_0x4ffbac(0x2c7):_0x4ffbac(0x2c0);return console[_0x4ffbac(0x104)]('✔\x20'+_0x5d341c+'\x20parent\x20segment\x20\x27'+_0x4865d1[_0x4ffbac(0x260)]+'\x27'),console[_0x4ffbac(0x104)]('\x20\x20'+_0x5b9d2e),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a31_0xe8811a(0x28c);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x310);async[a31_0xe8811a(0x224)](_0x298b1b){const _0x44e3c8=a31_0xe8811a,{options:_0x556d1e,args:_0xa2ba26,tdx:_0x4b3b49}=_0x298b1b,_0x42a736=_0x556d1e,_0xceab0a=_0xa2ba26[0x0]||_0x556d1e[_0x44e3c8(0x13c)];if(!_0xceab0a)return showParentSegmentNotSetError(_0x44e3c8(0x22a)+_0x44e3c8(0x1af)+_0x44e3c8(0x217)+_0x44e3c8(0x230)+_0x44e3c8(0x187)+_0x44e3c8(0x149)),0x1;const _0x2cb1bc=resolveYamlFile(_0xceab0a);if(!existsSync(_0x2cb1bc))return showFileNotFoundError(_0x2cb1bc,_0xceab0a),0x1;_0x42a736[_0x44e3c8(0x10d)]&&(console[_0x44e3c8(0x104)](_0x44e3c8(0x1e8)+_0x42a736[_0x44e3c8(0x1d6)]),console['error']('YAML\x20file:\x20'+_0x2cb1bc));let _0x1cff53;try{_0x1cff53=readFileSync(_0x2cb1bc,'utf-8');}catch(_0x637644){const _0x10860c=_0x637644 instanceof Error?_0x637644[_0x44e3c8(0x205)]:String(_0x637644);return console[_0x44e3c8(0x104)](_0x44e3c8(0x2fc)+_0x10860c),0x1;}const _0x5b6477=createCommandSpinner(a31_0x4d24f3['dim']('Validating\x20configuration...'),{'verbose':_0x42a736[_0x44e3c8(0x10d)]});_0x5b6477[_0x44e3c8(0x283)]();const _0x5e8b90={'onProgress':_0x202528=>{const _0x1e9f2b=_0x44e3c8;_0x5b6477[_0x1e9f2b(0x1be)]=formatProgressMessage(_0x202528);}};if(_0x42a736[_0x44e3c8(0x2cf)])_0x5e8b90[_0x44e3c8(0x2cf)]=!![];if(_0x42a736['enriched'])_0x5e8b90[_0x44e3c8(0x2bb)]=!![];_0x42a736[_0x44e3c8(0x229)]&&(_0x5e8b90[_0x44e3c8(0x229)]=_0x42a736[_0x44e3c8(0x229)]);_0x42a736[_0x44e3c8(0x2e3)]&&(_0x5e8b90[_0x44e3c8(0x2e3)]=_0x42a736['behavior']);if(_0x42a736[_0x44e3c8(0x2e1)])_0x5e8b90[_0x44e3c8(0x2e1)]=_0x42a736[_0x44e3c8(0x2e1)];let _0x3ac25c;try{_0x3ac25c=await _0x4b3b49['segment'][_0x44e3c8(0x2b6)](_0x1cff53,_0x5e8b90),_0x5b6477[_0x44e3c8(0x1e3)]();}catch(_0x20040e){_0x5b6477[_0x44e3c8(0x1e3)]();throw _0x20040e;}const _0x1a3a7b=_0x42a736['interval']||_0x44e3c8(0x256);return this[_0x44e3c8(0x214)](_0x3ac25c,_0x5e8b90,_0x2cb1bc,_0x1a3a7b),_0x3ac25c[_0x44e3c8(0x307)]?0x0:0x1;}[a31_0xe8811a(0x214)](_0x5c5b2c,_0x271685,_0x1893e9,_0x5c4aac){const _0x3bea28=a31_0xe8811a;console['error']('\x0a'+a31_0x4d24f3[_0x3bea28(0x166)](_0x3bea28(0x2ad))+'\x20'+_0x5c5b2c[_0x3bea28(0x260)]),console[_0x3bea28(0x104)]('═'[_0x3bea28(0x290)](0x3c)),this[_0x3bea28(0x2cc)](_0x5c5b2c);if(typeof _0x271685[_0x3bea28(0x229)]==='string'){this[_0x3bea28(0x136)](_0x5c5b2c),this[_0x3bea28(0x19a)](_0x5c5b2c),this['displayPreviewHints'](_0x1893e9,_0x5c4aac,_0x3bea28(0x229),_0x271685[_0x3bea28(0x229)]);return;}if(_0x271685[_0x3bea28(0x229)]===!![]){this[_0x3bea28(0x136)](_0x5c5b2c),this['displaySummary'](_0x5c5b2c),this['displayPreviewHints'](_0x1893e9,_0x5c4aac,_0x3bea28(0x289));return;}if(typeof _0x271685[_0x3bea28(0x2e3)]===_0x3bea28(0x11f)){this[_0x3bea28(0x2c9)](_0x5c5b2c,_0x5c4aac),this['displaySummary'](_0x5c5b2c),this[_0x3bea28(0x249)](_0x1893e9,_0x5c4aac,_0x3bea28(0x2e3),_0x271685[_0x3bea28(0x2e3)]);return;}if(_0x271685[_0x3bea28(0x2e3)]===!![]){this['displayBehaviorsStats'](_0x5c5b2c,_0x5c4aac),this[_0x3bea28(0x19a)](_0x5c5b2c),this[_0x3bea28(0x249)](_0x1893e9,_0x5c4aac,_0x3bea28(0x243));return;}this[_0x3bea28(0x136)](_0x5c5b2c),this[_0x3bea28(0x2c9)](_0x5c5b2c,_0x5c4aac),this[_0x3bea28(0x11c)](_0x5c5b2c),this[_0x3bea28(0x19a)](_0x5c5b2c),this[_0x3bea28(0x249)](_0x1893e9,_0x5c4aac,'all');}[a31_0xe8811a(0x11c)](_0x525228){displayRealtimeValidation(_0x525228);}[a31_0xe8811a(0x249)](_0x398a44,_0x20b5de,_0x24b242,_0x1be27b){const _0x50d527=a31_0xe8811a;console[_0x50d527(0x104)]('\x0a'+a31_0x4d24f3[_0x50d527(0x2f8)](_0x50d527(0x1f0)));const _0x3914ff=_0x20b5de!=='-1d'?'\x20--interval\x20'+_0x20b5de:'';if(_0x24b242===_0x50d527(0x229)&&_0x1be27b)console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3['dim']('tdx\x20ps\x20preview\x20'+_0x398a44+'\x20--attribute\x20\x22'+_0x1be27b+'\x22'+_0x3914ff));else{if(_0x24b242==='behavior'&&_0x1be27b)console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3[_0x50d527(0x2f8)](_0x50d527(0x2e8)+_0x398a44+_0x50d527(0x301)+_0x1be27b+'\x22'+_0x3914ff));else(_0x24b242===_0x50d527(0x289)||_0x24b242===_0x50d527(0x305))&&console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3['dim'](_0x50d527(0x2e8)+_0x398a44+_0x50d527(0x171)+_0x3914ff));}(_0x24b242==='behaviors'||_0x24b242===_0x50d527(0x305))&&console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3[_0x50d527(0x2f8)](_0x50d527(0x2e8)+_0x398a44+'\x20--behavior\x20\x22<name>\x22'+_0x3914ff)),_0x24b242===_0x50d527(0x305)&&console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3[_0x50d527(0x2f8)]('tdx\x20ps\x20preview\x20'+_0x398a44+'\x20--enriched'+_0x3914ff));}[a31_0xe8811a(0x2cc)](_0xd09171){const _0x2fe0fe=a31_0xe8811a,{master:_0x21b55f}=_0xd09171,_0x51f0a8=_0x21b55f[_0x2fe0fe(0x2a9)]?a31_0x4d24f3[_0x2fe0fe(0x2af)]('✔'):a31_0x4d24f3['red']('✘');console[_0x2fe0fe(0x104)]('\x0a'+a31_0x4d24f3[_0x2fe0fe(0x2f8)](_0x2fe0fe(0x1c0))),console[_0x2fe0fe(0x104)](_0x51f0a8+'\x20'+a31_0x4d24f3[_0x2fe0fe(0x166)](_0x21b55f[_0x2fe0fe(0x153)]+'.'+_0x21b55f[_0x2fe0fe(0x101)])),_0x21b55f[_0x2fe0fe(0x2a9)]?_0x21b55f['rowCount']!==undefined&&console[_0x2fe0fe(0x104)]('\x20\x20'+a31_0x4d24f3[_0x2fe0fe(0x2f8)](_0x2fe0fe(0x147))+'\x20'+a31_0x4d24f3['cyan'](formatRows(_0x21b55f[_0x2fe0fe(0x2ba)]))):console['error']('\x20\x20'+a31_0x4d24f3['red']('Error:')+'\x20'+_0x21b55f[_0x2fe0fe(0x12d)]);}['displayAttributesStats'](_0x4cca46){const _0x58c03b=a31_0xe8811a;if(_0x4cca46[_0x58c03b(0x289)][_0x58c03b(0x1a2)]===0x0)return;console[_0x58c03b(0x104)]('\x0a'+a31_0x4d24f3[_0x58c03b(0x2f8)](_0x58c03b(0x2a5)));for(const _0x1e3a79 of _0x4cca46[_0x58c03b(0x289)]){const _0x1442ff=_0x1e3a79[_0x58c03b(0x2a9)]?a31_0x4d24f3['green']('✔'):a31_0x4d24f3[_0x58c03b(0x2f4)]('✘');let _0x497d00='';if(_0x1e3a79['schemaValid']&&_0x1e3a79['matchedCount']!==undefined&&_0x1e3a79['coveragePercent']!==undefined){const _0x33a206=_0x1e3a79[_0x58c03b(0x30a)]['toFixed'](0x1),_0x161dd7=_0x1e3a79[_0x58c03b(0x30a)]>=0x50?a31_0x4d24f3[_0x58c03b(0x2af)]:_0x1e3a79[_0x58c03b(0x30a)]>=0x32?a31_0x4d24f3['yellow']:a31_0x4d24f3['red'];_0x497d00='\x20'+a31_0x4d24f3[_0x58c03b(0x2f8)](_0x58c03b(0x255))+'\x20'+_0x161dd7(_0x33a206+'%')+'\x20('+formatRows(_0x1e3a79['matchedCount'])+_0x58c03b(0x2c5);}console[_0x58c03b(0x104)](_0x1442ff+'\x20'+a31_0x4d24f3[_0x58c03b(0x166)](_0x1e3a79['name'])+_0x497d00),console['error']('\x20\x20'+a31_0x4d24f3['dim'](_0x58c03b(0x206))+'\x20'+a31_0x4d24f3[_0x58c03b(0x166)](_0x1e3a79[_0x58c03b(0x153)]+'.'+_0x1e3a79[_0x58c03b(0x101)]));const _0x288de7=_0x1e3a79['joinKey']===_0x1e3a79['foreignKey']?a31_0x4d24f3['dim']('Join\x20on:')+'\x20'+_0x1e3a79[_0x58c03b(0x29c)]:a31_0x4d24f3[_0x58c03b(0x2f8)]('Join:')+'\x20'+_0x1e3a79[_0x58c03b(0x29c)]+'\x20=\x20'+_0x1e3a79[_0x58c03b(0x161)];console['error']('\x20\x20'+_0x288de7),console[_0x58c03b(0x104)]('\x20\x20'+a31_0x4d24f3[_0x58c03b(0x2f8)]('Columns:')),this[_0x58c03b(0x178)](_0x1e3a79['columns']),!_0x1e3a79[_0x58c03b(0x2a9)]&&console[_0x58c03b(0x104)]('\x20\x20'+a31_0x4d24f3['red']('Error:')+'\x20'+_0x1e3a79['schemaError']);}}[a31_0xe8811a(0x2c9)](_0x57978b,_0x136e7f){const _0x14f79b=a31_0xe8811a;if(_0x57978b[_0x14f79b(0x243)]['length']===0x0)return;console[_0x14f79b(0x104)]('\x0a'+a31_0x4d24f3[_0x14f79b(0x2f8)](_0x14f79b(0x29e))+'\x20'+a31_0x4d24f3[_0x14f79b(0x2f8)]('('+_0x136e7f+')'));for(const _0x334533 of _0x57978b['behaviors']){const _0x3add9c=_0x334533[_0x14f79b(0x2a9)]?a31_0x4d24f3[_0x14f79b(0x2af)]('✔'):a31_0x4d24f3[_0x14f79b(0x2f4)]('✘');let _0x73bcfe='';if(_0x334533[_0x14f79b(0x2a9)]&&_0x334533[_0x14f79b(0x170)]!==undefined&&_0x334533[_0x14f79b(0x284)]!==undefined){const _0xbf5d6e=_0x334533[_0x14f79b(0x127)]?.[_0x14f79b(0x1ff)](0x1)||'?',_0xb84b06=(_0x334533[_0x14f79b(0x127)]??0x0)>=0x32?a31_0x4d24f3[_0x14f79b(0x2af)]:(_0x334533[_0x14f79b(0x127)]??0x0)>=0x14?a31_0x4d24f3[_0x14f79b(0x1a7)]:a31_0x4d24f3[_0x14f79b(0x2f4)];_0x73bcfe='\x20'+a31_0x4d24f3['dim'](_0x14f79b(0x16c))+'\x20'+_0xb84b06(formatRows(_0x334533[_0x14f79b(0x170)]))+'\x20('+_0xbf5d6e+_0x14f79b(0x1ad)+a31_0x4d24f3[_0x14f79b(0x2f8)](_0x14f79b(0x268))+'\x20'+a31_0x4d24f3[_0x14f79b(0x175)](formatRows(_0x334533[_0x14f79b(0x284)]));}console[_0x14f79b(0x104)](_0x3add9c+'\x20'+a31_0x4d24f3[_0x14f79b(0x166)](_0x334533[_0x14f79b(0x260)])+_0x73bcfe),console[_0x14f79b(0x104)]('\x20\x20'+a31_0x4d24f3[_0x14f79b(0x2f8)](_0x14f79b(0x206))+'\x20'+a31_0x4d24f3[_0x14f79b(0x166)](_0x334533[_0x14f79b(0x153)]+'.'+_0x334533[_0x14f79b(0x101)]));const _0x49dd12=_0x334533[_0x14f79b(0x29c)]===_0x334533['foreignKey']?a31_0x4d24f3[_0x14f79b(0x2f8)]('Join\x20on:')+'\x20'+_0x334533['joinKey']:a31_0x4d24f3['dim'](_0x14f79b(0x1f6))+'\x20'+_0x334533['joinKey']+_0x14f79b(0x2d3)+_0x334533[_0x14f79b(0x161)];console[_0x14f79b(0x104)]('\x20\x20'+_0x49dd12),console[_0x14f79b(0x104)]('\x20\x20'+a31_0x4d24f3[_0x14f79b(0x2f8)]('Columns:')),this[_0x14f79b(0x178)](_0x334533['columns']),!_0x334533[_0x14f79b(0x2a9)]&&console[_0x14f79b(0x104)]('\x20\x20'+a31_0x4d24f3[_0x14f79b(0x2f4)](_0x14f79b(0x21e))+'\x20'+_0x334533[_0x14f79b(0x12d)]);}}[a31_0xe8811a(0x178)](_0x57fbb3){const _0xcc2c48=a31_0xe8811a;for(const _0x6525dc of _0x57fbb3){_0x6525dc['label']===_0x6525dc[_0xcc2c48(0x1df)]||_0x6525dc['column']==='*'?console[_0xcc2c48(0x104)](_0xcc2c48(0x2aa)+_0x6525dc[_0xcc2c48(0x2ca)]):console[_0xcc2c48(0x104)](_0xcc2c48(0x2aa)+_0x6525dc['label']+'\x20'+a31_0x4d24f3[_0xcc2c48(0x2f8)]('('+_0x6525dc[_0xcc2c48(0x1df)]+')'));}}['displaySummary'](_0x51ae29){const _0x2386fb=a31_0xe8811a;console[_0x2386fb(0x104)]('─'[_0x2386fb(0x290)](0x3c));if(_0x51ae29[_0x2386fb(0x188)][_0x2386fb(0x1a2)]>0x0){console[_0x2386fb(0x104)]('\x0a'+a31_0x4d24f3[_0x2386fb(0x2f4)](_0x2386fb(0x297)));for(const _0x291498 of _0x51ae29[_0x2386fb(0x188)]){console[_0x2386fb(0x104)]('\x20\x20'+a31_0x4d24f3['red']('•')+'\x20'+_0x291498);}}_0x51ae29[_0x2386fb(0x307)]&&console['error']('\x0a'+a31_0x4d24f3[_0x2386fb(0x2af)]('✔')+_0x2386fb(0x225));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1c5);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x1a5);async[a31_0xe8811a(0x224)](_0x291d63){const _0x424872=a31_0xe8811a,{options:_0x24c2c3,args:_0x321949,tdx:_0x544c93}=_0x291d63,_0x325322=_0x24c2c3,_0x1f7d24=_0x321949[0x0]||_0x24c2c3[_0x424872(0x13c)];if(!_0x1f7d24)return showParentSegmentNotSetError(_0x424872(0x235)+_0x424872(0x204)+_0x424872(0x157)+_0x424872(0x1e2)+_0x424872(0x1de)+_0x424872(0x197)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x424872(0x149)),0x1;if(!_0x325322[_0x424872(0x2cf)]&&!_0x325322[_0x424872(0x229)]&&!_0x325322[_0x424872(0x2e3)]&&!_0x325322['enriched'])return console['error'](a31_0x4d24f3[_0x424872(0x2f4)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console['error'](_0x424872(0x1e4)),console[_0x424872(0x104)]('Options:'),console[_0x424872(0x104)](_0x424872(0x14a)),console['error'](_0x424872(0x151)),console['error'](_0x424872(0x1d7)),console[_0x424872(0x104)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x315884=resolveYamlFile(_0x1f7d24);if(!existsSync(_0x315884))return showFileNotFoundError(_0x315884,_0x1f7d24),0x1;_0x325322[_0x424872(0x10d)]&&(console[_0x424872(0x104)](_0x424872(0x1e8)+_0x325322[_0x424872(0x1d6)]),console[_0x424872(0x104)](_0x424872(0x172)+_0x315884));let _0x71ca70;try{_0x71ca70=readFileSync(_0x315884,_0x424872(0x29f));}catch(_0x1d95fc){const _0x118f77=_0x1d95fc instanceof Error?_0x1d95fc['message']:String(_0x1d95fc);return console[_0x424872(0x104)](_0x424872(0x2fc)+_0x118f77),0x1;}let _0x4c5e32;try{_0x4c5e32=parseDef(_0x71ca70);}catch(_0x48cf68){const _0x3ee35d=_0x48cf68 instanceof Error?_0x48cf68[_0x424872(0x205)]:String(_0x48cf68);return console['error'](a31_0x4d24f3[_0x424872(0x2f4)](_0x424872(0x1d4)+_0x3ee35d)),0x1;}if(_0x325322[_0x424872(0x229)]===!![]||_0x325322[_0x424872(0x229)]===''){const _0x32e4be=_0x4c5e32[_0x424872(0x289)]?.[_0x424872(0x17e)](_0x39795f=>_0x39795f[_0x424872(0x260)])||[];if(_0x32e4be[_0x424872(0x1a2)]===0x0)console[_0x424872(0x104)](a31_0x4d24f3[_0x424872(0x2f4)](_0x424872(0x2ec)));else{console[_0x424872(0x104)](a31_0x4d24f3['red']('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x424872(0x104)]('Available\x20attributes:');for(const _0x38ba33 of _0x32e4be){console[_0x424872(0x104)]('\x20\x20'+a31_0x4d24f3[_0x424872(0x175)](_0x38ba33));}console[_0x424872(0x104)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x1f7d24+_0x424872(0x1bf)+_0x32e4be[0x0]+'\x22');}return 0x1;}if(_0x325322['behavior']===!![]||_0x325322[_0x424872(0x2e3)]===''){const _0x250550=_0x4c5e32[_0x424872(0x243)]?.[_0x424872(0x17e)](_0x255483=>_0x255483[_0x424872(0x260)])||[];if(_0x250550['length']===0x0)console[_0x424872(0x104)](a31_0x4d24f3[_0x424872(0x2f4)](_0x424872(0x19e)));else{console[_0x424872(0x104)](a31_0x4d24f3[_0x424872(0x2f4)](_0x424872(0x22b))),console[_0x424872(0x104)](_0x424872(0x2d8));for(const _0x5ea291 of _0x250550){console[_0x424872(0x104)]('\x20\x20'+a31_0x4d24f3['cyan'](_0x5ea291));}console[_0x424872(0x104)](_0x424872(0x23f)+_0x1f7d24+_0x424872(0x301)+_0x250550[0x0]+'\x22');}return 0x1;}const _0x34968f=createCommandSpinner(a31_0x4d24f3[_0x424872(0x2f8)](_0x424872(0x308)),{'verbose':_0x325322[_0x424872(0x10d)]});_0x34968f[_0x424872(0x283)]();const _0x114c5f={'onProgress':_0x4ada37=>{const _0x296c0b=_0x424872;_0x34968f[_0x296c0b(0x1be)]=formatProgressMessage(_0x4ada37);}};if(_0x325322[_0x424872(0x2cf)])_0x114c5f['master']=!![];if(_0x325322['attribute']&&typeof _0x325322[_0x424872(0x229)]==='string')_0x114c5f[_0x424872(0x229)]=_0x325322[_0x424872(0x229)];if(_0x325322[_0x424872(0x2e3)]&&typeof _0x325322['behavior']===_0x424872(0x11f))_0x114c5f['behavior']=_0x325322[_0x424872(0x2e3)];if(_0x325322[_0x424872(0x2bb)])_0x114c5f[_0x424872(0x2bb)]=!![];if(_0x325322['interval'])_0x114c5f[_0x424872(0x2e1)]=_0x325322[_0x424872(0x2e1)];let _0x5c6012;try{_0x5c6012=await _0x544c93['segment'][_0x424872(0x24d)](_0x71ca70,_0x114c5f),_0x34968f['stop']();}catch(_0x4da99e){_0x34968f['stop']();throw _0x4da99e;}return await this[_0x424872(0x10a)](_0x5c6012,{'master':_0x325322['master'],'attribute':typeof _0x325322[_0x424872(0x229)]===_0x424872(0x11f)?_0x325322[_0x424872(0x229)]:undefined,'behavior':typeof _0x325322[_0x424872(0x2e3)]===_0x424872(0x11f)?_0x325322['behavior']:undefined,'enriched':_0x325322[_0x424872(0x2bb)]}),_0x5c6012[_0x424872(0x307)]?0x0:0x1;}async['displayPreviewResults'](_0x599e1e,_0x3326b8){const _0x22c1ae=a31_0xe8811a;console[_0x22c1ae(0x104)]('\x0a'+a31_0x4d24f3['bold'](_0x22c1ae(0x2d0))+'\x20'+_0x599e1e['name']),console[_0x22c1ae(0x104)]('═'[_0x22c1ae(0x290)](0x3c));if(_0x3326b8[_0x22c1ae(0x2cf)]&&_0x599e1e[_0x22c1ae(0x1b8)]){const _0x13ca22=a31_0x4d24f3['dim'](_0x22c1ae(0x237))+'\x20'+a31_0x4d24f3[_0x22c1ae(0x166)](_0x599e1e['master'][_0x22c1ae(0x153)]+'.'+_0x599e1e[_0x22c1ae(0x2cf)][_0x22c1ae(0x101)]);await this[_0x22c1ae(0x27a)](_0x13ca22,_0x599e1e['sampleData']);}else{if(_0x3326b8['attribute']&&_0x599e1e[_0x22c1ae(0x1b8)]){const _0x528890=a31_0x4d24f3[_0x22c1ae(0x2f8)](_0x22c1ae(0x138))+'\x20'+a31_0x4d24f3['bold'](_0x3326b8[_0x22c1ae(0x229)]);await this[_0x22c1ae(0x27a)](_0x528890,_0x599e1e[_0x22c1ae(0x1b8)]);}else{if(_0x3326b8[_0x22c1ae(0x2e3)]&&_0x599e1e[_0x22c1ae(0x1b8)]){const _0x390e4c=a31_0x4d24f3[_0x22c1ae(0x2f8)](_0x22c1ae(0x24e))+'\x20'+a31_0x4d24f3['bold'](_0x3326b8['behavior']);await this[_0x22c1ae(0x27a)](_0x390e4c,_0x599e1e[_0x22c1ae(0x1b8)]);}else{if(_0x3326b8[_0x22c1ae(0x2bb)]&&_0x599e1e[_0x22c1ae(0x1b8)]){const _0x356add=a31_0x4d24f3[_0x22c1ae(0x2f8)](_0x22c1ae(0x2c6))+'\x20'+a31_0x4d24f3[_0x22c1ae(0x166)]('Master\x20+\x20Attributes');await this[_0x22c1ae(0x27a)](_0x356add,_0x599e1e['sampleData']);}else!_0x599e1e[_0x22c1ae(0x1b8)]&&console[_0x22c1ae(0x104)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x599e1e['errors'][_0x22c1ae(0x1a2)]>0x0){console['error']('─'[_0x22c1ae(0x290)](0x3c)),console[_0x22c1ae(0x104)]('\x0a'+a31_0x4d24f3[_0x22c1ae(0x2f4)](_0x22c1ae(0x297)));for(const _0x21b436 of _0x599e1e[_0x22c1ae(0x188)]){console[_0x22c1ae(0x104)]('\x20\x20'+a31_0x4d24f3[_0x22c1ae(0x2f4)]('•')+'\x20'+_0x21b436);}}}async[a31_0xe8811a(0x27a)](_0x38542a,_0x3069e9){const _0x5944d3=a31_0xe8811a;if(_0x3069e9[_0x5944d3(0x1a2)]===0x0){console['error']('\x0a'+_0x38542a),console['error']('\x20\x20No\x20sample\x20data\x20available');return;}console['error']('\x0a'+_0x38542a);const _0xad1841=Object[_0x5944d3(0x1c8)](_0x3069e9[0x0])[_0x5944d3(0x17e)](_0x158479=>({'name':_0x158479,'type':typeof _0x3069e9[0x0][_0x158479]===_0x5944d3(0x1e0)?'double':_0x5944d3(0x28f)})),_0x2aa2ff={'queryId':'preview','columns':_0xad1841,'data':_0x3069e9,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3069e9['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x5434de=formatAsTable(_0x2aa2ff,_0x3069e9[_0x5944d3(0x1a2)],!![]);await writeOutput(_0x5434de,undefined,_0x5944d3(0x101));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a31_0xe8811a(0x2b8);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x15a);async[a31_0xe8811a(0x224)](_0x18e0f8){const _0x182949=a31_0xe8811a,{options:_0xc70f0b,args:_0x299eca,tdx:_0x53512f}=_0x18e0f8,_0xffcd71=_0xc70f0b,_0x54e49e=_0x299eca[0x0]||_0xc70f0b[_0x182949(0x13c)];if(!_0x54e49e)return showParentSegmentNotSetError(_0x182949(0x137)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x239028=resolveYamlFile(_0x54e49e);if(existsSync(_0x239028)){_0xffcd71[_0x182949(0x10d)]&&console['error'](_0x182949(0x23a)+_0x239028);let _0x1bfd9b;try{_0x1bfd9b=readFileSync(_0x239028,_0x182949(0x29f));}catch(_0x54b4bc){const _0x50eb9d=_0x54b4bc instanceof Error?_0x54b4bc['message']:String(_0x54b4bc);return console[_0x182949(0x104)](_0x182949(0x2fc)+_0x50eb9d),0x1;}const _0x11548b=await withSpinner(_0x182949(0x1c3),()=>_0x53512f[_0x182949(0x200)]['pushParentYaml'](_0x1bfd9b),{'verbose':_0xffcd71[_0x182949(0x10d)]}),_0x20f759=_0x11548b['data'],{isNew:_0x35df1c,name:_0x42e0eb,hasChanges:_0x162864,diffFormatted:_0x298e18}=_0x20f759;if(_0x162864){_0x35df1c?console[_0x182949(0x104)](_0x182949(0x30b)+_0x42e0eb+'\x27:'):console[_0x182949(0x104)](_0x182949(0x30f)+_0x42e0eb+'\x27:');console[_0x182949(0x104)]('─'[_0x182949(0x290)](0x3c)),console[_0x182949(0x104)](_0x298e18),console['error']('─'['repeat'](0x3c));const _0x35876b=_0x35df1c?_0x182949(0x1e9)+_0x42e0eb+_0x182949(0x2d4):_0x182949(0x2d9)+_0x42e0eb+_0x182949(0x2d4);if(!_0xffcd71[_0x182949(0x1d2)]){if(!isInteractive())return console['error'](a31_0x4d24f3[_0x182949(0x2f4)](_0x182949(0x276)),_0x182949(0x17f)),console[_0x182949(0x104)](a31_0x4d24f3['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2c9ad9=await confirmKey(_0x35876b);if(!_0x2c9ad9)return console[_0x182949(0x104)](a31_0x4d24f3['yellow'](_0x182949(0x231))),0x1;}const _0x31417f=_0x35df1c?_0x182949(0x2f1):_0x182949(0x20a);await withSpinner(_0x31417f+'\x20parent\x20segment\x20\x27'+_0x42e0eb+'\x27...',()=>_0x20f759[_0x182949(0x126)](),{'verbose':_0xffcd71[_0x182949(0x10d)]});const _0x1193c2=_0x35df1c?_0x182949(0x2c7):'Updated';console[_0x182949(0x104)]('✔\x20'+_0x1193c2+'\x20parent\x20segment\x20\x27'+_0x42e0eb+'\x27');}else console[_0x182949(0x104)](_0x182949(0x29b)+_0x42e0eb+_0x182949(0x181));}const _0x1e564d=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x54e49e+_0x182949(0x228),()=>_0x53512f[_0x182949(0x200)][_0x182949(0x240)](_0x54e49e),{'verbose':_0xffcd71[_0x182949(0x10d)]}),_0x37037a=_0x1e564d[_0x182949(0x113)],_0x1bead1=getConsoleUrl(_0xffcd71[_0x182949(0x1d6)],_0x182949(0x148)+_0x37037a[_0x182949(0x280)]+_0x182949(0x18e)+_0x37037a[_0x182949(0x1b1)]+_0x182949(0x319)+_0x37037a['workflowAttemptId']);return console['error'](_0x182949(0x132)),console[_0x182949(0x104)]('\x20\x20'+a31_0x4d24f3[_0x182949(0x2f8)](_0x182949(0x2da))+'\x20'+_0x37037a[_0x182949(0x190)]),console[_0x182949(0x104)]('\x20\x20'+a31_0x4d24f3[_0x182949(0x2f8)](_0x182949(0x118))+'\x20'+_0x37037a[_0x182949(0x13f)]),console[_0x182949(0x104)]('\x20\x20'+a31_0x4d24f3['dim'](_0x182949(0x12a))+'\x20'+_0x37037a['workflowSessionId']),console[_0x182949(0x104)]('\x20\x20'+a31_0x4d24f3[_0x182949(0x2f8)](_0x182949(0x13a))+'\x20'+_0x37037a['workflowAttemptId']),console[_0x182949(0x104)]('\x20\x20'+_0x1bead1),console[_0x182949(0x104)]('\x0a'+a31_0x4d24f3[_0x182949(0x2f8)](_0x182949(0x162))+_0x182949(0x11d)+_0x37037a[_0x182949(0x133)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1dd);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x282);async[a31_0xe8811a(0x224)](_0x23f7eb){const _0x1cf8e8=a31_0xe8811a,{options:_0x3e494b,args:_0x437fbc,tdx:_0x1a2ffe}=_0x23f7eb,_0x330a55=_0x437fbc[0x0]||_0x3e494b[_0x1cf8e8(0x13c)];if(!_0x330a55)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+_0x1cf8e8(0x20c)),0x1;_0x3e494b[_0x1cf8e8(0x10d)]&&(console['error']('Site:\x20'+_0x3e494b[_0x1cf8e8(0x1d6)]),console[_0x1cf8e8(0x104)]('Parent\x20segment:\x20'+_0x330a55));const _0x143828=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x330a55+_0x1cf8e8(0x228),()=>_0x1a2ffe[_0x1cf8e8(0x200)][_0x1cf8e8(0x134)](_0x330a55),{'verbose':_0x3e494b['verbose']}),_0xa603c3=_0x143828['data'];console[_0x1cf8e8(0x104)](_0x1cf8e8(0x245)+_0xa603c3[_0x1cf8e8(0x1a2)]+'\x20field'+(_0xa603c3[_0x1cf8e8(0x1a2)]!==0x1?'s':''));if(_0x3e494b[_0x1cf8e8(0x254)]||_0x3e494b[_0x1cf8e8(0x29a)])return await handleSDKOutput(_0xa603c3,_0x3e494b),0x0;return displayFieldsHumanReadable(_0xa603c3,_0x330a55),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0xe8811a(0x260)]='segment:parent:view';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x16e);async[a31_0xe8811a(0x224)](_0x1d9121){const _0x429e89=a31_0xe8811a,{options:_0x1ea218,args:_0xb7ad30,tdx:_0x3f9330}=_0x1d9121,_0x47eed8=_0x1ea218,_0x4b2d5a=_0xb7ad30[0x0]||_0x1ea218['parentSegment'];if(!_0x4b2d5a)return showParentSegmentNotSetError(_0x429e89(0x1e7)+_0x429e89(0x30d)+_0x429e89(0x217)+_0x429e89(0x11e)),0x1;_0x1ea218[_0x429e89(0x10d)]&&(console[_0x429e89(0x104)]('Site:\x20'+_0x1ea218[_0x429e89(0x1d6)]),console['error']('Parent\x20segment:\x20'+_0x4b2d5a));const _0x3eaf6a=await withSpinner(_0x429e89(0x11b)+_0x4b2d5a+_0x429e89(0x228),()=>_0x3f9330[_0x429e89(0x200)][_0x429e89(0x17c)](_0x4b2d5a),{'verbose':_0x1ea218['verbose']}),_0x98fa35=_0x3eaf6a[_0x429e89(0x113)];if(_0x47eed8['web']){const _0x1d935a=getConsoleNextUrl(_0x47eed8[_0x429e89(0x1d6)],_0x429e89(0x298)+_0x98fa35['id']);return console['error'](a31_0x4d24f3[_0x429e89(0x2af)]('✔')+_0x429e89(0x241)+a31_0x4d24f3[_0x429e89(0x175)](_0x1d935a)),openBrowser(_0x1d935a),0x0;}return await handleSingleObjectOutput(_0x98fa35,_0x1ea218),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']='segment:parent:desc';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x12b);async[a31_0xe8811a(0x224)](_0x74013e){const _0x169d16=a31_0xe8811a,{options:_0x4d8fc5,args:_0x20e531,tdx:_0x62d88}=_0x74013e,_0x143375=_0x4d8fc5,_0x296d32=_0x20e531[0x0]||_0x4d8fc5['parentSegment'];if(!_0x296d32)return showParentSegmentNotSetError(_0x169d16(0x1db)+_0x169d16(0x1bb)+_0x169d16(0x217)+_0x169d16(0x314)),0x1;_0x4d8fc5[_0x169d16(0x10d)]&&(console[_0x169d16(0x104)]('Site:\x20'+_0x4d8fc5[_0x169d16(0x1d6)]),console[_0x169d16(0x104)](_0x169d16(0x177)+_0x296d32));const _0x66220f=await withSpinner(_0x169d16(0x18d)+_0x296d32+_0x169d16(0x228),()=>_0x62d88[_0x169d16(0x200)][_0x169d16(0x143)](_0x296d32),{'verbose':_0x4d8fc5[_0x169d16(0x10d)]}),_0x13eecf=_0x66220f['data'],_0xff14d7=_0x62d88[_0x169d16(0x200)][_0x169d16(0x169)](_0x13eecf);if(_0x143375[_0x169d16(0x16f)]){const _0x4e8f9b=await this[_0x169d16(0x2bd)](_0x74013e,_0x296d32,_0x13eecf,_0xff14d7),_0x208f87=this[_0x169d16(0x1d5)](_0x4e8f9b);writeFileSync(_0x143375[_0x169d16(0x16f)],_0x208f87);const _0x1a7b2c=_0x4e8f9b[_0x169d16(0x163)][_0x169d16(0x317)][_0x169d16(0x1a2)]+_0x4e8f9b[_0x169d16(0x243)][_0x169d16(0x2ef)]((_0x2d2d45,_0xc2f568)=>_0x2d2d45+_0xc2f568[_0x169d16(0x317)][_0x169d16(0x1a2)],0x0),_0x5870f4=_0x4e8f9b[_0x169d16(0x243)][_0x169d16(0x186)](_0x4fb25e=>_0x4fb25e[_0x169d16(0x317)][_0x169d16(0x1a2)]===0x0)[_0x169d16(0x1a2)];return console[_0x169d16(0x253)]('Schema\x20saved\x20to\x20'+_0x143375[_0x169d16(0x16f)]),console['log'](_0x169d16(0x195)+_0xff14d7),console[_0x169d16(0x253)](_0x169d16(0x295)+_0x4e8f9b[_0x169d16(0x243)][_0x169d16(0x1a2)]+'\x20behaviors'),console[_0x169d16(0x253)]('\x20\x20Columns:\x20'+_0x1a7b2c+_0x169d16(0x2e0)),_0x5870f4>0x0&&console[_0x169d16(0x253)](_0x169d16(0x13b)+_0x5870f4+_0x169d16(0x1f1)),0x0;}console[_0x169d16(0x104)]('\x0a'+a31_0x4d24f3['bold'](_0x169d16(0x247))+'\x20'+a31_0x4d24f3[_0x169d16(0x175)](_0xff14d7));const _0x923671=await withSpinner(_0x169d16(0x215),()=>_0x62d88[_0x169d16(0x200)][_0x169d16(0x1fa)](_0x13eecf),{'verbose':_0x4d8fc5[_0x169d16(0x10d)]});console[_0x169d16(0x104)]('\x0a'+a31_0x4d24f3[_0x169d16(0x166)]('customers')+'\x20'+a31_0x4d24f3[_0x169d16(0x2f8)]('('+_0xff14d7+_0x169d16(0x248)));const _0x5f57c5=await executeSchemaQuery(_0x923671[_0x169d16(0x113)],_0x62d88,_0x4d8fc5);await handleQueryOutput(_0x5f57c5,_0x4d8fc5);const _0x229e4b=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x62d88[_0x169d16(0x200)][_0x169d16(0x19c)](_0x13eecf),{'verbose':_0x4d8fc5['verbose']});for(const _0x44933a of _0x229e4b['data']){const _0x522575='behavior_'+_0x44933a[_0x169d16(0x15b)]()['replace'](/\s+/g,'_'),_0xb368c8=_0x169d16(0x142)+_0xff14d7+'.'+_0x522575;console[_0x169d16(0x104)]('\x0a'+a31_0x4d24f3[_0x169d16(0x166)](_0x44933a)+'\x20'+a31_0x4d24f3['dim']('('+_0xff14d7+'.'+_0x522575+')'));try{const _0x5d4014=await executeSchemaQuery(_0xb368c8,_0x62d88,_0x4d8fc5);await handleQueryOutput(_0x5d4014,_0x4d8fc5);}catch{console[_0x169d16(0x104)](a31_0x4d24f3['yellow']('\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)'));}}return 0x0;}async[a31_0xe8811a(0x2bd)](_0x26a622,_0x1c8927,_0x580e98,_0xda79fe){const _0x2f2ece=a31_0xe8811a,{options:_0x1c5132,tdx:_0x17707b}=_0x26a622,_0x4aad78=await withSpinner(_0x2f2ece(0x215),()=>_0x17707b['segment'][_0x2f2ece(0x1fa)](_0x580e98),{'verbose':_0x1c5132[_0x2f2ece(0x10d)]}),_0x26a38a=await executeSchemaQuery(_0x4aad78[_0x2f2ece(0x113)],_0x17707b,_0x1c5132),_0x1278c0=_0x26a38a[_0x2f2ece(0x113)][_0x2f2ece(0x17e)](_0x1b649b=>({'name':_0x1b649b[_0x2f2ece(0x28e)],'type':_0x1b649b[_0x2f2ece(0x19b)]})),_0x307a91=await withSpinner(_0x2f2ece(0x125),()=>_0x17707b[_0x2f2ece(0x200)][_0x2f2ece(0x19c)](_0x580e98),{'verbose':_0x1c5132[_0x2f2ece(0x10d)]}),_0x429c39=[];for(const _0x3ce39e of _0x307a91[_0x2f2ece(0x113)]){const _0x453fa7=_0x2f2ece(0x144)+_0x3ce39e[_0x2f2ece(0x15b)]()['replace'](/\s+/g,'_'),_0x1ffd2d='SELECT\x20*\x20FROM\x20'+_0xda79fe+'.'+_0x453fa7;let _0x1a498c=[];try{const _0x3f967d=await executeSchemaQuery(_0x1ffd2d,_0x17707b,_0x1c5132);_0x1a498c=_0x3f967d[_0x2f2ece(0x113)][_0x2f2ece(0x17e)](_0x59dfc0=>({'name':_0x59dfc0[_0x2f2ece(0x28e)],'type':_0x59dfc0[_0x2f2ece(0x19b)]}));}catch{}_0x429c39[_0x2f2ece(0x1ed)]({'table':_0x453fa7,'columns':_0x1a498c});}return{'database':_0xda79fe,'parent_segment':_0x1c8927,'parent_id':_0x580e98,'customers':{'table':_0x2f2ece(0x163),'columns':_0x1278c0},'behaviors':_0x429c39};}[a31_0xe8811a(0x1d5)](_0x43db26){const _0x5be76f=a31_0xe8811a,_0x2856e7=_0x42b6cc=>{const _0x3af1a1=a31_0x28cc;if(_0x42b6cc['length']===0x0)return'[]';const _0x2d200d=_0x42b6cc['map'](_0x1df1c0=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x1df1c0[_0x3af1a1(0x260)]+_0x3af1a1(0x227)+_0x1df1c0[_0x3af1a1(0x223)]+_0x3af1a1(0x31d));return'[\x0a'+_0x2d200d[_0x3af1a1(0x31f)](',\x0a')+_0x3af1a1(0x15e);},_0x10cfa4=_0x43db26['behaviors'][_0x5be76f(0x17e)](_0x12ff4e=>{const _0x82339e=_0x5be76f;return _0x82339e(0x13d)+_0x12ff4e[_0x82339e(0x101)]+_0x82339e(0x145)+_0x2856e7(_0x12ff4e['columns'])['replace'](/^/gm,'\x20\x20')[_0x82339e(0x2d1)]()+'\x0a\x20\x20\x20\x20}';})['join'](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x43db26[_0x5be76f(0x153)]+_0x5be76f(0x12e)+_0x43db26[_0x5be76f(0x296)]+_0x5be76f(0x2d7)+_0x43db26[_0x5be76f(0x2e9)]+_0x5be76f(0x1a4)+_0x43db26[_0x5be76f(0x163)][_0x5be76f(0x101)]+_0x5be76f(0x1b7)+_0x2856e7(_0x43db26['customers']['columns'])['replace'](/^/gm,'\x20\x20')[_0x5be76f(0x2d1)]()+_0x5be76f(0x2b2)+_0x10cfa4+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x123);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x2e4);async['execute'](_0x55b739){const _0x46b727=a31_0xe8811a,{options:_0x494111,args:_0x24f0d9,tdx:_0x358ecf}=_0x55b739,_0x766379=_0x24f0d9[0x0]||_0x494111[_0x46b727(0x13c)];if(!_0x766379)return showParentSegmentNotSetError(_0x46b727(0x25b)+'\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;_0x494111['verbose']&&(console[_0x46b727(0x104)](_0x46b727(0x1e8)+_0x494111[_0x46b727(0x1d6)]),console['error'](_0x46b727(0x177)+_0x766379));const _0x580bb4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x766379+_0x46b727(0x228),()=>_0x358ecf['segment']['resolveParentId'](_0x766379),{'verbose':_0x494111[_0x46b727(0x10d)]}),_0x3c7240=_0x580bb4[_0x46b727(0x113)],_0xfd1b59=await withSpinner(_0x46b727(0x2e2)+_0x766379+'\x27...',()=>_0x358ecf[_0x46b727(0x200)][_0x46b727(0x1fa)](_0x3c7240),{'verbose':_0x494111[_0x46b727(0x10d)]}),_0x18f1fe=_0xfd1b59[_0x46b727(0x113)];return _0x494111[_0x46b727(0x14d)]===_0x46b727(0x254)||_0x494111[_0x46b727(0x14d)]===_0x46b727(0x29a)?await handleSDKOutput([{'sql':_0x18f1fe}],_0x494111):console[_0x46b727(0x253)](_0x18f1fe),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a31_0xe8811a(0x108);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x15d);async[a31_0xe8811a(0x224)](_0x2570ec){const _0x4b698c=a31_0xe8811a,{options:_0x3ff45b,args:_0x5a2cbd,tdx:_0x768115}=_0x2570ec,_0x56438f=_0x5a2cbd[0x0]||_0x3ff45b[_0x4b698c(0x13c)];if(!_0x56438f)return showParentSegmentNotSetError(_0x4b698c(0x270)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0x3ff45b[_0x4b698c(0x10d)]&&(console['error']('Site:\x20'+_0x3ff45b[_0x4b698c(0x1d6)]),console[_0x4b698c(0x104)](_0x4b698c(0x177)+_0x56438f));const _0x5d9327=await withSpinner(_0x4b698c(0x18d)+_0x56438f+_0x4b698c(0x228),()=>_0x768115[_0x4b698c(0x200)][_0x4b698c(0x143)](_0x56438f),{'verbose':_0x3ff45b[_0x4b698c(0x10d)]}),_0x4f89d7=_0x5d9327[_0x4b698c(0x113)],_0x1f7f5d=await withSpinner(_0x4b698c(0x2e2)+_0x56438f+'\x27...',()=>_0x768115[_0x4b698c(0x200)][_0x4b698c(0x1fa)](_0x4f89d7),{'verbose':_0x3ff45b[_0x4b698c(0x10d)]});let _0x583df6=_0x1f7f5d[_0x4b698c(0x113)];const _0xb7473e=resolveLimit(_0x3ff45b[_0x4b698c(0x263)],DEFAULT_DISPLAY_LIMIT),_0x551224=/\bLIMIT\s+\d+/i['test'](_0x583df6);!_0x551224&&(_0x583df6=_0x583df6['trim']()[_0x4b698c(0x2b1)](/;+$/,''),_0x583df6=_0x4b698c(0x226)+_0x583df6+_0x4b698c(0x10f)+_0xb7473e);_0x3ff45b[_0x4b698c(0x10d)]&&console[_0x4b698c(0x104)](_0x4b698c(0x17a)+_0x583df6);const _0x14b2d7=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x19b9d9=>{const _0x4e8b2f=_0x4b698c,_0x3487d7=await _0x768115[_0x4e8b2f(0x246)]['execute'](_0x583df6,{'catalog':'td','schema':_0x4e8b2f(0x100),'onJobId':_0x32deec=>{_0x19b9d9['setJobId'](_0x32deec);}});return _0x3487d7;},{'verbose':_0x3ff45b[_0x4b698c(0x10d)]}),_0x2a9d24=_0x14b2d7[_0x4b698c(0x113)],_0x355c48=_0x2a9d24[_0x4b698c(0x2d6)]?_0x4b698c(0x285)+_0x2a9d24[_0x4b698c(0x2d6)]+']':'';return console[_0x4b698c(0x104)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x2a9d24[_0x4b698c(0x242)][_0x4b698c(0x211)][_0x4b698c(0x1cd)]()+_0x4b698c(0x23c)+(_0x4b698c(0x21f)+formatElapsed(_0x2a9d24[_0x4b698c(0x242)]['elapsedTimeMillis'])+_0x355c48)),await handleQueryOutput(_0x2a9d24,_0x3ff45b),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x29d);[a31_0xe8811a(0x2ab)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a31_0xe8811a(0x224)](_0x3951ed){const _0x7860e1=a31_0xe8811a,{options:_0x2ebda6,args:_0x5f4def,tdx:_0x5b7c27}=_0x3951ed,_0x161aa6=_0x5f4def[0x0],_0x4935ff=await withSpinner(_0x161aa6?_0x7860e1(0x105)+_0x161aa6+_0x7860e1(0x228):_0x7860e1(0x20b),()=>_0x5b7c27['realtime'][_0x7860e1(0x12f)](),{'verbose':_0x2ebda6[_0x7860e1(0x10d)]});let _0x4f5b22=_0x4935ff[_0x7860e1(0x113)]['filter'](_0x4a8514=>_0x4a8514[_0x7860e1(0x274)]);if(_0x161aa6){const _0x4def17=_0x161aa6[_0x7860e1(0x2b1)](/[.+^${}()|[\]\\]/g,_0x7860e1(0x22e))[_0x7860e1(0x2b1)](/\*/g,'.*')[_0x7860e1(0x2b1)](/\?/g,'.'),_0x227058=new RegExp('^'+_0x4def17+'$','i');_0x4f5b22=_0x4f5b22[_0x7860e1(0x186)](_0x53adc9=>_0x227058[_0x7860e1(0x26b)](_0x53adc9[_0x7860e1(0x260)]));}_0x4f5b22[_0x7860e1(0x202)]((_0x2743a0,_0x3a6e8d)=>_0x2743a0[_0x7860e1(0x260)][_0x7860e1(0x25d)](_0x3a6e8d[_0x7860e1(0x260)])),console[_0x7860e1(0x104)](_0x7860e1(0x245)+_0x4f5b22[_0x7860e1(0x1a2)]+_0x7860e1(0x2a0)+(_0x4f5b22['length']!==0x1?'s':''));const _0x216b7b=_0x495452=>{const _0x2c324b=_0x7860e1;return getConsoleNextUrl(_0x2ebda6[_0x2c324b(0x1d6)],_0x2c324b(0x298)+_0x495452);};if(_0x2ebda6[_0x7860e1(0x14d)]==='json'||_0x2ebda6[_0x7860e1(0x14d)]===_0x7860e1(0x29a)){const _0x5b1ce1=_0x4f5b22[_0x7860e1(0x17e)](_0x200bb6=>({..._0x200bb6,'url':_0x216b7b(_0x200bb6['id'])}));await handleSDKOutput(_0x5b1ce1,_0x2ebda6);}else{if(_0x4f5b22['length']===0x0)console['log'](_0x7860e1(0x2b4));else for(const _0x26ed49 of _0x4f5b22){const _0x56bdb8=_0x26ed49['population']?a31_0x4d24f3[_0x7860e1(0x2f8)]('\x20('+formatRows(_0x26ed49[_0x7860e1(0x154)])+')'):'',_0x4224e8=hyperlink(_0x26ed49[_0x7860e1(0x260)],_0x216b7b(_0x26ed49['id']));console['log']('⚡\x20'+_0x4224e8+_0x56bdb8);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x27e);['description']=a31_0xe8811a(0x287);async['execute'](_0x12a9a4){const _0x5ccba2=a31_0xe8811a,{options:_0x55b1bc,args:_0x5e6b9f,tdx:_0x319bc4}=_0x12a9a4,_0x3310af=_0x5e6b9f[0x0]||_0x55b1bc['parentSegment'];if(!_0x3310af)return showParentSegmentNotSetError(_0x5ccba2(0x21c)+_0x5ccba2(0x194)),0x1;const _0x126a91=resolveYamlFile(_0x3310af);if(!existsSync(_0x126a91))return showFileNotFoundError(_0x126a91,_0x3310af),0x1;let _0x63bc18;try{_0x63bc18=readFileSync(_0x126a91,_0x5ccba2(0x29f));}catch(_0x3c3cd5){const _0x5089c9=_0x3c3cd5 instanceof Error?_0x3c3cd5[_0x5ccba2(0x205)]:String(_0x3c3cd5);return console[_0x5ccba2(0x104)]('Error\x20reading\x20file:\x20'+_0x5089c9),0x1;}const _0xd70d02=createCommandSpinner(a31_0x4d24f3[_0x5ccba2(0x2f8)](_0x5ccba2(0x312)),{'verbose':_0x55b1bc['verbose']});_0xd70d02['start']();const _0x3eb533={'realtime':!![],'onProgress':_0x4af32d=>{const _0x33bbfe=_0x5ccba2;_0xd70d02[_0x33bbfe(0x1be)]=formatProgressMessage(_0x4af32d);}};let _0x1246bb;try{_0x1246bb=await _0x319bc4[_0x5ccba2(0x200)][_0x5ccba2(0x2b6)](_0x63bc18,_0x3eb533),_0xd70d02[_0x5ccba2(0x1e3)]();}catch(_0x5246fc){_0xd70d02[_0x5ccba2(0x1e3)]();throw _0x5246fc;}console[_0x5ccba2(0x104)]('\x0a'+a31_0x4d24f3[_0x5ccba2(0x166)](_0x5ccba2(0x2cd))+'\x20'+_0x1246bb[_0x5ccba2(0x260)]),console[_0x5ccba2(0x104)]('═'[_0x5ccba2(0x290)](0x3c)),displayRealtimeValidation(_0x1246bb),console[_0x5ccba2(0x104)]('─'['repeat'](0x3c));if(_0x1246bb['errors'][_0x5ccba2(0x1a2)]>0x0){console[_0x5ccba2(0x104)]('\x0a'+a31_0x4d24f3['red'](_0x5ccba2(0x297)));for(const _0xd52bf1 of _0x1246bb[_0x5ccba2(0x188)]){console['error']('\x20\x20'+a31_0x4d24f3[_0x5ccba2(0x2f4)]('•')+'\x20'+_0xd52bf1);}}return _0x1246bb['allValid']&&console[_0x5ccba2(0x104)]('\x0a'+a31_0x4d24f3[_0x5ccba2(0x2af)]('✔')+_0x5ccba2(0x1b2)),_0x1246bb[_0x5ccba2(0x307)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1a9);['description']=a31_0xe8811a(0x1c9);async[a31_0xe8811a(0x224)](_0x5f3c43){const _0x5aed30=a31_0xe8811a,{options:_0x2b81ea,args:_0x22d9b5,tdx:_0x309d44}=_0x5f3c43,_0x32a5c0=_0x22d9b5[0x0]||_0x2b81ea['parentSegment'];if(!_0x32a5c0)return showParentSegmentNotSetError(_0x5aed30(0x2fa)+'\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;_0x2b81ea[_0x5aed30(0x10d)]&&(console[_0x5aed30(0x104)]('Site:\x20'+_0x2b81ea[_0x5aed30(0x1d6)]),console[_0x5aed30(0x104)](_0x5aed30(0x177)+_0x32a5c0));const _0x270803=await withSpinner(_0x5aed30(0x18d)+_0x32a5c0+_0x5aed30(0x228),()=>_0x309d44[_0x5aed30(0x200)]['resolveParentId'](_0x32a5c0),{'verbose':_0x2b81ea[_0x5aed30(0x10d)]}),_0x3505d1=_0x270803[_0x5aed30(0x113)],_0x2a0c43=await withSpinner(_0x5aed30(0x1c4)+_0x32a5c0+'\x27...',()=>_0x309d44[_0x5aed30(0x10e)]['listJourneys'](_0x3505d1),{'verbose':_0x2b81ea[_0x5aed30(0x10d)]}),_0x146296=_0x2a0c43[_0x5aed30(0x113)];console['error'](_0x5aed30(0x245)+_0x146296[_0x5aed30(0x1a2)]+_0x5aed30(0x23d)+(_0x146296['length']!==0x1?'s':''));if(_0x2b81ea[_0x5aed30(0x14d)]===_0x5aed30(0x254)||_0x2b81ea['format']===_0x5aed30(0x29a))await handleSDKOutput(_0x146296,_0x2b81ea);else{if(_0x146296['length']===0x0)console['log']('No\x20RT\x20journeys\x20found');else for(const _0x5b84af of _0x146296){const _0x1a18a1=_0x5b84af[_0x5aed30(0x311)]===_0x5aed30(0x251)?'🚀':'📝',_0x54aa1e=_0x5b84af[_0x5aed30(0x222)]?a31_0x4d24f3[_0x5aed30(0x1a7)](_0x5aed30(0x1d0)):'',_0x4ef998=a31_0x4d24f3[_0x5aed30(0x2f8)]('\x20('+_0x5b84af[_0x5aed30(0x1b6)]+'\x20stage'+(_0x5b84af['stageCount']!==0x1?'s':'')+')');console['log'](_0x1a18a1+'\x20'+_0x5b84af[_0x5aed30(0x260)]+_0x54aa1e+_0x4ef998);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x258);['description']=a31_0xe8811a(0x2dc);async[a31_0xe8811a(0x224)](_0x52927e){const _0x547e90=a31_0xe8811a,{options:_0x4d4db5,args:_0x1fd824,tdx:_0x212165}=_0x52927e,_0xacc183=_0x1fd824[0x0];if(!_0xacc183)return console[_0x547e90(0x104)](a31_0x4d24f3[_0x547e90(0x2f4)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x547e90(0x104)](_0x547e90(0x122)),console['error'](a31_0x4d24f3[_0x547e90(0x2f8)](_0x547e90(0x288))),0x1;_0x4d4db5['verbose']&&(console['error'](_0x547e90(0x1e8)+_0x4d4db5[_0x547e90(0x1d6)]),console[_0x547e90(0x104)](_0x547e90(0x28d)+_0xacc183));const _0x10e1e1=await withSpinner(_0x547e90(0x28a)+_0xacc183+_0x547e90(0x228),()=>_0x212165['realtime'][_0x547e90(0x2f6)](_0xacc183),{'verbose':_0x4d4db5[_0x547e90(0x10d)]}),_0x1def9d=_0x10e1e1[_0x547e90(0x113)];console['error']('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x1def9d[_0x547e90(0x260)]+'\x27');if(_0x4d4db5[_0x547e90(0x14d)]==='json'||_0x4d4db5[_0x547e90(0x14d)]===_0x547e90(0x29a))await handleSDKOutput([_0x1def9d],_0x4d4db5);else{const _0x5c7cd4=_0x1def9d['state']===_0x547e90(0x251)?'🚀':'📝',_0x429911=_0x1def9d[_0x547e90(0x222)]?a31_0x4d24f3[_0x547e90(0x1a7)]('\x20(paused)'):'';console[_0x547e90(0x253)](_0x5c7cd4+'\x20'+_0x1def9d[_0x547e90(0x260)]+_0x429911);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']='ps:rt:jn:resume';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x173);async[a31_0xe8811a(0x224)](_0x3541f8){const _0x10a788=a31_0xe8811a,{options:_0x593d5c,args:_0x3ca34a,tdx:_0x395986}=_0x3541f8,_0xdb571c=_0x3ca34a[0x0];if(!_0xdb571c)return console['error'](a31_0x4d24f3[_0x10a788(0x2f4)](_0x10a788(0x2bf))),console[_0x10a788(0x104)](_0x10a788(0x302)),console[_0x10a788(0x104)](a31_0x4d24f3['dim']('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x593d5c[_0x10a788(0x10d)]&&(console[_0x10a788(0x104)](_0x10a788(0x1e8)+_0x593d5c['site']),console[_0x10a788(0x104)](_0x10a788(0x28d)+_0xdb571c));const _0x234646=await withSpinner(_0x10a788(0x1a8)+_0xdb571c+_0x10a788(0x228),()=>_0x395986[_0x10a788(0x10e)]['resumeJourney'](_0xdb571c),{'verbose':_0x593d5c['verbose']}),_0x1fa8a1=_0x234646[_0x10a788(0x113)];console[_0x10a788(0x104)](_0x10a788(0x236)+_0x1fa8a1[_0x10a788(0x260)]+'\x27');if(_0x593d5c['format']==='json'||_0x593d5c[_0x10a788(0x14d)]===_0x10a788(0x29a))await handleSDKOutput([_0x1fa8a1],_0x593d5c);else{const _0x2683d4=_0x1fa8a1[_0x10a788(0x311)]===_0x10a788(0x251)?'🚀':'📝',_0x2af501=_0x1fa8a1[_0x10a788(0x222)]?a31_0x4d24f3['yellow'](_0x10a788(0x1d0)):'';console[_0x10a788(0x253)](_0x2683d4+'\x20'+_0x1fa8a1[_0x10a788(0x260)]+_0x2af501);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']=a31_0xe8811a(0x2fb);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x183);async[a31_0xe8811a(0x224)](_0x298986){const _0x2a2fde=a31_0xe8811a,{options:_0x3b0a63,args:_0x370645,tdx:_0x668b7e}=_0x298986,_0xeb438f=_0x370645[0x0]||_0x3b0a63[_0x2a2fde(0x13c)];if(!_0xeb438f)return showParentSegmentNotSetError(_0x2a2fde(0x267)+_0x2a2fde(0x25a)),0x1;_0x3b0a63['verbose']&&(console[_0x2a2fde(0x104)](_0x2a2fde(0x1e8)+_0x3b0a63['site']),console[_0x2a2fde(0x104)](_0x2a2fde(0x177)+_0xeb438f));const _0x395087=await withSpinner(_0x2a2fde(0x18d)+_0xeb438f+_0x2a2fde(0x228),()=>_0x668b7e[_0x2a2fde(0x200)][_0x2a2fde(0x143)](_0xeb438f),{'verbose':_0x3b0a63['verbose']}),_0x5766ad=_0x395087['data'],_0xcc9d9b=await withSpinner(_0x2a2fde(0x15f)+_0xeb438f+_0x2a2fde(0x228),()=>_0x668b7e[_0x2a2fde(0x10e)]['getCurrentConfigVersion'](_0x5766ad),{'verbose':_0x3b0a63[_0x2a2fde(0x10d)]}),_0x40219a=_0xcc9d9b[_0x2a2fde(0x113)];return console[_0x2a2fde(0x104)](_0x2a2fde(0x27b)),_0x3b0a63[_0x2a2fde(0x14d)]===_0x2a2fde(0x254)||_0x3b0a63[_0x2a2fde(0x14d)]==='jsonl'?await handleSDKOutput([_0x40219a],_0x3b0a63):(console[_0x2a2fde(0x253)]('id:\x20'+_0x40219a['id']),console[_0x2a2fde(0x253)](_0x2a2fde(0x278)+_0x40219a['audienceId']),console[_0x2a2fde(0x253)]('identifier:\x20'+_0x40219a[_0x2a2fde(0x1a3)]),console[_0x2a2fde(0x253)]('eventKind:\x20'+_0x40219a['eventKind']),console[_0x2a2fde(0x253)](_0x2a2fde(0x25c)+_0x40219a[_0x2a2fde(0x13f)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:service:list';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x2f7);async[a31_0xe8811a(0x224)](_0x57ba45){const _0x3b834a=a31_0xe8811a,{options:_0x2f8524,args:_0x5356bf,tdx:_0x9ec086}=_0x57ba45,_0x59d425=_0x5356bf[0x0]||_0x2f8524['parentSegment'];if(!_0x59d425)return showParentSegmentNotSetError(_0x3b834a(0x2dd)+_0x3b834a(0x1ce)),0x1;const _0x283810=await withSpinner(_0x3b834a(0x18d)+_0x59d425+_0x3b834a(0x228),()=>_0x9ec086['segment'][_0x3b834a(0x143)](_0x59d425),{'verbose':_0x2f8524['verbose']}),_0xa1209a=_0x283810[_0x3b834a(0x113)],_0x16e49b=await withSpinner(_0x3b834a(0x25f)+_0x59d425+_0x3b834a(0x228),()=>_0x9ec086[_0x3b834a(0x20d)]['list'](_0xa1209a),{'verbose':_0x2f8524[_0x3b834a(0x10d)]}),_0x473c72=_0x16e49b['data'];console[_0x3b834a(0x104)](_0x3b834a(0x245)+_0x473c72[_0x3b834a(0x1a2)]+_0x3b834a(0x121)+(_0x473c72[_0x3b834a(0x1a2)]!==0x1?'s':''));if(_0x2f8524[_0x3b834a(0x14d)]===_0x3b834a(0x254)||_0x2f8524['format']==='jsonl')await handleSDKOutput(_0x473c72,_0x2f8524);else{if(_0x473c72[_0x3b834a(0x1a2)]===0x0)console[_0x3b834a(0x253)]('No\x20personalization\x20services\x20configured'),console['error'](a31_0x4d24f3[_0x3b834a(0x175)]('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x2a2118 of _0x473c72){console[_0x3b834a(0x253)](a31_0x4d24f3[_0x3b834a(0x166)](_0x2a2118[_0x3b834a(0x260)])+'\x20'+a31_0x4d24f3['dim'](_0x3b834a(0x22c)+_0x2a2118['id']+')'));_0x2a2118['description']&&console[_0x3b834a(0x253)]('\x20\x20'+a31_0x4d24f3[_0x3b834a(0x2f8)](_0x2a2118[_0x3b834a(0x2ab)]));if(_0x2a2118[_0x3b834a(0x218)]&&_0x2a2118[_0x3b834a(0x218)][_0x3b834a(0x1a2)]>0x0)for(const _0x57a6ed of _0x2a2118[_0x3b834a(0x218)]){const _0x340b43=_0x57a6ed[_0x3b834a(0x1dc)]?.[_0x3b834a(0x1a2)]?_0x57a6ed[_0x3b834a(0x1dc)][_0x3b834a(0x31f)](',\x20'):_0x3b834a(0x203);console[_0x3b834a(0x253)]('\x20\x20'+a31_0x4d24f3['cyan'](_0x3b834a(0x321))+'\x20'+_0x57a6ed[_0x3b834a(0x260)]+'\x20'+a31_0x4d24f3[_0x3b834a(0x2f8)](_0x3b834a(0x22c)+_0x57a6ed['id']+')')),console[_0x3b834a(0x253)](_0x3b834a(0x2d5)+a31_0x4d24f3['dim'](_0x3b834a(0x1ea))+'\x20'+_0x340b43);}else console[_0x3b834a(0x253)]('\x20\x20'+a31_0x4d24f3[_0x3b834a(0x2f8)](_0x3b834a(0x120)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x261);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x131);async[a31_0xe8811a(0x224)](_0x44150f){const _0x4a97d0=a31_0xe8811a,{options:_0x5e6e75,args:_0x1af8fa,tdx:_0xfa932b}=_0x44150f,_0x242205=_0x5e6e75,_0x29eb48=_0x1af8fa[0x0],_0x276845=_0x1af8fa[0x1]||_0x5e6e75[_0x4a97d0(0x13c)];if(!_0x29eb48)return console[_0x4a97d0(0x104)]('Error:\x20Service\x20name\x20is\x20required'),console[_0x4a97d0(0x104)](_0x4a97d0(0x286)),console[_0x4a97d0(0x104)](_0x4a97d0(0x1f9)),0x1;if(!_0x276845)return showParentSegmentNotSetError(_0x4a97d0(0x160)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x3ad689=await withSpinner(_0x4a97d0(0x18d)+_0x276845+'\x27...',()=>_0xfa932b[_0x4a97d0(0x200)][_0x4a97d0(0x143)](_0x276845),{'verbose':_0x5e6e75[_0x4a97d0(0x10d)]}),_0x2f33b0=_0x3ad689[_0x4a97d0(0x113)],_0x486bcd={'name':_0x29eb48,'description':_0x242205[_0x4a97d0(0x2ab)],'public':_0x242205[_0x4a97d0(0x262)]},_0x3a016f=await withSpinner(_0x4a97d0(0x19d)+_0x29eb48+_0x4a97d0(0x228),()=>_0xfa932b[_0x4a97d0(0x20d)]['create'](_0x2f33b0,_0x486bcd),{'verbose':_0x5e6e75[_0x4a97d0(0x10d)]}),_0x473f6e=_0x3a016f[_0x4a97d0(0x113)];return console['error'](_0x4a97d0(0x292)+_0x473f6e['name']+_0x4a97d0(0x2b3)+_0x473f6e['id']),await handleSDKOutput([_0x473f6e],_0x5e6e75),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x201);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x219);async[a31_0xe8811a(0x224)](_0x385e52){const _0x52727f=a31_0xe8811a,{options:_0x54dc5a,args:_0x10f8d3,tdx:_0x3f95f5}=_0x385e52,_0x5f4ae7=_0x10f8d3[0x0],_0x1533d2=_0x10f8d3[0x1]||_0x54dc5a[_0x52727f(0x13c)];if(!_0x5f4ae7)return console['error'](_0x52727f(0x106)),console[_0x52727f(0x104)](_0x52727f(0x303)),console[_0x52727f(0x104)](_0x52727f(0x1f4)),0x1;if(!_0x1533d2)return showParentSegmentNotSetError(_0x52727f(0x1fd)+_0x52727f(0x1f4)),0x1;const _0x50abd9=await withSpinner(_0x52727f(0x18d)+_0x1533d2+_0x52727f(0x228),()=>_0x3f95f5[_0x52727f(0x200)][_0x52727f(0x143)](_0x1533d2),{'verbose':_0x54dc5a[_0x52727f(0x10d)]}),_0xb9abd5=_0x50abd9[_0x52727f(0x113)],_0x51c209=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x5f4ae7+_0x52727f(0x228),()=>_0x3f95f5[_0x52727f(0x20d)][_0x52727f(0x2a2)](_0xb9abd5,_0x5f4ae7),{'verbose':_0x54dc5a[_0x52727f(0x10d)]}),_0x357a76=_0x51c209[_0x52727f(0x113)];if(_0x54dc5a[_0x52727f(0x254)]||_0x54dc5a['jsonl'])await handleSDKOutput([_0x357a76],_0x54dc5a);else{console['log'](a31_0x4d24f3[_0x52727f(0x166)](_0x357a76['name'])+'\x20'+a31_0x4d24f3[_0x52727f(0x2f8)](_0x52727f(0x22c)+_0x357a76['id']+')'));_0x357a76[_0x52727f(0x2ab)]&&console[_0x52727f(0x253)]('\x20\x20'+a31_0x4d24f3['dim'](_0x357a76['description']));console['log']('\x20\x20'+a31_0x4d24f3[_0x52727f(0x175)](_0x52727f(0x232))+'\x20'+(_0x357a76[_0x52727f(0x262)]?'yes':'no'));if(_0x357a76[_0x52727f(0x218)]&&_0x357a76['tokens'][_0x52727f(0x1a2)]>0x0)for(const _0x18f90a of _0x357a76[_0x52727f(0x218)]){const _0x4b2ee8=_0x18f90a[_0x52727f(0x1dc)]?.['length']?_0x18f90a[_0x52727f(0x1dc)]['join'](',\x20'):_0x52727f(0x203);console[_0x52727f(0x253)]('\x20\x20'+a31_0x4d24f3['cyan'](_0x52727f(0x321))+'\x20'+_0x18f90a[_0x52727f(0x260)]+'\x20'+a31_0x4d24f3[_0x52727f(0x2f8)](_0x52727f(0x22c)+_0x18f90a['id']+')')),console[_0x52727f(0x253)](_0x52727f(0x2d5)+a31_0x4d24f3['dim'](_0x52727f(0x1ea))+'\x20'+_0x4b2ee8);}else console[_0x52727f(0x253)]('\x20\x20'+a31_0x4d24f3[_0x52727f(0x2f8)](_0x52727f(0x120)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{['name']=a31_0xe8811a(0x2d2);['description']='Delete\x20a\x20personalization\x20service';async['execute'](_0x21073e){const _0x143f3c=a31_0xe8811a,{options:_0x3f5b18,args:_0x127d34,tdx:_0x4092a0}=_0x21073e,_0x2d5859=_0x127d34[0x0],_0x330a6b=_0x127d34[0x1]||_0x3f5b18[_0x143f3c(0x13c)];if(!_0x2d5859)return console[_0x143f3c(0x104)](_0x143f3c(0x106)),console[_0x143f3c(0x104)](_0x143f3c(0x1bd)),console[_0x143f3c(0x104)](_0x143f3c(0x2ee)),0x1;if(!_0x330a6b)return showParentSegmentNotSetError(_0x143f3c(0x266)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x10f31f=await withSpinner(_0x143f3c(0x18d)+_0x330a6b+_0x143f3c(0x228),()=>_0x4092a0[_0x143f3c(0x200)][_0x143f3c(0x143)](_0x330a6b),{'verbose':_0x3f5b18[_0x143f3c(0x10d)]}),_0x399f17=_0x10f31f[_0x143f3c(0x113)];return await withSpinner(_0x143f3c(0x1cb)+_0x2d5859+_0x143f3c(0x228),()=>_0x4092a0[_0x143f3c(0x20d)][_0x143f3c(0x23b)](_0x399f17,_0x2d5859),{'verbose':_0x3f5b18[_0x143f3c(0x10d)]}),console['error'](_0x143f3c(0x31e)+_0x2d5859+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:service:update';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x152);async[a31_0xe8811a(0x224)](_0x21aefe){const _0x395829=a31_0xe8811a,{options:_0x334de9,args:_0x3747b7,tdx:_0x34724b}=_0x21aefe,_0x3f462e=_0x334de9,_0x1a4678=_0x3747b7[0x0],_0x23d8c3=_0x3747b7[0x1]||_0x334de9['parentSegment'];if(!_0x1a4678)return console[_0x395829(0x104)](_0x395829(0x106)),console[_0x395829(0x104)](_0x395829(0x293)),console[_0x395829(0x104)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x3f462e[_0x395829(0x260)])return console[_0x395829(0x104)]('Error:\x20--name\x20is\x20required'),console['error'](_0x395829(0x293)),0x1;if(!_0x23d8c3)return showParentSegmentNotSetError(_0x395829(0x250)+_0x395829(0xfe)),0x1;const _0x9058e4=await withSpinner(_0x395829(0x18d)+_0x23d8c3+_0x395829(0x228),()=>_0x34724b['segment'][_0x395829(0x143)](_0x23d8c3),{'verbose':_0x334de9[_0x395829(0x10d)]}),_0xf315a9=_0x9058e4[_0x395829(0x113)],_0x3879b6={'name':_0x3f462e[_0x395829(0x260)]};_0x3f462e['description']!==undefined&&(_0x3879b6[_0x395829(0x2ab)]=_0x3f462e[_0x395829(0x2ab)]);const _0x47f5e7=await withSpinner(_0x395829(0x1b5)+_0x1a4678+_0x395829(0x228),()=>_0x34724b['personalization'][_0x395829(0x164)](_0xf315a9,_0x1a4678,_0x3879b6),{'verbose':_0x334de9[_0x395829(0x10d)]}),_0x4f7056=_0x47f5e7[_0x395829(0x113)];return console[_0x395829(0x104)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x4f7056[_0x395829(0x260)]+'\x27'),await handleSDKOutput([_0x4f7056],_0x334de9),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:service:token:create';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x1ca);async[a31_0xe8811a(0x224)](_0x2f8de8){const _0x4a2a18=a31_0xe8811a,{options:_0x5794f9,args:_0x21ab0f,tdx:_0x280647}=_0x2f8de8,_0x478392=_0x5794f9,_0x202918=_0x21ab0f[0x0],_0x3339ce=_0x21ab0f[0x1],_0x57f975=_0x21ab0f[0x2]||_0x5794f9[_0x4a2a18(0x13c)];if(!_0x202918)return console[_0x4a2a18(0x104)]('Error:\x20Token\x20name\x20is\x20required'),console[_0x4a2a18(0x104)](_0x4a2a18(0x2f9)),console['error'](_0x4a2a18(0x156)),0x1;if(!_0x3339ce)return console[_0x4a2a18(0x104)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x4a2a18(0x104)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x4a2a18(0x104)](_0x4a2a18(0x156)),0x1;if(!_0x57f975)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+_0x4a2a18(0x156)),0x1;const _0x31a243=await withSpinner(_0x4a2a18(0x18d)+_0x57f975+_0x4a2a18(0x228),()=>_0x280647[_0x4a2a18(0x200)]['resolveParentId'](_0x57f975),{'verbose':_0x5794f9[_0x4a2a18(0x10d)]}),_0x2661fa=_0x31a243[_0x4a2a18(0x113)],_0x44defe={'name':_0x202918};_0x478392[_0x4a2a18(0x1dc)]&&(_0x44defe[_0x4a2a18(0x1dc)]=_0x478392[_0x4a2a18(0x1dc)][_0x4a2a18(0x17d)](',')[_0x4a2a18(0x17e)](_0x4c37f7=>_0x4c37f7[_0x4a2a18(0x2d1)]()));_0x478392[_0x4a2a18(0x2ab)]&&(_0x44defe[_0x4a2a18(0x2ab)]=_0x478392[_0x4a2a18(0x2ab)]);const _0x258880=await withSpinner(_0x4a2a18(0x119)+_0x202918+_0x4a2a18(0x174)+_0x3339ce+_0x4a2a18(0x228),()=>_0x280647['personalization'][_0x4a2a18(0x116)](_0x2661fa,_0x3339ce,_0x44defe),{'verbose':_0x5794f9['verbose']}),_0x173836=_0x258880['data'];return console[_0x4a2a18(0x104)](_0x4a2a18(0x1e5)+_0x173836[_0x4a2a18(0x260)]+_0x4a2a18(0x2b3)+_0x173836['id']),_0x173836[_0x4a2a18(0x1c2)]&&(console[_0x4a2a18(0x104)](a31_0x4d24f3[_0x4a2a18(0x1a7)](_0x4a2a18(0x1ec))),console['error'](a31_0x4d24f3['cyan'](_0x173836[_0x4a2a18(0x1c2)])),console['error']('')),await handleSDKOutput([_0x173836],_0x5794f9),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:service:token:delete';['description']=a31_0xe8811a(0x238);async[a31_0xe8811a(0x224)](_0x51b012){const _0x59d610=a31_0xe8811a,{options:_0x46f7fc,args:_0x1923fd,tdx:_0x15f1c}=_0x51b012,_0x11d6c4=_0x1923fd[0x0],_0x7dd43e=_0x1923fd[0x1]||_0x46f7fc[_0x59d610(0x13c)];if(!_0x11d6c4)return console['error'](_0x59d610(0x103)),console[_0x59d610(0x104)](_0x59d610(0x139)),console[_0x59d610(0x104)](_0x59d610(0x315)),0x1;if(!_0x7dd43e)return showParentSegmentNotSetError(_0x59d610(0x2b9)+_0x59d610(0x315)),0x1;const _0x52a56f=await withSpinner(_0x59d610(0x18d)+_0x7dd43e+_0x59d610(0x228),()=>_0x15f1c[_0x59d610(0x200)][_0x59d610(0x143)](_0x7dd43e),{'verbose':_0x46f7fc['verbose']}),_0x3a9081=_0x52a56f[_0x59d610(0x113)],_0x4eaf10=await withSpinner(_0x59d610(0x107),()=>_0x15f1c['personalization'][_0x59d610(0x12f)](_0x3a9081),{'verbose':_0x46f7fc[_0x59d610(0x10d)]}),_0x1bbec6=_0x4eaf10[_0x59d610(0x113)];let _0x3a8b57;for(const _0x255733 of _0x1bbec6){if(_0x255733['tokens']?.[_0x59d610(0x17b)](_0x4e56cd=>_0x4e56cd['id']===_0x11d6c4)){_0x3a8b57=_0x255733['id'];break;}}if(!_0x3a8b57)return console[_0x59d610(0x104)](_0x59d610(0x2a6)+_0x11d6c4+_0x59d610(0x2fe)),0x1;const _0x4f8f61=await withSpinner(_0x59d610(0x273)+_0x11d6c4+_0x59d610(0x228),()=>_0x15f1c['personalization'][_0x59d610(0x185)](_0x3a9081,_0x3a8b57,_0x11d6c4),{'verbose':_0x46f7fc[_0x59d610(0x10d)]}),_0x42c3ed=_0x4f8f61['data'];return console[_0x59d610(0x104)](_0x59d610(0x24b)+(_0x42c3ed[_0x59d610(0x260)]||_0x11d6c4)+'\x27'),await handleSDKOutput([_0x42c3ed],_0x46f7fc),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:list';[a31_0xe8811a(0x2ab)]='List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment';async['execute'](_0x2e71c6){const _0x4ba230=a31_0xe8811a,{options:_0x2e6d4d,args:_0x49ccf0,tdx:_0x12231b}=_0x2e71c6,_0x46a100=_0x49ccf0[0x0]||_0x2e6d4d[_0x4ba230(0x13c)];if(!_0x46a100)return showParentSegmentNotSetError(_0x4ba230(0x130)+'\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 _0x40eb64=await withSpinner(_0x4ba230(0x18d)+_0x46a100+'\x27...',()=>_0x12231b[_0x4ba230(0x200)][_0x4ba230(0x143)](_0x46a100),{'verbose':_0x2e6d4d[_0x4ba230(0x10d)]}),_0x54e7c3=_0x40eb64[_0x4ba230(0x113)],_0x5900fd=await withSpinner(_0x4ba230(0x111)+_0x46a100+_0x4ba230(0x228),()=>_0x12231b[_0x4ba230(0x20d)][_0x4ba230(0x27d)](_0x54e7c3),{'verbose':_0x2e6d4d[_0x4ba230(0x10d)]}),_0x21aa7a=_0x5900fd[_0x4ba230(0x113)];console[_0x4ba230(0x104)]('✔\x20Found\x20'+_0x21aa7a[_0x4ba230(0x1a2)]+_0x4ba230(0x1f8)+(_0x21aa7a[_0x4ba230(0x1a2)]!==0x1?'s':''));if(_0x2e6d4d[_0x4ba230(0x14d)]===_0x4ba230(0x254)||_0x2e6d4d[_0x4ba230(0x14d)]==='jsonl')await handleSDKOutput(_0x21aa7a,_0x2e6d4d);else{if(_0x21aa7a['length']===0x0)console['log'](_0x4ba230(0x2c8));else for(const _0x4824de of _0x21aa7a){console['log'](a31_0x4d24f3[_0x4ba230(0x166)](_0x4824de[_0x4ba230(0x260)])+'\x20'+a31_0x4d24f3[_0x4ba230(0x2f8)]('(id:\x20'+_0x4824de['id']+')'));_0x4824de[_0x4ba230(0x2ab)]&&console['log']('\x20\x20'+a31_0x4d24f3['dim'](_0x4824de[_0x4ba230(0x2ab)]));const _0x27cbbe=_0x4824de[_0x4ba230(0x209)]?.['length']||0x0;console[_0x4ba230(0x253)]('\x20\x20'+a31_0x4d24f3[_0x4ba230(0x175)](_0x4ba230(0x306))+'\x20'+_0x27cbbe);if(_0x4824de['sections']&&_0x4824de['sections']['length']>0x0)for(const _0xa9abf7 of _0x4824de['sections']){console['log'](_0x4ba230(0x2aa)+_0xa9abf7[_0x4ba230(0x260)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1ef);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x221);async['execute'](_0x35068c){const _0x504eb0=a31_0xe8811a,{options:_0x21c3c6,args:_0x6bf0ad,tdx:_0x22d54c}=_0x35068c,_0x767a9f=_0x6bf0ad[0x0];if(!_0x767a9f)return console[_0x504eb0(0x104)](_0x504eb0(0x198)),console['error'](_0x504eb0(0x1f5)),0x1;const _0x1a6e8b=await withSpinner(_0x504eb0(0x179)+_0x767a9f+'\x27...',()=>_0x22d54c[_0x504eb0(0x20d)][_0x504eb0(0x20f)](_0x767a9f),{'verbose':_0x21c3c6[_0x504eb0(0x10d)]}),_0x305198=_0x1a6e8b[_0x504eb0(0x113)];console[_0x504eb0(0x104)](_0x504eb0(0x199)+_0x305198[_0x504eb0(0x260)]+'\x27');if(_0x21c3c6[_0x504eb0(0x14d)]===_0x504eb0(0x254)||_0x21c3c6['format']==='jsonl')await handleSDKOutput([_0x305198],_0x21c3c6);else{console[_0x504eb0(0x253)](a31_0x4d24f3[_0x504eb0(0x166)](_0x305198[_0x504eb0(0x260)])+'\x20'+a31_0x4d24f3[_0x504eb0(0x2f8)]('(id:\x20'+_0x305198['id']+')'));_0x305198[_0x504eb0(0x2ab)]&&console[_0x504eb0(0x253)]('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x2f8)](_0x305198[_0x504eb0(0x2ab)]));_0x305198[_0x504eb0(0x190)]&&console[_0x504eb0(0x253)]('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x281))+'\x20'+_0x305198[_0x504eb0(0x190)]);console[_0x504eb0(0x253)]('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x19f))+'\x20'+_0x305198['createdAt']),console[_0x504eb0(0x253)]('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x1e1))+'\x20'+_0x305198['updatedAt']);const _0x2cb86a=_0x305198['sections']?.[_0x504eb0(0x1a2)]||0x0;console['log']('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x306))+'\x20'+_0x2cb86a);if(_0x305198[_0x504eb0(0x209)]&&_0x305198['sections'][_0x504eb0(0x1a2)]>0x0)for(const _0xfd070e of _0x305198[_0x504eb0(0x209)]){console[_0x504eb0(0x253)]('\x20\x20\x20\x20'+a31_0x4d24f3['bold'](_0xfd070e[_0x504eb0(0x260)])+'\x20'+a31_0x4d24f3[_0x504eb0(0x2f8)](_0x504eb0(0x22c)+_0xfd070e['id']+')')),_0xfd070e[_0x504eb0(0x20e)]&&(console[_0x504eb0(0x253)]('\x20\x20\x20\x20\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x1b3))+'\x20'+_0xfd070e[_0x504eb0(0x20e)][_0x504eb0(0x260)]),_0xfd070e[_0x504eb0(0x20e)][_0x504eb0(0x14b)]?.[_0x504eb0(0x316)]&&console[_0x504eb0(0x253)]('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x1ac))+'\x20'+_0xfd070e[_0x504eb0(0x20e)]['keyEventCriteria']['keyEventId'])),_0xfd070e['payload']&&console[_0x504eb0(0x253)](_0x504eb0(0x309)+a31_0x4d24f3['cyan'](_0x504eb0(0x212))+'\x20'+JSON[_0x504eb0(0x176)](_0xfd070e[_0x504eb0(0x1c7)])),_0xfd070e[_0x504eb0(0x1eb)]&&console[_0x504eb0(0x253)]('\x20\x20\x20\x20\x20\x20'+a31_0x4d24f3['cyan'](_0x504eb0(0x2b7))+'\x20true');}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1aa);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x2bc);async['execute'](_0x351c52){const _0x2706f0=a31_0xe8811a,{options:_0x11e966,args:_0x43e53d,tdx:_0x19ad4d}=_0x351c52,_0x1f5ba6=_0x43e53d[0x0];if(!_0x1f5ba6)return console[_0x2706f0(0x104)](_0x2706f0(0x198)),console['error'](_0x2706f0(0x26e)),0x1;return await withSpinner(_0x2706f0(0x259)+_0x1f5ba6+_0x2706f0(0x228),()=>_0x19ad4d['personalization'][_0x2706f0(0x2cb)](_0x1f5ba6),{'verbose':_0x11e966[_0x2706f0(0x10d)]}),console[_0x2706f0(0x104)](_0x2706f0(0x135)+_0x1f5ba6+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']=a31_0xe8811a(0x1d8);[a31_0xe8811a(0x2ab)]='Create\x20a\x20realtime\x20personalization\x20entity';async[a31_0xe8811a(0x224)](_0x3b8fcd){const _0x12399c=a31_0xe8811a,{options:_0x3d0091,tdx:_0x5a4283}=_0x3b8fcd,_0x3e8616=_0x3d0091;let _0x28e9f0;if(_0x3e8616[_0x12399c(0x10b)]){_0x28e9f0=await loadJSON(_0x3e8616[_0x12399c(0x10b)],!![]);if(!_0x28e9f0[_0x12399c(0x1fc)]?.['parentFolder'])return console['error']('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0x12399c(0x104)](_0x12399c(0x271)),console[_0x12399c(0x104)](_0x12399c(0x220)),0x1;}else{if(!_0x3e8616[_0x12399c(0x260)])return console['error'](_0x12399c(0x165)),console['error'](_0x12399c(0x277)),console[_0x12399c(0x104)](_0x12399c(0x25e)),0x1;if(_0x3e8616[_0x12399c(0x2ab)]===undefined)return console[_0x12399c(0x104)](_0x12399c(0x207)),console[_0x12399c(0x104)](_0x12399c(0x277)),console[_0x12399c(0x104)](_0x12399c(0x25e)),0x1;if(_0x3e8616[_0x12399c(0x184)]===undefined)return console[_0x12399c(0x104)](_0x12399c(0x155)),console[_0x12399c(0x104)](_0x12399c(0x2eb)),0x1;let _0x1f62c6=_0x3e8616[_0x12399c(0x190)];if(!_0x1f62c6&&_0x3d0091[_0x12399c(0x13c)]){const _0x57e038=await withSpinner(_0x12399c(0x18d)+_0x3d0091['parentSegment']+_0x12399c(0x228),()=>_0x5a4283[_0x12399c(0x200)][_0x12399c(0x143)](_0x3d0091['parentSegment']),{'verbose':_0x3d0091['verbose']});_0x1f62c6=_0x57e038[_0x12399c(0x113)];}let _0x36fb59;_0x3e8616['sections']&&(_0x36fb59=await loadJSON(_0x3e8616[_0x12399c(0x209)],![]));const _0x3bea13=_0x3e8616[_0x12399c(0x184)]===_0x12399c(0x31c)?null:{'id':_0x3e8616[_0x12399c(0x184)],'type':_0x12399c(0x2ff)};_0x28e9f0={'attributes':{'name':_0x3e8616[_0x12399c(0x260)],'description':_0x3e8616[_0x12399c(0x2ab)]||null,..._0x1f62c6!==undefined&&{'audienceId':_0x1f62c6},..._0x36fb59!==undefined&&{'sections':_0x36fb59}},'relationships':{'parentFolder':{'data':_0x3bea13}}};}const _0xc355fb=await withSpinner(_0x12399c(0x189)+(_0x28e9f0[_0x12399c(0x289)]?.[_0x12399c(0x260)]??'')+_0x12399c(0x228),()=>_0x5a4283['personalization'][_0x12399c(0x1d3)](_0x28e9f0),{'verbose':_0x3d0091['verbose']}),_0x397b67=_0xc355fb[_0x12399c(0x113)];return console[_0x12399c(0x104)](_0x12399c(0x252)+_0x397b67[_0x12399c(0x260)]+_0x12399c(0x2b3)+_0x397b67['id']),await handleSDKOutput([_0x397b67],_0x3d0091),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x304);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x300);async[a31_0xe8811a(0x224)](_0xfc5914){const _0x4d8215=a31_0xe8811a,{options:_0x50109b,args:_0x26737e}=_0xfc5914,_0x3e9fcc=_0x50109b,_0x5a6f57=_0x26737e[0x0];if(!_0x5a6f57)return console[_0x4d8215(0x104)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x4d8215(0x104)](_0x4d8215(0x146)),console[_0x4d8215(0x104)](_0x4d8215(0x313)),0x1;let _0x40021c;if(_0x3e9fcc[_0x4d8215(0x10b)])_0x40021c=await loadJSON(_0x3e9fcc['file'],!![]);else{if(!_0x3e9fcc[_0x4d8215(0x260)])return console[_0x4d8215(0x104)](_0x4d8215(0x165)),console['error'](_0x4d8215(0x146)),0x1;if(_0x3e9fcc[_0x4d8215(0x2ab)]===undefined)return console[_0x4d8215(0x104)](_0x4d8215(0x207)),console[_0x4d8215(0x104)](_0x4d8215(0x146)),0x1;let _0x5be9f3;_0x3e9fcc['sections']&&(_0x5be9f3=await loadJSON(_0x3e9fcc[_0x4d8215(0x209)],![])),_0x40021c={'attributes':{'name':_0x3e9fcc[_0x4d8215(0x260)],'description':_0x3e9fcc[_0x4d8215(0x2ab)]||null,..._0x5be9f3!==undefined&&{'sections':_0x5be9f3}}};}const {tdx:_0x49d668}=_0xfc5914,_0x325fdb=await withSpinner(_0x4d8215(0x2b5)+_0x5a6f57+_0x4d8215(0x228),()=>_0x49d668[_0x4d8215(0x20d)][_0x4d8215(0x1da)](_0x5a6f57,_0x40021c),{'verbose':_0x50109b[_0x4d8215(0x10d)]}),_0x287adf=_0x325fdb['data'];return console[_0x4d8215(0x104)](_0x4d8215(0x210)+_0x287adf['name']+_0x4d8215(0x22f)+_0x287adf['id']+')'),await handleSDKOutput([_0x287adf],_0x50109b),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x2ed);['description']='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a31_0xe8811a(0x224)](_0x18b559){const _0x44d3d5=a31_0xe8811a,{options:_0x1daa1f,args:_0x63c903}=_0x18b559,_0x2b5aa2=_0x63c903[0x0]||_0x1daa1f[_0x44d3d5(0x13c)];if(!_0x2b5aa2)return showParentSegmentNotSetError(_0x44d3d5(0x265)+_0x44d3d5(0x24c)),0x1;const _0x3fc678=resolveYamlFile(_0x2b5aa2);if(!existsSync(_0x3fc678))return showFileNotFoundError(_0x3fc678,_0x2b5aa2),0x1;let _0x3d4262;try{_0x3d4262=readFileSync(_0x3fc678,_0x44d3d5(0x29f));}catch(_0xbcd1f5){const _0x37581d=_0xbcd1f5 instanceof Error?_0xbcd1f5[_0x44d3d5(0x205)]:String(_0xbcd1f5);return console[_0x44d3d5(0x104)](_0x44d3d5(0x2fc)+_0x37581d),0x1;}let _0x5da684;try{_0x5da684=parseDef(_0x3d4262);}catch(_0x29d0fd){const _0x27d583=_0x29d0fd instanceof Error?_0x29d0fd['message']:String(_0x29d0fd);return console['error'](a31_0x4d24f3[_0x44d3d5(0x2f4)](_0x44d3d5(0x1d4)+_0x27d583)),0x1;}if(_0x5da684[_0x44d3d5(0x16d)]&&_0x5da684['personalization_services'][_0x44d3d5(0x1a2)]>0x0)return console[_0x44d3d5(0x104)](a31_0x4d24f3[_0x44d3d5(0x1a7)](_0x44d3d5(0x158)+_0x3fc678)),console[_0x44d3d5(0x104)](a31_0x4d24f3[_0x44d3d5(0x2f8)](_0x44d3d5(0x2ae)+_0x5da684[_0x44d3d5(0x16d)][_0x44d3d5(0x1a2)]+_0x44d3d5(0x1c1))),0x1;!_0x5da684[_0x44d3d5(0x10e)]&&(_0x5da684[_0x44d3d5(0x10e)]={'events':[{'name':_0x44d3d5(0x109),'source_table':_0x44d3d5(0x1ab)}],'attributes':[{'name':_0x44d3d5(0x1bc),'type':_0x44d3d5(0x14c)}],'id_stitching':{'primary_key':_0x5da684[_0x44d3d5(0x2cf)][_0x44d3d5(0x101)]===_0x44d3d5(0x163)?_0x44d3d5(0x1d1):'user_id'}});_0x5da684[_0x44d3d5(0x16d)]=[{'name':'My\x20Service','description':_0x44d3d5(0x2c3),'trigger_event':_0x44d3d5(0x109),'sections':[{'name':_0x44d3d5(0x1c6),'criteria':_0x44d3d5(0x159),'attributes':[_0x44d3d5(0x1bc)]}]}];const _0x16b3cf=serializeDef(_0x5da684);return writeFileSync(_0x3fc678,_0x16b3cf,'utf-8'),console[_0x44d3d5(0x104)](a31_0x4d24f3[_0x44d3d5(0x2af)]('✔')+_0x44d3d5(0x150)+a31_0x4d24f3[_0x44d3d5(0x175)](_0x3fc678)),(!_0x5da684[_0x44d3d5(0x10e)]||_0x3d4262[_0x44d3d5(0x2a7)](_0x44d3d5(0x1ae))===-0x1)&&console['error'](a31_0x4d24f3['green']('✔')+_0x44d3d5(0x15c)),console[_0x44d3d5(0x104)]('\x0a'+a31_0x4d24f3['dim']('Next\x20steps:')),console['error'](_0x44d3d5(0x14e)+_0x3fc678+_0x44d3d5(0x320)),console[_0x44d3d5(0x104)](_0x44d3d5(0x23e)+a31_0x4d24f3[_0x44d3d5(0x2f8)](_0x44d3d5(0x129)+_0x2b5aa2)+_0x44d3d5(0x21b)),0x0;}}
1
+ const a31_0x33df17=a31_0x26a5;(function(_0x3f5b5e,_0x4db013){const _0x16b37a=a31_0x26a5,_0x1960e2=_0x3f5b5e();while(!![]){try{const _0x26b25f=parseInt(_0x16b37a(0x2a0))/0x1*(-parseInt(_0x16b37a(0x1a3))/0x2)+parseInt(_0x16b37a(0x24f))/0x3*(parseInt(_0x16b37a(0x36c))/0x4)+-parseInt(_0x16b37a(0x1ae))/0x5*(-parseInt(_0x16b37a(0x32c))/0x6)+-parseInt(_0x16b37a(0x1c2))/0x7*(parseInt(_0x16b37a(0x3ae))/0x8)+-parseInt(_0x16b37a(0x357))/0x9*(parseInt(_0x16b37a(0x2a1))/0xa)+-parseInt(_0x16b37a(0x2ce))/0xb*(parseInt(_0x16b37a(0x3af))/0xc)+-parseInt(_0x16b37a(0x1e9))/0xd*(-parseInt(_0x16b37a(0x2e8))/0xe);if(_0x26b25f===_0x4db013)break;else _0x1960e2['push'](_0x1960e2['shift']());}catch(_0x4a3600){_0x1960e2['push'](_0x1960e2['shift']());}}}(a31_0x9269,0x854bb));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x3ba6d8 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_0x437b86 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_0x33df17(0x227),LEGACY_PARENT_SEGMENT_DIR=a31_0x33df17(0x38d);function openBrowser(_0x438557){const _0x736787=a31_0x33df17,_0xfe6cd4=process[_0x736787(0x1ad)],_0xc89d9c=_0xfe6cd4===_0x736787(0x314)?_0x736787(0x38e):_0xfe6cd4===_0x736787(0x2c0)?_0x736787(0x249):_0x736787(0x284);spawn(_0xc89d9c,[_0x438557],{'detached':!![],'stdio':_0x736787(0x28a)})[_0x736787(0x2d4)]();}function migrateLegacyDirectory(){const _0x59d958=a31_0x33df17;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x29d41b=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x29d41b[_0x59d958(0x1e3)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x59d958(0x2ef)](a31_0x437b86[_0x59d958(0x2e5)](_0x59d958(0x35a)+LEGACY_PARENT_SEGMENT_DIR+_0x59d958(0x1f9)+PARENT_SEGMENT_DIR+_0x59d958(0x220))),console[_0x59d958(0x2ef)](a31_0x437b86[_0x59d958(0x358)](_0x59d958(0x1ff)+LEGACY_PARENT_SEGMENT_DIR+_0x59d958(0x301))),![];console[_0x59d958(0x2ef)](a31_0x437b86[_0x59d958(0x2e5)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x59d958(0x1a7)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x59d958(0x2ef)](a31_0x437b86['green']('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1692e9){const _0x393f5e=_0x1692e9 instanceof Error?_0x1692e9[_0x59d958(0x367)]:String(_0x1692e9);return console[_0x59d958(0x2ef)](a31_0x437b86[_0x59d958(0x1bb)](_0x59d958(0x297)+_0x393f5e+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x33df17(0x306)](_0x50feac){const _0x3d0a88=a31_0x33df17;return migrateLegacyDirectory(),super[_0x3d0a88(0x306)](_0x50feac);}}function resolveYamlFile(_0x1bc318){const _0x8f6517=a31_0x33df17;if(_0x1bc318[_0x8f6517(0x2d6)](_0x8f6517(0x309))||_0x1bc318['endsWith'](_0x8f6517(0x21f)))return _0x1bc318;return a31_0x3ba6d8[_0x8f6517(0x1d3)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1bc318)+_0x8f6517(0x309));}function formatProgressMessage(_0xd304ac){const _0x4a7377=a31_0x33df17,_0x31bda0=_0xd304ac['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x31bda0){const [,_0x56d0ee,_0xbd9b7f,_0x2c7cff='']=_0x31bda0;return a31_0x437b86[_0x4a7377(0x358)](_0x56d0ee+':')+'\x20'+_0xbd9b7f+a31_0x437b86[_0x4a7377(0x358)](_0x2c7cff);}return a31_0x437b86[_0x4a7377(0x358)](_0xd304ac);}function showFileNotFoundError(_0x2df25c,_0x556e44){const _0x578b34=a31_0x33df17;console[_0x578b34(0x2ef)](a31_0x437b86[_0x578b34(0x1bb)](_0x578b34(0x345)+_0x2df25c+'\x0a')),console['error'](a31_0x437b86[_0x578b34(0x269)](_0x578b34(0x279)+_0x556e44+_0x578b34(0x2cd)));}function displayRealtimeValidation(_0x29dcfc){const _0x2737cc=a31_0x33df17;if(!_0x29dcfc[_0x2737cc(0x3bb)])return;const _0x267f33=_0x29dcfc[_0x2737cc(0x3bb)],_0x42ecb4=_0x267f33['enabled']?a31_0x437b86[_0x2737cc(0x292)](_0x2737cc(0x285)):a31_0x437b86['yellow'](_0x2737cc(0x20f));console[_0x2737cc(0x2ef)]('\x0a'+a31_0x437b86[_0x2737cc(0x358)](_0x2737cc(0x2e4))+'\x20'+_0x42ecb4);if(_0x267f33[_0x2737cc(0x1da)]&&_0x267f33['events'][_0x2737cc(0x2e9)]>0x0){console['error']('\x20\x20'+a31_0x437b86['dim'](_0x2737cc(0x2af))+'\x20'+_0x267f33['events'][_0x2737cc(0x2e9)]+_0x2737cc(0x39f));for(const _0x1f0ccd of _0x267f33[_0x2737cc(0x1da)]){const _0x394506=_0x1f0ccd[_0x2737cc(0x33a)]===![]?a31_0x437b86[_0x2737cc(0x1bb)]('✘'):a31_0x437b86['green']('✔');console['error'](_0x2737cc(0x373)+_0x394506+'\x20'+_0x1f0ccd[_0x2737cc(0x296)]),_0x1f0ccd[_0x2737cc(0x33e)]&&console[_0x2737cc(0x2ef)]('\x20\x20\x20\x20\x20\x20'+a31_0x437b86[_0x2737cc(0x1bb)](_0x1f0ccd[_0x2737cc(0x33e)]));}}if(_0x267f33[_0x2737cc(0x39d)]&&_0x267f33[_0x2737cc(0x39d)][_0x2737cc(0x2e9)]>0x0){console[_0x2737cc(0x2ef)]('\x20\x20'+a31_0x437b86[_0x2737cc(0x358)]('Attributes:')+'\x20'+_0x267f33[_0x2737cc(0x39d)][_0x2737cc(0x2e9)]+'\x20configured');for(const _0x4c77d6 of _0x267f33[_0x2737cc(0x39d)]){const _0x26f875=_0x4c77d6[_0x2737cc(0x351)]?a31_0x437b86[_0x2737cc(0x292)]('✔'):a31_0x437b86[_0x2737cc(0x1bb)]('✘');console[_0x2737cc(0x2ef)](_0x2737cc(0x373)+_0x26f875+'\x20'+_0x4c77d6['name']+'\x20'+a31_0x437b86[_0x2737cc(0x358)]('('+_0x4c77d6[_0x2737cc(0x34e)]+')'));}}if(_0x267f33['idStitching']){const _0x9cf069=_0x267f33[_0x2737cc(0x35e)][_0x2737cc(0x3bc)]?.[_0x2737cc(0x2e9)]?_0x2737cc(0x226)+_0x267f33[_0x2737cc(0x35e)][_0x2737cc(0x3bc)][_0x2737cc(0x1d3)](',\x20')+']':'';console[_0x2737cc(0x2ef)]('\x20\x20'+a31_0x437b86[_0x2737cc(0x358)](_0x2737cc(0x2f9))+'\x20'+_0x267f33[_0x2737cc(0x35e)][_0x2737cc(0x23c)]+_0x9cf069);}if(_0x267f33[_0x2737cc(0x3b2)]&&_0x267f33[_0x2737cc(0x3b2)][_0x2737cc(0x2e9)]>0x0){console['error']('\x20\x20'+a31_0x437b86[_0x2737cc(0x358)]('Personalization:')+'\x20'+_0x267f33['personalizationServices']['length']+_0x2737cc(0x203)+(_0x267f33[_0x2737cc(0x3b2)][_0x2737cc(0x2e9)]!==0x1?'s':''));for(const _0x23d5c1 of _0x267f33[_0x2737cc(0x3b2)]){console[_0x2737cc(0x2ef)](_0x2737cc(0x229)+_0x23d5c1[_0x2737cc(0x296)]);}}}function showParentSegmentNotSetError(_0x1e3b33){const _0x303a2c=a31_0x33df17;console[_0x303a2c(0x2ef)](a31_0x437b86[_0x303a2c(0x2e5)](_0x303a2c(0x260))),console[_0x303a2c(0x2ef)](_0x1e3b33);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x388);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2f8);async[a31_0x33df17(0x29e)](_0x2b4f3c){const _0x3fed58=a31_0x33df17,{options:_0x21e387,args:_0x13ac69,tdx:_0x42afa1}=_0x2b4f3c,_0x1aed93=_0x13ac69[0x0];_0x21e387[_0x3fed58(0x1a0)]&&(console['error'](_0x3fed58(0x368)+_0x21e387[_0x3fed58(0x24d)]),_0x1aed93&&console[_0x3fed58(0x2ef)]('Pattern:\x20'+_0x1aed93));const _0x490e3b=await withSpinner(_0x1aed93?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x1aed93+'\x27...':_0x3fed58(0x356),()=>_0x42afa1[_0x3fed58(0x207)][_0x3fed58(0x1bc)](),{'verbose':_0x21e387['verbose']});let _0x202ab7=_0x490e3b['data'];if(_0x1aed93){const _0x12cc01=_0x1aed93[_0x3fed58(0x341)](/[.+^${}()|[\]\\]/g,_0x3fed58(0x2bf))[_0x3fed58(0x341)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4120d2=new RegExp('^'+_0x12cc01+'$','i');_0x202ab7=_0x202ab7['filter'](_0x4ef65e=>_0x4120d2[_0x3fed58(0x2d9)](_0x4ef65e[_0x3fed58(0x39d)]['name']));}_0x202ab7[_0x3fed58(0x36e)]((_0x361817,_0x54d93a)=>_0x361817['attributes'][_0x3fed58(0x296)][_0x3fed58(0x35d)](_0x54d93a[_0x3fed58(0x39d)]['name'])),console['error'](_0x3fed58(0x396)+_0x202ab7['length']+_0x3fed58(0x3b3)+(_0x202ab7[_0x3fed58(0x2e9)]!==0x1?'s':''));const _0x4dcd2c=_0x53eec=>{const _0x4b5d27=_0x3fed58;return getConsoleNextUrl(_0x21e387[_0x4b5d27(0x24d)],_0x4b5d27(0x201)+_0x53eec);};if(_0x21e387[_0x3fed58(0x1f3)]===_0x3fed58(0x2c3)||_0x21e387[_0x3fed58(0x1f3)]===_0x3fed58(0x33b)){const _0x2ce704=_0x202ab7[_0x3fed58(0x1f7)](_0x9f7e1e=>({..._0x9f7e1e,'url':_0x4dcd2c(_0x9f7e1e['id'])}));await handleSDKOutput(_0x2ce704,_0x21e387);}else{if(_0x202ab7[_0x3fed58(0x2e9)]===0x0)_0x1aed93?console[_0x3fed58(0x2c2)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x1aed93):console[_0x3fed58(0x2c2)](_0x3fed58(0x2ed));else for(const _0x41856a of _0x202ab7){const _0x3315bd=_0x41856a['attributes'][_0x3fed58(0x1eb)]?a31_0x437b86[_0x3fed58(0x358)]('\x20('+formatRows(_0x41856a['attributes'][_0x3fed58(0x1eb)])+')'):'',_0x4b5661=hyperlink(_0x41856a[_0x3fed58(0x39d)][_0x3fed58(0x296)],_0x4dcd2c(_0x41856a['id']));console['log']('👥\x20'+_0x4b5661+_0x3315bd);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x224);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x25e);async[a31_0x33df17(0x29e)](_0x3c3c06){const _0x1a7653=a31_0x33df17,{options:_0xe53f74,args:_0x5e4a27,tdx:_0x812f76}=_0x3c3c06;console[_0x1a7653(0x2ef)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x1a7653(0x2ac)+_0x1a7653(0x316));const _0x551d08=_0xe53f74;if(_0x5e4a27[_0x1a7653(0x2e9)]===0x0)return console[_0x1a7653(0x2ef)](a31_0x437b86[_0x1a7653(0x1bb)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x1a7653(0x2ef)](_0x1a7653(0x2b4)),0x1;const _0x554d2e=_0x5e4a27[0x0];if(!_0x551d08[_0x1a7653(0x253)]||!_0x551d08[_0x1a7653(0x30d)])return console['error'](_0x1a7653(0x383)),console[_0x1a7653(0x2ef)](_0x1a7653(0x2b4)),0x1;_0x551d08[_0x1a7653(0x1a0)]&&(console[_0x1a7653(0x2ef)](_0x1a7653(0x368)+_0x551d08[_0x1a7653(0x24d)]),console['error'](_0x1a7653(0x319)+_0x554d2e),console[_0x1a7653(0x2ef)](_0x1a7653(0x1f0)+_0x551d08['database']),console[_0x1a7653(0x2ef)](_0x1a7653(0x206)+_0x551d08[_0x1a7653(0x30d)]));const _0x2747ff=await loadJSONFromOptions(_0x551d08[_0x1a7653(0x39d)],_0x551d08[_0x1a7653(0x1d4)]),_0x20af78=await loadJSONFromOptions(_0x551d08[_0x1a7653(0x308)],_0x551d08[_0x1a7653(0x228)]),_0x441a08=await loadJSONFromOptions(_0x551d08[_0x1a7653(0x332)],_0x551d08[_0x1a7653(0x2fc)]),_0xdad5a2={'name':_0x554d2e,'description':_0x551d08[_0x1a7653(0x2fa)],'scheduleType':_0x551d08[_0x1a7653(0x1e4)],'scheduleOption':_0x551d08['scheduleOption'],'timezone':_0x551d08[_0x1a7653(0x331)],'master':{'parentDatabaseName':_0x551d08[_0x1a7653(0x253)],'parentTableName':_0x551d08['table']},'attributes':_0x2747ff,'behaviors':_0x20af78,'customerGroup':_0x441a08},_0x1d2faa=await withSpinner(_0x1a7653(0x32d)+_0x554d2e+_0x1a7653(0x335),()=>_0x812f76[_0x1a7653(0x207)][_0x1a7653(0x26c)](_0xdad5a2),{'verbose':_0xe53f74[_0x1a7653(0x1a0)]}),_0x256e6b=_0x1d2faa['data'];return console['error'](_0x1a7653(0x354)+_0x256e6b[_0x1a7653(0x296)]+_0x1a7653(0x363)+_0x256e6b['id']),await handleSDKOutput([_0x256e6b],_0xe53f74),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x33df17(0x296)]='segment:parent:update';['description']=a31_0x33df17(0x237);async[a31_0x33df17(0x29e)](_0x411892){const _0x56f14b=a31_0x33df17,{options:_0x16bb02,args:_0x55e32c,tdx:_0x4cb132}=_0x411892;console[_0x56f14b(0x2ef)](_0x56f14b(0x2c5)+_0x56f14b(0x2ac)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x3dd3e0=_0x16bb02;if(_0x55e32c[_0x56f14b(0x2e9)]===0x0)return console[_0x56f14b(0x2ef)](a31_0x437b86['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x56f14b(0x2ef)](_0x56f14b(0x2ec)),0x1;const _0x75ae87=_0x55e32c[0x0];_0x3dd3e0[_0x56f14b(0x1a0)]&&(console[_0x56f14b(0x2ef)]('Site:\x20'+_0x3dd3e0[_0x56f14b(0x24d)]),console[_0x56f14b(0x2ef)](_0x56f14b(0x29f)+_0x75ae87));const _0x54ec3b=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x75ae87+_0x56f14b(0x335),()=>_0x4cb132[_0x56f14b(0x207)][_0x56f14b(0x318)](_0x75ae87),{'verbose':_0x3dd3e0[_0x56f14b(0x1a0)]}),_0x32fe85=_0x54ec3b[_0x56f14b(0x1a1)],_0x4e7344=await loadJSONFromOptions(_0x3dd3e0[_0x56f14b(0x2bc)],_0x3dd3e0[_0x56f14b(0x1cc)]),_0xddfce0=await loadJSONFromOptions(_0x3dd3e0[_0x56f14b(0x1ca)],_0x3dd3e0['addBehaviorsFile']),_0x439067={'name':_0x32fe85[_0x56f14b(0x296)],'description':_0x3dd3e0[_0x56f14b(0x2fa)]!==undefined?_0x3dd3e0[_0x56f14b(0x2fa)]:_0x32fe85['description'],'scheduleType':_0x3dd3e0[_0x56f14b(0x1e4)]!==undefined?_0x3dd3e0[_0x56f14b(0x1e4)]:_0x32fe85['scheduleType'],'scheduleOption':_0x3dd3e0[_0x56f14b(0x377)]!==undefined?_0x3dd3e0[_0x56f14b(0x377)]:_0x32fe85[_0x56f14b(0x377)],'timezone':_0x3dd3e0[_0x56f14b(0x331)]!==undefined?_0x3dd3e0['timezone']:_0x32fe85[_0x56f14b(0x331)],'master':_0x32fe85[_0x56f14b(0x211)],'attributes':_0x4e7344?[..._0x32fe85[_0x56f14b(0x39d)]||[],..._0x4e7344]:_0x32fe85[_0x56f14b(0x39d)],'behaviors':_0xddfce0?[..._0x32fe85[_0x56f14b(0x308)]||[],..._0xddfce0]:_0x32fe85[_0x56f14b(0x308)],'customerGroup':_0x32fe85['customerGroup']},_0x439645=await withSpinner(_0x56f14b(0x2aa)+_0x75ae87+'\x27...',()=>_0x4cb132[_0x56f14b(0x207)][_0x56f14b(0x1c4)](_0x75ae87,_0x439067),{'verbose':_0x3dd3e0[_0x56f14b(0x1a0)]}),_0x49c518=_0x439645[_0x56f14b(0x1a1)];return console[_0x56f14b(0x2ef)](_0x56f14b(0x1fa)+_0x49c518['name']+'\x27'),await handleSDKOutput([_0x49c518],_0x3dd3e0),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a31_0x33df17(0x1dd);['description']=a31_0x33df17(0x3bd);async[a31_0x33df17(0x29e)](_0x1b8f03){const _0x2e6cf9=a31_0x33df17,{options:_0x22c2c0,args:_0x4f6b38,tdx:_0xf2a923}=_0x1b8f03,_0x10b298=_0x22c2c0,_0x99a7de=_0x4f6b38[0x0]||_0x22c2c0['parentSegment'];if(!_0x99a7de)return showParentSegmentNotSetError(_0x2e6cf9(0x3aa)+_0x2e6cf9(0x1c8)),0x1;if(_0x10b298['use']&&_0x10b298[_0x2e6cf9(0x233)])return console[_0x2e6cf9(0x2ef)](a31_0x437b86[_0x2e6cf9(0x1bb)](_0x2e6cf9(0x3a5))),console[_0x2e6cf9(0x2ef)](a31_0x437b86['dim'](_0x2e6cf9(0x2b1))),console[_0x2e6cf9(0x2ef)](a31_0x437b86[_0x2e6cf9(0x358)](_0x2e6cf9(0x204)+PARENT_SEGMENT_DIR+_0x2e6cf9(0x1a6))),console['error'](a31_0x437b86[_0x2e6cf9(0x269)](_0x2e6cf9(0x33f))),0x1;const _0x517218=_0x10b298[_0x2e6cf9(0x233)]||a31_0x3ba6d8[_0x2e6cf9(0x1d3)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x99a7de)+_0x2e6cf9(0x309));_0x10b298[_0x2e6cf9(0x1a0)]&&(console[_0x2e6cf9(0x2ef)](_0x2e6cf9(0x368)+_0x10b298[_0x2e6cf9(0x24d)]),console[_0x2e6cf9(0x2ef)]('Parent\x20segment:\x20'+_0x99a7de),console[_0x2e6cf9(0x2ef)](_0x2e6cf9(0x2eb)+_0x517218));const _0x9ca6dc=await withSpinner(_0x2e6cf9(0x394)+_0x99a7de+'\x27...',()=>_0xf2a923[_0x2e6cf9(0x207)][_0x2e6cf9(0x1bd)](_0x99a7de),{'verbose':_0x10b298[_0x2e6cf9(0x1a0)]}),_0x1f6dbf=_0x9ca6dc['data'];if(existsSync(_0x517218)){const _0x75173b=readFileSync(_0x517218,_0x2e6cf9(0x2e6)),_0x2ba799=generateDiff(_0x75173b,_0x1f6dbf);if(!hasChanges(_0x2ba799))console[_0x2e6cf9(0x2ef)](a31_0x437b86['green']('✔')+_0x2e6cf9(0x272)+a31_0x437b86[_0x2e6cf9(0x269)](_0x517218)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x2e6cf9(0x2ef)](_0x2e6cf9(0x1b9)+_0x517218+'\x27:'),console[_0x2e6cf9(0x2ef)]('─'[_0x2e6cf9(0x1ea)](0x3c)),console[_0x2e6cf9(0x2ef)](formatDiffWithColors(_0x2ba799)),console['error']('─'[_0x2e6cf9(0x1ea)](0x3c));if(!_0x10b298[_0x2e6cf9(0x32e)]){if(!isInteractive())return console['error'](a31_0x437b86['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2e6cf9(0x2ef)](a31_0x437b86[_0x2e6cf9(0x358)](_0x2e6cf9(0x262))),0x1;const _0x25cdf2=await confirmKey('Overwrite\x20\x27'+_0x517218+'\x27?');if(!_0x25cdf2)return console[_0x2e6cf9(0x2ef)](a31_0x437b86[_0x2e6cf9(0x2e5)](_0x2e6cf9(0x20d))),0x1;}writeFileSync(_0x517218,_0x1f6dbf,_0x2e6cf9(0x2e6)),console['error'](a31_0x437b86['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x437b86[_0x2e6cf9(0x269)](_0x517218));}}else{const _0x1218b0=a31_0x3ba6d8[_0x2e6cf9(0x27e)](_0x517218);!existsSync(_0x1218b0)&&mkdirSync(_0x1218b0,{'recursive':!![]}),writeFileSync(_0x517218,_0x1f6dbf,_0x2e6cf9(0x2e6)),console[_0x2e6cf9(0x2ef)](a31_0x437b86[_0x2e6cf9(0x292)]('✔')+_0x2e6cf9(0x2f6)+a31_0x437b86[_0x2e6cf9(0x269)](_0x517218));}return saveSessionContext({'parent_segment':_0x99a7de},_0x10b298['session']),console['error'](a31_0x437b86[_0x2e6cf9(0x292)]('✔')+'\x20Context\x20set:\x20'+a31_0x437b86['dim'](_0x2e6cf9(0x38d))+_0x2e6cf9(0x2e2)+a31_0x437b86[_0x2e6cf9(0x269)](_0x99a7de)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a31_0x33df17(0x39a);[a31_0x33df17(0x2fa)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a31_0x33df17(0x29e)](_0x1c839b){const _0x2406a4=a31_0x33df17,{options:_0x5b3593,args:_0x4e0760,tdx:_0x450f17}=_0x1c839b,_0x31699f=_0x5b3593,_0x2edd23=_0x4e0760[0x0]||_0x5b3593['parentSegment'];if(!_0x2edd23)return showParentSegmentNotSetError(_0x2406a4(0x1e1)+_0x2406a4(0x252)),0x1;const _0x7a681a=resolveYamlFile(_0x2edd23);if(!existsSync(_0x7a681a))return showFileNotFoundError(_0x7a681a,_0x2edd23),0x1;_0x31699f['verbose']&&(console[_0x2406a4(0x2ef)](_0x2406a4(0x368)+_0x31699f[_0x2406a4(0x24d)]),console[_0x2406a4(0x2ef)]('YAML\x20file:\x20'+_0x7a681a));let _0x57df6b;try{_0x57df6b=readFileSync(_0x7a681a,_0x2406a4(0x2e6));}catch(_0x36fb91){const _0x2717a4=_0x36fb91 instanceof Error?_0x36fb91[_0x2406a4(0x367)]:String(_0x36fb91);return console[_0x2406a4(0x2ef)]('Error\x20reading\x20file:\x20'+_0x2717a4),0x1;}const _0xfdb41e=await withSpinner(_0x2406a4(0x2d7),()=>_0x450f17['segment'][_0x2406a4(0x27d)](_0x57df6b),{'verbose':_0x31699f[_0x2406a4(0x1a0)]}),_0x59e749=_0xfdb41e['data'],{isNew:_0x4d5a2a,name:_0x37b371,hasChanges:_0x450da3,diffFormatted:_0x54b425}=_0x59e749;if(!_0x450da3)return console['error'](_0x2406a4(0x1d8)+_0x37b371+_0x2406a4(0x240)),0x0;_0x4d5a2a?console['error'](_0x2406a4(0x28e)+_0x37b371+'\x27:'):console[_0x2406a4(0x2ef)](_0x2406a4(0x353)+_0x37b371+'\x27:');console['error']('─'[_0x2406a4(0x1ea)](0x3c)),console[_0x2406a4(0x2ef)](_0x54b425),console[_0x2406a4(0x2ef)]('─'[_0x2406a4(0x1ea)](0x3c));const _0xa38d9a=_0x4d5a2a?'Create\x20parent\x20segment\x20\x27'+_0x37b371+'\x27?':_0x2406a4(0x31e)+_0x37b371+'\x27?';if(!_0x31699f['yes']){if(!isInteractive())return console['error'](a31_0x437b86[_0x2406a4(0x1bb)](_0x2406a4(0x340)),_0x2406a4(0x3ab)),console['error'](a31_0x437b86[_0x2406a4(0x358)](_0x2406a4(0x262))),0x1;const _0x5ba482=await confirmKey(_0xa38d9a);if(!_0x5ba482)return console['error'](a31_0x437b86['yellow'](_0x2406a4(0x20d))),0x1;}const _0x3f9fa3=_0x4d5a2a?_0x2406a4(0x27c):_0x2406a4(0x231),_0x4017d4=await withSpinner(_0x3f9fa3+_0x2406a4(0x360)+_0x37b371+_0x2406a4(0x335),()=>_0x59e749['apply'](),{'verbose':_0x31699f['verbose']}),_0x3ffdf4=_0x4017d4[_0x2406a4(0x1a1)],_0x5c646b=getConsoleNextUrl(_0x31699f['site'],'/app/dw/parentSegments/'+_0x3ffdf4['id']),_0xfca05c=_0x4d5a2a?_0x2406a4(0x1d2):'Updated';return console[_0x2406a4(0x2ef)]('✔\x20'+_0xfca05c+'\x20parent\x20segment\x20\x27'+_0x3ffdf4[_0x2406a4(0x296)]+'\x27'),console['error']('\x20\x20'+_0x5c646b),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x23a);['description']=a31_0x33df17(0x1ac);async['execute'](_0x43250b){const _0x494505=a31_0x33df17,{options:_0x1b4a7a,args:_0x1262d1,tdx:_0xd6e8c5}=_0x43250b,_0x3bcf59=_0x1b4a7a,_0x55bf94=_0x1262d1[0x0]||_0x1b4a7a[_0x494505(0x2dd)];if(!_0x55bf94)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'+_0x494505(0x28b)+_0x494505(0x238)+_0x494505(0x2d1)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x494505(0x212)),0x1;const _0x149099=resolveYamlFile(_0x55bf94);if(!existsSync(_0x149099))return showFileNotFoundError(_0x149099,_0x55bf94),0x1;_0x3bcf59['verbose']&&(console[_0x494505(0x2ef)](_0x494505(0x368)+_0x3bcf59[_0x494505(0x24d)]),console[_0x494505(0x2ef)]('YAML\x20file:\x20'+_0x149099));let _0xfaebc9;try{_0xfaebc9=readFileSync(_0x149099,_0x494505(0x2e6));}catch(_0x22a184){const _0x1ffc9d=_0x22a184 instanceof Error?_0x22a184[_0x494505(0x367)]:String(_0x22a184);return console['error'](_0x494505(0x30e)+_0x1ffc9d),0x1;}const _0x1fdf4c=createCommandSpinner(a31_0x437b86[_0x494505(0x358)](_0x494505(0x268)),{'verbose':_0x3bcf59[_0x494505(0x1a0)]});_0x1fdf4c[_0x494505(0x249)]();const _0x384cf3={'onProgress':_0x575916=>{const _0x1a66b6=_0x494505;_0x1fdf4c[_0x1a66b6(0x2f5)]=formatProgressMessage(_0x575916);}};if(_0x3bcf59[_0x494505(0x211)])_0x384cf3[_0x494505(0x211)]=!![];if(_0x3bcf59[_0x494505(0x205)])_0x384cf3[_0x494505(0x205)]=!![];_0x3bcf59[_0x494505(0x39c)]&&(_0x384cf3[_0x494505(0x39c)]=_0x3bcf59['attribute']);_0x3bcf59['behavior']&&(_0x384cf3[_0x494505(0x1d0)]=_0x3bcf59['behavior']);if(_0x3bcf59[_0x494505(0x1e7)])_0x384cf3[_0x494505(0x1e7)]=_0x3bcf59[_0x494505(0x1e7)];let _0x13e638;try{_0x13e638=await _0xd6e8c5[_0x494505(0x207)]['validateParentYaml'](_0xfaebc9,_0x384cf3),_0x1fdf4c[_0x494505(0x2a4)]();}catch(_0x25a519){_0x1fdf4c[_0x494505(0x2a4)]();throw _0x25a519;}const _0x3c6022=_0x3bcf59[_0x494505(0x1e7)]||'-1d';return this['displayValidateResults'](_0x13e638,_0x384cf3,_0x149099,_0x3c6022),_0x13e638[_0x494505(0x324)]?0x0:0x1;}['displayValidateResults'](_0x2fd531,_0x469116,_0x556cd5,_0x1d5f72){const _0x4222c0=a31_0x33df17;console[_0x4222c0(0x2ef)]('\x0a'+a31_0x437b86[_0x4222c0(0x31c)](_0x4222c0(0x329))+'\x20'+_0x2fd531['name']),console['error']('═'[_0x4222c0(0x1ea)](0x3c)),this[_0x4222c0(0x326)](_0x2fd531);if(typeof _0x469116[_0x4222c0(0x39c)]===_0x4222c0(0x3b0)){this[_0x4222c0(0x2c8)](_0x2fd531),this[_0x4222c0(0x307)](_0x2fd531),this[_0x4222c0(0x1f8)](_0x556cd5,_0x1d5f72,_0x4222c0(0x39c),_0x469116[_0x4222c0(0x39c)]);return;}if(_0x469116[_0x4222c0(0x39c)]===!![]){this[_0x4222c0(0x2c8)](_0x2fd531),this[_0x4222c0(0x307)](_0x2fd531),this[_0x4222c0(0x1f8)](_0x556cd5,_0x1d5f72,'attributes');return;}if(typeof _0x469116[_0x4222c0(0x1d0)]===_0x4222c0(0x3b0)){this[_0x4222c0(0x208)](_0x2fd531,_0x1d5f72),this['displaySummary'](_0x2fd531),this[_0x4222c0(0x1f8)](_0x556cd5,_0x1d5f72,_0x4222c0(0x1d0),_0x469116[_0x4222c0(0x1d0)]);return;}if(_0x469116[_0x4222c0(0x1d0)]===!![]){this[_0x4222c0(0x208)](_0x2fd531,_0x1d5f72),this[_0x4222c0(0x307)](_0x2fd531),this['displayPreviewHints'](_0x556cd5,_0x1d5f72,_0x4222c0(0x308));return;}this[_0x4222c0(0x2c8)](_0x2fd531),this['displayBehaviorsStats'](_0x2fd531,_0x1d5f72),this[_0x4222c0(0x24b)](_0x2fd531),this[_0x4222c0(0x307)](_0x2fd531),this[_0x4222c0(0x1f8)](_0x556cd5,_0x1d5f72,'all');}[a31_0x33df17(0x24b)](_0x1e1820){displayRealtimeValidation(_0x1e1820);}[a31_0x33df17(0x1f8)](_0x23580f,_0xff7134,_0x148b9c,_0x1e7bdf){const _0x398ad4=a31_0x33df17;console[_0x398ad4(0x2ef)]('\x0a'+a31_0x437b86[_0x398ad4(0x358)](_0x398ad4(0x3ad)));const _0x451410=_0xff7134!==_0x398ad4(0x30a)?_0x398ad4(0x2c6)+_0xff7134:'';if(_0x148b9c===_0x398ad4(0x39c)&&_0x1e7bdf)console[_0x398ad4(0x2ef)]('\x20\x20'+a31_0x437b86[_0x398ad4(0x358)](_0x398ad4(0x215)+_0x23580f+_0x398ad4(0x1b3)+_0x1e7bdf+'\x22'+_0x451410));else{if(_0x148b9c===_0x398ad4(0x1d0)&&_0x1e7bdf)console[_0x398ad4(0x2ef)]('\x20\x20'+a31_0x437b86['dim'](_0x398ad4(0x215)+_0x23580f+_0x398ad4(0x2a3)+_0x1e7bdf+'\x22'+_0x451410));else(_0x148b9c===_0x398ad4(0x39d)||_0x148b9c===_0x398ad4(0x24a))&&console[_0x398ad4(0x2ef)]('\x20\x20'+a31_0x437b86['dim'](_0x398ad4(0x215)+_0x23580f+_0x398ad4(0x264)+_0x451410));}(_0x148b9c===_0x398ad4(0x308)||_0x148b9c==='all')&&console[_0x398ad4(0x2ef)]('\x20\x20'+a31_0x437b86[_0x398ad4(0x358)](_0x398ad4(0x215)+_0x23580f+_0x398ad4(0x3a7)+_0x451410)),_0x148b9c===_0x398ad4(0x24a)&&console[_0x398ad4(0x2ef)]('\x20\x20'+a31_0x437b86[_0x398ad4(0x358)](_0x398ad4(0x215)+_0x23580f+_0x398ad4(0x359)+_0x451410));}[a31_0x33df17(0x326)](_0xfe72df){const _0xc159=a31_0x33df17,{master:_0x54fd09}=_0xfe72df,_0x4e9ac8=_0x54fd09['schemaValid']?a31_0x437b86['green']('✔'):a31_0x437b86[_0xc159(0x1bb)]('✘');console['error']('\x0a'+a31_0x437b86[_0xc159(0x358)](_0xc159(0x393))),console['error'](_0x4e9ac8+'\x20'+a31_0x437b86[_0xc159(0x31c)](_0x54fd09[_0xc159(0x253)]+'.'+_0x54fd09['table'])),_0x54fd09[_0xc159(0x295)]?_0x54fd09['rowCount']!==undefined&&console[_0xc159(0x2ef)]('\x20\x20'+a31_0x437b86[_0xc159(0x358)](_0xc159(0x1e6))+'\x20'+a31_0x437b86['cyan'](formatRows(_0x54fd09[_0xc159(0x283)]))):console[_0xc159(0x2ef)]('\x20\x20'+a31_0x437b86[_0xc159(0x1bb)](_0xc159(0x30c))+'\x20'+_0x54fd09[_0xc159(0x31b)]);}[a31_0x33df17(0x2c8)](_0x373b06){const _0x47df47=a31_0x33df17;if(_0x373b06['attributes']['length']===0x0)return;console[_0x47df47(0x2ef)]('\x0a'+a31_0x437b86[_0x47df47(0x358)]('Attributes'));for(const _0x1cdff6 of _0x373b06[_0x47df47(0x39d)]){const _0x7b3af8=_0x1cdff6[_0x47df47(0x295)]?a31_0x437b86['green']('✔'):a31_0x437b86[_0x47df47(0x1bb)]('✘');let _0x3a0934='';if(_0x1cdff6['schemaValid']&&_0x1cdff6[_0x47df47(0x33c)]!==undefined&&_0x1cdff6[_0x47df47(0x21a)]!==undefined){const _0x5b3d22=_0x1cdff6[_0x47df47(0x21a)][_0x47df47(0x210)](0x1),_0xbdb301=_0x1cdff6[_0x47df47(0x21a)]>=0x50?a31_0x437b86[_0x47df47(0x292)]:_0x1cdff6[_0x47df47(0x21a)]>=0x32?a31_0x437b86[_0x47df47(0x2e5)]:a31_0x437b86[_0x47df47(0x1bb)];_0x3a0934='\x20'+a31_0x437b86[_0x47df47(0x358)](_0x47df47(0x2bb))+'\x20'+_0xbdb301(_0x5b3d22+'%')+'\x20('+formatRows(_0x1cdff6[_0x47df47(0x33c)])+_0x47df47(0x371);}console[_0x47df47(0x2ef)](_0x7b3af8+'\x20'+a31_0x437b86['bold'](_0x1cdff6[_0x47df47(0x296)])+_0x3a0934),console['error']('\x20\x20'+a31_0x437b86[_0x47df47(0x358)]('Source:')+'\x20'+a31_0x437b86[_0x47df47(0x31c)](_0x1cdff6['database']+'.'+_0x1cdff6[_0x47df47(0x30d)]));const _0x3d9786=_0x1cdff6[_0x47df47(0x3b4)]===_0x1cdff6['foreignKey']?a31_0x437b86[_0x47df47(0x358)](_0x47df47(0x3a8))+'\x20'+_0x1cdff6[_0x47df47(0x3b4)]:a31_0x437b86[_0x47df47(0x358)](_0x47df47(0x2ca))+'\x20'+_0x1cdff6[_0x47df47(0x3b4)]+_0x47df47(0x2e2)+_0x1cdff6[_0x47df47(0x2de)];console[_0x47df47(0x2ef)]('\x20\x20'+_0x3d9786),console[_0x47df47(0x2ef)]('\x20\x20'+a31_0x437b86[_0x47df47(0x358)](_0x47df47(0x29d))),this[_0x47df47(0x20e)](_0x1cdff6[_0x47df47(0x34d)]),!_0x1cdff6[_0x47df47(0x295)]&&console['error']('\x20\x20'+a31_0x437b86[_0x47df47(0x1bb)](_0x47df47(0x30c))+'\x20'+_0x1cdff6[_0x47df47(0x31b)]);}}[a31_0x33df17(0x208)](_0x19590e,_0x1e448f){const _0xaaae20=a31_0x33df17;if(_0x19590e['behaviors']['length']===0x0)return;console[_0xaaae20(0x2ef)]('\x0a'+a31_0x437b86[_0xaaae20(0x358)](_0xaaae20(0x305))+'\x20'+a31_0x437b86[_0xaaae20(0x358)]('('+_0x1e448f+')'));for(const _0x54f9df of _0x19590e[_0xaaae20(0x308)]){const _0x3a04ee=_0x54f9df['schemaValid']?a31_0x437b86['green']('✔'):a31_0x437b86[_0xaaae20(0x1bb)]('✘');let _0x36981e='';if(_0x54f9df[_0xaaae20(0x295)]&&_0x54f9df[_0xaaae20(0x261)]!==undefined&&_0x54f9df[_0xaaae20(0x1b7)]!==undefined){const _0x1ad245=_0x54f9df[_0xaaae20(0x1e8)]?.[_0xaaae20(0x210)](0x1)||'?',_0x58b692=(_0x54f9df[_0xaaae20(0x1e8)]??0x0)>=0x32?a31_0x437b86[_0xaaae20(0x292)]:(_0x54f9df[_0xaaae20(0x1e8)]??0x0)>=0x14?a31_0x437b86[_0xaaae20(0x2e5)]:a31_0x437b86[_0xaaae20(0x1bb)];_0x36981e='\x20'+a31_0x437b86[_0xaaae20(0x358)]('Customers:')+'\x20'+_0x58b692(formatRows(_0x54f9df[_0xaaae20(0x261)]))+'\x20('+_0x1ad245+_0xaaae20(0x2b0)+a31_0x437b86[_0xaaae20(0x358)](_0xaaae20(0x2af))+'\x20'+a31_0x437b86[_0xaaae20(0x269)](formatRows(_0x54f9df['totalEvents']));}console[_0xaaae20(0x2ef)](_0x3a04ee+'\x20'+a31_0x437b86[_0xaaae20(0x31c)](_0x54f9df[_0xaaae20(0x296)])+_0x36981e),console[_0xaaae20(0x2ef)]('\x20\x20'+a31_0x437b86[_0xaaae20(0x358)](_0xaaae20(0x3ac))+'\x20'+a31_0x437b86['bold'](_0x54f9df[_0xaaae20(0x253)]+'.'+_0x54f9df[_0xaaae20(0x30d)]));const _0x2ed24c=_0x54f9df[_0xaaae20(0x3b4)]===_0x54f9df[_0xaaae20(0x2de)]?a31_0x437b86[_0xaaae20(0x358)](_0xaaae20(0x3a8))+'\x20'+_0x54f9df[_0xaaae20(0x3b4)]:a31_0x437b86[_0xaaae20(0x358)]('Join:')+'\x20'+_0x54f9df[_0xaaae20(0x3b4)]+_0xaaae20(0x2e2)+_0x54f9df[_0xaaae20(0x2de)];console['error']('\x20\x20'+_0x2ed24c),console[_0xaaae20(0x2ef)]('\x20\x20'+a31_0x437b86[_0xaaae20(0x358)](_0xaaae20(0x29d))),this[_0xaaae20(0x20e)](_0x54f9df[_0xaaae20(0x34d)]),!_0x54f9df['schemaValid']&&console[_0xaaae20(0x2ef)]('\x20\x20'+a31_0x437b86[_0xaaae20(0x1bb)](_0xaaae20(0x30c))+'\x20'+_0x54f9df['schemaError']);}}[a31_0x33df17(0x20e)](_0x71a37){const _0x577356=a31_0x33df17;for(const _0x4caf51 of _0x71a37){_0x4caf51[_0x577356(0x1ee)]===_0x4caf51[_0x577356(0x3b6)]||_0x4caf51['column']==='*'?console[_0x577356(0x2ef)](_0x577356(0x229)+_0x4caf51['label']):console[_0x577356(0x2ef)](_0x577356(0x229)+_0x4caf51[_0x577356(0x1ee)]+'\x20'+a31_0x437b86[_0x577356(0x358)]('('+_0x4caf51['column']+')'));}}[a31_0x33df17(0x307)](_0x321ff7){const _0x479288=a31_0x33df17;console[_0x479288(0x2ef)]('─'['repeat'](0x3c));if(_0x321ff7[_0x479288(0x245)][_0x479288(0x2e9)]>0x0){console[_0x479288(0x2ef)]('\x0a'+a31_0x437b86[_0x479288(0x1bb)]('Errors:'));for(const _0x4c7b9a of _0x321ff7[_0x479288(0x245)]){console[_0x479288(0x2ef)]('\x20\x20'+a31_0x437b86['red']('•')+'\x20'+_0x4c7b9a);}}_0x321ff7[_0x479288(0x324)]&&console[_0x479288(0x2ef)]('\x0a'+a31_0x437b86[_0x479288(0x292)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x33df17(0x296)]='segment:parent:preview';[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2b2);async[a31_0x33df17(0x29e)](_0x5ca351){const _0x55584d=a31_0x33df17,{options:_0x325608,args:_0x429b44,tdx:_0x3831e1}=_0x5ca351,_0x342c80=_0x325608,_0x4ea343=_0x429b44[0x0]||_0x325608['parentSegment'];if(!_0x4ea343)return showParentSegmentNotSetError(_0x55584d(0x3b5)+_0x55584d(0x348)+'Options\x20(one\x20required):\x0a'+_0x55584d(0x337)+_0x55584d(0x1ec)+_0x55584d(0x1c5)+_0x55584d(0x218)+_0x55584d(0x212)),0x1;if(!_0x342c80[_0x55584d(0x211)]&&!_0x342c80['attribute']&&!_0x342c80[_0x55584d(0x1d0)]&&!_0x342c80[_0x55584d(0x205)])return console['error'](a31_0x437b86[_0x55584d(0x1bb)](_0x55584d(0x216))),console[_0x55584d(0x2ef)](_0x55584d(0x34f)),console[_0x55584d(0x2ef)](_0x55584d(0x27f)),console[_0x55584d(0x2ef)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x55584d(0x2ef)](_0x55584d(0x3c0)),console[_0x55584d(0x2ef)](_0x55584d(0x2a9)),console[_0x55584d(0x2ef)](_0x55584d(0x384)),0x1;const _0x50d0a7=resolveYamlFile(_0x4ea343);if(!existsSync(_0x50d0a7))return showFileNotFoundError(_0x50d0a7,_0x4ea343),0x1;_0x342c80[_0x55584d(0x1a0)]&&(console['error']('Site:\x20'+_0x342c80[_0x55584d(0x24d)]),console['error']('YAML\x20file:\x20'+_0x50d0a7));let _0x178785;try{_0x178785=readFileSync(_0x50d0a7,_0x55584d(0x2e6));}catch(_0x15e607){const _0x2dfd9f=_0x15e607 instanceof Error?_0x15e607[_0x55584d(0x367)]:String(_0x15e607);return console[_0x55584d(0x2ef)]('Error\x20reading\x20file:\x20'+_0x2dfd9f),0x1;}let _0x5e14e0;try{_0x5e14e0=parseDef(_0x178785);}catch(_0x48a3af){const _0x47f2d5=_0x48a3af instanceof Error?_0x48a3af[_0x55584d(0x367)]:String(_0x48a3af);return console['error'](a31_0x437b86['red'](_0x55584d(0x24c)+_0x47f2d5)),0x1;}if(_0x342c80[_0x55584d(0x39c)]===!![]||_0x342c80[_0x55584d(0x39c)]===''){const _0x531d92=_0x5e14e0['attributes']?.[_0x55584d(0x1f7)](_0x3d98b7=>_0x3d98b7['name'])||[];if(_0x531d92['length']===0x0)console[_0x55584d(0x2ef)](a31_0x437b86[_0x55584d(0x1bb)](_0x55584d(0x1a8)));else{console[_0x55584d(0x2ef)](a31_0x437b86['red'](_0x55584d(0x2d8))),console['error']('Available\x20attributes:');for(const _0x24392f of _0x531d92){console[_0x55584d(0x2ef)]('\x20\x20'+a31_0x437b86[_0x55584d(0x269)](_0x24392f));}console[_0x55584d(0x2ef)](_0x55584d(0x278)+_0x4ea343+_0x55584d(0x1b3)+_0x531d92[0x0]+'\x22');}return 0x1;}if(_0x342c80[_0x55584d(0x1d0)]===!![]||_0x342c80['behavior']===''){const _0x429e52=_0x5e14e0[_0x55584d(0x308)]?.[_0x55584d(0x1f7)](_0x3e5426=>_0x3e5426[_0x55584d(0x296)])||[];if(_0x429e52[_0x55584d(0x2e9)]===0x0)console[_0x55584d(0x2ef)](a31_0x437b86[_0x55584d(0x1bb)](_0x55584d(0x2d0)));else{console['error'](a31_0x437b86[_0x55584d(0x1bb)](_0x55584d(0x1b6))),console[_0x55584d(0x2ef)](_0x55584d(0x3a2));for(const _0x6f1888 of _0x429e52){console[_0x55584d(0x2ef)]('\x20\x20'+a31_0x437b86['cyan'](_0x6f1888));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x4ea343+_0x55584d(0x2a3)+_0x429e52[0x0]+'\x22');}return 0x1;}const _0x28ed45=createCommandSpinner(a31_0x437b86[_0x55584d(0x358)](_0x55584d(0x321)),{'verbose':_0x342c80[_0x55584d(0x1a0)]});_0x28ed45['start']();const _0x16dae4={'onProgress':_0x2877c6=>{const _0x466106=_0x55584d;_0x28ed45[_0x466106(0x2f5)]=formatProgressMessage(_0x2877c6);}};if(_0x342c80[_0x55584d(0x211)])_0x16dae4['master']=!![];if(_0x342c80[_0x55584d(0x39c)]&&typeof _0x342c80[_0x55584d(0x39c)]==='string')_0x16dae4['attribute']=_0x342c80[_0x55584d(0x39c)];if(_0x342c80[_0x55584d(0x1d0)]&&typeof _0x342c80[_0x55584d(0x1d0)]===_0x55584d(0x3b0))_0x16dae4[_0x55584d(0x1d0)]=_0x342c80['behavior'];if(_0x342c80[_0x55584d(0x205)])_0x16dae4['enriched']=!![];if(_0x342c80[_0x55584d(0x1e7)])_0x16dae4['interval']=_0x342c80[_0x55584d(0x1e7)];let _0x329b0c;try{_0x329b0c=await _0x3831e1[_0x55584d(0x207)][_0x55584d(0x287)](_0x178785,_0x16dae4),_0x28ed45[_0x55584d(0x2a4)]();}catch(_0x1c0c2c){_0x28ed45[_0x55584d(0x2a4)]();throw _0x1c0c2c;}return await this['displayPreviewResults'](_0x329b0c,{'master':_0x342c80[_0x55584d(0x211)],'attribute':typeof _0x342c80[_0x55584d(0x39c)]===_0x55584d(0x3b0)?_0x342c80['attribute']:undefined,'behavior':typeof _0x342c80[_0x55584d(0x1d0)]===_0x55584d(0x3b0)?_0x342c80['behavior']:undefined,'enriched':_0x342c80[_0x55584d(0x205)]}),_0x329b0c[_0x55584d(0x324)]?0x0:0x1;}async[a31_0x33df17(0x251)](_0x463201,_0x3eac55){const _0x51e9e4=a31_0x33df17;console[_0x51e9e4(0x2ef)]('\x0a'+a31_0x437b86['bold']('Preview:')+'\x20'+_0x463201['name']),console[_0x51e9e4(0x2ef)]('═'[_0x51e9e4(0x1ea)](0x3c));if(_0x3eac55[_0x51e9e4(0x211)]&&_0x463201[_0x51e9e4(0x2c4)]){const _0x2c37de=a31_0x437b86['dim'](_0x51e9e4(0x347))+'\x20'+a31_0x437b86['bold'](_0x463201[_0x51e9e4(0x211)][_0x51e9e4(0x253)]+'.'+_0x463201[_0x51e9e4(0x211)][_0x51e9e4(0x30d)]);await this[_0x51e9e4(0x37d)](_0x2c37de,_0x463201[_0x51e9e4(0x2c4)]);}else{if(_0x3eac55[_0x51e9e4(0x39c)]&&_0x463201[_0x51e9e4(0x2c4)]){const _0x30b32a=a31_0x437b86[_0x51e9e4(0x358)](_0x51e9e4(0x2ff))+'\x20'+a31_0x437b86[_0x51e9e4(0x31c)](_0x3eac55[_0x51e9e4(0x39c)]);await this[_0x51e9e4(0x37d)](_0x30b32a,_0x463201[_0x51e9e4(0x2c4)]);}else{if(_0x3eac55[_0x51e9e4(0x1d0)]&&_0x463201['sampleData']){const _0xfed5a3=a31_0x437b86[_0x51e9e4(0x358)](_0x51e9e4(0x294))+'\x20'+a31_0x437b86[_0x51e9e4(0x31c)](_0x3eac55[_0x51e9e4(0x1d0)]);await this[_0x51e9e4(0x37d)](_0xfed5a3,_0x463201['sampleData']);}else{if(_0x3eac55[_0x51e9e4(0x205)]&&_0x463201[_0x51e9e4(0x2c4)]){const _0x3cd03a=a31_0x437b86['dim']('Enriched:')+'\x20'+a31_0x437b86['bold'](_0x51e9e4(0x1ba));await this[_0x51e9e4(0x37d)](_0x3cd03a,_0x463201[_0x51e9e4(0x2c4)]);}else!_0x463201[_0x51e9e4(0x2c4)]&&console['error']('\x0aNo\x20sample\x20data\x20available');}}}if(_0x463201[_0x51e9e4(0x245)][_0x51e9e4(0x2e9)]>0x0){console['error']('─'[_0x51e9e4(0x1ea)](0x3c)),console[_0x51e9e4(0x2ef)]('\x0a'+a31_0x437b86[_0x51e9e4(0x1bb)]('Errors:'));for(const _0x54b566 of _0x463201['errors']){console[_0x51e9e4(0x2ef)]('\x20\x20'+a31_0x437b86[_0x51e9e4(0x1bb)]('•')+'\x20'+_0x54b566);}}}async[a31_0x33df17(0x37d)](_0x3bafe2,_0x4151c6){const _0x1ba5d0=a31_0x33df17;if(_0x4151c6['length']===0x0){console[_0x1ba5d0(0x2ef)]('\x0a'+_0x3bafe2),console[_0x1ba5d0(0x2ef)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x1ba5d0(0x2ef)]('\x0a'+_0x3bafe2);const _0x429278=Object[_0x1ba5d0(0x2ad)](_0x4151c6[0x0])['map'](_0x4946ab=>({'name':_0x4946ab,'type':typeof _0x4151c6[0x0][_0x4946ab]===_0x1ba5d0(0x397)?_0x1ba5d0(0x1b0):'varchar'})),_0x28f3d7={'queryId':_0x1ba5d0(0x1b1),'columns':_0x429278,'data':_0x4151c6,'stats':{'state':_0x1ba5d0(0x38f),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4151c6[_0x1ba5d0(0x2e9)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x39b602=formatAsTable(_0x28f3d7,_0x4151c6['length'],!![]);await writeOutput(_0x39b602,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a31_0x33df17(0x37a);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2a8);async['execute'](_0x18c641){const _0x57e068=a31_0x33df17,{options:_0x86de41,args:_0x15b124,tdx:_0x4781c0}=_0x18c641,_0x271f25=_0x86de41,_0x7fd9aa=_0x15b124[0x0]||_0x86de41[_0x57e068(0x2dd)];if(!_0x7fd9aa)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+_0x57e068(0x325)),0x1;const _0x3628bb=resolveYamlFile(_0x7fd9aa);if(existsSync(_0x3628bb)){_0x271f25[_0x57e068(0x1a0)]&&console[_0x57e068(0x2ef)]('Found\x20YAML\x20file:\x20'+_0x3628bb);let _0x6222a6;try{_0x6222a6=readFileSync(_0x3628bb,_0x57e068(0x2e6));}catch(_0x45b90d){const _0x1046f9=_0x45b90d instanceof Error?_0x45b90d[_0x57e068(0x367)]:String(_0x45b90d);return console[_0x57e068(0x2ef)]('Error\x20reading\x20file:\x20'+_0x1046f9),0x1;}const _0x5840ee=await withSpinner(_0x57e068(0x2d7),()=>_0x4781c0['segment'][_0x57e068(0x27d)](_0x6222a6),{'verbose':_0x271f25[_0x57e068(0x1a0)]}),_0x552383=_0x5840ee[_0x57e068(0x1a1)],{isNew:_0x2cc9e2,name:_0xb3edda,hasChanges:_0x5667cd,diffFormatted:_0x372c25}=_0x552383;if(_0x5667cd){_0x2cc9e2?console[_0x57e068(0x2ef)](_0x57e068(0x28e)+_0xb3edda+'\x27:'):console[_0x57e068(0x2ef)](_0x57e068(0x353)+_0xb3edda+'\x27:');console['error']('─'[_0x57e068(0x1ea)](0x3c)),console[_0x57e068(0x2ef)](_0x372c25),console['error']('─'[_0x57e068(0x1ea)](0x3c));const _0x1bdb5c=_0x2cc9e2?'Create\x20parent\x20segment\x20\x27'+_0xb3edda+_0x57e068(0x276):_0x57e068(0x31e)+_0xb3edda+'\x27\x20and\x20run\x20workflow?';if(!_0x271f25[_0x57e068(0x32e)]){if(!isInteractive())return console[_0x57e068(0x2ef)](a31_0x437b86['red'](_0x57e068(0x340)),_0x57e068(0x3ab)),console['error'](a31_0x437b86[_0x57e068(0x358)](_0x57e068(0x262))),0x1;const _0x20b961=await confirmKey(_0x1bdb5c);if(!_0x20b961)return console[_0x57e068(0x2ef)](a31_0x437b86[_0x57e068(0x2e5)](_0x57e068(0x20d))),0x1;}const _0x1cd9ef=_0x2cc9e2?_0x57e068(0x27c):_0x57e068(0x231);await withSpinner(_0x1cd9ef+_0x57e068(0x360)+_0xb3edda+_0x57e068(0x335),()=>_0x552383['apply'](),{'verbose':_0x271f25[_0x57e068(0x1a0)]});const _0x11f524=_0x2cc9e2?_0x57e068(0x1d2):_0x57e068(0x25d);console[_0x57e068(0x2ef)]('✔\x20'+_0x11f524+_0x57e068(0x360)+_0xb3edda+'\x27');}else console[_0x57e068(0x2ef)](_0x57e068(0x1d8)+_0xb3edda+_0x57e068(0x2ab));}const _0x10ed60=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x7fd9aa+_0x57e068(0x335),()=>_0x4781c0[_0x57e068(0x207)][_0x57e068(0x310)](_0x7fd9aa),{'verbose':_0x271f25[_0x57e068(0x1a0)]}),_0x3f9852=_0x10ed60['data'],_0x664073=getConsoleUrl(_0x271f25['site'],_0x57e068(0x267)+_0x3f9852[_0x57e068(0x21d)]+_0x57e068(0x37f)+_0x3f9852[_0x57e068(0x3be)]+_0x57e068(0x339)+_0x3f9852[_0x57e068(0x255)]);return console[_0x57e068(0x2ef)](_0x57e068(0x376)),console['error']('\x20\x20'+a31_0x437b86['dim'](_0x57e068(0x35f))+'\x20'+_0x3f9852[_0x57e068(0x2fd)]),console[_0x57e068(0x2ef)]('\x20\x20'+a31_0x437b86[_0x57e068(0x358)](_0x57e068(0x232))+'\x20'+_0x3f9852[_0x57e068(0x26f)]),console[_0x57e068(0x2ef)]('\x20\x20'+a31_0x437b86[_0x57e068(0x358)](_0x57e068(0x2fe))+'\x20'+_0x3f9852[_0x57e068(0x3be)]),console[_0x57e068(0x2ef)]('\x20\x20'+a31_0x437b86['dim'](_0x57e068(0x2d3))+'\x20'+_0x3f9852[_0x57e068(0x255)]),console[_0x57e068(0x2ef)]('\x20\x20'+_0x664073),console[_0x57e068(0x2ef)]('\x0a'+a31_0x437b86[_0x57e068(0x358)](_0x57e068(0x1d7))+_0x57e068(0x1a5)+_0x3f9852[_0x57e068(0x255)]+_0x57e068(0x1ce)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x33df17(0x296)]='segment:parent:fields';[a31_0x33df17(0x2fa)]=a31_0x33df17(0x1a4);async[a31_0x33df17(0x29e)](_0x6e6f74){const _0x4aff01=a31_0x33df17,{options:_0x527135,args:_0x27e501,tdx:_0xc9bc94}=_0x6e6f74,_0xa33d5c=_0x27e501[0x0]||_0x527135[_0x4aff01(0x2dd)];if(!_0xa33d5c)return showParentSegmentNotSetError(_0x4aff01(0x299)+_0x4aff01(0x1d5)),0x1;_0x527135[_0x4aff01(0x1a0)]&&(console[_0x4aff01(0x2ef)]('Site:\x20'+_0x527135[_0x4aff01(0x24d)]),console['error'](_0x4aff01(0x29f)+_0xa33d5c));const _0xade800=await withSpinner(_0x4aff01(0x2cc)+_0xa33d5c+_0x4aff01(0x335),()=>_0xc9bc94[_0x4aff01(0x207)]['listFields'](_0xa33d5c),{'verbose':_0x527135['verbose']}),_0x201e22=_0xade800[_0x4aff01(0x1a1)];console[_0x4aff01(0x2ef)](_0x4aff01(0x396)+_0x201e22[_0x4aff01(0x2e9)]+_0x4aff01(0x3a1)+(_0x201e22[_0x4aff01(0x2e9)]!==0x1?'s':''));if(_0x527135[_0x4aff01(0x2c3)]||_0x527135[_0x4aff01(0x33b)])return await handleSDKOutput(_0x201e22,_0x527135),0x0;return displayFieldsHumanReadable(_0x201e22,_0xa33d5c),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x2f0);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2f7);async[a31_0x33df17(0x29e)](_0x1c6081){const _0x1d5139=a31_0x33df17,{options:_0x3e2a2d,args:_0x1261b9,tdx:_0x2003a2}=_0x1c6081,_0x4296e4=_0x3e2a2d,_0x2e459d=_0x1261b9[0x0]||_0x3e2a2d[_0x1d5139(0x2dd)];if(!_0x2e459d)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'+_0x1d5139(0x286)+'Options:\x0a'+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x3e2a2d[_0x1d5139(0x1a0)]&&(console[_0x1d5139(0x2ef)](_0x1d5139(0x368)+_0x3e2a2d['site']),console[_0x1d5139(0x2ef)]('Parent\x20segment:\x20'+_0x2e459d));const _0x31d03d=await withSpinner(_0x1d5139(0x394)+_0x2e459d+_0x1d5139(0x335),()=>_0x2003a2['segment'][_0x1d5139(0x318)](_0x2e459d),{'verbose':_0x3e2a2d[_0x1d5139(0x1a0)]}),_0x2000d2=_0x31d03d[_0x1d5139(0x1a1)];if(_0x4296e4[_0x1d5139(0x37b)]){const _0x2f34dc=getConsoleNextUrl(_0x4296e4['site'],_0x1d5139(0x201)+_0x2000d2['id']);return console[_0x1d5139(0x2ef)](a31_0x437b86['green']('✔')+_0x1d5139(0x239)+a31_0x437b86['cyan'](_0x2f34dc)),openBrowser(_0x2f34dc),0x0;}return await handleSingleObjectOutput(_0x2000d2,_0x3e2a2d),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x33df17(0x296)]='segment:parent:desc';['description']=a31_0x33df17(0x21b);async['execute'](_0x3c0ce6){const _0x230a99=a31_0x33df17,{options:_0x309d4c,args:_0x4b54d1,tdx:_0x22575d}=_0x3c0ce6,_0x382d4c=_0x309d4c,_0x1837e9=_0x4b54d1[0x0]||_0x309d4c[_0x230a99(0x2dd)];if(!_0x1837e9)return showParentSegmentNotSetError(_0x230a99(0x266)+_0x230a99(0x2b5)+_0x230a99(0x238)+_0x230a99(0x374)),0x1;_0x309d4c[_0x230a99(0x1a0)]&&(console['error'](_0x230a99(0x368)+_0x309d4c[_0x230a99(0x24d)]),console[_0x230a99(0x2ef)]('Parent\x20segment:\x20'+_0x1837e9));const _0x53ad77=await withSpinner(_0x230a99(0x221)+_0x1837e9+_0x230a99(0x335),()=>_0x22575d[_0x230a99(0x207)][_0x230a99(0x1fc)](_0x1837e9),{'verbose':_0x309d4c['verbose']}),_0x156c9e=_0x53ad77['data'],_0x406b40=_0x22575d[_0x230a99(0x207)]['getOutputDatabaseName'](_0x156c9e);if(_0x382d4c['output']){const _0x2f41ac=await this[_0x230a99(0x265)](_0x3c0ce6,_0x1837e9,_0x156c9e,_0x406b40),_0x2d5227=this[_0x230a99(0x235)](_0x2f41ac);writeFileSync(_0x382d4c['output'],_0x2d5227);const _0x10f987=_0x2f41ac[_0x230a99(0x1b2)][_0x230a99(0x34d)][_0x230a99(0x2e9)]+_0x2f41ac[_0x230a99(0x308)][_0x230a99(0x1df)]((_0x3dbc9e,_0x2417b0)=>_0x3dbc9e+_0x2417b0[_0x230a99(0x34d)][_0x230a99(0x2e9)],0x0),_0x39c012=_0x2f41ac[_0x230a99(0x308)][_0x230a99(0x315)](_0x3cac7b=>_0x3cac7b[_0x230a99(0x34d)][_0x230a99(0x2e9)]===0x0)['length'];return console[_0x230a99(0x2c2)]('Schema\x20saved\x20to\x20'+_0x382d4c[_0x230a99(0x233)]),console[_0x230a99(0x2c2)](_0x230a99(0x22d)+_0x406b40),console[_0x230a99(0x2c2)](_0x230a99(0x2ba)+_0x2f41ac[_0x230a99(0x308)][_0x230a99(0x2e9)]+_0x230a99(0x322)),console[_0x230a99(0x2c2)](_0x230a99(0x25f)+_0x10f987+_0x230a99(0x2b6)),_0x39c012>0x0&&console[_0x230a99(0x2c2)](_0x230a99(0x263)+_0x39c012+_0x230a99(0x209)),0x0;}console[_0x230a99(0x2ef)]('\x0a'+a31_0x437b86[_0x230a99(0x31c)](_0x230a99(0x2ae))+'\x20'+a31_0x437b86['cyan'](_0x406b40));const _0x37d3e1=await withSpinner(_0x230a99(0x304),()=>_0x22575d[_0x230a99(0x207)][_0x230a99(0x334)](_0x156c9e),{'verbose':_0x309d4c[_0x230a99(0x1a0)]});console[_0x230a99(0x2ef)]('\x0a'+a31_0x437b86[_0x230a99(0x31c)](_0x230a99(0x1b2))+'\x20'+a31_0x437b86['dim']('('+_0x406b40+_0x230a99(0x390)));const _0x5c6408=await executeSchemaQuery(_0x37d3e1[_0x230a99(0x1a1)],_0x22575d,_0x309d4c);await handleQueryOutput(_0x5c6408,_0x309d4c);const _0x192f3c=await withSpinner(_0x230a99(0x214),()=>_0x22575d[_0x230a99(0x207)][_0x230a99(0x270)](_0x156c9e),{'verbose':_0x309d4c['verbose']});for(const _0x546672 of _0x192f3c[_0x230a99(0x1a1)]){const _0x3aafdb=_0x230a99(0x1f5)+_0x546672[_0x230a99(0x242)]()[_0x230a99(0x341)](/\s+/g,'_'),_0x2e0630=_0x230a99(0x25b)+_0x406b40+'.'+_0x3aafdb;console['error']('\x0a'+a31_0x437b86['bold'](_0x546672)+'\x20'+a31_0x437b86['dim']('('+_0x406b40+'.'+_0x3aafdb+')'));try{const _0x357b6e=await executeSchemaQuery(_0x2e0630,_0x22575d,_0x309d4c);await handleQueryOutput(_0x357b6e,_0x309d4c);}catch{console[_0x230a99(0x2ef)](a31_0x437b86[_0x230a99(0x2e5)](_0x230a99(0x370)));}}return 0x0;}async[a31_0x33df17(0x265)](_0x2a5d1d,_0x4a91fc,_0x26e889,_0x208b6c){const _0x4d6f47=a31_0x33df17,{options:_0xa17f45,tdx:_0x2ea480}=_0x2a5d1d,_0x3e822c=await withSpinner(_0x4d6f47(0x304),()=>_0x2ea480[_0x4d6f47(0x207)][_0x4d6f47(0x334)](_0x26e889),{'verbose':_0xa17f45[_0x4d6f47(0x1a0)]}),_0x2f5ca2=await executeSchemaQuery(_0x3e822c[_0x4d6f47(0x1a1)],_0x2ea480,_0xa17f45),_0x3b2ced=_0x2f5ca2['data'][_0x4d6f47(0x1f7)](_0x43e753=>({'name':_0x43e753[_0x4d6f47(0x22e)],'type':_0x43e753['column_type']})),_0x98d59a=await withSpinner(_0x4d6f47(0x214),()=>_0x2ea480[_0x4d6f47(0x207)]['getBehaviorNames'](_0x26e889),{'verbose':_0xa17f45[_0x4d6f47(0x1a0)]}),_0x235be1=[];for(const _0x45873b of _0x98d59a[_0x4d6f47(0x1a1)]){const _0x5c078f=_0x4d6f47(0x1f5)+_0x45873b[_0x4d6f47(0x242)]()['replace'](/\s+/g,'_'),_0xde6f78=_0x4d6f47(0x25b)+_0x208b6c+'.'+_0x5c078f;let _0x58ce88=[];try{const _0xdc2cbb=await executeSchemaQuery(_0xde6f78,_0x2ea480,_0xa17f45);_0x58ce88=_0xdc2cbb[_0x4d6f47(0x1a1)][_0x4d6f47(0x1f7)](_0x593900=>({'name':_0x593900[_0x4d6f47(0x22e)],'type':_0x593900[_0x4d6f47(0x27b)]}));}catch{}_0x235be1[_0x4d6f47(0x277)]({'table':_0x5c078f,'columns':_0x58ce88});}return{'database':_0x208b6c,'parent_segment':_0x4a91fc,'parent_id':_0x26e889,'customers':{'table':_0x4d6f47(0x1b2),'columns':_0x3b2ced},'behaviors':_0x235be1};}[a31_0x33df17(0x235)](_0x590514){const _0x3158d3=a31_0x33df17,_0x1bc592=_0x5cdf9b=>{const _0x585bee=a31_0x26a5;if(_0x5cdf9b[_0x585bee(0x2e9)]===0x0)return'[]';const _0x2e0cfc=_0x5cdf9b['map'](_0x12173d=>_0x585bee(0x1cd)+_0x12173d[_0x585bee(0x296)]+_0x585bee(0x1f2)+_0x12173d[_0x585bee(0x34e)]+'\x22\x20}');return'[\x0a'+_0x2e0cfc[_0x585bee(0x1d3)](',\x0a')+_0x585bee(0x1e0);},_0x24e8b0=_0x590514[_0x3158d3(0x308)][_0x3158d3(0x1f7)](_0x21f769=>{const _0x3fd4a3=_0x3158d3;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x21f769[_0x3fd4a3(0x30d)]+_0x3fd4a3(0x26d)+_0x1bc592(_0x21f769[_0x3fd4a3(0x34d)])['replace'](/^/gm,'\x20\x20')[_0x3fd4a3(0x364)]()+_0x3fd4a3(0x302);})[_0x3158d3(0x1d3)](',\x0a');return _0x3158d3(0x223)+_0x590514[_0x3158d3(0x253)]+_0x3158d3(0x21c)+_0x590514[_0x3158d3(0x38d)]+_0x3158d3(0x222)+_0x590514['parent_id']+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x590514['customers'][_0x3158d3(0x30d)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x1bc592(_0x590514[_0x3158d3(0x1b2)]['columns'])[_0x3158d3(0x341)](/^/gm,'\x20\x20')[_0x3158d3(0x364)]()+_0x3158d3(0x243)+_0x24e8b0+_0x3158d3(0x2c1);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x1d6);[a31_0x33df17(0x2fa)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a31_0x33df17(0x29e)](_0x4be00d){const _0x4dba22=a31_0x33df17,{options:_0x460adc,args:_0x5eeab5,tdx:_0x4e1f6c}=_0x4be00d,_0x33b824=_0x5eeab5[0x0]||_0x460adc['parentSegment'];if(!_0x33b824)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x4dba22(0x236)),0x1;_0x460adc[_0x4dba22(0x1a0)]&&(console[_0x4dba22(0x2ef)](_0x4dba22(0x368)+_0x460adc[_0x4dba22(0x24d)]),console[_0x4dba22(0x2ef)](_0x4dba22(0x29f)+_0x33b824));const _0x38da07=await withSpinner(_0x4dba22(0x221)+_0x33b824+_0x4dba22(0x335),()=>_0x4e1f6c[_0x4dba22(0x207)]['resolveParentId'](_0x33b824),{'verbose':_0x460adc['verbose']}),_0x5165cd=_0x38da07[_0x4dba22(0x1a1)],_0x1f3e61=await withSpinner(_0x4dba22(0x338)+_0x33b824+_0x4dba22(0x335),()=>_0x4e1f6c[_0x4dba22(0x207)][_0x4dba22(0x334)](_0x5165cd),{'verbose':_0x460adc[_0x4dba22(0x1a0)]}),_0x211a97=_0x1f3e61[_0x4dba22(0x1a1)];return _0x460adc[_0x4dba22(0x1f3)]===_0x4dba22(0x2c3)||_0x460adc['format']==='jsonl'?await handleSDKOutput([{'sql':_0x211a97}],_0x460adc):console[_0x4dba22(0x2c2)](_0x211a97),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a31_0x33df17(0x320);['description']='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x33df17(0x29e)](_0xa736e4){const _0x1f1a49=a31_0x33df17,{options:_0xa1fdb9,args:_0x518297,tdx:_0xae6d6f}=_0xa736e4,_0x1ec067=_0x518297[0x0]||_0xa1fdb9['parentSegment'];if(!_0x1ec067)return showParentSegmentNotSetError(_0x1f1a49(0x2cf)+_0x1f1a49(0x290)),0x1;_0xa1fdb9[_0x1f1a49(0x1a0)]&&(console[_0x1f1a49(0x2ef)](_0x1f1a49(0x368)+_0xa1fdb9['site']),console[_0x1f1a49(0x2ef)]('Parent\x20segment:\x20'+_0x1ec067));const _0x35d675=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1ec067+_0x1f1a49(0x335),()=>_0xae6d6f[_0x1f1a49(0x207)][_0x1f1a49(0x1fc)](_0x1ec067),{'verbose':_0xa1fdb9[_0x1f1a49(0x1a0)]}),_0x1795f5=_0x35d675[_0x1f1a49(0x1a1)],_0x46ca65=await withSpinner(_0x1f1a49(0x338)+_0x1ec067+'\x27...',()=>_0xae6d6f['segment']['getParentSQL'](_0x1795f5),{'verbose':_0xa1fdb9[_0x1f1a49(0x1a0)]});let _0x5e3051=_0x46ca65['data'];const _0x4a59b9=resolveLimit(_0xa1fdb9['limit'],DEFAULT_DISPLAY_LIMIT),_0x3b7d25=/\bLIMIT\s+\d+/i[_0x1f1a49(0x2d9)](_0x5e3051);!_0x3b7d25&&(_0x5e3051=_0x5e3051['trim']()[_0x1f1a49(0x341)](/;+$/,''),_0x5e3051=_0x1f1a49(0x26e)+_0x5e3051+_0x1f1a49(0x327)+_0x4a59b9);_0xa1fdb9['verbose']&&console[_0x1f1a49(0x2ef)](_0x1f1a49(0x330)+_0x5e3051);const _0x2356f6=await withProgressSpinner(_0x1f1a49(0x2e1),async _0x124ac4=>{const _0x135906=_0x1f1a49,_0x15eb99=await _0xae6d6f[_0x135906(0x2b3)][_0x135906(0x29e)](_0x5e3051,{'catalog':'td','schema':_0x135906(0x31a),'onJobId':_0x23d211=>{_0x124ac4['setJobId'](_0x23d211);}});return _0x15eb99;},{'verbose':_0xa1fdb9[_0x1f1a49(0x1a0)]}),_0x30c5dd=_0x2356f6[_0x1f1a49(0x1a1)],_0x1c3d52=_0x30c5dd[_0x1f1a49(0x23b)]?_0x1f1a49(0x25c)+_0x30c5dd[_0x1f1a49(0x23b)]+']':'';return console['error'](_0x1f1a49(0x1dc)+_0x30c5dd[_0x1f1a49(0x3b1)][_0x1f1a49(0x3a9)][_0x1f1a49(0x2d5)]()+'\x20rows\x20'+(_0x1f1a49(0x312)+formatElapsed(_0x30c5dd[_0x1f1a49(0x3b1)][_0x1f1a49(0x392)])+_0x1c3d52)),await handleQueryOutput(_0x30c5dd,_0xa1fdb9),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x298);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x247);async['execute'](_0x2e9c34){const _0x3c1c97=a31_0x33df17,{options:_0x50dfad,args:_0x39bd84,tdx:_0x229593}=_0x2e9c34,_0x20aebe=_0x39bd84[0x0],_0x5bf5c5=await withSpinner(_0x20aebe?'Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27'+_0x20aebe+_0x3c1c97(0x335):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x229593[_0x3c1c97(0x3bb)][_0x3c1c97(0x288)](),{'verbose':_0x50dfad[_0x3c1c97(0x1a0)]});let _0x18315b=_0x5bf5c5['data']['filter'](_0x511cf2=>_0x511cf2['realtime_enabled']);if(_0x20aebe){const _0x25254b=_0x20aebe[_0x3c1c97(0x341)](/[.+^${}()|[\]\\]/g,_0x3c1c97(0x2bf))[_0x3c1c97(0x341)](/\*/g,'.*')[_0x3c1c97(0x341)](/\?/g,'.'),_0x545ad3=new RegExp('^'+_0x25254b+'$','i');_0x18315b=_0x18315b[_0x3c1c97(0x315)](_0x48bad7=>_0x545ad3[_0x3c1c97(0x2d9)](_0x48bad7['name']));}_0x18315b['sort']((_0x3a3d55,_0x2cc74d)=>_0x3a3d55[_0x3c1c97(0x296)][_0x3c1c97(0x35d)](_0x2cc74d[_0x3c1c97(0x296)])),console[_0x3c1c97(0x2ef)]('✔\x20Found\x20'+_0x18315b[_0x3c1c97(0x2e9)]+_0x3c1c97(0x1c1)+(_0x18315b[_0x3c1c97(0x2e9)]!==0x1?'s':''));const _0x5e481f=_0x5254c8=>{const _0x33d2d5=_0x3c1c97;return getConsoleNextUrl(_0x50dfad[_0x33d2d5(0x24d)],'/app/dw/parentSegments/'+_0x5254c8);};if(_0x50dfad['format']===_0x3c1c97(0x2c3)||_0x50dfad[_0x3c1c97(0x1f3)]===_0x3c1c97(0x33b)){const _0x4d4e57=_0x18315b[_0x3c1c97(0x1f7)](_0x565095=>({..._0x565095,'url':_0x5e481f(_0x565095['id'])}));await handleSDKOutput(_0x4d4e57,_0x50dfad);}else{if(_0x18315b['length']===0x0)console[_0x3c1c97(0x2c2)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x3b2f18 of _0x18315b){const _0x43ad11=_0x3b2f18[_0x3c1c97(0x1eb)]?a31_0x437b86[_0x3c1c97(0x358)]('\x20('+formatRows(_0x3b2f18[_0x3c1c97(0x1eb)])+')'):'',_0xcf08f3=hyperlink(_0x3b2f18[_0x3c1c97(0x296)],_0x5e481f(_0x3b2f18['id']));console[_0x3c1c97(0x2c2)]('⚡\x20'+_0xcf08f3+_0x43ad11);}}return 0x0;}}function a31_0x9269(){const _0x551de3=['tdx\x20ps\x20preview\x20','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Error:\x20Token\x20ID\x20is\x20required','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','coveragePercent','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','workflowId','\x20Added\x20personalization\x20template\x20to\x20','.yaml','/\x20directories\x20exist.','Resolving\x20parent\x20segment\x20\x27','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','{\x0a\x20\x20\x22database\x22:\x20\x22','segment:parent:create','delete','\x20+\x20[','parent_segments','behaviorsFile','\x20\x20\x20\x20-\x20','Error:\x20--name\x20is\x20required','Personalization\x20service\x20description','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x20Database:\x20','column_name','entryCriteria','token:','Updating','Status:','output','✔\x20Found\x20personalization\x20\x27','formatSchemaJson','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Options:\x0a','\x20Opening\x20','segment:parent:validate','jobId','primaryKey','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','No\x20personalizations\x20configured','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','\x27\x20is\x20already\x20up\x20to\x20date','last_page_viewed','toLowerCase','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\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','errors','✔\x20Created\x20personalization\x20service\x20\x27','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','patchPersonalization','start','all','displayRealtimeInfo','Error\x20parsing\x20YAML:\x20','site','identifier','2494053kZulfR','value','displayPreviewResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','database','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','workflowAttemptId','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','payload','Fetching\x20personalization\x20service\x20\x27','folderId','Error:\x20Service\x20ID\x20is\x20required','SELECT\x20*\x20FROM\x20','\x20[Job\x20ID:\x20','Updated','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20Columns:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','customersWithEvents','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Note:\x20','\x20--attribute\x20\x22<name>\x22','collectSchema','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','/app/workflows/','Validating\x20configuration...','cyan','includeSensitive','Create\x20a\x20realtime\x20personalization\x20entity','createParent','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','SELECT\x20*\x20FROM\x20(\x0a','status','getBehaviorNames','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','\x20No\x20changes\x20-\x20','Delete\x20a\x20realtime\x20personalization','\x20RT\x20journey','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','\x27\x20and\x20run\x20workflow?','push','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','ps:rt:jn:pause','column_type','Creating','pushParentYaml','dirname','Options:','any','updatedAt','Deleting\x20token\x20\x27','rowCount','xdg-open','⚡\x20Enabled','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','previewParentYaml','list','My\x20Service','ignore','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','✔\x20Deleted\x20personalization\x20service\x20\x27','createToken','\x0aNew\x20parent\x20segment\x20\x27','ps:pz:list','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','ps:pz:service:list','green','\x27\x20for\x20service\x20\x27','Behavior:','schemaValid','name','✘\x20Failed\x20to\x20rename\x20directory:\x20','ps:rt:list','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','paused','ps:pz:init','(id:\x20','Columns:','execute','Parent\x20segment:\x20','178009uToUmw','30kdATPJ','stringify','\x20--behavior\x20\x22','stop','\x20\x201.\x20Edit\x20','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','allowedIps','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Updating\x20parent\x20segment\x20\x27','\x27\x20is\x20up\x20to\x20date','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','keys','Output\x20Database:','Events:','%)\x20','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','query','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\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','\x20total','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','ps:pz:delete','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x20Tables:\x201\x20customers\x20+\x20','Coverage:','addAttributes','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','\x5c$&','win32','\x0a\x20\x20]\x0a}\x0a','log','json','sampleData','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20--interval\x20','\x20personalization','displayAttributesStats','<database>.<table>','Join:','ps:rt:jn:resume','Listing\x20fields\x20for\x20\x27','`\x20to\x20download\x20the\x20configuration\x20first','339449ElWlgA','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Show\x20personalization\x20service\x20details','Attempt:','unref','toLocaleString','endsWith','Analyzing\x20changes...','Error:\x20--attribute\x20requires\x20a\x20name\x0a','test','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','tokens','parentSegment','foreignKey','\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','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','Executing\x20parent\x20segment\x20query...','\x20=\x20','file','RT\x202.0:','yellow','utf-8','sections','126yVcQJh','length','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','Output\x20file:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','No\x20parent\x20segments\x20found','\x20\x20\x20\x20\x20\x20','error','segment:parent:view','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','ps:pz:patch','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','some','text','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Show\x20parent\x20segment\x20details','List\x20parent\x20segments','ID\x20Stitching:','description','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','customerGroupFile','audienceId','Session:','Attribute:','create','/\x20directory.\x0a','\x0a\x20\x20\x20\x20}','\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','Fetching\x20customers\x20schema...','Behaviors','run','displaySummary','behaviors','.yml','-1d','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','Error:','table','Error\x20reading\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','runParent','ps:pz:create','in\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','darwin','filter','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','state','getParentFull','Name:\x20','information_schema','schemaError','bold','ps:rt:configuration_versions','Apply\x20changes\x20to\x20\x27','Patching\x20personalization\x20\x27','segment:parent:show','Fetching\x20sample\x20data...','\x20behaviors','Creating\x20token\x20\x27','allValid','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','displayMasterInfo','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','stageCount','Validate:','RT\x202.0\x20Validate:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','126vnAhwP','Creating\x20parent\x20segment\x20\x27','yes','audienceId:\x20','SQL\x20query:\x0a','timezone','customerGroup','Listing\x20RT\x20journeys\x20for\x20\x27','getParentSQL','\x27...','validateParentYaml','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Fetching\x20SQL\x20for\x20\x27','/attempt/','sourceTableValid','jsonl','matchedCount','get','sourceTableError','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x0aError:','replace','relationships','\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','Deleting\x20personalization\x20service\x20\x27','Error:\x20File\x20not\x20found:\x20','\x20RT\x20configuration\x20is\x20valid','Master:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','entryCriteria:','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','✔\x20Retrieved\x20RT\x20configuration\x20version','columns','type','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','valid','\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','\x0aChanges\x20to\x20apply\x20to\x20\x27','✔\x20Created\x20parent\x20segment\x20\x27','\x20stage','Listing\x20parent\x20segments...','1778895PVtXzP','dim','\x20--enriched','\x0a⚠️\x20\x20Both\x20','Listing\x20personalizations\x20for\x20\x27','Creating\x20personalization\x20service\x20\x27','localeCompare','idStitching','Audience\x20ID:','\x20parent\x20segment\x20\x27','ps:pz:service:token:delete','id:\x20','\x27\x20with\x20ID:\x20','trim','personalization_services','sections:','message','Site:\x20','Errors:','true','Error:\x20Service\x20name\x20is\x20required','4gaqEMs','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','sort','includeSensitive:','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x20rows)','\x20true','\x20\x20\x20\x20','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','identifier:\x20','\x0a✔\x20Workflow\x20started','scheduleOption','public','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','segment:parent:run','web','createdAt','displaySampleData','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','/sessions/','Default','folder-segment','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','Error:\x20--database\x20and\x20--table\x20are\x20required','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','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','segment:parent:list','RT\x20Journey\x20ID:\x20','Pause\x20activations\x20in\x20an\x20RT\x20journey','resumeJourney','ps:pz:service:delete','parent_segment','open','FINISHED','.customers)','ps:pz:service:show','elapsedTimeMillis','Master\x20Table','Fetching\x20parent\x20segment\x20\x27','ps:pz:show','✔\x20Found\x20','number','ps:pz:service:token:create','payload:','segment:parent:push','ps:rt:jn:list','attribute','attributes','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','\x20configured','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','\x20field','Available\x20behaviors:','✔\x20Created\x20personalization\x20\x27','created:','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','getPersonalization','\x20--behavior\x20\x22<name>\x22','Join\x20on:','processedRows','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Source:','To\x20view\x20sample\x20data:','2692448glWYoW','324drMtHX','string','stats','personalizationServices','\x20parent\x20segment','joinKey','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','column','\x20to\x20configure\x20your\x20personalization\x20service','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','✔\x20Created\x20token\x20\x27','audienceId:','realtime','stitchingKeys','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','workflowSessionId','single','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','ps:rt:validate','verbose','data','split','4kASLZW','List\x20available\x20fields\x20for\x20segmentation','\x20tdx\x20wf\x20attempt\x20','/{name}.yml\x0a','/\x20→\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','page_view','launched','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','platform','222295oPFkOe','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','double','preview','customers','\x20--attribute\x20\x22','null','keyEventCriteria','Error:\x20--behavior\x20requires\x20a\x20name\x0a','totalEvents','keyEventId:','\x0aChanges\x20to\x20\x27','Master\x20+\x20Attributes','red','listParents','pullParentYaml','Creating\x20personalization\x20\x27','\x20to\x20push\x20the\x20configuration','Updating\x20personalization\x20service\x20\x27','\x20RT-enabled\x20parent\x20segment','7yKVxep','pauseJourney','updateParent','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20service(s)\x20configured','Show\x20a\x20specific\x20realtime\x20personalization','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','deleteToken','addBehaviors','allowed\x20IPs:','addAttributesFile','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20kill','\x20(paused)','behavior','personalization','Created','join','attributesFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','segment:parent:sql','To\x20cancel:','✔\x20No\x20changes\x20-\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','events','tdx\x20ps\x20push\x20','✔\x20Query\x20completed:\x20Processed\x20','segment:parent:pull','Deleting\x20personalization\x20\x27','reduce','\x0a\x20\x20\x20\x20]','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','isDirectory','scheduleType','Listing\x20personalization\x20services\x20for\x20\x27','Rows:','interval','customerPercent','1299597PWGFaJ','repeat','population','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','label','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','Database:\x20','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','\x22,\x20\x22type\x22:\x20\x22','format','eventKind','behavior_','realtime:','map','displayPreviewHints','/\x20and\x20','✔\x20Updated\x20parent\x20segment\x20\x27','\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}','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Error:\x20Personalization\x20ID\x20is\x20required','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Update\x20a\x20realtime\x20personalization\x20entity','/app/dw/parentSegments/','Finding\x20service\x20for\x20token...','\x20service','using\x20the\x20default\x20path:\x20','enriched','Table:\x20','segment','displayBehaviorsStats','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','\x20personalization\x20service','\x20\x20\x20\x20\x20\x20\x20\x20','No\x20personalization\x20services\x20configured','Aborted.','displayColumns','⚡\x20Not\x20enabled','toFixed','master','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Fetching\x20behavior\x20list...'];a31_0x9269=function(){return _0x551de3;};return a31_0x9269();}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x3c1);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x1ed);async['execute'](_0x4e9c0d){const _0xdd2b51=a31_0x33df17,{options:_0x35f6ce,args:_0x1f3b0c,tdx:_0xf53c56}=_0x4e9c0d,_0x58719f=_0x1f3b0c[0x0]||_0x35f6ce[_0xdd2b51(0x2dd)];if(!_0x58719f)return showParentSegmentNotSetError(_0xdd2b51(0x275)+_0xdd2b51(0x303)),0x1;const _0x5618b9=resolveYamlFile(_0x58719f);if(!existsSync(_0x5618b9))return showFileNotFoundError(_0x5618b9,_0x58719f),0x1;let _0x12b7d3;try{_0x12b7d3=readFileSync(_0x5618b9,_0xdd2b51(0x2e6));}catch(_0x4bca04){const _0x489fa0=_0x4bca04 instanceof Error?_0x4bca04[_0xdd2b51(0x367)]:String(_0x4bca04);return console[_0xdd2b51(0x2ef)](_0xdd2b51(0x30e)+_0x489fa0),0x1;}const _0x589589=createCommandSpinner(a31_0x437b86[_0xdd2b51(0x358)]('Validating\x20RT\x20configuration...'),{'verbose':_0x35f6ce[_0xdd2b51(0x1a0)]});_0x589589[_0xdd2b51(0x249)]();const _0x15f180={'realtime':!![],'onProgress':_0x50f0af=>{const _0x54db51=_0xdd2b51;_0x589589[_0x54db51(0x2f5)]=formatProgressMessage(_0x50f0af);}};let _0x15ab51;try{_0x15ab51=await _0xf53c56[_0xdd2b51(0x207)][_0xdd2b51(0x336)](_0x12b7d3,_0x15f180),_0x589589[_0xdd2b51(0x2a4)]();}catch(_0xb7f442){_0x589589['stop']();throw _0xb7f442;}console[_0xdd2b51(0x2ef)]('\x0a'+a31_0x437b86[_0xdd2b51(0x31c)](_0xdd2b51(0x32a))+'\x20'+_0x15ab51[_0xdd2b51(0x296)]),console['error']('═'[_0xdd2b51(0x1ea)](0x3c)),displayRealtimeValidation(_0x15ab51),console[_0xdd2b51(0x2ef)]('─'[_0xdd2b51(0x1ea)](0x3c));if(_0x15ab51[_0xdd2b51(0x245)][_0xdd2b51(0x2e9)]>0x0){console[_0xdd2b51(0x2ef)]('\x0a'+a31_0x437b86[_0xdd2b51(0x1bb)](_0xdd2b51(0x369)));for(const _0x4ffbc5 of _0x15ab51['errors']){console[_0xdd2b51(0x2ef)]('\x20\x20'+a31_0x437b86[_0xdd2b51(0x1bb)]('•')+'\x20'+_0x4ffbc5);}}return _0x15ab51[_0xdd2b51(0x324)]&&console[_0xdd2b51(0x2ef)]('\x0a'+a31_0x437b86['green']('✔')+_0xdd2b51(0x346)),_0x15ab51[_0xdd2b51(0x324)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{['name']=a31_0x33df17(0x39b);[a31_0x33df17(0x2fa)]='List\x20RT\x20journeys';async[a31_0x33df17(0x29e)](_0x4ac9b6){const _0x2c94a8=a31_0x33df17,{options:_0x2b7755,args:_0x76fac,tdx:_0x17ee47}=_0x4ac9b6,_0x2af706=_0x76fac[0x0]||_0x2b7755['parentSegment'];if(!_0x2af706)return showParentSegmentNotSetError(_0x2c94a8(0x313)+_0x2c94a8(0x2df)),0x1;_0x2b7755[_0x2c94a8(0x1a0)]&&(console[_0x2c94a8(0x2ef)](_0x2c94a8(0x368)+_0x2b7755[_0x2c94a8(0x24d)]),console[_0x2c94a8(0x2ef)](_0x2c94a8(0x29f)+_0x2af706));const _0x2bf8b8=await withSpinner(_0x2c94a8(0x221)+_0x2af706+_0x2c94a8(0x335),()=>_0x17ee47[_0x2c94a8(0x207)][_0x2c94a8(0x1fc)](_0x2af706),{'verbose':_0x2b7755[_0x2c94a8(0x1a0)]}),_0x55bd0a=_0x2bf8b8[_0x2c94a8(0x1a1)],_0x91fadd=await withSpinner(_0x2c94a8(0x333)+_0x2af706+_0x2c94a8(0x335),()=>_0x17ee47[_0x2c94a8(0x3bb)]['listJourneys'](_0x55bd0a),{'verbose':_0x2b7755[_0x2c94a8(0x1a0)]}),_0x3385a4=_0x91fadd[_0x2c94a8(0x1a1)];console[_0x2c94a8(0x2ef)](_0x2c94a8(0x396)+_0x3385a4['length']+_0x2c94a8(0x274)+(_0x3385a4['length']!==0x1?'s':''));if(_0x2b7755['format']==='json'||_0x2b7755[_0x2c94a8(0x1f3)]===_0x2c94a8(0x33b))await handleSDKOutput(_0x3385a4,_0x2b7755);else{if(_0x3385a4[_0x2c94a8(0x2e9)]===0x0)console[_0x2c94a8(0x2c2)]('No\x20RT\x20journeys\x20found');else for(const _0x1a41be of _0x3385a4){const _0x58dc01=_0x1a41be['state']===_0x2c94a8(0x1aa)?'🚀':'📝',_0x451c55=_0x1a41be[_0x2c94a8(0x29a)]?a31_0x437b86[_0x2c94a8(0x2e5)]('\x20(paused)'):'',_0x1279cf=a31_0x437b86['dim']('\x20('+_0x1a41be[_0x2c94a8(0x328)]+_0x2c94a8(0x355)+(_0x1a41be[_0x2c94a8(0x328)]!==0x1?'s':'')+')');console[_0x2c94a8(0x2c2)](_0x58dc01+'\x20'+_0x1a41be['name']+_0x451c55+_0x1279cf);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x27a);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x38a);async[a31_0x33df17(0x29e)](_0x1ae08e){const _0x53283f=a31_0x33df17,{options:_0x4b8e72,args:_0x43baec,tdx:_0x280647}=_0x1ae08e,_0x29ee13=_0x43baec[0x0];if(!_0x29ee13)return console['error'](a31_0x437b86[_0x53283f(0x1bb)](_0x53283f(0x2f3))),console[_0x53283f(0x2ef)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console[_0x53283f(0x2ef)](a31_0x437b86['dim'](_0x53283f(0x30b))),0x1;_0x4b8e72[_0x53283f(0x1a0)]&&(console[_0x53283f(0x2ef)]('Site:\x20'+_0x4b8e72[_0x53283f(0x24d)]),console['error'](_0x53283f(0x389)+_0x29ee13));const _0x555173=await withSpinner(_0x53283f(0x1f1)+_0x29ee13+_0x53283f(0x335),()=>_0x280647[_0x53283f(0x3bb)][_0x53283f(0x1c3)](_0x29ee13),{'verbose':_0x4b8e72['verbose']}),_0x3fc16f=_0x555173[_0x53283f(0x1a1)];console[_0x53283f(0x2ef)](_0x53283f(0x1e2)+_0x3fc16f['name']+'\x27');if(_0x4b8e72[_0x53283f(0x1f3)]===_0x53283f(0x2c3)||_0x4b8e72['format']===_0x53283f(0x33b))await handleSDKOutput([_0x3fc16f],_0x4b8e72);else{const _0x131ef9=_0x3fc16f[_0x53283f(0x317)]===_0x53283f(0x1aa)?'🚀':'📝',_0x3a3339=_0x3fc16f[_0x53283f(0x29a)]?a31_0x437b86[_0x53283f(0x2e5)]('\x20(paused)'):'';console['log'](_0x131ef9+'\x20'+_0x3fc16f[_0x53283f(0x296)]+_0x3a3339);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x2cb);[a31_0x33df17(0x2fa)]='Resume\x20activations\x20in\x20an\x20RT\x20journey';async['execute'](_0x534f83){const _0x3d5099=a31_0x33df17,{options:_0x4ce517,args:_0x133355,tdx:_0x5503b7}=_0x534f83,_0x28e939=_0x133355[0x0];if(!_0x28e939)return console[_0x3d5099(0x2ef)](a31_0x437b86[_0x3d5099(0x1bb)](_0x3d5099(0x2f3))),console[_0x3d5099(0x2ef)](_0x3d5099(0x1af)),console[_0x3d5099(0x2ef)](a31_0x437b86[_0x3d5099(0x358)](_0x3d5099(0x30b))),0x1;_0x4ce517[_0x3d5099(0x1a0)]&&(console[_0x3d5099(0x2ef)](_0x3d5099(0x368)+_0x4ce517[_0x3d5099(0x24d)]),console['error'](_0x3d5099(0x389)+_0x28e939));const _0x5a6e13=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x28e939+_0x3d5099(0x335),()=>_0x5503b7[_0x3d5099(0x3bb)][_0x3d5099(0x38b)](_0x28e939),{'verbose':_0x4ce517[_0x3d5099(0x1a0)]}),_0x15a4e5=_0x5a6e13[_0x3d5099(0x1a1)];console[_0x3d5099(0x2ef)]('✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x15a4e5[_0x3d5099(0x296)]+'\x27');if(_0x4ce517['format']===_0x3d5099(0x2c3)||_0x4ce517['format']===_0x3d5099(0x33b))await handleSDKOutput([_0x15a4e5],_0x4ce517);else{const _0x2d868f=_0x15a4e5['state']===_0x3d5099(0x1aa)?'🚀':'📝',_0x5cf87e=_0x15a4e5[_0x3d5099(0x29a)]?a31_0x437b86[_0x3d5099(0x2e5)](_0x3d5099(0x1cf)):'';console[_0x3d5099(0x2c2)](_0x2d868f+'\x20'+_0x15a4e5[_0x3d5099(0x296)]+_0x5cf87e);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']=a31_0x33df17(0x31d);[a31_0x33df17(0x2fa)]='Get\x20current\x20RT\x20configuration\x20version\x20status';async[a31_0x33df17(0x29e)](_0x521388){const _0x4a2426=a31_0x33df17,{options:_0x1bc728,args:_0x16c47c,tdx:_0xf556c3}=_0x521388,_0x4130b7=_0x16c47c[0x0]||_0x1bc728['parentSegment'];if(!_0x4130b7)return showParentSegmentNotSetError(_0x4a2426(0x3a0)+'\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'),0x1;_0x1bc728[_0x4a2426(0x1a0)]&&(console['error'](_0x4a2426(0x368)+_0x1bc728[_0x4a2426(0x24d)]),console[_0x4a2426(0x2ef)](_0x4a2426(0x29f)+_0x4130b7));const _0xf407b=await withSpinner(_0x4a2426(0x221)+_0x4130b7+_0x4a2426(0x335),()=>_0xf556c3[_0x4a2426(0x207)]['resolveParentId'](_0x4130b7),{'verbose':_0x1bc728[_0x4a2426(0x1a0)]}),_0x3b78dc=_0xf407b[_0x4a2426(0x1a1)],_0x2f1c67=await withSpinner(_0x4a2426(0x271)+_0x4130b7+_0x4a2426(0x335),()=>_0xf556c3[_0x4a2426(0x3bb)]['getCurrentConfigVersion'](_0x3b78dc),{'verbose':_0x1bc728[_0x4a2426(0x1a0)]}),_0x1b8268=_0x2f1c67[_0x4a2426(0x1a1)];return console['error'](_0x4a2426(0x34c)),_0x1bc728['format']==='json'||_0x1bc728[_0x4a2426(0x1f3)]===_0x4a2426(0x33b)?await handleSDKOutput([_0x1b8268],_0x1bc728):(console[_0x4a2426(0x2c2)](_0x4a2426(0x362)+_0x1b8268['id']),console['log'](_0x4a2426(0x32f)+_0x1b8268['audienceId']),console[_0x4a2426(0x2c2)](_0x4a2426(0x375)+_0x1b8268[_0x4a2426(0x24e)]),console['log']('eventKind:\x20'+_0x1b8268[_0x4a2426(0x1f4)]),console['log']('status:\x20'+_0x1b8268['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x291);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2e0);async[a31_0x33df17(0x29e)](_0x21625f){const _0x13d510=a31_0x33df17,{options:_0xc74688,args:_0x396547,tdx:_0x1696c3}=_0x21625f,_0x32098d=_0x396547[0x0]||_0xc74688['parentSegment'];if(!_0x32098d)return showParentSegmentNotSetError(_0x13d510(0x2f1)+_0x13d510(0x343)),0x1;const _0x40c525=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x32098d+_0x13d510(0x335),()=>_0x1696c3[_0x13d510(0x207)][_0x13d510(0x1fc)](_0x32098d),{'verbose':_0xc74688[_0x13d510(0x1a0)]}),_0x20df41=_0x40c525['data'],_0x5c50bc=await withSpinner(_0x13d510(0x1e5)+_0x32098d+_0x13d510(0x335),()=>_0x1696c3[_0x13d510(0x1d1)][_0x13d510(0x288)](_0x20df41),{'verbose':_0xc74688[_0x13d510(0x1a0)]}),_0x4eb260=_0x5c50bc[_0x13d510(0x1a1)];console[_0x13d510(0x2ef)](_0x13d510(0x396)+_0x4eb260[_0x13d510(0x2e9)]+_0x13d510(0x20a)+(_0x4eb260[_0x13d510(0x2e9)]!==0x1?'s':''));if(_0xc74688['format']==='json'||_0xc74688[_0x13d510(0x1f3)]==='jsonl')await handleSDKOutput(_0x4eb260,_0xc74688);else{if(_0x4eb260[_0x13d510(0x2e9)]===0x0)console[_0x13d510(0x2c2)](_0x13d510(0x20c)),console[_0x13d510(0x2ef)](a31_0x437b86[_0x13d510(0x269)](_0x13d510(0x34b)));else for(const _0x4526db of _0x4eb260){console[_0x13d510(0x2c2)](a31_0x437b86['bold'](_0x4526db[_0x13d510(0x296)])+'\x20'+a31_0x437b86[_0x13d510(0x358)](_0x13d510(0x29c)+_0x4526db['id']+')'));_0x4526db[_0x13d510(0x2fa)]&&console['log']('\x20\x20'+a31_0x437b86[_0x13d510(0x358)](_0x4526db[_0x13d510(0x2fa)]));if(_0x4526db[_0x13d510(0x2dc)]&&_0x4526db[_0x13d510(0x2dc)][_0x13d510(0x2e9)]>0x0)for(const _0x2acb8b of _0x4526db['tokens']){const _0xc2b0be=_0x2acb8b[_0x13d510(0x2a7)]?.[_0x13d510(0x2e9)]?_0x2acb8b['allowedIps'][_0x13d510(0x1d3)](',\x20'):_0x13d510(0x280);console[_0x13d510(0x2c2)]('\x20\x20'+a31_0x437b86[_0x13d510(0x269)](_0x13d510(0x230))+'\x20'+_0x2acb8b[_0x13d510(0x296)]+'\x20'+a31_0x437b86[_0x13d510(0x358)](_0x13d510(0x29c)+_0x2acb8b['id']+')')),console[_0x13d510(0x2c2)](_0x13d510(0x373)+a31_0x437b86[_0x13d510(0x358)](_0x13d510(0x1cb))+'\x20'+_0xc2b0be);}else console['log']('\x20\x20'+a31_0x437b86['dim']('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{['name']='ps:pz:service:create';[a31_0x33df17(0x2fa)]=a31_0x33df17(0x382);async[a31_0x33df17(0x29e)](_0x33b061){const _0xb940e=a31_0x33df17,{options:_0x2acfe0,args:_0x4009c1,tdx:_0x3d26b7}=_0x33b061,_0x444598=_0x2acfe0,_0x2510ac=_0x4009c1[0x0],_0x46583f=_0x4009c1[0x1]||_0x2acfe0[_0xb940e(0x2dd)];if(!_0x2510ac)return console[_0xb940e(0x2ef)](_0xb940e(0x36b)),console[_0xb940e(0x2ef)](_0xb940e(0x1ab)),console[_0xb940e(0x2ef)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x46583f)return showParentSegmentNotSetError(_0xb940e(0x219)+_0xb940e(0x2db)),0x1;const _0x52d032=await withSpinner(_0xb940e(0x221)+_0x46583f+_0xb940e(0x335),()=>_0x3d26b7[_0xb940e(0x207)][_0xb940e(0x1fc)](_0x46583f),{'verbose':_0x2acfe0[_0xb940e(0x1a0)]}),_0xa8c9db=_0x52d032[_0xb940e(0x1a1)],_0x40bc2d={'name':_0x2510ac,'description':_0x444598['description'],'public':_0x444598[_0xb940e(0x378)]},_0x3d06c6=await withSpinner(_0xb940e(0x35c)+_0x2510ac+'\x27...',()=>_0x3d26b7[_0xb940e(0x1d1)][_0xb940e(0x300)](_0xa8c9db,_0x40bc2d),{'verbose':_0x2acfe0[_0xb940e(0x1a0)]}),_0x422b2a=_0x3d06c6[_0xb940e(0x1a1)];return console[_0xb940e(0x2ef)](_0xb940e(0x246)+_0x422b2a[_0xb940e(0x296)]+_0xb940e(0x363)+_0x422b2a['id']),await handleSDKOutput([_0x422b2a],_0x2acfe0),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{['name']=a31_0x33df17(0x391);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2d2);async[a31_0x33df17(0x29e)](_0x26d90c){const _0x253b05=a31_0x33df17,{options:_0x48256a,args:_0x4ece0c,tdx:_0x5a4ee0}=_0x26d90c,_0x4836a0=_0x4ece0c[0x0],_0x20d822=_0x4ece0c[0x1]||_0x48256a[_0x253b05(0x2dd)];if(!_0x4836a0)return console[_0x253b05(0x2ef)](_0x253b05(0x25a)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x253b05(0x2ef)](_0x253b05(0x349)),0x1;if(!_0x20d822)return showParentSegmentNotSetError(_0x253b05(0x2da)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x35742d=await withSpinner(_0x253b05(0x221)+_0x20d822+_0x253b05(0x335),()=>_0x5a4ee0['segment']['resolveParentId'](_0x20d822),{'verbose':_0x48256a['verbose']}),_0x50580d=_0x35742d['data'],_0x29f28a=await withSpinner(_0x253b05(0x258)+_0x4836a0+'\x27...',()=>_0x5a4ee0['personalization'][_0x253b05(0x33d)](_0x50580d,_0x4836a0),{'verbose':_0x48256a[_0x253b05(0x1a0)]}),_0xbfe574=_0x29f28a[_0x253b05(0x1a1)];if(_0x48256a[_0x253b05(0x2c3)]||_0x48256a[_0x253b05(0x33b)])await handleSDKOutput([_0xbfe574],_0x48256a);else{console['log'](a31_0x437b86[_0x253b05(0x31c)](_0xbfe574[_0x253b05(0x296)])+'\x20'+a31_0x437b86['dim'](_0x253b05(0x29c)+_0xbfe574['id']+')'));_0xbfe574[_0x253b05(0x2fa)]&&console[_0x253b05(0x2c2)]('\x20\x20'+a31_0x437b86[_0x253b05(0x358)](_0xbfe574[_0x253b05(0x2fa)]));console[_0x253b05(0x2c2)]('\x20\x20'+a31_0x437b86[_0x253b05(0x269)]('public:')+'\x20'+(_0xbfe574[_0x253b05(0x378)]?'yes':'no'));if(_0xbfe574['tokens']&&_0xbfe574[_0x253b05(0x2dc)][_0x253b05(0x2e9)]>0x0)for(const _0x1c6d8c of _0xbfe574['tokens']){const _0xa6a10d=_0x1c6d8c[_0x253b05(0x2a7)]?.['length']?_0x1c6d8c[_0x253b05(0x2a7)][_0x253b05(0x1d3)](',\x20'):_0x253b05(0x280);console[_0x253b05(0x2c2)]('\x20\x20'+a31_0x437b86[_0x253b05(0x269)]('token:')+'\x20'+_0x1c6d8c[_0x253b05(0x296)]+'\x20'+a31_0x437b86[_0x253b05(0x358)](_0x253b05(0x29c)+_0x1c6d8c['id']+')')),console[_0x253b05(0x2c2)](_0x253b05(0x373)+a31_0x437b86[_0x253b05(0x358)]('allowed\x20IPs:')+'\x20'+_0xa6a10d);}else console[_0x253b05(0x2c2)]('\x20\x20'+a31_0x437b86['dim']('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x38c);['description']='Delete\x20a\x20personalization\x20service';async[a31_0x33df17(0x29e)](_0x448dd2){const _0x36db96=a31_0x33df17,{options:_0x4c866a,args:_0x330668,tdx:_0x19ab39}=_0x448dd2,_0xaf2719=_0x330668[0x0],_0xe5b8e3=_0x330668[0x1]||_0x4c866a['parentSegment'];if(!_0xaf2719)return console[_0x36db96(0x2ef)](_0x36db96(0x25a)),console[_0x36db96(0x2ef)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0x36db96(0x2ef)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0xe5b8e3)return showParentSegmentNotSetError(_0x36db96(0x39e)+_0x36db96(0x30f)),0x1;const _0x23c897=await withSpinner(_0x36db96(0x221)+_0xe5b8e3+_0x36db96(0x335),()=>_0x19ab39['segment'][_0x36db96(0x1fc)](_0xe5b8e3),{'verbose':_0x4c866a[_0x36db96(0x1a0)]}),_0x206217=_0x23c897[_0x36db96(0x1a1)];return await withSpinner(_0x36db96(0x344)+_0xaf2719+_0x36db96(0x335),()=>_0x19ab39['personalization'][_0x36db96(0x225)](_0x206217,_0xaf2719),{'verbose':_0x4c866a['verbose']}),console[_0x36db96(0x2ef)](_0x36db96(0x28c)+_0xaf2719+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x33df17(0x296)]='ps:pz:service:update';['description']=a31_0x33df17(0x37e);async[a31_0x33df17(0x29e)](_0x1adc5d){const _0x5e5550=a31_0x33df17,{options:_0x40dac2,args:_0x870470,tdx:_0x101143}=_0x1adc5d,_0x26352a=_0x40dac2,_0x2b1bfd=_0x870470[0x0],_0x388c45=_0x870470[0x1]||_0x40dac2[_0x5e5550(0x2dd)];if(!_0x2b1bfd)return console['error'](_0x5e5550(0x25a)),console['error'](_0x5e5550(0x2fb)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x26352a['name'])return console[_0x5e5550(0x2ef)](_0x5e5550(0x22a)),console[_0x5e5550(0x2ef)](_0x5e5550(0x2fb)),0x1;if(!_0x388c45)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+_0x5e5550(0x3b8)),0x1;const _0x29ef48=await withSpinner(_0x5e5550(0x221)+_0x388c45+'\x27...',()=>_0x101143['segment'][_0x5e5550(0x1fc)](_0x388c45),{'verbose':_0x40dac2[_0x5e5550(0x1a0)]}),_0x164763=_0x29ef48[_0x5e5550(0x1a1)],_0x41ed1a={'name':_0x26352a[_0x5e5550(0x296)]};_0x26352a['description']!==undefined&&(_0x41ed1a[_0x5e5550(0x2fa)]=_0x26352a['description']);const _0x5cbf3d=await withSpinner(_0x5e5550(0x1c0)+_0x2b1bfd+_0x5e5550(0x335),()=>_0x101143[_0x5e5550(0x1d1)]['patch'](_0x164763,_0x2b1bfd,_0x41ed1a),{'verbose':_0x40dac2[_0x5e5550(0x1a0)]}),_0x362e70=_0x5cbf3d[_0x5e5550(0x1a1)];return console['error']('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x362e70[_0x5e5550(0x296)]+'\x27'),await handleSDKOutput([_0x362e70],_0x40dac2),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x398);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2be);async[a31_0x33df17(0x29e)](_0x461e06){const _0x144aec=a31_0x33df17,{options:_0xcb3798,args:_0x9ad04e,tdx:_0x5a59d4}=_0x461e06,_0x4fcf4d=_0xcb3798,_0x558417=_0x9ad04e[0x0],_0x20ec3a=_0x9ad04e[0x1],_0x5c7d87=_0x9ad04e[0x2]||_0xcb3798[_0x144aec(0x2dd)];if(!_0x558417)return console[_0x144aec(0x2ef)]('Error:\x20Token\x20name\x20is\x20required'),console[_0x144aec(0x2ef)](_0x144aec(0x256)),console[_0x144aec(0x2ef)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x20ec3a)return console[_0x144aec(0x2ef)](_0x144aec(0x25a)),console[_0x144aec(0x2ef)](_0x144aec(0x256)),console['error'](_0x144aec(0x32b)),0x1;if(!_0x5c7d87)return showParentSegmentNotSetError(_0x144aec(0x2b7)+_0x144aec(0x32b)),0x1;const _0x2692c7=await withSpinner(_0x144aec(0x221)+_0x5c7d87+_0x144aec(0x335),()=>_0x5a59d4[_0x144aec(0x207)][_0x144aec(0x1fc)](_0x5c7d87),{'verbose':_0xcb3798['verbose']}),_0x51081e=_0x2692c7[_0x144aec(0x1a1)],_0x113f92={'name':_0x558417};_0x4fcf4d[_0x144aec(0x2a7)]&&(_0x113f92[_0x144aec(0x2a7)]=_0x4fcf4d['allowedIps'][_0x144aec(0x1a2)](',')['map'](_0x2ac349=>_0x2ac349['trim']()));_0x4fcf4d[_0x144aec(0x2fa)]&&(_0x113f92[_0x144aec(0x2fa)]=_0x4fcf4d['description']);const _0x38faaa=await withSpinner(_0x144aec(0x323)+_0x558417+_0x144aec(0x293)+_0x20ec3a+_0x144aec(0x335),()=>_0x5a59d4[_0x144aec(0x1d1)][_0x144aec(0x28d)](_0x51081e,_0x20ec3a,_0x113f92),{'verbose':_0xcb3798[_0x144aec(0x1a0)]}),_0x1d4dae=_0x38faaa['data'];return console['error'](_0x144aec(0x3b9)+_0x1d4dae[_0x144aec(0x296)]+_0x144aec(0x363)+_0x1d4dae['id']),_0x1d4dae[_0x144aec(0x250)]&&(console['error'](a31_0x437b86[_0x144aec(0x2e5)](_0x144aec(0x23f))),console['error'](a31_0x437b86['cyan'](_0x1d4dae[_0x144aec(0x250)])),console[_0x144aec(0x2ef)]('')),await handleSDKOutput([_0x1d4dae],_0xcb3798),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x361);[a31_0x33df17(0x2fa)]='Delete\x20a\x20token\x20from\x20a\x20personalization\x20service';async[a31_0x33df17(0x29e)](_0x299351){const _0x43138b=a31_0x33df17,{options:_0x390bdd,args:_0xc79f5c,tdx:_0x5a8d9b}=_0x299351,_0x6f2706=_0xc79f5c[0x0],_0x9c69c2=_0xc79f5c[0x1]||_0x390bdd['parentSegment'];if(!_0x6f2706)return console[_0x43138b(0x2ef)](_0x43138b(0x217)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x9c69c2)return showParentSegmentNotSetError(_0x43138b(0x379)+_0x43138b(0x254)),0x1;const _0x592f74=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x9c69c2+'\x27...',()=>_0x5a8d9b['segment'][_0x43138b(0x1fc)](_0x9c69c2),{'verbose':_0x390bdd[_0x43138b(0x1a0)]}),_0x51a58e=_0x592f74[_0x43138b(0x1a1)],_0x4c3b16=await withSpinner(_0x43138b(0x202),()=>_0x5a8d9b[_0x43138b(0x1d1)][_0x43138b(0x288)](_0x51a58e),{'verbose':_0x390bdd[_0x43138b(0x1a0)]}),_0x4858ad=_0x4c3b16[_0x43138b(0x1a1)];let _0x507e0b;for(const _0x4b1fa4 of _0x4858ad){if(_0x4b1fa4[_0x43138b(0x2dc)]?.[_0x43138b(0x2f4)](_0x46fb2b=>_0x46fb2b['id']===_0x6f2706)){_0x507e0b=_0x4b1fa4['id'];break;}}if(!_0x507e0b)return console[_0x43138b(0x2ef)]('Error:\x20Token\x20\x27'+_0x6f2706+'\x27\x20not\x20found\x20in\x20any\x20personalization\x20service'),0x1;const _0x109006=await withSpinner(_0x43138b(0x282)+_0x6f2706+_0x43138b(0x335),()=>_0x5a8d9b['personalization'][_0x43138b(0x1c9)](_0x51a58e,_0x507e0b,_0x6f2706),{'verbose':_0x390bdd[_0x43138b(0x1a0)]}),_0x35a3c4=_0x109006['data'];return console[_0x43138b(0x2ef)]('✔\x20Deleted\x20token\x20\x27'+(_0x35a3c4[_0x43138b(0x296)]||_0x6f2706)+'\x27'),await handleSDKOutput([_0x35a3c4],_0x390bdd),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x28f);['description']=a31_0x33df17(0x2a6);async[a31_0x33df17(0x29e)](_0x3c4abd){const _0x4b65b1=a31_0x33df17,{options:_0x21eb57,args:_0x846acb,tdx:_0x560c51}=_0x3c4abd,_0x12b4fd=_0x846acb[0x0]||_0x21eb57['parentSegment'];if(!_0x12b4fd)return showParentSegmentNotSetError(_0x4b65b1(0x387)+_0x4b65b1(0x352)),0x1;const _0x3de383=await withSpinner(_0x4b65b1(0x221)+_0x12b4fd+'\x27...',()=>_0x560c51[_0x4b65b1(0x207)][_0x4b65b1(0x1fc)](_0x12b4fd),{'verbose':_0x21eb57[_0x4b65b1(0x1a0)]}),_0x59c6ff=_0x3de383['data'],_0x67691e=await withSpinner(_0x4b65b1(0x35b)+_0x12b4fd+_0x4b65b1(0x335),()=>_0x560c51[_0x4b65b1(0x1d1)]['listPersonalizations'](_0x59c6ff),{'verbose':_0x21eb57[_0x4b65b1(0x1a0)]}),_0x100b6c=_0x67691e[_0x4b65b1(0x1a1)];console[_0x4b65b1(0x2ef)](_0x4b65b1(0x396)+_0x100b6c[_0x4b65b1(0x2e9)]+_0x4b65b1(0x2c7)+(_0x100b6c[_0x4b65b1(0x2e9)]!==0x1?'s':''));if(_0x21eb57[_0x4b65b1(0x1f3)]==='json'||_0x21eb57[_0x4b65b1(0x1f3)]==='jsonl')await handleSDKOutput(_0x100b6c,_0x21eb57);else{if(_0x100b6c[_0x4b65b1(0x2e9)]===0x0)console[_0x4b65b1(0x2c2)](_0x4b65b1(0x23e));else for(const _0x58bfed of _0x100b6c){console[_0x4b65b1(0x2c2)](a31_0x437b86[_0x4b65b1(0x31c)](_0x58bfed[_0x4b65b1(0x296)])+'\x20'+a31_0x437b86[_0x4b65b1(0x358)](_0x4b65b1(0x29c)+_0x58bfed['id']+')'));_0x58bfed['description']&&console[_0x4b65b1(0x2c2)]('\x20\x20'+a31_0x437b86[_0x4b65b1(0x358)](_0x58bfed[_0x4b65b1(0x2fa)]));const _0x56a192=_0x58bfed[_0x4b65b1(0x2e7)]?.['length']||0x0;console[_0x4b65b1(0x2c2)]('\x20\x20'+a31_0x437b86[_0x4b65b1(0x269)](_0x4b65b1(0x366))+'\x20'+_0x56a192);if(_0x58bfed['sections']&&_0x58bfed[_0x4b65b1(0x2e7)][_0x4b65b1(0x2e9)]>0x0)for(const _0xf04e13 of _0x58bfed['sections']){console[_0x4b65b1(0x2c2)](_0x4b65b1(0x229)+_0xf04e13[_0x4b65b1(0x296)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x395);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x1c7);async[a31_0x33df17(0x29e)](_0x1d5ed9){const _0x27c361=a31_0x33df17,{options:_0x44ab1d,args:_0x30cc59,tdx:_0x67bda2}=_0x1d5ed9,_0x1152e3=_0x30cc59[0x0];if(!_0x1152e3)return console['error']('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x27c361(0x2ef)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x43df3b=await withSpinner('Getting\x20personalization\x20\x27'+_0x1152e3+'\x27...',()=>_0x67bda2[_0x27c361(0x1d1)][_0x27c361(0x3a6)](_0x1152e3),{'verbose':_0x44ab1d[_0x27c361(0x1a0)]}),_0x104943=_0x43df3b[_0x27c361(0x1a1)];console[_0x27c361(0x2ef)](_0x27c361(0x234)+_0x104943[_0x27c361(0x296)]+'\x27');if(_0x44ab1d[_0x27c361(0x1f3)]==='json'||_0x44ab1d[_0x27c361(0x1f3)]===_0x27c361(0x33b))await handleSDKOutput([_0x104943],_0x44ab1d);else{console['log'](a31_0x437b86['bold'](_0x104943[_0x27c361(0x296)])+'\x20'+a31_0x437b86[_0x27c361(0x358)](_0x27c361(0x29c)+_0x104943['id']+')'));_0x104943['description']&&console[_0x27c361(0x2c2)]('\x20\x20'+a31_0x437b86['dim'](_0x104943[_0x27c361(0x2fa)]));_0x104943[_0x27c361(0x2fd)]&&console[_0x27c361(0x2c2)]('\x20\x20'+a31_0x437b86[_0x27c361(0x269)](_0x27c361(0x3ba))+'\x20'+_0x104943[_0x27c361(0x2fd)]);console[_0x27c361(0x2c2)]('\x20\x20'+a31_0x437b86[_0x27c361(0x269)](_0x27c361(0x3a4))+'\x20'+_0x104943[_0x27c361(0x37c)]),console[_0x27c361(0x2c2)]('\x20\x20'+a31_0x437b86[_0x27c361(0x269)]('updated:')+'\x20'+_0x104943[_0x27c361(0x281)]);const _0x3dec31=_0x104943[_0x27c361(0x2e7)]?.[_0x27c361(0x2e9)]||0x0;console[_0x27c361(0x2c2)]('\x20\x20'+a31_0x437b86[_0x27c361(0x269)](_0x27c361(0x366))+'\x20'+_0x3dec31);if(_0x104943[_0x27c361(0x2e7)]&&_0x104943[_0x27c361(0x2e7)][_0x27c361(0x2e9)]>0x0)for(const _0x4f346a of _0x104943[_0x27c361(0x2e7)]){console['log'](_0x27c361(0x373)+a31_0x437b86[_0x27c361(0x31c)](_0x4f346a['name'])+'\x20'+a31_0x437b86[_0x27c361(0x358)](_0x27c361(0x29c)+_0x4f346a['id']+')')),_0x4f346a[_0x27c361(0x22f)]&&(console[_0x27c361(0x2c2)](_0x27c361(0x2ee)+a31_0x437b86[_0x27c361(0x269)](_0x27c361(0x34a))+'\x20'+_0x4f346a[_0x27c361(0x22f)][_0x27c361(0x296)]),_0x4f346a['entryCriteria']['keyEventCriteria']?.['keyEventId']&&console['log'](_0x27c361(0x20b)+a31_0x437b86['cyan'](_0x27c361(0x1b8))+'\x20'+_0x4f346a[_0x27c361(0x22f)][_0x27c361(0x1b5)]['keyEventId'])),_0x4f346a['payload']&&console[_0x27c361(0x2c2)]('\x20\x20\x20\x20\x20\x20'+a31_0x437b86['cyan'](_0x27c361(0x399))+'\x20'+JSON[_0x27c361(0x2a2)](_0x4f346a[_0x27c361(0x257)])),_0x4f346a[_0x27c361(0x26a)]&&console[_0x27c361(0x2c2)](_0x27c361(0x2ee)+a31_0x437b86[_0x27c361(0x269)](_0x27c361(0x36f))+_0x27c361(0x372));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x2b8);['description']=a31_0x33df17(0x273);async[a31_0x33df17(0x29e)](_0x43ba2f){const _0x5b1dad=a31_0x33df17,{options:_0x13f071,args:_0xb4140,tdx:_0x57ce96}=_0x43ba2f,_0x1368be=_0xb4140[0x0];if(!_0x1368be)return console[_0x5b1dad(0x2ef)](_0x5b1dad(0x1fe)),console[_0x5b1dad(0x2ef)](_0x5b1dad(0x1d9)),0x1;return await withSpinner(_0x5b1dad(0x1de)+_0x1368be+_0x5b1dad(0x335),()=>_0x57ce96[_0x5b1dad(0x1d1)]['deletePersonalization'](_0x1368be),{'verbose':_0x13f071[_0x5b1dad(0x1a0)]}),console[_0x5b1dad(0x2ef)]('✔\x20Deleted\x20personalization\x20\x27'+_0x1368be+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x311);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x26b);async['execute'](_0x118c59){const _0x2a915f=a31_0x33df17,{options:_0x3095e4,tdx:_0x1c7ed1}=_0x118c59,_0x3ef6ce=_0x3095e4;let _0x241ace;if(_0x3ef6ce['file']){_0x241ace=await loadJSON(_0x3ef6ce[_0x2a915f(0x2e3)],!![]);if(!_0x241ace[_0x2a915f(0x342)]?.['parentFolder'])return console[_0x2a915f(0x2ef)](_0x2a915f(0x1ef)),console[_0x2a915f(0x2ef)](_0x2a915f(0x2ea)),console[_0x2a915f(0x2ef)](_0x2a915f(0x1fb)),0x1;}else{if(!_0x3ef6ce[_0x2a915f(0x296)])return console[_0x2a915f(0x2ef)](_0x2a915f(0x2b9)),console[_0x2a915f(0x2ef)](_0x2a915f(0x23d)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x3ef6ce['description']===undefined)return console[_0x2a915f(0x2ef)](_0x2a915f(0x22c)),console[_0x2a915f(0x2ef)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x2a915f(0x2ef)](_0x2a915f(0x213)),0x1;if(_0x3ef6ce['folderId']===undefined)return console[_0x2a915f(0x2ef)](_0x2a915f(0x386)),console[_0x2a915f(0x2ef)](_0x2a915f(0x385)),0x1;let _0x5909db=_0x3ef6ce[_0x2a915f(0x2fd)];if(!_0x5909db&&_0x3095e4[_0x2a915f(0x2dd)]){const _0x11cab0=await withSpinner(_0x2a915f(0x221)+_0x3095e4[_0x2a915f(0x2dd)]+'\x27...',()=>_0x1c7ed1[_0x2a915f(0x207)][_0x2a915f(0x1fc)](_0x3095e4[_0x2a915f(0x2dd)]),{'verbose':_0x3095e4['verbose']});_0x5909db=_0x11cab0[_0x2a915f(0x1a1)];}let _0x5032f5;_0x3ef6ce[_0x2a915f(0x2e7)]&&(_0x5032f5=await loadJSON(_0x3ef6ce['sections'],![]));const _0x77d98a=_0x3ef6ce[_0x2a915f(0x259)]===_0x2a915f(0x1b4)?null:{'id':_0x3ef6ce[_0x2a915f(0x259)],'type':_0x2a915f(0x381)};_0x241ace={'attributes':{'name':_0x3ef6ce[_0x2a915f(0x296)],'description':_0x3ef6ce[_0x2a915f(0x2fa)]||null,..._0x5909db!==undefined&&{'audienceId':_0x5909db},..._0x5032f5!==undefined&&{'sections':_0x5032f5}},'relationships':{'parentFolder':{'data':_0x77d98a}}};}const _0x5502df=await withSpinner(_0x2a915f(0x1be)+(_0x241ace['attributes']?.['name']??'')+_0x2a915f(0x335),()=>_0x1c7ed1[_0x2a915f(0x1d1)]['createPersonalization'](_0x241ace),{'verbose':_0x3095e4[_0x2a915f(0x1a0)]}),_0xd9d0cf=_0x5502df[_0x2a915f(0x1a1)];return console[_0x2a915f(0x2ef)](_0x2a915f(0x3a3)+_0xd9d0cf['name']+_0x2a915f(0x363)+_0xd9d0cf['id']),await handleSDKOutput([_0xd9d0cf],_0x3095e4),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x2f2);['description']=a31_0x33df17(0x200);async[a31_0x33df17(0x29e)](_0x522e9b){const _0xc339e2=a31_0x33df17,{options:_0x495120,args:_0x26bc9a}=_0x522e9b,_0x34b4be=_0x495120,_0x253bcd=_0x26bc9a[0x0];if(!_0x253bcd)return console[_0xc339e2(0x2ef)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0xc339e2(0x2ef)](_0xc339e2(0x350)),console[_0xc339e2(0x2ef)](_0xc339e2(0x1fd)),0x1;let _0x2833e7;if(_0x34b4be[_0xc339e2(0x2e3)])_0x2833e7=await loadJSON(_0x34b4be[_0xc339e2(0x2e3)],!![]);else{if(!_0x34b4be[_0xc339e2(0x296)])return console[_0xc339e2(0x2ef)](_0xc339e2(0x2b9)),console[_0xc339e2(0x2ef)](_0xc339e2(0x350)),0x1;if(_0x34b4be[_0xc339e2(0x2fa)]===undefined)return console[_0xc339e2(0x2ef)]('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0xc339e2(0x2ef)](_0xc339e2(0x350)),0x1;let _0x4500b1;_0x34b4be['sections']&&(_0x4500b1=await loadJSON(_0x34b4be[_0xc339e2(0x2e7)],![])),_0x2833e7={'attributes':{'name':_0x34b4be[_0xc339e2(0x296)],'description':_0x34b4be[_0xc339e2(0x2fa)]||null,..._0x4500b1!==undefined&&{'sections':_0x4500b1}}};}const {tdx:_0x5c114e}=_0x522e9b,_0x5db79c=await withSpinner(_0xc339e2(0x31f)+_0x253bcd+'\x27...',()=>_0x5c114e[_0xc339e2(0x1d1)][_0xc339e2(0x248)](_0x253bcd,_0x2833e7),{'verbose':_0x495120['verbose']}),_0x531c21=_0x5db79c[_0xc339e2(0x1a1)];return console[_0xc339e2(0x2ef)]('✔\x20Updated\x20personalization\x20\x27'+_0x531c21[_0xc339e2(0x296)]+'\x27\x20(id:\x20'+_0x531c21['id']+')'),await handleSDKOutput([_0x531c21],_0x495120),0x0;}}function a31_0x26a5(_0x617322,_0x36147f){_0x617322=_0x617322-0x1a0;const _0x92691c=a31_0x9269();let _0x26a506=_0x92691c[_0x617322];return _0x26a506;}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a31_0x33df17(0x29b);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2bd);async[a31_0x33df17(0x29e)](_0x11e9dc){const _0x3eedc0=a31_0x33df17,{options:_0x42e444,args:_0x4dd821}=_0x11e9dc,_0x20ba74=_0x4dd821[0x0]||_0x42e444[_0x3eedc0(0x2dd)];if(!_0x20ba74)return showParentSegmentNotSetError('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'+_0x3eedc0(0x244)),0x1;const _0x24f69a=resolveYamlFile(_0x20ba74);if(!existsSync(_0x24f69a))return showFileNotFoundError(_0x24f69a,_0x20ba74),0x1;let _0x39e058;try{_0x39e058=readFileSync(_0x24f69a,'utf-8');}catch(_0x3390fa){const _0x265489=_0x3390fa instanceof Error?_0x3390fa[_0x3eedc0(0x367)]:String(_0x3390fa);return console[_0x3eedc0(0x2ef)](_0x3eedc0(0x30e)+_0x265489),0x1;}let _0x471500;try{_0x471500=parseDef(_0x39e058);}catch(_0x4ed314){const _0x2c02f0=_0x4ed314 instanceof Error?_0x4ed314[_0x3eedc0(0x367)]:String(_0x4ed314);return console['error'](a31_0x437b86[_0x3eedc0(0x1bb)](_0x3eedc0(0x24c)+_0x2c02f0)),0x1;}if(_0x471500[_0x3eedc0(0x365)]&&_0x471500[_0x3eedc0(0x365)][_0x3eedc0(0x2e9)]>0x0)return console[_0x3eedc0(0x2ef)](a31_0x437b86[_0x3eedc0(0x2e5)](_0x3eedc0(0x36d)+_0x24f69a)),console['error'](a31_0x437b86[_0x3eedc0(0x358)]('\x20\x20\x20'+_0x471500[_0x3eedc0(0x365)][_0x3eedc0(0x2e9)]+_0x3eedc0(0x1c6))),0x1;!_0x471500['realtime']&&(_0x471500[_0x3eedc0(0x3bb)]={'events':[{'name':'page_view','source_table':_0x3eedc0(0x2c9)}],'attributes':[{'name':_0x3eedc0(0x241),'type':_0x3eedc0(0x3bf)}],'id_stitching':{'primary_key':_0x471500[_0x3eedc0(0x211)][_0x3eedc0(0x30d)]==='customers'?'td_client_id':'user_id'}});_0x471500[_0x3eedc0(0x365)]=[{'name':_0x3eedc0(0x289),'description':_0x3eedc0(0x22b),'trigger_event':_0x3eedc0(0x1a9),'sections':[{'name':_0x3eedc0(0x380),'criteria':_0x3eedc0(0x36a),'attributes':[_0x3eedc0(0x241)]}]}];const _0x10255e=serializeDef(_0x471500);return writeFileSync(_0x24f69a,_0x10255e,_0x3eedc0(0x2e6)),console[_0x3eedc0(0x2ef)](a31_0x437b86[_0x3eedc0(0x292)]('✔')+_0x3eedc0(0x21e)+a31_0x437b86['cyan'](_0x24f69a)),(!_0x471500[_0x3eedc0(0x3bb)]||_0x39e058['indexOf'](_0x3eedc0(0x1f6))===-0x1)&&console[_0x3eedc0(0x2ef)](a31_0x437b86[_0x3eedc0(0x292)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x3eedc0(0x2ef)]('\x0a'+a31_0x437b86['dim']('Next\x20steps:')),console[_0x3eedc0(0x2ef)](_0x3eedc0(0x2a5)+_0x24f69a+_0x3eedc0(0x3b7)),console[_0x3eedc0(0x2ef)]('\x20\x202.\x20Run\x20'+a31_0x437b86[_0x3eedc0(0x358)](_0x3eedc0(0x1db)+_0x20ba74)+_0x3eedc0(0x1bf)),0x0;}}