@treasuredata/tdx 0.16.4 → 0.16.5

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 (217) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.d.ts.map +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-command.js.map +1 -1
  11. package/dist/commands/agent-test-command.d.ts +4 -0
  12. package/dist/commands/agent-test-command.d.ts.map +1 -1
  13. package/dist/commands/agent-test-command.js +1 -1
  14. package/dist/commands/agent-test-command.js.map +1 -1
  15. package/dist/commands/api-command.js +1 -1
  16. package/dist/commands/auth-command.d.ts.map +1 -1
  17. package/dist/commands/auth-command.js +1 -1
  18. package/dist/commands/auth-command.js.map +1 -1
  19. package/dist/commands/chat-command.js +1 -1
  20. package/dist/commands/claude-command.js +1 -1
  21. package/dist/commands/claude-statusline-command.js +1 -1
  22. package/dist/commands/claude-usage-command.js +1 -1
  23. package/dist/commands/command.js +1 -1
  24. package/dist/commands/connection-command.js +1 -1
  25. package/dist/commands/databases.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/llm-proxy.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/profile-command.d.ts.map +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profile-command.js.map +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-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/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.d.ts +7 -5
  58. package/dist/core/config.d.ts.map +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/config.js.map +1 -1
  61. package/dist/core/connection-cache.d.ts.map +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/connection-cache.js.map +1 -1
  64. package/dist/core/constants.d.ts +22 -0
  65. package/dist/core/constants.d.ts.map +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/constants.js.map +1 -1
  68. package/dist/core/credential-cache.js +1 -1
  69. package/dist/core/global-context.js +1 -1
  70. package/dist/core/keychain.d.ts.map +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/keychain.js.map +1 -1
  73. package/dist/core/profile.js +1 -1
  74. package/dist/core/project-config.js +1 -1
  75. package/dist/core/session.js +1 -1
  76. package/dist/core/user-cache.d.ts.map +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/user-cache.js.map +1 -1
  79. package/dist/core/version.d.ts +2 -2
  80. package/dist/core/version.js +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/mcp/server.js +1 -1
  83. package/dist/mcp/tools/index.js +1 -1
  84. package/dist/mcp/tools/tdx-run.js +1 -1
  85. package/dist/mcp/tools/tdx-search.js +1 -1
  86. package/dist/mcp/utils.js +1 -1
  87. package/dist/proxy/anthropic-adapter.js +1 -1
  88. package/dist/proxy/claude-usage-tracker.js +1 -1
  89. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  90. package/dist/proxy/context-signature.js +1 -1
  91. package/dist/proxy/conversation-utils.js +1 -1
  92. package/dist/proxy/passthrough-server.js +1 -1
  93. package/dist/proxy/server.js +1 -1
  94. package/dist/proxy/session-cache.js +1 -1
  95. package/dist/proxy/sse-usage-parser.js +1 -1
  96. package/dist/sdk/agent/agent-config.js +1 -1
  97. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  98. package/dist/sdk/agent/agent-yaml.d.ts +2 -0
  99. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  100. package/dist/sdk/agent/agent-yaml.js +1 -1
  101. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  102. package/dist/sdk/agent/test/evaluator.d.ts +3 -6
  103. package/dist/sdk/agent/test/evaluator.d.ts.map +1 -1
  104. package/dist/sdk/agent/test/evaluator.js +1 -1
  105. package/dist/sdk/agent/test/evaluator.js.map +1 -1
  106. package/dist/sdk/agent/test/executor.d.ts +57 -1
  107. package/dist/sdk/agent/test/executor.d.ts.map +1 -1
  108. package/dist/sdk/agent/test/executor.js +1 -1
  109. package/dist/sdk/agent/test/executor.js.map +1 -1
  110. package/dist/sdk/agent/test/index.d.ts +2 -2
  111. package/dist/sdk/agent/test/index.d.ts.map +1 -1
  112. package/dist/sdk/agent/test/index.js +1 -1
  113. package/dist/sdk/agent/test/index.js.map +1 -1
  114. package/dist/sdk/agent/test/output.js +1 -1
  115. package/dist/sdk/agent/test/parser.d.ts.map +1 -1
  116. package/dist/sdk/agent/test/parser.js +1 -1
  117. package/dist/sdk/agent/test/parser.js.map +1 -1
  118. package/dist/sdk/agent/test/types.d.ts +44 -0
  119. package/dist/sdk/agent/test/types.d.ts.map +1 -1
  120. package/dist/sdk/api.js +1 -1
  121. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  122. package/dist/sdk/claude-agent/environment.js +1 -1
  123. package/dist/sdk/claude-agent/index.js +1 -1
  124. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  125. package/dist/sdk/client/cdp-api-client.js +1 -1
  126. package/dist/sdk/client/endpoints.js +1 -1
  127. package/dist/sdk/client/endpoints.js.map +1 -1
  128. package/dist/sdk/client/engage-api-client.js +1 -1
  129. package/dist/sdk/client/http-client.js +1 -1
  130. package/dist/sdk/client/llm-api-client.d.ts +6 -0
  131. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  132. package/dist/sdk/client/llm-api-client.js +1 -1
  133. package/dist/sdk/client/llm-api-client.js.map +1 -1
  134. package/dist/sdk/client/rate-limiter.js +1 -1
  135. package/dist/sdk/client/td-api-client.js +1 -1
  136. package/dist/sdk/client/trino-api-client.js +1 -1
  137. package/dist/sdk/client/workflow-client.js +1 -1
  138. package/dist/sdk/connection-validator.js +1 -1
  139. package/dist/sdk/connection.js +1 -1
  140. package/dist/sdk/engage.js +1 -1
  141. package/dist/sdk/errors.js +1 -1
  142. package/dist/sdk/index.js +1 -1
  143. package/dist/sdk/io/index.js +1 -1
  144. package/dist/sdk/io/node-filesystem.js +1 -1
  145. package/dist/sdk/job.js +1 -1
  146. package/dist/sdk/journey.js +1 -1
  147. package/dist/sdk/llm/chat-cache.d.ts.map +1 -1
  148. package/dist/sdk/llm/chat-cache.js +1 -1
  149. package/dist/sdk/llm/chat-cache.js.map +1 -1
  150. package/dist/sdk/llm/index.d.ts +11 -3
  151. package/dist/sdk/llm/index.d.ts.map +1 -1
  152. package/dist/sdk/llm/index.js +1 -1
  153. package/dist/sdk/llm/index.js.map +1 -1
  154. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  155. package/dist/sdk/llm/model-aliases.js +1 -1
  156. package/dist/sdk/llm/model-factors.js +1 -1
  157. package/dist/sdk/query/index.js +1 -1
  158. package/dist/sdk/query/sql-parser.js +1 -1
  159. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  160. package/dist/sdk/segment/fields-display.js +1 -1
  161. package/dist/sdk/segment/file-discovery.js +1 -1
  162. package/dist/sdk/segment/journey-utils.js +1 -1
  163. package/dist/sdk/segment/journey-yaml.js +1 -1
  164. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  165. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  166. package/dist/sdk/segment/pull-workflow.js +1 -1
  167. package/dist/sdk/segment/push-workflow.js +1 -1
  168. package/dist/sdk/segment/resolution-context.js +1 -1
  169. package/dist/sdk/segment/segment-path-parser.js +1 -1
  170. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  171. package/dist/sdk/segment/target-resolution.js +1 -1
  172. package/dist/sdk/segment/tdx-config.js +1 -1
  173. package/dist/sdk/segment/validate-files.js +1 -1
  174. package/dist/sdk/segment/yaml-validator.js +1 -1
  175. package/dist/sdk/segment.js +1 -1
  176. package/dist/sdk/types/index.js +1 -1
  177. package/dist/sdk/types/llm.d.ts +39 -0
  178. package/dist/sdk/types/llm.d.ts.map +1 -1
  179. package/dist/sdk/types/progress.js +1 -1
  180. package/dist/sdk/user.js +1 -1
  181. package/dist/sdk/util/format-detector.js +1 -1
  182. package/dist/sdk/util/formatters.js +1 -1
  183. package/dist/sdk/util/index.js +1 -1
  184. package/dist/sdk/util/tree-formatter.js +1 -1
  185. package/dist/sdk/workflow/clone-workflow.js +1 -1
  186. package/dist/sdk/workflow/index.js +1 -1
  187. package/dist/sdk/workflow/pull-workflow.js +1 -1
  188. package/dist/sdk/workflow/push-workflow.js +1 -1
  189. package/dist/sdk/workflow/tdx-config.js +1 -1
  190. package/dist/sdk/workflow/workflow-utils.js +1 -1
  191. package/dist/utils/async.js +1 -1
  192. package/dist/utils/colors.js +1 -1
  193. package/dist/utils/diff.js +1 -1
  194. package/dist/utils/file-permissions.js +1 -1
  195. package/dist/utils/global-cache.d.ts +88 -0
  196. package/dist/utils/global-cache.d.ts.map +1 -0
  197. package/dist/utils/global-cache.js +1 -0
  198. package/dist/utils/global-cache.js.map +1 -0
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.d.ts +48 -0
  201. package/dist/utils/local-cache.d.ts.map +1 -0
  202. package/dist/utils/local-cache.js +1 -0
  203. package/dist/utils/local-cache.js.map +1 -0
  204. package/dist/utils/option-validation.js +1 -1
  205. package/dist/utils/port.js +1 -1
  206. package/dist/utils/process.js +1 -1
  207. package/dist/utils/prompt.js +1 -1
  208. package/dist/utils/spinner.js +1 -1
  209. package/dist/utils/sse-parser.js +1 -1
  210. package/dist/utils/string-utils.js +1 -1
  211. package/dist/utils/table-ref-parser.js +1 -1
  212. package/dist/utils/tdx-logger.js +1 -1
  213. package/dist/utils/tdx-logger.js.map +1 -1
  214. package/dist/utils/version-check.d.ts.map +1 -1
  215. package/dist/utils/version-check.js +1 -1
  216. package/dist/utils/version-check.js.map +1 -1
  217. package/package.json +2 -2
