@treasuredata/tdx 2026.3.54 → 2026.4.55

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 (254) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.d.ts.map +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-command.js.map +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/cas-command.js +1 -1
  15. package/dist/commands/cas-segment-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/delivery-command.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-campaign-pull-command.js +1 -1
  26. package/dist/commands/engage-campaign-push-command.js +1 -1
  27. package/dist/commands/engage-campaign-validate-command.js +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/engage-template-pull-command.js +1 -1
  30. package/dist/commands/engage-template-push-command.js +1 -1
  31. package/dist/commands/engage-template-validate-command.js +1 -1
  32. package/dist/commands/job-command.js +1 -1
  33. package/dist/commands/journey-command.js +1 -1
  34. package/dist/commands/journey-validate-command.js +1 -1
  35. package/dist/commands/llm-command.js +1 -1
  36. package/dist/commands/mcp-command.js +1 -1
  37. package/dist/commands/parent-segment-command.js +1 -1
  38. package/dist/commands/policy-command.js +1 -1
  39. package/dist/commands/profile-command.js +1 -1
  40. package/dist/commands/profiles-command.js +1 -1
  41. package/dist/commands/query-command.js +1 -1
  42. package/dist/commands/schedule-command.js +1 -1
  43. package/dist/commands/segment-command.js +1 -1
  44. package/dist/commands/segment-create-command.js +1 -1
  45. package/dist/commands/segment-fields-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/work-command.js +1 -1
  60. package/dist/commands/workflow-command.d.ts +27 -0
  61. package/dist/commands/workflow-command.d.ts.map +1 -1
  62. package/dist/commands/workflow-command.js +1 -1
  63. package/dist/commands/workflow-command.js.map +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/command-output.js +1 -1
  66. package/dist/core/config.js +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/tools/work-create-item.js +1 -1
  85. package/dist/mcp/utils.js +1 -1
  86. package/dist/proxy/claude-usage-tracker.js +1 -1
  87. package/dist/proxy/passthrough-server.js +1 -1
  88. package/dist/proxy/sse-usage-parser.js +1 -1
  89. package/dist/sdk/agent/agent-config.d.ts +10 -0
  90. package/dist/sdk/agent/agent-config.d.ts.map +1 -1
  91. package/dist/sdk/agent/agent-config.js +1 -1
  92. package/dist/sdk/agent/agent-config.js.map +1 -1
  93. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  94. package/dist/sdk/agent/agent-yaml.d.ts +61 -3
  95. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  96. package/dist/sdk/agent/agent-yaml.js +1 -1
  97. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  98. package/dist/sdk/agent/test/evaluator.js +1 -1
  99. package/dist/sdk/agent/test/executor.js +1 -1
  100. package/dist/sdk/agent/test/index.js +1 -1
  101. package/dist/sdk/agent/test/output.js +1 -1
  102. package/dist/sdk/agent/test/parser.js +1 -1
  103. package/dist/sdk/agent/tool-target-registry.js +1 -1
  104. package/dist/sdk/agent/types/agent-def.d.ts +43 -0
  105. package/dist/sdk/agent/types/agent-def.d.ts.map +1 -1
  106. package/dist/sdk/api.js +1 -1
  107. package/dist/sdk/cas/cas-api-client.js +1 -1
  108. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  109. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  110. package/dist/sdk/cas/index.js +1 -1
  111. package/dist/sdk/cas/pull-workflow.js +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/client/cdp-api-client.js +1 -1
  114. package/dist/sdk/client/delivery-api-client.js +1 -1
  115. package/dist/sdk/client/endpoints.js +1 -1
  116. package/dist/sdk/client/engage-api-client.js +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.d.ts +73 -1
  119. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  120. package/dist/sdk/client/llm-api-client.js +1 -1
  121. package/dist/sdk/client/llm-api-client.js.map +1 -1
  122. package/dist/sdk/client/oauth-refresh.js +1 -1
  123. package/dist/sdk/client/rate-limiter.js +1 -1
  124. package/dist/sdk/client/td-api-client.js +1 -1
  125. package/dist/sdk/client/trino-api-client.js +1 -1
  126. package/dist/sdk/client/workflow-client.d.ts +28 -1
  127. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  128. package/dist/sdk/client/workflow-client.js +1 -1
  129. package/dist/sdk/client/workflow-client.js.map +1 -1
  130. package/dist/sdk/connection-validator.js +1 -1
  131. package/dist/sdk/connection.js +1 -1
  132. package/dist/sdk/delivery.js +1 -1
  133. package/dist/sdk/engage/campaign-pull.js +1 -1
  134. package/dist/sdk/engage/campaign-push.js +1 -1
  135. package/dist/sdk/engage/campaign-validator.js +1 -1
  136. package/dist/sdk/engage/campaign-yaml.js +1 -1
  137. package/dist/sdk/engage/template-pull.js +1 -1
  138. package/dist/sdk/engage/template-push.js +1 -1
  139. package/dist/sdk/engage/template-validator.js +1 -1
  140. package/dist/sdk/engage/template-yaml.js +1 -1
  141. package/dist/sdk/engage/types/campaign-def.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  143. package/dist/sdk/engage/types/template-schema.js +1 -1
  144. package/dist/sdk/engage.js +1 -1
  145. package/dist/sdk/errors.js +1 -1
  146. package/dist/sdk/index.js +1 -1
  147. package/dist/sdk/io/index.js +1 -1
  148. package/dist/sdk/io/node-filesystem.js +1 -1
  149. package/dist/sdk/job.js +1 -1
  150. package/dist/sdk/journey.js +1 -1
  151. package/dist/sdk/llm/chat-cache.js +1 -1
  152. package/dist/sdk/llm/index.d.ts.map +1 -1
  153. package/dist/sdk/llm/index.js +1 -1
  154. package/dist/sdk/llm/index.js.map +1 -1
  155. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  156. package/dist/sdk/llm/model-factors.js +1 -1
  157. package/dist/sdk/personalization.js +1 -1
  158. package/dist/sdk/policy.js +1 -1
  159. package/dist/sdk/query/index.js +1 -1
  160. package/dist/sdk/query/sql-parser.js +1 -1
  161. package/dist/sdk/realtime.js +1 -1
  162. package/dist/sdk/schedule.js +1 -1
  163. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  164. package/dist/sdk/segment/fields-display.js +1 -1
  165. package/dist/sdk/segment/file-discovery.js +1 -1
  166. package/dist/sdk/segment/journey-utils.js +1 -1
  167. package/dist/sdk/segment/journey-validator.js +1 -1
  168. package/dist/sdk/segment/journey-yaml.js +1 -1
  169. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  170. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  171. package/dist/sdk/segment/pull-workflow.js +1 -1
  172. package/dist/sdk/segment/push-recovery.js +1 -1
  173. package/dist/sdk/segment/push-workflow.js +1 -1
  174. package/dist/sdk/segment/resolution-context.js +1 -1
  175. package/dist/sdk/segment/segment-path-parser.js +1 -1
  176. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  177. package/dist/sdk/segment/segment-validator.js +1 -1
  178. package/dist/sdk/segment/target-resolution.js +1 -1
  179. package/dist/sdk/segment/tdx-config.js +1 -1
  180. package/dist/sdk/segment/types/activation-schema.js +1 -1
  181. package/dist/sdk/segment/types/journey-def.js +1 -1
  182. package/dist/sdk/segment/types/journey-schema.js +1 -1
  183. package/dist/sdk/segment/types/segment-def.js +1 -1
  184. package/dist/sdk/segment/types/segment-schema.js +1 -1
  185. package/dist/sdk/segment/validate-files.js +1 -1
  186. package/dist/sdk/segment/yaml-validator.js +1 -1
  187. package/dist/sdk/segment.js +1 -1
  188. package/dist/sdk/types/index.d.ts +2 -2
  189. package/dist/sdk/types/index.d.ts.map +1 -1
  190. package/dist/sdk/types/index.js +1 -1
  191. package/dist/sdk/types/index.js.map +1 -1
  192. package/dist/sdk/types/llm.d.ts +158 -0
  193. package/dist/sdk/types/llm.d.ts.map +1 -1
  194. package/dist/sdk/types/progress.js +1 -1
  195. package/dist/sdk/types/workflow.d.ts +26 -0
  196. package/dist/sdk/types/workflow.d.ts.map +1 -1
  197. package/dist/sdk/types/workspace.js +1 -1
  198. package/dist/sdk/user.js +1 -1
  199. package/dist/sdk/util/format-detector.js +1 -1
  200. package/dist/sdk/util/formatters.js +1 -1
  201. package/dist/sdk/util/index.js +1 -1
  202. package/dist/sdk/util/paginate.js +1 -1
  203. package/dist/sdk/util/tree-formatter.js +1 -1
  204. package/dist/sdk/workflow/archive-validation.js +1 -1
  205. package/dist/sdk/workflow/clone-workflow.js +1 -1
  206. package/dist/sdk/workflow/index.d.ts +22 -0
  207. package/dist/sdk/workflow/index.d.ts.map +1 -1
  208. package/dist/sdk/workflow/index.js +1 -1
  209. package/dist/sdk/workflow/index.js.map +1 -1
  210. package/dist/sdk/workflow/pull-workflow.js +1 -1
  211. package/dist/sdk/workflow/push-workflow.js +1 -1
  212. package/dist/sdk/workflow/tdx-config.js +1 -1
  213. package/dist/sdk/workflow/workflow-utils.js +1 -1
  214. package/dist/sdk/workspace/frontmatter.js +1 -1
  215. package/dist/sdk/workspace/git.js +1 -1
  216. package/dist/sdk/workspace/index.js +1 -1
  217. package/dist/sdk/workspace/templates.js +1 -1
  218. package/dist/sdk/workspace/weekly.js +1 -1
  219. package/dist/sdk/workspace/wikilinks.js +1 -1
  220. package/dist/test-utils/command-runner.js +1 -1
  221. package/dist/test-utils/factories.js +1 -1
  222. package/dist/test-utils/fixtures.js +1 -1
  223. package/dist/test-utils/http-mock.js +1 -1
  224. package/dist/test-utils/index.js +1 -1
  225. package/dist/utils/async.js +1 -1
  226. package/dist/utils/colors.js +1 -1
  227. package/dist/utils/diff.js +1 -1
  228. package/dist/utils/file-permissions.js +1 -1
  229. package/dist/utils/file-reader.js +1 -1
  230. package/dist/utils/github-releases.js +1 -1
  231. package/dist/utils/global-cache.js +1 -1
  232. package/dist/utils/json-loader.js +1 -1
  233. package/dist/utils/local-cache.js +1 -1
  234. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  235. package/dist/utils/logger/formatters/index.js +1 -1
  236. package/dist/utils/logger/handlers/console-handler.js +1 -1
  237. package/dist/utils/logger/handlers/file-handler.js +1 -1
  238. package/dist/utils/logger/handlers/index.js +1 -1
  239. package/dist/utils/logger/handlers/null-handler.js +1 -1
  240. package/dist/utils/logger/index.js +1 -1
  241. package/dist/utils/logger/logger.js +1 -1
  242. package/dist/utils/logger/types.js +1 -1
  243. package/dist/utils/option-validation.js +1 -1
  244. package/dist/utils/process.d.ts.map +1 -1
  245. package/dist/utils/process.js +1 -1
  246. package/dist/utils/process.js.map +1 -1
  247. package/dist/utils/prompt.js +1 -1
  248. package/dist/utils/spinner.js +1 -1
  249. package/dist/utils/sse-parser.js +1 -1
  250. package/dist/utils/string-utils.js +1 -1
  251. package/dist/utils/table-ref-parser.js +1 -1
  252. package/dist/utils/tdx-logger.js +1 -1
  253. package/dist/utils/version-check.js +1 -1
  254. package/package.json +2 -2
