@treasuredata/tdx 0.9.0 → 0.9.2

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 (122) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/client/cdp-api-client.js +1 -1
  6. package/dist/client/engage-api-client.js +1 -1
  7. package/dist/client/http-client.js +1 -1
  8. package/dist/client/llm-api-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-api-client.js +1 -1
  11. package/dist/client/trino-api-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/agent-command.js +1 -1
  15. package/dist/commands/api-command.js +1 -1
  16. package/dist/commands/auth-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/context-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/llm-proxy.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pull-command.js +1 -1
  38. package/dist/commands/segment-push-command.js +1 -1
  39. package/dist/commands/segment-update-command.js +1 -1
  40. package/dist/commands/segment-use-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/proxy/anthropic-adapter.js +1 -1
  59. package/dist/proxy/claude-usage-tracker.js +1 -1
  60. package/dist/proxy/context-signature.js +1 -1
  61. package/dist/proxy/conversation-utils.js +1 -1
  62. package/dist/proxy/server.js +1 -1
  63. package/dist/proxy/session-cache.js +1 -1
  64. package/dist/sdk/agent/agent-yaml.d.ts +1 -1
  65. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  66. package/dist/sdk/agent/agent-yaml.js +1 -1
  67. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/connection.js +1 -1
  70. package/dist/sdk/engage.js +1 -1
  71. package/dist/sdk/errors.js +1 -1
  72. package/dist/sdk/index.js +1 -1
  73. package/dist/sdk/job.js +1 -1
  74. package/dist/sdk/journey.js +1 -1
  75. package/dist/sdk/llm.d.ts +27 -20
  76. package/dist/sdk/llm.d.ts.map +1 -1
  77. package/dist/sdk/llm.js +1 -1
  78. package/dist/sdk/llm.js.map +1 -1
  79. package/dist/sdk/query.js +1 -1
  80. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  81. package/dist/sdk/segment/journey-yaml.js +1 -1
  82. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  83. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  84. package/dist/sdk/segment.js +1 -1
  85. package/dist/sdk/user.js +1 -1
  86. package/dist/sdk/workflow.js +1 -1
  87. package/dist/types/endpoints.js +1 -1
  88. package/dist/types/index.js +1 -1
  89. package/dist/utils/agent-config.js +1 -1
  90. package/dist/utils/agent-ref-parser.js +1 -1
  91. package/dist/utils/async.js +1 -1
  92. package/dist/utils/chat-cache.js +1 -1
  93. package/dist/utils/colors.js +1 -1
  94. package/dist/utils/command-output.js +1 -1
  95. package/dist/utils/constants.js +1 -1
  96. package/dist/utils/diff.js +1 -1
  97. package/dist/utils/fields-display.js +1 -1
  98. package/dist/utils/file-permissions.js +1 -1
  99. package/dist/utils/format-detector.js +1 -1
  100. package/dist/utils/formatters.js +1 -1
  101. package/dist/utils/journey-utils.js +1 -1
  102. package/dist/utils/json-loader.js +1 -1
  103. package/dist/utils/llm-backup-utils.js +1 -1
  104. package/dist/utils/model-aliases.js +1 -1
  105. package/dist/utils/model-factors.js +1 -1
  106. package/dist/utils/option-validation.js +1 -1
  107. package/dist/utils/port.js +1 -1
  108. package/dist/utils/process.js +1 -1
  109. package/dist/utils/prompt.js +1 -1
  110. package/dist/utils/segment-path-parser.js +1 -1
  111. package/dist/utils/segment-ref-parser.js +1 -1
  112. package/dist/utils/spinner.js +1 -1
  113. package/dist/utils/sql-parser.js +1 -1
  114. package/dist/utils/sse-parser.js +1 -1
  115. package/dist/utils/string-utils.js +1 -1
  116. package/dist/utils/table-ref-parser.js +1 -1
  117. package/dist/utils/tdx-config.js +1 -1
  118. package/dist/utils/tdx-logger.js +1 -1
  119. package/dist/utils/tree-formatter.js +1 -1
  120. package/dist/utils/version-check.js +1 -1
  121. package/dist/utils/workflow-utils.js +1 -1
  122. package/package.json +1 -1