@@ -1 +1 @@
1
- const a119_0x520e5a=a119_0x4408;(function(_0x45e6b7,_0x1b0c12){const _0x2c779c=a119_0x4408,_0x53afa9=_0x45e6b7();while(!![]){try{const _0x17ca08=-parseInt(_0x2c779c(0x1a8))/0x1+parseInt(_0x2c779c(0x1f0))/0x2+parseInt(_0x2c779c(0x25c))/0x3*(parseInt(_0x2c779c(0x200))/0x4)+parseInt(_0x2c779c(0x1e6))/0x5*(-parseInt(_0x2c779c(0x179))/0x6)+parseInt(_0x2c779c(0x1b6))/0x7*(-parseInt(_0x2c779c(0x22f))/0x8)+parseInt(_0x2c779c(0x1b8))/0x9*(-parseInt(_0x2c779c(0x189))/0xa)+parseInt(_0x2c779c(0x1bc))/0xb;if(_0x17ca08===_0x1b0c12)break;else _0x53afa9['push'](_0x53afa9['shift']());}catch(_0x1ce2ae){_0x53afa9['push'](_0x53afa9['shift']());}}}(a119_0x1fa5,0x4ed6d));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a119_0x520e5a(0x252);export const PENDING_ACTIVATION_PREFIX=a119_0x520e5a(0x1b1);export function createPendingSegmentId(_0x4808a5){return''+PENDING_SEGMENT_PREFIX+_0x4808a5+'__';}export function isPendingSegmentId(_0x3bd1b0){const _0x2ff420=a119_0x520e5a;return _0x3bd1b0[_0x2ff420(0x1f3)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x5aab1b){return _0x5aab1b['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1f3311){return''+PENDING_ACTIVATION_PREFIX+_0x1f3311+'__';}export function isPendingActivationId(_0x209cdb){const _0x2accf4=a119_0x520e5a;return _0x209cdb[_0x2accf4(0x1f3)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1ef957){const _0x59f25e=a119_0x520e5a;return _0x1ef957[_0x59f25e(0x256)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0xd5a0b1,_0x7215ab){const _0x53ac31=a119_0x520e5a,_0x543f11=_0xd5a0b1+'::'+(_0x7215ab[_0x53ac31(0x1e0)]()||_0x53ac31(0x1b9)),_0x25f907=createHash(_0x53ac31(0x182))[_0x53ac31(0x19d)](_0x543f11)[_0x53ac31(0x21c)](_0x53ac31(0x194))['slice'](0x0,0xc);return _0x53ac31(0x177)+_0x25f907;}export function ensureJourneyDefaults(_0x536170){const _0x6c9e60=a119_0x520e5a;!_0x536170[_0x6c9e60(0x255)]&&(_0x536170[_0x6c9e60(0x255)]=''),!_0x536170[_0x6c9e60(0x17e)]&&(_0x536170[_0x6c9e60(0x17e)]=_0x6c9e60(0x1f1));}export function resolveTDFolderPath(_0xb4cd46,_0x4c2620,_0x36709e){const _0x4a4360=a119_0x520e5a;if(!_0x4c2620)return _0xb4cd46;if(_0xb4cd46===_0x36709e||_0xb4cd46[_0x4a4360(0x1f3)](_0x36709e+'/'))return _0xb4cd46;return _0xb4cd46?_0x36709e+'/'+_0xb4cd46:_0x36709e;}export function addFoldersToCreate(_0x41a058,_0xd257ab,_0x6aa773){const _0x3b4486=a119_0x520e5a;if(!_0x41a058)return;if(_0xd257ab[_0x3b4486(0x206)](_0x41a058))return;const _0x52b9f8=_0x41a058['split']('/');let _0x23a76c='';for(const _0x5a2744 of _0x52b9f8){_0x23a76c=_0x23a76c?_0x23a76c+'/'+_0x5a2744:_0x5a2744,!_0xd257ab[_0x3b4486(0x206)](_0x23a76c)&&_0x6aa773['add'](_0x23a76c);}}import*as a119_0x647c6f from'yaml';import{readFileSync}from'fs';import a119_0x2bd0fc from'path';import{isJourneyDef,parseYamlString as a119_0x5e7302,toYamlString as a119_0x191ce7,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x26df7c){const _0x18f801=a119_0x520e5a;if(Array[_0x18f801(0x22a)](_0x26df7c))return'['+_0x26df7c['map'](_0x33b42c=>stableStringify(_0x33b42c))['join'](',')+']';if(_0x26df7c&&typeof _0x26df7c===_0x18f801(0x225)){const _0x569051=_0x26df7c,_0x206f3a=Object[_0x18f801(0x1ea)](_0x569051)['sort'](),_0x66a5ea=_0x206f3a['map'](_0x447488=>'\x22'+_0x447488+'\x22:'+stableStringify(_0x569051[_0x447488]));return'{'+_0x66a5ea[_0x18f801(0x1c1)](',')+'}';}const _0x5c551a=JSON[_0x18f801(0x198)](_0x26df7c);return _0x5c551a===undefined?_0x18f801(0x1c2):_0x5c551a;}function activationSignature(_0x274c5b){const _0x289d06=a119_0x520e5a,_0x50795c={'connection':_0x274c5b[_0x289d06(0x174)],..._0x274c5b[_0x289d06(0x216)]!==undefined&&{'all_columns':_0x274c5b[_0x289d06(0x216)]},..._0x274c5b[_0x289d06(0x23a)]!==undefined&&{'columns':_0x274c5b[_0x289d06(0x23a)]},..._0x274c5b[_0x289d06(0x248)]!==undefined&&{'behavior':_0x274c5b['behavior']},..._0x274c5b['schedule']!==undefined&&{'schedule':_0x274c5b[_0x289d06(0x246)]},..._0x274c5b[_0x289d06(0x22d)]!==undefined&&{'notification':_0x274c5b[_0x289d06(0x22d)]},..._0x274c5b[_0x289d06(0x24a)]!==undefined&&{'connector_config':_0x274c5b[_0x289d06(0x24a)]},..._0x274c5b[_0x289d06(0x1bd)]!==undefined&&{'activation_template_id':_0x274c5b[_0x289d06(0x1bd)]}};return stableStringify(_0x50795c);}export async function prepareSegmentFiles(_0x2d624c,_0x1769f3,_0x176076,_0x32de00,_0x43f8cd){const _0x3101ad=a119_0x520e5a,{activationDefToCreateRequest:_0x512c47}=await import(_0x3101ad(0x19e)),_0x3f1ca5=[],_0x1420af=new Set();for(const {yamlConfig:_0x290da7,folderPath:_0x4ed6e1,sourcePath:_0x49cfd4}of _0x2d624c){const _0x3578cf=resolveTDFolderPath(_0x4ed6e1,_0x32de00,_0x43f8cd),_0x45e8c0=_0x3578cf+':'+_0x290da7[_0x3101ad(0x1d0)],_0x384861=_0x1769f3['segmentByFolderAndName']['get'](_0x45e8c0),_0x20fcfa=_0x384861?_0x1769f3['activationsBySegmentId'][_0x3101ad(0x207)](_0x384861['id'])||[]:[];addFoldersToCreate(_0x3578cf,_0x1769f3['folderPathToId'],_0x1420af);const _0x5639cf=calculateActivationActions(_0x290da7['activations']||[],_0x20fcfa,_0x1769f3[_0x3101ad(0x20c)],_0x1769f3[_0x3101ad(0x1f4)]);for(const _0x52d584 of _0x5639cf){(_0x52d584[_0x3101ad(0x191)]===_0x3101ad(0x217)||_0x52d584[_0x3101ad(0x191)]===_0x3101ad(0x19d))&&_0x52d584['yamlActivation']&&(_0x52d584['validatedRequest']=await _0x512c47(_0x52d584[_0x3101ad(0x208)],_0x176076));}const _0x2613af=calculateSegmentDiff(_0x290da7,_0x384861,_0x20fcfa,_0x1769f3['idToEmailMap'],_0x1769f3[_0x3101ad(0x1f4)]);_0x3f1ca5[_0x3101ad(0x21f)]({'relativePath':_0x290da7[_0x3101ad(0x1d0)],'absolutePath':_0x49cfd4,'yamlConfig':_0x290da7,'folderPath':_0x3578cf,'existingSegment':_0x384861,'existingActivations':_0x20fcfa,'isNew':_0x2613af[_0x3101ad(0x20e)],'hasChanges':_0x2613af[_0x3101ad(0x1cd)],'diff':_0x2613af['diff'],'activationActions':_0x5639cf});}return{'segmentFiles':_0x3f1ca5,'foldersToCreate':_0x1420af};}function a119_0x1fa5(){const _0x34c5eb=['journeyById','\x20(referenced\x20in\x20journey\x20','8923068KnJgqp','activation_template_id','segment_created','\x27...','utf-8','join','null','index','diff','folderPathToId','updateSegmentById','createdSegmentIds','kind','createdSegmentId','\x27\x20entry\x20criteria','SEGMENT_NOT_FOUND','JOURNEY_SYNTAX_ERROR','hasChanges','ACTIVATION_SYNTAX_ERROR','validatedRequest','name','NOT_FOUND','milestone','\x0a\x20\x20','absolutePath','Segment\x20not\x20found:\x20','embedded_segment_creating','includes','activationParams','):\x20','existingJourney','progress','activation_updating','updateActivation','logWarning','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','trim','Stage\x20\x27','SEGMENT_UPDATE_ERROR','attributes','Updating\x20activation\x20\x27','createActivation','2104835kRTywy','folder_creating','from','journey_updated','keys','goal','activation_creating','existingSegment','\x27\x20milestone','journeys','1071452EyJQAL','draft','segments','startsWith','connectionIdToNameMap','results','created','parentSegmentFolder','activationActions','size','Fetching\x20','existingActivation','length','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','entries','branches','125668CKEjRa','\x27\x20not\x20found\x20in\x20journey\x20\x27','nameToType','journeyActivationStepId','Created\x20folder\x20\x27','entry_criteria','has','get','yamlActivation','all','folderId','createJourneySegment','idToEmailMap','with','isNew','existingSegments','./journey-yaml.js','\x27\x20for\x20','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','journeyId','resolveSegment','all_columns','create','nameToId','folderPath','set','embedded_activation_creating','digest','../../utils/async.js','onProgress','push','\x20activation\x20\x27','waitCondition','segmentFolderId','Updated\x20segment\x20\x27','toString','object','segment_deleting','Creating\x20segment\x20\x27','steps','Failed\x20to\x20','isArray','\x20error(s)','localSegmentRules','notification','effectiveFolderId','360uZvynz','journeyStages','segment_deleted','JOURNEY_UPDATE_ERROR','logDeleted','sort','versionNumber','journeyBundleName','user','embedded_segment_created','withProgress','columns','segment_creating','filter','journeyBundlesByFolderAndName','entryCriteria','yamlConfig','updated','Activation','action','rule','\x27\x20exit\x20criteria','listSegments','schedule','parseDocument','behavior','flatMap','connector_config','logSuccess','split','activations','list','fetchJourney','deps','relative','__pending_','getJourney','Deleted\x20segment\x20\x27','description','replace','segmentNameToId','DecisionPoint',').\x20','INTERNAL','parse','3MfmUKX','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','map','Updated\x20activation\x20\x27','connection','Deleting\x20activation\x20\x27','\x20journey\x20from\x20file:\x20','journey_entry_criteria_','max','6FmuXDA','Activation\x20not\x20found:\x20','stages','Creating\x20activation\x20\x27','slice','state','activationContext','segmentId','Entry\x20criteria:\x20','sha1','Updated\x20journey\x20\x27','Created\x20segment\x20\x27','Updating\x20segment\x20\x27','activation_','Deleted\x20activation\x20\x27','add','2941390xQSekD','activationStepsById','WaitStep','embeddedSegmentNameToId','journey_updating','errors','deleteActivation','ACTIVATION_UPDATE_ERROR','type','getSegment','\x20segment\x20from\x20file:\x20','hex','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','activation_deleting','\x27\x20decision\x20point\x20branch\x20\x27','stringify','segment_updating','journey_created','relationships','values','update','./child-segment-yaml.js','toLowerCase','journeyActivationNameToId','Created\x20journey\x20\x27','find','embedded_activation_created','journey','folder','delete','unchanged','19746cfCDYP','resolveJourneyId','parentId','goal\x20criteria','item','getActivation','segment_updated','verbose','\x27\x20wait\x20condition','__pending_act_','entry','data','deleteSegment','stage\x20\x27','4109jRRJRR','rootFolderId','18flPMNl','segment'];a119_0x1fa5=function(){return _0x34c5eb;};return a119_0x1fa5();}export async function prepareJourneyFiles(_0x321410,_0x21f54f,_0xce092c,_0x8909bf){const _0x3daa0d=a119_0x520e5a,_0x10ddc0=[],_0x5c3dd4=new Set();for(const {yamlConfig:_0x5bde66,folderPath:_0x5d2fa8,sourcePath:_0x2a2def}of _0x321410){const _0x125ef2=resolveTDFolderPath(_0x5d2fa8,_0xce092c,_0x8909bf),_0xc08290=_0x125ef2+':'+_0x5bde66[_0x3daa0d(0x1d0)],_0x59f9c7=_0x21f54f[_0x3daa0d(0x23d)][_0x3daa0d(0x207)](_0xc08290);let _0x994df8,_0x2ba6f5;if(_0x59f9c7&&_0x59f9c7[_0x3daa0d(0x1fc)]>0x0){const _0x139193=buildLocalExpandedRuleMappings(_0x5bde66),{createYamlContext:_0x1cc482,prefetchJourneySegments:_0x239c75}=createPushYamlContextForBundle(_0x21f54f[_0x3daa0d(0x250)],_0x21f54f['parentId'],_0x21f54f[_0x3daa0d(0x20f)],_0x139193,_0x21f54f[_0x3daa0d(0x20c)],_0x21f54f[_0x3daa0d(0x1f4)],_0x21f54f[_0x3daa0d(0x18a)],_0x21f54f['journeyById']);await _0x239c75(_0x59f9c7[_0x3daa0d(0x25e)](_0xe31e01=>_0xe31e01['id']));const _0x51a291=hasMultipleVersions(_0x5bde66),_0x276400=async _0x4199ff=>{const _0x931236=_0x3daa0d,_0x5f1a88=_0x21f54f[_0x931236(0x1ba)]?.[_0x931236(0x207)](_0x4199ff);if(_0x5f1a88)return _0x5f1a88;return _0x21f54f[_0x931236(0x24f)]({'journeyId':_0x4199ff,'journeyName':_0x5bde66[_0x931236(0x1d0)],'isMultiVersion':_0x59f9c7['length']>0x1});};if(_0x51a291&&_0x59f9c7[_0x3daa0d(0x1fc)]>0x1){const _0x91b22=[];for(const _0x5ac0a3 of _0x59f9c7){const _0x3d8e90=_0x5ac0a3['versionNumber']||0x1;_0x21f54f['progress']?.[_0x3daa0d(0x19d)](_0x3daa0d(0x1fa)+_0x5bde66['name']+'\x20v'+_0x3d8e90);const _0x2e3aea=await _0x276400(_0x5ac0a3['id']),_0x3a51c1=_0x1cc482(_0x5ac0a3['id']),_0x2f96ce=await journeyResponseToDef(_0x2e3aea,_0x3a51c1);_0x91b22[_0x3daa0d(0x21f)]({'item':_0x5ac0a3,'yaml':_0x2f96ce});}const _0x127084=buildLocalRuleToNameMappingFromJourney(_0x5bde66);_0x2ba6f5=buildMergedJourneyDef(_0x91b22,_0x127084);const _0x472f44=Math[_0x3daa0d(0x178)](..._0x91b22[_0x3daa0d(0x25e)](_0x46b65e=>_0x46b65e[_0x3daa0d(0x1ac)][_0x3daa0d(0x235)]||0x0)),_0x5d888c=_0x59f9c7[_0x3daa0d(0x1a2)](_0x1d1e9d=>(_0x1d1e9d[_0x3daa0d(0x235)]||0x0)===_0x472f44);_0x5d888c&&(_0x21f54f[_0x3daa0d(0x1db)]?.[_0x3daa0d(0x19d)]('Fetching\x20'+_0x5bde66['name']+'\x20v'+_0x472f44),_0x994df8=await _0x276400(_0x5d888c['id']));}else{const _0xb68fd5=_0x59f9c7[_0x59f9c7[_0x3daa0d(0x1fc)]-0x1];_0x21f54f['progress']?.[_0x3daa0d(0x19d)](_0x3daa0d(0x1fa)+_0x5bde66[_0x3daa0d(0x1d0)]),_0x994df8=await _0x276400(_0xb68fd5['id']);const _0x167ce8=_0x1cc482(_0xb68fd5['id']),_0x51eefe=await journeyResponseToDef(_0x994df8,_0x167ce8),_0x2c9346=buildLocalRuleToNameMappingFromJourney(_0x5bde66);_0x2ba6f5=buildMergedJourneyDef([{'item':_0xb68fd5,'yaml':_0x51eefe}],_0x2c9346);}}addFoldersToCreate(_0x125ef2,_0x21f54f[_0x3daa0d(0x1c5)],_0x5c3dd4);const _0x3fcf19=calculateJourneyDiff(_0x5bde66,_0x2ba6f5);_0x10ddc0[_0x3daa0d(0x21f)]({'relativePath':_0x5bde66[_0x3daa0d(0x1d0)],'absolutePath':_0x2a2def,'yamlConfig':_0x5bde66,'folderPath':_0x125ef2,'existingJourney':_0x994df8,'isNew':_0x3fcf19[_0x3daa0d(0x20e)],'hasChanges':_0x3fcf19['hasChanges'],'diff':_0x3fcf19[_0x3daa0d(0x1c4)]});}return{'journeyFiles':_0x10ddc0,'foldersToCreate':_0x5c3dd4};}export function calculateActivationActions(_0xa718e0,_0x1df48b,_0x4dc3e4,_0x273423){const _0x51911b=a119_0x520e5a,_0x455d03=[],_0x5547ee=new Map();for(const _0x3985f9 of _0x1df48b){_0x5547ee[_0x51911b(0x21a)](_0x3985f9[_0x51911b(0x1d0)],_0x3985f9);}const _0x47097a=new Map();for(const _0x593255 of _0xa718e0){_0x47097a[_0x51911b(0x21a)](_0x593255[_0x51911b(0x1d0)],_0x593255);}for(const _0xd4370b of _0xa718e0){const _0x134eee=_0x5547ee['get'](_0xd4370b[_0x51911b(0x1d0)]);if(!_0x134eee)_0x455d03[_0x51911b(0x21f)]({'type':'create','name':_0xd4370b[_0x51911b(0x1d0)],'yamlActivation':_0xd4370b});else{const _0x4ea5da=activationResponseToDef(_0x134eee,_0x4dc3e4,_0x273423),_0x274ee8=a119_0x647c6f[_0x51911b(0x198)](_0x4ea5da),_0x3ba143=a119_0x647c6f['stringify'](_0xd4370b);_0x274ee8!==_0x3ba143&&_0x455d03[_0x51911b(0x21f)]({'type':_0x51911b(0x19d),'name':_0xd4370b[_0x51911b(0x1d0)],'yamlActivation':_0xd4370b,'existingActivation':_0x134eee});}}for(const _0x170baa of _0x1df48b){!_0x47097a[_0x51911b(0x206)](_0x170baa[_0x51911b(0x1d0)])&&_0x455d03[_0x51911b(0x21f)]({'type':_0x51911b(0x1a6),'name':_0x170baa[_0x51911b(0x1d0)],'existingActivation':_0x170baa});}return _0x455d03;}export function calculateSegmentDiff(_0x446ff1,_0x69491,_0x3b2ca7,_0xeb6e1b,_0x58c13f){const _0x2d922a=segmentToYamlString(_0x446ff1);if(_0x69491){const _0xb85a7d=segmentWithActivationsToYaml(_0x69491,_0x3b2ca7,undefined,_0xeb6e1b,_0x58c13f),_0x2eaab8=segmentToYamlString(_0xb85a7d),_0x4dd8f0=generateDiff(_0x2eaab8,_0x2d922a),_0x4199c3=hasChanges(_0x4dd8f0);return{'isNew':![],'hasChanges':_0x4199c3,'diff':_0x4199c3?formatDiffWithColors(_0x4dd8f0):undefined};}const _0x50dd45=generateDiff('',_0x2d922a);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x50dd45)};}export function calculateJourneyDiff(_0x1cebba,_0x55bf20){const _0x2c3688=normalizeJourneyDef(_0x1cebba,_0x1cebba),_0x1c16ba=a119_0x191ce7(_0x2c3688);if(_0x55bf20){const _0x5de59e=normalizeJourneyDef(_0x55bf20,_0x1cebba),_0x36c439=a119_0x191ce7(_0x5de59e),_0x10c491=generateDiff(_0x36c439,_0x1c16ba),_0xb8b470=hasChanges(_0x10c491);return{'isNew':![],'hasChanges':_0xb8b470,'diff':_0xb8b470?formatDiffWithColors(_0x10c491):undefined};}const _0x2d4ccd=generateDiff('',_0x1c16ba);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2d4ccd)};}export function findSegmentsToDelete(_0xa684c9,_0x3356d9,_0x16f650,_0x5bef0f,_0xe4a22f){const _0x19a45f=a119_0x520e5a,_0x22d467=new Set();for(const {yamlConfig:_0x21d646,folderPath:_0xf5aa6f}of _0x3356d9){_0x22d467['add'](_0xf5aa6f+':'+_0x21d646[_0x19a45f(0x1d0)]);}return _0xa684c9['filter'](_0xeb503d=>{const _0x1354c6=_0x19a45f,_0x3ec468=_0xeb503d[_0x1354c6(0x222)]?_0x16f650['get'](_0xeb503d[_0x1354c6(0x222)][_0x1354c6(0x224)]())||'':'',_0x98d7f9=_0x3ec468+':'+_0xeb503d[_0x1354c6(0x1d0)];if(_0x22d467[_0x1354c6(0x206)](_0x98d7f9))return![];if(_0xe4a22f)return _0x3ec468===_0x5bef0f||_0x3ec468['startsWith'](_0x5bef0f+'/');return!![];});}export function findJourneysToDelete(_0x3523b1,_0x248b00,_0xf01db6,_0x1d6933,_0xd1f3b5){const _0x5eed76=a119_0x520e5a,_0x3fc766=new Set();for(const {yamlConfig:_0x589efc,folderPath:_0x3743ca}of _0x248b00){_0x3fc766['add'](_0x3743ca+':'+_0x589efc['name']);}return _0x3523b1[_0x5eed76(0x23c)](_0x6f4be4=>{const _0x1ecd92=_0x5eed76,_0x512f15=_0x6f4be4[_0x1ecd92(0x20a)]?_0xf01db6[_0x1ecd92(0x207)](_0x6f4be4[_0x1ecd92(0x20a)])||'':'',_0x33e40b=_0x512f15+':'+_0x6f4be4[_0x1ecd92(0x236)];if(_0x3fc766[_0x1ecd92(0x206)](_0x33e40b))return![];if(_0xd1f3b5)return _0x512f15===_0x1d6933||_0x512f15[_0x1ecd92(0x1f3)](_0x1d6933+'/');return!![];});}export function buildSegmentLookupMap(_0x290c71,_0x56f9e2){const _0x3b7f2c=a119_0x520e5a,_0x17b835=new Map();for(const _0x11fd7d of _0x290c71){const _0x57eeff=_0x11fd7d[_0x3b7f2c(0x222)]?_0x56f9e2[_0x3b7f2c(0x207)](_0x11fd7d['segmentFolderId'][_0x3b7f2c(0x224)]())||'':'',_0x38085d=_0x57eeff+':'+_0x11fd7d[_0x3b7f2c(0x1d0)];_0x17b835[_0x3b7f2c(0x21a)](_0x38085d,_0x11fd7d);}return _0x17b835;}export function buildSegmentNameToIdMap(_0x5d0da3){const _0xc4e9ee=a119_0x520e5a,_0x48e012=new Map();for(const _0x48cdab of _0x5d0da3){_0x48e012[_0xc4e9ee(0x21a)](_0x48cdab[_0xc4e9ee(0x1d0)],_0x48cdab['id']);}return _0x48e012;}export function buildJourneyBundleLookupMap(_0x37b9c3,_0x11931f){const _0x432bd0=a119_0x520e5a,_0x15ae1c=new Map();for(const _0x3a1d60 of _0x37b9c3){const _0x25eb82=_0x3a1d60[_0x432bd0(0x20a)]?_0x11931f[_0x432bd0(0x207)](_0x3a1d60['folderId'])||'':'',_0x30066d=_0x25eb82+':'+_0x3a1d60[_0x432bd0(0x236)];!_0x15ae1c[_0x432bd0(0x206)](_0x30066d)&&_0x15ae1c[_0x432bd0(0x21a)](_0x30066d,[]),_0x15ae1c[_0x432bd0(0x207)](_0x30066d)[_0x432bd0(0x21f)](_0x3a1d60);}for(const _0x324cb9 of _0x15ae1c[_0x432bd0(0x19c)]()){_0x324cb9[_0x432bd0(0x234)]((_0x25dc5b,_0x5ef11b)=>(_0x25dc5b[_0x432bd0(0x235)]||0x0)-(_0x5ef11b[_0x432bd0(0x235)]||0x0));}return _0x15ae1c;}export function collectFoldersToCreate(_0x71c1ea,_0x47832d){const _0x367afa=a119_0x520e5a,_0x28b8c1=new Set();for(const _0x2d3ad7 of _0x71c1ea){if(!_0x2d3ad7)continue;if(_0x47832d[_0x367afa(0x206)](_0x2d3ad7))continue;const _0x22b5cb=_0x2d3ad7['split']('/');let _0xe2422e='';for(const _0x321001 of _0x22b5cb){_0xe2422e=_0xe2422e?_0xe2422e+'/'+_0x321001:_0x321001,!_0x47832d['has'](_0xe2422e)&&_0x28b8c1[_0x367afa(0x188)](_0xe2422e);}}return _0x28b8c1;}export function parseAndClassifyYamlFiles(_0x580b15,_0x4cffda,_0x4f1c6e){const _0x3fbc9c=a119_0x520e5a,_0x29aeae=[],_0x27dbef=[];for(const _0x2844ad of _0x580b15){const _0x4e6c15=a119_0x2bd0fc[_0x3fbc9c(0x251)](_0x4cffda,a119_0x2bd0fc['dirname'](_0x2844ad)),_0x20d71f=_0x4e6c15==='.'?'':_0x4e6c15,_0x245a29=readFileSync(_0x2844ad,_0x3fbc9c(0x1c0)),_0x169bbd=a119_0x647c6f[_0x3fbc9c(0x25b)](_0x245a29);if(isJourneyDef(_0x169bbd)){const _0xc268ca=a119_0x5e7302(_0x245a29);_0x27dbef[_0x3fbc9c(0x21f)]({'yamlConfig':_0xc268ca,'folderPath':_0x20d71f,'sourcePath':_0x2844ad});}else{if(!_0x4f1c6e?.['skipSegments']){const _0x145ecd=parseSegmentYamlFile(_0x245a29),_0x1c56e1=normalizeChildSegmentYaml(_0x145ecd);_0x29aeae[_0x3fbc9c(0x21f)]({'yamlConfig':_0x1c56e1,'folderPath':_0x20d71f,'sourcePath':_0x2844ad});}}}return{'segments':_0x29aeae,'journeys':_0x27dbef};}export function validateParsedFiles(_0xfdf703,_0x21dc71){const _0x5a6b58=a119_0x520e5a,_0x309ad5=[];for(const {yamlConfig:_0x467600,sourcePath:_0x3b2754}of _0xfdf703['segments']){const _0x3cf3d9=readFileSync(_0x3b2754,'utf-8'),_0x1969ba=a119_0x647c6f[_0x5a6b58(0x247)](_0x3cf3d9),_0x22ace3=validateSegmentDef(_0x467600,{'source':_0x3cf3d9,'document':_0x1969ba});if(!_0x22ace3['valid']){const _0x11812c=a119_0x2bd0fc[_0x5a6b58(0x251)](_0x21dc71,_0x3b2754);_0x309ad5['push']({'filePath':_0x11812c,'source':_0x3cf3d9,'result':_0x22ace3,'isJourney':![]});}}for(const {yamlConfig:_0x3e87bd,sourcePath:_0x27e26d}of _0xfdf703['journeys']){const _0x16f6b2=readFileSync(_0x27e26d,'utf-8'),_0x689c1=a119_0x647c6f[_0x5a6b58(0x247)](_0x16f6b2),_0x181012=validateJourneyDef(_0x3e87bd,{'source':_0x16f6b2,'document':_0x689c1});if(!_0x181012['valid']){const _0x594433=a119_0x2bd0fc[_0x5a6b58(0x251)](_0x21dc71,_0x27e26d);_0x309ad5[_0x5a6b58(0x21f)]({'filePath':_0x594433,'source':_0x16f6b2,'result':_0x181012,'isJourney':!![]});}}return _0x309ad5;}function a119_0x4408(_0x12bb2e,_0x4a1cbc){_0x12bb2e=_0x12bb2e-0x173;const _0x1fa502=a119_0x1fa5();let _0x4408d1=_0x1fa502[_0x12bb2e];return _0x4408d1;}export function formatValidationErrors(_0x4841c6){const _0x2d842d=a119_0x520e5a,_0x401616=[];for(const {filePath:_0x3708db,source:_0x19b885,result:_0x1decc0,isJourney:_0x48c23e}of _0x4841c6){const _0x2e3cc1=_0x48c23e?_0x2d842d(0x1a4):_0x2d842d(0x1b9);_0x401616[_0x2d842d(0x21f)]('\x0a'+_0x3708db+'\x20('+_0x2e3cc1+_0x2d842d(0x1d9)+_0x1decc0[_0x2d842d(0x18e)][_0x2d842d(0x1fc)]+_0x2d842d(0x22b)),_0x401616[_0x2d842d(0x21f)](formatValidationResult(_0x1decc0,_0x19b885,_0x3708db));}return _0x401616[_0x2d842d(0x1c1)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x3ab6c6){const _0x541f73=a119_0x520e5a,_0x318994=new Set(),_0x95a38e=new Map(),_0x22282a=collectSegmentUsageCounts(_0x3ab6c6);if(_0x3ab6c6[_0x541f73(0x1f2)])for(const [_0x3e89fe,_0x4f09c6]of Object[_0x541f73(0x1fe)](_0x3ab6c6['segments'])){_0x318994['add'](_0x3e89fe);if(_0x4f09c6['rule']){const _0x35158f=yamlRuleToApi(_0x4f09c6[_0x541f73(0x243)]),_0x3cd716=apiRuleToYaml(_0x35158f);_0x95a38e[_0x541f73(0x21a)](_0x3e89fe,_0x3cd716);}}const _0x57e888=new Map();let _0x4f1d91=0x0;for(const [_0x3bd128,_0x23e34f]of _0x95a38e){const _0x3eab12=serializeExpandedRule(_0x23e34f,_0x95a38e),_0x2895fe=_0x57e888[_0x541f73(0x207)](_0x3eab12)||[];_0x2895fe[_0x541f73(0x21f)]({'name':_0x3bd128,'index':_0x4f1d91}),_0x57e888[_0x541f73(0x21a)](_0x3eab12,_0x2895fe),_0x4f1d91++;}const _0x57569d=new Map();for(const [_0x26250d,_0x536711]of _0x57e888){const _0x500e01=_0x536711[_0x541f73(0x17d)]()[_0x541f73(0x234)]((_0x4580f9,_0x2075a6)=>{const _0x56fd53=_0x541f73,_0x218a00=_0x22282a[_0x56fd53(0x207)](_0x4580f9['name'])||0x0,_0x263f69=_0x22282a[_0x56fd53(0x207)](_0x2075a6[_0x56fd53(0x1d0)])||0x0;if(_0x218a00!==_0x263f69)return _0x263f69-_0x218a00;return _0x4580f9['index']-_0x2075a6[_0x56fd53(0x1c3)];})[_0x541f73(0x25e)](_0x6f1ff=>_0x6f1ff[_0x541f73(0x1d0)]),_0x5cd3f2=[];for(const _0x24b874 of _0x500e01){const _0x4f4897=_0x22282a[_0x541f73(0x207)](_0x24b874)||0x0,_0x2c5771=Math[_0x541f73(0x178)](_0x4f4897,0x1);for(let _0x3de18c=0x0;_0x3de18c<_0x2c5771;_0x3de18c++){_0x5cd3f2[_0x541f73(0x21f)](_0x24b874);}}_0x57569d['set'](_0x26250d,_0x5cd3f2);}return{'existingLocalSegmentNames':_0x318994,'localSegmentRules':_0x95a38e,'localExpandedRuleToNames':_0x57569d};}async function buildServerSegmentRuleMap(_0x3943e0,_0x2f3a3c,_0x19753f,_0x4c9568){const _0x1151fb=new Map(),_0x39f15b=new Set(),_0x1bea8c=async _0xd99575=>{const _0xac174d=a119_0x4408;if(_0x39f15b[_0xac174d(0x206)](_0xd99575))return;_0x39f15b[_0xac174d(0x188)](_0xd99575);let _0x292949=_0x19753f[_0xac174d(0x1a2)](_0x49924d=>_0x49924d['id']===_0xd99575);if(!_0x292949)try{_0x292949=await _0x3943e0[_0xac174d(0x1b9)][_0xac174d(0x192)](_0x2f3a3c,_0xd99575);}catch{return;}if(!_0x292949?.[_0xac174d(0x243)])return;const _0x371d07=apiRuleToYaml(_0x292949[_0xac174d(0x243)]);_0x1151fb[_0xac174d(0x21a)](_0xd99575,_0x371d07);const _0x2bd7c9=collectSegmentRefsFromRule(_0x371d07);for(const _0x5ac26b of _0x2bd7c9){await _0x1bea8c(_0x5ac26b);}};for(const _0x584f13 of _0x4c9568){await _0x1bea8c(_0x584f13);}return _0x1151fb;}export function createSegmentIdResolver(_0x21c098,_0x2ce91c){return async _0xec37fc=>{const _0x505acc=a119_0x4408,_0x14c53e=_0x21c098[_0x505acc(0x207)](_0xec37fc);if(!_0x14c53e)throw new SDKError(ErrorCode[_0x505acc(0x1cb)],_0x505acc(0x1d5)+_0xec37fc+_0x505acc(0x1df)+_0x2ce91c+'\x27)');return _0x14c53e;};}export function extractRootFolderId(_0x1f77b4){const _0x4764a4=a119_0x520e5a;return _0x1f77b4['relationships']?.[_0x4764a4(0x1f7)]?.[_0x4764a4(0x1b3)]?.['id']||_0x1f77b4[_0x4764a4(0x19b)]?.['parentFolder']?.[_0x4764a4(0x1b3)]?.['id'];}export function buildConnectionMaps(_0x180e33){const _0x412b29=a119_0x520e5a,_0x19a2b7=new Map(),_0x2b47dd=new Map(),_0x27b859=new Map();for(const _0x5263ce of _0x180e33){_0x19a2b7[_0x412b29(0x21a)](_0x5263ce['name'],parseInt(_0x5263ce['id'],0xa)),_0x2b47dd['set'](_0x5263ce['id'],_0x5263ce[_0x412b29(0x1d0)]),_0x27b859[_0x412b29(0x21a)](_0x5263ce[_0x412b29(0x1d0)],_0x5263ce['type']);}return{'nameToId':_0x19a2b7,'idToName':_0x2b47dd,'nameToType':_0x27b859};}export function calculatePushStats(_0x3dcac4,_0x82853f,_0x4a3f6b,_0x3bb3e6,_0x1fac96,_0x2e1bad,_0x16c962){const _0x4311e5=a119_0x520e5a,_0x4a476f=_0x3dcac4[_0x4311e5(0x23c)](_0x5bdb89=>_0x5bdb89['isNew']),_0xdcee96=_0x3dcac4[_0x4311e5(0x23c)](_0xf3233a=>!_0xf3233a[_0x4311e5(0x20e)]&&_0xf3233a[_0x4311e5(0x1cd)]),_0xade430=_0x3dcac4[_0x4311e5(0x23c)](_0x13643e=>!_0x13643e[_0x4311e5(0x20e)]&&!_0x13643e[_0x4311e5(0x1cd)]),_0x13ec64=_0x2e1bad?_0x3bb3e6:[],_0x6fb229=_0x82853f[_0x4311e5(0x23c)](_0x1d5773=>_0x1d5773['isNew']),_0x2d770e=_0x82853f['filter'](_0x2744bc=>!_0x2744bc[_0x4311e5(0x20e)]&&_0x2744bc['hasChanges']),_0x265635=_0x82853f['filter'](_0x9fa2f1=>!_0x9fa2f1[_0x4311e5(0x20e)]&&!_0x9fa2f1['hasChanges']),_0xea83ea=_0x2e1bad?_0x1fac96:[],_0x2a0679=_0x3dcac4[_0x4311e5(0x249)](_0x4abb48=>_0x4abb48['activationActions']),_0x3277fd=_0x2a0679[_0x4311e5(0x23c)](_0x2f3979=>_0x2f3979[_0x4311e5(0x191)]===_0x4311e5(0x217)),_0x508159=_0x2a0679['filter'](_0x291b01=>_0x291b01[_0x4311e5(0x191)]==='update'),_0x1b8de8=_0x2a0679[_0x4311e5(0x23c)](_0x4908df=>_0x4908df[_0x4311e5(0x191)]===_0x4311e5(0x1a6)),_0x396260=Array[_0x4311e5(0x1e8)](_0x4a3f6b)['sort'](),_0x2c0395=_0x16c962?![]:_0x4a476f[_0x4311e5(0x1fc)]>0x0||_0xdcee96[_0x4311e5(0x1fc)]>0x0||_0x13ec64[_0x4311e5(0x1fc)]>0x0,_0x5f1d91=_0x6fb229[_0x4311e5(0x1fc)]>0x0||_0x2d770e['length']>0x0||_0xea83ea['length']>0x0,_0x3d31b1=_0x16c962?![]:_0x2a0679[_0x4311e5(0x1fc)]>0x0,_0x5cb700=_0x396260['length']>0x0;return{'segments':{'new':_0x4a476f,'changed':_0xdcee96,'unchanged':_0xade430,'toDelete':_0x13ec64},'journeys':{'new':_0x6fb229,'changed':_0x2d770e,'unchanged':_0x265635,'toDelete':_0xea83ea},'activations':{'all':_0x2a0679,'toCreate':_0x3277fd,'toUpdate':_0x508159,'toDelete':_0x1b8de8},'folders':{'toCreate':_0x396260},'counts':{'segments':{'new':_0x4a476f[_0x4311e5(0x1fc)],'changed':_0xdcee96[_0x4311e5(0x1fc)],'unchanged':_0xade430[_0x4311e5(0x1fc)],'toDelete':_0x13ec64[_0x4311e5(0x1fc)]},'journeys':{'new':_0x6fb229['length'],'changed':_0x2d770e['length'],'unchanged':_0x265635[_0x4311e5(0x1fc)],'toDelete':_0xea83ea[_0x4311e5(0x1fc)]},'activations':{'create':_0x3277fd[_0x4311e5(0x1fc)],'update':_0x508159['length'],'delete':_0x1b8de8[_0x4311e5(0x1fc)]},'folders':_0x396260['length']},'hasChanges':_0x2c0395||_0x5f1d91||_0x3d31b1||_0x5cb700};}export async function buildPushExecutionContext(_0x37bc81,_0xc124e6,_0x5afaa3,_0x37289c,_0x33182f,_0x59d4e4){const _0x349570=a119_0x520e5a,_0x580c7f=extractRootFolderId(_0x5afaa3),{pathToId:_0x502baf,idToPath:_0x11063e}=buildFolderMaps(_0x33182f),_0x24299a=buildSegmentNameToIdMap(_0x37289c),_0x1e6d1d=new Map(),{batchAsync:_0x2700a7}=await import(_0x349570(0x21d)),[_0x2f0326,_0xc0aac2]=await Promise[_0x349570(0x209)]([_0x37bc81[_0x349570(0x237)]['buildUserMaps'](),_0x37bc81['connection'][_0x349570(0x24e)](),((async()=>{const _0x32933f=_0x349570;!_0x59d4e4&&_0x37289c[_0x32933f(0x1fc)]>0x0&&await _0x2700a7(_0x37289c,async _0x4fb5d7=>{const _0x55d20f=await _0x37bc81['segment']['listActivations'](_0xc124e6,_0x4fb5d7['id']);_0x1e6d1d['set'](_0x4fb5d7['id'],_0x55d20f);});})())]),{emailToId:_0x4e2b50,idToEmail:_0x2be5c5}=_0x2f0326,_0x10596e=buildConnectionMaps(_0xc0aac2);return{'rootFolderId':_0x580c7f,'folderPathToId':_0x502baf,'folderIdToPath':_0x11063e,'segmentNameToId':_0x24299a,'activationsBySegmentId':_0x1e6d1d,'emailToIdMap':_0x4e2b50,'idToEmailMap':_0x2be5c5,'connectionNameToIdMap':_0x10596e[_0x349570(0x218)],'connectionIdToNameMap':_0x10596e['idToName'],'connectionNameToTypeMap':_0x10596e[_0x349570(0x202)]};}export function createPushYamlContextForBundle(_0x3ed63a,_0x4f2c45,_0x2c955c,_0x58695f,_0x97bafe,_0xb27870,_0xcadf54,_0x1662c0){const {existingLocalSegmentNames:_0x4ed813,localExpandedRuleToNames:_0x1032b8}=_0x58695f,_0x3f4685=new Set(),_0x4c2141=new Map(),_0x59722b=new Map(),_0x5e5185=new Map(),_0x543ec3=createJumpTargetCache(),_0x545d94=new Map(),_0x1cf20f=new Map(),_0x1e47ab=new Set();let _0x510f00;const _0x2de79f=_0x25a713=>{const _0x1d35f1={'resolveSegment':async _0x51276e=>{const _0x47ab12=a119_0x4408,_0xfb97ae=_0x5e5185[_0x47ab12(0x207)](_0x51276e);if(_0xfb97ae!==undefined)return{'name':_0xfb97ae,'isJourneyLocal':!![]};try{let _0xa130fe=_0x2c955c[_0x47ab12(0x1a2)](_0x4f8d76=>_0x4f8d76['id']===_0x51276e);!_0xa130fe&&(_0xa130fe=await _0x3ed63a[_0x47ab12(0x1b9)]['getSegment'](_0x4f2c45,_0x51276e));const _0x163ff1=generateJourneyLocalName(_0xa130fe[_0x47ab12(0x1d0)]),_0x28b1b2=_0xa130fe[_0x47ab12(0x1c8)]===SEGMENT_KIND_JOURNEY&&_0x163ff1!==undefined;let _0x359d22=_0xa130fe[_0x47ab12(0x1d0)],_0x144ab5;if(_0x28b1b2&&_0xa130fe['rule']){const _0x230245=apiRuleToYaml(_0xa130fe[_0x47ab12(0x243)]);_0x1cf20f['set'](_0x51276e,_0x230245);const _0x5abf33=async _0x4c209c=>{const _0x20c979=_0x47ab12,_0x2bb868=collectSegmentRefsFromRule(_0x4c209c);for(const _0x38ee77 of _0x2bb868){if(!_0x1cf20f[_0x20c979(0x206)](_0x38ee77))try{const _0x3760d8=await _0x3ed63a[_0x20c979(0x1b9)]['getSegment'](_0x4f2c45,_0x38ee77);if(_0x3760d8?.[_0x20c979(0x243)]){const _0x679669=apiRuleToYaml(_0x3760d8[_0x20c979(0x243)]);_0x1cf20f['set'](_0x38ee77,_0x679669),await _0x5abf33(_0x679669);}}catch{}}};await _0x5abf33(_0x230245);const _0x2b04cc=serializeExpandedRule(_0x230245,_0x1cf20f),_0x3b4697=_0x1032b8['get'](_0x2b04cc);if(_0x3b4697&&_0x3b4697[_0x47ab12(0x1fc)]>0x0){const _0xfe22bf=_0x4c2141['get'](_0x2b04cc)||0x0,_0x404825=_0x3b4697[_0xfe22bf]||_0x3b4697[_0x3b4697[_0x47ab12(0x1fc)]-0x1];_0x4c2141[_0x47ab12(0x21a)](_0x2b04cc,_0xfe22bf+0x1),_0x359d22=_0x404825,_0x3f4685[_0x47ab12(0x188)](_0x359d22),_0x5e5185[_0x47ab12(0x21a)](_0x51276e,_0x359d22);const _0x573f3e=await resolveRuleSegmentRefs(_0x230245,async _0x31a1f5=>{const _0x27ffa0=_0x47ab12,_0x5aef66=_0x5e5185['get'](_0x31a1f5);if(_0x5aef66)return _0x5aef66;const _0x1ae8a6=await _0x510f00['resolveSegment'](_0x31a1f5);return _0x1ae8a6[_0x27ffa0(0x1d0)];});_0x144ab5={'description':_0xa130fe['description'],'rule':_0x573f3e};}else{const _0x4bedc7=_0x545d94[_0x47ab12(0x207)](_0x2b04cc);if(_0x4bedc7)_0x359d22=_0x4bedc7,_0x5e5185[_0x47ab12(0x21a)](_0x51276e,_0x359d22);else{if(_0x163ff1){let _0x2f9ba4=_0x163ff1,_0x48245e=0x2;while(_0x3f4685[_0x47ab12(0x206)](_0x2f9ba4)||_0x4ed813[_0x47ab12(0x206)](_0x2f9ba4)){_0x2f9ba4=_0x163ff1+'_'+_0x48245e,_0x48245e++;}_0x3f4685[_0x47ab12(0x188)](_0x2f9ba4),_0x359d22=_0x2f9ba4;}_0x5e5185[_0x47ab12(0x21a)](_0x51276e,_0x359d22),_0x545d94[_0x47ab12(0x21a)](_0x2b04cc,_0x359d22);const _0xd84bf1=await resolveRuleSegmentRefs(_0x230245,async _0x27094d=>{const _0x93f7ef=_0x47ab12,_0x5f9234=_0x5e5185[_0x93f7ef(0x207)](_0x27094d);if(_0x5f9234)return _0x5f9234;const _0x4b35c2=await _0x510f00[_0x93f7ef(0x215)](_0x27094d);return _0x4b35c2['name'];});_0x144ab5={'description':_0xa130fe['description'],'rule':_0xd84bf1};}}}return{'name':_0x359d22,'isJourneyLocal':_0x28b1b2,'definition':_0x144ab5};}catch{return{'name':_0x51276e,'isJourneyLocal':![]};}},'resolveActivation':async _0x5967de=>{const _0x5608f3=a119_0x4408,_0x45cf11=_0x59722b[_0x5608f3(0x207)](_0x5967de);if(_0x45cf11!==undefined)return{'name':_0x45cf11,'isJourneyLocal':!![]};try{let _0x5376c3=_0xcadf54?.[_0x5608f3(0x207)](_0x5967de);!_0x5376c3&&(_0x5376c3=await _0x3ed63a[_0x5608f3(0x1a4)][_0x5608f3(0x1ad)](_0x25a713,_0x5967de));const _0x1324ac=_0x5376c3[_0x5608f3(0x1e3)][_0x5608f3(0x1d8)][_0x5608f3(0x1d0)]||_0x5967de,_0x242d78=sanitizeYamlKey(_0x1324ac)||_0x5608f3(0x186)+_0x5967de,_0x3e851b=_0x242d78;_0x59722b[_0x5608f3(0x21a)](_0x5967de,_0x3e851b);const _0x4f85c0=journeyActivationStepToYaml(_0x5376c3,_0x97bafe,_0xb27870);return{'name':_0x3e851b,'isJourneyLocal':!![],'definition':_0x4f85c0};}catch{return{'name':_0x5967de,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x58c0ca,_0x9c9dc)=>resolveJumpTarget(_0x58c0ca,_0x9c9dc,_0x543ec3,async _0x548186=>{const _0x2eef4b=a119_0x4408,_0x13b0e7=_0x1662c0?.[_0x2eef4b(0x207)](_0x548186);if(_0x13b0e7)return _0x13b0e7;return _0x3ed63a[_0x2eef4b(0x1a4)][_0x2eef4b(0x253)](_0x548186);})};return _0x510f00=_0x1d35f1,_0x1d35f1;},_0x50583b=async _0x2ba316=>{const _0x146e9a=a119_0x4408,{collectSegmentIdsFromJourneyApi:_0x2b3966}=await import(_0x146e9a(0x210)),{batchAsync:_0x612c2a}=await import(_0x146e9a(0x21d)),_0x245a2e=new Set();for(const _0x859c55 of _0x2ba316){let _0x3bdb67=_0x1662c0?.[_0x146e9a(0x207)](_0x859c55);!_0x3bdb67&&(_0x3bdb67=await _0x3ed63a[_0x146e9a(0x1a4)][_0x146e9a(0x253)](_0x859c55));const _0x287cb9=_0x2b3966(_0x3bdb67);for(const _0x2d68d5 of _0x287cb9){_0x245a2e[_0x146e9a(0x188)](_0x2d68d5);}}let _0x2cbe16=Array[_0x146e9a(0x1e8)](_0x245a2e);while(_0x2cbe16['length']>0x0){const _0x598adb=_0x2cbe16['filter'](_0x5a35f4=>!_0x1e47ab['has'](_0x5a35f4));if(_0x598adb['length']===0x0)break;const _0x58f6cd=await _0x612c2a(_0x598adb,async _0x5ba3fc=>{const _0x1fd829=_0x146e9a;_0x1e47ab[_0x1fd829(0x188)](_0x5ba3fc);let _0x2a92af=_0x2c955c[_0x1fd829(0x1a2)](_0x29b4b4=>_0x29b4b4['id']===_0x5ba3fc);if(!_0x2a92af)try{_0x2a92af=await _0x3ed63a[_0x1fd829(0x1b9)][_0x1fd829(0x192)](_0x4f2c45,_0x5ba3fc);}catch{return null;}return{'segmentId':_0x5ba3fc,'segment':_0x2a92af};},0xa),_0x549fc9=new Set();for(const _0x2429c4 of _0x58f6cd){if(!_0x2429c4?.[_0x146e9a(0x1b9)]?.[_0x146e9a(0x243)])continue;const _0x151a77=apiRuleToYaml(_0x2429c4['segment']['rule']);_0x1cf20f[_0x146e9a(0x21a)](_0x2429c4[_0x146e9a(0x180)],_0x151a77);const _0x1408ca=collectSegmentRefsFromRule(_0x151a77);for(const _0x5a801f of _0x1408ca){!_0x1e47ab['has'](_0x5a801f)&&_0x549fc9['add'](_0x5a801f);}}_0x2cbe16=Array[_0x146e9a(0x1e8)](_0x549fc9);}};return{'createYamlContext':_0x2de79f,'prefetchJourneySegments':_0x50583b};}export async function executePushSegments(_0x29800b,_0x5c072b,_0x2c5e6a,_0x4c208c,_0xb14e28){const _0x407ada=a119_0x520e5a,{segmentDefToCreateRequest:_0x424bd1,segmentDefToUpdateRequest:_0x3c53f9}=await import('./child-segment-yaml.js'),_0x1500e7=_0x2c5e6a['folderPathToId'],_0x3db7a1=0x5,_0x4084e7=async _0x46ebec=>{const _0x33d0cb=a119_0x4408,_0x43db4e=_0x46ebec[_0x33d0cb(0x219)]?_0x1500e7[_0x33d0cb(0x207)](_0x46ebec['folderPath']):undefined;let _0x32ae5e;const _0x168a7b={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x46ebec['isNew']){_0xb14e28['onProgress']?.({'type':_0x33d0cb(0x23b),'name':_0x46ebec[_0x33d0cb(0x23f)][_0x33d0cb(0x1d0)]});const _0x1c9b0d=_0x424bd1(_0x46ebec[_0x33d0cb(0x23f)],_0x43db4e),_0x8b94ad=await _0xb14e28[_0x33d0cb(0x239)](_0x33d0cb(0x227)+_0x46ebec[_0x33d0cb(0x23f)]['name']+_0x33d0cb(0x1bf),()=>_0x29800b[_0x33d0cb(0x1b9)]['createSegment'](_0x4c208c[_0x33d0cb(0x1aa)],_0x1c9b0d));_0x32ae5e=_0x8b94ad[_0x33d0cb(0x1b3)]['id'],_0x168a7b[_0x33d0cb(0x1c9)]={'name':_0x46ebec[_0x33d0cb(0x23f)]['name'],'id':_0x32ae5e},_0xb14e28[_0x33d0cb(0x21e)]?.({'type':_0x33d0cb(0x1be),'name':_0x46ebec[_0x33d0cb(0x23f)][_0x33d0cb(0x1d0)],'segmentId':_0x32ae5e}),_0xb14e28[_0x33d0cb(0x24b)]?.(_0x33d0cb(0x184)+_0x46ebec[_0x33d0cb(0x23f)][_0x33d0cb(0x1d0)]+'\x27'),_0x168a7b[_0x33d0cb(0x1f6)]=0x1;}else{if(_0x46ebec[_0x33d0cb(0x1cd)]){_0xb14e28[_0x33d0cb(0x21e)]?.({'type':_0x33d0cb(0x199),'name':_0x46ebec[_0x33d0cb(0x23f)]['name']});const _0x3e1ff3=_0x3c53f9(_0x46ebec[_0x33d0cb(0x23f)]);_0x43db4e!==_0x46ebec[_0x33d0cb(0x1ed)]?.[_0x33d0cb(0x222)]&&(_0x3e1ff3[_0x33d0cb(0x222)]=_0x43db4e?parseInt(_0x43db4e,0xa):undefined),await _0xb14e28[_0x33d0cb(0x239)](_0x33d0cb(0x185)+_0x46ebec[_0x33d0cb(0x23f)][_0x33d0cb(0x1d0)]+_0x33d0cb(0x1bf),()=>_0x29800b['segment'][_0x33d0cb(0x1c6)](_0x4c208c[_0x33d0cb(0x1aa)],_0x46ebec[_0x33d0cb(0x1ed)]['id'],_0x3e1ff3)),_0x32ae5e=_0x46ebec['existingSegment']['id'],_0xb14e28[_0x33d0cb(0x21e)]?.({'type':_0x33d0cb(0x1ae),'name':_0x46ebec['yamlConfig'][_0x33d0cb(0x1d0)]}),_0xb14e28[_0x33d0cb(0x24b)]?.(_0x33d0cb(0x223)+_0x46ebec[_0x33d0cb(0x23f)][_0x33d0cb(0x1d0)]+'\x27'),_0x168a7b['updated']=0x1;}else _0x32ae5e=_0x46ebec[_0x33d0cb(0x1ed)]['id'];}}catch(_0x5d2cd8){const _0x56ae78=isHttp400Error(_0x5d2cd8),_0xe59570=_0x56ae78?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x33d0cb(0x1e2)],_0x47e9da=getErrorMessage(_0x5d2cd8);throw new SDKError(_0xe59570,_0x33d0cb(0x229)+(_0x46ebec[_0x33d0cb(0x20e)]?_0x33d0cb(0x217):'update')+_0x33d0cb(0x193)+_0x46ebec[_0x33d0cb(0x1d4)]+'\x0a\x20\x20'+_0x47e9da,_0x5d2cd8);}try{const _0x548e2d=await syncActivationsForSegment(_0x29800b,_0x4c208c[_0x33d0cb(0x1aa)],_0x32ae5e,_0x46ebec['yamlConfig'][_0x33d0cb(0x1d0)],_0x46ebec[_0x33d0cb(0x1f8)],_0xb14e28,_0x46ebec[_0x33d0cb(0x1d4)]);_0x168a7b[_0x33d0cb(0x24d)]=_0x548e2d;}catch(_0x5200f6){if(_0x5200f6 instanceof SDKError)throw _0x5200f6;throw new SDKError(ErrorCode[_0x33d0cb(0x190)],_0x33d0cb(0x1fd)+_0x46ebec['yamlConfig'][_0x33d0cb(0x1d0)]+'\x27\x20from\x20file:\x20'+_0x46ebec['absolutePath']+_0x33d0cb(0x1d3)+getErrorMessage(_0x5200f6),_0x5200f6);}return _0x168a7b;},_0x599409=await batchAsync(_0x5c072b,_0x4084e7,_0x3db7a1),_0x2b2e85={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5912d2 of _0x599409){_0x2b2e85[_0x407ada(0x1f6)]+=_0x5912d2[_0x407ada(0x1f6)],_0x2b2e85['updated']+=_0x5912d2[_0x407ada(0x240)],_0x5912d2[_0x407ada(0x1c9)]&&_0x2b2e85[_0x407ada(0x1c7)][_0x407ada(0x21a)](_0x5912d2['createdSegmentId'][_0x407ada(0x1d0)],_0x5912d2[_0x407ada(0x1c9)]['id']),_0x2b2e85[_0x407ada(0x24d)][_0x407ada(0x1f6)]+=_0x5912d2[_0x407ada(0x24d)][_0x407ada(0x1f6)],_0x2b2e85[_0x407ada(0x24d)]['updated']+=_0x5912d2['activations'][_0x407ada(0x240)],_0x2b2e85[_0x407ada(0x24d)]['deleted']+=_0x5912d2[_0x407ada(0x24d)]['deleted'];}return _0x2b2e85;}async function syncActivationsForSegment(_0x54e0e9,_0x95264a,_0x5a35cb,_0x2fb42e,_0x4ea1b4,_0x277da5,_0x38445d){const _0xe07080=a119_0x520e5a,_0x51fe36={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1118e4 of _0x4ea1b4){try{if(_0x1118e4[_0xe07080(0x191)]===_0xe07080(0x217)&&_0x1118e4[_0xe07080(0x1cf)])_0x277da5[_0xe07080(0x21e)]?.({'type':_0xe07080(0x1ec),'segmentName':_0x2fb42e,'activationName':_0x1118e4[_0xe07080(0x1d0)]}),await _0x277da5[_0xe07080(0x239)](_0xe07080(0x17c)+_0x1118e4[_0xe07080(0x1d0)]+_0xe07080(0x1bf),()=>_0x54e0e9[_0xe07080(0x1b9)][_0xe07080(0x1e5)](_0x95264a,_0x5a35cb,_0x1118e4[_0xe07080(0x1cf)])),_0x277da5[_0xe07080(0x21e)]?.({'type':'activation_created','segmentName':_0x2fb42e,'activationName':_0x1118e4[_0xe07080(0x1d0)]}),_0x277da5[_0xe07080(0x24b)]?.('Created\x20activation\x20\x27'+_0x1118e4['name']+'\x27'),_0x51fe36['created']++;else{if(_0x1118e4['type']===_0xe07080(0x19d)&&_0x1118e4[_0xe07080(0x1cf)]&&_0x1118e4[_0xe07080(0x1fb)])_0x277da5['onProgress']?.({'type':_0xe07080(0x1dc),'segmentName':_0x2fb42e,'activationName':_0x1118e4[_0xe07080(0x1d0)]}),await _0x277da5['withProgress'](_0xe07080(0x1e4)+_0x1118e4[_0xe07080(0x1d0)]+_0xe07080(0x1bf),()=>_0x54e0e9[_0xe07080(0x1b9)][_0xe07080(0x1dd)](_0x95264a,_0x5a35cb,_0x1118e4[_0xe07080(0x1fb)]['id'],_0x1118e4[_0xe07080(0x1cf)])),_0x277da5[_0xe07080(0x21e)]?.({'type':'activation_updated','segmentName':_0x2fb42e,'activationName':_0x1118e4[_0xe07080(0x1d0)]}),_0x277da5['logSuccess']?.(_0xe07080(0x173)+_0x1118e4[_0xe07080(0x1d0)]+'\x27'),_0x51fe36[_0xe07080(0x240)]++;else _0x1118e4[_0xe07080(0x191)]==='delete'&&_0x1118e4[_0xe07080(0x1fb)]&&(_0x277da5[_0xe07080(0x21e)]?.({'type':_0xe07080(0x196),'segmentName':_0x2fb42e,'activationName':_0x1118e4['name']}),await _0x277da5['withProgress'](_0xe07080(0x175)+_0x1118e4[_0xe07080(0x1d0)]+_0xe07080(0x1bf),()=>_0x54e0e9['segment'][_0xe07080(0x18f)](_0x95264a,_0x5a35cb,_0x1118e4['existingActivation']['id'])),_0x277da5[_0xe07080(0x21e)]?.({'type':'activation_deleted','segmentName':_0x2fb42e,'activationName':_0x1118e4['name']}),_0x277da5[_0xe07080(0x233)]?.(_0xe07080(0x187)+_0x1118e4[_0xe07080(0x1d0)]+'\x27'),_0x51fe36['deleted']++);}}catch(_0x9f8c65){const _0x4e54ef=isHttp400Error(_0x9f8c65),_0x221550=_0x4e54ef?ErrorCode[_0xe07080(0x1ce)]:ErrorCode[_0xe07080(0x190)],_0x1f90d7=getErrorMessage(_0x9f8c65);throw new SDKError(_0x221550,'Failed\x20to\x20'+_0x1118e4[_0xe07080(0x191)]+_0xe07080(0x220)+_0x1118e4[_0xe07080(0x1d0)]+'\x27\x20from\x20file:\x20'+_0x38445d+'\x0a\x20\x20'+_0x1f90d7,_0x9f8c65);}}return _0x51fe36;}export async function executePushFolders(_0x15ad73,_0x2ec8b0,_0x2b4b3d,_0x2fb440,_0x4cd35a){const _0x4425c2=a119_0x520e5a,_0x3edd65=new Map(_0x2b4b3d);for(const _0x307e95 of _0x2ec8b0){const _0x1c7a6e=_0x307e95[_0x4425c2(0x24c)]('/'),_0x3635ce=_0x1c7a6e[_0x1c7a6e[_0x4425c2(0x1fc)]-0x1],_0x722b58=_0x1c7a6e['slice'](0x0,-0x1)[_0x4425c2(0x1c1)]('/'),_0x3b6980=_0x3edd65[_0x4425c2(0x207)](_0x722b58);_0x4cd35a[_0x4425c2(0x21e)]?.({'type':_0x4425c2(0x1e7),'folder':_0x307e95});const _0xfdbee5={'name':_0x3635ce,'parentFolderId':_0x3b6980},_0x353333=await _0x4cd35a[_0x4425c2(0x239)]('Creating\x20folder\x20\x27'+_0x307e95+'\x27...',()=>_0x15ad73[_0x4425c2(0x1b9)]['createFolder'](_0x2fb440[_0x4425c2(0x1aa)],_0xfdbee5));_0x3edd65['set'](_0x307e95,_0x353333[_0x4425c2(0x1b3)]['id']),_0x4cd35a[_0x4425c2(0x21e)]?.({'type':'folder_created','folder':_0x307e95,'folderId':_0x353333['data']['id']}),_0x4cd35a['logInfo']?.(_0x4425c2(0x204)+_0x307e95+'\x27');}return _0x3edd65;}export async function executePushSegmentDeletions(_0x596b06,_0x3bcb58,_0x1a35b9){const _0x900776=a119_0x520e5a;if(_0x3bcb58[_0x900776(0x1fc)]===0x0)return 0x0;const {batchAsync:_0x1b36de}=await import(_0x900776(0x21d)),_0x23a65b=0x5,_0x5f33d2=await _0x1b36de(_0x3bcb58,async _0x1dd644=>{const _0x597d88=_0x900776;return _0x1a35b9['onProgress']?.({'type':_0x597d88(0x226),'name':_0x1dd644[_0x597d88(0x1d0)]}),await _0x596b06[_0x597d88(0x1b9)][_0x597d88(0x1b4)](_0x1dd644['id']),_0x1a35b9[_0x597d88(0x21e)]?.({'type':_0x597d88(0x231),'name':_0x1dd644['name']}),_0x1a35b9[_0x597d88(0x233)]?.(_0x597d88(0x254)+_0x1dd644[_0x597d88(0x1d0)]+'\x27'),0x1;},_0x23a65b);return _0x5f33d2['reduce']((_0x5066b4,_0x40b591)=>_0x5066b4+_0x40b591,0x0);}export async function executePushJourneys(_0x5450c7,_0x3d8f08,_0x268c11,_0x543770,_0x51ca0a){const _0x34f6ee=a119_0x520e5a,{journeyDefToRequest:_0x460bd5}=await import(_0x34f6ee(0x210)),{activationDefToCreateRequest:_0x23807b,yamlRuleToApi:_0x5c5fd4,validateSegmentRule:_0x52fe25}=await import(_0x34f6ee(0x19e)),_0x518e06={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x240928=new Map(_0x268c11[_0x34f6ee(0x257)]),_0x32ce5c=0x5;for(let _0x365f25=0x0;_0x365f25<_0x3d8f08[_0x34f6ee(0x1fc)];_0x365f25+=_0x32ce5c){const _0x492e04=_0x3d8f08['slice'](_0x365f25,_0x365f25+_0x32ce5c),_0x47e65c=await Promise[_0x34f6ee(0x209)](_0x492e04['map'](async _0x5cddb3=>{const _0x17a65f=_0x34f6ee;if(!_0x5cddb3[_0x17a65f(0x20e)]&&!_0x5cddb3['hasChanges'])return{'action':_0x17a65f(0x1a7),'name':_0x5cddb3[_0x17a65f(0x23f)][_0x17a65f(0x1d0)],'journeyId':_0x5cddb3[_0x17a65f(0x1da)]?.['id']};const _0x3586ae=_0x5cddb3[_0x17a65f(0x219)]?_0x268c11['folderPathToId']['get'](_0x5cddb3['folderPath']):undefined;_0x51ca0a[_0x17a65f(0x21e)]?.({'type':_0x5cddb3[_0x17a65f(0x20e)]?'journey_creating':_0x17a65f(0x18d),'name':_0x5cddb3[_0x17a65f(0x23f)][_0x17a65f(0x1d0)]});try{const _0x1cfde9=await executeSingleJourneyPush(_0x5450c7,_0x5cddb3,{..._0x268c11,'segmentNameToId':_0x240928},{'parentId':_0x543770[_0x17a65f(0x1aa)],'rootFolderId':_0x543770[_0x17a65f(0x1b7)],'folderId':_0x3586ae,'verbose':_0x543770[_0x17a65f(0x1af)]},_0x51ca0a,{'journeyDefToRequest':_0x460bd5,'activationDefToCreateRequest':_0x23807b,'yamlRuleToApi':_0x5c5fd4,'validateSegmentRule':_0x52fe25});for(const [_0x5dff35,_0x329798]of _0x1cfde9[_0x17a65f(0x18c)]){_0x240928[_0x17a65f(0x21a)](_0x5dff35,_0x329798),_0x518e06[_0x17a65f(0x18c)]['set'](_0x5dff35,_0x329798);}if(_0x1cfde9[_0x17a65f(0x242)]===_0x17a65f(0x1f6))_0x51ca0a[_0x17a65f(0x21e)]?.({'type':_0x17a65f(0x19a),'name':_0x5cddb3[_0x17a65f(0x23f)][_0x17a65f(0x1d0)],'journeyId':_0x1cfde9[_0x17a65f(0x214)]}),_0x51ca0a[_0x17a65f(0x24b)]?.(_0x17a65f(0x1a1)+_0x5cddb3[_0x17a65f(0x23f)]['name']+'\x27'),_0x518e06['created']++;else _0x1cfde9[_0x17a65f(0x242)]===_0x17a65f(0x240)&&(_0x51ca0a[_0x17a65f(0x21e)]?.({'type':_0x17a65f(0x1e9),'name':_0x5cddb3[_0x17a65f(0x23f)][_0x17a65f(0x1d0)]}),_0x51ca0a[_0x17a65f(0x24b)]?.(_0x17a65f(0x183)+_0x5cddb3[_0x17a65f(0x23f)][_0x17a65f(0x1d0)]+'\x27'),_0x518e06[_0x17a65f(0x240)]++);return{'action':_0x1cfde9[_0x17a65f(0x242)],'name':_0x5cddb3[_0x17a65f(0x23f)][_0x17a65f(0x1d0)],'journeyId':_0x1cfde9[_0x17a65f(0x214)]};}catch(_0x3c0fd6){const _0x423db7=isHttp400Error(_0x3c0fd6),_0x178aaf=_0x423db7?ErrorCode[_0x17a65f(0x1cc)]:ErrorCode[_0x17a65f(0x232)],_0x36c5ef=getErrorMessage(_0x3c0fd6);throw new SDKError(_0x178aaf,_0x17a65f(0x229)+(_0x5cddb3[_0x17a65f(0x20e)]?'create':_0x17a65f(0x19d))+_0x17a65f(0x176)+_0x5cddb3[_0x17a65f(0x1d4)]+'\x0a\x20\x20'+_0x36c5ef,_0x3c0fd6);}}));_0x518e06[_0x34f6ee(0x1f5)][_0x34f6ee(0x21f)](..._0x47e65c);}return _0x518e06;}async function executeSingleJourneyPush(_0x4152e5,_0x39d69f,_0x19f5f3,_0x517304,_0x4918da,_0x4ef05b){const _0x3f39f5=a119_0x520e5a,{journeyDefToRequest:_0x49bcee,activationDefToCreateRequest:_0x5c1d97,yamlRuleToApi:_0x485479,validateSegmentRule:_0x24de9c}=_0x4ef05b,_0x556f66=new Map(),_0x5396aa=new Map(),_0xe86cb8=new Map(),_0x30dbfd=new Map(),_0x837235=new Map();let _0x5e10d4;const _0x18d93d=async()=>{const _0x167a64=a119_0x4408;if(_0x5e10d4)return;_0x5e10d4=new Map();if(!_0x39d69f[_0x167a64(0x1da)])return;const _0x90a83=await _0x4152e5[_0x167a64(0x1a4)]['listActivations'](_0x39d69f[_0x167a64(0x1da)]['id']);for(const _0x22306c of _0x90a83){const _0x3de3d1=journeyActivationStepToYaml(_0x22306c,_0x19f5f3['idToEmailMap'],_0x19f5f3['connectionIdToNameMap']),_0x4d4399=activationSignature(_0x3de3d1);!_0x5e10d4[_0x167a64(0x206)](_0x4d4399)&&_0x5e10d4[_0x167a64(0x21a)](_0x4d4399,_0x22306c['id']),_0x3de3d1[_0x167a64(0x1d0)]&&_0x5396aa[_0x167a64(0x21a)](_0x3de3d1[_0x167a64(0x1d0)],_0x22306c['id']);}};if(_0x39d69f[_0x3f39f5(0x1da)]&&_0x39d69f[_0x3f39f5(0x23f)][_0x3f39f5(0x1f2)]){const _0x514fd6=buildLocalExpandedRuleMappings(_0x39d69f[_0x3f39f5(0x23f)]),_0x20c7c3=_0x514fd6[_0x3f39f5(0x22c)];if(_0x20c7c3[_0x3f39f5(0x1f9)]>0x0){const _0x3efab2=new Map();for(const [_0x378b43,_0x2baf7a]of _0x20c7c3){const _0x40900d=serializeExpandedRule(_0x2baf7a,_0x20c7c3);_0x3efab2[_0x3f39f5(0x21a)](_0x378b43,_0x40900d);}const _0x29ca21=collectSegmentIdsFromJourneyApi(_0x39d69f[_0x3f39f5(0x1da)]);if(_0x29ca21[_0x3f39f5(0x1f9)]>0x0){const _0x157045=await buildServerSegmentRuleMap(_0x4152e5,_0x517304['parentId'],_0x19f5f3[_0x3f39f5(0x20f)],_0x29ca21);if(_0x157045[_0x3f39f5(0x1f9)]>0x0){const _0x1bbe61=new Map();for(const [_0xbdf100,_0x1dfa85]of _0x157045){const _0x5d4b4a=serializeExpandedRule(_0x1dfa85,_0x157045);!_0x1bbe61['has'](_0x5d4b4a)&&_0x1bbe61[_0x3f39f5(0x21a)](_0x5d4b4a,_0xbdf100);}for(const [_0x4ff467,_0x13eeab]of _0x3efab2){const _0x2aa158=_0x1bbe61[_0x3f39f5(0x207)](_0x13eeab);_0x2aa158&&(_0x837235['set'](_0x4ff467,_0x2aa158),_0x19f5f3[_0x3f39f5(0x257)][_0x3f39f5(0x21a)](_0x4ff467,_0x2aa158));}}}}}const _0x24f72a={'resolveSegmentId':async _0x2aae04=>{const _0x2dbf7b=_0x3f39f5,_0x100037=_0x19f5f3[_0x2dbf7b(0x257)][_0x2dbf7b(0x207)](_0x2aae04);if(!_0x100037)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2dbf7b(0x1d5)+_0x2aae04+_0x2dbf7b(0x1bb)+_0x39d69f['yamlConfig'][_0x2dbf7b(0x1d0)]+')');return _0x100037;},'resolveEmbeddedSegmentId':async(_0x101e2c,_0x47da8d)=>{const _0x2a0d26=_0x3f39f5,_0x2e2a5b=_0x19f5f3[_0x2a0d26(0x257)]['get'](_0x101e2c);if(_0x2e2a5b)return _0x2e2a5b;const _0x586de6=_0x837235[_0x2a0d26(0x207)](_0x101e2c);if(_0x586de6)return _0x19f5f3[_0x2a0d26(0x257)]['set'](_0x101e2c,_0x586de6),_0x586de6;const _0x25121d=_0x19f5f3['existingSegments'][_0x2a0d26(0x1a2)](_0x4b694f=>_0x4b694f[_0x2a0d26(0x1d0)]===_0x101e2c);if(_0x25121d)return _0x19f5f3[_0x2a0d26(0x257)][_0x2a0d26(0x21a)](_0x101e2c,_0x25121d['id']),_0x25121d['id'];if(_0x39d69f[_0x2a0d26(0x20e)]){const {stageName:_0x12ff90,criteriaName:_0x5c1704}=findSegmentCriteriaLocation(_0x39d69f[_0x2a0d26(0x23f)],_0x101e2c);return _0x24de9c(_0x101e2c,_0x47da8d[_0x2a0d26(0x243)]),_0xe86cb8[_0x2a0d26(0x21a)](_0x101e2c,{'definition':_0x47da8d,'stageName':_0x12ff90,'criteriaName':_0x5c1704}),createPendingSegmentId(_0x101e2c);}const _0x2aa390=_0x39d69f['existingJourney']?.['id'];if(!_0x2aa390)throw new SDKError(ErrorCode[_0x2a0d26(0x25a)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x24de9c(_0x101e2c,_0x47da8d[_0x2a0d26(0x243)]);const _0x55db07=generateDeterministicJourneySegmentName(_0x39d69f[_0x2a0d26(0x23f)]['name'],_0x101e2c),_0x39f7e3=_0x19f5f3[_0x2a0d26(0x20f)][_0x2a0d26(0x1a2)](_0x59074e=>_0x59074e[_0x2a0d26(0x1d0)]===_0x55db07),_0x449e89=createSegmentIdResolver(_0x19f5f3[_0x2a0d26(0x257)],_0x101e2c),_0xf8fba9=await resolveRuleSegmentIds(_0x47da8d['rule'],_0x449e89);let _0x576b7e;if(_0x39f7e3)await _0x4152e5['segment'][_0x2a0d26(0x1c6)](_0x517304[_0x2a0d26(0x1aa)],_0x39f7e3['id'],{'description':_0x47da8d[_0x2a0d26(0x255)]||_0x2a0d26(0x181)+_0x101e2c,'rule':_0x485479(_0xf8fba9,!![]),'countPopulation':!![]}),_0x576b7e=_0x39f7e3['id'];else try{_0x576b7e=await _0x4152e5[_0x2a0d26(0x1b9)][_0x2a0d26(0x20b)]({'name':_0x55db07,'description':_0x47da8d['description']||_0x2a0d26(0x181)+_0x101e2c,'journeyId':_0x2aa390,'rule':_0x485479(_0xf8fba9,!![]),'countPopulation':!![],'parentFolderId':_0x517304[_0x2a0d26(0x1b7)]||'','audienceId':_0x517304['parentId']});}catch(_0x46f0d2){const _0x38c251=_0x46f0d2 instanceof Error&&_0x46f0d2['message'][_0x2a0d26(0x1d7)]('Name\x20has\x20already\x20been\x20taken');if(_0x38c251){const _0x2dce8f=await _0x4152e5[_0x2a0d26(0x1b9)][_0x2a0d26(0x245)](_0x517304[_0x2a0d26(0x1aa)]),_0xf96c7e=_0x2dce8f[_0x2a0d26(0x1a2)](_0x179c40=>_0x179c40[_0x2a0d26(0x1d0)]===_0x55db07);if(_0xf96c7e)await _0x4152e5[_0x2a0d26(0x1b9)][_0x2a0d26(0x1c6)](_0x517304[_0x2a0d26(0x1aa)],_0xf96c7e['id'],{'description':_0x47da8d[_0x2a0d26(0x255)]||_0x2a0d26(0x181)+_0x101e2c,'rule':_0x485479(_0xf8fba9,!![]),'countPopulation':!![]}),_0x576b7e=_0xf96c7e['id'];else throw _0x46f0d2;}else throw _0x46f0d2;}return _0x19f5f3[_0x2a0d26(0x257)][_0x2a0d26(0x21a)](_0x101e2c,_0x576b7e),_0x556f66[_0x2a0d26(0x21a)](_0x101e2c,_0x576b7e),_0x576b7e;},'resolveActivationId':async _0x5da7f6=>{const _0x2d9ee2=_0x3f39f5,_0x3af3d8=_0x5396aa['get'](_0x5da7f6);if(_0x3af3d8)return _0x3af3d8;if(_0x39d69f['existingJourney']){await _0x18d93d();const _0x1102a7=_0x5396aa['get'](_0x5da7f6);if(_0x1102a7)return _0x1102a7;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x2d9ee2(0x17a)+_0x5da7f6+_0x2d9ee2(0x1bb)+_0x39d69f[_0x2d9ee2(0x23f)][_0x2d9ee2(0x1d0)]+_0x2d9ee2(0x259)+_0x2d9ee2(0x195));},'resolveEmbeddedActivationId':async(_0x5744ec,_0x2c2311)=>{const _0x2dc86e=_0x3f39f5,_0x553657=_0x5396aa[_0x2dc86e(0x207)](_0x5744ec);if(_0x553657)return _0x553657;if(_0x39d69f[_0x2dc86e(0x20e)])return _0x30dbfd[_0x2dc86e(0x21a)](_0x5744ec,_0x2c2311),createPendingActivationId(_0x5744ec);if(_0x39d69f[_0x2dc86e(0x1da)]){await _0x18d93d();const _0x26fc41=_0x5396aa[_0x2dc86e(0x207)](_0x2c2311[_0x2dc86e(0x1d0)]);if(_0x26fc41)return _0x5396aa[_0x2dc86e(0x21a)](_0x5744ec,_0x26fc41),_0x26fc41;const _0x180d7a=activationSignature(_0x2c2311),_0x26b067=_0x5e10d4?.[_0x2dc86e(0x207)](_0x180d7a);if(_0x26b067)return _0x5396aa[_0x2dc86e(0x21a)](_0x5744ec,_0x26b067),_0x26b067;const _0x1f540c=await _0x5c1d97(_0x2c2311,_0x19f5f3[_0x2dc86e(0x17f)]),_0x1120ce=await _0x4152e5[_0x2dc86e(0x1a4)][_0x2dc86e(0x1e5)](_0x39d69f[_0x2dc86e(0x1da)]['id'],_0x1f540c);return _0x5396aa['set'](_0x5744ec,_0x1120ce['id']),_0x1120ce['id'];}throw new SDKError(ErrorCode[_0x2dc86e(0x25a)],_0x2dc86e(0x213));},'resolveJourneyId':async _0xac5959=>{const _0xa3146c=_0x3f39f5;try{return await _0x4152e5[_0xa3146c(0x1a4)][_0xa3146c(0x1a9)](_0x517304['parentId'],_0xac5959);}catch(_0x4fc19c){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0xac5959+_0xa3146c(0x212)+_0x39d69f[_0xa3146c(0x23f)]['name']+'\x27)',_0x4fc19c);}},'resolveStageId':async(_0x50c8aa,_0x5b5b6b)=>{const _0x5a9fd7=_0x3f39f5,_0x240277=await _0x4152e5['journey'][_0x5a9fd7(0x253)](_0x50c8aa),_0x1e9034=_0x240277['attributes'][_0x5a9fd7(0x230)]['find'](_0x2de415=>_0x2de415['name'][_0x5a9fd7(0x19f)]()===_0x5b5b6b['toLowerCase']());if(!_0x1e9034?.['id'])throw new SDKError(ErrorCode[_0x5a9fd7(0x1d1)],_0x5a9fd7(0x1e1)+_0x5b5b6b+_0x5a9fd7(0x201)+(_0x240277[_0x5a9fd7(0x1e3)][_0x5a9fd7(0x236)]||_0x240277[_0x5a9fd7(0x1e3)]['name'])+'\x27');return _0x1e9034['id'];}},_0x447a2e=await _0x49bcee(_0x39d69f['yamlConfig'],_0x517304[_0x3f39f5(0x1aa)],_0x24f72a),_0x5392d2=_0x517304[_0x3f39f5(0x20a)]||_0x517304[_0x3f39f5(0x1b7)];_0x5392d2&&(_0x447a2e[_0x3f39f5(0x19b)]={'parentFolder':{'data':{'id':_0x5392d2,'type':_0x3f39f5(0x1a5)}}});if(_0x39d69f[_0x3f39f5(0x20e)]){if(_0xe86cb8[_0x3f39f5(0x1f9)]>0x0||_0x30dbfd[_0x3f39f5(0x1f9)]>0x0)return await executeThreeStepJourneyCreate(_0x4152e5,_0x39d69f,_0x447a2e,{'pendingEmbeddedSegments':_0xe86cb8,'pendingEmbeddedActivations':_0x30dbfd,'embeddedSegmentNameToId':_0x556f66,'journeyActivationNameToId':_0x5396aa},{..._0x517304,'effectiveFolderId':_0x5392d2},_0x19f5f3,_0x4918da,_0x4ef05b);else{ensureJourneyDefaults(_0x447a2e[_0x3f39f5(0x1e3)]);const _0x1ece0a=await _0x4152e5[_0x3f39f5(0x1a4)][_0x3f39f5(0x217)](_0x447a2e);return{'action':_0x3f39f5(0x1f6),'journeyId':_0x1ece0a['id'],'embeddedSegmentNameToId':_0x556f66};}}else{if(_0x39d69f[_0x3f39f5(0x1cd)]&&_0x39d69f[_0x3f39f5(0x1da)])return ensureJourneyDefaults(_0x447a2e[_0x3f39f5(0x1e3)]),await _0x4152e5[_0x3f39f5(0x1a4)]['update'](_0x39d69f['existingJourney']['id'],_0x447a2e),{'action':_0x3f39f5(0x240),'journeyId':_0x39d69f[_0x3f39f5(0x1da)]['id'],'embeddedSegmentNameToId':_0x556f66};}return{'action':_0x3f39f5(0x1a7),'journeyId':_0x39d69f['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x556f66};}function findSegmentCriteriaLocation(_0x1a6198,_0x1a7d4f){const _0x41cf08=a119_0x520e5a,_0x5270fb=_0x1a6198[_0x41cf08(0x17b)]||_0x1a6198[_0x41cf08(0x1ef)]?.[0x0]?.[_0x41cf08(0x17b)]||[];let _0x5331ea=_0x41cf08(0x1b2),_0x17abc7=_0x1a7d4f;const _0x3c4855=_0x1a6198[_0x41cf08(0x1eb)]||_0x1a6198[_0x41cf08(0x1ef)]?.[0x0]?.[_0x41cf08(0x1eb)];if(_0x3c4855?.[_0x41cf08(0x1b9)]===_0x1a7d4f)return{'stageName':'goal','criteriaName':_0x3c4855[_0x41cf08(0x1d0)]||_0x1a7d4f};_0x12494d:for(const _0x38a788 of _0x5270fb){if(_0x38a788[_0x41cf08(0x205)]?.[_0x41cf08(0x1b9)]===_0x1a7d4f){_0x5331ea=_0x38a788[_0x41cf08(0x1d0)],_0x17abc7=_0x38a788[_0x41cf08(0x205)][_0x41cf08(0x1d0)]||_0x1a7d4f;break;}if(_0x38a788[_0x41cf08(0x228)])for(const _0x27340e of _0x38a788[_0x41cf08(0x228)]){if(_0x27340e[_0x41cf08(0x191)]==='decision_point'&&_0x27340e[_0x41cf08(0x20d)]?.[_0x41cf08(0x1ff)])for(const _0x282ce3 of _0x27340e[_0x41cf08(0x20d)][_0x41cf08(0x1ff)]){if(_0x282ce3[_0x41cf08(0x1b9)]===_0x1a7d4f){_0x5331ea=_0x38a788['name'],_0x17abc7=_0x282ce3[_0x41cf08(0x1d0)]||_0x1a7d4f;break _0x12494d;}}}}return{'stageName':_0x5331ea,'criteriaName':_0x17abc7};}async function executeThreeStepJourneyCreate(_0x4f0f63,_0x2352fe,_0x538f72,_0x3d006f,_0xaf8cbe,_0x9b13ce,_0x587275,_0x2c6f42){const _0x4067cf=a119_0x520e5a,{activationDefToCreateRequest:_0x2a030e,yamlRuleToApi:_0x365454}=_0x2c6f42,{pendingEmbeddedSegments:_0x2aa29d,pendingEmbeddedActivations:_0x57c1f2,embeddedSegmentNameToId:_0x1a9a09}=_0x3d006f,_0x392009=JSON[_0x4067cf(0x25b)](JSON[_0x4067cf(0x198)](_0x538f72));ensureJourneyDefaults(_0x392009[_0x4067cf(0x1e3)]),stripPendingIds(_0x392009);const _0x22936e=await _0x4f0f63[_0x4067cf(0x1a4)][_0x4067cf(0x217)](_0x392009),_0x8c693f=_0x22936e['id'],_0x416a4e=new Map();for(const _0x4841f4 of _0x22936e[_0x4067cf(0x1e3)][_0x4067cf(0x230)]){_0x416a4e['set'](_0x4841f4[_0x4067cf(0x1d0)][_0x4067cf(0x19f)](),_0x4841f4['id']);}for(const [_0x48af44,{definition:_0x3d1b74}]of _0x2aa29d){const _0x209302=generateDeterministicJourneySegmentName(_0x2352fe[_0x4067cf(0x23f)][_0x4067cf(0x1d0)],_0x48af44);_0x587275[_0x4067cf(0x21e)]?.({'type':_0x4067cf(0x1d6),'journeyName':_0x2352fe[_0x4067cf(0x23f)]['name'],'segmentName':_0x48af44});const _0x557d94=createSegmentIdResolver(_0x9b13ce[_0x4067cf(0x257)],_0x48af44),_0x4ba0ea=await resolveRuleSegmentIds(_0x3d1b74[_0x4067cf(0x243)],_0x557d94),_0x3a3a92=await _0x4f0f63[_0x4067cf(0x1b9)][_0x4067cf(0x20b)]({'name':_0x209302,'description':_0x3d1b74[_0x4067cf(0x255)]||_0x4067cf(0x181)+_0x48af44,'journeyId':_0x8c693f,'rule':_0x365454(_0x4ba0ea,!![]),'countPopulation':!![],'parentFolderId':_0xaf8cbe[_0x4067cf(0x22e)]||'','audienceId':_0xaf8cbe[_0x4067cf(0x1aa)]});_0x1a9a09[_0x4067cf(0x21a)](_0x48af44,_0x3a3a92),_0x9b13ce[_0x4067cf(0x257)]['set'](_0x48af44,_0x3a3a92),_0x587275['onProgress']?.({'type':_0x4067cf(0x238),'journeyName':_0x2352fe[_0x4067cf(0x23f)]['name'],'segmentName':_0x48af44});}const _0x3e7b15=new Map();for(const [_0x21133d,_0x3766ee]of _0x57c1f2){_0x587275[_0x4067cf(0x21e)]?.({'type':_0x4067cf(0x21b),'journeyName':_0x2352fe[_0x4067cf(0x23f)][_0x4067cf(0x1d0)],'activationName':_0x21133d});const _0xda70fc=await _0x2a030e(_0x3766ee,_0x9b13ce['activationContext']),_0x169967=await _0x4f0f63[_0x4067cf(0x1a4)][_0x4067cf(0x1e5)](_0x8c693f,_0xda70fc);_0x3e7b15[_0x4067cf(0x21a)](_0x21133d,_0x169967['id']),_0x3d006f[_0x4067cf(0x1a0)][_0x4067cf(0x21a)](_0x21133d,_0x169967['id']),_0x587275['onProgress']?.({'type':_0x4067cf(0x1a3),'journeyName':_0x2352fe[_0x4067cf(0x23f)][_0x4067cf(0x1d0)],'activationName':_0x21133d});}const _0x55914f=JSON['parse'](JSON['stringify'](_0x538f72));return _0x55914f['id']=_0x8c693f,ensureJourneyDefaults(_0x55914f[_0x4067cf(0x1e3)]),resolvePendingIdsInRequest(_0x55914f,_0x538f72,_0x416a4e,_0x1a9a09,_0x3e7b15,_0x587275),await _0x4f0f63[_0x4067cf(0x1a4)][_0x4067cf(0x19d)](_0x8c693f,_0x55914f),{'action':_0x4067cf(0x1f6),'journeyId':_0x8c693f,'embeddedSegmentNameToId':_0x1a9a09};}function stripPendingIds(_0x3d40d9){const _0x5a1dc2=a119_0x520e5a;for(const _0x3a6ec8 of _0x3d40d9['attributes'][_0x5a1dc2(0x230)]||[]){_0x3a6ec8[_0x5a1dc2(0x23e)]?.[_0x5a1dc2(0x180)]&&isPendingSegmentId(_0x3a6ec8[_0x5a1dc2(0x23e)]['segmentId'])&&delete _0x3a6ec8[_0x5a1dc2(0x23e)];if(_0x3a6ec8[_0x5a1dc2(0x228)])for(const _0x20883c of Object[_0x5a1dc2(0x1ea)](_0x3a6ec8[_0x5a1dc2(0x228)])){const _0x25724f=_0x3a6ec8[_0x5a1dc2(0x228)][_0x20883c];_0x25724f['type']===_0x5a1dc2(0x241)&&_0x25724f['journeyActivationStepId']&&isPendingActivationId(_0x25724f[_0x5a1dc2(0x203)])&&(_0x25724f['journeyActivationStepId']='');if(_0x25724f[_0x5a1dc2(0x191)]===_0x5a1dc2(0x258)&&_0x25724f[_0x5a1dc2(0x1ff)])for(const _0x551b76 of _0x25724f[_0x5a1dc2(0x1ff)]){_0x551b76[_0x5a1dc2(0x180)]&&isPendingSegmentId(_0x551b76[_0x5a1dc2(0x180)])&&(_0x551b76[_0x5a1dc2(0x180)]='');}_0x25724f[_0x5a1dc2(0x191)]===_0x5a1dc2(0x18b)&&_0x25724f[_0x5a1dc2(0x221)]?.[_0x5a1dc2(0x180)]&&isPendingSegmentId(_0x25724f['waitCondition'][_0x5a1dc2(0x180)])&&(_0x25724f[_0x5a1dc2(0x221)][_0x5a1dc2(0x180)]='');}}}function resolvePendingIdsInRequest(_0x451af3,_0x28ffa5,_0x3d743c,_0x680848,_0x37c108,_0x3ae734){const _0x343885=a119_0x520e5a,_0x507837=(_0x34c6fd,_0x3740cf)=>{const _0x53623d=a119_0x4408;if(!isPendingSegmentId(_0x34c6fd))return _0x34c6fd;const _0x4ae4cb=extractPendingSegmentName(_0x34c6fd),_0x29cecc=_0x680848[_0x53623d(0x207)](_0x4ae4cb);return!_0x29cecc&&_0x3ae734[_0x53623d(0x1de)]?.(_0x53623d(0x25d)+_0x4ae4cb+_0x53623d(0x211)+_0x3740cf),_0x29cecc;};if(_0x451af3[_0x343885(0x1e3)][_0x343885(0x1eb)]?.['segmentId']&&isPendingSegmentId(_0x451af3[_0x343885(0x1e3)]['goal'][_0x343885(0x180)])){const _0x3b9dc3=_0x507837(_0x451af3[_0x343885(0x1e3)][_0x343885(0x1eb)]['segmentId'],_0x343885(0x1ab));_0x3b9dc3&&(_0x451af3[_0x343885(0x1e3)][_0x343885(0x1eb)][_0x343885(0x180)]=_0x3b9dc3);}for(const _0x387fef of _0x451af3[_0x343885(0x1e3)][_0x343885(0x230)]||[]){const _0x57f2c3=_0x3d743c[_0x343885(0x207)](_0x387fef['name'][_0x343885(0x19f)]());_0x57f2c3&&(_0x387fef['id']=_0x57f2c3);if(_0x387fef[_0x343885(0x23e)]?.[_0x343885(0x180)]&&isPendingSegmentId(_0x387fef[_0x343885(0x23e)]['segmentId'])){const _0x5dd9d3=_0x507837(_0x387fef[_0x343885(0x23e)][_0x343885(0x180)],_0x343885(0x1b5)+_0x387fef[_0x343885(0x1d0)]+_0x343885(0x1ca));_0x5dd9d3&&(_0x387fef[_0x343885(0x23e)][_0x343885(0x180)]=_0x5dd9d3);}if(_0x387fef['exitCriterias'])for(const _0x1ea865 of _0x387fef['exitCriterias']){if(_0x1ea865[_0x343885(0x180)]&&isPendingSegmentId(_0x1ea865[_0x343885(0x180)])){const _0x248a96=_0x507837(_0x1ea865[_0x343885(0x180)],'stage\x20\x27'+_0x387fef['name']+_0x343885(0x244));_0x248a96&&(_0x1ea865[_0x343885(0x180)]=_0x248a96);}}if(_0x387fef['milestone']?.[_0x343885(0x180)]&&isPendingSegmentId(_0x387fef[_0x343885(0x1d2)][_0x343885(0x180)])){const _0x108d33=_0x507837(_0x387fef[_0x343885(0x1d2)][_0x343885(0x180)],'stage\x20\x27'+_0x387fef[_0x343885(0x1d0)]+_0x343885(0x1ee));_0x108d33&&(_0x387fef[_0x343885(0x1d2)]['segmentId']=_0x108d33);}if(_0x387fef['steps']){const _0x468213=_0x1b8b15=>_0x28ffa5[_0x343885(0x1e3)]['journeyStages']['find'](_0xb82698=>_0xb82698[_0x343885(0x1d0)][_0x343885(0x19f)]()===_0x387fef[_0x343885(0x1d0)]['toLowerCase']())?.[_0x343885(0x228)]?.[_0x1b8b15];for(const _0x336ff7 of Object[_0x343885(0x1ea)](_0x387fef[_0x343885(0x228)])){const _0x513f36=_0x387fef[_0x343885(0x228)][_0x336ff7],_0x1644cd=_0x468213(_0x336ff7);if(_0x513f36[_0x343885(0x191)]===_0x343885(0x241)&&_0x513f36[_0x343885(0x203)]&&(isPendingActivationId(_0x513f36[_0x343885(0x203)])||_0x513f36[_0x343885(0x203)]==='')){if(_0x1644cd?.[_0x343885(0x203)]&&isPendingActivationId(_0x1644cd['journeyActivationStepId'])){const _0x5624fd=extractPendingActivationName(_0x1644cd[_0x343885(0x203)]),_0x323606=_0x37c108[_0x343885(0x207)](_0x5624fd);_0x323606&&(_0x513f36[_0x343885(0x203)]=_0x323606);}}if(_0x513f36[_0x343885(0x191)]===_0x343885(0x258)&&_0x513f36[_0x343885(0x1ff)]&&_0x1644cd?.['branches'])for(let _0x13fbe0=0x0;_0x13fbe0<_0x513f36[_0x343885(0x1ff)][_0x343885(0x1fc)];_0x13fbe0++){const _0x3bcc08=_0x513f36[_0x343885(0x1ff)][_0x13fbe0],_0x3d1597=_0x1644cd[_0x343885(0x1ff)][_0x13fbe0];if(_0x3d1597?.[_0x343885(0x180)]&&isPendingSegmentId(_0x3d1597[_0x343885(0x180)])){const _0x44fe6f=_0x507837(_0x3d1597[_0x343885(0x180)],_0x343885(0x1b5)+_0x387fef[_0x343885(0x1d0)]+_0x343885(0x197)+(_0x3bcc08[_0x343885(0x1d0)]||_0x13fbe0)+'\x27');_0x44fe6f&&(_0x3bcc08[_0x343885(0x180)]=_0x44fe6f);}}if(_0x513f36['type']===_0x343885(0x18b)&&_0x513f36[_0x343885(0x221)]?.['segmentId']&&_0x1644cd?.['waitCondition']?.['segmentId']&&isPendingSegmentId(_0x1644cd['waitCondition'][_0x343885(0x180)])){const _0x3fb487=_0x507837(_0x1644cd[_0x343885(0x221)][_0x343885(0x180)],'stage\x20\x27'+_0x387fef[_0x343885(0x1d0)]+_0x343885(0x1b0));_0x3fb487&&(_0x513f36[_0x343885(0x221)]['segmentId']=_0x3fb487);}}}}}
1
+ (function(_0x51af2a,_0x4d01e4){const _0x574d27=a119_0x51cd,_0x31ced5=_0x51af2a();while(!![]){try{const _0x10072e=-parseInt(_0x574d27(0x96))/0x1*(parseInt(_0x574d27(0xbf))/0x2)+-parseInt(_0x574d27(0x111))/0x3+parseInt(_0x574d27(0x11a))/0x4*(parseInt(_0x574d27(0x149))/0x5)+-parseInt(_0x574d27(0xac))/0x6+-parseInt(_0x574d27(0x15a))/0x7*(parseInt(_0x574d27(0x123))/0x8)+-parseInt(_0x574d27(0x117))/0x9+parseInt(_0x574d27(0xcb))/0xa*(parseInt(_0x574d27(0x14e))/0xb);if(_0x10072e===_0x4d01e4)break;else _0x31ced5['push'](_0x31ced5['shift']());}catch(_0x2c3b37){_0x31ced5['push'](_0x31ced5['shift']());}}}(a119_0x4926,0xd4cb8));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0xb9c7f6){return''+PENDING_SEGMENT_PREFIX+_0xb9c7f6+'__';}export function isPendingSegmentId(_0x2ae484){const _0x7805b2=a119_0x51cd;return _0x2ae484[_0x7805b2(0x150)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x3c9a50){return _0x3c9a50['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x6a6bc6){return''+PENDING_ACTIVATION_PREFIX+_0x6a6bc6+'__';}export function isPendingActivationId(_0x2b84ba){const _0x2bcda3=a119_0x51cd;return _0x2b84ba[_0x2bcda3(0x150)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1e8de9){const _0xc9cbaf=a119_0x51cd;return _0x1e8de9[_0xc9cbaf(0x159)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x143398,_0x3fc728){const _0x3bc6de=a119_0x51cd,_0x2560ee=_0x143398+'::'+(_0x3fc728[_0x3bc6de(0xe3)]()||_0x3bc6de(0x8e)),_0x2eb938=createHash(_0x3bc6de(0x7d))[_0x3bc6de(0x11f)](_0x2560ee)[_0x3bc6de(0x114)](_0x3bc6de(0x115))[_0x3bc6de(0xe5)](0x0,0xc);return _0x3bc6de(0xf6)+_0x2eb938;}export function ensureJourneyDefaults(_0xd46690){const _0x406f57=a119_0x51cd;!_0xd46690[_0x406f57(0xa0)]&&(_0xd46690[_0x406f57(0xa0)]=''),!_0xd46690[_0x406f57(0x7e)]&&(_0xd46690['state']='draft');}export function resolveTDFolderPath(_0x26ac73,_0x43d964,_0x34425e){const _0x65ae7a=a119_0x51cd;if(!_0x43d964)return _0x26ac73;if(_0x26ac73===_0x34425e||_0x26ac73[_0x65ae7a(0x150)](_0x34425e+'/'))return _0x26ac73;return _0x26ac73?_0x34425e+'/'+_0x26ac73:_0x34425e;}export function addFoldersToCreate(_0x4ecc75,_0x49cf5b,_0x28deb6){const _0x127bff=a119_0x51cd;if(!_0x4ecc75)return;if(_0x49cf5b['has'](_0x4ecc75))return;const _0x30506f=_0x4ecc75[_0x127bff(0x14f)]('/');let _0x17fc21='';for(const _0x272640 of _0x30506f){_0x17fc21=_0x17fc21?_0x17fc21+'/'+_0x272640:_0x272640,!_0x49cf5b['has'](_0x17fc21)&&_0x28deb6['add'](_0x17fc21);}}import*as a119_0x42591b from'yaml';import{readFileSync}from'fs';import a119_0x21e344 from'path';import{isJourneyDef,parseYamlString as a119_0x220318,toYamlString as a119_0x367d5c,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x5896f0){const _0x48da7e=a119_0x51cd;if(Array[_0x48da7e(0x131)](_0x5896f0))return'['+_0x5896f0['map'](_0x4907bb=>stableStringify(_0x4907bb))['join'](',')+']';if(_0x5896f0&&typeof _0x5896f0===_0x48da7e(0x97)){const _0x7764be=_0x5896f0,_0x524758=Object[_0x48da7e(0xe0)](_0x7764be)[_0x48da7e(0xc0)](),_0x53efcc=_0x524758[_0x48da7e(0x9d)](_0x463523=>'\x22'+_0x463523+'\x22:'+stableStringify(_0x7764be[_0x463523]));return'{'+_0x53efcc[_0x48da7e(0x128)](',')+'}';}const _0x55e372=JSON['stringify'](_0x5896f0);return _0x55e372===undefined?'null':_0x55e372;}function activationSignature(_0x3ead0e){const _0x196b55=a119_0x51cd,_0x1aaf19={'connection':_0x3ead0e['connection'],..._0x3ead0e['all_columns']!==undefined&&{'all_columns':_0x3ead0e['all_columns']},..._0x3ead0e['columns']!==undefined&&{'columns':_0x3ead0e['columns']},..._0x3ead0e[_0x196b55(0x7f)]!==undefined&&{'behavior':_0x3ead0e[_0x196b55(0x7f)]},..._0x3ead0e[_0x196b55(0x142)]!==undefined&&{'schedule':_0x3ead0e[_0x196b55(0x142)]},..._0x3ead0e[_0x196b55(0xef)]!==undefined&&{'notification':_0x3ead0e[_0x196b55(0xef)]},..._0x3ead0e['connector_config']!==undefined&&{'connector_config':_0x3ead0e['connector_config']},..._0x3ead0e[_0x196b55(0x154)]!==undefined&&{'activation_template_id':_0x3ead0e['activation_template_id']}};return stableStringify(_0x1aaf19);}export async function prepareSegmentFiles(_0xf8a533,_0x486164,_0x4a20c3,_0x4071ff,_0x42655e){const _0x1af67b=a119_0x51cd,{activationDefToCreateRequest:_0x12eed8}=await import(_0x1af67b(0xd9)),_0x56100c=[],_0x2e9676=new Set();for(const {yamlConfig:_0x354fa0,folderPath:_0x4741a3,sourcePath:_0x10918d}of _0xf8a533){const _0x49645a=resolveTDFolderPath(_0x4741a3,_0x4071ff,_0x42655e),_0xda1e90=_0x49645a+':'+_0x354fa0[_0x1af67b(0x157)],_0x3a9037=_0x486164['segmentByFolderAndName'][_0x1af67b(0x125)](_0xda1e90),_0x2a2cff=_0x3a9037?_0x486164[_0x1af67b(0x95)][_0x1af67b(0x125)](_0x3a9037['id'])||[]:[];addFoldersToCreate(_0x49645a,_0x486164['folderPathToId'],_0x2e9676);const _0x84150a=calculateActivationActions(_0x354fa0[_0x1af67b(0xb7)]||[],_0x2a2cff,_0x486164[_0x1af67b(0x87)],_0x486164['connectionIdToNameMap']);for(const _0x469353 of _0x84150a){(_0x469353[_0x1af67b(0x93)]==='create'||_0x469353['type']===_0x1af67b(0x11f))&&_0x469353[_0x1af67b(0xcd)]&&(_0x469353[_0x1af67b(0x11b)]=await _0x12eed8(_0x469353[_0x1af67b(0xcd)],_0x4a20c3));}const _0x217f44=calculateSegmentDiff(_0x354fa0,_0x3a9037,_0x2a2cff,_0x486164[_0x1af67b(0x87)],_0x486164[_0x1af67b(0xe2)]);_0x56100c[_0x1af67b(0x152)]({'relativePath':_0x354fa0[_0x1af67b(0x157)],'absolutePath':_0x10918d,'yamlConfig':_0x354fa0,'folderPath':_0x49645a,'existingSegment':_0x3a9037,'existingActivations':_0x2a2cff,'isNew':_0x217f44[_0x1af67b(0x12b)],'hasChanges':_0x217f44[_0x1af67b(0x81)],'diff':_0x217f44[_0x1af67b(0xa5)],'activationActions':_0x84150a});}return{'segmentFiles':_0x56100c,'foldersToCreate':_0x2e9676};}export async function prepareJourneyFiles(_0x5319f8,_0x2e0330,_0x6d504f,_0x137d89){const _0x1f87b7=a119_0x51cd,_0x35a03a=[],_0x559bb3=new Set();for(const {yamlConfig:_0x29213c,folderPath:_0x591f00,sourcePath:_0x21f4d8}of _0x5319f8){const _0x6af6e2=resolveTDFolderPath(_0x591f00,_0x6d504f,_0x137d89),_0x58d4d1=_0x6af6e2+':'+_0x29213c[_0x1f87b7(0x157)],_0x56d739=_0x2e0330[_0x1f87b7(0x126)][_0x1f87b7(0x125)](_0x58d4d1);let _0x55062c,_0x7d7d0a;if(_0x56d739&&_0x56d739[_0x1f87b7(0xd2)]>0x0){const _0x438b45=buildLocalExpandedRuleMappings(_0x29213c),{createYamlContext:_0x22801b,prefetchJourneySegments:_0x4403db}=createPushYamlContextForBundle(_0x2e0330[_0x1f87b7(0x129)],_0x2e0330[_0x1f87b7(0x103)],_0x2e0330['existingSegments'],_0x438b45,_0x2e0330[_0x1f87b7(0x87)],_0x2e0330[_0x1f87b7(0xe2)],_0x2e0330['activationStepsById'],_0x2e0330['journeyById']);await _0x4403db(_0x56d739['map'](_0xc7c3b8=>_0xc7c3b8['id']));const _0x2ab92e=hasMultipleVersions(_0x29213c),_0x2ae60d=async _0xcbe40c=>{const _0x467a50=_0x1f87b7,_0x63d96b=_0x2e0330[_0x467a50(0x110)]?.['get'](_0xcbe40c);if(_0x63d96b)return _0x63d96b;return _0x2e0330['fetchJourney']({'journeyId':_0xcbe40c,'journeyName':_0x29213c['name'],'isMultiVersion':_0x56d739[_0x467a50(0xd2)]>0x1});};if(_0x2ab92e&&_0x56d739[_0x1f87b7(0xd2)]>0x1){const _0x50e23b=[];for(const _0x19c51c of _0x56d739){const _0xaa07a0=_0x19c51c[_0x1f87b7(0x88)]||0x1;_0x2e0330[_0x1f87b7(0x13b)]?.[_0x1f87b7(0x11f)](_0x1f87b7(0xe8)+_0x29213c[_0x1f87b7(0x157)]+'\x20v'+_0xaa07a0);const _0x52ff52=await _0x2ae60d(_0x19c51c['id']),_0x4252fa=_0x22801b(_0x19c51c['id']),_0x42068a=await journeyResponseToDef(_0x52ff52,_0x4252fa);_0x50e23b[_0x1f87b7(0x152)]({'item':_0x19c51c,'yaml':_0x42068a});}const _0x560f3e=buildLocalRuleToNameMappingFromJourney(_0x29213c);_0x7d7d0a=buildMergedJourneyDef(_0x50e23b,_0x560f3e);const _0x3d59bf=Math[_0x1f87b7(0xe9)](..._0x50e23b[_0x1f87b7(0x9d)](_0x54034a=>_0x54034a[_0x1f87b7(0xa2)][_0x1f87b7(0x88)]||0x0)),_0x22c024=_0x56d739[_0x1f87b7(0x124)](_0x14119e=>(_0x14119e['versionNumber']||0x0)===_0x3d59bf);_0x22c024&&(_0x2e0330[_0x1f87b7(0x13b)]?.[_0x1f87b7(0x11f)](_0x1f87b7(0xe8)+_0x29213c[_0x1f87b7(0x157)]+'\x20v'+_0x3d59bf),_0x55062c=await _0x2ae60d(_0x22c024['id']));}else{const _0x1eaf91=_0x56d739[_0x56d739[_0x1f87b7(0xd2)]-0x1];_0x2e0330['progress']?.[_0x1f87b7(0x11f)](_0x1f87b7(0xe8)+_0x29213c[_0x1f87b7(0x157)]),_0x55062c=await _0x2ae60d(_0x1eaf91['id']);const _0x325fff=_0x22801b(_0x1eaf91['id']),_0x24a8d0=await journeyResponseToDef(_0x55062c,_0x325fff),_0x16249c=buildLocalRuleToNameMappingFromJourney(_0x29213c);_0x7d7d0a=buildMergedJourneyDef([{'item':_0x1eaf91,'yaml':_0x24a8d0}],_0x16249c);}}addFoldersToCreate(_0x6af6e2,_0x2e0330[_0x1f87b7(0x10d)],_0x559bb3);const _0x549a66=calculateJourneyDiff(_0x29213c,_0x7d7d0a);_0x35a03a[_0x1f87b7(0x152)]({'relativePath':_0x29213c[_0x1f87b7(0x157)],'absolutePath':_0x21f4d8,'yamlConfig':_0x29213c,'folderPath':_0x6af6e2,'existingJourney':_0x55062c,'isNew':_0x549a66[_0x1f87b7(0x12b)],'hasChanges':_0x549a66[_0x1f87b7(0x81)],'diff':_0x549a66[_0x1f87b7(0xa5)]});}return{'journeyFiles':_0x35a03a,'foldersToCreate':_0x559bb3};}export function calculateActivationActions(_0x5e25df,_0x443fbc,_0x3ba32d,_0x487109){const _0x5061a2=a119_0x51cd,_0x1188b0=[],_0x4d789b=new Map();for(const _0x3aa7fb of _0x443fbc){_0x4d789b['set'](_0x3aa7fb[_0x5061a2(0x157)],_0x3aa7fb);}const _0x4815df=new Map();for(const _0x2485e2 of _0x5e25df){_0x4815df[_0x5061a2(0x121)](_0x2485e2[_0x5061a2(0x157)],_0x2485e2);}for(const _0x333fbf of _0x5e25df){const _0x3349d4=_0x4d789b[_0x5061a2(0x125)](_0x333fbf[_0x5061a2(0x157)]);if(!_0x3349d4)_0x1188b0[_0x5061a2(0x152)]({'type':_0x5061a2(0xc6),'name':_0x333fbf[_0x5061a2(0x157)],'yamlActivation':_0x333fbf});else{const _0x21c946=activationResponseToDef(_0x3349d4,_0x3ba32d,_0x487109),_0x551d10=a119_0x42591b['stringify'](_0x21c946),_0x8aa474=a119_0x42591b[_0x5061a2(0x132)](_0x333fbf);_0x551d10!==_0x8aa474&&_0x1188b0['push']({'type':'update','name':_0x333fbf[_0x5061a2(0x157)],'yamlActivation':_0x333fbf,'existingActivation':_0x3349d4});}}for(const _0x2eba43 of _0x443fbc){!_0x4815df[_0x5061a2(0x13c)](_0x2eba43[_0x5061a2(0x157)])&&_0x1188b0[_0x5061a2(0x152)]({'type':_0x5061a2(0x139),'name':_0x2eba43[_0x5061a2(0x157)],'existingActivation':_0x2eba43});}return _0x1188b0;}export function calculateSegmentDiff(_0x3ba358,_0x5b06a3,_0x1a3f39,_0x1f0f0d,_0x1dbaf9){const _0x1f9ba0=segmentToYamlString(_0x3ba358);if(_0x5b06a3){const _0x74ce28=segmentWithActivationsToYaml(_0x5b06a3,_0x1a3f39,undefined,_0x1f0f0d,_0x1dbaf9),_0x24dc1d=segmentToYamlString(_0x74ce28),_0xedda1=generateDiff(_0x24dc1d,_0x1f9ba0),_0x50a2b9=hasChanges(_0xedda1);return{'isNew':![],'hasChanges':_0x50a2b9,'diff':_0x50a2b9?formatDiffWithColors(_0xedda1):undefined};}const _0x3ff24b=generateDiff('',_0x1f9ba0);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3ff24b)};}export function calculateJourneyDiff(_0x79ea7,_0x5e800d){const _0x401c31=normalizeJourneyDef(_0x79ea7,_0x79ea7),_0xac4c95=a119_0x367d5c(_0x401c31);if(_0x5e800d){const _0x39c4e6=normalizeJourneyDef(_0x5e800d,_0x79ea7),_0x242439=a119_0x367d5c(_0x39c4e6),_0x4a0400=generateDiff(_0x242439,_0xac4c95),_0x279aef=hasChanges(_0x4a0400);return{'isNew':![],'hasChanges':_0x279aef,'diff':_0x279aef?formatDiffWithColors(_0x4a0400):undefined};}const _0x34492f=generateDiff('',_0xac4c95);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x34492f)};}export function findSegmentsToDelete(_0x2152b4,_0x3f4d62,_0x1faaf6,_0x5d8f9e,_0x4767ef){const _0x5aa6cb=a119_0x51cd,_0x4c0c02=new Set();for(const {yamlConfig:_0x388648,folderPath:_0xdbca1c}of _0x3f4d62){_0x4c0c02[_0x5aa6cb(0xfc)](_0xdbca1c+':'+_0x388648[_0x5aa6cb(0x157)]);}return _0x2152b4[_0x5aa6cb(0x148)](_0x48ba76=>{const _0x4e2a82=_0x5aa6cb,_0x4c2307=_0x48ba76[_0x4e2a82(0xc2)]?_0x1faaf6[_0x4e2a82(0x125)](_0x48ba76[_0x4e2a82(0xc2)][_0x4e2a82(0x13e)]())||'':'',_0x342523=_0x4c2307+':'+_0x48ba76['name'];if(_0x4c0c02[_0x4e2a82(0x13c)](_0x342523))return![];if(_0x4767ef)return _0x4c2307===_0x5d8f9e||_0x4c2307[_0x4e2a82(0x150)](_0x5d8f9e+'/');return!![];});}export function findJourneysToDelete(_0x164561,_0x4417ab,_0x4a749d,_0x2073c5,_0x5c5281){const _0xacaefe=a119_0x51cd,_0x4bb6a0=new Set();for(const {yamlConfig:_0x220a24,folderPath:_0x1310e7}of _0x4417ab){_0x4bb6a0[_0xacaefe(0xfc)](_0x1310e7+':'+_0x220a24[_0xacaefe(0x157)]);}return _0x164561['filter'](_0x173b4f=>{const _0x109ba5=_0xacaefe,_0x380bac=_0x173b4f['folderId']?_0x4a749d[_0x109ba5(0x125)](_0x173b4f[_0x109ba5(0x15b)])||'':'',_0x586ebc=_0x380bac+':'+_0x173b4f[_0x109ba5(0x147)];if(_0x4bb6a0[_0x109ba5(0x13c)](_0x586ebc))return![];if(_0x5c5281)return _0x380bac===_0x2073c5||_0x380bac[_0x109ba5(0x150)](_0x2073c5+'/');return!![];});}export function buildSegmentLookupMap(_0x2a0131,_0x1e47ef){const _0x9e36c1=a119_0x51cd,_0x4bdce3=new Map();for(const _0x4d8168 of _0x2a0131){const _0x1d43e7=_0x4d8168[_0x9e36c1(0xc2)]?_0x1e47ef[_0x9e36c1(0x125)](_0x4d8168[_0x9e36c1(0xc2)][_0x9e36c1(0x13e)]())||'':'',_0x26127d=_0x1d43e7+':'+_0x4d8168['name'];_0x4bdce3[_0x9e36c1(0x121)](_0x26127d,_0x4d8168);}return _0x4bdce3;}export function buildSegmentNameToIdMap(_0x55b3b3){const _0xa08eab=a119_0x51cd,_0x9da8d4=new Map();for(const _0x54173e of _0x55b3b3){_0x9da8d4['set'](_0x54173e[_0xa08eab(0x157)],_0x54173e['id']);}return _0x9da8d4;}export function buildJourneyBundleLookupMap(_0x1f195e,_0x5a577e){const _0x3549b9=a119_0x51cd,_0x102fcf=new Map();for(const _0x35a766 of _0x1f195e){const _0x7523f5=_0x35a766['folderId']?_0x5a577e[_0x3549b9(0x125)](_0x35a766[_0x3549b9(0x15b)])||'':'',_0x44e2a3=_0x7523f5+':'+_0x35a766[_0x3549b9(0x147)];!_0x102fcf[_0x3549b9(0x13c)](_0x44e2a3)&&_0x102fcf['set'](_0x44e2a3,[]),_0x102fcf['get'](_0x44e2a3)['push'](_0x35a766);}for(const _0x2b26a8 of _0x102fcf[_0x3549b9(0xb3)]()){_0x2b26a8[_0x3549b9(0xc0)]((_0x33f0fd,_0xf19cfa)=>(_0x33f0fd[_0x3549b9(0x88)]||0x0)-(_0xf19cfa[_0x3549b9(0x88)]||0x0));}return _0x102fcf;}export function collectFoldersToCreate(_0x22d60d,_0x4ea691){const _0x57945c=a119_0x51cd,_0x1bce93=new Set();for(const _0x368e34 of _0x22d60d){if(!_0x368e34)continue;if(_0x4ea691[_0x57945c(0x13c)](_0x368e34))continue;const _0x1b6cc0=_0x368e34[_0x57945c(0x14f)]('/');let _0x543510='';for(const _0xc75498 of _0x1b6cc0){_0x543510=_0x543510?_0x543510+'/'+_0xc75498:_0xc75498,!_0x4ea691[_0x57945c(0x13c)](_0x543510)&&_0x1bce93[_0x57945c(0xfc)](_0x543510);}}return _0x1bce93;}export function parseAndClassifyYamlFiles(_0x4ead5b,_0x47768d,_0x5ea58f){const _0x788818=a119_0x51cd,_0x141f11=[],_0x512970=[];for(const _0x8c0628 of _0x4ead5b){const _0x4f384c=a119_0x21e344['relative'](_0x47768d,a119_0x21e344[_0x788818(0x10e)](_0x8c0628)),_0x595a1b=_0x4f384c==='.'?'':_0x4f384c,_0x25df34=readFileSync(_0x8c0628,_0x788818(0x89)),_0x3028e1=a119_0x42591b[_0x788818(0x113)](_0x25df34);if(isJourneyDef(_0x3028e1)){const _0x4ede0a=a119_0x220318(_0x25df34);_0x512970['push']({'yamlConfig':_0x4ede0a,'folderPath':_0x595a1b,'sourcePath':_0x8c0628});}else{if(!_0x5ea58f?.[_0x788818(0x13d)]){const _0x4abe10=parseSegmentYamlFile(_0x25df34),_0x23788d=normalizeChildSegmentYaml(_0x4abe10);_0x141f11[_0x788818(0x152)]({'yamlConfig':_0x23788d,'folderPath':_0x595a1b,'sourcePath':_0x8c0628});}}}return{'segments':_0x141f11,'journeys':_0x512970};}export function validateParsedFiles(_0x1c5301,_0x115653){const _0x3c3f26=a119_0x51cd,_0x579c02=[];for(const {yamlConfig:_0x573b9d,sourcePath:_0x3428a4}of _0x1c5301[_0x3c3f26(0xf9)]){const _0x5cf09b=readFileSync(_0x3428a4,_0x3c3f26(0x89)),_0x3fd166=a119_0x42591b[_0x3c3f26(0xed)](_0x5cf09b),_0x4d9a84=validateSegmentDef(_0x573b9d,{'source':_0x5cf09b,'document':_0x3fd166});if(!_0x4d9a84[_0x3c3f26(0x143)]){const _0x35014e=a119_0x21e344['relative'](_0x115653,_0x3428a4);_0x579c02['push']({'filePath':_0x35014e,'source':_0x5cf09b,'result':_0x4d9a84,'isJourney':![]});}}for(const {yamlConfig:_0x4c406a,sourcePath:_0x3a34ea}of _0x1c5301[_0x3c3f26(0xe4)]){const _0x108ba2=readFileSync(_0x3a34ea,_0x3c3f26(0x89)),_0x1b8306=a119_0x42591b[_0x3c3f26(0xed)](_0x108ba2),_0x4e262f=validateJourneyDef(_0x4c406a,{'source':_0x108ba2,'document':_0x1b8306});if(!_0x4e262f[_0x3c3f26(0x143)]){const _0x2f6b16=a119_0x21e344['relative'](_0x115653,_0x3a34ea);_0x579c02[_0x3c3f26(0x152)]({'filePath':_0x2f6b16,'source':_0x108ba2,'result':_0x4e262f,'isJourney':!![]});}}return _0x579c02;}export function formatValidationErrors(_0x42056e){const _0x4c7450=a119_0x51cd,_0x2009ef=[];for(const {filePath:_0x3c552c,source:_0x430c53,result:_0x4d122e,isJourney:_0x688a89}of _0x42056e){const _0x44673a=_0x688a89?_0x4c7450(0x92):_0x4c7450(0x8e);_0x2009ef[_0x4c7450(0x152)]('\x0a'+_0x3c552c+'\x20('+_0x44673a+_0x4c7450(0x144)+_0x4d122e[_0x4c7450(0x10c)]['length']+_0x4c7450(0xc7)),_0x2009ef[_0x4c7450(0x152)](formatValidationResult(_0x4d122e,_0x430c53,_0x3c552c));}return _0x2009ef[_0x4c7450(0x128)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x47cb75){const _0xdc34ea=a119_0x51cd,_0x308581=new Set(),_0x2460a9=new Map(),_0x7f60ae=collectSegmentUsageCounts(_0x47cb75);if(_0x47cb75[_0xdc34ea(0xf9)])for(const [_0x3b43f3,_0x41a619]of Object[_0xdc34ea(0xd6)](_0x47cb75['segments'])){_0x308581[_0xdc34ea(0xfc)](_0x3b43f3);if(_0x41a619[_0xdc34ea(0x80)]){const _0x2f7d64=yamlRuleToApi(_0x41a619[_0xdc34ea(0x80)]),_0x3f1530=apiRuleToYaml(_0x2f7d64);_0x2460a9[_0xdc34ea(0x121)](_0x3b43f3,_0x3f1530);}}const _0x4f1fd7=new Map();let _0x552bce=0x0;for(const [_0x321a62,_0x53af0f]of _0x2460a9){const _0xf77772=serializeExpandedRule(_0x53af0f,_0x2460a9),_0x15941b=_0x4f1fd7['get'](_0xf77772)||[];_0x15941b[_0xdc34ea(0x152)]({'name':_0x321a62,'index':_0x552bce}),_0x4f1fd7[_0xdc34ea(0x121)](_0xf77772,_0x15941b),_0x552bce++;}const _0x52f75b=new Map();for(const [_0x58db05,_0x5e0f9a]of _0x4f1fd7){const _0x647955=_0x5e0f9a['slice']()[_0xdc34ea(0xc0)]((_0xa67ab7,_0x4076a6)=>{const _0x1ed922=_0xdc34ea,_0xa22496=_0x7f60ae[_0x1ed922(0x125)](_0xa67ab7['name'])||0x0,_0x4c03c2=_0x7f60ae[_0x1ed922(0x125)](_0x4076a6[_0x1ed922(0x157)])||0x0;if(_0xa22496!==_0x4c03c2)return _0x4c03c2-_0xa22496;return _0xa67ab7['index']-_0x4076a6[_0x1ed922(0xee)];})['map'](_0x38678f=>_0x38678f['name']),_0x22a38a=[];for(const _0xbda188 of _0x647955){const _0x237057=_0x7f60ae[_0xdc34ea(0x125)](_0xbda188)||0x0,_0x466520=Math['max'](_0x237057,0x1);for(let _0x1d2c86=0x0;_0x1d2c86<_0x466520;_0x1d2c86++){_0x22a38a[_0xdc34ea(0x152)](_0xbda188);}}_0x52f75b[_0xdc34ea(0x121)](_0x58db05,_0x22a38a);}return{'existingLocalSegmentNames':_0x308581,'localSegmentRules':_0x2460a9,'localExpandedRuleToNames':_0x52f75b};}async function buildServerSegmentRuleMap(_0x3dac61,_0x2cbeef,_0x449604,_0x166c42){const _0x33a931=new Map(),_0x3a0363=new Set(),_0x24dcbb=async _0x5b22a3=>{const _0x1eb6af=a119_0x51cd;if(_0x3a0363['has'](_0x5b22a3))return;_0x3a0363[_0x1eb6af(0xfc)](_0x5b22a3);let _0x40e7d2=_0x449604[_0x1eb6af(0x124)](_0x1c6a92=>_0x1c6a92['id']===_0x5b22a3);if(!_0x40e7d2)try{_0x40e7d2=await _0x3dac61[_0x1eb6af(0x8e)][_0x1eb6af(0xc8)](_0x2cbeef,_0x5b22a3);}catch{return;}if(!_0x40e7d2?.[_0x1eb6af(0x80)])return;const _0x2fa231=apiRuleToYaml(_0x40e7d2['rule']);_0x33a931[_0x1eb6af(0x121)](_0x5b22a3,_0x2fa231);const _0x56ad51=collectSegmentRefsFromRule(_0x2fa231);for(const _0x3761d7 of _0x56ad51){await _0x24dcbb(_0x3761d7);}};for(const _0x39bf52 of _0x166c42){await _0x24dcbb(_0x39bf52);}return _0x33a931;}export function createSegmentIdResolver(_0x9b6628,_0x4e2650){return async _0x151176=>{const _0x456de7=a119_0x51cd,_0x5eb22b=_0x9b6628[_0x456de7(0x125)](_0x151176);if(!_0x5eb22b)throw new SDKError(ErrorCode[_0x456de7(0xff)],_0x456de7(0x83)+_0x151176+_0x456de7(0xfa)+_0x4e2650+'\x27)');return _0x5eb22b;};}export function extractRootFolderId(_0x24b2ca){const _0x4d09a7=a119_0x51cd;return _0x24b2ca['relationships']?.[_0x4d09a7(0xa4)]?.['data']?.['id']||_0x24b2ca[_0x4d09a7(0x79)]?.['parentFolder']?.[_0x4d09a7(0x8c)]?.['id'];}export function buildConnectionMaps(_0x8cec99){const _0x36e440=a119_0x51cd,_0x2ffb74=new Map(),_0x43194b=new Map(),_0x481b2d=new Map();for(const _0x15422b of _0x8cec99){_0x2ffb74[_0x36e440(0x121)](_0x15422b[_0x36e440(0x157)],parseInt(_0x15422b['id'],0xa)),_0x43194b[_0x36e440(0x121)](_0x15422b['id'],_0x15422b[_0x36e440(0x157)]),_0x481b2d[_0x36e440(0x121)](_0x15422b[_0x36e440(0x157)],_0x15422b[_0x36e440(0x93)]);}return{'nameToId':_0x2ffb74,'idToName':_0x43194b,'nameToType':_0x481b2d};}export function calculatePushStats(_0x1eaf2f,_0x123d0a,_0x3a68f3,_0x3ba77f,_0x1e562b,_0xfbc319,_0x16daff){const _0x4d7a27=a119_0x51cd,_0x868135=_0x1eaf2f[_0x4d7a27(0x148)](_0x368ee3=>_0x368ee3[_0x4d7a27(0x12b)]),_0x55adf5=_0x1eaf2f[_0x4d7a27(0x148)](_0x362a22=>!_0x362a22[_0x4d7a27(0x12b)]&&_0x362a22[_0x4d7a27(0x81)]),_0x3a7b98=_0x1eaf2f[_0x4d7a27(0x148)](_0x2fed3c=>!_0x2fed3c[_0x4d7a27(0x12b)]&&!_0x2fed3c[_0x4d7a27(0x81)]),_0x242766=_0xfbc319?_0x3ba77f:[],_0x16a669=_0x123d0a[_0x4d7a27(0x148)](_0xde73e3=>_0xde73e3[_0x4d7a27(0x12b)]),_0x44e259=_0x123d0a[_0x4d7a27(0x148)](_0x4168f5=>!_0x4168f5['isNew']&&_0x4168f5['hasChanges']),_0x31d05d=_0x123d0a[_0x4d7a27(0x148)](_0x370feb=>!_0x370feb[_0x4d7a27(0x12b)]&&!_0x370feb[_0x4d7a27(0x81)]),_0x5e74a7=_0xfbc319?_0x1e562b:[],_0x393fd0=_0x1eaf2f[_0x4d7a27(0x130)](_0x46fd34=>_0x46fd34[_0x4d7a27(0x14c)]),_0x7e8d0e=_0x393fd0[_0x4d7a27(0x148)](_0x27b2bf=>_0x27b2bf[_0x4d7a27(0x93)]===_0x4d7a27(0xc6)),_0x21045d=_0x393fd0['filter'](_0x244826=>_0x244826['type']===_0x4d7a27(0x11f)),_0x1b7523=_0x393fd0[_0x4d7a27(0x148)](_0x46b954=>_0x46b954['type']===_0x4d7a27(0x139)),_0x47e76f=Array[_0x4d7a27(0xcf)](_0x3a68f3)[_0x4d7a27(0xc0)](),_0xe0dc9e=_0x16daff?![]:_0x868135[_0x4d7a27(0xd2)]>0x0||_0x55adf5[_0x4d7a27(0xd2)]>0x0||_0x242766['length']>0x0,_0x3fae06=_0x16a669[_0x4d7a27(0xd2)]>0x0||_0x44e259['length']>0x0||_0x5e74a7[_0x4d7a27(0xd2)]>0x0,_0x96c745=_0x16daff?![]:_0x393fd0[_0x4d7a27(0xd2)]>0x0,_0x5b5132=_0x47e76f['length']>0x0;return{'segments':{'new':_0x868135,'changed':_0x55adf5,'unchanged':_0x3a7b98,'toDelete':_0x242766},'journeys':{'new':_0x16a669,'changed':_0x44e259,'unchanged':_0x31d05d,'toDelete':_0x5e74a7},'activations':{'all':_0x393fd0,'toCreate':_0x7e8d0e,'toUpdate':_0x21045d,'toDelete':_0x1b7523},'folders':{'toCreate':_0x47e76f},'counts':{'segments':{'new':_0x868135[_0x4d7a27(0xd2)],'changed':_0x55adf5[_0x4d7a27(0xd2)],'unchanged':_0x3a7b98['length'],'toDelete':_0x242766[_0x4d7a27(0xd2)]},'journeys':{'new':_0x16a669[_0x4d7a27(0xd2)],'changed':_0x44e259[_0x4d7a27(0xd2)],'unchanged':_0x31d05d['length'],'toDelete':_0x5e74a7['length']},'activations':{'create':_0x7e8d0e[_0x4d7a27(0xd2)],'update':_0x21045d[_0x4d7a27(0xd2)],'delete':_0x1b7523[_0x4d7a27(0xd2)]},'folders':_0x47e76f['length']},'hasChanges':_0xe0dc9e||_0x3fae06||_0x96c745||_0x5b5132};}function a119_0x4926(){const _0x5ab9be=['segment_updating','createActivation','journey_updating','connection','segment_deleting','keys','yamlConfig','connectionIdToNameMap','trim','journeys','slice','\x20journey\x20from\x20file:\x20','Deleted\x20activation\x20\x27','Fetching\x20','max','user','idToName','attributes','parseDocument','index','notification','updated','segment_deleted','branches','segmentId','\x27\x20for\x20','Created\x20segment\x20\x27','journey_entry_criteria_','action','waitCondition','segments','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','segment_updated','add','Updating\x20segment\x20\x27','resolveJourneyId','SEGMENT_NOT_FOUND','NOT_FOUND','nameToId','updateActivation','parentId','withProgress','journey_created','all','Entry\x20criteria:\x20','getActivation','activation_deleted','Name\x20has\x20already\x20been\x20taken','./journey-yaml.js','errors','folderPathToId','dirname','exitCriterias','journeyById','4520928krTysA','rootFolderId','parse','digest','hex','segment_created','10152603zZdlDP','createJourneySegment','folder','4WgDkBX','validatedRequest','deleted','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','goal\x20criteria','update','logSuccess','set','activationParams','16FICubs','find','get','journeyBundlesByFolderAndName','toLowerCase','join','deps','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','isNew','Deleted\x20segment\x20\x27','journey_updated','journeyActivationNameToId','listActivations','flatMap','isArray','stringify','WaitStep','journeyActivationStepId','existingSegment','JOURNEY_SYNTAX_ERROR','segmentNameToId',').\x20','delete','existingActivation','progress','has','skipSegments','toString','absolutePath','../../utils/async.js','createdSegmentIds','schedule','valid','):\x20','folderPath','Created\x20journey\x20\x27','journeyBundleName','filter','2009715yXTWZf','\x20(referenced\x20in\x20journey\x20','with','activationActions','\x27\x20decision\x20point\x20branch\x20\x27','5269660Uwswhg','split','startsWith','updateSegmentById','push','activation_updating','activation_template_id','Updated\x20segment\x20\x27','SEGMENT_UPDATE_ERROR','name','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','replace','2597077UqIFrS','folderId','embedded_segment_creating','Updated\x20journey\x20\x27','\x27\x20not\x20found\x20in\x20journey\x20\x27','kind','Activation\x20not\x20found:\x20','relationships','activationContext','ACTIVATION_SYNTAX_ERROR','entry_criteria','sha1','state','behavior','rule','hasChanges','journey_creating','Segment\x20not\x20found:\x20','includes','segment_creating','activation_created','idToEmailMap','versionNumber','utf-8','ACTIVATION_UPDATE_ERROR','logInfo','data','JOURNEY_UPDATE_ERROR','segment','\x0a\x20\x20','getJourney','existingSegments','journey','type','created','activationsBySegmentId','1IQDJge','object','SEGMENT_SYNTAX_ERROR','goal','Stage\x20\x27','\x27\x20from\x20file:\x20','\x20activation\x20\x27','map','onProgress','stage\x20\x27','description','Deleting\x20activation\x20\x27','item','embeddedSegmentNameToId','parentSegmentFolder','diff','\x27\x20wait\x20condition','Updated\x20activation\x20\x27','\x27\x20entry\x20criteria','Activation','createdSegmentId','DecisionPoint','2028126zaWoCi','entryCriteria','folder_created','journeyId','milestone','reduce','size','values','INTERNAL','activation_deleting','Creating\x20segment\x20\x27','activations','Creating\x20folder\x20\x27','existingJourney','journeyStages','logDeleted','Journey\x20\x27','stages','deleteSegment','2169818ekvyxO','sort','Updating\x20activation\x20\x27','segmentFolderId','list','localSegmentRules','embedded_activation_created','create','\x20error(s)','getSegment','steps','unchanged','110rQJVgS','verbose','yamlActivation','results','from','buildUserMaps','effectiveFolderId','length','Failed\x20to\x20','\x27...','activation_','entries','createFolder','Created\x20activation\x20\x27','./child-segment-yaml.js','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context'];a119_0x4926=function(){return _0x5ab9be;};return a119_0x4926();}export async function buildPushExecutionContext(_0x50a1bf,_0x54b1b2,_0x556433,_0x336272,_0x46e5ea,_0x2d3aa4){const _0x1acb73=a119_0x51cd,_0x523abb=extractRootFolderId(_0x556433),{pathToId:_0x3f164b,idToPath:_0x121ee6}=buildFolderMaps(_0x46e5ea),_0xb2751d=buildSegmentNameToIdMap(_0x336272),_0x14a68b=new Map(),{batchAsync:_0x2352bd}=await import(_0x1acb73(0x140)),[_0x5d0418,_0x3fd856]=await Promise[_0x1acb73(0x106)]([_0x50a1bf[_0x1acb73(0xea)][_0x1acb73(0xd0)](),_0x50a1bf[_0x1acb73(0xde)][_0x1acb73(0xc3)](),((async()=>{const _0x124e1e=_0x1acb73;!_0x2d3aa4&&_0x336272[_0x124e1e(0xd2)]>0x0&&await _0x2352bd(_0x336272,async _0x468588=>{const _0x7d8e=_0x124e1e,_0xb08098=await _0x50a1bf[_0x7d8e(0x8e)][_0x7d8e(0x12f)](_0x54b1b2,_0x468588['id']);_0x14a68b[_0x7d8e(0x121)](_0x468588['id'],_0xb08098);});})())]),{emailToId:_0x13d7b0,idToEmail:_0x34e5d0}=_0x5d0418,_0x219092=buildConnectionMaps(_0x3fd856);return{'rootFolderId':_0x523abb,'folderPathToId':_0x3f164b,'folderIdToPath':_0x121ee6,'segmentNameToId':_0xb2751d,'activationsBySegmentId':_0x14a68b,'emailToIdMap':_0x13d7b0,'idToEmailMap':_0x34e5d0,'connectionNameToIdMap':_0x219092[_0x1acb73(0x101)],'connectionIdToNameMap':_0x219092[_0x1acb73(0xeb)],'connectionNameToTypeMap':_0x219092['nameToType']};}export function createPushYamlContextForBundle(_0x1ba38a,_0x127e2f,_0x5b374d,_0x1c6b6a,_0xc2f305,_0x138c12,_0x4a823c,_0x3b7580){const {existingLocalSegmentNames:_0x2b3721,localExpandedRuleToNames:_0x389ea9}=_0x1c6b6a,_0xcfeeea=new Set(),_0x4a3fa3=new Map(),_0x46af58=new Map(),_0x122bb9=new Map(),_0xa364d4=createJumpTargetCache(),_0x2d4e96=new Map(),_0x32121c=new Map(),_0x2d85f0=new Set();let _0x10c842;const _0x2b762e=_0x156873=>{const _0x3714fb={'resolveSegment':async _0x2e241e=>{const _0x38bae1=a119_0x51cd,_0x49221a=_0x122bb9[_0x38bae1(0x125)](_0x2e241e);if(_0x49221a!==undefined)return{'name':_0x49221a,'isJourneyLocal':!![]};try{let _0x3459a4=_0x5b374d['find'](_0x1f92a3=>_0x1f92a3['id']===_0x2e241e);!_0x3459a4&&(_0x3459a4=await _0x1ba38a['segment'][_0x38bae1(0xc8)](_0x127e2f,_0x2e241e));const _0x4992c8=generateJourneyLocalName(_0x3459a4[_0x38bae1(0x157)]),_0x233626=_0x3459a4[_0x38bae1(0x77)]===SEGMENT_KIND_JOURNEY&&_0x4992c8!==undefined;let _0x292b71=_0x3459a4['name'],_0x21df19;if(_0x233626&&_0x3459a4[_0x38bae1(0x80)]){const _0x7c81ac=apiRuleToYaml(_0x3459a4[_0x38bae1(0x80)]);_0x32121c[_0x38bae1(0x121)](_0x2e241e,_0x7c81ac);const _0x226d4a=async _0x45a268=>{const _0x51de66=_0x38bae1,_0x288843=collectSegmentRefsFromRule(_0x45a268);for(const _0x51fdd1 of _0x288843){if(!_0x32121c['has'](_0x51fdd1))try{const _0x5f9a77=await _0x1ba38a[_0x51de66(0x8e)][_0x51de66(0xc8)](_0x127e2f,_0x51fdd1);if(_0x5f9a77?.[_0x51de66(0x80)]){const _0x358961=apiRuleToYaml(_0x5f9a77['rule']);_0x32121c[_0x51de66(0x121)](_0x51fdd1,_0x358961),await _0x226d4a(_0x358961);}}catch{}}};await _0x226d4a(_0x7c81ac);const _0x50c490=serializeExpandedRule(_0x7c81ac,_0x32121c),_0x580bca=_0x389ea9[_0x38bae1(0x125)](_0x50c490);if(_0x580bca&&_0x580bca[_0x38bae1(0xd2)]>0x0){const _0x910020=_0x4a3fa3[_0x38bae1(0x125)](_0x50c490)||0x0,_0x321068=_0x580bca[_0x910020]||_0x580bca[_0x580bca[_0x38bae1(0xd2)]-0x1];_0x4a3fa3['set'](_0x50c490,_0x910020+0x1),_0x292b71=_0x321068,_0xcfeeea['add'](_0x292b71),_0x122bb9[_0x38bae1(0x121)](_0x2e241e,_0x292b71);const _0x14a12b=await resolveRuleSegmentRefs(_0x7c81ac,async _0x54546f=>{const _0x375209=_0x38bae1,_0x17c2ea=_0x122bb9[_0x375209(0x125)](_0x54546f);if(_0x17c2ea)return _0x17c2ea;const _0x3c8903=await _0x10c842['resolveSegment'](_0x54546f);return _0x3c8903[_0x375209(0x157)];});_0x21df19={'description':_0x3459a4[_0x38bae1(0xa0)],'rule':_0x14a12b};}else{const _0x3ce1b9=_0x2d4e96[_0x38bae1(0x125)](_0x50c490);if(_0x3ce1b9)_0x292b71=_0x3ce1b9,_0x122bb9['set'](_0x2e241e,_0x292b71);else{if(_0x4992c8){let _0x269931=_0x4992c8,_0x4cac8d=0x2;while(_0xcfeeea[_0x38bae1(0x13c)](_0x269931)||_0x2b3721[_0x38bae1(0x13c)](_0x269931)){_0x269931=_0x4992c8+'_'+_0x4cac8d,_0x4cac8d++;}_0xcfeeea[_0x38bae1(0xfc)](_0x269931),_0x292b71=_0x269931;}_0x122bb9[_0x38bae1(0x121)](_0x2e241e,_0x292b71),_0x2d4e96[_0x38bae1(0x121)](_0x50c490,_0x292b71);const _0x35eb1e=await resolveRuleSegmentRefs(_0x7c81ac,async _0x38503f=>{const _0xdefd=_0x38bae1,_0x7be625=_0x122bb9[_0xdefd(0x125)](_0x38503f);if(_0x7be625)return _0x7be625;const _0xe9e73a=await _0x10c842['resolveSegment'](_0x38503f);return _0xe9e73a[_0xdefd(0x157)];});_0x21df19={'description':_0x3459a4[_0x38bae1(0xa0)],'rule':_0x35eb1e};}}}return{'name':_0x292b71,'isJourneyLocal':_0x233626,'definition':_0x21df19};}catch{return{'name':_0x2e241e,'isJourneyLocal':![]};}},'resolveActivation':async _0x2778b8=>{const _0x4d94dd=a119_0x51cd,_0x2c5d4b=_0x46af58['get'](_0x2778b8);if(_0x2c5d4b!==undefined)return{'name':_0x2c5d4b,'isJourneyLocal':!![]};try{let _0x48f89f=_0x4a823c?.[_0x4d94dd(0x125)](_0x2778b8);!_0x48f89f&&(_0x48f89f=await _0x1ba38a[_0x4d94dd(0x92)][_0x4d94dd(0x108)](_0x156873,_0x2778b8));const _0x2263f3=_0x48f89f['attributes'][_0x4d94dd(0x122)][_0x4d94dd(0x157)]||_0x2778b8,_0x5a78ae=sanitizeYamlKey(_0x2263f3)||_0x4d94dd(0xd5)+_0x2778b8,_0x4cae44=_0x5a78ae;_0x46af58[_0x4d94dd(0x121)](_0x2778b8,_0x4cae44);const _0x51cb79=journeyActivationStepToYaml(_0x48f89f,_0xc2f305,_0x138c12);return{'name':_0x4cae44,'isJourneyLocal':!![],'definition':_0x51cb79};}catch{return{'name':_0x2778b8,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x89bef3,_0xffb560)=>resolveJumpTarget(_0x89bef3,_0xffb560,_0xa364d4,async _0x12cb33=>{const _0x73d072=a119_0x51cd,_0x498a15=_0x3b7580?.['get'](_0x12cb33);if(_0x498a15)return _0x498a15;return _0x1ba38a[_0x73d072(0x92)][_0x73d072(0x90)](_0x12cb33);})};return _0x10c842=_0x3714fb,_0x3714fb;},_0x3eab5c=async _0x4f3a3f=>{const _0x620720=a119_0x51cd,{collectSegmentIdsFromJourneyApi:_0x1d6ff7}=await import('./journey-yaml.js'),{batchAsync:_0x596146}=await import(_0x620720(0x140)),_0x2c535c=new Set();for(const _0x4070d8 of _0x4f3a3f){let _0x25d854=_0x3b7580?.[_0x620720(0x125)](_0x4070d8);!_0x25d854&&(_0x25d854=await _0x1ba38a[_0x620720(0x92)][_0x620720(0x90)](_0x4070d8));const _0x1d3ee5=_0x1d6ff7(_0x25d854);for(const _0x16166c of _0x1d3ee5){_0x2c535c[_0x620720(0xfc)](_0x16166c);}}let _0x2743f9=Array[_0x620720(0xcf)](_0x2c535c);while(_0x2743f9[_0x620720(0xd2)]>0x0){const _0x205314=_0x2743f9[_0x620720(0x148)](_0x4473dc=>!_0x2d85f0[_0x620720(0x13c)](_0x4473dc));if(_0x205314[_0x620720(0xd2)]===0x0)break;const _0x4b1875=await _0x596146(_0x205314,async _0x10a18d=>{const _0x510751=_0x620720;_0x2d85f0[_0x510751(0xfc)](_0x10a18d);let _0x2b380f=_0x5b374d['find'](_0x36ffb4=>_0x36ffb4['id']===_0x10a18d);if(!_0x2b380f)try{_0x2b380f=await _0x1ba38a[_0x510751(0x8e)]['getSegment'](_0x127e2f,_0x10a18d);}catch{return null;}return{'segmentId':_0x10a18d,'segment':_0x2b380f};},0xa),_0x356502=new Set();for(const _0x15ebb3 of _0x4b1875){if(!_0x15ebb3?.[_0x620720(0x8e)]?.['rule'])continue;const _0x2942bb=apiRuleToYaml(_0x15ebb3[_0x620720(0x8e)][_0x620720(0x80)]);_0x32121c[_0x620720(0x121)](_0x15ebb3['segmentId'],_0x2942bb);const _0x235340=collectSegmentRefsFromRule(_0x2942bb);for(const _0x2a2197 of _0x235340){!_0x2d85f0[_0x620720(0x13c)](_0x2a2197)&&_0x356502['add'](_0x2a2197);}}_0x2743f9=Array[_0x620720(0xcf)](_0x356502);}};return{'createYamlContext':_0x2b762e,'prefetchJourneySegments':_0x3eab5c};}export async function executePushSegments(_0x42bb48,_0x47fbf1,_0x3c9dcd,_0x12895e,_0x5c1d88){const _0x478454=a119_0x51cd,{segmentDefToCreateRequest:_0x2c076e,segmentDefToUpdateRequest:_0x4cdc19}=await import('./child-segment-yaml.js'),_0x13986c=_0x3c9dcd['folderPathToId'],_0x10fe6e=0x5,_0x201f52=async _0x274b75=>{const _0x3dee2b=a119_0x51cd,_0x2a6cca=_0x274b75[_0x3dee2b(0x145)]?_0x13986c[_0x3dee2b(0x125)](_0x274b75['folderPath']):undefined;let _0xbf6323;const _0x4cf808={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x274b75[_0x3dee2b(0x12b)]){_0x5c1d88[_0x3dee2b(0x9e)]?.({'type':_0x3dee2b(0x85),'name':_0x274b75['yamlConfig'][_0x3dee2b(0x157)]});const _0x17e0e3=_0x2c076e(_0x274b75[_0x3dee2b(0xe1)],_0x2a6cca),_0x3b330b=await _0x5c1d88[_0x3dee2b(0x104)](_0x3dee2b(0xb6)+_0x274b75['yamlConfig'][_0x3dee2b(0x157)]+_0x3dee2b(0xd4),()=>_0x42bb48[_0x3dee2b(0x8e)]['createSegment'](_0x12895e[_0x3dee2b(0x103)],_0x17e0e3));_0xbf6323=_0x3b330b[_0x3dee2b(0x8c)]['id'],_0x4cf808[_0x3dee2b(0xaa)]={'name':_0x274b75[_0x3dee2b(0xe1)]['name'],'id':_0xbf6323},_0x5c1d88[_0x3dee2b(0x9e)]?.({'type':_0x3dee2b(0x116),'name':_0x274b75['yamlConfig']['name'],'segmentId':_0xbf6323}),_0x5c1d88[_0x3dee2b(0x120)]?.(_0x3dee2b(0xf5)+_0x274b75[_0x3dee2b(0xe1)][_0x3dee2b(0x157)]+'\x27'),_0x4cf808['created']=0x1;}else{if(_0x274b75['hasChanges']){_0x5c1d88['onProgress']?.({'type':_0x3dee2b(0xdb),'name':_0x274b75['yamlConfig']['name']});const _0x3122ff=_0x4cdc19(_0x274b75[_0x3dee2b(0xe1)]);_0x2a6cca!==_0x274b75[_0x3dee2b(0x135)]?.[_0x3dee2b(0xc2)]&&(_0x3122ff[_0x3dee2b(0xc2)]=_0x2a6cca?parseInt(_0x2a6cca,0xa):undefined),await _0x5c1d88['withProgress'](_0x3dee2b(0xfd)+_0x274b75[_0x3dee2b(0xe1)][_0x3dee2b(0x157)]+_0x3dee2b(0xd4),()=>_0x42bb48[_0x3dee2b(0x8e)][_0x3dee2b(0x151)](_0x12895e[_0x3dee2b(0x103)],_0x274b75[_0x3dee2b(0x135)]['id'],_0x3122ff)),_0xbf6323=_0x274b75['existingSegment']['id'],_0x5c1d88[_0x3dee2b(0x9e)]?.({'type':_0x3dee2b(0xfb),'name':_0x274b75['yamlConfig'][_0x3dee2b(0x157)]}),_0x5c1d88['logSuccess']?.(_0x3dee2b(0x155)+_0x274b75[_0x3dee2b(0xe1)]['name']+'\x27'),_0x4cf808[_0x3dee2b(0xf0)]=0x1;}else _0xbf6323=_0x274b75[_0x3dee2b(0x135)]['id'];}}catch(_0x54ec54){const _0x5499c0=isHttp400Error(_0x54ec54),_0x24663d=_0x5499c0?ErrorCode[_0x3dee2b(0x98)]:ErrorCode[_0x3dee2b(0x156)],_0x205bc6=getErrorMessage(_0x54ec54);throw new SDKError(_0x24663d,_0x3dee2b(0xd3)+(_0x274b75[_0x3dee2b(0x12b)]?_0x3dee2b(0xc6):_0x3dee2b(0x11f))+'\x20segment\x20from\x20file:\x20'+_0x274b75['absolutePath']+_0x3dee2b(0x8f)+_0x205bc6,_0x54ec54);}try{const _0x27258b=await syncActivationsForSegment(_0x42bb48,_0x12895e[_0x3dee2b(0x103)],_0xbf6323,_0x274b75[_0x3dee2b(0xe1)][_0x3dee2b(0x157)],_0x274b75[_0x3dee2b(0x14c)],_0x5c1d88,_0x274b75['absolutePath']);_0x4cf808['activations']=_0x27258b;}catch(_0x53296e){if(_0x53296e instanceof SDKError)throw _0x53296e;throw new SDKError(ErrorCode[_0x3dee2b(0x8a)],_0x3dee2b(0x158)+_0x274b75['yamlConfig'][_0x3dee2b(0x157)]+_0x3dee2b(0x9b)+_0x274b75['absolutePath']+'\x0a\x20\x20'+getErrorMessage(_0x53296e),_0x53296e);}return _0x4cf808;},_0x13714d=await batchAsync(_0x47fbf1,_0x201f52,_0x10fe6e),_0x5bb7a3={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x728202 of _0x13714d){_0x5bb7a3[_0x478454(0x94)]+=_0x728202[_0x478454(0x94)],_0x5bb7a3[_0x478454(0xf0)]+=_0x728202['updated'],_0x728202[_0x478454(0xaa)]&&_0x5bb7a3[_0x478454(0x141)]['set'](_0x728202[_0x478454(0xaa)][_0x478454(0x157)],_0x728202['createdSegmentId']['id']),_0x5bb7a3[_0x478454(0xb7)][_0x478454(0x94)]+=_0x728202['activations'][_0x478454(0x94)],_0x5bb7a3[_0x478454(0xb7)][_0x478454(0xf0)]+=_0x728202[_0x478454(0xb7)][_0x478454(0xf0)],_0x5bb7a3[_0x478454(0xb7)][_0x478454(0x11c)]+=_0x728202[_0x478454(0xb7)][_0x478454(0x11c)];}return _0x5bb7a3;}async function syncActivationsForSegment(_0xb268bf,_0x8e4458,_0x2d945a,_0x15523c,_0x337c80,_0x4d267e,_0x40f276){const _0x3fd81c=a119_0x51cd,_0x374e59={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1be4ef of _0x337c80){try{if(_0x1be4ef['type']==='create'&&_0x1be4ef['validatedRequest'])_0x4d267e[_0x3fd81c(0x9e)]?.({'type':'activation_creating','segmentName':_0x15523c,'activationName':_0x1be4ef['name']}),await _0x4d267e[_0x3fd81c(0x104)]('Creating\x20activation\x20\x27'+_0x1be4ef['name']+_0x3fd81c(0xd4),()=>_0xb268bf[_0x3fd81c(0x8e)][_0x3fd81c(0xdc)](_0x8e4458,_0x2d945a,_0x1be4ef[_0x3fd81c(0x11b)])),_0x4d267e[_0x3fd81c(0x9e)]?.({'type':_0x3fd81c(0x86),'segmentName':_0x15523c,'activationName':_0x1be4ef[_0x3fd81c(0x157)]}),_0x4d267e[_0x3fd81c(0x120)]?.(_0x3fd81c(0xd8)+_0x1be4ef[_0x3fd81c(0x157)]+'\x27'),_0x374e59['created']++;else{if(_0x1be4ef['type']===_0x3fd81c(0x11f)&&_0x1be4ef[_0x3fd81c(0x11b)]&&_0x1be4ef[_0x3fd81c(0x13a)])_0x4d267e[_0x3fd81c(0x9e)]?.({'type':_0x3fd81c(0x153),'segmentName':_0x15523c,'activationName':_0x1be4ef[_0x3fd81c(0x157)]}),await _0x4d267e[_0x3fd81c(0x104)](_0x3fd81c(0xc1)+_0x1be4ef[_0x3fd81c(0x157)]+_0x3fd81c(0xd4),()=>_0xb268bf[_0x3fd81c(0x8e)][_0x3fd81c(0x102)](_0x8e4458,_0x2d945a,_0x1be4ef[_0x3fd81c(0x13a)]['id'],_0x1be4ef[_0x3fd81c(0x11b)])),_0x4d267e[_0x3fd81c(0x9e)]?.({'type':'activation_updated','segmentName':_0x15523c,'activationName':_0x1be4ef[_0x3fd81c(0x157)]}),_0x4d267e[_0x3fd81c(0x120)]?.(_0x3fd81c(0xa7)+_0x1be4ef[_0x3fd81c(0x157)]+'\x27'),_0x374e59[_0x3fd81c(0xf0)]++;else _0x1be4ef[_0x3fd81c(0x93)]===_0x3fd81c(0x139)&&_0x1be4ef[_0x3fd81c(0x13a)]&&(_0x4d267e['onProgress']?.({'type':_0x3fd81c(0xb5),'segmentName':_0x15523c,'activationName':_0x1be4ef[_0x3fd81c(0x157)]}),await _0x4d267e[_0x3fd81c(0x104)](_0x3fd81c(0xa1)+_0x1be4ef[_0x3fd81c(0x157)]+_0x3fd81c(0xd4),()=>_0xb268bf[_0x3fd81c(0x8e)]['deleteActivation'](_0x8e4458,_0x2d945a,_0x1be4ef[_0x3fd81c(0x13a)]['id'])),_0x4d267e[_0x3fd81c(0x9e)]?.({'type':_0x3fd81c(0x109),'segmentName':_0x15523c,'activationName':_0x1be4ef['name']}),_0x4d267e[_0x3fd81c(0xbb)]?.(_0x3fd81c(0xe7)+_0x1be4ef[_0x3fd81c(0x157)]+'\x27'),_0x374e59[_0x3fd81c(0x11c)]++);}}catch(_0x460ef0){const _0x3a929c=isHttp400Error(_0x460ef0),_0x466cc9=_0x3a929c?ErrorCode[_0x3fd81c(0x7b)]:ErrorCode[_0x3fd81c(0x8a)],_0x430686=getErrorMessage(_0x460ef0);throw new SDKError(_0x466cc9,'Failed\x20to\x20'+_0x1be4ef[_0x3fd81c(0x93)]+_0x3fd81c(0x9c)+_0x1be4ef[_0x3fd81c(0x157)]+_0x3fd81c(0x9b)+_0x40f276+_0x3fd81c(0x8f)+_0x430686,_0x460ef0);}}return _0x374e59;}export async function executePushFolders(_0x4dd1a2,_0x32cbbb,_0x454500,_0x3a2ceb,_0x4d00bd){const _0x4e80b4=a119_0x51cd,_0x849e46=new Map(_0x454500);for(const _0x8a05b0 of _0x32cbbb){const _0x4d924a=_0x8a05b0[_0x4e80b4(0x14f)]('/'),_0x2c464f=_0x4d924a[_0x4d924a['length']-0x1],_0xb22db4=_0x4d924a[_0x4e80b4(0xe5)](0x0,-0x1)[_0x4e80b4(0x128)]('/'),_0x714a7c=_0x849e46[_0x4e80b4(0x125)](_0xb22db4);_0x4d00bd[_0x4e80b4(0x9e)]?.({'type':'folder_creating','folder':_0x8a05b0});const _0x4cab16={'name':_0x2c464f,'parentFolderId':_0x714a7c},_0x43bed0=await _0x4d00bd[_0x4e80b4(0x104)](_0x4e80b4(0xb8)+_0x8a05b0+_0x4e80b4(0xd4),()=>_0x4dd1a2['segment'][_0x4e80b4(0xd7)](_0x3a2ceb[_0x4e80b4(0x103)],_0x4cab16));_0x849e46[_0x4e80b4(0x121)](_0x8a05b0,_0x43bed0[_0x4e80b4(0x8c)]['id']),_0x4d00bd[_0x4e80b4(0x9e)]?.({'type':_0x4e80b4(0xae),'folder':_0x8a05b0,'folderId':_0x43bed0[_0x4e80b4(0x8c)]['id']}),_0x4d00bd[_0x4e80b4(0x8b)]?.('Created\x20folder\x20\x27'+_0x8a05b0+'\x27');}return _0x849e46;}export async function executePushSegmentDeletions(_0x3927f1,_0x2dab66,_0x49d4d7){const _0x90a8a4=a119_0x51cd;if(_0x2dab66['length']===0x0)return 0x0;const {batchAsync:_0x1faee7}=await import(_0x90a8a4(0x140)),_0x2cfce6=0x5,_0x25dd7d=await _0x1faee7(_0x2dab66,async _0x27411c=>{const _0x5e266a=_0x90a8a4;return _0x49d4d7[_0x5e266a(0x9e)]?.({'type':_0x5e266a(0xdf),'name':_0x27411c[_0x5e266a(0x157)]}),await _0x3927f1[_0x5e266a(0x8e)][_0x5e266a(0xbe)](_0x27411c['id']),_0x49d4d7[_0x5e266a(0x9e)]?.({'type':_0x5e266a(0xf1),'name':_0x27411c[_0x5e266a(0x157)]}),_0x49d4d7[_0x5e266a(0xbb)]?.(_0x5e266a(0x12c)+_0x27411c['name']+'\x27'),0x1;},_0x2cfce6);return _0x25dd7d[_0x90a8a4(0xb1)]((_0x15339d,_0x236dc5)=>_0x15339d+_0x236dc5,0x0);}export async function executePushJourneys(_0x51d39f,_0x5b8e14,_0x357511,_0x378471,_0xc87c6e){const _0x2360e3=a119_0x51cd,{journeyDefToRequest:_0x267d56}=await import(_0x2360e3(0x10b)),{activationDefToCreateRequest:_0x1dff52,yamlRuleToApi:_0x21ec17,validateSegmentRule:_0x285b2e}=await import(_0x2360e3(0xd9)),_0x3ede35={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3e2827=new Map(_0x357511[_0x2360e3(0x137)]),_0xe54236=0x5;for(let _0x3cfe3e=0x0;_0x3cfe3e<_0x5b8e14[_0x2360e3(0xd2)];_0x3cfe3e+=_0xe54236){const _0x4e2531=_0x5b8e14[_0x2360e3(0xe5)](_0x3cfe3e,_0x3cfe3e+_0xe54236),_0x5dae8b=await Promise[_0x2360e3(0x106)](_0x4e2531['map'](async _0x22693b=>{const _0x1aa814=_0x2360e3;if(!_0x22693b[_0x1aa814(0x12b)]&&!_0x22693b[_0x1aa814(0x81)])return{'action':_0x1aa814(0xca),'name':_0x22693b[_0x1aa814(0xe1)][_0x1aa814(0x157)],'journeyId':_0x22693b[_0x1aa814(0xb9)]?.['id']};const _0x4da37b=_0x22693b[_0x1aa814(0x145)]?_0x357511[_0x1aa814(0x10d)][_0x1aa814(0x125)](_0x22693b[_0x1aa814(0x145)]):undefined;_0xc87c6e[_0x1aa814(0x9e)]?.({'type':_0x22693b[_0x1aa814(0x12b)]?_0x1aa814(0x82):_0x1aa814(0xdd),'name':_0x22693b[_0x1aa814(0xe1)][_0x1aa814(0x157)]});try{const _0x48861d=await executeSingleJourneyPush(_0x51d39f,_0x22693b,{..._0x357511,'segmentNameToId':_0x3e2827},{'parentId':_0x378471[_0x1aa814(0x103)],'rootFolderId':_0x378471[_0x1aa814(0x112)],'folderId':_0x4da37b,'verbose':_0x378471[_0x1aa814(0xcc)]},_0xc87c6e,{'journeyDefToRequest':_0x267d56,'activationDefToCreateRequest':_0x1dff52,'yamlRuleToApi':_0x21ec17,'validateSegmentRule':_0x285b2e});for(const [_0x333a41,_0x473df3]of _0x48861d['embeddedSegmentNameToId']){_0x3e2827[_0x1aa814(0x121)](_0x333a41,_0x473df3),_0x3ede35[_0x1aa814(0xa3)][_0x1aa814(0x121)](_0x333a41,_0x473df3);}if(_0x48861d[_0x1aa814(0xf7)]===_0x1aa814(0x94))_0xc87c6e[_0x1aa814(0x9e)]?.({'type':_0x1aa814(0x105),'name':_0x22693b['yamlConfig'][_0x1aa814(0x157)],'journeyId':_0x48861d[_0x1aa814(0xaf)]}),_0xc87c6e['logSuccess']?.(_0x1aa814(0x146)+_0x22693b[_0x1aa814(0xe1)][_0x1aa814(0x157)]+'\x27'),_0x3ede35[_0x1aa814(0x94)]++;else _0x48861d[_0x1aa814(0xf7)]===_0x1aa814(0xf0)&&(_0xc87c6e[_0x1aa814(0x9e)]?.({'type':_0x1aa814(0x12d),'name':_0x22693b[_0x1aa814(0xe1)][_0x1aa814(0x157)]}),_0xc87c6e['logSuccess']?.(_0x1aa814(0x75)+_0x22693b['yamlConfig'][_0x1aa814(0x157)]+'\x27'),_0x3ede35[_0x1aa814(0xf0)]++);return{'action':_0x48861d[_0x1aa814(0xf7)],'name':_0x22693b['yamlConfig'][_0x1aa814(0x157)],'journeyId':_0x48861d[_0x1aa814(0xaf)]};}catch(_0x9584bb){const _0x5c36df=isHttp400Error(_0x9584bb),_0x4614b7=_0x5c36df?ErrorCode[_0x1aa814(0x136)]:ErrorCode[_0x1aa814(0x8d)],_0xe1e2dc=getErrorMessage(_0x9584bb);throw new SDKError(_0x4614b7,'Failed\x20to\x20'+(_0x22693b[_0x1aa814(0x12b)]?_0x1aa814(0xc6):_0x1aa814(0x11f))+_0x1aa814(0xe6)+_0x22693b[_0x1aa814(0x13f)]+_0x1aa814(0x8f)+_0xe1e2dc,_0x9584bb);}}));_0x3ede35[_0x2360e3(0xce)]['push'](..._0x5dae8b);}return _0x3ede35;}async function executeSingleJourneyPush(_0xce4a81,_0x514216,_0x217d4d,_0x545cf1,_0x5bab44,_0x314d82){const _0x31de02=a119_0x51cd,{journeyDefToRequest:_0x49104c,activationDefToCreateRequest:_0x3f6817,yamlRuleToApi:_0x3fc7f8,validateSegmentRule:_0x10d857}=_0x314d82,_0x2f5201=new Map(),_0x257a0a=new Map(),_0x1cc56f=new Map(),_0xe9176c=new Map(),_0x1c2b67=new Map();let _0x59fc93;const _0x169f1a=async()=>{const _0x3e67dc=a119_0x51cd;if(_0x59fc93)return;_0x59fc93=new Map();if(!_0x514216[_0x3e67dc(0xb9)])return;const _0x4a91b0=await _0xce4a81[_0x3e67dc(0x92)]['listActivations'](_0x514216[_0x3e67dc(0xb9)]['id']);for(const _0x56fdef of _0x4a91b0){const _0x32bfd9=journeyActivationStepToYaml(_0x56fdef,_0x217d4d[_0x3e67dc(0x87)],_0x217d4d[_0x3e67dc(0xe2)]),_0x4058fb=activationSignature(_0x32bfd9);!_0x59fc93[_0x3e67dc(0x13c)](_0x4058fb)&&_0x59fc93[_0x3e67dc(0x121)](_0x4058fb,_0x56fdef['id']),_0x32bfd9['name']&&_0x257a0a[_0x3e67dc(0x121)](_0x32bfd9[_0x3e67dc(0x157)],_0x56fdef['id']);}};if(_0x514216[_0x31de02(0xb9)]&&_0x514216[_0x31de02(0xe1)][_0x31de02(0xf9)]){const _0x452d26=buildLocalExpandedRuleMappings(_0x514216[_0x31de02(0xe1)]),_0x3e196d=_0x452d26[_0x31de02(0xc4)];if(_0x3e196d[_0x31de02(0xb2)]>0x0){const _0x4bd636=new Map();for(const [_0x1aded1,_0x51f318]of _0x3e196d){const _0x1c2c0a=serializeExpandedRule(_0x51f318,_0x3e196d);_0x4bd636[_0x31de02(0x121)](_0x1aded1,_0x1c2c0a);}const _0xa628bc=collectSegmentIdsFromJourneyApi(_0x514216[_0x31de02(0xb9)]);if(_0xa628bc[_0x31de02(0xb2)]>0x0){const _0x2145fc=await buildServerSegmentRuleMap(_0xce4a81,_0x545cf1[_0x31de02(0x103)],_0x217d4d['existingSegments'],_0xa628bc);if(_0x2145fc[_0x31de02(0xb2)]>0x0){const _0x27c276=new Map();for(const [_0x3d0187,_0x33e988]of _0x2145fc){const _0xce685e=serializeExpandedRule(_0x33e988,_0x2145fc);!_0x27c276[_0x31de02(0x13c)](_0xce685e)&&_0x27c276['set'](_0xce685e,_0x3d0187);}for(const [_0x46ac7a,_0x37aedb]of _0x4bd636){const _0x54b34f=_0x27c276[_0x31de02(0x125)](_0x37aedb);_0x54b34f&&(_0x1c2b67[_0x31de02(0x121)](_0x46ac7a,_0x54b34f),_0x217d4d[_0x31de02(0x137)][_0x31de02(0x121)](_0x46ac7a,_0x54b34f));}}}}}const _0x14cb83={'resolveSegmentId':async _0x1c28f4=>{const _0x1ee040=_0x31de02,_0x7b75de=_0x217d4d[_0x1ee040(0x137)][_0x1ee040(0x125)](_0x1c28f4);if(!_0x7b75de)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1ee040(0x83)+_0x1c28f4+_0x1ee040(0x14a)+_0x514216[_0x1ee040(0xe1)]['name']+')');return _0x7b75de;},'resolveEmbeddedSegmentId':async(_0x203904,_0x564411)=>{const _0x5b0510=_0x31de02,_0x4563c9=_0x217d4d[_0x5b0510(0x137)][_0x5b0510(0x125)](_0x203904);if(_0x4563c9)return _0x4563c9;const _0x3553d3=_0x1c2b67[_0x5b0510(0x125)](_0x203904);if(_0x3553d3)return _0x217d4d[_0x5b0510(0x137)][_0x5b0510(0x121)](_0x203904,_0x3553d3),_0x3553d3;const _0x471028=_0x217d4d[_0x5b0510(0x91)][_0x5b0510(0x124)](_0x307d98=>_0x307d98[_0x5b0510(0x157)]===_0x203904);if(_0x471028)return _0x217d4d[_0x5b0510(0x137)][_0x5b0510(0x121)](_0x203904,_0x471028['id']),_0x471028['id'];if(_0x514216['isNew']){const {stageName:_0x1d66f3,criteriaName:_0x30cd42}=findSegmentCriteriaLocation(_0x514216[_0x5b0510(0xe1)],_0x203904);return _0x10d857(_0x203904,_0x564411[_0x5b0510(0x80)]),_0x1cc56f[_0x5b0510(0x121)](_0x203904,{'definition':_0x564411,'stageName':_0x1d66f3,'criteriaName':_0x30cd42}),createPendingSegmentId(_0x203904);}const _0x2d1b00=_0x514216[_0x5b0510(0xb9)]?.['id'];if(!_0x2d1b00)throw new SDKError(ErrorCode[_0x5b0510(0xb4)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x10d857(_0x203904,_0x564411['rule']);const _0x57a4c3=generateDeterministicJourneySegmentName(_0x514216[_0x5b0510(0xe1)]['name'],_0x203904),_0xfd93bb=_0x217d4d[_0x5b0510(0x91)][_0x5b0510(0x124)](_0x1d7bff=>_0x1d7bff[_0x5b0510(0x157)]===_0x57a4c3),_0x2cd6c2=createSegmentIdResolver(_0x217d4d[_0x5b0510(0x137)],_0x203904),_0x287e59=await resolveRuleSegmentIds(_0x564411[_0x5b0510(0x80)],_0x2cd6c2);let _0x48b649;if(_0xfd93bb)await _0xce4a81[_0x5b0510(0x8e)][_0x5b0510(0x151)](_0x545cf1['parentId'],_0xfd93bb['id'],{'description':_0x564411[_0x5b0510(0xa0)]||_0x5b0510(0x107)+_0x203904,'rule':_0x3fc7f8(_0x287e59,!![]),'countPopulation':!![]}),_0x48b649=_0xfd93bb['id'];else try{_0x48b649=await _0xce4a81[_0x5b0510(0x8e)][_0x5b0510(0x118)]({'name':_0x57a4c3,'description':_0x564411['description']||_0x5b0510(0x107)+_0x203904,'journeyId':_0x2d1b00,'rule':_0x3fc7f8(_0x287e59,!![]),'countPopulation':!![],'parentFolderId':_0x545cf1[_0x5b0510(0x112)]||'','audienceId':_0x545cf1[_0x5b0510(0x103)]});}catch(_0x62fac4){const _0x5b952c=_0x62fac4 instanceof Error&&_0x62fac4['message'][_0x5b0510(0x84)](_0x5b0510(0x10a));if(_0x5b952c){const _0x27c7c6=await _0xce4a81[_0x5b0510(0x8e)]['listSegments'](_0x545cf1[_0x5b0510(0x103)]),_0x4a5ff6=_0x27c7c6[_0x5b0510(0x124)](_0x149789=>_0x149789[_0x5b0510(0x157)]===_0x57a4c3);if(_0x4a5ff6)await _0xce4a81[_0x5b0510(0x8e)][_0x5b0510(0x151)](_0x545cf1[_0x5b0510(0x103)],_0x4a5ff6['id'],{'description':_0x564411['description']||_0x5b0510(0x107)+_0x203904,'rule':_0x3fc7f8(_0x287e59,!![]),'countPopulation':!![]}),_0x48b649=_0x4a5ff6['id'];else throw _0x62fac4;}else throw _0x62fac4;}return _0x217d4d['segmentNameToId']['set'](_0x203904,_0x48b649),_0x2f5201[_0x5b0510(0x121)](_0x203904,_0x48b649),_0x48b649;},'resolveActivationId':async _0x10d417=>{const _0x12a7f7=_0x31de02,_0x29d84c=_0x257a0a[_0x12a7f7(0x125)](_0x10d417);if(_0x29d84c)return _0x29d84c;if(_0x514216[_0x12a7f7(0xb9)]){await _0x169f1a();const _0x34ec13=_0x257a0a[_0x12a7f7(0x125)](_0x10d417);if(_0x34ec13)return _0x34ec13;}throw new SDKError(ErrorCode[_0x12a7f7(0x100)],_0x12a7f7(0x78)+_0x10d417+_0x12a7f7(0x14a)+_0x514216[_0x12a7f7(0xe1)][_0x12a7f7(0x157)]+_0x12a7f7(0x138)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x1ceaaf,_0x19c53f)=>{const _0x4d7f6c=_0x31de02,_0x558ecc=_0x257a0a['get'](_0x1ceaaf);if(_0x558ecc)return _0x558ecc;if(_0x514216['isNew'])return _0xe9176c[_0x4d7f6c(0x121)](_0x1ceaaf,_0x19c53f),createPendingActivationId(_0x1ceaaf);if(_0x514216[_0x4d7f6c(0xb9)]){await _0x169f1a();const _0x1585db=_0x257a0a[_0x4d7f6c(0x125)](_0x19c53f['name']);if(_0x1585db)return _0x257a0a[_0x4d7f6c(0x121)](_0x1ceaaf,_0x1585db),_0x1585db;const _0x21155c=activationSignature(_0x19c53f),_0x135fb1=_0x59fc93?.['get'](_0x21155c);if(_0x135fb1)return _0x257a0a[_0x4d7f6c(0x121)](_0x1ceaaf,_0x135fb1),_0x135fb1;const _0x2a8b29=await _0x3f6817(_0x19c53f,_0x217d4d[_0x4d7f6c(0x7a)]),_0x2890c6=await _0xce4a81[_0x4d7f6c(0x92)]['createActivation'](_0x514216['existingJourney']['id'],_0x2a8b29);return _0x257a0a[_0x4d7f6c(0x121)](_0x1ceaaf,_0x2890c6['id']),_0x2890c6['id'];}throw new SDKError(ErrorCode[_0x4d7f6c(0xb4)],_0x4d7f6c(0xda));},'resolveJourneyId':async _0x43978d=>{const _0x42bbab=_0x31de02;try{return await _0xce4a81[_0x42bbab(0x92)][_0x42bbab(0xfe)](_0x545cf1[_0x42bbab(0x103)],_0x43978d);}catch(_0xcb8abf){throw new SDKError(ErrorCode[_0x42bbab(0x100)],_0x42bbab(0xbc)+_0x43978d+_0x42bbab(0x11d)+_0x514216[_0x42bbab(0xe1)][_0x42bbab(0x157)]+'\x27)',_0xcb8abf);}},'resolveStageId':async(_0x635bd2,_0x131d3f)=>{const _0x23d1fa=_0x31de02,_0xcc8f92=await _0xce4a81[_0x23d1fa(0x92)][_0x23d1fa(0x90)](_0x635bd2),_0x65389c=_0xcc8f92['attributes'][_0x23d1fa(0xba)][_0x23d1fa(0x124)](_0x3728cd=>_0x3728cd['name']['toLowerCase']()===_0x131d3f[_0x23d1fa(0x127)]());if(!_0x65389c?.['id'])throw new SDKError(ErrorCode[_0x23d1fa(0x100)],_0x23d1fa(0x9a)+_0x131d3f+_0x23d1fa(0x76)+(_0xcc8f92[_0x23d1fa(0xec)][_0x23d1fa(0x147)]||_0xcc8f92[_0x23d1fa(0xec)][_0x23d1fa(0x157)])+'\x27');return _0x65389c['id'];}},_0x15a565=await _0x49104c(_0x514216[_0x31de02(0xe1)],_0x545cf1[_0x31de02(0x103)],_0x14cb83),_0x334d5e=_0x545cf1['folderId']||_0x545cf1[_0x31de02(0x112)];_0x334d5e&&(_0x15a565[_0x31de02(0x79)]={'parentFolder':{'data':{'id':_0x334d5e,'type':_0x31de02(0x119)}}});if(_0x514216[_0x31de02(0x12b)]){if(_0x1cc56f[_0x31de02(0xb2)]>0x0||_0xe9176c[_0x31de02(0xb2)]>0x0)return await executeThreeStepJourneyCreate(_0xce4a81,_0x514216,_0x15a565,{'pendingEmbeddedSegments':_0x1cc56f,'pendingEmbeddedActivations':_0xe9176c,'embeddedSegmentNameToId':_0x2f5201,'journeyActivationNameToId':_0x257a0a},{..._0x545cf1,'effectiveFolderId':_0x334d5e},_0x217d4d,_0x5bab44,_0x314d82);else{ensureJourneyDefaults(_0x15a565['attributes']);const _0x1cc486=await _0xce4a81['journey'][_0x31de02(0xc6)](_0x15a565);return{'action':_0x31de02(0x94),'journeyId':_0x1cc486['id'],'embeddedSegmentNameToId':_0x2f5201};}}else{if(_0x514216['hasChanges']&&_0x514216[_0x31de02(0xb9)])return ensureJourneyDefaults(_0x15a565[_0x31de02(0xec)]),await _0xce4a81[_0x31de02(0x92)]['update'](_0x514216[_0x31de02(0xb9)]['id'],_0x15a565),{'action':_0x31de02(0xf0),'journeyId':_0x514216[_0x31de02(0xb9)]['id'],'embeddedSegmentNameToId':_0x2f5201};}return{'action':'unchanged','journeyId':_0x514216[_0x31de02(0xb9)]?.['id'],'embeddedSegmentNameToId':_0x2f5201};}function findSegmentCriteriaLocation(_0x2e872c,_0x570cff){const _0x5236a1=a119_0x51cd,_0x372db9=_0x2e872c[_0x5236a1(0xbd)]||_0x2e872c[_0x5236a1(0xe4)]?.[0x0]?.['stages']||[];let _0x161b90='entry',_0x3ce723=_0x570cff;const _0xd72900=_0x2e872c[_0x5236a1(0x99)]||_0x2e872c[_0x5236a1(0xe4)]?.[0x0]?.['goal'];if(_0xd72900?.[_0x5236a1(0x8e)]===_0x570cff)return{'stageName':_0x5236a1(0x99),'criteriaName':_0xd72900['name']||_0x570cff};_0x362482:for(const _0x3174c6 of _0x372db9){if(_0x3174c6[_0x5236a1(0x7c)]?.[_0x5236a1(0x8e)]===_0x570cff){_0x161b90=_0x3174c6[_0x5236a1(0x157)],_0x3ce723=_0x3174c6[_0x5236a1(0x7c)][_0x5236a1(0x157)]||_0x570cff;break;}if(_0x3174c6[_0x5236a1(0xc9)])for(const _0x243db5 of _0x3174c6[_0x5236a1(0xc9)]){if(_0x243db5[_0x5236a1(0x93)]==='decision_point'&&_0x243db5[_0x5236a1(0x14b)]?.['branches'])for(const _0x394812 of _0x243db5[_0x5236a1(0x14b)][_0x5236a1(0xf2)]){if(_0x394812[_0x5236a1(0x8e)]===_0x570cff){_0x161b90=_0x3174c6[_0x5236a1(0x157)],_0x3ce723=_0x394812[_0x5236a1(0x157)]||_0x570cff;break _0x362482;}}}}return{'stageName':_0x161b90,'criteriaName':_0x3ce723};}async function executeThreeStepJourneyCreate(_0x680c34,_0x301694,_0x2b0afd,_0x503404,_0x4a7099,_0x6f0958,_0x198925,_0x94b906){const _0x1a8182=a119_0x51cd,{activationDefToCreateRequest:_0x24a963,yamlRuleToApi:_0x43e380}=_0x94b906,{pendingEmbeddedSegments:_0x482efb,pendingEmbeddedActivations:_0x4b2b8b,embeddedSegmentNameToId:_0x410454}=_0x503404,_0x321edb=JSON[_0x1a8182(0x113)](JSON['stringify'](_0x2b0afd));ensureJourneyDefaults(_0x321edb[_0x1a8182(0xec)]),stripPendingIds(_0x321edb);const _0x15f2f8=await _0x680c34['journey']['create'](_0x321edb),_0x58ef9f=_0x15f2f8['id'],_0x40c4b0=new Map();for(const _0xbf4749 of _0x15f2f8[_0x1a8182(0xec)][_0x1a8182(0xba)]){_0x40c4b0[_0x1a8182(0x121)](_0xbf4749[_0x1a8182(0x157)][_0x1a8182(0x127)](),_0xbf4749['id']);}for(const [_0x5657d2,{definition:_0x2dae35}]of _0x482efb){const _0x40cb09=generateDeterministicJourneySegmentName(_0x301694[_0x1a8182(0xe1)][_0x1a8182(0x157)],_0x5657d2);_0x198925[_0x1a8182(0x9e)]?.({'type':_0x1a8182(0x74),'journeyName':_0x301694[_0x1a8182(0xe1)]['name'],'segmentName':_0x5657d2});const _0x3326d1=createSegmentIdResolver(_0x6f0958[_0x1a8182(0x137)],_0x5657d2),_0xf9500e=await resolveRuleSegmentIds(_0x2dae35[_0x1a8182(0x80)],_0x3326d1),_0x3dca65=await _0x680c34[_0x1a8182(0x8e)]['createJourneySegment']({'name':_0x40cb09,'description':_0x2dae35['description']||_0x1a8182(0x107)+_0x5657d2,'journeyId':_0x58ef9f,'rule':_0x43e380(_0xf9500e,!![]),'countPopulation':!![],'parentFolderId':_0x4a7099[_0x1a8182(0xd1)]||'','audienceId':_0x4a7099['parentId']});_0x410454[_0x1a8182(0x121)](_0x5657d2,_0x3dca65),_0x6f0958[_0x1a8182(0x137)][_0x1a8182(0x121)](_0x5657d2,_0x3dca65),_0x198925[_0x1a8182(0x9e)]?.({'type':'embedded_segment_created','journeyName':_0x301694['yamlConfig'][_0x1a8182(0x157)],'segmentName':_0x5657d2});}const _0x5781f1=new Map();for(const [_0x2735cb,_0x214477]of _0x4b2b8b){_0x198925['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x301694['yamlConfig'][_0x1a8182(0x157)],'activationName':_0x2735cb});const _0x5d4e2a=await _0x24a963(_0x214477,_0x6f0958[_0x1a8182(0x7a)]),_0x249ea6=await _0x680c34[_0x1a8182(0x92)][_0x1a8182(0xdc)](_0x58ef9f,_0x5d4e2a);_0x5781f1[_0x1a8182(0x121)](_0x2735cb,_0x249ea6['id']),_0x503404[_0x1a8182(0x12e)][_0x1a8182(0x121)](_0x2735cb,_0x249ea6['id']),_0x198925[_0x1a8182(0x9e)]?.({'type':_0x1a8182(0xc5),'journeyName':_0x301694[_0x1a8182(0xe1)]['name'],'activationName':_0x2735cb});}const _0x1ee626=JSON[_0x1a8182(0x113)](JSON[_0x1a8182(0x132)](_0x2b0afd));return _0x1ee626['id']=_0x58ef9f,ensureJourneyDefaults(_0x1ee626['attributes']),resolvePendingIdsInRequest(_0x1ee626,_0x2b0afd,_0x40c4b0,_0x410454,_0x5781f1,_0x198925),await _0x680c34[_0x1a8182(0x92)][_0x1a8182(0x11f)](_0x58ef9f,_0x1ee626),{'action':_0x1a8182(0x94),'journeyId':_0x58ef9f,'embeddedSegmentNameToId':_0x410454};}function a119_0x51cd(_0x1ca9a5,_0x54978a){_0x1ca9a5=_0x1ca9a5-0x74;const _0x492643=a119_0x4926();let _0x51cdca=_0x492643[_0x1ca9a5];return _0x51cdca;}function stripPendingIds(_0x52ec8a){const _0x4b96a5=a119_0x51cd;for(const _0x38109 of _0x52ec8a['attributes'][_0x4b96a5(0xba)]||[]){_0x38109[_0x4b96a5(0xad)]?.[_0x4b96a5(0xf3)]&&isPendingSegmentId(_0x38109['entryCriteria'][_0x4b96a5(0xf3)])&&delete _0x38109[_0x4b96a5(0xad)];if(_0x38109[_0x4b96a5(0xc9)])for(const _0x1d86dc of Object[_0x4b96a5(0xe0)](_0x38109[_0x4b96a5(0xc9)])){const _0x33f454=_0x38109[_0x4b96a5(0xc9)][_0x1d86dc];_0x33f454['type']===_0x4b96a5(0xa9)&&_0x33f454[_0x4b96a5(0x134)]&&isPendingActivationId(_0x33f454[_0x4b96a5(0x134)])&&(_0x33f454[_0x4b96a5(0x134)]='');if(_0x33f454[_0x4b96a5(0x93)]===_0x4b96a5(0xab)&&_0x33f454[_0x4b96a5(0xf2)])for(const _0x2929d8 of _0x33f454[_0x4b96a5(0xf2)]){_0x2929d8[_0x4b96a5(0xf3)]&&isPendingSegmentId(_0x2929d8[_0x4b96a5(0xf3)])&&(_0x2929d8[_0x4b96a5(0xf3)]='');}_0x33f454['type']===_0x4b96a5(0x133)&&_0x33f454[_0x4b96a5(0xf8)]?.[_0x4b96a5(0xf3)]&&isPendingSegmentId(_0x33f454['waitCondition']['segmentId'])&&(_0x33f454['waitCondition'][_0x4b96a5(0xf3)]='');}}}function resolvePendingIdsInRequest(_0x3d986a,_0x530b96,_0x1ba5be,_0x40e036,_0x24cf2f,_0x31cb92){const _0x1c71a4=a119_0x51cd,_0x4bffc7=(_0x41f7fe,_0x41d1a1)=>{const _0xad1179=a119_0x51cd;if(!isPendingSegmentId(_0x41f7fe))return _0x41f7fe;const _0x76cc63=extractPendingSegmentName(_0x41f7fe),_0x1cc1ab=_0x40e036[_0xad1179(0x125)](_0x76cc63);return!_0x1cc1ab&&_0x31cb92['logWarning']?.(_0xad1179(0x12a)+_0x76cc63+_0xad1179(0xf4)+_0x41d1a1),_0x1cc1ab;};if(_0x3d986a[_0x1c71a4(0xec)][_0x1c71a4(0x99)]?.[_0x1c71a4(0xf3)]&&isPendingSegmentId(_0x3d986a[_0x1c71a4(0xec)][_0x1c71a4(0x99)][_0x1c71a4(0xf3)])){const _0x19ca61=_0x4bffc7(_0x3d986a[_0x1c71a4(0xec)][_0x1c71a4(0x99)][_0x1c71a4(0xf3)],_0x1c71a4(0x11e));_0x19ca61&&(_0x3d986a['attributes'][_0x1c71a4(0x99)][_0x1c71a4(0xf3)]=_0x19ca61);}for(const _0x4321dd of _0x3d986a[_0x1c71a4(0xec)][_0x1c71a4(0xba)]||[]){const _0x3cf891=_0x1ba5be['get'](_0x4321dd['name'][_0x1c71a4(0x127)]());_0x3cf891&&(_0x4321dd['id']=_0x3cf891);if(_0x4321dd['entryCriteria']?.[_0x1c71a4(0xf3)]&&isPendingSegmentId(_0x4321dd[_0x1c71a4(0xad)][_0x1c71a4(0xf3)])){const _0x3990cc=_0x4bffc7(_0x4321dd[_0x1c71a4(0xad)][_0x1c71a4(0xf3)],_0x1c71a4(0x9f)+_0x4321dd[_0x1c71a4(0x157)]+_0x1c71a4(0xa8));_0x3990cc&&(_0x4321dd[_0x1c71a4(0xad)]['segmentId']=_0x3990cc);}if(_0x4321dd['exitCriterias'])for(const _0x16eaa0 of _0x4321dd[_0x1c71a4(0x10f)]){if(_0x16eaa0[_0x1c71a4(0xf3)]&&isPendingSegmentId(_0x16eaa0[_0x1c71a4(0xf3)])){const _0x310f98=_0x4bffc7(_0x16eaa0[_0x1c71a4(0xf3)],'stage\x20\x27'+_0x4321dd['name']+'\x27\x20exit\x20criteria');_0x310f98&&(_0x16eaa0['segmentId']=_0x310f98);}}if(_0x4321dd[_0x1c71a4(0xb0)]?.[_0x1c71a4(0xf3)]&&isPendingSegmentId(_0x4321dd[_0x1c71a4(0xb0)]['segmentId'])){const _0x3b457f=_0x4bffc7(_0x4321dd[_0x1c71a4(0xb0)][_0x1c71a4(0xf3)],_0x1c71a4(0x9f)+_0x4321dd['name']+'\x27\x20milestone');_0x3b457f&&(_0x4321dd['milestone'][_0x1c71a4(0xf3)]=_0x3b457f);}if(_0x4321dd[_0x1c71a4(0xc9)]){const _0x3b24d1=_0x4db7d3=>_0x530b96['attributes'][_0x1c71a4(0xba)][_0x1c71a4(0x124)](_0x51f150=>_0x51f150[_0x1c71a4(0x157)][_0x1c71a4(0x127)]()===_0x4321dd[_0x1c71a4(0x157)][_0x1c71a4(0x127)]())?.[_0x1c71a4(0xc9)]?.[_0x4db7d3];for(const _0x1c1997 of Object[_0x1c71a4(0xe0)](_0x4321dd[_0x1c71a4(0xc9)])){const _0x7fda64=_0x4321dd[_0x1c71a4(0xc9)][_0x1c1997],_0x2c9048=_0x3b24d1(_0x1c1997);if(_0x7fda64[_0x1c71a4(0x93)]===_0x1c71a4(0xa9)&&_0x7fda64[_0x1c71a4(0x134)]&&(isPendingActivationId(_0x7fda64[_0x1c71a4(0x134)])||_0x7fda64[_0x1c71a4(0x134)]==='')){if(_0x2c9048?.['journeyActivationStepId']&&isPendingActivationId(_0x2c9048['journeyActivationStepId'])){const _0x511627=extractPendingActivationName(_0x2c9048[_0x1c71a4(0x134)]),_0x96daae=_0x24cf2f[_0x1c71a4(0x125)](_0x511627);_0x96daae&&(_0x7fda64[_0x1c71a4(0x134)]=_0x96daae);}}if(_0x7fda64[_0x1c71a4(0x93)]===_0x1c71a4(0xab)&&_0x7fda64[_0x1c71a4(0xf2)]&&_0x2c9048?.['branches'])for(let _0x31163f=0x0;_0x31163f<_0x7fda64[_0x1c71a4(0xf2)]['length'];_0x31163f++){const _0x8a12aa=_0x7fda64[_0x1c71a4(0xf2)][_0x31163f],_0x320422=_0x2c9048['branches'][_0x31163f];if(_0x320422?.['segmentId']&&isPendingSegmentId(_0x320422[_0x1c71a4(0xf3)])){const _0xd1b26d=_0x4bffc7(_0x320422['segmentId'],_0x1c71a4(0x9f)+_0x4321dd[_0x1c71a4(0x157)]+_0x1c71a4(0x14d)+(_0x8a12aa[_0x1c71a4(0x157)]||_0x31163f)+'\x27');_0xd1b26d&&(_0x8a12aa[_0x1c71a4(0xf3)]=_0xd1b26d);}}if(_0x7fda64['type']===_0x1c71a4(0x133)&&_0x7fda64['waitCondition']?.[_0x1c71a4(0xf3)]&&_0x2c9048?.['waitCondition']?.[_0x1c71a4(0xf3)]&&isPendingSegmentId(_0x2c9048[_0x1c71a4(0xf8)][_0x1c71a4(0xf3)])){const _0x344bbb=_0x4bffc7(_0x2c9048[_0x1c71a4(0xf8)]['segmentId'],_0x1c71a4(0x9f)+_0x4321dd['name']+_0x1c71a4(0xa6));_0x344bbb&&(_0x7fda64[_0x1c71a4(0xf8)]['segmentId']=_0x344bbb);}}}}}
@@ -1 +1 @@
1
- (function(_0x30f0a9,_0x15c291){const _0x343ca0=a120_0xdd4d,_0x5662f1=_0x30f0a9();while(!![]){try{const _0x4d930f=-parseInt(_0x343ca0(0xb0))/0x1+parseInt(_0x343ca0(0xb8))/0x2*(-parseInt(_0x343ca0(0xb5))/0x3)+-parseInt(_0x343ca0(0xb9))/0x4*(parseInt(_0x343ca0(0xb3))/0x5)+-parseInt(_0x343ca0(0xbb))/0x6*(parseInt(_0x343ca0(0xbc))/0x7)+parseInt(_0x343ca0(0xb1))/0x8*(parseInt(_0x343ca0(0xb2))/0x9)+parseInt(_0x343ca0(0xba))/0xa+parseInt(_0x343ca0(0xb4))/0xb;if(_0x4d930f===_0x15c291)break;else _0x5662f1['push'](_0x5662f1['shift']());}catch(_0x5e91cf){_0x5662f1['push'](_0x5662f1['shift']());}}}(a120_0x4fc5,0xb1375));export function buildFolderIdToPathMap(_0x24926f){const _0x1c3792=a120_0xdd4d,_0xdbb13c=new Map(),_0x220479=new Map();for(const _0x164117 of _0x24926f){_0x220479[_0x1c3792(0xbd)](_0x164117['id'],_0x164117);}const _0x110e3f=new Set();for(const _0x1633f7 of _0x24926f){!_0x1633f7['parentFolderId']&&_0x110e3f[_0x1c3792(0xad)](_0x1633f7['id']);}function _0x115121(_0x67e61){const _0x41423b=_0x1c3792;if(_0xdbb13c[_0x41423b(0xae)](_0x67e61['id']))return _0xdbb13c[_0x41423b(0xb7)](_0x67e61['id']);if(_0x110e3f[_0x41423b(0xae)](_0x67e61['id']))return _0xdbb13c[_0x41423b(0xbd)](_0x67e61['id'],''),'';if(_0x67e61['parentFolderId']){const _0xf7793=_0x220479[_0x41423b(0xb7)](_0x67e61['parentFolderId']);if(_0xf7793){const _0x52c2e2=_0x115121(_0xf7793),_0x581518=_0x52c2e2?_0x52c2e2+'/'+_0x67e61[_0x41423b(0xb6)]:_0x67e61[_0x41423b(0xb6)];return _0xdbb13c[_0x41423b(0xbd)](_0x67e61['id'],_0x581518),_0x581518;}}const _0x14c284=_0x67e61[_0x41423b(0xb6)];return _0xdbb13c[_0x41423b(0xbd)](_0x67e61['id'],_0x14c284),_0x14c284;}for(const _0x658d25 of _0x24926f){_0x115121(_0x658d25);}return _0xdbb13c;}function a120_0x4fc5(){const _0x1611e9=['parentFolderId','268028aHotVr','56YHrIvR','21699armHla','50lpMEMI','15155657uuNLmW','3BxcYGW','name','get','834810kfInju','323540uCnJQS','9762480hypQoB','96KNPiSI','65954SzQGNH','set','add','has'];a120_0x4fc5=function(){return _0x1611e9;};return a120_0x4fc5();}export function buildFolderPathToIdMap(_0x3dee55){const _0x3f6bf4=a120_0xdd4d,_0x1f0663=new Map(),_0x232a39=new Map();for(const _0x30d5f9 of _0x3dee55){_0x232a39[_0x3f6bf4(0xbd)](_0x30d5f9['id'],_0x30d5f9);}const _0x3c9e7f=new Set();for(const _0x1e12c8 of _0x3dee55){!_0x1e12c8[_0x3f6bf4(0xaf)]&&_0x3c9e7f[_0x3f6bf4(0xad)](_0x1e12c8['id']);}function _0x5ea4f3(_0x109ad6){const _0x3deeb7=_0x3f6bf4;if(_0x3c9e7f[_0x3deeb7(0xae)](_0x109ad6['id']))return'';if(_0x109ad6[_0x3deeb7(0xaf)]){const _0x1b6f9d=_0x232a39['get'](_0x109ad6['parentFolderId']);if(_0x1b6f9d){const _0x1dcc72=_0x5ea4f3(_0x1b6f9d);return _0x1dcc72?_0x1dcc72+'/'+_0x109ad6[_0x3deeb7(0xb6)]:_0x109ad6[_0x3deeb7(0xb6)];}}return _0x109ad6['name'];}for(const _0x2b618f of _0x3dee55){const _0x126247=_0x5ea4f3(_0x2b618f);_0x1f0663[_0x3f6bf4(0xbd)](_0x126247,_0x2b618f['id']);}return _0x1f0663;}function a120_0xdd4d(_0x39b418,_0x34fdf9){_0x39b418=_0x39b418-0xad;const _0x4fc549=a120_0x4fc5();let _0xdd4df2=_0x4fc549[_0x39b418];return _0xdd4df2;}export function buildFolderMaps(_0x349903){const _0x1d0429=a120_0xdd4d,_0x460beb=buildFolderIdToPathMap(_0x349903),_0x28ffe6=new Map();for(const [_0x44bf51,_0x15e92b]of _0x460beb){_0x28ffe6[_0x1d0429(0xbd)](_0x15e92b,_0x44bf51);}return{'idToPath':_0x460beb,'pathToId':_0x28ffe6};}export function getFolderPath(_0x29f3ea,_0x8cef54){if(!_0x29f3ea)return'';return _0x8cef54['get'](_0x29f3ea)??'';}
1
+ function a120_0x2657(_0x138e2c,_0x5911ae){_0x138e2c=_0x138e2c-0x1dd;const _0x1353eb=a120_0x1353();let _0x265752=_0x1353eb[_0x138e2c];return _0x265752;}(function(_0x181cf7,_0x35a07d){const _0x19006a=a120_0x2657,_0x34b390=_0x181cf7();while(!![]){try{const _0x61a64a=parseInt(_0x19006a(0x1e1))/0x1*(-parseInt(_0x19006a(0x1e0))/0x2)+-parseInt(_0x19006a(0x1ea))/0x3*(parseInt(_0x19006a(0x1ed))/0x4)+-parseInt(_0x19006a(0x1e8))/0x5+parseInt(_0x19006a(0x1e3))/0x6*(-parseInt(_0x19006a(0x1e7))/0x7)+-parseInt(_0x19006a(0x1e4))/0x8+parseInt(_0x19006a(0x1eb))/0x9+parseInt(_0x19006a(0x1e6))/0xa*(parseInt(_0x19006a(0x1de))/0xb);if(_0x61a64a===_0x35a07d)break;else _0x34b390['push'](_0x34b390['shift']());}catch(_0x1643b2){_0x34b390['push'](_0x34b390['shift']());}}}(a120_0x1353,0xec340));export function buildFolderIdToPathMap(_0x1ce6f7){const _0xb28daf=a120_0x2657,_0x118637=new Map(),_0x59155b=new Map();for(const _0x560832 of _0x1ce6f7){_0x59155b[_0xb28daf(0x1e5)](_0x560832['id'],_0x560832);}const _0x24930e=new Set();for(const _0x5e0226 of _0x1ce6f7){!_0x5e0226[_0xb28daf(0x1e9)]&&_0x24930e['add'](_0x5e0226['id']);}function _0x1b6524(_0x533777){const _0x6aa1f3=_0xb28daf;if(_0x118637[_0x6aa1f3(0x1dd)](_0x533777['id']))return _0x118637['get'](_0x533777['id']);if(_0x24930e['has'](_0x533777['id']))return _0x118637['set'](_0x533777['id'],''),'';if(_0x533777[_0x6aa1f3(0x1e9)]){const _0x567fae=_0x59155b[_0x6aa1f3(0x1e2)](_0x533777[_0x6aa1f3(0x1e9)]);if(_0x567fae){const _0x4943a5=_0x1b6524(_0x567fae),_0x4b2b34=_0x4943a5?_0x4943a5+'/'+_0x533777['name']:_0x533777[_0x6aa1f3(0x1ec)];return _0x118637[_0x6aa1f3(0x1e5)](_0x533777['id'],_0x4b2b34),_0x4b2b34;}}const _0x4f63fc=_0x533777[_0x6aa1f3(0x1ec)];return _0x118637['set'](_0x533777['id'],_0x4f63fc),_0x4f63fc;}for(const _0x589463 of _0x1ce6f7){_0x1b6524(_0x589463);}return _0x118637;}export function buildFolderPathToIdMap(_0x14eaf6){const _0x15ba00=a120_0x2657,_0x101723=new Map(),_0x36f2a3=new Map();for(const _0x1eafbe of _0x14eaf6){_0x36f2a3[_0x15ba00(0x1e5)](_0x1eafbe['id'],_0x1eafbe);}const _0x4af0f3=new Set();for(const _0x3b84b2 of _0x14eaf6){!_0x3b84b2[_0x15ba00(0x1e9)]&&_0x4af0f3[_0x15ba00(0x1df)](_0x3b84b2['id']);}function _0x5d4c9b(_0x4fc19b){const _0x340d24=_0x15ba00;if(_0x4af0f3['has'](_0x4fc19b['id']))return'';if(_0x4fc19b['parentFolderId']){const _0x5dbb1e=_0x36f2a3[_0x340d24(0x1e2)](_0x4fc19b[_0x340d24(0x1e9)]);if(_0x5dbb1e){const _0x463c07=_0x5d4c9b(_0x5dbb1e);return _0x463c07?_0x463c07+'/'+_0x4fc19b[_0x340d24(0x1ec)]:_0x4fc19b['name'];}}return _0x4fc19b[_0x340d24(0x1ec)];}for(const _0x32d58a of _0x14eaf6){const _0x3b9256=_0x5d4c9b(_0x32d58a);_0x101723[_0x15ba00(0x1e5)](_0x3b9256,_0x32d58a['id']);}return _0x101723;}function a120_0x1353(){const _0x30b22a=['parentFolderId','123ahvJdE','6120963GSAyLd','name','173836HzSjqi','has','2034483rtATog','add','3812386gMCimF','1omPZSS','get','10653666oaHDOQ','5169608kifKea','set','430piZOAK','7eabBWn','7778870vIIJBe'];a120_0x1353=function(){return _0x30b22a;};return a120_0x1353();}export function buildFolderMaps(_0x2878a0){const _0x1fa7b0=buildFolderIdToPathMap(_0x2878a0),_0x4884ce=new Map();for(const [_0x37b12f,_0x43d8a7]of _0x1fa7b0){_0x4884ce['set'](_0x43d8a7,_0x37b12f);}return{'idToPath':_0x1fa7b0,'pathToId':_0x4884ce};}export function getFolderPath(_0x4f70bb,_0x58a6f8){const _0x2bd534=a120_0x2657;if(!_0x4f70bb)return'';return _0x58a6f8[_0x2bd534(0x1e2)](_0x4f70bb)??'';}
@@ -1 +1 @@
1
- (function(_0x10e876,_0x2a032c){const _0x3cba1f=a121_0x194f,_0x4fa7d1=_0x10e876();while(!![]){try{const _0xf6126=parseInt(_0x3cba1f(0x9b))/0x1*(parseInt(_0x3cba1f(0x8f))/0x2)+-parseInt(_0x3cba1f(0x98))/0x3+-parseInt(_0x3cba1f(0x95))/0x4+-parseInt(_0x3cba1f(0xa8))/0x5+-parseInt(_0x3cba1f(0x83))/0x6+parseInt(_0x3cba1f(0xa9))/0x7*(parseInt(_0x3cba1f(0x94))/0x8)+-parseInt(_0x3cba1f(0x90))/0x9*(-parseInt(_0x3cba1f(0x92))/0xa);if(_0xf6126===_0x2a032c)break;else _0x4fa7d1['push'](_0x4fa7d1['shift']());}catch(_0x1b45cb){_0x4fa7d1['push'](_0x4fa7d1['shift']());}}}(a121_0x1680,0x27313));import a121_0x34425b from'path';import{parse as a121_0x57c1dd}from'yaml';function a121_0x194f(_0x17208e,_0x4bdb8a){_0x17208e=_0x17208e-0x7e;const _0x1680ee=a121_0x1680();let _0x194f9c=_0x1680ee[_0x17208e];return _0x194f9c;}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x4b13a2){const _0x4bf4de=a121_0x194f;if(!_0x4b13a2||_0x4b13a2['trim']()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x162a0a=_0x4b13a2[_0x4bf4de(0x96)]();if(_0x162a0a==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x4b13a2};const _0x551dca=_0x162a0a[_0x4bf4de(0x91)]('/')?_0x162a0a[_0x4bf4de(0xab)](0x1):_0x162a0a,_0x7cc54f=_0x551dca[_0x4bf4de(0x8a)]('/')[_0x4bf4de(0xa6)](_0x4e65d6=>_0x4e65d6!=='');if(_0x7cc54f['length']===0x0)throw new Error(_0x4bf4de(0x81));const _0x114888=_0x162a0a[_0x4bf4de(0x91)]('/')||!isRelativePathSegment(_0x7cc54f[0x0]);for(const _0xd1b621 of _0x7cc54f){validatePathSegment(_0xd1b621);}return{'segments':_0x7cc54f,'isAbsolute':_0x114888,'raw':_0x4b13a2};}function isRelativePathSegment(_0x3cc779){return _0x3cc779==='.'||_0x3cc779==='..';}function a121_0x1680(){const _0x105895=['parent_segment','.yml','isAbsolute','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','length','1450758LGfOfa','resolve','slice','join','journey','pop','replace','split','File\x20not\x20found:\x20','relative','Path\x20attempts\x20to\x20navigate\x20above\x20root','segment','6FOQzau','99CyAODg','startsWith','464420aMvGLi','No\x20tdx.json\x20found\x20for\x20file:\x20','8thkNIG','404536okMBRt','trim','test','96018PQUuuA','dirname','segments','67092BebbKX','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','endsWith','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Cannot\x20navigate\x20above\x20root','readFile','push','Relative\x20path\x20cannot\x20be\x20empty','tdx.json','parse','filter','Path\x20segment\x20cannot\x20be\x20empty','1162170FPRxRS','390320FkZOZV','root','substring','raw'];a121_0x1680=function(){return _0x105895;};return a121_0x1680();}function validatePathSegment(_0xa80549){const _0x146273=a121_0x194f;if(_0xa80549==='')throw new Error(_0x146273(0xa7));if(_0xa80549==='.'||_0xa80549==='..')return;if(/[\x00-\x1F\x7F]/[_0x146273(0x97)](_0xa80549))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0xa80549);if(_0xa80549!==_0xa80549[_0x146273(0x96)]()){}}export function validatePath(_0x3a19b2){const _0x2f076e=a121_0x194f;if(_0x3a19b2[_0x2f076e(0x9a)][_0x2f076e(0x82)]===0x0&&!_0x3a19b2[_0x2f076e(0x80)])throw new Error(_0x2f076e(0xa3));if(_0x3a19b2['isAbsolute']){if(_0x3a19b2[_0x2f076e(0x9a)][0x0]==='..')throw new Error(_0x2f076e(0x9f));let _0x1d83de=0x0;for(const _0x51c9ea of _0x3a19b2[_0x2f076e(0x9a)]){if(_0x51c9ea==='..'){if(_0x1d83de===0x0)throw new Error(_0x2f076e(0x8d));_0x1d83de--;}else _0x51c9ea!=='.'&&_0x1d83de++;}}}export function joinPaths(_0x126559,_0x58daf0){const _0x21dbf8=a121_0x194f;if(!_0x126559||_0x126559==='/')return _0x58daf0;if(!_0x58daf0||_0x58daf0==='.')return _0x126559;if(_0x58daf0[_0x21dbf8(0x91)]('/'))return _0x58daf0;const _0x11a2c9=parsePath(_0x126559),_0x485ce9=parsePath(_0x58daf0),_0x5ecbb4=[..._0x11a2c9['segments']];for(const _0x6ad06c of _0x485ce9[_0x21dbf8(0x9a)]){if(_0x6ad06c==='.')continue;else{if(_0x6ad06c==='..'){if(_0x5ecbb4['length']===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x5ecbb4[_0x21dbf8(0x88)]();}else _0x5ecbb4[_0x21dbf8(0xa2)](_0x6ad06c);}}const _0x1ac674=_0x5ecbb4[_0x21dbf8(0x86)]('/');return _0x11a2c9[_0x21dbf8(0xac)]['startsWith']('/')?'/'+_0x1ac674:_0x1ac674;}export function normalizePath(_0x498c30){const _0x11d244=a121_0x194f,_0x2f3f6c=parsePath(_0x498c30),_0x5bd29d=[];for(const _0x4c9891 of _0x2f3f6c['segments']){if(_0x4c9891==='.')continue;else{if(_0x4c9891==='..'){if(_0x5bd29d['length']===0x0){if(_0x2f3f6c[_0x11d244(0x80)])throw new Error(_0x11d244(0xa0));_0x5bd29d[_0x11d244(0xa2)]('..');}else _0x5bd29d[_0x5bd29d['length']-0x1]==='..'?_0x5bd29d[_0x11d244(0xa2)]('..'):_0x5bd29d[_0x11d244(0x88)]();}else _0x5bd29d['push'](_0x4c9891);}}if(_0x5bd29d[_0x11d244(0x82)]===0x0)return _0x2f3f6c[_0x11d244(0x80)]?'/':'.';const _0x2f37f9=_0x5bd29d[_0x11d244(0x86)]('/');return _0x2f3f6c[_0x11d244(0xac)][_0x11d244(0x91)]('/')?'/'+_0x2f37f9:_0x2f37f9;}export function getParentPath(_0x29bb0d){const _0x54e36e=a121_0x194f,_0x181249=parsePath(_0x29bb0d);if(_0x181249[_0x54e36e(0x9a)][_0x54e36e(0x82)]<=0x1)return'/';const _0x30877a=_0x181249[_0x54e36e(0x9a)][_0x54e36e(0x85)](0x0,-0x1)['join']('/');return _0x181249[_0x54e36e(0xac)][_0x54e36e(0x91)]('/')?'/'+_0x30877a:_0x30877a;}export function getBaseName(_0x58ffd4){const _0x49720a=a121_0x194f,_0x53acc5=parsePath(_0x58ffd4);return _0x53acc5[_0x49720a(0x9a)][_0x53acc5[_0x49720a(0x9a)][_0x49720a(0x82)]-0x1]||'';}export function isChildPath(_0x5ec20c,_0x2738de){const _0x2b0281=a121_0x194f,_0x11b76f=parsePath(_0x5ec20c),_0x251e4a=parsePath(_0x2738de);if(_0x11b76f[_0x2b0281(0x9a)]['length']<=_0x251e4a[_0x2b0281(0x9a)][_0x2b0281(0x82)])return![];for(let _0x5450ad=0x0;_0x5450ad<_0x251e4a[_0x2b0281(0x9a)][_0x2b0281(0x82)];_0x5450ad++){if(_0x11b76f[_0x2b0281(0x9a)][_0x5450ad]!==_0x251e4a[_0x2b0281(0x9a)][_0x5450ad])return![];}return!![];}export function splitPath(_0x79b6e0){const _0x35316b=a121_0x194f,_0x25f2df=parsePath(_0x79b6e0);if(_0x25f2df[_0x35316b(0x9a)][_0x35316b(0x82)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x25f2df[_0x35316b(0x9a)]['length']===0x1)return{'parent':_0x25f2df[_0x35316b(0x9a)][0x0]};return{'parent':_0x25f2df[_0x35316b(0x9a)][0x0],'child':_0x25f2df['segments'][_0x35316b(0x85)](0x1)['join']('/')};}export function isYamlFilePath(_0x2fa7a1){const _0xb2e773=a121_0x194f;return _0x2fa7a1[_0xb2e773(0x9d)](_0xb2e773(0x7f))||_0x2fa7a1[_0xb2e773(0x9d)]('.yaml');}export async function resolveYamlFilePath(_0x41f147,_0x9fb64b=nodeFileSystem){const _0x5cfaf9=a121_0x194f,_0xe9fa08=a121_0x34425b[_0x5cfaf9(0x84)](_0x41f147);if(!await _0x9fb64b['exists'](_0xe9fa08))throw new Error(_0x5cfaf9(0x8b)+_0x41f147);let _0x42c3e1=a121_0x34425b[_0x5cfaf9(0x99)](_0xe9fa08),_0x17f283=null,_0x508205=null;const _0x16b786=a121_0x34425b[_0x5cfaf9(0xa5)](_0x42c3e1)[_0x5cfaf9(0xaa)];while(_0x42c3e1!==_0x16b786){const _0x3bca53=a121_0x34425b['join'](_0x42c3e1,_0x5cfaf9(0xa4));if(await _0x9fb64b['exists'](_0x3bca53)){_0x17f283=_0x3bca53,_0x508205=_0x42c3e1;break;}_0x42c3e1=a121_0x34425b['dirname'](_0x42c3e1);}if(!_0x17f283||!_0x508205)throw new Error(_0x5cfaf9(0x93)+_0x41f147);const _0x4385af=await _0x9fb64b[_0x5cfaf9(0xa1)](_0x17f283),_0x4cce7b=JSON[_0x5cfaf9(0xa5)](_0x4385af),_0x477102=_0x4cce7b[_0x5cfaf9(0x7e)];if(!_0x477102)throw new Error(_0x5cfaf9(0x9e));const _0xccfe17=await _0x9fb64b[_0x5cfaf9(0xa1)](_0xe9fa08),_0x7c8e4d=a121_0x57c1dd(_0xccfe17),_0x548959=_0x7c8e4d['name'];if(!_0x548959)throw new Error(_0x5cfaf9(0x9c)+_0x41f147);const _0x41e4a7=_0x7c8e4d['type']===_0x5cfaf9(0x87)?_0x5cfaf9(0x87):_0x5cfaf9(0x8e),_0x34c363=a121_0x34425b[_0x5cfaf9(0x8c)](_0x508205,_0xe9fa08),_0x122b28=a121_0x34425b[_0x5cfaf9(0x99)](_0x34c363),_0x470f89=_0x122b28==='.'?'':_0x122b28[_0x5cfaf9(0x89)](/\\/g,'/'),_0x34a7e1=_0x470f89?_0x477102+'/'+_0x470f89+'/'+_0x548959:_0x477102+'/'+_0x548959;return{'parentSegment':_0x477102,'segmentName':_0x548959,'folderPath':_0x470f89,'fullPath':_0x34a7e1,'resourceType':_0x41e4a7};}
1
+ (function(_0x552447,_0x328901){const _0x52aecb=a121_0x5bfe,_0x365ad2=_0x552447();while(!![]){try{const _0x19f6f6=parseInt(_0x52aecb(0xb5))/0x1*(-parseInt(_0x52aecb(0xc4))/0x2)+-parseInt(_0x52aecb(0x9c))/0x3+parseInt(_0x52aecb(0xa5))/0x4+-parseInt(_0x52aecb(0xa2))/0x5+-parseInt(_0x52aecb(0xc5))/0x6*(parseInt(_0x52aecb(0xb4))/0x7)+parseInt(_0x52aecb(0xa0))/0x8+-parseInt(_0x52aecb(0xbb))/0x9*(-parseInt(_0x52aecb(0xb9))/0xa);if(_0x19f6f6===_0x328901)break;else _0x365ad2['push'](_0x365ad2['shift']());}catch(_0x36be27){_0x365ad2['push'](_0x365ad2['shift']());}}}(a121_0x336f,0x65357));import a121_0xafdfe9 from'path';import{parse as a121_0x23e860}from'yaml';function a121_0x336f(){const _0x8c8a91=['1278290rGURQr','364002IeYoPa','readFile','endsWith','root','split','134583NjxTwr','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','length','Path\x20cannot\x20be\x20empty','348792GEMeVT','trim','481800pSDbmx','dirname','segments','66636gelkbM','journey','isAbsolute','push','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','relative','parent_segment','pop','join','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','filter','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','63RBTeIp','1PFUCRD','Cannot\x20split\x20empty\x20path','.yml','File\x20not\x20found:\x20','16806620WnPlHq','raw','9fCJqZE','Path\x20attempts\x20to\x20navigate\x20above\x20root','test','substring','startsWith','slice','parse','type','exists'];a121_0x336f=function(){return _0x8c8a91;};return a121_0x336f();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x5579e7){const _0x46037c=a121_0x5bfe;if(!_0x5579e7||_0x5579e7[_0x46037c(0xa1)]()==='')throw new Error(_0x46037c(0x9f));const _0x2a5067=_0x5579e7['trim']();if(_0x2a5067==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5579e7};const _0x574ec3=_0x2a5067[_0x46037c(0xbf)]('/')?_0x2a5067[_0x46037c(0xbe)](0x1):_0x2a5067,_0x530702=_0x574ec3[_0x46037c(0x9b)]('/')[_0x46037c(0xb2)](_0x4da3aa=>_0x4da3aa!=='');if(_0x530702[_0x46037c(0x9e)]===0x0)throw new Error(_0x46037c(0xa9));const _0x1e0aa4=_0x2a5067[_0x46037c(0xbf)]('/')||!isRelativePathSegment(_0x530702[0x0]);for(const _0x2f2d5b of _0x530702){validatePathSegment(_0x2f2d5b);}return{'segments':_0x530702,'isAbsolute':_0x1e0aa4,'raw':_0x5579e7};}function isRelativePathSegment(_0x532953){return _0x532953==='.'||_0x532953==='..';}function validatePathSegment(_0x5cb61e){const _0x1bfdc8=a121_0x5bfe;if(_0x5cb61e==='')throw new Error(_0x1bfdc8(0xb0));if(_0x5cb61e==='.'||_0x5cb61e==='..')return;if(/[\x00-\x1F\x7F]/[_0x1bfdc8(0xbd)](_0x5cb61e))throw new Error(_0x1bfdc8(0x9d)+_0x5cb61e);if(_0x5cb61e!==_0x5cb61e[_0x1bfdc8(0xa1)]()){}}export function validatePath(_0x1e3712){const _0x32ea5d=a121_0x5bfe;if(_0x1e3712[_0x32ea5d(0xa4)][_0x32ea5d(0x9e)]===0x0&&!_0x1e3712['isAbsolute'])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x1e3712[_0x32ea5d(0xa7)]){if(_0x1e3712[_0x32ea5d(0xa4)][0x0]==='..')throw new Error(_0x32ea5d(0xae));let _0x5bb64a=0x0;for(const _0x3585a0 of _0x1e3712['segments']){if(_0x3585a0==='..'){if(_0x5bb64a===0x0)throw new Error(_0x32ea5d(0xbc));_0x5bb64a--;}else _0x3585a0!=='.'&&_0x5bb64a++;}}}function a121_0x5bfe(_0x4f4b3e,_0x1abf42){_0x4f4b3e=_0x4f4b3e-0x9b;const _0x336fab=a121_0x336f();let _0x5bfe44=_0x336fab[_0x4f4b3e];return _0x5bfe44;}export function joinPaths(_0xdab72,_0x2d7836){const _0x890d72=a121_0x5bfe;if(!_0xdab72||_0xdab72==='/')return _0x2d7836;if(!_0x2d7836||_0x2d7836==='.')return _0xdab72;if(_0x2d7836[_0x890d72(0xbf)]('/'))return _0x2d7836;const _0x215603=parsePath(_0xdab72),_0x336049=parsePath(_0x2d7836),_0x4e97d7=[..._0x215603[_0x890d72(0xa4)]];for(const _0x294f61 of _0x336049['segments']){if(_0x294f61==='.')continue;else{if(_0x294f61==='..'){if(_0x4e97d7[_0x890d72(0x9e)]===0x0)throw new Error(_0x890d72(0xb1));_0x4e97d7[_0x890d72(0xac)]();}else _0x4e97d7[_0x890d72(0xa8)](_0x294f61);}}const _0x510920=_0x4e97d7[_0x890d72(0xad)]('/');return _0x215603[_0x890d72(0xba)][_0x890d72(0xbf)]('/')?'/'+_0x510920:_0x510920;}export function normalizePath(_0x5099b9){const _0x455736=a121_0x5bfe,_0x198c3c=parsePath(_0x5099b9),_0x255fa3=[];for(const _0x47392d of _0x198c3c[_0x455736(0xa4)]){if(_0x47392d==='.')continue;else{if(_0x47392d==='..'){if(_0x255fa3[_0x455736(0x9e)]===0x0){if(_0x198c3c['isAbsolute'])throw new Error('Cannot\x20navigate\x20above\x20root');_0x255fa3[_0x455736(0xa8)]('..');}else _0x255fa3[_0x255fa3[_0x455736(0x9e)]-0x1]==='..'?_0x255fa3['push']('..'):_0x255fa3[_0x455736(0xac)]();}else _0x255fa3[_0x455736(0xa8)](_0x47392d);}}if(_0x255fa3[_0x455736(0x9e)]===0x0)return _0x198c3c[_0x455736(0xa7)]?'/':'.';const _0x51ff5e=_0x255fa3[_0x455736(0xad)]('/');return _0x198c3c['raw'][_0x455736(0xbf)]('/')?'/'+_0x51ff5e:_0x51ff5e;}export function getParentPath(_0x2d2e0d){const _0x4d836f=a121_0x5bfe,_0x21bd38=parsePath(_0x2d2e0d);if(_0x21bd38[_0x4d836f(0xa4)][_0x4d836f(0x9e)]<=0x1)return'/';const _0x2aa11b=_0x21bd38['segments'][_0x4d836f(0xc0)](0x0,-0x1)['join']('/');return _0x21bd38[_0x4d836f(0xba)]['startsWith']('/')?'/'+_0x2aa11b:_0x2aa11b;}export function getBaseName(_0x55e7ed){const _0x221b10=a121_0x5bfe,_0xbd0d4=parsePath(_0x55e7ed);return _0xbd0d4[_0x221b10(0xa4)][_0xbd0d4[_0x221b10(0xa4)][_0x221b10(0x9e)]-0x1]||'';}export function isChildPath(_0x28d829,_0xaedc1e){const _0xb769a=a121_0x5bfe,_0x7f0c14=parsePath(_0x28d829),_0x265ba3=parsePath(_0xaedc1e);if(_0x7f0c14[_0xb769a(0xa4)][_0xb769a(0x9e)]<=_0x265ba3[_0xb769a(0xa4)][_0xb769a(0x9e)])return![];for(let _0x18d8bb=0x0;_0x18d8bb<_0x265ba3[_0xb769a(0xa4)][_0xb769a(0x9e)];_0x18d8bb++){if(_0x7f0c14[_0xb769a(0xa4)][_0x18d8bb]!==_0x265ba3[_0xb769a(0xa4)][_0x18d8bb])return![];}return!![];}export function splitPath(_0x16a85a){const _0x3278d0=a121_0x5bfe,_0x407d24=parsePath(_0x16a85a);if(_0x407d24[_0x3278d0(0xa4)][_0x3278d0(0x9e)]===0x0)throw new Error(_0x3278d0(0xb6));if(_0x407d24[_0x3278d0(0xa4)]['length']===0x1)return{'parent':_0x407d24['segments'][0x0]};return{'parent':_0x407d24[_0x3278d0(0xa4)][0x0],'child':_0x407d24[_0x3278d0(0xa4)][_0x3278d0(0xc0)](0x1)['join']('/')};}export function isYamlFilePath(_0x2b5417){const _0x5cbd15=a121_0x5bfe;return _0x2b5417['endsWith'](_0x5cbd15(0xb7))||_0x2b5417[_0x5cbd15(0xc7)]('.yaml');}export async function resolveYamlFilePath(_0x50eedf,_0x59ab96=nodeFileSystem){const _0x24c9c2=a121_0x5bfe,_0x24547a=a121_0xafdfe9['resolve'](_0x50eedf);if(!await _0x59ab96[_0x24c9c2(0xc3)](_0x24547a))throw new Error(_0x24c9c2(0xb8)+_0x50eedf);let _0x56fb71=a121_0xafdfe9['dirname'](_0x24547a),_0x485f82=null,_0x556c42=null;const _0x5a4155=a121_0xafdfe9[_0x24c9c2(0xc1)](_0x56fb71)[_0x24c9c2(0xc8)];while(_0x56fb71!==_0x5a4155){const _0x4a79f7=a121_0xafdfe9['join'](_0x56fb71,'tdx.json');if(await _0x59ab96[_0x24c9c2(0xc3)](_0x4a79f7)){_0x485f82=_0x4a79f7,_0x556c42=_0x56fb71;break;}_0x56fb71=a121_0xafdfe9[_0x24c9c2(0xa3)](_0x56fb71);}if(!_0x485f82||!_0x556c42)throw new Error(_0x24c9c2(0xaf)+_0x50eedf);const _0x386ec1=await _0x59ab96['readFile'](_0x485f82),_0x5930fe=JSON['parse'](_0x386ec1),_0x417a6c=_0x5930fe[_0x24c9c2(0xab)];if(!_0x417a6c)throw new Error(_0x24c9c2(0xb3));const _0x5c4caf=await _0x59ab96[_0x24c9c2(0xc6)](_0x24547a),_0x282c21=a121_0x23e860(_0x5c4caf),_0x1ce02e=_0x282c21['name'];if(!_0x1ce02e)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x50eedf);const _0x2dff3b=_0x282c21[_0x24c9c2(0xc2)]===_0x24c9c2(0xa6)?_0x24c9c2(0xa6):'segment',_0x576435=a121_0xafdfe9[_0x24c9c2(0xaa)](_0x556c42,_0x24547a),_0x5bb1ef=a121_0xafdfe9['dirname'](_0x576435),_0x299ee9=_0x5bb1ef==='.'?'':_0x5bb1ef['replace'](/\\/g,'/'),_0x2e1067=_0x299ee9?_0x417a6c+'/'+_0x299ee9+'/'+_0x1ce02e:_0x417a6c+'/'+_0x1ce02e;return{'parentSegment':_0x417a6c,'segmentName':_0x1ce02e,'folderPath':_0x299ee9,'fullPath':_0x2e1067,'resourceType':_0x2dff3b};}
@@ -1 +1 @@
1
- (function(_0x1fcacf,_0x265bee){const _0x130fa8=a122_0x2117,_0x532cba=_0x1fcacf();while(!![]){try{const _0x7ed017=-parseInt(_0x130fa8(0xc6))/0x1+-parseInt(_0x130fa8(0xd0))/0x2*(parseInt(_0x130fa8(0xc4))/0x3)+parseInt(_0x130fa8(0xcf))/0x4*(-parseInt(_0x130fa8(0xc5))/0x5)+parseInt(_0x130fa8(0xc8))/0x6+-parseInt(_0x130fa8(0xc9))/0x7*(parseInt(_0x130fa8(0xcd))/0x8)+-parseInt(_0x130fa8(0xce))/0x9+parseInt(_0x130fa8(0xcb))/0xa;if(_0x7ed017===_0x265bee)break;else _0x532cba['push'](_0x532cba['shift']());}catch(_0x3ce782){_0x532cba['push'](_0x532cba['shift']());}}}(a122_0x1bd9,0x31177));function a122_0x2117(_0x5b459e,_0x5983a5){_0x5b459e=_0x5b459e-0xc3;const _0x1bd980=a122_0x1bd9();let _0x211798=_0x1bd980[_0x5b459e];return _0x211798;}function a122_0x1bd9(){const _0x25d088=['87872hysZil','.\x20Child\x20name\x20cannot\x20be\x20empty','6XFFkuY','1190nikhgo','37167VYasQe','indexOf','845262vXyLeI','350147DSnjLz','substring','7906380VyJqkD','Invalid\x20segment\x20reference\x20format:\x20','40FTMuAK','667926cfzfao','4724IcpmNE'];a122_0x1bd9=function(){return _0x25d088;};return a122_0x1bd9();}export function parseSegmentRef(_0x59cd51){const _0x2dc5a7=a122_0x2117,_0x2912c0=_0x59cd51[_0x2dc5a7(0xc7)]('/');if(_0x2912c0===-0x1)return{'parentId':_0x59cd51};if(_0x2912c0===0x0)throw new Error(_0x2dc5a7(0xcc)+_0x59cd51+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x510fd1=_0x59cd51[_0x2dc5a7(0xca)](0x0,_0x2912c0),_0x431c16=_0x59cd51[_0x2dc5a7(0xca)](_0x2912c0+0x1);if(_0x431c16==='')throw new Error(_0x2dc5a7(0xcc)+_0x59cd51+_0x2dc5a7(0xc3));return{'parentId':_0x510fd1,'childId':_0x431c16};}
1
+ function a122_0x1936(){const _0x8ebdd5=['substring','15zaXoaE','Invalid\x20segment\x20reference\x20format:\x20','618280eOMPkS','11882202HLtMVq','.\x20Child\x20name\x20cannot\x20be\x20empty','245788ZighyD','2442fiaVab','8416952KccsPk','150367xYIKyL','1306WxmjWp','4464260bMwcEK','18mmtLVw'];a122_0x1936=function(){return _0x8ebdd5;};return a122_0x1936();}(function(_0x4cf151,_0x32c64d){const _0x35c40b=a122_0xd5ed,_0x1e7c80=_0x4cf151();while(!![]){try{const _0x125fff=parseInt(_0x35c40b(0x19d))/0x1*(-parseInt(_0x35c40b(0x1a7))/0x2)+-parseInt(_0x35c40b(0x1a1))/0x3*(-parseInt(_0x35c40b(0x1a6))/0x4)+parseInt(_0x35c40b(0x1a3))/0x5+parseInt(_0x35c40b(0x1a4))/0x6+parseInt(_0x35c40b(0x1a9))/0x7+parseInt(_0x35c40b(0x1a8))/0x8+-parseInt(_0x35c40b(0x19f))/0x9*(parseInt(_0x35c40b(0x19e))/0xa);if(_0x125fff===_0x32c64d)break;else _0x1e7c80['push'](_0x1e7c80['shift']());}catch(_0x3b5eb4){_0x1e7c80['push'](_0x1e7c80['shift']());}}}(a122_0x1936,0xf3804));function a122_0xd5ed(_0x538c08,_0x12a147){_0x538c08=_0x538c08-0x19d;const _0x1936ac=a122_0x1936();let _0xd5ed3e=_0x1936ac[_0x538c08];return _0xd5ed3e;}export function parseSegmentRef(_0x2f7809){const _0x5d3f76=a122_0xd5ed,_0x24c7f9=_0x2f7809['indexOf']('/');if(_0x24c7f9===-0x1)return{'parentId':_0x2f7809};if(_0x24c7f9===0x0)throw new Error(_0x5d3f76(0x1a2)+_0x2f7809+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x5ca7de=_0x2f7809[_0x5d3f76(0x1a0)](0x0,_0x24c7f9),_0x17c7e3=_0x2f7809[_0x5d3f76(0x1a0)](_0x24c7f9+0x1);if(_0x17c7e3==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2f7809+_0x5d3f76(0x1a5));return{'parentId':_0x5ca7de,'childId':_0x17c7e3};}
@@ -1 +1 @@
1
- (function(_0x6c53ea,_0x557b74){const _0x42264e=a123_0x1ca4,_0x3ef0f9=_0x6c53ea();while(!![]){try{const _0x5014ba=-parseInt(_0x42264e(0x1bc))/0x1*(parseInt(_0x42264e(0x1a0))/0x2)+parseInt(_0x42264e(0x19a))/0x3*(parseInt(_0x42264e(0x19f))/0x4)+-parseInt(_0x42264e(0x1ba))/0x5+parseInt(_0x42264e(0x196))/0x6*(-parseInt(_0x42264e(0x18f))/0x7)+parseInt(_0x42264e(0x1a6))/0x8*(-parseInt(_0x42264e(0x199))/0x9)+-parseInt(_0x42264e(0x1ad))/0xa*(-parseInt(_0x42264e(0x1c0))/0xb)+-parseInt(_0x42264e(0x1c4))/0xc*(-parseInt(_0x42264e(0x1b5))/0xd);if(_0x5014ba===_0x557b74)break;else _0x3ef0f9['push'](_0x3ef0f9['shift']());}catch(_0x310301){_0x3ef0f9['push'](_0x3ef0f9['shift']());}}}(a123_0x5d00,0x346e4));import a123_0x3fa495 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';function a123_0x1ca4(_0x5cf161,_0x552b62){_0x5cf161=_0x5cf161-0x18f;const _0x5d0008=a123_0x5d00();let _0x1ca4ff=_0x5d0008[_0x5cf161];return _0x1ca4ff;}import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x3ccd65){const _0x49dc30=a123_0x1ca4;return _0x3ccd65[_0x49dc30(0x19d)]!==_0x49dc30(0x1ae);}export function isScopedResolution(_0xb60103){const _0x3e8228=a123_0x1ca4;return _0xb60103['type']===_0x3e8228(0x1c1)||_0xb60103[_0x3e8228(0x19d)]==='file'||_0xb60103[_0x3e8228(0x19d)]===_0x3e8228(0x1a8);}export function getScopedDetails(_0x285bcb){const _0x520ed2=a123_0x1ca4;if(isScopedResolution(_0x285bcb))return{'isScoped':_0x285bcb[_0x520ed2(0x195)],'scopedFolderPath':_0x285bcb['scopedFolderPath']};return undefined;}function a123_0x5d00(){const _0x510d65=['69vQauWa','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','basename','invalid_yaml','81873xnJRUQ','directory','no_config','parse','36KMFNac','relative','File\x20not\x20found:\x20','14WkwnsY','dirname','includes','resolve','match','parentSegment','isScoped','609882hIiGAN','File\x20not\x20found','no_parent','23481qiHGXU','224394FsAFEM','stat','Parent\x20segment\x20not\x20specified','type','join','8xvzkeY','9254dibjVE','scopedFolderPath','file_not_found','root','journey','exists','952vQeNPE','tdx.json','context','No\x20tdx.json\x20found\x20for\x20file:\x20','file','folderPath','isFile','370bsYKcp','error','trim','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','readFile','message','resourceType','2770391MHwGGa','Not\x20a\x20YAML\x20file:\x20','configDir','isDirectory','parent_segment','82620PcYugm','string'];a123_0x5d00=function(){return _0x510d65;};return a123_0x5d00();}async function findTdxConfigAsync(_0x5cf18d,_0x232f77){const _0x2f2b88=a123_0x1ca4;let _0x3b16d5=a123_0x3fa495[_0x2f2b88(0x192)](_0x5cf18d);const _0x212275=a123_0x3fa495['parse'](_0x3b16d5)[_0x2f2b88(0x1a3)];while(_0x3b16d5!==_0x212275){const _0x2f3c57=a123_0x3fa495[_0x2f2b88(0x19e)](_0x3b16d5,_0x2f2b88(0x1a7));if(await _0x232f77[_0x2f2b88(0x1a5)](_0x2f3c57))try{const _0x87aa64=await _0x232f77[_0x2f2b88(0x1b2)](_0x2f3c57),_0x16d741=JSON[_0x2f2b88(0x1c3)](_0x87aa64);if(_0x16d741[_0x2f2b88(0x1b9)]&&typeof _0x16d741['parent_segment']===_0x2f2b88(0x1bb))return{'configPath':_0x2f3c57,'configDir':_0x3b16d5,'parentSegment':_0x16d741[_0x2f2b88(0x1b9)]};}catch{}_0x3b16d5=a123_0x3fa495[_0x2f2b88(0x190)](_0x3b16d5);}return null;}function calculateScopedPath(_0x2f4dfe,_0x3ad7d0){const _0x383a41=a123_0x1ca4,_0x58375d=a123_0x3fa495[_0x383a41(0x1c5)](_0x3ad7d0,_0x2f4dfe),_0x3a9aa5=_0x58375d!==''&&_0x58375d!=='.'&&!_0x58375d['startsWith']('..');return{'isScoped':_0x3a9aa5,'scopedFolderPath':_0x3a9aa5?_0x58375d['replace'](/\\/g,'/'):''};}export async function resolveTarget(_0x17b4e3){const _0x59d628=a123_0x1ca4,{arg:_0x320644,contextParent:_0x5248f5,cwd:cwd=process['cwd'](),fs:fs=nodeFileSystem}=_0x17b4e3;if(_0x320644&&isYamlFilePath(_0x320644))try{const _0x29153d=await resolveYamlFilePath(_0x320644,fs),_0x33c5e3=a123_0x3fa495[_0x59d628(0x192)](_0x320644),_0x57fd9a=a123_0x3fa495[_0x59d628(0x190)](_0x33c5e3),_0x1aceb5=await findTdxConfigAsync(_0x57fd9a,fs);if(!_0x1aceb5){if(_0x5248f5){const _0x2743f5=a123_0x3fa495[_0x59d628(0x190)](_0x33c5e3);return{'type':'file','parentName':_0x5248f5,'targetDir':_0x2743f5,'configRoot':_0x2743f5,'filePath':_0x33c5e3,'resourceName':_0x29153d['segmentName'],'folderPath':_0x29153d[_0x59d628(0x1ab)],'resourceType':_0x29153d[_0x59d628(0x1b4)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x59d628(0x1ae),'errorCode':_0x59d628(0x1c2),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x320644,'arg':_0x320644,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}const _0x45c8a0=calculateScopedPath(_0x57fd9a,_0x1aceb5['configDir']);return{'type':_0x59d628(0x1aa),'parentName':_0x1aceb5[_0x59d628(0x194)],'targetDir':_0x1aceb5['configDir'],'configRoot':_0x1aceb5[_0x59d628(0x1b7)],'filePath':_0x33c5e3,'resourceName':_0x29153d['segmentName'],'folderPath':_0x29153d[_0x59d628(0x1ab)],'resourceType':_0x29153d[_0x59d628(0x1b4)],'isScoped':_0x45c8a0[_0x59d628(0x195)],'scopedFolderPath':_0x45c8a0[_0x59d628(0x1a1)]};}catch(_0x288ac7){const _0x94bed5=_0x288ac7 instanceof Error?_0x288ac7[_0x59d628(0x1b3)]:String(_0x288ac7);if(_0x94bed5[_0x59d628(0x191)](_0x59d628(0x197)))return{'type':_0x59d628(0x1ae),'errorCode':_0x59d628(0x1a2),'message':_0x59d628(0x1c6)+_0x320644,'arg':_0x320644};if(_0x94bed5['includes']('No\x20tdx.json\x20found')){if(_0x5248f5){const _0x3829d4=a123_0x3fa495[_0x59d628(0x192)](_0x320644);if(await fs[_0x59d628(0x1a5)](_0x3829d4)){const _0x3097ff=a123_0x3fa495[_0x59d628(0x190)](_0x3829d4),_0x44b056=await fs[_0x59d628(0x1b2)](_0x3829d4),_0x96b6ae=_0x44b056[_0x59d628(0x193)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x194096=_0x44b056['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x313468=_0x96b6ae?_0x96b6ae[0x1][_0x59d628(0x1af)]():a123_0x3fa495[_0x59d628(0x1be)](_0x320644,a123_0x3fa495['extname'](_0x320644)),_0x249534=_0x194096&&_0x194096[0x1][_0x59d628(0x1af)]()==='journey'?_0x59d628(0x1a4):'segment';return{'type':_0x59d628(0x1aa),'parentName':_0x5248f5,'targetDir':_0x3097ff,'configRoot':_0x3097ff,'filePath':_0x3829d4,'resourceName':_0x313468,'folderPath':'','resourceType':_0x249534,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x59d628(0x1ae),'errorCode':'no_config','message':_0x59d628(0x1a9)+_0x320644,'arg':_0x320644,'helpText':_0x59d628(0x1b0)};}return{'type':_0x59d628(0x1ae),'errorCode':_0x59d628(0x1bf),'message':_0x94bed5,'arg':_0x320644};}if(_0x320644){const _0x52370e=a123_0x3fa495[_0x59d628(0x192)](cwd,_0x320644);let _0x3d3355=null;try{_0x3d3355=await fs[_0x59d628(0x19b)](_0x52370e);}catch{}if(_0x3d3355?.[_0x59d628(0x1b8)]()){const _0x236d49=await findTdxConfigAsync(_0x52370e,fs);if(_0x236d49){const _0x164554=calculateScopedPath(_0x52370e,_0x236d49['configDir']);return{'type':'directory','parentName':_0x236d49[_0x59d628(0x194)],'targetDir':_0x52370e,'configRoot':_0x236d49[_0x59d628(0x1b7)],'isScoped':_0x164554[_0x59d628(0x195)],'scopedFolderPath':_0x164554['scopedFolderPath']};}if(_0x5248f5)return{'type':_0x59d628(0x1c1),'parentName':_0x5248f5,'targetDir':_0x52370e,'configRoot':_0x52370e,'isScoped':![],'scopedFolderPath':''};return{'type':_0x59d628(0x1ae),'errorCode':_0x59d628(0x1c2),'message':_0x59d628(0x1b1)+_0x320644,'arg':_0x320644,'helpText':_0x59d628(0x1b0)};}if(_0x3d3355?.[_0x59d628(0x1ac)]())return{'type':_0x59d628(0x1ae),'errorCode':_0x59d628(0x1bf),'message':_0x59d628(0x1b6)+_0x320644,'arg':_0x320644,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x15bcc6=sanitizeFileName(_0x320644),_0x193f60=getSegmentRootDir(_0x15bcc6,cwd);return{'type':'parent_name','parentName':_0x320644,'targetDir':_0x193f60,'configRoot':_0x193f60};}const _0x10d9a9=await findTdxConfigAsync(cwd,fs);if(_0x10d9a9){const _0x31e709=calculateScopedPath(cwd,_0x10d9a9[_0x59d628(0x1b7)]);return{'type':'context','parentName':_0x10d9a9['parentSegment'],'targetDir':cwd,'configRoot':_0x10d9a9[_0x59d628(0x1b7)],'isScoped':_0x31e709[_0x59d628(0x195)],'scopedFolderPath':_0x31e709[_0x59d628(0x1a1)]};}if(_0x5248f5){const _0x461c3e=sanitizeFileName(_0x5248f5),_0x46a60c=getSegmentRootDir(_0x461c3e,cwd);return{'type':_0x59d628(0x1a8),'parentName':_0x5248f5,'targetDir':_0x46a60c,'configRoot':_0x46a60c,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x59d628(0x1ae),'errorCode':_0x59d628(0x198),'message':_0x59d628(0x19c),'helpText':_0x59d628(0x1bd)};}
1
+ (function(_0x2e5203,_0x65eeb9){const _0x42c19d=a123_0x2a94,_0x5d819e=_0x2e5203();while(!![]){try{const _0x266f39=parseInt(_0x42c19d(0x10e))/0x1*(-parseInt(_0x42c19d(0x121))/0x2)+parseInt(_0x42c19d(0x11d))/0x3*(-parseInt(_0x42c19d(0x13e))/0x4)+parseInt(_0x42c19d(0x139))/0x5*(parseInt(_0x42c19d(0x11e))/0x6)+-parseInt(_0x42c19d(0x10a))/0x7*(-parseInt(_0x42c19d(0x113))/0x8)+-parseInt(_0x42c19d(0x11a))/0x9*(parseInt(_0x42c19d(0x13a))/0xa)+parseInt(_0x42c19d(0x119))/0xb*(parseInt(_0x42c19d(0x137))/0xc)+parseInt(_0x42c19d(0x128))/0xd*(parseInt(_0x42c19d(0x118))/0xe);if(_0x266f39===_0x65eeb9)break;else _0x5d819e['push'](_0x5d819e['shift']());}catch(_0x495e7f){_0x5d819e['push'](_0x5d819e['shift']());}}}(a123_0x567a,0x81bee));function a123_0x567a(){const _0x14d646=['file','join','folderPath','journey','isDirectory','no_config','invalid_yaml','isScoped','extname','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','file_not_found','parent_segment','cwd','no_parent','204924GtlXTe','Not\x20a\x20YAML\x20file:\x20','2132135bHbwuo','10vxmcbv','match','context','trim','4BerWXT','directory','includes','configDir','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','Parent\x20segment\x20not\x20specified','No\x20tdx.json\x20found\x20for\x20file:\x20','basename','67039KsaAsr','message','resolve','File\x20not\x20found:\x20','1hMXJLs','tdx.json','error','readFile','File\x20not\x20found','152ZSduYR','parse','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','parentSegment','exists','56hLEfUK','242JTdFvY','7952643WHxWEV','dirname','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','309513IdyBSG','6VJGLuN','resourceType','segmentName','709504wVCQQw','type','startsWith','root','scopedFolderPath','stat','isFile','2888938oGpnJK'];a123_0x567a=function(){return _0x14d646;};return a123_0x567a();}import a123_0x1cc55a from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x3ca5c0){const _0x3188e2=a123_0x2a94;return _0x3ca5c0['type']!==_0x3188e2(0x110);}export function isScopedResolution(_0x163f26){const _0xbc5fea=a123_0x2a94;return _0x163f26[_0xbc5fea(0x122)]===_0xbc5fea(0x13f)||_0x163f26['type']===_0xbc5fea(0x129)||_0x163f26[_0xbc5fea(0x122)]===_0xbc5fea(0x13c);}export function getScopedDetails(_0x213aa1){if(isScopedResolution(_0x213aa1))return{'isScoped':_0x213aa1['isScoped'],'scopedFolderPath':_0x213aa1['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x5817c1,_0xfb8e86){const _0x4a91ae=a123_0x2a94;let _0x3f762e=a123_0x1cc55a['resolve'](_0x5817c1);const _0x348b86=a123_0x1cc55a[_0x4a91ae(0x114)](_0x3f762e)[_0x4a91ae(0x124)];while(_0x3f762e!==_0x348b86){const _0x3974b5=a123_0x1cc55a[_0x4a91ae(0x12a)](_0x3f762e,_0x4a91ae(0x10f));if(await _0xfb8e86[_0x4a91ae(0x117)](_0x3974b5))try{const _0x198c5a=await _0xfb8e86['readFile'](_0x3974b5),_0x2a671d=JSON['parse'](_0x198c5a);if(_0x2a671d['parent_segment']&&typeof _0x2a671d[_0x4a91ae(0x134)]==='string')return{'configPath':_0x3974b5,'configDir':_0x3f762e,'parentSegment':_0x2a671d[_0x4a91ae(0x134)]};}catch{}_0x3f762e=a123_0x1cc55a[_0x4a91ae(0x11b)](_0x3f762e);}return null;}function calculateScopedPath(_0x708065,_0x1d129f){const _0x4750ab=a123_0x2a94,_0x2ebcd9=a123_0x1cc55a['relative'](_0x1d129f,_0x708065),_0x339366=_0x2ebcd9!==''&&_0x2ebcd9!=='.'&&!_0x2ebcd9[_0x4750ab(0x123)]('..');return{'isScoped':_0x339366,'scopedFolderPath':_0x339366?_0x2ebcd9['replace'](/\\/g,'/'):''};}function a123_0x2a94(_0x31e26a,_0x20cae1){_0x31e26a=_0x31e26a-0x109;const _0x567a42=a123_0x567a();let _0x2a94ab=_0x567a42[_0x31e26a];return _0x2a94ab;}export async function resolveTarget(_0x4cbc8a){const _0x1c3df1=a123_0x2a94,{arg:_0x429200,contextParent:_0x5bca2e,cwd:cwd=process[_0x1c3df1(0x135)](),fs:fs=nodeFileSystem}=_0x4cbc8a;if(_0x429200&&isYamlFilePath(_0x429200))try{const _0x4d3b60=await resolveYamlFilePath(_0x429200,fs),_0x4b4a2e=a123_0x1cc55a[_0x1c3df1(0x10c)](_0x429200),_0x549028=a123_0x1cc55a[_0x1c3df1(0x11b)](_0x4b4a2e),_0x180c82=await findTdxConfigAsync(_0x549028,fs);if(!_0x180c82){if(_0x5bca2e){const _0x737dad=a123_0x1cc55a[_0x1c3df1(0x11b)](_0x4b4a2e);return{'type':_0x1c3df1(0x129),'parentName':_0x5bca2e,'targetDir':_0x737dad,'configRoot':_0x737dad,'filePath':_0x4b4a2e,'resourceName':_0x4d3b60['segmentName'],'folderPath':_0x4d3b60[_0x1c3df1(0x12b)],'resourceType':_0x4d3b60[_0x1c3df1(0x11f)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1c3df1(0x110),'errorCode':_0x1c3df1(0x12e),'message':_0x1c3df1(0x144)+_0x429200,'arg':_0x429200,'helpText':_0x1c3df1(0x115)};}const _0x263ae2=calculateScopedPath(_0x549028,_0x180c82[_0x1c3df1(0x141)]);return{'type':_0x1c3df1(0x129),'parentName':_0x180c82[_0x1c3df1(0x116)],'targetDir':_0x180c82[_0x1c3df1(0x141)],'configRoot':_0x180c82['configDir'],'filePath':_0x4b4a2e,'resourceName':_0x4d3b60[_0x1c3df1(0x120)],'folderPath':_0x4d3b60[_0x1c3df1(0x12b)],'resourceType':_0x4d3b60['resourceType'],'isScoped':_0x263ae2['isScoped'],'scopedFolderPath':_0x263ae2[_0x1c3df1(0x125)]};}catch(_0x2d4d07){const _0x32a472=_0x2d4d07 instanceof Error?_0x2d4d07[_0x1c3df1(0x10b)]:String(_0x2d4d07);if(_0x32a472[_0x1c3df1(0x140)](_0x1c3df1(0x112)))return{'type':_0x1c3df1(0x110),'errorCode':_0x1c3df1(0x133),'message':_0x1c3df1(0x10d)+_0x429200,'arg':_0x429200};if(_0x32a472[_0x1c3df1(0x140)]('No\x20tdx.json\x20found')){if(_0x5bca2e){const _0xd4872f=a123_0x1cc55a[_0x1c3df1(0x10c)](_0x429200);if(await fs['exists'](_0xd4872f)){const _0x2ca5a6=a123_0x1cc55a[_0x1c3df1(0x11b)](_0xd4872f),_0xb1487c=await fs[_0x1c3df1(0x111)](_0xd4872f),_0x2feec7=_0xb1487c['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x3d1037=_0xb1487c[_0x1c3df1(0x13b)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x1ad2c5=_0x2feec7?_0x2feec7[0x1][_0x1c3df1(0x13d)]():a123_0x1cc55a[_0x1c3df1(0x109)](_0x429200,a123_0x1cc55a[_0x1c3df1(0x131)](_0x429200)),_0x1c2c9b=_0x3d1037&&_0x3d1037[0x1][_0x1c3df1(0x13d)]()===_0x1c3df1(0x12c)?_0x1c3df1(0x12c):'segment';return{'type':_0x1c3df1(0x129),'parentName':_0x5bca2e,'targetDir':_0x2ca5a6,'configRoot':_0x2ca5a6,'filePath':_0xd4872f,'resourceName':_0x1ad2c5,'folderPath':'','resourceType':_0x1c2c9b,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0x1c3df1(0x12e),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x429200,'arg':_0x429200,'helpText':_0x1c3df1(0x115)};}return{'type':_0x1c3df1(0x110),'errorCode':'invalid_yaml','message':_0x32a472,'arg':_0x429200};}if(_0x429200){const _0x4f3801=a123_0x1cc55a[_0x1c3df1(0x10c)](cwd,_0x429200);let _0x181727=null;try{_0x181727=await fs[_0x1c3df1(0x126)](_0x4f3801);}catch{}if(_0x181727?.[_0x1c3df1(0x12d)]()){const _0x256d9d=await findTdxConfigAsync(_0x4f3801,fs);if(_0x256d9d){const _0x422dd9=calculateScopedPath(_0x4f3801,_0x256d9d['configDir']);return{'type':_0x1c3df1(0x13f),'parentName':_0x256d9d['parentSegment'],'targetDir':_0x4f3801,'configRoot':_0x256d9d[_0x1c3df1(0x141)],'isScoped':_0x422dd9[_0x1c3df1(0x130)],'scopedFolderPath':_0x422dd9['scopedFolderPath']};}if(_0x5bca2e)return{'type':_0x1c3df1(0x13f),'parentName':_0x5bca2e,'targetDir':_0x4f3801,'configRoot':_0x4f3801,'isScoped':![],'scopedFolderPath':''};return{'type':_0x1c3df1(0x110),'errorCode':_0x1c3df1(0x12e),'message':_0x1c3df1(0x11c)+_0x429200,'arg':_0x429200,'helpText':_0x1c3df1(0x115)};}if(_0x181727?.[_0x1c3df1(0x127)]())return{'type':_0x1c3df1(0x110),'errorCode':_0x1c3df1(0x12f),'message':_0x1c3df1(0x138)+_0x429200,'arg':_0x429200,'helpText':_0x1c3df1(0x132)};const _0x3495f3=sanitizeFileName(_0x429200),_0x11c28e=getSegmentRootDir(_0x3495f3,cwd);return{'type':'parent_name','parentName':_0x429200,'targetDir':_0x11c28e,'configRoot':_0x11c28e};}const _0x5187d9=await findTdxConfigAsync(cwd,fs);if(_0x5187d9){const _0x54a8fa=calculateScopedPath(cwd,_0x5187d9[_0x1c3df1(0x141)]);return{'type':_0x1c3df1(0x13c),'parentName':_0x5187d9['parentSegment'],'targetDir':cwd,'configRoot':_0x5187d9[_0x1c3df1(0x141)],'isScoped':_0x54a8fa[_0x1c3df1(0x130)],'scopedFolderPath':_0x54a8fa['scopedFolderPath']};}if(_0x5bca2e){const _0x289702=sanitizeFileName(_0x5bca2e),_0x4960ac=getSegmentRootDir(_0x289702,cwd);return{'type':_0x1c3df1(0x13c),'parentName':_0x5bca2e,'targetDir':_0x4960ac,'configRoot':_0x4960ac,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1c3df1(0x110),'errorCode':_0x1c3df1(0x136),'message':_0x1c3df1(0x143),'helpText':_0x1c3df1(0x142)};}
@@ -1 +1 @@
1
- const a124_0x357228=a124_0x3aad;(function(_0x5b1022,_0x45d47f){const _0x35d4e8=a124_0x3aad,_0x1975c8=_0x5b1022();while(!![]){try{const _0x435d61=-parseInt(_0x35d4e8(0x102))/0x1*(parseInt(_0x35d4e8(0xf9))/0x2)+parseInt(_0x35d4e8(0x10c))/0x3+-parseInt(_0x35d4e8(0x100))/0x4*(parseInt(_0x35d4e8(0x104))/0x5)+parseInt(_0x35d4e8(0x106))/0x6*(-parseInt(_0x35d4e8(0xf6))/0x7)+parseInt(_0x35d4e8(0xf4))/0x8*(parseInt(_0x35d4e8(0xfe))/0x9)+-parseInt(_0x35d4e8(0x103))/0xa+parseInt(_0x35d4e8(0xf8))/0xb;if(_0x435d61===_0x45d47f)break;else _0x1975c8['push'](_0x1975c8['shift']());}catch(_0x472999){_0x1975c8['push'](_0x1975c8['shift']());}}}(a124_0x2a9f,0x77392));import{existsSync,readFileSync}from'fs';import a124_0x5a7431 from'path';function a124_0x3aad(_0x1a6ba4,_0x460d0b){_0x1a6ba4=_0x1a6ba4-0xf2;const _0x2a9fc4=a124_0x2a9f();let _0x3aad9f=_0x2a9fc4[_0x1a6ba4];return _0x3aad9f;}const TDX_CONFIG_FILE='tdx.json',SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x28ba3e=process['cwd']()){const _0x3be792=a124_0x3aad;let _0x542f3f=a124_0x5a7431[_0x3be792(0xf2)](_0x28ba3e);const _0x1fb335=a124_0x5a7431['parse'](_0x542f3f)['root'];while(_0x542f3f!==_0x1fb335){const _0xc6d58e=a124_0x5a7431[_0x3be792(0x108)](_0x542f3f,TDX_CONFIG_FILE);if(existsSync(_0xc6d58e))return _0xc6d58e;_0x542f3f=a124_0x5a7431[_0x3be792(0xf5)](_0x542f3f);}return null;}export function loadTdxConfig(_0x1b2347){const _0x388b25=a124_0x3aad,_0x18f97a=readFileSync(_0x1b2347,_0x388b25(0xfa));let _0x59bf33;try{_0x59bf33=JSON[_0x388b25(0xfb)](_0x18f97a);}catch{throw new Error(_0x388b25(0x10a)+_0x1b2347);}if(!_0x59bf33||typeof _0x59bf33!==_0x388b25(0x10d))throw new Error(_0x388b25(0xff));const _0x1bdb83=_0x59bf33;if(!_0x1bdb83[_0x388b25(0x109)]||typeof _0x1bdb83[_0x388b25(0x109)]!==_0x388b25(0xfd))throw new Error(_0x388b25(0x107));return{'parent_segment':_0x1bdb83[_0x388b25(0x109)]};}export function findTdxConfig(_0x4af80e=process[a124_0x357228(0xfc)]()){const _0x45087c=a124_0x357228,_0x3a41c7=findTdxConfigPath(_0x4af80e);if(!_0x3a41c7)throw new Error(_0x45087c(0xf7));const _0x4ff6c7=loadTdxConfig(_0x3a41c7),_0x595cb7=a124_0x5a7431[_0x45087c(0xf5)](_0x3a41c7);return{'config':_0x4ff6c7,'configPath':_0x3a41c7,'configDir':_0x595cb7};}export function tryFindTdxConfig(_0x113ea1){try{return findTdxConfig(_0x113ea1);}catch{return null;}}export function getSegmentRootDir(_0x11535f,_0x22fa72=process[a124_0x357228(0xfc)]()){const _0xbc5f45=a124_0x357228;return a124_0x5a7431[_0xbc5f45(0x108)](_0x22fa72,SEGMENTS_DIR,_0x11535f);}export function getTdxConfigPath(_0x163769,_0x3c85f6=process['cwd']()){const _0x2b9106=a124_0x357228;return a124_0x5a7431[_0x2b9106(0x108)](getSegmentRootDir(_0x163769,_0x3c85f6),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x39c7ee,_0x8b78ad){const _0x4e75d2=a124_0x357228,_0x523ba5=a124_0x5a7431[_0x4e75d2(0xf2)](_0x39c7ee),_0x35fd67=a124_0x5a7431[_0x4e75d2(0x101)](_0x8b78ad,_0x523ba5);if(_0x35fd67[_0x4e75d2(0xf3)]('..'))return'';return _0x35fd67;}export function localPathToTdFolderPath(_0x4af203){const _0x2b9685=a124_0x357228,_0x5743ac=a124_0x5a7431[_0x2b9685(0xf5)](_0x4af203);if(_0x5743ac==='.'||_0x5743ac==='')return'';return _0x5743ac[_0x2b9685(0x10b)](/\\/g,'/');}function a124_0x2a9f(){const _0x4e5f71=['18JZuGtD','Invalid\x20tdx.json:\x20expected\x20object','4228jQgqNB','relative','202351yDAyIL','5395530jxoQvR','1595CDuSwf','stringify','3522wSJzNa','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','join','parent_segment','Invalid\x20JSON\x20in\x20','replace','1568574neEANx','object','resolve','startsWith','949864iAbmvD','dirname','6769ZvDETe','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','19573752KpbyQX','6TexEAe','utf-8','parse','cwd','string'];a124_0x2a9f=function(){return _0x4e5f71;};return a124_0x2a9f();}export function tdFolderPathToLocalPath(_0x5c669a,_0x34b2f9){const _0x59f2b9=a124_0x357228;if(!_0x5c669a)return _0x34b2f9;return a124_0x5a7431[_0x59f2b9(0x108)](_0x34b2f9,_0x5c669a);}export function createTdxConfigContent(_0x3118b0){const _0x172181=a124_0x357228,_0x4b18a4={'parent_segment':_0x3118b0};return JSON[_0x172181(0x105)](_0x4b18a4,null,0x2)+'\x0a';}
1
+ const a124_0x3c5d67=a124_0x3c1b;(function(_0x65c032,_0x375eee){const _0x37f74a=a124_0x3c1b,_0x3120f8=_0x65c032();while(!![]){try{const _0x2b90c8=-parseInt(_0x37f74a(0x13f))/0x1*(-parseInt(_0x37f74a(0x14f))/0x2)+-parseInt(_0x37f74a(0x13b))/0x3+-parseInt(_0x37f74a(0x13c))/0x4+parseInt(_0x37f74a(0x143))/0x5+-parseInt(_0x37f74a(0x151))/0x6*(parseInt(_0x37f74a(0x144))/0x7)+parseInt(_0x37f74a(0x154))/0x8+parseInt(_0x37f74a(0x142))/0x9;if(_0x2b90c8===_0x375eee)break;else _0x3120f8['push'](_0x3120f8['shift']());}catch(_0x28f826){_0x3120f8['push'](_0x3120f8['shift']());}}}(a124_0x59ee,0x94611));import{existsSync,readFileSync}from'fs';import a124_0x23be15 from'path';const TDX_CONFIG_FILE=a124_0x3c5d67(0x147),SEGMENTS_DIR=a124_0x3c5d67(0x14c);export function findTdxConfigPath(_0x131461=process[a124_0x3c5d67(0x150)]()){const _0x5cc733=a124_0x3c5d67;let _0x4e4891=a124_0x23be15[_0x5cc733(0x141)](_0x131461);const _0x31ee36=a124_0x23be15['parse'](_0x4e4891)[_0x5cc733(0x149)];while(_0x4e4891!==_0x31ee36){const _0x156f89=a124_0x23be15['join'](_0x4e4891,TDX_CONFIG_FILE);if(existsSync(_0x156f89))return _0x156f89;_0x4e4891=a124_0x23be15[_0x5cc733(0x148)](_0x4e4891);}return null;}export function loadTdxConfig(_0x203aa5){const _0x39d9e2=a124_0x3c5d67,_0xe3218a=readFileSync(_0x203aa5,_0x39d9e2(0x139));let _0x25d811;try{_0x25d811=JSON[_0x39d9e2(0x145)](_0xe3218a);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x203aa5);}if(!_0x25d811||typeof _0x25d811!==_0x39d9e2(0x14e))throw new Error(_0x39d9e2(0x140));const _0x16fb01=_0x25d811;if(!_0x16fb01[_0x39d9e2(0x13d)]||typeof _0x16fb01[_0x39d9e2(0x13d)]!==_0x39d9e2(0x153))throw new Error(_0x39d9e2(0x14d));return{'parent_segment':_0x16fb01[_0x39d9e2(0x13d)]};}export function findTdxConfig(_0x23ead3=process[a124_0x3c5d67(0x150)]()){const _0x1cc5b7=a124_0x3c5d67,_0x5b8b9c=findTdxConfigPath(_0x23ead3);if(!_0x5b8b9c)throw new Error(_0x1cc5b7(0x13a));const _0x2a26cc=loadTdxConfig(_0x5b8b9c),_0x4feeef=a124_0x23be15[_0x1cc5b7(0x148)](_0x5b8b9c);return{'config':_0x2a26cc,'configPath':_0x5b8b9c,'configDir':_0x4feeef};}function a124_0x3c1b(_0x236d86,_0x27cc1e){_0x236d86=_0x236d86-0x139;const _0x59eeb1=a124_0x59ee();let _0x3c1b49=_0x59eeb1[_0x236d86];return _0x3c1b49;}export function tryFindTdxConfig(_0x17e603){try{return findTdxConfig(_0x17e603);}catch{return null;}}export function getSegmentRootDir(_0x24435c,_0x4d923e=process[a124_0x3c5d67(0x150)]()){const _0x5f1ce4=a124_0x3c5d67;return a124_0x23be15[_0x5f1ce4(0x146)](_0x4d923e,SEGMENTS_DIR,_0x24435c);}export function getTdxConfigPath(_0x225633,_0x534c48=process[a124_0x3c5d67(0x150)]()){const _0x3b2be3=a124_0x3c5d67;return a124_0x23be15[_0x3b2be3(0x146)](getSegmentRootDir(_0x225633,_0x534c48),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x7a3fd6,_0x531184){const _0x53b21f=a124_0x3c5d67,_0x471550=a124_0x23be15[_0x53b21f(0x141)](_0x7a3fd6),_0x498ca2=a124_0x23be15[_0x53b21f(0x14b)](_0x531184,_0x471550);if(_0x498ca2[_0x53b21f(0x14a)]('..'))return'';return _0x498ca2;}export function localPathToTdFolderPath(_0x1851a8){const _0x1d0653=a124_0x3c5d67,_0x5b05b0=a124_0x23be15[_0x1d0653(0x148)](_0x1851a8);if(_0x5b05b0==='.'||_0x5b05b0==='')return'';return _0x5b05b0[_0x1d0653(0x13e)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x3531cb,_0x1a56f0){if(!_0x3531cb)return _0x1a56f0;return a124_0x23be15['join'](_0x1a56f0,_0x3531cb);}function a124_0x59ee(){const _0x41ac57=['215055vbiIPt','1545530mDGbgI','602119zbnArr','parse','join','tdx.json','dirname','root','startsWith','relative','segments','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','object','470698HvhPIB','cwd','18xcGzFr','stringify','string','5022448QuztOr','utf-8','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','136428SCdTOU','3963660kNpMJI','parent_segment','replace','4eEDIiE','Invalid\x20tdx.json:\x20expected\x20object','resolve'];a124_0x59ee=function(){return _0x41ac57;};return a124_0x59ee();}export function createTdxConfigContent(_0x232d4d){const _0x47ee99=a124_0x3c5d67,_0x4d34d8={'parent_segment':_0x232d4d};return JSON[_0x47ee99(0x152)](_0x4d34d8,null,0x2)+'\x0a';}