@@ -1 +1 @@
1
- const a31_0x3334a4=a31_0x2bf9;(function(_0x143ef9,_0x4f18eb){const _0xa868ff=a31_0x2bf9,_0x1f71eb=_0x143ef9();while(!![]){try{const _0x3891f2=-parseInt(_0xa868ff(0x12c))/0x1+parseInt(_0xa868ff(0x1df))/0x2+parseInt(_0xa868ff(0x28f))/0x3*(parseInt(_0xa868ff(0x2b7))/0x4)+-parseInt(_0xa868ff(0x22d))/0x5*(-parseInt(_0xa868ff(0x2c1))/0x6)+-parseInt(_0xa868ff(0x225))/0x7+parseInt(_0xa868ff(0x1a9))/0x8*(parseInt(_0xa868ff(0x2d7))/0x9)+-parseInt(_0xa868ff(0x294))/0xa*(parseInt(_0xa868ff(0x130))/0xb);if(_0x3891f2===_0x4f18eb)break;else _0x1f71eb['push'](_0x1f71eb['shift']());}catch(_0x15313c){_0x1f71eb['push'](_0x1f71eb['shift']());}}}(a31_0x5870,0x71b58));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x45b635 from'path';import{BaseCommand}from'./command.js';function a31_0x5870(){const _0x11838e=['Creating','ps:rt:jn:resume','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','getPersonalization','\x20\x20\x20\x20\x20\x20\x20\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Apply\x20changes\x20to\x20\x27','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','tokens','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20--behavior\x20\x22','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Creating\x20parent\x20segment\x20\x27','ps:rt:list','segment:parent:pull','user_id','single','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','ps:pz:patch','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','yellow','status','list','getParentSQL','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','segment:parent:validate','\x20tdx\x20wf\x20attempt\x20','createPersonalization','get','\x20total','\x20Added\x20personalization\x20template\x20to\x20','type','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','displayMasterInfo','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','\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','deleteToken','\x27...','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','FINISHED','/attempt/','segment:parent:show','displaySummary','Listing\x20personalization\x20services\x20for\x20\x27','`\x20to\x20download\x20the\x20configuration\x20first','\x20\x20No\x20sample\x20data\x20available','Deleting\x20personalization\x20\x27','<database>.<table>','schemaError','Schema\x20saved\x20to\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','in\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','sourceTableValid','Errors:','\x20\x20\x20\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','information_schema','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Options\x20(one\x20required):\x0a','columns','displaySampleData','folderId','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','replace','\x20Context\x20set:\x20','jsonl','patchPersonalization','Events:','sections:','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','displayAttributesStats','customerGroup','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','payload:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','Preview:','Listing\x20fields\x20for\x20\x27','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Create\x20a\x20realtime\x20personalization\x20entity','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','\x20--enriched','/sessions/','\x20parent\x20segment','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','36390XLQilv','\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','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','label','red','8540xsHpNG','\x20--interval\x20','json','segment:parent:run','To\x20view\x20sample\x20data:','No\x20RT\x20journeys\x20found','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','\x20\x201.\x20Edit\x20','{\x0a\x20\x20\x22database\x22:\x20\x22','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','✔\x20Deleted\x20personalization\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','✔\x20Created\x20token\x20\x27','site','green','\x20+\x20[','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','Listing\x20parent\x20segments...','parentFolder','Show\x20personalization\x20service\x20details','parentSegment','push','file','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','Creating\x20token\x20\x27','formatSchemaJson','updateParent','identifier','toFixed','enriched','Columns:','eventKind','172MeZerF','Options:','ps:pz:list','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','limit','map','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','getOutputDatabaseName','Updated','6tLKXjH','workflowId','ps:pz:service:create','\x0a\x20\x20\x20\x20}','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','state','Show\x20parent\x20segment\x20details','Attributes','keyEventCriteria','listParents','resolveParentId','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Personalization\x20service\x20description','Created','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','allowedIps','bold','Listing\x20parent\x20segments\x20matching\x20\x27','/{name}.yml\x0a','\x27\x20is\x20already\x20up\x20to\x20date','updatedAt','59589GwGeoN','\x20=\x20','Join\x20on:','resumeJourney','Attributes:','\x20RT\x20configuration\x20is\x20valid','displayRealtimeInfo','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','No\x20personalizations\x20configured','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','start','Aborted.','\x27\x20(id:\x20','\x27\x20with\x20ID:\x20','jobId','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Error:\x20Personalization\x20ID\x20is\x20required','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','Master\x20+\x20Attributes','getParentFull','\x20Added\x20RT\x202.0\x20template\x20section','\x0aChanges\x20to\x20\x27','using\x20the\x20default\x20path:\x20','joinKey','\x20\x20\x20\x20\x20\x20','public:','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x27\x20and\x20run\x20workflow?','dim','Error:','eventKind:\x20','\x20[Job\x20ID:\x20','error','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','length','Error:\x20--behavior\x20requires\x20a\x20name\x0a','workflowSessionId','Default','filter','parent_segment','createToken','✔\x20Updated\x20personalization\x20service\x20\x27','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','ps:pz:create','stageCount','deletePersonalization','Enriched:','allowed\x20IPs:','/\x20directories\x20exist.','\x0a⚠️\x20\x20Both\x20','timezone','launched','customers','Table:\x20','\x20\x20Columns:\x20','ps:pz:show','✔\x20Found\x20','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','\x20true','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','No\x20RT-enabled\x20parent\x20segments\x20found','run','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','Validate:','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Error:\x20Token\x20\x27','primaryKey','segment:parent:sql','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','createParent','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','👥\x20','entryCriteria:','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','sampleData','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','displayPreviewHints','ps:pz:service:update','stop','Fetching\x20sample\x20data...','getBehaviorNames','Patching\x20personalization\x20\x27','audienceId:\x20','\x20Opening\x20','RT\x202.0\x20Validate:','join','value','Error:\x20Service\x20name\x20is\x20required','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','localeCompare','repeat','✔\x20Deleted\x20personalization\x20service\x20\x27','keyEventId','Behavior:','folder-segment','validateParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Fetching\x20personalization\x20service\x20\x27','ps:rt:jn:list','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Finding\x20service\x20for\x20token...','platform','behavior_','pullParentYaml','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','status:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','ps:pz:init','foreignKey','324883cNQZxK','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Create\x20parent\x20segment\x20\x27','10791KyLgCd','Source:','ID\x20Stitching:','name','Error\x20reading\x20file:\x20','column_name','\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','\x20service(s)\x20configured','tdx\x20ps\x20push\x20','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','segment:parent:create','Attribute:','.yml','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','identifier:\x20','updated:','unref','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','\x20configured','\x0aNew\x20parent\x20segment\x20\x27','RT\x20Journey\x20ID:\x20','sourceTableError','public','\x20--attribute\x20\x22','idStitching','schemaValid','Pause\x20activations\x20in\x20an\x20RT\x20journey','population','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','any','Updating','\x22\x20}','%)\x20','attributesFile','darwin','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','delete','\x20personalization','personalization_services','yes','apply','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','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','audienceId','number','Status:','interval','web','scheduleType','execute','utf-8','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','SELECT\x20*\x20FROM\x20','Fetching\x20behavior\x20list...','workflowAttemptId','YAML\x20file:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Error:\x20--name\x20is\x20required','/\x20and\x20','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','Error:\x20Service\x20ID\x20is\x20required','To\x20cancel:','\x20\x20Tables:\x201\x20customers\x20+\x20','\x20--attribute\x20\x22<name>\x22','Pattern:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x0aNo\x20sample\x20data\x20available','personalization','No\x20personalization\x20services\x20configured','\x5c$&','paused','realtime','Master\x20Table','Overwrite\x20\x27','\x20RT-enabled\x20parent\x20segment','behaviorsFile','\x20\x20Note:\x20','ps:pz:service:show','valid','isDirectory','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','\x20--behavior\x20\x22<name>\x22','\x0a\x20\x20]\x0a}\x0a','Master:','xdg-open','Deleting\x20personalization\x20service\x20\x27','customerGroupFile','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','all','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','behavior','No\x20parent\x20segments\x20match\x20pattern:\x20','Behaviors','listFields','Fetching\x20current\x20configuration\x20for\x20\x27','column_type','.customers)','Fetching\x20SQL\x20for\x20\x27','Resume\x20activations\x20in\x20an\x20RT\x20journey','/app/dw/parentSegments/','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','some','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x20No\x20changes\x20-\x20','trim','setJobId','⚡\x20Enabled','pushParentYaml','format','last_page_viewed','personalizationServices','Join:','tdx\x20ps\x20preview\x20','\x27\x20for\x20service\x20\x27','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','\x20\x202.\x20Run\x20','344BofAwL','✔\x20Updated\x20personalization\x20\x27','Fetching\x20customers\x20schema...','.yaml','column','endsWith','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Fetching\x20parent\x20segment\x20\x27','Error:\x20Token\x20name\x20is\x20required','Available\x20behaviors:','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','includeSensitive','segment','\x20stage','\x27\x20is\x20up\x20to\x20date','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','\x20\x20\x20','\x20\x20\x20\x20-\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Updating\x20personalization\x20service\x20\x27','\x20(paused)','ps:rt:validate','parent_segments','RT\x202.0:','Analyzing\x20changes...','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','match','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','\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','description','Show\x20parent\x20segment\x20schema\x20(column\x20types)','displayBehaviorsStats','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','getCurrentConfigVersion','dirname','Validating\x20configuration...','behaviors','Personalization:','Next\x20steps:','errors','Attempt:','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','rowCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','page_view','log','double','Listing\x20RT-enabled\x20parent\x20segments...','\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Update\x20a\x20realtime\x20personalization\x20entity','ignore','cyan','1556966yNtjWL','customerPercent','entryCriteria','✔\x20Retrieved\x20RT\x20configuration\x20version','varchar','verbose','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','true','List\x20available\x20fields\x20for\x20segmentation','payload','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','displayValidateResults','displayColumns','\x0aUsage:\x20tdx\x20ps\x20preview\x20','master','\x0a⚠️\x20\x20Migrating:\x20','Customers:','Options:\x0a','Parent\x20segment:\x20','segment:parent:view','Listing\x20personalizations\x20for\x20\x27','Get\x20current\x20RT\x20configuration\x20version\x20status','ps:pz:service:delete','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','sections','Validating\x20RT\x20configuration...','\x20is\x20already\x20up\x20to\x20date','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','message','attribute','parent_id','Error:\x20Token\x20ID\x20is\x20required','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\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','null','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','\x20field','toLocaleString','✔\x20Created\x20personalization\x20service\x20\x27','\x20to\x20push\x20the\x20configuration','\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}','database','attributes','test','(id:\x20','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','\x20RT\x20journey','\x20Configuration\x20is\x20valid','table','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Executing\x20parent\x20segment\x20query...','string','No\x20parent\x20segments\x20found','data','✔\x20Created\x20personalization\x20\x27','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','ps:pz:service:list','realtime_enabled','coveragePercent','\x0aError:','scheduleOption','pauseJourney','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','events','split','matchedCount','processedRows','text','1115016NupXxF','Site:\x20','elapsedTimeMillis','output','toLowerCase','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','stats','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','1014605urqCSG','Resolving\x20parent\x20segment\x20\x27','Database:\x20','✔\x20No\x20changes\x20-\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','allValid','segment:parent:update','stitchingKeys','Creating\x20personalization\x20service\x20\x27','\x22,\x20\x22type\x22:\x20\x22'];a31_0x5870=function(){return _0x11838e;};return a31_0x5870();}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';function a31_0x2bf9(_0xd5b598,_0x528af2){_0xd5b598=_0xd5b598-0xef;const _0x5870ee=a31_0x5870();let _0x2bf9a2=_0x5870ee[_0xd5b598];return _0x2bf9a2;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x47c070 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_0x3334a4(0x1bf),LEGACY_PARENT_SEGMENT_DIR=a31_0x3334a4(0x2fe);function openBrowser(_0x13d708){const _0x15971e=a31_0x3334a4,_0x2c74d5=process[_0x15971e(0x124)],_0x40d8e3=_0x2c74d5===_0x15971e(0x154)?'open':_0x2c74d5==='win32'?_0x15971e(0x2e1):_0x15971e(0x188);spawn(_0x40d8e3,[_0x13d708],{'detached':!![],'stdio':_0x15971e(0x1dd)})[_0x15971e(0x140)]();}function migrateLegacyDirectory(){const _0x158f58=a31_0x3334a4;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x55ff7c=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x55ff7c[_0x158f58(0x183)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a31_0x47c070[_0x158f58(0x24c)](_0x158f58(0xef)+LEGACY_PARENT_SEGMENT_DIR+_0x158f58(0x16e)+PARENT_SEGMENT_DIR+_0x158f58(0x307))),console[_0x158f58(0x2f7)](a31_0x47c070[_0x158f58(0x2f3)](_0x158f58(0x28e)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x158f58(0x2f7)](a31_0x47c070[_0x158f58(0x24c)](_0x158f58(0x1ee)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x158f58(0x2f7)](a31_0x47c070['green']('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x583a2f){const _0x55d43a=_0x583a2f instanceof Error?_0x583a2f[_0x158f58(0x1fc)]:String(_0x583a2f);return console[_0x158f58(0x2f7)](a31_0x47c070['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x55d43a+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x5274c8){const _0x504d89=a31_0x3334a4;return migrateLegacyDirectory(),super[_0x504d89(0xfb)](_0x5274c8);}}function resolveYamlFile(_0x45040c){const _0x4d3edf=a31_0x3334a4;if(_0x45040c[_0x4d3edf(0x1ae)](_0x4d3edf(0x13c))||_0x45040c[_0x4d3edf(0x1ae)](_0x4d3edf(0x1ac)))return _0x45040c;return a31_0x45b635[_0x4d3edf(0x114)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x45040c)+_0x4d3edf(0x13c));}function formatProgressMessage(_0x2b2226){const _0x1f3208=a31_0x3334a4,_0x1d8ba5=_0x2b2226[_0x1f3208(0x1c3)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x1d8ba5){const [,_0x1f3edd,_0x333a3e,_0x148549='']=_0x1d8ba5;return a31_0x47c070['dim'](_0x1f3edd+':')+'\x20'+_0x333a3e+a31_0x47c070[_0x1f3208(0x2f3)](_0x148549);}return a31_0x47c070[_0x1f3208(0x2f3)](_0x2b2226);}function showFileNotFoundError(_0x4e5456,_0x4d22c3){const _0x4f3ef6=a31_0x3334a4;console['error'](a31_0x47c070[_0x4f3ef6(0x293)]('Error:\x20File\x20not\x20found:\x20'+_0x4e5456+'\x0a')),console['error'](a31_0x47c070['cyan'](_0x4f3ef6(0x19a)+_0x4d22c3+_0x4f3ef6(0x266)));}function displayRealtimeValidation(_0x124e72){const _0x244085=a31_0x3334a4;if(!_0x124e72['realtime'])return;const _0x37aba7=_0x124e72[_0x244085(0x17b)],_0x278f87=_0x37aba7['enabled']?a31_0x47c070[_0x244085(0x2a3)](_0x244085(0x19e)):a31_0x47c070[_0x244085(0x24c)]('⚡\x20Not\x20enabled');console[_0x244085(0x2f7)]('\x0a'+a31_0x47c070[_0x244085(0x2f3)](_0x244085(0x1c0))+'\x20'+_0x278f87);if(_0x37aba7[_0x244085(0x220)]&&_0x37aba7[_0x244085(0x220)][_0x244085(0x2f9)]>0x0){console[_0x244085(0x2f7)]('\x20\x20'+a31_0x47c070['dim'](_0x244085(0x27e))+'\x20'+_0x37aba7[_0x244085(0x220)][_0x244085(0x2f9)]+_0x244085(0x144));for(const _0x31e49e of _0x37aba7[_0x244085(0x220)]){const _0xff7b25=_0x31e49e[_0x244085(0x26f)]===![]?a31_0x47c070[_0x244085(0x293)]('✘'):a31_0x47c070['green']('✔');console[_0x244085(0x2f7)](_0x244085(0x271)+_0xff7b25+'\x20'+_0x31e49e[_0x244085(0x133)]),_0x31e49e[_0x244085(0x147)]&&console[_0x244085(0x2f7)]('\x20\x20\x20\x20\x20\x20'+a31_0x47c070['red'](_0x31e49e[_0x244085(0x147)]));}}if(_0x37aba7[_0x244085(0x20b)]&&_0x37aba7[_0x244085(0x20b)][_0x244085(0x2f9)]>0x0){console[_0x244085(0x2f7)]('\x20\x20'+a31_0x47c070[_0x244085(0x2f3)](_0x244085(0x2db))+'\x20'+_0x37aba7[_0x244085(0x20b)]['length']+_0x244085(0x144));for(const _0x2aac54 of _0x37aba7[_0x244085(0x20b)]){const _0x1d4ffc=_0x2aac54[_0x244085(0x182)]?a31_0x47c070[_0x244085(0x2a3)]('✔'):a31_0x47c070[_0x244085(0x293)]('✘');console['error'](_0x244085(0x271)+_0x1d4ffc+'\x20'+_0x2aac54[_0x244085(0x133)]+'\x20'+a31_0x47c070[_0x244085(0x2f3)]('('+_0x2aac54[_0x244085(0x257)]+')'));}}if(_0x37aba7[_0x244085(0x14a)]){const _0x4c9785=_0x37aba7[_0x244085(0x14a)][_0x244085(0x234)]?.[_0x244085(0x2f9)]?_0x244085(0x2a4)+_0x37aba7['idStitching'][_0x244085(0x234)][_0x244085(0x114)](',\x20')+']':'';console[_0x244085(0x2f7)]('\x20\x20'+a31_0x47c070['dim'](_0x244085(0x132))+'\x20'+_0x37aba7[_0x244085(0x14a)][_0x244085(0x100)]+_0x4c9785);}if(_0x37aba7['personalizationServices']&&_0x37aba7[_0x244085(0x1a2)][_0x244085(0x2f9)]>0x0){console['error']('\x20\x20'+a31_0x47c070['dim'](_0x244085(0x1ce))+'\x20'+_0x37aba7[_0x244085(0x1a2)]['length']+'\x20service'+(_0x37aba7[_0x244085(0x1a2)][_0x244085(0x2f9)]!==0x1?'s':''));for(const _0x104f43 of _0x37aba7[_0x244085(0x1a2)]){console['error']('\x20\x20\x20\x20-\x20'+_0x104f43[_0x244085(0x133)]);}}}function showParentSegmentNotSetError(_0x462e24){const _0x161697=a31_0x3334a4;console[_0x161697(0x2f7)](a31_0x47c070['yellow'](_0x161697(0x231))),console[_0x161697(0x2f7)](_0x462e24);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x3334a4(0x133)]='segment:parent:list';['description']='List\x20parent\x20segments';async['execute'](_0x43a60f){const _0x375358=a31_0x3334a4,{options:_0xaa70e6,args:_0x35a9b9,tdx:_0x41e2ec}=_0x43a60f,_0x565116=_0x35a9b9[0x0];_0xaa70e6[_0x375358(0x1e4)]&&(console[_0x375358(0x2f7)](_0x375358(0x226)+_0xaa70e6[_0x375358(0x2a2)]),_0x565116&&console[_0x375358(0x2f7)](_0x375358(0x174)+_0x565116));const _0x48e25c=await withSpinner(_0x565116?_0x375358(0x2d3)+_0x565116+_0x375358(0x25e):_0x375358(0x2a7),()=>_0x41e2ec['segment'][_0x375358(0x2ca)](),{'verbose':_0xaa70e6[_0x375358(0x1e4)]});let _0x1a459f=_0x48e25c[_0x375358(0x216)];if(_0x565116){const _0x4eef10=_0x565116[_0x375358(0x27a)](/[.+^${}()|[\]\\]/g,_0x375358(0x179))[_0x375358(0x27a)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1b6dda=new RegExp('^'+_0x4eef10+'$','i');_0x1a459f=_0x1a459f[_0x375358(0x2fd)](_0x19c4dc=>_0x1b6dda[_0x375358(0x20c)](_0x19c4dc[_0x375358(0x20b)][_0x375358(0x133)]));}_0x1a459f['sort']((_0xfa3ed1,_0x590927)=>_0xfa3ed1[_0x375358(0x20b)][_0x375358(0x133)][_0x375358(0x118)](_0x590927['attributes']['name'])),console[_0x375358(0x2f7)](_0x375358(0xf6)+_0x1a459f[_0x375358(0x2f9)]+_0x375358(0x28d)+(_0x1a459f[_0x375358(0x2f9)]!==0x1?'s':''));const _0x549bf1=_0x2b57c7=>{const _0x27dd7d=_0x375358;return getConsoleNextUrl(_0xaa70e6[_0x27dd7d(0x2a2)],_0x27dd7d(0x197)+_0x2b57c7);};if(_0xaa70e6[_0x375358(0x1a0)]===_0x375358(0x296)||_0xaa70e6[_0x375358(0x1a0)]===_0x375358(0x27c)){const _0xd0db43=_0x1a459f['map'](_0x1df848=>({..._0x1df848,'url':_0x549bf1(_0x1df848['id'])}));await handleSDKOutput(_0xd0db43,_0xaa70e6);}else{if(_0x1a459f['length']===0x0)_0x565116?console[_0x375358(0x1d7)](_0x375358(0x18f)+_0x565116):console['log'](_0x375358(0x215));else for(const _0x27e939 of _0x1a459f){const _0x2ea536=_0x27e939[_0x375358(0x20b)][_0x375358(0x14d)]?a31_0x47c070[_0x375358(0x2f3)]('\x20('+formatRows(_0x27e939[_0x375358(0x20b)]['population'])+')'):'',_0x32ae2c=hyperlink(_0x27e939[_0x375358(0x20b)][_0x375358(0x133)],_0x549bf1(_0x27e939['id']));console[_0x375358(0x1d7)](_0x375358(0x105)+_0x32ae2c+_0x2ea536);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x13a);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x2f1);async['execute'](_0xab241f){const _0x335220=a31_0x3334a4,{options:_0x2b114a,args:_0x481d92,tdx:_0x1c5ee5}=_0xab241f;console['error'](_0x335220(0x1d3)+_0x335220(0x200)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x157c36=_0x2b114a;if(_0x481d92['length']===0x0)return console[_0x335220(0x2f7)](a31_0x47c070[_0x335220(0x293)](_0x335220(0x26c))),console[_0x335220(0x2f7)](_0x335220(0x109)),0x1;const _0x36154e=_0x481d92[0x0];if(!_0x157c36['database']||!_0x157c36[_0x335220(0x211)])return console[_0x335220(0x2f7)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x335220(0x2f7)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x157c36[_0x335220(0x1e4)]&&(console['error'](_0x335220(0x226)+_0x157c36[_0x335220(0x2a2)]),console[_0x335220(0x2f7)]('Name:\x20'+_0x36154e),console[_0x335220(0x2f7)](_0x335220(0x22f)+_0x157c36[_0x335220(0x20a)]),console[_0x335220(0x2f7)](_0x335220(0xf3)+_0x157c36['table']));const _0x1a961a=await loadJSONFromOptions(_0x157c36[_0x335220(0x20b)],_0x157c36[_0x335220(0x153)]),_0x36f505=await loadJSONFromOptions(_0x157c36[_0x335220(0x1cd)],_0x157c36[_0x335220(0x17f)]),_0x4c0c75=await loadJSONFromOptions(_0x157c36[_0x335220(0x282)],_0x157c36[_0x335220(0x18a)]),_0x2bb053={'name':_0x36154e,'description':_0x157c36[_0x335220(0x1c6)],'scheduleType':_0x157c36[_0x335220(0x164)],'scheduleOption':_0x157c36['scheduleOption'],'timezone':_0x157c36[_0x335220(0xf0)],'master':{'parentDatabaseName':_0x157c36[_0x335220(0x20a)],'parentTableName':_0x157c36[_0x335220(0x211)]},'attributes':_0x1a961a,'behaviors':_0x36f505,'customerGroup':_0x4c0c75},_0x39ae5b=await withSpinner(_0x335220(0x244)+_0x36154e+'\x27...',()=>_0x1c5ee5[_0x335220(0x1b5)][_0x335220(0x103)](_0x2bb053),{'verbose':_0x2b114a[_0x335220(0x1e4)]}),_0x42385c=_0x39ae5b[_0x335220(0x216)];return console[_0x335220(0x2f7)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x42385c[_0x335220(0x133)]+_0x335220(0x2e4)+_0x42385c['id']),await handleSDKOutput([_0x42385c],_0x2b114a),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x233);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x243);async['execute'](_0x269593){const _0x50f1b4=a31_0x3334a4,{options:_0x4d01e5,args:_0x4eeac5,tdx:_0x2d189b}=_0x269593;console[_0x50f1b4(0x2f7)](_0x50f1b4(0x29f)+_0x50f1b4(0x200)+_0x50f1b4(0x203));const _0x496299=_0x4d01e5;if(_0x4eeac5[_0x50f1b4(0x2f9)]===0x0)return console[_0x50f1b4(0x2f7)](a31_0x47c070[_0x50f1b4(0x293)](_0x50f1b4(0x26c))),console[_0x50f1b4(0x2f7)](_0x50f1b4(0x198)),0x1;const _0x52de4a=_0x4eeac5[0x0];_0x496299['verbose']&&(console[_0x50f1b4(0x2f7)]('Site:\x20'+_0x496299[_0x50f1b4(0x2a2)]),console[_0x50f1b4(0x2f7)](_0x50f1b4(0x1f1)+_0x52de4a));const _0x416cd7=await withSpinner(_0x50f1b4(0x192)+_0x52de4a+_0x50f1b4(0x25e),()=>_0x2d189b[_0x50f1b4(0x1b5)]['getParentFull'](_0x52de4a),{'verbose':_0x496299['verbose']}),_0x40f212=_0x416cd7[_0x50f1b4(0x216)],_0x5a3f1a=await loadJSONFromOptions(_0x496299['addAttributes'],_0x496299['addAttributesFile']),_0x221ebe=await loadJSONFromOptions(_0x496299['addBehaviors'],_0x496299['addBehaviorsFile']),_0x29ed38={'name':_0x40f212[_0x50f1b4(0x133)],'description':_0x496299[_0x50f1b4(0x1c6)]!==undefined?_0x496299[_0x50f1b4(0x1c6)]:_0x40f212[_0x50f1b4(0x1c6)],'scheduleType':_0x496299[_0x50f1b4(0x164)]!==undefined?_0x496299[_0x50f1b4(0x164)]:_0x40f212[_0x50f1b4(0x164)],'scheduleOption':_0x496299[_0x50f1b4(0x21d)]!==undefined?_0x496299[_0x50f1b4(0x21d)]:_0x40f212['scheduleOption'],'timezone':_0x496299[_0x50f1b4(0xf0)]!==undefined?_0x496299[_0x50f1b4(0xf0)]:_0x40f212[_0x50f1b4(0xf0)],'master':_0x40f212[_0x50f1b4(0x1ed)],'attributes':_0x5a3f1a?[..._0x40f212['attributes']||[],..._0x5a3f1a]:_0x40f212[_0x50f1b4(0x20b)],'behaviors':_0x221ebe?[..._0x40f212[_0x50f1b4(0x1cd)]||[],..._0x221ebe]:_0x40f212[_0x50f1b4(0x1cd)],'customerGroup':_0x40f212[_0x50f1b4(0x282)]},_0x5a24d2=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x52de4a+_0x50f1b4(0x25e),()=>_0x2d189b[_0x50f1b4(0x1b5)][_0x50f1b4(0x2b1)](_0x52de4a,_0x29ed38),{'verbose':_0x496299[_0x50f1b4(0x1e4)]}),_0x16f598=_0x5a24d2[_0x50f1b4(0x216)];return console[_0x50f1b4(0x2f7)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x16f598[_0x50f1b4(0x133)]+'\x27'),await handleSDKOutput([_0x16f598],_0x496299),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x246);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x280);async[a31_0x3334a4(0x165)](_0x3d5b76){const _0x57015e=a31_0x3334a4,{options:_0x3c55f1,args:_0x3bc0d3,tdx:_0x30884c}=_0x3d5b76,_0x3ece0c=_0x3c55f1,_0x444d07=_0x3bc0d3[0x0]||_0x3c55f1[_0x57015e(0x2aa)];if(!_0x444d07)return showParentSegmentNotSetError(_0x57015e(0x10a)+_0x57015e(0x1d5)),0x1;if(_0x3ece0c['use']&&_0x3ece0c['output'])return console['error'](a31_0x47c070['red'](_0x57015e(0x212))),console['error'](a31_0x47c070[_0x57015e(0x2f3)](_0x57015e(0x2ba))),console['error'](a31_0x47c070[_0x57015e(0x2f3)](_0x57015e(0x2ed)+PARENT_SEGMENT_DIR+_0x57015e(0x2d4))),console[_0x57015e(0x2f7)](a31_0x47c070[_0x57015e(0x1de)](_0x57015e(0x127))),0x1;const _0x2277b2=_0x3ece0c[_0x57015e(0x228)]||a31_0x45b635[_0x57015e(0x114)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x444d07)+_0x57015e(0x13c));_0x3ece0c[_0x57015e(0x1e4)]&&(console['error'](_0x57015e(0x226)+_0x3ece0c[_0x57015e(0x2a2)]),console['error']('Parent\x20segment:\x20'+_0x444d07),console['error']('Output\x20file:\x20'+_0x2277b2));const _0x3313a6=await withSpinner(_0x57015e(0x1b0)+_0x444d07+'\x27...',()=>_0x30884c['segment'][_0x57015e(0x126)](_0x444d07),{'verbose':_0x3ece0c[_0x57015e(0x1e4)]}),_0x268243=_0x3313a6['data'];if(existsSync(_0x2277b2)){const _0x31b082=readFileSync(_0x2277b2,'utf-8'),_0x2c3740=generateDiff(_0x31b082,_0x268243);if(!hasChanges(_0x2c3740))console[_0x57015e(0x2f7)](a31_0x47c070[_0x57015e(0x2a3)]('✔')+_0x57015e(0x19b)+a31_0x47c070[_0x57015e(0x1de)](_0x2277b2)+_0x57015e(0x1f9));else{console[_0x57015e(0x2f7)](_0x57015e(0x2ec)+_0x2277b2+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x57015e(0x2f7)](formatDiffWithColors(_0x2c3740)),console[_0x57015e(0x2f7)]('─'['repeat'](0x3c));if(!_0x3ece0c[_0x57015e(0x15b)]){if(!isInteractive())return console[_0x57015e(0x2f7)](a31_0x47c070[_0x57015e(0x293)]('\x0aError:'),_0x57015e(0x16c)),console[_0x57015e(0x2f7)](a31_0x47c070[_0x57015e(0x2f3)](_0x57015e(0x122))),0x1;const _0x34ac8e=await confirmKey(_0x57015e(0x17d)+_0x2277b2+'\x27?');if(!_0x34ac8e)return console[_0x57015e(0x2f7)](a31_0x47c070[_0x57015e(0x24c)](_0x57015e(0x2e2))),0x1;}writeFileSync(_0x2277b2,_0x268243,_0x57015e(0x166)),console[_0x57015e(0x2f7)](a31_0x47c070['green']('✔')+_0x57015e(0x274)+a31_0x47c070[_0x57015e(0x1de)](_0x2277b2));}}else{const _0x232052=a31_0x45b635[_0x57015e(0x1cb)](_0x2277b2);!existsSync(_0x232052)&&mkdirSync(_0x232052,{'recursive':!![]}),writeFileSync(_0x2277b2,_0x268243,_0x57015e(0x166)),console['error'](a31_0x47c070['green']('✔')+_0x57015e(0x274)+a31_0x47c070[_0x57015e(0x1de)](_0x2277b2));}return saveSessionContext({'parent_segment':_0x444d07},_0x3ece0c['session']),console['error'](a31_0x47c070[_0x57015e(0x2a3)]('✔')+_0x57015e(0x27b)+a31_0x47c070[_0x57015e(0x2f3)](_0x57015e(0x2fe))+_0x57015e(0x2d8)+a31_0x47c070['cyan'](_0x444d07)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']='segment:parent:push';[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x141);async['execute'](_0x4c3221){const _0x1f11ce=a31_0x3334a4,{options:_0x8c9fd6,args:_0x481040,tdx:_0x28edad}=_0x4c3221,_0x5ee36e=_0x8c9fd6,_0x247e39=_0x481040[0x0]||_0x8c9fd6[_0x1f11ce(0x2aa)];if(!_0x247e39)return showParentSegmentNotSetError(_0x1f11ce(0x12e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x284636=resolveYamlFile(_0x247e39);if(!existsSync(_0x284636))return showFileNotFoundError(_0x284636,_0x247e39),0x1;_0x5ee36e['verbose']&&(console['error'](_0x1f11ce(0x226)+_0x5ee36e[_0x1f11ce(0x2a2)]),console[_0x1f11ce(0x2f7)](_0x1f11ce(0x16b)+_0x284636));let _0x2c8b67;try{_0x2c8b67=readFileSync(_0x284636,_0x1f11ce(0x166));}catch(_0x138ce2){const _0x548be3=_0x138ce2 instanceof Error?_0x138ce2['message']:String(_0x138ce2);return console['error'](_0x1f11ce(0x134)+_0x548be3),0x1;}const _0x383292=await withSpinner('Analyzing\x20changes...',()=>_0x28edad[_0x1f11ce(0x1b5)][_0x1f11ce(0x19f)](_0x2c8b67),{'verbose':_0x5ee36e[_0x1f11ce(0x1e4)]}),_0x512306=_0x383292[_0x1f11ce(0x216)],{isNew:_0xc678ef,name:_0x3300be,hasChanges:_0xe5220e,diffFormatted:_0x276d06}=_0x512306;if(!_0xe5220e)return console[_0x1f11ce(0x2f7)](_0x1f11ce(0x230)+_0x3300be+_0x1f11ce(0x2d5)),0x0;_0xc678ef?console[_0x1f11ce(0x2f7)](_0x1f11ce(0x145)+_0x3300be+'\x27:'):console['error'](_0x1f11ce(0x23e)+_0x3300be+'\x27:');console[_0x1f11ce(0x2f7)]('─'['repeat'](0x3c)),console[_0x1f11ce(0x2f7)](_0x276d06),console[_0x1f11ce(0x2f7)]('─'[_0x1f11ce(0x119)](0x3c));const _0x43925b=_0xc678ef?_0x1f11ce(0x12f)+_0x3300be+'\x27?':_0x1f11ce(0x23d)+_0x3300be+'\x27?';if(!_0x5ee36e[_0x1f11ce(0x15b)]){if(!isInteractive())return console[_0x1f11ce(0x2f7)](a31_0x47c070['red'](_0x1f11ce(0x21c)),_0x1f11ce(0x16c)),console[_0x1f11ce(0x2f7)](a31_0x47c070[_0x1f11ce(0x2f3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4f12fb=await confirmKey(_0x43925b);if(!_0x4f12fb)return console[_0x1f11ce(0x2f7)](a31_0x47c070[_0x1f11ce(0x24c)](_0x1f11ce(0x2e2))),0x1;}const _0x54056b=_0xc678ef?_0x1f11ce(0x237):_0x1f11ce(0x150),_0x57e7db=await withSpinner(_0x54056b+_0x1f11ce(0x1da)+_0x3300be+_0x1f11ce(0x25e),()=>_0x512306[_0x1f11ce(0x15c)](),{'verbose':_0x5ee36e[_0x1f11ce(0x1e4)]}),_0x4f2a97=_0x57e7db[_0x1f11ce(0x216)],_0x1e9c27=getConsoleNextUrl(_0x5ee36e['site'],_0x1f11ce(0x197)+_0x4f2a97['id']),_0x3f30ef=_0xc678ef?_0x1f11ce(0x2ce):_0x1f11ce(0x2c0);return console[_0x1f11ce(0x2f7)]('✔\x20'+_0x3f30ef+_0x1f11ce(0x1da)+_0x4f2a97[_0x1f11ce(0x133)]+'\x27'),console[_0x1f11ce(0x2f7)]('\x20\x20'+_0x1e9c27),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x251);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x23c);async[a31_0x3334a4(0x165)](_0x58f49e){const _0x101082=a31_0x3334a4,{options:_0x5e2587,args:_0x5cdbf9,tdx:_0x34d82f}=_0x58f49e,_0x52fee8=_0x5e2587,_0xbb977c=_0x5cdbf9[0x0]||_0x5e2587[_0x101082(0x2aa)];if(!_0xbb977c)return showParentSegmentNotSetError(_0x101082(0x107)+_0x101082(0x1db)+_0x101082(0x1f0)+_0x101082(0x23f)+_0x101082(0x184)+_0x101082(0x156)),0x1;const _0x426e4c=resolveYamlFile(_0xbb977c);if(!existsSync(_0x426e4c))return showFileNotFoundError(_0x426e4c,_0xbb977c),0x1;_0x52fee8[_0x101082(0x1e4)]&&(console['error'](_0x101082(0x226)+_0x52fee8[_0x101082(0x2a2)]),console[_0x101082(0x2f7)](_0x101082(0x16b)+_0x426e4c));let _0x49bec9;try{_0x49bec9=readFileSync(_0x426e4c,_0x101082(0x166));}catch(_0x14c85f){const _0x27562e=_0x14c85f instanceof Error?_0x14c85f['message']:String(_0x14c85f);return console[_0x101082(0x2f7)](_0x101082(0x134)+_0x27562e),0x1;}const _0x500815=createCommandSpinner(a31_0x47c070[_0x101082(0x2f3)](_0x101082(0x1cc)),{'verbose':_0x52fee8[_0x101082(0x1e4)]});_0x500815[_0x101082(0x2e1)]();const _0x4545cd={'onProgress':_0x1d4a07=>{const _0x664481=_0x101082;_0x500815[_0x664481(0x224)]=formatProgressMessage(_0x1d4a07);}};if(_0x52fee8[_0x101082(0x1ed)])_0x4545cd[_0x101082(0x1ed)]=!![];if(_0x52fee8['enriched'])_0x4545cd[_0x101082(0x2b4)]=!![];_0x52fee8['attribute']&&(_0x4545cd[_0x101082(0x1fd)]=_0x52fee8['attribute']);_0x52fee8[_0x101082(0x18e)]&&(_0x4545cd[_0x101082(0x18e)]=_0x52fee8['behavior']);if(_0x52fee8[_0x101082(0x162)])_0x4545cd[_0x101082(0x162)]=_0x52fee8[_0x101082(0x162)];let _0xec8414;try{_0xec8414=await _0x34d82f['segment'][_0x101082(0x11e)](_0x49bec9,_0x4545cd),_0x500815[_0x101082(0x10d)]();}catch(_0x14950b){_0x500815[_0x101082(0x10d)]();throw _0x14950b;}const _0x586ca7=_0x52fee8[_0x101082(0x162)]||'-1d';return this['displayValidateResults'](_0xec8414,_0x4545cd,_0x426e4c,_0x586ca7),_0xec8414['allValid']?0x0:0x1;}[a31_0x3334a4(0x1ea)](_0x4be97c,_0x1de6a0,_0x1b5654,_0x4ac1ec){const _0x3c91d8=a31_0x3334a4;console[_0x3c91d8(0x2f7)]('\x0a'+a31_0x47c070['bold'](_0x3c91d8(0xfd))+'\x20'+_0x4be97c[_0x3c91d8(0x133)]),console[_0x3c91d8(0x2f7)]('═'[_0x3c91d8(0x119)](0x3c)),this[_0x3c91d8(0x259)](_0x4be97c);if(typeof _0x1de6a0[_0x3c91d8(0x1fd)]==='string'){this['displayAttributesStats'](_0x4be97c),this[_0x3c91d8(0x264)](_0x4be97c),this[_0x3c91d8(0x10b)](_0x1b5654,_0x4ac1ec,_0x3c91d8(0x1fd),_0x1de6a0[_0x3c91d8(0x1fd)]);return;}if(_0x1de6a0[_0x3c91d8(0x1fd)]===!![]){this[_0x3c91d8(0x281)](_0x4be97c),this[_0x3c91d8(0x264)](_0x4be97c),this[_0x3c91d8(0x10b)](_0x1b5654,_0x4ac1ec,_0x3c91d8(0x20b));return;}if(typeof _0x1de6a0['behavior']===_0x3c91d8(0x214)){this['displayBehaviorsStats'](_0x4be97c,_0x4ac1ec),this[_0x3c91d8(0x264)](_0x4be97c),this['displayPreviewHints'](_0x1b5654,_0x4ac1ec,_0x3c91d8(0x18e),_0x1de6a0[_0x3c91d8(0x18e)]);return;}if(_0x1de6a0[_0x3c91d8(0x18e)]===!![]){this['displayBehaviorsStats'](_0x4be97c,_0x4ac1ec),this[_0x3c91d8(0x264)](_0x4be97c),this[_0x3c91d8(0x10b)](_0x1b5654,_0x4ac1ec,_0x3c91d8(0x1cd));return;}this[_0x3c91d8(0x281)](_0x4be97c),this[_0x3c91d8(0x1c8)](_0x4be97c,_0x4ac1ec),this[_0x3c91d8(0x2dd)](_0x4be97c),this[_0x3c91d8(0x264)](_0x4be97c),this[_0x3c91d8(0x10b)](_0x1b5654,_0x4ac1ec,'all');}[a31_0x3334a4(0x2dd)](_0x322a1a){displayRealtimeValidation(_0x322a1a);}[a31_0x3334a4(0x10b)](_0x270c44,_0x164c97,_0x542dc8,_0x2d4d23){const _0xb6a4d8=a31_0x3334a4;console[_0xb6a4d8(0x2f7)]('\x0a'+a31_0x47c070['dim'](_0xb6a4d8(0x298)));const _0x5b5ea1=_0x164c97!=='-1d'?_0xb6a4d8(0x295)+_0x164c97:'';if(_0x542dc8===_0xb6a4d8(0x1fd)&&_0x2d4d23)console[_0xb6a4d8(0x2f7)]('\x20\x20'+a31_0x47c070[_0xb6a4d8(0x2f3)](_0xb6a4d8(0x1a4)+_0x270c44+_0xb6a4d8(0x149)+_0x2d4d23+'\x22'+_0x5b5ea1));else{if(_0x542dc8===_0xb6a4d8(0x18e)&&_0x2d4d23)console[_0xb6a4d8(0x2f7)]('\x20\x20'+a31_0x47c070[_0xb6a4d8(0x2f3)](_0xb6a4d8(0x1a4)+_0x270c44+_0xb6a4d8(0x242)+_0x2d4d23+'\x22'+_0x5b5ea1));else(_0x542dc8===_0xb6a4d8(0x20b)||_0x542dc8===_0xb6a4d8(0x18c))&&console[_0xb6a4d8(0x2f7)]('\x20\x20'+a31_0x47c070[_0xb6a4d8(0x2f3)]('tdx\x20ps\x20preview\x20'+_0x270c44+_0xb6a4d8(0x173)+_0x5b5ea1));}(_0x542dc8===_0xb6a4d8(0x1cd)||_0x542dc8==='all')&&console[_0xb6a4d8(0x2f7)]('\x20\x20'+a31_0x47c070['dim'](_0xb6a4d8(0x1a4)+_0x270c44+_0xb6a4d8(0x185)+_0x5b5ea1)),_0x542dc8==='all'&&console[_0xb6a4d8(0x2f7)]('\x20\x20'+a31_0x47c070['dim'](_0xb6a4d8(0x1a4)+_0x270c44+_0xb6a4d8(0x28b)+_0x5b5ea1));}[a31_0x3334a4(0x259)](_0x34ff95){const _0xb2e33=a31_0x3334a4,{master:_0x132dda}=_0x34ff95,_0x14e794=_0x132dda['schemaValid']?a31_0x47c070[_0xb2e33(0x2a3)]('✔'):a31_0x47c070['red']('✘');console[_0xb2e33(0x2f7)]('\x0a'+a31_0x47c070[_0xb2e33(0x2f3)](_0xb2e33(0x17c))),console[_0xb2e33(0x2f7)](_0x14e794+'\x20'+a31_0x47c070['bold'](_0x132dda[_0xb2e33(0x20a)]+'.'+_0x132dda[_0xb2e33(0x211)])),_0x132dda[_0xb2e33(0x14b)]?_0x132dda[_0xb2e33(0x1d4)]!==undefined&&console[_0xb2e33(0x2f7)]('\x20\x20'+a31_0x47c070[_0xb2e33(0x2f3)]('Rows:')+'\x20'+a31_0x47c070[_0xb2e33(0x1de)](formatRows(_0x132dda[_0xb2e33(0x1d4)]))):console['error']('\x20\x20'+a31_0x47c070[_0xb2e33(0x293)]('Error:')+'\x20'+_0x132dda['schemaError']);}[a31_0x3334a4(0x281)](_0x2cd699){const _0x2d7829=a31_0x3334a4;if(_0x2cd699[_0x2d7829(0x20b)][_0x2d7829(0x2f9)]===0x0)return;console['error']('\x0a'+a31_0x47c070[_0x2d7829(0x2f3)](_0x2d7829(0x2c8)));for(const _0x2c2924 of _0x2cd699[_0x2d7829(0x20b)]){const _0x2ebfdd=_0x2c2924[_0x2d7829(0x14b)]?a31_0x47c070[_0x2d7829(0x2a3)]('✔'):a31_0x47c070[_0x2d7829(0x293)]('✘');let _0x573eff='';if(_0x2c2924[_0x2d7829(0x14b)]&&_0x2c2924[_0x2d7829(0x222)]!==undefined&&_0x2c2924[_0x2d7829(0x21b)]!==undefined){const _0x2b98fc=_0x2c2924[_0x2d7829(0x21b)][_0x2d7829(0x2b3)](0x1),_0x24a04a=_0x2c2924['coveragePercent']>=0x50?a31_0x47c070[_0x2d7829(0x2a3)]:_0x2c2924['coveragePercent']>=0x32?a31_0x47c070[_0x2d7829(0x24c)]:a31_0x47c070[_0x2d7829(0x293)];_0x573eff='\x20'+a31_0x47c070[_0x2d7829(0x2f3)]('Coverage:')+'\x20'+_0x24a04a(_0x2b98fc+'%')+'\x20('+formatRows(_0x2c2924[_0x2d7829(0x222)])+'\x20rows)';}console[_0x2d7829(0x2f7)](_0x2ebfdd+'\x20'+a31_0x47c070['bold'](_0x2c2924[_0x2d7829(0x133)])+_0x573eff),console[_0x2d7829(0x2f7)]('\x20\x20'+a31_0x47c070['dim'](_0x2d7829(0x131))+'\x20'+a31_0x47c070['bold'](_0x2c2924[_0x2d7829(0x20a)]+'.'+_0x2c2924['table']));const _0x1ae772=_0x2c2924[_0x2d7829(0x2ee)]===_0x2c2924[_0x2d7829(0x12b)]?a31_0x47c070[_0x2d7829(0x2f3)]('Join\x20on:')+'\x20'+_0x2c2924['joinKey']:a31_0x47c070[_0x2d7829(0x2f3)]('Join:')+'\x20'+_0x2c2924[_0x2d7829(0x2ee)]+_0x2d7829(0x2d8)+_0x2c2924[_0x2d7829(0x12b)];console[_0x2d7829(0x2f7)]('\x20\x20'+_0x1ae772),console[_0x2d7829(0x2f7)]('\x20\x20'+a31_0x47c070[_0x2d7829(0x2f3)](_0x2d7829(0x2b5))),this[_0x2d7829(0x1eb)](_0x2c2924[_0x2d7829(0x276)]),!_0x2c2924['schemaValid']&&console[_0x2d7829(0x2f7)]('\x20\x20'+a31_0x47c070[_0x2d7829(0x293)](_0x2d7829(0x2f4))+'\x20'+_0x2c2924[_0x2d7829(0x26a)]);}}['displayBehaviorsStats'](_0x12ca43,_0x5f4c81){const _0x2bb1f4=a31_0x3334a4;if(_0x12ca43[_0x2bb1f4(0x1cd)][_0x2bb1f4(0x2f9)]===0x0)return;console[_0x2bb1f4(0x2f7)]('\x0a'+a31_0x47c070[_0x2bb1f4(0x2f3)](_0x2bb1f4(0x190))+'\x20'+a31_0x47c070[_0x2bb1f4(0x2f3)]('('+_0x5f4c81+')'));for(const _0x1537ea of _0x12ca43[_0x2bb1f4(0x1cd)]){const _0x26d345=_0x1537ea[_0x2bb1f4(0x14b)]?a31_0x47c070[_0x2bb1f4(0x2a3)]('✔'):a31_0x47c070[_0x2bb1f4(0x293)]('✘');let _0xf44832='';if(_0x1537ea[_0x2bb1f4(0x14b)]&&_0x1537ea['customersWithEvents']!==undefined&&_0x1537ea['totalEvents']!==undefined){const _0x5b3994=_0x1537ea[_0x2bb1f4(0x1e0)]?.['toFixed'](0x1)||'?',_0x31be78=(_0x1537ea[_0x2bb1f4(0x1e0)]??0x0)>=0x32?a31_0x47c070[_0x2bb1f4(0x2a3)]:(_0x1537ea['customerPercent']??0x0)>=0x14?a31_0x47c070[_0x2bb1f4(0x24c)]:a31_0x47c070[_0x2bb1f4(0x293)];_0xf44832='\x20'+a31_0x47c070[_0x2bb1f4(0x2f3)](_0x2bb1f4(0x1ef))+'\x20'+_0x31be78(formatRows(_0x1537ea['customersWithEvents']))+'\x20('+_0x5b3994+_0x2bb1f4(0x152)+a31_0x47c070['dim'](_0x2bb1f4(0x27e))+'\x20'+a31_0x47c070[_0x2bb1f4(0x1de)](formatRows(_0x1537ea['totalEvents']));}console['error'](_0x26d345+'\x20'+a31_0x47c070[_0x2bb1f4(0x2d2)](_0x1537ea[_0x2bb1f4(0x133)])+_0xf44832),console['error']('\x20\x20'+a31_0x47c070[_0x2bb1f4(0x2f3)](_0x2bb1f4(0x131))+'\x20'+a31_0x47c070[_0x2bb1f4(0x2d2)](_0x1537ea['database']+'.'+_0x1537ea[_0x2bb1f4(0x211)]));const _0x5b46be=_0x1537ea['joinKey']===_0x1537ea[_0x2bb1f4(0x12b)]?a31_0x47c070[_0x2bb1f4(0x2f3)](_0x2bb1f4(0x2d9))+'\x20'+_0x1537ea['joinKey']:a31_0x47c070['dim'](_0x2bb1f4(0x1a3))+'\x20'+_0x1537ea[_0x2bb1f4(0x2ee)]+_0x2bb1f4(0x2d8)+_0x1537ea[_0x2bb1f4(0x12b)];console[_0x2bb1f4(0x2f7)]('\x20\x20'+_0x5b46be),console['error']('\x20\x20'+a31_0x47c070[_0x2bb1f4(0x2f3)](_0x2bb1f4(0x2b5))),this[_0x2bb1f4(0x1eb)](_0x1537ea[_0x2bb1f4(0x276)]),!_0x1537ea[_0x2bb1f4(0x14b)]&&console[_0x2bb1f4(0x2f7)]('\x20\x20'+a31_0x47c070[_0x2bb1f4(0x293)](_0x2bb1f4(0x2f4))+'\x20'+_0x1537ea['schemaError']);}}[a31_0x3334a4(0x1eb)](_0x18b502){const _0x5d6e52=a31_0x3334a4;for(const _0x5540f6 of _0x18b502){_0x5540f6[_0x5d6e52(0x292)]===_0x5540f6[_0x5d6e52(0x1ad)]||_0x5540f6['column']==='*'?console[_0x5d6e52(0x2f7)](_0x5d6e52(0x1ba)+_0x5540f6['label']):console[_0x5d6e52(0x2f7)](_0x5d6e52(0x1ba)+_0x5540f6[_0x5d6e52(0x292)]+'\x20'+a31_0x47c070['dim']('('+_0x5540f6['column']+')'));}}[a31_0x3334a4(0x264)](_0x2fab52){const _0x4b8ef6=a31_0x3334a4;console[_0x4b8ef6(0x2f7)]('─'[_0x4b8ef6(0x119)](0x3c));if(_0x2fab52['errors']['length']>0x0){console[_0x4b8ef6(0x2f7)]('\x0a'+a31_0x47c070[_0x4b8ef6(0x293)](_0x4b8ef6(0x270)));for(const _0x449964 of _0x2fab52[_0x4b8ef6(0x1d0)]){console[_0x4b8ef6(0x2f7)]('\x20\x20'+a31_0x47c070[_0x4b8ef6(0x293)]('•')+'\x20'+_0x449964);}}_0x2fab52[_0x4b8ef6(0x232)]&&console[_0x4b8ef6(0x2f7)]('\x0a'+a31_0x47c070[_0x4b8ef6(0x2a3)]('✔')+_0x4b8ef6(0x210));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x3334a4(0x133)]='segment:parent:preview';[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x1e9);async['execute'](_0x2092a2){const _0x50fce1=a31_0x3334a4,{options:_0x43f13b,args:_0x1532ea,tdx:_0x5b8fbc}=_0x2092a2,_0x43d9bf=_0x43f13b,_0x1354cf=_0x1532ea[0x0]||_0x43f13b['parentSegment'];if(!_0x1354cf)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x50fce1(0x275)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x50fce1(0x239)+_0x50fce1(0x2d0)+_0x50fce1(0x2a0)+_0x50fce1(0x156)),0x1;if(!_0x43d9bf['master']&&!_0x43d9bf[_0x50fce1(0x1fd)]&&!_0x43d9bf['behavior']&&!_0x43d9bf[_0x50fce1(0x2b4)])return console[_0x50fce1(0x2f7)](a31_0x47c070[_0x50fce1(0x293)](_0x50fce1(0x260))),console[_0x50fce1(0x2f7)](_0x50fce1(0x2cc)),console[_0x50fce1(0x2f7)](_0x50fce1(0x2b8)),console[_0x50fce1(0x2f7)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x50fce1(0x2f7)](_0x50fce1(0x1a6)),console[_0x50fce1(0x2f7)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x50fce1(0x2f7)](_0x50fce1(0x24b)),0x1;const _0x3158bb=resolveYamlFile(_0x1354cf);if(!existsSync(_0x3158bb))return showFileNotFoundError(_0x3158bb,_0x1354cf),0x1;_0x43d9bf[_0x50fce1(0x1e4)]&&(console['error'](_0x50fce1(0x226)+_0x43d9bf[_0x50fce1(0x2a2)]),console[_0x50fce1(0x2f7)]('YAML\x20file:\x20'+_0x3158bb));let _0x3381bd;try{_0x3381bd=readFileSync(_0x3158bb,_0x50fce1(0x166));}catch(_0x246c11){const _0x5d4c4e=_0x246c11 instanceof Error?_0x246c11[_0x50fce1(0x1fc)]:String(_0x246c11);return console['error'](_0x50fce1(0x134)+_0x5d4c4e),0x1;}let _0x4d1f5b;try{_0x4d1f5b=parseDef(_0x3381bd);}catch(_0x5ea06d){const _0x541e4d=_0x5ea06d instanceof Error?_0x5ea06d[_0x50fce1(0x1fc)]:String(_0x5ea06d);return console[_0x50fce1(0x2f7)](a31_0x47c070[_0x50fce1(0x293)]('Error\x20parsing\x20YAML:\x20'+_0x541e4d)),0x1;}if(_0x43d9bf[_0x50fce1(0x1fd)]===!![]||_0x43d9bf[_0x50fce1(0x1fd)]===''){const _0x483139=_0x4d1f5b[_0x50fce1(0x20b)]?.[_0x50fce1(0x2bd)](_0x16cd05=>_0x16cd05[_0x50fce1(0x133)])||[];if(_0x483139[_0x50fce1(0x2f9)]===0x0)console[_0x50fce1(0x2f7)](a31_0x47c070[_0x50fce1(0x293)](_0x50fce1(0x272)));else{console[_0x50fce1(0x2f7)](a31_0x47c070[_0x50fce1(0x293)](_0x50fce1(0x2e6))),console['error']('Available\x20attributes:');for(const _0x374b8c of _0x483139){console[_0x50fce1(0x2f7)]('\x20\x20'+a31_0x47c070[_0x50fce1(0x1de)](_0x374b8c));}console[_0x50fce1(0x2f7)](_0x50fce1(0x1ec)+_0x1354cf+_0x50fce1(0x149)+_0x483139[0x0]+'\x22');}return 0x1;}if(_0x43d9bf[_0x50fce1(0x18e)]===!![]||_0x43d9bf[_0x50fce1(0x18e)]===''){const _0xbf6d9=_0x4d1f5b[_0x50fce1(0x1cd)]?.[_0x50fce1(0x2bd)](_0x493dc7=>_0x493dc7[_0x50fce1(0x133)])||[];if(_0xbf6d9[_0x50fce1(0x2f9)]===0x0)console[_0x50fce1(0x2f7)](a31_0x47c070[_0x50fce1(0x293)](_0x50fce1(0x25a)));else{console[_0x50fce1(0x2f7)](a31_0x47c070['red'](_0x50fce1(0x2fa))),console[_0x50fce1(0x2f7)](_0x50fce1(0x1b2));for(const _0x4166b9 of _0xbf6d9){console['error']('\x20\x20'+a31_0x47c070['cyan'](_0x4166b9));}console[_0x50fce1(0x2f7)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x1354cf+_0x50fce1(0x242)+_0xbf6d9[0x0]+'\x22');}return 0x1;}const _0x62f1f6=createCommandSpinner(a31_0x47c070[_0x50fce1(0x2f3)](_0x50fce1(0x10e)),{'verbose':_0x43d9bf[_0x50fce1(0x1e4)]});_0x62f1f6[_0x50fce1(0x2e1)]();const _0x263121={'onProgress':_0x2be498=>{const _0x102164=_0x50fce1;_0x62f1f6[_0x102164(0x224)]=formatProgressMessage(_0x2be498);}};if(_0x43d9bf[_0x50fce1(0x1ed)])_0x263121['master']=!![];if(_0x43d9bf['attribute']&&typeof _0x43d9bf['attribute']==='string')_0x263121[_0x50fce1(0x1fd)]=_0x43d9bf[_0x50fce1(0x1fd)];if(_0x43d9bf[_0x50fce1(0x18e)]&&typeof _0x43d9bf[_0x50fce1(0x18e)]===_0x50fce1(0x214))_0x263121['behavior']=_0x43d9bf['behavior'];if(_0x43d9bf['enriched'])_0x263121['enriched']=!![];if(_0x43d9bf[_0x50fce1(0x162)])_0x263121['interval']=_0x43d9bf[_0x50fce1(0x162)];let _0x2df122;try{_0x2df122=await _0x5b8fbc[_0x50fce1(0x1b5)]['previewParentYaml'](_0x3381bd,_0x263121),_0x62f1f6[_0x50fce1(0x10d)]();}catch(_0x5325d5){_0x62f1f6['stop']();throw _0x5325d5;}return await this['displayPreviewResults'](_0x2df122,{'master':_0x43d9bf[_0x50fce1(0x1ed)],'attribute':typeof _0x43d9bf[_0x50fce1(0x1fd)]===_0x50fce1(0x214)?_0x43d9bf[_0x50fce1(0x1fd)]:undefined,'behavior':typeof _0x43d9bf[_0x50fce1(0x18e)]===_0x50fce1(0x214)?_0x43d9bf[_0x50fce1(0x18e)]:undefined,'enriched':_0x43d9bf[_0x50fce1(0x2b4)]}),_0x2df122['allValid']?0x0:0x1;}async['displayPreviewResults'](_0x975e2e,_0x283c50){const _0x11ab41=a31_0x3334a4;console[_0x11ab41(0x2f7)]('\x0a'+a31_0x47c070[_0x11ab41(0x2d2)](_0x11ab41(0x286))+'\x20'+_0x975e2e[_0x11ab41(0x133)]),console['error']('═'[_0x11ab41(0x119)](0x3c));if(_0x283c50[_0x11ab41(0x1ed)]&&_0x975e2e[_0x11ab41(0x108)]){const _0xbdfbf3=a31_0x47c070[_0x11ab41(0x2f3)](_0x11ab41(0x187))+'\x20'+a31_0x47c070[_0x11ab41(0x2d2)](_0x975e2e[_0x11ab41(0x1ed)][_0x11ab41(0x20a)]+'.'+_0x975e2e[_0x11ab41(0x1ed)][_0x11ab41(0x211)]);await this[_0x11ab41(0x277)](_0xbdfbf3,_0x975e2e[_0x11ab41(0x108)]);}else{if(_0x283c50[_0x11ab41(0x1fd)]&&_0x975e2e['sampleData']){const _0x5eb69a=a31_0x47c070['dim'](_0x11ab41(0x13b))+'\x20'+a31_0x47c070[_0x11ab41(0x2d2)](_0x283c50['attribute']);await this['displaySampleData'](_0x5eb69a,_0x975e2e['sampleData']);}else{if(_0x283c50['behavior']&&_0x975e2e[_0x11ab41(0x108)]){const _0x341e22=a31_0x47c070['dim'](_0x11ab41(0x11c))+'\x20'+a31_0x47c070['bold'](_0x283c50[_0x11ab41(0x18e)]);await this[_0x11ab41(0x277)](_0x341e22,_0x975e2e[_0x11ab41(0x108)]);}else{if(_0x283c50[_0x11ab41(0x2b4)]&&_0x975e2e[_0x11ab41(0x108)]){const _0x31fa7d=a31_0x47c070['dim'](_0x11ab41(0x305))+'\x20'+a31_0x47c070[_0x11ab41(0x2d2)](_0x11ab41(0x2e9));await this[_0x11ab41(0x277)](_0x31fa7d,_0x975e2e[_0x11ab41(0x108)]);}else!_0x975e2e[_0x11ab41(0x108)]&&console[_0x11ab41(0x2f7)](_0x11ab41(0x176));}}}if(_0x975e2e[_0x11ab41(0x1d0)][_0x11ab41(0x2f9)]>0x0){console[_0x11ab41(0x2f7)]('─'[_0x11ab41(0x119)](0x3c)),console[_0x11ab41(0x2f7)]('\x0a'+a31_0x47c070['red'](_0x11ab41(0x270)));for(const _0x211703 of _0x975e2e[_0x11ab41(0x1d0)]){console['error']('\x20\x20'+a31_0x47c070[_0x11ab41(0x293)]('•')+'\x20'+_0x211703);}}}async[a31_0x3334a4(0x277)](_0x1c1865,_0x40af3b){const _0x33312d=a31_0x3334a4;if(_0x40af3b[_0x33312d(0x2f9)]===0x0){console[_0x33312d(0x2f7)]('\x0a'+_0x1c1865),console[_0x33312d(0x2f7)](_0x33312d(0x267));return;}console[_0x33312d(0x2f7)]('\x0a'+_0x1c1865);const _0x1f28ee=Object['keys'](_0x40af3b[0x0])[_0x33312d(0x2bd)](_0x127b53=>({'name':_0x127b53,'type':typeof _0x40af3b[0x0][_0x127b53]===_0x33312d(0x160)?_0x33312d(0x1d8):_0x33312d(0x1e3)})),_0x3a2939={'queryId':'preview','columns':_0x1f28ee,'data':_0x40af3b,'stats':{'state':_0x33312d(0x261),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x40af3b[_0x33312d(0x2f9)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x783bba=formatAsTable(_0x3a2939,_0x40af3b[_0x33312d(0x2f9)],!![]);await writeOutput(_0x783bba,undefined,_0x33312d(0x211));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a31_0x3334a4(0x297);[a31_0x3334a4(0x1c6)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async['execute'](_0x525845){const _0x825208=a31_0x3334a4,{options:_0x7f2bc1,args:_0x5846a0,tdx:_0x8a22da}=_0x525845,_0x559212=_0x7f2bc1,_0x4faee6=_0x5846a0[0x0]||_0x7f2bc1[_0x825208(0x2aa)];if(!_0x4faee6)return showParentSegmentNotSetError(_0x825208(0x29d)+_0x825208(0x22a)),0x1;const _0x486d76=resolveYamlFile(_0x4faee6);if(existsSync(_0x486d76)){_0x559212['verbose']&&console['error']('Found\x20YAML\x20file:\x20'+_0x486d76);let _0x1e56de;try{_0x1e56de=readFileSync(_0x486d76,'utf-8');}catch(_0x3f5709){const _0x164136=_0x3f5709 instanceof Error?_0x3f5709[_0x825208(0x1fc)]:String(_0x3f5709);return console[_0x825208(0x2f7)]('Error\x20reading\x20file:\x20'+_0x164136),0x1;}const _0x280f45=await withSpinner(_0x825208(0x1c1),()=>_0x8a22da['segment']['pushParentYaml'](_0x1e56de),{'verbose':_0x559212[_0x825208(0x1e4)]}),_0x2e34d9=_0x280f45[_0x825208(0x216)],{isNew:_0x30a18a,name:_0x4f5ac0,hasChanges:_0x45c9de,diffFormatted:_0x3c9b32}=_0x2e34d9;if(_0x45c9de){_0x30a18a?console[_0x825208(0x2f7)](_0x825208(0x145)+_0x4f5ac0+'\x27:'):console[_0x825208(0x2f7)](_0x825208(0x23e)+_0x4f5ac0+'\x27:');console[_0x825208(0x2f7)]('─'[_0x825208(0x119)](0x3c)),console[_0x825208(0x2f7)](_0x3c9b32),console[_0x825208(0x2f7)]('─'[_0x825208(0x119)](0x3c));const _0x4d0c1e=_0x30a18a?_0x825208(0x12f)+_0x4f5ac0+_0x825208(0x2f2):'Apply\x20changes\x20to\x20\x27'+_0x4f5ac0+_0x825208(0x2f2);if(!_0x559212[_0x825208(0x15b)]){if(!isInteractive())return console[_0x825208(0x2f7)](a31_0x47c070['red'](_0x825208(0x21c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x825208(0x2f7)](a31_0x47c070[_0x825208(0x2f3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5c06a7=await confirmKey(_0x4d0c1e);if(!_0x5c06a7)return console[_0x825208(0x2f7)](a31_0x47c070[_0x825208(0x24c)](_0x825208(0x2e2))),0x1;}const _0x3503cc=_0x30a18a?_0x825208(0x237):'Updating';await withSpinner(_0x3503cc+_0x825208(0x1da)+_0x4f5ac0+_0x825208(0x25e),()=>_0x2e34d9[_0x825208(0x15c)](),{'verbose':_0x559212['verbose']});const _0x5161be=_0x30a18a?_0x825208(0x2ce):_0x825208(0x2c0);console[_0x825208(0x2f7)]('✔\x20'+_0x5161be+_0x825208(0x1da)+_0x4f5ac0+'\x27');}else console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0x4f5ac0+_0x825208(0x1b7));}const _0xb76ce7=await withSpinner(_0x825208(0x1af)+_0x4faee6+_0x825208(0x25e),()=>_0x8a22da[_0x825208(0x1b5)]['runParent'](_0x4faee6),{'verbose':_0x559212['verbose']}),_0x2313e4=_0xb76ce7[_0x825208(0x216)],_0x5df240=getConsoleUrl(_0x559212[_0x825208(0x2a2)],'/app/workflows/'+_0x2313e4[_0x825208(0x2c2)]+_0x825208(0x28c)+_0x2313e4[_0x825208(0x2fb)]+_0x825208(0x262)+_0x2313e4[_0x825208(0x16a)]);return console['error']('\x0a✔\x20Workflow\x20started'),console[_0x825208(0x2f7)]('\x20\x20'+a31_0x47c070[_0x825208(0x2f3)]('Audience\x20ID:')+'\x20'+_0x2313e4[_0x825208(0x15f)]),console[_0x825208(0x2f7)]('\x20\x20'+a31_0x47c070[_0x825208(0x2f3)](_0x825208(0x161))+'\x20'+_0x2313e4[_0x825208(0x24d)]),console[_0x825208(0x2f7)]('\x20\x20'+a31_0x47c070['dim']('Session:')+'\x20'+_0x2313e4['workflowSessionId']),console[_0x825208(0x2f7)]('\x20\x20'+a31_0x47c070[_0x825208(0x2f3)](_0x825208(0x1d1))+'\x20'+_0x2313e4[_0x825208(0x16a)]),console[_0x825208(0x2f7)]('\x20\x20'+_0x5df240),console['error']('\x0a'+a31_0x47c070[_0x825208(0x2f3)](_0x825208(0x171))+_0x825208(0x252)+_0x2313e4[_0x825208(0x16a)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']='segment:parent:fields';[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x1e7);async[a31_0x3334a4(0x165)](_0x67505d){const _0x32a0fb=a31_0x3334a4,{options:_0x41ca19,args:_0x5688bb,tdx:_0x4962c9}=_0x67505d,_0x3fe4b4=_0x5688bb[0x0]||_0x41ca19[_0x32a0fb(0x2aa)];if(!_0x3fe4b4)return showParentSegmentNotSetError(_0x32a0fb(0x29a)+_0x32a0fb(0x21f)),0x1;_0x41ca19[_0x32a0fb(0x1e4)]&&(console[_0x32a0fb(0x2f7)](_0x32a0fb(0x226)+_0x41ca19[_0x32a0fb(0x2a2)]),console['error'](_0x32a0fb(0x1f1)+_0x3fe4b4));const _0x504943=await withSpinner(_0x32a0fb(0x287)+_0x3fe4b4+_0x32a0fb(0x25e),()=>_0x4962c9[_0x32a0fb(0x1b5)][_0x32a0fb(0x191)](_0x3fe4b4),{'verbose':_0x41ca19[_0x32a0fb(0x1e4)]}),_0x2fb776=_0x504943['data'];console[_0x32a0fb(0x2f7)](_0x32a0fb(0xf6)+_0x2fb776[_0x32a0fb(0x2f9)]+_0x32a0fb(0x205)+(_0x2fb776[_0x32a0fb(0x2f9)]!==0x1?'s':''));if(_0x41ca19[_0x32a0fb(0x296)]||_0x41ca19[_0x32a0fb(0x27c)])return await handleSDKOutput(_0x2fb776,_0x41ca19),0x0;return displayFieldsHumanReadable(_0x2fb776,_0x3fe4b4),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x1f2);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x2c7);async[a31_0x3334a4(0x165)](_0x3dae44){const _0x1a67b6=a31_0x3334a4,{options:_0x10d2e9,args:_0x486ac6,tdx:_0x2548a8}=_0x3dae44,_0x5f1342=_0x10d2e9,_0x2a8673=_0x486ac6[0x0]||_0x10d2e9['parentSegment'];if(!_0x2a8673)return showParentSegmentNotSetError(_0x1a67b6(0x1bb)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x1a67b6(0x1f0)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x10d2e9[_0x1a67b6(0x1e4)]&&(console[_0x1a67b6(0x2f7)](_0x1a67b6(0x226)+_0x10d2e9[_0x1a67b6(0x2a2)]),console[_0x1a67b6(0x2f7)](_0x1a67b6(0x1f1)+_0x2a8673));const _0x574970=await withSpinner(_0x1a67b6(0x1b0)+_0x2a8673+_0x1a67b6(0x25e),()=>_0x2548a8['segment'][_0x1a67b6(0x2ea)](_0x2a8673),{'verbose':_0x10d2e9[_0x1a67b6(0x1e4)]}),_0x7201a2=_0x574970['data'];if(_0x5f1342[_0x1a67b6(0x163)]){const _0x329b56=getConsoleNextUrl(_0x5f1342[_0x1a67b6(0x2a2)],_0x1a67b6(0x197)+_0x7201a2['id']);return console['error'](a31_0x47c070[_0x1a67b6(0x2a3)]('✔')+_0x1a67b6(0x112)+a31_0x47c070[_0x1a67b6(0x1de)](_0x329b56)),openBrowser(_0x329b56),0x0;}return await handleSingleObjectOutput(_0x7201a2,_0x10d2e9),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x3334a4(0x133)]='segment:parent:desc';['description']=a31_0x3334a4(0x1c7);async[a31_0x3334a4(0x165)](_0x101028){const _0x35e711=a31_0x3334a4,{options:_0x1aae4f,args:_0x7d1921,tdx:_0x5b5229}=_0x101028,_0x447010=_0x1aae4f,_0x544282=_0x7d1921[0x0]||_0x1aae4f[_0x35e711(0x2aa)];if(!_0x544282)return showParentSegmentNotSetError(_0x35e711(0xf7)+'\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'+_0x35e711(0x1f0)+_0x35e711(0x301)),0x1;_0x1aae4f['verbose']&&(console['error']('Site:\x20'+_0x1aae4f['site']),console[_0x35e711(0x2f7)](_0x35e711(0x1f1)+_0x544282));const _0x556279=await withSpinner(_0x35e711(0x22e)+_0x544282+_0x35e711(0x25e),()=>_0x5b5229['segment'][_0x35e711(0x2cb)](_0x544282),{'verbose':_0x1aae4f[_0x35e711(0x1e4)]}),_0x59b505=_0x556279[_0x35e711(0x216)],_0xc9574=_0x5b5229[_0x35e711(0x1b5)][_0x35e711(0x2bf)](_0x59b505);if(_0x447010[_0x35e711(0x228)]){const _0x3d2126=await this['collectSchema'](_0x101028,_0x544282,_0x59b505,_0xc9574),_0x2f5bc4=this[_0x35e711(0x2b0)](_0x3d2126);writeFileSync(_0x447010[_0x35e711(0x228)],_0x2f5bc4);const _0x77a072=_0x3d2126[_0x35e711(0xf2)][_0x35e711(0x276)][_0x35e711(0x2f9)]+_0x3d2126[_0x35e711(0x1cd)]['reduce']((_0x374dfe,_0x422339)=>_0x374dfe+_0x422339[_0x35e711(0x276)][_0x35e711(0x2f9)],0x0),_0xd83e95=_0x3d2126[_0x35e711(0x1cd)][_0x35e711(0x2fd)](_0x3bf4c2=>_0x3bf4c2[_0x35e711(0x276)][_0x35e711(0x2f9)]===0x0)['length'];return console[_0x35e711(0x1d7)](_0x35e711(0x26b)+_0x447010[_0x35e711(0x228)]),console['log']('\x20\x20Database:\x20'+_0xc9574),console[_0x35e711(0x1d7)](_0x35e711(0x172)+_0x3d2126['behaviors'][_0x35e711(0x2f9)]+'\x20behaviors'),console['log'](_0x35e711(0xf4)+_0x77a072+_0x35e711(0x255)),_0xd83e95>0x0&&console[_0x35e711(0x1d7)](_0x35e711(0x180)+_0xd83e95+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console[_0x35e711(0x2f7)]('\x0a'+a31_0x47c070['bold']('Output\x20Database:')+'\x20'+a31_0x47c070[_0x35e711(0x1de)](_0xc9574));const _0x35ea54=await withSpinner(_0x35e711(0x1ab),()=>_0x5b5229[_0x35e711(0x1b5)][_0x35e711(0x24f)](_0x59b505),{'verbose':_0x1aae4f[_0x35e711(0x1e4)]});console['error']('\x0a'+a31_0x47c070[_0x35e711(0x2d2)](_0x35e711(0xf2))+'\x20'+a31_0x47c070[_0x35e711(0x2f3)]('('+_0xc9574+_0x35e711(0x194)));const _0x1f7a55=await executeSchemaQuery(_0x35ea54[_0x35e711(0x216)],_0x5b5229,_0x1aae4f);await handleQueryOutput(_0x1f7a55,_0x1aae4f);const _0x276aa1=await withSpinner(_0x35e711(0x169),()=>_0x5b5229[_0x35e711(0x1b5)][_0x35e711(0x10f)](_0x59b505),{'verbose':_0x1aae4f[_0x35e711(0x1e4)]});for(const _0x58bc8a of _0x276aa1[_0x35e711(0x216)]){const _0x5cf32a='behavior_'+_0x58bc8a[_0x35e711(0x229)]()[_0x35e711(0x27a)](/\s+/g,'_'),_0xad37cb=_0x35e711(0x168)+_0xc9574+'.'+_0x5cf32a;console['error']('\x0a'+a31_0x47c070[_0x35e711(0x2d2)](_0x58bc8a)+'\x20'+a31_0x47c070['dim']('('+_0xc9574+'.'+_0x5cf32a+')'));try{const _0x37c481=await executeSchemaQuery(_0xad37cb,_0x5b5229,_0x1aae4f);await handleQueryOutput(_0x37c481,_0x1aae4f);}catch{console['error'](a31_0x47c070[_0x35e711(0x24c)](_0x35e711(0x279)));}}return 0x0;}async['collectSchema'](_0x27b38c,_0x1a2c80,_0x1bd2f5,_0x5964d9){const _0x357bdd=a31_0x3334a4,{options:_0x5c3f72,tdx:_0xa13b9e}=_0x27b38c,_0x4be783=await withSpinner(_0x357bdd(0x1ab),()=>_0xa13b9e[_0x357bdd(0x1b5)][_0x357bdd(0x24f)](_0x1bd2f5),{'verbose':_0x5c3f72[_0x357bdd(0x1e4)]}),_0xebdd2f=await executeSchemaQuery(_0x4be783[_0x357bdd(0x216)],_0xa13b9e,_0x5c3f72),_0x510c03=_0xebdd2f[_0x357bdd(0x216)][_0x357bdd(0x2bd)](_0x33f403=>({'name':_0x33f403[_0x357bdd(0x135)],'type':_0x33f403[_0x357bdd(0x193)]})),_0x410281=await withSpinner(_0x357bdd(0x169),()=>_0xa13b9e[_0x357bdd(0x1b5)]['getBehaviorNames'](_0x1bd2f5),{'verbose':_0x5c3f72[_0x357bdd(0x1e4)]}),_0x29c4e3=[];for(const _0xbd7c96 of _0x410281[_0x357bdd(0x216)]){const _0x24dffb=_0x357bdd(0x125)+_0xbd7c96[_0x357bdd(0x229)]()['replace'](/\s+/g,'_'),_0x5e2131='SELECT\x20*\x20FROM\x20'+_0x5964d9+'.'+_0x24dffb;let _0x4998f4=[];try{const _0x9d6f34=await executeSchemaQuery(_0x5e2131,_0xa13b9e,_0x5c3f72);_0x4998f4=_0x9d6f34[_0x357bdd(0x216)][_0x357bdd(0x2bd)](_0x2a66f9=>({'name':_0x2a66f9[_0x357bdd(0x135)],'type':_0x2a66f9[_0x357bdd(0x193)]}));}catch{}_0x29c4e3[_0x357bdd(0x2ab)]({'table':_0x24dffb,'columns':_0x4998f4});}return{'database':_0x5964d9,'parent_segment':_0x1a2c80,'parent_id':_0x1bd2f5,'customers':{'table':_0x357bdd(0xf2),'columns':_0x510c03},'behaviors':_0x29c4e3};}['formatSchemaJson'](_0x51fc40){const _0x1f3a10=a31_0x3334a4,_0x251651=_0x5b2966=>{const _0x3a3f2a=a31_0x2bf9;if(_0x5b2966['length']===0x0)return'[]';const _0x2454e2=_0x5b2966[_0x3a3f2a(0x2bd)](_0x41ffdb=>_0x3a3f2a(0x18b)+_0x41ffdb[_0x3a3f2a(0x133)]+_0x3a3f2a(0x236)+_0x41ffdb[_0x3a3f2a(0x257)]+_0x3a3f2a(0x151));return'[\x0a'+_0x2454e2[_0x3a3f2a(0x114)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x4f503c=_0x51fc40[_0x1f3a10(0x1cd)][_0x1f3a10(0x2bd)](_0x268160=>{const _0x9a6f49=_0x1f3a10;return _0x9a6f49(0x13d)+_0x268160[_0x9a6f49(0x211)]+_0x9a6f49(0x167)+_0x251651(_0x268160[_0x9a6f49(0x276)])[_0x9a6f49(0x27a)](/^/gm,'\x20\x20')[_0x9a6f49(0x19c)]()+_0x9a6f49(0x2c4);})[_0x1f3a10(0x114)](',\x0a');return _0x1f3a10(0x29c)+_0x51fc40[_0x1f3a10(0x20a)]+_0x1f3a10(0x1fa)+_0x51fc40[_0x1f3a10(0x2fe)]+_0x1f3a10(0x1c2)+_0x51fc40[_0x1f3a10(0x1fe)]+_0x1f3a10(0x1f6)+_0x51fc40['customers'][_0x1f3a10(0x211)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x251651(_0x51fc40['customers']['columns'])[_0x1f3a10(0x27a)](/^/gm,'\x20\x20')[_0x1f3a10(0x19c)]()+_0x1f3a10(0x12d)+_0x4f503c+_0x1f3a10(0x186);}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a31_0x3334a4(0x101);[a31_0x3334a4(0x1c6)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a31_0x3334a4(0x165)](_0x437081){const _0x526297=a31_0x3334a4,{options:_0x2463b5,args:_0x4f3dff,tdx:_0x1ce8a8}=_0x437081,_0x42f449=_0x4f3dff[0x0]||_0x2463b5[_0x526297(0x2aa)];if(!_0x42f449)return showParentSegmentNotSetError(_0x526297(0x1d2)+_0x526297(0x2c5)),0x1;_0x2463b5[_0x526297(0x1e4)]&&(console[_0x526297(0x2f7)]('Site:\x20'+_0x2463b5[_0x526297(0x2a2)]),console[_0x526297(0x2f7)](_0x526297(0x1f1)+_0x42f449));const _0xfc269=await withSpinner(_0x526297(0x22e)+_0x42f449+_0x526297(0x25e),()=>_0x1ce8a8[_0x526297(0x1b5)][_0x526297(0x2cb)](_0x42f449),{'verbose':_0x2463b5[_0x526297(0x1e4)]}),_0x306815=_0xfc269[_0x526297(0x216)],_0xc8752a=await withSpinner(_0x526297(0x195)+_0x42f449+_0x526297(0x25e),()=>_0x1ce8a8[_0x526297(0x1b5)][_0x526297(0x24f)](_0x306815),{'verbose':_0x2463b5['verbose']}),_0x57a5db=_0xc8752a['data'];return _0x2463b5[_0x526297(0x1a0)]===_0x526297(0x296)||_0x2463b5[_0x526297(0x1a0)]===_0x526297(0x27c)?await handleSDKOutput([{'sql':_0x57a5db}],_0x2463b5):console['log'](_0x57a5db),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x263);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x2ad);async[a31_0x3334a4(0x165)](_0x40d660){const _0x31748f=a31_0x3334a4,{options:_0x51b148,args:_0x1a9fec,tdx:_0x4b6145}=_0x40d660,_0x498bc9=_0x1a9fec[0x0]||_0x51b148['parentSegment'];if(!_0x498bc9)return showParentSegmentNotSetError(_0x31748f(0x20e)+'\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;_0x51b148[_0x31748f(0x1e4)]&&(console[_0x31748f(0x2f7)](_0x31748f(0x226)+_0x51b148[_0x31748f(0x2a2)]),console[_0x31748f(0x2f7)]('Parent\x20segment:\x20'+_0x498bc9));const _0x39338b=await withSpinner(_0x31748f(0x22e)+_0x498bc9+_0x31748f(0x25e),()=>_0x4b6145[_0x31748f(0x1b5)]['resolveParentId'](_0x498bc9),{'verbose':_0x51b148['verbose']}),_0x3abafd=_0x39338b['data'],_0x1d5830=await withSpinner(_0x31748f(0x195)+_0x498bc9+_0x31748f(0x25e),()=>_0x4b6145[_0x31748f(0x1b5)]['getParentSQL'](_0x3abafd),{'verbose':_0x51b148[_0x31748f(0x1e4)]});let _0x16f79d=_0x1d5830[_0x31748f(0x216)];const _0x43861e=resolveLimit(_0x51b148[_0x31748f(0x2bc)],DEFAULT_DISPLAY_LIMIT),_0x57047c=/\bLIMIT\s+\d+/i[_0x31748f(0x20c)](_0x16f79d);!_0x57047c&&(_0x16f79d=_0x16f79d[_0x31748f(0x19c)]()[_0x31748f(0x27a)](/;+$/,''),_0x16f79d='SELECT\x20*\x20FROM\x20(\x0a'+_0x16f79d+_0x31748f(0x2bb)+_0x43861e);_0x51b148['verbose']&&console['error']('SQL\x20query:\x0a'+_0x16f79d);const _0x2483b5=await withProgressSpinner(_0x31748f(0x213),async _0x2a66ea=>{const _0x19e245=_0x31748f,_0x375ea0=await _0x4b6145['query'][_0x19e245(0x165)](_0x16f79d,{'catalog':'td','schema':_0x19e245(0x273),'onJobId':_0x455372=>{const _0x22b372=_0x19e245;_0x2a66ea[_0x22b372(0x19d)](_0x455372);}});return _0x375ea0;},{'verbose':_0x51b148[_0x31748f(0x1e4)]}),_0x43609a=_0x2483b5[_0x31748f(0x216)],_0x17be29=_0x43609a[_0x31748f(0x2e5)]?_0x31748f(0x2f6)+_0x43609a['jobId']+']':'';return console[_0x31748f(0x2f7)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x43609a['stats'][_0x31748f(0x223)][_0x31748f(0x206)]()+'\x20rows\x20'+(_0x31748f(0x26d)+formatElapsed(_0x43609a[_0x31748f(0x22b)][_0x31748f(0x227)])+_0x17be29)),await handleQueryOutput(_0x43609a,_0x51b148),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x245);['description']='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a31_0x3334a4(0x165)](_0x149d95){const _0x4788c0=a31_0x3334a4,{options:_0x1ed3a5,args:_0x2248dd,tdx:_0x11bb32}=_0x149d95,_0x16b604=_0x2248dd[0x0],_0x2e15c8=await withSpinner(_0x16b604?_0x4788c0(0x283)+_0x16b604+_0x4788c0(0x25e):_0x4788c0(0x1d9),()=>_0x11bb32[_0x4788c0(0x17b)][_0x4788c0(0x24e)](),{'verbose':_0x1ed3a5[_0x4788c0(0x1e4)]});let _0x442d50=_0x2e15c8[_0x4788c0(0x216)][_0x4788c0(0x2fd)](_0x26933a=>_0x26933a[_0x4788c0(0x21a)]);if(_0x16b604){const _0x2308f4=_0x16b604[_0x4788c0(0x27a)](/[.+^${}()|[\]\\]/g,_0x4788c0(0x179))[_0x4788c0(0x27a)](/\*/g,'.*')[_0x4788c0(0x27a)](/\?/g,'.'),_0x2ee49a=new RegExp('^'+_0x2308f4+'$','i');_0x442d50=_0x442d50[_0x4788c0(0x2fd)](_0x420a9d=>_0x2ee49a[_0x4788c0(0x20c)](_0x420a9d['name']));}_0x442d50['sort']((_0xb5d176,_0x4253c4)=>_0xb5d176[_0x4788c0(0x133)][_0x4788c0(0x118)](_0x4253c4['name'])),console[_0x4788c0(0x2f7)](_0x4788c0(0xf6)+_0x442d50[_0x4788c0(0x2f9)]+_0x4788c0(0x17e)+(_0x442d50[_0x4788c0(0x2f9)]!==0x1?'s':''));const _0x870f08=_0x1f7c49=>{return getConsoleNextUrl(_0x1ed3a5['site'],'/app/dw/parentSegments/'+_0x1f7c49);};if(_0x1ed3a5[_0x4788c0(0x1a0)]===_0x4788c0(0x296)||_0x1ed3a5[_0x4788c0(0x1a0)]===_0x4788c0(0x27c)){const _0x41a8f3=_0x442d50['map'](_0x38230d=>({..._0x38230d,'url':_0x870f08(_0x38230d['id'])}));await handleSDKOutput(_0x41a8f3,_0x1ed3a5);}else{if(_0x442d50[_0x4788c0(0x2f9)]===0x0)console[_0x4788c0(0x1d7)](_0x4788c0(0xfa));else for(const _0x3b5314 of _0x442d50){const _0x4b985c=_0x3b5314[_0x4788c0(0x14d)]?a31_0x47c070[_0x4788c0(0x2f3)]('\x20('+formatRows(_0x3b5314[_0x4788c0(0x14d)])+')'):'',_0xdb65b1=hyperlink(_0x3b5314[_0x4788c0(0x133)],_0x870f08(_0x3b5314['id']));console['log']('⚡\x20'+_0xdb65b1+_0x4b985c);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x1be);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x288);async['execute'](_0x1087de){const _0x426b60=a31_0x3334a4,{options:_0x49df23,args:_0x294914,tdx:_0x1381e4}=_0x1087de,_0x29e70b=_0x294914[0x0]||_0x49df23['parentSegment'];if(!_0x29e70b)return showParentSegmentNotSetError(_0x426b60(0x2cf)+_0x426b60(0x25c)),0x1;const _0x51a0f7=resolveYamlFile(_0x29e70b);if(!existsSync(_0x51a0f7))return showFileNotFoundError(_0x51a0f7,_0x29e70b),0x1;let _0xaf5342;try{_0xaf5342=readFileSync(_0x51a0f7,_0x426b60(0x166));}catch(_0x55b2c0){const _0x43f448=_0x55b2c0 instanceof Error?_0x55b2c0[_0x426b60(0x1fc)]:String(_0x55b2c0);return console[_0x426b60(0x2f7)](_0x426b60(0x134)+_0x43f448),0x1;}const _0x34d444=createCommandSpinner(a31_0x47c070[_0x426b60(0x2f3)](_0x426b60(0x1f8)),{'verbose':_0x49df23['verbose']});_0x34d444[_0x426b60(0x2e1)]();const _0x3d4378={'realtime':!![],'onProgress':_0x1ce72f=>{const _0x404ed8=_0x426b60;_0x34d444[_0x404ed8(0x224)]=formatProgressMessage(_0x1ce72f);}};let _0x151632;try{_0x151632=await _0x1381e4[_0x426b60(0x1b5)]['validateParentYaml'](_0xaf5342,_0x3d4378),_0x34d444[_0x426b60(0x10d)]();}catch(_0x578b1b){_0x34d444[_0x426b60(0x10d)]();throw _0x578b1b;}console[_0x426b60(0x2f7)]('\x0a'+a31_0x47c070[_0x426b60(0x2d2)](_0x426b60(0x113))+'\x20'+_0x151632['name']),console[_0x426b60(0x2f7)]('═'[_0x426b60(0x119)](0x3c)),displayRealtimeValidation(_0x151632),console[_0x426b60(0x2f7)]('─'[_0x426b60(0x119)](0x3c));if(_0x151632[_0x426b60(0x1d0)][_0x426b60(0x2f9)]>0x0){console[_0x426b60(0x2f7)]('\x0a'+a31_0x47c070[_0x426b60(0x293)](_0x426b60(0x270)));for(const _0x42323f of _0x151632[_0x426b60(0x1d0)]){console[_0x426b60(0x2f7)]('\x20\x20'+a31_0x47c070['red']('•')+'\x20'+_0x42323f);}}return _0x151632[_0x426b60(0x232)]&&console[_0x426b60(0x2f7)]('\x0a'+a31_0x47c070[_0x426b60(0x2a3)]('✔')+_0x426b60(0x2dc)),_0x151632[_0x426b60(0x232)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{['name']=a31_0x3334a4(0x121);[a31_0x3334a4(0x1c6)]='List\x20RT\x20journeys';async['execute'](_0x245d72){const _0x5b1ed9=a31_0x3334a4,{options:_0x437e0c,args:_0x511863,tdx:_0x1119ce}=_0x245d72,_0x5788ff=_0x511863[0x0]||_0x437e0c[_0x5b1ed9(0x2aa)];if(!_0x5788ff)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a'+_0x5b1ed9(0x136)),0x1;_0x437e0c[_0x5b1ed9(0x1e4)]&&(console[_0x5b1ed9(0x2f7)](_0x5b1ed9(0x226)+_0x437e0c[_0x5b1ed9(0x2a2)]),console[_0x5b1ed9(0x2f7)](_0x5b1ed9(0x1f1)+_0x5788ff));const _0x46cb4d=await withSpinner(_0x5b1ed9(0x22e)+_0x5788ff+_0x5b1ed9(0x25e),()=>_0x1119ce[_0x5b1ed9(0x1b5)][_0x5b1ed9(0x2cb)](_0x5788ff),{'verbose':_0x437e0c['verbose']}),_0x4735f6=_0x46cb4d[_0x5b1ed9(0x216)],_0x45756f=await withSpinner('Listing\x20RT\x20journeys\x20for\x20\x27'+_0x5788ff+_0x5b1ed9(0x25e),()=>_0x1119ce['realtime']['listJourneys'](_0x4735f6),{'verbose':_0x437e0c['verbose']}),_0x1fb5ac=_0x45756f[_0x5b1ed9(0x216)];console[_0x5b1ed9(0x2f7)](_0x5b1ed9(0xf6)+_0x1fb5ac[_0x5b1ed9(0x2f9)]+_0x5b1ed9(0x20f)+(_0x1fb5ac[_0x5b1ed9(0x2f9)]!==0x1?'s':''));if(_0x437e0c['format']===_0x5b1ed9(0x296)||_0x437e0c[_0x5b1ed9(0x1a0)]===_0x5b1ed9(0x27c))await handleSDKOutput(_0x1fb5ac,_0x437e0c);else{if(_0x1fb5ac['length']===0x0)console[_0x5b1ed9(0x1d7)](_0x5b1ed9(0x299));else for(const _0x5b08e9 of _0x1fb5ac){const _0x2c1377=_0x5b08e9['state']===_0x5b1ed9(0xf1)?'🚀':'📝',_0x45a96d=_0x5b08e9[_0x5b1ed9(0x17a)]?a31_0x47c070[_0x5b1ed9(0x24c)]('\x20(paused)'):'',_0x6e3e99=a31_0x47c070[_0x5b1ed9(0x2f3)]('\x20('+_0x5b08e9[_0x5b1ed9(0x303)]+_0x5b1ed9(0x1b6)+(_0x5b08e9['stageCount']!==0x1?'s':'')+')');console['log'](_0x2c1377+'\x20'+_0x5b08e9['name']+_0x45a96d+_0x6e3e99);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x3334a4(0x133)]='ps:rt:jn:pause';['description']=a31_0x3334a4(0x14c);async[a31_0x3334a4(0x165)](_0x41385b){const _0xc70afe=a31_0x3334a4,{options:_0x24bbf3,args:_0x3fd351,tdx:_0x3a67c9}=_0x41385b,_0x3f37f7=_0x3fd351[0x0];if(!_0x3f37f7)return console[_0xc70afe(0x2f7)](a31_0x47c070['red']('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0xc70afe(0x2f7)](_0xc70afe(0x25f)),console[_0xc70afe(0x2f7)](a31_0x47c070[_0xc70afe(0x2f3)](_0xc70afe(0x104))),0x1;_0x24bbf3[_0xc70afe(0x1e4)]&&(console['error'](_0xc70afe(0x226)+_0x24bbf3[_0xc70afe(0x2a2)]),console[_0xc70afe(0x2f7)]('RT\x20Journey\x20ID:\x20'+_0x3f37f7));const _0x3ec1e1=await withSpinner(_0xc70afe(0x143)+_0x3f37f7+_0xc70afe(0x25e),()=>_0x3a67c9['realtime'][_0xc70afe(0x21e)](_0x3f37f7),{'verbose':_0x24bbf3[_0xc70afe(0x1e4)]}),_0x1f1364=_0x3ec1e1[_0xc70afe(0x216)];console[_0xc70afe(0x2f7)](_0xc70afe(0x1b8)+_0x1f1364['name']+'\x27');if(_0x24bbf3['format']===_0xc70afe(0x296)||_0x24bbf3[_0xc70afe(0x1a0)]===_0xc70afe(0x27c))await handleSDKOutput([_0x1f1364],_0x24bbf3);else{const _0x3f1c80=_0x1f1364[_0xc70afe(0x2c6)]===_0xc70afe(0xf1)?'🚀':'📝',_0x40481b=_0x1f1364[_0xc70afe(0x17a)]?a31_0x47c070['yellow'](_0xc70afe(0x1bd)):'';console['log'](_0x3f1c80+'\x20'+_0x1f1364[_0xc70afe(0x133)]+_0x40481b);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']=a31_0x3334a4(0x238);['description']=a31_0x3334a4(0x196);async['execute'](_0x5b566d){const _0x572757=a31_0x3334a4,{options:_0x19a520,args:_0x4a8a8b,tdx:_0x3df46e}=_0x5b566d,_0x1988ae=_0x4a8a8b[0x0];if(!_0x1988ae)return console[_0x572757(0x2f7)](a31_0x47c070[_0x572757(0x293)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x572757(0x2f7)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a'),console[_0x572757(0x2f7)](a31_0x47c070['dim'](_0x572757(0x104))),0x1;_0x19a520[_0x572757(0x1e4)]&&(console[_0x572757(0x2f7)](_0x572757(0x226)+_0x19a520[_0x572757(0x2a2)]),console['error'](_0x572757(0x146)+_0x1988ae));const _0x2a04d0=await withSpinner(_0x572757(0x204)+_0x1988ae+_0x572757(0x25e),()=>_0x3df46e[_0x572757(0x17b)][_0x572757(0x2da)](_0x1988ae),{'verbose':_0x19a520[_0x572757(0x1e4)]}),_0x4a6d71=_0x2a04d0[_0x572757(0x216)];console[_0x572757(0x2f7)](_0x572757(0x16f)+_0x4a6d71[_0x572757(0x133)]+'\x27');if(_0x19a520['format']===_0x572757(0x296)||_0x19a520['format']===_0x572757(0x27c))await handleSDKOutput([_0x4a6d71],_0x19a520);else{const _0x1feb68=_0x4a6d71[_0x572757(0x2c6)]===_0x572757(0xf1)?'🚀':'📝',_0xecbbf4=_0x4a6d71['paused']?a31_0x47c070['yellow'](_0x572757(0x1bd)):'';console[_0x572757(0x1d7)](_0x1feb68+'\x20'+_0x4a6d71['name']+_0xecbbf4);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']='ps:rt:configuration_versions';[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x1f4);async[a31_0x3334a4(0x165)](_0x57e9cc){const _0x51b14e=a31_0x3334a4,{options:_0x4f71d1,args:_0x3156a1,tdx:_0x1ebec6}=_0x57e9cc,_0x2226f1=_0x3156a1[0x0]||_0x4f71d1[_0x51b14e(0x2aa)];if(!_0x2226f1)return showParentSegmentNotSetError(_0x51b14e(0x102)+_0x51b14e(0x290)),0x1;_0x4f71d1[_0x51b14e(0x1e4)]&&(console[_0x51b14e(0x2f7)](_0x51b14e(0x226)+_0x4f71d1[_0x51b14e(0x2a2)]),console[_0x51b14e(0x2f7)](_0x51b14e(0x1f1)+_0x2226f1));const _0x1ebabb=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2226f1+_0x51b14e(0x25e),()=>_0x1ebec6['segment']['resolveParentId'](_0x2226f1),{'verbose':_0x4f71d1[_0x51b14e(0x1e4)]}),_0x2d14ba=_0x1ebabb[_0x51b14e(0x216)],_0x535ec2=await withSpinner(_0x51b14e(0x2a5)+_0x2226f1+_0x51b14e(0x25e),()=>_0x1ebec6[_0x51b14e(0x17b)][_0x51b14e(0x1ca)](_0x2d14ba),{'verbose':_0x4f71d1[_0x51b14e(0x1e4)]}),_0x2d3021=_0x535ec2['data'];return console[_0x51b14e(0x2f7)](_0x51b14e(0x1e2)),_0x4f71d1[_0x51b14e(0x1a0)]===_0x51b14e(0x296)||_0x4f71d1[_0x51b14e(0x1a0)]===_0x51b14e(0x27c)?await handleSDKOutput([_0x2d3021],_0x4f71d1):(console[_0x51b14e(0x1d7)]('id:\x20'+_0x2d3021['id']),console['log'](_0x51b14e(0x111)+_0x2d3021[_0x51b14e(0x15f)]),console[_0x51b14e(0x1d7)](_0x51b14e(0x13e)+_0x2d3021[_0x51b14e(0x2b2)]),console['log'](_0x51b14e(0x2f5)+_0x2d3021[_0x51b14e(0x2b6)]),console[_0x51b14e(0x1d7)](_0x51b14e(0x128)+_0x2d3021['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x219);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x142);async[a31_0x3334a4(0x165)](_0x3a3b2e){const _0x571035=a31_0x3334a4,{options:_0x40413a,args:_0x1997a5,tdx:_0x191168}=_0x3a3b2e,_0x48f8f5=_0x1997a5[0x0]||_0x40413a[_0x571035(0x2aa)];if(!_0x48f8f5)return showParentSegmentNotSetError(_0x571035(0x15d)+_0x571035(0x1c5)),0x1;const _0x410fbd=await withSpinner(_0x571035(0x22e)+_0x48f8f5+_0x571035(0x25e),()=>_0x191168[_0x571035(0x1b5)][_0x571035(0x2cb)](_0x48f8f5),{'verbose':_0x40413a[_0x571035(0x1e4)]}),_0x96abf3=_0x410fbd['data'],_0x26cf1d=await withSpinner(_0x571035(0x265)+_0x48f8f5+_0x571035(0x25e),()=>_0x191168[_0x571035(0x177)]['list'](_0x96abf3),{'verbose':_0x40413a[_0x571035(0x1e4)]}),_0x93cd82=_0x26cf1d[_0x571035(0x216)];console['error'](_0x571035(0xf6)+_0x93cd82['length']+'\x20personalization\x20service'+(_0x93cd82[_0x571035(0x2f9)]!==0x1?'s':''));if(_0x40413a[_0x571035(0x1a0)]==='json'||_0x40413a[_0x571035(0x1a0)]===_0x571035(0x27c))await handleSDKOutput(_0x93cd82,_0x40413a);else{if(_0x93cd82[_0x571035(0x2f9)]===0x0)console[_0x571035(0x1d7)](_0x571035(0x178)),console[_0x571035(0x2f7)](a31_0x47c070[_0x571035(0x1de)](_0x571035(0x117)));else for(const _0x70e39d of _0x93cd82){console[_0x571035(0x1d7)](a31_0x47c070[_0x571035(0x2d2)](_0x70e39d[_0x571035(0x133)])+'\x20'+a31_0x47c070['dim'](_0x571035(0x20d)+_0x70e39d['id']+')'));_0x70e39d[_0x571035(0x1c6)]&&console[_0x571035(0x1d7)]('\x20\x20'+a31_0x47c070[_0x571035(0x2f3)](_0x70e39d[_0x571035(0x1c6)]));if(_0x70e39d[_0x571035(0x240)]&&_0x70e39d['tokens'][_0x571035(0x2f9)]>0x0)for(const _0x946341 of _0x70e39d[_0x571035(0x240)]){const _0x3f5df5=_0x946341[_0x571035(0x2d1)]?.[_0x571035(0x2f9)]?_0x946341['allowedIps'][_0x571035(0x114)](',\x20'):'any';console[_0x571035(0x1d7)]('\x20\x20'+a31_0x47c070[_0x571035(0x1de)]('token:')+'\x20'+_0x946341['name']+'\x20'+a31_0x47c070['dim'](_0x571035(0x20d)+_0x946341['id']+')')),console[_0x571035(0x1d7)]('\x20\x20\x20\x20'+a31_0x47c070[_0x571035(0x2f3)](_0x571035(0x306))+'\x20'+_0x3f5df5);}else console[_0x571035(0x1d7)]('\x20\x20'+a31_0x47c070[_0x571035(0x2f3)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x2c3);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x1b3);async['execute'](_0x2da732){const _0x2b17a1=a31_0x3334a4,{options:_0x4cb567,args:_0x42a85e,tdx:_0xccdc1a}=_0x2da732,_0x24b507=_0x4cb567,_0x4ca951=_0x42a85e[0x0],_0x200c3d=_0x42a85e[0x1]||_0x4cb567[_0x2b17a1(0x2aa)];if(!_0x4ca951)return console[_0x2b17a1(0x2f7)](_0x2b17a1(0x116)),console['error'](_0x2b17a1(0x157)),console['error'](_0x2b17a1(0x15e)),0x1;if(!_0x200c3d)return showParentSegmentNotSetError(_0x2b17a1(0x26e)+_0x2b17a1(0x15e)),0x1;const _0x9336bd=await withSpinner(_0x2b17a1(0x22e)+_0x200c3d+_0x2b17a1(0x25e),()=>_0xccdc1a[_0x2b17a1(0x1b5)][_0x2b17a1(0x2cb)](_0x200c3d),{'verbose':_0x4cb567[_0x2b17a1(0x1e4)]}),_0x331aa7=_0x9336bd[_0x2b17a1(0x216)],_0x4d9b47={'name':_0x4ca951,'description':_0x24b507[_0x2b17a1(0x1c6)],'public':_0x24b507[_0x2b17a1(0x148)]},_0x2aea62=await withSpinner(_0x2b17a1(0x235)+_0x4ca951+_0x2b17a1(0x25e),()=>_0xccdc1a['personalization']['create'](_0x331aa7,_0x4d9b47),{'verbose':_0x4cb567[_0x2b17a1(0x1e4)]}),_0x1d0c27=_0x2aea62['data'];return console[_0x2b17a1(0x2f7)](_0x2b17a1(0x207)+_0x1d0c27[_0x2b17a1(0x133)]+_0x2b17a1(0x2e4)+_0x1d0c27['id']),await handleSDKOutput([_0x1d0c27],_0x4cb567),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x181);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x2a9);async[a31_0x3334a4(0x165)](_0x271ba1){const _0x17ec6e=a31_0x3334a4,{options:_0xb829f2,args:_0x1f4189,tdx:_0x54c05c}=_0x271ba1,_0x3189f6=_0x1f4189[0x0],_0xc1e6e1=_0x1f4189[0x1]||_0xb829f2['parentSegment'];if(!_0x3189f6)return console[_0x17ec6e(0x2f7)](_0x17ec6e(0x170)),console[_0x17ec6e(0x2f7)](_0x17ec6e(0x1e5)),console[_0x17ec6e(0x2f7)](_0x17ec6e(0x2de)),0x1;if(!_0xc1e6e1)return showParentSegmentNotSetError(_0x17ec6e(0x2be)+_0x17ec6e(0x2de)),0x1;const _0x2daf46=await withSpinner(_0x17ec6e(0x22e)+_0xc1e6e1+_0x17ec6e(0x25e),()=>_0x54c05c[_0x17ec6e(0x1b5)][_0x17ec6e(0x2cb)](_0xc1e6e1),{'verbose':_0xb829f2[_0x17ec6e(0x1e4)]}),_0x7fec04=_0x2daf46[_0x17ec6e(0x216)],_0x41338a=await withSpinner(_0x17ec6e(0x120)+_0x3189f6+'\x27...',()=>_0x54c05c[_0x17ec6e(0x177)][_0x17ec6e(0x254)](_0x7fec04,_0x3189f6),{'verbose':_0xb829f2['verbose']}),_0x189d3a=_0x41338a['data'];if(_0xb829f2['json']||_0xb829f2['jsonl'])await handleSDKOutput([_0x189d3a],_0xb829f2);else{console['log'](a31_0x47c070['bold'](_0x189d3a[_0x17ec6e(0x133)])+'\x20'+a31_0x47c070[_0x17ec6e(0x2f3)](_0x17ec6e(0x20d)+_0x189d3a['id']+')'));_0x189d3a[_0x17ec6e(0x1c6)]&&console['log']('\x20\x20'+a31_0x47c070[_0x17ec6e(0x2f3)](_0x189d3a[_0x17ec6e(0x1c6)]));console['log']('\x20\x20'+a31_0x47c070[_0x17ec6e(0x1de)](_0x17ec6e(0x2f0))+'\x20'+(_0x189d3a[_0x17ec6e(0x148)]?'yes':'no'));if(_0x189d3a['tokens']&&_0x189d3a[_0x17ec6e(0x240)][_0x17ec6e(0x2f9)]>0x0)for(const _0xe9a729 of _0x189d3a[_0x17ec6e(0x240)]){const _0x27efe8=_0xe9a729['allowedIps']?.['length']?_0xe9a729[_0x17ec6e(0x2d1)][_0x17ec6e(0x114)](',\x20'):_0x17ec6e(0x14f);console[_0x17ec6e(0x1d7)]('\x20\x20'+a31_0x47c070[_0x17ec6e(0x1de)]('token:')+'\x20'+_0xe9a729['name']+'\x20'+a31_0x47c070['dim']('(id:\x20'+_0xe9a729['id']+')')),console[_0x17ec6e(0x1d7)](_0x17ec6e(0x271)+a31_0x47c070[_0x17ec6e(0x2f3)](_0x17ec6e(0x306))+'\x20'+_0x27efe8);}else console[_0x17ec6e(0x1d7)]('\x20\x20'+a31_0x47c070[_0x17ec6e(0x2f3)]('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x1f5);[a31_0x3334a4(0x1c6)]='Delete\x20a\x20personalization\x20service';async['execute'](_0x5d1c21){const _0x47be4a=a31_0x3334a4,{options:_0x737bb,args:_0x569ab6,tdx:_0x3388fb}=_0x5d1c21,_0x582f90=_0x569ab6[0x0],_0x5a0aa9=_0x569ab6[0x1]||_0x737bb[_0x47be4a(0x2aa)];if(!_0x582f90)return console[_0x47be4a(0x2f7)](_0x47be4a(0x170)),console['error'](_0x47be4a(0x129)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x5a0aa9)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x2c9edd=await withSpinner(_0x47be4a(0x22e)+_0x5a0aa9+_0x47be4a(0x25e),()=>_0x3388fb[_0x47be4a(0x1b5)][_0x47be4a(0x2cb)](_0x5a0aa9),{'verbose':_0x737bb[_0x47be4a(0x1e4)]}),_0x28687c=_0x2c9edd[_0x47be4a(0x216)];return await withSpinner(_0x47be4a(0x189)+_0x582f90+'\x27...',()=>_0x3388fb['personalization'][_0x47be4a(0x158)](_0x28687c,_0x582f90),{'verbose':_0x737bb['verbose']}),console[_0x47be4a(0x2f7)](_0x47be4a(0x11a)+_0x582f90+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{['name']=a31_0x3334a4(0x10c);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x2f8);async['execute'](_0x3565e1){const _0x237181=a31_0x3334a4,{options:_0x238ef7,args:_0xa18026,tdx:_0x15762f}=_0x3565e1,_0x11eeef=_0x238ef7,_0xa58af3=_0xa18026[0x0],_0x47cd2f=_0xa18026[0x1]||_0x238ef7[_0x237181(0x2aa)];if(!_0xa58af3)return console[_0x237181(0x2f7)](_0x237181(0x170)),console[_0x237181(0x2f7)](_0x237181(0xf9)),console['error'](_0x237181(0x249)),0x1;if(!_0x11eeef[_0x237181(0x133)])return console[_0x237181(0x2f7)](_0x237181(0x16d)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),0x1;if(!_0x47cd2f)return showParentSegmentNotSetError(_0x237181(0x2e0)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x1f5721=await withSpinner(_0x237181(0x22e)+_0x47cd2f+_0x237181(0x25e),()=>_0x15762f['segment'][_0x237181(0x2cb)](_0x47cd2f),{'verbose':_0x238ef7[_0x237181(0x1e4)]}),_0x178b57=_0x1f5721[_0x237181(0x216)],_0x4e8143={'name':_0x11eeef[_0x237181(0x133)]};_0x11eeef[_0x237181(0x1c6)]!==undefined&&(_0x4e8143[_0x237181(0x1c6)]=_0x11eeef[_0x237181(0x1c6)]);const _0x1783cb=await withSpinner(_0x237181(0x1bc)+_0xa58af3+_0x237181(0x25e),()=>_0x15762f[_0x237181(0x177)]['patch'](_0x178b57,_0xa58af3,_0x4e8143),{'verbose':_0x238ef7[_0x237181(0x1e4)]}),_0x150e78=_0x1783cb[_0x237181(0x216)];return console[_0x237181(0x2f7)](_0x237181(0x300)+_0x150e78[_0x237181(0x133)]+'\x27'),await handleSDKOutput([_0x150e78],_0x238ef7),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']='ps:pz:service:token:create';[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x18d);async[a31_0x3334a4(0x165)](_0x41e0b0){const _0x5bb9f0=a31_0x3334a4,{options:_0x1108d1,args:_0x31831e,tdx:_0x16a0aa}=_0x41e0b0,_0x58cc50=_0x1108d1,_0x34542d=_0x31831e[0x0],_0x77dd44=_0x31831e[0x1],_0x658309=_0x31831e[0x2]||_0x1108d1[_0x5bb9f0(0x2aa)];if(!_0x34542d)return console['error'](_0x5bb9f0(0x1b1)),console[_0x5bb9f0(0x2f7)](_0x5bb9f0(0x25b)),console['error'](_0x5bb9f0(0x11f)),0x1;if(!_0x77dd44)return console[_0x5bb9f0(0x2f7)](_0x5bb9f0(0x170)),console[_0x5bb9f0(0x2f7)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x5bb9f0(0x2f7)](_0x5bb9f0(0x11f)),0x1;if(!_0x658309)return showParentSegmentNotSetError(_0x5bb9f0(0x2ae)+_0x5bb9f0(0x11f)),0x1;const _0x1910a6=await withSpinner(_0x5bb9f0(0x22e)+_0x658309+_0x5bb9f0(0x25e),()=>_0x16a0aa[_0x5bb9f0(0x1b5)]['resolveParentId'](_0x658309),{'verbose':_0x1108d1[_0x5bb9f0(0x1e4)]}),_0x435864=_0x1910a6[_0x5bb9f0(0x216)],_0x4911ec={'name':_0x34542d};_0x58cc50[_0x5bb9f0(0x2d1)]&&(_0x4911ec[_0x5bb9f0(0x2d1)]=_0x58cc50[_0x5bb9f0(0x2d1)][_0x5bb9f0(0x221)](',')[_0x5bb9f0(0x2bd)](_0x4cfc59=>_0x4cfc59[_0x5bb9f0(0x19c)]()));_0x58cc50[_0x5bb9f0(0x1c6)]&&(_0x4911ec[_0x5bb9f0(0x1c6)]=_0x58cc50['description']);const _0x457550=await withSpinner(_0x5bb9f0(0x2af)+_0x34542d+_0x5bb9f0(0x1a5)+_0x77dd44+'\x27...',()=>_0x16a0aa[_0x5bb9f0(0x177)][_0x5bb9f0(0x2ff)](_0x435864,_0x77dd44,_0x4911ec),{'verbose':_0x1108d1['verbose']}),_0x372b49=_0x457550[_0x5bb9f0(0x216)];return console['error'](_0x5bb9f0(0x2a1)+_0x372b49[_0x5bb9f0(0x133)]+_0x5bb9f0(0x2e4)+_0x372b49['id']),_0x372b49['value']&&(console[_0x5bb9f0(0x2f7)](a31_0x47c070['yellow'](_0x5bb9f0(0x1a7))),console[_0x5bb9f0(0x2f7)](a31_0x47c070[_0x5bb9f0(0x1de)](_0x372b49[_0x5bb9f0(0x115)])),console[_0x5bb9f0(0x2f7)]('')),await handleSDKOutput([_0x372b49],_0x1108d1),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{['name']='ps:pz:service:token:delete';[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x139);async[a31_0x3334a4(0x165)](_0x3f19fe){const _0xae8428=a31_0x3334a4,{options:_0x5e6d0f,args:_0x2ec510,tdx:_0x45b478}=_0x3f19fe,_0xf9e716=_0x2ec510[0x0],_0x5aab7d=_0x2ec510[0x1]||_0x5e6d0f[_0xae8428(0x2aa)];if(!_0xf9e716)return console[_0xae8428(0x2f7)](_0xae8428(0x1ff)),console[_0xae8428(0x2f7)](_0xae8428(0x285)),console['error'](_0xae8428(0x2a6)),0x1;if(!_0x5aab7d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x195fc8=await withSpinner(_0xae8428(0x22e)+_0x5aab7d+_0xae8428(0x25e),()=>_0x45b478[_0xae8428(0x1b5)][_0xae8428(0x2cb)](_0x5aab7d),{'verbose':_0x5e6d0f[_0xae8428(0x1e4)]}),_0x79805e=_0x195fc8[_0xae8428(0x216)],_0x21cbb4=await withSpinner(_0xae8428(0x123),()=>_0x45b478[_0xae8428(0x177)][_0xae8428(0x24e)](_0x79805e),{'verbose':_0x5e6d0f['verbose']}),_0x191fe5=_0x21cbb4[_0xae8428(0x216)];let _0x4cc804;for(const _0x3b4a09 of _0x191fe5){if(_0x3b4a09[_0xae8428(0x240)]?.[_0xae8428(0x199)](_0x3edc5c=>_0x3edc5c['id']===_0xf9e716)){_0x4cc804=_0x3b4a09['id'];break;}}if(!_0x4cc804)return console[_0xae8428(0x2f7)](_0xae8428(0xff)+_0xf9e716+_0xae8428(0x250)),0x1;const _0x1117cb=await withSpinner('Deleting\x20token\x20\x27'+_0xf9e716+_0xae8428(0x25e),()=>_0x45b478[_0xae8428(0x177)][_0xae8428(0x25d)](_0x79805e,_0x4cc804,_0xf9e716),{'verbose':_0x5e6d0f[_0xae8428(0x1e4)]}),_0x567904=_0x1117cb[_0xae8428(0x216)];return console[_0xae8428(0x2f7)]('✔\x20Deleted\x20token\x20\x27'+(_0x567904[_0xae8428(0x133)]||_0xf9e716)+'\x27'),await handleSDKOutput([_0x567904],_0x5e6d0f),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x2b9);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x1c9);async[a31_0x3334a4(0x165)](_0x3d4002){const _0x253160=a31_0x3334a4,{options:_0x25de08,args:_0x31d446,tdx:_0x2c9845}=_0x3d4002,_0x4d5d2a=_0x31d446[0x0]||_0x25de08[_0x253160(0x2aa)];if(!_0x4d5d2a)return showParentSegmentNotSetError(_0x253160(0x218)+_0x253160(0x201)),0x1;const _0x8fa7c1=await withSpinner(_0x253160(0x22e)+_0x4d5d2a+'\x27...',()=>_0x2c9845[_0x253160(0x1b5)][_0x253160(0x2cb)](_0x4d5d2a),{'verbose':_0x25de08['verbose']}),_0x14528c=_0x8fa7c1[_0x253160(0x216)],_0x1aeedc=await withSpinner(_0x253160(0x1f3)+_0x4d5d2a+_0x253160(0x25e),()=>_0x2c9845[_0x253160(0x177)]['listPersonalizations'](_0x14528c),{'verbose':_0x25de08[_0x253160(0x1e4)]}),_0x125ecf=_0x1aeedc['data'];console[_0x253160(0x2f7)](_0x253160(0xf6)+_0x125ecf[_0x253160(0x2f9)]+_0x253160(0x159)+(_0x125ecf['length']!==0x1?'s':''));if(_0x25de08[_0x253160(0x1a0)]==='json'||_0x25de08[_0x253160(0x1a0)]===_0x253160(0x27c))await handleSDKOutput(_0x125ecf,_0x25de08);else{if(_0x125ecf[_0x253160(0x2f9)]===0x0)console[_0x253160(0x1d7)](_0x253160(0x2df));else for(const _0x3c0d16 of _0x125ecf){console['log'](a31_0x47c070[_0x253160(0x2d2)](_0x3c0d16[_0x253160(0x133)])+'\x20'+a31_0x47c070['dim'](_0x253160(0x20d)+_0x3c0d16['id']+')'));_0x3c0d16['description']&&console[_0x253160(0x1d7)]('\x20\x20'+a31_0x47c070[_0x253160(0x2f3)](_0x3c0d16[_0x253160(0x1c6)]));const _0x2145fb=_0x3c0d16[_0x253160(0x1f7)]?.[_0x253160(0x2f9)]||0x0;console[_0x253160(0x1d7)]('\x20\x20'+a31_0x47c070['cyan'](_0x253160(0x27f))+'\x20'+_0x2145fb);if(_0x3c0d16[_0x253160(0x1f7)]&&_0x3c0d16[_0x253160(0x1f7)]['length']>0x0)for(const _0xdc6cca of _0x3c0d16['sections']){console['log'](_0x253160(0x1ba)+_0xdc6cca[_0x253160(0x133)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0xf5);[a31_0x3334a4(0x1c6)]='Show\x20a\x20specific\x20realtime\x20personalization';async[a31_0x3334a4(0x165)](_0xba5c1b){const _0x309459=a31_0x3334a4,{options:_0x44c226,args:_0x4b14b6,tdx:_0x218372}=_0xba5c1b,_0x29c229=_0x4b14b6[0x0];if(!_0x29c229)return console['error'](_0x309459(0x2e7)),console[_0x309459(0x2f7)](_0x309459(0x1c4)),0x1;const _0x227d0a=await withSpinner('Getting\x20personalization\x20\x27'+_0x29c229+_0x309459(0x25e),()=>_0x218372['personalization'][_0x309459(0x23a)](_0x29c229),{'verbose':_0x44c226[_0x309459(0x1e4)]}),_0x32f5ab=_0x227d0a[_0x309459(0x216)];console['error']('✔\x20Found\x20personalization\x20\x27'+_0x32f5ab[_0x309459(0x133)]+'\x27');if(_0x44c226[_0x309459(0x1a0)]===_0x309459(0x296)||_0x44c226['format']==='jsonl')await handleSDKOutput([_0x32f5ab],_0x44c226);else{console[_0x309459(0x1d7)](a31_0x47c070['bold'](_0x32f5ab[_0x309459(0x133)])+'\x20'+a31_0x47c070[_0x309459(0x2f3)](_0x309459(0x20d)+_0x32f5ab['id']+')'));_0x32f5ab[_0x309459(0x1c6)]&&console['log']('\x20\x20'+a31_0x47c070[_0x309459(0x2f3)](_0x32f5ab[_0x309459(0x1c6)]));_0x32f5ab[_0x309459(0x15f)]&&console[_0x309459(0x1d7)]('\x20\x20'+a31_0x47c070['cyan']('audienceId:')+'\x20'+_0x32f5ab[_0x309459(0x15f)]);console[_0x309459(0x1d7)]('\x20\x20'+a31_0x47c070[_0x309459(0x1de)]('created:')+'\x20'+_0x32f5ab['createdAt']),console[_0x309459(0x1d7)]('\x20\x20'+a31_0x47c070[_0x309459(0x1de)](_0x309459(0x13f))+'\x20'+_0x32f5ab[_0x309459(0x2d6)]);const _0x51fd1e=_0x32f5ab['sections']?.[_0x309459(0x2f9)]||0x0;console[_0x309459(0x1d7)]('\x20\x20'+a31_0x47c070[_0x309459(0x1de)](_0x309459(0x27f))+'\x20'+_0x51fd1e);if(_0x32f5ab[_0x309459(0x1f7)]&&_0x32f5ab['sections'][_0x309459(0x2f9)]>0x0)for(const _0x7ba165 of _0x32f5ab[_0x309459(0x1f7)]){console[_0x309459(0x1d7)](_0x309459(0x271)+a31_0x47c070[_0x309459(0x2d2)](_0x7ba165[_0x309459(0x133)])+'\x20'+a31_0x47c070['dim'](_0x309459(0x20d)+_0x7ba165['id']+')')),_0x7ba165[_0x309459(0x1e1)]&&(console['log']('\x20\x20\x20\x20\x20\x20'+a31_0x47c070[_0x309459(0x1de)](_0x309459(0x106))+'\x20'+_0x7ba165[_0x309459(0x1e1)]['name']),_0x7ba165[_0x309459(0x1e1)]['keyEventCriteria']?.[_0x309459(0x11b)]&&console[_0x309459(0x1d7)](_0x309459(0x23b)+a31_0x47c070[_0x309459(0x1de)]('keyEventId:')+'\x20'+_0x7ba165['entryCriteria'][_0x309459(0x2c9)]['keyEventId'])),_0x7ba165['payload']&&console[_0x309459(0x1d7)](_0x309459(0x2ef)+a31_0x47c070[_0x309459(0x1de)](_0x309459(0x284))+'\x20'+JSON['stringify'](_0x7ba165[_0x309459(0x1e8)])),_0x7ba165[_0x309459(0x1b4)]&&console[_0x309459(0x1d7)](_0x309459(0x2ef)+a31_0x47c070[_0x309459(0x1de)]('includeSensitive:')+_0x309459(0xf8));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x3334a4(0x133)]='ps:pz:delete';[a31_0x3334a4(0x1c6)]='Delete\x20a\x20realtime\x20personalization';async['execute'](_0x153a0e){const _0x20b46d=a31_0x3334a4,{options:_0xc0bf3f,args:_0x53a92f,tdx:_0x27f16c}=_0x153a0e,_0x562eb7=_0x53a92f[0x0];if(!_0x562eb7)return console[_0x20b46d(0x2f7)](_0x20b46d(0x2e7)),console[_0x20b46d(0x2f7)](_0x20b46d(0x258)),0x1;return await withSpinner(_0x20b46d(0x268)+_0x562eb7+_0x20b46d(0x25e),()=>_0x27f16c[_0x20b46d(0x177)][_0x20b46d(0x304)](_0x562eb7),{'verbose':_0xc0bf3f[_0x20b46d(0x1e4)]}),console[_0x20b46d(0x2f7)](_0x20b46d(0x29e)+_0x562eb7+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x302);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x289);async[a31_0x3334a4(0x165)](_0x46612f){const _0x4d7bc5=a31_0x3334a4,{options:_0x2c5c5b,tdx:_0x1a80fa}=_0x46612f,_0x56c735=_0x2c5c5b;let _0x28ffd9;if(_0x56c735[_0x4d7bc5(0x2ac)]){_0x28ffd9=await loadJSON(_0x56c735[_0x4d7bc5(0x2ac)],!![]);if(!_0x28ffd9['relationships']?.[_0x4d7bc5(0x2a8)])return console[_0x4d7bc5(0x2f7)](_0x4d7bc5(0x28a)),console[_0x4d7bc5(0x2f7)]('Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:'),console[_0x4d7bc5(0x2f7)](_0x4d7bc5(0x209)),0x1;}else{if(!_0x56c735[_0x4d7bc5(0x133)])return console[_0x4d7bc5(0x2f7)](_0x4d7bc5(0xfe)),console[_0x4d7bc5(0x2f7)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x4d7bc5(0x2f7)](_0x4d7bc5(0x175)),0x1;if(_0x56c735[_0x4d7bc5(0x1c6)]===undefined)return console['error'](_0x4d7bc5(0x241)),console['error'](_0x4d7bc5(0xfc)),console[_0x4d7bc5(0x2f7)](_0x4d7bc5(0x175)),0x1;if(_0x56c735[_0x4d7bc5(0x278)]===undefined)return console[_0x4d7bc5(0x2f7)]('Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.'),console[_0x4d7bc5(0x2f7)](_0x4d7bc5(0x22c)),0x1;let _0x3af4f2=_0x56c735['audienceId'];if(!_0x3af4f2&&_0x2c5c5b[_0x4d7bc5(0x2aa)]){const _0x38aee0=await withSpinner(_0x4d7bc5(0x22e)+_0x2c5c5b[_0x4d7bc5(0x2aa)]+_0x4d7bc5(0x25e),()=>_0x1a80fa[_0x4d7bc5(0x1b5)][_0x4d7bc5(0x2cb)](_0x2c5c5b[_0x4d7bc5(0x2aa)]),{'verbose':_0x2c5c5b[_0x4d7bc5(0x1e4)]});_0x3af4f2=_0x38aee0[_0x4d7bc5(0x216)];}let _0x213aa3;_0x56c735[_0x4d7bc5(0x1f7)]&&(_0x213aa3=await loadJSON(_0x56c735[_0x4d7bc5(0x1f7)],![]));const _0x10a025=_0x56c735[_0x4d7bc5(0x278)]===_0x4d7bc5(0x202)?null:{'id':_0x56c735[_0x4d7bc5(0x278)],'type':_0x4d7bc5(0x11d)};_0x28ffd9={'attributes':{'name':_0x56c735[_0x4d7bc5(0x133)],'description':_0x56c735[_0x4d7bc5(0x1c6)]||null,..._0x3af4f2!==undefined&&{'audienceId':_0x3af4f2},..._0x213aa3!==undefined&&{'sections':_0x213aa3}},'relationships':{'parentFolder':{'data':_0x10a025}}};}const _0x149e23=await withSpinner('Creating\x20personalization\x20\x27'+(_0x28ffd9[_0x4d7bc5(0x20b)]?.[_0x4d7bc5(0x133)]??'')+_0x4d7bc5(0x25e),()=>_0x1a80fa[_0x4d7bc5(0x177)][_0x4d7bc5(0x253)](_0x28ffd9),{'verbose':_0x2c5c5b['verbose']}),_0x442655=_0x149e23['data'];return console['error'](_0x4d7bc5(0x217)+_0x442655['name']+_0x4d7bc5(0x2e4)+_0x442655['id']),await handleSDKOutput([_0x442655],_0x2c5c5b),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x24a);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x1dc);async[a31_0x3334a4(0x165)](_0x28b905){const _0x34692d=a31_0x3334a4,{options:_0x4ed834,args:_0x8a388d}=_0x28b905,_0x5f5c2c=_0x4ed834,_0xb44259=_0x8a388d[0x0];if(!_0xb44259)return console[_0x34692d(0x2f7)](_0x34692d(0x2e7)),console[_0x34692d(0x2f7)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0x34692d(0x2f7)](_0x34692d(0x1fb)),0x1;let _0x430b7a;if(_0x5f5c2c[_0x34692d(0x2ac)])_0x430b7a=await loadJSON(_0x5f5c2c[_0x34692d(0x2ac)],!![]);else{if(!_0x5f5c2c[_0x34692d(0x133)])return console[_0x34692d(0x2f7)](_0x34692d(0xfe)),console[_0x34692d(0x2f7)](_0x34692d(0x155)),0x1;if(_0x5f5c2c['description']===undefined)return console[_0x34692d(0x2f7)](_0x34692d(0x241)),console[_0x34692d(0x2f7)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;let _0x5c1a8b;_0x5f5c2c[_0x34692d(0x1f7)]&&(_0x5c1a8b=await loadJSON(_0x5f5c2c[_0x34692d(0x1f7)],![])),_0x430b7a={'attributes':{'name':_0x5f5c2c[_0x34692d(0x133)],'description':_0x5f5c2c[_0x34692d(0x1c6)]||null,..._0x5c1a8b!==undefined&&{'sections':_0x5c1a8b}}};}const {tdx:_0xdce757}=_0x28b905,_0x5eb034=await withSpinner(_0x34692d(0x110)+_0xb44259+'\x27...',()=>_0xdce757[_0x34692d(0x177)][_0x34692d(0x27d)](_0xb44259,_0x430b7a),{'verbose':_0x4ed834[_0x34692d(0x1e4)]}),_0x151e02=_0x5eb034[_0x34692d(0x216)];return console['error'](_0x34692d(0x1aa)+_0x151e02['name']+_0x34692d(0x2e3)+_0x151e02['id']+')'),await handleSDKOutput([_0x151e02],_0x4ed834),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x3334a4(0x133)]=a31_0x3334a4(0x12a);[a31_0x3334a4(0x1c6)]=a31_0x3334a4(0x14e);async[a31_0x3334a4(0x165)](_0x4dd887){const _0x12995f=a31_0x3334a4,{options:_0xb83ce0,args:_0x34b26d}=_0x4dd887,_0x575674=_0x34b26d[0x0]||_0xb83ce0[_0x12995f(0x2aa)];if(!_0x575674)return showParentSegmentNotSetError(_0x12995f(0x2e8)+'\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'),0x1;const _0x42c7c7=resolveYamlFile(_0x575674);if(!existsSync(_0x42c7c7))return showFileNotFoundError(_0x42c7c7,_0x575674),0x1;let _0x4cba1c;try{_0x4cba1c=readFileSync(_0x42c7c7,_0x12995f(0x166));}catch(_0x46256b){const _0x15b0f5=_0x46256b instanceof Error?_0x46256b[_0x12995f(0x1fc)]:String(_0x46256b);return console[_0x12995f(0x2f7)](_0x12995f(0x134)+_0x15b0f5),0x1;}let _0x57676e;try{_0x57676e=parseDef(_0x4cba1c);}catch(_0x147f21){const _0x4bc080=_0x147f21 instanceof Error?_0x147f21[_0x12995f(0x1fc)]:String(_0x147f21);return console['error'](a31_0x47c070[_0x12995f(0x293)]('Error\x20parsing\x20YAML:\x20'+_0x4bc080)),0x1;}if(_0x57676e['personalization_services']&&_0x57676e[_0x12995f(0x15a)][_0x12995f(0x2f9)]>0x0)return console[_0x12995f(0x2f7)](a31_0x47c070['yellow'](_0x12995f(0x291)+_0x42c7c7)),console['error'](a31_0x47c070['dim'](_0x12995f(0x1b9)+_0x57676e[_0x12995f(0x15a)][_0x12995f(0x2f9)]+_0x12995f(0x137))),0x1;!_0x57676e['realtime']&&(_0x57676e[_0x12995f(0x17b)]={'events':[{'name':_0x12995f(0x1d6),'source_table':_0x12995f(0x269)}],'attributes':[{'name':_0x12995f(0x1a1),'type':_0x12995f(0x248)}],'id_stitching':{'primary_key':_0x57676e[_0x12995f(0x1ed)][_0x12995f(0x211)]===_0x12995f(0xf2)?'td_client_id':_0x12995f(0x247)}});_0x57676e[_0x12995f(0x15a)]=[{'name':'My\x20Service','description':_0x12995f(0x2cd),'trigger_event':_0x12995f(0x1d6),'sections':[{'name':_0x12995f(0x2fc),'criteria':_0x12995f(0x1e6),'attributes':[_0x12995f(0x1a1)]}]}];const _0xda1d1d=serializeDef(_0x57676e);return writeFileSync(_0x42c7c7,_0xda1d1d,_0x12995f(0x166)),console[_0x12995f(0x2f7)](a31_0x47c070[_0x12995f(0x2a3)]('✔')+_0x12995f(0x256)+a31_0x47c070[_0x12995f(0x1de)](_0x42c7c7)),(!_0x57676e[_0x12995f(0x17b)]||_0x4cba1c['indexOf']('realtime:')===-0x1)&&console[_0x12995f(0x2f7)](a31_0x47c070['green']('✔')+_0x12995f(0x2eb)),console[_0x12995f(0x2f7)]('\x0a'+a31_0x47c070[_0x12995f(0x2f3)](_0x12995f(0x1cf))),console[_0x12995f(0x2f7)](_0x12995f(0x29b)+_0x42c7c7+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x12995f(0x2f7)](_0x12995f(0x1a8)+a31_0x47c070[_0x12995f(0x2f3)](_0x12995f(0x138)+_0x575674)+_0x12995f(0x208)),0x0;}}
1
+ const a31_0x23ba89=a31_0x1186;(function(_0x251df9,_0x559f65){const _0x149442=a31_0x1186,_0x45bc40=_0x251df9();while(!![]){try{const _0x10a0fa=-parseInt(_0x149442(0x21a))/0x1+parseInt(_0x149442(0x271))/0x2+parseInt(_0x149442(0x27e))/0x3+-parseInt(_0x149442(0x2f1))/0x4*(-parseInt(_0x149442(0x39a))/0x5)+-parseInt(_0x149442(0x261))/0x6+parseInt(_0x149442(0x26d))/0x7*(parseInt(_0x149442(0x1c5))/0x8)+parseInt(_0x149442(0x32d))/0x9*(-parseInt(_0x149442(0x33d))/0xa);if(_0x10a0fa===_0x559f65)break;else _0x45bc40['push'](_0x45bc40['shift']());}catch(_0x25567e){_0x45bc40['push'](_0x45bc40['shift']());}}}(a31_0x1c60,0x48117));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x5fc94f 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_0x22e59c 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_0x23ba89(0x293),LEGACY_PARENT_SEGMENT_DIR=a31_0x23ba89(0x28e);function openBrowser(_0x2e0509){const _0x58c71e=a31_0x23ba89,_0x1d1e7b=process[_0x58c71e(0x2c3)],_0x9c3fc2=_0x1d1e7b==='darwin'?_0x58c71e(0x1ec):_0x1d1e7b===_0x58c71e(0x361)?'start':'xdg-open';spawn(_0x9c3fc2,[_0x2e0509],{'detached':!![],'stdio':_0x58c71e(0x276)})[_0x58c71e(0x243)]();}function migrateLegacyDirectory(){const _0xb9499d=a31_0x23ba89;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x32f96c=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x32f96c[_0xb9499d(0x23b)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xb9499d(0x1b0)](a31_0x22e59c[_0xb9499d(0x1e8)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0xb9499d(0x302))),console['error'](a31_0x22e59c['dim']('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xb9499d(0x266))),![];console[_0xb9499d(0x1b0)](a31_0x22e59c[_0xb9499d(0x1e8)](_0xb9499d(0x2c0)+LEGACY_PARENT_SEGMENT_DIR+_0xb9499d(0x213)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0xb9499d(0x1b0)](a31_0x22e59c['green'](_0xb9499d(0x21d)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x200308){const _0x10b6e0=_0x200308 instanceof Error?_0x200308[_0xb9499d(0x39b)]:String(_0x200308);return console['error'](a31_0x22e59c[_0xb9499d(0x38e)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x10b6e0+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x23ba89(0x330)](_0x204276){const _0xf33767=a31_0x23ba89;return migrateLegacyDirectory(),super[_0xf33767(0x330)](_0x204276);}}function resolveYamlFile(_0x1a34b4){const _0x65628b=a31_0x23ba89;if(_0x1a34b4[_0x65628b(0x217)](_0x65628b(0x257))||_0x1a34b4[_0x65628b(0x217)](_0x65628b(0x223)))return _0x1a34b4;return a31_0x5fc94f[_0x65628b(0x301)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1a34b4)+_0x65628b(0x257));}function formatProgressMessage(_0x1bef4e){const _0x50d9ee=a31_0x23ba89,_0x3c5800=_0x1bef4e[_0x50d9ee(0x1a4)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x3c5800){const [,_0x5e4027,_0x4f88e8,_0xd87cd2='']=_0x3c5800;return a31_0x22e59c[_0x50d9ee(0x297)](_0x5e4027+':')+'\x20'+_0x4f88e8+a31_0x22e59c[_0x50d9ee(0x297)](_0xd87cd2);}return a31_0x22e59c[_0x50d9ee(0x297)](_0x1bef4e);}function a31_0x1186(_0x395e1d,_0x52af27){_0x395e1d=_0x395e1d-0x1a2;const _0x1c6034=a31_0x1c60();let _0x11866c=_0x1c6034[_0x395e1d];return _0x11866c;}function a31_0x1c60(){const _0x280f1b=['No\x20parent\x20segments\x20match\x20pattern:\x20','last_page_viewed','4KOngvW','Attempt:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Analyzing\x20changes...','Updating','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','✔\x20Query\x20completed:\x20Processed\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','realtime:','Schema\x20saved\x20to\x20','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','Error\x20reading\x20file:\x20','\x20stage','execute','Create\x20a\x20realtime\x20personalization\x20entity','state','join','/\x20directories\x20exist.','keyEventCriteria','displaySummary','columns','Update\x20a\x20realtime\x20personalization\x20entity','Table:\x20','\x20behaviors','Creating\x20token\x20\x27','map','ps:rt:configuration_versions','\x20(paused)','previewParentYaml','Creating\x20parent\x20segment\x20\x27','description','\x20--enriched','paused','Fetching\x20current\x20configuration\x20for\x20\x27','\x20--attribute\x20\x22<name>\x22','ps:rt:validate','getOutputDatabaseName','\x27\x20and\x20run\x20workflow?','text','Error:\x20Service\x20name\x20is\x20required','Error:\x20Parent\x20segment\x20name\x20is\x20required','Fetching\x20parent\x20segment\x20\x27','scheduleOption','patch','Next\x20steps:','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','deletePersonalization','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','⚡\x20Enabled','\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\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','deleteToken','Master\x20+\x20Attributes','jsonl','behaviors','foreignKey','errors','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Behavior:','pauseJourney','72783GFprNJ','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','run','No\x20RT-enabled\x20parent\x20segments\x20found','sections','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Rows:','attributes','customerGroupFile','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','Apply\x20changes\x20to\x20\x27','No\x20personalization\x20services\x20configured','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','events','600kDSQln','some','\x20personalization\x20service','displayMasterInfo','log','Options\x20(one\x20required):\x0a','Error:\x20--database\x20and\x20--table\x20are\x20required','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','ps:rt:list','✔\x20Retrieved\x20RT\x20configuration\x20version','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Columns:','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','value','Create\x20parent\x20segment\x20\x27','tdx\x20ps\x20push\x20','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','segment:parent:list','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','schemaError','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','listPersonalizations','Get\x20SQL\x20query\x20for\x20parent\x20segment','createToken','name','Finding\x20service\x20for\x20token...','Site:\x20','behavior','replace','idStitching','test','listJourneys','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','entryCriteria','scheduleType','win32','format','Created','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','tokens','personalizationServices','To\x20view\x20sample\x20data:','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','dirname','\x20Configuration\x20is\x20valid','\x20Added\x20personalization\x20template\x20to\x20','list','keys','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','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','launched','status','enriched','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','sourceTableValid','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Fetching\x20SQL\x20for\x20\x27','ps:rt:jn:resume','Patching\x20personalization\x20\x27','string','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','json','\x20+\x20[','YAML\x20file:\x20','Delete\x20a\x20realtime\x20personalization','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','attribute','pushParentYaml','Default','start','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Options:\x0a','repeat','jobId','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','red','customerPercent','Updating\x20personalization\x20service\x20\x27','Updating\x20parent\x20segment\x20\x27','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\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','\x22\x20}','/{name}.yml\x0a','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','realtime','addBehaviorsFile','914005OHVjBJ','message','keyEventId','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','page_view','relationships','\x20configured','indexOf','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','token:','folder-segment','label','\x20No\x20changes\x20-\x20','\x20\x20Note:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','null','\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','\x20\x20Database:\x20','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','schemaValid','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','file','Attributes:','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','enabled','td_client_id','apply','segment:parent:fields','ps:pz:service:list','match','green','addAttributesFile','\x22,\x20\x22type\x22:\x20\x22','Creating','toLowerCase','listFields','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','\x20\x201.\x20Edit\x20','any','\x0aChanges\x20to\x20\x27','\x20RT-enabled\x20parent\x20segment','error','Deleting\x20token\x20\x27','all','web','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','information_schema','✔\x20Created\x20personalization\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','✔\x20Deleted\x20personalization\x20\x27','Error:\x20Service\x20ID\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','push','\x0aChanges\x20to\x20apply\x20to\x20\x27','workflowId','/app/workflows/','Validating\x20configuration...','getParentFull','id:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','runParent','80gwPPFD','delete','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','segment:parent:run','no\x20tokens\x20configured','\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\x20','✔\x20Found\x20','Available\x20attributes:','Errors:','\x20\x20Columns:\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Personalization:','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','output','behaviorsFile','ps:pz:service:delete','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','SELECT\x20*\x20FROM\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','column','stop','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','ps:pz:init','createParent','/app/dw/parentSegments/','customersWithEvents','created:','\x27...','getCurrentConfigVersion','Fetching\x20sample\x20data...','stringify','Status:','\x20rows\x20','yellow','/attempt/','\x20service','\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}','open','Available\x20behaviors:','segment:parent:preview','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x27\x20is\x20already\x20up\x20to\x20date','audienceId','user_id','Error:\x20Token\x20\x27','Parent\x20segment:\x20','double','Deleting\x20personalization\x20\x27','Creating\x20personalization\x20\x27','\x20service(s)\x20configured','addAttributes','Show\x20parent\x20segment\x20schema\x20(column\x20types)','joinKey','split','✔\x20Deleted\x20personalization\x20service\x20\x27','Found\x20YAML\x20file:\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x20total','payload','Validating\x20RT\x20configuration...','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','resolveParentId','validateParentYaml','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Audience\x20ID:','\x27\x20with\x20ID:\x20','ps:pz:service:update','column_type','addBehaviors','\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','utf-8','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','yes','matchedCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','/\x20→\x20','bold','Resolving\x20parent\x20segment\x20\x27','toFixed','endsWith','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','behavior_','153872YVIwZL','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\x20parent\x20segment\x20\x27','✔\x20Renamed\x20directory\x20to\x20','ps:pz:delete','Error:','\x20\x20\x20\x20-\x20','timezone','getBehaviorNames','.yaml','\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','workflowAttemptId','displayColumns','segment:parent:validate','displaySampleData','Overwrite\x20\x27','-1d','✔\x20Updated\x20personalization\x20service\x20\x27','Getting\x20personalization\x20\x27','public','✔\x20Created\x20token\x20\x27','limit','session','\x0a\x20\x20]\x0a}\x0a','No\x20RT\x20journeys\x20found','column_name','site','updated:','single','ps:pz:patch','audienceId:','sections:','RT\x202.0:','isDirectory','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','\x5c$&','entryCriteria:','master','Events:','personalization_services','customers','unref','interval','listParents','identifier:\x20','allValid','Join\x20on:','totalEvents','resumeJourney','audienceId:\x20','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Listing\x20personalizations\x20for\x20\x27','ps:rt:jn:list','✔\x20No\x20changes\x20-\x20\x27','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','createdAt','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','⚡\x20Not\x20enabled','Error:\x20--attribute\x20requires\x20a\x20name\x0a','.yml','Creating\x20personalization\x20service\x20\x27','ps:pz:create','folderId','filter','\x20to\x20push\x20the\x20configuration','create','localeCompare','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','/sessions/','1260936xCuOXk','get','Master\x20Table','personalization','\x20[Job\x20ID:\x20','/\x20directory.\x0a','stats','{\x0a\x20\x20\x22database\x22:\x20\x22','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','coveragePercent','includeSensitive:','cyan','197309kCbxIx','✔\x20Updated\x20parent\x20segment\x20\x27','stageCount','\x20\x20\x20\x20\x20\x20','832042wVOZbT','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aNo\x20sample\x20data\x20available','Validate:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','ignore','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','parent_id','\x0a\x20\x20\x20\x20}','\x20--attribute\x20\x22','updatedAt','Listing\x20parent\x20segments\x20matching\x20\x27','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','791241FQomlK','valid','\x20rows)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20RT\x20configuration\x20is\x20valid','Source:','.customers)','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x202.\x20Run\x20','allowed\x20IPs:','\x20RT\x20journey','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','(id:\x20','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','payload:','ps:pz:service:show','parent_segment','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','displayPreviewResults','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','trim','parent_segments','in\x20','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','dim','\x20--behavior\x20\x22','\x20true','\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','ps:pz:service:token:delete','✔\x20Updated\x20personalization\x20\x27','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','\x20is\x20already\x20up\x20to\x20date','✔\x20Found\x20personalization\x20\x27','\x20--behavior\x20\x22<name>\x22','\x20\x20\x20\x20\x20\x20\x20\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','\x20personalization','collectSchema','parentSegment','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','updateParent','table','✔\x20Deleted\x20token\x20\x27','setJobId','primaryKey','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','includeSensitive','FINISHED','displayRealtimeInfo','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','displayBehaviorsStats','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','\x0aNew\x20parent\x20segment\x20\x27','List\x20RT\x20journeys','Deleting\x20personalization\x20service\x20\x27','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','tdx\x20ps\x20preview\x20','sampleData','\x20--interval\x20','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Fetching\x20behavior\x20list...','database','displayPreviewHints','\x0a⚠️\x20\x20Migrating:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','platform','keyEventId:','displayValidateResults','Enriched:','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','length','attributesFile','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','varchar','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','processedRows','\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','No\x20personalizations\x20configured','displayAttributesStats','Fetching\x20customers\x20schema...','type','`\x20to\x20download\x20the\x20configuration\x20first','data','Error\x20parsing\x20YAML:\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x20Opening\x20','Options:','workflowSessionId','Error:\x20Token\x20ID\x20is\x20required','getParentSQL','Error:\x20Personalization\x20ID\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','\x20=\x20','formatSchemaJson','RT\x20Journey\x20ID:\x20','verbose','Show\x20a\x20specific\x20realtime\x20personalization','Join:','SQL\x20query:\x0a','allowedIps','use','population','parentFolder','Updated','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Aborted.','rowCount','stitchingKeys','Master:'];a31_0x1c60=function(){return _0x280f1b;};return a31_0x1c60();}function showFileNotFoundError(_0x3855b3,_0x327783){const _0x566112=a31_0x23ba89;console['error'](a31_0x22e59c[_0x566112(0x38e)]('Error:\x20File\x20not\x20found:\x20'+_0x3855b3+'\x0a')),console['error'](a31_0x22e59c[_0x566112(0x26c)](_0x566112(0x31e)+_0x327783+_0x566112(0x2d3)));}function displayRealtimeValidation(_0x5504c1){const _0x498dd6=a31_0x23ba89;if(!_0x5504c1['realtime'])return;const _0x57e155=_0x5504c1['realtime'],_0x250e6f=_0x57e155[_0x498dd6(0x3b3)]?a31_0x22e59c[_0x498dd6(0x1a5)](_0x498dd6(0x321)):a31_0x22e59c[_0x498dd6(0x1e8)](_0x498dd6(0x255));console[_0x498dd6(0x1b0)]('\x0a'+a31_0x22e59c['dim'](_0x498dd6(0x23a))+'\x20'+_0x250e6f);if(_0x57e155[_0x498dd6(0x33c)]&&_0x57e155[_0x498dd6(0x33c)][_0x498dd6(0x2c8)]>0x0){console[_0x498dd6(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x498dd6(0x297)](_0x498dd6(0x240))+'\x20'+_0x57e155[_0x498dd6(0x33c)][_0x498dd6(0x2c8)]+_0x498dd6(0x3a0));for(const _0x4ab307 of _0x57e155['events']){const _0x50314e=_0x4ab307[_0x498dd6(0x379)]===![]?a31_0x22e59c[_0x498dd6(0x38e)]('✘'):a31_0x22e59c[_0x498dd6(0x1a5)]('✔');console[_0x498dd6(0x1b0)](_0x498dd6(0x1cb)+_0x50314e+'\x20'+_0x4ab307['name']),_0x4ab307['sourceTableError']&&console['error'](_0x498dd6(0x270)+a31_0x22e59c[_0x498dd6(0x38e)](_0x4ab307['sourceTableError']));}}if(_0x57e155['attributes']&&_0x57e155[_0x498dd6(0x336)][_0x498dd6(0x2c8)]>0x0){console[_0x498dd6(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x498dd6(0x297)](_0x498dd6(0x3b1))+'\x20'+_0x57e155[_0x498dd6(0x336)][_0x498dd6(0x2c8)]+_0x498dd6(0x3a0));for(const _0x5d7f28 of _0x57e155[_0x498dd6(0x336)]){const _0x5b285b=_0x5d7f28[_0x498dd6(0x27f)]?a31_0x22e59c[_0x498dd6(0x1a5)]('✔'):a31_0x22e59c[_0x498dd6(0x38e)]('✘');console[_0x498dd6(0x1b0)]('\x20\x20\x20\x20'+_0x5b285b+'\x20'+_0x5d7f28[_0x498dd6(0x356)]+'\x20'+a31_0x22e59c['dim']('('+_0x5d7f28['type']+')'));}}if(_0x57e155[_0x498dd6(0x35b)]){const _0x2251d6=_0x57e155[_0x498dd6(0x35b)][_0x498dd6(0x2ed)]?.['length']?_0x498dd6(0x381)+_0x57e155[_0x498dd6(0x35b)][_0x498dd6(0x2ed)][_0x498dd6(0x301)](',\x20')+']':'';console[_0x498dd6(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x498dd6(0x297)]('ID\x20Stitching:')+'\x20'+_0x57e155[_0x498dd6(0x35b)][_0x498dd6(0x2ac)]+_0x2251d6);}if(_0x57e155[_0x498dd6(0x366)]&&_0x57e155[_0x498dd6(0x366)]['length']>0x0){console[_0x498dd6(0x1b0)]('\x20\x20'+a31_0x22e59c['dim'](_0x498dd6(0x1d1))+'\x20'+_0x57e155['personalizationServices']['length']+_0x498dd6(0x1ea)+(_0x57e155[_0x498dd6(0x366)][_0x498dd6(0x2c8)]!==0x1?'s':''));for(const _0x31ecc7 of _0x57e155[_0x498dd6(0x366)]){console[_0x498dd6(0x1b0)]('\x20\x20\x20\x20-\x20'+_0x31ecc7[_0x498dd6(0x356)]);}}}function showParentSegmentNotSetError(_0x48481a){const _0x418566=a31_0x23ba89;console[_0x418566(0x1b0)](a31_0x22e59c[_0x418566(0x1e8)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x418566(0x1b0)](_0x48481a);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x34e);[a31_0x23ba89(0x30f)]='List\x20parent\x20segments';async['execute'](_0x47999f){const _0x4f7fce=a31_0x23ba89,{options:_0x33c934,args:_0x5068b8,tdx:_0x2ec48a}=_0x47999f,_0x58431f=_0x5068b8[0x0];_0x33c934[_0x4f7fce(0x2e1)]&&(console[_0x4f7fce(0x1b0)](_0x4f7fce(0x358)+_0x33c934['site']),_0x58431f&&console['error']('Pattern:\x20'+_0x58431f));const _0x15b2f5=await withSpinner(_0x58431f?_0x4f7fce(0x27c)+_0x58431f+'\x27...':'Listing\x20parent\x20segments...',()=>_0x2ec48a['segment'][_0x4f7fce(0x245)](),{'verbose':_0x33c934[_0x4f7fce(0x2e1)]});let _0x352124=_0x15b2f5[_0x4f7fce(0x2d4)];if(_0x58431f){const _0x5003e5=_0x58431f[_0x4f7fce(0x35a)](/[.+^${}()|[\]\\]/g,_0x4f7fce(0x23d))[_0x4f7fce(0x35a)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4db75d=new RegExp('^'+_0x5003e5+'$','i');_0x352124=_0x352124[_0x4f7fce(0x25b)](_0x2fdb37=>_0x4db75d[_0x4f7fce(0x35c)](_0x2fdb37[_0x4f7fce(0x336)]['name']));}_0x352124['sort']((_0x130d5c,_0x19649d)=>_0x130d5c['attributes'][_0x4f7fce(0x356)]['localeCompare'](_0x19649d[_0x4f7fce(0x336)][_0x4f7fce(0x356)])),console['error'](_0x4f7fce(0x1cc)+_0x352124[_0x4f7fce(0x2c8)]+'\x20parent\x20segment'+(_0x352124[_0x4f7fce(0x2c8)]!==0x1?'s':''));const _0x2c4b8c=_0x4aabca=>{const _0x3b61a9=_0x4f7fce;return getConsoleNextUrl(_0x33c934[_0x3b61a9(0x234)],_0x3b61a9(0x1df)+_0x4aabca);};if(_0x33c934['format']==='json'||_0x33c934[_0x4f7fce(0x362)]===_0x4f7fce(0x326)){const _0x29e773=_0x352124[_0x4f7fce(0x30a)](_0x476b34=>({..._0x476b34,'url':_0x2c4b8c(_0x476b34['id'])}));await handleSDKOutput(_0x29e773,_0x33c934);}else{if(_0x352124[_0x4f7fce(0x2c8)]===0x0)_0x58431f?console[_0x4f7fce(0x341)](_0x4f7fce(0x2ef)+_0x58431f):console[_0x4f7fce(0x341)]('No\x20parent\x20segments\x20found');else for(const _0x5dbcef of _0x352124){const _0x4b4d90=_0x5dbcef[_0x4f7fce(0x336)][_0x4f7fce(0x2e7)]?a31_0x22e59c['dim']('\x20('+formatRows(_0x5dbcef[_0x4f7fce(0x336)]['population'])+')'):'',_0x5c472c=hyperlink(_0x5dbcef['attributes'][_0x4f7fce(0x356)],_0x2c4b8c(_0x5dbcef['id']));console[_0x4f7fce(0x341)]('👥\x20'+_0x5c472c+_0x4b4d90);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x23ba89(0x356)]='segment:parent:create';[a31_0x23ba89(0x30f)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a31_0x23ba89(0x2fe)](_0x113375){const _0x29d879=a31_0x23ba89,{options:_0x380107,args:_0x39c1c9,tdx:_0xf873e5}=_0x113375;console[_0x29d879(0x1b0)](_0x29d879(0x275)+_0x29d879(0x3a9)+_0x29d879(0x368));const _0x490636=_0x380107;if(_0x39c1c9['length']===0x0)return console[_0x29d879(0x1b0)](a31_0x22e59c['red'](_0x29d879(0x319))),console[_0x29d879(0x1b0)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x51bd0e=_0x39c1c9[0x0];if(!_0x490636['database']||!_0x490636[_0x29d879(0x2a9)])return console[_0x29d879(0x1b0)](_0x29d879(0x343)),console[_0x29d879(0x1b0)](_0x29d879(0x3a2)),0x1;_0x490636[_0x29d879(0x2e1)]&&(console['error'](_0x29d879(0x358)+_0x490636[_0x29d879(0x234)]),console['error']('Name:\x20'+_0x51bd0e),console['error']('Database:\x20'+_0x490636[_0x29d879(0x2be)]),console[_0x29d879(0x1b0)](_0x29d879(0x307)+_0x490636['table']));const _0x58b4d5=await loadJSONFromOptions(_0x490636[_0x29d879(0x336)],_0x490636[_0x29d879(0x2c9)]),_0x3e6477=await loadJSONFromOptions(_0x490636[_0x29d879(0x327)],_0x490636[_0x29d879(0x1d4)]),_0x5c9c5f=await loadJSONFromOptions(_0x490636['customerGroup'],_0x490636[_0x29d879(0x337)]),_0x3af1d0={'name':_0x51bd0e,'description':_0x490636[_0x29d879(0x30f)],'scheduleType':_0x490636[_0x29d879(0x360)],'scheduleOption':_0x490636['scheduleOption'],'timezone':_0x490636[_0x29d879(0x221)],'master':{'parentDatabaseName':_0x490636[_0x29d879(0x2be)],'parentTableName':_0x490636['table']},'attributes':_0x58b4d5,'behaviors':_0x3e6477,'customerGroup':_0x5c9c5f},_0x445ff1=await withSpinner(_0x29d879(0x30e)+_0x51bd0e+_0x29d879(0x1e2),()=>_0xf873e5[_0x29d879(0x392)][_0x29d879(0x1de)](_0x3af1d0),{'verbose':_0x380107[_0x29d879(0x2e1)]}),_0x58d79c=_0x445ff1[_0x29d879(0x2d4)];return console[_0x29d879(0x1b0)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x58d79c['name']+'\x27\x20with\x20ID:\x20'+_0x58d79c['id']),await handleSDKOutput([_0x58d79c],_0x380107),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x2b1);async[a31_0x23ba89(0x2fe)](_0x15c3e2){const _0x2a4ffd=a31_0x23ba89,{options:_0x51c624,args:_0x39781e,tdx:_0x3bf1b3}=_0x15c3e2;console[_0x2a4ffd(0x1b0)](_0x2a4ffd(0x1d8)+_0x2a4ffd(0x3a9)+_0x2a4ffd(0x368));const _0x47345f=_0x51c624;if(_0x39781e[_0x2a4ffd(0x2c8)]===0x0)return console[_0x2a4ffd(0x1b0)](a31_0x22e59c[_0x2a4ffd(0x38e)](_0x2a4ffd(0x319))),console[_0x2a4ffd(0x1b0)](_0x2a4ffd(0x277)),0x1;const _0xb2491f=_0x39781e[0x0];_0x47345f[_0x2a4ffd(0x2e1)]&&(console[_0x2a4ffd(0x1b0)](_0x2a4ffd(0x358)+_0x47345f[_0x2a4ffd(0x234)]),console[_0x2a4ffd(0x1b0)]('Parent\x20segment:\x20'+_0xb2491f));const _0x29b393=await withSpinner(_0x2a4ffd(0x312)+_0xb2491f+'\x27...',()=>_0x3bf1b3[_0x2a4ffd(0x392)][_0x2a4ffd(0x1c1)](_0xb2491f),{'verbose':_0x47345f['verbose']}),_0x19fd51=_0x29b393[_0x2a4ffd(0x2d4)],_0x156e32=await loadJSONFromOptions(_0x47345f[_0x2a4ffd(0x1f9)],_0x47345f[_0x2a4ffd(0x1a6)]),_0x4e419a=await loadJSONFromOptions(_0x47345f[_0x2a4ffd(0x20b)],_0x47345f[_0x2a4ffd(0x399)]),_0x55ab13={'name':_0x19fd51[_0x2a4ffd(0x356)],'description':_0x47345f[_0x2a4ffd(0x30f)]!==undefined?_0x47345f[_0x2a4ffd(0x30f)]:_0x19fd51['description'],'scheduleType':_0x47345f[_0x2a4ffd(0x360)]!==undefined?_0x47345f[_0x2a4ffd(0x360)]:_0x19fd51[_0x2a4ffd(0x360)],'scheduleOption':_0x47345f[_0x2a4ffd(0x31b)]!==undefined?_0x47345f[_0x2a4ffd(0x31b)]:_0x19fd51[_0x2a4ffd(0x31b)],'timezone':_0x47345f[_0x2a4ffd(0x221)]!==undefined?_0x47345f[_0x2a4ffd(0x221)]:_0x19fd51[_0x2a4ffd(0x221)],'master':_0x19fd51[_0x2a4ffd(0x23f)],'attributes':_0x156e32?[..._0x19fd51['attributes']||[],..._0x156e32]:_0x19fd51[_0x2a4ffd(0x336)],'behaviors':_0x4e419a?[..._0x19fd51['behaviors']||[],..._0x4e419a]:_0x19fd51[_0x2a4ffd(0x327)],'customerGroup':_0x19fd51['customerGroup']},_0x12b6d4=await withSpinner(_0x2a4ffd(0x391)+_0xb2491f+'\x27...',()=>_0x3bf1b3[_0x2a4ffd(0x392)][_0x2a4ffd(0x2a8)](_0xb2491f,_0x55ab13),{'verbose':_0x47345f[_0x2a4ffd(0x2e1)]}),_0x473869=_0x12b6d4['data'];return console[_0x2a4ffd(0x1b0)](_0x2a4ffd(0x26e)+_0x473869['name']+'\x27'),await handleSDKOutput([_0x473869],_0x47345f),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x23ba89(0x356)]='segment:parent:pull';['description']=a31_0x23ba89(0x32a);async[a31_0x23ba89(0x2fe)](_0xbeed68){const _0x4038bd=a31_0x23ba89,{options:_0x2ce326,args:_0x194318,tdx:_0x5a62ce}=_0xbeed68,_0x44983f=_0x2ce326,_0x534829=_0x194318[0x0]||_0x2ce326[_0x4038bd(0x2a6)];if(!_0x534829)return showParentSegmentNotSetError(_0x4038bd(0x344)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x44983f[_0x4038bd(0x2e6)]&&_0x44983f[_0x4038bd(0x1d3)])return console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x38e)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x297)](_0x4038bd(0x320))),console['error'](a31_0x22e59c[_0x4038bd(0x297)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x4038bd(0x396))),console[_0x4038bd(0x1b0)](a31_0x22e59c['cyan']('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x59d726=_0x44983f['output']||a31_0x5fc94f[_0x4038bd(0x301)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x534829)+_0x4038bd(0x257));_0x44983f[_0x4038bd(0x2e1)]&&(console[_0x4038bd(0x1b0)](_0x4038bd(0x358)+_0x44983f[_0x4038bd(0x234)]),console[_0x4038bd(0x1b0)](_0x4038bd(0x1f4)+_0x534829),console['error']('Output\x20file:\x20'+_0x59d726));const _0x4bee4d=await withSpinner(_0x4038bd(0x31a)+_0x534829+_0x4038bd(0x1e2),()=>_0x5a62ce[_0x4038bd(0x392)]['pullParentYaml'](_0x534829),{'verbose':_0x44983f[_0x4038bd(0x2e1)]}),_0x17c4ce=_0x4bee4d[_0x4038bd(0x2d4)];if(existsSync(_0x59d726)){const _0x567aaa=readFileSync(_0x59d726,_0x4038bd(0x20e)),_0x140735=generateDiff(_0x567aaa,_0x17c4ce);if(!hasChanges(_0x140735))console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x1a5)]('✔')+_0x4038bd(0x3a6)+a31_0x22e59c[_0x4038bd(0x26c)](_0x59d726)+_0x4038bd(0x29f));else{console[_0x4038bd(0x1b0)](_0x4038bd(0x1ae)+_0x59d726+'\x27:'),console[_0x4038bd(0x1b0)]('─'[_0x4038bd(0x38b)](0x3c)),console[_0x4038bd(0x1b0)](formatDiffWithColors(_0x140735)),console[_0x4038bd(0x1b0)]('─'[_0x4038bd(0x38b)](0x3c));if(!_0x44983f[_0x4038bd(0x210)]){if(!isInteractive())return console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x38e)](_0x4038bd(0x32e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x297)](_0x4038bd(0x378))),0x1;const _0x426313=await confirmKey(_0x4038bd(0x229)+_0x59d726+'\x27?');if(!_0x426313)return console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x1e8)](_0x4038bd(0x2eb))),0x1;}writeFileSync(_0x59d726,_0x17c4ce,'utf-8'),console['error'](a31_0x22e59c[_0x4038bd(0x1a5)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x22e59c[_0x4038bd(0x26c)](_0x59d726));}}else{const _0x50c92c=a31_0x5fc94f[_0x4038bd(0x369)](_0x59d726);!existsSync(_0x50c92c)&&mkdirSync(_0x50c92c,{'recursive':!![]}),writeFileSync(_0x59d726,_0x17c4ce,'utf-8'),console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x1a5)]('✔')+_0x4038bd(0x254)+a31_0x22e59c[_0x4038bd(0x26c)](_0x59d726));}return saveSessionContext({'parent_segment':_0x534829},_0x44983f[_0x4038bd(0x230)]),console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x1a5)]('✔')+_0x4038bd(0x20c)+a31_0x22e59c[_0x4038bd(0x297)](_0x4038bd(0x28e))+_0x4038bd(0x2de)+a31_0x22e59c[_0x4038bd(0x26c)](_0x534829)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']='segment:parent:push';[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x29d);async[a31_0x23ba89(0x2fe)](_0x1e3991){const _0x39cc5a=a31_0x23ba89,{options:_0x4a5cb0,args:_0x4492f3,tdx:_0x43b593}=_0x1e3991,_0x23f7b5=_0x4a5cb0,_0x1c7111=_0x4492f3[0x0]||_0x4a5cb0[_0x39cc5a(0x2a6)];if(!_0x1c7111)return showParentSegmentNotSetError(_0x39cc5a(0x2a7)+_0x39cc5a(0x393)),0x1;const _0xe58672=resolveYamlFile(_0x1c7111);if(!existsSync(_0xe58672))return showFileNotFoundError(_0xe58672,_0x1c7111),0x1;_0x23f7b5['verbose']&&(console[_0x39cc5a(0x1b0)](_0x39cc5a(0x358)+_0x23f7b5[_0x39cc5a(0x234)]),console[_0x39cc5a(0x1b0)](_0x39cc5a(0x382)+_0xe58672));let _0xcee19f;try{_0xcee19f=readFileSync(_0xe58672,_0x39cc5a(0x20e));}catch(_0x3bcb66){const _0x15df9f=_0x3bcb66 instanceof Error?_0x3bcb66[_0x39cc5a(0x39b)]:String(_0x3bcb66);return console[_0x39cc5a(0x1b0)](_0x39cc5a(0x2fc)+_0x15df9f),0x1;}const _0x111f16=await withSpinner(_0x39cc5a(0x2f4),()=>_0x43b593[_0x39cc5a(0x392)][_0x39cc5a(0x386)](_0xcee19f),{'verbose':_0x23f7b5[_0x39cc5a(0x2e1)]}),_0x50ccda=_0x111f16['data'],{isNew:_0x218bc4,name:_0x574d64,hasChanges:_0x5003a9,diffFormatted:_0x100e79}=_0x50ccda;if(!_0x5003a9)return console[_0x39cc5a(0x1b0)](_0x39cc5a(0x251)+_0x574d64+_0x39cc5a(0x1f0)),0x0;_0x218bc4?console[_0x39cc5a(0x1b0)](_0x39cc5a(0x2b5)+_0x574d64+'\x27:'):console[_0x39cc5a(0x1b0)](_0x39cc5a(0x1bd)+_0x574d64+'\x27:');console[_0x39cc5a(0x1b0)]('─'[_0x39cc5a(0x38b)](0x3c)),console[_0x39cc5a(0x1b0)](_0x100e79),console[_0x39cc5a(0x1b0)]('─'['repeat'](0x3c));const _0x256fea=_0x218bc4?_0x39cc5a(0x34b)+_0x574d64+'\x27?':_0x39cc5a(0x339)+_0x574d64+'\x27?';if(!_0x23f7b5['yes']){if(!isInteractive())return console[_0x39cc5a(0x1b0)](a31_0x22e59c[_0x39cc5a(0x38e)](_0x39cc5a(0x32e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a31_0x22e59c[_0x39cc5a(0x297)](_0x39cc5a(0x378))),0x1;const _0x3f76f5=await confirmKey(_0x256fea);if(!_0x3f76f5)return console['error'](a31_0x22e59c['yellow'](_0x39cc5a(0x2eb))),0x1;}const _0x489d18=_0x218bc4?'Creating':'Updating',_0x339b37=await withSpinner(_0x489d18+_0x39cc5a(0x21c)+_0x574d64+_0x39cc5a(0x1e2),()=>_0x50ccda[_0x39cc5a(0x3b5)](),{'verbose':_0x23f7b5['verbose']}),_0x4527ea=_0x339b37['data'],_0x1b57a6=getConsoleNextUrl(_0x23f7b5[_0x39cc5a(0x234)],_0x39cc5a(0x1df)+_0x4527ea['id']),_0x5935f5=_0x218bc4?'Created':_0x39cc5a(0x2e9);return console['error']('✔\x20'+_0x5935f5+_0x39cc5a(0x21c)+_0x4527ea['name']+'\x27'),console['error']('\x20\x20'+_0x1b57a6),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x23ba89(0x227);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x2ca);async['execute'](_0x9a4c74){const _0x2acef2=a31_0x23ba89,{options:_0x18eac8,args:_0x227b3c,tdx:_0x274682}=_0x9a4c74,_0x106472=_0x18eac8,_0x57054a=_0x227b3c[0x0]||_0x18eac8[_0x2acef2(0x2a6)];if(!_0x57054a)return showParentSegmentNotSetError(_0x2acef2(0x38d)+_0x2acef2(0x212)+_0x2acef2(0x38a)+_0x2acef2(0x295)+_0x2acef2(0x2b8)+_0x2acef2(0x322)),0x1;const _0x3c7519=resolveYamlFile(_0x57054a);if(!existsSync(_0x3c7519))return showFileNotFoundError(_0x3c7519,_0x57054a),0x1;_0x106472[_0x2acef2(0x2e1)]&&(console[_0x2acef2(0x1b0)](_0x2acef2(0x358)+_0x106472['site']),console['error'](_0x2acef2(0x382)+_0x3c7519));let _0x3666cd;try{_0x3666cd=readFileSync(_0x3c7519,_0x2acef2(0x20e));}catch(_0x1f6efe){const _0x3bdced=_0x1f6efe instanceof Error?_0x1f6efe[_0x2acef2(0x39b)]:String(_0x1f6efe);return console['error'](_0x2acef2(0x2fc)+_0x3bdced),0x1;}const _0x1861cc=createCommandSpinner(a31_0x22e59c[_0x2acef2(0x297)](_0x2acef2(0x1c0)),{'verbose':_0x106472[_0x2acef2(0x2e1)]});_0x1861cc[_0x2acef2(0x388)]();const _0x25d27f={'onProgress':_0x4f1d69=>{_0x1861cc['text']=formatProgressMessage(_0x4f1d69);}};if(_0x106472['master'])_0x25d27f[_0x2acef2(0x23f)]=!![];if(_0x106472[_0x2acef2(0x376)])_0x25d27f[_0x2acef2(0x376)]=!![];_0x106472[_0x2acef2(0x385)]&&(_0x25d27f[_0x2acef2(0x385)]=_0x106472[_0x2acef2(0x385)]);_0x106472[_0x2acef2(0x359)]&&(_0x25d27f[_0x2acef2(0x359)]=_0x106472[_0x2acef2(0x359)]);if(_0x106472[_0x2acef2(0x244)])_0x25d27f[_0x2acef2(0x244)]=_0x106472[_0x2acef2(0x244)];let _0x514d80;try{_0x514d80=await _0x274682[_0x2acef2(0x392)][_0x2acef2(0x205)](_0x3666cd,_0x25d27f),_0x1861cc[_0x2acef2(0x1db)]();}catch(_0x3003ba){_0x1861cc['stop']();throw _0x3003ba;}const _0x420c96=_0x106472[_0x2acef2(0x244)]||_0x2acef2(0x22a);return this[_0x2acef2(0x2c5)](_0x514d80,_0x25d27f,_0x3c7519,_0x420c96),_0x514d80[_0x2acef2(0x247)]?0x0:0x1;}[a31_0x23ba89(0x2c5)](_0xe0fd40,_0x2711b8,_0x3be933,_0x99a304){const _0x68531a=a31_0x23ba89;console[_0x68531a(0x1b0)]('\x0a'+a31_0x22e59c['bold'](_0x68531a(0x274))+'\x20'+_0xe0fd40[_0x68531a(0x356)]),console['error']('═'[_0x68531a(0x38b)](0x3c)),this[_0x68531a(0x340)](_0xe0fd40);if(typeof _0x2711b8[_0x68531a(0x385)]===_0x68531a(0x37e)){this[_0x68531a(0x2d0)](_0xe0fd40),this[_0x68531a(0x304)](_0xe0fd40),this[_0x68531a(0x2bf)](_0x3be933,_0x99a304,_0x68531a(0x385),_0x2711b8[_0x68531a(0x385)]);return;}if(_0x2711b8[_0x68531a(0x385)]===!![]){this[_0x68531a(0x2d0)](_0xe0fd40),this[_0x68531a(0x304)](_0xe0fd40),this[_0x68531a(0x2bf)](_0x3be933,_0x99a304,_0x68531a(0x336));return;}if(typeof _0x2711b8['behavior']===_0x68531a(0x37e)){this['displayBehaviorsStats'](_0xe0fd40,_0x99a304),this[_0x68531a(0x304)](_0xe0fd40),this[_0x68531a(0x2bf)](_0x3be933,_0x99a304,'behavior',_0x2711b8['behavior']);return;}if(_0x2711b8[_0x68531a(0x359)]===!![]){this[_0x68531a(0x2b3)](_0xe0fd40,_0x99a304),this[_0x68531a(0x304)](_0xe0fd40),this[_0x68531a(0x2bf)](_0x3be933,_0x99a304,_0x68531a(0x327));return;}this[_0x68531a(0x2d0)](_0xe0fd40),this[_0x68531a(0x2b3)](_0xe0fd40,_0x99a304),this['displayRealtimeInfo'](_0xe0fd40),this['displaySummary'](_0xe0fd40),this[_0x68531a(0x2bf)](_0x3be933,_0x99a304,_0x68531a(0x1b2));}[a31_0x23ba89(0x2b0)](_0x4a273d){displayRealtimeValidation(_0x4a273d);}[a31_0x23ba89(0x2bf)](_0x163b3d,_0x2c148c,_0x261246,_0x2e5075){const _0x56d592=a31_0x23ba89;console[_0x56d592(0x1b0)]('\x0a'+a31_0x22e59c[_0x56d592(0x297)](_0x56d592(0x367)));const _0x36b6a4=_0x2c148c!==_0x56d592(0x22a)?_0x56d592(0x2bb)+_0x2c148c:'';if(_0x261246===_0x56d592(0x385)&&_0x2e5075)console[_0x56d592(0x1b0)]('\x20\x20'+a31_0x22e59c['dim'](_0x56d592(0x2b9)+_0x163b3d+_0x56d592(0x27a)+_0x2e5075+'\x22'+_0x36b6a4));else{if(_0x261246==='behavior'&&_0x2e5075)console[_0x56d592(0x1b0)]('\x20\x20'+a31_0x22e59c['dim'](_0x56d592(0x2b9)+_0x163b3d+'\x20--behavior\x20\x22'+_0x2e5075+'\x22'+_0x36b6a4));else(_0x261246===_0x56d592(0x336)||_0x261246==='all')&&console[_0x56d592(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x56d592(0x297)](_0x56d592(0x2b9)+_0x163b3d+_0x56d592(0x313)+_0x36b6a4));}(_0x261246===_0x56d592(0x327)||_0x261246===_0x56d592(0x1b2))&&console[_0x56d592(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x56d592(0x297)]('tdx\x20ps\x20preview\x20'+_0x163b3d+_0x56d592(0x2a1)+_0x36b6a4)),_0x261246===_0x56d592(0x1b2)&&console['error']('\x20\x20'+a31_0x22e59c[_0x56d592(0x297)](_0x56d592(0x2b9)+_0x163b3d+_0x56d592(0x310)+_0x36b6a4));}['displayMasterInfo'](_0x10d4a8){const _0x261890=a31_0x23ba89,{master:_0x47ef60}=_0x10d4a8,_0x4d0f74=_0x47ef60[_0x261890(0x3ae)]?a31_0x22e59c[_0x261890(0x1a5)]('✔'):a31_0x22e59c[_0x261890(0x38e)]('✘');console['error']('\x0a'+a31_0x22e59c[_0x261890(0x297)](_0x261890(0x263))),console[_0x261890(0x1b0)](_0x4d0f74+'\x20'+a31_0x22e59c[_0x261890(0x214)](_0x47ef60[_0x261890(0x2be)]+'.'+_0x47ef60[_0x261890(0x2a9)])),_0x47ef60[_0x261890(0x3ae)]?_0x47ef60[_0x261890(0x2ec)]!==undefined&&console[_0x261890(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x261890(0x297)](_0x261890(0x335))+'\x20'+a31_0x22e59c[_0x261890(0x26c)](formatRows(_0x47ef60[_0x261890(0x2ec)]))):console[_0x261890(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x261890(0x38e)](_0x261890(0x21f))+'\x20'+_0x47ef60[_0x261890(0x351)]);}[a31_0x23ba89(0x2d0)](_0x50cfbb){const _0x189c48=a31_0x23ba89;if(_0x50cfbb[_0x189c48(0x336)][_0x189c48(0x2c8)]===0x0)return;console[_0x189c48(0x1b0)]('\x0a'+a31_0x22e59c[_0x189c48(0x297)]('Attributes'));for(const _0x5303d9 of _0x50cfbb[_0x189c48(0x336)]){const _0x482582=_0x5303d9['schemaValid']?a31_0x22e59c[_0x189c48(0x1a5)]('✔'):a31_0x22e59c[_0x189c48(0x38e)]('✘');let _0x431d4f='';if(_0x5303d9[_0x189c48(0x3ae)]&&_0x5303d9[_0x189c48(0x211)]!==undefined&&_0x5303d9[_0x189c48(0x26a)]!==undefined){const _0x3f014e=_0x5303d9[_0x189c48(0x26a)][_0x189c48(0x216)](0x1),_0x432e1e=_0x5303d9[_0x189c48(0x26a)]>=0x50?a31_0x22e59c['green']:_0x5303d9['coveragePercent']>=0x32?a31_0x22e59c['yellow']:a31_0x22e59c[_0x189c48(0x38e)];_0x431d4f='\x20'+a31_0x22e59c[_0x189c48(0x297)]('Coverage:')+'\x20'+_0x432e1e(_0x3f014e+'%')+'\x20('+formatRows(_0x5303d9['matchedCount'])+_0x189c48(0x280);}console[_0x189c48(0x1b0)](_0x482582+'\x20'+a31_0x22e59c[_0x189c48(0x214)](_0x5303d9[_0x189c48(0x356)])+_0x431d4f),console['error']('\x20\x20'+a31_0x22e59c[_0x189c48(0x297)]('Source:')+'\x20'+a31_0x22e59c[_0x189c48(0x214)](_0x5303d9[_0x189c48(0x2be)]+'.'+_0x5303d9[_0x189c48(0x2a9)]));const _0xcd6c72=_0x5303d9[_0x189c48(0x1fb)]===_0x5303d9[_0x189c48(0x328)]?a31_0x22e59c['dim'](_0x189c48(0x248))+'\x20'+_0x5303d9['joinKey']:a31_0x22e59c[_0x189c48(0x297)](_0x189c48(0x2e3))+'\x20'+_0x5303d9[_0x189c48(0x1fb)]+'\x20=\x20'+_0x5303d9[_0x189c48(0x328)];console['error']('\x20\x20'+_0xcd6c72),console['error']('\x20\x20'+a31_0x22e59c['dim'](_0x189c48(0x348))),this[_0x189c48(0x226)](_0x5303d9['columns']),!_0x5303d9['schemaValid']&&console['error']('\x20\x20'+a31_0x22e59c[_0x189c48(0x38e)](_0x189c48(0x21f))+'\x20'+_0x5303d9['schemaError']);}}[a31_0x23ba89(0x2b3)](_0x123f0a,_0x30ae64){const _0xcc1c07=a31_0x23ba89;if(_0x123f0a[_0xcc1c07(0x327)][_0xcc1c07(0x2c8)]===0x0)return;console[_0xcc1c07(0x1b0)]('\x0a'+a31_0x22e59c['dim']('Behaviors')+'\x20'+a31_0x22e59c[_0xcc1c07(0x297)]('('+_0x30ae64+')'));for(const _0x1c5da0 of _0x123f0a[_0xcc1c07(0x327)]){const _0x767daa=_0x1c5da0[_0xcc1c07(0x3ae)]?a31_0x22e59c['green']('✔'):a31_0x22e59c[_0xcc1c07(0x38e)]('✘');let _0x542674='';if(_0x1c5da0[_0xcc1c07(0x3ae)]&&_0x1c5da0[_0xcc1c07(0x1e0)]!==undefined&&_0x1c5da0[_0xcc1c07(0x249)]!==undefined){const _0x352073=_0x1c5da0[_0xcc1c07(0x38f)]?.[_0xcc1c07(0x216)](0x1)||'?',_0x48c840=(_0x1c5da0[_0xcc1c07(0x38f)]??0x0)>=0x32?a31_0x22e59c[_0xcc1c07(0x1a5)]:(_0x1c5da0['customerPercent']??0x0)>=0x14?a31_0x22e59c[_0xcc1c07(0x1e8)]:a31_0x22e59c[_0xcc1c07(0x38e)];_0x542674='\x20'+a31_0x22e59c[_0xcc1c07(0x297)]('Customers:')+'\x20'+_0x48c840(formatRows(_0x1c5da0['customersWithEvents']))+'\x20('+_0x352073+'%)\x20'+a31_0x22e59c['dim']('Events:')+'\x20'+a31_0x22e59c[_0xcc1c07(0x26c)](formatRows(_0x1c5da0[_0xcc1c07(0x249)]));}console[_0xcc1c07(0x1b0)](_0x767daa+'\x20'+a31_0x22e59c['bold'](_0x1c5da0['name'])+_0x542674),console[_0xcc1c07(0x1b0)]('\x20\x20'+a31_0x22e59c[_0xcc1c07(0x297)](_0xcc1c07(0x283))+'\x20'+a31_0x22e59c['bold'](_0x1c5da0[_0xcc1c07(0x2be)]+'.'+_0x1c5da0[_0xcc1c07(0x2a9)]));const _0x76889b=_0x1c5da0[_0xcc1c07(0x1fb)]===_0x1c5da0[_0xcc1c07(0x328)]?a31_0x22e59c[_0xcc1c07(0x297)](_0xcc1c07(0x248))+'\x20'+_0x1c5da0[_0xcc1c07(0x1fb)]:a31_0x22e59c[_0xcc1c07(0x297)](_0xcc1c07(0x2e3))+'\x20'+_0x1c5da0[_0xcc1c07(0x1fb)]+_0xcc1c07(0x2de)+_0x1c5da0[_0xcc1c07(0x328)];console['error']('\x20\x20'+_0x76889b),console[_0xcc1c07(0x1b0)]('\x20\x20'+a31_0x22e59c['dim'](_0xcc1c07(0x348))),this[_0xcc1c07(0x226)](_0x1c5da0[_0xcc1c07(0x305)]),!_0x1c5da0[_0xcc1c07(0x3ae)]&&console['error']('\x20\x20'+a31_0x22e59c[_0xcc1c07(0x38e)]('Error:')+'\x20'+_0x1c5da0[_0xcc1c07(0x351)]);}}[a31_0x23ba89(0x226)](_0xa4480a){const _0x3f1169=a31_0x23ba89;for(const _0x42a284 of _0xa4480a){_0x42a284[_0x3f1169(0x3a5)]===_0x42a284[_0x3f1169(0x1da)]||_0x42a284[_0x3f1169(0x1da)]==='*'?console[_0x3f1169(0x1b0)](_0x3f1169(0x220)+_0x42a284[_0x3f1169(0x3a5)]):console[_0x3f1169(0x1b0)]('\x20\x20\x20\x20-\x20'+_0x42a284[_0x3f1169(0x3a5)]+'\x20'+a31_0x22e59c['dim']('('+_0x42a284[_0x3f1169(0x1da)]+')'));}}[a31_0x23ba89(0x304)](_0x2a14a7){const _0x2d74c3=a31_0x23ba89;console[_0x2d74c3(0x1b0)]('─'[_0x2d74c3(0x38b)](0x3c));if(_0x2a14a7[_0x2d74c3(0x329)][_0x2d74c3(0x2c8)]>0x0){console[_0x2d74c3(0x1b0)]('\x0a'+a31_0x22e59c[_0x2d74c3(0x38e)](_0x2d74c3(0x1ce)));for(const _0x3465f2 of _0x2a14a7['errors']){console[_0x2d74c3(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x2d74c3(0x38e)]('•')+'\x20'+_0x3465f2);}}_0x2a14a7['allValid']&&console[_0x2d74c3(0x1b0)]('\x0a'+a31_0x22e59c[_0x2d74c3(0x1a5)]('✔')+_0x2d74c3(0x36a));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x1ee);['description']=a31_0x23ba89(0x2ea);async[a31_0x23ba89(0x2fe)](_0x1abb0e){const _0x750d92=a31_0x23ba89,{options:_0x470d76,args:_0xe33ab6,tdx:_0x50d9be}=_0x1abb0e,_0x4e83df=_0x470d76,_0x45ec09=_0xe33ab6[0x0]||_0x470d76[_0x750d92(0x2a6)];if(!_0x45ec09)return showParentSegmentNotSetError(_0x750d92(0x27d)+_0x750d92(0x32f)+_0x750d92(0x342)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x750d92(0x36f)+_0x750d92(0x2f3)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x750d92(0x322)),0x1;if(!_0x4e83df[_0x750d92(0x23f)]&&!_0x4e83df[_0x750d92(0x385)]&&!_0x4e83df[_0x750d92(0x359)]&&!_0x4e83df[_0x750d92(0x376)])return console[_0x750d92(0x1b0)](a31_0x22e59c[_0x750d92(0x38e)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x750d92(0x1b0)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x750d92(0x1b0)](_0x750d92(0x2d8)),console['error'](_0x750d92(0x296)),console[_0x750d92(0x1b0)](_0x750d92(0x20f)),console[_0x750d92(0x1b0)](_0x750d92(0x352)),console[_0x750d92(0x1b0)](_0x750d92(0x1ff)),0x1;const _0x31c81d=resolveYamlFile(_0x45ec09);if(!existsSync(_0x31c81d))return showFileNotFoundError(_0x31c81d,_0x45ec09),0x1;_0x4e83df[_0x750d92(0x2e1)]&&(console[_0x750d92(0x1b0)](_0x750d92(0x358)+_0x4e83df[_0x750d92(0x234)]),console['error'](_0x750d92(0x382)+_0x31c81d));let _0xabf0a7;try{_0xabf0a7=readFileSync(_0x31c81d,_0x750d92(0x20e));}catch(_0x4dbf23){const _0x51e17f=_0x4dbf23 instanceof Error?_0x4dbf23[_0x750d92(0x39b)]:String(_0x4dbf23);return console[_0x750d92(0x1b0)](_0x750d92(0x2fc)+_0x51e17f),0x1;}let _0x19bc7b;try{_0x19bc7b=parseDef(_0xabf0a7);}catch(_0x452ae2){const _0xb35299=_0x452ae2 instanceof Error?_0x452ae2['message']:String(_0x452ae2);return console[_0x750d92(0x1b0)](a31_0x22e59c[_0x750d92(0x38e)]('Error\x20parsing\x20YAML:\x20'+_0xb35299)),0x1;}if(_0x4e83df[_0x750d92(0x385)]===!![]||_0x4e83df[_0x750d92(0x385)]===''){const _0x32906c=_0x19bc7b['attributes']?.[_0x750d92(0x30a)](_0x1b7203=>_0x1b7203[_0x750d92(0x356)])||[];if(_0x32906c[_0x750d92(0x2c8)]===0x0)console[_0x750d92(0x1b0)](a31_0x22e59c[_0x750d92(0x38e)](_0x750d92(0x2d6)));else{console[_0x750d92(0x1b0)](a31_0x22e59c[_0x750d92(0x38e)](_0x750d92(0x256))),console[_0x750d92(0x1b0)](_0x750d92(0x1cd));for(const _0x2fae6d of _0x32906c){console['error']('\x20\x20'+a31_0x22e59c[_0x750d92(0x26c)](_0x2fae6d));}console[_0x750d92(0x1b0)](_0x750d92(0x2c1)+_0x45ec09+_0x750d92(0x27a)+_0x32906c[0x0]+'\x22');}return 0x1;}if(_0x4e83df[_0x750d92(0x359)]===!![]||_0x4e83df['behavior']===''){const _0x4a2bd2=_0x19bc7b[_0x750d92(0x327)]?.['map'](_0x38d275=>_0x38d275[_0x750d92(0x356)])||[];if(_0x4a2bd2[_0x750d92(0x2c8)]===0x0)console['error'](a31_0x22e59c[_0x750d92(0x38e)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x750d92(0x1b0)](a31_0x22e59c[_0x750d92(0x38e)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console['error'](_0x750d92(0x1ed));for(const _0x54963e of _0x4a2bd2){console['error']('\x20\x20'+a31_0x22e59c[_0x750d92(0x26c)](_0x54963e));}console[_0x750d92(0x1b0)](_0x750d92(0x2c1)+_0x45ec09+_0x750d92(0x298)+_0x4a2bd2[0x0]+'\x22');}return 0x1;}const _0x2cbef2=createCommandSpinner(a31_0x22e59c[_0x750d92(0x297)](_0x750d92(0x1e4)),{'verbose':_0x4e83df[_0x750d92(0x2e1)]});_0x2cbef2[_0x750d92(0x388)]();const _0x3a0f83={'onProgress':_0xc1c9ac=>{const _0x1312cd=_0x750d92;_0x2cbef2[_0x1312cd(0x317)]=formatProgressMessage(_0xc1c9ac);}};if(_0x4e83df['master'])_0x3a0f83['master']=!![];if(_0x4e83df[_0x750d92(0x385)]&&typeof _0x4e83df[_0x750d92(0x385)]===_0x750d92(0x37e))_0x3a0f83[_0x750d92(0x385)]=_0x4e83df['attribute'];if(_0x4e83df['behavior']&&typeof _0x4e83df[_0x750d92(0x359)]===_0x750d92(0x37e))_0x3a0f83[_0x750d92(0x359)]=_0x4e83df[_0x750d92(0x359)];if(_0x4e83df[_0x750d92(0x376)])_0x3a0f83[_0x750d92(0x376)]=!![];if(_0x4e83df[_0x750d92(0x244)])_0x3a0f83[_0x750d92(0x244)]=_0x4e83df[_0x750d92(0x244)];let _0x5ef191;try{_0x5ef191=await _0x50d9be['segment'][_0x750d92(0x30d)](_0xabf0a7,_0x3a0f83),_0x2cbef2[_0x750d92(0x1db)]();}catch(_0x1c1515){_0x2cbef2[_0x750d92(0x1db)]();throw _0x1c1515;}return await this[_0x750d92(0x290)](_0x5ef191,{'master':_0x4e83df[_0x750d92(0x23f)],'attribute':typeof _0x4e83df['attribute']===_0x750d92(0x37e)?_0x4e83df[_0x750d92(0x385)]:undefined,'behavior':typeof _0x4e83df[_0x750d92(0x359)]===_0x750d92(0x37e)?_0x4e83df['behavior']:undefined,'enriched':_0x4e83df['enriched']}),_0x5ef191[_0x750d92(0x247)]?0x0:0x1;}async['displayPreviewResults'](_0x283084,_0x417c4e){const _0x49ed01=a31_0x23ba89;console[_0x49ed01(0x1b0)]('\x0a'+a31_0x22e59c[_0x49ed01(0x214)]('Preview:')+'\x20'+_0x283084['name']),console['error']('═'['repeat'](0x3c));if(_0x417c4e[_0x49ed01(0x23f)]&&_0x283084['sampleData']){const _0x997b2=a31_0x22e59c[_0x49ed01(0x297)](_0x49ed01(0x2ee))+'\x20'+a31_0x22e59c['bold'](_0x283084[_0x49ed01(0x23f)]['database']+'.'+_0x283084[_0x49ed01(0x23f)]['table']);await this[_0x49ed01(0x228)](_0x997b2,_0x283084[_0x49ed01(0x2ba)]);}else{if(_0x417c4e[_0x49ed01(0x385)]&&_0x283084[_0x49ed01(0x2ba)]){const _0x24a20a=a31_0x22e59c[_0x49ed01(0x297)]('Attribute:')+'\x20'+a31_0x22e59c[_0x49ed01(0x214)](_0x417c4e['attribute']);await this['displaySampleData'](_0x24a20a,_0x283084[_0x49ed01(0x2ba)]);}else{if(_0x417c4e['behavior']&&_0x283084['sampleData']){const _0x59a4d3=a31_0x22e59c['dim'](_0x49ed01(0x32b))+'\x20'+a31_0x22e59c[_0x49ed01(0x214)](_0x417c4e[_0x49ed01(0x359)]);await this[_0x49ed01(0x228)](_0x59a4d3,_0x283084[_0x49ed01(0x2ba)]);}else{if(_0x417c4e[_0x49ed01(0x376)]&&_0x283084['sampleData']){const _0x1a0506=a31_0x22e59c['dim'](_0x49ed01(0x2c6))+'\x20'+a31_0x22e59c['bold'](_0x49ed01(0x325));await this[_0x49ed01(0x228)](_0x1a0506,_0x283084[_0x49ed01(0x2ba)]);}else!_0x283084[_0x49ed01(0x2ba)]&&console[_0x49ed01(0x1b0)](_0x49ed01(0x273));}}}if(_0x283084[_0x49ed01(0x329)][_0x49ed01(0x2c8)]>0x0){console['error']('─'[_0x49ed01(0x38b)](0x3c)),console['error']('\x0a'+a31_0x22e59c['red'](_0x49ed01(0x1ce)));for(const _0x2c61b6 of _0x283084[_0x49ed01(0x329)]){console[_0x49ed01(0x1b0)]('\x20\x20'+a31_0x22e59c['red']('•')+'\x20'+_0x2c61b6);}}}async[a31_0x23ba89(0x228)](_0x4910bf,_0x519d78){const _0x49e992=a31_0x23ba89;if(_0x519d78['length']===0x0){console['error']('\x0a'+_0x4910bf),console[_0x49e992(0x1b0)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x49e992(0x1b0)]('\x0a'+_0x4910bf);const _0x2c9d65=Object[_0x49e992(0x36d)](_0x519d78[0x0])[_0x49e992(0x30a)](_0x3c3155=>({'name':_0x3c3155,'type':typeof _0x519d78[0x0][_0x3c3155]==='number'?_0x49e992(0x1f5):_0x49e992(0x2cb)})),_0xc64114={'queryId':'preview','columns':_0x2c9d65,'data':_0x519d78,'stats':{'state':_0x49e992(0x2af),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x519d78[_0x49e992(0x2c8)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x545c7d=formatAsTable(_0xc64114,_0x519d78[_0x49e992(0x2c8)],!![]);await writeOutput(_0x545c7d,undefined,_0x49e992(0x2a9));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x1c8);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x1d2);async[a31_0x23ba89(0x2fe)](_0x5d25f3){const _0x45073b=a31_0x23ba89,{options:_0x4e618c,args:_0xe9563c,tdx:_0x421cc1}=_0x5d25f3,_0x6fc20=_0x4e618c,_0x2c0ed4=_0xe9563c[0x0]||_0x4e618c[_0x45073b(0x2a6)];if(!_0x2c0ed4)return showParentSegmentNotSetError(_0x45073b(0x24e)+_0x45073b(0x3af)),0x1;const _0x453946=resolveYamlFile(_0x2c0ed4);if(existsSync(_0x453946)){_0x6fc20[_0x45073b(0x2e1)]&&console['error'](_0x45073b(0x1fe)+_0x453946);let _0x21c1ed;try{_0x21c1ed=readFileSync(_0x453946,_0x45073b(0x20e));}catch(_0x20012f){const _0x74296c=_0x20012f instanceof Error?_0x20012f[_0x45073b(0x39b)]:String(_0x20012f);return console[_0x45073b(0x1b0)](_0x45073b(0x2fc)+_0x74296c),0x1;}const _0x5ccad4=await withSpinner(_0x45073b(0x2f4),()=>_0x421cc1[_0x45073b(0x392)][_0x45073b(0x386)](_0x21c1ed),{'verbose':_0x6fc20['verbose']}),_0x36ef1f=_0x5ccad4[_0x45073b(0x2d4)],{isNew:_0x1e3dbc,name:_0x335ea7,hasChanges:_0x24836a,diffFormatted:_0x254859}=_0x36ef1f;if(_0x24836a){_0x1e3dbc?console['error'](_0x45073b(0x2b5)+_0x335ea7+'\x27:'):console[_0x45073b(0x1b0)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x335ea7+'\x27:');console[_0x45073b(0x1b0)]('─'[_0x45073b(0x38b)](0x3c)),console[_0x45073b(0x1b0)](_0x254859),console[_0x45073b(0x1b0)]('─'[_0x45073b(0x38b)](0x3c));const _0x151431=_0x1e3dbc?_0x45073b(0x34b)+_0x335ea7+_0x45073b(0x316):_0x45073b(0x339)+_0x335ea7+_0x45073b(0x316);if(!_0x6fc20[_0x45073b(0x210)]){if(!isInteractive())return console[_0x45073b(0x1b0)](a31_0x22e59c[_0x45073b(0x38e)](_0x45073b(0x32e)),_0x45073b(0x272)),console[_0x45073b(0x1b0)](a31_0x22e59c[_0x45073b(0x297)](_0x45073b(0x378))),0x1;const _0x3e3f0d=await confirmKey(_0x151431);if(!_0x3e3f0d)return console[_0x45073b(0x1b0)](a31_0x22e59c[_0x45073b(0x1e8)]('Aborted.')),0x1;}const _0x5cb552=_0x1e3dbc?_0x45073b(0x1a8):_0x45073b(0x2f5);await withSpinner(_0x5cb552+_0x45073b(0x21c)+_0x335ea7+'\x27...',()=>_0x36ef1f[_0x45073b(0x3b5)](),{'verbose':_0x6fc20['verbose']});const _0x57560c=_0x1e3dbc?_0x45073b(0x363):_0x45073b(0x2e9);console[_0x45073b(0x1b0)]('✔\x20'+_0x57560c+_0x45073b(0x21c)+_0x335ea7+'\x27');}else console[_0x45073b(0x1b0)](_0x45073b(0x251)+_0x335ea7+'\x27\x20is\x20up\x20to\x20date');}const _0x14f608=await withSpinner(_0x45073b(0x34f)+_0x2c0ed4+_0x45073b(0x1e2),()=>_0x421cc1['segment'][_0x45073b(0x1c4)](_0x2c0ed4),{'verbose':_0x6fc20['verbose']}),_0x101009=_0x14f608[_0x45073b(0x2d4)],_0x5b1341=getConsoleUrl(_0x6fc20['site'],_0x45073b(0x1bf)+_0x101009[_0x45073b(0x1be)]+_0x45073b(0x260)+_0x101009['workflowSessionId']+_0x45073b(0x1e9)+_0x101009[_0x45073b(0x225)]);return console['error']('\x0a✔\x20Workflow\x20started'),console['error']('\x20\x20'+a31_0x22e59c[_0x45073b(0x297)](_0x45073b(0x207))+'\x20'+_0x101009['audienceId']),console[_0x45073b(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x45073b(0x297)](_0x45073b(0x1e6))+'\x20'+_0x101009[_0x45073b(0x375)]),console[_0x45073b(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x45073b(0x297)]('Session:')+'\x20'+_0x101009[_0x45073b(0x2d9)]),console[_0x45073b(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x45073b(0x297)](_0x45073b(0x2f2))+'\x20'+_0x101009[_0x45073b(0x225)]),console['error']('\x20\x20'+_0x5b1341),console[_0x45073b(0x1b0)]('\x0a'+a31_0x22e59c[_0x45073b(0x297)]('To\x20cancel:')+'\x20tdx\x20wf\x20attempt\x20'+_0x101009[_0x45073b(0x225)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x1a2);[a31_0x23ba89(0x30f)]='List\x20available\x20fields\x20for\x20segmentation';async[a31_0x23ba89(0x2fe)](_0x30711d){const _0x28cf99=a31_0x23ba89,{options:_0x22cab7,args:_0x2a3d86,tdx:_0x42b5e7}=_0x30711d,_0x42e531=_0x2a3d86[0x0]||_0x22cab7['parentSegment'];if(!_0x42e531)return showParentSegmentNotSetError(_0x28cf99(0x1b5)+_0x28cf99(0x1c3)),0x1;_0x22cab7[_0x28cf99(0x2e1)]&&(console[_0x28cf99(0x1b0)]('Site:\x20'+_0x22cab7[_0x28cf99(0x234)]),console[_0x28cf99(0x1b0)]('Parent\x20segment:\x20'+_0x42e531));const _0x16583e=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x42e531+_0x28cf99(0x1e2),()=>_0x42b5e7[_0x28cf99(0x392)][_0x28cf99(0x1aa)](_0x42e531),{'verbose':_0x22cab7['verbose']}),_0x44dc82=_0x16583e[_0x28cf99(0x2d4)];console['error'](_0x28cf99(0x1cc)+_0x44dc82[_0x28cf99(0x2c8)]+'\x20field'+(_0x44dc82[_0x28cf99(0x2c8)]!==0x1?'s':''));if(_0x22cab7[_0x28cf99(0x380)]||_0x22cab7[_0x28cf99(0x326)])return await handleSDKOutput(_0x44dc82,_0x22cab7),0x0;return displayFieldsHumanReadable(_0x44dc82,_0x42e531),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x23ba89(0x356)]='segment:parent:view';[a31_0x23ba89(0x30f)]='Show\x20parent\x20segment\x20details';async[a31_0x23ba89(0x2fe)](_0x2dd3cc){const _0x2c31fc=a31_0x23ba89,{options:_0x4a5988,args:_0x478119,tdx:_0x5ad8e7}=_0x2dd3cc,_0xbd843d=_0x4a5988,_0x265c37=_0x478119[0x0]||_0x4a5988[_0x2c31fc(0x2a6)];if(!_0x265c37)return showParentSegmentNotSetError(_0x2c31fc(0x1d0)+_0x2c31fc(0x281)+_0x2c31fc(0x38a)+_0x2c31fc(0x37f)),0x1;_0x4a5988[_0x2c31fc(0x2e1)]&&(console[_0x2c31fc(0x1b0)](_0x2c31fc(0x358)+_0x4a5988[_0x2c31fc(0x234)]),console[_0x2c31fc(0x1b0)](_0x2c31fc(0x1f4)+_0x265c37));const _0x54c25d=await withSpinner(_0x2c31fc(0x31a)+_0x265c37+_0x2c31fc(0x1e2),()=>_0x5ad8e7['segment'][_0x2c31fc(0x1c1)](_0x265c37),{'verbose':_0x4a5988[_0x2c31fc(0x2e1)]}),_0x120042=_0x54c25d[_0x2c31fc(0x2d4)];if(_0xbd843d[_0x2c31fc(0x1b3)]){const _0x1adb22=getConsoleNextUrl(_0xbd843d[_0x2c31fc(0x234)],_0x2c31fc(0x1df)+_0x120042['id']);return console[_0x2c31fc(0x1b0)](a31_0x22e59c[_0x2c31fc(0x1a5)]('✔')+_0x2c31fc(0x2d7)+a31_0x22e59c[_0x2c31fc(0x26c)](_0x1adb22)),openBrowser(_0x1adb22),0x0;}return await handleSingleObjectOutput(_0x120042,_0x4a5988),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x23ba89(0x356)]='segment:parent:desc';['description']=a31_0x23ba89(0x1fa);async[a31_0x23ba89(0x2fe)](_0x14136a){const _0x3ededa=a31_0x23ba89,{options:_0x3db31a,args:_0x3fc63e,tdx:_0x3709c3}=_0x14136a,_0x1082e3=_0x3db31a,_0xcba8ec=_0x3fc63e[0x0]||_0x3db31a[_0x3ededa(0x2a6)];if(!_0xcba8ec)return showParentSegmentNotSetError(_0x3ededa(0x372)+_0x3ededa(0x3ab)+'Options:\x0a'+_0x3ededa(0x24d)),0x1;_0x3db31a[_0x3ededa(0x2e1)]&&(console[_0x3ededa(0x1b0)]('Site:\x20'+_0x3db31a[_0x3ededa(0x234)]),console[_0x3ededa(0x1b0)](_0x3ededa(0x1f4)+_0xcba8ec));const _0x35c7e2=await withSpinner(_0x3ededa(0x215)+_0xcba8ec+'\x27...',()=>_0x3709c3['segment'][_0x3ededa(0x204)](_0xcba8ec),{'verbose':_0x3db31a[_0x3ededa(0x2e1)]}),_0x443f9c=_0x35c7e2['data'],_0x3e5c04=_0x3709c3[_0x3ededa(0x392)][_0x3ededa(0x315)](_0x443f9c);if(_0x1082e3['output']){const _0x850490=await this[_0x3ededa(0x2a5)](_0x14136a,_0xcba8ec,_0x443f9c,_0x3e5c04),_0x4a9b89=this[_0x3ededa(0x2df)](_0x850490);writeFileSync(_0x1082e3[_0x3ededa(0x1d3)],_0x4a9b89);const _0x35cf16=_0x850490[_0x3ededa(0x242)]['columns'][_0x3ededa(0x2c8)]+_0x850490['behaviors']['reduce']((_0x38a848,_0x5e248f)=>_0x38a848+_0x5e248f[_0x3ededa(0x305)][_0x3ededa(0x2c8)],0x0),_0x271a2a=_0x850490[_0x3ededa(0x327)]['filter'](_0x49ae73=>_0x49ae73['columns'][_0x3ededa(0x2c8)]===0x0)['length'];return console[_0x3ededa(0x341)](_0x3ededa(0x2fa)+_0x1082e3[_0x3ededa(0x1d3)]),console[_0x3ededa(0x341)](_0x3ededa(0x3ac)+_0x3e5c04),console['log']('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x850490['behaviors']['length']+_0x3ededa(0x308)),console['log'](_0x3ededa(0x1cf)+_0x35cf16+_0x3ededa(0x200)),_0x271a2a>0x0&&console['log'](_0x3ededa(0x3a7)+_0x271a2a+_0x3ededa(0x1d6)),0x0;}console['error']('\x0a'+a31_0x22e59c[_0x3ededa(0x214)]('Output\x20Database:')+'\x20'+a31_0x22e59c[_0x3ededa(0x26c)](_0x3e5c04));const _0x4b086c=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x3709c3[_0x3ededa(0x392)][_0x3ededa(0x2db)](_0x443f9c),{'verbose':_0x3db31a[_0x3ededa(0x2e1)]});console[_0x3ededa(0x1b0)]('\x0a'+a31_0x22e59c[_0x3ededa(0x214)]('customers')+'\x20'+a31_0x22e59c[_0x3ededa(0x297)]('('+_0x3e5c04+_0x3ededa(0x284)));const _0xf6acce=await executeSchemaQuery(_0x4b086c[_0x3ededa(0x2d4)],_0x3709c3,_0x3db31a);await handleQueryOutput(_0xf6acce,_0x3db31a);const _0x658449=await withSpinner(_0x3ededa(0x2bd),()=>_0x3709c3['segment'][_0x3ededa(0x222)](_0x443f9c),{'verbose':_0x3db31a[_0x3ededa(0x2e1)]});for(const _0x49e2c0 of _0x658449[_0x3ededa(0x2d4)]){const _0x3affdc=_0x3ededa(0x219)+_0x49e2c0[_0x3ededa(0x1a9)]()['replace'](/\s+/g,'_'),_0x4bac12=_0x3ededa(0x1d7)+_0x3e5c04+'.'+_0x3affdc;console[_0x3ededa(0x1b0)]('\x0a'+a31_0x22e59c[_0x3ededa(0x214)](_0x49e2c0)+'\x20'+a31_0x22e59c[_0x3ededa(0x297)]('('+_0x3e5c04+'.'+_0x3affdc+')'));try{const _0x2a748a=await executeSchemaQuery(_0x4bac12,_0x3709c3,_0x3db31a);await handleQueryOutput(_0x2a748a,_0x3db31a);}catch{console[_0x3ededa(0x1b0)](a31_0x22e59c[_0x3ededa(0x1e8)](_0x3ededa(0x1ef)));}}return 0x0;}async[a31_0x23ba89(0x2a5)](_0x412990,_0x2aae4f,_0x2af3cb,_0x3a419b){const _0x6f238a=a31_0x23ba89,{options:_0x1be676,tdx:_0x19731c}=_0x412990,_0x4b95ef=await withSpinner(_0x6f238a(0x2d1),()=>_0x19731c[_0x6f238a(0x392)][_0x6f238a(0x2db)](_0x2af3cb),{'verbose':_0x1be676[_0x6f238a(0x2e1)]}),_0x357827=await executeSchemaQuery(_0x4b95ef['data'],_0x19731c,_0x1be676),_0x50cac4=_0x357827[_0x6f238a(0x2d4)][_0x6f238a(0x30a)](_0x192c89=>({'name':_0x192c89[_0x6f238a(0x233)],'type':_0x192c89[_0x6f238a(0x20a)]})),_0x584924=await withSpinner(_0x6f238a(0x2bd),()=>_0x19731c['segment'][_0x6f238a(0x222)](_0x2af3cb),{'verbose':_0x1be676[_0x6f238a(0x2e1)]}),_0x2c0f96=[];for(const _0x38b27c of _0x584924[_0x6f238a(0x2d4)]){const _0x197ed8=_0x6f238a(0x219)+_0x38b27c[_0x6f238a(0x1a9)]()['replace'](/\s+/g,'_'),_0x32db1f=_0x6f238a(0x1d7)+_0x3a419b+'.'+_0x197ed8;let _0x47cab5=[];try{const _0x27d95e=await executeSchemaQuery(_0x32db1f,_0x19731c,_0x1be676);_0x47cab5=_0x27d95e['data'][_0x6f238a(0x30a)](_0x579f89=>({'name':_0x579f89[_0x6f238a(0x233)],'type':_0x579f89['column_type']}));}catch{}_0x2c0f96[_0x6f238a(0x1bc)]({'table':_0x197ed8,'columns':_0x47cab5});}return{'database':_0x3a419b,'parent_segment':_0x2aae4f,'parent_id':_0x2af3cb,'customers':{'table':_0x6f238a(0x242),'columns':_0x50cac4},'behaviors':_0x2c0f96};}[a31_0x23ba89(0x2df)](_0x11b762){const _0x285f4c=a31_0x23ba89,_0xcf1f1d=_0x3f0d1f=>{const _0x3b2dd6=a31_0x1186;if(_0x3f0d1f[_0x3b2dd6(0x2c8)]===0x0)return'[]';const _0x232ea2=_0x3f0d1f[_0x3b2dd6(0x30a)](_0x1cc6e2=>_0x3b2dd6(0x373)+_0x1cc6e2[_0x3b2dd6(0x356)]+_0x3b2dd6(0x1a7)+_0x1cc6e2[_0x3b2dd6(0x2d2)]+_0x3b2dd6(0x395));return'[\x0a'+_0x232ea2[_0x3b2dd6(0x301)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0xf26e24=_0x11b762[_0x285f4c(0x327)][_0x285f4c(0x30a)](_0x3c3ee7=>{const _0x906597=_0x285f4c;return _0x906597(0x35e)+_0x3c3ee7[_0x906597(0x2a9)]+_0x906597(0x1c7)+_0xcf1f1d(_0x3c3ee7[_0x906597(0x305)])[_0x906597(0x35a)](/^/gm,'\x20\x20')[_0x906597(0x292)]()+_0x906597(0x279);})['join'](',\x0a');return _0x285f4c(0x268)+_0x11b762['database']+'\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22'+_0x11b762[_0x285f4c(0x28e)]+_0x285f4c(0x334)+_0x11b762[_0x285f4c(0x278)]+_0x285f4c(0x2c7)+_0x11b762['customers'][_0x285f4c(0x2a9)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0xcf1f1d(_0x11b762[_0x285f4c(0x242)][_0x285f4c(0x305)])[_0x285f4c(0x35a)](/^/gm,'\x20\x20')[_0x285f4c(0x292)]()+_0x285f4c(0x39d)+_0xf26e24+_0x285f4c(0x231);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x23ba89(0x356)]='segment:parent:sql';['description']=a31_0x23ba89(0x354);async[a31_0x23ba89(0x2fe)](_0x32980b){const _0x2061d0=a31_0x23ba89,{options:_0x39a2b8,args:_0x42ddbb,tdx:_0x586cd0}=_0x32980b,_0x3aa8c9=_0x42ddbb[0x0]||_0x39a2b8[_0x2061d0(0x2a6)];if(!_0x3aa8c9)return showParentSegmentNotSetError(_0x2061d0(0x28b)+_0x2061d0(0x1bb)),0x1;_0x39a2b8[_0x2061d0(0x2e1)]&&(console['error'](_0x2061d0(0x358)+_0x39a2b8[_0x2061d0(0x234)]),console['error'](_0x2061d0(0x1f4)+_0x3aa8c9));const _0x3aa6c4=await withSpinner(_0x2061d0(0x215)+_0x3aa8c9+_0x2061d0(0x1e2),()=>_0x586cd0['segment'][_0x2061d0(0x204)](_0x3aa8c9),{'verbose':_0x39a2b8[_0x2061d0(0x2e1)]}),_0x50ea93=_0x3aa6c4[_0x2061d0(0x2d4)],_0x1a7a41=await withSpinner(_0x2061d0(0x37b)+_0x3aa8c9+_0x2061d0(0x1e2),()=>_0x586cd0[_0x2061d0(0x392)][_0x2061d0(0x2db)](_0x50ea93),{'verbose':_0x39a2b8[_0x2061d0(0x2e1)]}),_0x43b7a5=_0x1a7a41[_0x2061d0(0x2d4)];return _0x39a2b8[_0x2061d0(0x362)]===_0x2061d0(0x380)||_0x39a2b8[_0x2061d0(0x362)]===_0x2061d0(0x326)?await handleSDKOutput([{'sql':_0x43b7a5}],_0x39a2b8):console[_0x2061d0(0x341)](_0x43b7a5),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x23ba89(0x356)]='segment:parent:show';[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x397);async[a31_0x23ba89(0x2fe)](_0x47e87b){const _0x56a6df=a31_0x23ba89,{options:_0x3b1368,args:_0x1a348d,tdx:_0x4ceae1}=_0x47e87b,_0x3eb190=_0x1a348d[0x0]||_0x3b1368[_0x56a6df(0x2a6)];if(!_0x3eb190)return showParentSegmentNotSetError(_0x56a6df(0x37a)+_0x56a6df(0x20d)),0x1;_0x3b1368[_0x56a6df(0x2e1)]&&(console[_0x56a6df(0x1b0)](_0x56a6df(0x358)+_0x3b1368['site']),console[_0x56a6df(0x1b0)](_0x56a6df(0x1f4)+_0x3eb190));const _0x1fdb2b=await withSpinner(_0x56a6df(0x215)+_0x3eb190+_0x56a6df(0x1e2),()=>_0x4ceae1[_0x56a6df(0x392)][_0x56a6df(0x204)](_0x3eb190),{'verbose':_0x3b1368[_0x56a6df(0x2e1)]}),_0x313dfa=_0x1fdb2b['data'],_0xe47c31=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x3eb190+_0x56a6df(0x1e2),()=>_0x4ceae1['segment'][_0x56a6df(0x2db)](_0x313dfa),{'verbose':_0x3b1368[_0x56a6df(0x2e1)]});let _0x1667e7=_0xe47c31[_0x56a6df(0x2d4)];const _0x35b366=resolveLimit(_0x3b1368[_0x56a6df(0x22f)],DEFAULT_DISPLAY_LIMIT),_0x7d7c05=/\bLIMIT\s+\d+/i[_0x56a6df(0x35c)](_0x1667e7);!_0x7d7c05&&(_0x1667e7=_0x1667e7['trim']()['replace'](/;+$/,''),_0x1667e7='SELECT\x20*\x20FROM\x20(\x0a'+_0x1667e7+_0x56a6df(0x269)+_0x35b366);_0x3b1368[_0x56a6df(0x2e1)]&&console[_0x56a6df(0x1b0)](_0x56a6df(0x2e4)+_0x1667e7);const _0x8844f8=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x42b34a=>{const _0x54f240=_0x56a6df,_0x3970b9=await _0x4ceae1['query'][_0x54f240(0x2fe)](_0x1667e7,{'catalog':'td','schema':_0x54f240(0x1b6),'onJobId':_0xc41a30=>{const _0x314361=_0x54f240;_0x42b34a[_0x314361(0x2ab)](_0xc41a30);}});return _0x3970b9;},{'verbose':_0x3b1368[_0x56a6df(0x2e1)]}),_0x524af4=_0x8844f8['data'],_0x48ad96=_0x524af4[_0x56a6df(0x38c)]?_0x56a6df(0x265)+_0x524af4[_0x56a6df(0x38c)]+']':'';return console[_0x56a6df(0x1b0)](_0x56a6df(0x2f7)+_0x524af4[_0x56a6df(0x267)][_0x56a6df(0x2cd)]['toLocaleString']()+_0x56a6df(0x1e7)+(_0x56a6df(0x294)+formatElapsed(_0x524af4[_0x56a6df(0x267)]['elapsedTimeMillis'])+_0x48ad96)),await handleQueryOutput(_0x524af4,_0x3b1368),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x345);[a31_0x23ba89(0x30f)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a31_0x23ba89(0x2fe)](_0x4b51b6){const _0x591fa7=a31_0x23ba89,{options:_0x451240,args:_0x11bbe5,tdx:_0x2d7e6c}=_0x4b51b6,_0x4c23a9=_0x11bbe5[0x0],_0x51c27a=await withSpinner(_0x4c23a9?_0x591fa7(0x1dc)+_0x4c23a9+_0x591fa7(0x1e2):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x2d7e6c['realtime']['list'](),{'verbose':_0x451240[_0x591fa7(0x2e1)]});let _0x5bacb1=_0x51c27a[_0x591fa7(0x2d4)][_0x591fa7(0x25b)](_0x4fa305=>_0x4fa305['realtime_enabled']);if(_0x4c23a9){const _0x4cc6c8=_0x4c23a9[_0x591fa7(0x35a)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x591fa7(0x35a)](/\?/g,'.'),_0xd2b492=new RegExp('^'+_0x4cc6c8+'$','i');_0x5bacb1=_0x5bacb1[_0x591fa7(0x25b)](_0x9a2651=>_0xd2b492[_0x591fa7(0x35c)](_0x9a2651[_0x591fa7(0x356)]));}_0x5bacb1['sort']((_0x319bb6,_0x22f773)=>_0x319bb6['name'][_0x591fa7(0x25e)](_0x22f773[_0x591fa7(0x356)])),console[_0x591fa7(0x1b0)](_0x591fa7(0x1cc)+_0x5bacb1[_0x591fa7(0x2c8)]+_0x591fa7(0x1af)+(_0x5bacb1[_0x591fa7(0x2c8)]!==0x1?'s':''));const _0xa1a89c=_0x2bd72b=>{const _0x5c0ac3=_0x591fa7;return getConsoleNextUrl(_0x451240[_0x5c0ac3(0x234)],_0x5c0ac3(0x1df)+_0x2bd72b);};if(_0x451240[_0x591fa7(0x362)]===_0x591fa7(0x380)||_0x451240[_0x591fa7(0x362)]===_0x591fa7(0x326)){const _0x5392e2=_0x5bacb1[_0x591fa7(0x30a)](_0x13efcc=>({..._0x13efcc,'url':_0xa1a89c(_0x13efcc['id'])}));await handleSDKOutput(_0x5392e2,_0x451240);}else{if(_0x5bacb1[_0x591fa7(0x2c8)]===0x0)console[_0x591fa7(0x341)](_0x591fa7(0x331));else for(const _0x3f5d5b of _0x5bacb1){const _0x197ecf=_0x3f5d5b[_0x591fa7(0x2e7)]?a31_0x22e59c[_0x591fa7(0x297)]('\x20('+formatRows(_0x3f5d5b['population'])+')'):'',_0x3e75ea=hyperlink(_0x3f5d5b[_0x591fa7(0x356)],_0xa1a89c(_0x3f5d5b['id']));console['log']('⚡\x20'+_0x3e75ea+_0x197ecf);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x314);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x389);async['execute'](_0x57d712){const _0x1aaa9d=a31_0x23ba89,{options:_0x4893a1,args:_0x5eefce,tdx:_0x423178}=_0x57d712,_0x396528=_0x5eefce[0x0]||_0x4893a1[_0x1aaa9d(0x2a6)];if(!_0x396528)return showParentSegmentNotSetError(_0x1aaa9d(0x2ad)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment'),0x1;const _0x3bf455=resolveYamlFile(_0x396528);if(!existsSync(_0x3bf455))return showFileNotFoundError(_0x3bf455,_0x396528),0x1;let _0xdcecbf;try{_0xdcecbf=readFileSync(_0x3bf455,'utf-8');}catch(_0x559dcb){const _0x54a1f4=_0x559dcb instanceof Error?_0x559dcb['message']:String(_0x559dcb);return console[_0x1aaa9d(0x1b0)](_0x1aaa9d(0x2fc)+_0x54a1f4),0x1;}const _0x5bc9ca=createCommandSpinner(a31_0x22e59c[_0x1aaa9d(0x297)](_0x1aaa9d(0x202)),{'verbose':_0x4893a1[_0x1aaa9d(0x2e1)]});_0x5bc9ca['start']();const _0x4b5344={'realtime':!![],'onProgress':_0x2fa102=>{const _0x413bd9=_0x1aaa9d;_0x5bc9ca[_0x413bd9(0x317)]=formatProgressMessage(_0x2fa102);}};let _0x1bfa0c;try{_0x1bfa0c=await _0x423178[_0x1aaa9d(0x392)][_0x1aaa9d(0x205)](_0xdcecbf,_0x4b5344),_0x5bc9ca[_0x1aaa9d(0x1db)]();}catch(_0x2a5d20){_0x5bc9ca['stop']();throw _0x2a5d20;}console[_0x1aaa9d(0x1b0)]('\x0a'+a31_0x22e59c[_0x1aaa9d(0x214)]('RT\x202.0\x20Validate:')+'\x20'+_0x1bfa0c[_0x1aaa9d(0x356)]),console[_0x1aaa9d(0x1b0)]('═'[_0x1aaa9d(0x38b)](0x3c)),displayRealtimeValidation(_0x1bfa0c),console[_0x1aaa9d(0x1b0)]('─'[_0x1aaa9d(0x38b)](0x3c));if(_0x1bfa0c[_0x1aaa9d(0x329)][_0x1aaa9d(0x2c8)]>0x0){console[_0x1aaa9d(0x1b0)]('\x0a'+a31_0x22e59c[_0x1aaa9d(0x38e)](_0x1aaa9d(0x1ce)));for(const _0x51280b of _0x1bfa0c['errors']){console[_0x1aaa9d(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x1aaa9d(0x38e)]('•')+'\x20'+_0x51280b);}}return _0x1bfa0c[_0x1aaa9d(0x247)]&&console[_0x1aaa9d(0x1b0)]('\x0a'+a31_0x22e59c[_0x1aaa9d(0x1a5)]('✔')+_0x1aaa9d(0x282)),_0x1bfa0c[_0x1aaa9d(0x247)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x250);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x2b6);async['execute'](_0x593a53){const _0x46fcef=a31_0x23ba89,{options:_0x3bbec0,args:_0x359c8f,tdx:_0x179f74}=_0x593a53,_0x3aef7f=_0x359c8f[0x0]||_0x3bbec0['parentSegment'];if(!_0x3aef7f)return showParentSegmentNotSetError(_0x46fcef(0x36e)+_0x46fcef(0x2ce)),0x1;_0x3bbec0[_0x46fcef(0x2e1)]&&(console[_0x46fcef(0x1b0)](_0x46fcef(0x358)+_0x3bbec0['site']),console[_0x46fcef(0x1b0)](_0x46fcef(0x1f4)+_0x3aef7f));const _0x18892b=await withSpinner(_0x46fcef(0x215)+_0x3aef7f+_0x46fcef(0x1e2),()=>_0x179f74['segment'][_0x46fcef(0x204)](_0x3aef7f),{'verbose':_0x3bbec0[_0x46fcef(0x2e1)]}),_0x242cd5=_0x18892b[_0x46fcef(0x2d4)],_0x405f0a=await withSpinner('Listing\x20RT\x20journeys\x20for\x20\x27'+_0x3aef7f+_0x46fcef(0x1e2),()=>_0x179f74['realtime'][_0x46fcef(0x35d)](_0x242cd5),{'verbose':_0x3bbec0['verbose']}),_0x403d37=_0x405f0a[_0x46fcef(0x2d4)];console[_0x46fcef(0x1b0)](_0x46fcef(0x1cc)+_0x403d37[_0x46fcef(0x2c8)]+_0x46fcef(0x288)+(_0x403d37[_0x46fcef(0x2c8)]!==0x1?'s':''));if(_0x3bbec0[_0x46fcef(0x362)]==='json'||_0x3bbec0[_0x46fcef(0x362)]==='jsonl')await handleSDKOutput(_0x403d37,_0x3bbec0);else{if(_0x403d37[_0x46fcef(0x2c8)]===0x0)console[_0x46fcef(0x341)](_0x46fcef(0x232));else for(const _0x1944b4 of _0x403d37){const _0x31b68e=_0x1944b4['state']===_0x46fcef(0x374)?'🚀':'📝',_0x367f48=_0x1944b4[_0x46fcef(0x311)]?a31_0x22e59c[_0x46fcef(0x1e8)](_0x46fcef(0x30c)):'',_0x6bc777=a31_0x22e59c[_0x46fcef(0x297)]('\x20('+_0x1944b4[_0x46fcef(0x26f)]+_0x46fcef(0x2fd)+(_0x1944b4[_0x46fcef(0x26f)]!==0x1?'s':'')+')');console[_0x46fcef(0x341)](_0x31b68e+'\x20'+_0x1944b4['name']+_0x367f48+_0x6bc777);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x23ba89(0x356)]='ps:rt:jn:pause';[a31_0x23ba89(0x30f)]='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x23ba89(0x2fe)](_0x243f1a){const _0x363e67=a31_0x23ba89,{options:_0x3953f8,args:_0x5ed4af,tdx:_0x503508}=_0x243f1a,_0x439975=_0x5ed4af[0x0];if(!_0x439975)return console[_0x363e67(0x1b0)](a31_0x22e59c[_0x363e67(0x38e)](_0x363e67(0x2bc))),console['error']('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console[_0x363e67(0x1b0)](a31_0x22e59c['dim'](_0x363e67(0x21b))),0x1;_0x3953f8[_0x363e67(0x2e1)]&&(console[_0x363e67(0x1b0)](_0x363e67(0x358)+_0x3953f8[_0x363e67(0x234)]),console['error'](_0x363e67(0x2e0)+_0x439975));const _0x36be86=await withSpinner(_0x363e67(0x289)+_0x439975+'\x27...',()=>_0x503508[_0x363e67(0x398)][_0x363e67(0x32c)](_0x439975),{'verbose':_0x3953f8[_0x363e67(0x2e1)]}),_0x5433ef=_0x36be86[_0x363e67(0x2d4)];console[_0x363e67(0x1b0)](_0x363e67(0x2c2)+_0x5433ef[_0x363e67(0x356)]+'\x27');if(_0x3953f8[_0x363e67(0x362)]===_0x363e67(0x380)||_0x3953f8[_0x363e67(0x362)]===_0x363e67(0x326))await handleSDKOutput([_0x5433ef],_0x3953f8);else{const _0x30f295=_0x5433ef[_0x363e67(0x300)]==='launched'?'🚀':'📝',_0x5aad69=_0x5433ef[_0x363e67(0x311)]?a31_0x22e59c[_0x363e67(0x1e8)](_0x363e67(0x30c)):'';console['log'](_0x30f295+'\x20'+_0x5433ef['name']+_0x5aad69);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x37c);[a31_0x23ba89(0x30f)]='Resume\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x23ba89(0x2fe)](_0x43c6a0){const _0x386f41=a31_0x23ba89,{options:_0x2967b7,args:_0x329faf,tdx:_0x3f2267}=_0x43c6a0,_0xfa0b28=_0x329faf[0x0];if(!_0xfa0b28)return console[_0x386f41(0x1b0)](a31_0x22e59c[_0x386f41(0x38e)](_0x386f41(0x2bc))),console['error'](_0x386f41(0x23c)),console[_0x386f41(0x1b0)](a31_0x22e59c[_0x386f41(0x297)](_0x386f41(0x21b))),0x1;_0x2967b7[_0x386f41(0x2e1)]&&(console[_0x386f41(0x1b0)](_0x386f41(0x358)+_0x2967b7['site']),console[_0x386f41(0x1b0)](_0x386f41(0x2e0)+_0xfa0b28));const _0x313b2a=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0xfa0b28+'\x27...',()=>_0x3f2267[_0x386f41(0x398)][_0x386f41(0x24a)](_0xfa0b28),{'verbose':_0x2967b7[_0x386f41(0x2e1)]}),_0x1eb1c6=_0x313b2a[_0x386f41(0x2d4)];console[_0x386f41(0x1b0)](_0x386f41(0x2fb)+_0x1eb1c6[_0x386f41(0x356)]+'\x27');if(_0x2967b7[_0x386f41(0x362)]===_0x386f41(0x380)||_0x2967b7[_0x386f41(0x362)]===_0x386f41(0x326))await handleSDKOutput([_0x1eb1c6],_0x2967b7);else{const _0x31936d=_0x1eb1c6[_0x386f41(0x300)]===_0x386f41(0x374)?'🚀':'📝',_0x36fb9c=_0x1eb1c6['paused']?a31_0x22e59c[_0x386f41(0x1e8)](_0x386f41(0x30c)):'';console[_0x386f41(0x341)](_0x31936d+'\x20'+_0x1eb1c6[_0x386f41(0x356)]+_0x36fb9c);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x30b);[a31_0x23ba89(0x30f)]='Get\x20current\x20RT\x20configuration\x20version\x20status';async['execute'](_0x52250d){const _0x9a3d64=a31_0x23ba89,{options:_0xdf500,args:_0x2c0e18,tdx:_0x3d6741}=_0x52250d,_0x87b02d=_0x2c0e18[0x0]||_0xdf500[_0x9a3d64(0x2a6)];if(!_0x87b02d)return showParentSegmentNotSetError(_0x9a3d64(0x28f)+_0x9a3d64(0x394)),0x1;_0xdf500['verbose']&&(console[_0x9a3d64(0x1b0)](_0x9a3d64(0x358)+_0xdf500[_0x9a3d64(0x234)]),console[_0x9a3d64(0x1b0)]('Parent\x20segment:\x20'+_0x87b02d));const _0x485441=await withSpinner(_0x9a3d64(0x215)+_0x87b02d+'\x27...',()=>_0x3d6741[_0x9a3d64(0x392)][_0x9a3d64(0x204)](_0x87b02d),{'verbose':_0xdf500[_0x9a3d64(0x2e1)]}),_0x1cdd22=_0x485441['data'],_0x20919f=await withSpinner(_0x9a3d64(0x349)+_0x87b02d+_0x9a3d64(0x1e2),()=>_0x3d6741[_0x9a3d64(0x398)][_0x9a3d64(0x1e3)](_0x1cdd22),{'verbose':_0xdf500[_0x9a3d64(0x2e1)]}),_0xd8ce05=_0x20919f[_0x9a3d64(0x2d4)];return console[_0x9a3d64(0x1b0)](_0x9a3d64(0x346)),_0xdf500[_0x9a3d64(0x362)]==='json'||_0xdf500[_0x9a3d64(0x362)]==='jsonl'?await handleSDKOutput([_0xd8ce05],_0xdf500):(console['log'](_0x9a3d64(0x1c2)+_0xd8ce05['id']),console[_0x9a3d64(0x341)](_0x9a3d64(0x24b)+_0xd8ce05[_0x9a3d64(0x1f1)]),console[_0x9a3d64(0x341)](_0x9a3d64(0x246)+_0xd8ce05['identifier']),console[_0x9a3d64(0x341)]('eventKind:\x20'+_0xd8ce05['eventKind']),console[_0x9a3d64(0x341)]('status:\x20'+_0xd8ce05[_0x9a3d64(0x375)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x1a3);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x2f6);async['execute'](_0x4b1cbf){const _0x1010a1=a31_0x23ba89,{options:_0x5603a8,args:_0x1a9789,tdx:_0x396cbb}=_0x4b1cbf,_0x5c2fd1=_0x1a9789[0x0]||_0x5603a8['parentSegment'];if(!_0x5c2fd1)return showParentSegmentNotSetError(_0x1010a1(0x2f8)+_0x1010a1(0x1ca)),0x1;const _0x266ab9=await withSpinner(_0x1010a1(0x215)+_0x5c2fd1+'\x27...',()=>_0x396cbb[_0x1010a1(0x392)]['resolveParentId'](_0x5c2fd1),{'verbose':_0x5603a8[_0x1010a1(0x2e1)]}),_0x44f748=_0x266ab9[_0x1010a1(0x2d4)],_0x398eb9=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0x5c2fd1+_0x1010a1(0x1e2),()=>_0x396cbb['personalization']['list'](_0x44f748),{'verbose':_0x5603a8['verbose']}),_0x30dff9=_0x398eb9[_0x1010a1(0x2d4)];console[_0x1010a1(0x1b0)](_0x1010a1(0x1cc)+_0x30dff9['length']+_0x1010a1(0x33f)+(_0x30dff9[_0x1010a1(0x2c8)]!==0x1?'s':''));if(_0x5603a8[_0x1010a1(0x362)]===_0x1010a1(0x380)||_0x5603a8[_0x1010a1(0x362)]===_0x1010a1(0x326))await handleSDKOutput(_0x30dff9,_0x5603a8);else{if(_0x30dff9['length']===0x0)console[_0x1010a1(0x341)](_0x1010a1(0x33a)),console['error'](a31_0x22e59c[_0x1010a1(0x26c)](_0x1010a1(0x2b4)));else for(const _0x537f12 of _0x30dff9){console[_0x1010a1(0x341)](a31_0x22e59c[_0x1010a1(0x214)](_0x537f12[_0x1010a1(0x356)])+'\x20'+a31_0x22e59c['dim'](_0x1010a1(0x28a)+_0x537f12['id']+')'));_0x537f12[_0x1010a1(0x30f)]&&console[_0x1010a1(0x341)]('\x20\x20'+a31_0x22e59c[_0x1010a1(0x297)](_0x537f12[_0x1010a1(0x30f)]));if(_0x537f12['tokens']&&_0x537f12['tokens'][_0x1010a1(0x2c8)]>0x0)for(const _0x4ce2f7 of _0x537f12['tokens']){const _0x17d5cd=_0x4ce2f7[_0x1010a1(0x2e5)]?.[_0x1010a1(0x2c8)]?_0x4ce2f7['allowedIps'][_0x1010a1(0x301)](',\x20'):_0x1010a1(0x1ad);console['log']('\x20\x20'+a31_0x22e59c['cyan']('token:')+'\x20'+_0x4ce2f7['name']+'\x20'+a31_0x22e59c[_0x1010a1(0x297)](_0x1010a1(0x28a)+_0x4ce2f7['id']+')')),console[_0x1010a1(0x341)](_0x1010a1(0x1cb)+a31_0x22e59c[_0x1010a1(0x297)](_0x1010a1(0x287))+'\x20'+_0x17d5cd);}else console['log']('\x20\x20'+a31_0x22e59c[_0x1010a1(0x297)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x23ba89(0x356)]='ps:pz:service:create';[a31_0x23ba89(0x30f)]='Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment';async[a31_0x23ba89(0x2fe)](_0x225440){const _0x1e1f04=a31_0x23ba89,{options:_0x5005d6,args:_0x25d50a,tdx:_0x48e4f6}=_0x225440,_0x4cee39=_0x5005d6,_0x418797=_0x25d50a[0x0],_0x925db5=_0x25d50a[0x1]||_0x5005d6[_0x1e1f04(0x2a6)];if(!_0x418797)return console[_0x1e1f04(0x1b0)](_0x1e1f04(0x318)),console[_0x1e1f04(0x1b0)](_0x1e1f04(0x206)),console['error'](_0x1e1f04(0x370)),0x1;if(!_0x925db5)return showParentSegmentNotSetError(_0x1e1f04(0x364)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x223496=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x925db5+_0x1e1f04(0x1e2),()=>_0x48e4f6['segment'][_0x1e1f04(0x204)](_0x925db5),{'verbose':_0x5005d6[_0x1e1f04(0x2e1)]}),_0x2ee2e5=_0x223496[_0x1e1f04(0x2d4)],_0x26bd1c={'name':_0x418797,'description':_0x4cee39[_0x1e1f04(0x30f)],'public':_0x4cee39[_0x1e1f04(0x22d)]},_0x925264=await withSpinner(_0x1e1f04(0x258)+_0x418797+_0x1e1f04(0x1e2),()=>_0x48e4f6['personalization'][_0x1e1f04(0x25d)](_0x2ee2e5,_0x26bd1c),{'verbose':_0x5005d6['verbose']}),_0x2c7076=_0x925264[_0x1e1f04(0x2d4)];return console[_0x1e1f04(0x1b0)]('✔\x20Created\x20personalization\x20service\x20\x27'+_0x2c7076['name']+_0x1e1f04(0x208)+_0x2c7076['id']),await handleSDKOutput([_0x2c7076],_0x5005d6),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{['name']=a31_0x23ba89(0x28d);[a31_0x23ba89(0x30f)]='Show\x20personalization\x20service\x20details';async[a31_0x23ba89(0x2fe)](_0x54005c){const _0x2786ca=a31_0x23ba89,{options:_0x67e034,args:_0x36bb9c,tdx:_0x317ce0}=_0x54005c,_0x4d328b=_0x36bb9c[0x0],_0x207faf=_0x36bb9c[0x1]||_0x67e034[_0x2786ca(0x2a6)];if(!_0x4d328b)return console[_0x2786ca(0x1b0)](_0x2786ca(0x1ba)),console['error'](_0x2786ca(0x33b)),console[_0x2786ca(0x1b0)](_0x2786ca(0x377)),0x1;if(!_0x207faf)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a'+_0x2786ca(0x377)),0x1;const _0x4e6516=await withSpinner(_0x2786ca(0x215)+_0x207faf+_0x2786ca(0x1e2),()=>_0x317ce0[_0x2786ca(0x392)][_0x2786ca(0x204)](_0x207faf),{'verbose':_0x67e034[_0x2786ca(0x2e1)]}),_0x59d3fa=_0x4e6516['data'],_0x4d478f=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x4d328b+_0x2786ca(0x1e2),()=>_0x317ce0[_0x2786ca(0x264)][_0x2786ca(0x262)](_0x59d3fa,_0x4d328b),{'verbose':_0x67e034[_0x2786ca(0x2e1)]}),_0x5da95b=_0x4d478f['data'];if(_0x67e034[_0x2786ca(0x380)]||_0x67e034[_0x2786ca(0x326)])await handleSDKOutput([_0x5da95b],_0x67e034);else{console['log'](a31_0x22e59c[_0x2786ca(0x214)](_0x5da95b['name'])+'\x20'+a31_0x22e59c['dim'](_0x2786ca(0x28a)+_0x5da95b['id']+')'));_0x5da95b[_0x2786ca(0x30f)]&&console[_0x2786ca(0x341)]('\x20\x20'+a31_0x22e59c[_0x2786ca(0x297)](_0x5da95b[_0x2786ca(0x30f)]));console[_0x2786ca(0x341)]('\x20\x20'+a31_0x22e59c['cyan']('public:')+'\x20'+(_0x5da95b[_0x2786ca(0x22d)]?_0x2786ca(0x210):'no'));if(_0x5da95b[_0x2786ca(0x365)]&&_0x5da95b[_0x2786ca(0x365)]['length']>0x0)for(const _0x44e33e of _0x5da95b[_0x2786ca(0x365)]){const _0x1327be=_0x44e33e[_0x2786ca(0x2e5)]?.[_0x2786ca(0x2c8)]?_0x44e33e[_0x2786ca(0x2e5)][_0x2786ca(0x301)](',\x20'):'any';console[_0x2786ca(0x341)]('\x20\x20'+a31_0x22e59c[_0x2786ca(0x26c)](_0x2786ca(0x3a3))+'\x20'+_0x44e33e[_0x2786ca(0x356)]+'\x20'+a31_0x22e59c[_0x2786ca(0x297)](_0x2786ca(0x28a)+_0x44e33e['id']+')')),console[_0x2786ca(0x341)](_0x2786ca(0x1cb)+a31_0x22e59c['dim'](_0x2786ca(0x287))+'\x20'+_0x1327be);}else console['log']('\x20\x20'+a31_0x22e59c[_0x2786ca(0x297)](_0x2786ca(0x1c9)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x1d5);[a31_0x23ba89(0x30f)]='Delete\x20a\x20personalization\x20service';async[a31_0x23ba89(0x2fe)](_0x493a46){const _0x4c26ee=a31_0x23ba89,{options:_0x2307e7,args:_0x1da824,tdx:_0x1a51ad}=_0x493a46,_0x44c792=_0x1da824[0x0],_0x1afad9=_0x1da824[0x1]||_0x2307e7[_0x4c26ee(0x2a6)];if(!_0x44c792)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console['error'](_0x4c26ee(0x29e)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x1afad9)return showParentSegmentNotSetError(_0x4c26ee(0x2b2)+_0x4c26ee(0x1b8)),0x1;const _0x5b3423=await withSpinner(_0x4c26ee(0x215)+_0x1afad9+_0x4c26ee(0x1e2),()=>_0x1a51ad[_0x4c26ee(0x392)][_0x4c26ee(0x204)](_0x1afad9),{'verbose':_0x2307e7['verbose']}),_0x1eeb7f=_0x5b3423[_0x4c26ee(0x2d4)];return await withSpinner(_0x4c26ee(0x2b7)+_0x44c792+_0x4c26ee(0x1e2),()=>_0x1a51ad[_0x4c26ee(0x264)][_0x4c26ee(0x1c6)](_0x1eeb7f,_0x44c792),{'verbose':_0x2307e7[_0x4c26ee(0x2e1)]}),console[_0x4c26ee(0x1b0)](_0x4c26ee(0x1fd)+_0x44c792+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x209);['description']='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x23ba89(0x2fe)](_0x5d5391){const _0x2150ee=a31_0x23ba89,{options:_0x5e8d34,args:_0x345432,tdx:_0x196cba}=_0x5d5391,_0x59693a=_0x5e8d34,_0x4eabfe=_0x345432[0x0],_0x2161a6=_0x345432[0x1]||_0x5e8d34[_0x2150ee(0x2a6)];if(!_0x4eabfe)return console['error'](_0x2150ee(0x1ba)),console[_0x2150ee(0x1b0)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),console[_0x2150ee(0x1b0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x59693a[_0x2150ee(0x356)])return console[_0x2150ee(0x1b0)]('Error:\x20--name\x20is\x20required'),console[_0x2150ee(0x1b0)](_0x2150ee(0x2a3)),0x1;if(!_0x2161a6)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+_0x2150ee(0x1d9)),0x1;const _0x364fbd=await withSpinner(_0x2150ee(0x215)+_0x2161a6+_0x2150ee(0x1e2),()=>_0x196cba[_0x2150ee(0x392)][_0x2150ee(0x204)](_0x2161a6),{'verbose':_0x5e8d34[_0x2150ee(0x2e1)]}),_0x1cad68=_0x364fbd[_0x2150ee(0x2d4)],_0x511fe8={'name':_0x59693a['name']};_0x59693a[_0x2150ee(0x30f)]!==undefined&&(_0x511fe8[_0x2150ee(0x30f)]=_0x59693a['description']);const _0x370d1e=await withSpinner(_0x2150ee(0x390)+_0x4eabfe+'\x27...',()=>_0x196cba[_0x2150ee(0x264)][_0x2150ee(0x31c)](_0x1cad68,_0x4eabfe,_0x511fe8),{'verbose':_0x5e8d34[_0x2150ee(0x2e1)]}),_0x4ed671=_0x370d1e[_0x2150ee(0x2d4)];return console[_0x2150ee(0x1b0)](_0x2150ee(0x22b)+_0x4ed671[_0x2150ee(0x356)]+'\x27'),await handleSDKOutput([_0x4ed671],_0x5e8d34),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x23ba89(0x356)]='ps:pz:service:token:create';[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x203);async[a31_0x23ba89(0x2fe)](_0x47ffc8){const _0x5bedfa=a31_0x23ba89,{options:_0x451e48,args:_0x470176,tdx:_0x931066}=_0x47ffc8,_0xfe7c5d=_0x451e48,_0x377f56=_0x470176[0x0],_0x308e87=_0x470176[0x1],_0x5983e4=_0x470176[0x2]||_0x451e48[_0x5bedfa(0x2a6)];if(!_0x377f56)return console[_0x5bedfa(0x1b0)]('Error:\x20Token\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x5bedfa(0x1b0)](_0x5bedfa(0x323)),0x1;if(!_0x308e87)return console[_0x5bedfa(0x1b0)](_0x5bedfa(0x1ba)),console[_0x5bedfa(0x1b0)](_0x5bedfa(0x1b4)),console[_0x5bedfa(0x1b0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x5983e4)return showParentSegmentNotSetError(_0x5bedfa(0x384)+_0x5bedfa(0x323)),0x1;const _0x230b1e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5983e4+_0x5bedfa(0x1e2),()=>_0x931066[_0x5bedfa(0x392)][_0x5bedfa(0x204)](_0x5983e4),{'verbose':_0x451e48[_0x5bedfa(0x2e1)]}),_0xda185c=_0x230b1e[_0x5bedfa(0x2d4)],_0x3d7d85={'name':_0x377f56};_0xfe7c5d[_0x5bedfa(0x2e5)]&&(_0x3d7d85['allowedIps']=_0xfe7c5d[_0x5bedfa(0x2e5)][_0x5bedfa(0x1fc)](',')[_0x5bedfa(0x30a)](_0x40f323=>_0x40f323[_0x5bedfa(0x292)]()));_0xfe7c5d[_0x5bedfa(0x30f)]&&(_0x3d7d85[_0x5bedfa(0x30f)]=_0xfe7c5d[_0x5bedfa(0x30f)]);const _0x32e4c8=await withSpinner(_0x5bedfa(0x309)+_0x377f56+'\x27\x20for\x20service\x20\x27'+_0x308e87+_0x5bedfa(0x1e2),()=>_0x931066[_0x5bedfa(0x264)][_0x5bedfa(0x355)](_0xda185c,_0x308e87,_0x3d7d85),{'verbose':_0x451e48[_0x5bedfa(0x2e1)]}),_0x4c71d5=_0x32e4c8[_0x5bedfa(0x2d4)];return console[_0x5bedfa(0x1b0)](_0x5bedfa(0x22e)+_0x4c71d5['name']+'\x27\x20with\x20ID:\x20'+_0x4c71d5['id']),_0x4c71d5[_0x5bedfa(0x34a)]&&(console['error'](a31_0x22e59c[_0x5bedfa(0x1e8)]('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console[_0x5bedfa(0x1b0)](a31_0x22e59c[_0x5bedfa(0x26c)](_0x4c71d5['value'])),console[_0x5bedfa(0x1b0)]('')),await handleSDKOutput([_0x4c71d5],_0x451e48),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x29b);['description']=a31_0x23ba89(0x347);async['execute'](_0x30ad8c){const _0x335b2c=a31_0x23ba89,{options:_0x1d6db2,args:_0x3cbfe3,tdx:_0x20b51e}=_0x30ad8c,_0x188d7c=_0x3cbfe3[0x0],_0x3f5b20=_0x3cbfe3[0x1]||_0x1d6db2[_0x335b2c(0x2a6)];if(!_0x188d7c)return console[_0x335b2c(0x1b0)](_0x335b2c(0x2da)),console['error'](_0x335b2c(0x3a8)),console[_0x335b2c(0x1b0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x3f5b20)return showParentSegmentNotSetError(_0x335b2c(0x218)+_0x335b2c(0x2dd)),0x1;const _0xd40b4f=await withSpinner(_0x335b2c(0x215)+_0x3f5b20+_0x335b2c(0x1e2),()=>_0x20b51e[_0x335b2c(0x392)]['resolveParentId'](_0x3f5b20),{'verbose':_0x1d6db2[_0x335b2c(0x2e1)]}),_0x59338c=_0xd40b4f[_0x335b2c(0x2d4)],_0x2bfe40=await withSpinner(_0x335b2c(0x357),()=>_0x20b51e[_0x335b2c(0x264)][_0x335b2c(0x36c)](_0x59338c),{'verbose':_0x1d6db2['verbose']}),_0x262c96=_0x2bfe40[_0x335b2c(0x2d4)];let _0x25a740;for(const _0x50f08c of _0x262c96){if(_0x50f08c[_0x335b2c(0x365)]?.[_0x335b2c(0x33e)](_0x318385=>_0x318385['id']===_0x188d7c)){_0x25a740=_0x50f08c['id'];break;}}if(!_0x25a740)return console[_0x335b2c(0x1b0)](_0x335b2c(0x1f3)+_0x188d7c+_0x335b2c(0x1ab)),0x1;const _0x230cf1=await withSpinner(_0x335b2c(0x1b1)+_0x188d7c+_0x335b2c(0x1e2),()=>_0x20b51e[_0x335b2c(0x264)][_0x335b2c(0x324)](_0x59338c,_0x25a740,_0x188d7c),{'verbose':_0x1d6db2[_0x335b2c(0x2e1)]}),_0x2f9681=_0x230cf1['data'];return console[_0x335b2c(0x1b0)](_0x335b2c(0x2aa)+(_0x2f9681[_0x335b2c(0x356)]||_0x188d7c)+'\x27'),await handleSDKOutput([_0x2f9681],_0x1d6db2),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x23ba89(0x356)]='ps:pz:list';[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x3ad);async[a31_0x23ba89(0x2fe)](_0x5a187a){const _0x54f559=a31_0x23ba89,{options:_0x21eb0b,args:_0x4fdb51,tdx:_0x463da4}=_0x5a187a,_0x55d6db=_0x4fdb51[0x0]||_0x21eb0b['parentSegment'];if(!_0x55d6db)return showParentSegmentNotSetError(_0x54f559(0x3b2)+_0x54f559(0x29a)),0x1;const _0x18f8e0=await withSpinner(_0x54f559(0x215)+_0x55d6db+_0x54f559(0x1e2),()=>_0x463da4[_0x54f559(0x392)][_0x54f559(0x204)](_0x55d6db),{'verbose':_0x21eb0b[_0x54f559(0x2e1)]}),_0x40a45c=_0x18f8e0['data'],_0x2ca500=await withSpinner(_0x54f559(0x24f)+_0x55d6db+_0x54f559(0x1e2),()=>_0x463da4[_0x54f559(0x264)][_0x54f559(0x353)](_0x40a45c),{'verbose':_0x21eb0b[_0x54f559(0x2e1)]}),_0x38fee8=_0x2ca500[_0x54f559(0x2d4)];console[_0x54f559(0x1b0)](_0x54f559(0x1cc)+_0x38fee8['length']+_0x54f559(0x2a4)+(_0x38fee8[_0x54f559(0x2c8)]!==0x1?'s':''));if(_0x21eb0b[_0x54f559(0x362)]===_0x54f559(0x380)||_0x21eb0b['format']===_0x54f559(0x326))await handleSDKOutput(_0x38fee8,_0x21eb0b);else{if(_0x38fee8[_0x54f559(0x2c8)]===0x0)console['log'](_0x54f559(0x2cf));else for(const _0x30c22f of _0x38fee8){console['log'](a31_0x22e59c['bold'](_0x30c22f[_0x54f559(0x356)])+'\x20'+a31_0x22e59c[_0x54f559(0x297)]('(id:\x20'+_0x30c22f['id']+')'));_0x30c22f['description']&&console[_0x54f559(0x341)]('\x20\x20'+a31_0x22e59c['dim'](_0x30c22f[_0x54f559(0x30f)]));const _0x4f72c2=_0x30c22f[_0x54f559(0x332)]?.[_0x54f559(0x2c8)]||0x0;console[_0x54f559(0x341)]('\x20\x20'+a31_0x22e59c[_0x54f559(0x26c)](_0x54f559(0x239))+'\x20'+_0x4f72c2);if(_0x30c22f['sections']&&_0x30c22f['sections'][_0x54f559(0x2c8)]>0x0)for(const _0x1ad0f5 of _0x30c22f[_0x54f559(0x332)]){console['log'](_0x54f559(0x220)+_0x1ad0f5['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x23ba89(0x356)]='ps:pz:show';['description']=a31_0x23ba89(0x2e2);async[a31_0x23ba89(0x2fe)](_0x1a5882){const _0x5dbe7f=a31_0x23ba89,{options:_0x2176a2,args:_0x257c56,tdx:_0x3f376b}=_0x1a5882,_0x396539=_0x257c56[0x0];if(!_0x396539)return console[_0x5dbe7f(0x1b0)](_0x5dbe7f(0x2dc)),console[_0x5dbe7f(0x1b0)](_0x5dbe7f(0x25f)),0x1;const _0x35a984=await withSpinner(_0x5dbe7f(0x22c)+_0x396539+_0x5dbe7f(0x1e2),()=>_0x3f376b[_0x5dbe7f(0x264)]['getPersonalization'](_0x396539),{'verbose':_0x2176a2[_0x5dbe7f(0x2e1)]}),_0x49c568=_0x35a984['data'];console['error'](_0x5dbe7f(0x2a0)+_0x49c568[_0x5dbe7f(0x356)]+'\x27');if(_0x2176a2[_0x5dbe7f(0x362)]===_0x5dbe7f(0x380)||_0x2176a2['format']===_0x5dbe7f(0x326))await handleSDKOutput([_0x49c568],_0x2176a2);else{console[_0x5dbe7f(0x341)](a31_0x22e59c['bold'](_0x49c568['name'])+'\x20'+a31_0x22e59c[_0x5dbe7f(0x297)](_0x5dbe7f(0x28a)+_0x49c568['id']+')'));_0x49c568[_0x5dbe7f(0x30f)]&&console['log']('\x20\x20'+a31_0x22e59c[_0x5dbe7f(0x297)](_0x49c568[_0x5dbe7f(0x30f)]));_0x49c568['audienceId']&&console[_0x5dbe7f(0x341)]('\x20\x20'+a31_0x22e59c[_0x5dbe7f(0x26c)](_0x5dbe7f(0x238))+'\x20'+_0x49c568['audienceId']);console['log']('\x20\x20'+a31_0x22e59c[_0x5dbe7f(0x26c)](_0x5dbe7f(0x1e1))+'\x20'+_0x49c568[_0x5dbe7f(0x253)]),console[_0x5dbe7f(0x341)]('\x20\x20'+a31_0x22e59c['cyan'](_0x5dbe7f(0x235))+'\x20'+_0x49c568[_0x5dbe7f(0x27b)]);const _0x5e214b=_0x49c568[_0x5dbe7f(0x332)]?.[_0x5dbe7f(0x2c8)]||0x0;console[_0x5dbe7f(0x341)]('\x20\x20'+a31_0x22e59c[_0x5dbe7f(0x26c)](_0x5dbe7f(0x239))+'\x20'+_0x5e214b);if(_0x49c568[_0x5dbe7f(0x332)]&&_0x49c568[_0x5dbe7f(0x332)][_0x5dbe7f(0x2c8)]>0x0)for(const _0x452bf8 of _0x49c568[_0x5dbe7f(0x332)]){console[_0x5dbe7f(0x341)](_0x5dbe7f(0x1cb)+a31_0x22e59c['bold'](_0x452bf8[_0x5dbe7f(0x356)])+'\x20'+a31_0x22e59c[_0x5dbe7f(0x297)](_0x5dbe7f(0x28a)+_0x452bf8['id']+')')),_0x452bf8[_0x5dbe7f(0x35f)]&&(console[_0x5dbe7f(0x341)]('\x20\x20\x20\x20\x20\x20'+a31_0x22e59c[_0x5dbe7f(0x26c)](_0x5dbe7f(0x23e))+'\x20'+_0x452bf8['entryCriteria'][_0x5dbe7f(0x356)]),_0x452bf8['entryCriteria']['keyEventCriteria']?.[_0x5dbe7f(0x39c)]&&console[_0x5dbe7f(0x341)](_0x5dbe7f(0x2a2)+a31_0x22e59c['cyan'](_0x5dbe7f(0x2c4))+'\x20'+_0x452bf8[_0x5dbe7f(0x35f)][_0x5dbe7f(0x303)][_0x5dbe7f(0x39c)])),_0x452bf8[_0x5dbe7f(0x201)]&&console['log'](_0x5dbe7f(0x270)+a31_0x22e59c[_0x5dbe7f(0x26c)](_0x5dbe7f(0x28c))+'\x20'+JSON[_0x5dbe7f(0x1e5)](_0x452bf8['payload'])),_0x452bf8[_0x5dbe7f(0x2ae)]&&console[_0x5dbe7f(0x341)](_0x5dbe7f(0x270)+a31_0x22e59c[_0x5dbe7f(0x26c)](_0x5dbe7f(0x26b))+_0x5dbe7f(0x299));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x21e);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x383);async[a31_0x23ba89(0x2fe)](_0x2a3cee){const _0x218291=a31_0x23ba89,{options:_0x4670f6,args:_0x300c0f,tdx:_0x15b7f4}=_0x2a3cee,_0x41c3d4=_0x300c0f[0x0];if(!_0x41c3d4)return console[_0x218291(0x1b0)](_0x218291(0x2dc)),console[_0x218291(0x1b0)](_0x218291(0x350)),0x1;return await withSpinner(_0x218291(0x1f6)+_0x41c3d4+_0x218291(0x1e2),()=>_0x15b7f4[_0x218291(0x264)][_0x218291(0x31f)](_0x41c3d4),{'verbose':_0x4670f6[_0x218291(0x2e1)]}),console[_0x218291(0x1b0)](_0x218291(0x1b9)+_0x41c3d4+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x259);['description']=a31_0x23ba89(0x2ff);async[a31_0x23ba89(0x2fe)](_0x22cfe9){const _0x40f0c2=a31_0x23ba89,{options:_0x4ac44f,tdx:_0x1e728f}=_0x22cfe9,_0x59af9d=_0x4ac44f;let _0x33dd9c;if(_0x59af9d[_0x40f0c2(0x3b0)]){_0x33dd9c=await loadJSON(_0x59af9d[_0x40f0c2(0x3b0)],!![]);if(!_0x33dd9c[_0x40f0c2(0x39f)]?.[_0x40f0c2(0x2e8)])return console[_0x40f0c2(0x1b0)](_0x40f0c2(0x333)),console[_0x40f0c2(0x1b0)]('Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:'),console[_0x40f0c2(0x1b0)](_0x40f0c2(0x1eb)),0x1;}else{if(!_0x59af9d[_0x40f0c2(0x356)])return console[_0x40f0c2(0x1b0)](_0x40f0c2(0x285)),console['error'](_0x40f0c2(0x34d)),console['error'](_0x40f0c2(0x2cc)),0x1;if(_0x59af9d[_0x40f0c2(0x30f)]===undefined)return console['error'](_0x40f0c2(0x291)),console[_0x40f0c2(0x1b0)](_0x40f0c2(0x34d)),console[_0x40f0c2(0x1b0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x59af9d[_0x40f0c2(0x25a)]===undefined)return console['error']('Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.'),console[_0x40f0c2(0x1b0)]('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0xd6ff1d=_0x59af9d[_0x40f0c2(0x1f1)];if(!_0xd6ff1d&&_0x4ac44f[_0x40f0c2(0x2a6)]){const _0x3d1384=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4ac44f['parentSegment']+_0x40f0c2(0x1e2),()=>_0x1e728f[_0x40f0c2(0x392)][_0x40f0c2(0x204)](_0x4ac44f[_0x40f0c2(0x2a6)]),{'verbose':_0x4ac44f[_0x40f0c2(0x2e1)]});_0xd6ff1d=_0x3d1384['data'];}let _0x347770;_0x59af9d[_0x40f0c2(0x332)]&&(_0x347770=await loadJSON(_0x59af9d[_0x40f0c2(0x332)],![]));const _0x207da7=_0x59af9d[_0x40f0c2(0x25a)]===_0x40f0c2(0x3aa)?null:{'id':_0x59af9d[_0x40f0c2(0x25a)],'type':_0x40f0c2(0x3a4)};_0x33dd9c={'attributes':{'name':_0x59af9d[_0x40f0c2(0x356)],'description':_0x59af9d[_0x40f0c2(0x30f)]||null,..._0xd6ff1d!==undefined&&{'audienceId':_0xd6ff1d},..._0x347770!==undefined&&{'sections':_0x347770}},'relationships':{'parentFolder':{'data':_0x207da7}}};}const _0x4a0b57=await withSpinner(_0x40f0c2(0x1f7)+(_0x33dd9c[_0x40f0c2(0x336)]?.[_0x40f0c2(0x356)]??'')+'\x27...',()=>_0x1e728f['personalization']['createPersonalization'](_0x33dd9c),{'verbose':_0x4ac44f[_0x40f0c2(0x2e1)]}),_0x120613=_0x4a0b57[_0x40f0c2(0x2d4)];return console[_0x40f0c2(0x1b0)](_0x40f0c2(0x1b7)+_0x120613['name']+'\x27\x20with\x20ID:\x20'+_0x120613['id']),await handleSDKOutput([_0x120613],_0x4ac44f),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x237);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x306);async['execute'](_0x4eb9a0){const _0x23654c=a31_0x23ba89,{options:_0x2351db,args:_0x28ceb1}=_0x4eb9a0,_0x5427ae=_0x2351db,_0x2681b5=_0x28ceb1[0x0];if(!_0x2681b5)return console['error'](_0x23654c(0x2dc)),console[_0x23654c(0x1b0)](_0x23654c(0x24c)),console[_0x23654c(0x1b0)](_0x23654c(0x371)),0x1;let _0x560938;if(_0x5427ae[_0x23654c(0x3b0)])_0x560938=await loadJSON(_0x5427ae['file'],!![]);else{if(!_0x5427ae[_0x23654c(0x356)])return console[_0x23654c(0x1b0)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x23654c(0x1b0)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;if(_0x5427ae[_0x23654c(0x30f)]===undefined)return console[_0x23654c(0x1b0)](_0x23654c(0x291)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;let _0x48d9c9;_0x5427ae[_0x23654c(0x332)]&&(_0x48d9c9=await loadJSON(_0x5427ae['sections'],![])),_0x560938={'attributes':{'name':_0x5427ae[_0x23654c(0x356)],'description':_0x5427ae[_0x23654c(0x30f)]||null,..._0x48d9c9!==undefined&&{'sections':_0x48d9c9}}};}const {tdx:_0x20a349}=_0x4eb9a0,_0x434fba=await withSpinner(_0x23654c(0x37d)+_0x2681b5+_0x23654c(0x1e2),()=>_0x20a349[_0x23654c(0x264)]['patchPersonalization'](_0x2681b5,_0x560938),{'verbose':_0x2351db[_0x23654c(0x2e1)]}),_0x488add=_0x434fba['data'];return console[_0x23654c(0x1b0)](_0x23654c(0x29c)+_0x488add['name']+'\x27\x20(id:\x20'+_0x488add['id']+')'),await handleSDKOutput([_0x488add],_0x2351db),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a31_0x23ba89(0x1dd);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x252);async['execute'](_0x2bca30){const _0x5504d1=a31_0x23ba89,{options:_0xc65b56,args:_0x56a22f}=_0x2bca30,_0x2a0b4d=_0x56a22f[0x0]||_0xc65b56[_0x5504d1(0x2a6)];if(!_0x2a0b4d)return showParentSegmentNotSetError(_0x5504d1(0x338)+_0x5504d1(0x224)),0x1;const _0xc2ebb0=resolveYamlFile(_0x2a0b4d);if(!existsSync(_0xc2ebb0))return showFileNotFoundError(_0xc2ebb0,_0x2a0b4d),0x1;let _0x44c730;try{_0x44c730=readFileSync(_0xc2ebb0,_0x5504d1(0x20e));}catch(_0x21389c){const _0x28c5f9=_0x21389c instanceof Error?_0x21389c[_0x5504d1(0x39b)]:String(_0x21389c);return console[_0x5504d1(0x1b0)](_0x5504d1(0x2fc)+_0x28c5f9),0x1;}let _0x37ffb0;try{_0x37ffb0=parseDef(_0x44c730);}catch(_0x4c9ba5){const _0x1f2eec=_0x4c9ba5 instanceof Error?_0x4c9ba5[_0x5504d1(0x39b)]:String(_0x4c9ba5);return console['error'](a31_0x22e59c[_0x5504d1(0x38e)](_0x5504d1(0x2d5)+_0x1f2eec)),0x1;}if(_0x37ffb0['personalization_services']&&_0x37ffb0['personalization_services'][_0x5504d1(0x2c8)]>0x0)return console[_0x5504d1(0x1b0)](a31_0x22e59c['yellow']('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0xc2ebb0)),console[_0x5504d1(0x1b0)](a31_0x22e59c[_0x5504d1(0x297)]('\x20\x20\x20'+_0x37ffb0[_0x5504d1(0x241)][_0x5504d1(0x2c8)]+_0x5504d1(0x1f8))),0x1;!_0x37ffb0['realtime']&&(_0x37ffb0[_0x5504d1(0x398)]={'events':[{'name':_0x5504d1(0x39e),'source_table':'<database>.<table>'}],'attributes':[{'name':_0x5504d1(0x2f0),'type':_0x5504d1(0x236)}],'id_stitching':{'primary_key':_0x37ffb0[_0x5504d1(0x23f)][_0x5504d1(0x2a9)]==='customers'?_0x5504d1(0x3b4):_0x5504d1(0x1f2)}});_0x37ffb0['personalization_services']=[{'name':'My\x20Service','description':'Personalization\x20service\x20description','trigger_event':_0x5504d1(0x39e),'sections':[{'name':_0x5504d1(0x387),'criteria':'true','attributes':['last_page_viewed']}]}];const _0x410bb3=serializeDef(_0x37ffb0);return writeFileSync(_0xc2ebb0,_0x410bb3,_0x5504d1(0x20e)),console[_0x5504d1(0x1b0)](a31_0x22e59c[_0x5504d1(0x1a5)]('✔')+_0x5504d1(0x36b)+a31_0x22e59c[_0x5504d1(0x26c)](_0xc2ebb0)),(!_0x37ffb0['realtime']||_0x44c730[_0x5504d1(0x3a1)](_0x5504d1(0x2f9))===-0x1)&&console['error'](a31_0x22e59c[_0x5504d1(0x1a5)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x5504d1(0x1b0)]('\x0a'+a31_0x22e59c[_0x5504d1(0x297)](_0x5504d1(0x31d))),console[_0x5504d1(0x1b0)](_0x5504d1(0x1ac)+_0xc2ebb0+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x5504d1(0x1b0)](_0x5504d1(0x286)+a31_0x22e59c[_0x5504d1(0x297)](_0x5504d1(0x34c)+_0x2a0b4d)+_0x5504d1(0x25c)),0x0;}}