@treasuredata/tdx 0.8.12 → 0.9.1
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 +2 -2
- package/dist/cli-categories.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.d.ts +88 -0
- package/dist/client/llm-api-client.d.ts.map +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/llm-api-client.js.map +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.d.ts +32 -0
- package/dist/commands/agent-command.d.ts.map +1 -0
- package/dist/commands/agent-command.js +1 -0
- package/dist/commands/agent-command.js.map +1 -0
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.d.ts +3 -2
- package/dist/commands/chat-command.d.ts.map +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/chat-command.js.map +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/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.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/llm-command.d.ts +8 -4
- package/dist/commands/llm-command.d.ts.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-command.js.map +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-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/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.d.ts +1 -0
- package/dist/commands/use-command.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +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/config.d.ts +32 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +1 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +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.d.ts +1 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +386 -0
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -0
- package/dist/sdk/agent/agent-yaml.js +1 -0
- package/dist/sdk/agent/agent-yaml.js.map +1 -0
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +4 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm.d.ts +114 -0
- package/dist/sdk/llm.d.ts.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/llm.js.map +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.d.ts +17 -0
- package/dist/types/endpoints.d.ts.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/endpoints.js.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/llm.d.ts +203 -0
- package/dist/types/llm.d.ts.map +1 -1
- package/dist/utils/agent-config.d.ts +124 -0
- package/dist/utils/agent-config.d.ts.map +1 -0
- package/dist/utils/agent-config.js +1 -0
- package/dist/utils/agent-config.js.map +1 -0
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/journey-utils.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.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-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x8e2f7=a33_0x3aea;function a33_0x55a6(){const _0x383204=['includes','segments','Parent\x20path:\x20','name','verbose','yellow','Examples:','resolveFolderId','parent','✔\x20Created\x20segment\x20\x27','description','length','1490769nHzzLj','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','folder','type','\x20\x20\x20Path:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Target\x20path:\x20','1321817ZiMAMt','Creating\x20segment\x20\x27','Site:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','15074862ZyhzLr','invisible','6GBTrYu','Resolving\x20folder\x20\x27','18CcMTOZ','site','segment:create','resolveParentId','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','error','resolvePathToResource','noCountPopulation','folderId','Create\x20child\x20segment\x20with\x20filtering\x20rules','6649550GEcdzX','execute','Resolving\x20folder\x20path\x20\x27','rule','\x27\x20with\x20ID:\x20','80jjeQEj','676796kTNfqE','Resolved\x20relative\x20path\x20to:\x20','Segment\x20name:\x20','146180fSvruU','580616ILeouE','2ihmmev','segment','kind','data','ruleFile','Parent:\x20','\x27...'];a33_0x55a6=function(){return _0x383204;};return a33_0x55a6();}(function(_0x59ec6b,_0x3d5c1f){const _0x243d76=a33_0x3aea,_0x194484=_0x59ec6b();while(!![]){try{const _0x12b8c0=parseInt(_0x243d76(0x19c))/0x1+parseInt(_0x243d76(0x1a1))/0x2*(-parseInt(_0x243d76(0x1b4))/0x3)+parseInt(_0x243d76(0x19b))/0x4*(parseInt(_0x243d76(0x19f))/0x5)+-parseInt(_0x243d76(0x189))/0x6*(-parseInt(_0x243d76(0x182))/0x7)+-parseInt(_0x243d76(0x1a0))/0x8*(-parseInt(_0x243d76(0x18b))/0x9)+parseInt(_0x243d76(0x196))/0xa+-parseInt(_0x243d76(0x187))/0xb;if(_0x12b8c0===_0x3d5c1f)break;else _0x194484['push'](_0x194484['shift']());}catch(_0x2670ac){_0x194484['push'](_0x194484['shift']());}}}(a33_0x55a6,0x5ff83));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a33_0x3aea(_0x3867f3,_0x19c8ba){_0x3867f3=_0x3867f3-0x17e;const _0x55a6f1=a33_0x55a6();let _0x3aea46=_0x55a6f1[_0x3867f3];return _0x3aea46;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a33_0x39facf from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a33_0x8e2f7(0x18d);[a33_0x8e2f7(0x1b2)]=a33_0x8e2f7(0x195);async[a33_0x8e2f7(0x197)](_0x3cd8c3){const _0x27c1ab=a33_0x8e2f7;console[_0x27c1ab(0x191)](a33_0x39facf[_0x27c1ab(0x1ad)](_0x27c1ab(0x18f))),console[_0x27c1ab(0x191)](a33_0x39facf['yellow'](_0x27c1ab(0x180)));const {options:_0x341ace,args:_0x4ade33,tdx:_0x1fa7a0}=_0x3cd8c3,_0x1eeb50=_0x341ace;if(_0x4ade33[_0x27c1ab(0x1b3)]===0x0)return console[_0x27c1ab(0x191)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x27c1ab(0x191)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x27c1ab(0x191)](_0x27c1ab(0x1ae)),console[_0x27c1ab(0x191)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console['error'](_0x27c1ab(0x190)),console[_0x27c1ab(0x191)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x21a4af=_0x4ade33[0x0],_0x8ad895=_0x341ace['segmentPath'];let _0x354a90=_0x21a4af;_0x8ad895&&!_0x21a4af[_0x27c1ab(0x1a8)]('/')&&(_0x354a90=_0x8ad895+'/'+_0x21a4af,_0x1eeb50[_0x27c1ab(0x1ac)]&&console['error'](_0x27c1ab(0x19d)+_0x354a90));const _0x183c8c=parsePath(_0x354a90);if(_0x183c8c[_0x27c1ab(0x1a9)]['length']<0x2)return console[_0x27c1ab(0x191)](_0x27c1ab(0x1b5)),console[_0x27c1ab(0x191)](_0x27c1ab(0x186)),0x1;const _0x3b3efc=_0x183c8c[_0x27c1ab(0x1a9)][0x0],_0x447b93=getBaseName(_0x354a90),_0x2494f7=getParentPath(_0x354a90);_0x1eeb50[_0x27c1ab(0x1ac)]&&(console['error'](_0x27c1ab(0x184)+_0x1eeb50[_0x27c1ab(0x18c)]),console[_0x27c1ab(0x191)](_0x27c1ab(0x181)+_0x354a90),console[_0x27c1ab(0x191)](_0x27c1ab(0x1a6)+_0x3b3efc),console[_0x27c1ab(0x191)](_0x27c1ab(0x19e)+_0x447b93),console[_0x27c1ab(0x191)](_0x27c1ab(0x1aa)+_0x2494f7));const _0x59fc24=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3b3efc+_0x27c1ab(0x1a7),()=>_0x1fa7a0[_0x27c1ab(0x1a2)][_0x27c1ab(0x18e)](_0x3b3efc),{'verbose':_0x1eeb50[_0x27c1ab(0x1ac)]}),_0x19023e=_0x59fc24[_0x27c1ab(0x1a4)];let _0x3b4b4b;if(_0x183c8c[_0x27c1ab(0x1a9)]['length']>0x2){const _0x2025a0=await withSpinner(_0x27c1ab(0x198)+_0x2494f7+_0x27c1ab(0x1a7),()=>_0x1fa7a0[_0x27c1ab(0x1a2)][_0x27c1ab(0x192)](_0x2494f7),{'verbose':_0x1eeb50[_0x27c1ab(0x1ac)]}),_0x4ad3e5=_0x2025a0[_0x27c1ab(0x1a4)];if(_0x4ad3e5[_0x27c1ab(0x17e)]!==_0x27c1ab(0x1b6)&&_0x4ad3e5[_0x27c1ab(0x17e)]!==_0x27c1ab(0x1b0))return console['error'](_0x27c1ab(0x185)),0x1;_0x3b4b4b=_0x4ad3e5[_0x27c1ab(0x194)];}else{if(_0x1eeb50[_0x27c1ab(0x1b6)]){const _0x22144d=await withSpinner(_0x27c1ab(0x18a)+_0x1eeb50[_0x27c1ab(0x1b6)]+_0x27c1ab(0x1a7),()=>_0x1fa7a0[_0x27c1ab(0x1a2)][_0x27c1ab(0x1af)](_0x19023e,_0x1eeb50[_0x27c1ab(0x1b6)]),{'verbose':_0x1eeb50[_0x27c1ab(0x1ac)]});_0x3b4b4b=_0x22144d['data'];}}_0x1eeb50[_0x27c1ab(0x1ac)]&&_0x3b4b4b&&console[_0x27c1ab(0x191)]('Resolved\x20folder\x20ID:\x20'+_0x3b4b4b);const _0x5b42ed=await loadJSONFromOptions(_0x1eeb50[_0x27c1ab(0x199)],_0x1eeb50[_0x27c1ab(0x1a5)]),_0x27dcd9={'name':_0x447b93,'description':_0x1eeb50[_0x27c1ab(0x1b2)],'rule':_0x5b42ed,'kind':_0x1eeb50[_0x27c1ab(0x1a3)]!==undefined?parseInt(_0x1eeb50['kind'],0xa):undefined,'isVisible':_0x1eeb50[_0x27c1ab(0x188)]?![]:undefined,'segmentFolderId':_0x3b4b4b,'countPopulation':_0x1eeb50[_0x27c1ab(0x193)]?![]:undefined},_0x112cf3=await withSpinner(_0x27c1ab(0x183)+_0x447b93+_0x27c1ab(0x1a7),()=>_0x1fa7a0[_0x27c1ab(0x1a2)]['createSegment'](_0x19023e,_0x27dcd9),{'verbose':_0x1eeb50[_0x27c1ab(0x1ac)]}),_0x3e208d=_0x112cf3[_0x27c1ab(0x1a4)];return console[_0x27c1ab(0x191)](_0x27c1ab(0x1b1)+_0x3e208d[_0x27c1ab(0x1ab)]+_0x27c1ab(0x19a)+_0x3e208d['id']),_0x354a90!==_0x21a4af&&console[_0x27c1ab(0x191)](_0x27c1ab(0x17f)+_0x354a90),await handleSDKOutput([_0x3e208d],_0x1eeb50),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a34_0x6a34(_0xb40cb8,_0x1bfcf3){_0xb40cb8=_0xb40cb8-0xf4;const _0x17c6d8=a34_0x17c6();let _0x6a34af=_0x17c6d8[_0xb40cb8];return _0x6a34af;}const a34_0x3df74d=a34_0x6a34;(function(_0x4a5012,_0x3da16d){const _0x41ec94=a34_0x6a34,_0x2e9457=_0x4a5012();while(!![]){try{const _0x810f1f=parseInt(_0x41ec94(0xf5))/0x1+parseInt(_0x41ec94(0x108))/0x2*(-parseInt(_0x41ec94(0x111))/0x3)+-parseInt(_0x41ec94(0xfb))/0x4+-parseInt(_0x41ec94(0xfe))/0x5+-parseInt(_0x41ec94(0xf6))/0x6*(parseInt(_0x41ec94(0xfa))/0x7)+-parseInt(_0x41ec94(0x110))/0x8*(parseInt(_0x41ec94(0xfd))/0x9)+-parseInt(_0x41ec94(0xf9))/0xa*(-parseInt(_0x41ec94(0x105))/0xb);if(_0x810f1f===_0x3da16d)break;else _0x2e9457['push'](_0x2e9457['shift']());}catch(_0xc49294){_0x2e9457['push'](_0x2e9457['shift']());}}}(a34_0x17c6,0x1d06c));function a34_0x17c6(){const _0x1f6b3e=['parentSegment','Parent\x20segment:\x20','3048NBMazO','103713IPAGbk','Listing\x20fields\x20for\x20\x27','description','95065PaRwMW','78ssSHhF','\x20field','name','4870okPflm','20664dCyPnS','620064bHivtZ','site','819SkUDGk','323390IpxkZl','\x27...','verbose','✔\x20Found\x20','segment','List\x20available\x20fields\x20for\x20segmentation','error','9493cNEaVY','Site:\x20','segment:fields','6rmiWco','listFields','execute','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','data','Error:\x20Parent\x20segment\x20name\x20is\x20required'];a34_0x17c6=function(){return _0x1f6b3e;};return a34_0x17c6();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a34_0x3df74d(0xf8)]=a34_0x3df74d(0x107);[a34_0x3df74d(0xf4)]=a34_0x3df74d(0x103);async[a34_0x3df74d(0x10a)](_0x5070f1){const _0x51db81=a34_0x3df74d,{options:_0x41f47d,args:_0x170a98,tdx:_0x2ee5f4}=_0x5070f1,_0x3d33a8=_0x170a98[0x0]||_0x41f47d[_0x51db81(0x10e)];if(!_0x3d33a8)return console[_0x51db81(0x104)](_0x51db81(0x10d)),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x51db81(0x104)](_0x51db81(0x10b)),0x1;_0x41f47d[_0x51db81(0x100)]&&(console[_0x51db81(0x104)](_0x51db81(0x106)+_0x41f47d[_0x51db81(0xfc)]),console[_0x51db81(0x104)](_0x51db81(0x10f)+_0x3d33a8));const _0x90dd86=await withSpinner(_0x51db81(0x112)+_0x3d33a8+_0x51db81(0xff),()=>_0x2ee5f4[_0x51db81(0x102)][_0x51db81(0x109)](_0x3d33a8),{'verbose':_0x41f47d[_0x51db81(0x100)]}),_0x53eace=_0x90dd86[_0x51db81(0x10c)];console['error'](_0x51db81(0x101)+_0x53eace['length']+_0x51db81(0xf7)+(_0x53eace['length']!==0x1?'s':''));if(_0x41f47d['json']||_0x41f47d['jsonl'])return await handleSDKOutput(_0x53eace,_0x41f47d),0x0;return displayFieldsHumanReadable(_0x53eace,_0x3d33a8),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a34_0x2c95b8=a34_0x45c8;(function(_0x580615,_0x4e824b){const _0x1ccff8=a34_0x45c8,_0x8e9ee=_0x580615();while(!![]){try{const _0x138df5=parseInt(_0x1ccff8(0x1ed))/0x1*(parseInt(_0x1ccff8(0x1ae))/0x2)+parseInt(_0x1ccff8(0x211))/0x3*(parseInt(_0x1ccff8(0x1e5))/0x4)+parseInt(_0x1ccff8(0x1d0))/0x5+parseInt(_0x1ccff8(0x1f1))/0x6*(parseInt(_0x1ccff8(0x1b3))/0x7)+parseInt(_0x1ccff8(0x212))/0x8*(-parseInt(_0x1ccff8(0x1ad))/0x9)+-parseInt(_0x1ccff8(0x1f4))/0xa*(-parseInt(_0x1ccff8(0x1dc))/0xb)+parseInt(_0x1ccff8(0x1c9))/0xc*(-parseInt(_0x1ccff8(0x1ab))/0xd);if(_0x138df5===_0x4e824b)break;else _0x8e9ee['push'](_0x8e9ee['shift']());}catch(_0x3d7dca){_0x8e9ee['push'](_0x8e9ee['shift']());}}}(a34_0x187d,0xf40db));import{BaseCommand}from'./command.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';function a34_0x45c8(_0x36a8f7,_0x232d34){_0x36a8f7=_0x36a8f7-0x1a8;const _0x187d23=a34_0x187d();let _0x45c89c=_0x187d23[_0x36a8f7];return _0x45c89c;}import{segmentWithActivationsToYaml,segmentToYamlString,apiRuleToYaml,journeyActivationStepToYaml}from'../sdk/segment/child-segment-yaml.js';import{apiToYamlAsync,toYamlString as a34_0x4e305b}from'../sdk/segment/journey-yaml.js';import a34_0x2ac790 from'chalk';import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a34_0x254046 from'path';function a34_0x187d(){const _0x2536b1=['44aWiDxM','Fetching\x20connections\x20for\x20name\x20resolution...','Processing\x20journeys...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','length','reduce','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','dim','304462qrYiBd','buildIdToEmailMap','session','get','10059864iBgHPO','content','connection','90IUQcOD','isDirectory','\x20with\x20','Write\x20','dirname','\x0aPull\x20summary\x20for\x20\x27','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','getJourney','diff','Site:\x20','Fetching\x20parent\x20segment\x20info...','Fetching\x20segments...','listActivations','error','journey','✔\x20All\x20files\x20are\x20up\x20to\x20date','Fetching\x20journeys...','absolutePath','yellow','\x20\x20🎯\x20','has','message','buildIdToNameMap','.yml','\x20files\x20to\x20','folderId','add','Fetching\x20users\x20for\x20email\x20resolution...','journeyBundleName','79713RWoBUn','3890792uMHyPu','yaml','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','green','verbose','segment:pull','utf-8','activationParams','segment','slice','then','parent_segment','versionNumber','155597SubHGB','data','9RBHFYZ','4zTCFAR','parentFolderId','\x20\x20🗺️\x20\x20','filter','sort','7QrJhDN','\x20\x20Target:\x20','Using\x20parent\x20segment:\x20','listFolders','size','rule','all','red','Resolving\x20parent\x20segment\x20\x27','getParent','Aborted.','Fetching\x20folders...','attributes','push','tdx.json','\x20new\x20files','relative','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','parentSegment','\x20files?','kind','description','3036QbMtRn','from','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','execute','repeat','cyan','set','6474485aCXnoN','values','isNew','setExtra','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Warning:\x20Could\x20not\x20resolve\x20activation\x20','site','setPhase','yes','hasChanges','join','\x27...','783937SEQowK','Found\x20existing\x20tdx.json\x20at:\x20','\x0aChanges\x20to\x20\x27','resolveParentId','Found\x20tdx.json\x20at:\x20','✔\x20Context\x20set:\x20','audienceId','Fetching\x20activations...','name'];a34_0x187d=function(){return _0x2536b1;};return a34_0x187d();}import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';export class SegmentPullCommand extends BaseCommand{['name']=a34_0x2c95b8(0x218);[a34_0x2c95b8(0x1c8)]=a34_0x2c95b8(0x1c4);async[a34_0x2c95b8(0x1cc)](_0x5e8d4e){const _0x407a7b=a34_0x2c95b8,{options:_0x50613e,args:_0x514290,tdx:_0x11ea95}=_0x5e8d4e,_0x45f276=_0x50613e,_0x27fd04=_0x50613e[_0x407a7b(0x1c5)],_0x584a6b=_0x514290[0x0],_0x1cd7ac=findTdxConfigPath();let _0xc96684,_0x1db2ea;if(!_0x584a6b&&_0x1cd7ac){const _0x4cf69e=loadTdxConfig(_0x1cd7ac);_0xc96684=_0x4cf69e[_0x407a7b(0x1a9)],_0x1db2ea=a34_0x254046[_0x407a7b(0x1f8)](_0x1cd7ac),_0x45f276[_0x407a7b(0x217)]&&(console[_0x407a7b(0x201)](_0x407a7b(0x1dd)+_0x1cd7ac),console[_0x407a7b(0x201)](_0x407a7b(0x1b5)+_0xc96684));}else{if(_0x584a6b){if(existsSync(_0x584a6b)&&statSync(_0x584a6b)[_0x407a7b(0x1f5)]()){const _0x1dda04=findTdxConfigPath(_0x584a6b);if(_0x1dda04){const _0x54d5c6=loadTdxConfig(_0x1dda04);_0xc96684=_0x54d5c6['parent_segment'],_0x1db2ea=a34_0x254046['dirname'](_0x1dda04),_0x45f276['verbose']&&(console[_0x407a7b(0x201)](_0x407a7b(0x1e0)+_0x1dda04),console['error']('Using\x20parent\x20segment:\x20'+_0xc96684));}else return console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x1ba)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x584a6b+'\x0a')),console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x1ce)](_0x407a7b(0x1eb))),0x1;}else _0xc96684=_0x584a6b;}else _0xc96684=_0x27fd04;}if(!_0xc96684)return console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x206)](_0x407a7b(0x215))),console[_0x407a7b(0x201)](_0x407a7b(0x1fa)),console[_0x407a7b(0x201)](_0x407a7b(0x1d4)),console[_0x407a7b(0x201)](_0x407a7b(0x1e8)),0x1;_0x45f276[_0x407a7b(0x217)]&&(console['error'](_0x407a7b(0x1fd)+_0x45f276[_0x407a7b(0x1d6)]),console[_0x407a7b(0x201)]('Parent\x20segment:\x20'+_0xc96684));const _0xa3058b=await withSpinner(_0x407a7b(0x1bb)+_0xc96684+_0x407a7b(0x1db),()=>_0x11ea95[_0x407a7b(0x21b)][_0x407a7b(0x1df)](_0xc96684),{'verbose':_0x45f276[_0x407a7b(0x217)]}),_0x2adc1c=_0xa3058b[_0x407a7b(0x1ac)],_0x16ad9a=await withSpinner(_0x407a7b(0x1fe),()=>_0x11ea95[_0x407a7b(0x21b)][_0x407a7b(0x1bc)](_0x2adc1c),{'verbose':_0x45f276['verbose']}),_0x7df88=_0x16ad9a[_0x407a7b(0x1ac)][_0x407a7b(0x1bf)][_0x407a7b(0x1e4)];_0x45f276[_0x407a7b(0x217)]&&console[_0x407a7b(0x201)]('Resolved\x20parent\x20name:\x20'+_0x7df88);const [_0x1cba86,_0x27ab80,_0x45dd26]=await Promise[_0x407a7b(0x1b9)]([withSpinner(_0x407a7b(0x1ff),()=>_0x11ea95[_0x407a7b(0x21b)]['listSegments'](_0x2adc1c),{'verbose':_0x45f276[_0x407a7b(0x217)]}),withSpinner(_0x407a7b(0x1be),()=>_0x11ea95[_0x407a7b(0x21b)][_0x407a7b(0x1b6)](_0x2adc1c),{'verbose':_0x45f276['verbose']}),withSpinner(_0x407a7b(0x204),()=>_0x11ea95['journey']['listJourneysFromParentSegment'](_0x2adc1c),{'verbose':_0x45f276[_0x407a7b(0x217)]})]),_0xf324e0=_0x1cba86[_0x407a7b(0x1ac)],_0x47d008=_0x27ab80[_0x407a7b(0x1ac)],_0x37fee4=_0x45dd26[_0x407a7b(0x1ac)];if(_0xf324e0[_0x407a7b(0x1e9)]===0x0&&_0x37fee4[_0x407a7b(0x1e9)]===0x0)return console['error'](a34_0x2ac790['yellow'](_0x407a7b(0x214)+_0x7df88+'\x27')),0x0;const _0x2f83e8=buildFolderPathMap(_0x47d008),_0x127bd0=_0x1db2ea||getSegmentRootDir(sanitizeFileName(_0xc96684)),_0x2ba2dd=new Map();await withSpinner(_0x407a7b(0x1e3),async()=>{await batchAsync(_0xf324e0,async _0x19b5a6=>{const _0x48967e=a34_0x45c8,_0x13d38f=await _0x11ea95['segment'][_0x48967e(0x200)](_0x2adc1c,_0x19b5a6['id']);_0x2ba2dd[_0x48967e(0x1cf)](_0x19b5a6['id'],_0x13d38f);});},{'verbose':_0x45f276[_0x407a7b(0x217)]});const _0x12daa4=await withSpinner(_0x407a7b(0x20f),()=>_0x11ea95['user'][_0x407a7b(0x1ee)](),{'verbose':_0x45f276[_0x407a7b(0x217)]})[_0x407a7b(0x1a8)](_0x42c85d=>_0x42c85d[_0x407a7b(0x1ac)]),_0x39d4c8=await withSpinner(_0x407a7b(0x1e6),()=>_0x11ea95[_0x407a7b(0x1f3)][_0x407a7b(0x20a)](),{'verbose':_0x45f276[_0x407a7b(0x217)]})[_0x407a7b(0x1a8)](_0x4ebfe9=>_0x4ebfe9[_0x407a7b(0x1ac)]),_0x40d600=[],_0x57e410=a34_0x254046['join'](_0x127bd0,_0x407a7b(0x1c1)),_0x3861ca=createTdxConfigContent(_0x7df88);_0x40d600[_0x407a7b(0x1c0)](prepareFile(_0x57e410,_0x3861ca,_0x127bd0));const _0x41bb46=new Map();for(const _0x58180f of _0xf324e0){if(_0x58180f[_0x407a7b(0x1c7)]===SEGMENT_KIND_JOURNEY)continue;const _0x3d8136=_0x58180f['segmentFolderId']?_0x2f83e8[_0x407a7b(0x1f0)](_0x58180f['segmentFolderId'])||'':'',_0x4fbb0c=_0x2ba2dd[_0x407a7b(0x1f0)](_0x58180f['id'])||[],_0x138116=segmentWithActivationsToYaml(_0x58180f,_0x4fbb0c,undefined,_0x12daa4,_0x39d4c8),_0x44675f=_0x3d8136?a34_0x254046[_0x407a7b(0x1da)](_0x127bd0,_0x3d8136):_0x127bd0,_0x28bd76=sanitizeFileName(_0x58180f[_0x407a7b(0x1e4)]),_0x557882=getUniqueFileName(_0x44675f,_0x28bd76,_0x41bb46),_0x1c66d8=a34_0x254046['join'](_0x44675f,_0x557882+'.yml'),_0x4b7c7c=segmentToYamlString(_0x138116);_0x40d600[_0x407a7b(0x1c0)](prepareFile(_0x1c66d8,_0x4b7c7c,_0x127bd0));}const _0x5d63dd=new Map();for(const _0x3d88ca of _0xf324e0){_0x5d63dd[_0x407a7b(0x1cf)](_0x3d88ca['id'],_0x3d88ca);}const _0x4392af=new Map();for(const _0x391d70 of _0x37fee4){const _0x449c9e=_0x391d70['journeyBundleId'];!_0x4392af[_0x407a7b(0x208)](_0x449c9e)&&_0x4392af['set'](_0x449c9e,[]),_0x4392af[_0x407a7b(0x1f0)](_0x449c9e)[_0x407a7b(0x1c0)](_0x391d70);}for(const _0x3017fd of _0x4392af[_0x407a7b(0x1d1)]()){_0x3017fd[_0x407a7b(0x1b2)]((_0x5422f0,_0x389e3e)=>(_0x5422f0[_0x407a7b(0x1aa)]||0x0)-(_0x389e3e['versionNumber']||0x0));}const _0x18f2a0=()=>{const _0x556b0e=_0x407a7b,_0x268cb7=new Set(),_0x47249b=new Set(),_0x3684e0=new Map(),_0x557148=new Map(),_0x427792=createJumpTargetCache(),_0x2c1e55=(_0x43e3d0,_0x485580)=>({'resolveSegment':async _0x307c15=>{const _0xe2ffd0=a34_0x45c8,_0x3b2210=_0x3684e0[_0xe2ffd0(0x1f0)](_0x307c15);if(_0x3b2210!==undefined)return{'name':_0x3b2210,'isJourneyLocal':!![]};if(!_0x485580)return{'name':_0x307c15,'isJourneyLocal':![]};try{let _0x38c140=_0x5d63dd[_0xe2ffd0(0x1f0)](_0x307c15);!_0x38c140&&(_0x38c140=await _0x11ea95[_0xe2ffd0(0x21b)]['getSegment'](_0x485580,_0x307c15));const _0x2359f2=generateJourneyLocalName(_0x38c140['name']),_0x3ce5ef=_0x38c140[_0xe2ffd0(0x1c7)]===SEGMENT_KIND_JOURNEY&&_0x2359f2!==undefined;let _0x525d2e=_0x38c140['name'];if(_0x3ce5ef&&_0x2359f2){let _0x294f94=_0x2359f2,_0x2c649c=0x2;while(_0x268cb7[_0xe2ffd0(0x208)](_0x294f94)){_0x294f94=_0x2359f2+'_'+_0x2c649c,_0x2c649c++;}_0x268cb7[_0xe2ffd0(0x20e)](_0x294f94),_0x525d2e=_0x294f94,_0x3684e0[_0xe2ffd0(0x1cf)](_0x307c15,_0x525d2e);}let _0x2fa309;return _0x3ce5ef&&_0x38c140[_0xe2ffd0(0x1b8)]&&(_0x2fa309={'description':_0x38c140['description'],'rule':apiRuleToYaml(_0x38c140['rule'])}),{'name':_0x525d2e,'isJourneyLocal':_0x3ce5ef,'definition':_0x2fa309};}catch(_0x4e1260){return _0x45f276[_0xe2ffd0(0x217)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x307c15+':\x20'+_0x4e1260[_0xe2ffd0(0x209)]),{'name':_0x307c15,'isJourneyLocal':![]};}},'resolveActivation':async _0xcecb77=>{const _0x207f9f=a34_0x45c8,_0x3aa667=_0x557148[_0x207f9f(0x1f0)](_0xcecb77);if(_0x3aa667!==undefined)return{'name':_0x3aa667,'isJourneyLocal':!![]};try{const _0x572998=await _0x11ea95[_0x207f9f(0x202)]['getActivation'](_0x43e3d0,_0xcecb77),_0x457714=_0x572998[_0x207f9f(0x1bf)][_0x207f9f(0x21a)][_0x207f9f(0x1e4)]||_0xcecb77,_0x2a678c=sanitizeYamlKey(_0x457714)||'activation_'+_0xcecb77;let _0xb7e1bb=_0x2a678c,_0xa77447=0x2;while(_0x47249b[_0x207f9f(0x208)](_0xb7e1bb)){_0xb7e1bb=_0x2a678c+'_'+_0xa77447,_0xa77447++;}_0x47249b[_0x207f9f(0x20e)](_0xb7e1bb),_0x557148[_0x207f9f(0x1cf)](_0xcecb77,_0xb7e1bb);const _0x270bb1=journeyActivationStepToYaml(_0x572998,_0x12daa4,_0x39d4c8);return{'name':_0xb7e1bb,'isJourneyLocal':!![],'definition':_0x270bb1};}catch(_0x3e5539){return _0x45f276[_0x207f9f(0x217)]&&console['error'](_0x207f9f(0x1d5)+_0xcecb77+':\x20'+_0x3e5539[_0x207f9f(0x209)]),{'name':_0xcecb77,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x46a890,_0x452a7e)=>resolveJumpTarget(_0x46a890,_0x452a7e,_0x427792,_0x3b8955=>_0x11ea95['journey'][_0x556b0e(0x1fb)](_0x3b8955))});return{'createYamlContext':_0x2c1e55};};if(_0x4392af['size']>0x0){const _0x286b63=Array[_0x407a7b(0x1ca)](_0x4392af[_0x407a7b(0x1d1)]()),_0xc8daf4=await withQuerySpinner(_0x407a7b(0x1e7),async _0x1fdc20=>{const _0x549bf8=_0x407a7b,_0x9c6890=[];let _0x472e75=0x0;const _0x35dbb8=0x5;for(let _0x2bf4fb=0x0;_0x2bf4fb<_0x286b63[_0x549bf8(0x1e9)];_0x2bf4fb+=_0x35dbb8){const _0x59b225=_0x286b63[_0x549bf8(0x21c)](_0x2bf4fb,_0x2bf4fb+_0x35dbb8),_0x370200=await Promise[_0x549bf8(0x1b9)](_0x59b225['map'](async _0x34483d=>{const _0x511664=_0x549bf8,_0x578a5a=_0x34483d[0x0],_0x223f4e=_0x578a5a[_0x511664(0x210)];_0x1fdc20[_0x511664(0x1d7)]('Fetching\x20journey\x20\x27'+_0x223f4e+'\x27');const _0xb06b08=_0x578a5a[_0x511664(0x20d)]?_0x2f83e8[_0x511664(0x1f0)](_0x578a5a['folderId'])||'':'',{createYamlContext:_0x45506b}=_0x18f2a0(),_0x17d9c2=[];for(const _0xb312b1 of _0x34483d){const _0xb04956=await _0x11ea95[_0x511664(0x202)][_0x511664(0x1fb)](_0xb312b1['id']),_0x1b35de=_0xb04956[_0x511664(0x1bf)]?.[_0x511664(0x1e2)],_0x46973a=_0x45506b(_0xb312b1['id'],_0x1b35de),_0x550714=await apiToYamlAsync(_0xb04956,_0x46973a);_0x17d9c2[_0x511664(0x1c0)]({'item':_0xb312b1,'yaml':_0x550714});}let _0x20102a;return _0x17d9c2[_0x511664(0x1e9)]===0x1?_0x20102a=_0x17d9c2[0x0][_0x511664(0x213)]:_0x20102a=buildMergedJourneyYaml(_0x17d9c2),{'bundleName':_0x223f4e,'folderPath':_0xb06b08,'finalYaml':_0x20102a};}));_0x9c6890[_0x549bf8(0x1c0)](..._0x370200),_0x472e75+=_0x59b225[_0x549bf8(0x1e9)],_0x1fdc20[_0x549bf8(0x1d3)]('('+_0x472e75+'/'+_0x286b63[_0x549bf8(0x1e9)]+')');}return _0x9c6890;},{'verbose':_0x45f276[_0x407a7b(0x217)]});for(const {bundleName:_0x2a1d55,folderPath:_0x2a94ec,finalYaml:_0x46930b}of _0xc8daf4[_0x407a7b(0x1ac)]){const _0x1c0a92=a34_0x4e305b(_0x46930b),_0x2e9d21=_0x2a94ec?a34_0x254046[_0x407a7b(0x1da)](_0x127bd0,_0x2a94ec):_0x127bd0,_0x4b191c=sanitizeFileName(_0x2a1d55),_0x3ae1e0=getUniqueFileName(_0x2e9d21,_0x4b191c,_0x41bb46),_0x469fca=a34_0x254046[_0x407a7b(0x1da)](_0x2e9d21,_0x3ae1e0+_0x407a7b(0x20b));_0x40d600['push'](prepareFile(_0x469fca,_0x1c0a92,_0x127bd0));}}const _0x36848b=Array[_0x407a7b(0x1ca)](_0x2ba2dd['values']())[_0x407a7b(0x1ea)]((_0x5e5eaf,_0x2c2fd7)=>_0x5e5eaf+_0x2c2fd7['length'],0x0),_0x177e4a=_0x40d600[_0x407a7b(0x1b1)](_0x49ed2b=>_0x49ed2b[_0x407a7b(0x1d2)]),_0x2e3a83=_0x40d600[_0x407a7b(0x1b1)](_0x4fb1f3=>!_0x4fb1f3[_0x407a7b(0x1d2)]&&_0x4fb1f3[_0x407a7b(0x1d9)]),_0x47a988=_0x40d600[_0x407a7b(0x1b1)](_0x3206c8=>!_0x3206c8[_0x407a7b(0x1d2)]&&!_0x3206c8['hasChanges']),_0x5eb7ff=_0xf324e0[_0x407a7b(0x1b1)](_0x2139d4=>_0x2139d4[_0x407a7b(0x1c7)]!==SEGMENT_KIND_JOURNEY);console['error'](_0x407a7b(0x1f9)+_0x7df88+'\x27:'),console[_0x407a7b(0x201)](_0x407a7b(0x207)+a34_0x2ac790[_0x407a7b(0x1ce)](_0x5eb7ff[_0x407a7b(0x1e9)]+'\x20segments')+_0x407a7b(0x1f6)+a34_0x2ac790['cyan'](_0x36848b+'\x20activations'));if(_0x4392af[_0x407a7b(0x1b7)]>0x0){const _0x159136=_0x37fee4['length'],_0x15715c=_0x4392af[_0x407a7b(0x1b7)],_0x2fc781=_0x159136>_0x15715c?'\x20('+_0x159136+'\x20versions)':'';console[_0x407a7b(0x201)](_0x407a7b(0x1b0)+a34_0x2ac790['cyan'](_0x15715c+'\x20journeys')+a34_0x2ac790[_0x407a7b(0x1ec)](_0x2fc781));}console[_0x407a7b(0x201)]('\x20\x20'+a34_0x2ac790[_0x407a7b(0x216)]('+\x20'+_0x177e4a['length']+_0x407a7b(0x1c2))),console[_0x407a7b(0x201)]('\x20\x20'+a34_0x2ac790[_0x407a7b(0x206)]('~\x20'+_0x2e3a83[_0x407a7b(0x1e9)]+'\x20changed\x20files')),console[_0x407a7b(0x201)]('\x20\x20'+a34_0x2ac790['dim']('=\x20'+_0x47a988[_0x407a7b(0x1e9)]+'\x20unchanged\x20files')),console[_0x407a7b(0x201)](_0x407a7b(0x1b4)+a34_0x2ac790[_0x407a7b(0x1ce)](_0x127bd0)+'\x0a');if(_0x2e3a83[_0x407a7b(0x1e9)]>0x0)for(const _0x1fe4c4 of _0x2e3a83){console['error'](_0x407a7b(0x1de)+_0x1fe4c4['relativePath']+'\x27:'),console[_0x407a7b(0x201)]('─'['repeat'](0x3c)),console[_0x407a7b(0x201)](_0x1fe4c4[_0x407a7b(0x1fc)]),console[_0x407a7b(0x201)]('─'[_0x407a7b(0x1cd)](0x3c));}if(_0x45f276['dryRun'])return console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x206)](_0x407a7b(0x1cb))),0x0;if(_0x177e4a[_0x407a7b(0x1e9)]===0x0&&_0x2e3a83[_0x407a7b(0x1e9)]===0x0)return console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x216)](_0x407a7b(0x203))),saveSessionContext({'parent_segment':_0x7df88},_0x45f276[_0x407a7b(0x1ef)]),console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x216)]('✔\x20Context\x20set:\x20'+a34_0x2ac790[_0x407a7b(0x1ec)](_0x407a7b(0x1a9))+'\x20=\x20'+a34_0x2ac790[_0x407a7b(0x1ce)](_0x7df88))),0x0;if(!_0x45f276[_0x407a7b(0x1d8)]&&(_0x177e4a['length']>0x0||_0x2e3a83[_0x407a7b(0x1e9)]>0x0)){const _0x364b61=await confirmKey(_0x407a7b(0x1f7)+(_0x177e4a['length']+_0x2e3a83[_0x407a7b(0x1e9)])+_0x407a7b(0x1c6));if(!_0x364b61)return console[_0x407a7b(0x201)](_0x407a7b(0x1bd)),0x1;}for(const _0x5a4319 of _0x40d600){if(_0x5a4319[_0x407a7b(0x1d2)]||_0x5a4319[_0x407a7b(0x1d9)]){const _0x2f2199=a34_0x254046[_0x407a7b(0x1f8)](_0x5a4319[_0x407a7b(0x205)]);!existsSync(_0x2f2199)&&mkdirSync(_0x2f2199,{'recursive':!![]}),writeFileSync(_0x5a4319[_0x407a7b(0x205)],_0x5a4319[_0x407a7b(0x1f2)],_0x407a7b(0x219));}}return console[_0x407a7b(0x201)](a34_0x2ac790[_0x407a7b(0x216)]('✔\x20Pulled\x20'+(_0x177e4a[_0x407a7b(0x1e9)]+_0x2e3a83[_0x407a7b(0x1e9)])+_0x407a7b(0x20c)+_0x127bd0)),saveSessionContext({'parent_segment':_0x7df88},_0x45f276[_0x407a7b(0x1ef)]),console[_0x407a7b(0x201)](a34_0x2ac790['green'](_0x407a7b(0x1e1)+a34_0x2ac790[_0x407a7b(0x1ec)]('parent_segment')+'\x20=\x20'+a34_0x2ac790[_0x407a7b(0x1ce)](_0x7df88))),0x0;}}function buildFolderPathMap(_0x4817f4){const _0x2f950f=a34_0x2c95b8,_0x18babf=new Map(),_0x4feb47=new Map();for(const _0x3bf625 of _0x4817f4){_0x4feb47[_0x2f950f(0x1cf)](_0x3bf625['id'],_0x3bf625);}const _0xd0e84=new Set();for(const _0xf379e5 of _0x4817f4){!_0xf379e5[_0x2f950f(0x1af)]&&_0xd0e84['add'](_0xf379e5['id']);}function _0x35ed5a(_0x32e435){const _0x1193c0=_0x2f950f;if(_0x18babf['has'](_0x32e435['id']))return _0x18babf[_0x1193c0(0x1f0)](_0x32e435['id']);if(_0xd0e84[_0x1193c0(0x208)](_0x32e435['id']))return _0x18babf[_0x1193c0(0x1cf)](_0x32e435['id'],''),'';if(_0x32e435['parentFolderId']){const _0x6d3833=_0x4feb47[_0x1193c0(0x1f0)](_0x32e435[_0x1193c0(0x1af)]);if(_0x6d3833){const _0x43d8a0=_0x35ed5a(_0x6d3833),_0x18da64=_0x43d8a0?_0x43d8a0+'/'+_0x32e435[_0x1193c0(0x1e4)]:_0x32e435[_0x1193c0(0x1e4)];return _0x18babf[_0x1193c0(0x1cf)](_0x32e435['id'],_0x18da64),_0x18da64;}}const _0x2d5f6a=_0x32e435[_0x1193c0(0x1e4)];return _0x18babf[_0x1193c0(0x1cf)](_0x32e435['id'],_0x2d5f6a),_0x2d5f6a;}for(const _0x47a38a of _0x4817f4){_0x35ed5a(_0x47a38a);}return _0x18babf;}function getUniqueFileName(_0x1eaa33,_0x46b4bf,_0x359292){const _0x15628f=a34_0x2c95b8,_0x1d59c5=_0x1eaa33+':'+_0x46b4bf,_0x15b5fd=_0x359292['get'](_0x1d59c5)||0x0;_0x359292[_0x15628f(0x1cf)](_0x1d59c5,_0x15b5fd+0x1);if(_0x15b5fd===0x0)return _0x46b4bf;return _0x46b4bf+'-'+_0x15b5fd;}function prepareFile(_0x411655,_0x20f1f9,_0x5b5521){const _0x4aee73=a34_0x2c95b8,_0x3d5eba=a34_0x254046[_0x4aee73(0x1c3)](_0x5b5521,_0x411655);if(existsSync(_0x411655)){const _0xc5beaf=readFileSync(_0x411655,'utf-8'),_0x73e170=generateDiff(_0xc5beaf,_0x20f1f9),_0x41b947=hasChanges(_0x73e170);return{'relativePath':_0x3d5eba,'absolutePath':_0x411655,'content':_0x20f1f9,'isNew':![],'hasChanges':_0x41b947,'diff':_0x41b947?formatDiffWithColors(_0x73e170):undefined};}return{'relativePath':_0x3d5eba,'absolutePath':_0x411655,'content':_0x20f1f9,'isNew':!![],'hasChanges':![]};}
|
|
1
|
+
const a35_0x57ca53=a35_0x4c9b;(function(_0x12a98a,_0x242cf7){const _0x28271b=a35_0x4c9b,_0x869a1c=_0x12a98a();while(!![]){try{const _0x48a5df=-parseInt(_0x28271b(0x18b))/0x1+-parseInt(_0x28271b(0x1d5))/0x2*(-parseInt(_0x28271b(0x193))/0x3)+parseInt(_0x28271b(0x17c))/0x4*(parseInt(_0x28271b(0x170))/0x5)+parseInt(_0x28271b(0x196))/0x6+parseInt(_0x28271b(0x17f))/0x7+parseInt(_0x28271b(0x1e6))/0x8+-parseInt(_0x28271b(0x185))/0x9;if(_0x48a5df===_0x242cf7)break;else _0x869a1c['push'](_0x869a1c['shift']());}catch(_0x198fb2){_0x869a1c['push'](_0x869a1c['shift']());}}}(a35_0x3087,0xbf4b0));import{BaseCommand}from'./command.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';import{segmentWithActivationsToYaml,segmentToYamlString,apiRuleToYaml,journeyActivationStepToYaml}from'../sdk/segment/child-segment-yaml.js';import{apiToYamlAsync,toYamlString as a35_0x251cba}from'../sdk/segment/journey-yaml.js';import a35_0x5d08b3 from'chalk';function a35_0x3087(){const _0x3c0e00=['segment','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','reduce','message','Write\x20','✔\x20Pulled\x20','parentSegment','journeyBundleId','then','\x20=\x20','parentFolderId','708MwGjlA','\x20new\x20files','Found\x20tdx.json\x20at:\x20','\x20files?','✔\x20Context\x20set:\x20','versionNumber','slice','setExtra','yaml','site','segmentFolderId','\x20\x20Target:\x20','Fetching\x20folders...','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','set','relativePath','folderId','9792672jLgHUQ','795dQZBhf','dirname','\x0aPull\x20summary\x20for\x20\x27','utf-8','segment:pull','absolutePath','tdx.json','getJourney','hasChanges','cyan','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','size','2908CuJVkh','\x20unchanged\x20files','\x20with\x20','5665534tvqhKR','getActivation','get','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Resolved\x20parent\x20name:\x20','activationParams','21195333PLhKCd','user','push','diff','length','join','474842YwpoFB','has','values','✔\x20All\x20files\x20are\x20up\x20to\x20date','isNew','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','journey','3912tJcmiM','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','6016560yeDHbi','Fetching\x20connections\x20for\x20name\x20resolution...','name','yes','setPhase','Fetching\x20activations...','relative','\x20\x20🗺️\x20\x20','\x20journeys','attributes','.yml','resolveParentId','Fetching\x20segments...','Using\x20parent\x20segment:\x20','session','listFolders','Fetching\x20parent\x20segment\x20info...','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','red','\x0aChanges\x20to\x20\x27','journeyBundleName','description','\x20segments','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Found\x20existing\x20tdx.json\x20at:\x20','isDirectory','green','yellow','Warning:\x20Could\x20not\x20resolve\x20activation\x20','rule','Fetching\x20journeys...','add','data','Parent\x20segment:\x20','from','listSegments','dim','activation_','\x20changed\x20files','filter','parent_segment','Fetching\x20users\x20for\x20email\x20resolution...','getParent','content','verbose','repeat','\x27...','\x20versions)','dryRun','kind','Processing\x20journeys...'];a35_0x3087=function(){return _0x3c0e00;};return a35_0x3087();}import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';function a35_0x4c9b(_0x16712a,_0x239fe9){_0x16712a=_0x16712a-0x170;const _0x3087aa=a35_0x3087();let _0x4c9b9b=_0x3087aa[_0x16712a];return _0x4c9b9b;}import a35_0x441f24 from'path';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';export class SegmentPullCommand extends BaseCommand{['name']=a35_0x57ca53(0x174);[a35_0x57ca53(0x1ac)]=a35_0x57ca53(0x1a8);async['execute'](_0x57c052){const _0x6b95cb=a35_0x57ca53,{options:_0x55642b,args:_0x115a89,tdx:_0xeaa8a6}=_0x57c052,_0x477e5a=_0x55642b,_0x44a0f8=_0x55642b[_0x6b95cb(0x1d0)],_0x206c38=_0x115a89[0x0],_0x816fa=findTdxConfigPath();let _0x296baa,_0x1a995;if(!_0x206c38&&_0x816fa){const _0x5df5e4=loadTdxConfig(_0x816fa);_0x296baa=_0x5df5e4['parent_segment'],_0x1a995=a35_0x441f24[_0x6b95cb(0x171)](_0x816fa),_0x477e5a[_0x6b95cb(0x1c3)]&&(console['error'](_0x6b95cb(0x1af)+_0x816fa),console[_0x6b95cb(0x194)]('Using\x20parent\x20segment:\x20'+_0x296baa));}else{if(_0x206c38){if(existsSync(_0x206c38)&&statSync(_0x206c38)[_0x6b95cb(0x1b0)]()){const _0x46a393=findTdxConfigPath(_0x206c38);if(_0x46a393){const _0x36e321=loadTdxConfig(_0x46a393);_0x296baa=_0x36e321['parent_segment'],_0x1a995=a35_0x441f24['dirname'](_0x46a393),_0x477e5a['verbose']&&(console['error'](_0x6b95cb(0x1d7)+_0x46a393),console[_0x6b95cb(0x194)](_0x6b95cb(0x1a3)+_0x296baa));}else return console[_0x6b95cb(0x194)](a35_0x5d08b3[_0x6b95cb(0x1a9)](_0x6b95cb(0x1cb)+_0x206c38+'\x0a')),console[_0x6b95cb(0x194)](a35_0x5d08b3['cyan'](_0x6b95cb(0x17a))),0x1;}else _0x296baa=_0x206c38;}else _0x296baa=_0x44a0f8;}if(!_0x296baa)return console[_0x6b95cb(0x194)](a35_0x5d08b3[_0x6b95cb(0x1b2)](_0x6b95cb(0x182))),console[_0x6b95cb(0x194)](_0x6b95cb(0x1e2)),console[_0x6b95cb(0x194)](_0x6b95cb(0x191)),console['error'](_0x6b95cb(0x195)),0x1;_0x477e5a['verbose']&&(console[_0x6b95cb(0x194)]('Site:\x20'+_0x477e5a[_0x6b95cb(0x1de)]),console['error'](_0x6b95cb(0x1b8)+_0x296baa));const _0xf63d82=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x296baa+_0x6b95cb(0x1c5),()=>_0xeaa8a6[_0x6b95cb(0x1ca)][_0x6b95cb(0x1a1)](_0x296baa),{'verbose':_0x477e5a['verbose']}),_0x10c60a=_0xf63d82[_0x6b95cb(0x1b7)],_0x19b758=await withSpinner(_0x6b95cb(0x1a6),()=>_0xeaa8a6[_0x6b95cb(0x1ca)][_0x6b95cb(0x1c1)](_0x10c60a),{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]}),_0x569af6=_0x19b758[_0x6b95cb(0x1b7)][_0x6b95cb(0x19f)]['name'];_0x477e5a[_0x6b95cb(0x1c3)]&&console['error'](_0x6b95cb(0x183)+_0x569af6);const [_0x43f25e,_0x26f0ef,_0xca5e88]=await Promise['all']([withSpinner(_0x6b95cb(0x1a2),()=>_0xeaa8a6[_0x6b95cb(0x1ca)][_0x6b95cb(0x1ba)](_0x10c60a),{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]}),withSpinner(_0x6b95cb(0x1e1),()=>_0xeaa8a6[_0x6b95cb(0x1ca)][_0x6b95cb(0x1a5)](_0x10c60a),{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]}),withSpinner(_0x6b95cb(0x1b5),()=>_0xeaa8a6['journey']['listJourneysFromParentSegment'](_0x10c60a),{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]})]),_0x28e134=_0x43f25e['data'],_0x3f0a11=_0x26f0ef[_0x6b95cb(0x1b7)],_0x3d6eea=_0xca5e88[_0x6b95cb(0x1b7)];if(_0x28e134[_0x6b95cb(0x189)]===0x0&&_0x3d6eea[_0x6b95cb(0x189)]===0x0)return console[_0x6b95cb(0x194)](a35_0x5d08b3[_0x6b95cb(0x1b2)](_0x6b95cb(0x190)+_0x569af6+'\x27')),0x0;const _0x10189c=buildFolderPathMap(_0x3f0a11),_0x349f65=_0x1a995||getSegmentRootDir(sanitizeFileName(_0x296baa)),_0x51c8a6=new Map();await withSpinner(_0x6b95cb(0x19b),async()=>{await batchAsync(_0x28e134,async _0x310c06=>{const _0x47df01=a35_0x4c9b,_0x43f1aa=await _0xeaa8a6[_0x47df01(0x1ca)]['listActivations'](_0x10c60a,_0x310c06['id']);_0x51c8a6['set'](_0x310c06['id'],_0x43f1aa);});},{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]});const _0x5577a9=await withSpinner(_0x6b95cb(0x1c0),()=>_0xeaa8a6[_0x6b95cb(0x186)]['buildIdToEmailMap'](),{'verbose':_0x477e5a['verbose']})[_0x6b95cb(0x1d2)](_0x4d5e86=>_0x4d5e86['data']),_0x31c3b2=await withSpinner(_0x6b95cb(0x197),()=>_0xeaa8a6['connection']['buildIdToNameMap'](),{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]})['then'](_0x5e7020=>_0x5e7020[_0x6b95cb(0x1b7)]),_0x418cd=[],_0x573b89=a35_0x441f24['join'](_0x349f65,_0x6b95cb(0x176)),_0x411f86=createTdxConfigContent(_0x569af6);_0x418cd[_0x6b95cb(0x187)](prepareFile(_0x573b89,_0x411f86,_0x349f65));const _0x2cc359=new Map();for(const _0x209869 of _0x28e134){if(_0x209869['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x46ae15=_0x209869['segmentFolderId']?_0x10189c['get'](_0x209869[_0x6b95cb(0x1df)])||'':'',_0x19b262=_0x51c8a6[_0x6b95cb(0x181)](_0x209869['id'])||[],_0x33f7d2=segmentWithActivationsToYaml(_0x209869,_0x19b262,undefined,_0x5577a9,_0x31c3b2),_0x1fa1d9=_0x46ae15?a35_0x441f24[_0x6b95cb(0x18a)](_0x349f65,_0x46ae15):_0x349f65,_0x5c5ecc=sanitizeFileName(_0x209869[_0x6b95cb(0x198)]),_0x38ecb7=getUniqueFileName(_0x1fa1d9,_0x5c5ecc,_0x2cc359),_0x300c64=a35_0x441f24[_0x6b95cb(0x18a)](_0x1fa1d9,_0x38ecb7+_0x6b95cb(0x1a0)),_0x14cc86=segmentToYamlString(_0x33f7d2);_0x418cd['push'](prepareFile(_0x300c64,_0x14cc86,_0x349f65));}const _0x47df8b=new Map();for(const _0x496cea of _0x28e134){_0x47df8b[_0x6b95cb(0x1e3)](_0x496cea['id'],_0x496cea);}const _0x370c4c=new Map();for(const _0x231395 of _0x3d6eea){const _0xfe6abe=_0x231395[_0x6b95cb(0x1d1)];!_0x370c4c[_0x6b95cb(0x18c)](_0xfe6abe)&&_0x370c4c[_0x6b95cb(0x1e3)](_0xfe6abe,[]),_0x370c4c[_0x6b95cb(0x181)](_0xfe6abe)[_0x6b95cb(0x187)](_0x231395);}for(const _0x7b07e1 of _0x370c4c['values']()){_0x7b07e1['sort']((_0x43e694,_0x5d3468)=>(_0x43e694[_0x6b95cb(0x1da)]||0x0)-(_0x5d3468[_0x6b95cb(0x1da)]||0x0));}const _0x5960a4=()=>{const _0x5d126c=_0x6b95cb,_0x4f4140=new Set(),_0xca2e40=new Set(),_0x470c8d=new Map(),_0x253805=new Map(),_0x40e4b0=createJumpTargetCache(),_0x5f4579=(_0x474160,_0xcc7e9a)=>({'resolveSegment':async _0x3011de=>{const _0x448c8f=a35_0x4c9b,_0x52c810=_0x470c8d[_0x448c8f(0x181)](_0x3011de);if(_0x52c810!==undefined)return{'name':_0x52c810,'isJourneyLocal':!![]};if(!_0xcc7e9a)return{'name':_0x3011de,'isJourneyLocal':![]};try{let _0x1c2ad3=_0x47df8b[_0x448c8f(0x181)](_0x3011de);!_0x1c2ad3&&(_0x1c2ad3=await _0xeaa8a6[_0x448c8f(0x1ca)]['getSegment'](_0xcc7e9a,_0x3011de));const _0xf5a340=generateJourneyLocalName(_0x1c2ad3[_0x448c8f(0x198)]),_0x44a356=_0x1c2ad3[_0x448c8f(0x1c8)]===SEGMENT_KIND_JOURNEY&&_0xf5a340!==undefined;let _0x6dcfa7=_0x1c2ad3[_0x448c8f(0x198)];if(_0x44a356&&_0xf5a340){let _0x555890=_0xf5a340,_0x1583e1=0x2;while(_0x4f4140[_0x448c8f(0x18c)](_0x555890)){_0x555890=_0xf5a340+'_'+_0x1583e1,_0x1583e1++;}_0x4f4140[_0x448c8f(0x1b6)](_0x555890),_0x6dcfa7=_0x555890,_0x470c8d['set'](_0x3011de,_0x6dcfa7);}let _0x33e395;return _0x44a356&&_0x1c2ad3[_0x448c8f(0x1b4)]&&(_0x33e395={'description':_0x1c2ad3[_0x448c8f(0x1ac)],'rule':apiRuleToYaml(_0x1c2ad3[_0x448c8f(0x1b4)])}),{'name':_0x6dcfa7,'isJourneyLocal':_0x44a356,'definition':_0x33e395};}catch(_0x311e98){return _0x477e5a[_0x448c8f(0x1c3)]&&console['error'](_0x448c8f(0x1a7)+_0x3011de+':\x20'+_0x311e98[_0x448c8f(0x1cd)]),{'name':_0x3011de,'isJourneyLocal':![]};}},'resolveActivation':async _0x5e6843=>{const _0x18461=a35_0x4c9b,_0x5d33de=_0x253805[_0x18461(0x181)](_0x5e6843);if(_0x5d33de!==undefined)return{'name':_0x5d33de,'isJourneyLocal':!![]};try{const _0x17fbcd=await _0xeaa8a6['journey'][_0x18461(0x180)](_0x474160,_0x5e6843),_0x1ab719=_0x17fbcd[_0x18461(0x19f)][_0x18461(0x184)][_0x18461(0x198)]||_0x5e6843,_0x39b89c=sanitizeYamlKey(_0x1ab719)||_0x18461(0x1bc)+_0x5e6843;let _0x56a1c6=_0x39b89c,_0xe539db=0x2;while(_0xca2e40[_0x18461(0x18c)](_0x56a1c6)){_0x56a1c6=_0x39b89c+'_'+_0xe539db,_0xe539db++;}_0xca2e40[_0x18461(0x1b6)](_0x56a1c6),_0x253805[_0x18461(0x1e3)](_0x5e6843,_0x56a1c6);const _0x2ca8d2=journeyActivationStepToYaml(_0x17fbcd,_0x5577a9,_0x31c3b2);return{'name':_0x56a1c6,'isJourneyLocal':!![],'definition':_0x2ca8d2};}catch(_0x546ae4){return _0x477e5a['verbose']&&console[_0x18461(0x194)](_0x18461(0x1b3)+_0x5e6843+':\x20'+_0x546ae4[_0x18461(0x1cd)]),{'name':_0x5e6843,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x48d773,_0x41cdf7)=>resolveJumpTarget(_0x48d773,_0x41cdf7,_0x40e4b0,_0x1d8f4f=>_0xeaa8a6[_0x5d126c(0x192)][_0x5d126c(0x177)](_0x1d8f4f))});return{'createYamlContext':_0x5f4579};};if(_0x370c4c[_0x6b95cb(0x17b)]>0x0){const _0x3c68c7=Array['from'](_0x370c4c[_0x6b95cb(0x18d)]()),_0x46e6e6=await withQuerySpinner(_0x6b95cb(0x1c9),async _0x5d51c5=>{const _0x23470f=_0x6b95cb,_0x405aa6=[];let _0x532b05=0x0;const _0x175de6=0x5;for(let _0x45c68b=0x0;_0x45c68b<_0x3c68c7[_0x23470f(0x189)];_0x45c68b+=_0x175de6){const _0x183d6f=_0x3c68c7[_0x23470f(0x1db)](_0x45c68b,_0x45c68b+_0x175de6),_0x136391=await Promise['all'](_0x183d6f['map'](async _0x789b7d=>{const _0x47f87a=_0x23470f,_0x2b0f17=_0x789b7d[0x0],_0x347f00=_0x2b0f17[_0x47f87a(0x1ab)];_0x5d51c5[_0x47f87a(0x19a)]('Fetching\x20journey\x20\x27'+_0x347f00+'\x27');const _0x474dea=_0x2b0f17[_0x47f87a(0x1e5)]?_0x10189c[_0x47f87a(0x181)](_0x2b0f17[_0x47f87a(0x1e5)])||'':'',{createYamlContext:_0xa3c5e0}=_0x5960a4(),_0x1021e1=[];for(const _0x5eae41 of _0x789b7d){const _0x4768d6=await _0xeaa8a6[_0x47f87a(0x192)][_0x47f87a(0x177)](_0x5eae41['id']),_0xc02c8c=_0x4768d6[_0x47f87a(0x19f)]?.['audienceId'],_0x59cce9=_0xa3c5e0(_0x5eae41['id'],_0xc02c8c),_0x3358f0=await apiToYamlAsync(_0x4768d6,_0x59cce9);_0x1021e1[_0x47f87a(0x187)]({'item':_0x5eae41,'yaml':_0x3358f0});}let _0x1478db;return _0x1021e1[_0x47f87a(0x189)]===0x1?_0x1478db=_0x1021e1[0x0][_0x47f87a(0x1dd)]:_0x1478db=buildMergedJourneyYaml(_0x1021e1),{'bundleName':_0x347f00,'folderPath':_0x474dea,'finalYaml':_0x1478db};}));_0x405aa6[_0x23470f(0x187)](..._0x136391),_0x532b05+=_0x183d6f[_0x23470f(0x189)],_0x5d51c5[_0x23470f(0x1dc)]('('+_0x532b05+'/'+_0x3c68c7[_0x23470f(0x189)]+')');}return _0x405aa6;},{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]});for(const {bundleName:_0x34b32a,folderPath:_0x4dd62f,finalYaml:_0x15baaf}of _0x46e6e6['data']){const _0xde358f=a35_0x251cba(_0x15baaf),_0x51d4a5=_0x4dd62f?a35_0x441f24[_0x6b95cb(0x18a)](_0x349f65,_0x4dd62f):_0x349f65,_0x9e3572=sanitizeFileName(_0x34b32a),_0x3cc3a6=getUniqueFileName(_0x51d4a5,_0x9e3572,_0x2cc359),_0x44a48f=a35_0x441f24[_0x6b95cb(0x18a)](_0x51d4a5,_0x3cc3a6+_0x6b95cb(0x1a0));_0x418cd[_0x6b95cb(0x187)](prepareFile(_0x44a48f,_0xde358f,_0x349f65));}}const _0x5409b1=Array[_0x6b95cb(0x1b9)](_0x51c8a6[_0x6b95cb(0x18d)]())[_0x6b95cb(0x1cc)]((_0x2f79d4,_0x9c1393)=>_0x2f79d4+_0x9c1393['length'],0x0),_0x2a2cca=_0x418cd['filter'](_0x505027=>_0x505027['isNew']),_0x3a8613=_0x418cd[_0x6b95cb(0x1be)](_0xf036fc=>!_0xf036fc[_0x6b95cb(0x18f)]&&_0xf036fc[_0x6b95cb(0x178)]),_0x4478b7=_0x418cd['filter'](_0xcab230=>!_0xcab230['isNew']&&!_0xcab230[_0x6b95cb(0x178)]),_0x2d6fc2=_0x28e134[_0x6b95cb(0x1be)](_0x8e0f15=>_0x8e0f15['kind']!==SEGMENT_KIND_JOURNEY);console[_0x6b95cb(0x194)](_0x6b95cb(0x172)+_0x569af6+'\x27:'),console[_0x6b95cb(0x194)]('\x20\x20🎯\x20'+a35_0x5d08b3[_0x6b95cb(0x179)](_0x2d6fc2[_0x6b95cb(0x189)]+_0x6b95cb(0x1ad))+_0x6b95cb(0x17e)+a35_0x5d08b3[_0x6b95cb(0x179)](_0x5409b1+'\x20activations'));if(_0x370c4c[_0x6b95cb(0x17b)]>0x0){const _0x3ff0be=_0x3d6eea[_0x6b95cb(0x189)],_0x328def=_0x370c4c[_0x6b95cb(0x17b)],_0x19aa23=_0x3ff0be>_0x328def?'\x20('+_0x3ff0be+_0x6b95cb(0x1c6):'';console[_0x6b95cb(0x194)](_0x6b95cb(0x19d)+a35_0x5d08b3[_0x6b95cb(0x179)](_0x328def+_0x6b95cb(0x19e))+a35_0x5d08b3[_0x6b95cb(0x1bb)](_0x19aa23));}console[_0x6b95cb(0x194)]('\x20\x20'+a35_0x5d08b3['green']('+\x20'+_0x2a2cca[_0x6b95cb(0x189)]+_0x6b95cb(0x1d6))),console[_0x6b95cb(0x194)]('\x20\x20'+a35_0x5d08b3[_0x6b95cb(0x1b2)]('~\x20'+_0x3a8613[_0x6b95cb(0x189)]+_0x6b95cb(0x1bd))),console[_0x6b95cb(0x194)]('\x20\x20'+a35_0x5d08b3[_0x6b95cb(0x1bb)]('=\x20'+_0x4478b7[_0x6b95cb(0x189)]+_0x6b95cb(0x17d))),console[_0x6b95cb(0x194)](_0x6b95cb(0x1e0)+a35_0x5d08b3[_0x6b95cb(0x179)](_0x349f65)+'\x0a');if(_0x3a8613[_0x6b95cb(0x189)]>0x0)for(const _0x2b86f0 of _0x3a8613){console['error'](_0x6b95cb(0x1aa)+_0x2b86f0[_0x6b95cb(0x1e4)]+'\x27:'),console[_0x6b95cb(0x194)]('─'[_0x6b95cb(0x1c4)](0x3c)),console[_0x6b95cb(0x194)](_0x2b86f0[_0x6b95cb(0x188)]),console['error']('─'[_0x6b95cb(0x1c4)](0x3c));}if(_0x477e5a[_0x6b95cb(0x1c7)])return console['error'](a35_0x5d08b3[_0x6b95cb(0x1b2)](_0x6b95cb(0x1ae))),0x0;if(_0x2a2cca['length']===0x0&&_0x3a8613['length']===0x0)return console[_0x6b95cb(0x194)](a35_0x5d08b3['green'](_0x6b95cb(0x18e))),saveSessionContext({'parent_segment':_0x569af6},_0x477e5a[_0x6b95cb(0x1a4)]),console[_0x6b95cb(0x194)](a35_0x5d08b3['green'](_0x6b95cb(0x1d9)+a35_0x5d08b3[_0x6b95cb(0x1bb)](_0x6b95cb(0x1bf))+_0x6b95cb(0x1d3)+a35_0x5d08b3[_0x6b95cb(0x179)](_0x569af6))),0x0;if(!_0x477e5a[_0x6b95cb(0x199)]&&(_0x2a2cca['length']>0x0||_0x3a8613[_0x6b95cb(0x189)]>0x0)){const _0x48e62b=await confirmKey(_0x6b95cb(0x1ce)+(_0x2a2cca[_0x6b95cb(0x189)]+_0x3a8613[_0x6b95cb(0x189)])+_0x6b95cb(0x1d8));if(!_0x48e62b)return console[_0x6b95cb(0x194)]('Aborted.'),0x1;}for(const _0x2b7327 of _0x418cd){if(_0x2b7327[_0x6b95cb(0x18f)]||_0x2b7327[_0x6b95cb(0x178)]){const _0x3d9b7b=a35_0x441f24[_0x6b95cb(0x171)](_0x2b7327[_0x6b95cb(0x175)]);!existsSync(_0x3d9b7b)&&mkdirSync(_0x3d9b7b,{'recursive':!![]}),writeFileSync(_0x2b7327[_0x6b95cb(0x175)],_0x2b7327[_0x6b95cb(0x1c2)],'utf-8');}}return console[_0x6b95cb(0x194)](a35_0x5d08b3['green'](_0x6b95cb(0x1cf)+(_0x2a2cca[_0x6b95cb(0x189)]+_0x3a8613[_0x6b95cb(0x189)])+'\x20files\x20to\x20'+_0x349f65)),saveSessionContext({'parent_segment':_0x569af6},_0x477e5a[_0x6b95cb(0x1a4)]),console[_0x6b95cb(0x194)](a35_0x5d08b3[_0x6b95cb(0x1b1)]('✔\x20Context\x20set:\x20'+a35_0x5d08b3[_0x6b95cb(0x1bb)](_0x6b95cb(0x1bf))+_0x6b95cb(0x1d3)+a35_0x5d08b3['cyan'](_0x569af6))),0x0;}}function buildFolderPathMap(_0x4591b2){const _0x5249e5=a35_0x57ca53,_0x5a3e73=new Map(),_0x1b97b6=new Map();for(const _0x478eb9 of _0x4591b2){_0x1b97b6['set'](_0x478eb9['id'],_0x478eb9);}const _0x3604e4=new Set();for(const _0x23f0c2 of _0x4591b2){!_0x23f0c2[_0x5249e5(0x1d4)]&&_0x3604e4[_0x5249e5(0x1b6)](_0x23f0c2['id']);}function _0x219eb3(_0x173315){const _0x372df=_0x5249e5;if(_0x5a3e73['has'](_0x173315['id']))return _0x5a3e73[_0x372df(0x181)](_0x173315['id']);if(_0x3604e4['has'](_0x173315['id']))return _0x5a3e73[_0x372df(0x1e3)](_0x173315['id'],''),'';if(_0x173315[_0x372df(0x1d4)]){const _0x5d2198=_0x1b97b6[_0x372df(0x181)](_0x173315[_0x372df(0x1d4)]);if(_0x5d2198){const _0x38bea1=_0x219eb3(_0x5d2198),_0x15a4cd=_0x38bea1?_0x38bea1+'/'+_0x173315[_0x372df(0x198)]:_0x173315[_0x372df(0x198)];return _0x5a3e73['set'](_0x173315['id'],_0x15a4cd),_0x15a4cd;}}const _0x570af2=_0x173315[_0x372df(0x198)];return _0x5a3e73[_0x372df(0x1e3)](_0x173315['id'],_0x570af2),_0x570af2;}for(const _0x26399a of _0x4591b2){_0x219eb3(_0x26399a);}return _0x5a3e73;}function getUniqueFileName(_0x4d4dc6,_0x3ca851,_0x22e4d2){const _0x177eaa=a35_0x57ca53,_0x44eedc=_0x4d4dc6+':'+_0x3ca851,_0x4257cf=_0x22e4d2[_0x177eaa(0x181)](_0x44eedc)||0x0;_0x22e4d2[_0x177eaa(0x1e3)](_0x44eedc,_0x4257cf+0x1);if(_0x4257cf===0x0)return _0x3ca851;return _0x3ca851+'-'+_0x4257cf;}function prepareFile(_0x4e37f8,_0x4846d9,_0x1ed564){const _0x11ca61=a35_0x57ca53,_0x44bae0=a35_0x441f24[_0x11ca61(0x19c)](_0x1ed564,_0x4e37f8);if(existsSync(_0x4e37f8)){const _0x5ca8de=readFileSync(_0x4e37f8,_0x11ca61(0x173)),_0xdfc9b9=generateDiff(_0x5ca8de,_0x4846d9),_0x3c152a=hasChanges(_0xdfc9b9);return{'relativePath':_0x44bae0,'absolutePath':_0x4e37f8,'content':_0x4846d9,'isNew':![],'hasChanges':_0x3c152a,'diff':_0x3c152a?formatDiffWithColors(_0xdfc9b9):undefined};}return{'relativePath':_0x44bae0,'absolutePath':_0x4e37f8,'content':_0x4846d9,'isNew':!![],'hasChanges':![]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x502313=a35_0x55dd;(function(_0x37fc35,_0x103cc3){const _0xf6bc43=a35_0x55dd,_0x16460b=_0x37fc35();while(!![]){try{const _0x28ee92=-parseInt(_0xf6bc43(0x1f7))/0x1+-parseInt(_0xf6bc43(0x242))/0x2+parseInt(_0xf6bc43(0x267))/0x3+-parseInt(_0xf6bc43(0x2a3))/0x4+parseInt(_0xf6bc43(0x20f))/0x5+-parseInt(_0xf6bc43(0x27b))/0x6+parseInt(_0xf6bc43(0x279))/0x7;if(_0x28ee92===_0x103cc3)break;else _0x16460b['push'](_0x16460b['shift']());}catch(_0x315871){_0x16460b['push'](_0x16460b['shift']());}}}(a35_0x2840,0xb29e4));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../sdk/errors.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,findTdxConfig}from'../utils/tdx-config.js';import{segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,yamlToCreateRequest,yamlToUpdateRequest,yamlActivationToCreateRequest,yamlActivationToUpdateRequest,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a35_0x16738f,yamlToApi as a35_0x39979b,toYamlString as a35_0x13b2c5,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';function a35_0x55dd(_0x58283d,_0x5abe1e){_0x58283d=_0x58283d-0x1c9;const _0x284002=a35_0x2840();let _0x55dd94=_0x284002[_0x58283d];return _0x55dd94;}import a35_0x775e6 from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a35_0x2e958f from'path';import{getConsoleNextUrl}from'../types/endpoints.js';import*as a35_0x2c3d0b from'yaml';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';const PENDING_SEGMENT_PREFIX='__pending_';function createPendingSegmentId(_0x752d6e){return''+PENDING_SEGMENT_PREFIX+_0x752d6e+'__';}function isPendingSegmentId(_0x32b5d4){const _0x38cd52=a35_0x55dd;return _0x32b5d4[_0x38cd52(0x244)](PENDING_SEGMENT_PREFIX);}function a35_0x2840(){const _0x5da91c=['Creating','state','journey_entry_criteria_','split','\x27\x20details...','name','updateSegmentById','size','all','journeysOnly','getParent','parse','created','createSegment','deleteActivation','Creating\x20folder\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Activations:','\x20\x20✔\x20Updated\x20activation\x20\x27',')\x20with\x20ID:\x20','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','map','dim','get','listJourneysFromParentSegment','INTERNAL','journeyBundleName','\x27:\x20','activation_','\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27','Resolving\x20parent\x20segment\x20\x27','getSegment','Fetching\x20users\x20for\x20email\x20resolution...','\x20YAML\x20files\x20found','rule','\x20\x20Segments:\x20','update','\x20\x20📊\x20Segments:','data','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','1707430LqwMAY','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','startsWith','sort','listActivations','Failed\x20to\x20create\x20embedded\x20segment\x20\x27','\x20\x20\x20\x20','diff','Entry\x20criteria:\x20','set','hasChanges','\x27\x20(internal:\x20','\x20\x20✔\x20Deleted\x20activation\x20\x27','SEGMENT_SYNTAX_ERROR','stages','Failed\x20to\x20','repeat','config','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','SEGMENT_UPDATE_ERROR','utf-8','\x27...','\x20\x20Created\x20embedded\x20activation\x20\x27','segment\x20or\x20journey','yes','endsWith','/j/da/je','✔\x20Created\x20journey\x20\x27','Deleting\x20segment\x20\x27','\x20deleted','create','\x20segment\x20from\x20file:\x20','No\x20','\x27\x20with\x20ID:\x20','getJourney','\x20journey\x20\x27','__pending_act_','4236990POHgCB','randomUUID','createJourneySegment','\x20updated','SEGMENT_NOT_FOUND','Fetching\x20existing\x20segments...','setPhase','segmentId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','has','type','Error\x20parsing\x20','Deleting\x20activation\x20\x27','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','resolveParentId','Scoped\x20to\x20folder:\x20','length','11401761kbbLSq','Fetching\x20existing\x20journeys...','1566612bzKTwh','message','Changes\x20to:','\x20changes?','Fetching\x20journey\x20\x27','folderId','\x20to\x20create','Activation','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','unchanged','\x20\x20✔\x20Created\x20activation\x20\x27','existingSegment','buildIdToNameMap','Parent\x20segment:\x20','cwd','✔\x20Updated\x20journey\x20\x27','entry_criteria','dirname','Source\x20directory:\x20','JOURNEY_UPDATE_ERROR','segmentFolderId','ACTIVATION_SYNTAX_ERROR','toString','buildNameToIdMap','\x20created','✔\x20Created\x20segment\x20\x27','then','configDir','isDirectory','parentFolderId','stringify','\x20new','steps','✔\x20Updated\x20segment\x20\x27','yamlActivation','journeyStages','setExtra','\x20unchanged','/e/','\x20\x20Journeys:\x20','2332880EZjclx','\x20\x20Created\x20embedded\x20segment\x20\x27','entryCriteria','join','Fetching\x20connections\x20for\x20name\x20resolution...','Fetching\x20parent\x20segment\x20details...','absolutePath','.yml','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','folderPath','\x20activation\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x20\x20🗺️\x20\x20Journeys:','Folders\x20to\x20create:','relative','New\x20segment:','execute','\x0a\x20\x20','item','Error:\x20Directory\x20not\x20found:\x20','flatMap','action','dryRun','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','entries','\x20folders\x20to\x20create','journeyActivationStepId','replace','values','activations','Activation\x20not\x20found:\x20','/app/ps/','NOT_FOUND','\x20to\x20delete','activationActions','delete','journeys','parent_segment','segment','listSegments','Site:\x20','yellow','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','Creating\x20segment\x20\x27','getActivation','toLowerCase','journey','verbose','attributes','blue','\x27\x20v','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27','updateActivation','existingJourney','\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20Source:\x20','parentSegmentFolder','isFile','.yaml','activationParams','Fetching\x20existing\x20folders...','\x20activations]','branches','versionNumber','isNew','Fetching\x20existing\x20activations...','folder','add','1313021dcruOC','journeyId','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','createFolder','green','Segment\x20not\x20found:\x20','Stage\x20\x27','\x27\x20from\x20file:\x20','DecisionPoint','keys','Updating\x20activation\x20\x27','New\x20journey:','listFolders','description','red','createActivation','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20(referenced\x20in\x20journey\x20','draft','resolve','push','existingActivation','find','Creating\x20activation\x20\x27','3507625FXhdBU','yamlConfig','\x0aPush\x20summary\x20for\x20\x27','error','relationships','ACTIVATION_UPDATE_ERROR','Updating','cyan','site','Pushing\x20journeys...','filter'];a35_0x2840=function(){return _0x5da91c;};return a35_0x2840();}function extractPendingSegmentName(_0x515567){const _0x8859ab=a35_0x55dd;return _0x515567[_0x8859ab(0x1cc)](/^__pending_(.+)__$/,'$1');}const PENDING_ACTIVATION_PREFIX=a35_0x502313(0x266);function createPendingActivationId(_0x124e7e){return''+PENDING_ACTIVATION_PREFIX+_0x124e7e+'__';}function isPendingActivationId(_0x3bde92){return _0x3bde92['startsWith'](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x4661db){const _0x78580e=a35_0x502313;return _0x4661db[_0x78580e(0x1cc)](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0x51b44a){const _0x556add=a35_0x502313;!_0x51b44a['description']&&(_0x51b44a[_0x556add(0x204)]=''),!_0x51b44a[_0x556add(0x21b)]&&(_0x51b44a[_0x556add(0x21b)]=_0x556add(0x209));}function tryFindTdxConfig(_0x12ce13){try{return findTdxConfig(_0x12ce13);}catch{return null;}}function resolveTDFolderPath(_0x3cc848,_0xfee92e,_0x562dbb){if(!_0xfee92e)return _0x3cc848;return _0x3cc848?_0x562dbb+'/'+_0x3cc848:_0x562dbb;}export class SegmentPushCommand extends BaseCommand{[a35_0x502313(0x21f)]='segment:push';['description']=a35_0x502313(0x2ba);async[a35_0x502313(0x2b3)](_0x58813e){const _0x3c505d=a35_0x502313,{options:_0x1b6cd0,args:_0x58c800,tdx:_0x478b93}=_0x58813e,_0x5a4305=_0x1b6cd0,_0x3a7dcd=_0x1b6cd0['parentSegment'],_0x4e0cd6=_0x58c800[0x0];let _0x504b72,_0xf01b49,_0x2cbcbc,_0x5a076f;if(_0x4e0cd6){if(existsSync(_0x4e0cd6)&&statSync(_0x4e0cd6)[_0x3c505d(0x297)]()){const _0xff3387=tryFindTdxConfig(_0x4e0cd6);if(_0xff3387)_0x504b72=_0xff3387['config'][_0x3c505d(0x1d6)],_0xf01b49=_0x4e0cd6,_0x2cbcbc=_0xff3387['configDir'];else return console['error'](a35_0x775e6['red'](_0x3c505d(0x254)+_0x4e0cd6+'\x0a')),console['error'](a35_0x775e6[_0x3c505d(0x216)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}else{if(existsSync(_0x4e0cd6)&&statSync(_0x4e0cd6)[_0x3c505d(0x1ec)]()){const _0x59e3ef=a35_0x2e958f[_0x3c505d(0x28c)](_0x4e0cd6),_0x446914=tryFindTdxConfig(_0x59e3ef);if(_0x446914)_0x504b72=_0x446914[_0x3c505d(0x253)]['parent_segment'],_0x2cbcbc=_0x446914['configDir'],_0xf01b49=_0x446914[_0x3c505d(0x296)],_0x5a076f=a35_0x2e958f[_0x3c505d(0x20a)](_0x4e0cd6);else return console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x205)](_0x3c505d(0x254)+_0x59e3ef+'\x0a')),console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x216)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}else _0x504b72=_0x4e0cd6;}}else{const _0x1ceba1=tryFindTdxConfig(process['cwd']());_0x1ceba1?(_0x504b72=_0x1ceba1[_0x3c505d(0x253)][_0x3c505d(0x1d6)],_0xf01b49=process[_0x3c505d(0x289)](),_0x2cbcbc=_0x1ceba1['configDir']):_0x504b72=_0x3a7dcd;}if(!_0x504b72)return console['error'](a35_0x775e6[_0x3c505d(0x1da)](_0x3c505d(0x22a))),console[_0x3c505d(0x212)](_0x3c505d(0x1db)),console[_0x3c505d(0x212)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x3c505d(0x212)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file'),0x1;const _0x5ec8e4=_0xf01b49||getSegmentRootDir(sanitizeFileName(_0x504b72)),_0x522c73=_0x2cbcbc||_0x5ec8e4,_0x10e3fb=a35_0x2e958f[_0x3c505d(0x2b1)](_0x522c73,_0x5ec8e4),_0x8db47f=_0x10e3fb!==''&&_0x10e3fb!=='.';if(!existsSync(_0x5ec8e4))return console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x205)](_0x3c505d(0x2b6)+_0x5ec8e4+'\x0a')),console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x216)](_0x3c505d(0x207))),0x1;_0x5a4305['verbose']&&(console['error'](_0x3c505d(0x1d9)+_0x5a4305[_0x3c505d(0x217)]),console[_0x3c505d(0x212)](_0x3c505d(0x288)+_0x504b72),console[_0x3c505d(0x212)](_0x3c505d(0x28d)+_0x5ec8e4),_0x8db47f&&console[_0x3c505d(0x212)](_0x3c505d(0x277)+_0x10e3fb));const _0x12dbcd=await withSpinner(_0x3c505d(0x238)+_0x504b72+_0x3c505d(0x257),()=>_0x478b93['segment'][_0x3c505d(0x276)](_0x504b72),{'verbose':_0x5a4305['verbose']}),_0x4d869e=_0x12dbcd['data'],[_0x376062,_0xe148f,_0x1c6f79,_0x23979c,_0x3cc366]=await Promise[_0x3c505d(0x222)]([withSpinner(_0x3c505d(0x2a8),()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x224)](_0x4d869e),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]}),withSpinner(_0x3c505d(0x26c),()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x1d8)](_0x4d869e),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]}),withSpinner(_0x3c505d(0x1ef),()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x203)](_0x4d869e),{'verbose':_0x5a4305['verbose']}),withSpinner(_0x3c505d(0x27a),()=>_0x478b93[_0x3c505d(0x1df)][_0x3c505d(0x232)](_0x4d869e),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]}),withSpinner(_0x3c505d(0x23a),()=>_0x478b93['user']['buildUserMaps'](),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]})[_0x3c505d(0x295)](_0x185539=>_0x185539[_0x3c505d(0x240)])]),_0x14c6df=_0x376062[_0x3c505d(0x240)],_0x326beb=_0x14c6df[_0x3c505d(0x213)]?.[_0x3c505d(0x1eb)]?.[_0x3c505d(0x240)]?.['id']||_0x14c6df['relationships']?.['parentFolder']?.[_0x3c505d(0x240)]?.['id'],_0x284777=_0xe148f[_0x3c505d(0x240)],_0xa5d757=_0x1c6f79[_0x3c505d(0x240)],_0x3820c6=_0x23979c[_0x3c505d(0x240)],{emailToId:_0x47b79c,idToEmail:_0x583b40}=_0x3cc366,[_0x174bb4,_0x2a1a81]=await withSpinner(_0x3c505d(0x2a7),async()=>{const _0x29b607=_0x3c505d,[_0x51f3ff,_0x10967e]=await Promise[_0x29b607(0x222)]([_0x478b93['connection'][_0x29b607(0x292)](),_0x478b93['connection'][_0x29b607(0x287)]()]);return[_0x51f3ff,_0x10967e];},{'verbose':_0x5a4305[_0x3c505d(0x1e0)]})[_0x3c505d(0x295)](_0x5a2ea4=>_0x5a2ea4[_0x3c505d(0x240)]),_0x4a10a0=buildFolderPathToIdMap(_0xa5d757),_0x4fd007=new Map();for(const [_0x114b6a,_0x2c3bd2]of _0x4a10a0[_0x3c505d(0x1c9)]()){_0x4fd007[_0x3c505d(0x24b)](_0x2c3bd2,_0x114b6a);}const _0x4c4b3b=new Map();for(const _0x1868fb of _0x284777){const _0x21e330=_0x1868fb[_0x3c505d(0x28f)]?_0x4fd007[_0x3c505d(0x231)](_0x1868fb[_0x3c505d(0x28f)][_0x3c505d(0x291)]())||'':'',_0xbc9160=_0x21e330+':'+_0x1868fb['name'];_0x4c4b3b['set'](_0xbc9160,_0x1868fb);}const _0x132bf0=new Map();for(const _0xbcb5ec of _0x284777){_0x132bf0['set'](_0xbcb5ec[_0x3c505d(0x21f)],_0xbcb5ec['id']);}const _0x385ea1=new Map();for(const _0x3034e0 of _0x3820c6){const _0xbc0676=_0x3034e0[_0x3c505d(0x280)]?_0x4fd007[_0x3c505d(0x231)](_0x3034e0[_0x3c505d(0x280)])||'':'',_0x2b7f3c=_0xbc0676+':'+_0x3034e0[_0x3c505d(0x234)];!_0x385ea1[_0x3c505d(0x271)](_0x2b7f3c)&&_0x385ea1['set'](_0x2b7f3c,[]),_0x385ea1['get'](_0x2b7f3c)[_0x3c505d(0x20b)](_0x3034e0);}for(const _0x3c0ebe of _0x385ea1[_0x3c505d(0x1cd)]()){_0x3c0ebe[_0x3c505d(0x245)]((_0x11c7b3,_0x5343db)=>(_0x11c7b3[_0x3c505d(0x1f2)]||0x0)-(_0x5343db['versionNumber']||0x0));}let _0x192644;if(_0x5a076f){if(!_0x5a076f[_0x3c505d(0x25b)](_0x3c505d(0x2aa))&&!_0x5a076f[_0x3c505d(0x25b)](_0x3c505d(0x1ed)))return console[_0x3c505d(0x212)](a35_0x775e6['red'](_0x3c505d(0x275)+_0x5a076f+'\x0a')),0x1;_0x192644=[_0x5a076f];}else _0x192644=findYamlFiles(_0x5ec8e4);if(_0x192644[_0x3c505d(0x278)]===0x0)return console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x205)](_0x3c505d(0x26f)+_0x5ec8e4+'\x0a')),console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x216)](_0x3c505d(0x283))),0x1;const _0x22e1ab=[],_0x37dcdb=[];for(const _0x4cb548 of _0x192644){const _0x3025c3=a35_0x2e958f[_0x3c505d(0x2b1)](_0x5ec8e4,a35_0x2e958f[_0x3c505d(0x28c)](_0x4cb548)),_0x449292=_0x3025c3==='.'?'':_0x3025c3,_0x5ace42=readFileSync(_0x4cb548,_0x3c505d(0x256));try{const _0x583889=a35_0x2c3d0b['parse'](_0x5ace42);if(isJourneyYaml(_0x583889)){const _0x5c7579=a35_0x16738f(_0x5ace42);_0x37dcdb[_0x3c505d(0x20b)]({'yamlConfig':_0x5c7579,'folderPath':_0x449292,'sourcePath':_0x4cb548});}else{if(!_0x5a4305[_0x3c505d(0x223)]){const _0x174a38=parseSegmentYamlFile(_0x5ace42),_0x5cc778=normalizeChildSegmentYaml(_0x174a38);_0x22e1ab[_0x3c505d(0x20b)]({'yamlConfig':_0x5cc778,'folderPath':_0x449292,'sourcePath':_0x4cb548});}}}catch(_0x80d23a){return console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x205)](_0x3c505d(0x273)+_0x4cb548+':\x20'+(_0x80d23a instanceof Error?_0x80d23a[_0x3c505d(0x27c)]:_0x80d23a))),0x1;}}if(_0x22e1ab[_0x3c505d(0x278)]===0x0&&_0x37dcdb[_0x3c505d(0x278)]===0x0){const _0x1f8d43=_0x5a4305['journeysOnly']?_0x3c505d(0x1df):_0x3c505d(0x259);return console['error'](a35_0x775e6['yellow'](_0x3c505d(0x262)+_0x1f8d43+_0x3c505d(0x23b))),0x0;}const _0x4ce545=new Map();_0x284777[_0x3c505d(0x278)]>0x0&&!_0x5a4305[_0x3c505d(0x223)]&&await withSpinner(_0x3c505d(0x1f4),async()=>{await batchAsync(_0x284777,async _0x4cfc64=>{const _0x1b9ef9=a35_0x55dd,_0x49cc99=await _0x478b93[_0x1b9ef9(0x1d7)][_0x1b9ef9(0x246)](_0x4d869e,_0x4cfc64['id']);_0x4ce545[_0x1b9ef9(0x24b)](_0x4cfc64['id'],_0x49cc99);});},{'verbose':_0x5a4305[_0x3c505d(0x1e0)]});const _0x4db0e2=[],_0x2e8030=new Set();for(const {yamlConfig:_0x577b20,folderPath:_0x1d2eb8,sourcePath:_0x46723a}of _0x22e1ab){const _0x199818=resolveTDFolderPath(_0x1d2eb8,_0x8db47f,_0x10e3fb),_0x136ce9=_0x199818+':'+_0x577b20[_0x3c505d(0x21f)],_0x3a55ed=_0x4c4b3b[_0x3c505d(0x231)](_0x136ce9),_0x5edd12=_0x3a55ed?_0x4ce545[_0x3c505d(0x231)](_0x3a55ed['id'])||[]:[];if(_0x199818&&!_0x4a10a0[_0x3c505d(0x271)](_0x199818)){const _0x30e39c=_0x199818[_0x3c505d(0x21d)]('/');let _0x5f519a='';for(const _0x3887b6 of _0x30e39c){_0x5f519a=_0x5f519a?_0x5f519a+'/'+_0x3887b6:_0x3887b6,!_0x4a10a0[_0x3c505d(0x271)](_0x5f519a)&&_0x2e8030[_0x3c505d(0x1f6)](_0x5f519a);}}const _0x26b42=calculateActivationActions(_0x577b20[_0x3c505d(0x1ce)]||[],_0x5edd12,_0x583b40,_0x2a1a81),_0x31d95e=segmentToYamlString(_0x577b20);let _0x2fc1be,_0x4793a0=![],_0x58d920;if(_0x3a55ed){const _0x21557c=segmentWithActivationsToYaml(_0x3a55ed,_0x5edd12,undefined,_0x583b40,_0x2a1a81),_0xcee673=segmentToYamlString(_0x21557c);_0x2fc1be=generateDiff(_0xcee673,_0x31d95e),_0x4793a0=hasChanges(_0x2fc1be),_0x4793a0&&(_0x58d920=formatDiffWithColors(_0x2fc1be));}else _0x2fc1be=generateDiff('',_0x31d95e),_0x58d920=formatDiffWithColors(_0x2fc1be);_0x4db0e2['push']({'relativePath':_0x577b20[_0x3c505d(0x21f)],'absolutePath':_0x46723a,'yamlConfig':_0x577b20,'folderPath':_0x199818,'existingSegment':_0x3a55ed,'existingActivations':_0x5edd12,'isNew':!_0x3a55ed,'hasChanges':_0x4793a0,'diff':_0x58d920,'activationActions':_0x26b42});}let _0x4ec38b=[];if(!_0x5a076f){const _0x32c935=new Set();for(const {yamlConfig:_0x3b0f56,folderPath:_0x28c5e2}of _0x22e1ab){const _0xab3cfe=resolveTDFolderPath(_0x28c5e2,_0x8db47f,_0x10e3fb);_0x32c935['add'](_0xab3cfe+':'+_0x3b0f56['name']);}_0x4ec38b=_0x284777[_0x3c505d(0x219)](_0x1063bd=>{const _0x2beb47=_0x3c505d,_0x13f703=_0x1063bd[_0x2beb47(0x28f)]?_0x4fd007[_0x2beb47(0x231)](_0x1063bd[_0x2beb47(0x28f)][_0x2beb47(0x291)]())||'':'',_0x528688=_0x13f703+':'+_0x1063bd[_0x2beb47(0x21f)];if(_0x32c935['has'](_0x528688))return![];if(_0x8db47f)return _0x13f703===_0x10e3fb||_0x13f703[_0x2beb47(0x244)](_0x10e3fb+'/');return!![];});}const _0x28a2ab=[];for(const {yamlConfig:_0x5642a4,folderPath:_0x50e906,sourcePath:_0x2fbaaf}of _0x37dcdb){const _0x49ee62=resolveTDFolderPath(_0x50e906,_0x8db47f,_0x10e3fb),_0x2b455e=_0x49ee62+':'+_0x5642a4[_0x3c505d(0x21f)],_0x57e534=_0x385ea1['get'](_0x2b455e);let _0x282f78,_0x26c5ce;if(_0x57e534&&_0x57e534['length']>0x0){const _0x4976bd=new Set(),_0x4d5d0d=new Set(),_0x59092f=new Map(),_0x4d2ef7=new Map(),_0x70c766=createJumpTargetCache(),_0x15e02b=_0x4f55b9=>({'resolveSegment':async _0x1c6ef9=>{const _0x494762=_0x3c505d,_0x53cdaa=_0x4d2ef7[_0x494762(0x231)](_0x1c6ef9);if(_0x53cdaa!==undefined)return{'name':_0x53cdaa,'isJourneyLocal':!![]};try{let _0xf259cd=_0x284777[_0x494762(0x20d)](_0x31f6c9=>_0x31f6c9['id']===_0x1c6ef9);!_0xf259cd&&(_0xf259cd=await _0x478b93[_0x494762(0x1d7)][_0x494762(0x239)](_0x4d869e,_0x1c6ef9));const _0x29aac2=generateJourneyLocalName(_0xf259cd['name']),_0x4f1bb4=_0xf259cd['kind']===SEGMENT_KIND_JOURNEY&&_0x29aac2!==undefined;let _0x4502bf=_0xf259cd[_0x494762(0x21f)];if(_0x4f1bb4&&_0x29aac2){let _0x2a8b2f=_0x29aac2,_0x15b3a0=0x2;while(_0x4976bd['has'](_0x2a8b2f)){_0x2a8b2f=_0x29aac2+'_'+_0x15b3a0,_0x15b3a0++;}_0x4976bd[_0x494762(0x1f6)](_0x2a8b2f),_0x4502bf=_0x2a8b2f,_0x4d2ef7[_0x494762(0x24b)](_0x1c6ef9,_0x4502bf);}let _0x15f8c1;return _0x4f1bb4&&_0xf259cd[_0x494762(0x23c)]&&(_0x15f8c1={'description':_0xf259cd[_0x494762(0x204)],'rule':apiRuleToYaml(_0xf259cd['rule'])}),{'name':_0x4502bf,'isJourneyLocal':_0x4f1bb4,'definition':_0x15f8c1};}catch{return{'name':_0x1c6ef9,'isJourneyLocal':![]};}},'resolveActivation':async _0x2b6f04=>{const _0x34b36b=_0x3c505d,_0x4c0c49=_0x59092f['get'](_0x2b6f04);if(_0x4c0c49!==undefined)return{'name':_0x4c0c49,'isJourneyLocal':!![]};try{const _0x10d62c=await _0x478b93['journey'][_0x34b36b(0x1dd)](_0x4f55b9,_0x2b6f04),_0xfbabf6=_0x10d62c[_0x34b36b(0x1e1)]['activationParams'][_0x34b36b(0x21f)]||_0x2b6f04,_0x2aed18=sanitizeYamlKey(_0xfbabf6)||_0x34b36b(0x236)+_0x2b6f04;let _0x1f6254=_0x2aed18,_0x21de9a=0x2;while(_0x4d5d0d[_0x34b36b(0x271)](_0x1f6254)){_0x1f6254=_0x2aed18+'_'+_0x21de9a,_0x21de9a++;}_0x4d5d0d[_0x34b36b(0x1f6)](_0x1f6254),_0x59092f[_0x34b36b(0x24b)](_0x2b6f04,_0x1f6254);const _0x357ef2=journeyActivationStepToYaml(_0x10d62c,_0x583b40,_0x2a1a81);return{'name':_0x1f6254,'isJourneyLocal':!![],'definition':_0x357ef2};}catch{return{'name':_0x2b6f04,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x78e900,_0x15fe40)=>resolveJumpTarget(_0x78e900,_0x15fe40,_0x70c766,_0x5e4962=>_0x478b93['journey'][_0x3c505d(0x264)](_0x5e4962))}),_0x29284d=hasMultipleVersions(_0x5642a4);if(_0x29284d&&_0x57e534['length']>0x1){const _0x5957a9=[];for(const _0x3c0870 of _0x57e534){const _0x4e0ec1=await withSpinner(_0x3c505d(0x27f)+_0x5642a4[_0x3c505d(0x21f)]+_0x3c505d(0x1e3)+(_0x3c0870[_0x3c505d(0x1f2)]||0x1)+'...',()=>_0x478b93[_0x3c505d(0x1df)]['getJourney'](_0x3c0870['id']),{'verbose':_0x5a4305['verbose']}),_0x123b04=_0x15e02b(_0x3c0870['id']),_0x1ffd0f=await apiToYamlAsync(_0x4e0ec1[_0x3c505d(0x240)],_0x123b04);_0x5957a9[_0x3c505d(0x20b)]({'item':_0x3c0870,'yaml':_0x1ffd0f});}_0x26c5ce=buildMergedJourneyYaml(_0x5957a9);const _0x559e3f=Math['max'](..._0x5957a9[_0x3c505d(0x22f)](_0x3510fb=>_0x3510fb[_0x3c505d(0x2b5)][_0x3c505d(0x1f2)]||0x0)),_0x146926=_0x57e534['find'](_0xcca4de=>(_0xcca4de[_0x3c505d(0x1f2)]||0x0)===_0x559e3f);_0x146926&&(_0x282f78=await _0x478b93['journey']['getJourney'](_0x146926['id']));}else{const _0x4591e4=_0x57e534[_0x57e534[_0x3c505d(0x278)]-0x1],_0x413a6c=await withSpinner(_0x3c505d(0x27f)+_0x5642a4[_0x3c505d(0x21f)]+_0x3c505d(0x21e),()=>_0x478b93[_0x3c505d(0x1df)]['getJourney'](_0x4591e4['id']),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]});_0x282f78=_0x413a6c[_0x3c505d(0x240)];const _0x15aa7e=_0x15e02b(_0x4591e4['id']);_0x26c5ce=await apiToYamlAsync(_0x282f78,_0x15aa7e);}}if(_0x49ee62&&!_0x4a10a0[_0x3c505d(0x271)](_0x49ee62)){const _0xd88a46=_0x49ee62['split']('/');let _0x476d4c='';for(const _0x4018a5 of _0xd88a46){_0x476d4c=_0x476d4c?_0x476d4c+'/'+_0x4018a5:_0x4018a5,!_0x4a10a0[_0x3c505d(0x271)](_0x476d4c)&&_0x2e8030['add'](_0x476d4c);}}const _0x202cbf=normalizeJourneyYaml(_0x5642a4),_0x3d69dc=a35_0x13b2c5(_0x202cbf);let _0x5d9280=![],_0x23d2b1;if(_0x26c5ce){const _0x29a20b=normalizeJourneyYaml(_0x26c5ce),_0x5ebc73=a35_0x13b2c5(_0x29a20b),_0x3aee5d=generateDiff(_0x5ebc73,_0x3d69dc);_0x5d9280=hasChanges(_0x3aee5d),_0x5d9280&&(_0x23d2b1=formatDiffWithColors(_0x3aee5d));}else{const _0x2bb7f0=generateDiff('',_0x3d69dc);_0x23d2b1=formatDiffWithColors(_0x2bb7f0);}_0x28a2ab[_0x3c505d(0x20b)]({'relativePath':_0x5642a4[_0x3c505d(0x21f)],'absolutePath':_0x2fbaaf,'yamlConfig':_0x5642a4,'folderPath':_0x49ee62,'existingJourney':_0x282f78,'isNew':!_0x282f78,'hasChanges':_0x5d9280,'diff':_0x23d2b1});}let _0x230edf=[];if(!_0x5a076f){const _0x833391=new Set();for(const {yamlConfig:_0x15ca96,folderPath:_0x548022}of _0x37dcdb){const _0x2a05b2=resolveTDFolderPath(_0x548022,_0x8db47f,_0x10e3fb);_0x833391[_0x3c505d(0x1f6)](_0x2a05b2+':'+_0x15ca96[_0x3c505d(0x21f)]);}_0x230edf=_0x3820c6[_0x3c505d(0x219)](_0x35cb1b=>{const _0x5da649=_0x3c505d,_0x1f9a11=_0x35cb1b[_0x5da649(0x280)]?_0x4fd007[_0x5da649(0x231)](_0x35cb1b[_0x5da649(0x280)])||'':'',_0x49fc86=_0x1f9a11+':'+_0x35cb1b[_0x5da649(0x234)];if(_0x833391[_0x5da649(0x271)](_0x49fc86))return![];if(_0x8db47f)return _0x1f9a11===_0x10e3fb||_0x1f9a11[_0x5da649(0x244)](_0x10e3fb+'/');return!![];});}const _0x5d83d5=_0x4db0e2['filter'](_0x596dc0=>_0x596dc0[_0x3c505d(0x1f3)]),_0xfdd612=_0x4db0e2['filter'](_0x54ca5f=>!_0x54ca5f['isNew']&&_0x54ca5f['hasChanges']),_0x2bb1ee=_0x4db0e2[_0x3c505d(0x219)](_0xa3e439=>!_0xa3e439['isNew']&&!_0xa3e439[_0x3c505d(0x24c)]),_0x468177=Array['from'](_0x2e8030)[_0x3c505d(0x245)](),_0x271870=_0x5a4305[_0x3c505d(0x1d4)]?_0x4ec38b:[],_0x495a5f=_0x5a4305[_0x3c505d(0x1d4)]?_0x230edf:[],_0x21a547=_0x4db0e2[_0x3c505d(0x2b7)](_0x1c7f23=>_0x1c7f23[_0x3c505d(0x1d3)]),_0x23cd7f=_0x21a547['filter'](_0x4ec27e=>_0x4ec27e[_0x3c505d(0x272)]===_0x3c505d(0x260)),_0x324248=_0x21a547[_0x3c505d(0x219)](_0x3a2efa=>_0x3a2efa[_0x3c505d(0x272)]===_0x3c505d(0x23e)),_0x1bde84=_0x21a547[_0x3c505d(0x219)](_0x55dc7d=>_0x55dc7d[_0x3c505d(0x272)]===_0x3c505d(0x1d4)),_0x2f0e9f=_0x28a2ab[_0x3c505d(0x219)](_0x2b334a=>_0x2b334a[_0x3c505d(0x1f3)]),_0xf0ae22=_0x28a2ab[_0x3c505d(0x219)](_0x3a40c3=>!_0x3a40c3['isNew']&&_0x3a40c3['hasChanges']),_0x13b11e=_0x28a2ab[_0x3c505d(0x219)](_0x47d517=>!_0x47d517['isNew']&&!_0x47d517['hasChanges']);console[_0x3c505d(0x212)](_0x3c505d(0x211)+_0x504b72+'\x27:');_0x468177[_0x3c505d(0x278)]>0x0&&console['error']('\x20\x20'+a35_0x775e6['blue']('📁\x20'+_0x468177['length']+_0x3c505d(0x1ca)));if(!_0x5a4305[_0x3c505d(0x223)]){console['error'](_0x3c505d(0x23f)),console['error']('\x20\x20\x20\x20'+a35_0x775e6['green']('+\x20'+_0x5d83d5['length']+_0x3c505d(0x29a))),console[_0x3c505d(0x212)](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x1da)]('~\x20'+_0xfdd612['length']+'\x20changed'));if(_0x271870[_0x3c505d(0x278)]>0x0)console[_0x3c505d(0x212)](_0x3c505d(0x248)+a35_0x775e6['red']('-\x20'+_0x271870[_0x3c505d(0x278)]+_0x3c505d(0x1d2)));else _0x4ec38b[_0x3c505d(0x278)]>0x0&&!_0x5a4305['delete']&&console[_0x3c505d(0x212)]('\x20\x20\x20\x20'+a35_0x775e6['dim'](_0x4ec38b[_0x3c505d(0x278)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x230)]('=\x20'+_0x2bb1ee['length']+_0x3c505d(0x2a0)));}if(_0x28a2ab[_0x3c505d(0x278)]>0x0||_0x230edf[_0x3c505d(0x278)]>0x0){console[_0x3c505d(0x212)](_0x3c505d(0x2af)),console['error'](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x1fb)]('+\x20'+_0x2f0e9f[_0x3c505d(0x278)]+_0x3c505d(0x29a))),console[_0x3c505d(0x212)](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x1da)]('~\x20'+_0xf0ae22[_0x3c505d(0x278)]+'\x20changed'));if(_0x495a5f[_0x3c505d(0x278)]>0x0)console[_0x3c505d(0x212)]('\x20\x20\x20\x20'+a35_0x775e6[_0x3c505d(0x205)]('-\x20'+_0x495a5f[_0x3c505d(0x278)]+_0x3c505d(0x1d2)));else _0x230edf[_0x3c505d(0x278)]>0x0&&!_0x5a4305[_0x3c505d(0x1d4)]&&console[_0x3c505d(0x212)](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x230)](_0x230edf[_0x3c505d(0x278)]+_0x3c505d(0x1e9)));console[_0x3c505d(0x212)](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x230)]('=\x20'+_0x13b11e['length']+_0x3c505d(0x2a0)));}_0x21a547['length']>0x0&&!_0x5a4305['journeysOnly']&&(console[_0x3c505d(0x212)](''),console[_0x3c505d(0x212)](_0x3c505d(0x22b)),_0x23cd7f[_0x3c505d(0x278)]>0x0&&console['error'](_0x3c505d(0x248)+a35_0x775e6[_0x3c505d(0x1fb)]('+\x20'+_0x23cd7f['length']+_0x3c505d(0x281))),_0x324248[_0x3c505d(0x278)]>0x0&&console[_0x3c505d(0x212)](_0x3c505d(0x248)+a35_0x775e6['yellow']('~\x20'+_0x324248[_0x3c505d(0x278)]+'\x20to\x20update')),_0x1bde84[_0x3c505d(0x278)]>0x0&&console[_0x3c505d(0x212)]('\x20\x20\x20\x20'+a35_0x775e6[_0x3c505d(0x205)]('-\x20'+_0x1bde84[_0x3c505d(0x278)]+_0x3c505d(0x1d2))));console[_0x3c505d(0x212)](_0x3c505d(0x1ea)+a35_0x775e6['cyan'](_0x5ec8e4)+'\x0a');if(_0x468177['length']>0x0){console['error'](_0x3c505d(0x2b0));for(const _0x45c4e1 of _0x468177){console[_0x3c505d(0x212)]('\x20\x20'+a35_0x775e6[_0x3c505d(0x1e2)]('+')+'\x20'+_0x45c4e1);}console['error']('');}if(_0x5d83d5[_0x3c505d(0x278)]>0x0&&!_0x5a4305[_0x3c505d(0x223)])for(const _0x6e72e9 of _0x5d83d5){const _0xc91d5f=_0x6e72e9[_0x3c505d(0x2ac)]?_0x6e72e9[_0x3c505d(0x2ac)]+'/'+_0x6e72e9[_0x3c505d(0x210)]['name']:_0x6e72e9[_0x3c505d(0x210)][_0x3c505d(0x21f)],_0x4ec5e3=_0x6e72e9[_0x3c505d(0x210)][_0x3c505d(0x1ce)]?.[_0x3c505d(0x278)]||0x0,_0xed86e2=_0x4ec5e3>0x0?a35_0x775e6[_0x3c505d(0x230)]('\x20['+_0x4ec5e3+_0x3c505d(0x1f0)):'';console[_0x3c505d(0x212)]('\x0a'+a35_0x775e6['green'](_0x3c505d(0x2b2))+'\x20'+_0xc91d5f+_0xed86e2),console['error']('─'[_0x3c505d(0x252)](0x3c)),_0x6e72e9[_0x3c505d(0x249)]&&console[_0x3c505d(0x212)](_0x6e72e9[_0x3c505d(0x249)]),console['error']('─'[_0x3c505d(0x252)](0x3c));}if(_0x271870[_0x3c505d(0x278)]>0x0&&!_0x5a4305[_0x3c505d(0x223)])for(const _0x4694d7 of _0x271870){const _0x553571=_0x4694d7[_0x3c505d(0x28f)]?_0x4fd007[_0x3c505d(0x231)](_0x4694d7[_0x3c505d(0x28f)]['toString']())||'':'',_0x316a28=_0x553571?_0x553571+'/'+_0x4694d7[_0x3c505d(0x21f)]:_0x4694d7[_0x3c505d(0x21f)],_0x338997=_0x4ce545[_0x3c505d(0x231)](_0x4694d7['id'])||[],_0x519e9b=_0x338997['length']>0x0?a35_0x775e6[_0x3c505d(0x230)]('\x20['+_0x338997['length']+_0x3c505d(0x1f0)):'';console[_0x3c505d(0x212)]('\x0a'+a35_0x775e6[_0x3c505d(0x205)]('Delete\x20segment:')+'\x20'+_0x316a28+_0x519e9b),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c));const _0x3d0030=segmentWithActivationsToYaml(_0x4694d7,_0x338997,undefined,_0x583b40,_0x2a1a81),_0x493979=segmentToYamlString(_0x3d0030),_0x309ebe=generateDiff(_0x493979,'');console[_0x3c505d(0x212)](formatDiffWithColors(_0x309ebe)),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c));}const _0x31b9bf=_0x4db0e2[_0x3c505d(0x219)](_0x1ca255=>!_0x1ca255[_0x3c505d(0x1f3)]&&_0x1ca255[_0x3c505d(0x249)]);if(_0x31b9bf[_0x3c505d(0x278)]>0x0&&!_0x5a4305[_0x3c505d(0x223)])for(const _0x1134c7 of _0x31b9bf){const _0x8dd299=_0x1134c7[_0x3c505d(0x2ac)]?_0x1134c7[_0x3c505d(0x2ac)]+'/'+_0x1134c7['yamlConfig'][_0x3c505d(0x21f)]:_0x1134c7[_0x3c505d(0x210)]['name'];console[_0x3c505d(0x212)]('\x0a'+a35_0x775e6[_0x3c505d(0x1da)](_0x3c505d(0x27d))+'\x20'+_0x8dd299),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c)),console['error'](_0x1134c7['diff']),console['error']('─'[_0x3c505d(0x252)](0x3c));}if(_0x2f0e9f['length']>0x0)for(const _0x5ea333 of _0x2f0e9f){const _0x17f63c=_0x5ea333[_0x3c505d(0x2ac)]?_0x5ea333[_0x3c505d(0x2ac)]+'/'+_0x5ea333[_0x3c505d(0x210)][_0x3c505d(0x21f)]:_0x5ea333[_0x3c505d(0x210)]['name'];console[_0x3c505d(0x212)]('\x0a'+a35_0x775e6[_0x3c505d(0x1fb)](_0x3c505d(0x202))+'\x20'+_0x17f63c),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c)),_0x5ea333[_0x3c505d(0x249)]&&console['error'](_0x5ea333[_0x3c505d(0x249)]),console[_0x3c505d(0x212)]('─'['repeat'](0x3c));}const _0x3652d6=_0x28a2ab[_0x3c505d(0x219)](_0x1723c0=>!_0x1723c0[_0x3c505d(0x1f3)]&&_0x1723c0['diff']);if(_0x3652d6[_0x3c505d(0x278)]>0x0)for(const _0x1a544d of _0x3652d6){const _0x2c0e58=_0x1a544d[_0x3c505d(0x2ac)]?_0x1a544d[_0x3c505d(0x2ac)]+'/'+_0x1a544d[_0x3c505d(0x210)][_0x3c505d(0x21f)]:_0x1a544d[_0x3c505d(0x210)][_0x3c505d(0x21f)];console[_0x3c505d(0x212)]('\x0a'+a35_0x775e6['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x2c0e58),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c)),console[_0x3c505d(0x212)](_0x1a544d[_0x3c505d(0x249)]),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c));}if(_0x495a5f[_0x3c505d(0x278)]>0x0)for(const _0x561c32 of _0x495a5f){const _0x14aa7c=_0x561c32['folderId']?_0x4fd007['get'](_0x561c32['folderId'])||'':'',_0xa988d4=_0x14aa7c?_0x14aa7c+'/'+_0x561c32['journeyBundleName']:_0x561c32['journeyBundleName'];console[_0x3c505d(0x212)]('\x0a'+a35_0x775e6['red']('Delete\x20journey:')+'\x20'+_0xa988d4),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c)),console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x205)]('(Journey\x20will\x20be\x20deleted)')),console[_0x3c505d(0x212)]('─'[_0x3c505d(0x252)](0x3c));}if(_0x5a4305[_0x3c505d(0x2b9)])return console[_0x3c505d(0x212)](a35_0x775e6['yellow'](_0x3c505d(0x1f9))),0x0;const _0x188c57=_0x5a4305[_0x3c505d(0x223)]?![]:_0x5d83d5['length']>0x0||_0xfdd612[_0x3c505d(0x278)]>0x0||_0x271870[_0x3c505d(0x278)]>0x0,_0x5ee401=_0x2f0e9f[_0x3c505d(0x278)]>0x0||_0xf0ae22[_0x3c505d(0x278)]>0x0||_0x495a5f[_0x3c505d(0x278)]>0x0,_0x21a648=_0x5a4305[_0x3c505d(0x223)]?![]:_0x21a547['length']>0x0,_0x1c3d6b=_0x468177[_0x3c505d(0x278)]>0x0;if(!_0x188c57&&!_0x5ee401&&!_0x21a648&&!_0x1c3d6b){const _0x1dc07f=_0x5a4305['journeysOnly']?_0x3c505d(0x241):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x1fb)](_0x1dc07f));if(_0x5a076f&&_0x13b11e[_0x3c505d(0x278)]===0x1){const _0x59d797=_0x13b11e[0x0];if(_0x59d797[_0x3c505d(0x1e7)]?.['id']){const _0x4a5735=getConsoleNextUrl(_0x5a4305[_0x3c505d(0x217)],_0x3c505d(0x1d0)+_0x4d869e+_0x3c505d(0x2a1)+_0x59d797[_0x3c505d(0x1e7)]['id']+_0x3c505d(0x25c));console[_0x3c505d(0x212)]('\x20\x20'+a35_0x775e6['cyan'](_0x4a5735));}}return 0x0;}const _0xcdd556=_0x5a4305[_0x3c505d(0x223)]?_0x2f0e9f[_0x3c505d(0x278)]+_0xf0ae22[_0x3c505d(0x278)]+_0x495a5f['length']+_0x468177[_0x3c505d(0x278)]:_0x5d83d5['length']+_0xfdd612[_0x3c505d(0x278)]+_0x271870['length']+_0x2f0e9f[_0x3c505d(0x278)]+_0xf0ae22[_0x3c505d(0x278)]+_0x495a5f[_0x3c505d(0x278)]+_0x468177[_0x3c505d(0x278)]+_0x21a547[_0x3c505d(0x278)];if(!_0x5a4305[_0x3c505d(0x25a)]&&_0xcdd556>0x0){const _0x261067=await confirmKey('Push\x20'+_0xcdd556+_0x3c505d(0x27e));if(!_0x261067)return console[_0x3c505d(0x212)]('Aborted.'),0x1;}for(const _0x26452f of _0x468177){const _0x51d875=_0x26452f[_0x3c505d(0x21d)]('/'),_0x25501f=_0x51d875[_0x51d875[_0x3c505d(0x278)]-0x1],_0x24e328=_0x51d875['slice'](0x0,-0x1)[_0x3c505d(0x2a6)]('/'),_0x48ea7d=_0x4a10a0['get'](_0x24e328),_0x621a1a={'name':_0x25501f,'parentFolderId':_0x48ea7d},_0x1840fd=await withSpinner(_0x3c505d(0x229)+_0x26452f+_0x3c505d(0x257),()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x1fa)](_0x4d869e,_0x621a1a),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]});_0x4a10a0[_0x3c505d(0x24b)](_0x26452f,_0x1840fd[_0x3c505d(0x240)]['id']),console['error'](a35_0x775e6[_0x3c505d(0x1e2)]('✔\x20Created\x20folder\x20\x27'+_0x26452f+'\x27'));}let _0x532bfe=0x0,_0x338d4f=0x0,_0x6aa33f=0x0,_0x436294=0x0,_0x289af1=0x0,_0x1b46a8=0x0;const _0x20bf67=new Map();for(const _0x540505 of _0x5a4305['journeysOnly']?[]:_0x4db0e2){const _0x5c90c6=_0x540505[_0x3c505d(0x2ac)]?_0x4a10a0[_0x3c505d(0x231)](_0x540505['folderPath']):undefined;let _0x15c914;try{if(_0x540505[_0x3c505d(0x1f3)]){const _0x209ade=yamlToCreateRequest(_0x540505[_0x3c505d(0x210)],_0x5c90c6),_0x55c59e=await withSpinner(_0x3c505d(0x1dc)+_0x540505[_0x3c505d(0x210)][_0x3c505d(0x21f)]+_0x3c505d(0x257),()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x227)](_0x4d869e,_0x209ade),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]});_0x15c914=_0x55c59e[_0x3c505d(0x240)]['id'],_0x20bf67[_0x3c505d(0x24b)](_0x540505[_0x3c505d(0x210)]['name'],_0x15c914),console['error'](a35_0x775e6[_0x3c505d(0x1fb)](_0x3c505d(0x294)+_0x540505[_0x3c505d(0x210)]['name']+'\x27')),_0x532bfe++;}else{if(_0x540505[_0x3c505d(0x24c)]){const _0x1aebab=yamlToUpdateRequest(_0x540505[_0x3c505d(0x210)]);_0x5c90c6!==_0x540505[_0x3c505d(0x286)]?.[_0x3c505d(0x28f)]&&(_0x1aebab[_0x3c505d(0x28f)]=_0x5c90c6?parseInt(_0x5c90c6,0xa):undefined),await withSpinner('Updating\x20segment\x20\x27'+_0x540505['yamlConfig'][_0x3c505d(0x21f)]+_0x3c505d(0x257),()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x220)](_0x4d869e,_0x540505[_0x3c505d(0x286)]['id'],_0x1aebab),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]}),_0x15c914=_0x540505[_0x3c505d(0x286)]['id'],console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x1da)](_0x3c505d(0x29c)+_0x540505[_0x3c505d(0x210)][_0x3c505d(0x21f)]+'\x27')),_0x338d4f++;}else _0x15c914=_0x540505[_0x3c505d(0x286)]['id'];}}catch(_0x193316){const _0x750b3=isHttp400Error(_0x193316),_0x5ce335=_0x750b3?ErrorCode[_0x3c505d(0x24f)]:ErrorCode[_0x3c505d(0x255)],_0x244f52=getErrorMessage(_0x193316);throw new SDKError(_0x5ce335,_0x3c505d(0x251)+(_0x540505[_0x3c505d(0x1f3)]?_0x3c505d(0x260):_0x3c505d(0x23e))+_0x3c505d(0x261)+_0x540505[_0x3c505d(0x2a9)]+_0x3c505d(0x2b4)+_0x244f52,_0x193316);}for(const _0x5e39e of _0x540505[_0x3c505d(0x1d3)]){try{if(_0x5e39e[_0x3c505d(0x272)]===_0x3c505d(0x260)&&_0x5e39e[_0x3c505d(0x29d)]){const _0x5a84c3=yamlActivationToCreateRequest(_0x5e39e[_0x3c505d(0x29d)],_0x47b79c,_0x174bb4);await withSpinner(_0x3c505d(0x20e)+_0x5e39e['name']+'\x27...',()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x206)](_0x4d869e,_0x15c914,_0x5a84c3),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]}),console[_0x3c505d(0x212)](a35_0x775e6['green'](_0x3c505d(0x285)+_0x5e39e[_0x3c505d(0x21f)]+'\x27')),_0x436294++;}else{if(_0x5e39e['type']===_0x3c505d(0x23e)&&_0x5e39e[_0x3c505d(0x29d)]&&_0x5e39e[_0x3c505d(0x20c)]){const _0x86e37a=yamlActivationToUpdateRequest(_0x5e39e['yamlActivation'],_0x47b79c,_0x174bb4);await withSpinner(_0x3c505d(0x201)+_0x5e39e[_0x3c505d(0x21f)]+'\x27...',()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x1e6)](_0x4d869e,_0x15c914,_0x5e39e[_0x3c505d(0x20c)]['id'],_0x86e37a),{'verbose':_0x5a4305[_0x3c505d(0x1e0)]}),console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x1da)](_0x3c505d(0x22c)+_0x5e39e[_0x3c505d(0x21f)]+'\x27')),_0x289af1++;}else _0x5e39e['type']===_0x3c505d(0x1d4)&&_0x5e39e[_0x3c505d(0x20c)]&&(await withSpinner(_0x3c505d(0x274)+_0x5e39e['name']+'\x27...',()=>_0x478b93[_0x3c505d(0x1d7)][_0x3c505d(0x228)](_0x4d869e,_0x15c914,_0x5e39e[_0x3c505d(0x20c)]['id']),{'verbose':_0x5a4305['verbose']}),console[_0x3c505d(0x212)](a35_0x775e6['red'](_0x3c505d(0x24e)+_0x5e39e['name']+'\x27')),_0x1b46a8++);}}catch(_0x43fab6){const _0x45b6ab=isHttp400Error(_0x43fab6),_0x2e794c=_0x45b6ab?ErrorCode[_0x3c505d(0x290)]:ErrorCode[_0x3c505d(0x214)],_0x3439ff=getErrorMessage(_0x43fab6);throw new SDKError(_0x2e794c,'Failed\x20to\x20'+_0x5e39e[_0x3c505d(0x272)]+_0x3c505d(0x2ad)+_0x5e39e[_0x3c505d(0x21f)]+_0x3c505d(0x1fe)+_0x540505[_0x3c505d(0x2a9)]+_0x3c505d(0x2b4)+_0x3439ff,_0x43fab6);}}}for(const _0x413e75 of _0x5a4305['journeysOnly']?[]:_0x271870){await withSpinner(_0x3c505d(0x25e)+_0x413e75[_0x3c505d(0x21f)]+_0x3c505d(0x257),()=>_0x478b93['segment']['deleteSegment'](_0x413e75['id']),{'verbose':_0x5a4305['verbose']}),console[_0x3c505d(0x212)](a35_0x775e6['red']('✔\x20Deleted\x20segment\x20\x27'+_0x413e75['name']+'\x27')),_0x6aa33f++;}let _0x4617db=0x0,_0x2fa3fa=0x0,_0x551c9d=0x0;const _0x2c78c3=new Map(_0x132bf0);for(const _0x1538be of _0x4db0e2){_0x1538be[_0x3c505d(0x1f3)]&&_0x20bf67['has'](_0x1538be[_0x3c505d(0x210)][_0x3c505d(0x21f)])&&_0x2c78c3[_0x3c505d(0x24b)](_0x1538be[_0x3c505d(0x210)]['name'],_0x20bf67['get'](_0x1538be[_0x3c505d(0x210)][_0x3c505d(0x21f)]));}if(_0x28a2ab['length']>0x0){const _0x53219c=await withQuerySpinner(_0x3c505d(0x218),async _0x14c8ce=>{const _0x445fbf=_0x3c505d,_0x5973b4=[];let _0x5378a7=0x0;const _0x5115f2=0x5;for(let _0x557f81=0x0;_0x557f81<_0x28a2ab['length'];_0x557f81+=_0x5115f2){const _0x40654e=_0x28a2ab['slice'](_0x557f81,_0x557f81+_0x5115f2),_0x18e383=await Promise[_0x445fbf(0x222)](_0x40654e[_0x445fbf(0x22f)](async _0x202d39=>{const _0x51d373=_0x445fbf;if(!_0x202d39['isNew']&&!_0x202d39[_0x51d373(0x24c)])return{'action':_0x51d373(0x284),'name':_0x202d39['yamlConfig'][_0x51d373(0x21f)],'journeyId':_0x202d39['existingJourney']?.['id']};const _0x1d4852=_0x202d39[_0x51d373(0x2ac)]?_0x4a10a0['get'](_0x202d39[_0x51d373(0x2ac)]):undefined,_0x1ffc07=_0x202d39[_0x51d373(0x1f3)]?_0x51d373(0x21a):_0x51d373(0x215);_0x14c8ce[_0x51d373(0x26d)](_0x1ffc07+_0x51d373(0x265)+_0x202d39[_0x51d373(0x210)][_0x51d373(0x21f)]+'\x27');const _0x4ccd0e=new Map(),_0x4aacff=new Map(),_0x36153b=new Map(),_0x53a98c={'resolveSegmentId':async _0x1decc9=>{const _0x411494=_0x51d373,_0x3b1534=_0x2c78c3[_0x411494(0x231)](_0x1decc9);if(!_0x3b1534)throw new SDKError(ErrorCode[_0x411494(0x26b)],_0x411494(0x1fc)+_0x1decc9+_0x411494(0x208)+_0x202d39[_0x411494(0x210)][_0x411494(0x21f)]+')');return _0x3b1534;},'resolveEmbeddedSegmentId':async(_0x4bdf9e,_0x421929)=>{const _0x55f3b9=_0x51d373,_0x1aef70=_0x2c78c3[_0x55f3b9(0x231)](_0x4bdf9e);if(_0x1aef70)return _0x1aef70;const _0x150aa7=_0x284777['find'](_0x377522=>_0x377522[_0x55f3b9(0x21f)]===_0x4bdf9e);if(_0x150aa7)return _0x2c78c3[_0x55f3b9(0x24b)](_0x4bdf9e,_0x150aa7['id']),_0x150aa7['id'];if(_0x202d39[_0x55f3b9(0x1f3)]){const _0xf65d32=_0x202d39[_0x55f3b9(0x210)][_0x55f3b9(0x250)]||_0x202d39['yamlConfig'][_0x55f3b9(0x1d5)]?.[0x0]?.[_0x55f3b9(0x250)]||[];let _0x285eb8='entry',_0x50ea3a=_0x4bdf9e;for(const _0x40bd95 of _0xf65d32){if(_0x40bd95[_0x55f3b9(0x28b)]?.[_0x55f3b9(0x1d7)]===_0x4bdf9e){_0x285eb8=_0x40bd95[_0x55f3b9(0x21f)],_0x50ea3a=_0x40bd95['entry_criteria'][_0x55f3b9(0x21f)]||_0x4bdf9e;break;}}return _0x4aacff[_0x55f3b9(0x24b)](_0x4bdf9e,{'definition':_0x421929,'stageName':_0x285eb8,'criteriaName':_0x50ea3a}),createPendingSegmentId(_0x4bdf9e);}const _0x298598=_0x202d39[_0x55f3b9(0x1e7)]?.['id'];if(!_0x298598)throw new SDKError(ErrorCode[_0x55f3b9(0x233)],_0x55f3b9(0x2ae));const _0x5e5457=_0x55f3b9(0x21c)+crypto['randomUUID']();try{const _0x266cbc=await _0x478b93['segment'][_0x55f3b9(0x269)]({'name':_0x5e5457,'description':_0x421929['description']||'Entry\x20criteria:\x20'+_0x4bdf9e,'journeyId':_0x298598,'rule':yamlRuleToApi(_0x421929[_0x55f3b9(0x23c)],!![]),'countPopulation':!![],'parentFolderId':_0x326beb||'','audienceId':_0x4d869e});return _0x5a4305['verbose']&&console[_0x55f3b9(0x212)](_0x55f3b9(0x2a4)+_0x4bdf9e+_0x55f3b9(0x24d)+_0x5e5457+_0x55f3b9(0x22d)+_0x266cbc),_0x2c78c3[_0x55f3b9(0x24b)](_0x4bdf9e,_0x266cbc),_0x266cbc;}catch(_0x2784e1){throw new SDKError(ErrorCode[_0x55f3b9(0x255)],_0x55f3b9(0x247)+_0x4bdf9e+_0x55f3b9(0x235)+getErrorMessage(_0x2784e1),_0x2784e1);}},'resolveActivationId':async _0x10a1ce=>{const _0x40fb12=_0x51d373,_0x5874eb=_0x4ccd0e['get'](_0x10a1ce);if(_0x5874eb)return _0x5874eb;if(_0x202d39[_0x40fb12(0x1e7)]){const _0x1fdd53=await _0x478b93['journey'][_0x40fb12(0x246)](_0x202d39['existingJourney']['id']),_0x2b0396=_0x1fdd53['find'](_0x36c2a5=>_0x36c2a5[_0x40fb12(0x1e1)][_0x40fb12(0x1ee)]?.['name']===_0x10a1ce);if(_0x2b0396)return _0x4ccd0e[_0x40fb12(0x24b)](_0x10a1ce,_0x2b0396['id']),_0x2b0396['id'];}throw new SDKError(ErrorCode[_0x40fb12(0x1d1)],_0x40fb12(0x1cf)+_0x10a1ce+_0x40fb12(0x208)+_0x202d39['yamlConfig'][_0x40fb12(0x21f)]+').\x20'+_0x40fb12(0x2ab));},'resolveEmbeddedActivationId':async(_0x21b434,_0xc500d5)=>{const _0x380a97=_0x51d373,_0x50884d=_0x4ccd0e[_0x380a97(0x231)](_0x21b434);if(_0x50884d)return _0x50884d;if(_0x202d39[_0x380a97(0x1f3)])return _0x36153b[_0x380a97(0x24b)](_0x21b434,_0xc500d5),createPendingActivationId(_0x21b434);if(_0x202d39[_0x380a97(0x1e7)]){const _0x34a503=await _0x478b93[_0x380a97(0x1df)]['listActivations'](_0x202d39[_0x380a97(0x1e7)]['id']),_0x1b5bab=_0x34a503[_0x380a97(0x20d)](_0x5e6d3b=>_0x5e6d3b['attributes'][_0x380a97(0x1ee)]?.['name']===_0xc500d5[_0x380a97(0x21f)]);if(_0x1b5bab)return _0x4ccd0e[_0x380a97(0x24b)](_0x21b434,_0x1b5bab['id']),_0x1b5bab['id'];try{const _0x902071=yamlActivationToCreateRequest(_0xc500d5,_0x47b79c,_0x174bb4),_0x2ac626=await _0x478b93['journey'][_0x380a97(0x206)](_0x202d39[_0x380a97(0x1e7)]['id'],_0x902071);return _0x5a4305['verbose']&&console[_0x380a97(0x212)]('\x20\x20Created\x20embedded\x20activation\x20\x27'+_0x21b434+_0x380a97(0x263)+_0x2ac626['id']),_0x4ccd0e[_0x380a97(0x24b)](_0x21b434,_0x2ac626['id']),_0x2ac626['id'];}catch(_0x223c99){throw new SDKError(ErrorCode[_0x380a97(0x28e)],'Failed\x20to\x20create\x20embedded\x20activation\x20\x27'+_0x21b434+_0x380a97(0x235)+getErrorMessage(_0x223c99),_0x223c99);}}throw new SDKError(ErrorCode[_0x380a97(0x233)],_0x380a97(0x22e));},'resolveJourneyId':async _0x4bb716=>{const _0x5964df=_0x51d373;try{return await _0x478b93[_0x5964df(0x1df)]['resolveJourneyId'](_0x4d869e,_0x4bb716);}catch(_0x2bc19a){throw new SDKError(ErrorCode[_0x5964df(0x1d1)],'Journey\x20\x27'+_0x4bb716+_0x5964df(0x243)+_0x202d39[_0x5964df(0x210)][_0x5964df(0x21f)]+'\x27)',_0x2bc19a);}},'resolveStageId':async(_0x4b5b51,_0x440d56)=>{const _0x2f4c70=_0x51d373,_0x5b9264=await _0x478b93['journey']['getJourney'](_0x4b5b51),_0x4cba6b=_0x5b9264['attributes'][_0x2f4c70(0x29e)][_0x2f4c70(0x20d)](_0x548b14=>_0x548b14['name']['toLowerCase']()===_0x440d56[_0x2f4c70(0x1de)]());if(!_0x4cba6b?.['id'])throw new SDKError(ErrorCode[_0x2f4c70(0x1d1)],_0x2f4c70(0x1fd)+_0x440d56+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x5b9264[_0x2f4c70(0x1e1)][_0x2f4c70(0x234)]||_0x5b9264['attributes'][_0x2f4c70(0x21f)])+'\x27');return _0x4cba6b['id'];}};try{const _0x46f7de=await a35_0x39979b(_0x202d39[_0x51d373(0x210)],_0x4d869e,_0x53a98c),_0xd7cd0f=_0x1d4852||_0x326beb;_0xd7cd0f&&(_0x46f7de['relationships']={'parentFolder':{'data':{'id':_0xd7cd0f,'type':_0x51d373(0x1f5)}}});if(_0x202d39[_0x51d373(0x1f3)]){if(_0x4aacff[_0x51d373(0x221)]>0x0||_0x36153b[_0x51d373(0x221)]>0x0){const _0x11c05b=JSON['parse'](JSON[_0x51d373(0x299)](_0x46f7de));ensureJourneyDefaults(_0x11c05b['attributes']);for(const _0x4d69c8 of _0x11c05b['attributes'][_0x51d373(0x29e)]){_0x4d69c8['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x4d69c8['entryCriteria']['segmentId'])&&delete _0x4d69c8['entryCriteria'];if(_0x4d69c8[_0x51d373(0x29b)])for(const _0x973f8d of Object['keys'](_0x4d69c8[_0x51d373(0x29b)])){const _0x17c550=_0x4d69c8[_0x51d373(0x29b)][_0x973f8d];_0x17c550[_0x51d373(0x272)]===_0x51d373(0x282)&&_0x17c550[_0x51d373(0x1cb)]&&isPendingActivationId(_0x17c550[_0x51d373(0x1cb)])&&(_0x17c550[_0x51d373(0x1cb)]='');if(_0x17c550[_0x51d373(0x272)]===_0x51d373(0x1ff)&&_0x17c550[_0x51d373(0x1f1)])for(const _0x3086c8 of _0x17c550['branches']){_0x3086c8[_0x51d373(0x26e)]&&isPendingSegmentId(_0x3086c8['segmentId'])&&(_0x3086c8[_0x51d373(0x26e)]='');}}}_0x5a4305[_0x51d373(0x1e0)]&&console[_0x51d373(0x212)](_0x51d373(0x1e8)+JSON['stringify'](_0x11c05b,null,0x2));const _0x3df753=await _0x478b93[_0x51d373(0x1df)][_0x51d373(0x260)](_0x11c05b),_0x19dfa3=_0x3df753['id'],_0x392fd1=new Map();for(const _0x4c49d7 of _0x3df753[_0x51d373(0x1e1)]['journeyStages']){_0x392fd1['set'](_0x4c49d7[_0x51d373(0x21f)][_0x51d373(0x1de)](),_0x4c49d7['id']);}const _0x38b795=new Map();for(const [_0x4293cf,{definition:_0x1f1bc1,criteriaName:_0x18634b}]of _0x4aacff){const _0x2771b0=generateJourneyLocalName(_0x18634b)||'journey_entry_criteria_'+crypto[_0x51d373(0x268)]();_0x5a4305[_0x51d373(0x1e0)]&&console[_0x51d373(0x212)](_0x51d373(0x1e5)+_0x4293cf+_0x51d373(0x24d)+_0x2771b0+')\x20with\x20journeyId:\x20'+_0x19dfa3);const _0x412011=await _0x478b93[_0x51d373(0x1d7)][_0x51d373(0x269)]({'name':_0x2771b0,'description':_0x1f1bc1[_0x51d373(0x204)]||_0x51d373(0x24a)+_0x4293cf,'journeyId':_0x19dfa3,'rule':yamlRuleToApi(_0x1f1bc1['rule'],!![]),'countPopulation':!![],'parentFolderId':_0xd7cd0f||'','audienceId':_0x4d869e});_0x38b795['set'](_0x4293cf,_0x412011),_0x2c78c3[_0x51d373(0x24b)](_0x4293cf,_0x412011),_0x5a4305['verbose']&&console[_0x51d373(0x212)](_0x51d373(0x2a4)+_0x4293cf+_0x51d373(0x263)+_0x412011);}const _0x35935e=new Map();for(const [_0x54c738,_0x2cbaf3]of _0x36153b){_0x5a4305[_0x51d373(0x1e0)]&&console['error'](_0x51d373(0x237)+_0x54c738+'\x27\x20with\x20journeyId:\x20'+_0x19dfa3);try{const _0xcaf082=yamlActivationToCreateRequest(_0x2cbaf3,_0x47b79c,_0x174bb4),_0xe127c=await _0x478b93[_0x51d373(0x1df)][_0x51d373(0x206)](_0x19dfa3,_0xcaf082);_0x35935e['set'](_0x54c738,_0xe127c['id']),_0x4ccd0e['set'](_0x54c738,_0xe127c['id']),_0x5a4305[_0x51d373(0x1e0)]&&console[_0x51d373(0x212)](_0x51d373(0x258)+_0x54c738+'\x27\x20with\x20ID:\x20'+_0xe127c['id']);}catch(_0x46397f){throw new SDKError(ErrorCode[_0x51d373(0x28e)],_0x51d373(0x1e4)+_0x54c738+_0x51d373(0x235)+getErrorMessage(_0x46397f),_0x46397f);}}const _0x4d0c61=JSON[_0x51d373(0x225)](JSON['stringify'](_0x46f7de));_0x4d0c61['id']=_0x19dfa3,ensureJourneyDefaults(_0x4d0c61['attributes']);for(const _0x4b8f15 of _0x4d0c61[_0x51d373(0x1e1)][_0x51d373(0x29e)]){const _0x3499a2=_0x392fd1['get'](_0x4b8f15[_0x51d373(0x21f)][_0x51d373(0x1de)]());_0x3499a2&&(_0x4b8f15['id']=_0x3499a2);if(_0x4b8f15[_0x51d373(0x2a5)]?.[_0x51d373(0x26e)]&&isPendingSegmentId(_0x4b8f15[_0x51d373(0x2a5)][_0x51d373(0x26e)])){const _0x427978=extractPendingSegmentName(_0x4b8f15[_0x51d373(0x2a5)][_0x51d373(0x26e)]),_0x5688bc=_0x38b795['get'](_0x427978);_0x5688bc&&(_0x4b8f15['entryCriteria']['segmentId']=_0x5688bc);}if(_0x4b8f15[_0x51d373(0x29b)]){const _0x1b20dd=_0x3e1b96=>_0x46f7de['attributes'][_0x51d373(0x29e)]['find'](_0x40b02d=>_0x40b02d[_0x51d373(0x21f)][_0x51d373(0x1de)]()===_0x4b8f15[_0x51d373(0x21f)]['toLowerCase']())?.[_0x51d373(0x29b)]?.[_0x3e1b96];for(const _0x5b5281 of Object[_0x51d373(0x200)](_0x4b8f15['steps'])){const _0x51bddb=_0x4b8f15[_0x51d373(0x29b)][_0x5b5281],_0x4de2c9=_0x1b20dd(_0x5b5281);if(_0x51bddb[_0x51d373(0x272)]==='Activation'&&_0x51bddb[_0x51d373(0x1cb)]&&(isPendingActivationId(_0x51bddb[_0x51d373(0x1cb)])||_0x51bddb[_0x51d373(0x1cb)]==='')){if(_0x4de2c9?.['journeyActivationStepId']&&isPendingActivationId(_0x4de2c9[_0x51d373(0x1cb)])){const _0x580626=extractPendingActivationName(_0x4de2c9[_0x51d373(0x1cb)]),_0x2ac1f7=_0x35935e[_0x51d373(0x231)](_0x580626);_0x2ac1f7&&(_0x51bddb['journeyActivationStepId']=_0x2ac1f7);}}if(_0x51bddb[_0x51d373(0x272)]===_0x51d373(0x1ff)&&_0x51bddb[_0x51d373(0x1f1)]&&_0x4de2c9?.[_0x51d373(0x1f1)])for(let _0x55fe27=0x0;_0x55fe27<_0x51bddb['branches']['length'];_0x55fe27++){const _0x4022e4=_0x51bddb['branches'][_0x55fe27],_0x1c2ba0=_0x4de2c9['branches'][_0x55fe27];if(_0x1c2ba0?.[_0x51d373(0x26e)]&&isPendingSegmentId(_0x1c2ba0['segmentId'])){const _0x48b71b=extractPendingSegmentName(_0x1c2ba0[_0x51d373(0x26e)]),_0x380988=_0x38b795['get'](_0x48b71b);_0x380988&&(_0x4022e4[_0x51d373(0x26e)]=_0x380988);}}}}}return _0x5a4305[_0x51d373(0x1e0)]&&console[_0x51d373(0x212)]('\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20'+JSON[_0x51d373(0x299)](_0x4d0c61,null,0x2)),await _0x478b93[_0x51d373(0x1df)]['update'](_0x19dfa3,_0x4d0c61),{'action':_0x51d373(0x226),'name':_0x202d39['yamlConfig'][_0x51d373(0x21f)],'journeyId':_0x19dfa3};}else{ensureJourneyDefaults(_0x46f7de['attributes']);_0x5a4305[_0x51d373(0x1e0)]&&console[_0x51d373(0x212)]('\x20\x20Journey\x20API\x20request:\x20'+JSON[_0x51d373(0x299)](_0x46f7de,null,0x2));const _0x3a38d9=await _0x478b93[_0x51d373(0x1df)][_0x51d373(0x260)](_0x46f7de);return{'action':_0x51d373(0x226),'name':_0x202d39[_0x51d373(0x210)][_0x51d373(0x21f)],'journeyId':_0x3a38d9['id']};}}else{if(_0x202d39[_0x51d373(0x24c)]&&_0x202d39[_0x51d373(0x1e7)])return ensureJourneyDefaults(_0x46f7de['attributes']),await _0x478b93[_0x51d373(0x1df)]['update'](_0x202d39[_0x51d373(0x1e7)]['id'],_0x46f7de),{'action':'updated','name':_0x202d39[_0x51d373(0x210)]['name'],'journeyId':_0x202d39[_0x51d373(0x1e7)]['id']};}return{'action':_0x51d373(0x284),'name':_0x202d39['yamlConfig'][_0x51d373(0x21f)],'journeyId':_0x202d39[_0x51d373(0x1e7)]?.['id']};}catch(_0x38148f){const _0x4a2e8e=isHttp400Error(_0x38148f),_0x4d8425=_0x4a2e8e?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x51d373(0x28e)],_0x3036f0=getErrorMessage(_0x38148f);throw new SDKError(_0x4d8425,_0x51d373(0x251)+(_0x202d39[_0x51d373(0x1f3)]?_0x51d373(0x260):'update')+'\x20journey\x20from\x20file:\x20'+_0x202d39[_0x51d373(0x2a9)]+_0x51d373(0x2b4)+_0x3036f0,_0x38148f);}}));_0x5973b4[_0x445fbf(0x20b)](..._0x18e383),_0x5378a7+=_0x40654e[_0x445fbf(0x278)],_0x14c8ce[_0x445fbf(0x29f)]('('+_0x5378a7+'/'+_0x28a2ab['length']+')');}return _0x5973b4;},{'verbose':_0x5a4305[_0x3c505d(0x1e0)]});for(const _0x876014 of _0x53219c['data']){if(_0x876014[_0x3c505d(0x2b8)]===_0x3c505d(0x226))console['error'](a35_0x775e6[_0x3c505d(0x1fb)](_0x3c505d(0x25d)+_0x876014[_0x3c505d(0x21f)]+'\x27')),_0x4617db++;else _0x876014['action']==='updated'&&(console['error'](a35_0x775e6['yellow'](_0x3c505d(0x28a)+_0x876014[_0x3c505d(0x21f)]+'\x27')),_0x2fa3fa++);}if(_0x5a076f&&_0x53219c[_0x3c505d(0x240)]['length']===0x1){const _0x2a633e=_0x53219c[_0x3c505d(0x240)][0x0];if(_0x2a633e[_0x3c505d(0x1f8)]){const _0x14948c=getConsoleNextUrl(_0x5a4305[_0x3c505d(0x217)],_0x3c505d(0x1d0)+_0x4d869e+'/e/'+_0x2a633e[_0x3c505d(0x1f8)]+_0x3c505d(0x25c));console[_0x3c505d(0x212)]('\x20\x20'+a35_0x775e6[_0x3c505d(0x216)](_0x14948c));}}}for(const _0x2cce66 of _0x495a5f){console[_0x3c505d(0x212)](a35_0x775e6[_0x3c505d(0x1da)](_0x3c505d(0x270)+_0x2cce66['journeyBundleName'])),_0x551c9d++;}const _0x5983ff=[];if(_0x532bfe>0x0)_0x5983ff['push'](_0x532bfe+_0x3c505d(0x293));if(_0x338d4f>0x0)_0x5983ff['push'](_0x338d4f+_0x3c505d(0x26a));if(_0x6aa33f>0x0)_0x5983ff[_0x3c505d(0x20b)](_0x6aa33f+_0x3c505d(0x25f));const _0x53e4ad=[];if(_0x4617db>0x0)_0x53e4ad[_0x3c505d(0x20b)](_0x4617db+_0x3c505d(0x293));if(_0x2fa3fa>0x0)_0x53e4ad[_0x3c505d(0x20b)](_0x2fa3fa+'\x20updated');if(_0x551c9d>0x0)_0x53e4ad['push'](_0x551c9d+'\x20deleted');const _0x313f1c=[];if(_0x436294>0x0)_0x313f1c[_0x3c505d(0x20b)](_0x436294+_0x3c505d(0x293));if(_0x289af1>0x0)_0x313f1c['push'](_0x289af1+_0x3c505d(0x26a));if(_0x1b46a8>0x0)_0x313f1c[_0x3c505d(0x20b)](_0x1b46a8+_0x3c505d(0x25f));return console[_0x3c505d(0x212)](a35_0x775e6['green']('\x0a✔\x20Push\x20complete')),_0x5983ff[_0x3c505d(0x278)]>0x0&&!_0x5a4305[_0x3c505d(0x223)]&&console[_0x3c505d(0x212)](_0x3c505d(0x23d)+_0x5983ff[_0x3c505d(0x2a6)](',\x20')),_0x53e4ad['length']>0x0&&console[_0x3c505d(0x212)](_0x3c505d(0x2a2)+_0x53e4ad[_0x3c505d(0x2a6)](',\x20')),_0x313f1c['length']>0x0&&!_0x5a4305[_0x3c505d(0x223)]&&console[_0x3c505d(0x212)]('\x20\x20Activations:\x20'+_0x313f1c[_0x3c505d(0x2a6)](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x324b06){const _0x24132b=a35_0x502313,_0x311089=new Map(),_0x14c280=new Map();for(const _0x3a2761 of _0x324b06){_0x14c280['set'](_0x3a2761['id'],_0x3a2761);}const _0x3998db=new Set();for(const _0x355cd8 of _0x324b06){!_0x355cd8[_0x24132b(0x298)]&&_0x3998db[_0x24132b(0x1f6)](_0x355cd8['id']);}function _0x5b86a5(_0x208f03){const _0x3a7d4a=_0x24132b;if(_0x3998db[_0x3a7d4a(0x271)](_0x208f03['id']))return'';if(_0x208f03[_0x3a7d4a(0x298)]){const _0x1c2b95=_0x14c280[_0x3a7d4a(0x231)](_0x208f03['parentFolderId']);if(_0x1c2b95){const _0x111a5a=_0x5b86a5(_0x1c2b95);return _0x111a5a?_0x111a5a+'/'+_0x208f03[_0x3a7d4a(0x21f)]:_0x208f03[_0x3a7d4a(0x21f)];}}return _0x208f03[_0x3a7d4a(0x21f)];}for(const _0x234d39 of _0x324b06){const _0x16866a=_0x5b86a5(_0x234d39);_0x311089[_0x24132b(0x24b)](_0x16866a,_0x234d39['id']);}return _0x311089;}function findYamlFiles(_0x469ef8){const _0x1ff7fb=[];function _0x510946(_0x29eed4){const _0x232f7d=a35_0x55dd,_0x59feed=readdirSync(_0x29eed4,{'withFileTypes':!![]});for(const _0x47bfec of _0x59feed){const _0x43018c=a35_0x2e958f[_0x232f7d(0x2a6)](_0x29eed4,_0x47bfec[_0x232f7d(0x21f)]);if(_0x47bfec['isDirectory']())_0x510946(_0x43018c);else(_0x47bfec[_0x232f7d(0x21f)][_0x232f7d(0x25b)](_0x232f7d(0x2aa))||_0x47bfec['name'][_0x232f7d(0x25b)](_0x232f7d(0x1ed)))&&_0x1ff7fb[_0x232f7d(0x20b)](_0x43018c);}}return _0x510946(_0x469ef8),_0x1ff7fb;}function calculateActivationActions(_0x38bbcd,_0x303646,_0x592579,_0x341f19){const _0x99b1aa=a35_0x502313,_0xa9e90=[],_0x5000ea=new Map();for(const _0x445c31 of _0x303646){_0x5000ea[_0x99b1aa(0x24b)](_0x445c31[_0x99b1aa(0x21f)],_0x445c31);}const _0x519d8c=new Map();for(const _0x2313a1 of _0x38bbcd){_0x519d8c[_0x99b1aa(0x24b)](_0x2313a1[_0x99b1aa(0x21f)],_0x2313a1);}for(const _0x652125 of _0x38bbcd){const _0x46e228=_0x5000ea[_0x99b1aa(0x231)](_0x652125['name']);if(!_0x46e228)_0xa9e90['push']({'type':'create','name':_0x652125[_0x99b1aa(0x21f)],'yamlActivation':_0x652125});else{const _0x54cae0=activationToYaml(_0x46e228,_0x592579,_0x341f19),_0x227983=a35_0x2c3d0b['stringify'](_0x54cae0),_0x26e287=a35_0x2c3d0b['stringify'](_0x652125);_0x227983!==_0x26e287&&_0xa9e90[_0x99b1aa(0x20b)]({'type':_0x99b1aa(0x23e),'name':_0x652125[_0x99b1aa(0x21f)],'yamlActivation':_0x652125,'existingActivation':_0x46e228});}}for(const _0x4ac68b of _0x303646){!_0x519d8c[_0x99b1aa(0x271)](_0x4ac68b['name'])&&_0xa9e90['push']({'type':_0x99b1aa(0x1d4),'name':_0x4ac68b['name'],'existingActivation':_0x4ac68b});}return _0xa9e90;}
|
|
1
|
+
const a36_0x22d99d=a36_0x6dbb;(function(_0x1cfc3f,_0x57bfa5){const _0x3c1e84=a36_0x6dbb,_0x34f2f6=_0x1cfc3f();while(!![]){try{const _0x37d78c=-parseInt(_0x3c1e84(0x154))/0x1*(parseInt(_0x3c1e84(0x14c))/0x2)+parseInt(_0x3c1e84(0xe8))/0x3*(-parseInt(_0x3c1e84(0x100))/0x4)+-parseInt(_0x3c1e84(0x175))/0x5+parseInt(_0x3c1e84(0x144))/0x6+parseInt(_0x3c1e84(0x107))/0x7*(parseInt(_0x3c1e84(0x1da))/0x8)+parseInt(_0x3c1e84(0x199))/0x9+parseInt(_0x3c1e84(0x137))/0xa;if(_0x37d78c===_0x57bfa5)break;else _0x34f2f6['push'](_0x34f2f6['shift']());}catch(_0x4017cf){_0x34f2f6['push'](_0x34f2f6['shift']());}}}(a36_0x3765,0x47653));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../sdk/errors.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,findTdxConfig}from'../utils/tdx-config.js';import{segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,yamlToCreateRequest,yamlToUpdateRequest,yamlActivationToCreateRequest,yamlActivationToUpdateRequest,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a36_0x50afac,yamlToApi as a36_0x16c25f,toYamlString as a36_0x9eee8b,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';import a36_0x572dba from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a36_0x1f36c2 from'path';import{getConsoleNextUrl}from'../types/endpoints.js';import*as a36_0x34bb63 from'yaml';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';const PENDING_SEGMENT_PREFIX=a36_0x22d99d(0x162);function createPendingSegmentId(_0xc5c63e){return''+PENDING_SEGMENT_PREFIX+_0xc5c63e+'__';}function isPendingSegmentId(_0x103207){const _0x4df96f=a36_0x22d99d;return _0x103207[_0x4df96f(0x16f)](PENDING_SEGMENT_PREFIX);}function extractPendingSegmentName(_0x541735){const _0x115258=a36_0x22d99d;return _0x541735[_0x115258(0x131)](/^__pending_(.+)__$/,'$1');}function a36_0x6dbb(_0x11cc66,_0x4a7acc){_0x11cc66=_0x11cc66-0xdf;const _0x376540=a36_0x3765();let _0x6dbb91=_0x376540[_0x11cc66];return _0x6dbb91;}function a36_0x3765(){const _0x369238=['setPhase','red','folderPath','Pushing\x20journeys...','then','flatMap','SEGMENT_UPDATE_ERROR','map','getActivation',')\x20with\x20journeyId:\x20','hasChanges','updated','resolveJourneyId','journey','stages','\x27\x20(internal:\x20','\x20\x20Journeys:\x20','all','\x20\x20Source:\x20','parent_segment','endsWith','parentFolderId','deleteSegment','\x20changed','rule','unchanged','buildNameToIdMap','Failed\x20to\x20','No\x20','journeyActivationStepId','269532GCvqMO','has','isNew','journey_entry_criteria_','yellow','kind','✔\x20Created\x20journey\x20\x27','filter','\x27\x20with\x20ID:\x20','dryRun','entries','existingSegment','INTERNAL','absolutePath','\x27\x20not\x20found\x20in\x20journey\x20\x27','delete','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20\x20🗺️\x20\x20Journeys:','find','\x20\x20Created\x20embedded\x20segment\x20\x27','ACTIVATION_UPDATE_ERROR','Creating\x20segment\x20\x27','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20folders\x20to\x20create','diff','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','isDirectory','Site:\x20','\x27\x20from\x20file:\x20','.yml','\x20updated','Delete\x20segment:','segmentFolderId','journeyBundleName','join','\x20\x20✔\x20Updated\x20activation\x20\x27','config','buildIdToNameMap','\x20unchanged','activationActions','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','.yaml','resolveParentId','max','\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27','\x0a\x20\x20','\x20to\x20update','JOURNEY_UPDATE_ERROR','get','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Fetching\x20existing\x20folders...','action','add','listJourneysFromParentSegment','Parent\x20segment:\x20','\x20\x20Journey\x20API\x20request:\x20','journeys','\x27\x20v','getSegment','activations','\x20\x20Created\x20embedded\x20activation\x20\x27','execute','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','/app/ps/','Failed\x20to\x20create\x20embedded\x20segment\x20\x27','16664AqnJcp','toString','Updating\x20segment\x20\x27','buildUserMaps','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','entry_criteria','push','\x20(referenced\x20in\x20journey\x20','Creating\x20folder\x20\x27','Entry\x20criteria:\x20','randomUUID','create','1599dyRhVC','\x0a✔\x20Push\x20complete','\x27:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','description','NOT_FOUND','Fetching\x20journey\x20\x27','keys','steps','\x20\x20✔\x20Created\x20activation\x20\x27','...','existingJourney','Push\x20','versionNumber','\x20journey\x20\x27','cyan','split','segment\x20or\x20journey','createFolder','\x20new','stringify','user','utf-8','created','4332eAyUSO','JOURNEY_SYNTAX_ERROR','getParent','\x20to\x20create','segmentId','size','state','217auUrLF','__pending_act_','SEGMENT_SYNTAX_ERROR','activationParams','toLowerCase','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Resolving\x20parent\x20segment\x20\x27','type','\x20\x20✔\x20Deleted\x20activation\x20\x27','green','Scoped\x20to\x20folder:\x20','configDir','createJourneySegment','yamlActivation','createSegment','Changes\x20to\x20journey:','✔\x20Updated\x20journey\x20\x27','Updating\x20activation\x20\x27','set','✔\x20Created\x20folder\x20\x27','\x20activations]','getJourney','Updating','dim','segment:push','resolve','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Deleting\x20segment\x20\x27','\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27','entry','folderId','blue','✔\x20Deleted\x20segment\x20\x27','journeyId','Activation\x20not\x20found:\x20','sort','Journey\x20\x27','length','\x20deleted','repeat','\x27...','Stage\x20\x27','replace','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','site','\x20segment\x20from\x20file:\x20','verbose','Delete\x20journey:','10263140SfsZEo','existingActivation',').\x20','New\x20segment:','Fetching\x20existing\x20journeys...','data','relationships','yes','/e/','Deleting\x20activation\x20\x27','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','DecisionPoint','\x20created','1470522ScihWO','\x20\x20Activations:','branches','\x20to\x20delete','ACTIVATION_SYNTAX_ERROR','entryCriteria','parentFolder','parentSegmentFolder','860578kUVjRR','listFolders','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','error','Changes\x20to:','\x20\x20📊\x20Segments:','attributes','\x20journey\x20from\x20file:\x20','1DpkZIg','connection','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20Activations:\x20','listActivations','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','cwd','values','yamlConfig','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','dirname','journeyStages','update','Segment\x20not\x20found:\x20','__pending_','relative','deleteActivation','\x27\x20details...','Activation','listSegments','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x20\x20\x20\x20','createActivation','parentSegment','\x20\x20Segments:\x20','segment','\x0aPush\x20summary\x20for\x20\x27','startsWith','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','slice','name','Fetching\x20parent\x20segment\x20details...','Aborted.','329795iJlQDO','journeysOnly','Error\x20parsing\x20','isFile','\x27\x20with\x20journeyId:\x20','Creating'];a36_0x3765=function(){return _0x369238;};return a36_0x3765();}const PENDING_ACTIVATION_PREFIX=a36_0x22d99d(0x108);function createPendingActivationId(_0x47ee45){return''+PENDING_ACTIVATION_PREFIX+_0x47ee45+'__';}function isPendingActivationId(_0x17a4bd){const _0x3e42f4=a36_0x22d99d;return _0x17a4bd[_0x3e42f4(0x16f)](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x466111){return _0x466111['replace'](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0x327274){const _0x1b5a90=a36_0x22d99d;!_0x327274[_0x1b5a90(0xec)]&&(_0x327274['description']=''),!_0x327274[_0x1b5a90(0x106)]&&(_0x327274[_0x1b5a90(0x106)]='draft');}function tryFindTdxConfig(_0x213c0c){try{return findTdxConfig(_0x213c0c);}catch{return null;}}function resolveTDFolderPath(_0x4ec352,_0x460488,_0x5d41e5){if(!_0x460488)return _0x4ec352;return _0x4ec352?_0x5d41e5+'/'+_0x4ec352:_0x5d41e5;}export class SegmentPushCommand extends BaseCommand{[a36_0x22d99d(0x172)]=a36_0x22d99d(0x11f);[a36_0x22d99d(0xec)]=a36_0x22d99d(0x1af);async[a36_0x22d99d(0x1d6)](_0x51ef13){const _0x6547e4=a36_0x22d99d,{options:_0x4cebcb,args:_0x35ff6a,tdx:_0x474725}=_0x51ef13,_0x2fc5ee=_0x4cebcb,_0x480765=_0x4cebcb[_0x6547e4(0x16b)],_0x1e34d3=_0x35ff6a[0x0];let _0x335fe7,_0x3ad140,_0x51f055,_0x3fa3a4;if(_0x1e34d3){if(existsSync(_0x1e34d3)&&statSync(_0x1e34d3)[_0x6547e4(0x1b3)]()){const _0x10339b=tryFindTdxConfig(_0x1e34d3);if(_0x10339b)_0x335fe7=_0x10339b[_0x6547e4(0x1bd)][_0x6547e4(0x18e)],_0x3ad140=_0x1e34d3,_0x51f055=_0x10339b['configDir'];else return console[_0x6547e4(0x14f)](a36_0x572dba['red'](_0x6547e4(0x14e)+_0x1e34d3+'\x0a')),console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0xf7)](_0x6547e4(0xeb))),0x1;}else{if(existsSync(_0x1e34d3)&&statSync(_0x1e34d3)[_0x6547e4(0x178)]()){const _0x377c22=a36_0x1f36c2[_0x6547e4(0x15e)](_0x1e34d3),_0x9a9b84=tryFindTdxConfig(_0x377c22);if(_0x9a9b84)_0x335fe7=_0x9a9b84[_0x6547e4(0x1bd)]['parent_segment'],_0x51f055=_0x9a9b84['configDir'],_0x3ad140=_0x9a9b84[_0x6547e4(0x112)],_0x3fa3a4=a36_0x1f36c2[_0x6547e4(0x120)](_0x1e34d3);else return console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x17c)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x377c22+'\x0a')),console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0xf7)](_0x6547e4(0xeb))),0x1;}else _0x335fe7=_0x1e34d3;}}else{const _0x4c04f3=tryFindTdxConfig(process['cwd']());_0x4c04f3?(_0x335fe7=_0x4c04f3[_0x6547e4(0x1bd)][_0x6547e4(0x18e)],_0x3ad140=process[_0x6547e4(0x15a)](),_0x51f055=_0x4c04f3[_0x6547e4(0x112)]):_0x335fe7=_0x480765;}if(!_0x335fe7)return console['error'](a36_0x572dba['yellow'](_0x6547e4(0x1c1))),console[_0x6547e4(0x14f)](_0x6547e4(0x1b2)),console[_0x6547e4(0x14f)](_0x6547e4(0x156)),console[_0x6547e4(0x14f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file'),0x1;const _0x12beee=_0x3ad140||getSegmentRootDir(sanitizeFileName(_0x335fe7)),_0x26aff5=_0x51f055||_0x12beee,_0x2eff3c=a36_0x1f36c2[_0x6547e4(0x163)](_0x26aff5,_0x12beee),_0x23a0b6=_0x2eff3c!==''&&_0x2eff3c!=='.';if(!existsSync(_0x12beee))return console['error'](a36_0x572dba['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x12beee+'\x0a')),console[_0x6547e4(0x14f)](a36_0x572dba['cyan'](_0x6547e4(0xeb))),0x1;_0x2fc5ee[_0x6547e4(0x135)]&&(console['error'](_0x6547e4(0x1b4)+_0x2fc5ee[_0x6547e4(0x133)]),console[_0x6547e4(0x14f)](_0x6547e4(0x1cf)+_0x335fe7),console['error']('Source\x20directory:\x20'+_0x12beee),_0x23a0b6&&console['error'](_0x6547e4(0x111)+_0x2eff3c));const _0x13403d=await withSpinner(_0x6547e4(0x10d)+_0x335fe7+_0x6547e4(0x12f),()=>_0x474725[_0x6547e4(0x16d)][_0x6547e4(0x1c3)](_0x335fe7),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),_0x47019c=_0x13403d['data'],[_0x5cdcd6,_0x3c7f5b,_0xc3b205,_0x4b4e01,_0x134df6]=await Promise[_0x6547e4(0x18c)]([withSpinner(_0x6547e4(0x173),()=>_0x474725[_0x6547e4(0x16d)][_0x6547e4(0x102)](_0x47019c),{'verbose':_0x2fc5ee['verbose']}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x474725['segment'][_0x6547e4(0x167)](_0x47019c),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),withSpinner(_0x6547e4(0x1cb),()=>_0x474725[_0x6547e4(0x16d)][_0x6547e4(0x14d)](_0x47019c),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),withSpinner(_0x6547e4(0x13b),()=>_0x474725[_0x6547e4(0x188)][_0x6547e4(0x1ce)](_0x47019c),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x474725[_0x6547e4(0xfd)][_0x6547e4(0xdf)](),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]})[_0x6547e4(0x17f)](_0xb27053=>_0xb27053[_0x6547e4(0x13c)])]),_0x39dceb=_0x5cdcd6[_0x6547e4(0x13c)],_0x571556=_0x39dceb['relationships']?.[_0x6547e4(0x14b)]?.[_0x6547e4(0x13c)]?.['id']||_0x39dceb[_0x6547e4(0x13d)]?.[_0x6547e4(0x14a)]?.[_0x6547e4(0x13c)]?.['id'],_0x479e9a=_0x3c7f5b[_0x6547e4(0x13c)],_0x5747d5=_0xc3b205[_0x6547e4(0x13c)],_0x1d5441=_0x4b4e01[_0x6547e4(0x13c)],{emailToId:_0xbac001,idToEmail:_0x57ddbe}=_0x134df6,[_0x3f6048,_0x4d220e]=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0xf255ea=_0x6547e4,[_0x375be3,_0x19bbe6]=await Promise['all']([_0x474725[_0xf255ea(0x155)][_0xf255ea(0x195)](),_0x474725[_0xf255ea(0x155)][_0xf255ea(0x1be)]()]);return[_0x375be3,_0x19bbe6];},{'verbose':_0x2fc5ee['verbose']})['then'](_0xe6b395=>_0xe6b395[_0x6547e4(0x13c)]),_0x2a65df=buildFolderPathToIdMap(_0x5747d5),_0x1447b7=new Map();for(const [_0x15f0b5,_0x3facd0]of _0x2a65df[_0x6547e4(0x1a3)]()){_0x1447b7[_0x6547e4(0x119)](_0x3facd0,_0x15f0b5);}const _0x31e355=new Map();for(const _0x1390a8 of _0x479e9a){const _0x30aa9b=_0x1390a8[_0x6547e4(0x1b9)]?_0x1447b7[_0x6547e4(0x1c9)](_0x1390a8[_0x6547e4(0x1b9)][_0x6547e4(0x1db)]())||'':'',_0x99f1f7=_0x30aa9b+':'+_0x1390a8[_0x6547e4(0x172)];_0x31e355[_0x6547e4(0x119)](_0x99f1f7,_0x1390a8);}const _0x14d80c=new Map();for(const _0x4b907e of _0x479e9a){_0x14d80c['set'](_0x4b907e['name'],_0x4b907e['id']);}const _0x2369c0=new Map();for(const _0x1ff661 of _0x1d5441){const _0x449d35=_0x1ff661['folderId']?_0x1447b7[_0x6547e4(0x1c9)](_0x1ff661[_0x6547e4(0x125)])||'':'',_0x2bf117=_0x449d35+':'+_0x1ff661[_0x6547e4(0x1ba)];!_0x2369c0['has'](_0x2bf117)&&_0x2369c0['set'](_0x2bf117,[]),_0x2369c0['get'](_0x2bf117)[_0x6547e4(0xe2)](_0x1ff661);}for(const _0x106eb6 of _0x2369c0[_0x6547e4(0x15b)]()){_0x106eb6[_0x6547e4(0x12a)]((_0x54ab41,_0x45967f)=>(_0x54ab41[_0x6547e4(0xf5)]||0x0)-(_0x45967f['versionNumber']||0x0));}let _0x34a5e7;if(_0x3fa3a4){if(!_0x3fa3a4[_0x6547e4(0x18f)]('.yml')&&!_0x3fa3a4[_0x6547e4(0x18f)](_0x6547e4(0x1c2)))return console['error'](a36_0x572dba[_0x6547e4(0x17c)](_0x6547e4(0x141)+_0x3fa3a4+'\x0a')),0x1;_0x34a5e7=[_0x3fa3a4];}else _0x34a5e7=findYamlFiles(_0x12beee);if(_0x34a5e7['length']===0x0)return console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x17c)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x12beee+'\x0a')),console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0xf7)](_0x6547e4(0x1d7))),0x1;const _0xe2cf23=[],_0x3007de=[];for(const _0x1d703c of _0x34a5e7){const _0x5a1601=a36_0x1f36c2[_0x6547e4(0x163)](_0x12beee,a36_0x1f36c2[_0x6547e4(0x15e)](_0x1d703c)),_0x4fac6e=_0x5a1601==='.'?'':_0x5a1601,_0x1ce5ef=readFileSync(_0x1d703c,_0x6547e4(0xfe));try{const _0x39b328=a36_0x34bb63['parse'](_0x1ce5ef);if(isJourneyYaml(_0x39b328)){const _0x1b4746=a36_0x50afac(_0x1ce5ef);_0x3007de[_0x6547e4(0xe2)]({'yamlConfig':_0x1b4746,'folderPath':_0x4fac6e,'sourcePath':_0x1d703c});}else{if(!_0x2fc5ee[_0x6547e4(0x176)]){const _0x5ed6c2=parseSegmentYamlFile(_0x1ce5ef),_0x3e05fe=normalizeChildSegmentYaml(_0x5ed6c2);_0xe2cf23[_0x6547e4(0xe2)]({'yamlConfig':_0x3e05fe,'folderPath':_0x4fac6e,'sourcePath':_0x1d703c});}}}catch(_0x44e088){return console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x17c)](_0x6547e4(0x177)+_0x1d703c+':\x20'+(_0x44e088 instanceof Error?_0x44e088['message']:_0x44e088))),0x1;}}if(_0xe2cf23[_0x6547e4(0x12c)]===0x0&&_0x3007de[_0x6547e4(0x12c)]===0x0){const _0x58e753=_0x2fc5ee['journeysOnly']?_0x6547e4(0x188):_0x6547e4(0xf9);return console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x19d)](_0x6547e4(0x197)+_0x58e753+'\x20YAML\x20files\x20found')),0x0;}const _0x36b052=new Map();_0x479e9a[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x176)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x479e9a,async _0x46f89b=>{const _0x9aec13=a36_0x6dbb,_0x2c5189=await _0x474725['segment'][_0x9aec13(0x158)](_0x47019c,_0x46f89b['id']);_0x36b052[_0x9aec13(0x119)](_0x46f89b['id'],_0x2c5189);});},{'verbose':_0x2fc5ee[_0x6547e4(0x135)]});const _0x3db5f1=[],_0x57b92b=new Set();for(const {yamlConfig:_0x18df9f,folderPath:_0x5b70d8,sourcePath:_0xeea04d}of _0xe2cf23){const _0x460b2d=resolveTDFolderPath(_0x5b70d8,_0x23a0b6,_0x2eff3c),_0x59e967=_0x460b2d+':'+_0x18df9f['name'],_0x26e213=_0x31e355[_0x6547e4(0x1c9)](_0x59e967),_0x16007a=_0x26e213?_0x36b052[_0x6547e4(0x1c9)](_0x26e213['id'])||[]:[];if(_0x460b2d&&!_0x2a65df[_0x6547e4(0x19a)](_0x460b2d)){const _0x999d=_0x460b2d[_0x6547e4(0xf8)]('/');let _0x21431f='';for(const _0x252a42 of _0x999d){_0x21431f=_0x21431f?_0x21431f+'/'+_0x252a42:_0x252a42,!_0x2a65df['has'](_0x21431f)&&_0x57b92b[_0x6547e4(0x1cd)](_0x21431f);}}const _0x7faad4=calculateActivationActions(_0x18df9f[_0x6547e4(0x1d4)]||[],_0x16007a,_0x57ddbe,_0x4d220e),_0x59b215=segmentToYamlString(_0x18df9f);let _0x41edfc,_0x3f2995=![],_0x5cb653;if(_0x26e213){const _0x23fad7=segmentWithActivationsToYaml(_0x26e213,_0x16007a,undefined,_0x57ddbe,_0x4d220e),_0x584cfa=segmentToYamlString(_0x23fad7);_0x41edfc=generateDiff(_0x584cfa,_0x59b215),_0x3f2995=hasChanges(_0x41edfc),_0x3f2995&&(_0x5cb653=formatDiffWithColors(_0x41edfc));}else _0x41edfc=generateDiff('',_0x59b215),_0x5cb653=formatDiffWithColors(_0x41edfc);_0x3db5f1[_0x6547e4(0xe2)]({'relativePath':_0x18df9f['name'],'absolutePath':_0xeea04d,'yamlConfig':_0x18df9f,'folderPath':_0x460b2d,'existingSegment':_0x26e213,'existingActivations':_0x16007a,'isNew':!_0x26e213,'hasChanges':_0x3f2995,'diff':_0x5cb653,'activationActions':_0x7faad4});}let _0x3f5146=[];if(!_0x3fa3a4){const _0x436bba=new Set();for(const {yamlConfig:_0x346fe3,folderPath:_0x4d12cb}of _0xe2cf23){const _0x510551=resolveTDFolderPath(_0x4d12cb,_0x23a0b6,_0x2eff3c);_0x436bba['add'](_0x510551+':'+_0x346fe3['name']);}_0x3f5146=_0x479e9a['filter'](_0x329a79=>{const _0x3df210=_0x6547e4,_0xa52f1d=_0x329a79[_0x3df210(0x1b9)]?_0x1447b7['get'](_0x329a79[_0x3df210(0x1b9)][_0x3df210(0x1db)]())||'':'',_0x1e2828=_0xa52f1d+':'+_0x329a79[_0x3df210(0x172)];if(_0x436bba['has'](_0x1e2828))return![];if(_0x23a0b6)return _0xa52f1d===_0x2eff3c||_0xa52f1d[_0x3df210(0x16f)](_0x2eff3c+'/');return!![];});}const _0x616dc1=[];for(const {yamlConfig:_0x11b025,folderPath:_0x4e2100,sourcePath:_0x2a8910}of _0x3007de){const _0x24151a=resolveTDFolderPath(_0x4e2100,_0x23a0b6,_0x2eff3c),_0x256564=_0x24151a+':'+_0x11b025[_0x6547e4(0x172)],_0x4f2305=_0x2369c0[_0x6547e4(0x1c9)](_0x256564);let _0x341064,_0xebc707;if(_0x4f2305&&_0x4f2305[_0x6547e4(0x12c)]>0x0){const _0x22188e=new Set(),_0x29a61f=new Set(),_0xf1a6b3=new Map(),_0x499290=new Map(),_0x4ca24e=createJumpTargetCache(),_0x156b74=_0x52e7f2=>({'resolveSegment':async _0x1fec4f=>{const _0x3db1de=_0x6547e4,_0x4137f8=_0x499290[_0x3db1de(0x1c9)](_0x1fec4f);if(_0x4137f8!==undefined)return{'name':_0x4137f8,'isJourneyLocal':!![]};try{let _0x276575=_0x479e9a[_0x3db1de(0x1ab)](_0x57d79e=>_0x57d79e['id']===_0x1fec4f);!_0x276575&&(_0x276575=await _0x474725[_0x3db1de(0x16d)][_0x3db1de(0x1d3)](_0x47019c,_0x1fec4f));const _0x426e0e=generateJourneyLocalName(_0x276575[_0x3db1de(0x172)]),_0x383d96=_0x276575[_0x3db1de(0x19e)]===SEGMENT_KIND_JOURNEY&&_0x426e0e!==undefined;let _0x56c9c8=_0x276575['name'];if(_0x383d96&&_0x426e0e){let _0x19c12f=_0x426e0e,_0x2fb323=0x2;while(_0x22188e[_0x3db1de(0x19a)](_0x19c12f)){_0x19c12f=_0x426e0e+'_'+_0x2fb323,_0x2fb323++;}_0x22188e[_0x3db1de(0x1cd)](_0x19c12f),_0x56c9c8=_0x19c12f,_0x499290['set'](_0x1fec4f,_0x56c9c8);}let _0x1a7425;return _0x383d96&&_0x276575['rule']&&(_0x1a7425={'description':_0x276575[_0x3db1de(0xec)],'rule':apiRuleToYaml(_0x276575[_0x3db1de(0x193)])}),{'name':_0x56c9c8,'isJourneyLocal':_0x383d96,'definition':_0x1a7425};}catch{return{'name':_0x1fec4f,'isJourneyLocal':![]};}},'resolveActivation':async _0x106c87=>{const _0x443079=_0x6547e4,_0x5099bc=_0xf1a6b3['get'](_0x106c87);if(_0x5099bc!==undefined)return{'name':_0x5099bc,'isJourneyLocal':!![]};try{const _0x232c72=await _0x474725['journey'][_0x443079(0x183)](_0x52e7f2,_0x106c87),_0x18df1e=_0x232c72[_0x443079(0x152)][_0x443079(0x10a)][_0x443079(0x172)]||_0x106c87,_0x3d3867=sanitizeYamlKey(_0x18df1e)||'activation_'+_0x106c87;let _0x528d01=_0x3d3867,_0x55383a=0x2;while(_0x29a61f[_0x443079(0x19a)](_0x528d01)){_0x528d01=_0x3d3867+'_'+_0x55383a,_0x55383a++;}_0x29a61f[_0x443079(0x1cd)](_0x528d01),_0xf1a6b3[_0x443079(0x119)](_0x106c87,_0x528d01);const _0xdcb26f=journeyActivationStepToYaml(_0x232c72,_0x57ddbe,_0x4d220e);return{'name':_0x528d01,'isJourneyLocal':!![],'definition':_0xdcb26f};}catch{return{'name':_0x106c87,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xc33057,_0x1005b9)=>resolveJumpTarget(_0xc33057,_0x1005b9,_0x4ca24e,_0x4c4e67=>_0x474725[_0x6547e4(0x188)][_0x6547e4(0x11c)](_0x4c4e67))}),_0x3806bc=hasMultipleVersions(_0x11b025);if(_0x3806bc&&_0x4f2305[_0x6547e4(0x12c)]>0x1){const _0x2c8969=[];for(const _0x1b01a0 of _0x4f2305){const _0x429515=await withSpinner(_0x6547e4(0xee)+_0x11b025[_0x6547e4(0x172)]+_0x6547e4(0x1d2)+(_0x1b01a0['versionNumber']||0x1)+_0x6547e4(0xf2),()=>_0x474725[_0x6547e4(0x188)]['getJourney'](_0x1b01a0['id']),{'verbose':_0x2fc5ee['verbose']}),_0x48010e=_0x156b74(_0x1b01a0['id']),_0x45ac4c=await apiToYamlAsync(_0x429515[_0x6547e4(0x13c)],_0x48010e);_0x2c8969['push']({'item':_0x1b01a0,'yaml':_0x45ac4c});}_0xebc707=buildMergedJourneyYaml(_0x2c8969);const _0x55f5e4=Math[_0x6547e4(0x1c4)](..._0x2c8969[_0x6547e4(0x182)](_0x2ffc5=>_0x2ffc5['item'][_0x6547e4(0xf5)]||0x0)),_0x3ffa21=_0x4f2305[_0x6547e4(0x1ab)](_0x70b469=>(_0x70b469[_0x6547e4(0xf5)]||0x0)===_0x55f5e4);_0x3ffa21&&(_0x341064=await _0x474725[_0x6547e4(0x188)][_0x6547e4(0x11c)](_0x3ffa21['id']));}else{const _0xb839ac=_0x4f2305[_0x4f2305[_0x6547e4(0x12c)]-0x1],_0x330b25=await withSpinner(_0x6547e4(0xee)+_0x11b025[_0x6547e4(0x172)]+_0x6547e4(0x165),()=>_0x474725[_0x6547e4(0x188)][_0x6547e4(0x11c)](_0xb839ac['id']),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]});_0x341064=_0x330b25[_0x6547e4(0x13c)];const _0x238d59=_0x156b74(_0xb839ac['id']);_0xebc707=await apiToYamlAsync(_0x341064,_0x238d59);}}if(_0x24151a&&!_0x2a65df[_0x6547e4(0x19a)](_0x24151a)){const _0x4bb5ac=_0x24151a[_0x6547e4(0xf8)]('/');let _0x5aac31='';for(const _0x278f79 of _0x4bb5ac){_0x5aac31=_0x5aac31?_0x5aac31+'/'+_0x278f79:_0x278f79,!_0x2a65df['has'](_0x5aac31)&&_0x57b92b['add'](_0x5aac31);}}const _0x586c91=normalizeJourneyYaml(_0x11b025),_0x533114=a36_0x9eee8b(_0x586c91);let _0x53558a=![],_0x485ee2;if(_0xebc707){const _0x297760=normalizeJourneyYaml(_0xebc707),_0x278011=a36_0x9eee8b(_0x297760),_0x6165f0=generateDiff(_0x278011,_0x533114);_0x53558a=hasChanges(_0x6165f0),_0x53558a&&(_0x485ee2=formatDiffWithColors(_0x6165f0));}else{const _0x5a3c4f=generateDiff('',_0x533114);_0x485ee2=formatDiffWithColors(_0x5a3c4f);}_0x616dc1[_0x6547e4(0xe2)]({'relativePath':_0x11b025[_0x6547e4(0x172)],'absolutePath':_0x2a8910,'yamlConfig':_0x11b025,'folderPath':_0x24151a,'existingJourney':_0x341064,'isNew':!_0x341064,'hasChanges':_0x53558a,'diff':_0x485ee2});}let _0x34b20a=[];if(!_0x3fa3a4){const _0x3f6071=new Set();for(const {yamlConfig:_0x281cc2,folderPath:_0x210ceb}of _0x3007de){const _0x4374dd=resolveTDFolderPath(_0x210ceb,_0x23a0b6,_0x2eff3c);_0x3f6071[_0x6547e4(0x1cd)](_0x4374dd+':'+_0x281cc2[_0x6547e4(0x172)]);}_0x34b20a=_0x1d5441[_0x6547e4(0x1a0)](_0x4c4496=>{const _0x1694b4=_0x6547e4,_0x447931=_0x4c4496[_0x1694b4(0x125)]?_0x1447b7[_0x1694b4(0x1c9)](_0x4c4496[_0x1694b4(0x125)])||'':'',_0xb0d8f3=_0x447931+':'+_0x4c4496[_0x1694b4(0x1ba)];if(_0x3f6071[_0x1694b4(0x19a)](_0xb0d8f3))return![];if(_0x23a0b6)return _0x447931===_0x2eff3c||_0x447931['startsWith'](_0x2eff3c+'/');return!![];});}const _0x134bae=_0x3db5f1[_0x6547e4(0x1a0)](_0x502047=>_0x502047['isNew']),_0x232e6d=_0x3db5f1[_0x6547e4(0x1a0)](_0x502ac8=>!_0x502ac8[_0x6547e4(0x19b)]&&_0x502ac8[_0x6547e4(0x185)]),_0x2581ea=_0x3db5f1[_0x6547e4(0x1a0)](_0x389720=>!_0x389720['isNew']&&!_0x389720[_0x6547e4(0x185)]),_0x29a9dc=Array['from'](_0x57b92b)[_0x6547e4(0x12a)](),_0x52e9fa=_0x2fc5ee[_0x6547e4(0x1a8)]?_0x3f5146:[],_0x596d13=_0x2fc5ee[_0x6547e4(0x1a8)]?_0x34b20a:[],_0x9af884=_0x3db5f1[_0x6547e4(0x180)](_0x4f9b4c=>_0x4f9b4c[_0x6547e4(0x1c0)]),_0x294beb=_0x9af884['filter'](_0x1e2dac=>_0x1e2dac[_0x6547e4(0x10e)]===_0x6547e4(0xe7)),_0x52c504=_0x9af884[_0x6547e4(0x1a0)](_0x5316f7=>_0x5316f7['type']===_0x6547e4(0x160)),_0x1c8bb1=_0x9af884[_0x6547e4(0x1a0)](_0x17c5b3=>_0x17c5b3[_0x6547e4(0x10e)]==='delete'),_0x12a91c=_0x616dc1[_0x6547e4(0x1a0)](_0x2e3e54=>_0x2e3e54[_0x6547e4(0x19b)]),_0x576ac7=_0x616dc1[_0x6547e4(0x1a0)](_0x10286b=>!_0x10286b['isNew']&&_0x10286b['hasChanges']),_0x5d3dcc=_0x616dc1[_0x6547e4(0x1a0)](_0x184e72=>!_0x184e72[_0x6547e4(0x19b)]&&!_0x184e72[_0x6547e4(0x185)]);console[_0x6547e4(0x14f)](_0x6547e4(0x16e)+_0x335fe7+'\x27:');_0x29a9dc[_0x6547e4(0x12c)]>0x0&&console[_0x6547e4(0x14f)]('\x20\x20'+a36_0x572dba[_0x6547e4(0x126)]('📁\x20'+_0x29a9dc[_0x6547e4(0x12c)]+_0x6547e4(0x1b0)));if(!_0x2fc5ee[_0x6547e4(0x176)]){console[_0x6547e4(0x14f)](_0x6547e4(0x151)),console[_0x6547e4(0x14f)](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x110)]('+\x20'+_0x134bae[_0x6547e4(0x12c)]+_0x6547e4(0xfb))),console['error'](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x19d)]('~\x20'+_0x232e6d[_0x6547e4(0x12c)]+_0x6547e4(0x192)));if(_0x52e9fa['length']>0x0)console[_0x6547e4(0x14f)](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x17c)]('-\x20'+_0x52e9fa[_0x6547e4(0x12c)]+_0x6547e4(0x147)));else _0x3f5146[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x1a8)]&&console[_0x6547e4(0x14f)]('\x20\x20\x20\x20'+a36_0x572dba[_0x6547e4(0x11e)](_0x3f5146[_0x6547e4(0x12c)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x6547e4(0x14f)]('\x20\x20\x20\x20'+a36_0x572dba[_0x6547e4(0x11e)]('=\x20'+_0x2581ea[_0x6547e4(0x12c)]+_0x6547e4(0x1bf)));}if(_0x616dc1[_0x6547e4(0x12c)]>0x0||_0x34b20a[_0x6547e4(0x12c)]>0x0){console['error'](_0x6547e4(0x1aa)),console[_0x6547e4(0x14f)]('\x20\x20\x20\x20'+a36_0x572dba[_0x6547e4(0x110)]('+\x20'+_0x12a91c[_0x6547e4(0x12c)]+_0x6547e4(0xfb))),console[_0x6547e4(0x14f)](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x19d)]('~\x20'+_0x576ac7[_0x6547e4(0x12c)]+'\x20changed'));if(_0x596d13[_0x6547e4(0x12c)]>0x0)console['error'](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x17c)]('-\x20'+_0x596d13[_0x6547e4(0x12c)]+_0x6547e4(0x147)));else _0x34b20a[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x1a8)]&&console[_0x6547e4(0x14f)]('\x20\x20\x20\x20'+a36_0x572dba['dim'](_0x34b20a['length']+_0x6547e4(0x10c)));console[_0x6547e4(0x14f)](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x11e)]('=\x20'+_0x5d3dcc['length']+_0x6547e4(0x1bf)));}_0x9af884[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee['journeysOnly']&&(console[_0x6547e4(0x14f)](''),console[_0x6547e4(0x14f)](_0x6547e4(0x145)),_0x294beb['length']>0x0&&console[_0x6547e4(0x14f)](_0x6547e4(0x169)+a36_0x572dba[_0x6547e4(0x110)]('+\x20'+_0x294beb['length']+_0x6547e4(0x103))),_0x52c504[_0x6547e4(0x12c)]>0x0&&console['error'](_0x6547e4(0x169)+a36_0x572dba['yellow']('~\x20'+_0x52c504[_0x6547e4(0x12c)]+_0x6547e4(0x1c7))),_0x1c8bb1[_0x6547e4(0x12c)]>0x0&&console[_0x6547e4(0x14f)](_0x6547e4(0x169)+a36_0x572dba['red']('-\x20'+_0x1c8bb1[_0x6547e4(0x12c)]+'\x20to\x20delete')));console[_0x6547e4(0x14f)](_0x6547e4(0x18d)+a36_0x572dba[_0x6547e4(0xf7)](_0x12beee)+'\x0a');if(_0x29a9dc['length']>0x0){console[_0x6547e4(0x14f)]('Folders\x20to\x20create:');for(const _0x44c6a7 of _0x29a9dc){console[_0x6547e4(0x14f)]('\x20\x20'+a36_0x572dba['blue']('+')+'\x20'+_0x44c6a7);}console[_0x6547e4(0x14f)]('');}if(_0x134bae['length']>0x0&&!_0x2fc5ee['journeysOnly'])for(const _0x4f0aa0 of _0x134bae){const _0xc24baf=_0x4f0aa0['folderPath']?_0x4f0aa0[_0x6547e4(0x17d)]+'/'+_0x4f0aa0['yamlConfig'][_0x6547e4(0x172)]:_0x4f0aa0[_0x6547e4(0x15c)]['name'],_0x747426=_0x4f0aa0[_0x6547e4(0x15c)][_0x6547e4(0x1d4)]?.[_0x6547e4(0x12c)]||0x0,_0x519186=_0x747426>0x0?a36_0x572dba[_0x6547e4(0x11e)]('\x20['+_0x747426+_0x6547e4(0x11b)):'';console[_0x6547e4(0x14f)]('\x0a'+a36_0x572dba[_0x6547e4(0x110)](_0x6547e4(0x13a))+'\x20'+_0xc24baf+_0x519186),console[_0x6547e4(0x14f)]('─'['repeat'](0x3c)),_0x4f0aa0[_0x6547e4(0x1b1)]&&console[_0x6547e4(0x14f)](_0x4f0aa0[_0x6547e4(0x1b1)]),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c));}if(_0x52e9fa[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x176)])for(const _0x3fb874 of _0x52e9fa){const _0x5f2c58=_0x3fb874[_0x6547e4(0x1b9)]?_0x1447b7['get'](_0x3fb874[_0x6547e4(0x1b9)][_0x6547e4(0x1db)]())||'':'',_0x32656d=_0x5f2c58?_0x5f2c58+'/'+_0x3fb874[_0x6547e4(0x172)]:_0x3fb874[_0x6547e4(0x172)],_0x310d79=_0x36b052[_0x6547e4(0x1c9)](_0x3fb874['id'])||[],_0x22d1b1=_0x310d79['length']>0x0?a36_0x572dba[_0x6547e4(0x11e)]('\x20['+_0x310d79[_0x6547e4(0x12c)]+_0x6547e4(0x11b)):'';console[_0x6547e4(0x14f)]('\x0a'+a36_0x572dba[_0x6547e4(0x17c)](_0x6547e4(0x1b8))+'\x20'+_0x32656d+_0x22d1b1),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c));const _0x2624f0=segmentWithActivationsToYaml(_0x3fb874,_0x310d79,undefined,_0x57ddbe,_0x4d220e),_0x145913=segmentToYamlString(_0x2624f0),_0x34f3ee=generateDiff(_0x145913,'');console[_0x6547e4(0x14f)](formatDiffWithColors(_0x34f3ee)),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c));}const _0x25ee43=_0x3db5f1[_0x6547e4(0x1a0)](_0x54259d=>!_0x54259d['isNew']&&_0x54259d['diff']);if(_0x25ee43[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x176)])for(const _0x4088f2 of _0x25ee43){const _0xd95f8=_0x4088f2[_0x6547e4(0x17d)]?_0x4088f2['folderPath']+'/'+_0x4088f2[_0x6547e4(0x15c)]['name']:_0x4088f2[_0x6547e4(0x15c)][_0x6547e4(0x172)];console['error']('\x0a'+a36_0x572dba[_0x6547e4(0x19d)](_0x6547e4(0x150))+'\x20'+_0xd95f8),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c)),console[_0x6547e4(0x14f)](_0x4088f2[_0x6547e4(0x1b1)]),console[_0x6547e4(0x14f)]('─'['repeat'](0x3c));}if(_0x12a91c[_0x6547e4(0x12c)]>0x0)for(const _0x115a4f of _0x12a91c){const _0x395687=_0x115a4f[_0x6547e4(0x17d)]?_0x115a4f[_0x6547e4(0x17d)]+'/'+_0x115a4f['yamlConfig'][_0x6547e4(0x172)]:_0x115a4f[_0x6547e4(0x15c)][_0x6547e4(0x172)];console['error']('\x0a'+a36_0x572dba[_0x6547e4(0x110)]('New\x20journey:')+'\x20'+_0x395687),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c)),_0x115a4f[_0x6547e4(0x1b1)]&&console[_0x6547e4(0x14f)](_0x115a4f[_0x6547e4(0x1b1)]),console[_0x6547e4(0x14f)]('─'['repeat'](0x3c));}const _0x429e0c=_0x616dc1['filter'](_0x46b498=>!_0x46b498[_0x6547e4(0x19b)]&&_0x46b498[_0x6547e4(0x1b1)]);if(_0x429e0c[_0x6547e4(0x12c)]>0x0)for(const _0xf8f547 of _0x429e0c){const _0x377121=_0xf8f547[_0x6547e4(0x17d)]?_0xf8f547[_0x6547e4(0x17d)]+'/'+_0xf8f547['yamlConfig'][_0x6547e4(0x172)]:_0xf8f547[_0x6547e4(0x15c)][_0x6547e4(0x172)];console[_0x6547e4(0x14f)]('\x0a'+a36_0x572dba[_0x6547e4(0x19d)](_0x6547e4(0x116))+'\x20'+_0x377121),console['error']('─'[_0x6547e4(0x12e)](0x3c)),console['error'](_0xf8f547[_0x6547e4(0x1b1)]),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c));}if(_0x596d13[_0x6547e4(0x12c)]>0x0)for(const _0x214b99 of _0x596d13){const _0x2548df=_0x214b99[_0x6547e4(0x125)]?_0x1447b7['get'](_0x214b99[_0x6547e4(0x125)])||'':'',_0xa83225=_0x2548df?_0x2548df+'/'+_0x214b99['journeyBundleName']:_0x214b99[_0x6547e4(0x1ba)];console[_0x6547e4(0x14f)]('\x0a'+a36_0x572dba[_0x6547e4(0x17c)](_0x6547e4(0x136))+'\x20'+_0xa83225),console['error']('─'[_0x6547e4(0x12e)](0x3c)),console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x17c)]('(Journey\x20will\x20be\x20deleted)')),console[_0x6547e4(0x14f)]('─'[_0x6547e4(0x12e)](0x3c));}if(_0x2fc5ee[_0x6547e4(0x1a2)])return console[_0x6547e4(0x14f)](a36_0x572dba['yellow'](_0x6547e4(0x1ca))),0x0;const _0x16b3cd=_0x2fc5ee[_0x6547e4(0x176)]?![]:_0x134bae[_0x6547e4(0x12c)]>0x0||_0x232e6d[_0x6547e4(0x12c)]>0x0||_0x52e9fa[_0x6547e4(0x12c)]>0x0,_0x57962d=_0x12a91c[_0x6547e4(0x12c)]>0x0||_0x576ac7['length']>0x0||_0x596d13[_0x6547e4(0x12c)]>0x0,_0x119526=_0x2fc5ee[_0x6547e4(0x176)]?![]:_0x9af884[_0x6547e4(0x12c)]>0x0,_0x545919=_0x29a9dc['length']>0x0;if(!_0x16b3cd&&!_0x57962d&&!_0x119526&&!_0x545919){const _0x5f22ce=_0x2fc5ee[_0x6547e4(0x176)]?_0x6547e4(0x121):_0x6547e4(0x170);console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x110)](_0x5f22ce));if(_0x3fa3a4&&_0x5d3dcc[_0x6547e4(0x12c)]===0x1){const _0x1acc21=_0x5d3dcc[0x0];if(_0x1acc21['existingJourney']?.['id']){const _0x91f15f=getConsoleNextUrl(_0x2fc5ee[_0x6547e4(0x133)],'/app/ps/'+_0x47019c+'/e/'+_0x1acc21[_0x6547e4(0xf3)]['id']+'/j/da/je');console[_0x6547e4(0x14f)]('\x20\x20'+a36_0x572dba[_0x6547e4(0xf7)](_0x91f15f));}}return 0x0;}const _0x9842e4=_0x2fc5ee['journeysOnly']?_0x12a91c['length']+_0x576ac7[_0x6547e4(0x12c)]+_0x596d13[_0x6547e4(0x12c)]+_0x29a9dc[_0x6547e4(0x12c)]:_0x134bae[_0x6547e4(0x12c)]+_0x232e6d[_0x6547e4(0x12c)]+_0x52e9fa[_0x6547e4(0x12c)]+_0x12a91c[_0x6547e4(0x12c)]+_0x576ac7[_0x6547e4(0x12c)]+_0x596d13['length']+_0x29a9dc[_0x6547e4(0x12c)]+_0x9af884[_0x6547e4(0x12c)];if(!_0x2fc5ee[_0x6547e4(0x13e)]&&_0x9842e4>0x0){const _0x41128f=await confirmKey(_0x6547e4(0xf4)+_0x9842e4+'\x20changes?');if(!_0x41128f)return console[_0x6547e4(0x14f)](_0x6547e4(0x174)),0x1;}for(const _0x472841 of _0x29a9dc){const _0x1c729d=_0x472841[_0x6547e4(0xf8)]('/'),_0x59c2d8=_0x1c729d[_0x1c729d[_0x6547e4(0x12c)]-0x1],_0x34db01=_0x1c729d[_0x6547e4(0x171)](0x0,-0x1)[_0x6547e4(0x1bb)]('/'),_0x5c83f4=_0x2a65df[_0x6547e4(0x1c9)](_0x34db01),_0x2c9581={'name':_0x59c2d8,'parentFolderId':_0x5c83f4},_0x29a4ff=await withSpinner(_0x6547e4(0xe4)+_0x472841+_0x6547e4(0x12f),()=>_0x474725['segment'][_0x6547e4(0xfa)](_0x47019c,_0x2c9581),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]});_0x2a65df[_0x6547e4(0x119)](_0x472841,_0x29a4ff['data']['id']),console['error'](a36_0x572dba[_0x6547e4(0x126)](_0x6547e4(0x11a)+_0x472841+'\x27'));}let _0x3e27cc=0x0,_0x3f9c86=0x0,_0x4fd6cc=0x0,_0x1651ec=0x0,_0x50e902=0x0,_0x467573=0x0;const _0x1a6bef=new Map();for(const _0x3b3eb8 of _0x2fc5ee['journeysOnly']?[]:_0x3db5f1){const _0x52139c=_0x3b3eb8[_0x6547e4(0x17d)]?_0x2a65df[_0x6547e4(0x1c9)](_0x3b3eb8[_0x6547e4(0x17d)]):undefined;let _0x31fc68;try{if(_0x3b3eb8[_0x6547e4(0x19b)]){const _0x6396fc=yamlToCreateRequest(_0x3b3eb8[_0x6547e4(0x15c)],_0x52139c),_0x4f0543=await withSpinner(_0x6547e4(0x1ae)+_0x3b3eb8['yamlConfig'][_0x6547e4(0x172)]+_0x6547e4(0x12f),()=>_0x474725[_0x6547e4(0x16d)][_0x6547e4(0x115)](_0x47019c,_0x6396fc),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]});_0x31fc68=_0x4f0543[_0x6547e4(0x13c)]['id'],_0x1a6bef[_0x6547e4(0x119)](_0x3b3eb8[_0x6547e4(0x15c)][_0x6547e4(0x172)],_0x31fc68),console['error'](a36_0x572dba[_0x6547e4(0x110)]('✔\x20Created\x20segment\x20\x27'+_0x3b3eb8['yamlConfig'][_0x6547e4(0x172)]+'\x27')),_0x3e27cc++;}else{if(_0x3b3eb8['hasChanges']){const _0x275187=yamlToUpdateRequest(_0x3b3eb8[_0x6547e4(0x15c)]);_0x52139c!==_0x3b3eb8[_0x6547e4(0x1a4)]?.[_0x6547e4(0x1b9)]&&(_0x275187[_0x6547e4(0x1b9)]=_0x52139c?parseInt(_0x52139c,0xa):undefined),await withSpinner(_0x6547e4(0x1dc)+_0x3b3eb8[_0x6547e4(0x15c)][_0x6547e4(0x172)]+_0x6547e4(0x12f),()=>_0x474725[_0x6547e4(0x16d)]['updateSegmentById'](_0x47019c,_0x3b3eb8[_0x6547e4(0x1a4)]['id'],_0x275187),{'verbose':_0x2fc5ee['verbose']}),_0x31fc68=_0x3b3eb8[_0x6547e4(0x1a4)]['id'],console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x19d)]('✔\x20Updated\x20segment\x20\x27'+_0x3b3eb8['yamlConfig']['name']+'\x27')),_0x3f9c86++;}else _0x31fc68=_0x3b3eb8['existingSegment']['id'];}}catch(_0x913c49){const _0x23705e=isHttp400Error(_0x913c49),_0x5811b9=_0x23705e?ErrorCode[_0x6547e4(0x109)]:ErrorCode[_0x6547e4(0x181)],_0x29ec9d=getErrorMessage(_0x913c49);throw new SDKError(_0x5811b9,_0x6547e4(0x196)+(_0x3b3eb8['isNew']?'create':_0x6547e4(0x160))+_0x6547e4(0x134)+_0x3b3eb8[_0x6547e4(0x1a6)]+_0x6547e4(0x1c6)+_0x29ec9d,_0x913c49);}for(const _0x25b5f5 of _0x3b3eb8[_0x6547e4(0x1c0)]){try{if(_0x25b5f5['type']==='create'&&_0x25b5f5[_0x6547e4(0x114)]){const _0x4dcf1b=yamlActivationToCreateRequest(_0x25b5f5['yamlActivation'],_0xbac001,_0x3f6048);await withSpinner('Creating\x20activation\x20\x27'+_0x25b5f5[_0x6547e4(0x172)]+_0x6547e4(0x12f),()=>_0x474725[_0x6547e4(0x16d)][_0x6547e4(0x16a)](_0x47019c,_0x31fc68,_0x4dcf1b),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),console['error'](a36_0x572dba[_0x6547e4(0x110)](_0x6547e4(0xf1)+_0x25b5f5[_0x6547e4(0x172)]+'\x27')),_0x1651ec++;}else{if(_0x25b5f5[_0x6547e4(0x10e)]===_0x6547e4(0x160)&&_0x25b5f5[_0x6547e4(0x114)]&&_0x25b5f5[_0x6547e4(0x138)]){const _0x1fe48f=yamlActivationToUpdateRequest(_0x25b5f5['yamlActivation'],_0xbac001,_0x3f6048);await withSpinner(_0x6547e4(0x118)+_0x25b5f5[_0x6547e4(0x172)]+_0x6547e4(0x12f),()=>_0x474725[_0x6547e4(0x16d)]['updateActivation'](_0x47019c,_0x31fc68,_0x25b5f5['existingActivation']['id'],_0x1fe48f),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),console['error'](a36_0x572dba['yellow'](_0x6547e4(0x1bc)+_0x25b5f5[_0x6547e4(0x172)]+'\x27')),_0x50e902++;}else _0x25b5f5[_0x6547e4(0x10e)]===_0x6547e4(0x1a8)&&_0x25b5f5['existingActivation']&&(await withSpinner(_0x6547e4(0x140)+_0x25b5f5[_0x6547e4(0x172)]+_0x6547e4(0x12f),()=>_0x474725['segment'][_0x6547e4(0x164)](_0x47019c,_0x31fc68,_0x25b5f5[_0x6547e4(0x138)]['id']),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),console['error'](a36_0x572dba[_0x6547e4(0x17c)](_0x6547e4(0x10f)+_0x25b5f5[_0x6547e4(0x172)]+'\x27')),_0x467573++);}}catch(_0x433553){const _0x1612fb=isHttp400Error(_0x433553),_0x5e9ef7=_0x1612fb?ErrorCode[_0x6547e4(0x148)]:ErrorCode[_0x6547e4(0x1ad)],_0x4651e0=getErrorMessage(_0x433553);throw new SDKError(_0x5e9ef7,_0x6547e4(0x196)+_0x25b5f5[_0x6547e4(0x10e)]+'\x20activation\x20\x27'+_0x25b5f5[_0x6547e4(0x172)]+_0x6547e4(0x1b5)+_0x3b3eb8[_0x6547e4(0x1a6)]+_0x6547e4(0x1c6)+_0x4651e0,_0x433553);}}}for(const _0x3f3566 of _0x2fc5ee['journeysOnly']?[]:_0x52e9fa){await withSpinner(_0x6547e4(0x122)+_0x3f3566['name']+_0x6547e4(0x12f),()=>_0x474725[_0x6547e4(0x16d)][_0x6547e4(0x191)](_0x3f3566['id']),{'verbose':_0x2fc5ee[_0x6547e4(0x135)]}),console[_0x6547e4(0x14f)](a36_0x572dba['red'](_0x6547e4(0x127)+_0x3f3566['name']+'\x27')),_0x4fd6cc++;}let _0x5803e4=0x0,_0x151043=0x0,_0x3731a6=0x0;const _0x242b51=new Map(_0x14d80c);for(const _0x5ceb1 of _0x3db5f1){_0x5ceb1[_0x6547e4(0x19b)]&&_0x1a6bef['has'](_0x5ceb1[_0x6547e4(0x15c)][_0x6547e4(0x172)])&&_0x242b51[_0x6547e4(0x119)](_0x5ceb1[_0x6547e4(0x15c)][_0x6547e4(0x172)],_0x1a6bef[_0x6547e4(0x1c9)](_0x5ceb1['yamlConfig'][_0x6547e4(0x172)]));}if(_0x616dc1[_0x6547e4(0x12c)]>0x0){const _0x372889=await withQuerySpinner(_0x6547e4(0x17e),async _0x282b86=>{const _0x9888d=_0x6547e4,_0x58bc7e=[];let _0x4ab869=0x0;const _0x1984dd=0x5;for(let _0x120119=0x0;_0x120119<_0x616dc1[_0x9888d(0x12c)];_0x120119+=_0x1984dd){const _0x3af869=_0x616dc1[_0x9888d(0x171)](_0x120119,_0x120119+_0x1984dd),_0x118fe4=await Promise[_0x9888d(0x18c)](_0x3af869[_0x9888d(0x182)](async _0x328278=>{const _0x1d344f=_0x9888d;if(!_0x328278['isNew']&&!_0x328278[_0x1d344f(0x185)])return{'action':'unchanged','name':_0x328278[_0x1d344f(0x15c)][_0x1d344f(0x172)],'journeyId':_0x328278['existingJourney']?.['id']};const _0xc70838=_0x328278[_0x1d344f(0x17d)]?_0x2a65df[_0x1d344f(0x1c9)](_0x328278[_0x1d344f(0x17d)]):undefined,_0x2177e2=_0x328278[_0x1d344f(0x19b)]?_0x1d344f(0x17a):_0x1d344f(0x11d);_0x282b86[_0x1d344f(0x17b)](_0x2177e2+_0x1d344f(0xf6)+_0x328278[_0x1d344f(0x15c)]['name']+'\x27');const _0x567b49=new Map(),_0x1feca6=new Map(),_0x51d33c=new Map(),_0x42e6ff={'resolveSegmentId':async _0x57302c=>{const _0x1f3637=_0x1d344f,_0x1bee9e=_0x242b51['get'](_0x57302c);if(!_0x1bee9e)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1f3637(0x161)+_0x57302c+_0x1f3637(0xe3)+_0x328278['yamlConfig']['name']+')');return _0x1bee9e;},'resolveEmbeddedSegmentId':async(_0x330cc,_0x924aa1)=>{const _0x2acba3=_0x1d344f,_0x2fe9ad=_0x242b51[_0x2acba3(0x1c9)](_0x330cc);if(_0x2fe9ad)return _0x2fe9ad;const _0x429e7a=_0x479e9a[_0x2acba3(0x1ab)](_0x26dbb6=>_0x26dbb6[_0x2acba3(0x172)]===_0x330cc);if(_0x429e7a)return _0x242b51['set'](_0x330cc,_0x429e7a['id']),_0x429e7a['id'];if(_0x328278[_0x2acba3(0x19b)]){const _0x130888=_0x328278[_0x2acba3(0x15c)]['stages']||_0x328278[_0x2acba3(0x15c)][_0x2acba3(0x1d1)]?.[0x0]?.[_0x2acba3(0x189)]||[];let _0x30ac9d=_0x2acba3(0x124),_0xeeb676=_0x330cc;for(const _0x43353b of _0x130888){if(_0x43353b[_0x2acba3(0xe1)]?.['segment']===_0x330cc){_0x30ac9d=_0x43353b[_0x2acba3(0x172)],_0xeeb676=_0x43353b[_0x2acba3(0xe1)][_0x2acba3(0x172)]||_0x330cc;break;}}return _0x1feca6[_0x2acba3(0x119)](_0x330cc,{'definition':_0x924aa1,'stageName':_0x30ac9d,'criteriaName':_0xeeb676}),createPendingSegmentId(_0x330cc);}const _0x118738=_0x328278[_0x2acba3(0xf3)]?.['id'];if(!_0x118738)throw new SDKError(ErrorCode['INTERNAL'],_0x2acba3(0x168));const _0xd973ed=_0x2acba3(0x19c)+crypto[_0x2acba3(0xe6)]();try{const _0x10b653=await _0x474725[_0x2acba3(0x16d)][_0x2acba3(0x113)]({'name':_0xd973ed,'description':_0x924aa1[_0x2acba3(0xec)]||_0x2acba3(0xe5)+_0x330cc,'journeyId':_0x118738,'rule':yamlRuleToApi(_0x924aa1[_0x2acba3(0x193)],!![]),'countPopulation':!![],'parentFolderId':_0x571556||'','audienceId':_0x47019c});return _0x2fc5ee[_0x2acba3(0x135)]&&console[_0x2acba3(0x14f)]('\x20\x20Created\x20embedded\x20segment\x20\x27'+_0x330cc+'\x27\x20(internal:\x20'+_0xd973ed+')\x20with\x20ID:\x20'+_0x10b653),_0x242b51[_0x2acba3(0x119)](_0x330cc,_0x10b653),_0x10b653;}catch(_0x273c2f){throw new SDKError(ErrorCode[_0x2acba3(0x181)],_0x2acba3(0x1d9)+_0x330cc+_0x2acba3(0xea)+getErrorMessage(_0x273c2f),_0x273c2f);}},'resolveActivationId':async _0x4c784d=>{const _0x1a3111=_0x1d344f,_0x3397f2=_0x567b49[_0x1a3111(0x1c9)](_0x4c784d);if(_0x3397f2)return _0x3397f2;if(_0x328278[_0x1a3111(0xf3)]){const _0x2ad5ab=await _0x474725['journey'][_0x1a3111(0x158)](_0x328278['existingJourney']['id']),_0x5ca175=_0x2ad5ab[_0x1a3111(0x1ab)](_0x2de817=>_0x2de817[_0x1a3111(0x152)][_0x1a3111(0x10a)]?.['name']===_0x4c784d);if(_0x5ca175)return _0x567b49[_0x1a3111(0x119)](_0x4c784d,_0x5ca175['id']),_0x5ca175['id'];}throw new SDKError(ErrorCode[_0x1a3111(0xed)],_0x1a3111(0x129)+_0x4c784d+_0x1a3111(0xe3)+_0x328278[_0x1a3111(0x15c)][_0x1a3111(0x172)]+_0x1a3111(0x139)+_0x1a3111(0x159));},'resolveEmbeddedActivationId':async(_0x4bb13c,_0x2455c5)=>{const _0x233fcb=_0x1d344f,_0x3c0f65=_0x567b49['get'](_0x4bb13c);if(_0x3c0f65)return _0x3c0f65;if(_0x328278[_0x233fcb(0x19b)])return _0x51d33c[_0x233fcb(0x119)](_0x4bb13c,_0x2455c5),createPendingActivationId(_0x4bb13c);if(_0x328278['existingJourney']){const _0x236727=await _0x474725['journey'][_0x233fcb(0x158)](_0x328278['existingJourney']['id']),_0x1aec67=_0x236727[_0x233fcb(0x1ab)](_0x5b4475=>_0x5b4475[_0x233fcb(0x152)][_0x233fcb(0x10a)]?.[_0x233fcb(0x172)]===_0x2455c5[_0x233fcb(0x172)]);if(_0x1aec67)return _0x567b49[_0x233fcb(0x119)](_0x4bb13c,_0x1aec67['id']),_0x1aec67['id'];try{const _0x2216b1=yamlActivationToCreateRequest(_0x2455c5,_0xbac001,_0x3f6048),_0x286b68=await _0x474725[_0x233fcb(0x188)][_0x233fcb(0x16a)](_0x328278[_0x233fcb(0xf3)]['id'],_0x2216b1);return _0x2fc5ee[_0x233fcb(0x135)]&&console[_0x233fcb(0x14f)]('\x20\x20Created\x20embedded\x20activation\x20\x27'+_0x4bb13c+_0x233fcb(0x1a1)+_0x286b68['id']),_0x567b49[_0x233fcb(0x119)](_0x4bb13c,_0x286b68['id']),_0x286b68['id'];}catch(_0x3d2f24){throw new SDKError(ErrorCode[_0x233fcb(0x1c8)],_0x233fcb(0xe0)+_0x4bb13c+_0x233fcb(0xea)+getErrorMessage(_0x3d2f24),_0x3d2f24);}}throw new SDKError(ErrorCode[_0x233fcb(0x1a5)],_0x233fcb(0x15d));},'resolveJourneyId':async _0xa1b602=>{const _0x48c644=_0x1d344f;try{return await _0x474725[_0x48c644(0x188)][_0x48c644(0x187)](_0x47019c,_0xa1b602);}catch(_0x5384b4){throw new SDKError(ErrorCode['NOT_FOUND'],_0x48c644(0x12b)+_0xa1b602+_0x48c644(0x132)+_0x328278['yamlConfig'][_0x48c644(0x172)]+'\x27)',_0x5384b4);}},'resolveStageId':async(_0x5cd80d,_0x16e2f7)=>{const _0x141c36=_0x1d344f,_0x4e1638=await _0x474725['journey']['getJourney'](_0x5cd80d),_0x448282=_0x4e1638[_0x141c36(0x152)][_0x141c36(0x15f)][_0x141c36(0x1ab)](_0x2c9291=>_0x2c9291['name'][_0x141c36(0x10b)]()===_0x16e2f7[_0x141c36(0x10b)]());if(!_0x448282?.['id'])throw new SDKError(ErrorCode[_0x141c36(0xed)],_0x141c36(0x130)+_0x16e2f7+_0x141c36(0x1a7)+(_0x4e1638['attributes'][_0x141c36(0x1ba)]||_0x4e1638['attributes'][_0x141c36(0x172)])+'\x27');return _0x448282['id'];}};try{const _0x39a361=await a36_0x16c25f(_0x328278['yamlConfig'],_0x47019c,_0x42e6ff),_0x29d1d4=_0xc70838||_0x571556;_0x29d1d4&&(_0x39a361['relationships']={'parentFolder':{'data':{'id':_0x29d1d4,'type':'folder'}}});if(_0x328278[_0x1d344f(0x19b)]){if(_0x1feca6[_0x1d344f(0x105)]>0x0||_0x51d33c[_0x1d344f(0x105)]>0x0){const _0x26102f=JSON['parse'](JSON[_0x1d344f(0xfc)](_0x39a361));ensureJourneyDefaults(_0x26102f[_0x1d344f(0x152)]);for(const _0x4d7836 of _0x26102f[_0x1d344f(0x152)][_0x1d344f(0x15f)]){_0x4d7836['entryCriteria']?.[_0x1d344f(0x104)]&&isPendingSegmentId(_0x4d7836[_0x1d344f(0x149)][_0x1d344f(0x104)])&&delete _0x4d7836[_0x1d344f(0x149)];if(_0x4d7836[_0x1d344f(0xf0)])for(const _0x31f615 of Object[_0x1d344f(0xef)](_0x4d7836['steps'])){const _0x2b6161=_0x4d7836['steps'][_0x31f615];_0x2b6161[_0x1d344f(0x10e)]===_0x1d344f(0x166)&&_0x2b6161[_0x1d344f(0x198)]&&isPendingActivationId(_0x2b6161['journeyActivationStepId'])&&(_0x2b6161['journeyActivationStepId']='');if(_0x2b6161[_0x1d344f(0x10e)]===_0x1d344f(0x142)&&_0x2b6161[_0x1d344f(0x146)])for(const _0x4db3cc of _0x2b6161['branches']){_0x4db3cc[_0x1d344f(0x104)]&&isPendingSegmentId(_0x4db3cc[_0x1d344f(0x104)])&&(_0x4db3cc[_0x1d344f(0x104)]='');}}}_0x2fc5ee[_0x1d344f(0x135)]&&console[_0x1d344f(0x14f)]('\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20'+JSON[_0x1d344f(0xfc)](_0x26102f,null,0x2));const _0x24eb7a=await _0x474725['journey'][_0x1d344f(0xe7)](_0x26102f),_0x396b37=_0x24eb7a['id'],_0x14ad67=new Map();for(const _0x202f03 of _0x24eb7a[_0x1d344f(0x152)][_0x1d344f(0x15f)]){_0x14ad67[_0x1d344f(0x119)](_0x202f03[_0x1d344f(0x172)][_0x1d344f(0x10b)](),_0x202f03['id']);}const _0x4dadaf=new Map();for(const [_0x24bb8c,{definition:_0xbaf868,criteriaName:_0x2315d0}]of _0x1feca6){const _0x4b37bb=generateJourneyLocalName(_0x2315d0)||'journey_entry_criteria_'+crypto[_0x1d344f(0xe6)]();_0x2fc5ee['verbose']&&console['error'](_0x1d344f(0x1c5)+_0x24bb8c+_0x1d344f(0x18a)+_0x4b37bb+_0x1d344f(0x184)+_0x396b37);const _0x36c346=await _0x474725[_0x1d344f(0x16d)][_0x1d344f(0x113)]({'name':_0x4b37bb,'description':_0xbaf868[_0x1d344f(0xec)]||_0x1d344f(0xe5)+_0x24bb8c,'journeyId':_0x396b37,'rule':yamlRuleToApi(_0xbaf868[_0x1d344f(0x193)],!![]),'countPopulation':!![],'parentFolderId':_0x29d1d4||'','audienceId':_0x47019c});_0x4dadaf[_0x1d344f(0x119)](_0x24bb8c,_0x36c346),_0x242b51[_0x1d344f(0x119)](_0x24bb8c,_0x36c346),_0x2fc5ee[_0x1d344f(0x135)]&&console[_0x1d344f(0x14f)](_0x1d344f(0x1ac)+_0x24bb8c+_0x1d344f(0x1a1)+_0x36c346);}const _0x27ef75=new Map();for(const [_0x24815a,_0x1f6ae9]of _0x51d33c){_0x2fc5ee[_0x1d344f(0x135)]&&console[_0x1d344f(0x14f)](_0x1d344f(0x123)+_0x24815a+_0x1d344f(0x179)+_0x396b37);try{const _0x132f34=yamlActivationToCreateRequest(_0x1f6ae9,_0xbac001,_0x3f6048),_0x26b4b7=await _0x474725[_0x1d344f(0x188)][_0x1d344f(0x16a)](_0x396b37,_0x132f34);_0x27ef75[_0x1d344f(0x119)](_0x24815a,_0x26b4b7['id']),_0x567b49[_0x1d344f(0x119)](_0x24815a,_0x26b4b7['id']),_0x2fc5ee[_0x1d344f(0x135)]&&console[_0x1d344f(0x14f)](_0x1d344f(0x1d5)+_0x24815a+'\x27\x20with\x20ID:\x20'+_0x26b4b7['id']);}catch(_0x1f1e10){throw new SDKError(ErrorCode[_0x1d344f(0x1c8)],_0x1d344f(0xe0)+_0x24815a+_0x1d344f(0xea)+getErrorMessage(_0x1f1e10),_0x1f1e10);}}const _0x13355c=JSON['parse'](JSON[_0x1d344f(0xfc)](_0x39a361));_0x13355c['id']=_0x396b37,ensureJourneyDefaults(_0x13355c['attributes']);for(const _0x3b6e00 of _0x13355c[_0x1d344f(0x152)][_0x1d344f(0x15f)]){const _0x22e4c4=_0x14ad67[_0x1d344f(0x1c9)](_0x3b6e00[_0x1d344f(0x172)][_0x1d344f(0x10b)]());_0x22e4c4&&(_0x3b6e00['id']=_0x22e4c4);if(_0x3b6e00[_0x1d344f(0x149)]?.[_0x1d344f(0x104)]&&isPendingSegmentId(_0x3b6e00[_0x1d344f(0x149)][_0x1d344f(0x104)])){const _0x7c2865=extractPendingSegmentName(_0x3b6e00[_0x1d344f(0x149)][_0x1d344f(0x104)]),_0x1455b5=_0x4dadaf[_0x1d344f(0x1c9)](_0x7c2865);_0x1455b5&&(_0x3b6e00['entryCriteria'][_0x1d344f(0x104)]=_0x1455b5);}if(_0x3b6e00[_0x1d344f(0xf0)]){const _0xdf939f=_0x38f0d7=>_0x39a361['attributes'][_0x1d344f(0x15f)][_0x1d344f(0x1ab)](_0x4c6b73=>_0x4c6b73['name'][_0x1d344f(0x10b)]()===_0x3b6e00[_0x1d344f(0x172)][_0x1d344f(0x10b)]())?.[_0x1d344f(0xf0)]?.[_0x38f0d7];for(const _0x219db0 of Object[_0x1d344f(0xef)](_0x3b6e00[_0x1d344f(0xf0)])){const _0x2acc1c=_0x3b6e00[_0x1d344f(0xf0)][_0x219db0],_0x42cc5d=_0xdf939f(_0x219db0);if(_0x2acc1c[_0x1d344f(0x10e)]===_0x1d344f(0x166)&&_0x2acc1c['journeyActivationStepId']&&(isPendingActivationId(_0x2acc1c[_0x1d344f(0x198)])||_0x2acc1c['journeyActivationStepId']==='')){if(_0x42cc5d?.[_0x1d344f(0x198)]&&isPendingActivationId(_0x42cc5d[_0x1d344f(0x198)])){const _0x29b92d=extractPendingActivationName(_0x42cc5d[_0x1d344f(0x198)]),_0x326b29=_0x27ef75[_0x1d344f(0x1c9)](_0x29b92d);_0x326b29&&(_0x2acc1c[_0x1d344f(0x198)]=_0x326b29);}}if(_0x2acc1c[_0x1d344f(0x10e)]===_0x1d344f(0x142)&&_0x2acc1c[_0x1d344f(0x146)]&&_0x42cc5d?.[_0x1d344f(0x146)])for(let _0x3ea557=0x0;_0x3ea557<_0x2acc1c['branches'][_0x1d344f(0x12c)];_0x3ea557++){const _0x41428f=_0x2acc1c['branches'][_0x3ea557],_0x57ee62=_0x42cc5d[_0x1d344f(0x146)][_0x3ea557];if(_0x57ee62?.[_0x1d344f(0x104)]&&isPendingSegmentId(_0x57ee62['segmentId'])){const _0xd657fb=extractPendingSegmentName(_0x57ee62[_0x1d344f(0x104)]),_0x20efde=_0x4dadaf[_0x1d344f(0x1c9)](_0xd657fb);_0x20efde&&(_0x41428f[_0x1d344f(0x104)]=_0x20efde);}}}}}return _0x2fc5ee[_0x1d344f(0x135)]&&console[_0x1d344f(0x14f)]('\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20'+JSON[_0x1d344f(0xfc)](_0x13355c,null,0x2)),await _0x474725[_0x1d344f(0x188)][_0x1d344f(0x160)](_0x396b37,_0x13355c),{'action':_0x1d344f(0xff),'name':_0x328278[_0x1d344f(0x15c)][_0x1d344f(0x172)],'journeyId':_0x396b37};}else{ensureJourneyDefaults(_0x39a361[_0x1d344f(0x152)]);_0x2fc5ee[_0x1d344f(0x135)]&&console['error'](_0x1d344f(0x1d0)+JSON[_0x1d344f(0xfc)](_0x39a361,null,0x2));const _0x20e7ec=await _0x474725[_0x1d344f(0x188)][_0x1d344f(0xe7)](_0x39a361);return{'action':'created','name':_0x328278[_0x1d344f(0x15c)][_0x1d344f(0x172)],'journeyId':_0x20e7ec['id']};}}else{if(_0x328278[_0x1d344f(0x185)]&&_0x328278[_0x1d344f(0xf3)])return ensureJourneyDefaults(_0x39a361[_0x1d344f(0x152)]),await _0x474725['journey'][_0x1d344f(0x160)](_0x328278[_0x1d344f(0xf3)]['id'],_0x39a361),{'action':_0x1d344f(0x186),'name':_0x328278[_0x1d344f(0x15c)][_0x1d344f(0x172)],'journeyId':_0x328278[_0x1d344f(0xf3)]['id']};}return{'action':_0x1d344f(0x194),'name':_0x328278['yamlConfig'][_0x1d344f(0x172)],'journeyId':_0x328278[_0x1d344f(0xf3)]?.['id']};}catch(_0x92b1a6){const _0x3a0315=isHttp400Error(_0x92b1a6),_0x690e92=_0x3a0315?ErrorCode[_0x1d344f(0x101)]:ErrorCode[_0x1d344f(0x1c8)],_0x58d1a3=getErrorMessage(_0x92b1a6);throw new SDKError(_0x690e92,'Failed\x20to\x20'+(_0x328278[_0x1d344f(0x19b)]?'create':_0x1d344f(0x160))+_0x1d344f(0x153)+_0x328278[_0x1d344f(0x1a6)]+_0x1d344f(0x1c6)+_0x58d1a3,_0x92b1a6);}}));_0x58bc7e[_0x9888d(0xe2)](..._0x118fe4),_0x4ab869+=_0x3af869[_0x9888d(0x12c)],_0x282b86['setExtra']('('+_0x4ab869+'/'+_0x616dc1['length']+')');}return _0x58bc7e;},{'verbose':_0x2fc5ee[_0x6547e4(0x135)]});for(const _0x1230e1 of _0x372889[_0x6547e4(0x13c)]){if(_0x1230e1[_0x6547e4(0x1cc)]===_0x6547e4(0xff))console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x110)](_0x6547e4(0x19f)+_0x1230e1['name']+'\x27')),_0x5803e4++;else _0x1230e1[_0x6547e4(0x1cc)]===_0x6547e4(0x186)&&(console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x19d)](_0x6547e4(0x117)+_0x1230e1[_0x6547e4(0x172)]+'\x27')),_0x151043++);}if(_0x3fa3a4&&_0x372889[_0x6547e4(0x13c)]['length']===0x1){const _0x37bfcf=_0x372889[_0x6547e4(0x13c)][0x0];if(_0x37bfcf[_0x6547e4(0x128)]){const _0x379f5f=getConsoleNextUrl(_0x2fc5ee['site'],_0x6547e4(0x1d8)+_0x47019c+_0x6547e4(0x13f)+_0x37bfcf[_0x6547e4(0x128)]+'/j/da/je');console[_0x6547e4(0x14f)]('\x20\x20'+a36_0x572dba['cyan'](_0x379f5f));}}}for(const _0x2a8287 of _0x596d13){console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x19d)](_0x6547e4(0x1a9)+_0x2a8287[_0x6547e4(0x1ba)])),_0x3731a6++;}const _0x16e3a1=[];if(_0x3e27cc>0x0)_0x16e3a1[_0x6547e4(0xe2)](_0x3e27cc+_0x6547e4(0x143));if(_0x3f9c86>0x0)_0x16e3a1['push'](_0x3f9c86+_0x6547e4(0x1b7));if(_0x4fd6cc>0x0)_0x16e3a1[_0x6547e4(0xe2)](_0x4fd6cc+_0x6547e4(0x12d));const _0x114ead=[];if(_0x5803e4>0x0)_0x114ead[_0x6547e4(0xe2)](_0x5803e4+_0x6547e4(0x143));if(_0x151043>0x0)_0x114ead[_0x6547e4(0xe2)](_0x151043+_0x6547e4(0x1b7));if(_0x3731a6>0x0)_0x114ead[_0x6547e4(0xe2)](_0x3731a6+_0x6547e4(0x12d));const _0x23fd4a=[];if(_0x1651ec>0x0)_0x23fd4a[_0x6547e4(0xe2)](_0x1651ec+_0x6547e4(0x143));if(_0x50e902>0x0)_0x23fd4a['push'](_0x50e902+_0x6547e4(0x1b7));if(_0x467573>0x0)_0x23fd4a[_0x6547e4(0xe2)](_0x467573+_0x6547e4(0x12d));return console[_0x6547e4(0x14f)](a36_0x572dba[_0x6547e4(0x110)](_0x6547e4(0xe9))),_0x16e3a1[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x176)]&&console[_0x6547e4(0x14f)](_0x6547e4(0x16c)+_0x16e3a1[_0x6547e4(0x1bb)](',\x20')),_0x114ead[_0x6547e4(0x12c)]>0x0&&console[_0x6547e4(0x14f)](_0x6547e4(0x18b)+_0x114ead[_0x6547e4(0x1bb)](',\x20')),_0x23fd4a[_0x6547e4(0x12c)]>0x0&&!_0x2fc5ee[_0x6547e4(0x176)]&&console[_0x6547e4(0x14f)](_0x6547e4(0x157)+_0x23fd4a['join'](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x1ea565){const _0x295756=a36_0x22d99d,_0x40d0b7=new Map(),_0x4f5926=new Map();for(const _0xce5c48 of _0x1ea565){_0x4f5926['set'](_0xce5c48['id'],_0xce5c48);}const _0x20757e=new Set();for(const _0x185fb0 of _0x1ea565){!_0x185fb0[_0x295756(0x190)]&&_0x20757e[_0x295756(0x1cd)](_0x185fb0['id']);}function _0x2d6d4f(_0x2e8b96){const _0x48c34d=_0x295756;if(_0x20757e['has'](_0x2e8b96['id']))return'';if(_0x2e8b96['parentFolderId']){const _0x59b152=_0x4f5926[_0x48c34d(0x1c9)](_0x2e8b96[_0x48c34d(0x190)]);if(_0x59b152){const _0x36d9c2=_0x2d6d4f(_0x59b152);return _0x36d9c2?_0x36d9c2+'/'+_0x2e8b96[_0x48c34d(0x172)]:_0x2e8b96['name'];}}return _0x2e8b96[_0x48c34d(0x172)];}for(const _0x18028a of _0x1ea565){const _0x40120b=_0x2d6d4f(_0x18028a);_0x40d0b7[_0x295756(0x119)](_0x40120b,_0x18028a['id']);}return _0x40d0b7;}function findYamlFiles(_0x50db7b){const _0x307ce9=[];function _0x31f2ba(_0x460db7){const _0x108a15=a36_0x6dbb,_0x4312e9=readdirSync(_0x460db7,{'withFileTypes':!![]});for(const _0x13c706 of _0x4312e9){const _0x4e159e=a36_0x1f36c2[_0x108a15(0x1bb)](_0x460db7,_0x13c706[_0x108a15(0x172)]);if(_0x13c706[_0x108a15(0x1b3)]())_0x31f2ba(_0x4e159e);else(_0x13c706[_0x108a15(0x172)]['endsWith'](_0x108a15(0x1b6))||_0x13c706[_0x108a15(0x172)]['endsWith'](_0x108a15(0x1c2)))&&_0x307ce9[_0x108a15(0xe2)](_0x4e159e);}}return _0x31f2ba(_0x50db7b),_0x307ce9;}function calculateActivationActions(_0x4e56ac,_0x2a8eac,_0x1da4e0,_0x1b8cef){const _0x1775a6=a36_0x22d99d,_0x3ed280=[],_0x5dabc6=new Map();for(const _0xb3208b of _0x2a8eac){_0x5dabc6[_0x1775a6(0x119)](_0xb3208b[_0x1775a6(0x172)],_0xb3208b);}const _0x1ec30b=new Map();for(const _0x584498 of _0x4e56ac){_0x1ec30b[_0x1775a6(0x119)](_0x584498[_0x1775a6(0x172)],_0x584498);}for(const _0x564b8a of _0x4e56ac){const _0x4d11cd=_0x5dabc6[_0x1775a6(0x1c9)](_0x564b8a[_0x1775a6(0x172)]);if(!_0x4d11cd)_0x3ed280[_0x1775a6(0xe2)]({'type':_0x1775a6(0xe7),'name':_0x564b8a[_0x1775a6(0x172)],'yamlActivation':_0x564b8a});else{const _0x323bb0=activationToYaml(_0x4d11cd,_0x1da4e0,_0x1b8cef),_0x55bfa7=a36_0x34bb63[_0x1775a6(0xfc)](_0x323bb0),_0x4f0a1a=a36_0x34bb63[_0x1775a6(0xfc)](_0x564b8a);_0x55bfa7!==_0x4f0a1a&&_0x3ed280[_0x1775a6(0xe2)]({'type':_0x1775a6(0x160),'name':_0x564b8a[_0x1775a6(0x172)],'yamlActivation':_0x564b8a,'existingActivation':_0x4d11cd});}}for(const _0x39a540 of _0x2a8eac){!_0x1ec30b[_0x1775a6(0x19a)](_0x39a540[_0x1775a6(0x172)])&&_0x3ed280[_0x1775a6(0xe2)]({'type':_0x1775a6(0x1a8),'name':_0x39a540[_0x1775a6(0x172)],'existingActivation':_0x39a540});}return _0x3ed280;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a37_0xf4ec(_0x56d04c,_0x468b06){_0x56d04c=_0x56d04c-0xd9;const _0x461714=a37_0x4617();let _0xf4eca1=_0x461714[_0x56d04c];return _0xf4eca1;}const a37_0x1e12a5=a37_0xf4ec;(function(_0x5c5b3b,_0x543a80){const _0x3bae6e=a37_0xf4ec,_0x4185d5=_0x5c5b3b();while(!![]){try{const _0x11777f=-parseInt(_0x3bae6e(0xe2))/0x1+parseInt(_0x3bae6e(0xfc))/0x2+-parseInt(_0x3bae6e(0xdb))/0x3+parseInt(_0x3bae6e(0xf6))/0x4*(-parseInt(_0x3bae6e(0xf4))/0x5)+-parseInt(_0x3bae6e(0xee))/0x6*(parseInt(_0x3bae6e(0xe9))/0x7)+parseInt(_0x3bae6e(0xe3))/0x8*(parseInt(_0x3bae6e(0xf5))/0x9)+parseInt(_0x3bae6e(0xdd))/0xa;if(_0x11777f===_0x543a80)break;else _0x4185d5['push'](_0x4185d5['shift']());}catch(_0x531a20){_0x4185d5['push'](_0x4185d5['shift']());}}}(a37_0x4617,0x4f16a));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a37_0x4617(){const _0x1ac9be=['7OIqcZG','Segment\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Updating\x20segment\x20\x27','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','2554008swgiHT','Resolved\x20folder\x20ID:\x20','data','updateSegmentById','description','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','50GHRZbU','36xGpdwG','9036mBCJpk','yellow','segment:update','kind','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segment','1131510koFTne','resolvePathToResource','name','\x27...','rule','segmentPath','INTERNAL','segmentName','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','folder','verbose','366156vWqaSG','segmentId','5350700ePISlt','error','Examples:','Resolving\x20folder\x20\x27','length','504677IcNSnG','596216Mlkcfo','resolveFolderId','execute','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','ruleFile','type'];a37_0x4617=function(){return _0x1ac9be;};return a37_0x4617();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a37_0x170c95 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a37_0x1e12a5(0xfe)]=a37_0x1e12a5(0xf8);[a37_0x1e12a5(0xf2)]='Update\x20existing\x20child\x20segment';async[a37_0x1e12a5(0xe5)](_0x38ce83){const _0x185092=a37_0x1e12a5;console['error'](a37_0x170c95[_0x185092(0xf7)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x185092(0xde)](a37_0x170c95[_0x185092(0xf7)](_0x185092(0xeb)));const {options:_0x55c2be,args:_0x5f9987,tdx:_0x59bc18}=_0x38ce83,_0x3f7786=_0x55c2be;if(_0x5f9987[_0x185092(0xe1)]===0x0)return console[_0x185092(0xde)](_0x185092(0xe6)),console[_0x185092(0xde)](_0x185092(0xfa)),console['error'](_0x185092(0xdf)),console[_0x185092(0xde)](_0x185092(0x105)),console[_0x185092(0xde)](_0x185092(0xed)),0x1;const _0xf2ef77=_0x5f9987[0x0],_0x9cfd1c=_0x55c2be[_0x185092(0x101)];let _0x5c6211=_0xf2ef77;_0x9cfd1c&&!_0xf2ef77['includes']('/')&&(_0x5c6211=_0x9cfd1c+'/'+_0xf2ef77,_0x3f7786[_0x185092(0xda)]&&console[_0x185092(0xde)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5c6211));const _0x3f937d=await withSpinner('Resolving\x20path\x20\x27'+_0x5c6211+_0x185092(0xff),()=>_0x59bc18[_0x185092(0xfb)][_0x185092(0xfd)](_0x5c6211),{'verbose':_0x3f7786['verbose']}),_0x10b8b9=_0x3f937d[_0x185092(0xf0)];_0x3f7786[_0x185092(0xda)]&&console[_0x185092(0xde)]('Resolved\x20type:\x20'+_0x10b8b9[_0x185092(0xe8)]);if(_0x10b8b9['type']!==_0x185092(0xfb))return console[_0x185092(0xde)]('Error:\x20Cannot\x20update\x20'+_0x10b8b9[_0x185092(0xe8)]+_0x185092(0xf3)),console[_0x185092(0xde)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x10b8b9[_0x185092(0xdc)])throw new SDKError(ErrorCode[_0x185092(0x102)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2b29b4=_0x10b8b9['parentId'],_0x4538e5=_0x10b8b9[_0x185092(0xdc)];_0x3f7786[_0x185092(0xda)]&&(console['error']('Parent\x20ID:\x20'+_0x2b29b4),console[_0x185092(0xde)](_0x185092(0xea)+_0x4538e5));let _0x18dfb9;if(_0x3f7786['folder']){const _0x5417e4=_0x3f7786[_0x185092(0xd9)],_0x18c53e=await withSpinner(_0x185092(0xe0)+_0x5417e4+_0x185092(0xff),()=>_0x59bc18[_0x185092(0xfb)][_0x185092(0xe4)](_0x2b29b4,_0x5417e4),{'verbose':_0x3f7786[_0x185092(0xda)]});_0x18dfb9=parseInt(_0x18c53e[_0x185092(0xf0)],0xa),_0x3f7786[_0x185092(0xda)]&&console[_0x185092(0xde)](_0x185092(0xef)+_0x18dfb9);}const _0x10c681=await loadJSONFromOptions(_0x3f7786[_0x185092(0x100)],_0x3f7786[_0x185092(0xe7)]),_0x290c2d={'name':_0x3f7786['name'],'description':_0x3f7786[_0x185092(0xf2)],'rule':_0x10c681,'kind':_0x3f7786[_0x185092(0xf9)]!==undefined?parseInt(_0x3f7786[_0x185092(0xf9)],0xa):undefined,'segmentFolderId':_0x18dfb9},_0x43f5ed=await withSpinner(_0x185092(0xec)+_0x10b8b9[_0x185092(0x103)]+'\x27...',()=>_0x59bc18[_0x185092(0xfb)][_0x185092(0xf1)](_0x2b29b4,_0x4538e5,_0x290c2d),{'verbose':_0x3f7786[_0x185092(0xda)]}),_0x2c3a37=_0x43f5ed[_0x185092(0xf0)];return console[_0x185092(0xde)]('✔\x20Updated\x20segment\x20\x27'+_0x2c3a37['name']+'\x27'),_0x5c6211!==_0xf2ef77&&console[_0x185092(0xde)](_0x185092(0x104)+_0x5c6211),await handleSDKOutput([_0x2c3a37],_0x3f7786),0x0;}}
|