@treasuredata/tdx 0.28.7 → 0.28.8
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.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x4357a7=a19_0x19ec;function a19_0x19ec(_0x30e3bd,_0x1af834){_0x30e3bd=_0x30e3bd-0x1a7;const _0x50e42d=a19_0x50e4();let _0x19ec6f=_0x50e42d[_0x30e3bd];return _0x19ec6f;}(function(_0x5e7eeb,_0x2e0941){const _0x53b8d0=a19_0x19ec,_0xf7a654=_0x5e7eeb();while(!![]){try{const _0x2da00b=parseInt(_0x53b8d0(0x1d3))/0x1*(-parseInt(_0x53b8d0(0x1d4))/0x2)+-parseInt(_0x53b8d0(0x1c2))/0x3*(parseInt(_0x53b8d0(0x1ad))/0x4)+-parseInt(_0x53b8d0(0x1cd))/0x5+parseInt(_0x53b8d0(0x1ae))/0x6*(parseInt(_0x53b8d0(0x1ca))/0x7)+-parseInt(_0x53b8d0(0x1d2))/0x8*(-parseInt(_0x53b8d0(0x1b1))/0x9)+parseInt(_0x53b8d0(0x1c6))/0xa*(parseInt(_0x53b8d0(0x1c7))/0xb)+parseInt(_0x53b8d0(0x1aa))/0xc*(parseInt(_0x53b8d0(0x1a9))/0xd);if(_0x2da00b===_0x2e0941)break;else _0xf7a654['push'](_0xf7a654['shift']());}catch(_0x5c5af0){_0xf7a654['push'](_0xf7a654['shift']());}}}(a19_0x50e4,0xddd1a));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a19_0xd7adc4 from'chalk';import a19_0x553842 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a19_0x4357a7(0x1d1)]=a19_0x4357a7(0x1b8);['description']=a19_0x4357a7(0x1b3);async[a19_0x4357a7(0x1c0)](_0x2b0811){const _0x41ade3=a19_0x4357a7,{options:_0x5b807b,args:_0x38d6bc}=_0x2b0811,_0x26530a=_0x5b807b,_0x201ab3=_0x38d6bc[0x0],_0x24f903=_0x201ab3?a19_0x553842['resolve'](_0x201ab3):undefined,_0x7e2c72=_0x24f903?isYamlFile(_0x24f903):![];let _0x3ff62c,_0x477901;if(_0x7e2c72&&_0x24f903)_0x3ff62c=a19_0x553842['dirname'](_0x24f903),_0x477901=_0x24f903;else _0x24f903?_0x3ff62c=_0x24f903:_0x3ff62c=process['cwd']();if(!_0x477901&&!existsSync(_0x3ff62c))return console[_0x41ade3(0x1c9)](a19_0xd7adc4[_0x41ade3(0x1bd)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3ff62c+'\x0a')),0x1;let _0x2ba920;if(_0x477901){if(!_0x477901[_0x41ade3(0x1be)]('.yml')&&!_0x477901['endsWith']('.yaml'))return console[_0x41ade3(0x1c9)](a19_0xd7adc4[_0x41ade3(0x1bd)](_0x41ade3(0x1c3)+_0x477901+'\x0a')),0x1;_0x2ba920=[_0x477901];}else _0x2ba920=findYamlFiles(_0x3ff62c);if(_0x2ba920[_0x41ade3(0x1c1)]===0x0)return console[_0x41ade3(0x1c9)](a19_0xd7adc4[_0x41ade3(0x1bd)](_0x41ade3(0x1b2)+_0x3ff62c+'\x0a')),0x1;const _0x45df17=validateYamlFiles(_0x2ba920,_0x3ff62c,{'filterType':'campaign'}),_0x475c75=calculateSummary(_0x45df17),_0x37d9db=_0x45df17[_0x41ade3(0x1d0)](isValidationResult);if(_0x37d9db['length']===0x0)return console[_0x41ade3(0x1c9)](a19_0xd7adc4[_0x41ade3(0x1ac)](_0x41ade3(0x1d8)+_0x3ff62c+'\x0a')),_0x475c75['skippedCount']>0x0&&console[_0x41ade3(0x1c9)](a19_0xd7adc4['dim']('('+_0x475c75[_0x41ade3(0x1ce)]+_0x41ade3(0x1d5))),0x0;for(const _0x1472f6 of _0x45df17){if(!isValidationResult(_0x1472f6)){_0x26530a['verbose']&&console[_0x41ade3(0x1d6)](a19_0xd7adc4[_0x41ade3(0x1bf)]('-\x20'+_0x1472f6[_0x41ade3(0x1a7)]+_0x41ade3(0x1bb)+_0x1472f6[_0x41ade3(0x1cb)]+')'));continue;}const {relativePath:_0x5559f2,source:_0x5c890c,result:_0x343843}=_0x1472f6;if(_0x343843[_0x41ade3(0x1c8)]&&_0x343843['warnings']['length']===0x0)_0x26530a[_0x41ade3(0x1c5)]&&console[_0x41ade3(0x1d6)](a19_0xd7adc4[_0x41ade3(0x1cc)]('✔\x20'+_0x5559f2));else _0x343843[_0x41ade3(0x1c8)]?(console[_0x41ade3(0x1d6)](a19_0xd7adc4[_0x41ade3(0x1ac)]('⚠\x20'+_0x5559f2+':\x20'+_0x343843[_0x41ade3(0x1ba)]['length']+'\x20warning(s)')),console[_0x41ade3(0x1d6)](formatValidationResult(_0x343843,_0x5c890c,_0x5559f2))):(console[_0x41ade3(0x1d6)](a19_0xd7adc4[_0x41ade3(0x1bd)]('✖\x20'+_0x5559f2+':\x20'+_0x343843[_0x41ade3(0x1d7)][_0x41ade3(0x1c1)]+_0x41ade3(0x1c4))),console[_0x41ade3(0x1d6)](formatValidationResult(_0x343843,_0x5c890c,_0x5559f2)));}return console[_0x41ade3(0x1d6)](''),_0x475c75[_0x41ade3(0x1b9)]?(console['log'](a19_0xd7adc4[_0x41ade3(0x1bd)](_0x41ade3(0x1cf)+_0x475c75[_0x41ade3(0x1b0)]+_0x41ade3(0x1b7)+_0x475c75['validCount']+_0x41ade3(0x1b4))),_0x475c75[_0x41ade3(0x1a8)]>0x0&&console[_0x41ade3(0x1d6)](a19_0xd7adc4['yellow'](_0x475c75[_0x41ade3(0x1a8)]+_0x41ade3(0x1af))),_0x475c75['skippedCount']>0x0&&console['log'](a19_0xd7adc4[_0x41ade3(0x1bf)](_0x475c75[_0x41ade3(0x1ce)]+_0x41ade3(0x1b5))),0x1):(console[_0x41ade3(0x1d6)](a19_0xd7adc4[_0x41ade3(0x1cc)](_0x41ade3(0x1b6)+_0x475c75[_0x41ade3(0x1bc)]+_0x41ade3(0x1ab))),_0x475c75[_0x41ade3(0x1a8)]>0x0&&console[_0x41ade3(0x1d6)](a19_0xd7adc4[_0x41ade3(0x1ac)](_0x475c75[_0x41ade3(0x1a8)]+_0x41ade3(0x1af))),_0x475c75['skippedCount']>0x0&&console[_0x41ade3(0x1d6)](a19_0xd7adc4[_0x41ade3(0x1bf)](_0x475c75[_0x41ade3(0x1ce)]+_0x41ade3(0x1b5))),0x0);}}function a19_0x50e4(){const _0x523831=['Validation\x20failed:\x20','filter','name','32YWHggw','129783pPsZUQ','22WSnMBl','\x20non-campaign\x20file(s)\x20skipped)','log','errors','No\x20campaign\x20YAML\x20files\x20found\x20in\x20','relativePath','warningCount','13kAzGaa','26163732CGoWur','\x20campaign(s)\x20valid','yellow','1732996lEBpCL','6078hgPQge','\x20warning(s)\x20found','invalidCount','1367208cxrqnB','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Validate\x20campaign\x20YAML\x20files','\x20valid','\x20non-campaign\x20file(s)\x20skipped','✔\x20All\x20','\x20campaign(s)\x20with\x20errors,\x20','engage:campaign:validate','hasErrors','warnings','\x20(skipped:\x20','validCount','red','endsWith','dim','execute','length','9mMZazW','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20error(s)','verbose','290IvDRVK','659329XjwkYz','valid','error','6335riAClW','reason','green','9035125FvNIrp','skippedCount'];a19_0x50e4=function(){return _0x523831;};return a19_0x50e4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x36d42e=a20_0x4838;(function(_0x546503,_0x43d001){const _0x171db0=a20_0x4838,_0x447f2c=_0x546503();while(!![]){try{const _0x54df59=parseInt(_0x171db0(0xef))/0x1+-parseInt(_0x171db0(0xa6))/0x2+-parseInt(_0x171db0(0x92))/0x3+parseInt(_0x171db0(0xe7))/0x4*(parseInt(_0x171db0(0x8b))/0x5)+-parseInt(_0x171db0(0xa2))/0x6+parseInt(_0x171db0(0xd6))/0x7+-parseInt(_0x171db0(0xc3))/0x8;if(_0x54df59===_0x43d001)break;else _0x447f2c['push'](_0x447f2c['shift']());}catch(_0x31ee4b){_0x447f2c['push'](_0x447f2c['shift']());}}}(a20_0x1688,0x83ba6));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{readFileContent}from'../utils/file-reader.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';export async function resolveWorkspaceIdFromOptions(_0x48b137,_0xafffe5,_0x245f1b=![]){const _0x2a1f94=a20_0x4838;if(_0x48b137['workspace'])return await _0xafffe5[_0x2a1f94(0x69)][_0x2a1f94(0xad)](_0x48b137[_0x2a1f94(0x75)]);const _0x3ea4e5=loadSessionContext(_0x48b137[_0x2a1f94(0x7e)]);if(_0x3ea4e5?.[_0x2a1f94(0x6c)])return await _0xafffe5[_0x2a1f94(0x69)]['resolveWorkspaceId'](_0x3ea4e5[_0x2a1f94(0x6c)]);if(_0x245f1b)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x2a1f94(0x7d),undefined,{'helpText':_0x2a1f94(0xeb)});return undefined;}async function resolveSegmentFromOptions(_0x387c20,_0x2ec50f){const _0x3f7a24=a20_0x4838;if(!_0x387c20[_0x3f7a24(0x7f)])return{};const _0xc0559c=_0x387c20['segment'],_0x13f399=await _0x2ec50f[_0x3f7a24(0x7f)][_0x3f7a24(0x73)](_0xc0559c);return{'audienceId':_0x13f399[_0x3f7a24(0xb2)],'audienceName':_0x13f399['parentName'],..._0x13f399[_0x3f7a24(0xfb)]&&{'segmentId':_0x13f399[_0x3f7a24(0xfb)],'segmentName':_0x13f399[_0x3f7a24(0xfa)]}};}function buildConnectorConfig(_0x44f290){const _0xdeff16=a20_0x4838,_0x3022f3=_0x44f290[_0xdeff16(0xb9)],_0xd2407e=_0x44f290['jsonColumns'];if(!_0x3022f3&&!_0xd2407e)return undefined;return{..._0x3022f3&&{'emailSenderId':_0x3022f3},..._0xd2407e&&{'jsonColumns':_0xd2407e}};}export class EngageCampaignsCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0x6f);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0xba);async['execute'](_0x1cbeb9){const _0x35282d=a20_0x36d42e,{options:_0x455b00,args:_0x432140,tdx:_0x472f58}=_0x1cbeb9,_0x1e46c5=_0x432140[0x0],_0x5b2e7a=resolveLimit(_0x455b00[_0x35282d(0x96)],DEFAULT_LLM_LIMIT),_0x4c3486=_0x455b00,_0xd46b51=_0x4c3486[_0x35282d(0x79)],_0x2f46d6=_0x4c3486[_0x35282d(0xcb)],_0x41658c=await resolveWorkspaceIdFromOptions(_0x4c3486,_0x472f58),_0x100ef1=await withSpinner(_0x35282d(0x89),()=>_0x472f58[_0x35282d(0x69)]['listCampaigns']({'type':_0xd46b51,'status':_0x2f46d6,'workspaceId':_0x41658c,'limit':_0x5b2e7a}),{'verbose':_0x455b00[_0x35282d(0x85)]});let _0x2b2d74=_0x100ef1['data'];_0x1e46c5&&(_0x2b2d74=_0x100ef1[_0x35282d(0xf0)][_0x35282d(0xec)](_0x1f77e3=>matchGlobPattern(_0x1f77e3[_0x35282d(0x6d)],_0x1e46c5)));const _0x2568e3=_0x455b00[_0x35282d(0xb5)];if(_0x455b00['format']===_0x35282d(0xfe)||_0x455b00['format']===_0x35282d(0xd0)){const _0x31b2fe=_0x2b2d74['map'](_0x2103ac=>({..._0x2103ac,'url':_0x2103ac['workspaceId']?getCampaignUrl(_0x2568e3,_0x2103ac[_0x35282d(0xa7)],_0x2103ac['id']):undefined}));await handleSDKOutput(_0x31b2fe,_0x455b00);}else await handleSDKOutput(_0x2b2d74,_0x455b00);return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0xd5);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0xb3);async[a20_0x36d42e(0x9b)](_0x35e76c){const _0x1faa1c=a20_0x36d42e,{options:_0x361e16,args:_0x55bb00,tdx:_0x1add09}=_0x35e76c;if(_0x55bb00['length']===0x0)return console['error'](_0x1faa1c(0x88)),console[_0x1faa1c(0xda)](_0x1faa1c(0x90)),0x1;const _0x5bee4c=_0x55bb00[0x0],_0x22554c=_0x361e16,_0xa7acba=await resolveWorkspaceIdFromOptions(_0x22554c,_0x1add09),_0x356e00=_0x22554c[_0x1faa1c(0x70)],_0x33971b=_0x361e16[_0x1faa1c(0xb5)];if(_0x356e00){const _0x41d77b=await withSpinner(_0x1faa1c(0xb7)+_0x5bee4c+_0x1faa1c(0xaa),()=>_0x1add09[_0x1faa1c(0x69)][_0x1faa1c(0xa9)](_0x5bee4c,_0xa7acba),{'verbose':_0x361e16['verbose']}),_0x2e91da=_0x41d77b['data'],_0x195a84=_0x2e91da[_0x1faa1c(0xd4)][_0x1faa1c(0xa7)]?getCampaignUrl(_0x33971b,_0x2e91da[_0x1faa1c(0xd4)][_0x1faa1c(0xa7)],_0x2e91da['id']):undefined;await handleSDKOutput([{..._0x2e91da,..._0x195a84&&{'url':_0x195a84}}],_0x361e16);}else{const _0xfccefb=await withSpinner(_0x1faa1c(0xb7)+_0x5bee4c+'\x27...',()=>_0x1add09['engage'][_0x1faa1c(0xc2)](_0x5bee4c,_0xa7acba),{'verbose':_0x361e16[_0x1faa1c(0x85)]}),_0x30d70b=_0xfccefb[_0x1faa1c(0xf0)],_0x41dbc8=_0x30d70b[_0x1faa1c(0xa7)]?getCampaignUrl(_0x33971b,_0x30d70b[_0x1faa1c(0xa7)],_0x30d70b['id']):undefined;await handleSingleObjectOutput({..._0x30d70b,..._0x41dbc8&&{'url':_0x41dbc8}},_0x361e16);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0xf4);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0xb8);async[a20_0x36d42e(0x9b)](_0x57b7e1){const _0x176394=a20_0x36d42e,{options:_0x3a6d46,tdx:_0x220b89}=_0x57b7e1,_0x54193c=_0x3a6d46,_0x296440=_0x54193c[_0x176394(0x6d)],_0x1538bd=_0x54193c[_0x176394(0x79)];if(!_0x296440)return console[_0x176394(0xda)](_0x176394(0xf6)),console['error'](_0x176394(0xd8)),0x1;if(!_0x1538bd)return console['error'](_0x176394(0xd1)),console[_0x176394(0xda)](_0x176394(0xd8)),0x1;const _0x13b4a8=await resolveWorkspaceIdFromOptions(_0x54193c,_0x220b89,!![]),_0x5700ad=await resolveSegmentFromOptions(_0x54193c,_0x220b89),_0x3fdb85=buildConnectorConfig(_0x54193c),_0x34c9ea={'name':_0x296440,'campaignType':_0x1538bd,'workspaceId':_0x13b4a8,'description':_0x54193c[_0x176394(0x8f)],..._0x5700ad,'connectorConfig':_0x3fdb85,'startAt':_0x54193c[_0x176394(0x80)],'timezone':_0x54193c[_0x176394(0xa0)]},_0x3a6aed=await withSpinner(_0x176394(0xe6)+_0x296440+'\x27...',()=>_0x220b89[_0x176394(0x69)]['createCampaign'](_0x34c9ea));return await handleSDKOutput([_0x3a6aed[_0x176394(0xf0)]],_0x3a6d46),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a20_0x36d42e(0xc5);[a20_0x36d42e(0x8f)]='Update\x20a\x20campaign';async[a20_0x36d42e(0x9b)](_0x548d21){const _0x585421=a20_0x36d42e,{options:_0x226254,args:_0x1d0cfa,tdx:_0x312a51}=_0x548d21;if(_0x1d0cfa[_0x585421(0x8d)]===0x0)return console[_0x585421(0xda)](_0x585421(0x88)),console[_0x585421(0xda)]('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x34bfd5=_0x1d0cfa[0x0],_0x2c3d0d=_0x226254,_0x36a637=await resolveWorkspaceIdFromOptions(_0x2c3d0d,_0x312a51),_0x45c74d=await resolveSegmentFromOptions(_0x2c3d0d,_0x312a51),_0x763c3a=buildConnectorConfig(_0x2c3d0d),_0x3fb76f={'name':_0x2c3d0d[_0x585421(0x6d)],'description':_0x2c3d0d[_0x585421(0x8f)],..._0x45c74d,'connectorConfig':_0x763c3a,'startAt':_0x2c3d0d[_0x585421(0x80)],'timezone':_0x2c3d0d[_0x585421(0xa0)]},_0x48fe47=Object[_0x585421(0xae)](Object['entries'](_0x3fb76f)[_0x585421(0xec)](([,_0x35a98a])=>_0x35a98a!==undefined));if(Object[_0x585421(0x82)](_0x48fe47)[_0x585421(0x8d)]===0x0)return console[_0x585421(0xda)](_0x585421(0xc6)),console['error'](_0x585421(0xa4)),0x1;const _0x16e01a=await withSpinner(_0x585421(0xc8)+_0x34bfd5+_0x585421(0xaa),()=>_0x312a51[_0x585421(0x69)][_0x585421(0xe1)](_0x34bfd5,_0x48fe47,_0x36a637),{'verbose':_0x226254[_0x585421(0x85)]});return await handleSDKOutput([_0x16e01a[_0x585421(0xf0)]],_0x226254),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']=a20_0x36d42e(0xff);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0xee);async[a20_0x36d42e(0x9b)](_0x5e9f68){const _0x2a9b4a=a20_0x36d42e,{options:_0x3b2fff,args:_0x72f76d,tdx:_0x102e5a}=_0x5e9f68;if(_0x72f76d[_0x2a9b4a(0x8d)]===0x0)return console['error'](_0x2a9b4a(0x88)),console[_0x2a9b4a(0xda)](_0x2a9b4a(0xcf)),0x1;const _0x313395=_0x72f76d[0x0],_0x50397e=_0x3b2fff,_0x336a13=await resolveWorkspaceIdFromOptions(_0x50397e,_0x102e5a);if(!_0x3b2fff['yes']){const _0x2bd6db=await confirm(_0x2a9b4a(0xcc)+_0x313395+_0x2a9b4a(0x76));if(!_0x2bd6db)return console[_0x2a9b4a(0x8c)](_0x2a9b4a(0xaf)),0x0;}return await withSpinner(_0x2a9b4a(0xab)+_0x313395+_0x2a9b4a(0xaa),()=>_0x102e5a[_0x2a9b4a(0x69)][_0x2a9b4a(0x9a)](_0x313395,_0x336a13),{'verbose':_0x3b2fff['verbose']}),console[_0x2a9b4a(0x8c)](_0x2a9b4a(0x94)+_0x313395+_0x2a9b4a(0x97)),0x0;}}function a20_0x4838(_0x4b4fbe,_0x3c50d4){_0x4b4fbe=_0x4b4fbe-0x68;const _0x1688f0=a20_0x1688();let _0x48383a=_0x1688f0[_0x4b4fbe];return _0x48383a;}export class EngageCampaignLaunchCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0x78);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0x7a);async[a20_0x36d42e(0x9b)](_0x4160eb){const _0x4f9ba8=a20_0x36d42e,{options:_0x3e47e4,args:_0x37f339,tdx:_0x315211}=_0x4160eb;if(_0x37f339[_0x4f9ba8(0x8d)]===0x0)return console[_0x4f9ba8(0xda)](_0x4f9ba8(0x88)),console[_0x4f9ba8(0xda)](_0x4f9ba8(0xd7)),0x1;const _0x444c92=_0x37f339[0x0],_0x5f46ab=_0x3e47e4,_0x4ecf73=await resolveWorkspaceIdFromOptions(_0x5f46ab,_0x315211);return await withSpinner(_0x4f9ba8(0x99)+_0x444c92+'\x27...',()=>_0x315211[_0x4f9ba8(0x69)][_0x4f9ba8(0xe2)](_0x444c92,_0x4ecf73),{'verbose':_0x3e47e4[_0x4f9ba8(0x85)]}),console[_0x4f9ba8(0x8c)](_0x4f9ba8(0x94)+_0x444c92+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0xac);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0xc9);async[a20_0x36d42e(0x9b)](_0x375e06){const _0x50e665=a20_0x36d42e,{options:_0x2fa8e6,args:_0x15bfe5,tdx:_0x4dbb4b}=_0x375e06;if(_0x15bfe5['length']===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x3fc93b=_0x15bfe5[0x0],_0x181d90=_0x2fa8e6,_0x1565e5=await resolveWorkspaceIdFromOptions(_0x181d90,_0x4dbb4b);return await withSpinner(_0x50e665(0x9c)+_0x3fc93b+_0x50e665(0xaa),()=>_0x4dbb4b[_0x50e665(0x69)][_0x50e665(0xce)](_0x3fc93b,_0x1565e5),{'verbose':_0x2fa8e6[_0x50e665(0x85)]}),console[_0x50e665(0x8c)](_0x50e665(0x94)+_0x3fc93b+_0x50e665(0x98)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{['name']=a20_0x36d42e(0xf7);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0x91);async['execute'](_0x1d48e8){const _0x28502f=a20_0x36d42e,{options:_0x3c61b0,args:_0x53979e,tdx:_0x273ae8}=_0x1d48e8;if(_0x53979e[_0x28502f(0x8d)]===0x0)return console['error'](_0x28502f(0x88)),console[_0x28502f(0xda)]('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0x513a6f=_0x53979e[0x0],_0x57882d=_0x3c61b0,_0x2617d3=await resolveWorkspaceIdFromOptions(_0x57882d,_0x273ae8);return await withSpinner('Resuming\x20campaign\x20\x27'+_0x513a6f+_0x28502f(0xaa),()=>_0x273ae8[_0x28502f(0x69)][_0x28502f(0x71)](_0x513a6f,_0x2617d3),{'verbose':_0x3c61b0[_0x28502f(0x85)]}),console[_0x28502f(0x8c)](_0x28502f(0x94)+_0x513a6f+_0x28502f(0x86)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']='engage:campaign:duplicate';['description']=a20_0x36d42e(0xa5);async[a20_0x36d42e(0x9b)](_0xbc209b){const _0x560ae9=a20_0x36d42e,{options:_0x4b052d,args:_0x2677db,tdx:_0x4049a9}=_0xbc209b;if(_0x2677db[_0x560ae9(0x8d)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x560ae9(0xda)](_0x560ae9(0xb0)),0x1;const _0x680875=_0x2677db[0x0],_0x58048d=_0x4b052d,_0x49fde4=await resolveWorkspaceIdFromOptions(_0x58048d,_0x4049a9),_0xd87a5f=await withSpinner(_0x560ae9(0xa3)+_0x680875+_0x560ae9(0xaa),()=>_0x4049a9['engage'][_0x560ae9(0xed)](_0x680875,_0x49fde4),{'verbose':_0x4b052d[_0x560ae9(0x85)]});return await handleSDKOutput([_0xd87a5f[_0x560ae9(0xf0)]],_0x4b052d),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0xc0);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0x9e);async['execute'](_0x179397){const _0x21ca7f=a20_0x36d42e,{options:_0x1f254d,args:_0x1d5717,tdx:_0x33c2e3}=_0x179397,_0x189e22=_0x1d5717[0x0],_0x31767c=resolveLimit(_0x1f254d[_0x21ca7f(0x96)],DEFAULT_LLM_LIMIT),_0x1d1a71=_0x1f254d,_0x43130f=await resolveWorkspaceIdFromOptions(_0x1d1a71,_0x33c2e3),_0x2d9aaa=await withSpinner('Fetching\x20templates...',()=>_0x33c2e3['engage'][_0x21ca7f(0xfc)]({'workspaceId':_0x43130f,'limit':_0x31767c}),{'verbose':_0x1f254d[_0x21ca7f(0x85)]});let _0x5cd14c=_0x2d9aaa[_0x21ca7f(0xf0)];return _0x189e22&&(_0x5cd14c=_0x2d9aaa[_0x21ca7f(0xf0)][_0x21ca7f(0xec)](_0x4e867b=>matchGlobPattern(_0x4e867b[_0x21ca7f(0x6d)],_0x189e22))),await handleSDKOutput(_0x5cd14c,_0x1f254d),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']='engage:template:show';[a20_0x36d42e(0x8f)]='Show\x20email\x20template\x20details';async[a20_0x36d42e(0x9b)](_0x54dc89){const _0x38198e=a20_0x36d42e,{options:_0x5bd37b,args:_0x38dd3f,tdx:_0x695bf6}=_0x54dc89;if(_0x38dd3f['length']===0x0)return console[_0x38198e(0xda)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x38198e(0xda)](_0x38198e(0xcd)),0x1;const _0x4797b8=_0x38dd3f[0x0],_0x4b1592=_0x5bd37b,_0x3f6334=await resolveWorkspaceIdFromOptions(_0x4b1592,_0x695bf6),_0x2415ba=_0x4b1592['full'];if(_0x2415ba){const _0x211837=await withSpinner(_0x38198e(0xb1)+_0x4797b8+_0x38198e(0xaa),()=>_0x695bf6[_0x38198e(0x69)]['getTemplateFull'](_0x4797b8,_0x3f6334),{'verbose':_0x5bd37b[_0x38198e(0x85)]});await handleSDKOutput([_0x211837],_0x5bd37b);}else{const _0x511880=await withSpinner(_0x38198e(0xb1)+_0x4797b8+_0x38198e(0xaa),()=>_0x695bf6[_0x38198e(0x69)]['getTemplate'](_0x4797b8,_0x3f6334),{'verbose':_0x5bd37b[_0x38198e(0x85)]});await handleSDKOutput([_0x511880],_0x5bd37b);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a20_0x36d42e(0x6d)]='engage:template:create';['description']=a20_0x36d42e(0xbf);async[a20_0x36d42e(0x9b)](_0x4cd86e){const _0x45f84c=a20_0x36d42e,{options:_0x2823cd,tdx:_0x31dfdc}=_0x4cd86e,_0xb1e2db=_0x2823cd,_0xbe1d0a=_0xb1e2db[_0x45f84c(0x6d)],_0xf8cd7=_0xb1e2db['subject'],_0x485cb4=_0xb1e2db[_0x45f84c(0xb6)],_0x5194b6=_0xb1e2db[_0x45f84c(0xc1)];if(!_0xbe1d0a)return console[_0x45f84c(0xda)](_0x45f84c(0xf6)),console['error'](_0x45f84c(0xdb)),0x1;if(!_0xf8cd7)return console[_0x45f84c(0xda)](_0x45f84c(0x87)),0x1;if(_0x485cb4&&_0x5194b6)return console[_0x45f84c(0xda)](_0x45f84c(0xd2)),0x1;const _0x26ff5e=_0x5194b6?readFileContent(_0x5194b6):_0x485cb4;if(!_0x26ff5e)return console[_0x45f84c(0xda)](_0x45f84c(0xf1)),0x1;const _0x2e4ce2=await resolveWorkspaceIdFromOptions(_0xb1e2db,_0x31dfdc,!![]),_0x12b2f9={'name':_0xbe1d0a,'subjectTemplate':_0xf8cd7,'htmlTemplate':_0x26ff5e,'workspaceId':_0x2e4ce2,'plaintextTemplate':_0xb1e2db['plaintext'],'editorType':_0xb1e2db[_0x45f84c(0xc7)]},_0x3538cd=await withSpinner(_0x45f84c(0xa8)+_0xbe1d0a+'\x27...',()=>_0x31dfdc[_0x45f84c(0x69)]['createTemplate'](_0x12b2f9));return await handleSDKOutput([_0x3538cd[_0x45f84c(0xf0)]],_0x2823cd),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0xbe);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0xdf);async['execute'](_0x6fa08e){const _0x2ff297=a20_0x36d42e,{options:_0xd1faa7,args:_0x3611cf,tdx:_0x37ca13}=_0x6fa08e;if(_0x3611cf[_0x2ff297(0x8d)]===0x0)return console[_0x2ff297(0xda)](_0x2ff297(0xe5)),console['error'](_0x2ff297(0x8e)),0x1;const _0x105ab3=_0x3611cf[0x0],_0x1ae159=_0xd1faa7,_0x58c968=_0x1ae159[_0x2ff297(0xb6)],_0x4f2f8f=_0x1ae159[_0x2ff297(0xc1)];if(_0x58c968&&_0x4f2f8f)return console[_0x2ff297(0xda)](_0x2ff297(0xd2)),0x1;const _0x5e1026=_0x4f2f8f?readFileContent(_0x4f2f8f):_0x58c968,_0x5c936a=await resolveWorkspaceIdFromOptions(_0x1ae159,_0x37ca13),_0x2dd0ef={'name':_0x1ae159[_0x2ff297(0x6d)],'subjectTemplate':_0x1ae159['subject'],'htmlTemplate':_0x5e1026,'plaintextTemplate':_0x1ae159[_0x2ff297(0xa1)]},_0x3903ed=Object[_0x2ff297(0xae)](Object['entries'](_0x2dd0ef)[_0x2ff297(0xec)](([,_0x252a0d])=>_0x252a0d!==undefined));if(Object[_0x2ff297(0x82)](_0x3903ed)[_0x2ff297(0x8d)]===0x0)return console['error'](_0x2ff297(0xc6)),console[_0x2ff297(0xda)]('Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext'),0x1;const _0x238d40=await withSpinner('Updating\x20template\x20\x27'+_0x105ab3+'\x27...',()=>_0x37ca13['engage'][_0x2ff297(0x6e)](_0x105ab3,_0x3903ed,_0x5c936a),{'verbose':_0xd1faa7[_0x2ff297(0x85)]});return await handleSDKOutput([_0x238d40[_0x2ff297(0xf0)]],_0xd1faa7),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0x7b);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0x84);async[a20_0x36d42e(0x9b)](_0x309edf){const _0x34d343=a20_0x36d42e,{options:_0x5b57fd,args:_0xaa3a9,tdx:_0x157fb0}=_0x309edf;if(_0xaa3a9[_0x34d343(0x8d)]===0x0)return console[_0x34d343(0xda)](_0x34d343(0xe5)),console[_0x34d343(0xda)](_0x34d343(0x68)),0x1;const _0x4097aa=_0xaa3a9[0x0],_0x3cd9fb=_0x5b57fd,_0x36aca2=await resolveWorkspaceIdFromOptions(_0x3cd9fb,_0x157fb0);if(!_0x5b57fd[_0x34d343(0xca)]){const _0x2c9b10=await confirm(_0x34d343(0xbb)+_0x4097aa+_0x34d343(0x76));if(!_0x2c9b10)return console[_0x34d343(0x8c)](_0x34d343(0xaf)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x4097aa+'\x27...',()=>_0x157fb0[_0x34d343(0x69)][_0x34d343(0xdd)](_0x4097aa,_0x36aca2),{'verbose':_0x5b57fd[_0x34d343(0x85)]}),console['log'](_0x34d343(0xde)+_0x4097aa+_0x34d343(0x97)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0xc4);['description']=a20_0x36d42e(0xf3);async[a20_0x36d42e(0x9b)](_0x3578c2){const _0x581f3d=a20_0x36d42e,{options:_0x45c9eb,args:_0x2773ea,tdx:_0x151a2e}=_0x3578c2,_0x11ac9f=_0x2773ea[0x0],_0x2ade1e=resolveLimit(_0x45c9eb['limit'],DEFAULT_LLM_LIMIT),_0x593d06=await withSpinner('Fetching\x20workspaces...',()=>_0x151a2e[_0x581f3d(0x69)][_0x581f3d(0xe8)]({'limit':_0x2ade1e}),{'verbose':_0x45c9eb[_0x581f3d(0x85)]});let _0x4655b2=_0x593d06['data'];return _0x11ac9f&&(_0x4655b2=_0x593d06[_0x581f3d(0xf0)][_0x581f3d(0xec)](_0x44e1df=>matchGlobPattern(_0x44e1df[_0x581f3d(0x6d)],_0x11ac9f))),await handleSDKOutput(_0x4655b2,_0x45c9eb),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0x81);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0x9d);async['execute'](_0xc4a424){const _0x38925f=a20_0x36d42e,{options:_0x3d108a,args:_0x232885,tdx:_0x32252e}=_0xc4a424;if(_0x232885[_0x38925f(0x8d)]===0x0)return console[_0x38925f(0xda)](_0x38925f(0x83)),console[_0x38925f(0xda)](_0x38925f(0x93)),0x1;const _0x3998e6=_0x232885[0x0],_0x40a6b7=_0x3d108a,_0x3a907d=_0x40a6b7['full'];if(_0x3a907d){const _0x4b85d3=await withSpinner('Fetching\x20workspace\x20\x27'+_0x3998e6+'\x27...',()=>_0x32252e[_0x38925f(0x69)][_0x38925f(0xea)](_0x3998e6),{'verbose':_0x3d108a[_0x38925f(0x85)]});await handleSDKOutput([_0x4b85d3],_0x3d108a);}else{const _0x38cae8=await withSpinner(_0x38925f(0x6b)+_0x3998e6+_0x38925f(0xaa),()=>_0x32252e[_0x38925f(0x69)][_0x38925f(0xf5)](_0x3998e6),{'verbose':_0x3d108a[_0x38925f(0x85)]});await handleSDKOutput([_0x38cae8],_0x3d108a);}return 0x0;}}function a20_0x1688(){const _0x372093=['Fetching\x20workspace\x20\x27','engage_workspace','name','updateTemplate','engage:campaigns','full','resumeCampaign','Options:\x20--name,\x20--description','resolvePathToResource','engage:workspace:update','workspace','\x27?\x20This\x20cannot\x20be\x20undone.','Update\x20a\x20workspace','engage:campaign:launch','type','Launch\x20a\x20campaign','engage:template:delete','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','Workspace\x20is\x20required\x20for\x20this\x20operation','session','segment','startAt','engage:workspace:show','keys','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Delete\x20an\x20email\x20template','verbose','\x27\x20resumed\x20successfully','Error:\x20--subject\x20is\x20required','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Fetching\x20campaigns...','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','8220hLcmio','log','length','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','description','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Resume\x20a\x20paused\x20campaign','1540839tjDVTI','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Campaign\x20\x27','entries','limit','\x27\x20deleted\x20successfully','\x27\x20paused\x20successfully','Launching\x20campaign\x20\x27','deleteCampaign','execute','Pausing\x20campaign\x20\x27','Show\x20workspace\x20details','List\x20email\x20templates','Delete\x20a\x20workspace','timezone','plaintext','3549108lwHgxF','Duplicating\x20campaign\x20\x27','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','Duplicate\x20a\x20campaign','1263312qYGJgS','workspaceId','Creating\x20template\x20\x27','getCampaignFull','\x27...','Deleting\x20campaign\x20\x27','engage:campaign:pause','resolveWorkspaceId','fromEntries','Operation\x20cancelled','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Fetching\x20template\x20\x27','parentId','Show\x20campaign\x20details','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','site','html','Fetching\x20campaign\x20\x27','Create\x20a\x20new\x20campaign','emailSenderId','List\x20campaigns','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','Verifying\x20workspace\x20\x27','Creating\x20workspace\x20\x27','engage:template:update','Create\x20an\x20email\x20template','engage:templates','htmlFile','getCampaign','2049688UFANZu','engage:workspaces','engage:campaign:update','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','editorType','Updating\x20campaign\x20\x27','Pause\x20a\x20campaign','yes','status','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','pauseCampaign','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','jsonl','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','engage:workspace:use','attributes','engage:campaign:show','4922477NYYnmC','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Workspace\x20\x27','error','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','Create\x20a\x20workspace','deleteTemplate','Template\x20\x27','Update\x20an\x20email\x20template','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','updateCampaign','launchCampaign','Updating\x20workspace\x20\x27','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Creating\x20campaign\x20\x27','2240MAkWRi','listWorkspaces','Deleting\x20workspace\x20\x27','getWorkspaceFull','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','filter','duplicateCampaign','Delete\x20a\x20campaign','908705xaxvHI','data','Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required','createWorkspace','List\x20workspaces','engage:campaign:create','getWorkspace','Error:\x20--name\x20is\x20required','engage:campaign:resume','updateWorkspace','Error:\x20Workspace\x20name\x20is\x20required','segmentName','segmentId','listTemplates','deleteWorkspace','json','engage:campaign:delete','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','engage','engage:workspace:create'];a20_0x1688=function(){return _0x372093;};return a20_0x1688();}export class EngageWorkspaceCreateCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0x6a);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0xdc);async[a20_0x36d42e(0x9b)](_0xbef710){const _0x1a226f=a20_0x36d42e,{options:_0x6cdf0,tdx:_0x497960}=_0xbef710,_0x3e3338=_0x6cdf0,_0x38d7d1=_0x3e3338[_0x1a226f(0x6d)];if(!_0x38d7d1)return console[_0x1a226f(0xda)](_0x1a226f(0xf6)),console[_0x1a226f(0xda)](_0x1a226f(0xe0)),0x1;const _0xeb940c={'name':_0x38d7d1,'description':_0x3e3338[_0x1a226f(0x8f)]},_0x2582a1=await withSpinner(_0x1a226f(0xbd)+_0x38d7d1+_0x1a226f(0xaa),()=>_0x497960['engage'][_0x1a226f(0xf2)](_0xeb940c));return await handleSDKOutput([_0x2582a1[_0x1a226f(0xf0)]],_0x6cdf0),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0x74);[a20_0x36d42e(0x8f)]=a20_0x36d42e(0x77);async['execute'](_0x5bbc45){const _0x2d2604=a20_0x36d42e,{options:_0x17d4cc,args:_0x4ee924,tdx:_0x597134}=_0x5bbc45;if(_0x4ee924['length']===0x0)return console[_0x2d2604(0xda)](_0x2d2604(0x83)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x1ae048=_0x4ee924[0x0],_0x15eccc=_0x17d4cc,_0x3d0215={'name':_0x15eccc['name'],'description':_0x15eccc[_0x2d2604(0x8f)]},_0x1c0b27=Object['fromEntries'](Object[_0x2d2604(0x95)](_0x3d0215)[_0x2d2604(0xec)](([,_0x479eef])=>_0x479eef!==undefined));if(Object[_0x2d2604(0x82)](_0x1c0b27)[_0x2d2604(0x8d)]===0x0)return console['error'](_0x2d2604(0xc6)),console[_0x2d2604(0xda)](_0x2d2604(0x72)),0x1;const _0x37fe9f=await withSpinner(_0x2d2604(0xe3)+_0x1ae048+_0x2d2604(0xaa),()=>_0x597134[_0x2d2604(0x69)][_0x2d2604(0xf8)](_0x1ae048,_0x1c0b27),{'verbose':_0x17d4cc[_0x2d2604(0x85)]});return await handleSDKOutput([_0x37fe9f[_0x2d2604(0xf0)]],_0x17d4cc),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a20_0x36d42e(0x6d)]='engage:workspace:delete';['description']=a20_0x36d42e(0x9f);async[a20_0x36d42e(0x9b)](_0x235fb1){const _0x1ae548=a20_0x36d42e,{options:_0x18bd22,args:_0x9fb244,tdx:_0x36afec}=_0x235fb1;if(_0x9fb244['length']===0x0)return console[_0x1ae548(0xda)](_0x1ae548(0x83)),console[_0x1ae548(0xda)](_0x1ae548(0x8a)),0x1;const _0x2c8177=_0x9fb244[0x0];if(!_0x18bd22[_0x1ae548(0xca)]){const _0x4f2cf9=await confirm(_0x1ae548(0xb4)+_0x2c8177+_0x1ae548(0x76));if(!_0x4f2cf9)return console[_0x1ae548(0x8c)](_0x1ae548(0xaf)),0x0;}return await withSpinner(_0x1ae548(0xe9)+_0x2c8177+_0x1ae548(0xaa),()=>_0x36afec['engage'][_0x1ae548(0xfd)](_0x2c8177),{'verbose':_0x18bd22[_0x1ae548(0x85)]}),console[_0x1ae548(0x8c)](_0x1ae548(0xd9)+_0x2c8177+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a20_0x36d42e(0x6d)]=a20_0x36d42e(0xd3);[a20_0x36d42e(0x8f)]='Set\x20workspace\x20context\x20for\x20Engage\x20commands';async[a20_0x36d42e(0x9b)](_0x8f3647){const _0x1b55ad=a20_0x36d42e,{options:_0x13ff82,args:_0x85f230,tdx:_0xeeffcd}=_0x8f3647;if(_0x85f230[_0x1b55ad(0x8d)]===0x0)return console[_0x1b55ad(0xda)](_0x1b55ad(0xf9)),console[_0x1b55ad(0xda)](_0x1b55ad(0x7c)),0x1;const _0xee46f1=_0x85f230[0x0];await withSpinner(_0x1b55ad(0xbc)+_0xee46f1+_0x1b55ad(0xaa),()=>_0xeeffcd[_0x1b55ad(0x69)][_0x1b55ad(0xad)](_0xee46f1));const _0x4e104f=_0x13ff82[_0x1b55ad(0x7e)]||undefined;return saveSessionContext({'engage_workspace':_0xee46f1},_0x4e104f),console[_0x1b55ad(0x8c)]('Engage\x20workspace\x20set\x20to:\x20'+_0xee46f1),console['log'](_0x1b55ad(0xe4)),0x0;}}
|
|
1
|
+
const a20_0x33cdc2=a20_0x2557;(function(_0x1f3682,_0x3b4a5e){const _0x2a5447=a20_0x2557,_0x4a09c2=_0x1f3682();while(!![]){try{const _0x219d7d=-parseInt(_0x2a5447(0x1ca))/0x1*(parseInt(_0x2a5447(0x1e6))/0x2)+-parseInt(_0x2a5447(0x178))/0x3+parseInt(_0x2a5447(0x207))/0x4+parseInt(_0x2a5447(0x20c))/0x5*(parseInt(_0x2a5447(0x187))/0x6)+parseInt(_0x2a5447(0x17f))/0x7+-parseInt(_0x2a5447(0x1ae))/0x8+parseInt(_0x2a5447(0x1d6))/0x9;if(_0x219d7d===_0x3b4a5e)break;else _0x4a09c2['push'](_0x4a09c2['shift']());}catch(_0x5d377e){_0x4a09c2['push'](_0x4a09c2['shift']());}}}(a20_0x5f36,0x4dc2e));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';function a20_0x2557(_0x399d65,_0x5b087a){_0x399d65=_0x399d65-0x172;const _0x5f3662=a20_0x5f36();let _0x255731=_0x5f3662[_0x399d65];return _0x255731;}import{readFileContent}from'../utils/file-reader.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';export async function resolveWorkspaceIdFromOptions(_0x18c336,_0x544a05,_0x25c07a=![]){const _0x21271d=a20_0x2557;if(_0x18c336[_0x21271d(0x18a)])return await _0x544a05['engage'][_0x21271d(0x1c7)](_0x18c336['workspace']);const _0x46dd36=loadSessionContext(_0x18c336['session']);if(_0x46dd36?.[_0x21271d(0x1b5)])return await _0x544a05['engage'][_0x21271d(0x1c7)](_0x46dd36[_0x21271d(0x1b5)]);if(_0x25c07a)throw new SDKError(ErrorCode[_0x21271d(0x1b0)],_0x21271d(0x18d),undefined,{'helpText':_0x21271d(0x1be)});return undefined;}async function resolveSegmentFromOptions(_0x116573,_0x280da2){const _0x5bee9a=a20_0x2557;if(!_0x116573[_0x5bee9a(0x1ba)])return{};const _0x3c8d40=_0x116573[_0x5bee9a(0x1ba)],_0x3d503c=await _0x280da2[_0x5bee9a(0x1ba)][_0x5bee9a(0x1bf)](_0x3c8d40);return{'audienceId':_0x3d503c[_0x5bee9a(0x1d9)],'audienceName':_0x3d503c['parentName'],..._0x3d503c[_0x5bee9a(0x1af)]&&{'segmentId':_0x3d503c[_0x5bee9a(0x1af)],'segmentName':_0x3d503c[_0x5bee9a(0x1fa)]}};}function buildConnectorConfig(_0x20bd47){const _0x18a1c1=a20_0x2557,_0x3104c1=_0x20bd47[_0x18a1c1(0x172)],_0x43533f=_0x20bd47[_0x18a1c1(0x1a2)];if(!_0x3104c1&&!_0x43533f)return undefined;return{..._0x3104c1&&{'emailSenderId':_0x3104c1},..._0x43533f&&{'jsonColumns':_0x43533f}};}export class EngageCampaignsCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x19f);['description']='List\x20campaigns';async[a20_0x33cdc2(0x1eb)](_0x3d5d8c){const _0x3524d3=a20_0x33cdc2,{options:_0x425c05,args:_0x3e7ff8,tdx:_0x3b5cec}=_0x3d5d8c,_0x10adad=_0x3e7ff8[0x0],_0x50a666=resolveLimit(_0x425c05['limit'],DEFAULT_LLM_LIMIT),_0x43effe=_0x425c05,_0x1224b9=_0x43effe['type'],_0xe6a5be=_0x43effe[_0x3524d3(0x1d5)],_0x22dd38=await resolveWorkspaceIdFromOptions(_0x43effe,_0x3b5cec),_0x5eeb0f=await withSpinner(_0x3524d3(0x1f8),()=>_0x3b5cec[_0x3524d3(0x1bc)]['listCampaigns']({'type':_0x1224b9,'status':_0xe6a5be,'workspaceId':_0x22dd38,'limit':_0x50a666}),{'verbose':_0x425c05[_0x3524d3(0x176)]});let _0x2f2d9d=_0x5eeb0f[_0x3524d3(0x1ac)];_0x10adad&&(_0x2f2d9d=_0x5eeb0f[_0x3524d3(0x1ac)][_0x3524d3(0x175)](_0x19ec6d=>matchGlobPattern(_0x19ec6d[_0x3524d3(0x1c2)],_0x10adad)));const _0x5ec584=_0x425c05['site'];if(_0x425c05[_0x3524d3(0x1ff)]===_0x3524d3(0x1e7)||_0x425c05[_0x3524d3(0x1ff)]===_0x3524d3(0x201)){const _0x554c8f=_0x2f2d9d[_0x3524d3(0x1ab)](_0x57701e=>({..._0x57701e,'url':_0x57701e[_0x3524d3(0x1b7)]?getCampaignUrl(_0x5ec584,_0x57701e[_0x3524d3(0x1b7)],_0x57701e['id']):undefined}));await handleSDKOutput(_0x554c8f,_0x425c05);}else await handleSDKOutput(_0x2f2d9d,_0x425c05);return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{['name']=a20_0x33cdc2(0x1b4);['description']=a20_0x33cdc2(0x1a3);async[a20_0x33cdc2(0x1eb)](_0x198433){const _0x4b6403=a20_0x33cdc2,{options:_0x2ebee9,args:_0x2761ae,tdx:_0x50d924}=_0x198433;if(_0x2761ae[_0x4b6403(0x1b3)]===0x0)return console[_0x4b6403(0x183)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x4b6403(0x183)](_0x4b6403(0x199)),0x1;const _0xf78855=_0x2761ae[0x0],_0x430b4d=_0x2ebee9,_0x5874e0=await resolveWorkspaceIdFromOptions(_0x430b4d,_0x50d924),_0x5eed04=_0x430b4d['full'],_0x1f785d=_0x2ebee9['site'];if(_0x5eed04){const _0x50643=await withSpinner('Fetching\x20campaign\x20\x27'+_0xf78855+_0x4b6403(0x1ad),()=>_0x50d924['engage'][_0x4b6403(0x173)](_0xf78855,_0x5874e0),{'verbose':_0x2ebee9['verbose']}),_0x362be9=_0x50643[_0x4b6403(0x1ac)],_0x217129=_0x362be9['attributes']['workspaceId']?getCampaignUrl(_0x1f785d,_0x362be9[_0x4b6403(0x1a4)]['workspaceId'],_0x362be9['id']):undefined;await handleSDKOutput([{..._0x362be9,..._0x217129&&{'url':_0x217129}}],_0x2ebee9);}else{const _0xefd169=await withSpinner(_0x4b6403(0x1b8)+_0xf78855+'\x27...',()=>_0x50d924[_0x4b6403(0x1bc)][_0x4b6403(0x200)](_0xf78855,_0x5874e0),{'verbose':_0x2ebee9[_0x4b6403(0x176)]}),_0xab83ce=_0xefd169[_0x4b6403(0x1ac)],_0x28cc68=_0xab83ce[_0x4b6403(0x1b7)]?getCampaignUrl(_0x1f785d,_0xab83ce[_0x4b6403(0x1b7)],_0xab83ce['id']):undefined;await handleSingleObjectOutput({..._0xab83ce,..._0x28cc68&&{'url':_0x28cc68}},_0x2ebee9);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x181);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x179);async[a20_0x33cdc2(0x1eb)](_0x3eb4aa){const _0x3f8785=a20_0x33cdc2,{options:_0x1cceb5,tdx:_0x111a32}=_0x3eb4aa,_0x2d0b67=_0x1cceb5,_0xeb8071=_0x2d0b67['name'],_0x4d7f55=_0x2d0b67[_0x3f8785(0x1c0)];if(!_0xeb8071)return console['error']('Error:\x20--name\x20is\x20required'),console['error'](_0x3f8785(0x1e1)),0x1;if(!_0x4d7f55)return console['error'](_0x3f8785(0x1ce)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x4e42e1=await resolveWorkspaceIdFromOptions(_0x2d0b67,_0x111a32,!![]),_0x4b70a8=await resolveSegmentFromOptions(_0x2d0b67,_0x111a32),_0x42165c=buildConnectorConfig(_0x2d0b67),_0x429e58={'name':_0xeb8071,'campaignType':_0x4d7f55,'workspaceId':_0x4e42e1,'description':_0x2d0b67[_0x3f8785(0x1d3)],..._0x4b70a8,'connectorConfig':_0x42165c,'startAt':_0x2d0b67[_0x3f8785(0x198)],'timezone':_0x2d0b67[_0x3f8785(0x1db)]},_0x4983b5=await withSpinner(_0x3f8785(0x1dd)+_0xeb8071+_0x3f8785(0x1ad),()=>_0x111a32[_0x3f8785(0x1bc)][_0x3f8785(0x1e9)](_0x429e58));return await handleSDKOutput([_0x4983b5[_0x3f8785(0x1ac)]],_0x1cceb5),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']='engage:campaign:update';[a20_0x33cdc2(0x1d3)]='Update\x20a\x20campaign';async[a20_0x33cdc2(0x1eb)](_0x28dd5d){const _0x344039=a20_0x33cdc2,{options:_0x160ecb,args:_0x4e608c,tdx:_0x5165a3}=_0x28dd5d;if(_0x4e608c['length']===0x0)return console[_0x344039(0x183)](_0x344039(0x191)),console[_0x344039(0x183)](_0x344039(0x1f1)),0x1;const _0x2d4674=_0x4e608c[0x0],_0x3a8c0e=_0x160ecb,_0x30fc8e=await resolveWorkspaceIdFromOptions(_0x3a8c0e,_0x5165a3),_0x1a8595=await resolveSegmentFromOptions(_0x3a8c0e,_0x5165a3),_0x367303=buildConnectorConfig(_0x3a8c0e),_0x4432aa={'name':_0x3a8c0e['name'],'description':_0x3a8c0e[_0x344039(0x1d3)],..._0x1a8595,'connectorConfig':_0x367303,'startAt':_0x3a8c0e[_0x344039(0x198)],'timezone':_0x3a8c0e[_0x344039(0x1db)]},_0x25596e=Object[_0x344039(0x1f4)](Object['entries'](_0x4432aa)[_0x344039(0x175)](([,_0x186d2f])=>_0x186d2f!==undefined));if(Object['keys'](_0x25596e)['length']===0x0)return console[_0x344039(0x183)](_0x344039(0x1c1)),console[_0x344039(0x183)](_0x344039(0x1a9)),0x1;const _0x4ca839=await withSpinner('Updating\x20campaign\x20\x27'+_0x2d4674+_0x344039(0x1ad),()=>_0x5165a3[_0x344039(0x1bc)][_0x344039(0x18b)](_0x2d4674,_0x25596e,_0x30fc8e),{'verbose':_0x160ecb[_0x344039(0x176)]});return await handleSDKOutput([_0x4ca839[_0x344039(0x1ac)]],_0x160ecb),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x184);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x18f);async['execute'](_0x3a2739){const _0x315237=a20_0x33cdc2,{options:_0x3c6f5d,args:_0x2f0ea8,tdx:_0x3a409a}=_0x3a2739;if(_0x2f0ea8[_0x315237(0x1b3)]===0x0)return console['error'](_0x315237(0x191)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x3451ce=_0x2f0ea8[0x0],_0x16c148=_0x3c6f5d,_0x2bf52f=await resolveWorkspaceIdFromOptions(_0x16c148,_0x3a409a);if(!_0x3c6f5d[_0x315237(0x1ef)]){const _0xf32371=await confirm(_0x315237(0x204)+_0x3451ce+_0x315237(0x1cd));if(!_0xf32371)return console[_0x315237(0x17c)](_0x315237(0x1c9)),0x0;}return await withSpinner(_0x315237(0x17d)+_0x3451ce+_0x315237(0x1ad),()=>_0x3a409a['engage'][_0x315237(0x1e3)](_0x3451ce,_0x2bf52f),{'verbose':_0x3c6f5d[_0x315237(0x176)]}),console[_0x315237(0x17c)]('Campaign\x20\x27'+_0x3451ce+_0x315237(0x208)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x1f2);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x1de);async[a20_0x33cdc2(0x1eb)](_0x5976a8){const _0x4683b8=a20_0x33cdc2,{options:_0x361d81,args:_0xfb4d8c,tdx:_0x4f2ec5}=_0x5976a8;if(_0xfb4d8c[_0x4683b8(0x1b3)]===0x0)return console[_0x4683b8(0x183)](_0x4683b8(0x191)),console[_0x4683b8(0x183)](_0x4683b8(0x1d1)),0x1;const _0x44dcab=_0xfb4d8c[0x0],_0x2ef164=_0x361d81,_0x3f2aaf=await resolveWorkspaceIdFromOptions(_0x2ef164,_0x4f2ec5);return await withSpinner('Launching\x20campaign\x20\x27'+_0x44dcab+_0x4683b8(0x1ad),()=>_0x4f2ec5['engage'][_0x4683b8(0x209)](_0x44dcab,_0x3f2aaf),{'verbose':_0x361d81[_0x4683b8(0x176)]}),console[_0x4683b8(0x17c)](_0x4683b8(0x1ed)+_0x44dcab+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a20_0x33cdc2(0x193);['description']=a20_0x33cdc2(0x17a);async[a20_0x33cdc2(0x1eb)](_0x369f94){const _0xc635ae=a20_0x33cdc2,{options:_0xf8c570,args:_0x2abffe,tdx:_0x1ae5f5}=_0x369f94;if(_0x2abffe[_0xc635ae(0x1b3)]===0x0)return console[_0xc635ae(0x183)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0xc635ae(0x183)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x2ec1f1=_0x2abffe[0x0],_0x16aee2=_0xf8c570,_0x208d01=await resolveWorkspaceIdFromOptions(_0x16aee2,_0x1ae5f5);return await withSpinner(_0xc635ae(0x1da)+_0x2ec1f1+_0xc635ae(0x1ad),()=>_0x1ae5f5['engage'][_0xc635ae(0x1aa)](_0x2ec1f1,_0x208d01),{'verbose':_0xf8c570[_0xc635ae(0x176)]}),console['log'](_0xc635ae(0x1ed)+_0x2ec1f1+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]='engage:campaign:resume';[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x1a7);async[a20_0x33cdc2(0x1eb)](_0x1b5606){const _0x50132=a20_0x33cdc2,{options:_0xca0376,args:_0x1acb62,tdx:_0x1ea252}=_0x1b5606;if(_0x1acb62['length']===0x0)return console[_0x50132(0x183)](_0x50132(0x191)),console[_0x50132(0x183)](_0x50132(0x1b6)),0x1;const _0x306053=_0x1acb62[0x0],_0x41de07=_0xca0376,_0x560c11=await resolveWorkspaceIdFromOptions(_0x41de07,_0x1ea252);return await withSpinner(_0x50132(0x1fe)+_0x306053+_0x50132(0x1ad),()=>_0x1ea252[_0x50132(0x1bc)]['resumeCampaign'](_0x306053,_0x560c11),{'verbose':_0xca0376[_0x50132(0x176)]}),console[_0x50132(0x17c)](_0x50132(0x1ed)+_0x306053+_0x50132(0x1e0)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x1e4);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x1df);async[a20_0x33cdc2(0x1eb)](_0x13762b){const _0x2bf79c=a20_0x33cdc2,{options:_0xacdf4d,args:_0xb31df7,tdx:_0x1a9906}=_0x13762b;if(_0xb31df7[_0x2bf79c(0x1b3)]===0x0)return console[_0x2bf79c(0x183)](_0x2bf79c(0x191)),console[_0x2bf79c(0x183)](_0x2bf79c(0x190)),0x1;const _0x1cbb99=_0xb31df7[0x0],_0x3588be=_0xacdf4d,_0x166e8d=await resolveWorkspaceIdFromOptions(_0x3588be,_0x1a9906),_0x1f46b4=await withSpinner(_0x2bf79c(0x205)+_0x1cbb99+_0x2bf79c(0x1ad),()=>_0x1a9906[_0x2bf79c(0x1bc)][_0x2bf79c(0x1d7)](_0x1cbb99,_0x166e8d),{'verbose':_0xacdf4d[_0x2bf79c(0x176)]});return await handleSDKOutput([_0x1f46b4[_0x2bf79c(0x1ac)]],_0xacdf4d),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x1c8);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x1b1);async['execute'](_0x50aa9b){const _0x1a2afd=a20_0x33cdc2,{options:_0x56e01c,args:_0x4d1172,tdx:_0x5efe71}=_0x50aa9b,_0x1c230c=_0x4d1172[0x0],_0x1a587a=resolveLimit(_0x56e01c[_0x1a2afd(0x19a)],DEFAULT_LLM_LIMIT),_0x4508ff=_0x56e01c,_0x338831=await resolveWorkspaceIdFromOptions(_0x4508ff,_0x5efe71),_0x80e9de=await withSpinner(_0x1a2afd(0x1f7),()=>_0x5efe71[_0x1a2afd(0x1bc)][_0x1a2afd(0x20a)]({'workspaceId':_0x338831,'limit':_0x1a587a}),{'verbose':_0x56e01c['verbose']});let _0x440038=_0x80e9de[_0x1a2afd(0x1ac)];return _0x1c230c&&(_0x440038=_0x80e9de['data'][_0x1a2afd(0x175)](_0x35fe4=>matchGlobPattern(_0x35fe4[_0x1a2afd(0x1c2)],_0x1c230c))),await handleSDKOutput(_0x440038,_0x56e01c),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x18e);['description']=a20_0x33cdc2(0x20b);async[a20_0x33cdc2(0x1eb)](_0x5e7f84){const _0x414c81=a20_0x33cdc2,{options:_0x2fc27f,args:_0x1c6dbf,tdx:_0x4f8d12}=_0x5e7f84;if(_0x1c6dbf[_0x414c81(0x1b3)]===0x0)return console[_0x414c81(0x183)](_0x414c81(0x188)),console[_0x414c81(0x183)](_0x414c81(0x1b2)),0x1;const _0x35b48a=_0x1c6dbf[0x0],_0x1bdb9d=_0x2fc27f,_0x49e85f=await resolveWorkspaceIdFromOptions(_0x1bdb9d,_0x4f8d12),_0x33c1e9=_0x1bdb9d[_0x414c81(0x1e2)];if(_0x33c1e9){const _0x1c6e7a=await withSpinner(_0x414c81(0x19b)+_0x35b48a+_0x414c81(0x1ad),()=>_0x4f8d12[_0x414c81(0x1bc)]['getTemplateFull'](_0x35b48a,_0x49e85f),{'verbose':_0x2fc27f[_0x414c81(0x176)]});await handleSDKOutput([_0x1c6e7a],_0x2fc27f);}else{const _0x4d2ae7=await withSpinner(_0x414c81(0x19b)+_0x35b48a+_0x414c81(0x1ad),()=>_0x4f8d12[_0x414c81(0x1bc)][_0x414c81(0x1b9)](_0x35b48a,_0x49e85f),{'verbose':_0x2fc27f['verbose']});await handleSDKOutput([_0x4d2ae7],_0x2fc27f);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x17e);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x1fc);async[a20_0x33cdc2(0x1eb)](_0x31c870){const _0x16699b=a20_0x33cdc2,{options:_0x5b665e,tdx:_0x1f256c}=_0x31c870,_0x27ec27=_0x5b665e,_0x106bf4=_0x27ec27['name'],_0x211c09=_0x27ec27[_0x16699b(0x192)],_0x1d5d13=_0x27ec27[_0x16699b(0x1bd)],_0x32fc78=_0x27ec27[_0x16699b(0x1ec)];if(!_0x106bf4)return console[_0x16699b(0x183)](_0x16699b(0x1d8)),console[_0x16699b(0x183)]('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x211c09)return console[_0x16699b(0x183)](_0x16699b(0x1cc)),0x1;if(_0x1d5d13&&_0x32fc78)return console[_0x16699b(0x183)](_0x16699b(0x1f5)),0x1;const _0x242c22=_0x32fc78?readFileContent(_0x32fc78):_0x1d5d13;if(!_0x242c22)return console[_0x16699b(0x183)](_0x16699b(0x1ee)),0x1;const _0x29ff11=await resolveWorkspaceIdFromOptions(_0x27ec27,_0x1f256c,!![]),_0x1ced63={'name':_0x106bf4,'subjectTemplate':_0x211c09,'htmlTemplate':_0x242c22,'workspaceId':_0x29ff11,'plaintextTemplate':_0x27ec27[_0x16699b(0x1a8)],'editorType':_0x27ec27[_0x16699b(0x1c6)]},_0x69a784=await withSpinner(_0x16699b(0x189)+_0x106bf4+_0x16699b(0x1ad),()=>_0x1f256c[_0x16699b(0x1bc)][_0x16699b(0x1f3)](_0x1ced63));return await handleSDKOutput([_0x69a784['data']],_0x5b665e),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x182);[a20_0x33cdc2(0x1d3)]='Update\x20an\x20email\x20template';async[a20_0x33cdc2(0x1eb)](_0x3dce75){const _0x433528=a20_0x33cdc2,{options:_0x161d97,args:_0x5430c9,tdx:_0x5cb3ed}=_0x3dce75;if(_0x5430c9[_0x433528(0x1b3)]===0x0)return console['error'](_0x433528(0x188)),console[_0x433528(0x183)](_0x433528(0x1d0)),0x1;const _0x1e7fb8=_0x5430c9[0x0],_0x4e3c77=_0x161d97,_0x21feb0=_0x4e3c77['html'],_0x4de053=_0x4e3c77[_0x433528(0x1ec)];if(_0x21feb0&&_0x4de053)return console[_0x433528(0x183)]('Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file'),0x1;const _0x2259f0=_0x4de053?readFileContent(_0x4de053):_0x21feb0,_0x15eb09=await resolveWorkspaceIdFromOptions(_0x4e3c77,_0x5cb3ed),_0x42b29f={'name':_0x4e3c77[_0x433528(0x1c2)],'subjectTemplate':_0x4e3c77[_0x433528(0x192)],'htmlTemplate':_0x2259f0,'plaintextTemplate':_0x4e3c77[_0x433528(0x1a8)]},_0x4f8351=Object[_0x433528(0x1f4)](Object[_0x433528(0x1f9)](_0x42b29f)[_0x433528(0x175)](([,_0x32eef8])=>_0x32eef8!==undefined));if(Object[_0x433528(0x1f6)](_0x4f8351)[_0x433528(0x1b3)]===0x0)return console[_0x433528(0x183)](_0x433528(0x1c1)),console['error'](_0x433528(0x18c)),0x1;const _0x4898e8=await withSpinner(_0x433528(0x196)+_0x1e7fb8+_0x433528(0x1ad),()=>_0x5cb3ed[_0x433528(0x1bc)][_0x433528(0x17b)](_0x1e7fb8,_0x4f8351,_0x15eb09),{'verbose':_0x161d97[_0x433528(0x176)]});return await handleSDKOutput([_0x4898e8[_0x433528(0x1ac)]],_0x161d97),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']=a20_0x33cdc2(0x1e8);[a20_0x33cdc2(0x1d3)]='Delete\x20an\x20email\x20template';async[a20_0x33cdc2(0x1eb)](_0xb570e9){const _0x5d6112=a20_0x33cdc2,{options:_0x586ca1,args:_0xff7da,tdx:_0x435a12}=_0xb570e9;if(_0xff7da[_0x5d6112(0x1b3)]===0x0)return console['error'](_0x5d6112(0x188)),console[_0x5d6112(0x183)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0xffb99f=_0xff7da[0x0],_0x396fe8=_0x586ca1,_0x193710=await resolveWorkspaceIdFromOptions(_0x396fe8,_0x435a12);if(!_0x586ca1[_0x5d6112(0x1ef)]){const _0x596404=await confirm(_0x5d6112(0x1d4)+_0xffb99f+_0x5d6112(0x1cd));if(!_0x596404)return console['log'](_0x5d6112(0x1c9)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0xffb99f+'\x27...',()=>_0x435a12['engage'][_0x5d6112(0x1a0)](_0xffb99f,_0x193710),{'verbose':_0x586ca1['verbose']}),console[_0x5d6112(0x17c)](_0x5d6112(0x203)+_0xffb99f+_0x5d6112(0x208)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]='engage:workspaces';['description']=a20_0x33cdc2(0x19e);async[a20_0x33cdc2(0x1eb)](_0x11a216){const _0x40e402=a20_0x33cdc2,{options:_0x780f7,args:_0x467345,tdx:_0x8e5eb0}=_0x11a216,_0x55bdfe=_0x467345[0x0],_0x9a2983=resolveLimit(_0x780f7['limit'],DEFAULT_LLM_LIMIT),_0x2324bb=await withSpinner(_0x40e402(0x1c5),()=>_0x8e5eb0[_0x40e402(0x1bc)][_0x40e402(0x19c)]({'limit':_0x9a2983}),{'verbose':_0x780f7[_0x40e402(0x176)]});let _0x202bae=_0x2324bb[_0x40e402(0x1ac)];return _0x55bdfe&&(_0x202bae=_0x2324bb[_0x40e402(0x1ac)]['filter'](_0xdb400f=>matchGlobPattern(_0xdb400f[_0x40e402(0x1c2)],_0x55bdfe))),await handleSDKOutput(_0x202bae,_0x780f7),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x1f0);['description']=a20_0x33cdc2(0x194);async[a20_0x33cdc2(0x1eb)](_0x26919b){const _0x1c064c=a20_0x33cdc2,{options:_0x1ac186,args:_0x230a53,tdx:_0x4f68c4}=_0x26919b;if(_0x230a53['length']===0x0)return console['error']('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x1c064c(0x183)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x57f6bd=_0x230a53[0x0],_0xcda20e=_0x1ac186,_0x22bead=_0xcda20e['full'];if(_0x22bead){const _0x404150=await withSpinner(_0x1c064c(0x1dc)+_0x57f6bd+_0x1c064c(0x1ad),()=>_0x4f68c4[_0x1c064c(0x1bc)][_0x1c064c(0x177)](_0x57f6bd),{'verbose':_0x1ac186['verbose']});await handleSDKOutput([_0x404150],_0x1ac186);}else{const _0x39db7e=await withSpinner(_0x1c064c(0x1dc)+_0x57f6bd+_0x1c064c(0x1ad),()=>_0x4f68c4[_0x1c064c(0x1bc)][_0x1c064c(0x195)](_0x57f6bd),{'verbose':_0x1ac186[_0x1c064c(0x176)]});await handleSDKOutput([_0x39db7e],_0x1ac186);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x1fd);['description']='Create\x20a\x20workspace';async['execute'](_0x2bd2c0){const _0x60b5c8=a20_0x33cdc2,{options:_0x34247f,tdx:_0x2aefcd}=_0x2bd2c0,_0x1e54a4=_0x34247f,_0x3cd15a=_0x1e54a4[_0x60b5c8(0x1c2)];if(!_0x3cd15a)return console[_0x60b5c8(0x183)]('Error:\x20--name\x20is\x20required'),console[_0x60b5c8(0x183)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x184ec7={'name':_0x3cd15a,'description':_0x1e54a4[_0x60b5c8(0x1d3)]},_0x3c3d3c=await withSpinner(_0x60b5c8(0x1a1)+_0x3cd15a+_0x60b5c8(0x1ad),()=>_0x2aefcd[_0x60b5c8(0x1bc)][_0x60b5c8(0x1ea)](_0x184ec7));return await handleSDKOutput([_0x3c3d3c[_0x60b5c8(0x1ac)]],_0x34247f),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x185);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x1fb);async[a20_0x33cdc2(0x1eb)](_0x49af47){const _0x14c932=a20_0x33cdc2,{options:_0x154452,args:_0x5c136e,tdx:_0x40d210}=_0x49af47;if(_0x5c136e[_0x14c932(0x1b3)]===0x0)return console[_0x14c932(0x183)](_0x14c932(0x1c4)),console['error'](_0x14c932(0x1cf)),0x1;const _0x49ca32=_0x5c136e[0x0],_0x135548=_0x154452,_0x41d47b={'name':_0x135548[_0x14c932(0x1c2)],'description':_0x135548[_0x14c932(0x1d3)]},_0x5b9d73=Object['fromEntries'](Object['entries'](_0x41d47b)[_0x14c932(0x175)](([,_0x1fd7cb])=>_0x1fd7cb!==undefined));if(Object[_0x14c932(0x1f6)](_0x5b9d73)[_0x14c932(0x1b3)]===0x0)return console['error'](_0x14c932(0x1c1)),console[_0x14c932(0x183)](_0x14c932(0x19d)),0x1;const _0x6c14a8=await withSpinner(_0x14c932(0x206)+_0x49ca32+_0x14c932(0x1ad),()=>_0x40d210[_0x14c932(0x1bc)][_0x14c932(0x1c3)](_0x49ca32,_0x5b9d73),{'verbose':_0x154452[_0x14c932(0x176)]});return await handleSDKOutput([_0x6c14a8[_0x14c932(0x1ac)]],_0x154452),0x0;}}function a20_0x5f36(){const _0x3c4683=['Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','description','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','status','3480840DxvHaq','duplicateCampaign','Error:\x20--name\x20is\x20required','parentId','Pausing\x20campaign\x20\x27','timezone','Fetching\x20workspace\x20\x27','Creating\x20campaign\x20\x27','Launch\x20a\x20campaign','Duplicate\x20a\x20campaign','\x27\x20resumed\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','full','deleteCampaign','engage:campaign:duplicate','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','46cNQxLQ','json','engage:template:delete','createCampaign','createWorkspace','execute','htmlFile','Campaign\x20\x27','Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required','yes','engage:workspace:show','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','engage:campaign:launch','createTemplate','fromEntries','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','keys','Fetching\x20templates...','Fetching\x20campaigns...','entries','segmentName','Update\x20a\x20workspace','Create\x20an\x20email\x20template','engage:workspace:create','Resuming\x20campaign\x20\x27','format','getCampaign','jsonl','Delete\x20a\x20workspace','Template\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Duplicating\x20campaign\x20\x27','Updating\x20workspace\x20\x27','2029348tqyhle','\x27\x20deleted\x20successfully','launchCampaign','listTemplates','Show\x20email\x20template\x20details','1770005dHWgul','emailSenderId','getCampaignFull','Deleting\x20workspace\x20\x27','filter','verbose','getWorkspaceFull','1411680HrXrcK','Create\x20a\x20new\x20campaign','Pause\x20a\x20campaign','updateTemplate','log','Deleting\x20campaign\x20\x27','engage:template:create','992747CGugQU','Engage\x20workspace\x20set\x20to:\x20','engage:campaign:create','engage:template:update','error','engage:campaign:delete','engage:workspace:update','Set\x20workspace\x20context\x20for\x20Engage\x20commands','6GWgtNd','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Creating\x20template\x20\x27','workspace','updateCampaign','Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext','Workspace\x20is\x20required\x20for\x20this\x20operation','engage:template:show','Delete\x20a\x20campaign','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','subject','engage:campaign:pause','Show\x20workspace\x20details','getWorkspace','Updating\x20template\x20\x27','session','startAt','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','limit','Fetching\x20template\x20\x27','listWorkspaces','Options:\x20--name,\x20--description','List\x20workspaces','engage:campaigns','deleteTemplate','Creating\x20workspace\x20\x27','jsonColumns','Show\x20campaign\x20details','attributes','Error:\x20Workspace\x20name\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Resume\x20a\x20paused\x20campaign','plaintext','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','pauseCampaign','map','data','\x27...','3601040YoudUj','segmentId','MISSING_ARGUMENT','List\x20email\x20templates','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','length','engage:campaign:show','engage_workspace','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','workspaceId','Fetching\x20campaign\x20\x27','getTemplate','segment','Workspace\x20\x27','engage','html','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','resolvePathToResource','type','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','name','updateWorkspace','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Fetching\x20workspaces...','editorType','resolveWorkspaceId','engage:templates','Operation\x20cancelled','6553SnhAwe','engage:workspace:use','Error:\x20--subject\x20is\x20required','\x27?\x20This\x20cannot\x20be\x20undone.','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'];a20_0x5f36=function(){return _0x3c4683;};return a20_0x5f36();}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]='engage:workspace:delete';[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x202);async[a20_0x33cdc2(0x1eb)](_0x157124){const _0x28c4a2=a20_0x33cdc2,{options:_0x2bfbef,args:_0x3e200f,tdx:_0x4a2167}=_0x157124;if(_0x3e200f['length']===0x0)return console['error'](_0x28c4a2(0x1c4)),console['error'](_0x28c4a2(0x1a6)),0x1;const _0x1dc015=_0x3e200f[0x0];if(!_0x2bfbef[_0x28c4a2(0x1ef)]){const _0x287380=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0x1dc015+_0x28c4a2(0x1cd));if(!_0x287380)return console['log'](_0x28c4a2(0x1c9)),0x0;}return await withSpinner(_0x28c4a2(0x174)+_0x1dc015+_0x28c4a2(0x1ad),()=>_0x4a2167[_0x28c4a2(0x1bc)]['deleteWorkspace'](_0x1dc015),{'verbose':_0x2bfbef[_0x28c4a2(0x176)]}),console[_0x28c4a2(0x17c)](_0x28c4a2(0x1bb)+_0x1dc015+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a20_0x33cdc2(0x1cb);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x186);async[a20_0x33cdc2(0x1eb)](_0x2bc02e){const _0x26635b=a20_0x33cdc2,{options:_0x5db2aa,args:_0x4154a8,tdx:_0x4374cb}=_0x2bc02e;if(_0x4154a8[_0x26635b(0x1b3)]===0x0)return console['error'](_0x26635b(0x1a5)),console['error'](_0x26635b(0x1e5)),0x1;const _0x207f97=_0x4154a8[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0x207f97+_0x26635b(0x1ad),()=>_0x4374cb[_0x26635b(0x1bc)][_0x26635b(0x1c7)](_0x207f97));const _0x4fee81=_0x5db2aa[_0x26635b(0x197)]||undefined;return saveSessionContext({'engage_workspace':_0x207f97},_0x4fee81),console[_0x26635b(0x17c)](_0x26635b(0x180)+_0x207f97),console[_0x26635b(0x17c)](_0x26635b(0x1d2)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a21_0x4f3528=a21_0x5001;(function(_0x51240d,_0x1357bb){const _0x229a39=a21_0x5001,_0x2a664f=_0x51240d();while(!![]){try{const _0x342dd5=-parseInt(_0x229a39(0x1ac))/0x1+-parseInt(_0x229a39(0x1ed))/0x2*(-parseInt(_0x229a39(0x1b5))/0x3)+parseInt(_0x229a39(0x1c3))/0x4+-parseInt(_0x229a39(0x1a4))/0x5+parseInt(_0x229a39(0x1a6))/0x6+parseInt(_0x229a39(0x1e7))/0x7+-parseInt(_0x229a39(0x1a7))/0x8*(parseInt(_0x229a39(0x1dd))/0x9);if(_0x342dd5===_0x1357bb)break;else _0x2a664f['push'](_0x2a664f['shift']());}catch(_0x2f55af){_0x2a664f['push'](_0x2a664f['shift']());}}}(a21_0x5b45,0xc6943));import{BaseCommand}from'./command.js';function a21_0x5001(_0x2c9aae,_0x5aafb5){_0x2c9aae=_0x2c9aae-0x1a4;const _0x5b453c=a21_0x5b45();let _0x5001fe=_0x5b453c[_0x2c9aae];return _0x5001fe;}import{SDKError,ErrorCode}from'../sdk/index.js';function a21_0x5b45(){const _0x3d280f=['length','yes','verbose','\x20job','1330253iMwaFk','Job\x20type:\x20','✔\x20Job\x20submitted','query','submit','error','created_at','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','161589XBdZUN','Limit:\x20','validate','data','✔\x20Found\x20','Get\x20job\x20results','Submit\x20a\x20job','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Getting\x20job\x20details...','description','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','List\x20jobs','type','round','2011636mAwoNd','args','result','execute','job:kill','limit','jobs','job:result','priority','job:submit','Submitting\x20job...','user_name','end_at','hive','jobType','✔\x20Retrieved\x20','start_at','\x20jobs','show','debug','\x20row','Query:\x20','Getting\x20job\x20results...','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','job_id','78363KYhKEV','Status\x20filter:\x20','database','\x20\x20Job\x20ID:\x20','file','map','Kill\x20a\x20job','substring','INVALID_ARGUMENT','trino','68691vGxLPw','No\x20SQL\x20statements\x20found\x20in\x20file','name','getTime','job:show','status','60qwQaOv','3229385pGABUV','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','9189582OPHjAI','800NZiGUa'];a21_0x5b45=function(){return _0x3d280f;};return a21_0x5b45();}import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class JobListCommand extends BaseCommand{['name']=a21_0x4f3528(0x1c9);[a21_0x4f3528(0x1be)]=a21_0x4f3528(0x1c0);async[a21_0x4f3528(0x1c6)](_0xa13920){const _0x5a0c34=a21_0x4f3528,{options:_0x39c89b,tdx:_0x38e80b}=_0xa13920,_0x2855c3=resolveLimit(_0x39c89b[_0x5a0c34(0x1c8)],DEFAULT_DISPLAY_LIMIT),_0x4847fb=_0x39c89b[_0x5a0c34(0x1ec)];_0x39c89b[_0x5a0c34(0x1aa)]&&(console[_0x5a0c34(0x1b1)](_0x5a0c34(0x1b6)+_0x2855c3+_0x5a0c34(0x1d4)),_0x4847fb&&console['error'](_0x5a0c34(0x1de)+_0x4847fb));const _0x53c3d3=await withSpinner('Listing\x20jobs...',()=>_0x38e80b[_0x5a0c34(0x1c9)]['list']({'from':0x0,'to':_0x2855c3-0x1,'status':_0x4847fb}),{'verbose':_0x39c89b[_0x5a0c34(0x1aa)]}),_0x1fb091=_0x53c3d3['data'];console[_0x5a0c34(0x1b1)](_0x5a0c34(0x1b9)+_0x1fb091['length']+_0x5a0c34(0x1ab)+(_0x1fb091[_0x5a0c34(0x1a8)]!==0x1?'s':''));const _0x5effb2=_0x1fb091[_0x5a0c34(0x1e2)](_0x4e1523=>{const _0x443b92=_0x5a0c34;let _0x5567aa;if(_0x4e1523[_0x443b92(0x1d3)]&&_0x4e1523[_0x443b92(0x1cf)]){const _0x351513=new Date(_0x4e1523[_0x443b92(0x1d3)])[_0x443b92(0x1ea)](),_0x428655=new Date(_0x4e1523[_0x443b92(0x1cf)])[_0x443b92(0x1ea)]();_0x5567aa=Math[_0x443b92(0x1c2)]((_0x428655-_0x351513)/0x3e8);}return{'job_id':_0x4e1523[_0x443b92(0x1dc)],'type':_0x4e1523[_0x443b92(0x1c1)],'status':_0x4e1523[_0x443b92(0x1ec)],'user_name':_0x4e1523[_0x443b92(0x1ce)],'duration_sec':_0x5567aa,'created_at':_0x4e1523[_0x443b92(0x1b2)],'started_at':_0x4e1523[_0x443b92(0x1d3)],'end_at':_0x4e1523[_0x443b92(0x1cf)]};});return await handleSDKOutput(_0x5effb2,_0x39c89b),0x0;}}export class JobShowCommand extends BaseCommand{[a21_0x4f3528(0x1e9)]=a21_0x4f3528(0x1eb);[a21_0x4f3528(0x1be)]='Show\x20job\x20details';['validate'](_0x3b0fe7){const _0x3be5f9=a21_0x4f3528,_0x2b9749=_0x3b0fe7[_0x3be5f9(0x1c4)][0x0];if(!_0x2b9749)return _0x3be5f9(0x1da);return undefined;}async[a21_0x4f3528(0x1c6)](_0x3a2b92){const _0x3d4e15=a21_0x4f3528,{options:_0x58a90b,args:_0x19f41a,tdx:_0x149d7b}=_0x3a2b92,_0x1c21b1=_0x19f41a[0x0],_0x48ad83=await withSpinner(_0x3d4e15(0x1bd),()=>_0x149d7b['jobs'][_0x3d4e15(0x1d5)](_0x1c21b1),{'verbose':_0x58a90b['verbose']}),_0xbb193c=_0x48ad83[_0x3d4e15(0x1b8)];let _0x574823;if(_0xbb193c[_0x3d4e15(0x1d3)]&&_0xbb193c[_0x3d4e15(0x1cf)]){const _0x1d0a50=new Date(_0xbb193c['start_at'])[_0x3d4e15(0x1ea)](),_0x183fb4=new Date(_0xbb193c[_0x3d4e15(0x1cf)])['getTime']();_0x574823=Math[_0x3d4e15(0x1c2)]((_0x183fb4-_0x1d0a50)/0x3e8);}const _0x95200e={'job_id':_0xbb193c[_0x3d4e15(0x1dc)],'type':_0xbb193c[_0x3d4e15(0x1c1)],'status':_0xbb193c[_0x3d4e15(0x1ec)],..._0xbb193c[_0x3d4e15(0x1ce)]&&{'user_name':_0xbb193c[_0x3d4e15(0x1ce)]},..._0x574823!==undefined&&{'duration_sec':_0x574823},..._0xbb193c[_0x3d4e15(0x1b2)]&&{'created_at':_0xbb193c[_0x3d4e15(0x1b2)]},..._0xbb193c['start_at']&&{'started_at':_0xbb193c[_0x3d4e15(0x1d3)]},..._0xbb193c[_0x3d4e15(0x1cf)]&&{'end_at':_0xbb193c[_0x3d4e15(0x1cf)]},..._0xbb193c[_0x3d4e15(0x1df)]&&{'database':_0xbb193c[_0x3d4e15(0x1df)]},..._0xbb193c[_0x3d4e15(0x1cb)]!==undefined&&{'priority':_0xbb193c[_0x3d4e15(0x1cb)]},..._0xbb193c['url']&&{'url':_0xbb193c['url']},..._0xbb193c[_0x3d4e15(0x1af)]&&{'query':_0xbb193c[_0x3d4e15(0x1af)]},..._0xbb193c[_0x3d4e15(0x1d6)]&&{'debug':_0xbb193c[_0x3d4e15(0x1d6)]}};return await handleSingleObjectOutput(_0x95200e,_0x58a90b),0x0;}}export class JobKillCommand extends BaseCommand{[a21_0x4f3528(0x1e9)]=a21_0x4f3528(0x1c7);[a21_0x4f3528(0x1be)]=a21_0x4f3528(0x1e3);[a21_0x4f3528(0x1b7)](_0x2bd30a){const _0x55bec3=a21_0x4f3528,_0x2df229=_0x2bd30a[_0x55bec3(0x1c4)][0x0];if(!_0x2df229)return _0x55bec3(0x1bc);return undefined;}async[a21_0x4f3528(0x1c6)](_0x8c55d4){const _0x5ebc41=a21_0x4f3528,{options:_0x2e21fb,args:_0x3eda16,tdx:_0x530401}=_0x8c55d4,_0x507905=_0x3eda16[0x0];if(!_0x2e21fb[_0x5ebc41(0x1a9)]){const _0x172d45=await confirm(_0x5ebc41(0x1bf)+_0x507905+'?');if(!_0x172d45)return console[_0x5ebc41(0x1b1)]('Cancelled'),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x530401[_0x5ebc41(0x1c9)]['kill'](_0x507905),{'verbose':_0x2e21fb['verbose']}),console[_0x5ebc41(0x1b1)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x507905),console[_0x5ebc41(0x1b1)](_0x5ebc41(0x1a5)+_0x507905+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a21_0x4f3528(0x1cc);[a21_0x4f3528(0x1be)]=a21_0x4f3528(0x1bb);async[a21_0x4f3528(0x1c6)](_0x2c976b){const _0x2ed04f=a21_0x4f3528,{options:_0x4e5e33,args:_0x22ef35,tdx:_0x39eb98}=_0x2c976b,_0x55181e=_0x4e5e33[_0x2ed04f(0x1d1)]||_0x2ed04f(0x1e6),_0x24e726=_0x4e5e33[_0x2ed04f(0x1e1)],_0x374e51=_0x4e5e33['database']||'information_schema',_0x581fd7=_0x4e5e33[_0x2ed04f(0x1c5)];if(_0x55181e!==_0x2ed04f(0x1e6)&&_0x55181e!==_0x2ed04f(0x1d0))throw new SDKError(ErrorCode[_0x2ed04f(0x1e5)],_0x2ed04f(0x1b4));let _0x553316;if(_0x24e726){if(_0x22ef35[0x0])throw new SDKError(ErrorCode[_0x2ed04f(0x1e5)],_0x2ed04f(0x1b3));const _0x57aa99=readSqlStatementsFromFile(_0x24e726);if(_0x57aa99[_0x2ed04f(0x1a8)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2ed04f(0x1e8));if(_0x57aa99['length']>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x553316=_0x57aa99[0x0];}else{if(!_0x22ef35[0x0])throw new SDKError(ErrorCode[_0x2ed04f(0x1e5)],_0x2ed04f(0x1db));_0x553316=_0x22ef35[0x0];}_0x4e5e33['verbose']&&(console[_0x2ed04f(0x1b1)](_0x2ed04f(0x1ad)+_0x55181e),console[_0x2ed04f(0x1b1)]('Database:\x20'+_0x374e51),console[_0x2ed04f(0x1b1)](_0x2ed04f(0x1d8)+_0x553316[_0x2ed04f(0x1e4)](0x0,0x64)+(_0x553316[_0x2ed04f(0x1a8)]>0x64?'...':'')));const _0x53eb7b=await withSpinner(_0x2ed04f(0x1cd),()=>_0x39eb98['jobs'][_0x2ed04f(0x1b0)](_0x374e51,_0x553316,_0x55181e,_0x581fd7),{'verbose':_0x4e5e33[_0x2ed04f(0x1aa)]}),_0x3ac282=_0x53eb7b['data'];return console[_0x2ed04f(0x1b1)](_0x2ed04f(0x1ae)),console[_0x2ed04f(0x1b1)](_0x2ed04f(0x1e0)+_0x3ac282[_0x2ed04f(0x1dc)]),await handleSDKOutput([_0x3ac282],_0x4e5e33),0x0;}}export class JobResultCommand extends BaseCommand{[a21_0x4f3528(0x1e9)]=a21_0x4f3528(0x1ca);['description']=a21_0x4f3528(0x1ba);[a21_0x4f3528(0x1b7)](_0x2416bf){const _0x513d07=a21_0x4f3528,_0x1715c4=_0x2416bf[_0x513d07(0x1c4)][0x0];if(!_0x1715c4)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a21_0x4f3528(0x1c6)](_0x5539df){const _0x52d70c=a21_0x4f3528,{options:_0x598406,args:_0x289206,tdx:_0xaecd29}=_0x5539df,_0x22559b=_0x289206[0x0],_0x3bd53b=await withSpinner(_0x52d70c(0x1d9),()=>_0xaecd29[_0x52d70c(0x1c9)][_0x52d70c(0x1c5)](_0x22559b),{'verbose':_0x598406[_0x52d70c(0x1aa)]}),_0x1c5c8d=_0x3bd53b['data'];return console['error'](_0x52d70c(0x1d2)+_0x1c5c8d['length']+_0x52d70c(0x1d7)+(_0x1c5c8d['length']!==0x1?'s':'')),await handleSDKOutput(_0x1c5c8d,_0x598406),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a22_0x5a8bdc=a22_0x1b6d;(function(_0x327030,_0x4ebf42){const _0xff8212=a22_0x1b6d,_0x12c116=_0x327030();while(!![]){try{const _0x44fbdb=parseInt(_0xff8212(0xf7))/0x1*(-parseInt(_0xff8212(0x144))/0x2)+parseInt(_0xff8212(0x108))/0x3*(-parseInt(_0xff8212(0x178))/0x4)+-parseInt(_0xff8212(0xbb))/0x5*(-parseInt(_0xff8212(0x17b))/0x6)+-parseInt(_0xff8212(0x175))/0x7*(parseInt(_0xff8212(0x121))/0x8)+-parseInt(_0xff8212(0xdd))/0x9*(-parseInt(_0xff8212(0xda))/0xa)+-parseInt(_0xff8212(0x110))/0xb+parseInt(_0xff8212(0x132))/0xc*(parseInt(_0xff8212(0xae))/0xd);if(_0x44fbdb===_0x4ebf42)break;else _0x12c116['push'](_0x12c116['shift']());}catch(_0x1d9d34){_0x12c116['push'](_0x12c116['shift']());}}}(a22_0x1181,0x54d3a));import a22_0x56bc5a from'chalk';import a22_0x271ee7 from'path';function a22_0x1b6d(_0xf30f8b,_0x50380a){_0xf30f8b=_0xf30f8b-0x9a;const _0x118110=a22_0x1181();let _0x1b6d1f=_0x118110[_0xf30f8b];return _0x1b6d1f;}import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x4bc469){const _0x509d45=a22_0x1b6d;return!_0x4bc469&&(console[_0x509d45(0xcb)](_0x509d45(0xcc)),console['error'](_0x509d45(0xf0))),!!_0x4bc469;}function withJsonFormat(_0x149d82){const _0x5a813d=a22_0x1b6d;if(!_0x149d82[_0x5a813d(0x11f)]&&!_0x149d82['json']&&!_0x149d82[_0x5a813d(0xf6)]&&!_0x149d82[_0x5a813d(0xff)])return{..._0x149d82,'format':_0x5a813d(0xcd),'json':!![]};return _0x149d82;}function formatJourneyState(_0x5e114e){const _0x6b719a=a22_0x1b6d;switch(_0x5e114e){case'launched':return a22_0x56bc5a[_0x6b719a(0xbd)](_0x6b719a(0x16c));case _0x6b719a(0xb8):return a22_0x56bc5a[_0x6b719a(0x151)](_0x6b719a(0x128));case _0x6b719a(0xc7):return a22_0x56bc5a['yellow'](_0x6b719a(0x14c));case'completed':return a22_0x56bc5a[_0x6b719a(0x181)](_0x6b719a(0xa3));case _0x6b719a(0x15e):return a22_0x56bc5a['dim'](_0x6b719a(0xf9));default:return'('+_0x5e114e+')';}}function formatJourneyItem(_0x52047a,_0x3cd3cf='',_0x5e33a1){const _0x489461=a22_0x1b6d,_0x3ff794=formatJourneyState(_0x52047a[_0x489461(0x135)]),_0x27445a=_0x5e33a1?hyperlink(_0x52047a[_0x489461(0x19d)],_0x5e33a1):_0x52047a[_0x489461(0x19d)];return _0x3cd3cf+_0x489461(0x172)+_0x27445a+'\x20'+_0x3ff794;}function escapeRegex(_0x3eb926){return _0x3eb926['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x28235e){const _0x4582e0=a22_0x1b6d,_0x1f23ec=_0x28235e['split']('*')[_0x4582e0(0xe9)](escapeRegex);return new RegExp(_0x1f23ec[_0x4582e0(0x15f)]('.*'),'i');}function buildRuleToNameMapping(_0x48c1a3){const _0x3103b3=a22_0x1b6d,_0x542e53=new Map();if(_0x48c1a3['segments'])for(const [_0x40c5ba,_0x3a8054]of Object[_0x3103b3(0x188)](_0x48c1a3[_0x3103b3(0x18e)])){if(_0x3a8054[_0x3103b3(0x199)]){const _0x4a5d46=serializeRule(_0x3a8054[_0x3103b3(0x199)]),_0x450e7f=_0x542e53['get'](_0x4a5d46);_0x450e7f?_0x450e7f[_0x3103b3(0xf1)](_0x40c5ba):_0x542e53[_0x3103b3(0xec)](_0x4a5d46,[_0x40c5ba]);}}return _0x542e53;}async function resolveJourneyIdFromInput(_0x59b388,_0x52dcb0,_0x31a668){const _0x4ecc9d=a22_0x1b6d,_0x3fd703=await resolveJourneyTarget(_0x59b388,_0x52dcb0['parentSegment'],_0x52dcb0[_0x4ecc9d(0xa0)]),_0x2b16b0=_0x3fd703[_0x4ecc9d(0xce)];if(!_0x2b16b0)throw new SDKError(ErrorCode[_0x4ecc9d(0xe8)],_0x4ecc9d(0x18b));const _0x1cf6f3=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x31a668[_0x4ecc9d(0x100)]['resolveParentId'](_0x2b16b0),{'verbose':_0x52dcb0[_0x4ecc9d(0xa0)]}),_0x561e17=_0x1cf6f3[_0x4ecc9d(0xfd)],_0x57e3ad=await withSpinner('Resolving\x20journey...',()=>_0x31a668['journey']['resolveJourneyId'](_0x561e17,_0x3fd703[_0x4ecc9d(0xa1)]),{'verbose':_0x52dcb0[_0x4ecc9d(0xa0)]});return{'journeyId':_0x57e3ad[_0x4ecc9d(0xfd)],'journeyName':_0x3fd703[_0x4ecc9d(0xa1)],'parentSegmentId':_0x561e17};}async function resolveJourneyTarget(_0x5c317b,_0x26b1a7,_0x14a3b1){const _0xf16c88=a22_0x1b6d;if(isYamlFilePath(_0x5c317b))try{const _0x2d7796=await resolveYamlFilePath(_0x5c317b);return _0x14a3b1&&(console['error'](_0xf16c88(0x180)+_0x5c317b),console[_0xf16c88(0xcb)]('\x20\x20Parent\x20segment:\x20'+_0x2d7796[_0xf16c88(0xce)]),console[_0xf16c88(0xcb)]('\x20\x20Name:\x20'+_0x2d7796[_0xf16c88(0x19f)]),console[_0xf16c88(0xcb)](_0xf16c88(0x125)+(_0x2d7796[_0xf16c88(0x142)]||_0xf16c88(0xaa)))),{'journeyName':_0x2d7796[_0xf16c88(0x19f)],'parentSegment':_0x2d7796['parentSegment'],'resolved':_0x2d7796};}catch(_0xbfb1b3){throw new SDKError(ErrorCode[_0xf16c88(0xe8)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0xbfb1b3['message']);}if(!_0x26b1a7)throw new SDKError(ErrorCode[_0xf16c88(0xe8)],_0xf16c88(0x11c));return{'journeyName':_0x5c317b,'parentSegment':_0x26b1a7};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a22_0x5a8bdc(0x1a1)]=a22_0x5a8bdc(0xe0);async[a22_0x5a8bdc(0x179)](_0x401ee1){const _0x50906e=a22_0x5a8bdc,{options:_0x57c012,args:_0xc35e0d,tdx:_0x11ed9c}=_0x401ee1,_0x40d7dc=_0xc35e0d[0x0],_0x4276ea=_0x57c012[_0x50906e(0xce)];if(!_0x4276ea)return console['error'](_0x50906e(0x17a)),console[_0x50906e(0xcb)](_0x50906e(0xd0)),0x1;const _0x4764eb=await withSpinner(_0x50906e(0x133),()=>_0x11ed9c['segment']['resolveParentId'](_0x4276ea),{'verbose':_0x57c012[_0x50906e(0xa0)]}),_0x596211=_0x4764eb[_0x50906e(0xfd)];_0x57c012[_0x50906e(0xa0)]&&(console['error'](_0x50906e(0x149)+_0x4276ea+_0x50906e(0x194)+_0x596211+')'),_0x40d7dc&&console['error'](_0x50906e(0x192)+_0x40d7dc));const _0x35f1a1=await withSpinner(_0x50906e(0xb9),()=>_0x11ed9c[_0x50906e(0x100)][_0x50906e(0x18a)](_0x596211),{'verbose':_0x57c012[_0x50906e(0xa0)]}),_0x1d609c=_0x35f1a1['data'],_0x41803d=_0x1d609c['rootFolderId'],_0x48713e=await withSpinner('Listing\x20journeys...',()=>_0x11ed9c[_0x50906e(0x18f)]['listJourneysWithFolders'](_0x596211,_0x41803d),{'verbose':_0x57c012['verbose']});let _0x4d9ee8=_0x48713e[_0x50906e(0xfd)][_0x50906e(0x122)];const _0x49563c=_0x48713e[_0x50906e(0xfd)]['folders'],_0x33cc4d=new Map();for(const _0x176c4e of _0x49563c){_0x33cc4d[_0x50906e(0xec)](_0x176c4e['id'],_0x176c4e[_0x50906e(0x154)]);}if(_0x40d7dc){const _0x34e55c=globToRegex(_0x40d7dc);_0x4d9ee8=_0x4d9ee8[_0x50906e(0x16f)](_0x5c15da=>_0x34e55c['test'](_0x5c15da[_0x50906e(0x19d)]));}console[_0x50906e(0xcb)](_0x50906e(0x15c)+_0x4d9ee8[_0x50906e(0x19a)]+_0x50906e(0x143)+(_0x4d9ee8[_0x50906e(0x19a)]!==0x1?'s':''));const _0xac6aaf=_0x58980=>{const _0x63ef1f=_0x50906e;return getConsoleNextUrl(_0x57c012[_0x63ef1f(0x13b)],_0x63ef1f(0x186)+_0x596211+'/e/'+_0x58980+_0x63ef1f(0x15d));};if(_0x57c012[_0x50906e(0x11f)]===_0x50906e(0xa7))await handleSDKOutput(_0x4d9ee8,_0x57c012);else{if(_0x57c012[_0x50906e(0x11f)]==='json'){const _0x2619c2=_0x4d9ee8[_0x50906e(0xe9)](_0x26ca67=>({..._0x26ca67,'url':_0xac6aaf(_0x26ca67['id'])}));await handleSDKOutput(_0x2619c2,_0x57c012);}else{console['log']('['+_0x4276ea+']');const _0x283aaa=new Map(),_0x18bc06=[];for(const _0x144faa of _0x4d9ee8){if(!_0x144faa[_0x50906e(0x10b)]||_0x144faa[_0x50906e(0x10b)]===_0x41803d)_0x18bc06[_0x50906e(0xf1)](_0x144faa);else{const _0x463e94=_0x283aaa['get'](_0x144faa['folderId'])||[];_0x463e94['push'](_0x144faa),_0x283aaa[_0x50906e(0xec)](_0x144faa['folderId'],_0x463e94);}}const _0x41edac=(_0x5debf2,_0xab9c63)=>_0x5debf2[_0x50906e(0x19d)][_0x50906e(0x171)](_0xab9c63[_0x50906e(0x19d)],undefined,{'sensitivity':_0x50906e(0xfb)});_0x18bc06[_0x50906e(0x104)](_0x41edac);for(const _0x37bba4 of _0x18bc06){console[_0x50906e(0x118)](formatJourneyItem(_0x37bba4,'',_0xac6aaf(_0x37bba4['id'])));}const _0x39c132=[..._0x283aaa[_0x50906e(0x188)]()][_0x50906e(0x104)]((_0x12ef11,_0x456a55)=>{const _0x18de56=_0x50906e,_0x1d089a=_0x33cc4d['get'](_0x12ef11[0x0])||_0x12ef11[0x0],_0x5db9eb=_0x33cc4d['get'](_0x456a55[0x0])||_0x456a55[0x0];return _0x1d089a[_0x18de56(0x171)](_0x5db9eb,undefined,{'sensitivity':_0x18de56(0xfb)});});for(const [_0x245d2f,_0x2d434c]of _0x39c132){const _0x476fff=_0x33cc4d['get'](_0x245d2f)||_0x245d2f;console[_0x50906e(0x118)](_0x50906e(0x197)+_0x476fff),_0x2d434c['sort'](_0x41edac);for(const _0x4c020e of _0x2d434c){console[_0x50906e(0x118)](formatJourneyItem(_0x4c020e,'\x20\x20',_0xac6aaf(_0x4c020e['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']='journey:view';[a22_0x5a8bdc(0x1a1)]=a22_0x5a8bdc(0xee);async[a22_0x5a8bdc(0x179)](_0x20dc66){const _0x257bc9=a22_0x5a8bdc,{options:_0x4d1b72,args:_0x1edd55,tdx:_0xc9f14b}=_0x20dc66,_0x5e9d22=_0x1edd55[0x0];if(!_0x5e9d22)return console[_0x257bc9(0xcb)](_0x257bc9(0xcc)),console[_0x257bc9(0xcb)](_0x257bc9(0x145)),console[_0x257bc9(0xcb)](_0x257bc9(0x185)),console[_0x257bc9(0xcb)](_0x257bc9(0x189)),0x1;_0x4d1b72[_0x257bc9(0xa0)]&&console[_0x257bc9(0xcb)](_0x257bc9(0x11d)+_0x5e9d22);const {journeyId:_0x25adf9,parentSegmentId:_0x479ce6}=await resolveJourneyIdFromInput(_0x5e9d22,_0x4d1b72,_0xc9f14b);if(_0x4d1b72[_0x257bc9(0xea)]){const _0x5c055d=getConsoleNextUrl(_0x4d1b72[_0x257bc9(0x13b)],'/app/ps/'+_0x479ce6+'/e/'+_0x25adf9+_0x257bc9(0xe6));return console[_0x257bc9(0xcb)](a22_0x56bc5a[_0x257bc9(0xbd)]('✔')+_0x257bc9(0x174)+a22_0x56bc5a[_0x257bc9(0xe3)](_0x5c055d)),openBrowser(_0x5c055d),0x0;}const _0x4b02f3=await withSpinner(_0x257bc9(0x196),()=>_0xc9f14b[_0x257bc9(0x18f)][_0x257bc9(0xdc)](_0x25adf9),{'verbose':_0x4d1b72['verbose']}),_0x9f1f0d=_0x4b02f3[_0x257bc9(0xfd)],_0x1973fc=_0x4d1b72[_0x257bc9(0x152)];let _0x5326d7;if(_0x1973fc)try{const _0x20cfa8=await withSpinner(_0x257bc9(0x12d),()=>_0xc9f14b[_0x257bc9(0x18f)][_0x257bc9(0xaf)](_0x25adf9),{'verbose':_0x4d1b72[_0x257bc9(0xa0)]});_0x5326d7=_0x20cfa8[_0x257bc9(0xfd)];}catch{_0x4d1b72[_0x257bc9(0xa0)]&&console[_0x257bc9(0xcb)](_0x257bc9(0xdf));}const _0xbcb89e=getConsoleNextUrl(_0x4d1b72[_0x257bc9(0x13b)],_0x257bc9(0x186)+_0x479ce6+_0x257bc9(0x106)+_0x25adf9+'/j/da/je'),_0x3ffb16={'id':_0x9f1f0d['id'],'name':_0x9f1f0d[_0x257bc9(0x159)][_0x257bc9(0x154)],'description':_0x9f1f0d[_0x257bc9(0x159)][_0x257bc9(0x1a1)],'state':_0x9f1f0d[_0x257bc9(0x159)]['state'],'paused':_0x9f1f0d[_0x257bc9(0x159)]['paused'],'reentry_mode':_0x9f1f0d[_0x257bc9(0x159)][_0x257bc9(0x16e)],'stages':_0x9f1f0d['attributes']['journeyStages']?.[_0x257bc9(0x19a)]||0x0,..._0x9f1f0d[_0x257bc9(0x159)][_0x257bc9(0xdb)]&&{'goal':_0x9f1f0d['attributes'][_0x257bc9(0xdb)][_0x257bc9(0x154)]},..._0x5326d7&&{'statistics':{'size':_0x5326d7['size'],'entered':_0x5326d7[_0x257bc9(0xd3)],'goal_achieved':_0x5326d7[_0x257bc9(0xc4)],'completion_rate':_0x5326d7[_0x257bc9(0xfe)],'exit_or_jump':_0x5326d7[_0x257bc9(0xc6)],'exit_or_jump_rate':_0x5326d7['exitOrJumpRate'],'stages':_0x5326d7[_0x257bc9(0xb6)]}},'url':_0xbcb89e};return await handleSingleObjectOutput(_0x3ffb16,_0x4d1b72),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a22_0x5a8bdc(0x154)]=a22_0x5a8bdc(0x190);[a22_0x5a8bdc(0x1a1)]=a22_0x5a8bdc(0x187);async[a22_0x5a8bdc(0x179)](_0x120103){const _0x451089=a22_0x5a8bdc,{options:_0x923837,args:_0x38c6c5,tdx:_0x5596a5}=_0x120103,_0x3042c0=_0x38c6c5[0x0];if(!requireNameOrPath(_0x3042c0))return 0x1;_0x923837[_0x451089(0xa0)]&&console[_0x451089(0xcb)](_0x451089(0x11d)+_0x3042c0);const _0x49b5d1=_0x923837,_0x2a173a=_0x49b5d1[_0x451089(0xfc)],_0x24a6e1=_0x49b5d1['to'],_0xd58928=_0x49b5d1[_0x451089(0x9d)],_0x384390=_0x49b5d1[_0x451089(0xb0)];_0xd58928&&!_0x2a173a&&!_0x24a6e1&&console[_0x451089(0xcb)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x4e8ad1=_0xd58928?withJsonFormat(_0x923837):_0x923837,{journeyId:_0xa469ff,journeyName:_0x4f1cba}=await resolveJourneyIdFromInput(_0x3042c0,_0x4e8ad1,_0x5596a5),_0x55a2bb=_0x2a173a||_0x24a6e1?{'from':_0x2a173a,'to':_0x24a6e1}:undefined,_0x73c609=await withSpinner(_0x451089(0x12d),()=>Promise[_0x451089(0x150)]([_0x5596a5['journey'][_0x451089(0xdc)](_0xa469ff),_0x5596a5[_0x451089(0x18f)]['getStatistics'](_0xa469ff,_0x55a2bb)]),{'verbose':_0x4e8ad1[_0x451089(0xa0)]}),[_0x562308,_0x2be0fd]=_0x73c609[_0x451089(0xfd)];if(!_0x2be0fd||_0x2be0fd[_0x451089(0x168)]===null)return console[_0x451089(0xcb)](_0x451089(0xb1)+_0x4f1cba),console[_0x451089(0xcb)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0xbf40ce=buildStageNameMap(_0x562308),_0x179c6e=!!(_0x55a2bb&&_0x2be0fd['history']?.[_0x451089(0x19a)]),_0x1d420c={'stageNameMap':_0xbf40ce,'hasPeriod':_0x179c6e,'includeHistory':!!_0xd58928};if(_0x384390&&_0x2be0fd[_0x451089(0xb6)]){const _0xdee72e=_0x2be0fd[_0x451089(0xb6)][_0x451089(0x10c)](_0x5b51fa=>{const _0x290761=_0x451089,_0x6e1016=_0xbf40ce[_0x290761(0x11a)](_0x5b51fa['id'])??'';return _0x6e1016[_0x290761(0xbe)]()===_0x384390[_0x290761(0xbe)]();});if(_0xdee72e)return await handleSingleObjectOutput(formatStageStats(_0xdee72e,_0x1d420c),_0x4e8ad1),0x0;const _0xd5b5b2=_0x2be0fd[_0x451089(0xb6)][_0x451089(0xe9)](_0x22a1d0=>_0xbf40ce['get'](_0x22a1d0['id'])??_0x22a1d0['id']);return console['error'](_0x451089(0x120)+_0x384390+'\x22\x20not\x20found'),console['error'](_0x451089(0x124)+_0xd5b5b2[_0x451089(0x15f)](',\x20')),0x1;}const _0x13ea44=_0x2be0fd[_0x451089(0xb6)]?.[_0x451089(0xe9)](_0x4a0da8=>formatStageStats(_0x4a0da8,_0x1d420c)),_0x31da70=assembleJourneyStats(_0x2be0fd,{'from':_0x2a173a,'to':_0x24a6e1,'includeHistory':_0xd58928});return await this[_0x451089(0x11e)](_0x31da70,_0x13ea44??[],_0x4e8ad1),0x0;}async['renderStats'](_0x16e40e,_0x38cf7d,_0xbde6f0){const _0x158873=a22_0x5a8bdc,_0x4aa7ab=_0xbde6f0[_0x158873(0x11f)]===_0x158873(0xcd)||_0xbde6f0[_0x158873(0x11f)]===_0x158873(0xf6)||_0xbde6f0[_0x158873(0xcd)]||_0xbde6f0['jsonl'];if(_0x4aa7ab){_0x16e40e[_0x158873(0xb6)]=_0x38cf7d,await handleSingleObjectOutput(_0x16e40e,_0xbde6f0);return;}await handleSingleObjectOutput(_0x16e40e,_0xbde6f0);for(const _0x2ac7e0 of _0x38cf7d){console['log'](''),console[_0x158873(0x118)](String(a22_0x56bc5a[_0x158873(0xe3)][_0x158873(0x10d)]('['+_0x2ac7e0[_0x158873(0x154)]+']'))+a22_0x56bc5a['dim']('\x20'+_0x2ac7e0['id']));const {id:_0x4197f3,name:_0x262f4a,..._0x3aa042}=_0x2ac7e0;await handleSingleObjectOutput(_0x3aa042,_0xbde6f0);}}}export class JourneyTrafficCommand extends BaseCommand{[a22_0x5a8bdc(0x154)]=a22_0x5a8bdc(0x101);[a22_0x5a8bdc(0x1a1)]=a22_0x5a8bdc(0x116);async[a22_0x5a8bdc(0x179)](_0x57faa8){const _0x83018=a22_0x5a8bdc,{options:_0x4059e3,args:_0x286a93,tdx:_0x5d1fd0}=_0x57faa8,_0x37d5cd=_0x286a93[0x0];if(!requireNameOrPath(_0x37d5cd))return 0x1;_0x4059e3['verbose']&&console[_0x83018(0xcb)](_0x83018(0x11d)+_0x37d5cd);const _0x2529f4=_0x4059e3,_0xaedfc0=_0x2529f4[_0x83018(0x173)],_0x716ce3=_0x2529f4[_0x83018(0xfc)],_0x3b1fda=_0x2529f4['to'],_0x4a6143=_0x2529f4['limit'];if(_0xaedfc0&&_0xaedfc0!==_0x83018(0xe7)&&_0xaedfc0!==_0x83018(0x146))return console[_0x83018(0xcb)](_0x83018(0xd1)+_0xaedfc0+_0x83018(0x9b)),0x1;const _0x23264b=withJsonFormat(_0x4059e3),{journeyId:_0x1b39b5,journeyName:_0x4044b4}=await resolveJourneyIdFromInput(_0x37d5cd,_0x23264b,_0x5d1fd0),_0x562b6f={'type':_0xaedfc0,'from':_0x716ce3,'to':_0x3b1fda,'limit':_0x4a6143},_0x47dc8e=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x5d1fd0['journey']['getTrafficData'](_0x1b39b5,_0x562b6f),{'verbose':_0x23264b[_0x83018(0xa0)]}),_0x20b5c6=_0x47dc8e['data'],_0x833af4=_0x20b5c6[_0x83018(0xe7)]&&(_0x20b5c6[_0x83018(0xe7)][_0x83018(0xc3)]['length']>0x0||_0x20b5c6[_0x83018(0xe7)][_0x83018(0xbf)]['length']>0x0),_0x7c26bf=_0x20b5c6[_0x83018(0x146)]&&_0x20b5c6[_0x83018(0x146)]['length']>0x0;if(!_0x833af4&&!_0x7c26bf)return console['error'](_0x83018(0xcf)+_0x4044b4),console['error']('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x716ce3&&_0x3b1fda&&console['error'](_0x83018(0x16b)),0x0;return await handleSingleObjectOutput(_0x20b5c6,_0x23264b),0x0;}}function formatStageStats(_0x3a83c8,_0x29ce21){const _0x5e8446=a22_0x5a8bdc,_0x1a405b=_0x29ce21[_0x5e8446(0xd5)]&&_0x3a83c8[_0x5e8446(0x15a)]?.[_0x5e8446(0x19a)]?aggregateStageHistory(_0x3a83c8[_0x5e8446(0x15a)]):{'size':_0x3a83c8[_0x5e8446(0x126)],'entered':_0x3a83c8[_0x5e8446(0xd3)],'milestone':_0x3a83c8[_0x5e8446(0x176)],'milestone_rate':_0x3a83c8[_0x5e8446(0x111)],'exit_or_jump':_0x3a83c8[_0x5e8446(0xc6)],'exit_or_jump_rate':_0x3a83c8[_0x5e8446(0x137)]},_0x598c46={'id':_0x3a83c8['id'],'name':_0x29ce21['stageNameMap']['get'](_0x3a83c8['id'])??_0x3a83c8['id'],..._0x1a405b};return _0x29ce21[_0x5e8446(0xd5)]&&_0x29ce21[_0x5e8446(0x9d)]&&_0x3a83c8[_0x5e8446(0x15a)]&&(_0x598c46[_0x5e8446(0x15a)]=_0x3a83c8[_0x5e8446(0x15a)]),_0x598c46;}export class JourneyPauseCommand extends BaseCommand{[a22_0x5a8bdc(0x154)]='journey:pause';[a22_0x5a8bdc(0x1a1)]=a22_0x5a8bdc(0x15b);async[a22_0x5a8bdc(0x179)](_0x5e49f1){const _0x16de30=a22_0x5a8bdc,{options:_0x65d337,args:_0x3850fc,tdx:_0x15440e}=_0x5e49f1,_0x56ef92=_0x3850fc[0x0];if(!requireNameOrPath(_0x56ef92))return 0x1;_0x65d337[_0x16de30(0xa0)]&&console[_0x16de30(0xcb)](_0x16de30(0x11d)+_0x56ef92);const {journeyId:_0x54a490,journeyName:_0x3f73f7}=await resolveJourneyIdFromInput(_0x56ef92,_0x65d337,_0x15440e);if(!_0x65d337['yes']){const _0x2dfefc=await confirm(_0x16de30(0x177)+_0x3f73f7+'\x22?');if(!_0x2dfefc)return console['error']('Cancelled'),0x0;}const _0x630c23=await withSpinner(_0x16de30(0xd7),()=>_0x15440e[_0x16de30(0x18f)][_0x16de30(0x156)](_0x54a490),{'verbose':_0x65d337['verbose']}),_0x4f02d9=_0x630c23[_0x16de30(0xfd)];return console[_0x16de30(0xcb)](_0x16de30(0x198)+_0x4f02d9['attributes'][_0x16de30(0x154)]+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a22_0x5a8bdc(0x155);[a22_0x5a8bdc(0x1a1)]=a22_0x5a8bdc(0xca);async['execute'](_0xc7fbec){const _0x29c3aa=a22_0x5a8bdc,{options:_0x5835ec,args:_0x34fb24,tdx:_0x3bd3bc}=_0xc7fbec,_0x9d7a47=_0x34fb24[0x0];if(!requireNameOrPath(_0x9d7a47))return 0x1;_0x5835ec[_0x29c3aa(0xa0)]&&console['error'](_0x29c3aa(0x11d)+_0x9d7a47);const {journeyId:_0x36cdab,journeyName:_0x23568a}=await resolveJourneyIdFromInput(_0x9d7a47,_0x5835ec,_0x3bd3bc);if(!_0x5835ec[_0x29c3aa(0xa6)]){const _0x2451e4=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x23568a+'\x22?');if(!_0x2451e4)return console[_0x29c3aa(0xcb)](_0x29c3aa(0xeb)),0x0;}const _0x50574b=await withSpinner(_0x29c3aa(0x166),()=>_0x3bd3bc[_0x29c3aa(0x18f)]['resume'](_0x36cdab),{'verbose':_0x5835ec[_0x29c3aa(0xa0)]}),_0x5e7ac4=_0x50574b[_0x29c3aa(0xfd)];return console[_0x29c3aa(0xcb)]('✔\x20Journey\x20\x22'+_0x5e7ac4[_0x29c3aa(0x159)][_0x29c3aa(0x154)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{[a22_0x5a8bdc(0x154)]=a22_0x5a8bdc(0x103);['description']='Export\x20journey(s)\x20as\x20YAML\x20files';async['execute'](_0x15da40){const _0x2ba6cb=a22_0x5a8bdc,{options:_0x2f24f0,args:_0x433962,tdx:_0x2af8cf}=_0x15da40,_0x13fb93=_0x2f24f0,_0x5a595f=_0x433962[0x0],_0x59bf18=_0x5a595f&&isYamlFilePath(_0x5a595f),_0x3cd3f7=await resolveTarget({'arg':_0x59bf18?_0x5a595f:undefined,'contextParent':_0x2f24f0[_0x2ba6cb(0xce)],'cwd':process[_0x2ba6cb(0x12e)]()});if(!isSuccessfulResolution(_0x3cd3f7))return _0x3cd3f7['errorCode']===_0x2ba6cb(0x19b)?(console[_0x2ba6cb(0xcb)](a22_0x56bc5a[_0x2ba6cb(0x102)](_0x2ba6cb(0x14b))),console['error'](_0x2ba6cb(0x16a)),console['error'](_0x2ba6cb(0xf2)),console[_0x2ba6cb(0xcb)](_0x2ba6cb(0x161)),console[_0x2ba6cb(0xcb)](_0x2ba6cb(0x195))):(console['error'](a22_0x56bc5a[_0x2ba6cb(0x115)]('Error:\x20'+_0x3cd3f7[_0x2ba6cb(0x167)]+'\x0a')),_0x3cd3f7[_0x2ba6cb(0x158)]&&console[_0x2ba6cb(0xcb)](a22_0x56bc5a[_0x2ba6cb(0xe3)](_0x3cd3f7[_0x2ba6cb(0x158)]))),0x1;let _0x22567b=_0x59bf18?undefined:_0x5a595f,_0xc6f43a,_0x2596dc;_0x3cd3f7[_0x2ba6cb(0x173)]==='file'&&(_0x22567b=_0x3cd3f7[_0x2ba6cb(0xf8)],_0xc6f43a=_0x3cd3f7[_0x2ba6cb(0x17f)],_0x2596dc=_0x3cd3f7[_0x2ba6cb(0x142)]);const _0x192981=_0x3cd3f7[_0x2ba6cb(0xe4)],_0x45791a=_0x3cd3f7[_0x2ba6cb(0x13a)];_0x13fb93['verbose']&&(console[_0x2ba6cb(0xcb)](_0x2ba6cb(0x149)+_0x192981),console['error'](_0x2ba6cb(0x191)+_0x45791a),_0x22567b&&console[_0x2ba6cb(0xcb)]('Journey\x20name:\x20'+_0x22567b),_0xc6f43a&&console['error']('Target\x20file:\x20'+_0xc6f43a),_0x2596dc&&console['error']('Folder\x20path:\x20'+_0x2596dc));const _0x44d07a=await withSpinner(_0x2ba6cb(0x133),()=>_0x2af8cf[_0x2ba6cb(0x100)]['resolveParentId'](_0x192981),{'verbose':_0x2f24f0['verbose']}),_0x4196d3=_0x44d07a[_0x2ba6cb(0xfd)],{journeys:_0x4bc217,folders:_0x57ef86}=await withSpinner(_0x2ba6cb(0x18d),async()=>{const _0x7e0904=_0x2ba6cb,[_0x81a8fd,_0x1652d0]=await Promise[_0x7e0904(0x150)]([_0x2af8cf[_0x7e0904(0x18f)]['listJourneysFromParentSegment'](_0x4196d3,undefined,{'includeAllVersions':!![]}),_0x2af8cf[_0x7e0904(0x100)][_0x7e0904(0x134)](_0x4196d3)]);return{'journeys':_0x81a8fd,'folders':_0x1652d0};},{'verbose':_0x2f24f0[_0x2ba6cb(0xa0)]})[_0x2ba6cb(0xd4)](_0x43c079=>_0x43c079[_0x2ba6cb(0xfd)]);let _0x161f63=_0x4bc217;const _0xca5e32=buildFolderIdToPathMap(_0x57ef86);if(_0x22567b){const _0x4156dc=_0x161f63[_0x2ba6cb(0x16f)](_0x1c628a=>_0x1c628a[_0x2ba6cb(0x19d)][_0x2ba6cb(0xbe)]()===_0x22567b[_0x2ba6cb(0xbe)]());if(_0x4156dc[_0x2ba6cb(0x19a)]===0x0)return console[_0x2ba6cb(0xcb)](_0x2ba6cb(0x147)+_0x22567b),console['error'](_0x2ba6cb(0xc1)),0x1;_0x161f63=_0x4156dc;}if(_0x2596dc!==undefined){const _0xaec0a9=_0x161f63[_0x2ba6cb(0x16f)](_0x1f1cf5=>{const _0x43de16=_0x2ba6cb,_0x363983=_0x1f1cf5['folderId']?_0xca5e32[_0x43de16(0x11a)](_0x1f1cf5[_0x43de16(0x10b)])||'':'';return _0x363983===_0x2596dc;});if(_0xaec0a9[_0x2ba6cb(0x19a)]===0x0&&_0x161f63[_0x2ba6cb(0x19a)]>0x0){console['error'](_0x2ba6cb(0x136)+_0x22567b+_0x2ba6cb(0x19c)+(_0x2596dc||_0x2ba6cb(0xa5))),console[_0x2ba6cb(0xcb)](_0x2ba6cb(0x10e));for(const _0x33c9da of _0x161f63){const _0xa9acbf=_0x33c9da[_0x2ba6cb(0x10b)]?_0xca5e32[_0x2ba6cb(0x11a)](_0x33c9da['folderId'])||'':'';console[_0x2ba6cb(0xcb)](_0x2ba6cb(0x17d)+(_0xa9acbf||_0x2ba6cb(0xaa))+'/'+_0x33c9da['journeyBundleName']);}return 0x1;}_0x161f63=_0xaec0a9;}if(_0x161f63['length']===0x0)return console['error']('No\x20journeys\x20found'),0x0;const _0xc6f654=new Map();for(const _0x2a8081 of _0x161f63){const _0x135306=_0x2a8081['journeyBundleId'];!_0xc6f654[_0x2ba6cb(0x14a)](_0x135306)&&_0xc6f654[_0x2ba6cb(0xec)](_0x135306,[]),_0xc6f654['get'](_0x135306)[_0x2ba6cb(0xf1)](_0x2a8081);}for(const _0x265e6c of _0xc6f654['values']()){_0x265e6c['sort']((_0x4f7f80,_0x40ea25)=>(_0x4f7f80['versionNumber']||0x0)-(_0x40ea25[_0x2ba6cb(0x140)]||0x0));}const _0x302e67=[],{idToEmailMap:_0x35d1c1,connectionIdToNameMap:_0xf7c42f}=await withSpinner(_0x2ba6cb(0xd6),async()=>{const _0x28725a=_0x2ba6cb,[_0x273f52,_0x418ccf]=await Promise['all']([_0x2af8cf[_0x28725a(0x123)]['buildIdToEmailMap'](),_0x2af8cf['connection']['buildIdToNameMap']()]);return{'idToEmailMap':_0x273f52,'connectionIdToNameMap':_0x418ccf};},{'verbose':_0x2f24f0[_0x2ba6cb(0xa0)]})[_0x2ba6cb(0xd4)](_0x41eef8=>_0x41eef8[_0x2ba6cb(0xfd)]);for(const _0x4ab605 of _0xc6f654[_0x2ba6cb(0x112)]()){const _0x4d79b1=_0x4ab605[0x0][_0x2ba6cb(0x19d)],_0x94925a=_0x4ab605[0x0]['folderId'],_0x294f71=_0x94925a?_0xca5e32['get'](_0x94925a)||'':'',_0x1e7f4a=_0x294f71?a22_0x271ee7['join'](_0x45791a,_0x294f71):_0x45791a,_0x2a42a8=_0xc6f43a||a22_0x271ee7[_0x2ba6cb(0x15f)](_0x1e7f4a,sanitizeFileName(_0x4d79b1)+_0x2ba6cb(0x141));let _0x59b50a,_0x28d74e;if(existsSync(_0x2a42a8))try{const _0x2754bf=readFileSync(_0x2a42a8,'utf-8'),_0x26b8ec=parseYamlString(_0x2754bf);_0x28d74e=_0x26b8ec,_0x59b50a=buildRuleToNameMapping(_0x26b8ec),_0x13fb93[_0x2ba6cb(0xa0)]&&_0x59b50a[_0x2ba6cb(0x126)]>0x0&&console[_0x2ba6cb(0xcb)]('Found\x20'+_0x59b50a['size']+_0x2ba6cb(0x13d)+_0x4d79b1);}catch(_0x280deb){_0x13fb93[_0x2ba6cb(0xa0)]&&console['error']('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x280deb[_0x2ba6cb(0x167)]);}const _0x7780e5=[],_0x2f16bd=new Set(),_0xa06c06=new Map(),_0xab43cc=new Map(),_0x4b2aff=new Set(),_0x5d3e83=new Map(),_0x5c319f=new Map(),_0x3ac6c5=createJumpTargetCache();await withProgressSpinner(_0x2ba6cb(0xe5)+_0x4d79b1+_0x2ba6cb(0x1a0),async _0x53a73c=>{const _0x4ed6f5=_0x2ba6cb;for(const _0x2f5a5e of _0x4ab605){const _0x4ce811=_0x4ab605[_0x4ed6f5(0x19a)]>0x1?_0x2f5a5e['journeyBundleName']+'\x20v'+(_0x2f5a5e['versionNumber']||0x1):_0x2f5a5e['journeyBundleName'];_0x53a73c[_0x4ed6f5(0x114)](_0x4ed6f5(0xe5)+_0x4ce811);const _0x150fae=await _0x2af8cf[_0x4ed6f5(0x18f)][_0x4ed6f5(0xdc)](_0x2f5a5e['id']),_0x36ac14=_0x150fae[_0x4ed6f5(0x159)]?.[_0x4ed6f5(0xc9)],_0xf488c2={'resolveSegment':async _0x294b73=>{const _0x26b168=_0x4ed6f5;if(!_0x36ac14)return{'name':_0x294b73,'isJourneyLocal':![]};const _0x57301a=_0xa06c06[_0x26b168(0x11a)](_0x294b73);if(_0x57301a)return _0x57301a;try{const _0xc55fa0=await _0x2af8cf[_0x26b168(0x100)][_0x26b168(0x17e)](_0x36ac14,_0x294b73),_0x3b88a9=_0xc55fa0['kind']===SEGMENT_KIND_JOURNEY;let _0x155484,_0xd7e69e=_0xc55fa0[_0x26b168(0x154)];if(_0x3b88a9&&_0xc55fa0[_0x26b168(0x199)]){const _0x4ad6bf=await segmentResponseToDef(_0xc55fa0,{'resolveSegmentName':async _0x5771af=>{const _0x16b50f=_0x26b168,_0x1f6c6b=_0xa06c06[_0x16b50f(0x11a)](_0x5771af);if(_0x1f6c6b)return _0x1f6c6b[_0x16b50f(0x154)];const _0x377ea9=await _0xf488c2[_0x16b50f(0x12c)](_0x5771af);return _0x377ea9[_0x16b50f(0x154)];}}),_0xab8125=_0x4ad6bf['rule'];_0x155484={'description':_0xc55fa0[_0x26b168(0x1a1)],'rule':_0xab8125};const _0x2ac497=serializeRule(_0xab8125),_0x4ed540=_0xab43cc[_0x26b168(0x11a)](_0x2ac497);if(_0x4ed540)_0xd7e69e=_0x4ed540,_0x155484=undefined,_0x13fb93['verbose']&&console['error'](_0x26b168(0xa2)+_0xc55fa0[_0x26b168(0x154)]+_0x26b168(0x193)+_0x4ed540);else{let _0x28abd5=![];if(_0x59b50a){const _0xebf012=_0x59b50a[_0x26b168(0x11a)](_0x2ac497);if(_0xebf012){const _0x133bbd=_0xebf012['find'](_0x3a3712=>!_0x2f16bd[_0x26b168(0x14a)](_0x3a3712));_0x133bbd&&(_0xd7e69e=_0x133bbd,_0x2f16bd[_0x26b168(0x131)](_0x133bbd),_0xab43cc[_0x26b168(0xec)](_0x2ac497,_0x133bbd),_0x28abd5=!![],_0x13fb93['verbose']&&console[_0x26b168(0xcb)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x133bbd+'\x20(rule\x20match)'));}}if(!_0x28abd5){const _0x139070=generateJourneyLocalName(_0xc55fa0[_0x26b168(0x154)]);_0x139070&&(_0xd7e69e=_0x139070);let _0x268d5a=_0xd7e69e,_0x30213a=0x2;while(_0x2f16bd['has'](_0x268d5a)){_0x268d5a=_0xd7e69e+'_'+_0x30213a,_0x30213a++;}_0x2f16bd[_0x26b168(0x131)](_0x268d5a),_0xab43cc[_0x26b168(0xec)](_0x2ac497,_0x268d5a),_0xd7e69e=_0x268d5a;}}}const _0x52b92f={'name':_0xd7e69e,'isJourneyLocal':_0x3b88a9,'definition':_0x155484};return _0xa06c06['set'](_0x294b73,_0x52b92f),_0x52b92f;}catch(_0x22bbf5){return _0x2f24f0[_0x26b168(0xa0)]&&console['error'](_0x26b168(0xd8)+_0x294b73+':\x20'+_0x22bbf5['message']),{'name':_0x294b73,'isJourneyLocal':![]};}},'resolveActivation':async _0x5b8b69=>{const _0x1830df=_0x4ed6f5,_0x42e74c=_0x5d3e83[_0x1830df(0x11a)](_0x5b8b69);if(_0x42e74c)return _0x42e74c;try{const _0x2fff67=await _0x2af8cf['journey'][_0x1830df(0x183)](_0x2f5a5e['id'],_0x5b8b69),_0x9dce5a=journeyActivationStepToYaml(_0x2fff67,_0x35d1c1,_0xf7c42f),_0x1ec756=JSON['stringify']({'name':_0x9dce5a[_0x1830df(0x154)],'connection':_0x9dce5a[_0x1830df(0x162)],'connector_config':_0x9dce5a[_0x1830df(0x138)]}),_0x5ee087=_0x5c319f['get'](_0x1ec756);if(_0x5ee087){const _0x54b0b2={'name':_0x5ee087,'isJourneyLocal':!![],'definition':_0x9dce5a};return _0x5d3e83[_0x1830df(0xec)](_0x5b8b69,_0x54b0b2),_0x54b0b2;}const _0xdfa68d=_0x2fff67[_0x1830df(0x159)][_0x1830df(0xc8)][_0x1830df(0x154)]||_0x5b8b69,_0x157c0c=sanitizeYamlKey(_0xdfa68d)||_0x1830df(0x9e)+_0x5b8b69;let _0x2c0f9b=_0x157c0c,_0x362ecd=0x2;while(_0x4b2aff[_0x1830df(0x14a)](_0x2c0f9b)){_0x2c0f9b=_0x157c0c+'_'+_0x362ecd,_0x362ecd++;}_0x4b2aff['add'](_0x2c0f9b),_0x5c319f['set'](_0x1ec756,_0x2c0f9b);const _0x2ba639={'name':_0x2c0f9b,'isJourneyLocal':!![],'definition':_0x9dce5a};return _0x5d3e83['set'](_0x5b8b69,_0x2ba639),_0x2ba639;}catch(_0x35cc9e){return _0x2f24f0['verbose']&&console['error'](_0x1830df(0xad)+_0x5b8b69+':\x20'+_0x35cc9e['message']),{'name':_0x5b8b69,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1217ef,_0x59f065)=>{const _0x161453=_0x4ed6f5;return resolveJumpTarget(_0x1217ef,_0x59f065,_0x3ac6c5,_0x605f8b=>_0x2af8cf[_0x161453(0x18f)][_0x161453(0xdc)](_0x605f8b));}},_0x1d9d67=await journeyResponseToDef(_0x150fae,_0xf488c2);_0x7780e5[_0x4ed6f5(0xf1)]({'item':_0x2f5a5e,'yaml':_0x1d9d67});}},{'verbose':_0x2f24f0[_0x2ba6cb(0xa0)]});const _0x1dde6c=await _0x2af8cf[_0x2ba6cb(0x18f)][_0x2ba6cb(0x18c)](_0x4ab605[0x0][_0x2ba6cb(0x1a3)]),_0x4f3bf4=buildMergedJourneyDef(_0x7780e5,_0x59b50a,_0x1dde6c),_0x264b0c=normalizeJourneyDef(_0x4f3bf4,_0x28d74e),_0x37d1b6=toYamlString(_0x264b0c),_0x5c2c3a=_0xc6f43a||a22_0x271ee7[_0x2ba6cb(0x15f)](_0x1e7f4a,sanitizeFileName(_0x4d79b1)+_0x2ba6cb(0x141));!_0xc6f43a&&_0x294f71&&!existsSync(_0x1e7f4a)&&mkdirSync(_0x1e7f4a,{'recursive':!![]});const _0x5ea943=a22_0x271ee7[_0x2ba6cb(0xa4)](process[_0x2ba6cb(0x12e)](),_0x5c2c3a);if(existsSync(_0x5c2c3a)){const _0x256bfe=readFileSync(_0x5c2c3a,_0x2ba6cb(0x164)),_0x3a7a94=generateDiff(_0x256bfe,_0x37d1b6),_0x2bbf64=hasChanges(_0x3a7a94);_0x302e67[_0x2ba6cb(0xf1)]({'relativePath':_0x5ea943,'absolutePath':_0x5c2c3a,'content':_0x37d1b6,'isNew':![],'hasChanges':_0x2bbf64,'diff':_0x2bbf64?formatDiffWithColors(_0x3a7a94):undefined});}else _0x302e67[_0x2ba6cb(0xf1)]({'relativePath':_0x5ea943,'absolutePath':_0x5c2c3a,'content':_0x37d1b6,'isNew':!![],'hasChanges':![]});}const _0x2c1395=_0x302e67[_0x2ba6cb(0x16f)](_0x3a0a1a=>_0x3a0a1a[_0x2ba6cb(0xde)]),_0x401cea=_0x302e67[_0x2ba6cb(0x16f)](_0x5b1a4f=>!_0x5b1a4f[_0x2ba6cb(0xde)]&&_0x5b1a4f[_0x2ba6cb(0xe2)]),_0x24b236=_0x302e67[_0x2ba6cb(0x16f)](_0x47a7f2=>!_0x47a7f2['isNew']&&!_0x47a7f2[_0x2ba6cb(0xe2)]),_0x111dcc=_0x161f63[_0x2ba6cb(0x19a)],_0x2006cc=_0xc6f654[_0x2ba6cb(0x126)],_0x2b68e2=_0x111dcc>_0x2006cc?'\x20('+_0x111dcc+_0x2ba6cb(0x148):'';console['error'](_0x2ba6cb(0x119)),console['error']('\x20\x20'+a22_0x56bc5a[_0x2ba6cb(0xe3)](_0x2006cc+_0x2ba6cb(0xc2))+a22_0x56bc5a[_0x2ba6cb(0x151)](_0x2b68e2)),console[_0x2ba6cb(0xcb)]('\x20\x20'+a22_0x56bc5a[_0x2ba6cb(0xbd)]('+\x20'+_0x2c1395['length']+_0x2ba6cb(0xc5))),console[_0x2ba6cb(0xcb)]('\x20\x20'+a22_0x56bc5a[_0x2ba6cb(0x102)]('~\x20'+_0x401cea['length']+_0x2ba6cb(0x157))),console['error']('\x20\x20'+a22_0x56bc5a['dim']('=\x20'+_0x24b236['length']+'\x20unchanged\x20files')),console[_0x2ba6cb(0xcb)](_0x2ba6cb(0x14e)+a22_0x56bc5a[_0x2ba6cb(0xe3)](_0x45791a)+'\x0a');if(_0x401cea[_0x2ba6cb(0x19a)]>0x0)for(const _0x22eaa8 of _0x401cea){console['error'](_0x2ba6cb(0x169)+_0x22eaa8[_0x2ba6cb(0xf5)]+'\x27:'),console[_0x2ba6cb(0xcb)]('─'[_0x2ba6cb(0x153)](0x3c)),console['error'](_0x22eaa8[_0x2ba6cb(0x11b)]),console[_0x2ba6cb(0xcb)]('─'[_0x2ba6cb(0x153)](0x3c));}if(_0x13fb93['dryRun'])return console[_0x2ba6cb(0xcb)](a22_0x56bc5a[_0x2ba6cb(0x102)](_0x2ba6cb(0xef))),0x0;if(_0x2c1395['length']===0x0&&_0x401cea[_0x2ba6cb(0x19a)]===0x0)return console[_0x2ba6cb(0xcb)](a22_0x56bc5a['green'](_0x2ba6cb(0x14d))),saveSessionContext({'parent_segment':_0x192981},_0x13fb93[_0x2ba6cb(0xe1)]),console[_0x2ba6cb(0xcb)](a22_0x56bc5a['green']('✔\x20Context\x20set:\x20'+a22_0x56bc5a['dim'](_0x2ba6cb(0x10a))+'\x20=\x20'+a22_0x56bc5a[_0x2ba6cb(0xe3)](_0x192981))),0x0;if(!_0x13fb93[_0x2ba6cb(0xa6)]&&(_0x2c1395['length']>0x0||_0x401cea['length']>0x0)){if(!isInteractive())return console[_0x2ba6cb(0xcb)](a22_0x56bc5a[_0x2ba6cb(0x115)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2ba6cb(0xcb)](a22_0x56bc5a[_0x2ba6cb(0x151)](_0x2ba6cb(0x170))),0x1;const _0x48577b=await confirmKey('Write\x20'+(_0x2c1395[_0x2ba6cb(0x19a)]+_0x401cea[_0x2ba6cb(0x19a)])+'\x20files?');if(!_0x48577b)return console[_0x2ba6cb(0xcb)](a22_0x56bc5a[_0x2ba6cb(0x102)](_0x2ba6cb(0xb5)),_0x2ba6cb(0xb2)),0x1;}!existsSync(_0x45791a)&&mkdirSync(_0x45791a,{'recursive':!![]});const _0x2483f4=a22_0x271ee7['join'](_0x45791a,'tdx.json');writeFileSync(_0x2483f4,createTdxConfigContent(_0x192981),'utf-8');for(const _0x5d87d2 of _0x302e67){(_0x5d87d2[_0x2ba6cb(0xde)]||_0x5d87d2[_0x2ba6cb(0xe2)])&&writeFileSync(_0x5d87d2[_0x2ba6cb(0x163)],_0x5d87d2[_0x2ba6cb(0xbc)],_0x2ba6cb(0x164));}return console[_0x2ba6cb(0xcb)](a22_0x56bc5a[_0x2ba6cb(0xbd)](_0x2ba6cb(0x12f)+(_0x2c1395[_0x2ba6cb(0x19a)]+_0x401cea[_0x2ba6cb(0x19a)])+_0x2ba6cb(0xc0)+_0x45791a)),saveSessionContext({'parent_segment':_0x192981},_0x13fb93[_0x2ba6cb(0xe1)]),console[_0x2ba6cb(0xcb)](a22_0x56bc5a[_0x2ba6cb(0xbd)]('✔\x20Context\x20set:\x20'+a22_0x56bc5a[_0x2ba6cb(0x151)](_0x2ba6cb(0x10a))+'\x20=\x20'+a22_0x56bc5a[_0x2ba6cb(0xe3)](_0x192981))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a22_0x5a8bdc(0x154)]=a22_0x5a8bdc(0x1a2);[a22_0x5a8bdc(0x1a1)]=a22_0x5a8bdc(0xb3);async[a22_0x5a8bdc(0x179)](_0x1511c3){const _0x13e792=a22_0x5a8bdc,{options:_0x5b6edc,args:_0xb1ec21,tdx:_0x209290}=_0x1511c3,_0x363d2c=_0xb1ec21[0x0];if(!requireNameOrPath(_0x363d2c))return 0x1;_0x5b6edc[_0x13e792(0xa0)]&&console['error'](_0x13e792(0x11d)+_0x363d2c);const {journeyId:_0x4a4efa}=await resolveJourneyIdFromInput(_0x363d2c,_0x5b6edc,_0x209290),_0x5d8811=await withSpinner(_0x13e792(0x184),()=>_0x209290[_0x13e792(0x18f)]['getColumnMapping'](_0x4a4efa),{'verbose':_0x5b6edc[_0x13e792(0xa0)]}),_0x18e327=_0x5d8811[_0x13e792(0xfd)];return console['log']('Database:\x20'+_0x18e327[_0x13e792(0x105)]),console[_0x13e792(0x118)](_0x13e792(0x127)+_0x18e327[_0x13e792(0xa7)]),await handleSDKOutput(_0x18e327[_0x13e792(0x1a4)],_0x5b6edc),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a22_0x5a8bdc(0x154)]=a22_0x5a8bdc(0x165);[a22_0x5a8bdc(0x1a1)]=a22_0x5a8bdc(0x117);async[a22_0x5a8bdc(0x179)](_0x4bc8be){const _0x4761d6=a22_0x5a8bdc,{options:_0x3b71c2,args:_0x7dbc07,tdx:_0x2b1ee8}=_0x4bc8be,_0x3a5dab=_0x7dbc07[0x0];if(!requireNameOrPath(_0x3a5dab))return 0x1;_0x3b71c2[_0x4761d6(0xa0)]&&console[_0x4761d6(0xcb)](_0x4761d6(0x11d)+_0x3a5dab);const {journeyId:_0x247472}=await resolveJourneyIdFromInput(_0x3a5dab,_0x3b71c2,_0x2b1ee8),_0x7b6899=await withSpinner('Listing\x20journey\x20activations...',()=>_0x2b1ee8[_0x4761d6(0x18f)][_0x4761d6(0xab)](_0x247472),{'verbose':_0x3b71c2[_0x4761d6(0xa0)]}),_0x40a7ca=_0x7b6899[_0x4761d6(0xfd)];return console['error']('Found\x20'+_0x40a7ca[_0x4761d6(0x19a)]+_0x4761d6(0x19e)+(_0x40a7ca[_0x4761d6(0x19a)]!==0x1?'s':'')),await handleSDKOutput(_0x40a7ca,_0x3b71c2),0x0;}}function a22_0x1181(){const _0x47f982=['\x20\x20Journey\x20ID:\x20','relativePath','jsonl','284731PzhWPM','resourceName','(archived)','createdAt','base','from','data','completionRate','tsv','segment','journey:traffic','yellow','journey:pull','sort','database','/e/','\x20Created\x20v','6xSvOpg','options','parent_segment','folderId','find','bold','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','List\x20all\x20versions\x20of\x20a\x20journey','1990175gTginR','completeMilestoneRate','values','Error:\x20Invalid\x20version\x20number:\x20','setPhase','red','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','List\x20activations\x20for\x20a\x20journey','log','\x0aPull\x20summary:','get','diff','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Input:\x20','renderStats','format','Error:\x20Stage\x20\x22','7032VfRjkS','journeys','user','Available\x20stages:\x20','\x20\x20Folder\x20path:\x20','size','Table:\x20','(draft)','createVersion','\x20not\x20found.\x20Available:\x20','\x20(draft)\x20—\x20\x22','resolveSegment','Getting\x20journey\x20statistics...','cwd','✔\x20Pulled\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','add','34572Rfgexg','Resolving\x20parent\x20segment...','listFolders','state','Error:\x20Journey\x20\x27','exitOrJumpRate','connector_config','journeyStages','targetDir','site','journey:version:create','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Error:\x20Version\x20','versionNumber','.yml','folderPath','\x20journey','2xmpDII','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','activation','Error:\x20Journey\x20not\x20found:\x20','\x20versions)','Parent\x20segment:\x20','has','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','(paused)','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Target:\x20','Error:\x20--version\x20option\x20is\x20required','all','dim','includeStats','repeat','name','journey:resume','pause','\x20changed\x20files','helpText','attributes','history','Pause\x20a\x20running\x20journey','✔\x20Found\x20','/j/da','archived','join','Listing\x20journey\x20versions...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','connection','absolutePath','utf-8','journey:activations','Resuming\x20journey...','message','journeyId','\x0aChanges\x20to\x20\x27','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','(running)','updatedAt','reentryMode','filter','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','localeCompare','🗺️\x20','type','\x20Opening\x20','2926dVoevC','milestoneSize','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','945380fVlYtG','execute','Error:\x20Parent\x20segment\x20context\x20required','24lCDFwb','file','\x20\x20-\x20','getSegment','filePath','Resolved\x20YAML\x20file:\x20','blue','listVersions','getActivation','Getting\x20column\x20mapping...','Options:','/app/ps/','Show\x20journey\x20statistics','entries','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','getParentFull','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','getLatestJourneyId','Fetching\x20journeys\x20and\x20folders...','segments','journey','journey:stats','Target\x20directory:\x20','Pattern:\x20','\x20->\x20','\x20(ID:\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Getting\x20journey\x20details...','📁\x20','✔\x20Journey\x20\x22','rule','length','no_parent','\x27\x20not\x20found\x20in\x20','journeyBundleName','\x20activation','segmentName','...','description','journey:columns','journeyBundleId','columns','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','version','includeHistory','activation_','journey:push','verbose','journeyName','\x20\x20Consolidating\x20duplicate\x20segment:\x20','(completed)','relative','root\x20folder','yes','table','args','Getting\x20version\x20','(root)','listActivationsFlat','segmentPushCommand','Warning:\x20Could\x20not\x20resolve\x20activation\x20','4199GMSBqf','getStatistics','stage','No\x20statistics\x20available\x20for\x20journey:\x20','-\x20no\x20files\x20written','Show\x20journey\x20table\x20column\x20mapping','\x20details...','Aborted.','stages','Creating\x20new\x20version...','draft','Fetching\x20parent\x20segment...','journey:version:view','379345RGPFBj','content','green','toLowerCase','links','\x20journey\x20files\x20to\x20','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','\x20journeys','nodes','goalSize','\x20new\x20files','exitOrJumpSize','paused','activationParams','audienceId','Resume\x20a\x20paused\x20journey','error','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','json','parentSegment','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Error:\x20Invalid\x20--type\x20\x22','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','enteredSize','then','hasPeriod','Fetching\x20users\x20and\x20connections...','Pausing\x20journey...','Warning:\x20Could\x20not\x20resolve\x20segment\x20','journey:versions','1730paghtF','goal','getJourney','21807CSjFwf','isNew','\x20\x20Statistics\x20not\x20available','List\x20journeys\x20in\x20current\x20context','session','hasChanges','cyan','parentName','Fetching\x20','/j/da/je','conversion','INVALID_ARGUMENT','map','web','Cancelled','set','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Show\x20journey\x20details','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','push','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Resolving\x20version...'];a22_0x1181=function(){return _0x47f982;};return a22_0x1181();}export class JourneyPushCommand extends BaseCommand{['name']=a22_0x5a8bdc(0x9f);['description']=a22_0x5a8bdc(0x9a);[a22_0x5a8bdc(0xac)]=new SegmentPushCommand();async[a22_0x5a8bdc(0x179)](_0x106468){const _0x4fecff=a22_0x5a8bdc,_0x157b81=_0x106468[_0x4fecff(0xa8)][0x0];let _0x46ea25;if(_0x157b81){const _0x5ae280=await resolveTarget({'arg':_0x157b81,'contextParent':_0x106468[_0x4fecff(0x109)][_0x4fecff(0xce)],'cwd':process[_0x4fecff(0x12e)]()});isSuccessfulResolution(_0x5ae280)&&_0x5ae280[_0x4fecff(0x173)]===_0x4fecff(0x17c)&&(_0x46ea25=_0x5ae280[_0x4fecff(0x17f)]);}const _0x28fbd4={..._0x106468,'options':{..._0x106468[_0x4fecff(0x109)],'journeysOnly':!![],..._0x46ea25&&{'singleFilePath':_0x46ea25}}};return this[_0x4fecff(0xac)][_0x4fecff(0x179)](_0x28fbd4);}}export class JourneyVersionsCommand extends BaseCommand{[a22_0x5a8bdc(0x154)]=a22_0x5a8bdc(0xd9);[a22_0x5a8bdc(0x1a1)]=a22_0x5a8bdc(0x10f);async[a22_0x5a8bdc(0x179)](_0xf54002){const _0x140b05=a22_0x5a8bdc,{options:_0x2dda59,args:_0x91f16d,tdx:_0x5c7fb2}=_0xf54002,_0x883aeb=_0x91f16d[0x0];if(!requireNameOrPath(_0x883aeb))return 0x1;if(_0x2dda59['verbose'])console[_0x140b05(0xcb)](_0x140b05(0x11d)+_0x883aeb);const {journeyId:_0x4e8e68}=await resolveJourneyIdFromInput(_0x883aeb,_0x2dda59,_0x5c7fb2),_0x1573e0=await withSpinner(_0x140b05(0x160),()=>_0x5c7fb2[_0x140b05(0x18f)][_0x140b05(0x182)](_0x4e8e68),{'verbose':_0x2dda59[_0x140b05(0xa0)]}),{bundleName:_0x1e8d83,versions:_0x576c8d,latestJourneyId:_0x697b5d}=_0x1573e0[_0x140b05(0xfd)];console['error'](_0x1e8d83+':\x20'+_0x576c8d[_0x140b05(0x19a)]+'\x20version'+(_0x576c8d[_0x140b05(0x19a)]!==0x1?'s':''));const _0x5c6339=_0x576c8d[_0x140b05(0xe9)](_0x3cb705=>({'version':_0x3cb705[_0x140b05(0x140)],'journey_id':_0x3cb705[_0x140b05(0x168)],'name':_0x3cb705['name'],'state':_0x3cb705[_0x140b05(0x135)],'paused':_0x3cb705['paused'],'latest':_0x3cb705['journeyId']===_0x697b5d,'created_at':_0x3cb705['createdAt']}));return await handleSDKOutput(_0x5c6339,_0x2dda59),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a22_0x5a8bdc(0x154)]=a22_0x5a8bdc(0x13c);['description']=a22_0x5a8bdc(0xd2);async[a22_0x5a8bdc(0x179)](_0x1c13df){const _0x205bef=a22_0x5a8bdc,{options:_0x3f6e05,args:_0x407c0d,tdx:_0x1802a9}=_0x1c13df,_0xdcdb8f=_0x407c0d[0x0];if(!requireNameOrPath(_0xdcdb8f))return 0x1;if(_0x3f6e05[_0x205bef(0xa0)])console[_0x205bef(0xcb)](_0x205bef(0x11d)+_0xdcdb8f);const {journeyId:_0x4211a5,journeyName:_0x520ab3}=await resolveJourneyIdFromInput(_0xdcdb8f,_0x3f6e05,_0x1802a9);if(!_0x3f6e05[_0x205bef(0xa6)]){const _0x307a90=await confirm(_0x205bef(0x130)+_0x520ab3+'\x22?');if(!_0x307a90)return console['error'](_0x205bef(0xeb)),0x0;}const _0x449d3b=await withSpinner(_0x205bef(0xb7),()=>_0x1802a9[_0x205bef(0x18f)][_0x205bef(0x129)](_0x4211a5),{'verbose':_0x3f6e05['verbose']}),_0xbfd5f7=_0x449d3b[_0x205bef(0xfd)];return console[_0x205bef(0xcb)](a22_0x56bc5a[_0x205bef(0xbd)]('✔')+_0x205bef(0x107)+_0xbfd5f7['attributes'][_0x205bef(0x140)]+_0x205bef(0x12b)+_0xbfd5f7[_0x205bef(0x159)][_0x205bef(0x154)]+'\x22'),console['error'](_0x205bef(0xf4)+_0xbfd5f7['id']),await handleSingleObjectOutput({'id':_0xbfd5f7['id'],'name':_0xbfd5f7[_0x205bef(0x159)]['name'],'version':_0xbfd5f7['attributes'][_0x205bef(0x140)],'state':_0xbfd5f7['attributes']['state'],'bundle_id':_0xbfd5f7['attributes'][_0x205bef(0x1a3)],'created_at':_0xbfd5f7[_0x205bef(0x159)][_0x205bef(0xfa)]},_0x3f6e05),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a22_0x5a8bdc(0x154)]=a22_0x5a8bdc(0xba);[a22_0x5a8bdc(0x1a1)]=a22_0x5a8bdc(0x13e);async[a22_0x5a8bdc(0x179)](_0x39a6f1){const _0xf65781=a22_0x5a8bdc,{options:_0x4c4756,args:_0x33ac4f,tdx:_0x58cf72}=_0x39a6f1,_0x55b806=_0x33ac4f[0x0];if(!requireNameOrPath(_0x55b806))return 0x1;const _0x152d17=_0x4c4756[_0xf65781(0x9c)];if(!_0x152d17)return console[_0xf65781(0xcb)](_0xf65781(0x14f)),console[_0xf65781(0xcb)](_0xf65781(0xed)),0x1;const _0x40a3b6=parseInt(_0x152d17,0xa);if(isNaN(_0x40a3b6)||_0x40a3b6<0x1)return console['error'](_0xf65781(0x113)+_0x152d17),0x1;if(_0x4c4756['verbose'])console[_0xf65781(0xcb)](_0xf65781(0x11d)+_0x55b806+',\x20version:\x20'+_0x40a3b6);const {journeyId:_0x174345,parentSegmentId:_0x9f0312}=await resolveJourneyIdFromInput(_0x55b806,_0x4c4756,_0x58cf72),_0x325841=await withSpinner(_0xf65781(0xf3),()=>_0x58cf72[_0xf65781(0x18f)][_0xf65781(0x182)](_0x174345),{'verbose':_0x4c4756[_0xf65781(0xa0)]}),{versions:_0x18bbde,latestJourneyId:_0x5dc20c}=_0x325841['data'],_0x643177=_0x18bbde[_0xf65781(0x10c)](_0x5ab312=>_0x5ab312[_0xf65781(0x140)]===_0x40a3b6);if(!_0x643177){const _0x2ac206=_0x18bbde[_0xf65781(0xe9)](_0x1f21dd=>'v'+_0x1f21dd['versionNumber'])[_0xf65781(0x15f)](',\x20');return console[_0xf65781(0xcb)](_0xf65781(0x13f)+_0x40a3b6+_0xf65781(0x12a)+_0x2ac206),0x1;}const _0x262b72=await withSpinner(_0xf65781(0xa9)+_0x40a3b6+_0xf65781(0xb4),()=>_0x58cf72[_0xf65781(0x18f)][_0xf65781(0xdc)](_0x643177[_0xf65781(0x168)]),{'verbose':_0x4c4756[_0xf65781(0xa0)]}),_0x3d51be=_0x262b72[_0xf65781(0xfd)],_0x2c02e2=getConsoleNextUrl(_0x4c4756['site'],_0xf65781(0x186)+_0x9f0312+_0xf65781(0x106)+_0x643177[_0xf65781(0x168)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0x3d51be['id'],'name':_0x3d51be[_0xf65781(0x159)]['name'],'version':_0x3d51be[_0xf65781(0x159)][_0xf65781(0x140)],'description':_0x3d51be[_0xf65781(0x159)]['description'],'state':_0x3d51be[_0xf65781(0x159)][_0xf65781(0x135)],'paused':_0x3d51be[_0xf65781(0x159)]['paused'],'reentry_mode':_0x3d51be[_0xf65781(0x159)]['reentryMode'],'stages':_0x3d51be[_0xf65781(0x159)][_0xf65781(0x139)]?.['length']||0x0,..._0x3d51be[_0xf65781(0x159)]['goal']&&{'goal':_0x3d51be[_0xf65781(0x159)][_0xf65781(0xdb)][_0xf65781(0x154)]},'latest':_0x643177[_0xf65781(0x168)]===_0x5dc20c,'created_at':_0x3d51be['attributes'][_0xf65781(0xfa)],'updated_at':_0x3d51be[_0xf65781(0x159)][_0xf65781(0x16d)],'url':_0x2c02e2},_0x4c4756),0x0;}}
|
|
1
|
+
const a22_0x1d6769=a22_0x5d71;function a22_0x4c2c(){const _0x27a4df=['journeyName','limit','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','8wwMDcB','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Resuming\x20journey...','database','Target\x20directory:\x20','diff','map','parent_segment','List\x20all\x20versions\x20of\x20a\x20journey','description','history','3DVZEqE','\x20changed\x20files','reentryMode','folders','activation','includeHistory','\x20journey\x20files\x20to\x20','No\x20statistics\x20available\x20for\x20journey:\x20','session','versionNumber','blue','replace','message','filter','/j/da','-\x20no\x20files\x20written','green','pause','root\x20folder','✔\x20Journey\x20\x22','Fetching\x20users\x20and\x20connections...','✔\x20Context\x20set:\x20','audienceId','journey:versions','(paused)','Folder\x20path:\x20','\x20journeys','Export\x20journey(s)\x20as\x20YAML\x20files','Getting\x20journey\x20traffic\x20data...','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','segmentPushCommand','Found\x20','Pause\x20a\x20running\x20journey','renderStats','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x22\x20paused','(draft)','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','✔\x20Pulled\x20','table','base','\x20journey','all','Error:\x20Version\x20','(root)','Error:\x20Invalid\x20--type\x20\x22','\x20not\x20found.\x20Available:\x20','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Show\x20journey\x20details','repeat','9743328RsSnZp','getParentFull','add','user','Parent\x20segment:\x20','tsv','type','stageNameMap','Resolved\x20YAML\x20file:\x20','Getting\x20version\x20','\x0aChanges\x20to\x20\x27','Warning:\x20Could\x20not\x20resolve\x20segment\x20','length','\x0aPull\x20summary:','dim','paused','bold','Fetching\x20','state','activationParams','execute','List\x20activations\x20for\x20a\x20journey','no_parent','kind','Resolving\x20version...','push','4294612VNdnlI','createVersion','✔\x20Found\x20','launched','journey','yes','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','...','connector_config','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','data','json','View\x20a\x20specific\x20version\x20of\x20a\x20journey','find','journey:list','sort','entries','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','isNew','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','(archived)','journeyId','Getting\x20journey\x20statistics...','version','then','folderId','journeyBundleName','\x20Created\x20v','journey:pause','web','\x20(ID:\x20','exitOrJumpRate','Pausing\x20journey...','13782411GvzuES','stringify','\x20unchanged\x20files','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','has','\x20\x20Name:\x20','goal','Listing\x20journey\x20activations...','utf-8','stages','325PzIomU','buildIdToEmailMap','log','file','\x20\x20Statistics\x20not\x20available','resourceName','listActivationsFlat','Write\x20','1050524qCHkdH','Pattern:\x20','errorCode','Input:\x20','Error:\x20Stage\x20\x22','updatedAt','getColumnMapping','values','Getting\x20journey\x20details...','setPhase','attributes','listJourneysWithFolders','Resolving\x20parent\x20segment...','conversion','1608710CyoOJO','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Fetching\x20journeys\x20and\x20folders...','segment','absolutePath','createdAt','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20=\x20','List\x20journeys\x20in\x20current\x20context','resolveJourneyId','.yml','goalSize','set','getActivation','📁\x20','🗺️\x20','\x20->\x20','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','enteredSize','format','Available\x20stages:\x20','name','/j/da/je','cyan','journey:view','Error:\x20Journey\x20not\x20found:\x20','journey:push','stage','Show\x20journey\x20table\x20column\x20mapping','No\x20journeys\x20found','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20versions)','\x20Opening\x20','helpText','args','exitOrJumpSize','completed','INVALID_ARGUMENT','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x20details...','filePath','get','\x20\x20Journey\x20ID:\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','hasPeriod','\x5c$&','Show\x20journey\x20statistics','options','journeyBundleId','Cancelled','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x22\x20resumed','\x20\x20Folder\x20path:\x20','journey:traffic','connection','red','\x20(rule\x20match)','toLowerCase','relative','\x20\x20Target:\x20','jsonl','rule','test','completionRate','targetDir','/e/','163110lAlBFR','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','(running)','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','buildIdToNameMap','tdx.json','✔\x20All\x20files\x20are\x20up\x20to\x20date','segments','Listing\x20journeys...','77797840xWQxtj','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','Resume\x20a\x20paused\x20journey','\x0aError:','segmentName','listVersions','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','journey:version:create','resolveParentId','site','parentName','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','resume','\x20\x20-\x20','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','getLatestJourneyId','/app/ps/','Journey\x20name:\x20','verbose','rootFolderId','cwd','Target\x20file:\x20','localeCompare','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Warning:\x20Could\x20not\x20resolve\x20activation\x20','getStatistics','folderPath','join','Resolving\x20journey...','\x20new\x20files','Creating\x20new\x20version...','journey:columns','journey:activations','from','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','getJourney','activation_','journeyStages','\x20(draft)\x20—\x20\x22','dryRun','size','Database:\x20','Error:\x20Invalid\x20version\x20number:\x20','hasChanges','split','parentSegment','journey:resume'];a22_0x4c2c=function(){return _0x27a4df;};return a22_0x4c2c();}(function(_0x3ee55d,_0xb38946){const _0x462fc3=a22_0x5d71,_0x41cf3c=_0x3ee55d();while(!![]){try{const _0x472225=-parseInt(_0x462fc3(0x1b3))/0x1+parseInt(_0x462fc3(0x1a5))/0x2+-parseInt(_0x462fc3(0x126))/0x3*(parseInt(_0x462fc3(0x172))/0x4)+-parseInt(_0x462fc3(0x19d))/0x5*(parseInt(_0x462fc3(0x1f6))/0x6)+-parseInt(_0x462fc3(0x158))/0x7+-parseInt(_0x462fc3(0x235))/0x8*(parseInt(_0x462fc3(0x193))/0x9)+parseInt(_0x462fc3(0x200))/0xa;if(_0x472225===_0xb38946)break;else _0x41cf3c['push'](_0x41cf3c['shift']());}catch(_0x432076){_0x41cf3c['push'](_0x41cf3c['shift']());}}}(a22_0x4c2c,0xe3a17));import a22_0x4d1f82 from'chalk';import a22_0x3db790 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x2fd44e){const _0x5bc5a2=a22_0x5d71;return!_0x2fd44e&&(console[_0x5bc5a2(0x232)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x5bc5a2(0x143))),!!_0x2fd44e;}function withJsonFormat(_0x2a12c1){const _0x3f68d6=a22_0x5d71;if(!_0x2a12c1['format']&&!_0x2a12c1[_0x3f68d6(0x17d)]&&!_0x2a12c1[_0x3f68d6(0x1f0)]&&!_0x2a12c1[_0x3f68d6(0x15d)])return{..._0x2a12c1,'format':'json','json':!![]};return _0x2a12c1;}function formatJourneyState(_0x227b5e){const _0x119890=a22_0x5d71;switch(_0x227b5e){case _0x119890(0x175):return a22_0x4d1f82[_0x119890(0x136)](_0x119890(0x1f8));case'draft':return a22_0x4d1f82[_0x119890(0x166)](_0x119890(0x14a));case _0x119890(0x167):return a22_0x4d1f82['yellow'](_0x119890(0x13e));case _0x119890(0x1d8):return a22_0x4d1f82[_0x119890(0x130)]('(completed)');case'archived':return a22_0x4d1f82[_0x119890(0x166)](_0x119890(0x186));default:return'('+_0x227b5e+')';}}function formatJourneyItem(_0x324ea9,_0x4bf9ce='',_0x488ed5){const _0x492c5b=a22_0x5d71,_0x39fbe8=formatJourneyState(_0x324ea9[_0x492c5b(0x16a)]),_0x5ef2f7=_0x488ed5?hyperlink(_0x324ea9[_0x492c5b(0x18c)],_0x488ed5):_0x324ea9[_0x492c5b(0x18c)];return _0x4bf9ce+_0x492c5b(0x1c2)+_0x5ef2f7+'\x20'+_0x39fbe8;}function escapeRegex(_0x49febe){const _0x31dfef=a22_0x5d71;return _0x49febe[_0x31dfef(0x131)](/[.*+?^${}()|[\]\\]/g,_0x31dfef(0x1e1));}function globToRegex(_0xd903f3){const _0x25d760=a22_0x5d71,_0x38e0da=_0xd903f3[_0x25d760(0x22d)]('*')[_0x25d760(0x23b)](escapeRegex);return new RegExp(_0x38e0da[_0x25d760(0x21c)]('.*'),'i');}function buildRuleToNameMapping(_0x26518b){const _0xd5a950=a22_0x5d71,_0x2429c1=new Map();if(_0x26518b[_0xd5a950(0x1fe)])for(const [_0x25d42a,_0x355cfb]of Object[_0xd5a950(0x182)](_0x26518b[_0xd5a950(0x1fe)])){if(_0x355cfb['rule']){const _0x352aae=serializeRule(_0x355cfb[_0xd5a950(0x1f1)]),_0xab9c7b=_0x2429c1['get'](_0x352aae);_0xab9c7b?_0xab9c7b[_0xd5a950(0x171)](_0x25d42a):_0x2429c1[_0xd5a950(0x1bf)](_0x352aae,[_0x25d42a]);}}return _0x2429c1;}async function resolveJourneyIdFromInput(_0x26dc21,_0x5180f9,_0x55f325){const _0x127dd0=a22_0x5d71,_0x4678ed=await resolveJourneyTarget(_0x26dc21,_0x5180f9[_0x127dd0(0x22e)],_0x5180f9[_0x127dd0(0x213)]),_0x7eb2b3=_0x4678ed['parentSegment'];if(!_0x7eb2b3)throw new SDKError(ErrorCode[_0x127dd0(0x1d9)],_0x127dd0(0x218));const _0x101c00=await withSpinner(_0x127dd0(0x1b1),()=>_0x55f325[_0x127dd0(0x1b6)][_0x127dd0(0x209)](_0x7eb2b3),{'verbose':_0x5180f9[_0x127dd0(0x213)]}),_0x5eb003=_0x101c00[_0x127dd0(0x17c)],_0x45e4e0=await withSpinner(_0x127dd0(0x21d),()=>_0x55f325[_0x127dd0(0x176)][_0x127dd0(0x1bc)](_0x5eb003,_0x4678ed[_0x127dd0(0x230)]),{'verbose':_0x5180f9[_0x127dd0(0x213)]});return{'journeyId':_0x45e4e0[_0x127dd0(0x17c)],'journeyName':_0x4678ed[_0x127dd0(0x230)],'parentSegmentId':_0x5eb003};}async function resolveJourneyTarget(_0x227999,_0x8998da,_0x5de2c0){const _0x5b3424=a22_0x5d71;if(isYamlFilePath(_0x227999))try{const _0x33f7d5=await resolveYamlFilePath(_0x227999);return _0x5de2c0&&(console['error'](_0x5b3424(0x160)+_0x227999),console[_0x5b3424(0x232)]('\x20\x20Parent\x20segment:\x20'+_0x33f7d5[_0x5b3424(0x22e)]),console[_0x5b3424(0x232)](_0x5b3424(0x198)+_0x33f7d5[_0x5b3424(0x204)]),console[_0x5b3424(0x232)](_0x5b3424(0x1e8)+(_0x33f7d5[_0x5b3424(0x21b)]||_0x5b3424(0x152)))),{'journeyName':_0x33f7d5[_0x5b3424(0x204)],'parentSegment':_0x33f7d5['parentSegment'],'resolved':_0x33f7d5};}catch(_0x41f801){throw new SDKError(ErrorCode[_0x5b3424(0x1d9)],_0x5b3424(0x207)+_0x41f801[_0x5b3424(0x132)]);}if(!_0x8998da)throw new SDKError(ErrorCode[_0x5b3424(0x1d9)],_0x5b3424(0x148));return{'journeyName':_0x227999,'parentSegment':_0x8998da};}export class JourneyListCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x180);['description']=a22_0x1d6769(0x1bb);async[a22_0x1d6769(0x16c)](_0x2e5f6a){const _0x41f36c=a22_0x1d6769,{options:_0x13317d,args:_0x4b9964,tdx:_0x37b973}=_0x2e5f6a,_0x21687c=_0x4b9964[0x0],_0x15d5e9=_0x13317d[_0x41f36c(0x22e)];if(!_0x15d5e9)return console['error']('Error:\x20Parent\x20segment\x20context\x20required'),console['error'](_0x41f36c(0x1b9)),0x1;const _0x40a62e=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x37b973[_0x41f36c(0x1b6)]['resolveParentId'](_0x15d5e9),{'verbose':_0x13317d[_0x41f36c(0x213)]}),_0x59572b=_0x40a62e[_0x41f36c(0x17c)];_0x13317d[_0x41f36c(0x213)]&&(console[_0x41f36c(0x232)](_0x41f36c(0x15c)+_0x15d5e9+_0x41f36c(0x190)+_0x59572b+')'),_0x21687c&&console[_0x41f36c(0x232)](_0x41f36c(0x1a6)+_0x21687c));const _0x19886a=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x37b973['segment'][_0x41f36c(0x159)](_0x59572b),{'verbose':_0x13317d['verbose']}),_0x4fb8a2=_0x19886a['data'],_0x2ca7f9=_0x4fb8a2[_0x41f36c(0x214)],_0x129313=await withSpinner(_0x41f36c(0x1ff),()=>_0x37b973[_0x41f36c(0x176)][_0x41f36c(0x1b0)](_0x59572b,_0x2ca7f9),{'verbose':_0x13317d[_0x41f36c(0x213)]});let _0x1cd286=_0x129313['data']['journeys'];const _0x2b5120=_0x129313[_0x41f36c(0x17c)][_0x41f36c(0x129)],_0x274cfe=new Map();for(const _0x602239 of _0x2b5120){_0x274cfe[_0x41f36c(0x1bf)](_0x602239['id'],_0x602239['name']);}if(_0x21687c){const _0x3d5ac9=globToRegex(_0x21687c);_0x1cd286=_0x1cd286[_0x41f36c(0x133)](_0x147710=>_0x3d5ac9[_0x41f36c(0x1f2)](_0x147710[_0x41f36c(0x18c)]));}console[_0x41f36c(0x232)](_0x41f36c(0x174)+_0x1cd286[_0x41f36c(0x164)]+_0x41f36c(0x14f)+(_0x1cd286[_0x41f36c(0x164)]!==0x1?'s':''));const _0x5e6d22=_0x558ab6=>{const _0x2affd7=_0x41f36c;return getConsoleNextUrl(_0x13317d['site'],_0x2affd7(0x211)+_0x59572b+'/e/'+_0x558ab6+_0x2affd7(0x134));};if(_0x13317d[_0x41f36c(0x1c7)]===_0x41f36c(0x14d))await handleSDKOutput(_0x1cd286,_0x13317d);else{if(_0x13317d[_0x41f36c(0x1c7)]===_0x41f36c(0x17d)){const _0x32d5d9=_0x1cd286['map'](_0xd35b66=>({..._0xd35b66,'url':_0x5e6d22(_0xd35b66['id'])}));await handleSDKOutput(_0x32d5d9,_0x13317d);}else{console[_0x41f36c(0x19f)]('['+_0x15d5e9+']');const _0x10f948=new Map(),_0x30177f=[];for(const _0x1b42e4 of _0x1cd286){if(!_0x1b42e4[_0x41f36c(0x18b)]||_0x1b42e4[_0x41f36c(0x18b)]===_0x2ca7f9)_0x30177f[_0x41f36c(0x171)](_0x1b42e4);else{const _0x1c4224=_0x10f948[_0x41f36c(0x1dd)](_0x1b42e4[_0x41f36c(0x18b)])||[];_0x1c4224[_0x41f36c(0x171)](_0x1b42e4),_0x10f948[_0x41f36c(0x1bf)](_0x1b42e4[_0x41f36c(0x18b)],_0x1c4224);}}const _0x51088c=(_0x4e0609,_0x5921ca)=>_0x4e0609[_0x41f36c(0x18c)][_0x41f36c(0x217)](_0x5921ca['journeyBundleName'],undefined,{'sensitivity':_0x41f36c(0x14e)});_0x30177f['sort'](_0x51088c);for(const _0x496ffb of _0x30177f){console[_0x41f36c(0x19f)](formatJourneyItem(_0x496ffb,'',_0x5e6d22(_0x496ffb['id'])));}const _0x3d73b8=[..._0x10f948[_0x41f36c(0x182)]()][_0x41f36c(0x181)]((_0xb43dd,_0xbbf766)=>{const _0x292818=_0x41f36c,_0x27e9d0=_0x274cfe[_0x292818(0x1dd)](_0xb43dd[0x0])||_0xb43dd[0x0],_0x4c8a8f=_0x274cfe['get'](_0xbbf766[0x0])||_0xbbf766[0x0];return _0x27e9d0['localeCompare'](_0x4c8a8f,undefined,{'sensitivity':'base'});});for(const [_0x6bede5,_0x4cfcab]of _0x3d73b8){const _0x518c0d=_0x274cfe[_0x41f36c(0x1dd)](_0x6bede5)||_0x6bede5;console[_0x41f36c(0x19f)](_0x41f36c(0x1c1)+_0x518c0d),_0x4cfcab[_0x41f36c(0x181)](_0x51088c);for(const _0x11921e of _0x4cfcab){console[_0x41f36c(0x19f)](formatJourneyItem(_0x11921e,'\x20\x20',_0x5e6d22(_0x11921e['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x1cc);[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x156);async[a22_0x1d6769(0x16c)](_0x465d7a){const _0x3e8734=a22_0x1d6769,{options:_0x443ca8,args:_0x1d8f1e,tdx:_0x44f54f}=_0x465d7a,_0x526d68=_0x1d8f1e[0x0];if(!_0x526d68)return console[_0x3e8734(0x232)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x3e8734(0x232)](_0x3e8734(0x20c)),console[_0x3e8734(0x232)]('Options:'),console[_0x3e8734(0x232)](_0x3e8734(0x183)),0x1;_0x443ca8[_0x3e8734(0x213)]&&console['error'](_0x3e8734(0x1a8)+_0x526d68);const {journeyId:_0x3412f0,parentSegmentId:_0x39289e}=await resolveJourneyIdFromInput(_0x526d68,_0x443ca8,_0x44f54f);if(_0x443ca8[_0x3e8734(0x18f)]){const _0x5f135a=getConsoleNextUrl(_0x443ca8[_0x3e8734(0x20a)],'/app/ps/'+_0x39289e+_0x3e8734(0x1f5)+_0x3412f0+_0x3e8734(0x1ca));return console[_0x3e8734(0x232)](a22_0x4d1f82['green']('✔')+_0x3e8734(0x1d4)+a22_0x4d1f82[_0x3e8734(0x1cb)](_0x5f135a)),openBrowser(_0x5f135a),0x0;}const _0x25b09d=await withSpinner(_0x3e8734(0x1ad),()=>_0x44f54f[_0x3e8734(0x176)][_0x3e8734(0x224)](_0x3412f0),{'verbose':_0x443ca8[_0x3e8734(0x213)]}),_0x9b3b16=_0x25b09d['data'],_0x31e196=_0x443ca8['includeStats'];let _0x5d5940;if(_0x31e196)try{const _0xadf673=await withSpinner(_0x3e8734(0x188),()=>_0x44f54f[_0x3e8734(0x176)]['getStatistics'](_0x3412f0),{'verbose':_0x443ca8[_0x3e8734(0x213)]});_0x5d5940=_0xadf673[_0x3e8734(0x17c)];}catch{_0x443ca8[_0x3e8734(0x213)]&&console[_0x3e8734(0x232)](_0x3e8734(0x1a1));}const _0x339ea1=getConsoleNextUrl(_0x443ca8[_0x3e8734(0x20a)],_0x3e8734(0x211)+_0x39289e+_0x3e8734(0x1f5)+_0x3412f0+_0x3e8734(0x1ca)),_0x315778={'id':_0x9b3b16['id'],'name':_0x9b3b16[_0x3e8734(0x1af)][_0x3e8734(0x1c9)],'description':_0x9b3b16['attributes'][_0x3e8734(0x23e)],'state':_0x9b3b16[_0x3e8734(0x1af)][_0x3e8734(0x16a)],'paused':_0x9b3b16['attributes']['paused'],'reentry_mode':_0x9b3b16['attributes']['reentryMode'],'stages':_0x9b3b16[_0x3e8734(0x1af)][_0x3e8734(0x226)]?.[_0x3e8734(0x164)]||0x0,..._0x9b3b16['attributes'][_0x3e8734(0x199)]&&{'goal':_0x9b3b16[_0x3e8734(0x1af)]['goal']['name']},..._0x5d5940&&{'statistics':{'size':_0x5d5940[_0x3e8734(0x229)],'entered':_0x5d5940['enteredSize'],'goal_achieved':_0x5d5940[_0x3e8734(0x1be)],'completion_rate':_0x5d5940[_0x3e8734(0x1f3)],'exit_or_jump':_0x5d5940['exitOrJumpSize'],'exit_or_jump_rate':_0x5d5940['exitOrJumpRate'],'stages':_0x5d5940['stages']}},'url':_0x339ea1};return await handleSingleObjectOutput(_0x315778,_0x443ca8),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]='journey:stats';[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x1e2);async[a22_0x1d6769(0x16c)](_0x2079b6){const _0x1655c6=a22_0x1d6769,{options:_0x3fe7a9,args:_0x314480,tdx:_0x4e5ce1}=_0x2079b6,_0x54ddb1=_0x314480[0x0];if(!requireNameOrPath(_0x54ddb1))return 0x1;_0x3fe7a9[_0x1655c6(0x213)]&&console[_0x1655c6(0x232)]('Input:\x20'+_0x54ddb1);const _0x4612e6=_0x3fe7a9,_0x1eb991=_0x4612e6[_0x1655c6(0x222)],_0x97565e=_0x4612e6['to'],_0x15835d=_0x4612e6[_0x1655c6(0x12b)],_0x376441=_0x4612e6[_0x1655c6(0x1cf)];_0x15835d&&!_0x1eb991&&!_0x97565e&&console[_0x1655c6(0x232)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x5cac0d=_0x15835d?withJsonFormat(_0x3fe7a9):_0x3fe7a9,{journeyId:_0x235410,journeyName:_0x3d03f7}=await resolveJourneyIdFromInput(_0x54ddb1,_0x5cac0d,_0x4e5ce1),_0x3a00e4=_0x1eb991||_0x97565e?{'from':_0x1eb991,'to':_0x97565e}:undefined,_0x3ec855=await withSpinner(_0x1655c6(0x188),()=>Promise[_0x1655c6(0x150)]([_0x4e5ce1[_0x1655c6(0x176)][_0x1655c6(0x224)](_0x235410),_0x4e5ce1[_0x1655c6(0x176)][_0x1655c6(0x21a)](_0x235410,_0x3a00e4)]),{'verbose':_0x5cac0d[_0x1655c6(0x213)]}),[_0x596de6,_0x269e5e]=_0x3ec855[_0x1655c6(0x17c)];if(!_0x269e5e||_0x269e5e[_0x1655c6(0x187)]===null)return console[_0x1655c6(0x232)](_0x1655c6(0x12d)+_0x3d03f7),console[_0x1655c6(0x232)](_0x1655c6(0x236)),0x0;const _0x13a614=buildStageNameMap(_0x596de6),_0x3a7ba8=!!(_0x3a00e4&&_0x269e5e[_0x1655c6(0x125)]?.[_0x1655c6(0x164)]),_0x42b936={'stageNameMap':_0x13a614,'hasPeriod':_0x3a7ba8,'includeHistory':!!_0x15835d};if(_0x376441&&_0x269e5e[_0x1655c6(0x19c)]){const _0x4348c1=_0x269e5e['stages'][_0x1655c6(0x17f)](_0x1581d2=>{const _0x15c90d=_0x1655c6,_0x55c8c3=_0x13a614[_0x15c90d(0x1dd)](_0x1581d2['id'])??'';return _0x55c8c3[_0x15c90d(0x1ed)]()===_0x376441['toLowerCase']();});if(_0x4348c1)return await handleSingleObjectOutput(formatStageStats(_0x4348c1,_0x42b936),_0x5cac0d),0x0;const _0x19cc51=_0x269e5e['stages'][_0x1655c6(0x23b)](_0x2424ad=>_0x13a614[_0x1655c6(0x1dd)](_0x2424ad['id'])??_0x2424ad['id']);return console[_0x1655c6(0x232)](_0x1655c6(0x1a9)+_0x376441+'\x22\x20not\x20found'),console['error'](_0x1655c6(0x1c8)+_0x19cc51[_0x1655c6(0x21c)](',\x20')),0x1;}const _0x12f7a3=_0x269e5e[_0x1655c6(0x19c)]?.[_0x1655c6(0x23b)](_0x50d385=>formatStageStats(_0x50d385,_0x42b936)),_0x4471f0=assembleJourneyStats(_0x269e5e,{'from':_0x1eb991,'to':_0x97565e,'includeHistory':_0x15835d});return await this[_0x1655c6(0x147)](_0x4471f0,_0x12f7a3??[],_0x5cac0d),0x0;}async[a22_0x1d6769(0x147)](_0x2d4d3e,_0x2bd9cd,_0x262fc7){const _0x20e4c5=a22_0x1d6769,_0x901791=_0x262fc7['format']===_0x20e4c5(0x17d)||_0x262fc7[_0x20e4c5(0x1c7)]==='jsonl'||_0x262fc7[_0x20e4c5(0x17d)]||_0x262fc7[_0x20e4c5(0x1f0)];if(_0x901791){_0x2d4d3e[_0x20e4c5(0x19c)]=_0x2bd9cd,await handleSingleObjectOutput(_0x2d4d3e,_0x262fc7);return;}await handleSingleObjectOutput(_0x2d4d3e,_0x262fc7);for(const _0x3502cc of _0x2bd9cd){console[_0x20e4c5(0x19f)](''),console[_0x20e4c5(0x19f)](String(a22_0x4d1f82['cyan'][_0x20e4c5(0x168)]('['+_0x3502cc['name']+']'))+a22_0x4d1f82[_0x20e4c5(0x166)]('\x20'+_0x3502cc['id']));const {id:_0x4c5ffe,name:_0xd270f7,..._0x5f6a3a}=_0x3502cc;await handleSingleObjectOutput(_0x5f6a3a,_0x262fc7);}}}export class JourneyTrafficCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x1e9);[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x1c5);async[a22_0x1d6769(0x16c)](_0x190d27){const _0xb5c4c1=a22_0x1d6769,{options:_0x40cbc3,args:_0x486ea2,tdx:_0x3ae74c}=_0x190d27,_0x181cd3=_0x486ea2[0x0];if(!requireNameOrPath(_0x181cd3))return 0x1;_0x40cbc3[_0xb5c4c1(0x213)]&&console[_0xb5c4c1(0x232)](_0xb5c4c1(0x1a8)+_0x181cd3);const _0x174cb7=_0x40cbc3,_0x20236a=_0x174cb7[_0xb5c4c1(0x15e)],_0x111366=_0x174cb7[_0xb5c4c1(0x222)],_0x1e55dd=_0x174cb7['to'],_0x1f3e90=_0x174cb7[_0xb5c4c1(0x231)];if(_0x20236a&&_0x20236a!==_0xb5c4c1(0x1b2)&&_0x20236a!=='activation')return console[_0xb5c4c1(0x232)](_0xb5c4c1(0x153)+_0x20236a+_0xb5c4c1(0x1b4)),0x1;const _0x1968f2=withJsonFormat(_0x40cbc3),{journeyId:_0x15d29f,journeyName:_0x263c78}=await resolveJourneyIdFromInput(_0x181cd3,_0x1968f2,_0x3ae74c),_0x4fb645={'type':_0x20236a,'from':_0x111366,'to':_0x1e55dd,'limit':_0x1f3e90},_0x5775ac=await withSpinner(_0xb5c4c1(0x142),()=>_0x3ae74c[_0xb5c4c1(0x176)]['getTrafficData'](_0x15d29f,_0x4fb645),{'verbose':_0x1968f2[_0xb5c4c1(0x213)]}),_0x2553b7=_0x5775ac[_0xb5c4c1(0x17c)],_0x2bc7ed=_0x2553b7[_0xb5c4c1(0x1b2)]&&(_0x2553b7[_0xb5c4c1(0x1b2)]['nodes'][_0xb5c4c1(0x164)]>0x0||_0x2553b7[_0xb5c4c1(0x1b2)]['links'][_0xb5c4c1(0x164)]>0x0),_0x475a85=_0x2553b7[_0xb5c4c1(0x12a)]&&_0x2553b7[_0xb5c4c1(0x12a)][_0xb5c4c1(0x164)]>0x0;if(!_0x2bc7ed&&!_0x475a85)return console['error'](_0xb5c4c1(0x196)+_0x263c78),console[_0xb5c4c1(0x232)](_0xb5c4c1(0x178)),_0x111366&&_0x1e55dd&&console[_0xb5c4c1(0x232)](_0xb5c4c1(0x1f7)),0x0;return await handleSingleObjectOutput(_0x2553b7,_0x1968f2),0x0;}}function formatStageStats(_0x2c42bf,_0x44c89b){const _0x72e2cf=a22_0x1d6769,_0x3976b6=_0x44c89b['hasPeriod']&&_0x2c42bf[_0x72e2cf(0x125)]?.[_0x72e2cf(0x164)]?aggregateStageHistory(_0x2c42bf['history']):{'size':_0x2c42bf[_0x72e2cf(0x229)],'entered':_0x2c42bf[_0x72e2cf(0x1c6)],'milestone':_0x2c42bf['milestoneSize'],'milestone_rate':_0x2c42bf['completeMilestoneRate'],'exit_or_jump':_0x2c42bf[_0x72e2cf(0x1d7)],'exit_or_jump_rate':_0x2c42bf[_0x72e2cf(0x191)]},_0x385d22={'id':_0x2c42bf['id'],'name':_0x44c89b[_0x72e2cf(0x15f)][_0x72e2cf(0x1dd)](_0x2c42bf['id'])??_0x2c42bf['id'],..._0x3976b6};return _0x44c89b[_0x72e2cf(0x1e0)]&&_0x44c89b[_0x72e2cf(0x12b)]&&_0x2c42bf['history']&&(_0x385d22[_0x72e2cf(0x125)]=_0x2c42bf[_0x72e2cf(0x125)]),_0x385d22;}export class JourneyPauseCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x18e);['description']=a22_0x1d6769(0x146);async[a22_0x1d6769(0x16c)](_0x2bb5c4){const _0x2626e6=a22_0x1d6769,{options:_0x56032f,args:_0x4b7cdb,tdx:_0x546195}=_0x2bb5c4,_0x1c8e12=_0x4b7cdb[0x0];if(!requireNameOrPath(_0x1c8e12))return 0x1;_0x56032f[_0x2626e6(0x213)]&&console['error'](_0x2626e6(0x1a8)+_0x1c8e12);const {journeyId:_0x567d03,journeyName:_0x502988}=await resolveJourneyIdFromInput(_0x1c8e12,_0x56032f,_0x546195);if(!_0x56032f[_0x2626e6(0x177)]){const _0x5433b1=await confirm(_0x2626e6(0x223)+_0x502988+'\x22?');if(!_0x5433b1)return console[_0x2626e6(0x232)](_0x2626e6(0x1e5)),0x0;}const _0x1296c5=await withSpinner(_0x2626e6(0x192),()=>_0x546195['journey'][_0x2626e6(0x137)](_0x567d03),{'verbose':_0x56032f[_0x2626e6(0x213)]}),_0x4e2157=_0x1296c5[_0x2626e6(0x17c)];return console['error'](_0x2626e6(0x139)+_0x4e2157[_0x2626e6(0x1af)][_0x2626e6(0x1c9)]+_0x2626e6(0x149)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a22_0x1d6769(0x22f);[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x202);async[a22_0x1d6769(0x16c)](_0x37b003){const _0x10919f=a22_0x1d6769,{options:_0x5dabc2,args:_0x2f1bbe,tdx:_0x134f24}=_0x37b003,_0x55a096=_0x2f1bbe[0x0];if(!requireNameOrPath(_0x55a096))return 0x1;_0x5dabc2['verbose']&&console['error'](_0x10919f(0x1a8)+_0x55a096);const {journeyId:_0x31889a,journeyName:_0x485893}=await resolveJourneyIdFromInput(_0x55a096,_0x5dabc2,_0x134f24);if(!_0x5dabc2[_0x10919f(0x177)]){const _0x3f51b9=await confirm(_0x10919f(0x14b)+_0x485893+'\x22?');if(!_0x3f51b9)return console[_0x10919f(0x232)](_0x10919f(0x1e5)),0x0;}const _0x20602c=await withSpinner(_0x10919f(0x237),()=>_0x134f24[_0x10919f(0x176)][_0x10919f(0x20d)](_0x31889a),{'verbose':_0x5dabc2[_0x10919f(0x213)]}),_0x10c03a=_0x20602c['data'];return console['error'](_0x10919f(0x139)+_0x10c03a[_0x10919f(0x1af)][_0x10919f(0x1c9)]+_0x10919f(0x1e7)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]='journey:pull';['description']=a22_0x1d6769(0x141);async[a22_0x1d6769(0x16c)](_0x396e22){const _0x3316be=a22_0x1d6769,{options:_0x37d45c,args:_0x143101,tdx:_0x3f74c5}=_0x396e22,_0xf119b6=_0x37d45c,_0x25b708=_0x143101[0x0],_0x48b431=_0x25b708&&isYamlFilePath(_0x25b708),_0x58f81e=await resolveTarget({'arg':_0x48b431?_0x25b708:undefined,'contextParent':_0x37d45c[_0x3316be(0x22e)],'cwd':process[_0x3316be(0x215)]()});if(!isSuccessfulResolution(_0x58f81e))return _0x58f81e[_0x3316be(0x1a7)]===_0x3316be(0x16e)?(console[_0x3316be(0x232)](a22_0x4d1f82['yellow'](_0x3316be(0x185))),console['error'](_0x3316be(0x201)),console[_0x3316be(0x232)](_0x3316be(0x1fa)),console[_0x3316be(0x232)](_0x3316be(0x233)),console[_0x3316be(0x232)](_0x3316be(0x206))):(console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x1eb)]('Error:\x20'+_0x58f81e[_0x3316be(0x132)]+'\x0a')),_0x58f81e[_0x3316be(0x1d5)]&&console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x1cb)](_0x58f81e[_0x3316be(0x1d5)]))),0x1;let _0x1d1594=_0x48b431?undefined:_0x25b708,_0x1b9382,_0x13ae69;_0x58f81e[_0x3316be(0x15e)]==='file'&&(_0x1d1594=_0x58f81e[_0x3316be(0x1a2)],_0x1b9382=_0x58f81e[_0x3316be(0x1dc)],_0x13ae69=_0x58f81e[_0x3316be(0x21b)]);const _0x20047b=_0x58f81e[_0x3316be(0x20b)],_0x543d2e=_0x58f81e[_0x3316be(0x1f4)];_0xf119b6[_0x3316be(0x213)]&&(console[_0x3316be(0x232)]('Parent\x20segment:\x20'+_0x20047b),console['error'](_0x3316be(0x239)+_0x543d2e),_0x1d1594&&console[_0x3316be(0x232)](_0x3316be(0x212)+_0x1d1594),_0x1b9382&&console[_0x3316be(0x232)](_0x3316be(0x216)+_0x1b9382),_0x13ae69&&console[_0x3316be(0x232)](_0x3316be(0x13f)+_0x13ae69));const _0x537091=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x3f74c5[_0x3316be(0x1b6)][_0x3316be(0x209)](_0x20047b),{'verbose':_0x37d45c[_0x3316be(0x213)]}),_0x85d107=_0x537091[_0x3316be(0x17c)],{journeys:_0x1830b1,folders:_0x3cd384}=await withSpinner(_0x3316be(0x1b5),async()=>{const _0x471d21=_0x3316be,[_0x3f99c0,_0x4126a4]=await Promise['all']([_0x3f74c5[_0x471d21(0x176)]['listJourneysFromParentSegment'](_0x85d107,undefined,{'includeAllVersions':!![]}),_0x3f74c5[_0x471d21(0x1b6)]['listFolders'](_0x85d107)]);return{'journeys':_0x3f99c0,'folders':_0x4126a4};},{'verbose':_0x37d45c[_0x3316be(0x213)]})[_0x3316be(0x18a)](_0x469c13=>_0x469c13[_0x3316be(0x17c)]);let _0x2fa207=_0x1830b1;const _0x4f93ea=buildFolderIdToPathMap(_0x3cd384);if(_0x1d1594){const _0x5bfeff=_0x2fa207[_0x3316be(0x133)](_0x98407c=>_0x98407c['journeyBundleName'][_0x3316be(0x1ed)]()===_0x1d1594[_0x3316be(0x1ed)]());if(_0x5bfeff[_0x3316be(0x164)]===0x0)return console[_0x3316be(0x232)](_0x3316be(0x1cd)+_0x1d1594),console[_0x3316be(0x232)](_0x3316be(0x20f)),0x1;_0x2fa207=_0x5bfeff;}if(_0x13ae69!==undefined){const _0x1d2d7c=_0x2fa207[_0x3316be(0x133)](_0x11f870=>{const _0x421b54=_0x3316be,_0x11b6b9=_0x11f870[_0x421b54(0x18b)]?_0x4f93ea[_0x421b54(0x1dd)](_0x11f870['folderId'])||'':'';return _0x11b6b9===_0x13ae69;});if(_0x1d2d7c[_0x3316be(0x164)]===0x0&&_0x2fa207[_0x3316be(0x164)]>0x0){console[_0x3316be(0x232)]('Error:\x20Journey\x20\x27'+_0x1d1594+'\x27\x20not\x20found\x20in\x20'+(_0x13ae69||_0x3316be(0x138))),console['error'](_0x3316be(0x234));for(const _0x21022e of _0x2fa207){const _0x11e810=_0x21022e[_0x3316be(0x18b)]?_0x4f93ea[_0x3316be(0x1dd)](_0x21022e[_0x3316be(0x18b)])||'':'';console['error'](_0x3316be(0x20e)+(_0x11e810||_0x3316be(0x152))+'/'+_0x21022e[_0x3316be(0x18c)]);}return 0x1;}_0x2fa207=_0x1d2d7c;}if(_0x2fa207[_0x3316be(0x164)]===0x0)return console[_0x3316be(0x232)](_0x3316be(0x1d1)),0x0;const _0x466a6e=new Map();for(const _0x192789 of _0x2fa207){const _0x1c9e65=_0x192789['journeyBundleId'];!_0x466a6e[_0x3316be(0x197)](_0x1c9e65)&&_0x466a6e[_0x3316be(0x1bf)](_0x1c9e65,[]),_0x466a6e[_0x3316be(0x1dd)](_0x1c9e65)[_0x3316be(0x171)](_0x192789);}for(const _0xa39551 of _0x466a6e['values']()){_0xa39551[_0x3316be(0x181)]((_0x1c0108,_0x118f10)=>(_0x1c0108[_0x3316be(0x12f)]||0x0)-(_0x118f10[_0x3316be(0x12f)]||0x0));}const _0xe5d1b0=[],{idToEmailMap:_0x2b4ae0,connectionIdToNameMap:_0x4420ad}=await withSpinner(_0x3316be(0x13a),async()=>{const _0x4a1ab0=_0x3316be,[_0x3627f2,_0x1d9d3c]=await Promise[_0x4a1ab0(0x150)]([_0x3f74c5[_0x4a1ab0(0x15b)][_0x4a1ab0(0x19e)](),_0x3f74c5[_0x4a1ab0(0x1ea)][_0x4a1ab0(0x1fb)]()]);return{'idToEmailMap':_0x3627f2,'connectionIdToNameMap':_0x1d9d3c};},{'verbose':_0x37d45c[_0x3316be(0x213)]})['then'](_0x129f19=>_0x129f19[_0x3316be(0x17c)]);for(const _0x3cbe37 of _0x466a6e[_0x3316be(0x1ac)]()){const _0x5d7f48=_0x3cbe37[0x0][_0x3316be(0x18c)],_0x35291b=_0x3cbe37[0x0][_0x3316be(0x18b)],_0x227b92=_0x35291b?_0x4f93ea[_0x3316be(0x1dd)](_0x35291b)||'':'',_0x29545c=_0x227b92?a22_0x3db790[_0x3316be(0x21c)](_0x543d2e,_0x227b92):_0x543d2e,_0x1728c9=_0x1b9382||a22_0x3db790[_0x3316be(0x21c)](_0x29545c,sanitizeFileName(_0x5d7f48)+_0x3316be(0x1bd));let _0x38b063,_0x5d0b4e;if(existsSync(_0x1728c9))try{const _0x98e82=readFileSync(_0x1728c9,_0x3316be(0x19b)),_0x203ddc=parseYamlString(_0x98e82);_0x5d0b4e=_0x203ddc,_0x38b063=buildRuleToNameMapping(_0x203ddc),_0xf119b6[_0x3316be(0x213)]&&_0x38b063[_0x3316be(0x229)]>0x0&&console[_0x3316be(0x232)](_0x3316be(0x145)+_0x38b063[_0x3316be(0x229)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x5d7f48);}catch(_0x32ec62){_0xf119b6[_0x3316be(0x213)]&&console[_0x3316be(0x232)](_0x3316be(0x17b)+_0x32ec62['message']);}const _0x242feb=[],_0x5cdb8=new Set(),_0x1767cc=new Map(),_0x554292=new Map(),_0x4029ca=new Set(),_0xe618f3=new Map(),_0x1bb9aa=new Map(),_0x453c39=createJumpTargetCache();await withProgressSpinner(_0x3316be(0x169)+_0x5d7f48+_0x3316be(0x179),async _0x5b43c8=>{const _0x2a3da3=_0x3316be;for(const _0x150467 of _0x3cbe37){const _0x574483=_0x3cbe37['length']>0x1?_0x150467['journeyBundleName']+'\x20v'+(_0x150467[_0x2a3da3(0x12f)]||0x1):_0x150467[_0x2a3da3(0x18c)];_0x5b43c8[_0x2a3da3(0x1ae)](_0x2a3da3(0x169)+_0x574483);const _0x14b576=await _0x3f74c5[_0x2a3da3(0x176)][_0x2a3da3(0x224)](_0x150467['id']),_0x20d70f=_0x14b576[_0x2a3da3(0x1af)]?.[_0x2a3da3(0x13c)],_0x23b516={'resolveSegment':async _0x52d3dc=>{const _0x5b3219=_0x2a3da3;if(!_0x20d70f)return{'name':_0x52d3dc,'isJourneyLocal':![]};const _0x1828f7=_0x1767cc[_0x5b3219(0x1dd)](_0x52d3dc);if(_0x1828f7)return _0x1828f7;try{const _0x2d2add=await _0x3f74c5[_0x5b3219(0x1b6)]['getSegment'](_0x20d70f,_0x52d3dc),_0x43e886=_0x2d2add[_0x5b3219(0x16f)]===SEGMENT_KIND_JOURNEY;let _0x22a05d,_0x5a1e5c=_0x2d2add[_0x5b3219(0x1c9)];if(_0x43e886&&_0x2d2add['rule']){const _0x416301=await segmentResponseToDef(_0x2d2add,{'resolveSegmentName':async _0x9e7d35=>{const _0xa94f20=_0x5b3219,_0x52efa8=_0x1767cc['get'](_0x9e7d35);if(_0x52efa8)return _0x52efa8['name'];const _0x563d25=await _0x23b516['resolveSegment'](_0x9e7d35);return _0x563d25[_0xa94f20(0x1c9)];}}),_0x1d2bbb=_0x416301[_0x5b3219(0x1f1)];_0x22a05d={'description':_0x2d2add[_0x5b3219(0x23e)],'rule':_0x1d2bbb};const _0x589edd=serializeRule(_0x1d2bbb),_0x7303aa=_0x554292[_0x5b3219(0x1dd)](_0x589edd);if(_0x7303aa)_0x5a1e5c=_0x7303aa,_0x22a05d=undefined,_0xf119b6[_0x5b3219(0x213)]&&console[_0x5b3219(0x232)](_0x5b3219(0x1e6)+_0x2d2add['name']+_0x5b3219(0x1c3)+_0x7303aa);else{let _0x1dc788=![];if(_0x38b063){const _0x38ca15=_0x38b063[_0x5b3219(0x1dd)](_0x589edd);if(_0x38ca15){const _0x34ea60=_0x38ca15['find'](_0x273591=>!_0x5cdb8['has'](_0x273591));_0x34ea60&&(_0x5a1e5c=_0x34ea60,_0x5cdb8[_0x5b3219(0x15a)](_0x34ea60),_0x554292[_0x5b3219(0x1bf)](_0x589edd,_0x34ea60),_0x1dc788=!![],_0xf119b6[_0x5b3219(0x213)]&&console[_0x5b3219(0x232)](_0x5b3219(0x1da)+_0x34ea60+_0x5b3219(0x1ec)));}}if(!_0x1dc788){const _0x216cfb=generateJourneyLocalName(_0x2d2add[_0x5b3219(0x1c9)]);_0x216cfb&&(_0x5a1e5c=_0x216cfb);let _0x3c4718=_0x5a1e5c,_0x68ad72=0x2;while(_0x5cdb8[_0x5b3219(0x197)](_0x3c4718)){_0x3c4718=_0x5a1e5c+'_'+_0x68ad72,_0x68ad72++;}_0x5cdb8[_0x5b3219(0x15a)](_0x3c4718),_0x554292[_0x5b3219(0x1bf)](_0x589edd,_0x3c4718),_0x5a1e5c=_0x3c4718;}}}const _0x306f49={'name':_0x5a1e5c,'isJourneyLocal':_0x43e886,'definition':_0x22a05d};return _0x1767cc[_0x5b3219(0x1bf)](_0x52d3dc,_0x306f49),_0x306f49;}catch(_0x4854dd){return _0x37d45c[_0x5b3219(0x213)]&&console[_0x5b3219(0x232)](_0x5b3219(0x163)+_0x52d3dc+':\x20'+_0x4854dd['message']),{'name':_0x52d3dc,'isJourneyLocal':![]};}},'resolveActivation':async _0x38a292=>{const _0x3205dc=_0x2a3da3,_0x231bf6=_0xe618f3['get'](_0x38a292);if(_0x231bf6)return _0x231bf6;try{const _0x17d1ea=await _0x3f74c5[_0x3205dc(0x176)][_0x3205dc(0x1c0)](_0x150467['id'],_0x38a292),_0x18b729=journeyActivationStepToYaml(_0x17d1ea,_0x2b4ae0,_0x4420ad),_0x4b39d0=JSON[_0x3205dc(0x194)]({'name':_0x18b729[_0x3205dc(0x1c9)],'connection':_0x18b729[_0x3205dc(0x1ea)],'connector_config':_0x18b729[_0x3205dc(0x17a)]}),_0xc192ea=_0x1bb9aa[_0x3205dc(0x1dd)](_0x4b39d0);if(_0xc192ea){const _0x5a3ac4={'name':_0xc192ea,'isJourneyLocal':!![],'definition':_0x18b729};return _0xe618f3['set'](_0x38a292,_0x5a3ac4),_0x5a3ac4;}const _0x3955e2=_0x17d1ea['attributes'][_0x3205dc(0x16b)][_0x3205dc(0x1c9)]||_0x38a292,_0x2a9bad=sanitizeYamlKey(_0x3955e2)||_0x3205dc(0x225)+_0x38a292;let _0x996feb=_0x2a9bad,_0x4fadee=0x2;while(_0x4029ca[_0x3205dc(0x197)](_0x996feb)){_0x996feb=_0x2a9bad+'_'+_0x4fadee,_0x4fadee++;}_0x4029ca[_0x3205dc(0x15a)](_0x996feb),_0x1bb9aa[_0x3205dc(0x1bf)](_0x4b39d0,_0x996feb);const _0x1261d5={'name':_0x996feb,'isJourneyLocal':!![],'definition':_0x18b729};return _0xe618f3[_0x3205dc(0x1bf)](_0x38a292,_0x1261d5),_0x1261d5;}catch(_0x14ef05){return _0x37d45c[_0x3205dc(0x213)]&&console[_0x3205dc(0x232)](_0x3205dc(0x219)+_0x38a292+':\x20'+_0x14ef05[_0x3205dc(0x132)]),{'name':_0x38a292,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1875e8,_0x506e26)=>{const _0xb9617=_0x2a3da3;return resolveJumpTarget(_0x1875e8,_0x506e26,_0x453c39,_0x20e24f=>_0x3f74c5[_0xb9617(0x176)]['getJourney'](_0x20e24f));}},_0x8d5297=await journeyResponseToDef(_0x14b576,_0x23b516);_0x242feb['push']({'item':_0x150467,'yaml':_0x8d5297});}},{'verbose':_0x37d45c[_0x3316be(0x213)]});const _0x4989e6=await _0x3f74c5['journey'][_0x3316be(0x210)](_0x3cbe37[0x0][_0x3316be(0x1e4)]),_0x3c8abc=buildMergedJourneyDef(_0x242feb,_0x38b063,_0x4989e6),_0x4e955b=normalizeJourneyDef(_0x3c8abc,_0x5d0b4e),_0x278a2f=toYamlString(_0x4e955b),_0x425dbd=_0x1b9382||a22_0x3db790['join'](_0x29545c,sanitizeFileName(_0x5d7f48)+_0x3316be(0x1bd));!_0x1b9382&&_0x227b92&&!existsSync(_0x29545c)&&mkdirSync(_0x29545c,{'recursive':!![]});const _0x555db4=a22_0x3db790[_0x3316be(0x1ee)](process['cwd'](),_0x425dbd);if(existsSync(_0x425dbd)){const _0x39b9d3=readFileSync(_0x425dbd,_0x3316be(0x19b)),_0x1234bb=generateDiff(_0x39b9d3,_0x278a2f),_0x335cbb=hasChanges(_0x1234bb);_0xe5d1b0['push']({'relativePath':_0x555db4,'absolutePath':_0x425dbd,'content':_0x278a2f,'isNew':![],'hasChanges':_0x335cbb,'diff':_0x335cbb?formatDiffWithColors(_0x1234bb):undefined});}else _0xe5d1b0['push']({'relativePath':_0x555db4,'absolutePath':_0x425dbd,'content':_0x278a2f,'isNew':!![],'hasChanges':![]});}const _0x13cbcc=_0xe5d1b0[_0x3316be(0x133)](_0x4753a6=>_0x4753a6['isNew']),_0x1c3ea3=_0xe5d1b0[_0x3316be(0x133)](_0x190c83=>!_0x190c83[_0x3316be(0x184)]&&_0x190c83['hasChanges']),_0x1c2723=_0xe5d1b0[_0x3316be(0x133)](_0x42df29=>!_0x42df29['isNew']&&!_0x42df29['hasChanges']),_0x4e9aa1=_0x2fa207['length'],_0x328929=_0x466a6e['size'],_0x55f659=_0x4e9aa1>_0x328929?'\x20('+_0x4e9aa1+_0x3316be(0x1d3):'';console[_0x3316be(0x232)](_0x3316be(0x165)),console[_0x3316be(0x232)]('\x20\x20'+a22_0x4d1f82[_0x3316be(0x1cb)](_0x328929+_0x3316be(0x140))+a22_0x4d1f82['dim'](_0x55f659)),console[_0x3316be(0x232)]('\x20\x20'+a22_0x4d1f82[_0x3316be(0x136)]('+\x20'+_0x13cbcc[_0x3316be(0x164)]+_0x3316be(0x21e))),console[_0x3316be(0x232)]('\x20\x20'+a22_0x4d1f82[_0x3316be(0x1f9)]('~\x20'+_0x1c3ea3[_0x3316be(0x164)]+_0x3316be(0x127))),console['error']('\x20\x20'+a22_0x4d1f82[_0x3316be(0x166)]('=\x20'+_0x1c2723[_0x3316be(0x164)]+_0x3316be(0x195))),console[_0x3316be(0x232)](_0x3316be(0x1ef)+a22_0x4d1f82['cyan'](_0x543d2e)+'\x0a');if(_0x1c3ea3['length']>0x0)for(const _0x3f6294 of _0x1c3ea3){console[_0x3316be(0x232)](_0x3316be(0x162)+_0x3f6294['relativePath']+'\x27:'),console['error']('─'[_0x3316be(0x157)](0x3c)),console[_0x3316be(0x232)](_0x3f6294[_0x3316be(0x23a)]),console[_0x3316be(0x232)]('─'['repeat'](0x3c));}if(_0xf119b6[_0x3316be(0x228)])return console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x1f9)](_0x3316be(0x1d2))),0x0;if(_0x13cbcc[_0x3316be(0x164)]===0x0&&_0x1c3ea3[_0x3316be(0x164)]===0x0)return console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x136)](_0x3316be(0x1fd))),saveSessionContext({'parent_segment':_0x20047b},_0xf119b6[_0x3316be(0x12e)]),console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x136)](_0x3316be(0x13b)+a22_0x4d1f82['dim'](_0x3316be(0x23c))+'\x20=\x20'+a22_0x4d1f82[_0x3316be(0x1cb)](_0x20047b))),0x0;if(!_0xf119b6[_0x3316be(0x177)]&&(_0x13cbcc[_0x3316be(0x164)]>0x0||_0x1c3ea3['length']>0x0)){if(!isInteractive())return console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x1eb)](_0x3316be(0x203)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x166)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5bbc96=await confirmKey(_0x3316be(0x1a4)+(_0x13cbcc[_0x3316be(0x164)]+_0x1c3ea3['length'])+'\x20files?');if(!_0x5bbc96)return console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x1f9)]('Aborted.'),_0x3316be(0x135)),0x1;}!existsSync(_0x543d2e)&&mkdirSync(_0x543d2e,{'recursive':!![]});const _0x36276f=a22_0x3db790[_0x3316be(0x21c)](_0x543d2e,_0x3316be(0x1fc));writeFileSync(_0x36276f,createTdxConfigContent(_0x20047b),_0x3316be(0x19b));for(const _0x1a3ce0 of _0xe5d1b0){(_0x1a3ce0[_0x3316be(0x184)]||_0x1a3ce0[_0x3316be(0x22c)])&&writeFileSync(_0x1a3ce0[_0x3316be(0x1b7)],_0x1a3ce0['content'],_0x3316be(0x19b));}return console['error'](a22_0x4d1f82[_0x3316be(0x136)](_0x3316be(0x14c)+(_0x13cbcc[_0x3316be(0x164)]+_0x1c3ea3['length'])+_0x3316be(0x12c)+_0x543d2e)),saveSessionContext({'parent_segment':_0x20047b},_0xf119b6[_0x3316be(0x12e)]),console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x136)](_0x3316be(0x13b)+a22_0x4d1f82[_0x3316be(0x166)](_0x3316be(0x23c))+_0x3316be(0x1ba)+a22_0x4d1f82['cyan'](_0x20047b))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x220);[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x1d0);async['execute'](_0x3bffd7){const _0x14c23d=a22_0x1d6769,{options:_0x1860ac,args:_0xc96399,tdx:_0x55810e}=_0x3bffd7,_0x3648aa=_0xc96399[0x0];if(!requireNameOrPath(_0x3648aa))return 0x1;_0x1860ac[_0x14c23d(0x213)]&&console[_0x14c23d(0x232)](_0x14c23d(0x1a8)+_0x3648aa);const {journeyId:_0x547b83}=await resolveJourneyIdFromInput(_0x3648aa,_0x1860ac,_0x55810e),_0x5a8d93=await withSpinner('Getting\x20column\x20mapping...',()=>_0x55810e['journey'][_0x14c23d(0x1ab)](_0x547b83),{'verbose':_0x1860ac[_0x14c23d(0x213)]}),_0x221bc1=_0x5a8d93[_0x14c23d(0x17c)];return console[_0x14c23d(0x19f)](_0x14c23d(0x22a)+_0x221bc1[_0x14c23d(0x238)]),console[_0x14c23d(0x19f)]('Table:\x20'+_0x221bc1[_0x14c23d(0x14d)]),await handleSDKOutput(_0x221bc1['columns'],_0x1860ac),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x221);[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x16d);async[a22_0x1d6769(0x16c)](_0x419c3d){const _0x40df1e=a22_0x1d6769,{options:_0x1bf70d,args:_0x1bb8ca,tdx:_0x6bce64}=_0x419c3d,_0x1e812d=_0x1bb8ca[0x0];if(!requireNameOrPath(_0x1e812d))return 0x1;_0x1bf70d['verbose']&&console[_0x40df1e(0x232)]('Input:\x20'+_0x1e812d);const {journeyId:_0x1773cf}=await resolveJourneyIdFromInput(_0x1e812d,_0x1bf70d,_0x6bce64),_0x2fad8b=await withSpinner(_0x40df1e(0x19a),()=>_0x6bce64[_0x40df1e(0x176)][_0x40df1e(0x1a3)](_0x1773cf),{'verbose':_0x1bf70d[_0x40df1e(0x213)]}),_0xbf87c8=_0x2fad8b[_0x40df1e(0x17c)];return console[_0x40df1e(0x232)]('Found\x20'+_0xbf87c8[_0x40df1e(0x164)]+'\x20activation'+(_0xbf87c8[_0x40df1e(0x164)]!==0x1?'s':'')),await handleSDKOutput(_0xbf87c8,_0x1bf70d),0x0;}}export class JourneyPushCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x1ce);['description']=a22_0x1d6769(0x1c4);[a22_0x1d6769(0x144)]=new SegmentPushCommand();async[a22_0x1d6769(0x16c)](_0x2aaff4){const _0x3731d9=a22_0x1d6769,_0x15a01e=_0x2aaff4[_0x3731d9(0x1d6)][0x0];let _0x44b0ac;if(_0x15a01e){const _0x25763a=await resolveTarget({'arg':_0x15a01e,'contextParent':_0x2aaff4[_0x3731d9(0x1e3)][_0x3731d9(0x22e)],'cwd':process['cwd']()});isSuccessfulResolution(_0x25763a)&&_0x25763a[_0x3731d9(0x15e)]===_0x3731d9(0x1a0)&&(_0x44b0ac=_0x25763a[_0x3731d9(0x1dc)]);}const _0x544f09={..._0x2aaff4,'options':{..._0x2aaff4['options'],'journeysOnly':!![],..._0x44b0ac&&{'singleFilePath':_0x44b0ac}}};return this[_0x3731d9(0x144)][_0x3731d9(0x16c)](_0x544f09);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a22_0x1d6769(0x13d);[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x23d);async['execute'](_0x160974){const _0x1c4a7d=a22_0x1d6769,{options:_0x2c37a4,args:_0xcb91c8,tdx:_0x4bf4ee}=_0x160974,_0x17df0a=_0xcb91c8[0x0];if(!requireNameOrPath(_0x17df0a))return 0x1;if(_0x2c37a4[_0x1c4a7d(0x213)])console[_0x1c4a7d(0x232)](_0x1c4a7d(0x1a8)+_0x17df0a);const {journeyId:_0x2dba66}=await resolveJourneyIdFromInput(_0x17df0a,_0x2c37a4,_0x4bf4ee),_0x42e391=await withSpinner('Listing\x20journey\x20versions...',()=>_0x4bf4ee['journey'][_0x1c4a7d(0x205)](_0x2dba66),{'verbose':_0x2c37a4[_0x1c4a7d(0x213)]}),{bundleName:_0x2d041a,versions:_0xcb3b27,latestJourneyId:_0x439c91}=_0x42e391[_0x1c4a7d(0x17c)];console[_0x1c4a7d(0x232)](_0x2d041a+':\x20'+_0xcb3b27[_0x1c4a7d(0x164)]+'\x20version'+(_0xcb3b27[_0x1c4a7d(0x164)]!==0x1?'s':''));const _0x2ea9e8=_0xcb3b27[_0x1c4a7d(0x23b)](_0x1264cb=>({'version':_0x1264cb[_0x1c4a7d(0x12f)],'journey_id':_0x1264cb[_0x1c4a7d(0x187)],'name':_0x1264cb['name'],'state':_0x1264cb['state'],'paused':_0x1264cb[_0x1c4a7d(0x167)],'latest':_0x1264cb[_0x1c4a7d(0x187)]===_0x439c91,'created_at':_0x1264cb[_0x1c4a7d(0x1b8)]}));return await handleSDKOutput(_0x2ea9e8,_0x2c37a4),0x0;}}function a22_0x5d71(_0x5bfa9f,_0x295648){_0x5bfa9f=_0x5bfa9f-0x125;const _0x4c2c80=a22_0x4c2c();let _0x5d714a=_0x4c2c80[_0x5bfa9f];return _0x5d714a;}export class JourneyVersionCreateCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x208);[a22_0x1d6769(0x23e)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a22_0x1d6769(0x16c)](_0x338d4e){const _0x69c482=a22_0x1d6769,{options:_0x42435f,args:_0x54f9b3,tdx:_0x30f3d0}=_0x338d4e,_0x1a38db=_0x54f9b3[0x0];if(!requireNameOrPath(_0x1a38db))return 0x1;if(_0x42435f[_0x69c482(0x213)])console[_0x69c482(0x232)](_0x69c482(0x1a8)+_0x1a38db);const {journeyId:_0x542a7c,journeyName:_0x3637d3}=await resolveJourneyIdFromInput(_0x1a38db,_0x42435f,_0x30f3d0);if(!_0x42435f[_0x69c482(0x177)]){const _0x338210=await confirm(_0x69c482(0x1df)+_0x3637d3+'\x22?');if(!_0x338210)return console['error']('Cancelled'),0x0;}const _0x3a8c40=await withSpinner(_0x69c482(0x21f),()=>_0x30f3d0[_0x69c482(0x176)][_0x69c482(0x173)](_0x542a7c),{'verbose':_0x42435f['verbose']}),_0x24c212=_0x3a8c40[_0x69c482(0x17c)];return console[_0x69c482(0x232)](a22_0x4d1f82[_0x69c482(0x136)]('✔')+_0x69c482(0x18d)+_0x24c212[_0x69c482(0x1af)]['versionNumber']+_0x69c482(0x227)+_0x24c212[_0x69c482(0x1af)][_0x69c482(0x1c9)]+'\x22'),console['error'](_0x69c482(0x1de)+_0x24c212['id']),await handleSingleObjectOutput({'id':_0x24c212['id'],'name':_0x24c212[_0x69c482(0x1af)]['name'],'version':_0x24c212[_0x69c482(0x1af)][_0x69c482(0x12f)],'state':_0x24c212['attributes'][_0x69c482(0x16a)],'bundle_id':_0x24c212['attributes'][_0x69c482(0x1e4)],'created_at':_0x24c212['attributes'][_0x69c482(0x1b8)]},_0x42435f),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]='journey:version:view';[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x17e);async[a22_0x1d6769(0x16c)](_0x47b275){const _0x1ba6f7=a22_0x1d6769,{options:_0x244e27,args:_0x2aa9f4,tdx:_0x44bdda}=_0x47b275,_0x294df3=_0x2aa9f4[0x0];if(!requireNameOrPath(_0x294df3))return 0x1;const _0x203d7c=_0x244e27[_0x1ba6f7(0x189)];if(!_0x203d7c)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x1ba6f7(0x232)](_0x1ba6f7(0x155)),0x1;const _0x3d5f74=parseInt(_0x203d7c,0xa);if(isNaN(_0x3d5f74)||_0x3d5f74<0x1)return console['error'](_0x1ba6f7(0x22b)+_0x203d7c),0x1;if(_0x244e27[_0x1ba6f7(0x213)])console[_0x1ba6f7(0x232)](_0x1ba6f7(0x1a8)+_0x294df3+',\x20version:\x20'+_0x3d5f74);const {journeyId:_0x5c1e70,parentSegmentId:_0x293ddb}=await resolveJourneyIdFromInput(_0x294df3,_0x244e27,_0x44bdda),_0x48f4c6=await withSpinner(_0x1ba6f7(0x170),()=>_0x44bdda[_0x1ba6f7(0x176)][_0x1ba6f7(0x205)](_0x5c1e70),{'verbose':_0x244e27[_0x1ba6f7(0x213)]}),{versions:_0x3c2133,latestJourneyId:_0x31fccd}=_0x48f4c6[_0x1ba6f7(0x17c)],_0x47d3c7=_0x3c2133[_0x1ba6f7(0x17f)](_0xda92cd=>_0xda92cd[_0x1ba6f7(0x12f)]===_0x3d5f74);if(!_0x47d3c7){const _0x52188a=_0x3c2133[_0x1ba6f7(0x23b)](_0x4a5b60=>'v'+_0x4a5b60['versionNumber'])[_0x1ba6f7(0x21c)](',\x20');return console[_0x1ba6f7(0x232)](_0x1ba6f7(0x151)+_0x3d5f74+_0x1ba6f7(0x154)+_0x52188a),0x1;}const _0x2c2b8f=await withSpinner(_0x1ba6f7(0x161)+_0x3d5f74+_0x1ba6f7(0x1db),()=>_0x44bdda['journey']['getJourney'](_0x47d3c7['journeyId']),{'verbose':_0x244e27[_0x1ba6f7(0x213)]}),_0x541c99=_0x2c2b8f['data'],_0x3f5089=getConsoleNextUrl(_0x244e27[_0x1ba6f7(0x20a)],'/app/ps/'+_0x293ddb+_0x1ba6f7(0x1f5)+_0x47d3c7[_0x1ba6f7(0x187)]+_0x1ba6f7(0x1ca));return await handleSingleObjectOutput({'id':_0x541c99['id'],'name':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x1c9)],'version':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x12f)],'description':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x23e)],'state':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x16a)],'paused':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x167)],'reentry_mode':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x128)],'stages':_0x541c99[_0x1ba6f7(0x1af)]['journeyStages']?.['length']||0x0,..._0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x199)]&&{'goal':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x199)][_0x1ba6f7(0x1c9)]},'latest':_0x47d3c7[_0x1ba6f7(0x187)]===_0x31fccd,'created_at':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x1b8)],'updated_at':_0x541c99['attributes'][_0x1ba6f7(0x1aa)],'url':_0x3f5089},_0x244e27),0x0;}}
|