@@ -1 +1 @@
1
- const a31_0x2e2ab0=a31_0x309c;(function(_0x1776a1,_0x2eb371){const _0x1085c9=a31_0x309c,_0x22e9a1=_0x1776a1();while(!![]){try{const _0x402bdb=parseInt(_0x1085c9(0x1a4))/0x1*(parseInt(_0x1085c9(0x1b2))/0x2)+parseInt(_0x1085c9(0x1a8))/0x3*(-parseInt(_0x1085c9(0x193))/0x4)+-parseInt(_0x1085c9(0x1a0))/0x5+-parseInt(_0x1085c9(0x1b7))/0x6+-parseInt(_0x1085c9(0x1b3))/0x7+-parseInt(_0x1085c9(0x1a2))/0x8*(-parseInt(_0x1085c9(0x19f))/0x9)+parseInt(_0x1085c9(0x1a9))/0xa;if(_0x402bdb===_0x2eb371)break;else _0x22e9a1['push'](_0x22e9a1['shift']());}catch(_0xd4a4b2){_0x22e9a1['push'](_0x22e9a1['shift']());}}}(a31_0xa5e1,0xc1a96));import{BaseCommand}from'./command.js';function a31_0x309c(_0x4fba17,_0x277a8c){_0x4fba17=_0x4fba17-0x192;const _0xa5e163=a31_0xa5e1();let _0x309c53=_0xa5e163[_0x4fba17];return _0x309c53;}import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';function a31_0xa5e1(){const _0x5ed53d=['4853555rSDURa','Query\x20completed:\x20Processed\x20','56PJJEMq','processedRows','1teLCEO','in\x20','\x0aAll\x20results\x20saved\x20to\x20','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','15eNBbep','33556060duLqeX','state','verbose','length','Schema:\x20','Catalog:\x20','...','options','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','779512ZQbOMe','9489396OEBrya','query','data','information_schema','4269666NtiUtp','Executing\x20query\x20[','\x20rows\x20','\x20splits','setExtra','message','Executing\x20statement\x20','Statement\x20','completedSplits','setPhase','name','catalog','execute','543940nDnpcB','error','\x20-\x20','push','output','SQL:\x20','Run\x20Trino\x20queries\x20(streaming)','file','site','description','Executing\x20query...','jobId','984537Nttflz'];a31_0xa5e1=function(){return _0x5ed53d;};return a31_0xa5e1();}import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a31_0x2e2ab0(0x1c1)]=a31_0x2e2ab0(0x1b4);[a31_0x2e2ab0(0x19c)]=a31_0x2e2ab0(0x199);async[a31_0x2e2ab0(0x192)](_0x34f3cd){const _0x2e6720=a31_0x2e2ab0,{options:_0x5727b3,args:_0x3a73f6,tdx:_0x572689}=_0x34f3cd,_0xd0d114=_0x3a73f6[0x0],_0x368af2=_0x5727b3['file'];let _0x125ca1;try{if(_0x368af2)_0x125ca1=readSqlStatementsFromFile(_0x368af2);else{if(_0xd0d114==='-')_0x125ca1=await readSqlStatementsFromStdin();else{if(_0xd0d114&&isSqlFilePath(_0xd0d114))_0x125ca1=readSqlStatementsFromFile(_0xd0d114);else{if(_0xd0d114)_0x125ca1=splitSqlStatements(_0xd0d114);else throw new Error('No\x20SQL\x20provided');}}}}catch(_0x1ddd99){return console['error']('Error:\x20'+_0x1ddd99[_0x2e6720(0x1bc)]),0x1;}const _0x3175e9=_0x5727b3['database']||_0x2e6720(0x1b6),_0x13e7ad=_0x5727b3[_0x2e6720(0x1c2)];try{const _0x339d26=[],_0x4c7747=!!_0x5727b3[_0x2e6720(0x197)];for(let _0x1a2381=0x0;_0x1a2381<_0x125ca1[_0x2e6720(0x1ac)];_0x1a2381++){const _0x586c5f=_0x125ca1[_0x1a2381],_0x1f5b3c=_0x1a2381+0x1,_0x22be80=_0x125ca1[_0x2e6720(0x1ac)],_0x580c99=_0x22be80>0x1;_0x5727b3[_0x2e6720(0x1ab)]&&(console[_0x2e6720(0x194)]('\x0a'+(_0x580c99?_0x2e6720(0x1be)+_0x1f5b3c+'/'+_0x22be80+':':'')),console[_0x2e6720(0x194)]('Site:\x20'+_0x5727b3[_0x2e6720(0x19b)]),console[_0x2e6720(0x194)](_0x2e6720(0x1ae)+(_0x13e7ad||'td')),console[_0x2e6720(0x194)](_0x2e6720(0x1ad)+_0x3175e9),console[_0x2e6720(0x194)](_0x2e6720(0x198)+_0x586c5f));const _0x584ee1=_0x580c99?_0x2e6720(0x1bd)+_0x1f5b3c+'/'+_0x22be80+_0x2e6720(0x1af):_0x2e6720(0x19d);try{const _0x5082dd=await withQuerySpinner(_0x584ee1,async _0x49dc35=>{const _0x10e67e=_0x2e6720,_0x4e9e12=await _0x572689[_0x10e67e(0x1b4)][_0x10e67e(0x192)](_0x586c5f,{'catalog':_0x13e7ad,'schema':_0x3175e9,'onJobId':_0x1364e7=>{_0x49dc35['setJobId'](_0x1364e7);},'onProgress':_0x2bd351=>{const _0x418a06=_0x10e67e;_0x49dc35[_0x418a06(0x1c0)](_0x418a06(0x1b8)+_0x2bd351[_0x418a06(0x1aa)]+']'),_0x49dc35[_0x418a06(0x1bb)](formatRows(_0x2bd351[_0x418a06(0x1a3)])+_0x418a06(0x1b9)+_0x2bd351[_0x418a06(0x1bf)]+'/'+_0x2bd351['totalSplits']+_0x418a06(0x1ba));}});return _0x4e9e12;},{'verbose':_0x5727b3[_0x2e6720(0x1ab)]}),_0x22eff3=_0x5082dd[_0x2e6720(0x1b5)],_0x4a20ff=_0x22eff3[_0x2e6720(0x19e)]?'\x20[Job\x20ID:\x20'+_0x22eff3[_0x2e6720(0x19e)]+']':'',_0x35d0c1=_0x580c99?_0x2e6720(0x1be)+_0x1f5b3c+'/'+_0x22be80+_0x2e6720(0x195):'';console['error']('✔\x20'+_0x35d0c1+_0x2e6720(0x1a1)+formatRows(_0x22eff3['stats'][_0x2e6720(0x1a3)])+_0x2e6720(0x1b9)+(_0x2e6720(0x1a5)+formatElapsed(_0x22eff3['stats']['elapsedTimeMillis'])+_0x4a20ff));if(_0x580c99&&_0x4c7747){const _0x1849f3=resolveOutputOptions(_0x5727b3),_0x4e8e2c=await formatQueryOutput(_0x22eff3,_0x1849f3);_0x339d26[_0x2e6720(0x196)](_0x4e8e2c);}else await handleQueryOutput(_0x22eff3,_0x5727b3);}catch(_0x1c852c){const _0x47cafd=_0x580c99?_0x2e6720(0x1be)+_0x1f5b3c+'/'+_0x22be80+':\x0a':'',_0x51c71f=_0x1c852c instanceof SDKError?_0x1c852c['originalMessage']:_0x1c852c[_0x2e6720(0x1bc)];return console[_0x2e6720(0x194)](''+_0x47cafd+_0x51c71f),0x1;}}if(_0x125ca1[_0x2e6720(0x1ac)]>0x1&&_0x4c7747&&_0x339d26['length']>0x0){const _0x2081f4=_0x339d26['join']('\x0a');writeFileSync(_0x5727b3[_0x2e6720(0x197)],_0x2081f4),console[_0x2e6720(0x194)](_0x2e6720(0x1a6)+_0x5727b3[_0x2e6720(0x197)]);}return 0x0;}catch(_0x531b8e){throw _0x531b8e;}}['validate'](_0x3b8dff){const _0x2fb761=a31_0x2e2ab0,_0x55fcc8=_0x3b8dff['args'][0x0],_0xbcd74a=_0x3b8dff[_0x2fb761(0x1b0)][_0x2fb761(0x19a)];if(!_0x55fcc8&&!_0xbcd74a)return _0x2fb761(0x1a7);if(_0x55fcc8&&_0xbcd74a)return _0x2fb761(0x1b1);return undefined;}}
1
+ function a31_0x5ae9(_0x3c3b83,_0x4cac86){_0x3c3b83=_0x3c3b83-0x178;const _0x52a017=a31_0x52a0();let _0x5ae9fb=_0x52a017[_0x3c3b83];return _0x5ae9fb;}const a31_0x50d114=a31_0x5ae9;function a31_0x52a0(){const _0x4dfdd0=['execute','Catalog:\x20','10juXWgu','information_schema','setJobId','52479JOaSns','push','totalSplits','args','\x20rows\x20','No\x20SQL\x20provided','Executing\x20query\x20[','verbose','...','Site:\x20','state','660735yNouuP','in\x20','error','Statement\x20','query','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','\x20-\x20','originalMessage','6qUhrpB','elapsedTimeMillis','stats','14hVyjdo','Query\x20completed:\x20Processed\x20','Executing\x20query...','27884pOgavD','\x0aAll\x20results\x20saved\x20to\x20','file','output','catalog','processedRows','setExtra','\x20splits','setPhase','description','487984LBgtcC','jobId','6113943BKMMci','options','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','site','\x20[Job\x20ID:\x20','1375465UcQVbp','name','length','999400VTPCGE','join','message','data'];a31_0x52a0=function(){return _0x4dfdd0;};return a31_0x52a0();}(function(_0x354bf7,_0x4fd801){const _0x123940=a31_0x5ae9,_0x234113=_0x354bf7();while(!![]){try{const _0x3c611d=parseInt(_0x123940(0x18b))/0x1*(parseInt(_0x123940(0x188))/0x2)+parseInt(_0x123940(0x1a8))/0x3+parseInt(_0x123940(0x195))/0x4+parseInt(_0x123940(0x17d))/0x5+-parseInt(_0x123940(0x185))/0x6*(-parseInt(_0x123940(0x19c))/0x7)+parseInt(_0x123940(0x19f))/0x8+-parseInt(_0x123940(0x197))/0x9*(parseInt(_0x123940(0x1a5))/0xa);if(_0x3c611d===_0x4fd801)break;else _0x234113['push'](_0x234113['shift']());}catch(_0x254163){_0x234113['push'](_0x234113['shift']());}}}(a31_0x52a0,0x1a975));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a31_0x50d114(0x19d)]=a31_0x50d114(0x181);[a31_0x50d114(0x194)]='Run\x20Trino\x20queries\x20(streaming)';async[a31_0x50d114(0x1a3)](_0x4b73a9){const _0x11456b=a31_0x50d114,{options:_0x2b5075,args:_0x54e6c3,tdx:_0x227ffd}=_0x4b73a9,_0x49c7dd=_0x54e6c3[0x0],_0x379030=_0x2b5075[_0x11456b(0x18d)];let _0x1beb54;try{if(_0x379030)_0x1beb54=readSqlStatementsFromFile(_0x379030);else{if(_0x49c7dd==='-')_0x1beb54=await readSqlStatementsFromStdin();else{if(_0x49c7dd&&isSqlFilePath(_0x49c7dd))_0x1beb54=readSqlStatementsFromFile(_0x49c7dd);else{if(_0x49c7dd)_0x1beb54=splitSqlStatements(_0x49c7dd);else throw new Error(_0x11456b(0x1ad));}}}}catch(_0x2b9029){return console[_0x11456b(0x17f)]('Error:\x20'+_0x2b9029[_0x11456b(0x1a1)]),0x1;}const _0x3b01be=_0x2b5075['database']||_0x11456b(0x1a6),_0x808f3a=_0x2b5075[_0x11456b(0x18f)];try{const _0x4df070=[],_0x3854bf=!!_0x2b5075[_0x11456b(0x18e)];for(let _0x3cde3f=0x0;_0x3cde3f<_0x1beb54[_0x11456b(0x19e)];_0x3cde3f++){const _0x682a92=_0x1beb54[_0x3cde3f],_0x454ef2=_0x3cde3f+0x1,_0xb26daa=_0x1beb54['length'],_0x52bf25=_0xb26daa>0x1;_0x2b5075[_0x11456b(0x179)]&&(console[_0x11456b(0x17f)]('\x0a'+(_0x52bf25?'Statement\x20'+_0x454ef2+'/'+_0xb26daa+':':'')),console[_0x11456b(0x17f)](_0x11456b(0x17b)+_0x2b5075[_0x11456b(0x19a)]),console[_0x11456b(0x17f)](_0x11456b(0x1a4)+(_0x808f3a||'td')),console[_0x11456b(0x17f)]('Schema:\x20'+_0x3b01be),console['error']('SQL:\x20'+_0x682a92));const _0x59482=_0x52bf25?'Executing\x20statement\x20'+_0x454ef2+'/'+_0xb26daa+_0x11456b(0x17a):_0x11456b(0x18a);try{const _0x50e3f7=await withQuerySpinner(_0x59482,async _0x139c6c=>{const _0x2d269a=await _0x227ffd['query']['execute'](_0x682a92,{'catalog':_0x808f3a,'schema':_0x3b01be,'onJobId':_0x445ab3=>{const _0x532d33=a31_0x5ae9;_0x139c6c[_0x532d33(0x1a7)](_0x445ab3);},'onProgress':_0xddfe54=>{const _0x3dee44=a31_0x5ae9;_0x139c6c[_0x3dee44(0x193)](_0x3dee44(0x178)+_0xddfe54[_0x3dee44(0x17c)]+']'),_0x139c6c[_0x3dee44(0x191)](formatRows(_0xddfe54[_0x3dee44(0x190)])+_0x3dee44(0x1ac)+_0xddfe54['completedSplits']+'/'+_0xddfe54[_0x3dee44(0x1aa)]+_0x3dee44(0x192));}});return _0x2d269a;},{'verbose':_0x2b5075[_0x11456b(0x179)]}),_0x39dc36=_0x50e3f7[_0x11456b(0x1a2)],_0x42b51a=_0x39dc36[_0x11456b(0x196)]?_0x11456b(0x19b)+_0x39dc36[_0x11456b(0x196)]+']':'',_0x21086d=_0x52bf25?'Statement\x20'+_0x454ef2+'/'+_0xb26daa+_0x11456b(0x183):'';console[_0x11456b(0x17f)]('✔\x20'+_0x21086d+_0x11456b(0x189)+formatRows(_0x39dc36[_0x11456b(0x187)][_0x11456b(0x190)])+_0x11456b(0x1ac)+(_0x11456b(0x17e)+formatElapsed(_0x39dc36[_0x11456b(0x187)][_0x11456b(0x186)])+_0x42b51a));if(_0x52bf25&&_0x3854bf){const _0x4bba8c=resolveOutputOptions(_0x2b5075),_0xd64bd3=await formatQueryOutput(_0x39dc36,_0x4bba8c);_0x4df070[_0x11456b(0x1a9)](_0xd64bd3);}else await handleQueryOutput(_0x39dc36,_0x2b5075);}catch(_0x3094fe){const _0x49e756=_0x52bf25?_0x11456b(0x180)+_0x454ef2+'/'+_0xb26daa+':\x0a':'',_0x200dd1=_0x3094fe instanceof SDKError?_0x3094fe[_0x11456b(0x184)]:_0x3094fe[_0x11456b(0x1a1)];return console[_0x11456b(0x17f)](''+_0x49e756+_0x200dd1),0x1;}}if(_0x1beb54[_0x11456b(0x19e)]>0x1&&_0x3854bf&&_0x4df070[_0x11456b(0x19e)]>0x0){const _0x17b70f=_0x4df070[_0x11456b(0x1a0)]('\x0a');writeFileSync(_0x2b5075[_0x11456b(0x18e)],_0x17b70f),console[_0x11456b(0x17f)](_0x11456b(0x18c)+_0x2b5075['output']);}return 0x0;}catch(_0x280d7c){throw _0x280d7c;}}['validate'](_0x54fa42){const _0x481f86=a31_0x50d114,_0x30f6bc=_0x54fa42[_0x481f86(0x1ab)][0x0],_0x32b60c=_0x54fa42[_0x481f86(0x198)]['file'];if(!_0x30f6bc&&!_0x32b60c)return _0x481f86(0x199);if(_0x30f6bc&&_0x32b60c)return _0x481f86(0x182);return undefined;}}
@@ -1 +1 @@
1
- const a32_0x2461d7=a32_0x3e09;(function(_0x134d69,_0x1a9542){const _0x3d25eb=a32_0x3e09,_0xe1506c=_0x134d69();while(!![]){try{const _0x3bba6e=parseInt(_0x3d25eb(0x223))/0x1+parseInt(_0x3d25eb(0x1d3))/0x2*(-parseInt(_0x3d25eb(0x230))/0x3)+parseInt(_0x3d25eb(0x1cd))/0x4+parseInt(_0x3d25eb(0x1c3))/0x5*(parseInt(_0x3d25eb(0x1d7))/0x6)+parseInt(_0x3d25eb(0x1cc))/0x7*(-parseInt(_0x3d25eb(0x226))/0x8)+-parseInt(_0x3d25eb(0x20a))/0x9+-parseInt(_0x3d25eb(0x248))/0xa*(-parseInt(_0x3d25eb(0x229))/0xb);if(_0x3bba6e===_0x1a9542)break;else _0xe1506c['push'](_0xe1506c['shift']());}catch(_0x236fbd){_0xe1506c['push'](_0xe1506c['shift']());}}}(a32_0x385c,0x98e58));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a32_0x385c(){const _0x71a3f3=['Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','url','getFolder','parent','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Executing\x20segment\x20query...','toLocaleString','includes','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','segmentPath','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Fetching\x20folder\x20\x27','710QoutLc','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','segmentId','data','json','Parent\x20segment:\x20','Segment\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','site','✔\x20Created\x20folder\x20\x27','/app/ps/','Folder\x20ID:\x20','trim','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Parent\x20segment\x20name\x20is\x20required','folderId','Resolving\x20parent\x20segment\x20\x27','SEGMENT_FOLDER_NOT_FOUND','setJobId','66535hTOPrx','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Fetching\x20parent\x20segment\x20details...','Show\x20segment\x20or\x20folder\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','cause','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','folderPath','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','101857LTrDYk','3117260jUATFn','Resolved\x20parent\x20ID:\x20','length','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Resolved\x20type:\x20','web','30bASSdU','\x20\x20Cause:\x20','Site:\x20','segment:folder:list','198DJBbSC','replace','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','jobId','description','segment:describe','Options:','\x27\x20with\x20ID:\x20','information_schema','parentSegment','Error:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','createFolder','\x20[Job\x20ID:\x20','parentFolder','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','in\x20','Creating\x20folder\x20\x27','Fetching\x20segment\x20details...','getSegmentSQL','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','resolveParentId','resolvePathToResource','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20sql','stats','/e/','(root)','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Listing\x20folders\x20for\x20parent\x20\x27','log','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Show\x20folder\x20or\x20child\x20segment\x20details','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Usage:\x20tdx\x20sg\x20sql\x20<name>','cyan','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','parentId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','processedRows','execute','code','segment:folder:show','Resolving\x20path\x20\x27','green','Fetching\x20folder\x20details...','Get\x20SQL\x20query\x20for\x20child\x20segment','folder','6510204jZbolH','\x20\x20Segment\x20name:\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','getSegment','\x20\x20Parent\x20segment:\x20','segmentName','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Examples:','\x20\x20Folder\x20path:\x20','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Error:\x20Folder\x20reference\x20is\x20required','listFolders','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Show\x20segment\x20folder\x20details','INVALID_ARGUMENT','error','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x27...','Resolving\x20\x27','\x20Opening\x20','segment:view','SQL\x20query:\x0a','697808oQQYcD','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Use:\x20tdx\x20ps\x20show','440xygxtC','limit','jsonl','128326XyPpzs','Parent\x20ID:\x20','segment:show','Target\x20path:\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Parent\x20name:\x20','118923BURcDL','Resolved\x20relative\x20path\x20to:\x20','\x20folder','type','message','name','segment:folder:create','segment','resolveFolderId','Error:\x20Path\x20or\x20name\x20is\x20required','verbose','SEGMENT_NOT_FOUND'];a32_0x385c=function(){return _0x71a3f3;};return a32_0x385c();}import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';function a32_0x3e09(_0x1c26fc,_0x13758c){_0x1c26fc=_0x1c26fc-0x1be;const _0x385c58=a32_0x385c();let _0x3e0971=_0x385c58[_0x1c26fc];return _0x3e0971;}import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a32_0x19be70 from'chalk';function resolveSegmentTarget(_0xfc7c3,_0x171b5d,_0x5191b9){const _0x187504=a32_0x3e09;if(isYamlFilePath(_0xfc7c3))try{const _0x1e1a89=resolveYamlFilePath(_0xfc7c3);return _0x5191b9&&(console[_0x187504(0x21c)]('Resolved\x20YAML\x20file:\x20'+_0xfc7c3),console['error'](_0x187504(0x20e)+_0x1e1a89['parentSegment']),console['error'](_0x187504(0x20b)+_0x1e1a89[_0x187504(0x20f)]),console[_0x187504(0x21c)](_0x187504(0x213)+(_0x1e1a89[_0x187504(0x1ca)]||_0x187504(0x1f3))),console[_0x187504(0x21c)]('\x20\x20Full\x20path:\x20'+_0x1e1a89['fullPath'])),_0x1e1a89['fullPath'];}catch(_0x53a25b){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x187504(0x1f4)+_0x53a25b[_0x187504(0x234)]);}if(!_0x171b5d)throw new SDKError(ErrorCode[_0x187504(0x21b)],_0x187504(0x210));return _0x171b5d+'/'+_0xfc7c3;}export class SegmentDescribeCommand extends BaseCommand{[a32_0x2461d7(0x235)]=a32_0x2461d7(0x1dc);[a32_0x2461d7(0x1db)]=a32_0x2461d7(0x1c6);async[a32_0x2461d7(0x202)](_0x55e982){const _0x2ea0b2=a32_0x2461d7,{options:_0x3a2878,args:_0x3e9e35,tdx:_0x54822d}=_0x55e982,_0x2099c7=_0x3e9e35[0x0],_0x106a8f=!_0x2099c7&&!!_0x3a2878['parentSegment'],_0x216e58=_0x2099c7||_0x3a2878[_0x2ea0b2(0x1e0)];if(!_0x216e58)return console[_0x2ea0b2(0x21c)](_0x2ea0b2(0x239)),console[_0x2ea0b2(0x21c)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x2ea0b2(0x21c)](_0x2ea0b2(0x212)),console[_0x2ea0b2(0x21c)](_0x2ea0b2(0x200)),console['error'](_0x2ea0b2(0x255)),console[_0x2ea0b2(0x21c)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x2ea0b2(0x1d9)),0x1;try{const _0x4f5542=_0x3a2878[_0x2ea0b2(0x245)];let _0x345cb1=_0x216e58;!_0x106a8f&&_0x4f5542&&!_0x216e58[_0x2ea0b2(0x243)]('/')&&(_0x345cb1=_0x4f5542+'/'+_0x216e58,_0x3a2878['verbose']&&console[_0x2ea0b2(0x21c)](_0x2ea0b2(0x231)+_0x345cb1));const _0x5a4103=await withSpinner(_0x2ea0b2(0x205)+_0x345cb1+_0x2ea0b2(0x21e),()=>_0x54822d[_0x2ea0b2(0x237)][_0x2ea0b2(0x1ed)](_0x345cb1),{'verbose':_0x3a2878['verbose']}),_0x1fa4f3=_0x5a4103[_0x2ea0b2(0x24b)];_0x3a2878[_0x2ea0b2(0x23a)]&&(console[_0x2ea0b2(0x21c)]('Resolved\x20type:\x20'+_0x1fa4f3[_0x2ea0b2(0x233)]),console[_0x2ea0b2(0x21c)](_0x2ea0b2(0x22a)+_0x1fa4f3[_0x2ea0b2(0x1ff)]),_0x1fa4f3[_0x2ea0b2(0x1bf)]&&console['error'](_0x2ea0b2(0x253)+_0x1fa4f3[_0x2ea0b2(0x1bf)]),_0x1fa4f3[_0x2ea0b2(0x24a)]&&console[_0x2ea0b2(0x21c)](_0x2ea0b2(0x24e)+_0x1fa4f3[_0x2ea0b2(0x24a)]));if(_0x1fa4f3[_0x2ea0b2(0x233)]===_0x2ea0b2(0x23f)){const _0x592056=await withSpinner(_0x2ea0b2(0x1c5),()=>_0x54822d['segment']['getParent'](_0x1fa4f3[_0x2ea0b2(0x1ff)]),{'verbose':_0x3a2878['verbose']});await handleSingleObjectOutput(_0x592056[_0x2ea0b2(0x24b)],_0x3a2878);}else{if(_0x1fa4f3[_0x2ea0b2(0x233)]==='folder'){if(!_0x1fa4f3[_0x2ea0b2(0x1bf)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x45d846=await withSpinner(_0x2ea0b2(0x207),()=>_0x54822d[_0x2ea0b2(0x237)][_0x2ea0b2(0x23e)](_0x1fa4f3[_0x2ea0b2(0x1bf)]),{'verbose':_0x3a2878[_0x2ea0b2(0x23a)]});await handleSingleObjectOutput(_0x45d846['data'],_0x3a2878);}else{if(_0x1fa4f3[_0x2ea0b2(0x233)]===_0x2ea0b2(0x237)){if(!_0x1fa4f3['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2ea0b2(0x258));const _0x5ec3c0=await withSpinner(_0x2ea0b2(0x1e9),()=>_0x54822d['segment'][_0x2ea0b2(0x20d)](_0x1fa4f3[_0x2ea0b2(0x1ff)],_0x1fa4f3[_0x2ea0b2(0x24a)]),{'verbose':_0x3a2878[_0x2ea0b2(0x23a)]});await handleSingleObjectOutput(_0x5ec3c0['data'],_0x3a2878);}}}return 0x0;}catch(_0x44ff4a){if(_0x44ff4a instanceof SDKError)return console[_0x2ea0b2(0x21c)](_0x2ea0b2(0x1e1)+_0x44ff4a[_0x2ea0b2(0x234)]),_0x44ff4a[_0x2ea0b2(0x1c8)]&&console['error']('\x20\x20Cause:\x20'+_0x44ff4a[_0x2ea0b2(0x1c8)]),0x1;throw _0x44ff4a;}}}export class SegmentShowCommand extends BaseCommand{[a32_0x2461d7(0x235)]=a32_0x2461d7(0x22b);[a32_0x2461d7(0x1db)]=a32_0x2461d7(0x1e6);async[a32_0x2461d7(0x202)](_0x3db622){const _0x607e03=a32_0x2461d7,{options:_0x8b5b25,args:_0x35b8ae,tdx:_0x7c21e1}=_0x3db622,_0x24c669=_0x35b8ae[0x0];if(!_0x24c669)return console[_0x607e03(0x21c)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x607e03(0x21c)](_0x607e03(0x22d)),console[_0x607e03(0x21c)](_0x607e03(0x1eb)),console[_0x607e03(0x21c)](_0x607e03(0x212)),console[_0x607e03(0x21c)](_0x607e03(0x216)),console['error'](_0x607e03(0x1fe)),0x1;try{const _0x3e9516=_0x8b5b25[_0x607e03(0x1e0)],_0x4123c1=resolveSegmentTarget(_0x24c669,_0x3e9516,_0x8b5b25[_0x607e03(0x23a)]);_0x8b5b25[_0x607e03(0x23a)]&&console[_0x607e03(0x21c)](_0x607e03(0x22c)+_0x4123c1);const _0x5d45dc=await withSpinner('Resolving\x20\x27'+_0x24c669+'\x27...',()=>_0x7c21e1[_0x607e03(0x237)][_0x607e03(0x1ed)](_0x4123c1),{'verbose':_0x8b5b25[_0x607e03(0x23a)]}),_0xcb3bdd=_0x5d45dc['data'];_0x8b5b25[_0x607e03(0x23a)]&&(console[_0x607e03(0x21c)](_0x607e03(0x1d1)+_0xcb3bdd[_0x607e03(0x233)]),console[_0x607e03(0x21c)](_0x607e03(0x22a)+_0xcb3bdd[_0x607e03(0x1ff)]));if(_0xcb3bdd[_0x607e03(0x233)]===_0x607e03(0x209))return console[_0x607e03(0x21c)](_0x607e03(0x1cb)),console[_0x607e03(0x21c)](_0x607e03(0x1f7)),0x1;if(_0xcb3bdd[_0x607e03(0x233)]===_0x607e03(0x23f))return console[_0x607e03(0x21c)](_0x607e03(0x20c)),console[_0x607e03(0x21c)](_0x607e03(0x225)),0x1;if(!_0xcb3bdd[_0x607e03(0x24a)])throw new SDKError(ErrorCode[_0x607e03(0x23b)],_0x607e03(0x258));const _0x1ae8ed=await withSpinner(_0x607e03(0x215),()=>_0x7c21e1['segment'][_0x607e03(0x1ea)](_0xcb3bdd['parentId'],_0xcb3bdd[_0x607e03(0x24a)]),{'verbose':_0x8b5b25['verbose']});let _0x2e7b5a=_0x1ae8ed['data'];const _0x1af1d2=resolveLimit(_0x8b5b25[_0x607e03(0x227)],DEFAULT_DISPLAY_LIMIT),_0x1f9c75=/\bLIMIT\s+\d+/i['test'](_0x2e7b5a);!_0x1f9c75&&(_0x2e7b5a=_0x2e7b5a[_0x607e03(0x254)]()[_0x607e03(0x1d8)](/;+$/,''),_0x2e7b5a='SELECT\x20*\x20FROM\x20(\x0a'+_0x2e7b5a+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x1af1d2);_0x8b5b25[_0x607e03(0x23a)]&&console[_0x607e03(0x21c)](_0x607e03(0x222)+_0x2e7b5a);const _0x12e31b=await withQuerySpinner(_0x607e03(0x241),async _0x3448ac=>{const _0x2a6fe8=_0x607e03,_0x5af798=await _0x7c21e1['query']['execute'](_0x2e7b5a,{'catalog':'td','schema':_0x2a6fe8(0x1df),'onJobId':_0x499f3a=>{const _0xfef212=_0x2a6fe8;_0x3448ac[_0xfef212(0x1c2)](_0x499f3a);}});return _0x5af798;},{'verbose':_0x8b5b25[_0x607e03(0x23a)]}),_0x5aa724=_0x12e31b[_0x607e03(0x24b)],_0x578aa7=_0x5aa724[_0x607e03(0x1da)]?_0x607e03(0x1e4)+_0x5aa724['jobId']+']':'';return console[_0x607e03(0x21c)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x5aa724[_0x607e03(0x1f1)][_0x607e03(0x201)][_0x607e03(0x242)]()+'\x20rows\x20'+(_0x607e03(0x1e7)+formatElapsed(_0x5aa724[_0x607e03(0x1f1)]['elapsedTimeMillis'])+_0x578aa7)),await handleQueryOutput(_0x5aa724,_0x8b5b25),0x0;}catch(_0x5cac10){if(_0x5cac10 instanceof SDKError)return console[_0x607e03(0x21c)]('✖\x20Query\x20failed\x20['+_0x5cac10[_0x607e03(0x203)]+']'),console[_0x607e03(0x21c)]('\x0a'+_0x5cac10['message']),0x1;throw _0x5cac10;}}}export class SegmentFolderListCommand extends BaseCommand{[a32_0x2461d7(0x235)]=a32_0x2461d7(0x1d6);[a32_0x2461d7(0x1db)]=a32_0x2461d7(0x22e);async[a32_0x2461d7(0x202)](_0x56b476){const _0x18d300=a32_0x2461d7,{options:_0x1f42c5,args:_0x2231be,tdx:_0x52fbb1}=_0x56b476;if(_0x2231be[_0x18d300(0x1cf)]===0x0)return console[_0x18d300(0x21c)](_0x18d300(0x1be)),console[_0x18d300(0x21c)](_0x18d300(0x211)),0x1;const _0x3003f4=_0x2231be[0x0];try{_0x1f42c5[_0x18d300(0x23a)]&&(console['error'](_0x18d300(0x1d5)+_0x1f42c5[_0x18d300(0x250)]),console['error'](_0x18d300(0x22f)+_0x3003f4));const _0x5c058e=await withSpinner(_0x18d300(0x1c0)+_0x3003f4+_0x18d300(0x21e),()=>_0x52fbb1[_0x18d300(0x237)][_0x18d300(0x1ec)](_0x3003f4),{'verbose':_0x1f42c5['verbose']}),_0x401700=_0x5c058e[_0x18d300(0x24b)];_0x1f42c5[_0x18d300(0x23a)]&&console['error'](_0x18d300(0x1ce)+_0x401700);const _0x154c8f=await withSpinner(_0x18d300(0x1f5)+_0x3003f4+_0x18d300(0x21e),()=>_0x52fbb1[_0x18d300(0x237)][_0x18d300(0x218)](_0x401700),{'verbose':_0x1f42c5[_0x18d300(0x23a)]}),_0x224bae=_0x154c8f['data'];return console['error']('✔\x20Found\x20'+_0x224bae[_0x18d300(0x1cf)]+_0x18d300(0x232)+(_0x224bae[_0x18d300(0x1cf)]!==0x1?'s':'')),await handleSDKOutput(_0x224bae,_0x1f42c5),0x0;}catch(_0xcd0124){if(_0xcd0124 instanceof SDKError)return console[_0x18d300(0x21c)](_0x18d300(0x1e1)+_0xcd0124[_0x18d300(0x234)]),_0xcd0124['cause']&&console[_0x18d300(0x21c)]('\x20\x20Cause:\x20'+_0xcd0124['cause']),0x1;throw _0xcd0124;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a32_0x2461d7(0x204);[a32_0x2461d7(0x1db)]=a32_0x2461d7(0x21a);async[a32_0x2461d7(0x202)](_0x37d294){const _0x5641ff=a32_0x2461d7,{options:_0x58a289,args:_0x1d454e,tdx:_0x2601dc}=_0x37d294;if(_0x1d454e['length']===0x0)return console[_0x5641ff(0x21c)](_0x5641ff(0x217)),console['error'](_0x5641ff(0x224)),0x1;try{const {parentId:_0x56ef34,childId:_0x42747b}=parseSegmentRef(_0x1d454e[0x0]);_0x58a289[_0x5641ff(0x23a)]&&(console[_0x5641ff(0x21c)](_0x5641ff(0x1d5)+_0x58a289[_0x5641ff(0x250)]),console[_0x5641ff(0x21c)](_0x5641ff(0x22f)+_0x56ef34),_0x42747b&&console['error']('Folder\x20name:\x20'+_0x42747b));if(!_0x42747b)return console[_0x5641ff(0x21c)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x539ff5=await withSpinner(_0x5641ff(0x1c0)+_0x56ef34+_0x5641ff(0x21e),()=>_0x2601dc['segment']['resolveParentId'](_0x56ef34),{'verbose':_0x58a289[_0x5641ff(0x23a)]}),_0x36b92e=_0x539ff5[_0x5641ff(0x24b)];_0x58a289[_0x5641ff(0x23a)]&&console[_0x5641ff(0x21c)]('Resolved\x20parent\x20ID:\x20'+_0x36b92e);const _0x38c809=await withSpinner('Resolving\x20folder\x20\x27'+_0x42747b+_0x5641ff(0x21e),()=>_0x2601dc['segment'][_0x5641ff(0x238)](_0x36b92e,_0x42747b),{'verbose':_0x58a289[_0x5641ff(0x23a)]}),_0x471aab=_0x38c809[_0x5641ff(0x24b)];_0x58a289[_0x5641ff(0x23a)]&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x471aab);const _0x26ce28=await withSpinner(_0x5641ff(0x247)+_0x42747b+_0x5641ff(0x21e),()=>_0x2601dc['segment'][_0x5641ff(0x23e)](_0x471aab),{'verbose':_0x58a289['verbose']});return await handleSDKOutput([_0x26ce28[_0x5641ff(0x24b)]],_0x58a289),0x0;}catch(_0x16544a){if(_0x16544a instanceof SDKError)return console[_0x5641ff(0x21c)]('Error:\x20'+_0x16544a[_0x5641ff(0x234)]),_0x16544a['cause']&&console[_0x5641ff(0x21c)](_0x5641ff(0x1d4)+_0x16544a[_0x5641ff(0x1c8)]),0x1;throw _0x16544a;}}}export class SegmentSQLCommand extends BaseCommand{[a32_0x2461d7(0x235)]='segment:sql';[a32_0x2461d7(0x1db)]=a32_0x2461d7(0x208);async[a32_0x2461d7(0x202)](_0xb6ea47){const _0x1d93b7=a32_0x2461d7,{options:_0x64920e,args:_0x17eea3,tdx:_0x4a65f3}=_0xb6ea47,_0x5025e4=_0x17eea3[0x0];if(!_0x5025e4)return console[_0x1d93b7(0x21c)](_0x1d93b7(0x1e2)),console[_0x1d93b7(0x21c)](_0x1d93b7(0x1fa)),console[_0x1d93b7(0x21c)](_0x1d93b7(0x244)),console[_0x1d93b7(0x21c)](_0x1d93b7(0x212)),console[_0x1d93b7(0x21c)](_0x1d93b7(0x249)),console['error']('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x53abb2=_0x64920e[_0x1d93b7(0x1e0)],_0x3682b0=resolveSegmentTarget(_0x5025e4,_0x53abb2,_0x64920e[_0x1d93b7(0x23a)]);_0x64920e[_0x1d93b7(0x23a)]&&console['error']('Target\x20path:\x20'+_0x3682b0);const _0x3e200d=await withSpinner(_0x1d93b7(0x21f)+_0x5025e4+'\x27...',()=>_0x4a65f3[_0x1d93b7(0x237)][_0x1d93b7(0x1ed)](_0x3682b0),{'verbose':_0x64920e[_0x1d93b7(0x23a)]}),_0x160e52=_0x3e200d[_0x1d93b7(0x24b)];_0x64920e[_0x1d93b7(0x23a)]&&(console[_0x1d93b7(0x21c)](_0x1d93b7(0x1d1)+_0x160e52['type']),console[_0x1d93b7(0x21c)](_0x1d93b7(0x22a)+_0x160e52[_0x1d93b7(0x1ff)]));if(_0x160e52[_0x1d93b7(0x233)]===_0x1d93b7(0x209))return console[_0x1d93b7(0x21c)](_0x1d93b7(0x23c)),console[_0x1d93b7(0x21c)](_0x1d93b7(0x1f9)),0x1;if(_0x160e52[_0x1d93b7(0x233)]===_0x1d93b7(0x23f))return console[_0x1d93b7(0x21c)](_0x1d93b7(0x214)),console[_0x1d93b7(0x21c)](_0x1d93b7(0x1f0)),0x1;if(!_0x160e52[_0x1d93b7(0x24a)])throw new SDKError(ErrorCode[_0x1d93b7(0x23b)],_0x1d93b7(0x258));const _0x33e262=await withSpinner(_0x1d93b7(0x215),()=>_0x4a65f3[_0x1d93b7(0x237)][_0x1d93b7(0x1ea)](_0x160e52[_0x1d93b7(0x1ff)],_0x160e52[_0x1d93b7(0x24a)]),{'verbose':_0x64920e[_0x1d93b7(0x23a)]}),_0x26636d=_0x33e262[_0x1d93b7(0x24b)];return _0x64920e['format']===_0x1d93b7(0x24c)||_0x64920e['format']===_0x1d93b7(0x228)?await handleSDKOutput([{'sql':_0x26636d}],_0x64920e):console[_0x1d93b7(0x1f6)](_0x26636d),0x0;}catch(_0x1f7392){if(_0x1f7392 instanceof SDKError)return console[_0x1d93b7(0x21c)](_0x1d93b7(0x1e1)+_0x1f7392[_0x1d93b7(0x234)]),_0x1f7392[_0x1d93b7(0x1c8)]&&console[_0x1d93b7(0x21c)](_0x1d93b7(0x1d4)+_0x1f7392[_0x1d93b7(0x1c8)]),0x1;throw _0x1f7392;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a32_0x2461d7(0x235)]=a32_0x2461d7(0x236);[a32_0x2461d7(0x1db)]='Create\x20segment\x20folder\x20for\x20organization';async[a32_0x2461d7(0x202)](_0x5b010e){const _0x1df6b8=a32_0x2461d7,{options:_0x36c2ef,args:_0x51ad60,tdx:_0x21604e}=_0x5b010e,_0x36a6a6=_0x36c2ef;if(_0x51ad60['length']<0x2)return console[_0x1df6b8(0x21c)](_0x1df6b8(0x1d0)),console['error'](_0x1df6b8(0x246)),0x1;const _0x3f4cc5=_0x51ad60[0x0],_0x78f5df=_0x51ad60[0x1];_0x36a6a6[_0x1df6b8(0x23a)]&&(console[_0x1df6b8(0x21c)](_0x1df6b8(0x1d5)+_0x36a6a6[_0x1df6b8(0x250)]),console[_0x1df6b8(0x21c)](_0x1df6b8(0x24d)+_0x3f4cc5),console[_0x1df6b8(0x21c)]('Folder\x20name:\x20'+_0x78f5df));let _0x4e91bc;if(_0x36a6a6[_0x1df6b8(0x1e5)]){const _0x23e9e3=_0x36a6a6[_0x1df6b8(0x1e5)],_0x37ee05=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3f4cc5+_0x1df6b8(0x21e),()=>_0x21604e['segment'][_0x1df6b8(0x1ec)](_0x3f4cc5),{'verbose':_0x36a6a6[_0x1df6b8(0x23a)]}),_0xba3f2d=_0x37ee05[_0x1df6b8(0x24b)],_0x59de66=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x23e9e3+_0x1df6b8(0x21e),()=>_0x21604e[_0x1df6b8(0x237)][_0x1df6b8(0x238)](_0xba3f2d,_0x23e9e3),{'verbose':_0x36a6a6[_0x1df6b8(0x23a)]});_0x4e91bc=_0x59de66[_0x1df6b8(0x24b)],_0x36a6a6[_0x1df6b8(0x23a)]&&console['error']('Resolved\x20parent\x20folder\x20ID:\x20'+_0x4e91bc);}const _0x2ac50d={'name':_0x78f5df,'description':_0x36a6a6[_0x1df6b8(0x1db)],'parentFolderId':_0x4e91bc},_0x49a600=await withSpinner(_0x1df6b8(0x1e8)+_0x78f5df+_0x1df6b8(0x21e),()=>_0x21604e['segment'][_0x1df6b8(0x1e3)](_0x3f4cc5,_0x2ac50d),{'verbose':_0x36a6a6[_0x1df6b8(0x23a)]}),_0x1b0c4b=_0x49a600['data'];return console[_0x1df6b8(0x21c)](_0x1df6b8(0x251)+_0x1b0c4b[_0x1df6b8(0x235)]+_0x1df6b8(0x1de)+_0x1b0c4b['id']),await handleSDKOutput([_0x1b0c4b],_0x36a6a6),0x0;}}export class SegmentViewCommand extends BaseCommand{[a32_0x2461d7(0x235)]=a32_0x2461d7(0x221);[a32_0x2461d7(0x1db)]=a32_0x2461d7(0x1f8);async[a32_0x2461d7(0x202)](_0x1cf5da){const _0x2f4946=a32_0x2461d7,{options:_0x4d1a63,args:_0x36a8a2,tdx:_0x5eaccf}=_0x1cf5da,_0x2d7817=_0x36a8a2[0x0];if(!_0x2d7817)return console[_0x2f4946(0x21c)](_0x2f4946(0x1fd)),console[_0x2f4946(0x21c)](_0x2f4946(0x1c9)),console['error'](_0x2f4946(0x257)),console[_0x2f4946(0x21c)](_0x2f4946(0x1dd)),console[_0x2f4946(0x21c)](_0x2f4946(0x219)),console[_0x2f4946(0x21c)](_0x2f4946(0x212)),console[_0x2f4946(0x21c)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x2f4946(0x21c)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x2f4946(0x21c)](_0x2f4946(0x1c4)),console[_0x2f4946(0x21c)](_0x2f4946(0x24f)),0x1;try{const _0x43ba69=_0x4d1a63[_0x2f4946(0x1e0)],_0x3c86a8=resolveSegmentTarget(_0x2d7817,_0x43ba69,_0x4d1a63[_0x2f4946(0x23a)]);_0x4d1a63[_0x2f4946(0x23a)]&&console[_0x2f4946(0x21c)]('Target\x20path:\x20'+_0x3c86a8);const _0x273aee=await withSpinner(_0x2f4946(0x21f)+_0x2d7817+_0x2f4946(0x21e),()=>_0x5eaccf[_0x2f4946(0x237)][_0x2f4946(0x1ed)](_0x3c86a8),{'verbose':_0x4d1a63[_0x2f4946(0x23a)]}),_0x5f51f8=_0x273aee[_0x2f4946(0x24b)];_0x4d1a63[_0x2f4946(0x23a)]&&(console['error'](_0x2f4946(0x1d1)+_0x5f51f8[_0x2f4946(0x233)]),console['error'](_0x2f4946(0x22a)+_0x5f51f8[_0x2f4946(0x1ff)]),_0x5f51f8[_0x2f4946(0x1bf)]&&console['error'](_0x2f4946(0x253)+_0x5f51f8[_0x2f4946(0x1bf)]),_0x5f51f8[_0x2f4946(0x24a)]&&console[_0x2f4946(0x21c)](_0x2f4946(0x24e)+_0x5f51f8[_0x2f4946(0x24a)]));if(_0x4d1a63[_0x2f4946(0x1d2)]){if(_0x5f51f8['type']===_0x2f4946(0x209))return console[_0x2f4946(0x21c)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x5f51f8['type']===_0x2f4946(0x23f))return console[_0x2f4946(0x21c)](_0x2f4946(0x1ef)),console['error']('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x5f51f8[_0x2f4946(0x24a)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2f4946(0x258));const _0x20c7ec=getConsoleNextUrl(_0x4d1a63[_0x2f4946(0x250)],_0x2f4946(0x252)+_0x5f51f8[_0x2f4946(0x1ff)]+_0x2f4946(0x1f2)+_0x5f51f8[_0x2f4946(0x24a)]);return console['error'](a32_0x19be70[_0x2f4946(0x206)]('✔')+_0x2f4946(0x220)+a32_0x19be70[_0x2f4946(0x1fb)](_0x20c7ec)),openBrowser(_0x20c7ec),0x0;}if(_0x5f51f8[_0x2f4946(0x233)]==='folder'){if(!_0x5f51f8['folderId'])throw new SDKError(ErrorCode[_0x2f4946(0x1c1)],_0x2f4946(0x1ee));const _0xf6ebbb=await withSpinner(_0x2f4946(0x207),()=>_0x5eaccf['segment'][_0x2f4946(0x23e)](_0x5f51f8[_0x2f4946(0x1bf)]),{'verbose':_0x4d1a63[_0x2f4946(0x23a)]});await handleSingleObjectOutput(_0xf6ebbb[_0x2f4946(0x24b)],_0x4d1a63);}else{if(_0x5f51f8[_0x2f4946(0x233)]===_0x2f4946(0x237)){if(!_0x5f51f8[_0x2f4946(0x24a)])throw new SDKError(ErrorCode[_0x2f4946(0x23b)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x59da13=await withSpinner(_0x2f4946(0x1e9),()=>_0x5eaccf[_0x2f4946(0x237)]['getSegment'](_0x5f51f8[_0x2f4946(0x1ff)],_0x5f51f8[_0x2f4946(0x24a)]),{'verbose':_0x4d1a63[_0x2f4946(0x23a)]}),_0x3d0d14=getConsoleNextUrl(_0x4d1a63[_0x2f4946(0x250)],_0x2f4946(0x252)+_0x5f51f8[_0x2f4946(0x1ff)]+_0x2f4946(0x1f2)+_0x5f51f8[_0x2f4946(0x24a)]),_0x5208e3=_0x59da13[_0x2f4946(0x24b)];_0x5208e3[_0x2f4946(0x23d)]=_0x3d0d14,await handleSingleObjectOutput(_0x5208e3,_0x4d1a63);}else return console[_0x2f4946(0x21c)](_0x2f4946(0x21d)),console[_0x2f4946(0x21c)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x169aeb){if(_0x169aeb instanceof SDKError)return console[_0x2f4946(0x21c)]('Error:\x20'+_0x169aeb[_0x2f4946(0x234)]),_0x169aeb[_0x2f4946(0x1c8)]&&console['error'](_0x2f4946(0x1d4)+_0x169aeb[_0x2f4946(0x1c8)]),0x1;throw _0x169aeb;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a32_0x2461d7(0x235)]='segment:desc';[a32_0x2461d7(0x1db)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a32_0x2461d7(0x202)](_0x420c32){const _0x56bb6d=a32_0x2461d7,{options:_0x2cc237,args:_0x322ea6,tdx:_0x13611f}=_0x420c32,_0x3b6828=_0x322ea6[0x0];if(!_0x3b6828)return console['error'](_0x56bb6d(0x1e2)),console[_0x56bb6d(0x21c)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x56bb6d(0x1c7)),console[_0x56bb6d(0x21c)]('Examples:'),console[_0x56bb6d(0x21c)](_0x56bb6d(0x240)),console[_0x56bb6d(0x21c)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x1801a5=_0x2cc237[_0x56bb6d(0x1e0)],_0x39cb5e=resolveSegmentTarget(_0x3b6828,_0x1801a5,_0x2cc237['verbose']);_0x2cc237[_0x56bb6d(0x23a)]&&console[_0x56bb6d(0x21c)](_0x56bb6d(0x22c)+_0x39cb5e);const _0x31f428=await withSpinner(_0x56bb6d(0x21f)+_0x3b6828+_0x56bb6d(0x21e),()=>_0x13611f[_0x56bb6d(0x237)][_0x56bb6d(0x1ed)](_0x39cb5e),{'verbose':_0x2cc237[_0x56bb6d(0x23a)]}),_0x232d15=_0x31f428[_0x56bb6d(0x24b)];_0x2cc237['verbose']&&(console[_0x56bb6d(0x21c)](_0x56bb6d(0x1d1)+_0x232d15[_0x56bb6d(0x233)]),console[_0x56bb6d(0x21c)](_0x56bb6d(0x22a)+_0x232d15[_0x56bb6d(0x1ff)]));if(_0x232d15[_0x56bb6d(0x233)]===_0x56bb6d(0x209))return console[_0x56bb6d(0x21c)](_0x56bb6d(0x256)),console['error'](_0x56bb6d(0x1f9)),0x1;if(_0x232d15[_0x56bb6d(0x233)]===_0x56bb6d(0x23f))return console[_0x56bb6d(0x21c)](_0x56bb6d(0x1fc)),console[_0x56bb6d(0x21c)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x232d15[_0x56bb6d(0x24a)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x56bb6d(0x258));const _0x53952a=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x13611f[_0x56bb6d(0x237)][_0x56bb6d(0x1ea)](_0x232d15[_0x56bb6d(0x1ff)],_0x232d15['segmentId']),{'verbose':_0x2cc237['verbose']}),_0x25c45e=_0x53952a[_0x56bb6d(0x24b)],_0x3cce8d=await executeSchemaQuery(_0x25c45e,_0x13611f,_0x2cc237);return await handleQueryOutput(_0x3cce8d,_0x2cc237),0x0;}catch(_0x5f1dc3){if(_0x5f1dc3 instanceof SDKError)return console[_0x56bb6d(0x21c)](_0x56bb6d(0x1e1)+_0x5f1dc3[_0x56bb6d(0x234)]),_0x5f1dc3[_0x56bb6d(0x1c8)]&&console['error']('\x20\x20Cause:\x20'+_0x5f1dc3[_0x56bb6d(0x1c8)]),0x1;throw _0x5f1dc3;}}}
1
+ function a32_0xf358(){const _0x2feda3=['Site:\x20','413861cAFdfn','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','2259vgWtDy','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','SELECT\x20*\x20FROM\x20(\x0a','execute','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','/e/','INVALID_ARGUMENT','Error:\x20Path\x20or\x20name\x20is\x20required','segment:folder:create','trim','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Examples:','Resolved\x20type:\x20','Creating\x20folder\x20\x27','parentSegment','segmentPath','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20Opening\x20','json','29865MCfArM','data','cause','message','getSegmentSQL','description','jobId','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','folderPath','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Show\x20segment\x20folder\x20details','SEGMENT_NOT_FOUND','parentFolder','listFolders','Folder\x20ID:\x20','toLocaleString','log','Usage:\x20tdx\x20sg\x20desc\x20<name>','18668gDFWCT','cyan','Fetching\x20folder\x20details...','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Target\x20path:\x20','\x20rows\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20Parent\x20segment:\x20','Parent\x20ID:\x20','SQL\x20query:\x0a','\x27\x20with\x20ID:\x20','\x27...','Use:\x20tdx\x20ps\x20desc','parentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Resolved\x20YAML\x20file:\x20','jsonl','includes','url','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20relative\x20path\x20to:\x20','segment:folder:list','Resolved\x20folder\x20ID:\x20','Resolving\x20\x27','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Fetching\x20parent\x20segment\x20details...','limit','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','stats','folder','segment:view','525OKLDAa','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','/app/ps/','Usage:\x20tdx\x20segment\x20describe\x20<path>','Resolving\x20parent\x20folder\x20\x27','\x20\x20Folder\x20path:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parent','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Resolved\x20parent\x20ID:\x20','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:desc','121840tzrFuP','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','information_schema','✖\x20Query\x20failed\x20[','Usage:\x20tdx\x20sg\x20show\x20<name>','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','(root)','segmentId','error','✔\x20Found\x20','Resolving\x20path\x20\x27','2136GJmBGV','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20folder','Error:\x20Folder\x20reference\x20is\x20required','fullPath','✔\x20Query\x20completed:\x20Processed\x20','test','Error:\x20','folderId','12SdGrOS','✔\x20Created\x20folder\x20\x27','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20segment\x20details...','createFolder','length','type','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Fetching\x20folder\x20\x27','SEGMENT_FOLDER_NOT_FOUND','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','segment:sql','resolveParentId','Create\x20segment\x20folder\x20for\x20organization','Fetching\x20SQL\x20for\x20segment...','resolvePathToResource','name','Resolving\x20folder\x20\x27','703520WbGTyf','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','processedRows','getSegment','in\x20','Use:\x20tdx\x20ps\x20show','\x20\x20Cause:\x20','verbose','Segment\x20ID:\x20','\x20[Job\x20ID:\x20','2438lNVRbz','site','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','80GZIZTN','\x20\x20Full\x20path:\x20','Show\x20segment\x20or\x20folder\x20details','Parent\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','segmentName','getFolder','replace','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','web','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Use:\x20tdx\x20ps\x20view\x20-w','Use:\x20tdx\x20ps\x20view','query'];a32_0xf358=function(){return _0x2feda3;};return a32_0xf358();}const a32_0x22f685=a32_0xdd02;(function(_0x2123c6,_0x30ddc5){const _0x1a389c=a32_0xdd02,_0x6fb9fd=_0x2123c6();while(!![]){try{const _0x1772e4=parseInt(_0x1a389c(0x23f))/0x1+parseInt(_0x1a389c(0x1d4))/0x2*(-parseInt(_0x1a389c(0x233))/0x3)+parseInt(_0x1a389c(0x211))/0x4*(parseInt(_0x1a389c(0x1d8))/0x5)+parseInt(_0x1a389c(0x256))/0x6*(parseInt(_0x1a389c(0x1e8))/0x7)+parseInt(_0x1a389c(0x24b))/0x8*(-parseInt(_0x1a389c(0x1ea))/0x9)+parseInt(_0x1a389c(0x268))/0xa+parseInt(_0x1a389c(0x1fd))/0xb;if(_0x1772e4===_0x30ddc5)break;else _0x6fb9fd['push'](_0x6fb9fd['shift']());}catch(_0x515890){_0x6fb9fd['push'](_0x6fb9fd['shift']());}}}(a32_0xf358,0x1a3db));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a32_0x10f154 from'chalk';function resolveSegmentTarget(_0x40f1d1,_0x5e1a39,_0x350492){const _0xbed8d8=a32_0xdd02;if(isYamlFilePath(_0x40f1d1))try{const _0x5f351f=resolveYamlFilePath(_0x40f1d1);return _0x350492&&(console[_0xbed8d8(0x248)](_0xbed8d8(0x220)+_0x40f1d1),console[_0xbed8d8(0x248)](_0xbed8d8(0x218)+_0x5f351f[_0xbed8d8(0x1f8)]),console[_0xbed8d8(0x248)]('\x20\x20Segment\x20name:\x20'+_0x5f351f[_0xbed8d8(0x1de)]),console['error'](_0xbed8d8(0x238)+(_0x5f351f[_0xbed8d8(0x205)]||_0xbed8d8(0x246))),console['error'](_0xbed8d8(0x1d9)+_0x5f351f[_0xbed8d8(0x251)])),_0x5f351f[_0xbed8d8(0x251)];}catch(_0x23d5cf){throw new SDKError(ErrorCode[_0xbed8d8(0x1f0)],_0xbed8d8(0x1eb)+_0x23d5cf['message']);}if(!_0x5e1a39)throw new SDKError(ErrorCode[_0xbed8d8(0x1f0)],_0xbed8d8(0x229));return _0x5e1a39+'/'+_0x40f1d1;}export class SegmentDescribeCommand extends BaseCommand{[a32_0x22f685(0x266)]='segment:describe';[a32_0x22f685(0x202)]=a32_0x22f685(0x1da);async[a32_0x22f685(0x1ed)](_0x4c0ead){const _0x331cee=a32_0x22f685,{options:_0x366a45,args:_0x3c1be0,tdx:_0x31495}=_0x4c0ead,_0x1ad931=_0x3c1be0[0x0],_0x1d357a=!_0x1ad931&&!!_0x366a45[_0x331cee(0x1f8)],_0x576040=_0x1ad931||_0x366a45['parentSegment'];if(!_0x576040)return console[_0x331cee(0x248)](_0x331cee(0x1f1)),console[_0x331cee(0x248)](_0x331cee(0x236)),console[_0x331cee(0x248)](_0x331cee(0x1f5)),console[_0x331cee(0x248)](_0x331cee(0x1e9)),console[_0x331cee(0x248)](_0x331cee(0x207)),console[_0x331cee(0x248)](_0x331cee(0x1e1)),console[_0x331cee(0x248)](_0x331cee(0x239)),0x1;try{const _0xb9b6a9=_0x366a45[_0x331cee(0x1f9)];let _0x6ea400=_0x576040;!_0x1d357a&&_0xb9b6a9&&!_0x576040[_0x331cee(0x222)]('/')&&(_0x6ea400=_0xb9b6a9+'/'+_0x576040,_0x366a45['verbose']&&console[_0x331cee(0x248)](_0x331cee(0x225)+_0x6ea400));const _0x5c2c43=await withSpinner(_0x331cee(0x24a)+_0x6ea400+_0x331cee(0x21c),()=>_0x31495['segment'][_0x331cee(0x265)](_0x6ea400),{'verbose':_0x366a45[_0x331cee(0x1d1)]}),_0x4e0e81=_0x5c2c43[_0x331cee(0x1fe)];_0x366a45[_0x331cee(0x1d1)]&&(console[_0x331cee(0x248)]('Resolved\x20type:\x20'+_0x4e0e81[_0x331cee(0x25c)]),console[_0x331cee(0x248)]('Parent\x20ID:\x20'+_0x4e0e81['parentId']),_0x4e0e81['folderId']&&console[_0x331cee(0x248)](_0x331cee(0x20d)+_0x4e0e81[_0x331cee(0x255)]),_0x4e0e81[_0x331cee(0x247)]&&console['error'](_0x331cee(0x1d2)+_0x4e0e81[_0x331cee(0x247)]));if(_0x4e0e81[_0x331cee(0x25c)]===_0x331cee(0x23a)){const _0x47ffc4=await withSpinner(_0x331cee(0x22d),()=>_0x31495['segment']['getParent'](_0x4e0e81[_0x331cee(0x21e)]),{'verbose':_0x366a45[_0x331cee(0x1d1)]});await handleSingleObjectOutput(_0x47ffc4['data'],_0x366a45);}else{if(_0x4e0e81[_0x331cee(0x25c)]===_0x331cee(0x231)){if(!_0x4e0e81[_0x331cee(0x255)])throw new SDKError(ErrorCode[_0x331cee(0x25f)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x43da13=await withSpinner(_0x331cee(0x213),()=>_0x31495['segment'][_0x331cee(0x1df)](_0x4e0e81['folderId']),{'verbose':_0x366a45[_0x331cee(0x1d1)]});await handleSingleObjectOutput(_0x43da13['data'],_0x366a45);}else{if(_0x4e0e81[_0x331cee(0x25c)]===_0x331cee(0x24d)){if(!_0x4e0e81[_0x331cee(0x247)])throw new SDKError(ErrorCode[_0x331cee(0x20a)],_0x331cee(0x224));const _0x25b887=await withSpinner(_0x331cee(0x259),()=>_0x31495[_0x331cee(0x24d)]['getSegment'](_0x4e0e81[_0x331cee(0x21e)],_0x4e0e81[_0x331cee(0x247)]),{'verbose':_0x366a45[_0x331cee(0x1d1)]});await handleSingleObjectOutput(_0x25b887[_0x331cee(0x1fe)],_0x366a45);}}}return 0x0;}catch(_0x375094){if(_0x375094 instanceof SDKError)return console[_0x331cee(0x248)]('Error:\x20'+_0x375094[_0x331cee(0x200)]),_0x375094[_0x331cee(0x1ff)]&&console[_0x331cee(0x248)](_0x331cee(0x1d0)+_0x375094[_0x331cee(0x1ff)]),0x1;throw _0x375094;}}}export class SegmentShowCommand extends BaseCommand{[a32_0x22f685(0x266)]='segment:show';[a32_0x22f685(0x202)]=a32_0x22f685(0x1ee);async[a32_0x22f685(0x1ed)](_0x3b8742){const _0x463922=a32_0x22f685,{options:_0xbc7b6a,args:_0x1928f2,tdx:_0x1bc033}=_0x3b8742,_0x438f10=_0x1928f2[0x0];if(!_0x438f10)return console[_0x463922(0x248)](_0x463922(0x1d7)),console['error'](_0x463922(0x243)),console['error'](_0x463922(0x24c)),console[_0x463922(0x248)](_0x463922(0x1f5)),console[_0x463922(0x248)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x463922(0x248)](_0x463922(0x26a)),0x1;try{const _0x1da838=_0xbc7b6a[_0x463922(0x1f8)],_0x404a30=resolveSegmentTarget(_0x438f10,_0x1da838,_0xbc7b6a[_0x463922(0x1d1)]);_0xbc7b6a['verbose']&&console['error'](_0x463922(0x215)+_0x404a30);const _0x364368=await withSpinner(_0x463922(0x228)+_0x438f10+_0x463922(0x21c),()=>_0x1bc033[_0x463922(0x24d)][_0x463922(0x265)](_0x404a30),{'verbose':_0xbc7b6a[_0x463922(0x1d1)]}),_0x154c1f=_0x364368[_0x463922(0x1fe)];_0xbc7b6a['verbose']&&(console['error'](_0x463922(0x1f6)+_0x154c1f[_0x463922(0x25c)]),console[_0x463922(0x248)](_0x463922(0x219)+_0x154c1f[_0x463922(0x21e)]));if(_0x154c1f['type']===_0x463922(0x231))return console[_0x463922(0x248)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x463922(0x248)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x154c1f[_0x463922(0x25c)]===_0x463922(0x23a))return console['error'](_0x463922(0x26b)),console[_0x463922(0x248)](_0x463922(0x1cf)),0x1;if(!_0x154c1f['segmentId'])throw new SDKError(ErrorCode[_0x463922(0x20a)],_0x463922(0x224));const _0x3a5e69=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x1bc033[_0x463922(0x24d)][_0x463922(0x201)](_0x154c1f[_0x463922(0x21e)],_0x154c1f[_0x463922(0x247)]),{'verbose':_0xbc7b6a[_0x463922(0x1d1)]});let _0x196a73=_0x3a5e69[_0x463922(0x1fe)];const _0x240b0e=resolveLimit(_0xbc7b6a[_0x463922(0x22e)],DEFAULT_DISPLAY_LIMIT),_0x4c3c7c=/\bLIMIT\s+\d+/i[_0x463922(0x253)](_0x196a73);!_0x4c3c7c&&(_0x196a73=_0x196a73[_0x463922(0x1f3)]()[_0x463922(0x1e0)](/;+$/,''),_0x196a73=_0x463922(0x1ec)+_0x196a73+_0x463922(0x25d)+_0x240b0e);_0xbc7b6a[_0x463922(0x1d1)]&&console[_0x463922(0x248)](_0x463922(0x21a)+_0x196a73);const _0x113d0d=await withQuerySpinner('Executing\x20segment\x20query...',async _0x5cc080=>{const _0x2de917=_0x463922,_0x372fbe=await _0x1bc033[_0x2de917(0x1e6)][_0x2de917(0x1ed)](_0x196a73,{'catalog':'td','schema':_0x2de917(0x241),'onJobId':_0x57931d=>{_0x5cc080['setJobId'](_0x57931d);}});return _0x372fbe;},{'verbose':_0xbc7b6a[_0x463922(0x1d1)]}),_0x265191=_0x113d0d[_0x463922(0x1fe)],_0xd9fbdf=_0x265191[_0x463922(0x203)]?_0x463922(0x1d3)+_0x265191[_0x463922(0x203)]+']':'';return console[_0x463922(0x248)](_0x463922(0x252)+_0x265191['stats'][_0x463922(0x26c)][_0x463922(0x20e)]()+_0x463922(0x216)+(_0x463922(0x26e)+formatElapsed(_0x265191[_0x463922(0x230)]['elapsedTimeMillis'])+_0xd9fbdf)),await handleQueryOutput(_0x265191,_0xbc7b6a),0x0;}catch(_0x3c1726){if(_0x3c1726 instanceof SDKError)return console[_0x463922(0x248)](_0x463922(0x242)+_0x3c1726['code']+']'),console['error']('\x0a'+_0x3c1726[_0x463922(0x200)]),0x1;throw _0x3c1726;}}}export class SegmentFolderListCommand extends BaseCommand{[a32_0x22f685(0x266)]=a32_0x22f685(0x226);['description']=a32_0x22f685(0x234);async[a32_0x22f685(0x1ed)](_0x48237b){const _0x59c631=a32_0x22f685,{options:_0x55e24c,args:_0x531f80,tdx:_0x3a0d20}=_0x48237b;if(_0x531f80['length']===0x0)return console[_0x59c631(0x248)](_0x59c631(0x244)),console[_0x59c631(0x248)](_0x59c631(0x269)),0x1;const _0x2b0cc5=_0x531f80[0x0];try{_0x55e24c[_0x59c631(0x1d1)]&&(console['error'](_0x59c631(0x1e7)+_0x55e24c[_0x59c631(0x1d5)]),console[_0x59c631(0x248)](_0x59c631(0x1db)+_0x2b0cc5));const _0x295fb6=await withSpinner(_0x59c631(0x1dc)+_0x2b0cc5+_0x59c631(0x21c),()=>_0x3a0d20[_0x59c631(0x24d)]['resolveParentId'](_0x2b0cc5),{'verbose':_0x55e24c[_0x59c631(0x1d1)]}),_0x55ed2a=_0x295fb6[_0x59c631(0x1fe)];_0x55e24c[_0x59c631(0x1d1)]&&console[_0x59c631(0x248)]('Resolved\x20parent\x20ID:\x20'+_0x55ed2a);const _0x174fe1=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x2b0cc5+_0x59c631(0x21c),()=>_0x3a0d20[_0x59c631(0x24d)][_0x59c631(0x20c)](_0x55ed2a),{'verbose':_0x55e24c[_0x59c631(0x1d1)]}),_0x42973b=_0x174fe1[_0x59c631(0x1fe)];return console['error'](_0x59c631(0x249)+_0x42973b[_0x59c631(0x25b)]+_0x59c631(0x24f)+(_0x42973b['length']!==0x1?'s':'')),await handleSDKOutput(_0x42973b,_0x55e24c),0x0;}catch(_0x5572bc){if(_0x5572bc instanceof SDKError)return console[_0x59c631(0x248)](_0x59c631(0x254)+_0x5572bc[_0x59c631(0x200)]),_0x5572bc[_0x59c631(0x1ff)]&&console[_0x59c631(0x248)](_0x59c631(0x1d0)+_0x5572bc[_0x59c631(0x1ff)]),0x1;throw _0x5572bc;}}}export class SegmentFolderShowCommand extends BaseCommand{[a32_0x22f685(0x266)]='segment:folder:show';[a32_0x22f685(0x202)]=a32_0x22f685(0x209);async[a32_0x22f685(0x1ed)](_0xc53fad){const _0x36113b=a32_0x22f685,{options:_0x34093e,args:_0x9eba61,tdx:_0x232c74}=_0xc53fad;if(_0x9eba61[_0x36113b(0x25b)]===0x0)return console['error'](_0x36113b(0x250)),console[_0x36113b(0x248)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x30520f,childId:_0x1f44de}=parseSegmentRef(_0x9eba61[0x0]);_0x34093e[_0x36113b(0x1d1)]&&(console['error'](_0x36113b(0x1e7)+_0x34093e[_0x36113b(0x1d5)]),console[_0x36113b(0x248)]('Parent\x20name:\x20'+_0x30520f),_0x1f44de&&console[_0x36113b(0x248)]('Folder\x20name:\x20'+_0x1f44de));if(!_0x1f44de)return console[_0x36113b(0x248)](_0x36113b(0x1f4)),0x1;const _0x2d33a9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x30520f+_0x36113b(0x21c),()=>_0x232c74[_0x36113b(0x24d)][_0x36113b(0x262)](_0x30520f),{'verbose':_0x34093e[_0x36113b(0x1d1)]}),_0x3bc630=_0x2d33a9[_0x36113b(0x1fe)];_0x34093e[_0x36113b(0x1d1)]&&console[_0x36113b(0x248)](_0x36113b(0x23c)+_0x3bc630);const _0x1c0e09=await withSpinner(_0x36113b(0x267)+_0x1f44de+_0x36113b(0x21c),()=>_0x232c74['segment'][_0x36113b(0x1dd)](_0x3bc630,_0x1f44de),{'verbose':_0x34093e[_0x36113b(0x1d1)]}),_0x59f8f8=_0x1c0e09[_0x36113b(0x1fe)];_0x34093e[_0x36113b(0x1d1)]&&console[_0x36113b(0x248)](_0x36113b(0x227)+_0x59f8f8);const _0x55176c=await withSpinner(_0x36113b(0x25e)+_0x1f44de+_0x36113b(0x21c),()=>_0x232c74['segment'][_0x36113b(0x1df)](_0x59f8f8),{'verbose':_0x34093e['verbose']});return await handleSDKOutput([_0x55176c[_0x36113b(0x1fe)]],_0x34093e),0x0;}catch(_0x19935f){if(_0x19935f instanceof SDKError)return console[_0x36113b(0x248)]('Error:\x20'+_0x19935f['message']),_0x19935f[_0x36113b(0x1ff)]&&console[_0x36113b(0x248)](_0x36113b(0x1d0)+_0x19935f['cause']),0x1;throw _0x19935f;}}}export class SegmentSQLCommand extends BaseCommand{[a32_0x22f685(0x266)]=a32_0x22f685(0x261);[a32_0x22f685(0x202)]=a32_0x22f685(0x24e);async[a32_0x22f685(0x1ed)](_0x52e13a){const _0x12c69a=a32_0x22f685,{options:_0x5dcf9a,args:_0x44470f,tdx:_0x417ac6}=_0x52e13a,_0x1ad84c=_0x44470f[0x0];if(!_0x1ad84c)return console['error'](_0x12c69a(0x1d7)),console[_0x12c69a(0x248)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0x12c69a(0x248)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x12c69a(0x248)]('Examples:'),console[_0x12c69a(0x248)](_0x12c69a(0x245)),console[_0x12c69a(0x248)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x53f159=_0x5dcf9a[_0x12c69a(0x1f8)],_0x1d2a90=resolveSegmentTarget(_0x1ad84c,_0x53f159,_0x5dcf9a['verbose']);_0x5dcf9a[_0x12c69a(0x1d1)]&&console['error'](_0x12c69a(0x215)+_0x1d2a90);const _0x5162ab=await withSpinner(_0x12c69a(0x228)+_0x1ad84c+'\x27...',()=>_0x417ac6['segment'][_0x12c69a(0x265)](_0x1d2a90),{'verbose':_0x5dcf9a['verbose']}),_0x2c5aea=_0x5162ab['data'];_0x5dcf9a[_0x12c69a(0x1d1)]&&(console[_0x12c69a(0x248)](_0x12c69a(0x1f6)+_0x2c5aea['type']),console['error'](_0x12c69a(0x219)+_0x2c5aea[_0x12c69a(0x21e)]));if(_0x2c5aea[_0x12c69a(0x25c)]===_0x12c69a(0x231))return console[_0x12c69a(0x248)](_0x12c69a(0x240)),console[_0x12c69a(0x248)](_0x12c69a(0x23b)),0x1;if(_0x2c5aea[_0x12c69a(0x25c)]===_0x12c69a(0x23a))return console[_0x12c69a(0x248)](_0x12c69a(0x23d)),console[_0x12c69a(0x248)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x2c5aea['segmentId'])throw new SDKError(ErrorCode[_0x12c69a(0x20a)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5221d3=await withSpinner(_0x12c69a(0x264),()=>_0x417ac6[_0x12c69a(0x24d)]['getSegmentSQL'](_0x2c5aea[_0x12c69a(0x21e)],_0x2c5aea[_0x12c69a(0x247)]),{'verbose':_0x5dcf9a[_0x12c69a(0x1d1)]}),_0x48c0bd=_0x5221d3[_0x12c69a(0x1fe)];return _0x5dcf9a['format']===_0x12c69a(0x1fc)||_0x5dcf9a['format']===_0x12c69a(0x221)?await handleSDKOutput([{'sql':_0x48c0bd}],_0x5dcf9a):console[_0x12c69a(0x20f)](_0x48c0bd),0x0;}catch(_0x34857c){if(_0x34857c instanceof SDKError)return console['error'](_0x12c69a(0x254)+_0x34857c['message']),_0x34857c[_0x12c69a(0x1ff)]&&console[_0x12c69a(0x248)]('\x20\x20Cause:\x20'+_0x34857c[_0x12c69a(0x1ff)]),0x1;throw _0x34857c;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a32_0x22f685(0x1f2);['description']=a32_0x22f685(0x263);async[a32_0x22f685(0x1ed)](_0x48ce56){const _0x67942d=a32_0x22f685,{options:_0x3aeacd,args:_0x1f1087,tdx:_0x25437f}=_0x48ce56,_0x216e39=_0x3aeacd;if(_0x1f1087[_0x67942d(0x25b)]<0x2)return console['error'](_0x67942d(0x1e3)),console[_0x67942d(0x248)](_0x67942d(0x208)),0x1;const _0x4a839b=_0x1f1087[0x0],_0x1fa298=_0x1f1087[0x1];_0x216e39[_0x67942d(0x1d1)]&&(console[_0x67942d(0x248)](_0x67942d(0x1e7)+_0x216e39[_0x67942d(0x1d5)]),console[_0x67942d(0x248)]('Parent\x20segment:\x20'+_0x4a839b),console[_0x67942d(0x248)]('Folder\x20name:\x20'+_0x1fa298));let _0x4ee1af;if(_0x216e39[_0x67942d(0x20b)]){const _0x140b76=_0x216e39[_0x67942d(0x20b)],_0x19085e=await withSpinner(_0x67942d(0x1dc)+_0x4a839b+_0x67942d(0x21c),()=>_0x25437f[_0x67942d(0x24d)][_0x67942d(0x262)](_0x4a839b),{'verbose':_0x216e39[_0x67942d(0x1d1)]}),_0x144b1d=_0x19085e[_0x67942d(0x1fe)],_0x27fa7b=await withSpinner(_0x67942d(0x237)+_0x140b76+_0x67942d(0x21c),()=>_0x25437f[_0x67942d(0x24d)]['resolveFolderId'](_0x144b1d,_0x140b76),{'verbose':_0x216e39[_0x67942d(0x1d1)]});_0x4ee1af=_0x27fa7b[_0x67942d(0x1fe)],_0x216e39[_0x67942d(0x1d1)]&&console[_0x67942d(0x248)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x4ee1af);}const _0x2afce6={'name':_0x1fa298,'description':_0x216e39[_0x67942d(0x202)],'parentFolderId':_0x4ee1af},_0x8cd354=await withSpinner(_0x67942d(0x1f7)+_0x1fa298+_0x67942d(0x21c),()=>_0x25437f['segment'][_0x67942d(0x25a)](_0x4a839b,_0x2afce6),{'verbose':_0x216e39[_0x67942d(0x1d1)]}),_0xe3491c=_0x8cd354[_0x67942d(0x1fe)];return console[_0x67942d(0x248)](_0x67942d(0x257)+_0xe3491c[_0x67942d(0x266)]+_0x67942d(0x21b)+_0xe3491c['id']),await handleSDKOutput([_0xe3491c],_0x216e39),0x0;}}export class SegmentViewCommand extends BaseCommand{[a32_0x22f685(0x266)]=a32_0x22f685(0x232);[a32_0x22f685(0x202)]=a32_0x22f685(0x22b);async['execute'](_0x555c00){const _0x4f6937=a32_0x22f685,{options:_0x4bea07,args:_0x1ae342,tdx:_0x4c1618}=_0x555c00,_0x1ba7e1=_0x1ae342[0x0];if(!_0x1ba7e1)return console[_0x4f6937(0x248)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x4f6937(0x248)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console['error'](_0x4f6937(0x21f)),console['error']('Options:'),console[_0x4f6937(0x248)](_0x4f6937(0x22c)),console[_0x4f6937(0x248)](_0x4f6937(0x1f5)),console['error'](_0x4f6937(0x204)),console[_0x4f6937(0x248)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x4f6937(0x248)](_0x4f6937(0x22a)),console['error'](_0x4f6937(0x1d6)),0x1;try{const _0x5a86ba=_0x4bea07['parentSegment'],_0x2d788f=resolveSegmentTarget(_0x1ba7e1,_0x5a86ba,_0x4bea07[_0x4f6937(0x1d1)]);_0x4bea07[_0x4f6937(0x1d1)]&&console[_0x4f6937(0x248)](_0x4f6937(0x215)+_0x2d788f);const _0x563a17=await withSpinner('Resolving\x20\x27'+_0x1ba7e1+_0x4f6937(0x21c),()=>_0x4c1618[_0x4f6937(0x24d)][_0x4f6937(0x265)](_0x2d788f),{'verbose':_0x4bea07[_0x4f6937(0x1d1)]}),_0x5f55ee=_0x563a17['data'];_0x4bea07[_0x4f6937(0x1d1)]&&(console['error']('Resolved\x20type:\x20'+_0x5f55ee[_0x4f6937(0x25c)]),console['error'](_0x4f6937(0x219)+_0x5f55ee[_0x4f6937(0x21e)]),_0x5f55ee[_0x4f6937(0x255)]&&console[_0x4f6937(0x248)]('Folder\x20ID:\x20'+_0x5f55ee[_0x4f6937(0x255)]),_0x5f55ee['segmentId']&&console[_0x4f6937(0x248)](_0x4f6937(0x1d2)+_0x5f55ee[_0x4f6937(0x247)]));if(_0x4bea07[_0x4f6937(0x1e2)]){if(_0x5f55ee[_0x4f6937(0x25c)]===_0x4f6937(0x231))return console[_0x4f6937(0x248)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x5f55ee[_0x4f6937(0x25c)]===_0x4f6937(0x23a))return console[_0x4f6937(0x248)](_0x4f6937(0x260)),console[_0x4f6937(0x248)](_0x4f6937(0x1e4)),0x1;if(!_0x5f55ee[_0x4f6937(0x247)])throw new SDKError(ErrorCode[_0x4f6937(0x20a)],_0x4f6937(0x224));const _0x38718a=getConsoleNextUrl(_0x4bea07[_0x4f6937(0x1d5)],_0x4f6937(0x235)+_0x5f55ee[_0x4f6937(0x21e)]+'/e/'+_0x5f55ee[_0x4f6937(0x247)]);return console['error'](a32_0x10f154['green']('✔')+_0x4f6937(0x1fb)+a32_0x10f154[_0x4f6937(0x212)](_0x38718a)),openBrowser(_0x38718a),0x0;}if(_0x5f55ee['type']===_0x4f6937(0x231)){if(!_0x5f55ee[_0x4f6937(0x255)])throw new SDKError(ErrorCode[_0x4f6937(0x25f)],_0x4f6937(0x258));const _0x9c6178=await withSpinner(_0x4f6937(0x213),()=>_0x4c1618[_0x4f6937(0x24d)][_0x4f6937(0x1df)](_0x5f55ee[_0x4f6937(0x255)]),{'verbose':_0x4bea07[_0x4f6937(0x1d1)]});await handleSingleObjectOutput(_0x9c6178[_0x4f6937(0x1fe)],_0x4bea07);}else{if(_0x5f55ee[_0x4f6937(0x25c)]===_0x4f6937(0x24d)){if(!_0x5f55ee[_0x4f6937(0x247)])throw new SDKError(ErrorCode[_0x4f6937(0x20a)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x17a0c8=await withSpinner(_0x4f6937(0x259),()=>_0x4c1618[_0x4f6937(0x24d)][_0x4f6937(0x26d)](_0x5f55ee[_0x4f6937(0x21e)],_0x5f55ee[_0x4f6937(0x247)]),{'verbose':_0x4bea07[_0x4f6937(0x1d1)]}),_0x19aa1d=getConsoleNextUrl(_0x4bea07[_0x4f6937(0x1d5)],_0x4f6937(0x235)+_0x5f55ee['parentId']+_0x4f6937(0x1ef)+_0x5f55ee[_0x4f6937(0x247)]),_0x52013e=_0x17a0c8[_0x4f6937(0x1fe)];_0x52013e[_0x4f6937(0x223)]=_0x19aa1d,await handleSingleObjectOutput(_0x52013e,_0x4bea07);}else return console[_0x4f6937(0x248)](_0x4f6937(0x217)),console[_0x4f6937(0x248)](_0x4f6937(0x1e5)),0x1;}return 0x0;}catch(_0x2befa2){if(_0x2befa2 instanceof SDKError)return console[_0x4f6937(0x248)](_0x4f6937(0x254)+_0x2befa2[_0x4f6937(0x200)]),_0x2befa2['cause']&&console[_0x4f6937(0x248)](_0x4f6937(0x1d0)+_0x2befa2[_0x4f6937(0x1ff)]),0x1;throw _0x2befa2;}}}function a32_0xdd02(_0x5ebce1,_0x1556c9){_0x5ebce1=_0x5ebce1-0x1cf;const _0xf35816=a32_0xf358();let _0xdd02af=_0xf35816[_0x5ebce1];return _0xdd02af;}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a32_0x22f685(0x266)]=a32_0x22f685(0x23e);[a32_0x22f685(0x202)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a32_0x22f685(0x1ed)](_0x23ebcd){const _0x4d750c=a32_0x22f685,{options:_0x58c3d9,args:_0x30459e,tdx:_0x2e8548}=_0x23ebcd,_0xee0f79=_0x30459e[0x0];if(!_0xee0f79)return console[_0x4d750c(0x248)](_0x4d750c(0x1d7)),console['error'](_0x4d750c(0x210)),console[_0x4d750c(0x248)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console['error']('Examples:'),console['error'](_0x4d750c(0x22f)),console[_0x4d750c(0x248)](_0x4d750c(0x1fa)),0x1;try{const _0x4c7431=_0x58c3d9[_0x4d750c(0x1f8)],_0x387f0b=resolveSegmentTarget(_0xee0f79,_0x4c7431,_0x58c3d9[_0x4d750c(0x1d1)]);_0x58c3d9[_0x4d750c(0x1d1)]&&console[_0x4d750c(0x248)]('Target\x20path:\x20'+_0x387f0b);const _0x3d1090=await withSpinner(_0x4d750c(0x228)+_0xee0f79+_0x4d750c(0x21c),()=>_0x2e8548[_0x4d750c(0x24d)][_0x4d750c(0x265)](_0x387f0b),{'verbose':_0x58c3d9['verbose']}),_0x3e6ada=_0x3d1090[_0x4d750c(0x1fe)];_0x58c3d9[_0x4d750c(0x1d1)]&&(console[_0x4d750c(0x248)](_0x4d750c(0x1f6)+_0x3e6ada['type']),console[_0x4d750c(0x248)](_0x4d750c(0x219)+_0x3e6ada['parentId']));if(_0x3e6ada[_0x4d750c(0x25c)]===_0x4d750c(0x231))return console['error'](_0x4d750c(0x214)),console['error'](_0x4d750c(0x23b)),0x1;if(_0x3e6ada['type']===_0x4d750c(0x23a))return console['error'](_0x4d750c(0x206)),console[_0x4d750c(0x248)](_0x4d750c(0x21d)),0x1;if(!_0x3e6ada[_0x4d750c(0x247)])throw new SDKError(ErrorCode[_0x4d750c(0x20a)],_0x4d750c(0x224));const _0x3374b7=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2e8548[_0x4d750c(0x24d)][_0x4d750c(0x201)](_0x3e6ada['parentId'],_0x3e6ada[_0x4d750c(0x247)]),{'verbose':_0x58c3d9['verbose']}),_0x545537=_0x3374b7[_0x4d750c(0x1fe)],_0x4cb884=await executeSchemaQuery(_0x545537,_0x2e8548,_0x58c3d9);return await handleQueryOutput(_0x4cb884,_0x58c3d9),0x0;}catch(_0x252b77){if(_0x252b77 instanceof SDKError)return console[_0x4d750c(0x248)](_0x4d750c(0x254)+_0x252b77[_0x4d750c(0x200)]),_0x252b77[_0x4d750c(0x1ff)]&&console[_0x4d750c(0x248)](_0x4d750c(0x1d0)+_0x252b77[_0x4d750c(0x1ff)]),0x1;throw _0x252b77;}}}
@@ -1 +1 @@
1
- const a33_0x252783=a33_0x49e1;(function(_0x4e5308,_0x1fa83f){const _0x3034d3=a33_0x49e1,_0x424687=_0x4e5308();while(!![]){try{const _0x2ca0b2=parseInt(_0x3034d3(0xcc))/0x1*(parseInt(_0x3034d3(0xa9))/0x2)+-parseInt(_0x3034d3(0x9f))/0x3+parseInt(_0x3034d3(0xb7))/0x4*(parseInt(_0x3034d3(0xb6))/0x5)+-parseInt(_0x3034d3(0xaa))/0x6*(-parseInt(_0x3034d3(0xa6))/0x7)+parseInt(_0x3034d3(0xba))/0x8*(parseInt(_0x3034d3(0xb4))/0x9)+-parseInt(_0x3034d3(0x9c))/0xa*(parseInt(_0x3034d3(0xc6))/0xb)+-parseInt(_0x3034d3(0xd9))/0xc*(parseInt(_0x3034d3(0xad))/0xd);if(_0x2ca0b2===_0x1fa83f)break;else _0x424687['push'](_0x424687['shift']());}catch(_0x27cb38){_0x424687['push'](_0x424687['shift']());}}}(a33_0x3844,0xcc528));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a33_0x49e1(_0x1b0847,_0x5c107d){_0x1b0847=_0x1b0847-0x9c;const _0x3844ec=a33_0x3844();let _0x49e142=_0x3844ec[_0x1b0847];return _0x49e142;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a33_0x3dc2a5 from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a33_0x252783(0xbb);[a33_0x252783(0xcd)]=a33_0x252783(0xab);async[a33_0x252783(0xc0)](_0x3a1f56){const _0x49fb3a=a33_0x252783;console[_0x49fb3a(0xce)](a33_0x3dc2a5[_0x49fb3a(0xb0)](_0x49fb3a(0xd0))),console['error'](a33_0x3dc2a5[_0x49fb3a(0xb0)](_0x49fb3a(0xa2)));const {options:_0x140ac8,args:_0x462ddd,tdx:_0x408b14}=_0x3a1f56,_0xb914f7=_0x140ac8;if(_0x462ddd[_0x49fb3a(0xa0)]===0x0)return console[_0x49fb3a(0xce)](_0x49fb3a(0xcb)),console[_0x49fb3a(0xce)](_0x49fb3a(0xc5)),console[_0x49fb3a(0xce)](_0x49fb3a(0xd2)),console['error'](_0x49fb3a(0xc1)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x49fb3a(0xce)](_0x49fb3a(0xb1)),0x1;const _0x4dc331=_0x462ddd[0x0],_0x432f23=_0x140ac8[_0x49fb3a(0xbd)];let _0x2dfa11=_0x4dc331;_0x432f23&&!_0x4dc331[_0x49fb3a(0xd7)]('/')&&(_0x2dfa11=_0x432f23+'/'+_0x4dc331,_0xb914f7[_0x49fb3a(0xac)]&&console[_0x49fb3a(0xce)](_0x49fb3a(0xae)+_0x2dfa11));const _0x5bd8e9=parsePath(_0x2dfa11);if(_0x5bd8e9[_0x49fb3a(0xd5)][_0x49fb3a(0xa0)]<0x2)return console['error'](_0x49fb3a(0xbc)),console[_0x49fb3a(0xce)](_0x49fb3a(0xd6)),0x1;const _0x36b3a3=_0x5bd8e9[_0x49fb3a(0xd5)][0x0],_0x52a761=getBaseName(_0x2dfa11),_0x464cea=getParentPath(_0x2dfa11);_0xb914f7['verbose']&&(console[_0x49fb3a(0xce)]('Site:\x20'+_0xb914f7[_0x49fb3a(0xcf)]),console['error'](_0x49fb3a(0xa8)+_0x2dfa11),console[_0x49fb3a(0xce)](_0x49fb3a(0xa7)+_0x36b3a3),console[_0x49fb3a(0xce)](_0x49fb3a(0xa5)+_0x52a761),console[_0x49fb3a(0xce)](_0x49fb3a(0xc2)+_0x464cea));const _0x10c979=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x36b3a3+_0x49fb3a(0xd4),()=>_0x408b14[_0x49fb3a(0xd1)][_0x49fb3a(0xa3)](_0x36b3a3),{'verbose':_0xb914f7[_0x49fb3a(0xac)]}),_0x11547f=_0x10c979[_0x49fb3a(0xc8)];let _0x29cdb2;if(_0x5bd8e9[_0x49fb3a(0xd5)][_0x49fb3a(0xa0)]>0x2){const _0x287be8=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x464cea+_0x49fb3a(0xd4),()=>_0x408b14[_0x49fb3a(0xd1)][_0x49fb3a(0xca)](_0x464cea),{'verbose':_0xb914f7[_0x49fb3a(0xac)]}),_0x323c98=_0x287be8['data'];if(_0x323c98[_0x49fb3a(0xc3)]!==_0x49fb3a(0xc9)&&_0x323c98[_0x49fb3a(0xc3)]!==_0x49fb3a(0xc7))return console[_0x49fb3a(0xce)](_0x49fb3a(0x9e)),0x1;_0x29cdb2=_0x323c98[_0x49fb3a(0xbf)];}else{if(_0xb914f7['folder']){const _0xa395e3=await withSpinner(_0x49fb3a(0xaf)+_0xb914f7[_0x49fb3a(0xc9)]+'\x27...',()=>_0x408b14['segment'][_0x49fb3a(0x9d)](_0x11547f,_0xb914f7[_0x49fb3a(0xc9)]),{'verbose':_0xb914f7[_0x49fb3a(0xac)]});_0x29cdb2=_0xa395e3['data'];}}_0xb914f7[_0x49fb3a(0xac)]&&_0x29cdb2&&console[_0x49fb3a(0xce)](_0x49fb3a(0xb9)+_0x29cdb2);const _0x29d470=await loadJSONFromOptions(_0xb914f7[_0x49fb3a(0xb5)],_0xb914f7[_0x49fb3a(0xd3)]),_0x5ba15d={'name':_0x52a761,'description':_0xb914f7[_0x49fb3a(0xcd)],'rule':_0x29d470,'kind':_0xb914f7[_0x49fb3a(0xbe)]!==undefined?parseInt(_0xb914f7['kind'],0xa):undefined,'isVisible':_0xb914f7[_0x49fb3a(0xd8)]?![]:undefined,'segmentFolderId':_0x29cdb2,'countPopulation':_0xb914f7[_0x49fb3a(0xb2)]?![]:undefined},_0x22d7a0=await withSpinner(_0x49fb3a(0xa4)+_0x52a761+'\x27...',()=>_0x408b14[_0x49fb3a(0xd1)]['createSegment'](_0x11547f,_0x5ba15d),{'verbose':_0xb914f7['verbose']}),_0x50f408=_0x22d7a0[_0x49fb3a(0xc8)];return console['error'](_0x49fb3a(0xc4)+_0x50f408[_0x49fb3a(0xb8)]+_0x49fb3a(0xb3)+_0x50f408['id']),_0x2dfa11!==_0x4dc331&&console['error'](_0x49fb3a(0xa1)+_0x2dfa11),await handleSDKOutput([_0x50f408],_0xb914f7),0x0;}}function a33_0x3844(){const _0xd18ac=['2939718hWedVC','length','\x20\x20\x20Path:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','resolveParentId','Creating\x20segment\x20\x27','Segment\x20name:\x20','1491QsFHix','Parent:\x20','Target\x20path:\x20','4eZmxzy','42918bwaJrK','Create\x20child\x20segment\x20with\x20filtering\x20rules','verbose','247pQbwGV','Resolved\x20relative\x20path\x20to:\x20','Resolving\x20folder\x20\x27','yellow','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','noCountPopulation','\x27\x20with\x20ID:\x20','261ACuhIq','rule','20TUdcty','1671176kLZGgY','name','Resolved\x20folder\x20ID:\x20','421712RDtrHa','segment:create','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segmentPath','kind','folderId','execute','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Parent\x20path:\x20','type','✔\x20Created\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','66IrYJJP','parent','data','folder','resolvePathToResource','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','371519CqZtRu','description','error','site','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','segment','Examples:','ruleFile','\x27...','segments','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','includes','invisible','2286300MhLolN','49540kGGNSZ','resolveFolderId','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'];a33_0x3844=function(){return _0xd18ac;};return a33_0x3844();}
1
+ const a33_0xcd98e8=a33_0x49d3;(function(_0x3a32c3,_0x466eed){const _0x116529=a33_0x49d3,_0x4b67a5=_0x3a32c3();while(!![]){try{const _0x308a90=-parseInt(_0x116529(0x157))/0x1+-parseInt(_0x116529(0x18b))/0x2*(-parseInt(_0x116529(0x167))/0x3)+parseInt(_0x116529(0x166))/0x4+-parseInt(_0x116529(0x159))/0x5*(parseInt(_0x116529(0x17a))/0x6)+-parseInt(_0x116529(0x18a))/0x7+parseInt(_0x116529(0x175))/0x8*(-parseInt(_0x116529(0x177))/0x9)+parseInt(_0x116529(0x168))/0xa*(parseInt(_0x116529(0x179))/0xb);if(_0x308a90===_0x466eed)break;else _0x4b67a5['push'](_0x4b67a5['shift']());}catch(_0x2b5620){_0x4b67a5['push'](_0x4b67a5['shift']());}}}(a33_0x27b6,0x1ce2f));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a33_0x27b6(){const _0x4814c6=['description','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','resolveFolderId','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolved\x20folder\x20ID:\x20','72ZRwguj','name','48123dqoEcU','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','11EHwAXJ','1098nLOizy','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','resolvePathToResource','site','segment:create','noCountPopulation','data','type','invisible','error','folderId','\x27...','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','parent','279293negtjP','12jnqVFc','122225XjFGjw','Creating\x20segment\x20\x27','2845lUUMgn','Site:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Target\x20path:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolved\x20relative\x20path\x20to:\x20','segment','Parent\x20path:\x20','includes','rule','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','verbose','kind','213264pnYSep','15585dFAXPf','3482070CdoMei','Resolving\x20folder\x20path\x20\x27','execute','segments','folder','yellow'];a33_0x27b6=function(){return _0x4814c6;};return a33_0x27b6();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a33_0x49d3(_0x22a4c2,_0x1e2790){_0x22a4c2=_0x22a4c2-0x157;const _0x27b625=a33_0x27b6();let _0x49d392=_0x27b625[_0x22a4c2];return _0x49d392;}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a33_0x357805 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a33_0xcd98e8(0x176)]=a33_0xcd98e8(0x180);[a33_0xcd98e8(0x16e)]=a33_0xcd98e8(0x15d);async[a33_0xcd98e8(0x16a)](_0xe276b7){const _0x1c62b3=a33_0xcd98e8;console['error'](a33_0x357805[_0x1c62b3(0x16d)](_0x1c62b3(0x188))),console['error'](a33_0x357805['yellow'](_0x1c62b3(0x17d)));const {options:_0x5b39c6,args:_0x45726c,tdx:_0x34832f}=_0xe276b7,_0x57b967=_0x5b39c6;if(_0x45726c['length']===0x0)return console['error'](_0x1c62b3(0x15b)),console['error'](_0x1c62b3(0x178)),console[_0x1c62b3(0x185)]('Examples:'),console[_0x1c62b3(0x185)](_0x1c62b3(0x17c)),console[_0x1c62b3(0x185)](_0x1c62b3(0x173)),console['error'](_0x1c62b3(0x171)),0x1;const _0x58ff4c=_0x45726c[0x0],_0x170b5a=_0x5b39c6['segmentPath'];let _0x27f613=_0x58ff4c;_0x170b5a&&!_0x58ff4c[_0x1c62b3(0x161)]('/')&&(_0x27f613=_0x170b5a+'/'+_0x58ff4c,_0x57b967['verbose']&&console[_0x1c62b3(0x185)](_0x1c62b3(0x15e)+_0x27f613));const _0x315ede=parsePath(_0x27f613);if(_0x315ede[_0x1c62b3(0x16b)]['length']<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x1c62b3(0x185)](_0x1c62b3(0x163)),0x1;const _0x7730c3=_0x315ede[_0x1c62b3(0x16b)][0x0],_0x4d658d=getBaseName(_0x27f613),_0x2af671=getParentPath(_0x27f613);_0x57b967[_0x1c62b3(0x164)]&&(console[_0x1c62b3(0x185)](_0x1c62b3(0x15a)+_0x57b967[_0x1c62b3(0x17f)]),console['error'](_0x1c62b3(0x15c)+_0x27f613),console['error']('Parent:\x20'+_0x7730c3),console[_0x1c62b3(0x185)]('Segment\x20name:\x20'+_0x4d658d),console['error'](_0x1c62b3(0x160)+_0x2af671));const _0x33723a=await withSpinner(_0x1c62b3(0x172)+_0x7730c3+_0x1c62b3(0x187),()=>_0x34832f['segment']['resolveParentId'](_0x7730c3),{'verbose':_0x57b967[_0x1c62b3(0x164)]}),_0x2da8a2=_0x33723a[_0x1c62b3(0x182)];let _0x31ca98;if(_0x315ede[_0x1c62b3(0x16b)]['length']>0x2){const _0x446681=await withSpinner(_0x1c62b3(0x169)+_0x2af671+_0x1c62b3(0x187),()=>_0x34832f[_0x1c62b3(0x15f)][_0x1c62b3(0x17e)](_0x2af671),{'verbose':_0x57b967[_0x1c62b3(0x164)]}),_0x4b4bb3=_0x446681[_0x1c62b3(0x182)];if(_0x4b4bb3[_0x1c62b3(0x183)]!=='folder'&&_0x4b4bb3[_0x1c62b3(0x183)]!==_0x1c62b3(0x189))return console['error'](_0x1c62b3(0x16f)),0x1;_0x31ca98=_0x4b4bb3[_0x1c62b3(0x186)];}else{if(_0x57b967['folder']){const _0x244c89=await withSpinner('Resolving\x20folder\x20\x27'+_0x57b967['folder']+_0x1c62b3(0x187),()=>_0x34832f[_0x1c62b3(0x15f)][_0x1c62b3(0x170)](_0x2da8a2,_0x57b967[_0x1c62b3(0x16c)]),{'verbose':_0x57b967[_0x1c62b3(0x164)]});_0x31ca98=_0x244c89[_0x1c62b3(0x182)];}}_0x57b967[_0x1c62b3(0x164)]&&_0x31ca98&&console[_0x1c62b3(0x185)](_0x1c62b3(0x174)+_0x31ca98);const _0x1d01c0=await loadJSONFromOptions(_0x57b967[_0x1c62b3(0x162)],_0x57b967['ruleFile']),_0x110eb2={'name':_0x4d658d,'description':_0x57b967[_0x1c62b3(0x16e)],'rule':_0x1d01c0,'kind':_0x57b967[_0x1c62b3(0x165)]!==undefined?parseInt(_0x57b967[_0x1c62b3(0x165)],0xa):undefined,'isVisible':_0x57b967[_0x1c62b3(0x184)]?![]:undefined,'segmentFolderId':_0x31ca98,'countPopulation':_0x57b967[_0x1c62b3(0x181)]?![]:undefined},_0x2d6fea=await withSpinner(_0x1c62b3(0x158)+_0x4d658d+_0x1c62b3(0x187),()=>_0x34832f[_0x1c62b3(0x15f)]['createSegment'](_0x2da8a2,_0x110eb2),{'verbose':_0x57b967['verbose']}),_0x552b14=_0x2d6fea[_0x1c62b3(0x182)];return console[_0x1c62b3(0x185)]('✔\x20Created\x20segment\x20\x27'+_0x552b14[_0x1c62b3(0x176)]+_0x1c62b3(0x17b)+_0x552b14['id']),_0x27f613!==_0x58ff4c&&console['error']('\x20\x20\x20Path:\x20'+_0x27f613),await handleSDKOutput([_0x552b14],_0x57b967),0x0;}}
@@ -1 +1 @@
1
- const a34_0xc8407c=a34_0xc464;(function(_0x126f85,_0x567b4f){const _0x2194f7=a34_0xc464,_0x56123f=_0x126f85();while(!![]){try{const _0x568d88=parseInt(_0x2194f7(0xe2))/0x1*(parseInt(_0x2194f7(0xfa))/0x2)+parseInt(_0x2194f7(0xe3))/0x3+parseInt(_0x2194f7(0xe6))/0x4+parseInt(_0x2194f7(0xe7))/0x5+parseInt(_0x2194f7(0xf1))/0x6*(-parseInt(_0x2194f7(0xf5))/0x7)+parseInt(_0x2194f7(0xe9))/0x8+-parseInt(_0x2194f7(0xf0))/0x9;if(_0x568d88===_0x567b4f)break;else _0x56123f['push'](_0x56123f['shift']());}catch(_0x47c95a){_0x56123f['push'](_0x56123f['shift']());}}}(a34_0x2c34,0xd10b3));function a34_0xc464(_0x478e99,_0x47c646){_0x478e99=_0x478e99-0xdf;const _0x2c3416=a34_0x2c34();let _0xc464fb=_0x2c3416[_0x478e99];return _0xc464fb;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a34_0xc8407c(0xe0)]='segment:fields';[a34_0xc8407c(0xf8)]=a34_0xc8407c(0xeb);async[a34_0xc8407c(0xee)](_0x243cd4){const _0x3a71ae=a34_0xc8407c,{options:_0x14f99a,args:_0x22081b,tdx:_0x6838df}=_0x243cd4,_0x3b8e34=_0x22081b[0x0]||_0x14f99a[_0x3a71ae(0xf3)];if(!_0x3b8e34)return console[_0x3a71ae(0xed)](_0x3a71ae(0xec)),console[_0x3a71ae(0xed)](_0x3a71ae(0xe1)),console[_0x3a71ae(0xed)](_0x3a71ae(0xf2)),0x1;_0x14f99a[_0x3a71ae(0xf4)]&&(console['error'](_0x3a71ae(0xe8)+_0x14f99a['site']),console[_0x3a71ae(0xed)](_0x3a71ae(0xef)+_0x3b8e34));const _0x3ed610=await withSpinner(_0x3a71ae(0xea)+_0x3b8e34+_0x3a71ae(0xe4),()=>_0x6838df[_0x3a71ae(0xf6)]['listFields'](_0x3b8e34),{'verbose':_0x14f99a[_0x3a71ae(0xf4)]}),_0x28951b=_0x3ed610[_0x3a71ae(0xe5)];console[_0x3a71ae(0xed)]('✔\x20Found\x20'+_0x28951b[_0x3a71ae(0xf7)]+_0x3a71ae(0xdf)+(_0x28951b[_0x3a71ae(0xf7)]!==0x1?'s':''));if(_0x14f99a['json']||_0x14f99a[_0x3a71ae(0xf9)])return await handleSDKOutput(_0x28951b,_0x14f99a),0x0;return displayFieldsHumanReadable(_0x28951b,_0x3b8e34),0x0;}}function a34_0x2c34(){const _0x377523=['\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parentSegment','verbose','42QbmSwb','segment','length','description','jsonl','144770YMZkFz','\x20field','name','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','11hhcUwp','2956539BlzVlD','\x27...','data','4772804dAKVOo','7784590zIFYXp','Site:\x20','11536744mIgbdE','Listing\x20fields\x20for\x20\x27','List\x20available\x20fields\x20for\x20segmentation','Error:\x20Parent\x20segment\x20name\x20is\x20required','error','execute','Parent\x20segment:\x20','31882347hqvNSq','1575234TALpsv'];a34_0x2c34=function(){return _0x377523;};return a34_0x2c34();}
1
+ const a34_0x25297a=a34_0x5028;(function(_0x213456,_0x5917cc){const _0x19ca7c=a34_0x5028,_0x4dce49=_0x213456();while(!![]){try{const _0x5a8f1b=-parseInt(_0x19ca7c(0x168))/0x1*(-parseInt(_0x19ca7c(0x154))/0x2)+parseInt(_0x19ca7c(0x15d))/0x3*(-parseInt(_0x19ca7c(0x157))/0x4)+parseInt(_0x19ca7c(0x167))/0x5*(parseInt(_0x19ca7c(0x165))/0x6)+-parseInt(_0x19ca7c(0x15c))/0x7+-parseInt(_0x19ca7c(0x152))/0x8*(parseInt(_0x19ca7c(0x156))/0x9)+parseInt(_0x19ca7c(0x14d))/0xa*(-parseInt(_0x19ca7c(0x155))/0xb)+parseInt(_0x19ca7c(0x14e))/0xc*(parseInt(_0x19ca7c(0x163))/0xd);if(_0x5a8f1b===_0x5917cc)break;else _0x4dce49['push'](_0x4dce49['shift']());}catch(_0x21969a){_0x4dce49['push'](_0x4dce49['shift']());}}}(a34_0x13c9,0x89501));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';function a34_0x5028(_0x1be987,_0x5da407){_0x1be987=_0x1be987-0x14b;const _0x13c9f3=a34_0x13c9();let _0x5028a7=_0x13c9f3[_0x1be987];return _0x5028a7;}export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';[a34_0x25297a(0x14f)]=a34_0x25297a(0x14c);async[a34_0x25297a(0x158)](_0x5b0395){const _0x17c08f=a34_0x25297a,{options:_0x3ea955,args:_0x496e0f,tdx:_0x1044a9}=_0x5b0395,_0x3cd823=_0x496e0f[0x0]||_0x3ea955[_0x17c08f(0x15e)];if(!_0x3cd823)return console['error'](_0x17c08f(0x162)),console[_0x17c08f(0x161)](_0x17c08f(0x159)),console[_0x17c08f(0x161)](_0x17c08f(0x150)),0x1;_0x3ea955[_0x17c08f(0x153)]&&(console[_0x17c08f(0x161)]('Site:\x20'+_0x3ea955[_0x17c08f(0x15a)]),console[_0x17c08f(0x161)](_0x17c08f(0x15b)+_0x3cd823));const _0x18c199=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x3cd823+_0x17c08f(0x160),()=>_0x1044a9['segment'][_0x17c08f(0x14b)](_0x3cd823),{'verbose':_0x3ea955[_0x17c08f(0x153)]}),_0x30943f=_0x18c199['data'];console[_0x17c08f(0x161)](_0x17c08f(0x151)+_0x30943f[_0x17c08f(0x166)]+'\x20field'+(_0x30943f[_0x17c08f(0x166)]!==0x1?'s':''));if(_0x3ea955[_0x17c08f(0x164)]||_0x3ea955[_0x17c08f(0x15f)])return await handleSDKOutput(_0x30943f,_0x3ea955),0x0;return displayFieldsHumanReadable(_0x30943f,_0x3cd823),0x0;}}function a34_0x13c9(){const _0xdeb5bb=['json','6HnpRpa','length','2895105dJKbkj','4OGilCU','listFields','List\x20available\x20fields\x20for\x20segmentation','108340djWSNl','14942244gbBmer','description','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','✔\x20Found\x20','8XRLYSb','verbose','117712mtdWyP','77ljadQJ','5256549TMgazK','7352JgVbQH','execute','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','site','Parent\x20segment:\x20','4252850HrSBsX','375ZKxZrc','parentSegment','jsonl','\x27...','error','Error:\x20Parent\x20segment\x20name\x20is\x20required','13wXJQPU'];a34_0x13c9=function(){return _0xdeb5bb;};return a34_0x13c9();}
@@ -1 +1 @@
1
- const a35_0x816586=a35_0x4548;(function(_0xbeffbb,_0x3ac8d6){const _0x55eb7f=a35_0x4548,_0x5d64a0=_0xbeffbb();while(!![]){try{const _0x205fd7=parseInt(_0x55eb7f(0x22d))/0x1+-parseInt(_0x55eb7f(0x1ea))/0x2*(-parseInt(_0x55eb7f(0x21c))/0x3)+-parseInt(_0x55eb7f(0x1fb))/0x4+-parseInt(_0x55eb7f(0x215))/0x5+parseInt(_0x55eb7f(0x22f))/0x6+-parseInt(_0x55eb7f(0x1f2))/0x7*(parseInt(_0x55eb7f(0x232))/0x8)+parseInt(_0x55eb7f(0x1f6))/0x9*(-parseInt(_0x55eb7f(0x224))/0xa);if(_0x205fd7===_0x3ac8d6)break;else _0x5d64a0['push'](_0x5d64a0['shift']());}catch(_0x447d3b){_0x5d64a0['push'](_0x5d64a0['shift']());}}}(a35_0x5938,0x3833b));import{BaseCommand}from'./command.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';import{segmentWithActivationsToYaml,segmentToYamlString,apiRuleToYaml,journeyActivationStepToYaml}from'../sdk/segment/child-segment-yaml.js';import{apiToYamlAsync,toYamlString as a35_0x51a693}from'../sdk/segment/journey-yaml.js';import a35_0x398218 from'chalk';function a35_0x4548(_0x38131f,_0x41e73c){_0x38131f=_0x38131f-0x1e0;const _0x59387a=a35_0x5938();let _0x4548bf=_0x59387a[_0x38131f];return _0x4548bf;}import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a35_0x2741df from'path';import{sanitizeFileName}from'../utils/string-utils.js';function a35_0x5938(){const _0x20931f=['Fetching\x20parent\x20segment\x20info...','isNew','journeyBundleId','\x20\x20Target:\x20','journeyBundleName','verbose','Fetching\x20journey\x20\x27','444050epUFvd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','1802310vzAxGQ','hasChanges','size','13872lsNELR','error','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','set','\x20journeys','then','dim','\x0aPull\x20summary\x20for\x20\x27','session','name','getActivation','Fetching\x20journeys...','join','Found\x20tdx.json\x20at:\x20','utf-8','filter','isDirectory','content','✔\x20Context\x20set:\x20','red','data','get','\x20=\x20','segment','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','add','relativePath','dryRun','site','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','.yml','description','journey','\x0aChanges\x20to\x20\x27','Fetching\x20activations...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','activationParams','message','getParent','values','✔\x20Pulled\x20','repeat','yellow','\x20\x20🗺️\x20\x20','\x20files\x20to\x20','1682tiwDOq','rule','resolveParentId','\x27...','all','listSegments','cyan','Resolving\x20parent\x20segment\x20\x27','357PGCChB','folderId','from','listActivations','1670103DWJTmV','green','diff','kind','versionNumber','98432fqHqZV','execute','Fetching\x20connections\x20for\x20name\x20resolution...','user','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Using\x20parent\x20segment:\x20','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Parent\x20segment:\x20','Fetching\x20folders...','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','parent_segment','push','\x20unchanged\x20files','Warning:\x20Could\x20not\x20resolve\x20activation\x20','\x20with\x20','dirname','\x20\x20🎯\x20','Processing\x20journeys...','length','setExtra','getJourney','parentSegment','sort','buildIdToEmailMap','absolutePath','getSegment','1365525CtoBcj','audienceId','\x20segments','\x20new\x20files','attributes','\x20files?','\x20versions)','867uLOCHh','relative','connection','listFolders','yaml','parentFolderId','has','reduce','20hMxMIE','setPhase'];a35_0x5938=function(){return _0x20931f;};return a35_0x5938();}import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';export class SegmentPullCommand extends BaseCommand{[a35_0x816586(0x23b)]='segment:pull';[a35_0x816586(0x251)]=a35_0x816586(0x204);async[a35_0x816586(0x1fc)](_0x45ac65){const _0x524813=a35_0x816586,{options:_0x74043b,args:_0x5ca3c7,tdx:_0x2c5b60}=_0x45ac65,_0x3f6063=_0x74043b,_0x25b80e=_0x74043b[_0x524813(0x210)],_0x2feb9d=_0x5ca3c7[0x0],_0x176d0c=findTdxConfigPath();let _0x47ce57,_0x1d6724;if(!_0x2feb9d&&_0x176d0c){const _0x174773=loadTdxConfig(_0x176d0c);_0x47ce57=_0x174773[_0x524813(0x205)],_0x1d6724=a35_0x2741df[_0x524813(0x20a)](_0x176d0c),_0x3f6063[_0x524813(0x22b)]&&(console[_0x524813(0x233)]('Found\x20existing\x20tdx.json\x20at:\x20'+_0x176d0c),console[_0x524813(0x233)](_0x524813(0x200)+_0x47ce57));}else{if(_0x2feb9d){if(existsSync(_0x2feb9d)&&statSync(_0x2feb9d)[_0x524813(0x242)]()){const _0x4e08bd=findTdxConfigPath(_0x2feb9d);if(_0x4e08bd){const _0x3268cd=loadTdxConfig(_0x4e08bd);_0x47ce57=_0x3268cd['parent_segment'],_0x1d6724=a35_0x2741df[_0x524813(0x20a)](_0x4e08bd),_0x3f6063[_0x524813(0x22b)]&&(console[_0x524813(0x233)](_0x524813(0x23f)+_0x4e08bd),console['error']('Using\x20parent\x20segment:\x20'+_0x47ce57));}else return console[_0x524813(0x233)](a35_0x398218[_0x524813(0x245)](_0x524813(0x24a)+_0x2feb9d+'\x0a')),console[_0x524813(0x233)](a35_0x398218[_0x524813(0x1f0)](_0x524813(0x1ff))),0x1;}else _0x47ce57=_0x2feb9d;}else _0x47ce57=_0x25b80e;}if(!_0x47ce57)return console[_0x524813(0x233)](a35_0x398218[_0x524813(0x1e7)](_0x524813(0x234))),console[_0x524813(0x233)](_0x524813(0x24f)),console['error'](_0x524813(0x1e0)),console[_0x524813(0x233)](_0x524813(0x22e)),0x1;_0x3f6063[_0x524813(0x22b)]&&(console[_0x524813(0x233)]('Site:\x20'+_0x3f6063[_0x524813(0x24e)]),console['error'](_0x524813(0x202)+_0x47ce57));const _0x3e214c=await withSpinner(_0x524813(0x1f1)+_0x47ce57+_0x524813(0x1ed),()=>_0x2c5b60[_0x524813(0x249)][_0x524813(0x1ec)](_0x47ce57),{'verbose':_0x3f6063[_0x524813(0x22b)]}),_0x36456f=_0x3e214c['data'],_0xf2503=await withSpinner(_0x524813(0x226),()=>_0x2c5b60[_0x524813(0x249)][_0x524813(0x1e3)](_0x36456f),{'verbose':_0x3f6063['verbose']}),_0x4327d1=_0xf2503[_0x524813(0x246)][_0x524813(0x219)]['name'];_0x3f6063['verbose']&&console[_0x524813(0x233)]('Resolved\x20parent\x20name:\x20'+_0x4327d1);const [_0x5adf48,_0x51d580,_0x4cb255]=await Promise[_0x524813(0x1ee)]([withSpinner('Fetching\x20segments...',()=>_0x2c5b60[_0x524813(0x249)][_0x524813(0x1ef)](_0x36456f),{'verbose':_0x3f6063[_0x524813(0x22b)]}),withSpinner(_0x524813(0x203),()=>_0x2c5b60[_0x524813(0x249)][_0x524813(0x21f)](_0x36456f),{'verbose':_0x3f6063['verbose']}),withSpinner(_0x524813(0x23d),()=>_0x2c5b60[_0x524813(0x252)]['listJourneysFromParentSegment'](_0x36456f),{'verbose':_0x3f6063[_0x524813(0x22b)]})]),_0x1c6ce7=_0x5adf48['data'],_0x264f97=_0x51d580[_0x524813(0x246)],_0x4bb3c2=_0x4cb255[_0x524813(0x246)];if(_0x1c6ce7[_0x524813(0x20d)]===0x0&&_0x4bb3c2[_0x524813(0x20d)]===0x0)return console[_0x524813(0x233)](a35_0x398218[_0x524813(0x1e7)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x4327d1+'\x27')),0x0;const _0x64cb46=buildFolderPathMap(_0x264f97),_0x12592b=_0x1d6724||getSegmentRootDir(sanitizeFileName(_0x47ce57)),_0x630f36=new Map();await withSpinner(_0x524813(0x254),async()=>{await batchAsync(_0x1c6ce7,async _0x5dda05=>{const _0x5dec0b=a35_0x4548,_0x4ae122=await _0x2c5b60['segment'][_0x5dec0b(0x1f5)](_0x36456f,_0x5dda05['id']);_0x630f36[_0x5dec0b(0x235)](_0x5dda05['id'],_0x4ae122);});},{'verbose':_0x3f6063[_0x524813(0x22b)]});const _0x4d49c9=await withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x2c5b60[_0x524813(0x1fe)][_0x524813(0x212)](),{'verbose':_0x3f6063[_0x524813(0x22b)]})[_0x524813(0x237)](_0x16d633=>_0x16d633['data']),_0x8ee975=await withSpinner(_0x524813(0x1fd),()=>_0x2c5b60[_0x524813(0x21e)]['buildIdToNameMap'](),{'verbose':_0x3f6063[_0x524813(0x22b)]})[_0x524813(0x237)](_0x16bcb2=>_0x16bcb2[_0x524813(0x246)]),_0x11de11=[],_0x187991=a35_0x2741df[_0x524813(0x23e)](_0x12592b,'tdx.json'),_0x283cf9=createTdxConfigContent(_0x4327d1);_0x11de11['push'](prepareFile(_0x187991,_0x283cf9,_0x12592b));const _0x430774=new Map();for(const _0x5703c8 of _0x1c6ce7){if(_0x5703c8[_0x524813(0x1f9)]===SEGMENT_KIND_JOURNEY)continue;const _0x3984a4=_0x5703c8['segmentFolderId']?_0x64cb46[_0x524813(0x247)](_0x5703c8['segmentFolderId'])||'':'',_0x43e205=_0x630f36[_0x524813(0x247)](_0x5703c8['id'])||[],_0x38835b=segmentWithActivationsToYaml(_0x5703c8,_0x43e205,undefined,_0x4d49c9,_0x8ee975),_0x313a0d=_0x3984a4?a35_0x2741df['join'](_0x12592b,_0x3984a4):_0x12592b,_0x32253a=sanitizeFileName(_0x5703c8[_0x524813(0x23b)]),_0x637c9f=getUniqueFileName(_0x313a0d,_0x32253a,_0x430774),_0x53d052=a35_0x2741df[_0x524813(0x23e)](_0x313a0d,_0x637c9f+_0x524813(0x250)),_0x2791eb=segmentToYamlString(_0x38835b);_0x11de11[_0x524813(0x206)](prepareFile(_0x53d052,_0x2791eb,_0x12592b));}const _0x5c8a92=new Map();for(const _0x3caed2 of _0x1c6ce7){_0x5c8a92[_0x524813(0x235)](_0x3caed2['id'],_0x3caed2);}const _0x328e43=new Map();for(const _0x108641 of _0x4bb3c2){const _0x536afe=_0x108641[_0x524813(0x228)];!_0x328e43[_0x524813(0x222)](_0x536afe)&&_0x328e43[_0x524813(0x235)](_0x536afe,[]),_0x328e43[_0x524813(0x247)](_0x536afe)[_0x524813(0x206)](_0x108641);}for(const _0x2de750 of _0x328e43['values']()){_0x2de750[_0x524813(0x211)]((_0x4886b8,_0x597a52)=>(_0x4886b8[_0x524813(0x1fa)]||0x0)-(_0x597a52[_0x524813(0x1fa)]||0x0));}const _0x5f4b54=()=>{const _0x2b970b=_0x524813,_0x3e7726=new Set(),_0x180ee8=new Set(),_0x1d12d2=new Map(),_0x2a7411=new Map(),_0x5475f1=createJumpTargetCache(),_0x35b84b=(_0x14a6dd,_0xa95da5)=>({'resolveSegment':async _0x12864a=>{const _0x2ab5a6=a35_0x4548,_0x5513e4=_0x1d12d2[_0x2ab5a6(0x247)](_0x12864a);if(_0x5513e4!==undefined)return{'name':_0x5513e4,'isJourneyLocal':!![]};if(!_0xa95da5)return{'name':_0x12864a,'isJourneyLocal':![]};try{let _0x416627=_0x5c8a92[_0x2ab5a6(0x247)](_0x12864a);!_0x416627&&(_0x416627=await _0x2c5b60[_0x2ab5a6(0x249)][_0x2ab5a6(0x214)](_0xa95da5,_0x12864a));const _0x4635a6=generateJourneyLocalName(_0x416627[_0x2ab5a6(0x23b)]),_0x4f2cf4=_0x416627[_0x2ab5a6(0x1f9)]===SEGMENT_KIND_JOURNEY&&_0x4635a6!==undefined;let _0x4e1d38=_0x416627[_0x2ab5a6(0x23b)];if(_0x4f2cf4&&_0x4635a6){let _0x375707=_0x4635a6,_0x381b90=0x2;while(_0x3e7726[_0x2ab5a6(0x222)](_0x375707)){_0x375707=_0x4635a6+'_'+_0x381b90,_0x381b90++;}_0x3e7726[_0x2ab5a6(0x24b)](_0x375707),_0x4e1d38=_0x375707,_0x1d12d2[_0x2ab5a6(0x235)](_0x12864a,_0x4e1d38);}let _0x23161e;return _0x4f2cf4&&_0x416627['rule']&&(_0x23161e={'description':_0x416627[_0x2ab5a6(0x251)],'rule':apiRuleToYaml(_0x416627[_0x2ab5a6(0x1eb)])}),{'name':_0x4e1d38,'isJourneyLocal':_0x4f2cf4,'definition':_0x23161e};}catch(_0xcc0911){return _0x3f6063['verbose']&&console['error'](_0x2ab5a6(0x201)+_0x12864a+':\x20'+_0xcc0911[_0x2ab5a6(0x1e2)]),{'name':_0x12864a,'isJourneyLocal':![]};}},'resolveActivation':async _0x272705=>{const _0x2d9fe3=a35_0x4548,_0x192237=_0x2a7411[_0x2d9fe3(0x247)](_0x272705);if(_0x192237!==undefined)return{'name':_0x192237,'isJourneyLocal':!![]};try{const _0x418791=await _0x2c5b60[_0x2d9fe3(0x252)][_0x2d9fe3(0x23c)](_0x14a6dd,_0x272705),_0x499318=_0x418791[_0x2d9fe3(0x219)][_0x2d9fe3(0x1e1)]['name']||_0x272705,_0x5bd31a=sanitizeYamlKey(_0x499318)||'activation_'+_0x272705;let _0x3dcddf=_0x5bd31a,_0x1e9b57=0x2;while(_0x180ee8[_0x2d9fe3(0x222)](_0x3dcddf)){_0x3dcddf=_0x5bd31a+'_'+_0x1e9b57,_0x1e9b57++;}_0x180ee8[_0x2d9fe3(0x24b)](_0x3dcddf),_0x2a7411[_0x2d9fe3(0x235)](_0x272705,_0x3dcddf);const _0xdc64ba=journeyActivationStepToYaml(_0x418791,_0x4d49c9,_0x8ee975);return{'name':_0x3dcddf,'isJourneyLocal':!![],'definition':_0xdc64ba};}catch(_0xe2351e){return _0x3f6063[_0x2d9fe3(0x22b)]&&console['error'](_0x2d9fe3(0x208)+_0x272705+':\x20'+_0xe2351e['message']),{'name':_0x272705,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x259b3e,_0x8ddb5d)=>resolveJumpTarget(_0x259b3e,_0x8ddb5d,_0x5475f1,_0x5eef6b=>_0x2c5b60[_0x2b970b(0x252)]['getJourney'](_0x5eef6b))});return{'createYamlContext':_0x35b84b};};if(_0x328e43['size']>0x0){const _0x16cd37=Array[_0x524813(0x1f4)](_0x328e43['values']()),_0x239bf8=await withQuerySpinner(_0x524813(0x20c),async _0x510142=>{const _0x41ee8e=_0x524813,_0x16f9ed=[];let _0x34ef05=0x0;const _0xe45743=0x5;for(let _0x246c29=0x0;_0x246c29<_0x16cd37[_0x41ee8e(0x20d)];_0x246c29+=_0xe45743){const _0x2e38e9=_0x16cd37['slice'](_0x246c29,_0x246c29+_0xe45743),_0x2117ec=await Promise['all'](_0x2e38e9['map'](async _0x3d572c=>{const _0x27996e=_0x41ee8e,_0xabc60b=_0x3d572c[0x0],_0x21ed9d=_0xabc60b[_0x27996e(0x22a)];_0x510142[_0x27996e(0x225)](_0x27996e(0x22c)+_0x21ed9d+'\x27');const _0x3a147b=_0xabc60b[_0x27996e(0x1f3)]?_0x64cb46[_0x27996e(0x247)](_0xabc60b[_0x27996e(0x1f3)])||'':'',{createYamlContext:_0x5294c2}=_0x5f4b54(),_0x30896b=[];for(const _0x1511fa of _0x3d572c){const _0x4effb5=await _0x2c5b60[_0x27996e(0x252)][_0x27996e(0x20f)](_0x1511fa['id']),_0x5aa9a7=_0x4effb5[_0x27996e(0x219)]?.[_0x27996e(0x216)],_0xdcce4e=_0x5294c2(_0x1511fa['id'],_0x5aa9a7),_0xcc2e97=await apiToYamlAsync(_0x4effb5,_0xdcce4e);_0x30896b[_0x27996e(0x206)]({'item':_0x1511fa,'yaml':_0xcc2e97});}let _0x30ad52;return _0x30896b[_0x27996e(0x20d)]===0x1?_0x30ad52=_0x30896b[0x0][_0x27996e(0x220)]:_0x30ad52=buildMergedJourneyYaml(_0x30896b),{'bundleName':_0x21ed9d,'folderPath':_0x3a147b,'finalYaml':_0x30ad52};}));_0x16f9ed[_0x41ee8e(0x206)](..._0x2117ec),_0x34ef05+=_0x2e38e9[_0x41ee8e(0x20d)],_0x510142[_0x41ee8e(0x20e)]('('+_0x34ef05+'/'+_0x16cd37[_0x41ee8e(0x20d)]+')');}return _0x16f9ed;},{'verbose':_0x3f6063[_0x524813(0x22b)]});for(const {bundleName:_0x31d7ee,folderPath:_0x50779e,finalYaml:_0x569e0c}of _0x239bf8[_0x524813(0x246)]){const _0x1e0579=a35_0x51a693(_0x569e0c),_0x510301=_0x50779e?a35_0x2741df[_0x524813(0x23e)](_0x12592b,_0x50779e):_0x12592b,_0x4e4008=sanitizeFileName(_0x31d7ee),_0x1cacfd=getUniqueFileName(_0x510301,_0x4e4008,_0x430774),_0xae9a50=a35_0x2741df['join'](_0x510301,_0x1cacfd+_0x524813(0x250));_0x11de11[_0x524813(0x206)](prepareFile(_0xae9a50,_0x1e0579,_0x12592b));}}const _0x537ac7=Array['from'](_0x630f36[_0x524813(0x1e4)]())[_0x524813(0x223)]((_0x3b3568,_0x77a24)=>_0x3b3568+_0x77a24[_0x524813(0x20d)],0x0),_0x2c68aa=_0x11de11[_0x524813(0x241)](_0x3f5cf5=>_0x3f5cf5['isNew']),_0x83e86d=_0x11de11[_0x524813(0x241)](_0x558716=>!_0x558716[_0x524813(0x227)]&&_0x558716[_0x524813(0x230)]),_0x5e0f07=_0x11de11[_0x524813(0x241)](_0xc44b9=>!_0xc44b9[_0x524813(0x227)]&&!_0xc44b9['hasChanges']),_0x3395cc=_0x1c6ce7['filter'](_0xffd883=>_0xffd883['kind']!==SEGMENT_KIND_JOURNEY);console['error'](_0x524813(0x239)+_0x4327d1+'\x27:'),console[_0x524813(0x233)](_0x524813(0x20b)+a35_0x398218['cyan'](_0x3395cc['length']+_0x524813(0x217))+_0x524813(0x209)+a35_0x398218[_0x524813(0x1f0)](_0x537ac7+'\x20activations'));if(_0x328e43[_0x524813(0x231)]>0x0){const _0x18697d=_0x4bb3c2[_0x524813(0x20d)],_0x584bc6=_0x328e43['size'],_0x279dde=_0x18697d>_0x584bc6?'\x20('+_0x18697d+_0x524813(0x21b):'';console[_0x524813(0x233)](_0x524813(0x1e8)+a35_0x398218[_0x524813(0x1f0)](_0x584bc6+_0x524813(0x236))+a35_0x398218['dim'](_0x279dde));}console[_0x524813(0x233)]('\x20\x20'+a35_0x398218[_0x524813(0x1f7)]('+\x20'+_0x2c68aa[_0x524813(0x20d)]+_0x524813(0x218))),console[_0x524813(0x233)]('\x20\x20'+a35_0x398218['yellow']('~\x20'+_0x83e86d['length']+'\x20changed\x20files')),console[_0x524813(0x233)]('\x20\x20'+a35_0x398218[_0x524813(0x238)]('=\x20'+_0x5e0f07[_0x524813(0x20d)]+_0x524813(0x207))),console['error'](_0x524813(0x229)+a35_0x398218['cyan'](_0x12592b)+'\x0a');if(_0x83e86d[_0x524813(0x20d)]>0x0)for(const _0x508b23 of _0x83e86d){console['error'](_0x524813(0x253)+_0x508b23[_0x524813(0x24c)]+'\x27:'),console[_0x524813(0x233)]('─'[_0x524813(0x1e6)](0x3c)),console['error'](_0x508b23[_0x524813(0x1f8)]),console[_0x524813(0x233)]('─'[_0x524813(0x1e6)](0x3c));}if(_0x3f6063[_0x524813(0x24d)])return console[_0x524813(0x233)](a35_0x398218[_0x524813(0x1e7)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2c68aa[_0x524813(0x20d)]===0x0&&_0x83e86d[_0x524813(0x20d)]===0x0)return console[_0x524813(0x233)](a35_0x398218['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x4327d1},_0x3f6063['session']),console[_0x524813(0x233)](a35_0x398218[_0x524813(0x1f7)](_0x524813(0x244)+a35_0x398218[_0x524813(0x238)](_0x524813(0x205))+_0x524813(0x248)+a35_0x398218[_0x524813(0x1f0)](_0x4327d1))),0x0;if(!_0x3f6063['yes']&&(_0x2c68aa[_0x524813(0x20d)]>0x0||_0x83e86d[_0x524813(0x20d)]>0x0)){const _0x1ad495=await confirmKey('Write\x20'+(_0x2c68aa[_0x524813(0x20d)]+_0x83e86d[_0x524813(0x20d)])+_0x524813(0x21a));if(!_0x1ad495)return console[_0x524813(0x233)]('Aborted.'),0x1;}for(const _0x16775d of _0x11de11){if(_0x16775d[_0x524813(0x227)]||_0x16775d[_0x524813(0x230)]){const _0x4a9e9a=a35_0x2741df['dirname'](_0x16775d[_0x524813(0x213)]);!existsSync(_0x4a9e9a)&&mkdirSync(_0x4a9e9a,{'recursive':!![]}),writeFileSync(_0x16775d[_0x524813(0x213)],_0x16775d[_0x524813(0x243)],_0x524813(0x240));}}return console[_0x524813(0x233)](a35_0x398218['green'](_0x524813(0x1e5)+(_0x2c68aa['length']+_0x83e86d[_0x524813(0x20d)])+_0x524813(0x1e9)+_0x12592b)),saveSessionContext({'parent_segment':_0x4327d1},_0x3f6063[_0x524813(0x23a)]),console[_0x524813(0x233)](a35_0x398218[_0x524813(0x1f7)]('✔\x20Context\x20set:\x20'+a35_0x398218[_0x524813(0x238)](_0x524813(0x205))+_0x524813(0x248)+a35_0x398218['cyan'](_0x4327d1))),0x0;}}function buildFolderPathMap(_0x1a8e79){const _0x40350c=a35_0x816586,_0xc7ab7b=new Map(),_0x340ad2=new Map();for(const _0x3a47f1 of _0x1a8e79){_0x340ad2['set'](_0x3a47f1['id'],_0x3a47f1);}const _0x36f7a8=new Set();for(const _0x1f0cec of _0x1a8e79){!_0x1f0cec[_0x40350c(0x221)]&&_0x36f7a8[_0x40350c(0x24b)](_0x1f0cec['id']);}function _0x3d86ae(_0x2dab0d){const _0x1ab614=_0x40350c;if(_0xc7ab7b['has'](_0x2dab0d['id']))return _0xc7ab7b['get'](_0x2dab0d['id']);if(_0x36f7a8[_0x1ab614(0x222)](_0x2dab0d['id']))return _0xc7ab7b[_0x1ab614(0x235)](_0x2dab0d['id'],''),'';if(_0x2dab0d[_0x1ab614(0x221)]){const _0x23cdcd=_0x340ad2[_0x1ab614(0x247)](_0x2dab0d[_0x1ab614(0x221)]);if(_0x23cdcd){const _0x181615=_0x3d86ae(_0x23cdcd),_0x453789=_0x181615?_0x181615+'/'+_0x2dab0d[_0x1ab614(0x23b)]:_0x2dab0d[_0x1ab614(0x23b)];return _0xc7ab7b['set'](_0x2dab0d['id'],_0x453789),_0x453789;}}const _0x4dc7f2=_0x2dab0d[_0x1ab614(0x23b)];return _0xc7ab7b[_0x1ab614(0x235)](_0x2dab0d['id'],_0x4dc7f2),_0x4dc7f2;}for(const _0x154d34 of _0x1a8e79){_0x3d86ae(_0x154d34);}return _0xc7ab7b;}function getUniqueFileName(_0x2680bd,_0x3709c6,_0x4d429d){const _0x3b5134=a35_0x816586,_0x34e755=_0x2680bd+':'+_0x3709c6,_0x1faba1=_0x4d429d[_0x3b5134(0x247)](_0x34e755)||0x0;_0x4d429d[_0x3b5134(0x235)](_0x34e755,_0x1faba1+0x1);if(_0x1faba1===0x0)return _0x3709c6;return _0x3709c6+'-'+_0x1faba1;}function prepareFile(_0x111328,_0x506523,_0x54057e){const _0x40a32e=a35_0x816586,_0x126da3=a35_0x2741df[_0x40a32e(0x21d)](_0x54057e,_0x111328);if(existsSync(_0x111328)){const _0x5710a6=readFileSync(_0x111328,_0x40a32e(0x240)),_0x1361c2=generateDiff(_0x5710a6,_0x506523),_0x49af44=hasChanges(_0x1361c2);return{'relativePath':_0x126da3,'absolutePath':_0x111328,'content':_0x506523,'isNew':![],'hasChanges':_0x49af44,'diff':_0x49af44?formatDiffWithColors(_0x1361c2):undefined};}return{'relativePath':_0x126da3,'absolutePath':_0x111328,'content':_0x506523,'isNew':!![],'hasChanges':![]};}
1
+ const a35_0x4ce8e6=a35_0x5099;(function(_0x333b29,_0x2fe5f3){const _0x5d90e6=a35_0x5099,_0x2df1ce=_0x333b29();while(!![]){try{const _0x1c21b9=-parseInt(_0x5d90e6(0x110))/0x1+-parseInt(_0x5d90e6(0xe3))/0x2*(parseInt(_0x5d90e6(0xd5))/0x3)+parseInt(_0x5d90e6(0x13d))/0x4*(-parseInt(_0x5d90e6(0x12c))/0x5)+-parseInt(_0x5d90e6(0x128))/0x6+-parseInt(_0x5d90e6(0x122))/0x7*(parseInt(_0x5d90e6(0xdc))/0x8)+parseInt(_0x5d90e6(0x134))/0x9*(parseInt(_0x5d90e6(0xde))/0xa)+parseInt(_0x5d90e6(0xec))/0xb;if(_0x1c21b9===_0x2fe5f3)break;else _0x2df1ce['push'](_0x2df1ce['shift']());}catch(_0x3eaa47){_0x2df1ce['push'](_0x2df1ce['shift']());}}}(a35_0x36a8,0x1c40a));import{BaseCommand}from'./command.js';function a35_0x36a8(){const _0x23e8ee=['620vIZggt','\x0aChanges\x20to\x20\x27','Processing\x20journeys...','dim','audienceId','14030QbeFvF','getActivation','relativePath','\x20versions)','from','values','Fetching\x20activations...','\x20=\x20','Write\x20','7506400xLQgQn','push','\x0aPull\x20summary\x20for\x20\x27','Fetching\x20users\x20for\x20email\x20resolution...','slice','Fetching\x20connections\x20for\x20name\x20resolution...','absolutePath','hasChanges','green','✔\x20Pulled\x20','\x20\x20🗺️\x20\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20changed\x20files','listSegments','content','message','session','Fetching\x20parent\x20segment\x20info...','\x20files\x20to\x20','Aborted.','connection','journeyBundleId','map','Resolving\x20parent\x20segment\x20\x27','parent_segment','\x20\x20Target:\x20','dirname','segment:pull','attributes','all','verbose','cyan','Resolved\x20parent\x20name:\x20','join','journeyBundleName','Parent\x20segment:\x20','183953yylXXV','\x20new\x20files','resolveParentId','diff','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Found\x20existing\x20tdx.json\x20at:\x20','name','repeat','site','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','isNew','Fetching\x20folders...','Found\x20tdx.json\x20at:\x20','execute','versionNumber','user','has','77NAqIjF','reduce','getJourney','filter','getSegment','Fetching\x20segments...','1181298BMXZHR','yellow','.yml','segmentFolderId','8355GYGCBO','data','journey','rule','relative','\x20activations','kind','listJourneysFromParentSegment','4041dNfMoH','Fetching\x20journey\x20\x27','set','segment','get','✔\x20Context\x20set:\x20','folderId','activation_','buildIdToEmailMap','180YgHRkS','setPhase','Warning:\x20Could\x20not\x20resolve\x20activation\x20','yes','parentFolderId','Using\x20parent\x20segment:\x20','then','Fetching\x20journeys...','getParent','length','listFolders','\x20segments','\x27...','27caDLZJ','buildIdToNameMap','isDirectory','add','red','size','parentSegment','54800VRZvZR','error'];a35_0x36a8=function(){return _0x23e8ee;};return a35_0x36a8();}import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';import{segmentWithActivationsToYaml,segmentToYamlString,apiRuleToYaml,journeyActivationStepToYaml}from'../sdk/segment/child-segment-yaml.js';import{apiToYamlAsync,toYamlString as a35_0x47142e}from'../sdk/segment/journey-yaml.js';import a35_0xfbd8a5 from'chalk';import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a35_0xcc50b from'path';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';export class SegmentPullCommand extends BaseCommand{[a35_0x4ce8e6(0x117)]=a35_0x4ce8e6(0x107);['description']=a35_0x4ce8e6(0x115);async[a35_0x4ce8e6(0x11e)](_0x337642){const _0x39628c=a35_0x4ce8e6,{options:_0x303a54,args:_0x4d3291,tdx:_0x193b24}=_0x337642,_0x59a985=_0x303a54,_0xf424e4=_0x303a54[_0x39628c(0xdb)],_0x173ca0=_0x4d3291[0x0],_0x8815e2=findTdxConfigPath();let _0x18b0eb,_0x55a966;if(!_0x173ca0&&_0x8815e2){const _0x2d128a=loadTdxConfig(_0x8815e2);_0x18b0eb=_0x2d128a[_0x39628c(0x104)],_0x55a966=a35_0xcc50b[_0x39628c(0x106)](_0x8815e2),_0x59a985['verbose']&&(console['error'](_0x39628c(0x116)+_0x8815e2),console[_0x39628c(0xdd)](_0x39628c(0xcd)+_0x18b0eb));}else{if(_0x173ca0){if(existsSync(_0x173ca0)&&statSync(_0x173ca0)[_0x39628c(0xd7)]()){const _0xbe4244=findTdxConfigPath(_0x173ca0);if(_0xbe4244){const _0x283601=loadTdxConfig(_0xbe4244);_0x18b0eb=_0x283601['parent_segment'],_0x55a966=a35_0xcc50b[_0x39628c(0x106)](_0xbe4244),_0x59a985[_0x39628c(0x10a)]&&(console[_0x39628c(0xdd)](_0x39628c(0x11d)+_0xbe4244),console['error'](_0x39628c(0xcd)+_0x18b0eb));}else return console['error'](a35_0xfbd8a5[_0x39628c(0xd9)](_0x39628c(0x11a)+_0x173ca0+'\x0a')),console[_0x39628c(0xdd)](a35_0xfbd8a5['cyan'](_0x39628c(0x114))),0x1;}else _0x18b0eb=_0x173ca0;}else _0x18b0eb=_0xf424e4;}if(!_0x18b0eb)return console['error'](a35_0xfbd8a5[_0x39628c(0x129)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x39628c(0xdd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file'),0x1;_0x59a985['verbose']&&(console[_0x39628c(0xdd)]('Site:\x20'+_0x59a985[_0x39628c(0x119)]),console[_0x39628c(0xdd)](_0x39628c(0x10f)+_0x18b0eb));const _0x68b661=await withSpinner(_0x39628c(0x103)+_0x18b0eb+_0x39628c(0xd4),()=>_0x193b24[_0x39628c(0x137)][_0x39628c(0x112)](_0x18b0eb),{'verbose':_0x59a985['verbose']}),_0x376b31=_0x68b661[_0x39628c(0x12d)],_0x323043=await withSpinner(_0x39628c(0xfd),()=>_0x193b24[_0x39628c(0x137)][_0x39628c(0xd0)](_0x376b31),{'verbose':_0x59a985[_0x39628c(0x10a)]}),_0x41a802=_0x323043[_0x39628c(0x12d)]['attributes'][_0x39628c(0x117)];_0x59a985[_0x39628c(0x10a)]&&console[_0x39628c(0xdd)](_0x39628c(0x10c)+_0x41a802);const [_0x3667b9,_0x3dba67,_0x48e37f]=await Promise[_0x39628c(0x109)]([withSpinner(_0x39628c(0x127),()=>_0x193b24[_0x39628c(0x137)][_0x39628c(0xf9)](_0x376b31),{'verbose':_0x59a985[_0x39628c(0x10a)]}),withSpinner(_0x39628c(0x11c),()=>_0x193b24[_0x39628c(0x137)][_0x39628c(0xd2)](_0x376b31),{'verbose':_0x59a985[_0x39628c(0x10a)]}),withSpinner(_0x39628c(0xcf),()=>_0x193b24[_0x39628c(0x12e)][_0x39628c(0x133)](_0x376b31),{'verbose':_0x59a985['verbose']})]),_0x37e804=_0x3667b9[_0x39628c(0x12d)],_0x4c29a5=_0x3dba67[_0x39628c(0x12d)],_0x559698=_0x48e37f[_0x39628c(0x12d)];if(_0x37e804[_0x39628c(0xd1)]===0x0&&_0x559698[_0x39628c(0xd1)]===0x0)return console[_0x39628c(0xdd)](a35_0xfbd8a5[_0x39628c(0x129)](_0x39628c(0xf7)+_0x41a802+'\x27')),0x0;const _0x4bd89e=buildFolderPathMap(_0x4c29a5),_0x3b291f=_0x55a966||getSegmentRootDir(sanitizeFileName(_0x18b0eb)),_0x461ddc=new Map();await withSpinner(_0x39628c(0xe9),async()=>{await batchAsync(_0x37e804,async _0x5b0064=>{const _0x5d564a=a35_0x5099,_0x2c04d4=await _0x193b24['segment']['listActivations'](_0x376b31,_0x5b0064['id']);_0x461ddc[_0x5d564a(0x136)](_0x5b0064['id'],_0x2c04d4);});},{'verbose':_0x59a985[_0x39628c(0x10a)]});const _0x35c75c=await withSpinner(_0x39628c(0xef),()=>_0x193b24[_0x39628c(0x120)][_0x39628c(0x13c)](),{'verbose':_0x59a985[_0x39628c(0x10a)]})[_0x39628c(0xce)](_0x3b91d8=>_0x3b91d8[_0x39628c(0x12d)]),_0x4c52bf=await withSpinner(_0x39628c(0xf1),()=>_0x193b24[_0x39628c(0x100)][_0x39628c(0xd6)](),{'verbose':_0x59a985[_0x39628c(0x10a)]})[_0x39628c(0xce)](_0x42286a=>_0x42286a[_0x39628c(0x12d)]),_0x88912a=[],_0x336d96=a35_0xcc50b[_0x39628c(0x10d)](_0x3b291f,'tdx.json'),_0x1744a8=createTdxConfigContent(_0x41a802);_0x88912a[_0x39628c(0xed)](prepareFile(_0x336d96,_0x1744a8,_0x3b291f));const _0x116c62=new Map();for(const _0x35db49 of _0x37e804){if(_0x35db49[_0x39628c(0x132)]===SEGMENT_KIND_JOURNEY)continue;const _0x3b61b3=_0x35db49[_0x39628c(0x12b)]?_0x4bd89e['get'](_0x35db49[_0x39628c(0x12b)])||'':'',_0x2984f0=_0x461ddc[_0x39628c(0x138)](_0x35db49['id'])||[],_0x383fd3=segmentWithActivationsToYaml(_0x35db49,_0x2984f0,undefined,_0x35c75c,_0x4c52bf),_0x49f958=_0x3b61b3?a35_0xcc50b['join'](_0x3b291f,_0x3b61b3):_0x3b291f,_0x43c206=sanitizeFileName(_0x35db49['name']),_0x383114=getUniqueFileName(_0x49f958,_0x43c206,_0x116c62),_0x1f7bb2=a35_0xcc50b[_0x39628c(0x10d)](_0x49f958,_0x383114+_0x39628c(0x12a)),_0x8e3b7a=segmentToYamlString(_0x383fd3);_0x88912a[_0x39628c(0xed)](prepareFile(_0x1f7bb2,_0x8e3b7a,_0x3b291f));}const _0x3548db=new Map();for(const _0x2efabf of _0x37e804){_0x3548db[_0x39628c(0x136)](_0x2efabf['id'],_0x2efabf);}const _0x52064b=new Map();for(const _0x5bdfd9 of _0x559698){const _0x2436b6=_0x5bdfd9[_0x39628c(0x101)];!_0x52064b[_0x39628c(0x121)](_0x2436b6)&&_0x52064b['set'](_0x2436b6,[]),_0x52064b[_0x39628c(0x138)](_0x2436b6)[_0x39628c(0xed)](_0x5bdfd9);}for(const _0x451266 of _0x52064b[_0x39628c(0xe8)]()){_0x451266['sort']((_0x455105,_0x115c3f)=>(_0x455105[_0x39628c(0x11f)]||0x0)-(_0x115c3f[_0x39628c(0x11f)]||0x0));}const _0xa6b712=()=>{const _0x578807=_0x39628c,_0xc62911=new Set(),_0x3ba5ed=new Set(),_0x58eb03=new Map(),_0x123f34=new Map(),_0x50606e=createJumpTargetCache(),_0x3dd2b2=(_0x2fbe67,_0x2fd627)=>({'resolveSegment':async _0x4cb330=>{const _0x26033e=a35_0x5099,_0x3a8265=_0x58eb03[_0x26033e(0x138)](_0x4cb330);if(_0x3a8265!==undefined)return{'name':_0x3a8265,'isJourneyLocal':!![]};if(!_0x2fd627)return{'name':_0x4cb330,'isJourneyLocal':![]};try{let _0x5f3645=_0x3548db[_0x26033e(0x138)](_0x4cb330);!_0x5f3645&&(_0x5f3645=await _0x193b24[_0x26033e(0x137)][_0x26033e(0x126)](_0x2fd627,_0x4cb330));const _0x5a67a8=generateJourneyLocalName(_0x5f3645[_0x26033e(0x117)]),_0x511693=_0x5f3645[_0x26033e(0x132)]===SEGMENT_KIND_JOURNEY&&_0x5a67a8!==undefined;let _0x4934fc=_0x5f3645[_0x26033e(0x117)];if(_0x511693&&_0x5a67a8){let _0xcbaa8e=_0x5a67a8,_0xedbb7a=0x2;while(_0xc62911['has'](_0xcbaa8e)){_0xcbaa8e=_0x5a67a8+'_'+_0xedbb7a,_0xedbb7a++;}_0xc62911[_0x26033e(0xd8)](_0xcbaa8e),_0x4934fc=_0xcbaa8e,_0x58eb03[_0x26033e(0x136)](_0x4cb330,_0x4934fc);}let _0x12e6c9;return _0x511693&&_0x5f3645[_0x26033e(0x12f)]&&(_0x12e6c9={'description':_0x5f3645['description'],'rule':apiRuleToYaml(_0x5f3645[_0x26033e(0x12f)])}),{'name':_0x4934fc,'isJourneyLocal':_0x511693,'definition':_0x12e6c9};}catch(_0x7f9530){return _0x59a985[_0x26033e(0x10a)]&&console[_0x26033e(0xdd)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x4cb330+':\x20'+_0x7f9530[_0x26033e(0xfb)]),{'name':_0x4cb330,'isJourneyLocal':![]};}},'resolveActivation':async _0x58e17c=>{const _0xdeca34=a35_0x5099,_0x164d6a=_0x123f34[_0xdeca34(0x138)](_0x58e17c);if(_0x164d6a!==undefined)return{'name':_0x164d6a,'isJourneyLocal':!![]};try{const _0xeef562=await _0x193b24['journey'][_0xdeca34(0xe4)](_0x2fbe67,_0x58e17c),_0x5c284=_0xeef562['attributes']['activationParams']['name']||_0x58e17c,_0x49d233=sanitizeYamlKey(_0x5c284)||_0xdeca34(0x13b)+_0x58e17c;let _0xf478a8=_0x49d233,_0xff83c2=0x2;while(_0x3ba5ed[_0xdeca34(0x121)](_0xf478a8)){_0xf478a8=_0x49d233+'_'+_0xff83c2,_0xff83c2++;}_0x3ba5ed[_0xdeca34(0xd8)](_0xf478a8),_0x123f34[_0xdeca34(0x136)](_0x58e17c,_0xf478a8);const _0x1d4f70=journeyActivationStepToYaml(_0xeef562,_0x35c75c,_0x4c52bf);return{'name':_0xf478a8,'isJourneyLocal':!![],'definition':_0x1d4f70};}catch(_0x2481e7){return _0x59a985['verbose']&&console[_0xdeca34(0xdd)](_0xdeca34(0xca)+_0x58e17c+':\x20'+_0x2481e7[_0xdeca34(0xfb)]),{'name':_0x58e17c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x49cb66,_0x299b70)=>resolveJumpTarget(_0x49cb66,_0x299b70,_0x50606e,_0x152a8d=>_0x193b24[_0x578807(0x12e)][_0x578807(0x124)](_0x152a8d))});return{'createYamlContext':_0x3dd2b2};};if(_0x52064b[_0x39628c(0xda)]>0x0){const _0x52dbd1=Array[_0x39628c(0xe7)](_0x52064b[_0x39628c(0xe8)]()),_0x11fae5=await withQuerySpinner(_0x39628c(0xe0),async _0x3984b8=>{const _0x45ad68=_0x39628c,_0x4de842=[];let _0x5e65f2=0x0;const _0x5d282f=0x5;for(let _0x4f923a=0x0;_0x4f923a<_0x52dbd1['length'];_0x4f923a+=_0x5d282f){const _0x30d367=_0x52dbd1[_0x45ad68(0xf0)](_0x4f923a,_0x4f923a+_0x5d282f),_0x2e7da5=await Promise[_0x45ad68(0x109)](_0x30d367[_0x45ad68(0x102)](async _0x4696db=>{const _0x23460f=_0x45ad68,_0x23bdc1=_0x4696db[0x0],_0x8aa522=_0x23bdc1[_0x23460f(0x10e)];_0x3984b8[_0x23460f(0x13e)](_0x23460f(0x135)+_0x8aa522+'\x27');const _0x330172=_0x23bdc1['folderId']?_0x4bd89e[_0x23460f(0x138)](_0x23bdc1[_0x23460f(0x13a)])||'':'',{createYamlContext:_0x48eca1}=_0xa6b712(),_0x4c6e56=[];for(const _0x380963 of _0x4696db){const _0x186d02=await _0x193b24[_0x23460f(0x12e)][_0x23460f(0x124)](_0x380963['id']),_0x128346=_0x186d02[_0x23460f(0x108)]?.[_0x23460f(0xe2)],_0x206c4e=_0x48eca1(_0x380963['id'],_0x128346),_0x5d19a0=await apiToYamlAsync(_0x186d02,_0x206c4e);_0x4c6e56[_0x23460f(0xed)]({'item':_0x380963,'yaml':_0x5d19a0});}let _0x4fd681;return _0x4c6e56[_0x23460f(0xd1)]===0x1?_0x4fd681=_0x4c6e56[0x0]['yaml']:_0x4fd681=buildMergedJourneyYaml(_0x4c6e56),{'bundleName':_0x8aa522,'folderPath':_0x330172,'finalYaml':_0x4fd681};}));_0x4de842[_0x45ad68(0xed)](..._0x2e7da5),_0x5e65f2+=_0x30d367[_0x45ad68(0xd1)],_0x3984b8['setExtra']('('+_0x5e65f2+'/'+_0x52dbd1[_0x45ad68(0xd1)]+')');}return _0x4de842;},{'verbose':_0x59a985[_0x39628c(0x10a)]});for(const {bundleName:_0x268da3,folderPath:_0x4bf847,finalYaml:_0x29e6ff}of _0x11fae5[_0x39628c(0x12d)]){const _0x162e1f=a35_0x47142e(_0x29e6ff),_0x2fd7ec=_0x4bf847?a35_0xcc50b[_0x39628c(0x10d)](_0x3b291f,_0x4bf847):_0x3b291f,_0x879c17=sanitizeFileName(_0x268da3),_0x8ade7d=getUniqueFileName(_0x2fd7ec,_0x879c17,_0x116c62),_0x5af314=a35_0xcc50b[_0x39628c(0x10d)](_0x2fd7ec,_0x8ade7d+'.yml');_0x88912a[_0x39628c(0xed)](prepareFile(_0x5af314,_0x162e1f,_0x3b291f));}}const _0x9ce939=Array[_0x39628c(0xe7)](_0x461ddc['values']())[_0x39628c(0x123)]((_0x5a5bbe,_0x1f48ef)=>_0x5a5bbe+_0x1f48ef['length'],0x0),_0x2c5fae=_0x88912a['filter'](_0x2fa82a=>_0x2fa82a['isNew']),_0x475f2d=_0x88912a[_0x39628c(0x125)](_0x7c78a5=>!_0x7c78a5['isNew']&&_0x7c78a5[_0x39628c(0xf3)]),_0x286af4=_0x88912a[_0x39628c(0x125)](_0x26bc5f=>!_0x26bc5f['isNew']&&!_0x26bc5f[_0x39628c(0xf3)]),_0x481cb7=_0x37e804[_0x39628c(0x125)](_0x5863c3=>_0x5863c3[_0x39628c(0x132)]!==SEGMENT_KIND_JOURNEY);console['error'](_0x39628c(0xee)+_0x41a802+'\x27:'),console[_0x39628c(0xdd)]('\x20\x20🎯\x20'+a35_0xfbd8a5[_0x39628c(0x10b)](_0x481cb7[_0x39628c(0xd1)]+_0x39628c(0xd3))+'\x20with\x20'+a35_0xfbd8a5['cyan'](_0x9ce939+_0x39628c(0x131)));if(_0x52064b['size']>0x0){const _0x561958=_0x559698[_0x39628c(0xd1)],_0x31f28b=_0x52064b[_0x39628c(0xda)],_0x33eced=_0x561958>_0x31f28b?'\x20('+_0x561958+_0x39628c(0xe6):'';console['error'](_0x39628c(0xf6)+a35_0xfbd8a5['cyan'](_0x31f28b+'\x20journeys')+a35_0xfbd8a5[_0x39628c(0xe1)](_0x33eced));}console[_0x39628c(0xdd)]('\x20\x20'+a35_0xfbd8a5['green']('+\x20'+_0x2c5fae['length']+_0x39628c(0x111))),console[_0x39628c(0xdd)]('\x20\x20'+a35_0xfbd8a5[_0x39628c(0x129)]('~\x20'+_0x475f2d['length']+_0x39628c(0xf8))),console[_0x39628c(0xdd)]('\x20\x20'+a35_0xfbd8a5['dim']('=\x20'+_0x286af4[_0x39628c(0xd1)]+'\x20unchanged\x20files')),console[_0x39628c(0xdd)](_0x39628c(0x105)+a35_0xfbd8a5[_0x39628c(0x10b)](_0x3b291f)+'\x0a');if(_0x475f2d['length']>0x0)for(const _0x2116eb of _0x475f2d){console[_0x39628c(0xdd)](_0x39628c(0xdf)+_0x2116eb[_0x39628c(0xe5)]+'\x27:'),console[_0x39628c(0xdd)]('─'[_0x39628c(0x118)](0x3c)),console['error'](_0x2116eb[_0x39628c(0x113)]),console[_0x39628c(0xdd)]('─'[_0x39628c(0x118)](0x3c));}if(_0x59a985['dryRun'])return console[_0x39628c(0xdd)](a35_0xfbd8a5[_0x39628c(0x129)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2c5fae['length']===0x0&&_0x475f2d['length']===0x0)return console['error'](a35_0xfbd8a5[_0x39628c(0xf4)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x41a802},_0x59a985[_0x39628c(0xfc)]),console[_0x39628c(0xdd)](a35_0xfbd8a5['green'](_0x39628c(0x139)+a35_0xfbd8a5[_0x39628c(0xe1)](_0x39628c(0x104))+'\x20=\x20'+a35_0xfbd8a5['cyan'](_0x41a802))),0x0;if(!_0x59a985[_0x39628c(0xcb)]&&(_0x2c5fae['length']>0x0||_0x475f2d[_0x39628c(0xd1)]>0x0)){const _0x34f860=await confirmKey(_0x39628c(0xeb)+(_0x2c5fae[_0x39628c(0xd1)]+_0x475f2d[_0x39628c(0xd1)])+'\x20files?');if(!_0x34f860)return console[_0x39628c(0xdd)](_0x39628c(0xff)),0x1;}for(const _0x3830a9 of _0x88912a){if(_0x3830a9[_0x39628c(0x11b)]||_0x3830a9[_0x39628c(0xf3)]){const _0x476791=a35_0xcc50b[_0x39628c(0x106)](_0x3830a9[_0x39628c(0xf2)]);!existsSync(_0x476791)&&mkdirSync(_0x476791,{'recursive':!![]}),writeFileSync(_0x3830a9[_0x39628c(0xf2)],_0x3830a9[_0x39628c(0xfa)],'utf-8');}}return console[_0x39628c(0xdd)](a35_0xfbd8a5[_0x39628c(0xf4)](_0x39628c(0xf5)+(_0x2c5fae[_0x39628c(0xd1)]+_0x475f2d[_0x39628c(0xd1)])+_0x39628c(0xfe)+_0x3b291f)),saveSessionContext({'parent_segment':_0x41a802},_0x59a985[_0x39628c(0xfc)]),console[_0x39628c(0xdd)](a35_0xfbd8a5[_0x39628c(0xf4)](_0x39628c(0x139)+a35_0xfbd8a5['dim']('parent_segment')+_0x39628c(0xea)+a35_0xfbd8a5[_0x39628c(0x10b)](_0x41a802))),0x0;}}function buildFolderPathMap(_0xf66468){const _0x4d2a01=a35_0x4ce8e6,_0x21e9ce=new Map(),_0x227958=new Map();for(const _0x22b820 of _0xf66468){_0x227958[_0x4d2a01(0x136)](_0x22b820['id'],_0x22b820);}const _0x7c0adf=new Set();for(const _0x42b7f2 of _0xf66468){!_0x42b7f2[_0x4d2a01(0xcc)]&&_0x7c0adf[_0x4d2a01(0xd8)](_0x42b7f2['id']);}function _0x33da6d(_0x515843){const _0x111a66=_0x4d2a01;if(_0x21e9ce['has'](_0x515843['id']))return _0x21e9ce[_0x111a66(0x138)](_0x515843['id']);if(_0x7c0adf[_0x111a66(0x121)](_0x515843['id']))return _0x21e9ce['set'](_0x515843['id'],''),'';if(_0x515843[_0x111a66(0xcc)]){const _0x21b23b=_0x227958[_0x111a66(0x138)](_0x515843['parentFolderId']);if(_0x21b23b){const _0x479a50=_0x33da6d(_0x21b23b),_0x45c058=_0x479a50?_0x479a50+'/'+_0x515843['name']:_0x515843[_0x111a66(0x117)];return _0x21e9ce['set'](_0x515843['id'],_0x45c058),_0x45c058;}}const _0xadb9e6=_0x515843[_0x111a66(0x117)];return _0x21e9ce['set'](_0x515843['id'],_0xadb9e6),_0xadb9e6;}for(const _0x53f881 of _0xf66468){_0x33da6d(_0x53f881);}return _0x21e9ce;}function getUniqueFileName(_0x4ea139,_0x19acea,_0x355d9e){const _0x5ed605=a35_0x4ce8e6,_0x5a33f9=_0x4ea139+':'+_0x19acea,_0x4e0d5e=_0x355d9e['get'](_0x5a33f9)||0x0;_0x355d9e[_0x5ed605(0x136)](_0x5a33f9,_0x4e0d5e+0x1);if(_0x4e0d5e===0x0)return _0x19acea;return _0x19acea+'-'+_0x4e0d5e;}function a35_0x5099(_0x47ca84,_0x32bab4){_0x47ca84=_0x47ca84-0xca;const _0x36a88b=a35_0x36a8();let _0x509929=_0x36a88b[_0x47ca84];return _0x509929;}function prepareFile(_0x22403b,_0x59c545,_0x467266){const _0x2d4562=a35_0x4ce8e6,_0x352516=a35_0xcc50b[_0x2d4562(0x130)](_0x467266,_0x22403b);if(existsSync(_0x22403b)){const _0x2a2736=readFileSync(_0x22403b,'utf-8'),_0x50c265=generateDiff(_0x2a2736,_0x59c545),_0x2737bd=hasChanges(_0x50c265);return{'relativePath':_0x352516,'absolutePath':_0x22403b,'content':_0x59c545,'isNew':![],'hasChanges':_0x2737bd,'diff':_0x2737bd?formatDiffWithColors(_0x50c265):undefined};}return{'relativePath':_0x352516,'absolutePath':_0x22403b,'content':_0x59c545,'isNew':!![],'hasChanges':![]};}