@treasuredata/tdx 2026.3.44 → 2026.3.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  141. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  142. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  143. package/dist/sdk/segment/fields-display.js +1 -1
  144. package/dist/sdk/segment/file-discovery.js +1 -1
  145. package/dist/sdk/segment/journey-utils.js +1 -1
  146. package/dist/sdk/segment/journey-validator.js +1 -1
  147. package/dist/sdk/segment/journey-yaml.js +1 -1
  148. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  149. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/pull-workflow.js +1 -1
  151. package/dist/sdk/segment/push-recovery.js +1 -1
  152. package/dist/sdk/segment/push-workflow.js +1 -1
  153. package/dist/sdk/segment/resolution-context.js +1 -1
  154. package/dist/sdk/segment/segment-path-parser.js +1 -1
  155. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  156. package/dist/sdk/segment/segment-validator.js +1 -1
  157. package/dist/sdk/segment/target-resolution.js +1 -1
  158. package/dist/sdk/segment/tdx-config.js +1 -1
  159. package/dist/sdk/segment/types/activation-schema.js +1 -1
  160. package/dist/sdk/segment/types/journey-def.js +1 -1
  161. package/dist/sdk/segment/types/journey-schema.js +1 -1
  162. package/dist/sdk/segment/types/segment-def.js +1 -1
  163. package/dist/sdk/segment/types/segment-schema.js +1 -1
  164. package/dist/sdk/segment/validate-files.js +1 -1
  165. package/dist/sdk/segment/yaml-validator.js +1 -1
  166. package/dist/sdk/segment.js +1 -1
  167. package/dist/sdk/types/index.js +1 -1
  168. package/dist/sdk/types/progress.js +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/sdk/workspace/frontmatter.js +1 -1
  184. package/dist/sdk/workspace/git.js +1 -1
  185. package/dist/sdk/workspace/index.js +1 -1
  186. package/dist/sdk/workspace/templates.js +1 -1
  187. package/dist/sdk/workspace/weekly.js +1 -1
  188. package/dist/sdk/workspace/wikilinks.js +1 -1
  189. package/dist/test-utils/command-runner.js +1 -1
  190. package/dist/test-utils/factories.js +1 -1
  191. package/dist/test-utils/fixtures.js +1 -1
  192. package/dist/test-utils/http-mock.js +1 -1
  193. package/dist/test-utils/index.js +1 -1
  194. package/dist/utils/async.js +1 -1
  195. package/dist/utils/colors.js +1 -1
  196. package/dist/utils/diff.js +1 -1
  197. package/dist/utils/file-permissions.js +1 -1
  198. package/dist/utils/file-reader.js +1 -1
  199. package/dist/utils/github-releases.js +1 -1
  200. package/dist/utils/global-cache.js +1 -1
  201. package/dist/utils/json-loader.js +1 -1
  202. package/dist/utils/local-cache.js +1 -1
  203. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  204. package/dist/utils/logger/formatters/index.js +1 -1
  205. package/dist/utils/logger/handlers/console-handler.js +1 -1
  206. package/dist/utils/logger/handlers/file-handler.js +1 -1
  207. package/dist/utils/logger/handlers/index.js +1 -1
  208. package/dist/utils/logger/handlers/null-handler.js +1 -1
  209. package/dist/utils/logger/index.js +1 -1
  210. package/dist/utils/logger/logger.js +1 -1
  211. package/dist/utils/logger/types.js +1 -1
  212. package/dist/utils/option-validation.js +1 -1
  213. package/dist/utils/process.js +1 -1
  214. package/dist/utils/prompt.js +1 -1
  215. package/dist/utils/spinner.js +1 -1
  216. package/dist/utils/sse-parser.js +1 -1
  217. package/dist/utils/string-utils.js +1 -1
  218. package/dist/utils/table-ref-parser.js +1 -1
  219. package/dist/utils/tdx-logger.js +1 -1
  220. package/dist/utils/version-check.js +1 -1
  221. package/package.json +1 -1
@@ -1 +1 @@
1
- const a152_0x5626a8=a152_0x3af2;(function(_0x66b1e6,_0x594bc1){const _0x4f2756=a152_0x3af2,_0x1f4899=_0x66b1e6();while(!![]){try{const _0x2718f6=-parseInt(_0x4f2756(0x147))/0x1*(-parseInt(_0x4f2756(0xca))/0x2)+-parseInt(_0x4f2756(0x173))/0x3+-parseInt(_0x4f2756(0x13f))/0x4+parseInt(_0x4f2756(0xa4))/0x5+-parseInt(_0x4f2756(0x120))/0x6*(-parseInt(_0x4f2756(0x149))/0x7)+parseInt(_0x4f2756(0x10c))/0x8*(parseInt(_0x4f2756(0xd0))/0x9)+-parseInt(_0x4f2756(0x188))/0xa;if(_0x2718f6===_0x594bc1)break;else _0x1f4899['push'](_0x1f4899['shift']());}catch(_0x15ef21){_0x1f4899['push'](_0x1f4899['shift']());}}}(a152_0xae12,0x307bc));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x5626a8(0xa9));export const PENDING_SEGMENT_PREFIX=a152_0x5626a8(0xd4);export const PENDING_ACTIVATION_PREFIX=a152_0x5626a8(0xbc);export function createPendingSegmentId(_0x19ee91){return''+PENDING_SEGMENT_PREFIX+_0x19ee91+'__';}export function isPendingSegmentId(_0x3137d5){const _0x12e1fd=a152_0x5626a8;return _0x3137d5['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x3137d5[_0x12e1fd(0x172)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x417c76){const _0x2dcb9b=a152_0x5626a8;return _0x417c76[_0x2dcb9b(0xfa)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1e76b4){return''+PENDING_ACTIVATION_PREFIX+_0x1e76b4+'__';}export function isPendingActivationId(_0x261398){const _0x301561=a152_0x5626a8;return _0x261398[_0x301561(0x172)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x5aa130){const _0x433a77=a152_0x5626a8;return _0x5aa130[_0x433a77(0xfa)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x2240ff,_0x2ace16){const _0x4a4090=a152_0x5626a8,_0x591ea5=_0x2240ff+'::'+(_0x2ace16['trim']()||_0x4a4090(0x16d)),_0x2b6dcf=createHash(_0x4a4090(0x19e))[_0x4a4090(0xe2)](_0x591ea5)[_0x4a4090(0x176)]('hex')[_0x4a4090(0x10a)](0x0,0xc);return _0x4a4090(0xa2)+_0x2b6dcf;}export function ensureJourneyDefaults(_0x4db35d){const _0x180220=a152_0x5626a8;!_0x4db35d[_0x180220(0xed)]&&(_0x4db35d[_0x180220(0xed)]=''),!_0x4db35d[_0x180220(0x16b)]&&(_0x4db35d[_0x180220(0x16b)]=_0x180220(0x151));}export function injectExistingStageIds(_0x56b6af,_0x2fbb9a){const _0x273a5e=a152_0x5626a8,_0xdd31a=new Map(_0x2fbb9a['map'](_0x480121=>[_0x480121[_0x273a5e(0x117)],_0x480121['id']]));for(const _0x235344 of _0x56b6af){if(!_0x235344['id']){const _0x39b3e4=_0xdd31a[_0x273a5e(0x161)](_0x235344[_0x273a5e(0x117)]);_0x39b3e4&&(_0x235344['id']=_0x39b3e4);}}}export function resolveTDFolderPath(_0x522bbe,_0x39acf6,_0x23dc79){const _0x433458=a152_0x5626a8;if(!_0x39acf6)return _0x522bbe;if(_0x522bbe===_0x23dc79||_0x522bbe[_0x433458(0x172)](_0x23dc79+'/'))return _0x522bbe;return _0x522bbe?_0x23dc79+'/'+_0x522bbe:_0x23dc79;}export function addFoldersToCreate(_0x2160fa,_0x556801,_0x2570d5){const _0x1a97a6=a152_0x5626a8;if(!_0x2160fa)return;if(_0x556801[_0x1a97a6(0x166)](_0x2160fa))return;const _0x5f0a4b=_0x2160fa[_0x1a97a6(0x17f)]('/');let _0x31c3a4='';for(const _0x3ef3e4 of _0x5f0a4b){_0x31c3a4=_0x31c3a4?_0x31c3a4+'/'+_0x3ef3e4:_0x3ef3e4,!_0x556801[_0x1a97a6(0x166)](_0x31c3a4)&&_0x2570d5[_0x1a97a6(0x119)](_0x31c3a4);}}export function sortFoldersByDepth(_0x257ea9){return[..._0x257ea9]['sort']((_0x5bab3e,_0xa77563)=>{const _0x21267d=a152_0x3af2,_0x162fad=(_0x5bab3e[_0x21267d(0x154)](/\//g)||[])[_0x21267d(0x13a)],_0x4ab1e8=(_0xa77563[_0x21267d(0x154)](/\//g)||[])['length'];return _0x162fad-_0x4ab1e8;});}import*as a152_0xa6c136 from'yaml';import{readFileSync}from'fs';import a152_0xccb8fb from'path';import{isJourneyDef,parseYamlString as a152_0x425e6e,toYamlString as a152_0x1a0c30,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';function a152_0xae12(){const _0xd85b9a=['split','join','waitStepUnit','deleteSegment','from','day','activation_created','embeddedSegmentNameToId','):\x20','4036300zxaSXH','dirname','listActivations','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','validatedRequest','Activation','relative','journeyBundleName','kind','journeys','folderPath','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','getSegment\x20failed\x20for\x20','resolveJourneyId','run_after_journey_refresh','schedule','uniqueSegmentName','Failed\x20to\x20','segment_updated','steps','localName','sha1','\x27\x20exit\x20criteria','activation_','progress','existingActivation','delete','journey','getLatestJourneyId','logInfo','some','activationParams','\x27\x20not\x20found\x20in\x20journey\x20\x27','ACTIVATION_SYNTAX_ERROR','action','fetchJourney','journey_entry_criteria_','activation_deleting','1258175wmGLEe','journey_created','hasChanges','Name\x20has\x20already\x20been\x20taken','\x27\x20to\x20local\x20\x27','tdx.sdk.push-workflow','logDeleted','getSegmentEntity','Created\x20segment\x20\x27','keys','./child-segment-yaml.js','set','journeyName','\x0a\x20\x20','skipSegments','withProgress','and\x20the\x20server\x20segment,\x20then\x20retry.','Updating\x20segment\x20\x27','toString','createFolder','all','entries','behavior','existingSegment','__pending_act_','milestone','entry_criteria','Creating\x20folder\x20\x27','Failed\x20to\x20resolve\x20segment\x20','createdSegmentId','Segment\x20not\x20found','type','Created\x20folder\x20\x27','parseDocument','errors','Segment\x20not\x20found:\x20','deleted',').\x20','112978ZIFHTT','createActivation','activationActions','Entry\x20criteria:\x20','connector_config','values','1629chNGxH','Journey\x20\x27','../../utils/async.js','parentId','__pending_','created','segmentByFolderAndName','segmentNameToId','JOURNEY_SYNTAX_ERROR','waitStepType','nameToType','toLowerCase','parentSegmentFolder','versionNumber','embedded_activation_created','null','createSegment','debug','update','Matched\x20server\x20segment\x20\x27','idToName','rootFolderId','exitCriterias','segment_deleted','activations','folderId','Updated\x20journey\x20\x27','segment_creating','onProgress','description','toISOString','connectionIdToNameMap','embedded_segment_created','flatMap','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','DecisionPoint','segment_updating','folderPathToId','journeyId','folder_creating',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','existingJourney','replace','journeyStages','size','journey_updated','activation_template_id','data','connection','Condition','isArray','journey_creating','WaitStep','activation_creating','SEGMENT_NOT_FOUND','Updated\x20activation\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','resolveSegment','slice','resolvedRule','15648MXUsoK','deleteActivation','.$1.push-recovery.json','find','journeyById','\x20(referenced\x20in\x20journey\x20','conditionSegmentId','./journey-yaml.js','utf-8','journeyBundlesByFolderAndName','logWarning','name','reduce','add','relationships','stage\x20\x27','absolutePath','sort','effectiveFolderId','stringify','468OvbQPM','parse','Updated\x20segment\x20\x27','JOURNEY_UPDATE_ERROR','Embedded\x20segment\x20\x27','yamlConfig','Fetching\x20','INTERNAL','all_columns','max','conditionTimeoutUnit','parentFolder','rule','with','branches','\x27...','create','conditionTimeoutDuration','segment_created','journeyActivationNameToId','yamlActivation','segments','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','user','activationContext','segmentId','length','\x27\x20milestone','segmentFolderId','results','\x20error(s)','1054236QLqAJd','idToEmailMap','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','activation_updated','\x20journey\x20from\x20file:\x20','\x27\x20wait\x20condition','Creating\x20segment\x20\x27','Deleted\x20activation\x20\x27','3LRCTBI','getSegmentEntity\x20also\x20failed\x20for\x20','11116FgezuT','Created\x20journey\x20\x27','index','decision_point','Failed\x20to\x20resolve\x20activation\x20','buildUserMaps','message','push','draft','map','logSuccess','match','goal\x20criteria','Delete\x20the\x20push\x20recovery\x20file\x20(','existingSegments','attributes','notification','SEGMENT_SYNTAX_ERROR','includes','unchanged','filter','columns','journeyActivationStepId','\x27\x20by\x20rule\x20content','get','valid','deps','embedded_segment_creating','journeyBundleId','has','ACTIVATION_UPDATE_ERROR','getJourney','SEGMENT_UPDATE_ERROR','\x27\x20from\x20file:\x20','state','\x27\x20for\x20','segment','object','updateSegmentById','diff','createdSegmentIds','startsWith','99675syHcBi','conditions','NOT_FOUND','digest','item','uniqueServerName','updated','folder','createJourneySegment','goal','entryCriteria','isNew'];a152_0xae12=function(){return _0xd85b9a;};return a152_0xae12();}import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x1a5557){const _0x33bf29=a152_0x5626a8;if(Array[_0x33bf29(0x102)](_0x1a5557))return'['+_0x1a5557['map'](_0x373b29=>stableStringify(_0x373b29))['join'](',')+']';if(_0x1a5557&&typeof _0x1a5557===_0x33bf29(0x16e)){const _0x12d6cc=_0x1a5557,_0x3c0da0=Object[_0x33bf29(0xad)](_0x12d6cc)['sort'](),_0x552e43=_0x3c0da0[_0x33bf29(0x152)](_0x1780ba=>'\x22'+_0x1780ba+'\x22:'+stableStringify(_0x12d6cc[_0x1780ba]));return'{'+_0x552e43[_0x33bf29(0x180)](',')+'}';}const _0x4a42b8=JSON[_0x33bf29(0x11f)](_0x1a5557);return _0x4a42b8===undefined?_0x33bf29(0xdf):_0x4a42b8;}function activationSignature(_0x1cd628){const _0x2d2a54=a152_0x5626a8,_0x1aa5df={'connection':_0x1cd628['connection'],..._0x1cd628['all_columns']!==undefined&&{'all_columns':_0x1cd628[_0x2d2a54(0x128)]},..._0x1cd628[_0x2d2a54(0x15e)]!==undefined&&{'columns':_0x1cd628['columns']},..._0x1cd628[_0x2d2a54(0xba)]!==undefined&&{'behavior':_0x1cd628[_0x2d2a54(0xba)]},..._0x1cd628[_0x2d2a54(0x198)]!==undefined&&{'schedule':_0x1cd628[_0x2d2a54(0x198)]},..._0x1cd628[_0x2d2a54(0x159)]!==undefined&&{'notification':_0x1cd628[_0x2d2a54(0x159)]},..._0x1cd628[_0x2d2a54(0xce)]!==undefined&&{'connector_config':_0x1cd628[_0x2d2a54(0xce)]},..._0x1cd628[_0x2d2a54(0xfe)]!==undefined&&{'activation_template_id':_0x1cd628[_0x2d2a54(0xfe)]}};return stableStringify(_0x1aa5df);}async function fetchSegment(_0x5c24d2,_0x20e2fe,_0xac7211,_0x1dc3d8){const _0x3eec5f=a152_0x5626a8,_0x1dd6d1=_0x1dc3d8?.[_0x3eec5f(0x10f)](_0x576f75=>_0x576f75['id']===_0xac7211);if(_0x1dd6d1)return _0x1dd6d1;try{return await _0x5c24d2[_0x3eec5f(0x16d)]['getSegment'](_0x20e2fe,_0xac7211);}catch(_0x2893b3){logger[_0x3eec5f(0xe1)](_0x3eec5f(0x195)+_0xac7211+_0x3eec5f(0xf8)+_0x2893b3);try{return await _0x5c24d2[_0x3eec5f(0x16d)][_0x3eec5f(0xab)](_0xac7211);}catch(_0x3a3f51){return logger[_0x3eec5f(0xe1)](_0x3eec5f(0x148)+_0xac7211+':\x20'+_0x3a3f51),null;}}}function recoverSegmentIdsFromPushRecovery(_0x16c3b8,_0x2432ed,_0x2e91c5){const _0x4804fb=a152_0x5626a8,_0x16055a=readPushRecovery(_0x16c3b8[_0x4804fb(0x11c)]);if(_0x16055a?.[_0x4804fb(0xb0)]===_0x16c3b8['yamlConfig'][_0x4804fb(0x117)])for(const [_0x8b9333,_0x3c6734]of Object[_0x4804fb(0xb9)](_0x16055a[_0x4804fb(0x135)])){const _0x5eb0ff=generateDeterministicJourneySegmentName(_0x16c3b8['yamlConfig'][_0x4804fb(0x117)],_0x8b9333);_0x3c6734['uniqueServerName']===_0x5eb0ff&&(_0x2432ed[_0x4804fb(0xaf)](_0x8b9333,_0x3c6734['segmentId']),_0x2e91c5[_0x4804fb(0xaf)](_0x8b9333,_0x3c6734[_0x4804fb(0x139)]));}}async function createOrRecoverEmbeddedSegment(_0x970038,_0x1a6460,_0x3270fb,_0x3225f6){const _0x2878e1=a152_0x5626a8;let _0x23d377;try{_0x23d377=await _0x970038['segment'][_0x2878e1(0x17b)]({'name':_0x3270fb[_0x2878e1(0x199)],'description':_0x3270fb[_0x2878e1(0xed)],'journeyId':_0x3270fb[_0x2878e1(0xf6)],'rule':_0x3225f6(_0x3270fb[_0x2878e1(0x10b)],!![]),'countPopulation':!![],'parentFolderId':_0x3270fb['folderId'],'audienceId':_0x3270fb[_0x2878e1(0xd3)]});}catch(_0x563bec){const _0x3612bb=_0x563bec instanceof Error&&_0x563bec[_0x2878e1(0x14f)][_0x2878e1(0x15b)](_0x2878e1(0xa7));if(_0x3612bb){const _0x37f0e7=readPushRecovery(_0x1a6460[_0x2878e1(0x11c)]),_0x505293=_0x37f0e7?.[_0x2878e1(0xb0)]===_0x1a6460['yamlConfig'][_0x2878e1(0x117)]?_0x37f0e7['segments'][_0x3270fb[_0x2878e1(0x19d)]]:undefined;if(_0x505293?.[_0x2878e1(0x178)]===_0x3270fb[_0x2878e1(0x199)])await _0x970038['segment']['updateSegmentById'](_0x3270fb[_0x2878e1(0xd3)],_0x505293[_0x2878e1(0x139)],{'description':_0x3270fb[_0x2878e1(0xed)],'rule':_0x3225f6(_0x3270fb['resolvedRule'],!![]),'countPopulation':!![]}),_0x23d377=_0x505293[_0x2878e1(0x139)];else throw new SDKError(ErrorCode[_0x2878e1(0x169)],_0x2878e1(0x124)+_0x3270fb[_0x2878e1(0x19d)]+_0x2878e1(0x194)+(_0x2878e1(0x156)+_0x1a6460['absolutePath']['replace'](/([^/]+)$/,_0x2878e1(0x10e))+')\x20')+_0x2878e1(0xb4),_0x563bec);}else throw _0x563bec;}return saveSegmentToPushRecovery(_0x1a6460['absolutePath'],_0x1a6460['yamlConfig'][_0x2878e1(0x117)],_0x3270fb['localName'],{'segmentId':_0x23d377,'uniqueServerName':_0x3270fb[_0x2878e1(0x199)],'createdAt':new Date()[_0x2878e1(0xee)]()}),_0x23d377;}export async function prepareSegmentFiles(_0x20489a,_0x27eafa,_0x1b9a7e,_0x3aecd3,_0x3774b7){const _0x19225a=a152_0x5626a8,{activationDefToCreateRequest:_0x3d4b66}=await import(_0x19225a(0xae)),_0x2f4c45=[],_0x5bfc6c=new Set();for(const {yamlConfig:_0x58817c,folderPath:_0x51626e,sourcePath:_0x183fed}of _0x20489a){const _0x359969=resolveTDFolderPath(_0x51626e,_0x3aecd3,_0x3774b7),_0x292243=_0x359969+':'+_0x58817c['name'],_0x469ab6=_0x27eafa[_0x19225a(0xd6)][_0x19225a(0x161)](_0x292243),_0x52a4cc=_0x469ab6?_0x27eafa['activationsBySegmentId'][_0x19225a(0x161)](_0x469ab6['id'])||[]:[];addFoldersToCreate(_0x359969,_0x27eafa[_0x19225a(0xf5)],_0x5bfc6c);const _0x447491=calculateActivationActions(_0x58817c['activations']||[],_0x52a4cc,_0x27eafa[_0x19225a(0x140)],_0x27eafa[_0x19225a(0xef)]);for(const _0x62d944 of _0x447491){(_0x62d944[_0x19225a(0xc3)]===_0x19225a(0x130)||_0x62d944['type']===_0x19225a(0xe2))&&_0x62d944[_0x19225a(0x134)]&&(_0x62d944[_0x19225a(0x18d)]=await _0x3d4b66(_0x62d944[_0x19225a(0x134)],_0x1b9a7e));}const _0x5c3085=calculateSegmentDiff(_0x58817c,_0x469ab6,_0x52a4cc,_0x27eafa[_0x19225a(0x140)],_0x27eafa['connectionIdToNameMap']);_0x2f4c45[_0x19225a(0x150)]({'relativePath':_0x58817c[_0x19225a(0x117)],'absolutePath':_0x183fed,'yamlConfig':_0x58817c,'folderPath':_0x359969,'existingSegment':_0x469ab6,'existingActivations':_0x52a4cc,'isNew':_0x5c3085[_0x19225a(0x17e)],'hasChanges':_0x5c3085['hasChanges'],'diff':_0x5c3085[_0x19225a(0x170)],'activationActions':_0x447491});}return{'segmentFiles':_0x2f4c45,'foldersToCreate':_0x5bfc6c};}export async function prepareJourneyFiles(_0x40a12f,_0x5f01f8,_0x16973d,_0x30aea2){const _0x486ea7=a152_0x5626a8,_0x40a005=[],_0x2ae29b=new Set();for(const {yamlConfig:_0x2bae7b,folderPath:_0x3fa8ee,sourcePath:_0x5c4f05}of _0x40a12f){const _0xa3ba0a=resolveTDFolderPath(_0x3fa8ee,_0x16973d,_0x30aea2),_0x4352e8=_0xa3ba0a+':'+_0x2bae7b[_0x486ea7(0x117)],_0x4274d9=_0x5f01f8[_0x486ea7(0x115)][_0x486ea7(0x161)](_0x4352e8);let _0x58260d,_0x1d6eb8;if(_0x4274d9&&_0x4274d9[_0x486ea7(0x13a)]>0x0){const _0x33c8a9=buildLocalExpandedRuleMappings(_0x2bae7b),{createYamlContext:_0x5b32da,prefetchJourneySegments:_0x2cd296}=createPushYamlContextForBundle(_0x5f01f8[_0x486ea7(0x163)],_0x5f01f8['parentId'],_0x5f01f8[_0x486ea7(0x157)],_0x33c8a9,_0x5f01f8['idToEmailMap'],_0x5f01f8[_0x486ea7(0xef)],_0x5f01f8['activationStepsById'],_0x5f01f8['journeyById']);await _0x2cd296(_0x4274d9[_0x486ea7(0x152)](_0x260156=>_0x260156['id']));const _0x3efee1=await _0x5f01f8['deps'][_0x486ea7(0x99)][_0x486ea7(0x9a)](_0x4274d9[0x0][_0x486ea7(0x165)]),_0x448cc0=hasMultipleVersions(_0x2bae7b),_0x8f801=async _0x3f4320=>{const _0x1c9b57=_0x486ea7,_0xa2ba7b=_0x5f01f8[_0x1c9b57(0x110)]?.[_0x1c9b57(0x161)](_0x3f4320);if(_0xa2ba7b)return _0xa2ba7b;return _0x5f01f8[_0x1c9b57(0xa1)]({'journeyId':_0x3f4320,'journeyName':_0x2bae7b[_0x1c9b57(0x117)],'isMultiVersion':_0x4274d9[_0x1c9b57(0x13a)]>0x1});};if(_0x448cc0&&_0x4274d9['length']>0x1){const _0x4f8e63=[];for(const _0x2787b8 of _0x4274d9){const _0x311228=_0x2787b8[_0x486ea7(0xdd)]||0x1;_0x5f01f8[_0x486ea7(0x96)]?.['update'](_0x486ea7(0x126)+_0x2bae7b[_0x486ea7(0x117)]+'\x20v'+_0x311228);const _0x5e05ee=await _0x8f801(_0x2787b8['id']),_0x14bf66=_0x5b32da(_0x2787b8['id']),_0x1b9622=await journeyResponseToDef(_0x5e05ee,_0x14bf66);_0x4f8e63[_0x486ea7(0x150)]({'item':_0x2787b8,'yaml':_0x1b9622});}const _0x273900=buildLocalRuleToNameMappingFromJourney(_0x2bae7b);_0x1d6eb8=buildMergedJourneyDef(_0x4f8e63,_0x273900,_0x3efee1);const _0x2a8de2=Math['max'](..._0x4f8e63[_0x486ea7(0x152)](_0x1a2662=>_0x1a2662[_0x486ea7(0x177)][_0x486ea7(0xdd)]||0x0)),_0x4ab52f=_0x4274d9[_0x486ea7(0x10f)](_0x11ad49=>(_0x11ad49[_0x486ea7(0xdd)]||0x0)===_0x2a8de2);_0x4ab52f&&(_0x5f01f8['progress']?.['update'](_0x486ea7(0x126)+_0x2bae7b[_0x486ea7(0x117)]+'\x20v'+_0x2a8de2),_0x58260d=await _0x8f801(_0x4ab52f['id']));}else{const _0x2967e2=_0x4274d9[_0x4274d9[_0x486ea7(0x13a)]-0x1];_0x5f01f8[_0x486ea7(0x96)]?.['update']('Fetching\x20'+_0x2bae7b['name']),_0x58260d=await _0x8f801(_0x2967e2['id']);const _0x352877=_0x5b32da(_0x2967e2['id']),_0x585aba=await journeyResponseToDef(_0x58260d,_0x352877),_0x2557c6=buildLocalRuleToNameMappingFromJourney(_0x2bae7b);_0x1d6eb8=buildMergedJourneyDef([{'item':_0x2967e2,'yaml':_0x585aba}],_0x2557c6,_0x3efee1);}}addFoldersToCreate(_0xa3ba0a,_0x5f01f8['folderPathToId'],_0x2ae29b);const _0x48f681=calculateJourneyDiff(_0x2bae7b,_0x1d6eb8);_0x40a005['push']({'relativePath':_0x2bae7b[_0x486ea7(0x117)],'absolutePath':_0x5c4f05,'yamlConfig':_0x2bae7b,'folderPath':_0xa3ba0a,'existingJourney':_0x58260d,'isNew':_0x48f681[_0x486ea7(0x17e)],'hasChanges':_0x48f681[_0x486ea7(0xa6)],'diff':_0x48f681['diff']});}return{'journeyFiles':_0x40a005,'foldersToCreate':_0x2ae29b};}export function calculateActivationActions(_0x2d6ae5,_0x5a0693,_0x572da7,_0x87f19a){const _0x48b100=a152_0x5626a8,_0x38a27d=[],_0x373394=new Map();for(const _0x5fd41c of _0x5a0693){_0x373394[_0x48b100(0xaf)](_0x5fd41c[_0x48b100(0x117)],_0x5fd41c);}const _0x337a94=new Map();for(const _0x291e66 of _0x2d6ae5){_0x337a94[_0x48b100(0xaf)](_0x291e66['name'],_0x291e66);}for(const _0x858472 of _0x2d6ae5){const _0x2391a9=_0x373394[_0x48b100(0x161)](_0x858472[_0x48b100(0x117)]);if(!_0x2391a9)_0x38a27d[_0x48b100(0x150)]({'type':_0x48b100(0x130),'name':_0x858472[_0x48b100(0x117)],'yamlActivation':_0x858472});else{const _0x2be045=activationResponseToDef(_0x2391a9,_0x572da7,_0x87f19a),_0x4b481a=a152_0xa6c136[_0x48b100(0x11f)](_0x2be045),_0x3310bc=a152_0xa6c136[_0x48b100(0x11f)](_0x858472);_0x4b481a!==_0x3310bc&&_0x38a27d[_0x48b100(0x150)]({'type':'update','name':_0x858472[_0x48b100(0x117)],'yamlActivation':_0x858472,'existingActivation':_0x2391a9});}}for(const _0x3f6c09 of _0x5a0693){!_0x337a94[_0x48b100(0x166)](_0x3f6c09['name'])&&_0x38a27d[_0x48b100(0x150)]({'type':_0x48b100(0x98),'name':_0x3f6c09[_0x48b100(0x117)],'existingActivation':_0x3f6c09});}return _0x38a27d;}function calculateYamlDiff(_0x3350de,_0x303d86){if(_0x303d86){const _0x208cb4=generateDiff(_0x303d86,_0x3350de),_0x3251a0=hasChanges(_0x208cb4);return{'isNew':![],'hasChanges':_0x3251a0,'diff':_0x3251a0?formatDiffWithColors(_0x208cb4):undefined};}const _0x1dfd16=generateDiff('',_0x3350de);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1dfd16)};}export function calculateSegmentDiff(_0x4b6b2d,_0x4f6b3e,_0x3cf6c2,_0x348707,_0x5a0dda){const _0x215c21=segmentToYamlString(_0x4b6b2d),_0x3f1192=_0x4f6b3e?segmentToYamlString(segmentWithActivationsToYaml(_0x4f6b3e,_0x3cf6c2,undefined,_0x348707,_0x5a0dda)):undefined;return calculateYamlDiff(_0x215c21,_0x3f1192);}export function calculateJourneyDiff(_0x1c50c0,_0x44e8c6){const _0x7f1193=normalizeJourneyDef(_0x1c50c0,_0x1c50c0),_0x539850=a152_0x1a0c30(_0x7f1193),_0x310362=_0x44e8c6?a152_0x1a0c30(normalizeJourneyDef(_0x44e8c6,_0x1c50c0)):undefined;return calculateYamlDiff(_0x539850,_0x310362);}export function findSegmentsToDelete(_0x138ed1,_0x33a092,_0x419038,_0x14a014,_0x49f747){const _0x78b4c2=a152_0x5626a8,_0x599dc1=new Set();for(const {yamlConfig:_0xdef46f,folderPath:_0x2ea049}of _0x33a092){_0x599dc1[_0x78b4c2(0x119)](_0x2ea049+':'+_0xdef46f[_0x78b4c2(0x117)]);}return _0x138ed1[_0x78b4c2(0x15d)](_0x386134=>{const _0x4eb70a=_0x78b4c2,_0x1baefa=_0x386134[_0x4eb70a(0x13c)]?_0x419038[_0x4eb70a(0x161)](_0x386134['segmentFolderId'][_0x4eb70a(0xb6)]())||'':'',_0x5b168c=_0x1baefa+':'+_0x386134[_0x4eb70a(0x117)];if(_0x599dc1[_0x4eb70a(0x166)](_0x5b168c))return![];if(_0x49f747)return _0x1baefa===_0x14a014||_0x1baefa[_0x4eb70a(0x172)](_0x14a014+'/');return!![];});}export function findJourneysToDelete(_0x56bd6e,_0x2931af,_0x155b95,_0x12a5a0,_0x5f495b){const _0x3764d9=a152_0x5626a8,_0x224de3=new Set();for(const {yamlConfig:_0x308656,folderPath:_0x3b2c35}of _0x2931af){_0x224de3[_0x3764d9(0x119)](_0x3b2c35+':'+_0x308656['name']);}return _0x56bd6e['filter'](_0x134a0f=>{const _0x2871a4=_0x3764d9,_0x161fb3=_0x134a0f['folderId']?_0x155b95[_0x2871a4(0x161)](_0x134a0f[_0x2871a4(0xe9)])||'':'',_0x410b29=_0x161fb3+':'+_0x134a0f[_0x2871a4(0x190)];if(_0x224de3[_0x2871a4(0x166)](_0x410b29))return![];if(_0x5f495b)return _0x161fb3===_0x12a5a0||_0x161fb3[_0x2871a4(0x172)](_0x12a5a0+'/');return!![];});}export function buildSegmentLookupMap(_0x466dda,_0xcde34b){const _0x3ce467=a152_0x5626a8,_0x404ea8=new Map();for(const _0xd8fc58 of _0x466dda){const _0x5a9b3b=_0xd8fc58[_0x3ce467(0x13c)]?_0xcde34b[_0x3ce467(0x161)](_0xd8fc58[_0x3ce467(0x13c)][_0x3ce467(0xb6)]())||'':'',_0x38ab24=_0x5a9b3b+':'+_0xd8fc58['name'];_0x404ea8[_0x3ce467(0xaf)](_0x38ab24,_0xd8fc58);}return _0x404ea8;}export function buildSegmentNameToIdMap(_0x23e0a2){const _0x2d10f1=a152_0x5626a8,_0x111f8f=new Map();for(const _0x59be96 of _0x23e0a2){_0x111f8f[_0x2d10f1(0xaf)](_0x59be96['name'],_0x59be96['id']);}return _0x111f8f;}export function buildJourneyBundleLookupMap(_0x5bf4f2,_0x2366e2){const _0x12ec99=a152_0x5626a8,_0x2dd888=new Map();for(const _0x40a7f3 of _0x5bf4f2){const _0x5e476b=_0x40a7f3[_0x12ec99(0xe9)]?_0x2366e2[_0x12ec99(0x161)](_0x40a7f3[_0x12ec99(0xe9)])||'':'',_0x4ac84d=_0x5e476b+':'+_0x40a7f3['journeyBundleName'];!_0x2dd888[_0x12ec99(0x166)](_0x4ac84d)&&_0x2dd888['set'](_0x4ac84d,[]),_0x2dd888[_0x12ec99(0x161)](_0x4ac84d)[_0x12ec99(0x150)](_0x40a7f3);}for(const _0x5b4847 of _0x2dd888[_0x12ec99(0xcf)]()){_0x5b4847['sort']((_0x587c87,_0x5b829f)=>(_0x587c87[_0x12ec99(0xdd)]||0x0)-(_0x5b829f['versionNumber']||0x0));}return _0x2dd888;}export function collectFoldersToCreate(_0x30ade6,_0x39f207){const _0x1e65ef=a152_0x5626a8,_0x150936=new Set();for(const _0x9a7585 of _0x30ade6){if(!_0x9a7585)continue;if(_0x39f207[_0x1e65ef(0x166)](_0x9a7585))continue;const _0x461d82=_0x9a7585['split']('/');let _0x2c7fef='';for(const _0xf8f3c of _0x461d82){_0x2c7fef=_0x2c7fef?_0x2c7fef+'/'+_0xf8f3c:_0xf8f3c,!_0x39f207[_0x1e65ef(0x166)](_0x2c7fef)&&_0x150936['add'](_0x2c7fef);}}return _0x150936;}export function parseAndClassifyYamlFiles(_0x4f4cfb,_0x27ebd9,_0x330ed2){const _0x24c044=a152_0x5626a8,_0x23eeae=[],_0x51223e=[];for(const _0x394716 of _0x4f4cfb){const _0x186c21=a152_0xccb8fb[_0x24c044(0x18f)](_0x27ebd9,a152_0xccb8fb[_0x24c044(0x189)](_0x394716)),_0x352b7e=_0x186c21==='.'?'':_0x186c21,_0x337a1e=readFileSync(_0x394716,_0x24c044(0x114)),_0x3abbb5=a152_0xa6c136[_0x24c044(0x121)](_0x337a1e);if(isJourneyDef(_0x3abbb5)){const _0x19702b=a152_0x425e6e(_0x337a1e);_0x51223e[_0x24c044(0x150)]({'yamlConfig':_0x19702b,'folderPath':_0x352b7e,'sourcePath':_0x394716});}else{if(!_0x330ed2?.[_0x24c044(0xb2)]){const _0x3bc8fd=parseSegmentYamlFile(_0x337a1e),_0x14cc3b=normalizeChildSegmentYaml(_0x3bc8fd);_0x23eeae[_0x24c044(0x150)]({'yamlConfig':_0x14cc3b,'folderPath':_0x352b7e,'sourcePath':_0x394716});}}}return{'segments':_0x23eeae,'journeys':_0x51223e};}export function validateParsedFiles(_0x1ce78a,_0x17d682){const _0x45c814=a152_0x5626a8,_0x28adef=[];for(const {yamlConfig:_0x50fed0,sourcePath:_0x19926f}of _0x1ce78a['segments']){const _0x97e611=readFileSync(_0x19926f,'utf-8'),_0x485453=a152_0xa6c136['parseDocument'](_0x97e611),_0x280d82=validateSegmentDef(_0x50fed0,{'source':_0x97e611,'document':_0x485453},{'skipSchema':!![]});if(!_0x280d82[_0x45c814(0x162)]){const _0x2c6c0e=a152_0xccb8fb[_0x45c814(0x18f)](_0x17d682,_0x19926f);_0x28adef[_0x45c814(0x150)]({'filePath':_0x2c6c0e,'source':_0x97e611,'result':_0x280d82,'isJourney':![]});}}for(const {yamlConfig:_0x3574c9,sourcePath:_0x515df1}of _0x1ce78a[_0x45c814(0x192)]){const _0x6754e=readFileSync(_0x515df1,'utf-8'),_0x3b0569=a152_0xa6c136[_0x45c814(0xc5)](_0x6754e),_0x66a614=validateJourneyDef(_0x3574c9,{'source':_0x6754e,'document':_0x3b0569},{'skipSchema':!![]});if(!_0x66a614['valid']){const _0x4768a5=a152_0xccb8fb['relative'](_0x17d682,_0x515df1);_0x28adef[_0x45c814(0x150)]({'filePath':_0x4768a5,'source':_0x6754e,'result':_0x66a614,'isJourney':!![]});}}return _0x28adef;}export function formatValidationErrors(_0x3900cf){const _0x2d8bb6=a152_0x5626a8,_0x1d7edd=[];for(const {filePath:_0x40cdee,source:_0x3f4167,result:_0x187cc6,isJourney:_0x474787}of _0x3900cf){const _0x4f7618=_0x474787?_0x2d8bb6(0x99):_0x2d8bb6(0x16d);_0x1d7edd[_0x2d8bb6(0x150)]('\x0a'+_0x40cdee+'\x20('+_0x4f7618+_0x2d8bb6(0x187)+_0x187cc6[_0x2d8bb6(0xc6)][_0x2d8bb6(0x13a)]+_0x2d8bb6(0x13e)),_0x1d7edd[_0x2d8bb6(0x150)](formatValidationResult(_0x187cc6,_0x3f4167,_0x40cdee));}return _0x1d7edd[_0x2d8bb6(0x180)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x15fd61){const _0x2eeccc=a152_0x5626a8,_0x5d6db5=new Set(),_0x275df8=new Map(),_0x343699=collectSegmentUsageCounts(_0x15fd61);if(_0x15fd61[_0x2eeccc(0x135)])for(const [_0x2c3016,_0x56ded6]of Object['entries'](_0x15fd61[_0x2eeccc(0x135)])){_0x5d6db5[_0x2eeccc(0x119)](_0x2c3016);if(_0x56ded6[_0x2eeccc(0x12c)]){const _0x2f5902=yamlRuleToApi(_0x56ded6['rule']),_0x5349cb=apiRuleToYaml(_0x2f5902);_0x275df8[_0x2eeccc(0xaf)](_0x2c3016,_0x5349cb);}}const _0x4c2ebc=new Map();let _0xd0fe1d=0x0;for(const [_0x1c89f2,_0x25a149]of _0x275df8){const _0x241399=serializeExpandedRule(_0x25a149,_0x275df8),_0x260828=_0x4c2ebc['get'](_0x241399)||[];_0x260828['push']({'name':_0x1c89f2,'index':_0xd0fe1d}),_0x4c2ebc[_0x2eeccc(0xaf)](_0x241399,_0x260828),_0xd0fe1d++;}const _0x32b74f=new Map();for(const [_0x2a19cd,_0x8293ab]of _0x4c2ebc){const _0x3d9a51=_0x8293ab[_0x2eeccc(0x10a)]()['sort']((_0x5157d2,_0x5adf18)=>{const _0x450ccd=_0x2eeccc,_0xcf538d=_0x343699[_0x450ccd(0x161)](_0x5157d2[_0x450ccd(0x117)])||0x0,_0x3db45d=_0x343699[_0x450ccd(0x161)](_0x5adf18[_0x450ccd(0x117)])||0x0;if(_0xcf538d!==_0x3db45d)return _0x3db45d-_0xcf538d;return _0x5157d2['index']-_0x5adf18[_0x450ccd(0x14b)];})[_0x2eeccc(0x152)](_0x37dc84=>_0x37dc84[_0x2eeccc(0x117)]),_0x461f10=[];for(const _0x40fbf9 of _0x3d9a51){const _0x36c7d2=_0x343699[_0x2eeccc(0x161)](_0x40fbf9)||0x0,_0x5124f6=Math[_0x2eeccc(0x129)](_0x36c7d2,0x1);for(let _0x29d7aa=0x0;_0x29d7aa<_0x5124f6;_0x29d7aa++){_0x461f10['push'](_0x40fbf9);}}_0x32b74f['set'](_0x2a19cd,_0x461f10);}return{'existingLocalSegmentNames':_0x5d6db5,'localSegmentRules':_0x275df8,'localExpandedRuleToNames':_0x32b74f};}export function createSegmentIdResolver(_0x2afc55,_0x2acfb0){return async _0x476455=>{const _0x1a9011=a152_0x3af2,_0x14eae0=_0x2afc55[_0x1a9011(0x161)](_0x476455);if(!_0x14eae0)throw new SDKError(ErrorCode[_0x1a9011(0x106)],_0x1a9011(0xc7)+_0x476455+_0x1a9011(0xf2)+_0x2acfb0+'\x27)');return _0x14eae0;};}export function extractRootFolderId(_0x5748b3){const _0x2da82e=a152_0x5626a8;return _0x5748b3[_0x2da82e(0x11a)]?.[_0x2da82e(0xdc)]?.[_0x2da82e(0xff)]?.['id']||_0x5748b3[_0x2da82e(0x11a)]?.[_0x2da82e(0x12b)]?.[_0x2da82e(0xff)]?.['id'];}export function buildConnectionMaps(_0x3eed58){const _0x1e9370=a152_0x5626a8,_0x51da66=new Map(),_0x282087=new Map(),_0x4d7cc4=new Map();for(const _0x26019e of _0x3eed58){_0x51da66[_0x1e9370(0xaf)](_0x26019e[_0x1e9370(0x117)],parseInt(_0x26019e['id'],0xa)),_0x282087[_0x1e9370(0xaf)](_0x26019e['id'],_0x26019e['name']),_0x4d7cc4[_0x1e9370(0xaf)](_0x26019e[_0x1e9370(0x117)],_0x26019e[_0x1e9370(0xc3)]);}return{'nameToId':_0x51da66,'idToName':_0x282087,'nameToType':_0x4d7cc4};}export function calculatePushStats(_0x2bb9de,_0x299de0,_0x3869da,_0x4d3e69,_0x5aec34,_0x457638,_0x5da3df){const _0x4d7e54=a152_0x5626a8,_0xe2b2a8=_0x2bb9de[_0x4d7e54(0x15d)](_0x59e3ae=>_0x59e3ae[_0x4d7e54(0x17e)]),_0x208137=_0x2bb9de[_0x4d7e54(0x15d)](_0x198f8e=>!_0x198f8e['isNew']&&_0x198f8e['hasChanges']),_0x25ee9f=_0x2bb9de[_0x4d7e54(0x15d)](_0x1c1b19=>!_0x1c1b19[_0x4d7e54(0x17e)]&&!_0x1c1b19['hasChanges']),_0x57c5c8=_0x457638?_0x4d3e69:[],_0x1f2d1e=_0x299de0[_0x4d7e54(0x15d)](_0x1cecf5=>_0x1cecf5[_0x4d7e54(0x17e)]),_0x5d5275=_0x299de0[_0x4d7e54(0x15d)](_0x2eff77=>!_0x2eff77[_0x4d7e54(0x17e)]&&_0x2eff77[_0x4d7e54(0xa6)]),_0x17e2ef=_0x299de0[_0x4d7e54(0x15d)](_0x99124b=>!_0x99124b[_0x4d7e54(0x17e)]&&!_0x99124b[_0x4d7e54(0xa6)]),_0x28e07e=_0x457638?_0x5aec34:[],_0x2e1100=_0x2bb9de[_0x4d7e54(0xf1)](_0x167e7c=>_0x167e7c[_0x4d7e54(0xcc)]),_0x757e8b=_0x2e1100[_0x4d7e54(0x15d)](_0x5724a8=>_0x5724a8[_0x4d7e54(0xc3)]===_0x4d7e54(0x130)),_0x3032b3=_0x2e1100['filter'](_0x1d178a=>_0x1d178a[_0x4d7e54(0xc3)]===_0x4d7e54(0xe2)),_0x44e506=_0x2e1100['filter'](_0x3f34ea=>_0x3f34ea['type']===_0x4d7e54(0x98)),_0x56976a=Array[_0x4d7e54(0x183)](_0x3869da)[_0x4d7e54(0x11d)](),_0x14882a=_0x5da3df?![]:_0xe2b2a8[_0x4d7e54(0x13a)]>0x0||_0x208137['length']>0x0||_0x57c5c8[_0x4d7e54(0x13a)]>0x0,_0x396bef=_0x1f2d1e[_0x4d7e54(0x13a)]>0x0||_0x5d5275[_0x4d7e54(0x13a)]>0x0||_0x28e07e[_0x4d7e54(0x13a)]>0x0,_0x371e0e=_0x5da3df?![]:_0x2e1100['length']>0x0,_0x578835=_0x56976a['length']>0x0;return{'segments':{'new':_0xe2b2a8,'changed':_0x208137,'unchanged':_0x25ee9f,'toDelete':_0x57c5c8},'journeys':{'new':_0x1f2d1e,'changed':_0x5d5275,'unchanged':_0x17e2ef,'toDelete':_0x28e07e},'activations':{'all':_0x2e1100,'toCreate':_0x757e8b,'toUpdate':_0x3032b3,'toDelete':_0x44e506},'folders':{'toCreate':_0x56976a},'counts':{'segments':{'new':_0xe2b2a8[_0x4d7e54(0x13a)],'changed':_0x208137[_0x4d7e54(0x13a)],'unchanged':_0x25ee9f[_0x4d7e54(0x13a)],'toDelete':_0x57c5c8['length']},'journeys':{'new':_0x1f2d1e['length'],'changed':_0x5d5275[_0x4d7e54(0x13a)],'unchanged':_0x17e2ef['length'],'toDelete':_0x28e07e['length']},'activations':{'create':_0x757e8b[_0x4d7e54(0x13a)],'update':_0x3032b3['length'],'delete':_0x44e506['length']},'folders':_0x56976a[_0x4d7e54(0x13a)]},'hasChanges':_0x14882a||_0x396bef||_0x371e0e||_0x578835};}export async function buildPushExecutionContext(_0x11ce46,_0x24cc3f,_0x15fa60,_0x3ba708,_0x1ba08b,_0x344e34){const _0x3b75d0=a152_0x5626a8,_0x53f62a=extractRootFolderId(_0x15fa60),{pathToId:_0x4d614d,idToPath:_0x45aba4}=buildFolderMaps(_0x1ba08b),_0x3e7ea3=buildSegmentNameToIdMap(_0x3ba708),_0x6d4087=new Map(),{batchAsync:_0x4afde7}=await import(_0x3b75d0(0xd2)),[_0x164001,_0x38e28b]=await Promise[_0x3b75d0(0xb8)]([_0x11ce46[_0x3b75d0(0x137)][_0x3b75d0(0x14e)](),_0x11ce46[_0x3b75d0(0x100)]['list'](),((async()=>{const _0x504196=_0x3b75d0;!_0x344e34&&_0x3ba708[_0x504196(0x13a)]>0x0&&await _0x4afde7(_0x3ba708,async _0x23722e=>{const _0x306ad3=_0x504196,_0x18febe=await _0x11ce46[_0x306ad3(0x16d)][_0x306ad3(0x18a)](_0x24cc3f,_0x23722e['id']);_0x6d4087[_0x306ad3(0xaf)](_0x23722e['id'],_0x18febe);});})())]),{emailToId:_0x2311d7,idToEmail:_0xd9be11}=_0x164001,_0x1be8a3=buildConnectionMaps(_0x38e28b);return{'rootFolderId':_0x53f62a,'folderPathToId':_0x4d614d,'folderIdToPath':_0x45aba4,'segmentNameToId':_0x3e7ea3,'activationsBySegmentId':_0x6d4087,'emailToIdMap':_0x2311d7,'idToEmailMap':_0xd9be11,'connectionNameToIdMap':_0x1be8a3['nameToId'],'connectionIdToNameMap':_0x1be8a3[_0x3b75d0(0xe4)],'connectionNameToTypeMap':_0x1be8a3[_0x3b75d0(0xda)]};}export function createPushYamlContextForBundle(_0x93d8ad,_0xe3c066,_0x130bd9,_0x328738,_0x4d895f,_0x49da61,_0x15dbcc,_0x4f83f3){const {existingLocalSegmentNames:_0x41b2ba,localExpandedRuleToNames:_0x365198}=_0x328738,_0x595474=new Set(),_0x3f0629=new Map(),_0x2749d6=new Map(),_0x2a1c93=new Map(),_0x3927db=createJumpTargetCache(),_0x373fa2=new Map(),_0x51b8ca=new Map(),_0x3aca6b=new Set();let _0x521107;const _0x1c40d2=_0x51cbc3=>{const _0x180381={'resolveSegment':async _0x19cb67=>{const _0x3a77ad=a152_0x3af2,_0x32f5af=_0x2a1c93[_0x3a77ad(0x161)](_0x19cb67);if(_0x32f5af!==undefined)return{'name':_0x32f5af,'isJourneyLocal':!![]};try{const _0x42e310=await fetchSegment(_0x93d8ad,_0xe3c066,_0x19cb67,_0x130bd9);if(!_0x42e310)throw new Error(_0x3a77ad(0xc2));const _0x4fb338=generateJourneyLocalName(_0x42e310[_0x3a77ad(0x117)]),_0xfba4b6=_0x42e310[_0x3a77ad(0x191)]===SEGMENT_KIND_JOURNEY&&_0x4fb338!==undefined;let _0x32f350=_0x42e310[_0x3a77ad(0x117)],_0x420e9a;if(_0xfba4b6&&_0x42e310[_0x3a77ad(0x12c)]){const _0x5775b2=apiRuleToYaml(_0x42e310[_0x3a77ad(0x12c)]);_0x51b8ca[_0x3a77ad(0xaf)](_0x19cb67,_0x5775b2);const _0x5b7202=async _0x3df844=>{const _0x435021=_0x3a77ad,_0x231e59=collectSegmentRefsFromRule(_0x3df844);for(const _0x5c3df1 of _0x231e59){if(!_0x51b8ca[_0x435021(0x166)](_0x5c3df1))try{const _0x517484=await fetchSegment(_0x93d8ad,_0xe3c066,_0x5c3df1,_0x130bd9);if(_0x517484?.[_0x435021(0x12c)]){const _0x1b2917=apiRuleToYaml(_0x517484[_0x435021(0x12c)]);_0x51b8ca[_0x435021(0xaf)](_0x5c3df1,_0x1b2917),await _0x5b7202(_0x1b2917);}}catch(_0x5a19ea){logger['debug']('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x5c3df1+':\x20'+_0x5a19ea);}}};await _0x5b7202(_0x5775b2);const _0x196c9c=serializeExpandedRule(_0x5775b2,_0x51b8ca),_0x2c0fd7=_0x365198[_0x3a77ad(0x161)](_0x196c9c);if(_0x2c0fd7&&_0x2c0fd7[_0x3a77ad(0x13a)]>0x0){const _0x9a5dc9=_0x3f0629['get'](_0x196c9c)||0x0,_0x42ea79=_0x2c0fd7[_0x9a5dc9]||_0x2c0fd7[_0x2c0fd7[_0x3a77ad(0x13a)]-0x1];_0x3f0629['set'](_0x196c9c,_0x9a5dc9+0x1),_0x32f350=_0x42ea79,_0x595474[_0x3a77ad(0x119)](_0x32f350),_0x2a1c93[_0x3a77ad(0xaf)](_0x19cb67,_0x32f350);const _0x1a0c9b=await resolveRuleSegmentRefs(_0x5775b2,async _0x4146f7=>{const _0x5235d3=_0x3a77ad,_0x4bc708=_0x2a1c93[_0x5235d3(0x161)](_0x4146f7);if(_0x4bc708)return _0x4bc708;const _0x2d5d36=await _0x521107[_0x5235d3(0x109)](_0x4146f7);return _0x2d5d36[_0x5235d3(0x117)];});_0x420e9a={'description':_0x42e310[_0x3a77ad(0xed)],'rule':_0x1a0c9b};}else{const _0x5e7a2d=_0x373fa2[_0x3a77ad(0x161)](_0x196c9c);if(_0x5e7a2d)_0x32f350=_0x5e7a2d,_0x2a1c93['set'](_0x19cb67,_0x32f350);else{if(_0x4fb338){let _0x29d3a8=_0x4fb338,_0x7e748b=0x2;while(_0x595474[_0x3a77ad(0x166)](_0x29d3a8)||_0x41b2ba[_0x3a77ad(0x166)](_0x29d3a8)){_0x29d3a8=_0x4fb338+'_'+_0x7e748b,_0x7e748b++;}_0x595474['add'](_0x29d3a8),_0x32f350=_0x29d3a8;}_0x2a1c93[_0x3a77ad(0xaf)](_0x19cb67,_0x32f350),_0x373fa2['set'](_0x196c9c,_0x32f350);const _0x260ccf=await resolveRuleSegmentRefs(_0x5775b2,async _0x535e2e=>{const _0xb4889e=_0x3a77ad,_0x26d9c6=_0x2a1c93['get'](_0x535e2e);if(_0x26d9c6)return _0x26d9c6;const _0xc0654f=await _0x521107[_0xb4889e(0x109)](_0x535e2e);return _0xc0654f[_0xb4889e(0x117)];});_0x420e9a={'description':_0x42e310[_0x3a77ad(0xed)],'rule':_0x260ccf};}}}return{'name':_0x32f350,'isJourneyLocal':_0xfba4b6,'definition':_0x420e9a};}catch(_0x5dbf62){return logger['debug'](_0x3a77ad(0xc0)+_0x19cb67+':\x20'+_0x5dbf62),{'name':_0x19cb67,'isJourneyLocal':![]};}},'resolveActivation':async _0x2c661d=>{const _0x4fd4bc=a152_0x3af2,_0x5f5b12=_0x2749d6[_0x4fd4bc(0x161)](_0x2c661d);if(_0x5f5b12!==undefined)return{'name':_0x5f5b12,'isJourneyLocal':!![]};try{let _0x55965a=_0x15dbcc?.[_0x4fd4bc(0x161)](_0x2c661d);!_0x55965a&&(_0x55965a=await _0x93d8ad[_0x4fd4bc(0x99)]['getActivation'](_0x51cbc3,_0x2c661d));const _0x362474=_0x55965a[_0x4fd4bc(0x158)][_0x4fd4bc(0x9d)]['name']||_0x2c661d,_0x484571=sanitizeYamlKey(_0x362474)||_0x4fd4bc(0x1a0)+_0x2c661d,_0x30dfdd=_0x484571;_0x2749d6['set'](_0x2c661d,_0x30dfdd);const _0x364233=journeyActivationStepToYaml(_0x55965a,_0x4d895f,_0x49da61);return{'name':_0x30dfdd,'isJourneyLocal':!![],'definition':_0x364233};}catch(_0x2d2061){return logger['debug'](_0x4fd4bc(0x14d)+_0x2c661d+':\x20'+_0x2d2061),{'name':_0x2c661d,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x13aa60,_0x5b59bd)=>resolveJumpTarget(_0x13aa60,_0x5b59bd,_0x3927db,async _0x27dc85=>{const _0x266b21=a152_0x3af2,_0xcf0deb=_0x4f83f3?.[_0x266b21(0x161)](_0x27dc85);if(_0xcf0deb)return _0xcf0deb;return _0x93d8ad[_0x266b21(0x99)][_0x266b21(0x168)](_0x27dc85);})};return _0x521107=_0x180381,_0x180381;},_0x37be8c=async _0x37f0e4=>{const _0x3b9442=a152_0x3af2,{collectSegmentIdsFromJourneyApi:_0x5f287e}=await import(_0x3b9442(0x113)),{batchAsync:_0x58f9b1}=await import(_0x3b9442(0xd2)),_0x432c16=new Set();for(const _0x22af2a of _0x37f0e4){let _0x470aa6=_0x4f83f3?.[_0x3b9442(0x161)](_0x22af2a);!_0x470aa6&&(_0x470aa6=await _0x93d8ad[_0x3b9442(0x99)][_0x3b9442(0x168)](_0x22af2a));const _0x52b3cc=_0x5f287e(_0x470aa6);for(const _0xafd39a of _0x52b3cc){_0x432c16[_0x3b9442(0x119)](_0xafd39a);}}let _0x36846e=Array[_0x3b9442(0x183)](_0x432c16);while(_0x36846e[_0x3b9442(0x13a)]>0x0){const _0x54dc9c=_0x36846e['filter'](_0x3b7f0b=>!_0x3aca6b[_0x3b9442(0x166)](_0x3b7f0b));if(_0x54dc9c[_0x3b9442(0x13a)]===0x0)break;const _0x1352f1=await _0x58f9b1(_0x54dc9c,async _0x384771=>{const _0x5d2234=_0x3b9442;_0x3aca6b[_0x5d2234(0x119)](_0x384771);const _0x1fdee7=await fetchSegment(_0x93d8ad,_0xe3c066,_0x384771,_0x130bd9);if(!_0x1fdee7)return null;return{'segmentId':_0x384771,'segment':_0x1fdee7};},0xa),_0x8c1c46=new Set();for(const _0x46aae3 of _0x1352f1){if(!_0x46aae3?.['segment']?.[_0x3b9442(0x12c)])continue;const _0x229dbc=apiRuleToYaml(_0x46aae3[_0x3b9442(0x16d)][_0x3b9442(0x12c)]);_0x51b8ca['set'](_0x46aae3[_0x3b9442(0x139)],_0x229dbc);const _0xce207f=collectSegmentRefsFromRule(_0x229dbc);for(const _0x45e5a9 of _0xce207f){!_0x3aca6b[_0x3b9442(0x166)](_0x45e5a9)&&_0x8c1c46['add'](_0x45e5a9);}}_0x36846e=Array[_0x3b9442(0x183)](_0x8c1c46);}};return{'createYamlContext':_0x1c40d2,'prefetchJourneySegments':_0x37be8c};}export async function executePushSegments(_0x12ed98,_0x30c220,_0x5de4ea,_0x42905e,_0x1a3b05){const _0x4b4733=a152_0x5626a8,{segmentDefToCreateRequest:_0x25a86e,segmentDefToUpdateRequest:_0x3eb509}=await import(_0x4b4733(0xae)),_0x14b073=_0x5de4ea[_0x4b4733(0xf5)],_0x435eb7=0x5,_0x4e5be1=async _0x5e26de=>{const _0x282fbf=_0x4b4733,_0x5d3f2d=_0x5e26de['folderPath']?_0x14b073[_0x282fbf(0x161)](_0x5e26de['folderPath']):undefined;let _0x160c0c;const _0x3b88de={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x401b24=_0x5e26de['yamlConfig'];if(_0x5e26de['yamlConfig'][_0x282fbf(0x12c)]){const _0x5ef479=createSegmentIdResolver(_0x5de4ea['segmentNameToId'],_0x5e26de['yamlConfig'][_0x282fbf(0x117)]),_0xd1190=await resolveRuleSegmentIds(_0x5e26de[_0x282fbf(0x125)][_0x282fbf(0x12c)],_0x5ef479);_0x401b24={..._0x5e26de['yamlConfig'],'rule':_0xd1190};}try{if(_0x5e26de[_0x282fbf(0x17e)]){_0x1a3b05[_0x282fbf(0xec)]?.({'type':_0x282fbf(0xeb),'name':_0x5e26de['yamlConfig']['name']});const _0x59ce71=_0x25a86e(_0x401b24,_0x5d3f2d),_0x1a5f20=await _0x1a3b05[_0x282fbf(0xb3)](_0x282fbf(0x145)+_0x5e26de[_0x282fbf(0x125)]['name']+_0x282fbf(0x12f),()=>_0x12ed98['segment'][_0x282fbf(0xe0)](_0x42905e[_0x282fbf(0xd3)],_0x59ce71));_0x160c0c=_0x1a5f20[_0x282fbf(0xff)]['id'],_0x5de4ea[_0x282fbf(0xd7)]['set'](_0x5e26de[_0x282fbf(0x125)][_0x282fbf(0x117)],_0x160c0c),_0x3b88de['createdSegmentId']={'name':_0x5e26de['yamlConfig'][_0x282fbf(0x117)],'id':_0x160c0c},_0x1a3b05[_0x282fbf(0xec)]?.({'type':_0x282fbf(0x132),'name':_0x5e26de[_0x282fbf(0x125)][_0x282fbf(0x117)],'segmentId':_0x160c0c}),_0x1a3b05[_0x282fbf(0x153)]?.(_0x282fbf(0xac)+_0x5e26de[_0x282fbf(0x125)][_0x282fbf(0x117)]+'\x27'),_0x3b88de['created']=0x1;}else{if(_0x5e26de[_0x282fbf(0xa6)]){_0x1a3b05[_0x282fbf(0xec)]?.({'type':_0x282fbf(0xf4),'name':_0x5e26de[_0x282fbf(0x125)]['name']});const _0x8334cf=_0x3eb509(_0x401b24);_0x5d3f2d!==_0x5e26de[_0x282fbf(0xbb)]?.['segmentFolderId']&&(_0x8334cf[_0x282fbf(0x13c)]=_0x5d3f2d?parseInt(_0x5d3f2d,0xa):undefined),await _0x1a3b05[_0x282fbf(0xb3)](_0x282fbf(0xb5)+_0x5e26de[_0x282fbf(0x125)]['name']+_0x282fbf(0x12f),()=>_0x12ed98[_0x282fbf(0x16d)][_0x282fbf(0x16f)](_0x42905e[_0x282fbf(0xd3)],_0x5e26de[_0x282fbf(0xbb)]['id'],_0x8334cf)),_0x160c0c=_0x5e26de['existingSegment']['id'],_0x1a3b05[_0x282fbf(0xec)]?.({'type':_0x282fbf(0x19b),'name':_0x5e26de[_0x282fbf(0x125)][_0x282fbf(0x117)]}),_0x1a3b05[_0x282fbf(0x153)]?.(_0x282fbf(0x122)+_0x5e26de[_0x282fbf(0x125)][_0x282fbf(0x117)]+'\x27'),_0x3b88de[_0x282fbf(0x179)]=0x1;}else _0x160c0c=_0x5e26de[_0x282fbf(0xbb)]['id'];}}catch(_0x4ced2f){const _0x3f9e76=isHttp400Error(_0x4ced2f),_0x17c822=_0x3f9e76?ErrorCode[_0x282fbf(0x15a)]:ErrorCode[_0x282fbf(0x169)],_0x29fc2a=getErrorMessage(_0x4ced2f);throw new SDKError(_0x17c822,_0x282fbf(0x19a)+(_0x5e26de[_0x282fbf(0x17e)]?'create':'update')+'\x20segment\x20from\x20file:\x20'+_0x5e26de['absolutePath']+_0x282fbf(0xb1)+_0x29fc2a,_0x4ced2f);}try{const _0x39b6e2=await syncActivationsForSegment(_0x12ed98,_0x42905e[_0x282fbf(0xd3)],_0x160c0c,_0x5e26de[_0x282fbf(0x125)][_0x282fbf(0x117)],_0x5e26de['activationActions'],_0x1a3b05,_0x5e26de[_0x282fbf(0x11c)]);_0x3b88de['activations']=_0x39b6e2;}catch(_0x1adc07){if(_0x1adc07 instanceof SDKError)throw _0x1adc07;throw new SDKError(ErrorCode[_0x282fbf(0x167)],_0x282fbf(0x18b)+_0x5e26de[_0x282fbf(0x125)][_0x282fbf(0x117)]+_0x282fbf(0x16a)+_0x5e26de['absolutePath']+_0x282fbf(0xb1)+getErrorMessage(_0x1adc07),_0x1adc07);}return _0x3b88de;},_0x30f223=await batchAsync(_0x30c220,_0x4e5be1,_0x435eb7),_0x1af0f6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3f3686 of _0x30f223){_0x1af0f6[_0x4b4733(0xd5)]+=_0x3f3686[_0x4b4733(0xd5)],_0x1af0f6[_0x4b4733(0x179)]+=_0x3f3686[_0x4b4733(0x179)],_0x3f3686[_0x4b4733(0xc1)]&&_0x1af0f6[_0x4b4733(0x171)][_0x4b4733(0xaf)](_0x3f3686['createdSegmentId'][_0x4b4733(0x117)],_0x3f3686[_0x4b4733(0xc1)]['id']),_0x1af0f6['activations'][_0x4b4733(0xd5)]+=_0x3f3686[_0x4b4733(0xe8)][_0x4b4733(0xd5)],_0x1af0f6[_0x4b4733(0xe8)][_0x4b4733(0x179)]+=_0x3f3686[_0x4b4733(0xe8)][_0x4b4733(0x179)],_0x1af0f6[_0x4b4733(0xe8)][_0x4b4733(0xc8)]+=_0x3f3686[_0x4b4733(0xe8)][_0x4b4733(0xc8)];}return _0x1af0f6;}async function syncActivationsForSegment(_0xda5c2d,_0x38e07c,_0x113343,_0x2560ef,_0x30fc9d,_0x3b9d61,_0x8d2dd4){const _0x642326=a152_0x5626a8,_0x13e4f0={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xbea344 of _0x30fc9d){try{if(_0xbea344[_0x642326(0xc3)]===_0x642326(0x130)&&_0xbea344['validatedRequest'])_0x3b9d61['onProgress']?.({'type':_0x642326(0x105),'segmentName':_0x2560ef,'activationName':_0xbea344[_0x642326(0x117)]}),await _0x3b9d61[_0x642326(0xb3)]('Creating\x20activation\x20\x27'+_0xbea344[_0x642326(0x117)]+'\x27...',()=>_0xda5c2d[_0x642326(0x16d)][_0x642326(0xcb)](_0x38e07c,_0x113343,_0xbea344['validatedRequest'])),_0x3b9d61['onProgress']?.({'type':_0x642326(0x185),'segmentName':_0x2560ef,'activationName':_0xbea344[_0x642326(0x117)]}),_0x3b9d61[_0x642326(0x153)]?.('Created\x20activation\x20\x27'+_0xbea344[_0x642326(0x117)]+'\x27'),_0x13e4f0['created']++;else{if(_0xbea344[_0x642326(0xc3)]===_0x642326(0xe2)&&_0xbea344[_0x642326(0x18d)]&&_0xbea344[_0x642326(0x97)])_0x3b9d61[_0x642326(0xec)]?.({'type':'activation_updating','segmentName':_0x2560ef,'activationName':_0xbea344[_0x642326(0x117)]}),await _0x3b9d61[_0x642326(0xb3)]('Updating\x20activation\x20\x27'+_0xbea344[_0x642326(0x117)]+_0x642326(0x12f),()=>_0xda5c2d['segment']['updateActivation'](_0x38e07c,_0x113343,_0xbea344['existingActivation']['id'],_0xbea344[_0x642326(0x18d)])),_0x3b9d61[_0x642326(0xec)]?.({'type':_0x642326(0x142),'segmentName':_0x2560ef,'activationName':_0xbea344['name']}),_0x3b9d61[_0x642326(0x153)]?.(_0x642326(0x107)+_0xbea344[_0x642326(0x117)]+'\x27'),_0x13e4f0[_0x642326(0x179)]++;else _0xbea344['type']===_0x642326(0x98)&&_0xbea344[_0x642326(0x97)]&&(_0x3b9d61[_0x642326(0xec)]?.({'type':_0x642326(0xa3),'segmentName':_0x2560ef,'activationName':_0xbea344[_0x642326(0x117)]}),await _0x3b9d61[_0x642326(0xb3)]('Deleting\x20activation\x20\x27'+_0xbea344['name']+_0x642326(0x12f),()=>_0xda5c2d[_0x642326(0x16d)][_0x642326(0x10d)](_0x38e07c,_0x113343,_0xbea344['existingActivation']['id'])),_0x3b9d61[_0x642326(0xec)]?.({'type':'activation_deleted','segmentName':_0x2560ef,'activationName':_0xbea344[_0x642326(0x117)]}),_0x3b9d61[_0x642326(0xaa)]?.(_0x642326(0x146)+_0xbea344[_0x642326(0x117)]+'\x27'),_0x13e4f0[_0x642326(0xc8)]++);}}catch(_0x51d9a8){const _0x17672c=isHttp400Error(_0x51d9a8),_0x533800=_0x17672c?ErrorCode[_0x642326(0x9f)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x49d1a3=getErrorMessage(_0x51d9a8);throw new SDKError(_0x533800,_0x642326(0x19a)+_0xbea344[_0x642326(0xc3)]+'\x20activation\x20\x27'+_0xbea344[_0x642326(0x117)]+_0x642326(0x16a)+_0x8d2dd4+_0x642326(0xb1)+_0x49d1a3,_0x51d9a8);}}return _0x13e4f0;}export async function executePushFolders(_0x5db280,_0x3a2800,_0x2b1502,_0x44df35,_0xfe8430){const _0xef37dc=a152_0x5626a8,_0x3fa4e9=new Map(_0x2b1502),_0x371b74=sortFoldersByDepth(_0x3a2800);for(const _0x5751b8 of _0x371b74){const _0x357de7=_0x5751b8[_0xef37dc(0x17f)]('/'),_0x473fc9=_0x357de7[_0x357de7[_0xef37dc(0x13a)]-0x1],_0x253d9a=_0x357de7[_0xef37dc(0x10a)](0x0,-0x1)[_0xef37dc(0x180)]('/'),_0x594adb=_0x3fa4e9[_0xef37dc(0x161)](_0x253d9a);_0xfe8430['onProgress']?.({'type':_0xef37dc(0xf7),'folder':_0x5751b8});const _0x359aeb={'name':_0x473fc9,'parentFolderId':_0x594adb},_0x236eb9=await _0xfe8430['withProgress'](_0xef37dc(0xbf)+_0x5751b8+_0xef37dc(0x12f),()=>_0x5db280[_0xef37dc(0x16d)][_0xef37dc(0xb7)](_0x44df35[_0xef37dc(0xd3)],_0x359aeb));_0x3fa4e9[_0xef37dc(0xaf)](_0x5751b8,_0x236eb9[_0xef37dc(0xff)]['id']),_0xfe8430[_0xef37dc(0xec)]?.({'type':'folder_created','folder':_0x5751b8,'folderId':_0x236eb9[_0xef37dc(0xff)]['id']}),_0xfe8430[_0xef37dc(0x9b)]?.(_0xef37dc(0xc4)+_0x5751b8+'\x27');}return _0x3fa4e9;}export async function executePushSegmentDeletions(_0x485463,_0x17d7d4,_0x361a52){const _0x49ee9f=a152_0x5626a8;if(_0x17d7d4['length']===0x0)return 0x0;const {batchAsync:_0x2f2755}=await import(_0x49ee9f(0xd2)),_0x45490a=0x5,_0x432fb6=await _0x2f2755(_0x17d7d4,async _0x578637=>{const _0x154221=_0x49ee9f;return _0x361a52[_0x154221(0xec)]?.({'type':'segment_deleting','name':_0x578637[_0x154221(0x117)]}),await _0x485463['segment'][_0x154221(0x182)](_0x578637['id']),_0x361a52['onProgress']?.({'type':_0x154221(0xe7),'name':_0x578637[_0x154221(0x117)]}),_0x361a52[_0x154221(0xaa)]?.('Deleted\x20segment\x20\x27'+_0x578637[_0x154221(0x117)]+'\x27'),0x1;},_0x45490a);return _0x432fb6[_0x49ee9f(0x118)]((_0x4fdafe,_0x21797c)=>_0x4fdafe+_0x21797c,0x0);}export async function executePushJourneys(_0x550e2e,_0x26b39d,_0x6104ef,_0x17e252,_0x4f6a5e){const _0x26e031=a152_0x5626a8,{journeyDefToRequest:_0x10e606}=await import(_0x26e031(0x113)),{activationDefToCreateRequest:_0x45238d,yamlRuleToApi:_0x5cd59e,validateSegmentRule:_0x4cb22d}=await import(_0x26e031(0xae)),_0x2c2f7d={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1c08d6=new Map(_0x6104ef[_0x26e031(0xd7)]),_0x690ad8=0x5;for(let _0x2d353c=0x0;_0x2d353c<_0x26b39d[_0x26e031(0x13a)];_0x2d353c+=_0x690ad8){const _0x2d8cce=_0x26b39d['slice'](_0x2d353c,_0x2d353c+_0x690ad8),_0x52c78b=await Promise[_0x26e031(0xb8)](_0x2d8cce[_0x26e031(0x152)](async _0x262e48=>{const _0x5cd8f7=_0x26e031;if(!_0x262e48[_0x5cd8f7(0x17e)]&&!_0x262e48['hasChanges'])return{'action':_0x5cd8f7(0x15c),'name':_0x262e48['yamlConfig'][_0x5cd8f7(0x117)],'journeyId':_0x262e48['existingJourney']?.['id']};const _0x5811ab=_0x262e48[_0x5cd8f7(0x193)]?_0x6104ef[_0x5cd8f7(0xf5)][_0x5cd8f7(0x161)](_0x262e48[_0x5cd8f7(0x193)]):undefined;_0x4f6a5e['onProgress']?.({'type':_0x262e48[_0x5cd8f7(0x17e)]?_0x5cd8f7(0x103):'journey_updating','name':_0x262e48['yamlConfig']['name']});try{const _0x595c45=await executeSingleJourneyPush(_0x550e2e,_0x262e48,{..._0x6104ef,'segmentNameToId':_0x1c08d6},{'parentId':_0x17e252[_0x5cd8f7(0xd3)],'rootFolderId':_0x17e252['rootFolderId'],'folderId':_0x5811ab,'verbose':_0x17e252['verbose']},_0x4f6a5e,{'journeyDefToRequest':_0x10e606,'activationDefToCreateRequest':_0x45238d,'yamlRuleToApi':_0x5cd59e,'validateSegmentRule':_0x4cb22d});for(const [_0x2059eb,_0xb33b7a]of _0x595c45[_0x5cd8f7(0x186)]){_0x1c08d6[_0x5cd8f7(0xaf)](_0x2059eb,_0xb33b7a),_0x2c2f7d[_0x5cd8f7(0x186)][_0x5cd8f7(0xaf)](_0x2059eb,_0xb33b7a);}if(_0x595c45[_0x5cd8f7(0xa0)]===_0x5cd8f7(0xd5))_0x4f6a5e[_0x5cd8f7(0xec)]?.({'type':_0x5cd8f7(0xa5),'name':_0x262e48[_0x5cd8f7(0x125)]['name'],'journeyId':_0x595c45[_0x5cd8f7(0xf6)]}),_0x4f6a5e[_0x5cd8f7(0x153)]?.(_0x5cd8f7(0x14a)+_0x262e48['yamlConfig'][_0x5cd8f7(0x117)]+'\x27'),_0x2c2f7d[_0x5cd8f7(0xd5)]++;else _0x595c45[_0x5cd8f7(0xa0)]===_0x5cd8f7(0x179)&&(_0x4f6a5e[_0x5cd8f7(0xec)]?.({'type':_0x5cd8f7(0xfd),'name':_0x262e48[_0x5cd8f7(0x125)]['name']}),_0x4f6a5e[_0x5cd8f7(0x153)]?.(_0x5cd8f7(0xea)+_0x262e48[_0x5cd8f7(0x125)]['name']+'\x27'),_0x2c2f7d[_0x5cd8f7(0x179)]++);return{'action':_0x595c45[_0x5cd8f7(0xa0)],'name':_0x262e48[_0x5cd8f7(0x125)][_0x5cd8f7(0x117)],'journeyId':_0x595c45['journeyId']};}catch(_0x10b626){const _0xff2c4=isHttp400Error(_0x10b626),_0x5e7f54=_0xff2c4?ErrorCode[_0x5cd8f7(0xd8)]:ErrorCode[_0x5cd8f7(0x123)],_0x2822c7=getErrorMessage(_0x10b626);throw new SDKError(_0x5e7f54,_0x5cd8f7(0x19a)+(_0x262e48['isNew']?_0x5cd8f7(0x130):_0x5cd8f7(0xe2))+_0x5cd8f7(0x143)+_0x262e48['absolutePath']+'\x0a\x20\x20'+_0x2822c7,_0x10b626);}}));_0x2c2f7d[_0x26e031(0x13d)]['push'](..._0x52c78b);}return _0x2c2f7d;}async function matchExistingJourneySegments(_0x5434f8,_0x4a628d,_0x2b1894,_0x571d46,_0x4e456c){const _0x46dc3f=a152_0x5626a8;if(!_0x4a628d[_0x46dc3f(0xf9)]||!_0x4a628d['yamlConfig'][_0x46dc3f(0x135)])return;const _0x574d8a=new Map(),_0x1c570b=new Set();for(const _0x430e5e of Object[_0x46dc3f(0xad)](_0x4a628d[_0x46dc3f(0x125)][_0x46dc3f(0x135)])){const _0xbf5167=generateDeterministicJourneySegmentName(_0x4a628d[_0x46dc3f(0x125)][_0x46dc3f(0x117)],_0x430e5e);_0x574d8a[_0x46dc3f(0xaf)](_0xbf5167,_0x430e5e),_0x1c570b[_0x46dc3f(0x119)](_0x430e5e);}const _0x5f3d8d=[],_0x161f39=collectSegmentIdsFromJourneyApi(_0x4a628d[_0x46dc3f(0xf9)]);for(const _0x460d18 of _0x161f39){const _0x216fa5=await fetchSegment(_0x5434f8,_0x2b1894,_0x460d18,_0x571d46);if(!_0x216fa5?.[_0x46dc3f(0x117)])continue;const _0x2564d2=_0x574d8a[_0x46dc3f(0x161)](_0x216fa5['name']);_0x2564d2?(_0x4e456c[_0x46dc3f(0xaf)](_0x2564d2,_0x460d18),_0x1c570b[_0x46dc3f(0x98)](_0x2564d2)):_0x5f3d8d['push']({'id':_0x460d18,'seg':_0x216fa5});}if(_0x1c570b[_0x46dc3f(0xfc)]>0x0&&_0x5f3d8d[_0x46dc3f(0x13a)]>0x0){const {localExpandedRuleToNames:_0x2c4cf1}=buildLocalExpandedRuleMappings(_0x4a628d[_0x46dc3f(0x125)]),_0x378289=new Map();for(const {id:_0x4d6def,seg:_0x591f37}of _0x5f3d8d){if(_0x591f37['rule']){const _0x4d40b9=apiRuleToYaml(_0x591f37[_0x46dc3f(0x12c)]);_0x378289[_0x46dc3f(0xaf)](_0x4d6def,_0x4d40b9);}}for(const {id:_0x5c2af5,seg:_0x2d7c45}of _0x5f3d8d){if(!_0x2d7c45[_0x46dc3f(0x12c)])continue;const _0x526f27=_0x378289[_0x46dc3f(0x161)](_0x5c2af5);if(!_0x526f27)continue;const _0x2425f0=serializeExpandedRule(_0x526f27,_0x378289),_0xfff75c=_0x2c4cf1[_0x46dc3f(0x161)](_0x2425f0);if(_0xfff75c){const _0x1eb7b4=_0xfff75c[_0x46dc3f(0x10f)](_0x99d1ba=>_0x1c570b[_0x46dc3f(0x166)](_0x99d1ba));_0x1eb7b4&&(_0x4e456c['set'](_0x1eb7b4,_0x5c2af5),_0x1c570b[_0x46dc3f(0x98)](_0x1eb7b4),logger[_0x46dc3f(0xe1)](_0x46dc3f(0xe3)+_0x2d7c45[_0x46dc3f(0x117)]+_0x46dc3f(0xa8)+_0x1eb7b4+_0x46dc3f(0x160)));}}}}async function executeSingleJourneyPush(_0x23a90b,_0x216f69,_0xe16b3c,_0x6120e9,_0x185d2c,_0x485824){const _0x2e7ed4=a152_0x5626a8,{journeyDefToRequest:_0x532f4b,activationDefToCreateRequest:_0x9e2ecc,yamlRuleToApi:_0x181ef1,validateSegmentRule:_0x3cab62}=_0x485824,_0x2749f0=new Map(),_0x489e09=new Map();recoverSegmentIdsFromPushRecovery(_0x216f69,_0x2749f0,_0xe16b3c['segmentNameToId']);const _0x191627=new Map(),_0x39b2a2=new Map(),_0x1c7acf=new Map();let _0x4a7087;const _0x514b5f=async()=>{const _0x515861=a152_0x3af2;if(_0x4a7087)return;_0x4a7087=new Map();if(!_0x216f69[_0x515861(0xf9)])return;const _0x45ee3c=await _0x23a90b[_0x515861(0x99)][_0x515861(0x18a)](_0x216f69['existingJourney']['id']);for(const _0x13da70 of _0x45ee3c){const _0x4fb400=journeyActivationStepToYaml(_0x13da70,_0xe16b3c[_0x515861(0x140)],_0xe16b3c['connectionIdToNameMap']),_0x55a7e4=activationSignature(_0x4fb400);!_0x4a7087[_0x515861(0x166)](_0x55a7e4)&&_0x4a7087[_0x515861(0xaf)](_0x55a7e4,_0x13da70['id']),_0x4fb400['name']&&_0x489e09[_0x515861(0xaf)](_0x4fb400[_0x515861(0x117)],_0x13da70['id']);}};await matchExistingJourneySegments(_0x23a90b,_0x216f69,_0x6120e9[_0x2e7ed4(0xd3)],_0xe16b3c[_0x2e7ed4(0x157)],_0xe16b3c[_0x2e7ed4(0xd7)]);const _0x446561={'resolveSegmentId':async _0x27486a=>{const _0x3a5dfd=_0x2e7ed4,_0xe144d8=_0xe16b3c[_0x3a5dfd(0xd7)][_0x3a5dfd(0x161)](_0x27486a);if(!_0xe144d8)throw new SDKError(ErrorCode[_0x3a5dfd(0x106)],'Segment\x20not\x20found:\x20'+_0x27486a+_0x3a5dfd(0x111)+_0x216f69[_0x3a5dfd(0x125)][_0x3a5dfd(0x117)]+')');return _0xe144d8;},'resolveEmbeddedSegmentId':async(_0x2794bd,_0x4bee69)=>{const _0x213b29=_0x2e7ed4,_0x1ad7af=_0xe16b3c[_0x213b29(0xd7)][_0x213b29(0x161)](_0x2794bd);if(_0x1ad7af)return _0x1ad7af;const _0x260724=_0xe16b3c[_0x213b29(0x157)][_0x213b29(0x10f)](_0x3abe07=>_0x3abe07[_0x213b29(0x117)]===_0x2794bd);if(_0x260724)return _0xe16b3c['segmentNameToId']['set'](_0x2794bd,_0x260724['id']),_0x260724['id'];if(_0x216f69[_0x213b29(0x17e)]){const {stageName:_0x26a196,criteriaName:_0xf92f88}=findSegmentCriteriaLocation(_0x216f69[_0x213b29(0x125)],_0x2794bd);return _0x3cab62(_0x2794bd,_0x4bee69[_0x213b29(0x12c)]),_0x39b2a2[_0x213b29(0xaf)](_0x2794bd,{'definition':_0x4bee69,'stageName':_0x26a196,'criteriaName':_0xf92f88}),createPendingSegmentId(_0x2794bd);}const _0xa72054=_0x216f69[_0x213b29(0xf9)]?.['id'];if(!_0xa72054)throw new SDKError(ErrorCode[_0x213b29(0x127)],_0x213b29(0x18c));const _0x2e3a47=_0x191627[_0x213b29(0x161)](_0x2794bd);if(_0x2e3a47)return _0x2e3a47;const _0x8b5360=((async()=>{const _0x293c73=_0x213b29;_0x3cab62(_0x2794bd,_0x4bee69['rule']);const _0x57dbeb=generateDeterministicJourneySegmentName(_0x216f69['yamlConfig'][_0x293c73(0x117)],_0x2794bd),_0x598eac=_0xe16b3c[_0x293c73(0x157)]['find'](_0x146f88=>_0x146f88['name']===_0x57dbeb),_0x5b2fe6=createSegmentIdResolver(_0xe16b3c[_0x293c73(0xd7)],_0x2794bd),_0x371a7f=await resolveRuleSegmentIds(_0x4bee69[_0x293c73(0x12c)],_0x5b2fe6);let _0x4ccd21;return _0x598eac?(await _0x23a90b['segment'][_0x293c73(0x16f)](_0x6120e9[_0x293c73(0xd3)],_0x598eac['id'],{'description':_0x4bee69[_0x293c73(0xed)]||_0x293c73(0xcd)+_0x2794bd,'rule':_0x181ef1(_0x371a7f),'countPopulation':!![]}),_0x4ccd21=_0x598eac['id'],saveSegmentToPushRecovery(_0x216f69[_0x293c73(0x11c)],_0x216f69[_0x293c73(0x125)][_0x293c73(0x117)],_0x2794bd,{'segmentId':_0x4ccd21,'uniqueServerName':_0x57dbeb,'createdAt':new Date()[_0x293c73(0xee)]()})):_0x4ccd21=await createOrRecoverEmbeddedSegment(_0x23a90b,_0x216f69,{'localName':_0x2794bd,'uniqueSegmentName':_0x57dbeb,'description':_0x4bee69[_0x293c73(0xed)]||_0x293c73(0xcd)+_0x2794bd,'journeyId':_0xa72054,'resolvedRule':_0x371a7f,'parentId':_0x6120e9[_0x293c73(0xd3)],'folderId':_0x6120e9[_0x293c73(0xe5)]||''},_0x181ef1),_0xe16b3c[_0x293c73(0xd7)][_0x293c73(0xaf)](_0x2794bd,_0x4ccd21),_0x2749f0['set'](_0x2794bd,_0x4ccd21),_0x4ccd21;})());_0x191627[_0x213b29(0xaf)](_0x2794bd,_0x8b5360);try{return await _0x8b5360;}finally{_0x191627[_0x213b29(0x98)](_0x2794bd);}},'resolveActivationId':async _0x1f1b8d=>{const _0x177d93=_0x2e7ed4,_0x321e61=_0x489e09[_0x177d93(0x161)](_0x1f1b8d);if(_0x321e61)return _0x321e61;if(_0x216f69[_0x177d93(0xf9)]){await _0x514b5f();const _0x459223=_0x489e09['get'](_0x1f1b8d);if(_0x459223)return _0x459223;}throw new SDKError(ErrorCode[_0x177d93(0x175)],'Activation\x20not\x20found:\x20'+_0x1f1b8d+_0x177d93(0x111)+_0x216f69['yamlConfig'][_0x177d93(0x117)]+_0x177d93(0xc9)+_0x177d93(0x136));},'resolveEmbeddedActivationId':async(_0x38e531,_0x5a9a07)=>{const _0x3ebcb1=_0x2e7ed4,_0xffe16e=_0x489e09[_0x3ebcb1(0x161)](_0x38e531);if(_0xffe16e)return _0xffe16e;if(_0x216f69[_0x3ebcb1(0x17e)])return _0x1c7acf[_0x3ebcb1(0xaf)](_0x38e531,_0x5a9a07),createPendingActivationId(_0x38e531);if(_0x216f69['existingJourney']){await _0x514b5f();const _0x3a6d4d=_0x489e09[_0x3ebcb1(0x161)](_0x5a9a07[_0x3ebcb1(0x117)]);if(_0x3a6d4d)return _0x489e09[_0x3ebcb1(0xaf)](_0x38e531,_0x3a6d4d),_0x3a6d4d;const _0x47ef1=activationSignature(_0x5a9a07),_0x17f8b7=_0x4a7087?.[_0x3ebcb1(0x161)](_0x47ef1);if(_0x17f8b7)return _0x489e09[_0x3ebcb1(0xaf)](_0x38e531,_0x17f8b7),_0x17f8b7;const _0x118736=await _0x9e2ecc(_0x5a9a07,_0xe16b3c['activationContext']),_0x1b9d5a={..._0x118736,..._0x5a9a07[_0x3ebcb1(0x197)]!==undefined&&{'runAfterJourneyRefresh':_0x5a9a07[_0x3ebcb1(0x197)]}},_0xf760b5=await _0x23a90b[_0x3ebcb1(0x99)][_0x3ebcb1(0xcb)](_0x216f69['existingJourney']['id'],_0x1b9d5a);return _0x489e09[_0x3ebcb1(0xaf)](_0x38e531,_0xf760b5['id']),_0xf760b5['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x3ebcb1(0x108));},'resolveJourneyId':async _0x38251d=>{const _0x4d47d2=_0x2e7ed4;try{return await _0x23a90b[_0x4d47d2(0x99)][_0x4d47d2(0x196)](_0x6120e9[_0x4d47d2(0xd3)],_0x38251d);}catch(_0x4693bf){throw new SDKError(ErrorCode[_0x4d47d2(0x175)],_0x4d47d2(0xd1)+_0x38251d+_0x4d47d2(0x141)+_0x216f69['yamlConfig']['name']+'\x27)',_0x4693bf);}},'resolveStageId':async(_0x5737ea,_0x5e88ca)=>{const _0x263976=_0x2e7ed4,_0x300553=await _0x23a90b['journey'][_0x263976(0x168)](_0x5737ea),_0x448170=_0x300553[_0x263976(0x158)]['journeyStages'][_0x263976(0x10f)](_0xa72d48=>_0xa72d48['name'][_0x263976(0xdb)]()===_0x5e88ca[_0x263976(0xdb)]());if(!_0x448170?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x5e88ca+_0x263976(0x9e)+(_0x300553[_0x263976(0x158)][_0x263976(0x190)]||_0x300553[_0x263976(0x158)][_0x263976(0x117)])+'\x27');return _0x448170['id'];}},_0x17feca=await _0x532f4b(_0x216f69[_0x2e7ed4(0x125)],_0x6120e9[_0x2e7ed4(0xd3)],_0x446561),_0xe6014a=_0x6120e9[_0x2e7ed4(0xe9)]||_0x6120e9['rootFolderId'];_0xe6014a&&(_0x17feca['relationships']={'parentFolder':{'data':{'id':_0xe6014a,'type':_0x2e7ed4(0x17a)}}});if(_0x216f69[_0x2e7ed4(0x17e)]){if(_0x39b2a2[_0x2e7ed4(0xfc)]>0x0||_0x1c7acf[_0x2e7ed4(0xfc)]>0x0)return await executeThreeStepJourneyCreate(_0x23a90b,_0x216f69,_0x17feca,{'pendingEmbeddedSegments':_0x39b2a2,'pendingEmbeddedActivations':_0x1c7acf,'embeddedSegmentNameToId':_0x2749f0,'journeyActivationNameToId':_0x489e09},{..._0x6120e9,'effectiveFolderId':_0xe6014a},_0xe16b3c,_0x185d2c,_0x485824);else{ensureJourneyDefaults(_0x17feca['attributes']);const _0x131cdb=await _0x23a90b[_0x2e7ed4(0x99)][_0x2e7ed4(0x130)](_0x17feca);return deletePushRecovery(_0x216f69[_0x2e7ed4(0x11c)]),{'action':_0x2e7ed4(0xd5),'journeyId':_0x131cdb['id'],'embeddedSegmentNameToId':_0x2749f0};}}else{if(_0x216f69[_0x2e7ed4(0xa6)]&&_0x216f69[_0x2e7ed4(0xf9)]){_0x17feca['id']=_0x216f69[_0x2e7ed4(0xf9)]['id'];const _0x4b7d4c=_0x17feca['attributes'];_0x216f69['existingJourney'][_0x2e7ed4(0x158)]?.[_0x2e7ed4(0x190)]&&(_0x4b7d4c[_0x2e7ed4(0x190)]=_0x216f69['existingJourney']['attributes'][_0x2e7ed4(0x190)]);const _0x28eaba=_0x216f69['existingJourney'][_0x2e7ed4(0x158)]?.[_0x2e7ed4(0xfb)];return _0x28eaba&&_0x17feca[_0x2e7ed4(0x158)][_0x2e7ed4(0xfb)]&&injectExistingStageIds(_0x17feca[_0x2e7ed4(0x158)][_0x2e7ed4(0xfb)],_0x28eaba),ensureJourneyDefaults(_0x4b7d4c),await _0x23a90b['journey'][_0x2e7ed4(0xe2)](_0x216f69[_0x2e7ed4(0xf9)]['id'],_0x17feca),deletePushRecovery(_0x216f69[_0x2e7ed4(0x11c)]),{'action':_0x2e7ed4(0x179),'journeyId':_0x216f69[_0x2e7ed4(0xf9)]['id'],'embeddedSegmentNameToId':_0x2749f0};}}return deletePushRecovery(_0x216f69[_0x2e7ed4(0x11c)]),{'action':_0x2e7ed4(0x15c),'journeyId':_0x216f69[_0x2e7ed4(0xf9)]?.['id'],'embeddedSegmentNameToId':_0x2749f0};}function a152_0x3af2(_0x5cadf3,_0x3a22b9){_0x5cadf3=_0x5cadf3-0x96;const _0xae12bf=a152_0xae12();let _0x3af2d0=_0xae12bf[_0x5cadf3];return _0x3af2d0;}function findSegmentCriteriaLocation(_0x3baad7,_0x5e0cda){const _0x7839db=a152_0x5626a8,_0x3dfea6=_0x3baad7['stages']||_0x3baad7[_0x7839db(0x192)]?.[0x0]?.['stages']||[];let _0xcbb320='entry',_0x143033=_0x5e0cda;const _0x5e37fd=_0x3baad7[_0x7839db(0x17c)]||_0x3baad7[_0x7839db(0x192)]?.[0x0]?.['goal'];if(_0x5e37fd?.[_0x7839db(0x16d)]===_0x5e0cda)return{'stageName':_0x7839db(0x17c),'criteriaName':_0x5e37fd[_0x7839db(0x117)]||_0x5e0cda};_0x3ae8fb:for(const _0x4c3a26 of _0x3dfea6){if(_0x4c3a26[_0x7839db(0xbe)]?.[_0x7839db(0x16d)]===_0x5e0cda){_0xcbb320=_0x4c3a26[_0x7839db(0x117)],_0x143033=_0x4c3a26[_0x7839db(0xbe)][_0x7839db(0x117)]||_0x5e0cda;break;}if(_0x4c3a26[_0x7839db(0x19c)])for(const _0x185d20 of _0x4c3a26['steps']){if(_0x185d20[_0x7839db(0xc3)]===_0x7839db(0x14c)&&_0x185d20[_0x7839db(0x12d)]?.[_0x7839db(0x12e)])for(const _0x38c2a9 of _0x185d20[_0x7839db(0x12d)][_0x7839db(0x12e)]){if(_0x38c2a9[_0x7839db(0x16d)]===_0x5e0cda){_0xcbb320=_0x4c3a26[_0x7839db(0x117)],_0x143033=_0x38c2a9['name']||_0x5e0cda;break _0x3ae8fb;}}}}return{'stageName':_0xcbb320,'criteriaName':_0x143033};}async function executeThreeStepJourneyCreate(_0xef4d48,_0x522c49,_0x2a9e37,_0x48f92d,_0x26e405,_0x422b23,_0x428c53,_0x5d08a8){const _0x1c893d=a152_0x5626a8,{activationDefToCreateRequest:_0xe364f6,yamlRuleToApi:_0x18a6eb}=_0x5d08a8,{pendingEmbeddedSegments:_0x43f629,pendingEmbeddedActivations:_0x54d18f,embeddedSegmentNameToId:_0x2d13c2}=_0x48f92d,_0x21e64a=JSON[_0x1c893d(0x121)](JSON[_0x1c893d(0x11f)](_0x2a9e37));ensureJourneyDefaults(_0x21e64a['attributes']),stripPendingIds(_0x21e64a);const _0x2a21d7=await _0xef4d48[_0x1c893d(0x99)]['create'](_0x21e64a),_0x1adc92=_0x2a21d7['id'],_0x628ac7=new Map();for(const _0x571a92 of _0x2a21d7[_0x1c893d(0x158)][_0x1c893d(0xfb)]){_0x628ac7[_0x1c893d(0xaf)](_0x571a92[_0x1c893d(0x117)]['toLowerCase'](),_0x571a92['id']);}recoverSegmentIdsFromPushRecovery(_0x522c49,_0x2d13c2,_0x422b23[_0x1c893d(0xd7)]);for(const [_0x2b9266,{definition:_0xf4ffeb}]of _0x43f629){if(_0x2d13c2['has'](_0x2b9266)){_0x428c53[_0x1c893d(0xec)]?.({'type':_0x1c893d(0xf0),'journeyName':_0x522c49[_0x1c893d(0x125)][_0x1c893d(0x117)],'segmentName':_0x2b9266});continue;}const _0x5dafbe=generateDeterministicJourneySegmentName(_0x522c49[_0x1c893d(0x125)][_0x1c893d(0x117)],_0x2b9266);_0x428c53[_0x1c893d(0xec)]?.({'type':_0x1c893d(0x164),'journeyName':_0x522c49['yamlConfig']['name'],'segmentName':_0x2b9266});const _0x40dc9e=createSegmentIdResolver(_0x422b23[_0x1c893d(0xd7)],_0x2b9266),_0x4a8c58=await resolveRuleSegmentIds(_0xf4ffeb[_0x1c893d(0x12c)],_0x40dc9e),_0x5efa11=await createOrRecoverEmbeddedSegment(_0xef4d48,_0x522c49,{'localName':_0x2b9266,'uniqueSegmentName':_0x5dafbe,'description':_0xf4ffeb[_0x1c893d(0xed)]||_0x1c893d(0xcd)+_0x2b9266,'journeyId':_0x1adc92,'resolvedRule':_0x4a8c58,'parentId':_0x26e405[_0x1c893d(0xd3)],'folderId':_0x26e405[_0x1c893d(0x11e)]||''},_0x18a6eb);_0x2d13c2['set'](_0x2b9266,_0x5efa11),_0x422b23[_0x1c893d(0xd7)][_0x1c893d(0xaf)](_0x2b9266,_0x5efa11),_0x428c53[_0x1c893d(0xec)]?.({'type':_0x1c893d(0xf0),'journeyName':_0x522c49[_0x1c893d(0x125)][_0x1c893d(0x117)],'segmentName':_0x2b9266});}const _0x28951f=new Map();for(const [_0x3e66cf,_0x243198]of _0x54d18f){_0x428c53[_0x1c893d(0xec)]?.({'type':'embedded_activation_creating','journeyName':_0x522c49[_0x1c893d(0x125)][_0x1c893d(0x117)],'activationName':_0x3e66cf});const _0x91b726=await _0xe364f6(_0x243198,_0x422b23[_0x1c893d(0x138)]),_0x53f401={..._0x91b726,..._0x243198[_0x1c893d(0x197)]!==undefined&&{'runAfterJourneyRefresh':_0x243198[_0x1c893d(0x197)]}},_0x241b9f=await _0xef4d48[_0x1c893d(0x99)][_0x1c893d(0xcb)](_0x1adc92,_0x53f401);_0x28951f[_0x1c893d(0xaf)](_0x3e66cf,_0x241b9f['id']),_0x48f92d[_0x1c893d(0x133)][_0x1c893d(0xaf)](_0x3e66cf,_0x241b9f['id']),_0x428c53[_0x1c893d(0xec)]?.({'type':_0x1c893d(0xde),'journeyName':_0x522c49[_0x1c893d(0x125)][_0x1c893d(0x117)],'activationName':_0x3e66cf});}const _0x2f5274=JSON[_0x1c893d(0x121)](JSON[_0x1c893d(0x11f)](_0x2a9e37));return _0x2f5274['id']=_0x1adc92,ensureJourneyDefaults(_0x2f5274[_0x1c893d(0x158)]),resolvePendingIdsInRequest(_0x2f5274,_0x2a9e37,_0x628ac7,_0x2d13c2,_0x28951f,_0x428c53),await _0xef4d48[_0x1c893d(0x99)]['update'](_0x1adc92,_0x2f5274),deletePushRecovery(_0x522c49[_0x1c893d(0x11c)]),{'action':_0x1c893d(0xd5),'journeyId':_0x1adc92,'embeddedSegmentNameToId':_0x2d13c2};}export function stripWaitStepPendingIds(_0xc0fc3c){const _0x5403e0=a152_0x5626a8,_0x328839=_0xc0fc3c[_0x5403e0(0x112)]&&isPendingSegmentId(_0xc0fc3c[_0x5403e0(0x112)]),_0xacfc4a=_0xc0fc3c[_0x5403e0(0x174)]?.[_0x5403e0(0x9c)](_0x3ddf52=>_0x3ddf52[_0x5403e0(0x139)]&&isPendingSegmentId(_0x3ddf52['segmentId']));(_0x328839||_0xacfc4a)&&(_0xc0fc3c[_0x5403e0(0xd9)]='Duration',_0xc0fc3c['waitStep']=0x1,_0xc0fc3c[_0x5403e0(0x181)]=_0x5403e0(0x184),delete _0xc0fc3c[_0x5403e0(0x112)],delete _0xc0fc3c['conditionTimeoutDuration'],delete _0xc0fc3c['conditionTimeoutUnit'],delete _0xc0fc3c[_0x5403e0(0x174)]);}export function resolveWaitStepPendingIds(_0x470558,_0x500f8f,_0x2359ea,_0x8b6c3b){const _0x32e862=a152_0x5626a8;if(_0x500f8f[_0x32e862(0x112)]&&isPendingSegmentId(_0x500f8f[_0x32e862(0x112)])){const _0x3358be=_0x2359ea(_0x500f8f[_0x32e862(0x112)],_0x32e862(0x11b)+_0x8b6c3b+_0x32e862(0x144));_0x3358be&&(_0x470558[_0x32e862(0xd9)]=_0x32e862(0x101),_0x470558['conditionSegmentId']=_0x3358be,delete _0x470558['waitStep'],delete _0x470558[_0x32e862(0x181)],_0x500f8f[_0x32e862(0x131)]!==undefined&&(_0x470558['conditionTimeoutDuration']=_0x500f8f[_0x32e862(0x131)]),_0x500f8f['conditionTimeoutUnit']&&(_0x470558['conditionTimeoutUnit']=_0x500f8f[_0x32e862(0x12a)]));}if(_0x500f8f['conditions']){const _0x13805e=_0x500f8f[_0x32e862(0x174)][_0x32e862(0x9c)](_0x4d95e5=>_0x4d95e5[_0x32e862(0x139)]&&isPendingSegmentId(_0x4d95e5['segmentId']));if(_0x13805e){const _0x6e0f8a=_0x500f8f[_0x32e862(0x174)][_0x32e862(0x152)](_0x5eef29=>{const _0x13d8f3=_0x32e862;if(_0x5eef29[_0x13d8f3(0x139)]&&isPendingSegmentId(_0x5eef29[_0x13d8f3(0x139)])){const _0xafef86=_0x2359ea(_0x5eef29[_0x13d8f3(0x139)],_0x13d8f3(0x11b)+_0x8b6c3b+_0x13d8f3(0x144));return{..._0x5eef29,'segmentId':_0xafef86||_0x5eef29[_0x13d8f3(0x139)]};}return{..._0x5eef29};});_0x470558[_0x32e862(0xd9)]=_0x32e862(0x101),_0x470558[_0x32e862(0x174)]=_0x6e0f8a,delete _0x470558['waitStep'],delete _0x470558['waitStepUnit'],delete _0x470558[_0x32e862(0x112)],delete _0x470558[_0x32e862(0x131)],delete _0x470558[_0x32e862(0x12a)];}}}function stripPendingIds(_0x18c0f4){const _0x5226ae=a152_0x5626a8;_0x18c0f4[_0x5226ae(0x158)][_0x5226ae(0x17c)]?.[_0x5226ae(0x139)]&&isPendingSegmentId(_0x18c0f4[_0x5226ae(0x158)][_0x5226ae(0x17c)]['segmentId'])&&delete _0x18c0f4[_0x5226ae(0x158)]['goal'];for(const _0x4b0540 of _0x18c0f4[_0x5226ae(0x158)][_0x5226ae(0xfb)]||[]){_0x4b0540[_0x5226ae(0x17d)]?.[_0x5226ae(0x139)]&&isPendingSegmentId(_0x4b0540[_0x5226ae(0x17d)]['segmentId'])&&delete _0x4b0540[_0x5226ae(0x17d)];_0x4b0540[_0x5226ae(0xbd)]?.['segmentId']&&isPendingSegmentId(_0x4b0540[_0x5226ae(0xbd)]['segmentId'])&&delete _0x4b0540[_0x5226ae(0xbd)];_0x4b0540['exitCriterias']&&(_0x4b0540[_0x5226ae(0xe6)]=_0x4b0540[_0x5226ae(0xe6)][_0x5226ae(0x15d)](_0x1f8fd7=>!_0x1f8fd7[_0x5226ae(0x139)]||!isPendingSegmentId(_0x1f8fd7[_0x5226ae(0x139)])));if(_0x4b0540[_0x5226ae(0x19c)])for(const _0x480a3f of Object[_0x5226ae(0xad)](_0x4b0540['steps'])){const _0xd251fc=_0x4b0540[_0x5226ae(0x19c)][_0x480a3f];_0xd251fc[_0x5226ae(0xc3)]==='Activation'&&_0xd251fc['journeyActivationStepId']&&isPendingActivationId(_0xd251fc['journeyActivationStepId'])&&(_0xd251fc['journeyActivationStepId']='');if(_0xd251fc['type']===_0x5226ae(0xf3)&&_0xd251fc[_0x5226ae(0x12e)])for(const _0x508c3a of _0xd251fc['branches']){_0x508c3a[_0x5226ae(0x139)]&&isPendingSegmentId(_0x508c3a[_0x5226ae(0x139)])&&(_0x508c3a[_0x5226ae(0x139)]='');}_0xd251fc[_0x5226ae(0xc3)]==='WaitStep'&&stripWaitStepPendingIds(_0xd251fc);}}}function resolvePendingIdsInRequest(_0x2a7076,_0x234d8d,_0xeee34e,_0x119b2d,_0x24c142,_0x57a25e){const _0x21655b=a152_0x5626a8,_0x2bcba0=(_0x767b19,_0x1093af)=>{const _0x5169cf=a152_0x3af2;if(!isPendingSegmentId(_0x767b19))return _0x767b19;const _0x730e2a=extractPendingSegmentName(_0x767b19),_0x7fa44b=_0x119b2d[_0x5169cf(0x161)](_0x730e2a);return!_0x7fa44b&&_0x57a25e[_0x5169cf(0x116)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x730e2a+_0x5169cf(0x16c)+_0x1093af),_0x7fa44b;};if(_0x2a7076['attributes']['goal']?.['segmentId']&&isPendingSegmentId(_0x2a7076[_0x21655b(0x158)][_0x21655b(0x17c)][_0x21655b(0x139)])){const _0x5f21d3=_0x2bcba0(_0x2a7076[_0x21655b(0x158)][_0x21655b(0x17c)][_0x21655b(0x139)],_0x21655b(0x155));_0x5f21d3&&(_0x2a7076[_0x21655b(0x158)]['goal'][_0x21655b(0x139)]=_0x5f21d3);}for(const _0x39797f of _0x2a7076[_0x21655b(0x158)][_0x21655b(0xfb)]||[]){const _0x316f2f=_0xeee34e[_0x21655b(0x161)](_0x39797f[_0x21655b(0x117)][_0x21655b(0xdb)]());_0x316f2f&&(_0x39797f['id']=_0x316f2f);if(_0x39797f[_0x21655b(0x17d)]?.[_0x21655b(0x139)]&&isPendingSegmentId(_0x39797f['entryCriteria'][_0x21655b(0x139)])){const _0x4e1ad5=_0x2bcba0(_0x39797f[_0x21655b(0x17d)][_0x21655b(0x139)],_0x21655b(0x11b)+_0x39797f[_0x21655b(0x117)]+'\x27\x20entry\x20criteria');_0x4e1ad5&&(_0x39797f['entryCriteria'][_0x21655b(0x139)]=_0x4e1ad5);}if(_0x39797f[_0x21655b(0xe6)])for(const _0xd9382f of _0x39797f[_0x21655b(0xe6)]){if(_0xd9382f[_0x21655b(0x139)]&&isPendingSegmentId(_0xd9382f['segmentId'])){const _0xcff23=_0x2bcba0(_0xd9382f[_0x21655b(0x139)],_0x21655b(0x11b)+_0x39797f[_0x21655b(0x117)]+_0x21655b(0x19f));_0xcff23&&(_0xd9382f[_0x21655b(0x139)]=_0xcff23);}}if(_0x39797f[_0x21655b(0xbd)]?.[_0x21655b(0x139)]&&isPendingSegmentId(_0x39797f['milestone'][_0x21655b(0x139)])){const _0xf7ff31=_0x2bcba0(_0x39797f[_0x21655b(0xbd)]['segmentId'],_0x21655b(0x11b)+_0x39797f[_0x21655b(0x117)]+_0x21655b(0x13b));_0xf7ff31&&(_0x39797f[_0x21655b(0xbd)][_0x21655b(0x139)]=_0xf7ff31);}if(_0x39797f[_0x21655b(0x19c)]){const _0x5c7e05=_0x135aea=>_0x234d8d[_0x21655b(0x158)]['journeyStages']?.[_0x21655b(0x10f)](_0x48bf6a=>_0x48bf6a['name'][_0x21655b(0xdb)]()===_0x39797f[_0x21655b(0x117)][_0x21655b(0xdb)]())?.[_0x21655b(0x19c)]?.[_0x135aea];for(const _0x196e4c of Object[_0x21655b(0xad)](_0x39797f[_0x21655b(0x19c)])){const _0x1127e8=_0x39797f[_0x21655b(0x19c)][_0x196e4c],_0x272ba1=_0x5c7e05(_0x196e4c);if(_0x1127e8[_0x21655b(0xc3)]===_0x21655b(0x18e)&&_0x1127e8[_0x21655b(0x15f)]&&(isPendingActivationId(_0x1127e8[_0x21655b(0x15f)])||_0x1127e8[_0x21655b(0x15f)]==='')){if(_0x272ba1?.[_0x21655b(0x15f)]&&isPendingActivationId(_0x272ba1[_0x21655b(0x15f)])){const _0x3b79f5=extractPendingActivationName(_0x272ba1[_0x21655b(0x15f)]),_0x4dba45=_0x24c142[_0x21655b(0x161)](_0x3b79f5);_0x4dba45&&(_0x1127e8[_0x21655b(0x15f)]=_0x4dba45);}}if(_0x1127e8['type']===_0x21655b(0xf3)&&_0x1127e8['branches']&&_0x272ba1?.[_0x21655b(0x12e)])for(let _0x434c6f=0x0;_0x434c6f<_0x1127e8[_0x21655b(0x12e)][_0x21655b(0x13a)];_0x434c6f++){const _0x29c412=_0x1127e8[_0x21655b(0x12e)][_0x434c6f],_0x3e5175=_0x272ba1[_0x21655b(0x12e)][_0x434c6f];if(_0x3e5175?.[_0x21655b(0x139)]&&isPendingSegmentId(_0x3e5175[_0x21655b(0x139)])){const _0x18d813=_0x2bcba0(_0x3e5175['segmentId'],'stage\x20\x27'+_0x39797f[_0x21655b(0x117)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x29c412[_0x21655b(0x117)]||_0x434c6f)+'\x27');_0x18d813&&(_0x29c412[_0x21655b(0x139)]=_0x18d813);}}_0x1127e8['type']===_0x21655b(0x104)&&_0x272ba1?.['type']===_0x21655b(0x104)&&resolveWaitStepPendingIds(_0x1127e8,_0x272ba1,_0x2bcba0,_0x39797f['name']);}}}}
1
+ const a152_0x427e52=a152_0x5d01;(function(_0x2433e0,_0x13e305){const _0x310d73=a152_0x5d01,_0x5cca8c=_0x2433e0();while(!![]){try{const _0x19097b=parseInt(_0x310d73(0x138))/0x1*(-parseInt(_0x310d73(0x1f0))/0x2)+parseInt(_0x310d73(0x1e7))/0x3*(parseInt(_0x310d73(0x20f))/0x4)+parseInt(_0x310d73(0x123))/0x5+parseInt(_0x310d73(0x1fc))/0x6*(parseInt(_0x310d73(0x1e3))/0x7)+-parseInt(_0x310d73(0x13f))/0x8+parseInt(_0x310d73(0x12c))/0x9*(parseInt(_0x310d73(0x1a6))/0xa)+parseInt(_0x310d73(0x1c0))/0xb;if(_0x19097b===_0x13e305)break;else _0x5cca8c['push'](_0x5cca8c['shift']());}catch(_0xff2aa1){_0x5cca8c['push'](_0x5cca8c['shift']());}}}(a152_0x5381,0x732e1));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x427e52(0x1d1));export const PENDING_SEGMENT_PREFIX=a152_0x427e52(0x167);export const PENDING_ACTIVATION_PREFIX=a152_0x427e52(0x216);export function createPendingSegmentId(_0xa8ad7c){return''+PENDING_SEGMENT_PREFIX+_0xa8ad7c+'__';}function a152_0x5d01(_0x1565a5,_0x3a0fb0){_0x1565a5=_0x1565a5-0x122;const _0x538198=a152_0x5381();let _0x5d0196=_0x538198[_0x1565a5];return _0x5d0196;}export function isPendingSegmentId(_0x5d18cd){const _0x28c710=a152_0x427e52;return _0x5d18cd[_0x28c710(0x1e1)](PENDING_SEGMENT_PREFIX)&&!_0x5d18cd[_0x28c710(0x1e1)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x3ce477){const _0x4f0bf1=a152_0x427e52;return _0x3ce477[_0x4f0bf1(0x158)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4b68a1){return''+PENDING_ACTIVATION_PREFIX+_0x4b68a1+'__';}export function isPendingActivationId(_0x14a27a){const _0x1e83df=a152_0x427e52;return _0x14a27a[_0x1e83df(0x1e1)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x16a944){const _0x2f0940=a152_0x427e52;return _0x16a944[_0x2f0940(0x158)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3df512,_0x1ea340){const _0x3c061c=a152_0x427e52,_0x3a7a9e=_0x3df512+'::'+(_0x1ea340[_0x3c061c(0x1d6)]()||_0x3c061c(0x16c)),_0x27ee97=createHash('sha1')[_0x3c061c(0x15a)](_0x3a7a9e)[_0x3c061c(0x146)](_0x3c061c(0x20d))[_0x3c061c(0x144)](0x0,0xc);return'journey_entry_criteria_'+_0x27ee97;}export function ensureJourneyDefaults(_0x15b8d2){const _0x380695=a152_0x427e52;!_0x15b8d2[_0x380695(0x1f4)]&&(_0x15b8d2['description']=''),!_0x15b8d2['state']&&(_0x15b8d2[_0x380695(0x1b7)]=_0x380695(0x1f3));}export function injectExistingStageIds(_0x3ee443,_0x3d4177){const _0x55ea69=a152_0x427e52,_0x5c4f7f=new Map(_0x3d4177['map'](_0xe1e714=>[_0xe1e714[_0x55ea69(0x132)],_0xe1e714['id']]));for(const _0x12feb9 of _0x3ee443){if(!_0x12feb9['id']){const _0xca4ef9=_0x5c4f7f['get'](_0x12feb9['name']);_0xca4ef9&&(_0x12feb9['id']=_0xca4ef9);}}}export function resolveTDFolderPath(_0x1e3d92,_0x11792a,_0x2e1036){if(!_0x11792a)return _0x1e3d92;if(_0x1e3d92===_0x2e1036||_0x1e3d92['startsWith'](_0x2e1036+'/'))return _0x1e3d92;return _0x1e3d92?_0x2e1036+'/'+_0x1e3d92:_0x2e1036;}export function addFoldersToCreate(_0x5d9f56,_0x260a1d,_0x599504){const _0x129875=a152_0x427e52;if(!_0x5d9f56)return;if(_0x260a1d[_0x129875(0x1ca)](_0x5d9f56))return;const _0x4fe447=_0x5d9f56['split']('/');let _0x4a7a2d='';for(const _0x562804 of _0x4fe447){_0x4a7a2d=_0x4a7a2d?_0x4a7a2d+'/'+_0x562804:_0x562804,!_0x260a1d[_0x129875(0x1ca)](_0x4a7a2d)&&_0x599504[_0x129875(0x1eb)](_0x4a7a2d);}}export function sortFoldersByDepth(_0x52353f){const _0x3d8b62=a152_0x427e52;return[..._0x52353f][_0x3d8b62(0x201)]((_0x399128,_0x30e190)=>{const _0xe6d87=_0x3d8b62,_0xe0dd65=(_0x399128[_0xe6d87(0x12a)](/\//g)||[])['length'],_0x21bd56=(_0x30e190[_0xe6d87(0x12a)](/\//g)||[])[_0xe6d87(0x1f9)];return _0xe0dd65-_0x21bd56;});}import*as a152_0x3db32a from'yaml';import{readFileSync}from'fs';import a152_0x5aada6 from'path';import{isJourneyDef,parseYamlString as a152_0x143a16,toYamlString as a152_0x2294ca,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x492acb){const _0x1175c4=a152_0x427e52;if(Array[_0x1175c4(0x1df)](_0x492acb))return'['+_0x492acb[_0x1175c4(0x1c4)](_0x36f8b2=>stableStringify(_0x36f8b2))[_0x1175c4(0x13e)](',')+']';if(_0x492acb&&typeof _0x492acb===_0x1175c4(0x1a2)){const _0x45f69d=_0x492acb,_0x2d88be=Object[_0x1175c4(0x20b)](_0x45f69d)[_0x1175c4(0x201)](),_0x21781e=_0x2d88be[_0x1175c4(0x1c4)](_0x1c72a0=>'\x22'+_0x1c72a0+'\x22:'+stableStringify(_0x45f69d[_0x1c72a0]));return'{'+_0x21781e[_0x1175c4(0x13e)](',')+'}';}const _0xb5295d=JSON[_0x1175c4(0x198)](_0x492acb);return _0xb5295d===undefined?'null':_0xb5295d;}function activationSignature(_0x422c57){const _0x1e649b=a152_0x427e52,_0x9d7d7c={'connection':_0x422c57[_0x1e649b(0x193)],..._0x422c57[_0x1e649b(0x1a4)]!==undefined&&{'all_columns':_0x422c57['all_columns']},..._0x422c57[_0x1e649b(0x16a)]!==undefined&&{'columns':_0x422c57[_0x1e649b(0x16a)]},..._0x422c57[_0x1e649b(0x1fa)]!==undefined&&{'behavior':_0x422c57['behavior']},..._0x422c57[_0x1e649b(0x20e)]!==undefined&&{'schedule':_0x422c57[_0x1e649b(0x20e)]},..._0x422c57['notification']!==undefined&&{'notification':_0x422c57[_0x1e649b(0x1a0)]},..._0x422c57['connector_config']!==undefined&&{'connector_config':_0x422c57[_0x1e649b(0x214)]},..._0x422c57[_0x1e649b(0x122)]!==undefined&&{'activation_template_id':_0x422c57[_0x1e649b(0x122)]}};return stableStringify(_0x9d7d7c);}async function fetchSegment(_0x44410c,_0x5d9be3,_0x5d1b2f,_0x253d26){const _0x24ba73=a152_0x427e52,_0x1aa8ea=_0x253d26?.[_0x24ba73(0x151)](_0x5bccec=>_0x5bccec['id']===_0x5d1b2f);if(_0x1aa8ea)return _0x1aa8ea;try{return await _0x44410c[_0x24ba73(0x16c)][_0x24ba73(0x1b1)](_0x5d9be3,_0x5d1b2f);}catch(_0x583738){logger[_0x24ba73(0x131)]('getSegment\x20failed\x20for\x20'+_0x5d1b2f+_0x24ba73(0x181)+_0x583738);try{return await _0x44410c[_0x24ba73(0x16c)]['getSegmentEntity'](_0x5d1b2f);}catch(_0x33e8a7){return logger[_0x24ba73(0x131)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x5d1b2f+':\x20'+_0x33e8a7),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3dc3e9,_0x32c652,_0x30dd3f){const _0x352977=a152_0x427e52,_0x39509c=readPushRecovery(_0x3dc3e9['absolutePath']);if(_0x39509c?.[_0x352977(0x1dd)]===_0x3dc3e9['yamlConfig'][_0x352977(0x132)])for(const [_0x4d6bdf,_0x227b24]of Object[_0x352977(0x1ba)](_0x39509c['segments'])){const _0x592f74=generateDeterministicJourneySegmentName(_0x3dc3e9[_0x352977(0x194)][_0x352977(0x132)],_0x4d6bdf);_0x227b24[_0x352977(0x19f)]===_0x592f74&&(_0x32c652[_0x352977(0x1a8)](_0x4d6bdf,_0x227b24['segmentId']),_0x30dd3f[_0x352977(0x1a8)](_0x4d6bdf,_0x227b24[_0x352977(0x185)]));}}async function createOrRecoverEmbeddedSegment(_0x432d78,_0x2d9311,_0x2c63a1,_0x594506){const _0x272b54=a152_0x427e52;let _0x5ce801;try{_0x5ce801=await _0x432d78['segment'][_0x272b54(0x1f5)]({'name':_0x2c63a1[_0x272b54(0x1cf)],'description':_0x2c63a1[_0x272b54(0x1f4)],'journeyId':_0x2c63a1[_0x272b54(0x1c7)],'rule':_0x594506(_0x2c63a1[_0x272b54(0x184)],!![]),'countPopulation':!![],'parentFolderId':_0x2c63a1[_0x272b54(0x128)],'audienceId':_0x2c63a1['parentId']});}catch(_0x2e6bd4){const _0x394b80=_0x2e6bd4 instanceof Error&&_0x2e6bd4[_0x272b54(0x195)][_0x272b54(0x133)]('Name\x20has\x20already\x20been\x20taken');if(_0x394b80){const _0x120ab2=readPushRecovery(_0x2d9311[_0x272b54(0x177)]),_0x4cddb9=_0x120ab2?.[_0x272b54(0x1dd)]===_0x2d9311['yamlConfig'][_0x272b54(0x132)]?_0x120ab2[_0x272b54(0x125)][_0x2c63a1[_0x272b54(0x14e)]]:undefined;if(_0x4cddb9?.[_0x272b54(0x19f)]===_0x2c63a1[_0x272b54(0x1cf)])await _0x432d78['segment'][_0x272b54(0x1ea)](_0x2c63a1[_0x272b54(0x218)],_0x4cddb9[_0x272b54(0x185)],{'description':_0x2c63a1['description'],'rule':_0x594506(_0x2c63a1[_0x272b54(0x184)],!![]),'countPopulation':!![]}),_0x5ce801=_0x4cddb9[_0x272b54(0x185)];else throw new SDKError(ErrorCode[_0x272b54(0x1db)],_0x272b54(0x1a3)+_0x2c63a1[_0x272b54(0x14e)]+_0x272b54(0x16e)+(_0x272b54(0x1c5)+_0x2d9311[_0x272b54(0x177)][_0x272b54(0x158)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x272b54(0x15d),_0x2e6bd4);}else throw _0x2e6bd4;}return saveSegmentToPushRecovery(_0x2d9311[_0x272b54(0x177)],_0x2d9311['yamlConfig'][_0x272b54(0x132)],_0x2c63a1[_0x272b54(0x14e)],{'segmentId':_0x5ce801,'uniqueServerName':_0x2c63a1[_0x272b54(0x1cf)],'createdAt':new Date()['toISOString']()}),_0x5ce801;}export async function prepareSegmentFiles(_0x5e1d45,_0x15d048,_0x25487e,_0x8cb143,_0x301692){const _0xc92757=a152_0x427e52,{activationDefToCreateRequest:_0x313ac1}=await import(_0xc92757(0x127)),_0x427a39=[],_0x577a52=new Set();for(const {yamlConfig:_0x2187f3,folderPath:_0x18e71e,sourcePath:_0x365031}of _0x5e1d45){const _0x5c8730=resolveTDFolderPath(_0x18e71e,_0x8cb143,_0x301692),_0x1398fb=_0x5c8730+':'+_0x2187f3['name'],_0x3190ef=_0x15d048[_0xc92757(0x213)][_0xc92757(0x199)](_0x1398fb),_0x3dad60=_0x3190ef?_0x15d048[_0xc92757(0x18a)]['get'](_0x3190ef['id'])||[]:[];addFoldersToCreate(_0x5c8730,_0x15d048[_0xc92757(0x1b4)],_0x577a52);const _0x5726f3=calculateActivationActions(_0x2187f3[_0xc92757(0x1e0)]||[],_0x3dad60,_0x15d048['idToEmailMap'],_0x15d048['connectionIdToNameMap']);for(const _0x398ffa of _0x5726f3){(_0x398ffa[_0xc92757(0x1f1)]==='create'||_0x398ffa[_0xc92757(0x1f1)]===_0xc92757(0x15a))&&_0x398ffa[_0xc92757(0x1d3)]&&(_0x398ffa['validatedRequest']=await _0x313ac1(_0x398ffa[_0xc92757(0x1d3)],_0x25487e));}const _0x226ea2=calculateSegmentDiff(_0x2187f3,_0x3190ef,_0x3dad60,_0x15d048[_0xc92757(0x13d)],_0x15d048['connectionIdToNameMap']);_0x427a39['push']({'relativePath':_0x2187f3[_0xc92757(0x132)],'absolutePath':_0x365031,'yamlConfig':_0x2187f3,'folderPath':_0x5c8730,'existingSegment':_0x3190ef,'existingActivations':_0x3dad60,'isNew':_0x226ea2['isNew'],'hasChanges':_0x226ea2[_0xc92757(0x219)],'diff':_0x226ea2[_0xc92757(0x152)],'activationActions':_0x5726f3});}return{'segmentFiles':_0x427a39,'foldersToCreate':_0x577a52};}export async function prepareJourneyFiles(_0xd539e5,_0x137aa6,_0x401c88,_0x4b2d53){const _0x4d49db=a152_0x427e52,_0x6b91d1=[],_0xe83e5c=new Set();for(const {yamlConfig:_0x23f580,folderPath:_0x11147d,sourcePath:_0x4b24fd}of _0xd539e5){const _0x37b8e5=resolveTDFolderPath(_0x11147d,_0x401c88,_0x4b2d53),_0x561910=_0x37b8e5+':'+_0x23f580[_0x4d49db(0x132)],_0x5762b2=_0x137aa6[_0x4d49db(0x180)][_0x4d49db(0x199)](_0x561910);let _0x467738,_0x2ee338;if(_0x5762b2&&_0x5762b2[_0x4d49db(0x1f9)]>0x0){const _0x290a5a=buildLocalExpandedRuleMappings(_0x23f580),{createYamlContext:_0x21800e,prefetchJourneySegments:_0x38959a}=createPushYamlContextForBundle(_0x137aa6[_0x4d49db(0x205)],_0x137aa6[_0x4d49db(0x218)],_0x137aa6[_0x4d49db(0x1e6)],_0x290a5a,_0x137aa6['idToEmailMap'],_0x137aa6[_0x4d49db(0x1a9)],_0x137aa6['activationStepsById'],_0x137aa6[_0x4d49db(0x197)]);await _0x38959a(_0x5762b2[_0x4d49db(0x1c4)](_0x2b2502=>_0x2b2502['id']));const _0xf92dd1=await _0x137aa6[_0x4d49db(0x205)][_0x4d49db(0x1e8)]['getLatestJourneyId'](_0x5762b2[0x0]['journeyBundleId']),_0x199dfc=hasMultipleVersions(_0x23f580),_0x46832b=async _0x3a80c3=>{const _0xf2cd0f=_0x4d49db,_0x301946=_0x137aa6[_0xf2cd0f(0x197)]?.[_0xf2cd0f(0x199)](_0x3a80c3);if(_0x301946)return _0x301946;return _0x137aa6['fetchJourney']({'journeyId':_0x3a80c3,'journeyName':_0x23f580[_0xf2cd0f(0x132)],'isMultiVersion':_0x5762b2[_0xf2cd0f(0x1f9)]>0x1});};if(_0x199dfc&&_0x5762b2['length']>0x1){const _0x354e3d=[];for(const _0x39ff06 of _0x5762b2){const _0x376d52=_0x39ff06[_0x4d49db(0x1f2)]||0x1;_0x137aa6['progress']?.[_0x4d49db(0x15a)](_0x4d49db(0x1be)+_0x23f580[_0x4d49db(0x132)]+'\x20v'+_0x376d52);const _0x4c3c5f=await _0x46832b(_0x39ff06['id']),_0x346949=_0x21800e(_0x39ff06['id']),_0x30eebd=await journeyResponseToDef(_0x4c3c5f,_0x346949);_0x354e3d[_0x4d49db(0x202)]({'item':_0x39ff06,'yaml':_0x30eebd});}const _0x5ee3b8=buildLocalRuleToNameMappingFromJourney(_0x23f580);_0x2ee338=buildMergedJourneyDef(_0x354e3d,_0x5ee3b8,_0xf92dd1);const _0x59c07c=Math[_0x4d49db(0x206)](..._0x354e3d['map'](_0x57e068=>_0x57e068[_0x4d49db(0x1ec)][_0x4d49db(0x1f2)]||0x0)),_0x242c35=_0x5762b2[_0x4d49db(0x151)](_0x588f99=>(_0x588f99[_0x4d49db(0x1f2)]||0x0)===_0x59c07c);_0x242c35&&(_0x137aa6['progress']?.[_0x4d49db(0x15a)]('Fetching\x20'+_0x23f580['name']+'\x20v'+_0x59c07c),_0x467738=await _0x46832b(_0x242c35['id']));}else{const _0x1a6ade=_0x5762b2[_0x5762b2['length']-0x1];_0x137aa6[_0x4d49db(0x1ac)]?.['update'](_0x4d49db(0x1be)+_0x23f580[_0x4d49db(0x132)]),_0x467738=await _0x46832b(_0x1a6ade['id']);const _0x1c00d0=_0x21800e(_0x1a6ade['id']),_0x4dc637=await journeyResponseToDef(_0x467738,_0x1c00d0),_0x493cac=buildLocalRuleToNameMappingFromJourney(_0x23f580);_0x2ee338=buildMergedJourneyDef([{'item':_0x1a6ade,'yaml':_0x4dc637}],_0x493cac,_0xf92dd1);}}addFoldersToCreate(_0x37b8e5,_0x137aa6[_0x4d49db(0x1b4)],_0xe83e5c);const _0x3e07de=calculateJourneyDiff(_0x23f580,_0x2ee338);_0x6b91d1['push']({'relativePath':_0x23f580[_0x4d49db(0x132)],'absolutePath':_0x4b24fd,'yamlConfig':_0x23f580,'folderPath':_0x37b8e5,'existingJourney':_0x467738,'isNew':_0x3e07de['isNew'],'hasChanges':_0x3e07de[_0x4d49db(0x219)],'diff':_0x3e07de[_0x4d49db(0x152)]});}return{'journeyFiles':_0x6b91d1,'foldersToCreate':_0xe83e5c};}export function calculateActivationActions(_0x1731b0,_0x2402a5,_0x3e4b81,_0x29aa4e){const _0x5d4759=a152_0x427e52,_0x48d16f=[],_0xb23ffe=new Map();for(const _0x41ce4e of _0x2402a5){_0xb23ffe[_0x5d4759(0x1a8)](_0x41ce4e[_0x5d4759(0x132)],_0x41ce4e);}const _0xbb1a2e=new Map();for(const _0x54f5e3 of _0x1731b0){_0xbb1a2e[_0x5d4759(0x1a8)](_0x54f5e3[_0x5d4759(0x132)],_0x54f5e3);}for(const _0x1541a9 of _0x1731b0){const _0x2cbd14=_0xb23ffe[_0x5d4759(0x199)](_0x1541a9['name']);if(!_0x2cbd14)_0x48d16f[_0x5d4759(0x202)]({'type':_0x5d4759(0x134),'name':_0x1541a9[_0x5d4759(0x132)],'yamlActivation':_0x1541a9});else{const _0x2f66fe=activationResponseToDef(_0x2cbd14,_0x3e4b81,_0x29aa4e),_0x37cff0=a152_0x3db32a[_0x5d4759(0x198)](_0x2f66fe),_0x2e26fd=a152_0x3db32a[_0x5d4759(0x198)](_0x1541a9);_0x37cff0!==_0x2e26fd&&_0x48d16f[_0x5d4759(0x202)]({'type':'update','name':_0x1541a9[_0x5d4759(0x132)],'yamlActivation':_0x1541a9,'existingActivation':_0x2cbd14});}}for(const _0x4102f5 of _0x2402a5){!_0xbb1a2e[_0x5d4759(0x1ca)](_0x4102f5[_0x5d4759(0x132)])&&_0x48d16f[_0x5d4759(0x202)]({'type':_0x5d4759(0x19b),'name':_0x4102f5[_0x5d4759(0x132)],'existingActivation':_0x4102f5});}return _0x48d16f;}function calculateYamlDiff(_0xa886ea,_0x597c3e){if(_0x597c3e){const _0x2a389a=generateDiff(_0x597c3e,_0xa886ea),_0x5bc7c6=hasChanges(_0x2a389a);return{'isNew':![],'hasChanges':_0x5bc7c6,'diff':_0x5bc7c6?formatDiffWithColors(_0x2a389a):undefined};}const _0x564c81=generateDiff('',_0xa886ea);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x564c81)};}export function calculateSegmentDiff(_0x2b9abb,_0x12a3eb,_0x4bf5e2,_0x2c4eea,_0x3fae29){const _0x153a43=segmentToYamlString(_0x2b9abb),_0x4ee9ef=_0x12a3eb?segmentToYamlString(segmentWithActivationsToYaml(_0x12a3eb,_0x4bf5e2,undefined,_0x2c4eea,_0x3fae29)):undefined;return calculateYamlDiff(_0x153a43,_0x4ee9ef);}export function calculateJourneyDiff(_0x529057,_0x3b9f58){const _0x39286d=normalizeJourneyDef(_0x529057,_0x529057),_0x27b15e=a152_0x2294ca(_0x39286d),_0x58455b=_0x3b9f58?a152_0x2294ca(normalizeJourneyDef(_0x3b9f58,_0x529057)):undefined;return calculateYamlDiff(_0x27b15e,_0x58455b);}export function findSegmentsToDelete(_0xd9f409,_0x135437,_0x400fc1,_0xe8ff1c,_0x49f7bc){const _0x502774=a152_0x427e52,_0x503922=new Set();for(const {yamlConfig:_0x146b1e,folderPath:_0x269f2d}of _0x135437){_0x503922[_0x502774(0x1eb)](_0x269f2d+':'+_0x146b1e[_0x502774(0x132)]);}return _0xd9f409[_0x502774(0x150)](_0x426a9e=>{const _0x17e6ea=_0x502774,_0xbbe91a=_0x426a9e[_0x17e6ea(0x15b)]?_0x400fc1['get'](_0x426a9e[_0x17e6ea(0x15b)]['toString']())||'':'',_0x4b47f6=_0xbbe91a+':'+_0x426a9e[_0x17e6ea(0x132)];if(_0x503922[_0x17e6ea(0x1ca)](_0x4b47f6))return![];if(_0x49f7bc)return _0xbbe91a===_0xe8ff1c||_0xbbe91a[_0x17e6ea(0x1e1)](_0xe8ff1c+'/');return!![];});}export function findJourneysToDelete(_0x37f6a1,_0x12b4db,_0x638508,_0x1a9cf2,_0x2a0faa){const _0x189f6f=a152_0x427e52,_0x1f06bb=new Set();for(const {yamlConfig:_0x304b25,folderPath:_0x2f0f54}of _0x12b4db){_0x1f06bb[_0x189f6f(0x1eb)](_0x2f0f54+':'+_0x304b25[_0x189f6f(0x132)]);}return _0x37f6a1[_0x189f6f(0x150)](_0xe2331b=>{const _0x3e347d=_0x189f6f,_0x1e6ce4=_0xe2331b[_0x3e347d(0x128)]?_0x638508['get'](_0xe2331b['folderId'])||'':'',_0xb73f94=_0x1e6ce4+':'+_0xe2331b[_0x3e347d(0x17e)];if(_0x1f06bb[_0x3e347d(0x1ca)](_0xb73f94))return![];if(_0x2a0faa)return _0x1e6ce4===_0x1a9cf2||_0x1e6ce4['startsWith'](_0x1a9cf2+'/');return!![];});}export function buildSegmentLookupMap(_0x242039,_0x2c53f5){const _0x518a8e=a152_0x427e52,_0x3ded1d=new Map();for(const _0x5b5ca8 of _0x242039){const _0x25b1dd=_0x5b5ca8[_0x518a8e(0x15b)]?_0x2c53f5[_0x518a8e(0x199)](_0x5b5ca8['segmentFolderId'][_0x518a8e(0x1c2)]())||'':'',_0xacad17=_0x25b1dd+':'+_0x5b5ca8['name'];_0x3ded1d[_0x518a8e(0x1a8)](_0xacad17,_0x5b5ca8);}return _0x3ded1d;}export function buildSegmentNameToIdMap(_0x44e9ff){const _0x3c7afd=a152_0x427e52,_0x5e3ab6=new Map();for(const _0x3e5b06 of _0x44e9ff){_0x5e3ab6[_0x3c7afd(0x1a8)](_0x3e5b06[_0x3c7afd(0x132)],_0x3e5b06['id']);}return _0x5e3ab6;}export function buildJourneyBundleLookupMap(_0x11993a,_0x3c3e0b){const _0x1a214f=a152_0x427e52,_0x5012e9=new Map();for(const _0x244c4a of _0x11993a){const _0x49d3d1=_0x244c4a['folderId']?_0x3c3e0b[_0x1a214f(0x199)](_0x244c4a['folderId'])||'':'',_0x51bbbd=_0x49d3d1+':'+_0x244c4a[_0x1a214f(0x17e)];!_0x5012e9[_0x1a214f(0x1ca)](_0x51bbbd)&&_0x5012e9[_0x1a214f(0x1a8)](_0x51bbbd,[]),_0x5012e9['get'](_0x51bbbd)[_0x1a214f(0x202)](_0x244c4a);}for(const _0x56401b of _0x5012e9[_0x1a214f(0x189)]()){_0x56401b[_0x1a214f(0x201)]((_0x83fc7e,_0x1becd3)=>(_0x83fc7e[_0x1a214f(0x1f2)]||0x0)-(_0x1becd3['versionNumber']||0x0));}return _0x5012e9;}export function collectFoldersToCreate(_0x555599,_0x571bed){const _0x11fe20=a152_0x427e52,_0x2245f2=new Set();for(const _0x3f010f of _0x555599){if(!_0x3f010f)continue;if(_0x571bed[_0x11fe20(0x1ca)](_0x3f010f))continue;const _0x5d0f87=_0x3f010f[_0x11fe20(0x19d)]('/');let _0x4827bf='';for(const _0x3b7c71 of _0x5d0f87){_0x4827bf=_0x4827bf?_0x4827bf+'/'+_0x3b7c71:_0x3b7c71,!_0x571bed[_0x11fe20(0x1ca)](_0x4827bf)&&_0x2245f2[_0x11fe20(0x1eb)](_0x4827bf);}}return _0x2245f2;}export function parseAndClassifyYamlFiles(_0x43cbb8,_0x217584,_0x1b3e52){const _0x282c3e=a152_0x427e52,_0x5e2fd0=[],_0x2b6ca5=[];for(const _0x49f0b8 of _0x43cbb8){const _0xf69e93=a152_0x5aada6[_0x282c3e(0x1c6)](_0x217584,a152_0x5aada6['dirname'](_0x49f0b8)),_0x182915=_0xf69e93==='.'?'':_0xf69e93,_0x26542e=readFileSync(_0x49f0b8,_0x282c3e(0x18e)),_0x286d4e=a152_0x3db32a[_0x282c3e(0x200)](_0x26542e);if(isJourneyDef(_0x286d4e)){const _0x2f095b=a152_0x143a16(_0x26542e);_0x2b6ca5[_0x282c3e(0x202)]({'yamlConfig':_0x2f095b,'folderPath':_0x182915,'sourcePath':_0x49f0b8});}else{if(!_0x1b3e52?.[_0x282c3e(0x1f7)]){const _0x385a32=parseSegmentYamlFile(_0x26542e),_0x1b0835=normalizeChildSegmentYaml(_0x385a32);_0x5e2fd0[_0x282c3e(0x202)]({'yamlConfig':_0x1b0835,'folderPath':_0x182915,'sourcePath':_0x49f0b8});}}}return{'segments':_0x5e2fd0,'journeys':_0x2b6ca5};}export function validateParsedFiles(_0x3ae982,_0x2629df){const _0x27d5df=a152_0x427e52,_0x5282ca=[];for(const {yamlConfig:_0x5a18f0,sourcePath:_0x494457}of _0x3ae982['segments']){const _0x14aa9e=readFileSync(_0x494457,_0x27d5df(0x18e)),_0x599ad2=a152_0x3db32a[_0x27d5df(0x204)](_0x14aa9e),_0x3a2e4b=validateSegmentDef(_0x5a18f0,{'source':_0x14aa9e,'document':_0x599ad2},{'skipSchema':!![]});if(!_0x3a2e4b[_0x27d5df(0x1d0)]){const _0x538156=a152_0x5aada6['relative'](_0x2629df,_0x494457);_0x5282ca[_0x27d5df(0x202)]({'filePath':_0x538156,'source':_0x14aa9e,'result':_0x3a2e4b,'isJourney':![]});}}for(const {yamlConfig:_0x256435,sourcePath:_0x1e47f1}of _0x3ae982['journeys']){const _0x44ebc4=readFileSync(_0x1e47f1,'utf-8'),_0x1a7e34=a152_0x3db32a[_0x27d5df(0x204)](_0x44ebc4),_0x5b2fb6=validateJourneyDef(_0x256435,{'source':_0x44ebc4,'document':_0x1a7e34},{'skipSchema':!![]});if(!_0x5b2fb6['valid']){const _0x27a9a8=a152_0x5aada6[_0x27d5df(0x1c6)](_0x2629df,_0x1e47f1);_0x5282ca[_0x27d5df(0x202)]({'filePath':_0x27a9a8,'source':_0x44ebc4,'result':_0x5b2fb6,'isJourney':!![]});}}return _0x5282ca;}export function formatValidationErrors(_0x44e1df){const _0x5aecf9=a152_0x427e52,_0xeb08bc=[];for(const {filePath:_0x39f49d,source:_0x314eae,result:_0x2737f9,isJourney:_0x15f02f}of _0x44e1df){const _0x1e7782=_0x15f02f?_0x5aecf9(0x1e8):_0x5aecf9(0x16c);_0xeb08bc[_0x5aecf9(0x202)]('\x0a'+_0x39f49d+'\x20('+_0x1e7782+'):\x20'+_0x2737f9['errors'][_0x5aecf9(0x1f9)]+_0x5aecf9(0x1bc)),_0xeb08bc[_0x5aecf9(0x202)](formatValidationResult(_0x2737f9,_0x314eae,_0x39f49d));}return _0xeb08bc['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x2dbaf3){const _0x9ee40e=a152_0x427e52,_0x285055=new Set(),_0x3746c5=new Map(),_0xed30a5=collectSegmentUsageCounts(_0x2dbaf3);if(_0x2dbaf3['segments'])for(const [_0x2181aa,_0x233982]of Object[_0x9ee40e(0x1ba)](_0x2dbaf3[_0x9ee40e(0x125)])){_0x285055['add'](_0x2181aa);if(_0x233982[_0x9ee40e(0x163)]){const _0x4a2b63=yamlRuleToApi(_0x233982[_0x9ee40e(0x163)]),_0x531698=apiRuleToYaml(_0x4a2b63);_0x3746c5['set'](_0x2181aa,_0x531698);}}const _0x3f5aed=new Map();let _0x37f3b9=0x0;for(const [_0x42e930,_0x4e17dd]of _0x3746c5){const _0x560b37=serializeExpandedRule(_0x4e17dd,_0x3746c5),_0x1f111b=_0x3f5aed[_0x9ee40e(0x199)](_0x560b37)||[];_0x1f111b[_0x9ee40e(0x202)]({'name':_0x42e930,'index':_0x37f3b9}),_0x3f5aed[_0x9ee40e(0x1a8)](_0x560b37,_0x1f111b),_0x37f3b9++;}const _0x2a75a2=new Map();for(const [_0x39764b,_0x5f4cef]of _0x3f5aed){const _0x4e2fed=_0x5f4cef['slice']()[_0x9ee40e(0x201)]((_0x4453cd,_0x5bb88e)=>{const _0x791b36=_0x9ee40e,_0x53f936=_0xed30a5[_0x791b36(0x199)](_0x4453cd[_0x791b36(0x132)])||0x0,_0x169b71=_0xed30a5['get'](_0x5bb88e[_0x791b36(0x132)])||0x0;if(_0x53f936!==_0x169b71)return _0x169b71-_0x53f936;return _0x4453cd[_0x791b36(0x1af)]-_0x5bb88e[_0x791b36(0x1af)];})[_0x9ee40e(0x1c4)](_0x354b2d=>_0x354b2d[_0x9ee40e(0x132)]),_0x3e9dbf=[];for(const _0x4cb465 of _0x4e2fed){const _0x1d3704=_0xed30a5['get'](_0x4cb465)||0x0,_0x1fbac7=Math[_0x9ee40e(0x206)](_0x1d3704,0x1);for(let _0x1ddf77=0x0;_0x1ddf77<_0x1fbac7;_0x1ddf77++){_0x3e9dbf[_0x9ee40e(0x202)](_0x4cb465);}}_0x2a75a2[_0x9ee40e(0x1a8)](_0x39764b,_0x3e9dbf);}return{'existingLocalSegmentNames':_0x285055,'localSegmentRules':_0x3746c5,'localExpandedRuleToNames':_0x2a75a2};}export function createSegmentIdResolver(_0x5e4302,_0x341b65){return async _0x5a5b63=>{const _0x55820d=a152_0x5d01,_0x212622=_0x5e4302[_0x55820d(0x199)](_0x5a5b63);if(!_0x212622)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x55820d(0x1f6)+_0x5a5b63+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x341b65+'\x27)');return _0x212622;};}export function extractRootFolderId(_0x38e5c4){const _0x16b45f=a152_0x427e52;return _0x38e5c4['relationships']?.[_0x16b45f(0x1c9)]?.['data']?.['id']||_0x38e5c4[_0x16b45f(0x1d2)]?.[_0x16b45f(0x17d)]?.[_0x16b45f(0x164)]?.['id'];}export function buildConnectionMaps(_0x306b10){const _0x419a21=a152_0x427e52,_0x5f28d4=new Map(),_0x59b283=new Map(),_0x5780ca=new Map();for(const _0x5c2ca5 of _0x306b10){_0x5f28d4[_0x419a21(0x1a8)](_0x5c2ca5['name'],parseInt(_0x5c2ca5['id'],0xa)),_0x59b283['set'](_0x5c2ca5['id'],_0x5c2ca5[_0x419a21(0x132)]),_0x5780ca['set'](_0x5c2ca5[_0x419a21(0x132)],_0x5c2ca5[_0x419a21(0x1f1)]);}return{'nameToId':_0x5f28d4,'idToName':_0x59b283,'nameToType':_0x5780ca};}export function calculatePushStats(_0x3dc2cd,_0x28a44a,_0x3b51dd,_0x134de8,_0x4d6f88,_0x3cb543,_0x5e3f20){const _0x140f73=a152_0x427e52,_0x3fe5bf=_0x3dc2cd[_0x140f73(0x150)](_0x115781=>_0x115781[_0x140f73(0x143)]),_0x53ad4a=_0x3dc2cd[_0x140f73(0x150)](_0x15fff2=>!_0x15fff2['isNew']&&_0x15fff2[_0x140f73(0x219)]),_0xcd60d2=_0x3dc2cd[_0x140f73(0x150)](_0x47bcf3=>!_0x47bcf3[_0x140f73(0x143)]&&!_0x47bcf3['hasChanges']),_0x2da35=_0x3cb543?_0x134de8:[],_0x210dad=_0x28a44a[_0x140f73(0x150)](_0x1a683f=>_0x1a683f[_0x140f73(0x143)]),_0x4e9cf8=_0x28a44a['filter'](_0x50908f=>!_0x50908f[_0x140f73(0x143)]&&_0x50908f[_0x140f73(0x219)]),_0x2a6a26=_0x28a44a[_0x140f73(0x150)](_0xd8c941=>!_0xd8c941[_0x140f73(0x143)]&&!_0xd8c941['hasChanges']),_0x3d0cbf=_0x3cb543?_0x4d6f88:[],_0x1b3f02=_0x3dc2cd['flatMap'](_0x15ee9f=>_0x15ee9f[_0x140f73(0x1c3)]),_0x23835f=_0x1b3f02[_0x140f73(0x150)](_0x1b2363=>_0x1b2363[_0x140f73(0x1f1)]===_0x140f73(0x134)),_0x5966fd=_0x1b3f02[_0x140f73(0x150)](_0x5c1aa9=>_0x5c1aa9[_0x140f73(0x1f1)]===_0x140f73(0x15a)),_0x5d27b1=_0x1b3f02[_0x140f73(0x150)](_0x329865=>_0x329865['type']===_0x140f73(0x19b)),_0x271e26=Array['from'](_0x3b51dd)[_0x140f73(0x201)](),_0x43babb=_0x5e3f20?![]:_0x3fe5bf[_0x140f73(0x1f9)]>0x0||_0x53ad4a['length']>0x0||_0x2da35[_0x140f73(0x1f9)]>0x0,_0x564d68=_0x210dad[_0x140f73(0x1f9)]>0x0||_0x4e9cf8[_0x140f73(0x1f9)]>0x0||_0x3d0cbf['length']>0x0,_0x30bade=_0x5e3f20?![]:_0x1b3f02[_0x140f73(0x1f9)]>0x0,_0x23b7b4=_0x271e26[_0x140f73(0x1f9)]>0x0;return{'segments':{'new':_0x3fe5bf,'changed':_0x53ad4a,'unchanged':_0xcd60d2,'toDelete':_0x2da35},'journeys':{'new':_0x210dad,'changed':_0x4e9cf8,'unchanged':_0x2a6a26,'toDelete':_0x3d0cbf},'activations':{'all':_0x1b3f02,'toCreate':_0x23835f,'toUpdate':_0x5966fd,'toDelete':_0x5d27b1},'folders':{'toCreate':_0x271e26},'counts':{'segments':{'new':_0x3fe5bf[_0x140f73(0x1f9)],'changed':_0x53ad4a[_0x140f73(0x1f9)],'unchanged':_0xcd60d2[_0x140f73(0x1f9)],'toDelete':_0x2da35[_0x140f73(0x1f9)]},'journeys':{'new':_0x210dad['length'],'changed':_0x4e9cf8[_0x140f73(0x1f9)],'unchanged':_0x2a6a26[_0x140f73(0x1f9)],'toDelete':_0x3d0cbf['length']},'activations':{'create':_0x23835f[_0x140f73(0x1f9)],'update':_0x5966fd[_0x140f73(0x1f9)],'delete':_0x5d27b1[_0x140f73(0x1f9)]},'folders':_0x271e26[_0x140f73(0x1f9)]},'hasChanges':_0x43babb||_0x564d68||_0x30bade||_0x23b7b4};}export async function buildPushExecutionContext(_0x1f0746,_0x1c8177,_0x5823cf,_0x3d80a1,_0x5cd86b,_0x13a8c3){const _0x18bc7f=a152_0x427e52,_0xddcfd8=extractRootFolderId(_0x5823cf),{pathToId:_0x500cd7,idToPath:_0x463520}=buildFolderMaps(_0x5cd86b),_0xcba375=buildSegmentNameToIdMap(_0x3d80a1),_0x51d9ea=new Map(),{batchAsync:_0x1f3d59}=await import(_0x18bc7f(0x139)),[_0x54b877,_0x3adb58]=await Promise[_0x18bc7f(0x130)]([_0x1f0746[_0x18bc7f(0x174)][_0x18bc7f(0x1b6)](),_0x1f0746[_0x18bc7f(0x193)][_0x18bc7f(0x168)](),((async()=>{const _0x17c92b=_0x18bc7f;!_0x13a8c3&&_0x3d80a1[_0x17c92b(0x1f9)]>0x0&&await _0x1f3d59(_0x3d80a1,async _0x2aa6a6=>{const _0x1f9a65=_0x17c92b,_0x382da0=await _0x1f0746[_0x1f9a65(0x16c)][_0x1f9a65(0x203)](_0x1c8177,_0x2aa6a6['id']);_0x51d9ea['set'](_0x2aa6a6['id'],_0x382da0);});})())]),{emailToId:_0x50c742,idToEmail:_0x2cc769}=_0x54b877,_0x422995=buildConnectionMaps(_0x3adb58);return{'rootFolderId':_0xddcfd8,'folderPathToId':_0x500cd7,'folderIdToPath':_0x463520,'segmentNameToId':_0xcba375,'activationsBySegmentId':_0x51d9ea,'emailToIdMap':_0x50c742,'idToEmailMap':_0x2cc769,'connectionNameToIdMap':_0x422995[_0x18bc7f(0x209)],'connectionIdToNameMap':_0x422995[_0x18bc7f(0x1d8)],'connectionNameToTypeMap':_0x422995['nameToType']};}export function createPushYamlContextForBundle(_0x3a6757,_0x2a9d24,_0xaffe70,_0x218d6a,_0x3f7abb,_0x4fd570,_0x28d62c,_0x23c0f9){const {existingLocalSegmentNames:_0x287f2c,localExpandedRuleToNames:_0x5ca74f}=_0x218d6a,_0x2fcfb7=new Set(),_0xc141d1=new Map(),_0x1d9de1=new Map(),_0x498cea=new Map(),_0x5bdd78=createJumpTargetCache(),_0x3c3288=new Map(),_0x554ebf=new Map(),_0x242e0d=new Set();let _0x3aea0b;const _0x1655ff=_0x23807f=>{const _0x2759d9={'resolveSegment':async _0x237744=>{const _0x514686=a152_0x5d01,_0x38f3dc=_0x498cea[_0x514686(0x199)](_0x237744);if(_0x38f3dc!==undefined)return{'name':_0x38f3dc,'isJourneyLocal':!![]};try{const _0x578245=await fetchSegment(_0x3a6757,_0x2a9d24,_0x237744,_0xaffe70);if(!_0x578245)throw new Error('Segment\x20not\x20found');const _0x23aa7f=generateJourneyLocalName(_0x578245[_0x514686(0x132)]),_0xbf3993=_0x578245[_0x514686(0x1fb)]===SEGMENT_KIND_JOURNEY&&_0x23aa7f!==undefined;let _0x4c7216=_0x578245['name'],_0x9a2326;if(_0xbf3993&&_0x578245[_0x514686(0x163)]){const _0x2918bc=apiRuleToYaml(_0x578245[_0x514686(0x163)]);_0x554ebf['set'](_0x237744,_0x2918bc);const _0x5b0e3c=async _0x3479cd=>{const _0x22094b=_0x514686,_0x5218aa=collectSegmentRefsFromRule(_0x3479cd);for(const _0x366ff5 of _0x5218aa){if(!_0x554ebf[_0x22094b(0x1ca)](_0x366ff5))try{const _0x4f40fd=await fetchSegment(_0x3a6757,_0x2a9d24,_0x366ff5,_0xaffe70);if(_0x4f40fd?.[_0x22094b(0x163)]){const _0x1dab69=apiRuleToYaml(_0x4f40fd[_0x22094b(0x163)]);_0x554ebf[_0x22094b(0x1a8)](_0x366ff5,_0x1dab69),await _0x5b0e3c(_0x1dab69);}}catch(_0x128584){logger[_0x22094b(0x131)](_0x22094b(0x212)+_0x366ff5+':\x20'+_0x128584);}}};await _0x5b0e3c(_0x2918bc);const _0xc0d98c=serializeExpandedRule(_0x2918bc,_0x554ebf),_0x39e7e1=_0x5ca74f['get'](_0xc0d98c);if(_0x39e7e1&&_0x39e7e1['length']>0x0){const _0x4ba0e2=_0xc141d1[_0x514686(0x199)](_0xc0d98c)||0x0,_0x46ac29=_0x39e7e1[_0x4ba0e2]||_0x39e7e1[_0x39e7e1[_0x514686(0x1f9)]-0x1];_0xc141d1[_0x514686(0x1a8)](_0xc0d98c,_0x4ba0e2+0x1),_0x4c7216=_0x46ac29,_0x2fcfb7['add'](_0x4c7216),_0x498cea[_0x514686(0x1a8)](_0x237744,_0x4c7216);const _0x2ec7a2=await resolveRuleSegmentRefs(_0x2918bc,async _0x10bf14=>{const _0x2ed041=_0x514686,_0x274584=_0x498cea[_0x2ed041(0x199)](_0x10bf14);if(_0x274584)return _0x274584;const _0x222632=await _0x3aea0b[_0x2ed041(0x192)](_0x10bf14);return _0x222632['name'];});_0x9a2326={'description':_0x578245['description'],'rule':_0x2ec7a2};}else{const _0x3a7eac=_0x3c3288[_0x514686(0x199)](_0xc0d98c);if(_0x3a7eac)_0x4c7216=_0x3a7eac,_0x498cea[_0x514686(0x1a8)](_0x237744,_0x4c7216);else{if(_0x23aa7f){let _0x118603=_0x23aa7f,_0x3e9fe5=0x2;while(_0x2fcfb7['has'](_0x118603)||_0x287f2c['has'](_0x118603)){_0x118603=_0x23aa7f+'_'+_0x3e9fe5,_0x3e9fe5++;}_0x2fcfb7[_0x514686(0x1eb)](_0x118603),_0x4c7216=_0x118603;}_0x498cea['set'](_0x237744,_0x4c7216),_0x3c3288['set'](_0xc0d98c,_0x4c7216);const _0x1415bb=await resolveRuleSegmentRefs(_0x2918bc,async _0x581e15=>{const _0x30d065=_0x498cea['get'](_0x581e15);if(_0x30d065)return _0x30d065;const _0xecc2e=await _0x3aea0b['resolveSegment'](_0x581e15);return _0xecc2e['name'];});_0x9a2326={'description':_0x578245[_0x514686(0x1f4)],'rule':_0x1415bb};}}}return{'name':_0x4c7216,'isJourneyLocal':_0xbf3993,'definition':_0x9a2326};}catch(_0x24e2a9){return logger['debug'](_0x514686(0x1fd)+_0x237744+':\x20'+_0x24e2a9),{'name':_0x237744,'isJourneyLocal':![]};}},'resolveActivation':async _0x197fef=>{const _0x14f1a2=a152_0x5d01,_0xbc709=_0x1d9de1['get'](_0x197fef);if(_0xbc709!==undefined)return{'name':_0xbc709,'isJourneyLocal':!![]};try{let _0x2b74ff=_0x28d62c?.['get'](_0x197fef);!_0x2b74ff&&(_0x2b74ff=await _0x3a6757['journey'][_0x14f1a2(0x165)](_0x23807f,_0x197fef));const _0x16cb37=_0x2b74ff[_0x14f1a2(0x15f)][_0x14f1a2(0x169)][_0x14f1a2(0x132)]||_0x197fef,_0x27cfed=sanitizeYamlKey(_0x16cb37)||_0x14f1a2(0x1cd)+_0x197fef,_0x133733=_0x27cfed;_0x1d9de1[_0x14f1a2(0x1a8)](_0x197fef,_0x133733);const _0x5621d5=journeyActivationStepToYaml(_0x2b74ff,_0x3f7abb,_0x4fd570);return{'name':_0x133733,'isJourneyLocal':!![],'definition':_0x5621d5};}catch(_0x51b49a){return logger[_0x14f1a2(0x131)](_0x14f1a2(0x13b)+_0x197fef+':\x20'+_0x51b49a),{'name':_0x197fef,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x511127,_0x56c8b1)=>resolveJumpTarget(_0x511127,_0x56c8b1,_0x5bdd78,async _0x2efa96=>{const _0x53f0dc=a152_0x5d01,_0xcde399=_0x23c0f9?.[_0x53f0dc(0x199)](_0x2efa96);if(_0xcde399)return _0xcde399;return _0x3a6757[_0x53f0dc(0x1e8)][_0x53f0dc(0x1b2)](_0x2efa96);})};return _0x3aea0b=_0x2759d9,_0x2759d9;},_0x361384=async _0x533aea=>{const _0x460397=a152_0x5d01,{collectSegmentIdsFromJourneyApi:_0x194b2c}=await import('./journey-yaml.js'),{batchAsync:_0x1207e4}=await import(_0x460397(0x139)),_0x1cb7a2=new Set();for(const _0x1dc03a of _0x533aea){let _0x202298=_0x23c0f9?.['get'](_0x1dc03a);!_0x202298&&(_0x202298=await _0x3a6757[_0x460397(0x1e8)][_0x460397(0x1b2)](_0x1dc03a));const _0x5e8708=_0x194b2c(_0x202298);for(const _0x167275 of _0x5e8708){_0x1cb7a2[_0x460397(0x1eb)](_0x167275);}}let _0x545cfb=Array[_0x460397(0x1bd)](_0x1cb7a2);while(_0x545cfb[_0x460397(0x1f9)]>0x0){const _0x1bfcd6=_0x545cfb[_0x460397(0x150)](_0x2f41b7=>!_0x242e0d['has'](_0x2f41b7));if(_0x1bfcd6[_0x460397(0x1f9)]===0x0)break;const _0x2e54f0=await _0x1207e4(_0x1bfcd6,async _0x351004=>{_0x242e0d['add'](_0x351004);const _0xf1cff3=await fetchSegment(_0x3a6757,_0x2a9d24,_0x351004,_0xaffe70);if(!_0xf1cff3)return null;return{'segmentId':_0x351004,'segment':_0xf1cff3};},0xa),_0xe06cdd=new Set();for(const _0x5ba0f5 of _0x2e54f0){if(!_0x5ba0f5?.['segment']?.[_0x460397(0x163)])continue;const _0x4c7a38=apiRuleToYaml(_0x5ba0f5[_0x460397(0x16c)][_0x460397(0x163)]);_0x554ebf['set'](_0x5ba0f5[_0x460397(0x185)],_0x4c7a38);const _0x23c89c=collectSegmentRefsFromRule(_0x4c7a38);for(const _0xf13d28 of _0x23c89c){!_0x242e0d[_0x460397(0x1ca)](_0xf13d28)&&_0xe06cdd[_0x460397(0x1eb)](_0xf13d28);}}_0x545cfb=Array[_0x460397(0x1bd)](_0xe06cdd);}};return{'createYamlContext':_0x1655ff,'prefetchJourneySegments':_0x361384};}export async function executePushSegments(_0x41947c,_0x42eb3e,_0x25cdd7,_0x3b5461,_0x1c28f6){const _0x4e8b10=a152_0x427e52,{segmentDefToCreateRequest:_0x257789,segmentDefToUpdateRequest:_0x29456a}=await import('./child-segment-yaml.js'),_0x850726=_0x25cdd7[_0x4e8b10(0x1b4)],_0x2e9927=0x5,_0x4414d8=async _0x453e8e=>{const _0x46a28b=_0x4e8b10,_0x4cfdb4=_0x453e8e[_0x46a28b(0x1b3)]?_0x850726[_0x46a28b(0x199)](_0x453e8e['folderPath']):undefined;let _0x15d107;const _0x562237={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x3112f5=_0x453e8e['yamlConfig'];if(_0x453e8e['yamlConfig']['rule']){const _0x58564f=createSegmentIdResolver(_0x25cdd7[_0x46a28b(0x217)],_0x453e8e[_0x46a28b(0x194)][_0x46a28b(0x132)]),_0x215f90=await resolveRuleSegmentIds(_0x453e8e['yamlConfig'][_0x46a28b(0x163)],_0x58564f);_0x3112f5={..._0x453e8e[_0x46a28b(0x194)],'rule':_0x215f90};}try{if(_0x453e8e[_0x46a28b(0x143)]){_0x1c28f6['onProgress']?.({'type':_0x46a28b(0x124),'name':_0x453e8e[_0x46a28b(0x194)][_0x46a28b(0x132)]});const _0x262722=_0x257789(_0x3112f5,_0x4cfdb4),_0x1133e6=await _0x1c28f6[_0x46a28b(0x1ff)]('Creating\x20segment\x20\x27'+_0x453e8e[_0x46a28b(0x194)][_0x46a28b(0x132)]+_0x46a28b(0x16d),()=>_0x41947c[_0x46a28b(0x16c)][_0x46a28b(0x12f)](_0x3b5461[_0x46a28b(0x218)],_0x262722));_0x15d107=_0x1133e6[_0x46a28b(0x164)]['id'],_0x25cdd7[_0x46a28b(0x217)][_0x46a28b(0x1a8)](_0x453e8e['yamlConfig']['name'],_0x15d107),_0x562237[_0x46a28b(0x12b)]={'name':_0x453e8e[_0x46a28b(0x194)][_0x46a28b(0x132)],'id':_0x15d107},_0x1c28f6[_0x46a28b(0x1ed)]?.({'type':'segment_created','name':_0x453e8e[_0x46a28b(0x194)]['name'],'segmentId':_0x15d107}),_0x1c28f6[_0x46a28b(0x210)]?.(_0x46a28b(0x1e2)+_0x453e8e[_0x46a28b(0x194)]['name']+'\x27'),_0x562237[_0x46a28b(0x12e)]=0x1;}else{if(_0x453e8e[_0x46a28b(0x219)]){_0x1c28f6[_0x46a28b(0x1ed)]?.({'type':'segment_updating','name':_0x453e8e[_0x46a28b(0x194)][_0x46a28b(0x132)]});const _0xe836ae=_0x29456a(_0x3112f5);_0x4cfdb4!==_0x453e8e[_0x46a28b(0x1d5)]?.[_0x46a28b(0x15b)]&&(_0xe836ae[_0x46a28b(0x15b)]=_0x4cfdb4?parseInt(_0x4cfdb4,0xa):undefined),await _0x1c28f6[_0x46a28b(0x1ff)]('Updating\x20segment\x20\x27'+_0x453e8e[_0x46a28b(0x194)]['name']+'\x27...',()=>_0x41947c[_0x46a28b(0x16c)]['updateSegmentById'](_0x3b5461[_0x46a28b(0x218)],_0x453e8e[_0x46a28b(0x1d5)]['id'],_0xe836ae)),_0x15d107=_0x453e8e[_0x46a28b(0x1d5)]['id'],_0x1c28f6['onProgress']?.({'type':_0x46a28b(0x1a1),'name':_0x453e8e[_0x46a28b(0x194)][_0x46a28b(0x132)]}),_0x1c28f6[_0x46a28b(0x210)]?.(_0x46a28b(0x20a)+_0x453e8e[_0x46a28b(0x194)][_0x46a28b(0x132)]+'\x27'),_0x562237['updated']=0x1;}else _0x15d107=_0x453e8e[_0x46a28b(0x1d5)]['id'];}}catch(_0x570ef4){const _0x4711dd=isHttp400Error(_0x570ef4),_0x4da213=_0x4711dd?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x2c7899=getErrorMessage(_0x570ef4);throw new SDKError(_0x4da213,_0x46a28b(0x137)+(_0x453e8e[_0x46a28b(0x143)]?_0x46a28b(0x134):_0x46a28b(0x15a))+_0x46a28b(0x13a)+_0x453e8e[_0x46a28b(0x177)]+_0x46a28b(0x153)+_0x2c7899,_0x570ef4);}try{const _0x101f00=await syncActivationsForSegment(_0x41947c,_0x3b5461[_0x46a28b(0x218)],_0x15d107,_0x453e8e['yamlConfig'][_0x46a28b(0x132)],_0x453e8e[_0x46a28b(0x1c3)],_0x1c28f6,_0x453e8e[_0x46a28b(0x177)]);_0x562237['activations']=_0x101f00;}catch(_0x141273){if(_0x141273 instanceof SDKError)throw _0x141273;throw new SDKError(ErrorCode[_0x46a28b(0x1e5)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x453e8e[_0x46a28b(0x194)][_0x46a28b(0x132)]+_0x46a28b(0x161)+_0x453e8e[_0x46a28b(0x177)]+'\x0a\x20\x20'+getErrorMessage(_0x141273),_0x141273);}return _0x562237;},_0x2d2243=await batchAsync(_0x42eb3e,_0x4414d8,_0x2e9927),_0x5686f3={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x49910c of _0x2d2243){_0x5686f3[_0x4e8b10(0x12e)]+=_0x49910c['created'],_0x5686f3[_0x4e8b10(0x19c)]+=_0x49910c[_0x4e8b10(0x19c)],_0x49910c[_0x4e8b10(0x12b)]&&_0x5686f3[_0x4e8b10(0x156)][_0x4e8b10(0x1a8)](_0x49910c[_0x4e8b10(0x12b)][_0x4e8b10(0x132)],_0x49910c['createdSegmentId']['id']),_0x5686f3[_0x4e8b10(0x1e0)][_0x4e8b10(0x12e)]+=_0x49910c['activations'][_0x4e8b10(0x12e)],_0x5686f3['activations'][_0x4e8b10(0x19c)]+=_0x49910c[_0x4e8b10(0x1e0)][_0x4e8b10(0x19c)],_0x5686f3['activations'][_0x4e8b10(0x14f)]+=_0x49910c[_0x4e8b10(0x1e0)][_0x4e8b10(0x14f)];}return _0x5686f3;}async function syncActivationsForSegment(_0x116012,_0x3ff5a4,_0x23a551,_0x5237e7,_0xd3063e,_0x546748,_0x15cf9e){const _0x4216b2=a152_0x427e52,_0x4caf3e={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x532c22 of _0xd3063e){try{if(_0x532c22[_0x4216b2(0x1f1)]===_0x4216b2(0x134)&&_0x532c22['validatedRequest'])_0x546748[_0x4216b2(0x1ed)]?.({'type':_0x4216b2(0x187),'segmentName':_0x5237e7,'activationName':_0x532c22[_0x4216b2(0x132)]}),await _0x546748[_0x4216b2(0x1ff)](_0x4216b2(0x1bf)+_0x532c22[_0x4216b2(0x132)]+_0x4216b2(0x16d),()=>_0x116012['segment'][_0x4216b2(0x1bb)](_0x3ff5a4,_0x23a551,_0x532c22[_0x4216b2(0x149)])),_0x546748['onProgress']?.({'type':_0x4216b2(0x178),'segmentName':_0x5237e7,'activationName':_0x532c22[_0x4216b2(0x132)]}),_0x546748[_0x4216b2(0x210)]?.(_0x4216b2(0x1b9)+_0x532c22['name']+'\x27'),_0x4caf3e['created']++;else{if(_0x532c22['type']===_0x4216b2(0x15a)&&_0x532c22['validatedRequest']&&_0x532c22[_0x4216b2(0x171)])_0x546748[_0x4216b2(0x1ed)]?.({'type':'activation_updating','segmentName':_0x5237e7,'activationName':_0x532c22[_0x4216b2(0x132)]}),await _0x546748[_0x4216b2(0x1ff)](_0x4216b2(0x188)+_0x532c22[_0x4216b2(0x132)]+_0x4216b2(0x16d),()=>_0x116012[_0x4216b2(0x16c)][_0x4216b2(0x20c)](_0x3ff5a4,_0x23a551,_0x532c22['existingActivation']['id'],_0x532c22[_0x4216b2(0x149)])),_0x546748[_0x4216b2(0x1ed)]?.({'type':'activation_updated','segmentName':_0x5237e7,'activationName':_0x532c22[_0x4216b2(0x132)]}),_0x546748[_0x4216b2(0x210)]?.('Updated\x20activation\x20\x27'+_0x532c22[_0x4216b2(0x132)]+'\x27'),_0x4caf3e[_0x4216b2(0x19c)]++;else _0x532c22[_0x4216b2(0x1f1)]===_0x4216b2(0x19b)&&_0x532c22[_0x4216b2(0x171)]&&(_0x546748['onProgress']?.({'type':'activation_deleting','segmentName':_0x5237e7,'activationName':_0x532c22['name']}),await _0x546748[_0x4216b2(0x1ff)](_0x4216b2(0x19e)+_0x532c22[_0x4216b2(0x132)]+'\x27...',()=>_0x116012[_0x4216b2(0x16c)]['deleteActivation'](_0x3ff5a4,_0x23a551,_0x532c22['existingActivation']['id'])),_0x546748['onProgress']?.({'type':_0x4216b2(0x135),'segmentName':_0x5237e7,'activationName':_0x532c22[_0x4216b2(0x132)]}),_0x546748[_0x4216b2(0x1e9)]?.(_0x4216b2(0x186)+_0x532c22[_0x4216b2(0x132)]+'\x27'),_0x4caf3e[_0x4216b2(0x14f)]++);}}catch(_0x4c9da5){const _0x1075e6=isHttp400Error(_0x4c9da5),_0x4f7933=_0x1075e6?ErrorCode[_0x4216b2(0x15c)]:ErrorCode[_0x4216b2(0x1e5)],_0x42ec72=getErrorMessage(_0x4c9da5);throw new SDKError(_0x4f7933,_0x4216b2(0x137)+_0x532c22[_0x4216b2(0x1f1)]+'\x20activation\x20\x27'+_0x532c22['name']+'\x27\x20from\x20file:\x20'+_0x15cf9e+'\x0a\x20\x20'+_0x42ec72,_0x4c9da5);}}return _0x4caf3e;}function a152_0x5381(){const _0x42c7c0=['journeyBundlesByFolderAndName',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','waitStep','JOURNEY_SYNTAX_ERROR','resolvedRule','segmentId','Deleted\x20activation\x20\x27','activation_creating','Updating\x20activation\x20\x27','values','activationsBySegmentId','results','logWarning','./journey-yaml.js','utf-8','exitCriterias','segment_deleted','logInfo','resolveSegment','connection','yamlConfig','message','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','journeyById','stringify','get','waitStepUnit','delete','updated','split','Deleting\x20activation\x20\x27','uniqueServerName','notification','segment_updated','object','Embedded\x20segment\x20\x27','all_columns','goal','40happKP','journeyActivationNameToId','set','connectionIdToNameMap','folder_created','existingJourney','progress','size','\x27\x20decision\x20point\x20branch\x20\x27','index','WaitStep','getSegment','getJourney','folderPath','folderPathToId','Updated\x20journey\x20\x27','buildUserMaps','state','Deleted\x20segment\x20\x27','Created\x20activation\x20\x27','entries','createActivation','\x20error(s)','from','Fetching\x20','Creating\x20activation\x20\x27','4409064PBiXrm','journeyStages','toString','activationActions','map','Delete\x20the\x20push\x20recovery\x20file\x20(','relative','journeyId','Stage\x20\x27','parentSegmentFolder','has','NOT_FOUND','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','activation_','Creating\x20folder\x20\x27','uniqueSegmentName','valid','tdx.sdk.push-workflow','relationships','yamlActivation','rootFolderId','existingSegment','trim','INTERNAL','idToName','entryCriteria','activationContext','SEGMENT_UPDATE_ERROR','embeddedSegmentNameToId','journeyName','\x27\x20not\x20found\x20in\x20journey\x20\x27','isArray','activations','startsWith','Created\x20segment\x20\x27','855953SnnKFE','\x27\x20to\x20local\x20\x27','ACTIVATION_UPDATE_ERROR','existingSegments','392271lfrqXj','journey','logDeleted','updateSegmentById','add','item','onProgress','conditionTimeoutDuration','Condition','648398MgLLyM','type','versionNumber','draft','description','createJourneySegment','Segment\x20not\x20found:\x20','skipSegments','JOURNEY_UPDATE_ERROR','length','behavior','kind','6zitZGb','Failed\x20to\x20resolve\x20segment\x20','\x27\x20for\x20','withProgress','parse','sort','push','listActivations','parseDocument','deps','max','\x27\x20wait\x20condition','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','nameToId','Updated\x20segment\x20\x27','keys','updateActivation','hex','schedule','12jPpgbe','logSuccess','\x27\x20entry\x20criteria','Failed\x20to\x20fetch\x20referenced\x20segment\x20','segmentByFolderAndName','connector_config','\x27\x20by\x20rule\x20content','__pending_act_','segmentNameToId','parentId','hasChanges','\x27\x20milestone','resolveJourneyId','activation_template_id','1407600kToaZF','segment_creating','segments','entry','./child-segment-yaml.js','folderId','journey_updating','match','createdSegmentId','698823fMwSBy','createFolder','created','createSegment','all','debug','name','includes','create','activation_deleted','Created\x20journey\x20\x27','Failed\x20to\x20','2GNZDuR','../../utils/async.js','\x20segment\x20from\x20file:\x20','Failed\x20to\x20resolve\x20activation\x20','unchanged','idToEmailMap','join','3098456CMzuah','embedded_segment_created','entry_criteria','effectiveFolderId','isNew','slice','stages','digest','journeyActivationStepId','Entry\x20criteria:\x20','validatedRequest','milestone','Activation\x20not\x20found:\x20','toLowerCase','Activation','localName','deleted','filter','find','diff','\x0a\x20\x20','\x20journey\x20from\x20file:\x20','journey_updated','createdSegmentIds','Duration','replace','branches','update','segmentFolderId','ACTIVATION_SYNTAX_ERROR','and\x20the\x20server\x20segment,\x20then\x20retry.','stage\x20\x27','attributes','embedded_segment_creating','\x27\x20from\x20file:\x20','day','rule','data','getActivation','conditionSegmentId','__pending_','list','activationParams','columns','steps','segment','\x27...','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','conditions','\x20(referenced\x20in\x20journey\x20','existingActivation','Matched\x20server\x20segment\x20\x27','with','user','conditionTimeoutUnit','DecisionPoint','absolutePath','activation_created','embedded_activation_creating',').\x20','folder_creating','run_after_journey_refresh','parentFolder','journeyBundleName','some'];a152_0x5381=function(){return _0x42c7c0;};return a152_0x5381();}export async function executePushFolders(_0x1b6ddb,_0x4ba934,_0x51d2ec,_0x35ad3d,_0x25d8c7){const _0x18fefc=a152_0x427e52,_0x4c16aa=new Map(_0x51d2ec),_0x562a00=sortFoldersByDepth(_0x4ba934);for(const _0x417d54 of _0x562a00){const _0x5a3a67=_0x417d54['split']('/'),_0x18588a=_0x5a3a67[_0x5a3a67['length']-0x1],_0x7ef78=_0x5a3a67[_0x18fefc(0x144)](0x0,-0x1)[_0x18fefc(0x13e)]('/'),_0x150a9b=_0x4c16aa[_0x18fefc(0x199)](_0x7ef78);_0x25d8c7[_0x18fefc(0x1ed)]?.({'type':_0x18fefc(0x17b),'folder':_0x417d54});const _0x5a73ba={'name':_0x18588a,'parentFolderId':_0x150a9b},_0x4aafb0=await _0x25d8c7[_0x18fefc(0x1ff)](_0x18fefc(0x1ce)+_0x417d54+_0x18fefc(0x16d),()=>_0x1b6ddb[_0x18fefc(0x16c)][_0x18fefc(0x12d)](_0x35ad3d[_0x18fefc(0x218)],_0x5a73ba));_0x4c16aa[_0x18fefc(0x1a8)](_0x417d54,_0x4aafb0[_0x18fefc(0x164)]['id']),_0x25d8c7[_0x18fefc(0x1ed)]?.({'type':_0x18fefc(0x1aa),'folder':_0x417d54,'folderId':_0x4aafb0[_0x18fefc(0x164)]['id']}),_0x25d8c7[_0x18fefc(0x191)]?.('Created\x20folder\x20\x27'+_0x417d54+'\x27');}return _0x4c16aa;}export async function executePushSegmentDeletions(_0x1899b9,_0x1ca5e6,_0x7b8541){const _0x4fd8a9=a152_0x427e52;if(_0x1ca5e6['length']===0x0)return 0x0;const {batchAsync:_0x41e4ec}=await import(_0x4fd8a9(0x139)),_0x2c042a=0x5,_0xe342e1=await _0x41e4ec(_0x1ca5e6,async _0x14213f=>{const _0x4db60a=_0x4fd8a9;return _0x7b8541[_0x4db60a(0x1ed)]?.({'type':'segment_deleting','name':_0x14213f['name']}),await _0x1899b9[_0x4db60a(0x16c)]['deleteSegment'](_0x14213f['id']),_0x7b8541[_0x4db60a(0x1ed)]?.({'type':_0x4db60a(0x190),'name':_0x14213f[_0x4db60a(0x132)]}),_0x7b8541['logDeleted']?.(_0x4db60a(0x1b8)+_0x14213f[_0x4db60a(0x132)]+'\x27'),0x1;},_0x2c042a);return _0xe342e1['reduce']((_0x4b19f5,_0x29c2bd)=>_0x4b19f5+_0x29c2bd,0x0);}export async function executePushJourneys(_0x56c0a6,_0x133ce5,_0x2058af,_0x2d944e,_0x13a163){const _0x8df6e1=a152_0x427e52,{journeyDefToRequest:_0x488c34}=await import(_0x8df6e1(0x18d)),{activationDefToCreateRequest:_0xf09384,yamlRuleToApi:_0x23610b,validateSegmentRule:_0x567fa6}=await import('./child-segment-yaml.js'),_0x5afcf0={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x438f8e=new Map(_0x2058af[_0x8df6e1(0x217)]),_0x11347f=0x5;for(let _0x60459f=0x0;_0x60459f<_0x133ce5[_0x8df6e1(0x1f9)];_0x60459f+=_0x11347f){const _0x1c13da=_0x133ce5['slice'](_0x60459f,_0x60459f+_0x11347f),_0x42d712=await Promise[_0x8df6e1(0x130)](_0x1c13da[_0x8df6e1(0x1c4)](async _0x2cd7bc=>{const _0x4cec5d=_0x8df6e1;if(!_0x2cd7bc[_0x4cec5d(0x143)]&&!_0x2cd7bc[_0x4cec5d(0x219)])return{'action':_0x4cec5d(0x13c),'name':_0x2cd7bc[_0x4cec5d(0x194)]['name'],'journeyId':_0x2cd7bc[_0x4cec5d(0x1ab)]?.['id']};const _0x3789f1=_0x2cd7bc[_0x4cec5d(0x1b3)]?_0x2058af[_0x4cec5d(0x1b4)][_0x4cec5d(0x199)](_0x2cd7bc[_0x4cec5d(0x1b3)]):undefined;_0x13a163[_0x4cec5d(0x1ed)]?.({'type':_0x2cd7bc[_0x4cec5d(0x143)]?'journey_creating':_0x4cec5d(0x129),'name':_0x2cd7bc[_0x4cec5d(0x194)][_0x4cec5d(0x132)]});try{const _0x55df26=await executeSingleJourneyPush(_0x56c0a6,_0x2cd7bc,{..._0x2058af,'segmentNameToId':_0x438f8e},{'parentId':_0x2d944e[_0x4cec5d(0x218)],'rootFolderId':_0x2d944e[_0x4cec5d(0x1d4)],'folderId':_0x3789f1,'verbose':_0x2d944e['verbose']},_0x13a163,{'journeyDefToRequest':_0x488c34,'activationDefToCreateRequest':_0xf09384,'yamlRuleToApi':_0x23610b,'validateSegmentRule':_0x567fa6});for(const [_0x27c83e,_0x49f5be]of _0x55df26[_0x4cec5d(0x1dc)]){_0x438f8e['set'](_0x27c83e,_0x49f5be),_0x5afcf0[_0x4cec5d(0x1dc)]['set'](_0x27c83e,_0x49f5be);}if(_0x55df26['action']===_0x4cec5d(0x12e))_0x13a163['onProgress']?.({'type':'journey_created','name':_0x2cd7bc[_0x4cec5d(0x194)]['name'],'journeyId':_0x55df26[_0x4cec5d(0x1c7)]}),_0x13a163['logSuccess']?.(_0x4cec5d(0x136)+_0x2cd7bc[_0x4cec5d(0x194)][_0x4cec5d(0x132)]+'\x27'),_0x5afcf0['created']++;else _0x55df26['action']===_0x4cec5d(0x19c)&&(_0x13a163[_0x4cec5d(0x1ed)]?.({'type':_0x4cec5d(0x155),'name':_0x2cd7bc[_0x4cec5d(0x194)][_0x4cec5d(0x132)]}),_0x13a163[_0x4cec5d(0x210)]?.(_0x4cec5d(0x1b5)+_0x2cd7bc[_0x4cec5d(0x194)][_0x4cec5d(0x132)]+'\x27'),_0x5afcf0[_0x4cec5d(0x19c)]++);return{'action':_0x55df26['action'],'name':_0x2cd7bc['yamlConfig'][_0x4cec5d(0x132)],'journeyId':_0x55df26[_0x4cec5d(0x1c7)]};}catch(_0x5ae9fd){const _0x52feb3=isHttp400Error(_0x5ae9fd),_0x5aa5d6=_0x52feb3?ErrorCode[_0x4cec5d(0x183)]:ErrorCode[_0x4cec5d(0x1f8)],_0x33c7ac=getErrorMessage(_0x5ae9fd);throw new SDKError(_0x5aa5d6,_0x4cec5d(0x137)+(_0x2cd7bc[_0x4cec5d(0x143)]?_0x4cec5d(0x134):_0x4cec5d(0x15a))+_0x4cec5d(0x154)+_0x2cd7bc[_0x4cec5d(0x177)]+'\x0a\x20\x20'+_0x33c7ac,_0x5ae9fd);}}));_0x5afcf0[_0x8df6e1(0x18b)][_0x8df6e1(0x202)](..._0x42d712);}return _0x5afcf0;}async function matchExistingJourneySegments(_0x5ed174,_0x459594,_0x20cac7,_0x5b56d1,_0x56dbd8){const _0x10f888=a152_0x427e52;if(!_0x459594[_0x10f888(0x1ab)]||!_0x459594['yamlConfig'][_0x10f888(0x125)])return;const _0x1605f6=new Map(),_0x4e5cb0=new Set();for(const _0x54c69d of Object[_0x10f888(0x20b)](_0x459594['yamlConfig'][_0x10f888(0x125)])){const _0x15e28e=generateDeterministicJourneySegmentName(_0x459594[_0x10f888(0x194)][_0x10f888(0x132)],_0x54c69d);_0x1605f6['set'](_0x15e28e,_0x54c69d),_0x4e5cb0[_0x10f888(0x1eb)](_0x54c69d);}const _0xcc4e31=[],_0x3d2415=collectSegmentIdsFromJourneyApi(_0x459594[_0x10f888(0x1ab)]);for(const _0x5cab9c of _0x3d2415){const _0x5b1b96=await fetchSegment(_0x5ed174,_0x20cac7,_0x5cab9c,_0x5b56d1);if(!_0x5b1b96?.[_0x10f888(0x132)])continue;const _0xf18657=_0x1605f6[_0x10f888(0x199)](_0x5b1b96[_0x10f888(0x132)]);_0xf18657?(_0x56dbd8['set'](_0xf18657,_0x5cab9c),_0x4e5cb0[_0x10f888(0x19b)](_0xf18657)):_0xcc4e31['push']({'id':_0x5cab9c,'seg':_0x5b1b96});}if(_0x4e5cb0[_0x10f888(0x1ad)]>0x0&&_0xcc4e31['length']>0x0){const {localExpandedRuleToNames:_0x6fa43f}=buildLocalExpandedRuleMappings(_0x459594[_0x10f888(0x194)]),_0x8382e6=new Map();for(const {id:_0x338227,seg:_0x2732a9}of _0xcc4e31){if(_0x2732a9['rule']){const _0x442fea=apiRuleToYaml(_0x2732a9[_0x10f888(0x163)]);_0x8382e6[_0x10f888(0x1a8)](_0x338227,_0x442fea);}}for(const {id:_0x1a0213,seg:_0xa01f25}of _0xcc4e31){if(!_0xa01f25['rule'])continue;const _0x5943b6=_0x8382e6[_0x10f888(0x199)](_0x1a0213);if(!_0x5943b6)continue;const _0x26e6bd=serializeExpandedRule(_0x5943b6,_0x8382e6),_0x6edc62=_0x6fa43f[_0x10f888(0x199)](_0x26e6bd);if(_0x6edc62){const _0x4da273=_0x6edc62[_0x10f888(0x151)](_0x156fea=>_0x4e5cb0['has'](_0x156fea));_0x4da273&&(_0x56dbd8[_0x10f888(0x1a8)](_0x4da273,_0x1a0213),_0x4e5cb0['delete'](_0x4da273),logger[_0x10f888(0x131)](_0x10f888(0x172)+_0xa01f25['name']+_0x10f888(0x1e4)+_0x4da273+_0x10f888(0x215)));}}}}async function executeSingleJourneyPush(_0x450049,_0x164530,_0x1368aa,_0x1f2f59,_0x36f956,_0x2ef1d1){const _0x53098c=a152_0x427e52,{journeyDefToRequest:_0x3663cd,activationDefToCreateRequest:_0x3dbc05,yamlRuleToApi:_0x346cc6,validateSegmentRule:_0x46ff75}=_0x2ef1d1,_0x37b858=new Map(),_0x43c96c=new Map();recoverSegmentIdsFromPushRecovery(_0x164530,_0x37b858,_0x1368aa[_0x53098c(0x217)]);const _0x32391f=new Map(),_0x31acf3=new Map(),_0x1a7fbd=new Map();let _0x52eab7;const _0x2c7d7d=async()=>{const _0x3e36fe=_0x53098c;if(_0x52eab7)return;_0x52eab7=new Map();if(!_0x164530[_0x3e36fe(0x1ab)])return;const _0x3be8bc=await _0x450049[_0x3e36fe(0x1e8)][_0x3e36fe(0x203)](_0x164530['existingJourney']['id']);for(const _0x17eba7 of _0x3be8bc){const _0x3f12be=journeyActivationStepToYaml(_0x17eba7,_0x1368aa[_0x3e36fe(0x13d)],_0x1368aa['connectionIdToNameMap']),_0x31630f=activationSignature(_0x3f12be);!_0x52eab7['has'](_0x31630f)&&_0x52eab7[_0x3e36fe(0x1a8)](_0x31630f,_0x17eba7['id']),_0x3f12be['name']&&_0x43c96c[_0x3e36fe(0x1a8)](_0x3f12be[_0x3e36fe(0x132)],_0x17eba7['id']);}};await matchExistingJourneySegments(_0x450049,_0x164530,_0x1f2f59[_0x53098c(0x218)],_0x1368aa[_0x53098c(0x1e6)],_0x1368aa[_0x53098c(0x217)]);const _0x3ac446={'resolveSegmentId':async _0x5b558b=>{const _0x5bd58c=_0x53098c,_0x5aaa5f=_0x1368aa[_0x5bd58c(0x217)][_0x5bd58c(0x199)](_0x5b558b);if(!_0x5aaa5f)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x5b558b+_0x5bd58c(0x170)+_0x164530[_0x5bd58c(0x194)][_0x5bd58c(0x132)]+')');return _0x5aaa5f;},'resolveEmbeddedSegmentId':async(_0x4bbb47,_0x5219f2)=>{const _0x263560=_0x53098c,_0x4dbf67=_0x1368aa[_0x263560(0x217)][_0x263560(0x199)](_0x4bbb47);if(_0x4dbf67)return _0x4dbf67;const _0x2f9e34=_0x1368aa[_0x263560(0x1e6)]['find'](_0x4de436=>_0x4de436[_0x263560(0x132)]===_0x4bbb47);if(_0x2f9e34)return _0x1368aa['segmentNameToId'][_0x263560(0x1a8)](_0x4bbb47,_0x2f9e34['id']),_0x2f9e34['id'];if(_0x164530['isNew']){const {stageName:_0x4993a6,criteriaName:_0x5d232c}=findSegmentCriteriaLocation(_0x164530[_0x263560(0x194)],_0x4bbb47);return _0x46ff75(_0x4bbb47,_0x5219f2[_0x263560(0x163)]),_0x31acf3[_0x263560(0x1a8)](_0x4bbb47,{'definition':_0x5219f2,'stageName':_0x4993a6,'criteriaName':_0x5d232c}),createPendingSegmentId(_0x4bbb47);}const _0x224f7e=_0x164530['existingJourney']?.['id'];if(!_0x224f7e)throw new SDKError(ErrorCode[_0x263560(0x1d7)],_0x263560(0x1cc));const _0x85d61c=_0x32391f[_0x263560(0x199)](_0x4bbb47);if(_0x85d61c)return _0x85d61c;const _0x59720c=((async()=>{const _0x15d1ad=_0x263560;_0x46ff75(_0x4bbb47,_0x5219f2[_0x15d1ad(0x163)]);const _0x49936a=generateDeterministicJourneySegmentName(_0x164530[_0x15d1ad(0x194)][_0x15d1ad(0x132)],_0x4bbb47),_0x5e6193=_0x1368aa[_0x15d1ad(0x1e6)][_0x15d1ad(0x151)](_0x442bb3=>_0x442bb3[_0x15d1ad(0x132)]===_0x49936a),_0x370019=createSegmentIdResolver(_0x1368aa['segmentNameToId'],_0x4bbb47),_0x222559=await resolveRuleSegmentIds(_0x5219f2[_0x15d1ad(0x163)],_0x370019);let _0x5c5d2e;return _0x5e6193?(await _0x450049['segment'][_0x15d1ad(0x1ea)](_0x1f2f59[_0x15d1ad(0x218)],_0x5e6193['id'],{'description':_0x5219f2[_0x15d1ad(0x1f4)]||'Entry\x20criteria:\x20'+_0x4bbb47,'rule':_0x346cc6(_0x222559),'countPopulation':!![]}),_0x5c5d2e=_0x5e6193['id'],saveSegmentToPushRecovery(_0x164530[_0x15d1ad(0x177)],_0x164530[_0x15d1ad(0x194)]['name'],_0x4bbb47,{'segmentId':_0x5c5d2e,'uniqueServerName':_0x49936a,'createdAt':new Date()['toISOString']()})):_0x5c5d2e=await createOrRecoverEmbeddedSegment(_0x450049,_0x164530,{'localName':_0x4bbb47,'uniqueSegmentName':_0x49936a,'description':_0x5219f2[_0x15d1ad(0x1f4)]||_0x15d1ad(0x148)+_0x4bbb47,'journeyId':_0x224f7e,'resolvedRule':_0x222559,'parentId':_0x1f2f59[_0x15d1ad(0x218)],'folderId':_0x1f2f59[_0x15d1ad(0x1d4)]||''},_0x346cc6),_0x1368aa[_0x15d1ad(0x217)][_0x15d1ad(0x1a8)](_0x4bbb47,_0x5c5d2e),_0x37b858[_0x15d1ad(0x1a8)](_0x4bbb47,_0x5c5d2e),_0x5c5d2e;})());_0x32391f[_0x263560(0x1a8)](_0x4bbb47,_0x59720c);try{return await _0x59720c;}finally{_0x32391f[_0x263560(0x19b)](_0x4bbb47);}},'resolveActivationId':async _0x5de5a8=>{const _0x5a6afa=_0x53098c,_0x3bf0d5=_0x43c96c['get'](_0x5de5a8);if(_0x3bf0d5)return _0x3bf0d5;if(_0x164530['existingJourney']){await _0x2c7d7d();const _0x22f98b=_0x43c96c[_0x5a6afa(0x199)](_0x5de5a8);if(_0x22f98b)return _0x22f98b;}throw new SDKError(ErrorCode[_0x5a6afa(0x1cb)],_0x5a6afa(0x14b)+_0x5de5a8+_0x5a6afa(0x170)+_0x164530[_0x5a6afa(0x194)]['name']+_0x5a6afa(0x17a)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x163027,_0xd51496)=>{const _0x163d92=_0x53098c,_0x4fb4c1=_0x43c96c[_0x163d92(0x199)](_0x163027);if(_0x4fb4c1)return _0x4fb4c1;if(_0x164530['isNew'])return _0x1a7fbd[_0x163d92(0x1a8)](_0x163027,_0xd51496),createPendingActivationId(_0x163027);if(_0x164530['existingJourney']){await _0x2c7d7d();const _0x18fafe=_0x43c96c[_0x163d92(0x199)](_0xd51496[_0x163d92(0x132)]);if(_0x18fafe)return _0x43c96c[_0x163d92(0x1a8)](_0x163027,_0x18fafe),_0x18fafe;const _0x83a85a=activationSignature(_0xd51496),_0x1b200f=_0x52eab7?.[_0x163d92(0x199)](_0x83a85a);if(_0x1b200f)return _0x43c96c[_0x163d92(0x1a8)](_0x163027,_0x1b200f),_0x1b200f;const _0x32d035=await _0x3dbc05(_0xd51496,_0x1368aa[_0x163d92(0x1da)]),_0xf8494b={..._0x32d035,..._0xd51496[_0x163d92(0x17c)]!==undefined&&{'runAfterJourneyRefresh':_0xd51496['run_after_journey_refresh']}},_0x3cc283=await _0x450049[_0x163d92(0x1e8)][_0x163d92(0x1bb)](_0x164530['existingJourney']['id'],_0xf8494b);return _0x43c96c[_0x163d92(0x1a8)](_0x163027,_0x3cc283['id']),_0x3cc283['id'];}throw new SDKError(ErrorCode[_0x163d92(0x1d7)],_0x163d92(0x196));},'resolveJourneyId':async _0x480709=>{const _0x55bf9a=_0x53098c;try{return await _0x450049[_0x55bf9a(0x1e8)][_0x55bf9a(0x21b)](_0x1f2f59[_0x55bf9a(0x218)],_0x480709);}catch(_0x415559){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0x480709+_0x55bf9a(0x208)+_0x164530[_0x55bf9a(0x194)][_0x55bf9a(0x132)]+'\x27)',_0x415559);}},'resolveStageId':async(_0x5e691d,_0x230586)=>{const _0x112c90=_0x53098c,_0x5adf7d=await _0x450049[_0x112c90(0x1e8)][_0x112c90(0x1b2)](_0x5e691d),_0x1105f4=_0x5adf7d[_0x112c90(0x15f)]['journeyStages'][_0x112c90(0x151)](_0x5e6a6f=>_0x5e6a6f[_0x112c90(0x132)][_0x112c90(0x14c)]()===_0x230586[_0x112c90(0x14c)]());if(!_0x1105f4?.['id'])throw new SDKError(ErrorCode[_0x112c90(0x1cb)],_0x112c90(0x1c8)+_0x230586+_0x112c90(0x1de)+(_0x5adf7d[_0x112c90(0x15f)]['journeyBundleName']||_0x5adf7d['attributes']['name'])+'\x27');return _0x1105f4['id'];}},_0xb757a3=await _0x3663cd(_0x164530[_0x53098c(0x194)],_0x1f2f59[_0x53098c(0x218)],_0x3ac446),_0x40973f=_0x1f2f59[_0x53098c(0x128)]||_0x1f2f59[_0x53098c(0x1d4)];_0x40973f&&(_0xb757a3['relationships']={'parentFolder':{'data':{'id':_0x40973f,'type':'folder'}}});if(_0x164530[_0x53098c(0x143)]){if(_0x31acf3[_0x53098c(0x1ad)]>0x0||_0x1a7fbd['size']>0x0)return await executeThreeStepJourneyCreate(_0x450049,_0x164530,_0xb757a3,{'pendingEmbeddedSegments':_0x31acf3,'pendingEmbeddedActivations':_0x1a7fbd,'embeddedSegmentNameToId':_0x37b858,'journeyActivationNameToId':_0x43c96c},{..._0x1f2f59,'effectiveFolderId':_0x40973f},_0x1368aa,_0x36f956,_0x2ef1d1);else{ensureJourneyDefaults(_0xb757a3[_0x53098c(0x15f)]);const _0x590c96=await _0x450049[_0x53098c(0x1e8)][_0x53098c(0x134)](_0xb757a3);return deletePushRecovery(_0x164530[_0x53098c(0x177)]),{'action':_0x53098c(0x12e),'journeyId':_0x590c96['id'],'embeddedSegmentNameToId':_0x37b858};}}else{if(_0x164530[_0x53098c(0x219)]&&_0x164530['existingJourney']){_0xb757a3['id']=_0x164530[_0x53098c(0x1ab)]['id'];const _0x202e7d=_0xb757a3[_0x53098c(0x15f)];_0x164530[_0x53098c(0x1ab)][_0x53098c(0x15f)]?.[_0x53098c(0x17e)]&&(_0x202e7d[_0x53098c(0x17e)]=_0x164530[_0x53098c(0x1ab)][_0x53098c(0x15f)][_0x53098c(0x17e)]);const _0x38480e=_0x164530['existingJourney']['attributes']?.['journeyStages'];return _0x38480e&&_0xb757a3['attributes'][_0x53098c(0x1c1)]&&injectExistingStageIds(_0xb757a3[_0x53098c(0x15f)]['journeyStages'],_0x38480e),ensureJourneyDefaults(_0x202e7d),await _0x450049[_0x53098c(0x1e8)][_0x53098c(0x15a)](_0x164530[_0x53098c(0x1ab)]['id'],_0xb757a3),deletePushRecovery(_0x164530[_0x53098c(0x177)]),{'action':_0x53098c(0x19c),'journeyId':_0x164530[_0x53098c(0x1ab)]['id'],'embeddedSegmentNameToId':_0x37b858};}}return deletePushRecovery(_0x164530[_0x53098c(0x177)]),{'action':'unchanged','journeyId':_0x164530[_0x53098c(0x1ab)]?.['id'],'embeddedSegmentNameToId':_0x37b858};}function findSegmentCriteriaLocation(_0x45e4f9,_0x571e86){const _0x376885=a152_0x427e52,_0x126e26=_0x45e4f9[_0x376885(0x145)]||_0x45e4f9['journeys']?.[0x0]?.[_0x376885(0x145)]||[];let _0x48cde2=_0x376885(0x126),_0x411b16=_0x571e86;const _0x38df32=_0x45e4f9[_0x376885(0x1a5)]||_0x45e4f9['journeys']?.[0x0]?.[_0x376885(0x1a5)];if(_0x38df32?.[_0x376885(0x16c)]===_0x571e86)return{'stageName':'goal','criteriaName':_0x38df32[_0x376885(0x132)]||_0x571e86};_0xca7314:for(const _0x4ad060 of _0x126e26){if(_0x4ad060['entry_criteria']?.[_0x376885(0x16c)]===_0x571e86){_0x48cde2=_0x4ad060['name'],_0x411b16=_0x4ad060[_0x376885(0x141)][_0x376885(0x132)]||_0x571e86;break;}if(_0x4ad060['steps'])for(const _0x342e18 of _0x4ad060['steps']){if(_0x342e18[_0x376885(0x1f1)]==='decision_point'&&_0x342e18[_0x376885(0x173)]?.[_0x376885(0x159)])for(const _0x4b4bb1 of _0x342e18[_0x376885(0x173)]['branches']){if(_0x4b4bb1[_0x376885(0x16c)]===_0x571e86){_0x48cde2=_0x4ad060[_0x376885(0x132)],_0x411b16=_0x4b4bb1[_0x376885(0x132)]||_0x571e86;break _0xca7314;}}}}return{'stageName':_0x48cde2,'criteriaName':_0x411b16};}async function executeThreeStepJourneyCreate(_0x251773,_0x1066d7,_0x89b391,_0x5520c6,_0x4c8e45,_0x5d3d68,_0x27b50e,_0x4760b7){const _0x36e7af=a152_0x427e52,{activationDefToCreateRequest:_0x4cee18,yamlRuleToApi:_0x202fe5}=_0x4760b7,{pendingEmbeddedSegments:_0x53dcc5,pendingEmbeddedActivations:_0x3828ce,embeddedSegmentNameToId:_0x3fd106}=_0x5520c6,_0x3b6427=JSON[_0x36e7af(0x200)](JSON['stringify'](_0x89b391));ensureJourneyDefaults(_0x3b6427[_0x36e7af(0x15f)]),stripPendingIds(_0x3b6427);const _0x430f66=await _0x251773[_0x36e7af(0x1e8)][_0x36e7af(0x134)](_0x3b6427),_0x3823e7=_0x430f66['id'],_0x40f201=new Map();for(const _0x1d723c of _0x430f66[_0x36e7af(0x15f)][_0x36e7af(0x1c1)]){_0x40f201[_0x36e7af(0x1a8)](_0x1d723c[_0x36e7af(0x132)][_0x36e7af(0x14c)](),_0x1d723c['id']);}recoverSegmentIdsFromPushRecovery(_0x1066d7,_0x3fd106,_0x5d3d68[_0x36e7af(0x217)]);for(const [_0x357360,{definition:_0x33a543}]of _0x53dcc5){if(_0x3fd106[_0x36e7af(0x1ca)](_0x357360)){_0x27b50e['onProgress']?.({'type':'embedded_segment_created','journeyName':_0x1066d7['yamlConfig'][_0x36e7af(0x132)],'segmentName':_0x357360});continue;}const _0x5d0306=generateDeterministicJourneySegmentName(_0x1066d7[_0x36e7af(0x194)][_0x36e7af(0x132)],_0x357360);_0x27b50e[_0x36e7af(0x1ed)]?.({'type':_0x36e7af(0x160),'journeyName':_0x1066d7[_0x36e7af(0x194)][_0x36e7af(0x132)],'segmentName':_0x357360});const _0x1556a0=createSegmentIdResolver(_0x5d3d68[_0x36e7af(0x217)],_0x357360),_0x5df5d0=await resolveRuleSegmentIds(_0x33a543[_0x36e7af(0x163)],_0x1556a0),_0xf2447a=await createOrRecoverEmbeddedSegment(_0x251773,_0x1066d7,{'localName':_0x357360,'uniqueSegmentName':_0x5d0306,'description':_0x33a543['description']||'Entry\x20criteria:\x20'+_0x357360,'journeyId':_0x3823e7,'resolvedRule':_0x5df5d0,'parentId':_0x4c8e45[_0x36e7af(0x218)],'folderId':_0x4c8e45[_0x36e7af(0x142)]||''},_0x202fe5);_0x3fd106[_0x36e7af(0x1a8)](_0x357360,_0xf2447a),_0x5d3d68[_0x36e7af(0x217)][_0x36e7af(0x1a8)](_0x357360,_0xf2447a),_0x27b50e[_0x36e7af(0x1ed)]?.({'type':_0x36e7af(0x140),'journeyName':_0x1066d7['yamlConfig']['name'],'segmentName':_0x357360});}const _0xe83345=new Map();for(const [_0x407ed1,_0x4b8cfe]of _0x3828ce){_0x27b50e[_0x36e7af(0x1ed)]?.({'type':_0x36e7af(0x179),'journeyName':_0x1066d7['yamlConfig'][_0x36e7af(0x132)],'activationName':_0x407ed1});const _0x4c2c05=await _0x4cee18(_0x4b8cfe,_0x5d3d68[_0x36e7af(0x1da)]),_0x4768ec={..._0x4c2c05,..._0x4b8cfe[_0x36e7af(0x17c)]!==undefined&&{'runAfterJourneyRefresh':_0x4b8cfe[_0x36e7af(0x17c)]}},_0xd61ea3=await _0x251773[_0x36e7af(0x1e8)][_0x36e7af(0x1bb)](_0x3823e7,_0x4768ec);_0xe83345[_0x36e7af(0x1a8)](_0x407ed1,_0xd61ea3['id']),_0x5520c6[_0x36e7af(0x1a7)][_0x36e7af(0x1a8)](_0x407ed1,_0xd61ea3['id']),_0x27b50e[_0x36e7af(0x1ed)]?.({'type':'embedded_activation_created','journeyName':_0x1066d7[_0x36e7af(0x194)][_0x36e7af(0x132)],'activationName':_0x407ed1});}const _0x359aeb=JSON['parse'](JSON['stringify'](_0x89b391));return _0x359aeb['id']=_0x3823e7,ensureJourneyDefaults(_0x359aeb[_0x36e7af(0x15f)]),resolvePendingIdsInRequest(_0x359aeb,_0x89b391,_0x40f201,_0x3fd106,_0xe83345,_0x27b50e),await _0x251773[_0x36e7af(0x1e8)]['update'](_0x3823e7,_0x359aeb),deletePushRecovery(_0x1066d7['absolutePath']),{'action':_0x36e7af(0x12e),'journeyId':_0x3823e7,'embeddedSegmentNameToId':_0x3fd106};}export function stripWaitStepPendingIds(_0x192989){const _0x1f621a=a152_0x427e52,_0x17bd0f=_0x192989['conditionSegmentId']&&isPendingSegmentId(_0x192989['conditionSegmentId']),_0xfb9810=_0x192989[_0x1f621a(0x16f)]?.[_0x1f621a(0x17f)](_0x547d8e=>_0x547d8e[_0x1f621a(0x185)]&&isPendingSegmentId(_0x547d8e[_0x1f621a(0x185)]));(_0x17bd0f||_0xfb9810)&&(_0x192989['waitStepType']=_0x1f621a(0x157),_0x192989[_0x1f621a(0x182)]=0x1,_0x192989['waitStepUnit']=_0x1f621a(0x162),delete _0x192989[_0x1f621a(0x166)],delete _0x192989['conditionTimeoutDuration'],delete _0x192989[_0x1f621a(0x175)],delete _0x192989['conditions']);}export function resolveWaitStepPendingIds(_0x4cd439,_0x2f029c,_0x424f29,_0x2292c1){const _0x4309cb=a152_0x427e52;if(_0x2f029c[_0x4309cb(0x166)]&&isPendingSegmentId(_0x2f029c[_0x4309cb(0x166)])){const _0x35b921=_0x424f29(_0x2f029c['conditionSegmentId'],_0x4309cb(0x15e)+_0x2292c1+_0x4309cb(0x207));_0x35b921&&(_0x4cd439['waitStepType']=_0x4309cb(0x1ef),_0x4cd439[_0x4309cb(0x166)]=_0x35b921,delete _0x4cd439[_0x4309cb(0x182)],delete _0x4cd439[_0x4309cb(0x19a)],_0x2f029c[_0x4309cb(0x1ee)]!==undefined&&(_0x4cd439[_0x4309cb(0x1ee)]=_0x2f029c[_0x4309cb(0x1ee)]),_0x2f029c[_0x4309cb(0x175)]&&(_0x4cd439[_0x4309cb(0x175)]=_0x2f029c[_0x4309cb(0x175)]));}if(_0x2f029c['conditions']){const _0x3e46a1=_0x2f029c[_0x4309cb(0x16f)][_0x4309cb(0x17f)](_0x17f421=>_0x17f421[_0x4309cb(0x185)]&&isPendingSegmentId(_0x17f421['segmentId']));if(_0x3e46a1){const _0x34066e=_0x2f029c[_0x4309cb(0x16f)][_0x4309cb(0x1c4)](_0x498734=>{const _0x1f2862=_0x4309cb;if(_0x498734[_0x1f2862(0x185)]&&isPendingSegmentId(_0x498734[_0x1f2862(0x185)])){const _0x102325=_0x424f29(_0x498734[_0x1f2862(0x185)],'stage\x20\x27'+_0x2292c1+_0x1f2862(0x207));return{..._0x498734,'segmentId':_0x102325||_0x498734[_0x1f2862(0x185)]};}return{..._0x498734};});_0x4cd439['waitStepType']=_0x4309cb(0x1ef),_0x4cd439[_0x4309cb(0x16f)]=_0x34066e,delete _0x4cd439[_0x4309cb(0x182)],delete _0x4cd439[_0x4309cb(0x19a)],delete _0x4cd439[_0x4309cb(0x166)],delete _0x4cd439[_0x4309cb(0x1ee)],delete _0x4cd439[_0x4309cb(0x175)];}}}function stripPendingIds(_0x4253ea){const _0x3b072e=a152_0x427e52;_0x4253ea[_0x3b072e(0x15f)][_0x3b072e(0x1a5)]?.[_0x3b072e(0x185)]&&isPendingSegmentId(_0x4253ea[_0x3b072e(0x15f)][_0x3b072e(0x1a5)]['segmentId'])&&delete _0x4253ea[_0x3b072e(0x15f)]['goal'];for(const _0x438669 of _0x4253ea[_0x3b072e(0x15f)]['journeyStages']||[]){_0x438669['entryCriteria']?.[_0x3b072e(0x185)]&&isPendingSegmentId(_0x438669[_0x3b072e(0x1d9)]['segmentId'])&&delete _0x438669[_0x3b072e(0x1d9)];_0x438669[_0x3b072e(0x14a)]?.[_0x3b072e(0x185)]&&isPendingSegmentId(_0x438669[_0x3b072e(0x14a)][_0x3b072e(0x185)])&&delete _0x438669[_0x3b072e(0x14a)];_0x438669['exitCriterias']&&(_0x438669[_0x3b072e(0x18f)]=_0x438669[_0x3b072e(0x18f)][_0x3b072e(0x150)](_0x3896d8=>!_0x3896d8[_0x3b072e(0x185)]||!isPendingSegmentId(_0x3896d8[_0x3b072e(0x185)])));if(_0x438669['steps'])for(const _0x3355b9 of Object[_0x3b072e(0x20b)](_0x438669['steps'])){const _0x39bb66=_0x438669[_0x3b072e(0x16b)][_0x3355b9];_0x39bb66[_0x3b072e(0x1f1)]===_0x3b072e(0x14d)&&_0x39bb66[_0x3b072e(0x147)]&&isPendingActivationId(_0x39bb66['journeyActivationStepId'])&&(_0x39bb66[_0x3b072e(0x147)]='');if(_0x39bb66[_0x3b072e(0x1f1)]==='DecisionPoint'&&_0x39bb66[_0x3b072e(0x159)])for(const _0x1a12dc of _0x39bb66[_0x3b072e(0x159)]){_0x1a12dc[_0x3b072e(0x185)]&&isPendingSegmentId(_0x1a12dc['segmentId'])&&(_0x1a12dc[_0x3b072e(0x185)]='');}_0x39bb66['type']===_0x3b072e(0x1b0)&&stripWaitStepPendingIds(_0x39bb66);}}}function resolvePendingIdsInRequest(_0x3d1283,_0x5b8a6a,_0x55847e,_0x2d2477,_0x2a8f40,_0x1a7722){const _0x5ac25c=a152_0x427e52,_0x322a0e=(_0x1fe0f7,_0x4478be)=>{const _0x25b389=a152_0x5d01;if(!isPendingSegmentId(_0x1fe0f7))return _0x1fe0f7;const _0x50bb6d=extractPendingSegmentName(_0x1fe0f7),_0x3cabd1=_0x2d2477[_0x25b389(0x199)](_0x50bb6d);return!_0x3cabd1&&_0x1a7722[_0x25b389(0x18c)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x50bb6d+_0x25b389(0x1fe)+_0x4478be),_0x3cabd1;};if(_0x3d1283[_0x5ac25c(0x15f)][_0x5ac25c(0x1a5)]?.[_0x5ac25c(0x185)]&&isPendingSegmentId(_0x3d1283[_0x5ac25c(0x15f)][_0x5ac25c(0x1a5)][_0x5ac25c(0x185)])){const _0x56f0a4=_0x322a0e(_0x3d1283[_0x5ac25c(0x15f)][_0x5ac25c(0x1a5)][_0x5ac25c(0x185)],'goal\x20criteria');_0x56f0a4&&(_0x3d1283[_0x5ac25c(0x15f)]['goal'][_0x5ac25c(0x185)]=_0x56f0a4);}for(const _0x4adeb9 of _0x3d1283['attributes'][_0x5ac25c(0x1c1)]||[]){const _0x456a90=_0x55847e[_0x5ac25c(0x199)](_0x4adeb9['name'][_0x5ac25c(0x14c)]());_0x456a90&&(_0x4adeb9['id']=_0x456a90);if(_0x4adeb9[_0x5ac25c(0x1d9)]?.[_0x5ac25c(0x185)]&&isPendingSegmentId(_0x4adeb9['entryCriteria'][_0x5ac25c(0x185)])){const _0x409438=_0x322a0e(_0x4adeb9[_0x5ac25c(0x1d9)]['segmentId'],_0x5ac25c(0x15e)+_0x4adeb9['name']+_0x5ac25c(0x211));_0x409438&&(_0x4adeb9['entryCriteria'][_0x5ac25c(0x185)]=_0x409438);}if(_0x4adeb9[_0x5ac25c(0x18f)])for(const _0x177080 of _0x4adeb9[_0x5ac25c(0x18f)]){if(_0x177080[_0x5ac25c(0x185)]&&isPendingSegmentId(_0x177080[_0x5ac25c(0x185)])){const _0x428e9a=_0x322a0e(_0x177080[_0x5ac25c(0x185)],'stage\x20\x27'+_0x4adeb9[_0x5ac25c(0x132)]+'\x27\x20exit\x20criteria');_0x428e9a&&(_0x177080[_0x5ac25c(0x185)]=_0x428e9a);}}if(_0x4adeb9[_0x5ac25c(0x14a)]?.['segmentId']&&isPendingSegmentId(_0x4adeb9[_0x5ac25c(0x14a)]['segmentId'])){const _0x3a1ee7=_0x322a0e(_0x4adeb9['milestone'][_0x5ac25c(0x185)],_0x5ac25c(0x15e)+_0x4adeb9[_0x5ac25c(0x132)]+_0x5ac25c(0x21a));_0x3a1ee7&&(_0x4adeb9['milestone'][_0x5ac25c(0x185)]=_0x3a1ee7);}if(_0x4adeb9[_0x5ac25c(0x16b)]){const _0x540e34=_0x68376c=>_0x5b8a6a['attributes'][_0x5ac25c(0x1c1)]?.['find'](_0x337803=>_0x337803['name'][_0x5ac25c(0x14c)]()===_0x4adeb9[_0x5ac25c(0x132)]['toLowerCase']())?.['steps']?.[_0x68376c];for(const _0x38bbef of Object['keys'](_0x4adeb9[_0x5ac25c(0x16b)])){const _0x5e9a3b=_0x4adeb9['steps'][_0x38bbef],_0xae81b2=_0x540e34(_0x38bbef);if(_0x5e9a3b[_0x5ac25c(0x1f1)]===_0x5ac25c(0x14d)&&_0x5e9a3b[_0x5ac25c(0x147)]&&(isPendingActivationId(_0x5e9a3b[_0x5ac25c(0x147)])||_0x5e9a3b[_0x5ac25c(0x147)]==='')){if(_0xae81b2?.['journeyActivationStepId']&&isPendingActivationId(_0xae81b2[_0x5ac25c(0x147)])){const _0x1f8ff4=extractPendingActivationName(_0xae81b2[_0x5ac25c(0x147)]),_0x3354ab=_0x2a8f40[_0x5ac25c(0x199)](_0x1f8ff4);_0x3354ab&&(_0x5e9a3b[_0x5ac25c(0x147)]=_0x3354ab);}}if(_0x5e9a3b[_0x5ac25c(0x1f1)]===_0x5ac25c(0x176)&&_0x5e9a3b['branches']&&_0xae81b2?.[_0x5ac25c(0x159)])for(let _0x581439=0x0;_0x581439<_0x5e9a3b[_0x5ac25c(0x159)][_0x5ac25c(0x1f9)];_0x581439++){const _0x16652e=_0x5e9a3b[_0x5ac25c(0x159)][_0x581439],_0x449091=_0xae81b2[_0x5ac25c(0x159)][_0x581439];if(_0x449091?.[_0x5ac25c(0x185)]&&isPendingSegmentId(_0x449091['segmentId'])){const _0x23ebb3=_0x322a0e(_0x449091[_0x5ac25c(0x185)],_0x5ac25c(0x15e)+_0x4adeb9['name']+_0x5ac25c(0x1ae)+(_0x16652e[_0x5ac25c(0x132)]||_0x581439)+'\x27');_0x23ebb3&&(_0x16652e[_0x5ac25c(0x185)]=_0x23ebb3);}}_0x5e9a3b['type']===_0x5ac25c(0x1b0)&&_0xae81b2?.[_0x5ac25c(0x1f1)]==='WaitStep'&&resolveWaitStepPendingIds(_0x5e9a3b,_0xae81b2,_0x322a0e,_0x4adeb9[_0x5ac25c(0x132)]);}}}}
@@ -1 +1 @@
1
- (function(_0x16b83f,_0x3be395){const _0x19f068=a153_0x360b,_0x8f88d=_0x16b83f();while(!![]){try{const _0x596cd8=-parseInt(_0x19f068(0x175))/0x1*(-parseInt(_0x19f068(0x16f))/0x2)+-parseInt(_0x19f068(0x16b))/0x3*(-parseInt(_0x19f068(0x17a))/0x4)+parseInt(_0x19f068(0x16e))/0x5*(parseInt(_0x19f068(0x16c))/0x6)+-parseInt(_0x19f068(0x17b))/0x7*(-parseInt(_0x19f068(0x174))/0x8)+-parseInt(_0x19f068(0x173))/0x9*(-parseInt(_0x19f068(0x16d))/0xa)+-parseInt(_0x19f068(0x17c))/0xb+-parseInt(_0x19f068(0x178))/0xc;if(_0x596cd8===_0x3be395)break;else _0x8f88d['push'](_0x8f88d['shift']());}catch(_0x22c496){_0x8f88d['push'](_0x8f88d['shift']());}}}(a153_0x4435,0x7054c));function a153_0x360b(_0x190abb,_0x3bf0d7){_0x190abb=_0x190abb-0x16b;const _0x443503=a153_0x4435();let _0x360b9a=_0x443503[_0x190abb];return _0x360b9a;}export function buildFolderIdToPathMap(_0x4a3cfa){const _0x10f985=a153_0x360b,_0x53269c=new Map(),_0x1e04a=new Map();for(const _0x4e572e of _0x4a3cfa){_0x1e04a[_0x10f985(0x177)](_0x4e572e['id'],_0x4e572e);}const _0x527d8f=new Set();for(const _0x25c137 of _0x4a3cfa){!_0x25c137[_0x10f985(0x171)]&&_0x527d8f[_0x10f985(0x170)](_0x25c137['id']);}function _0x1919c3(_0x532396){const _0xe41fd4=_0x10f985;if(_0x53269c[_0xe41fd4(0x176)](_0x532396['id']))return _0x53269c[_0xe41fd4(0x172)](_0x532396['id']);if(_0x527d8f[_0xe41fd4(0x176)](_0x532396['id']))return _0x53269c[_0xe41fd4(0x177)](_0x532396['id'],''),'';if(_0x532396[_0xe41fd4(0x171)]){const _0x426eee=_0x1e04a[_0xe41fd4(0x172)](_0x532396['parentFolderId']);if(_0x426eee){const _0x2713fe=_0x1919c3(_0x426eee),_0x5900d2=_0x2713fe?_0x2713fe+'/'+_0x532396[_0xe41fd4(0x179)]:_0x532396[_0xe41fd4(0x179)];return _0x53269c[_0xe41fd4(0x177)](_0x532396['id'],_0x5900d2),_0x5900d2;}}const _0x4f349c=_0x532396[_0xe41fd4(0x179)];return _0x53269c[_0xe41fd4(0x177)](_0x532396['id'],_0x4f349c),_0x4f349c;}for(const _0x901826 of _0x4a3cfa){_0x1919c3(_0x901826);}return _0x53269c;}export function buildFolderPathToIdMap(_0x83b7d){const _0x5c06f3=a153_0x360b,_0x4c56a4=new Map(),_0x562c04=new Map();for(const _0x117b4e of _0x83b7d){_0x562c04[_0x5c06f3(0x177)](_0x117b4e['id'],_0x117b4e);}const _0x56405c=new Set();for(const _0x3a705e of _0x83b7d){!_0x3a705e[_0x5c06f3(0x171)]&&_0x56405c[_0x5c06f3(0x170)](_0x3a705e['id']);}function _0x30c2fa(_0x2b8bf1){const _0x41a376=_0x5c06f3;if(_0x56405c['has'](_0x2b8bf1['id']))return'';if(_0x2b8bf1['parentFolderId']){const _0x14471a=_0x562c04[_0x41a376(0x172)](_0x2b8bf1[_0x41a376(0x171)]);if(_0x14471a){const _0x41d3cf=_0x30c2fa(_0x14471a);return _0x41d3cf?_0x41d3cf+'/'+_0x2b8bf1[_0x41a376(0x179)]:_0x2b8bf1['name'];}}return _0x2b8bf1[_0x41a376(0x179)];}for(const _0x207c3c of _0x83b7d){const _0x54be53=_0x30c2fa(_0x207c3c);_0x4c56a4[_0x5c06f3(0x177)](_0x54be53,_0x207c3c['id']);}return _0x4c56a4;}export function buildFolderMaps(_0x518c49){const _0xeeaf35=a153_0x360b,_0x267b00=buildFolderIdToPathMap(_0x518c49),_0x579592=new Map();for(const [_0x12efcd,_0x1871a4]of _0x267b00){_0x579592[_0xeeaf35(0x177)](_0x1871a4,_0x12efcd);}return{'idToPath':_0x267b00,'pathToId':_0x579592};}export function getFolderPath(_0x20cdba,_0x2f1c75){const _0x567c07=a153_0x360b;if(!_0x20cdba)return'';return _0x2f1c75[_0x567c07(0x172)](_0x20cdba)??'';}function a153_0x4435(){const _0x43aad3=['name','20WOpZUg','210RkdbRc','2056472zcfyFe','95859FUeaqN','6wAHpKR','10GHBnPE','3983810OPMIPG','4UajhJd','add','parentFolderId','get','2210211TlkwDJ','62576ernYaj','454603yehVQB','has','set','20386944OIVJyz'];a153_0x4435=function(){return _0x43aad3;};return a153_0x4435();}
1
+ (function(_0x59711d,_0x260d59){const _0x55e076=a153_0x27ff,_0x5a007d=_0x59711d();while(!![]){try{const _0x5bc015=-parseInt(_0x55e076(0x1d5))/0x1+-parseInt(_0x55e076(0x1c8))/0x2*(parseInt(_0x55e076(0x1cc))/0x3)+parseInt(_0x55e076(0x1d0))/0x4+-parseInt(_0x55e076(0x1d3))/0x5*(-parseInt(_0x55e076(0x1d1))/0x6)+parseInt(_0x55e076(0x1d8))/0x7*(parseInt(_0x55e076(0x1d4))/0x8)+parseInt(_0x55e076(0x1cf))/0x9*(-parseInt(_0x55e076(0x1ca))/0xa)+-parseInt(_0x55e076(0x1d2))/0xb*(parseInt(_0x55e076(0x1c7))/0xc);if(_0x5bc015===_0x260d59)break;else _0x5a007d['push'](_0x5a007d['shift']());}catch(_0x5a89bc){_0x5a007d['push'](_0x5a007d['shift']());}}}(a153_0x2894,0x82456));function a153_0x2894(){const _0x34652e=['1017DMkmyU','3106140GdwwsF','6GdTMZp','11SchAWK','2467285yfjBwd','8CswWeG','45214JbiPeZ','name','set','4621547AxYxYp','2992884NNwRHl','10852yMJZbO','has','91280cSQkIf','add','39bWWaLT','get','parentFolderId'];a153_0x2894=function(){return _0x34652e;};return a153_0x2894();}function a153_0x27ff(_0x1dccf5,_0x5901da){_0x1dccf5=_0x1dccf5-0x1c7;const _0x289494=a153_0x2894();let _0x27ffa2=_0x289494[_0x1dccf5];return _0x27ffa2;}export function buildFolderIdToPathMap(_0x9cb872){const _0x2c0ad0=a153_0x27ff,_0x9a45be=new Map(),_0x19b833=new Map();for(const _0x502cf4 of _0x9cb872){_0x19b833[_0x2c0ad0(0x1d7)](_0x502cf4['id'],_0x502cf4);}const _0x3e0c15=new Set();for(const _0x43b6b8 of _0x9cb872){!_0x43b6b8[_0x2c0ad0(0x1ce)]&&_0x3e0c15[_0x2c0ad0(0x1cb)](_0x43b6b8['id']);}function _0x4d3ffc(_0x441dae){const _0x220850=_0x2c0ad0;if(_0x9a45be[_0x220850(0x1c9)](_0x441dae['id']))return _0x9a45be['get'](_0x441dae['id']);if(_0x3e0c15[_0x220850(0x1c9)](_0x441dae['id']))return _0x9a45be['set'](_0x441dae['id'],''),'';if(_0x441dae[_0x220850(0x1ce)]){const _0x401e59=_0x19b833['get'](_0x441dae[_0x220850(0x1ce)]);if(_0x401e59){const _0x36dcd5=_0x4d3ffc(_0x401e59),_0xe2a56e=_0x36dcd5?_0x36dcd5+'/'+_0x441dae[_0x220850(0x1d6)]:_0x441dae['name'];return _0x9a45be[_0x220850(0x1d7)](_0x441dae['id'],_0xe2a56e),_0xe2a56e;}}const _0x16c824=_0x441dae[_0x220850(0x1d6)];return _0x9a45be['set'](_0x441dae['id'],_0x16c824),_0x16c824;}for(const _0x4bc01e of _0x9cb872){_0x4d3ffc(_0x4bc01e);}return _0x9a45be;}export function buildFolderPathToIdMap(_0x352e92){const _0x1f7795=a153_0x27ff,_0x104d18=new Map(),_0xd09833=new Map();for(const _0x4b1e30 of _0x352e92){_0xd09833[_0x1f7795(0x1d7)](_0x4b1e30['id'],_0x4b1e30);}const _0x2ce505=new Set();for(const _0x98673e of _0x352e92){!_0x98673e['parentFolderId']&&_0x2ce505[_0x1f7795(0x1cb)](_0x98673e['id']);}function _0x35d989(_0x1af23b){const _0x4d8f8b=_0x1f7795;if(_0x2ce505[_0x4d8f8b(0x1c9)](_0x1af23b['id']))return'';if(_0x1af23b[_0x4d8f8b(0x1ce)]){const _0x55d736=_0xd09833[_0x4d8f8b(0x1cd)](_0x1af23b[_0x4d8f8b(0x1ce)]);if(_0x55d736){const _0x3b10bf=_0x35d989(_0x55d736);return _0x3b10bf?_0x3b10bf+'/'+_0x1af23b[_0x4d8f8b(0x1d6)]:_0x1af23b['name'];}}return _0x1af23b[_0x4d8f8b(0x1d6)];}for(const _0x32be2c of _0x352e92){const _0x27896b=_0x35d989(_0x32be2c);_0x104d18['set'](_0x27896b,_0x32be2c['id']);}return _0x104d18;}export function buildFolderMaps(_0x46ebe9){const _0x158db9=a153_0x27ff,_0x27f656=buildFolderIdToPathMap(_0x46ebe9),_0x35cec0=new Map();for(const [_0x570ef5,_0x18a84e]of _0x27f656){_0x35cec0[_0x158db9(0x1d7)](_0x18a84e,_0x570ef5);}return{'idToPath':_0x27f656,'pathToId':_0x35cec0};}export function getFolderPath(_0x22de39,_0x384e87){const _0x3babf4=a153_0x27ff;if(!_0x22de39)return'';return _0x384e87[_0x3babf4(0x1cd)](_0x22de39)??'';}
@@ -1 +1 @@
1
- (function(_0x22aa39,_0x2b73ac){const _0x53e55b=a154_0x47fc,_0x2863a0=_0x22aa39();while(!![]){try{const _0x1c7ae4=-parseInt(_0x53e55b(0xf7))/0x1+parseInt(_0x53e55b(0x119))/0x2+-parseInt(_0x53e55b(0x10c))/0x3+parseInt(_0x53e55b(0x102))/0x4+parseInt(_0x53e55b(0x11a))/0x5*(parseInt(_0x53e55b(0x10e))/0x6)+-parseInt(_0x53e55b(0xfb))/0x7+parseInt(_0x53e55b(0x101))/0x8*(parseInt(_0x53e55b(0x107))/0x9);if(_0x1c7ae4===_0x2b73ac)break;else _0x2863a0['push'](_0x2863a0['shift']());}catch(_0x60bbdd){_0x2863a0['push'](_0x2863a0['shift']());}}}(a154_0x8831,0xa29e3));import a154_0x46d77a from'path';import{parse as a154_0x5e8da7}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x1e00b0){const _0x1b7d77=a154_0x47fc;if(!_0x1e00b0||_0x1e00b0[_0x1b7d77(0xf3)]()==='')throw new Error(_0x1b7d77(0x120));const _0x5adb09=_0x1e00b0[_0x1b7d77(0xf3)]();if(_0x5adb09==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x1e00b0};const _0x4d88e7=_0x5adb09[_0x1b7d77(0x10f)]('/')?_0x5adb09[_0x1b7d77(0x11b)](0x1):_0x5adb09,_0x4ff15d=_0x4d88e7[_0x1b7d77(0x10b)]('/')[_0x1b7d77(0x111)](_0x195721=>_0x195721!=='');if(_0x4ff15d[_0x1b7d77(0xfc)]===0x0)throw new Error(_0x1b7d77(0x112));const _0x2c534b=_0x5adb09[_0x1b7d77(0x10f)]('/')||!isRelativePathSegment(_0x4ff15d[0x0]);for(const _0x264aff of _0x4ff15d){validatePathSegment(_0x264aff);}return{'segments':_0x4ff15d,'isAbsolute':_0x2c534b,'raw':_0x1e00b0};}function isRelativePathSegment(_0x61ae97){return _0x61ae97==='.'||_0x61ae97==='..';}function validatePathSegment(_0x5b8109){const _0x1ef9a4=a154_0x47fc;if(_0x5b8109==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x5b8109==='.'||_0x5b8109==='..')return;if(/[\x00-\x1F\x7F]/[_0x1ef9a4(0x114)](_0x5b8109))throw new Error(_0x1ef9a4(0xf6)+_0x5b8109);if(_0x5b8109!==_0x5b8109[_0x1ef9a4(0xf3)]()){}}export function validatePath(_0x1a6acf){const _0x34c38b=a154_0x47fc;if(_0x1a6acf[_0x34c38b(0x106)]['length']===0x0&&!_0x1a6acf[_0x34c38b(0x108)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x1a6acf[_0x34c38b(0x108)]){if(_0x1a6acf[_0x34c38b(0x106)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x1cf3cd=0x0;for(const _0x2f72ef of _0x1a6acf[_0x34c38b(0x106)]){if(_0x2f72ef==='..'){if(_0x1cf3cd===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x1cf3cd--;}else _0x2f72ef!=='.'&&_0x1cf3cd++;}}}function a154_0x47fc(_0x26e01d,_0x4bc8f9){_0x26e01d=_0x26e01d-0xf2;const _0x883174=a154_0x8831();let _0x47fcba=_0x883174[_0x26e01d];return _0x47fcba;}export function joinPaths(_0x33c379,_0x5606f0){const _0x36109b=a154_0x47fc;if(!_0x33c379||_0x33c379==='/')return _0x5606f0;if(!_0x5606f0||_0x5606f0==='.')return _0x33c379;if(_0x5606f0[_0x36109b(0x10f)]('/'))return _0x5606f0;const _0x332afe=parsePath(_0x33c379),_0x5ba334=parsePath(_0x5606f0),_0x286840=[..._0x332afe[_0x36109b(0x106)]];for(const _0x2ca125 of _0x5ba334['segments']){if(_0x2ca125==='.')continue;else{if(_0x2ca125==='..'){if(_0x286840['length']===0x0)throw new Error(_0x36109b(0x104));_0x286840[_0x36109b(0x117)]();}else _0x286840[_0x36109b(0x115)](_0x2ca125);}}const _0x58ea4b=_0x286840[_0x36109b(0xf9)]('/');return _0x332afe['raw']['startsWith']('/')?'/'+_0x58ea4b:_0x58ea4b;}export function normalizePath(_0x4c0ce0){const _0x6cb2cd=a154_0x47fc,_0x3d782f=parsePath(_0x4c0ce0),_0xa7f779=[];for(const _0xf0adf2 of _0x3d782f[_0x6cb2cd(0x106)]){if(_0xf0adf2==='.')continue;else{if(_0xf0adf2==='..'){if(_0xa7f779[_0x6cb2cd(0xfc)]===0x0){if(_0x3d782f[_0x6cb2cd(0x108)])throw new Error(_0x6cb2cd(0x104));_0xa7f779[_0x6cb2cd(0x115)]('..');}else _0xa7f779[_0xa7f779[_0x6cb2cd(0xfc)]-0x1]==='..'?_0xa7f779[_0x6cb2cd(0x115)]('..'):_0xa7f779[_0x6cb2cd(0x117)]();}else _0xa7f779['push'](_0xf0adf2);}}if(_0xa7f779['length']===0x0)return _0x3d782f['isAbsolute']?'/':'.';const _0x36de23=_0xa7f779[_0x6cb2cd(0xf9)]('/');return _0x3d782f[_0x6cb2cd(0x10d)][_0x6cb2cd(0x10f)]('/')?'/'+_0x36de23:_0x36de23;}export function getParentPath(_0x5de5d1){const _0x3b5df4=a154_0x47fc,_0x161fae=parsePath(_0x5de5d1);if(_0x161fae[_0x3b5df4(0x106)][_0x3b5df4(0xfc)]<=0x1)return'/';const _0x5c5778=_0x161fae[_0x3b5df4(0x106)]['slice'](0x0,-0x1)[_0x3b5df4(0xf9)]('/');return _0x161fae['raw'][_0x3b5df4(0x10f)]('/')?'/'+_0x5c5778:_0x5c5778;}export function getBaseName(_0x56772a){const _0x10d9f3=a154_0x47fc,_0x5a59c8=parsePath(_0x56772a);return _0x5a59c8[_0x10d9f3(0x106)][_0x5a59c8[_0x10d9f3(0x106)]['length']-0x1]||'';}export function isChildPath(_0x5c7069,_0x1d7c94){const _0x3e09f0=a154_0x47fc,_0x2f40cc=parsePath(_0x5c7069),_0x37f984=parsePath(_0x1d7c94);if(_0x2f40cc['segments'][_0x3e09f0(0xfc)]<=_0x37f984[_0x3e09f0(0x106)]['length'])return![];for(let _0x31b3c5=0x0;_0x31b3c5<_0x37f984[_0x3e09f0(0x106)][_0x3e09f0(0xfc)];_0x31b3c5++){if(_0x2f40cc[_0x3e09f0(0x106)][_0x31b3c5]!==_0x37f984[_0x3e09f0(0x106)][_0x31b3c5])return![];}return!![];}export function splitPath(_0x2955a3){const _0x680947=a154_0x47fc,_0x777349=parsePath(_0x2955a3);if(_0x777349[_0x680947(0x106)][_0x680947(0xfc)]===0x0)throw new Error(_0x680947(0x11c));if(_0x777349[_0x680947(0x106)][_0x680947(0xfc)]===0x1)return{'parent':_0x777349[_0x680947(0x106)][0x0]};return{'parent':_0x777349[_0x680947(0x106)][0x0],'child':_0x777349[_0x680947(0x106)][_0x680947(0x11d)](0x1)['join']('/')};}export function isYamlFilePath(_0x35d527){const _0x4c6ddb=a154_0x47fc;return _0x35d527[_0x4c6ddb(0x105)](_0x4c6ddb(0xf4))||_0x35d527[_0x4c6ddb(0x105)](_0x4c6ddb(0x11f));}function a154_0x8831(){const _0x50ed13=['exists','No\x20tdx.json\x20found\x20for\x20file:\x20','trim','.yml','parse','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','1172219OxIQPH','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','join','readFile','2487058ldlnUA','length','parent_segment','journey','type','dirname','272otybKW','1255308LDfqjZ','name','Cannot\x20navigate\x20above\x20root','endsWith','segments','156402kKNnRB','isAbsolute','root','resolve','split','2499405fSxnwz','raw','48fEjPnf','startsWith','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','filter','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','replace','test','push','File\x20not\x20found:\x20','pop','relative','2036568cqwNUz','689855hOogtA','substring','Cannot\x20split\x20empty\x20path','slice','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','.yaml','Path\x20cannot\x20be\x20empty'];a154_0x8831=function(){return _0x50ed13;};return a154_0x8831();}export async function resolveYamlFilePath(_0x496998,_0x1a940f=nodeFileSystem){const _0x30acac=a154_0x47fc,_0x18edb6=a154_0x46d77a[_0x30acac(0x10a)](_0x496998);if(!await _0x1a940f[_0x30acac(0x121)](_0x18edb6))throw new Error(_0x30acac(0x116)+_0x496998);let _0x3dd83b=a154_0x46d77a['dirname'](_0x18edb6),_0x531bc2=null,_0x58a502=null;const _0x13585e=a154_0x46d77a[_0x30acac(0xf5)](_0x3dd83b)[_0x30acac(0x109)];while(_0x3dd83b!==_0x13585e){const _0x44919f=a154_0x46d77a[_0x30acac(0xf9)](_0x3dd83b,'tdx.json');if(await _0x1a940f['exists'](_0x44919f)){_0x531bc2=_0x44919f,_0x58a502=_0x3dd83b;break;}_0x3dd83b=a154_0x46d77a[_0x30acac(0x100)](_0x3dd83b);}if(!_0x531bc2||!_0x58a502)throw new Error(_0x30acac(0xf2)+_0x496998+'\x0a'+_0x30acac(0xf8));const _0x3aa14b=await _0x1a940f[_0x30acac(0xfa)](_0x531bc2),_0x4ec41f=JSON['parse'](_0x3aa14b),_0x1f6619=_0x4ec41f[_0x30acac(0xfd)];if(!_0x1f6619)throw new Error(_0x30acac(0x110));const _0x356578=await _0x1a940f[_0x30acac(0xfa)](_0x18edb6),_0x1de16b=a154_0x5e8da7(_0x356578),_0x43192f=_0x1de16b[_0x30acac(0x103)];if(!_0x43192f)throw new Error(_0x30acac(0x11e)+_0x496998);const _0x5e1c3f=_0x1de16b[_0x30acac(0xff)]===_0x30acac(0xfe)?_0x30acac(0xfe):'segment',_0x4a74e4=a154_0x46d77a[_0x30acac(0x118)](_0x58a502,_0x18edb6),_0x50e69d=a154_0x46d77a[_0x30acac(0x100)](_0x4a74e4),_0x282269=_0x50e69d==='.'?'':_0x50e69d[_0x30acac(0x113)](/\\/g,'/'),_0x58a5af=_0x282269?_0x1f6619+'/'+_0x282269+'/'+_0x43192f:_0x1f6619+'/'+_0x43192f;return{'parentSegment':_0x1f6619,'segmentName':_0x43192f,'folderPath':_0x282269,'fullPath':_0x58a5af,'resourceType':_0x5e1c3f,'content':_0x356578};}
1
+ (function(_0x5af560,_0x331db3){const _0x56e37a=a154_0x7a10,_0xb388df=_0x5af560();while(!![]){try{const _0x4cb4b6=-parseInt(_0x56e37a(0x118))/0x1+-parseInt(_0x56e37a(0x131))/0x2*(-parseInt(_0x56e37a(0x125))/0x3)+parseInt(_0x56e37a(0x10e))/0x4*(parseInt(_0x56e37a(0x134))/0x5)+-parseInt(_0x56e37a(0x112))/0x6*(parseInt(_0x56e37a(0x135))/0x7)+-parseInt(_0x56e37a(0x10c))/0x8+parseInt(_0x56e37a(0x113))/0x9+parseInt(_0x56e37a(0x12f))/0xa*(parseInt(_0x56e37a(0x132))/0xb);if(_0x4cb4b6===_0x331db3)break;else _0xb388df['push'](_0xb388df['shift']());}catch(_0x286a87){_0xb388df['push'](_0xb388df['shift']());}}}(a154_0x5238,0x6ee99));import a154_0x5c00e5 from'path';import{parse as a154_0x4db4de}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x15654a){const _0x34ceb6=a154_0x7a10;if(!_0x15654a||_0x15654a[_0x34ceb6(0x12c)]()==='')throw new Error(_0x34ceb6(0x10a));const _0x5b8ada=_0x15654a[_0x34ceb6(0x12c)]();if(_0x5b8ada==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x15654a};const _0x5ae073=_0x5b8ada[_0x34ceb6(0x127)]('/')?_0x5b8ada[_0x34ceb6(0x124)](0x1):_0x5b8ada,_0x441f03=_0x5ae073[_0x34ceb6(0x130)]('/')[_0x34ceb6(0x10f)](_0x246e09=>_0x246e09!=='');if(_0x441f03[_0x34ceb6(0x107)]===0x0)throw new Error(_0x34ceb6(0x11d));const _0x51e755=_0x5b8ada[_0x34ceb6(0x127)]('/')||!isRelativePathSegment(_0x441f03[0x0]);for(const _0x4f3e53 of _0x441f03){validatePathSegment(_0x4f3e53);}return{'segments':_0x441f03,'isAbsolute':_0x51e755,'raw':_0x15654a};}function isRelativePathSegment(_0x53fc35){return _0x53fc35==='.'||_0x53fc35==='..';}function validatePathSegment(_0x348ffe){const _0x5d5044=a154_0x7a10;if(_0x348ffe==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x348ffe==='.'||_0x348ffe==='..')return;if(/[\x00-\x1F\x7F]/[_0x5d5044(0x139)](_0x348ffe))throw new Error(_0x5d5044(0x123)+_0x348ffe);if(_0x348ffe!==_0x348ffe['trim']()){}}export function validatePath(_0x58f896){const _0x3a9982=a154_0x7a10;if(_0x58f896['segments'][_0x3a9982(0x107)]===0x0&&!_0x58f896[_0x3a9982(0x117)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x58f896[_0x3a9982(0x117)]){if(_0x58f896[_0x3a9982(0x129)][0x0]==='..')throw new Error(_0x3a9982(0x138));let _0x28b96b=0x0;for(const _0x4b888b of _0x58f896[_0x3a9982(0x129)]){if(_0x4b888b==='..'){if(_0x28b96b===0x0)throw new Error(_0x3a9982(0x116));_0x28b96b--;}else _0x4b888b!=='.'&&_0x28b96b++;}}}export function joinPaths(_0x3e13d5,_0x3b097c){const _0x147ad8=a154_0x7a10;if(!_0x3e13d5||_0x3e13d5==='/')return _0x3b097c;if(!_0x3b097c||_0x3b097c==='.')return _0x3e13d5;if(_0x3b097c['startsWith']('/'))return _0x3b097c;const _0x23836a=parsePath(_0x3e13d5),_0x584ec9=parsePath(_0x3b097c),_0x1fd2d3=[..._0x23836a[_0x147ad8(0x129)]];for(const _0x491b3b of _0x584ec9['segments']){if(_0x491b3b==='.')continue;else{if(_0x491b3b==='..'){if(_0x1fd2d3[_0x147ad8(0x107)]===0x0)throw new Error(_0x147ad8(0x12d));_0x1fd2d3[_0x147ad8(0x122)]();}else _0x1fd2d3['push'](_0x491b3b);}}const _0x270f74=_0x1fd2d3[_0x147ad8(0x137)]('/');return _0x23836a[_0x147ad8(0x121)]['startsWith']('/')?'/'+_0x270f74:_0x270f74;}export function normalizePath(_0x58d134){const _0x218d72=a154_0x7a10,_0x145d33=parsePath(_0x58d134),_0x2ffaa9=[];for(const _0x5373ec of _0x145d33[_0x218d72(0x129)]){if(_0x5373ec==='.')continue;else{if(_0x5373ec==='..'){if(_0x2ffaa9[_0x218d72(0x107)]===0x0){if(_0x145d33[_0x218d72(0x117)])throw new Error(_0x218d72(0x12d));_0x2ffaa9['push']('..');}else _0x2ffaa9[_0x2ffaa9[_0x218d72(0x107)]-0x1]==='..'?_0x2ffaa9[_0x218d72(0x126)]('..'):_0x2ffaa9['pop']();}else _0x2ffaa9[_0x218d72(0x126)](_0x5373ec);}}if(_0x2ffaa9['length']===0x0)return _0x145d33[_0x218d72(0x117)]?'/':'.';const _0x429777=_0x2ffaa9['join']('/');return _0x145d33[_0x218d72(0x121)][_0x218d72(0x127)]('/')?'/'+_0x429777:_0x429777;}export function getParentPath(_0x3b1582){const _0x4863a6=a154_0x7a10,_0x4e52e4=parsePath(_0x3b1582);if(_0x4e52e4[_0x4863a6(0x129)][_0x4863a6(0x107)]<=0x1)return'/';const _0x410107=_0x4e52e4[_0x4863a6(0x129)][_0x4863a6(0x110)](0x0,-0x1)[_0x4863a6(0x137)]('/');return _0x4e52e4['raw']['startsWith']('/')?'/'+_0x410107:_0x410107;}export function getBaseName(_0x4155c9){const _0x222917=a154_0x7a10,_0x4438d4=parsePath(_0x4155c9);return _0x4438d4[_0x222917(0x129)][_0x4438d4[_0x222917(0x129)][_0x222917(0x107)]-0x1]||'';}export function isChildPath(_0x51db3e,_0x49f440){const _0x575846=a154_0x7a10,_0x37c52b=parsePath(_0x51db3e),_0x101fb4=parsePath(_0x49f440);if(_0x37c52b['segments'][_0x575846(0x107)]<=_0x101fb4[_0x575846(0x129)][_0x575846(0x107)])return![];for(let _0x3c4f23=0x0;_0x3c4f23<_0x101fb4['segments']['length'];_0x3c4f23++){if(_0x37c52b[_0x575846(0x129)][_0x3c4f23]!==_0x101fb4[_0x575846(0x129)][_0x3c4f23])return![];}return!![];}export function splitPath(_0x30061d){const _0x43cf23=a154_0x7a10,_0x9ac67c=parsePath(_0x30061d);if(_0x9ac67c[_0x43cf23(0x129)][_0x43cf23(0x107)]===0x0)throw new Error(_0x43cf23(0x111));if(_0x9ac67c[_0x43cf23(0x129)][_0x43cf23(0x107)]===0x1)return{'parent':_0x9ac67c['segments'][0x0]};return{'parent':_0x9ac67c[_0x43cf23(0x129)][0x0],'child':_0x9ac67c[_0x43cf23(0x129)][_0x43cf23(0x110)](0x1)['join']('/')};}export function isYamlFilePath(_0x53473d){const _0x2c96ab=a154_0x7a10;return _0x53473d[_0x2c96ab(0x115)](_0x2c96ab(0x10b))||_0x53473d[_0x2c96ab(0x115)](_0x2c96ab(0x108));}function a154_0x7a10(_0x29bdab,_0x4dd03f){_0x29bdab=_0x29bdab-0x107;const _0x523812=a154_0x5238();let _0x7a105e=_0x523812[_0x29bdab];return _0x7a105e;}function a154_0x5238(){const _0x28a438=['relative','File\x20not\x20found:\x20','raw','pop','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','substring','24fQEfet','push','startsWith','dirname','segments','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','readFile','trim','Cannot\x20navigate\x20above\x20root','parent_segment','10sAIliB','split','113728dIsESB','11305602vketKH','replace','160345iDIUYD','5088629knhXvb','exists','join','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','test','length','.yaml','resolve','Path\x20cannot\x20be\x20empty','.yml','4124000TMPgjK','journey','12pytOUQ','filter','slice','Cannot\x20split\x20empty\x20path','6DINASO','1187802mAyvEe','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','endsWith','Path\x20attempts\x20to\x20navigate\x20above\x20root','isAbsolute','14135YTeoJD','segment','parse','tdx.json','name','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','type'];a154_0x5238=function(){return _0x28a438;};return a154_0x5238();}export async function resolveYamlFilePath(_0x2cc9f1,_0x4bbbc1=nodeFileSystem){const _0x2ab916=a154_0x7a10,_0x9faac7=a154_0x5c00e5[_0x2ab916(0x109)](_0x2cc9f1);if(!await _0x4bbbc1[_0x2ab916(0x136)](_0x9faac7))throw new Error(_0x2ab916(0x120)+_0x2cc9f1);let _0x2428d6=a154_0x5c00e5[_0x2ab916(0x128)](_0x9faac7),_0x3bfbf9=null,_0x4f22fd=null;const _0x1749c2=a154_0x5c00e5[_0x2ab916(0x11a)](_0x2428d6)['root'];while(_0x2428d6!==_0x1749c2){const _0x42d0f2=a154_0x5c00e5[_0x2ab916(0x137)](_0x2428d6,_0x2ab916(0x11b));if(await _0x4bbbc1['exists'](_0x42d0f2)){_0x3bfbf9=_0x42d0f2,_0x4f22fd=_0x2428d6;break;}_0x2428d6=a154_0x5c00e5[_0x2ab916(0x128)](_0x2428d6);}if(!_0x3bfbf9||!_0x4f22fd)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x2cc9f1+'\x0a'+_0x2ab916(0x12a));const _0xde403=await _0x4bbbc1[_0x2ab916(0x12b)](_0x3bfbf9),_0x4ca882=JSON[_0x2ab916(0x11a)](_0xde403),_0x4148f2=_0x4ca882[_0x2ab916(0x12e)];if(!_0x4148f2)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x23ad96=await _0x4bbbc1[_0x2ab916(0x12b)](_0x9faac7),_0x5d6d25=a154_0x4db4de(_0x23ad96),_0x2cdbd0=_0x5d6d25[_0x2ab916(0x11c)];if(!_0x2cdbd0)throw new Error(_0x2ab916(0x114)+_0x2cc9f1);const _0x868ff=_0x5d6d25[_0x2ab916(0x11e)]===_0x2ab916(0x10d)?_0x2ab916(0x10d):_0x2ab916(0x119),_0x350bdd=a154_0x5c00e5[_0x2ab916(0x11f)](_0x4f22fd,_0x9faac7),_0x3b473e=a154_0x5c00e5['dirname'](_0x350bdd),_0x1f2fde=_0x3b473e==='.'?'':_0x3b473e[_0x2ab916(0x133)](/\\/g,'/'),_0x1c702f=_0x1f2fde?_0x4148f2+'/'+_0x1f2fde+'/'+_0x2cdbd0:_0x4148f2+'/'+_0x2cdbd0;return{'parentSegment':_0x4148f2,'segmentName':_0x2cdbd0,'folderPath':_0x1f2fde,'fullPath':_0x1c702f,'resourceType':_0x868ff,'content':_0x23ad96};}
@@ -1 +1 @@
1
- function a155_0x6e58(){const _0xe32fbd=['809585iZjFfV','indexOf','72mgezkW','2996230dzoTnu','2030555Yoqclz','.\x20Parent\x20name\x20cannot\x20be\x20empty','12aiVlgN','9658944SWMKyL','substring','27Cihfvt','5617337zmErAE','4288GQVFLy','12DKxsXs','122394OWXAuB'];a155_0x6e58=function(){return _0xe32fbd;};return a155_0x6e58();}function a155_0x5a5e(_0x18291a,_0x50a476){_0x18291a=_0x18291a-0xa6;const _0x6e5873=a155_0x6e58();let _0x5a5e20=_0x6e5873[_0x18291a];return _0x5a5e20;}(function(_0x157214,_0x39d921){const _0x59f2b4=a155_0x5a5e,_0x4f566b=_0x157214();while(!![]){try{const _0x4224a1=parseInt(_0x59f2b4(0xa9))/0x1*(-parseInt(_0x59f2b4(0xa8))/0x2)+-parseInt(_0x59f2b4(0xaa))/0x3*(-parseInt(_0x59f2b4(0xad))/0x4)+-parseInt(_0x59f2b4(0xaf))/0x5*(-parseInt(_0x59f2b4(0xb1))/0x6)+parseInt(_0x59f2b4(0xab))/0x7+-parseInt(_0x59f2b4(0xb2))/0x8+parseInt(_0x59f2b4(0xa6))/0x9*(parseInt(_0x59f2b4(0xae))/0xa)+-parseInt(_0x59f2b4(0xa7))/0xb;if(_0x4224a1===_0x39d921)break;else _0x4f566b['push'](_0x4f566b['shift']());}catch(_0x5ae244){_0x4f566b['push'](_0x4f566b['shift']());}}}(a155_0x6e58,0xc78c3));export function parseSegmentRef(_0x34a6aa){const _0x4cb959=a155_0x5a5e,_0x598aa1=_0x34a6aa[_0x4cb959(0xac)]('/');if(_0x598aa1===-0x1)return{'parentId':_0x34a6aa};if(_0x598aa1===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x34a6aa+_0x4cb959(0xb0));const _0x2b4670=_0x34a6aa['substring'](0x0,_0x598aa1),_0x4dfe1d=_0x34a6aa[_0x4cb959(0xb3)](_0x598aa1+0x1);if(_0x4dfe1d==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x34a6aa+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x2b4670,'childId':_0x4dfe1d};}
1
+ function a155_0x586f(_0x18f996,_0x135c0c){_0x18f996=_0x18f996-0x19b;const _0x49cb75=a155_0x49cb();let _0x586f5e=_0x49cb75[_0x18f996];return _0x586f5e;}function a155_0x49cb(){const _0x4a83dd=['9vTpAem','1697988ZLbEnQ','15sUhsYZ','Invalid\x20segment\x20reference\x20format:\x20','.\x20Child\x20name\x20cannot\x20be\x20empty','10125070kZVYGc','2395485MTSIJy','.\x20Parent\x20name\x20cannot\x20be\x20empty','1469908gfCptd','2TPjwOW','883307bklkmn','5348152pLloAM','222096ldOPRt'];a155_0x49cb=function(){return _0x4a83dd;};return a155_0x49cb();}(function(_0x588711,_0x66d73c){const _0x134b87=a155_0x586f,_0x2def64=_0x588711();while(!![]){try{const _0x1bb8fb=-parseInt(_0x134b87(0x1a3))/0x1*(parseInt(_0x134b87(0x1a2))/0x2)+-parseInt(_0x134b87(0x19f))/0x3+-parseInt(_0x134b87(0x1a1))/0x4+parseInt(_0x134b87(0x19b))/0x5*(parseInt(_0x134b87(0x1a7))/0x6)+parseInt(_0x134b87(0x1a5))/0x7+parseInt(_0x134b87(0x1a4))/0x8+parseInt(_0x134b87(0x1a6))/0x9*(parseInt(_0x134b87(0x19e))/0xa);if(_0x1bb8fb===_0x66d73c)break;else _0x2def64['push'](_0x2def64['shift']());}catch(_0x27539c){_0x2def64['push'](_0x2def64['shift']());}}}(a155_0x49cb,0x7d1d5));export function parseSegmentRef(_0x4e0562){const _0x30647d=a155_0x586f,_0x364f0b=_0x4e0562['indexOf']('/');if(_0x364f0b===-0x1)return{'parentId':_0x4e0562};if(_0x364f0b===0x0)throw new Error(_0x30647d(0x19c)+_0x4e0562+_0x30647d(0x1a0));const _0x527dec=_0x4e0562['substring'](0x0,_0x364f0b),_0x5749bd=_0x4e0562['substring'](_0x364f0b+0x1);if(_0x5749bd==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x4e0562+_0x30647d(0x19d));return{'parentId':_0x527dec,'childId':_0x5749bd};}