@treasuredata/tdx 2026.3.36 → 2026.3.37

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 (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a152_0x59916b=a152_0x54b0;(function(_0x10bf40,_0x5bfdda){const _0x17cb40=a152_0x54b0,_0x2d5e3f=_0x10bf40();while(!![]){try{const _0x1044b0=-parseInt(_0x17cb40(0x212))/0x1*(parseInt(_0x17cb40(0x194))/0x2)+parseInt(_0x17cb40(0x1e3))/0x3+-parseInt(_0x17cb40(0x140))/0x4+-parseInt(_0x17cb40(0x148))/0x5*(-parseInt(_0x17cb40(0x147))/0x6)+-parseInt(_0x17cb40(0x225))/0x7*(-parseInt(_0x17cb40(0x1cb))/0x8)+-parseInt(_0x17cb40(0x15e))/0x9+-parseInt(_0x17cb40(0x1fe))/0xa*(-parseInt(_0x17cb40(0x235))/0xb);if(_0x1044b0===_0x5bfdda)break;else _0x2d5e3f['push'](_0x2d5e3f['shift']());}catch(_0x470ff5){_0x2d5e3f['push'](_0x2d5e3f['shift']());}}}(a152_0x481a,0xc984c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';function a152_0x54b0(_0x296254,_0x5a0f4d){_0x296254=_0x296254-0x13d;const _0x481afa=a152_0x481a();let _0x54b076=_0x481afa[_0x296254];return _0x54b076;}const logger=Logger['of'](a152_0x59916b(0x1f3));export const PENDING_SEGMENT_PREFIX=a152_0x59916b(0x187);export const PENDING_ACTIVATION_PREFIX=a152_0x59916b(0x207);export function createPendingSegmentId(_0x963781){return''+PENDING_SEGMENT_PREFIX+_0x963781+'__';}export function isPendingSegmentId(_0x3f82cd){const _0x4806ba=a152_0x59916b;return _0x3f82cd[_0x4806ba(0x1d7)](PENDING_SEGMENT_PREFIX)&&!_0x3f82cd[_0x4806ba(0x1d7)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x4a6636){const _0x1a4a84=a152_0x59916b;return _0x4a6636[_0x1a4a84(0x221)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x455824){return''+PENDING_ACTIVATION_PREFIX+_0x455824+'__';}export function isPendingActivationId(_0x317624){const _0x467439=a152_0x59916b;return _0x317624[_0x467439(0x1d7)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4de3e1){return _0x4de3e1['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x357e78,_0x3d16be){const _0x3aafb7=a152_0x59916b,_0x5449ab=_0x357e78+'::'+(_0x3d16be['trim']()||_0x3aafb7(0x240)),_0xd4ab46=createHash(_0x3aafb7(0x189))[_0x3aafb7(0x1b1)](_0x5449ab)['digest'](_0x3aafb7(0x14a))['slice'](0x0,0xc);return _0x3aafb7(0x238)+_0xd4ab46;}export function ensureJourneyDefaults(_0x459315){const _0x34772d=a152_0x59916b;!_0x459315[_0x34772d(0x1a3)]&&(_0x459315[_0x34772d(0x1a3)]=''),!_0x459315['state']&&(_0x459315[_0x34772d(0x20f)]=_0x34772d(0x14b));}export function injectExistingStageIds(_0x5d830a,_0x37d077){const _0x4d6f57=a152_0x59916b,_0x5ee23b=new Map(_0x37d077['map'](_0x3b3bb7=>[_0x3b3bb7[_0x4d6f57(0x1ce)],_0x3b3bb7['id']]));for(const _0x413767 of _0x5d830a){if(!_0x413767['id']){const _0x458c4c=_0x5ee23b[_0x4d6f57(0x21c)](_0x413767[_0x4d6f57(0x1ce)]);_0x458c4c&&(_0x413767['id']=_0x458c4c);}}}export function resolveTDFolderPath(_0x4fcad8,_0x4c90b8,_0x5e65ab){const _0xa9eccd=a152_0x59916b;if(!_0x4c90b8)return _0x4fcad8;if(_0x4fcad8===_0x5e65ab||_0x4fcad8[_0xa9eccd(0x1d7)](_0x5e65ab+'/'))return _0x4fcad8;return _0x4fcad8?_0x5e65ab+'/'+_0x4fcad8:_0x5e65ab;}export function addFoldersToCreate(_0xa3c18a,_0x3d8fe1,_0x12d163){const _0x149d5c=a152_0x59916b;if(!_0xa3c18a)return;if(_0x3d8fe1[_0x149d5c(0x145)](_0xa3c18a))return;const _0xf14c94=_0xa3c18a[_0x149d5c(0x1e8)]('/');let _0x4b0215='';for(const _0x4023ba of _0xf14c94){_0x4b0215=_0x4b0215?_0x4b0215+'/'+_0x4023ba:_0x4023ba,!_0x3d8fe1[_0x149d5c(0x145)](_0x4b0215)&&_0x12d163[_0x149d5c(0x180)](_0x4b0215);}}export function sortFoldersByDepth(_0x2dcad3){const _0x5dfd5a=a152_0x59916b;return[..._0x2dcad3][_0x5dfd5a(0x1a1)]((_0x29b06f,_0x277b72)=>{const _0xf1eba0=_0x5dfd5a,_0x54c009=(_0x29b06f['match'](/\//g)||[])[_0xf1eba0(0x1fd)],_0xf9fb25=(_0x277b72[_0xf1eba0(0x1fc)](/\//g)||[])[_0xf1eba0(0x1fd)];return _0x54c009-_0xf9fb25;});}import*as a152_0x329c1f from'yaml';import{readFileSync}from'fs';import a152_0x822047 from'path';import{isJourneyDef,parseYamlString as a152_0x73dd06,toYamlString as a152_0x4934de,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x236e6f){const _0x51f1e4=a152_0x59916b;if(Array[_0x51f1e4(0x188)](_0x236e6f))return'['+_0x236e6f[_0x51f1e4(0x1da)](_0x2c108e=>stableStringify(_0x2c108e))['join'](',')+']';if(_0x236e6f&&typeof _0x236e6f===_0x51f1e4(0x20a)){const _0x5ec5d1=_0x236e6f,_0x220b42=Object[_0x51f1e4(0x141)](_0x5ec5d1)[_0x51f1e4(0x1a1)](),_0x1ae193=_0x220b42[_0x51f1e4(0x1da)](_0x554dce=>'\x22'+_0x554dce+'\x22:'+stableStringify(_0x5ec5d1[_0x554dce]));return'{'+_0x1ae193[_0x51f1e4(0x1d3)](',')+'}';}const _0x23d083=JSON[_0x51f1e4(0x18a)](_0x236e6f);return _0x23d083===undefined?_0x51f1e4(0x23c):_0x23d083;}function activationSignature(_0x33266d){const _0x45b8ff=a152_0x59916b,_0x3ecd1c={'connection':_0x33266d['connection'],..._0x33266d[_0x45b8ff(0x144)]!==undefined&&{'all_columns':_0x33266d[_0x45b8ff(0x144)]},..._0x33266d[_0x45b8ff(0x1c4)]!==undefined&&{'columns':_0x33266d[_0x45b8ff(0x1c4)]},..._0x33266d['behavior']!==undefined&&{'behavior':_0x33266d[_0x45b8ff(0x206)]},..._0x33266d[_0x45b8ff(0x14f)]!==undefined&&{'schedule':_0x33266d['schedule']},..._0x33266d['notification']!==undefined&&{'notification':_0x33266d[_0x45b8ff(0x17b)]},..._0x33266d[_0x45b8ff(0x1e1)]!==undefined&&{'connector_config':_0x33266d[_0x45b8ff(0x1e1)]},..._0x33266d[_0x45b8ff(0x1f2)]!==undefined&&{'activation_template_id':_0x33266d['activation_template_id']}};return stableStringify(_0x3ecd1c);}async function fetchSegment(_0xeb70e7,_0x4cbcc0,_0x281e31,_0x5e1659){const _0x107fab=a152_0x59916b,_0x105f19=_0x5e1659?.[_0x107fab(0x16c)](_0xc19c48=>_0xc19c48['id']===_0x281e31);if(_0x105f19)return _0x105f19;try{return await _0xeb70e7[_0x107fab(0x240)][_0x107fab(0x162)](_0x4cbcc0,_0x281e31);}catch(_0x17a173){logger['debug'](_0x107fab(0x218)+_0x281e31+_0x107fab(0x22b)+_0x17a173);try{return await _0xeb70e7[_0x107fab(0x240)][_0x107fab(0x1a8)](_0x281e31);}catch(_0x1f8d88){return logger['debug'](_0x107fab(0x1c9)+_0x281e31+':\x20'+_0x1f8d88),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3d0926,_0x589c5b,_0x182064){const _0x95ec20=a152_0x59916b,_0x4c8d7c=readPushRecovery(_0x3d0926['absolutePath']);if(_0x4c8d7c?.['journeyName']===_0x3d0926[_0x95ec20(0x245)][_0x95ec20(0x1ce)])for(const [_0x56721d,_0x44d65b]of Object[_0x95ec20(0x199)](_0x4c8d7c[_0x95ec20(0x23d)])){const _0x353e56=generateDeterministicJourneySegmentName(_0x3d0926[_0x95ec20(0x245)][_0x95ec20(0x1ce)],_0x56721d);_0x44d65b['uniqueServerName']===_0x353e56&&(_0x589c5b[_0x95ec20(0x172)](_0x56721d,_0x44d65b[_0x95ec20(0x16d)]),_0x182064[_0x95ec20(0x172)](_0x56721d,_0x44d65b[_0x95ec20(0x16d)]));}}async function createOrRecoverEmbeddedSegment(_0x54f43d,_0x313a32,_0x237c26,_0x34e906){const _0x95549=a152_0x59916b;let _0x5dd774;try{_0x5dd774=await _0x54f43d[_0x95549(0x240)][_0x95549(0x1e7)]({'name':_0x237c26[_0x95549(0x1f5)],'description':_0x237c26[_0x95549(0x1a3)],'journeyId':_0x237c26[_0x95549(0x223)],'rule':_0x34e906(_0x237c26[_0x95549(0x1d4)],!![]),'countPopulation':!![],'parentFolderId':_0x237c26[_0x95549(0x169)],'audienceId':_0x237c26[_0x95549(0x1c5)]});}catch(_0x5eedc3){const _0x12b469=_0x5eedc3 instanceof Error&&_0x5eedc3[_0x95549(0x230)][_0x95549(0x1ec)]('Name\x20has\x20already\x20been\x20taken');if(_0x12b469){const _0x39c126=readPushRecovery(_0x313a32[_0x95549(0x202)]),_0x36a52a=_0x39c126?.[_0x95549(0x1fa)]===_0x313a32[_0x95549(0x245)][_0x95549(0x1ce)]?_0x39c126[_0x95549(0x23d)][_0x237c26[_0x95549(0x1c6)]]:undefined;if(_0x36a52a?.[_0x95549(0x15d)]===_0x237c26['uniqueSegmentName'])await _0x54f43d[_0x95549(0x240)]['updateSegmentById'](_0x237c26[_0x95549(0x1c5)],_0x36a52a[_0x95549(0x16d)],{'description':_0x237c26[_0x95549(0x1a3)],'rule':_0x34e906(_0x237c26[_0x95549(0x1d4)],!![]),'countPopulation':!![]}),_0x5dd774=_0x36a52a[_0x95549(0x16d)];else throw new SDKError(ErrorCode[_0x95549(0x1c3)],_0x95549(0x1a9)+_0x237c26[_0x95549(0x1c6)]+_0x95549(0x1a6)+(_0x95549(0x1be)+_0x313a32[_0x95549(0x202)][_0x95549(0x221)](/([^/]+)$/,_0x95549(0x1cd))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x5eedc3);}else throw _0x5eedc3;}return saveSegmentToPushRecovery(_0x313a32[_0x95549(0x202)],_0x313a32[_0x95549(0x245)][_0x95549(0x1ce)],_0x237c26[_0x95549(0x1c6)],{'segmentId':_0x5dd774,'uniqueServerName':_0x237c26['uniqueSegmentName'],'createdAt':new Date()[_0x95549(0x22d)]()}),_0x5dd774;}export async function prepareSegmentFiles(_0x1e6f2e,_0x479c51,_0x1b1c0e,_0x1120d7,_0x3f78d5){const _0x51cd1c=a152_0x59916b,{activationDefToCreateRequest:_0x5957fa}=await import(_0x51cd1c(0x20c)),_0xfbf0a9=[],_0x1184a6=new Set();for(const {yamlConfig:_0x493108,folderPath:_0x1ce061,sourcePath:_0x4d14c3}of _0x1e6f2e){const _0xe33ee6=resolveTDFolderPath(_0x1ce061,_0x1120d7,_0x3f78d5),_0x1abf0f=_0xe33ee6+':'+_0x493108[_0x51cd1c(0x1ce)],_0x433b5a=_0x479c51[_0x51cd1c(0x1a0)][_0x51cd1c(0x21c)](_0x1abf0f),_0x4a47ea=_0x433b5a?_0x479c51[_0x51cd1c(0x1db)][_0x51cd1c(0x21c)](_0x433b5a['id'])||[]:[];addFoldersToCreate(_0xe33ee6,_0x479c51[_0x51cd1c(0x1b0)],_0x1184a6);const _0x9b81a=calculateActivationActions(_0x493108[_0x51cd1c(0x1df)]||[],_0x4a47ea,_0x479c51['idToEmailMap'],_0x479c51[_0x51cd1c(0x247)]);for(const _0x538d18 of _0x9b81a){(_0x538d18['type']==='create'||_0x538d18['type']===_0x51cd1c(0x1b1))&&_0x538d18[_0x51cd1c(0x1b4)]&&(_0x538d18[_0x51cd1c(0x152)]=await _0x5957fa(_0x538d18[_0x51cd1c(0x1b4)],_0x1b1c0e));}const _0x48e44e=calculateSegmentDiff(_0x493108,_0x433b5a,_0x4a47ea,_0x479c51['idToEmailMap'],_0x479c51[_0x51cd1c(0x247)]);_0xfbf0a9[_0x51cd1c(0x1ae)]({'relativePath':_0x493108[_0x51cd1c(0x1ce)],'absolutePath':_0x4d14c3,'yamlConfig':_0x493108,'folderPath':_0xe33ee6,'existingSegment':_0x433b5a,'existingActivations':_0x4a47ea,'isNew':_0x48e44e[_0x51cd1c(0x190)],'hasChanges':_0x48e44e[_0x51cd1c(0x1f7)],'diff':_0x48e44e[_0x51cd1c(0x231)],'activationActions':_0x9b81a});}return{'segmentFiles':_0xfbf0a9,'foldersToCreate':_0x1184a6};}export async function prepareJourneyFiles(_0x25738e,_0x2e471d,_0x4245b8,_0xd0790f){const _0xc080cc=a152_0x59916b,_0x5a0999=[],_0x529873=new Set();for(const {yamlConfig:_0x5c9937,folderPath:_0x461e16,sourcePath:_0x443e42}of _0x25738e){const _0x3b8166=resolveTDFolderPath(_0x461e16,_0x4245b8,_0xd0790f),_0x3affbd=_0x3b8166+':'+_0x5c9937['name'],_0x4fa639=_0x2e471d[_0xc080cc(0x219)]['get'](_0x3affbd);let _0x2e82b4,_0x4e3219;if(_0x4fa639&&_0x4fa639[_0xc080cc(0x1fd)]>0x0){const _0x26a312=buildLocalExpandedRuleMappings(_0x5c9937),{createYamlContext:_0x42f116,prefetchJourneySegments:_0x3adc39}=createPushYamlContextForBundle(_0x2e471d[_0xc080cc(0x13d)],_0x2e471d['parentId'],_0x2e471d[_0xc080cc(0x1bf)],_0x26a312,_0x2e471d[_0xc080cc(0x1f1)],_0x2e471d['connectionIdToNameMap'],_0x2e471d[_0xc080cc(0x173)],_0x2e471d[_0xc080cc(0x236)]);await _0x3adc39(_0x4fa639['map'](_0x3611f7=>_0x3611f7['id']));const _0x24d278=await _0x2e471d[_0xc080cc(0x13d)]['journey'][_0xc080cc(0x1b5)](_0x4fa639[0x0]['journeyBundleId']),_0x549b1a=hasMultipleVersions(_0x5c9937),_0x52ac59=async _0x4e907d=>{const _0x6dc397=_0xc080cc,_0x34c1f2=_0x2e471d[_0x6dc397(0x236)]?.[_0x6dc397(0x21c)](_0x4e907d);if(_0x34c1f2)return _0x34c1f2;return _0x2e471d[_0x6dc397(0x217)]({'journeyId':_0x4e907d,'journeyName':_0x5c9937['name'],'isMultiVersion':_0x4fa639['length']>0x1});};if(_0x549b1a&&_0x4fa639[_0xc080cc(0x1fd)]>0x1){const _0x23e502=[];for(const _0x4d4233 of _0x4fa639){const _0x323cad=_0x4d4233[_0xc080cc(0x164)]||0x1;_0x2e471d[_0xc080cc(0x167)]?.[_0xc080cc(0x1b1)](_0xc080cc(0x1b3)+_0x5c9937[_0xc080cc(0x1ce)]+'\x20v'+_0x323cad);const _0x57c3fe=await _0x52ac59(_0x4d4233['id']),_0x138c7b=_0x42f116(_0x4d4233['id']),_0x406397=await journeyResponseToDef(_0x57c3fe,_0x138c7b);_0x23e502[_0xc080cc(0x1ae)]({'item':_0x4d4233,'yaml':_0x406397});}const _0x34be0b=buildLocalRuleToNameMappingFromJourney(_0x5c9937);_0x4e3219=buildMergedJourneyDef(_0x23e502,_0x34be0b,_0x24d278);const _0x33fb31=Math['max'](..._0x23e502[_0xc080cc(0x1da)](_0x299b5a=>_0x299b5a[_0xc080cc(0x1d5)][_0xc080cc(0x164)]||0x0)),_0x1e49b7=_0x4fa639['find'](_0x5dba9f=>(_0x5dba9f['versionNumber']||0x0)===_0x33fb31);_0x1e49b7&&(_0x2e471d['progress']?.[_0xc080cc(0x1b1)](_0xc080cc(0x1b3)+_0x5c9937[_0xc080cc(0x1ce)]+'\x20v'+_0x33fb31),_0x2e82b4=await _0x52ac59(_0x1e49b7['id']));}else{const _0x2532dd=_0x4fa639[_0x4fa639[_0xc080cc(0x1fd)]-0x1];_0x2e471d['progress']?.[_0xc080cc(0x1b1)](_0xc080cc(0x1b3)+_0x5c9937[_0xc080cc(0x1ce)]),_0x2e82b4=await _0x52ac59(_0x2532dd['id']);const _0x89808c=_0x42f116(_0x2532dd['id']),_0x4bc96b=await journeyResponseToDef(_0x2e82b4,_0x89808c),_0x6cff5c=buildLocalRuleToNameMappingFromJourney(_0x5c9937);_0x4e3219=buildMergedJourneyDef([{'item':_0x2532dd,'yaml':_0x4bc96b}],_0x6cff5c,_0x24d278);}}addFoldersToCreate(_0x3b8166,_0x2e471d[_0xc080cc(0x1b0)],_0x529873);const _0x3f1155=calculateJourneyDiff(_0x5c9937,_0x4e3219);_0x5a0999[_0xc080cc(0x1ae)]({'relativePath':_0x5c9937['name'],'absolutePath':_0x443e42,'yamlConfig':_0x5c9937,'folderPath':_0x3b8166,'existingJourney':_0x2e82b4,'isNew':_0x3f1155[_0xc080cc(0x190)],'hasChanges':_0x3f1155['hasChanges'],'diff':_0x3f1155[_0xc080cc(0x231)]});}return{'journeyFiles':_0x5a0999,'foldersToCreate':_0x529873};}export function calculateActivationActions(_0x1ecfd0,_0x2dde2a,_0x435a58,_0x31d94c){const _0x5ddca7=a152_0x59916b,_0x3592f9=[],_0x2437a8=new Map();for(const _0x19fe37 of _0x2dde2a){_0x2437a8[_0x5ddca7(0x172)](_0x19fe37[_0x5ddca7(0x1ce)],_0x19fe37);}const _0x2142bb=new Map();for(const _0x48ce1b of _0x1ecfd0){_0x2142bb['set'](_0x48ce1b[_0x5ddca7(0x1ce)],_0x48ce1b);}for(const _0x4e7e4a of _0x1ecfd0){const _0x696f50=_0x2437a8[_0x5ddca7(0x21c)](_0x4e7e4a['name']);if(!_0x696f50)_0x3592f9['push']({'type':'create','name':_0x4e7e4a[_0x5ddca7(0x1ce)],'yamlActivation':_0x4e7e4a});else{const _0x2c7c98=activationResponseToDef(_0x696f50,_0x435a58,_0x31d94c),_0x201451=a152_0x329c1f[_0x5ddca7(0x18a)](_0x2c7c98),_0x41a8f7=a152_0x329c1f['stringify'](_0x4e7e4a);_0x201451!==_0x41a8f7&&_0x3592f9[_0x5ddca7(0x1ae)]({'type':_0x5ddca7(0x1b1),'name':_0x4e7e4a['name'],'yamlActivation':_0x4e7e4a,'existingActivation':_0x696f50});}}for(const _0x399795 of _0x2dde2a){!_0x2142bb['has'](_0x399795[_0x5ddca7(0x1ce)])&&_0x3592f9[_0x5ddca7(0x1ae)]({'type':_0x5ddca7(0x193),'name':_0x399795[_0x5ddca7(0x1ce)],'existingActivation':_0x399795});}return _0x3592f9;}function calculateYamlDiff(_0x594cd9,_0x168954){if(_0x168954){const _0x5ea57a=generateDiff(_0x168954,_0x594cd9),_0x567ad2=hasChanges(_0x5ea57a);return{'isNew':![],'hasChanges':_0x567ad2,'diff':_0x567ad2?formatDiffWithColors(_0x5ea57a):undefined};}const _0x597aab=generateDiff('',_0x594cd9);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x597aab)};}export function calculateSegmentDiff(_0x276817,_0x3b1331,_0x336db0,_0x3b5eba,_0x40ab1b){const _0x4fa3f7=segmentToYamlString(_0x276817),_0x44e4cb=_0x3b1331?segmentToYamlString(segmentWithActivationsToYaml(_0x3b1331,_0x336db0,undefined,_0x3b5eba,_0x40ab1b)):undefined;return calculateYamlDiff(_0x4fa3f7,_0x44e4cb);}export function calculateJourneyDiff(_0x1933d3,_0x8694b9){const _0x4c86b8=normalizeJourneyDef(_0x1933d3,_0x1933d3),_0x4c8f26=a152_0x4934de(_0x4c86b8),_0x57e608=_0x8694b9?a152_0x4934de(normalizeJourneyDef(_0x8694b9,_0x1933d3)):undefined;return calculateYamlDiff(_0x4c8f26,_0x57e608);}export function findSegmentsToDelete(_0x557888,_0x3bfdcb,_0x156c30,_0xe710fd,_0x55cac8){const _0x1e609e=a152_0x59916b,_0x561717=new Set();for(const {yamlConfig:_0x5a5978,folderPath:_0x5c4061}of _0x3bfdcb){_0x561717[_0x1e609e(0x180)](_0x5c4061+':'+_0x5a5978[_0x1e609e(0x1ce)]);}return _0x557888['filter'](_0x1fd4c3=>{const _0x5b2c54=_0x1e609e,_0xfbf8cd=_0x1fd4c3['segmentFolderId']?_0x156c30['get'](_0x1fd4c3[_0x5b2c54(0x228)]['toString']())||'':'',_0x179d21=_0xfbf8cd+':'+_0x1fd4c3[_0x5b2c54(0x1ce)];if(_0x561717[_0x5b2c54(0x145)](_0x179d21))return![];if(_0x55cac8)return _0xfbf8cd===_0xe710fd||_0xfbf8cd[_0x5b2c54(0x1d7)](_0xe710fd+'/');return!![];});}function a152_0x481a(){const _0x1d54de=['valid','Updated\x20journey\x20\x27','Delete\x20the\x20push\x20recovery\x20file\x20(','existingSegments','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','parseDocument','embedded_segment_creating','SEGMENT_UPDATE_ERROR','columns','parentId','localName','deleted','values','getSegmentEntity\x20also\x20failed\x20for\x20','journeyStages','568jfGZHd','ACTIVATION_UPDATE_ERROR','.$1.push-recovery.json','name','Duration','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','toLowerCase','Failed\x20to\x20fetch\x20referenced\x20segment\x20','join','resolvedRule','item','\x27\x20wait\x20condition','startsWith','updateActivation','slice','map','activationsBySegmentId','created','segment_creating','WaitStep','activations','\x27\x20to\x20local\x20\x27','connector_config','INTERNAL','2300838YiZiHY','rootFolderId','journeyActivationStepId','logSuccess','createJourneySegment','split','waitStepType','createFolder','embeddedSegmentNameToId','includes','conditions','listActivations','relationships','existingJourney','idToEmailMap','activation_template_id','tdx.sdk.push-workflow','deleteActivation','uniqueSegmentName','existingSegment','hasChanges','Entry\x20criteria:\x20','stage\x20\x27','journeyName','segment_created','match','length','326310FIuOwH','size','createdSegmentIds','journey_creating','absolutePath','conditionTimeoutUnit','max','waitStepUnit','behavior','__pending_act_','connection','Segment\x20not\x20found','object','entry_criteria','./child-segment-yaml.js','segmentNameToId','\x20segment\x20from\x20file:\x20','state','branches','attributes','1510009TnKhov','Segment\x20not\x20found:\x20','activation_deleting','journeyActivationNameToId','type','fetchJourney','getSegment\x20failed\x20for\x20','journeyBundlesByFolderAndName','effectiveFolderId','activation_updated','get','conditionSegmentId','reduce',').\x20','idToName','replace','Created\x20activation\x20\x27','journeyId','onProgress','59395dAudvf','):\x20','goal','segmentFolderId','getJourney','journey_created',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','\x27\x20milestone','toISOString','deleteSegment','parentSegmentFolder','message','diff','journeys','entryCriteria','journey_updating','902hgrLpx','journeyById','embedded_activation_created','journey_entry_criteria_','\x27\x20not\x20found\x20in\x20journey\x20\x27','Activation','toString','null','segments','withProgress','resolveJourneyId','segment','create','activationActions','Condition','activation_updating','yamlConfig','list','connectionIdToNameMap','deps','journey','./journey-yaml.js','3055188PYayqo','keys','\x27\x20from\x20file:\x20','createActivation','all_columns','has','from','18HhrqJY','1035805NRELxS','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','hex','draft','parse','activation_','folderPath','schedule','Updated\x20activation\x20\x27','folder_created','validatedRequest','all','Failed\x20to\x20resolve\x20segment\x20','with','getActivation','\x27\x20decision\x20point\x20branch\x20\x27','../../utils/async.js','buildUserMaps','relative','DecisionPoint','journeyBundleName','uniqueServerName','14106420JnbmCO','NOT_FOUND','journey_updated','createdSegmentId','getSegment','Updating\x20segment\x20\x27','versionNumber','ACTIVATION_SYNTAX_ERROR','resolveSegment','progress','dirname','folderId','logWarning','logDeleted','find','segmentId','entry','day','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','exitCriterias','set','activationStepsById','folder_creating','\x27\x20exit\x20criteria','rule','\x20(referenced\x20in\x20journey\x20','segment_deleting','run_after_journey_refresh','\x27\x20by\x20rule\x20content','notification','updated','waitStep','segment_updating','\x20activation\x20\x27','add','unchanged','Deleting\x20activation\x20\x27','Matched\x20server\x20segment\x20\x27','Failed\x20to\x20','logInfo','debug','__pending_','isArray','sha1','stringify','Journey\x20\x27','Created\x20segment\x20\x27','steps','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','decision_point','isNew','kind','some','delete','2QTRNoq','verbose','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','filter','Activation\x20not\x20found:\x20','entries','folder','JOURNEY_SYNTAX_ERROR','milestone','conditionTimeoutDuration','Stage\x20\x27','utf-8','segmentByFolderAndName','sort','\x27\x20entry\x20criteria','description','index','segment_updated','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','embedded_segment_created','getSegmentEntity','Embedded\x20segment\x20\x27','\x27...','\x0a\x20\x20','\x27\x20for\x20','updateSegmentById','push','existingActivation','folderPathToId','update','skipSegments','Fetching\x20','yamlActivation','getLatestJourneyId','data','action','activationContext','segment_deleted','stages','Deleted\x20activation\x20\x27'];a152_0x481a=function(){return _0x1d54de;};return a152_0x481a();}export function findJourneysToDelete(_0x2e5aa4,_0x18b731,_0x5e2379,_0x10dc21,_0x5c433c){const _0xf9fcaa=a152_0x59916b,_0x415253=new Set();for(const {yamlConfig:_0x1d612a,folderPath:_0x3dc2b6}of _0x18b731){_0x415253[_0xf9fcaa(0x180)](_0x3dc2b6+':'+_0x1d612a[_0xf9fcaa(0x1ce)]);}return _0x2e5aa4[_0xf9fcaa(0x197)](_0xeaceff=>{const _0x3e877a=_0xf9fcaa,_0x5a6098=_0xeaceff[_0x3e877a(0x169)]?_0x5e2379['get'](_0xeaceff[_0x3e877a(0x169)])||'':'',_0x115910=_0x5a6098+':'+_0xeaceff['journeyBundleName'];if(_0x415253[_0x3e877a(0x145)](_0x115910))return![];if(_0x5c433c)return _0x5a6098===_0x10dc21||_0x5a6098[_0x3e877a(0x1d7)](_0x10dc21+'/');return!![];});}export function buildSegmentLookupMap(_0x355c1e,_0x4bade7){const _0x5a3789=a152_0x59916b,_0x3d9099=new Map();for(const _0x1ebad8 of _0x355c1e){const _0x583d72=_0x1ebad8['segmentFolderId']?_0x4bade7['get'](_0x1ebad8[_0x5a3789(0x228)][_0x5a3789(0x23b)]())||'':'',_0x49e53d=_0x583d72+':'+_0x1ebad8[_0x5a3789(0x1ce)];_0x3d9099['set'](_0x49e53d,_0x1ebad8);}return _0x3d9099;}export function buildSegmentNameToIdMap(_0x36328a){const _0xe175e4=a152_0x59916b,_0x1fc74b=new Map();for(const _0x251cbe of _0x36328a){_0x1fc74b['set'](_0x251cbe[_0xe175e4(0x1ce)],_0x251cbe['id']);}return _0x1fc74b;}export function buildJourneyBundleLookupMap(_0x46ed9e,_0x483f55){const _0x5043bb=a152_0x59916b,_0x31523a=new Map();for(const _0x1bbe73 of _0x46ed9e){const _0x558b9a=_0x1bbe73[_0x5043bb(0x169)]?_0x483f55['get'](_0x1bbe73[_0x5043bb(0x169)])||'':'',_0x28965d=_0x558b9a+':'+_0x1bbe73[_0x5043bb(0x15c)];!_0x31523a[_0x5043bb(0x145)](_0x28965d)&&_0x31523a[_0x5043bb(0x172)](_0x28965d,[]),_0x31523a[_0x5043bb(0x21c)](_0x28965d)[_0x5043bb(0x1ae)](_0x1bbe73);}for(const _0x2d7c98 of _0x31523a[_0x5043bb(0x1c8)]()){_0x2d7c98[_0x5043bb(0x1a1)]((_0xcf814,_0x48c53c)=>(_0xcf814[_0x5043bb(0x164)]||0x0)-(_0x48c53c[_0x5043bb(0x164)]||0x0));}return _0x31523a;}export function collectFoldersToCreate(_0x21e01b,_0x273089){const _0x403d6e=a152_0x59916b,_0x347999=new Set();for(const _0x5e704b of _0x21e01b){if(!_0x5e704b)continue;if(_0x273089['has'](_0x5e704b))continue;const _0x29b81d=_0x5e704b[_0x403d6e(0x1e8)]('/');let _0x556726='';for(const _0x13883f of _0x29b81d){_0x556726=_0x556726?_0x556726+'/'+_0x13883f:_0x13883f,!_0x273089[_0x403d6e(0x145)](_0x556726)&&_0x347999[_0x403d6e(0x180)](_0x556726);}}return _0x347999;}export function parseAndClassifyYamlFiles(_0x5621ab,_0xa6b5d5,_0x789ab0){const _0x1ccd8f=a152_0x59916b,_0x2280b8=[],_0x38e218=[];for(const _0x4443e8 of _0x5621ab){const _0x5ca330=a152_0x822047['relative'](_0xa6b5d5,a152_0x822047[_0x1ccd8f(0x168)](_0x4443e8)),_0x18ea99=_0x5ca330==='.'?'':_0x5ca330,_0x4b9e96=readFileSync(_0x4443e8,_0x1ccd8f(0x19f)),_0x314467=a152_0x329c1f[_0x1ccd8f(0x14c)](_0x4b9e96);if(isJourneyDef(_0x314467)){const _0x22b732=a152_0x73dd06(_0x4b9e96);_0x38e218[_0x1ccd8f(0x1ae)]({'yamlConfig':_0x22b732,'folderPath':_0x18ea99,'sourcePath':_0x4443e8});}else{if(!_0x789ab0?.[_0x1ccd8f(0x1b2)]){const _0x18003f=parseSegmentYamlFile(_0x4b9e96),_0x24b919=normalizeChildSegmentYaml(_0x18003f);_0x2280b8[_0x1ccd8f(0x1ae)]({'yamlConfig':_0x24b919,'folderPath':_0x18ea99,'sourcePath':_0x4443e8});}}}return{'segments':_0x2280b8,'journeys':_0x38e218};}export function validateParsedFiles(_0x35c275,_0x2953af){const _0x376375=a152_0x59916b,_0x4e388b=[];for(const {yamlConfig:_0x50cb93,sourcePath:_0x275881}of _0x35c275[_0x376375(0x23d)]){const _0x296cb3=readFileSync(_0x275881,_0x376375(0x19f)),_0x258995=a152_0x329c1f['parseDocument'](_0x296cb3),_0x526ca5=validateSegmentDef(_0x50cb93,{'source':_0x296cb3,'document':_0x258995},{'skipSchema':!![]});if(!_0x526ca5[_0x376375(0x1bc)]){const _0x5b183e=a152_0x822047[_0x376375(0x15a)](_0x2953af,_0x275881);_0x4e388b[_0x376375(0x1ae)]({'filePath':_0x5b183e,'source':_0x296cb3,'result':_0x526ca5,'isJourney':![]});}}for(const {yamlConfig:_0x2404f5,sourcePath:_0x2b9893}of _0x35c275[_0x376375(0x232)]){const _0x355dce=readFileSync(_0x2b9893,_0x376375(0x19f)),_0x28b886=a152_0x329c1f[_0x376375(0x1c1)](_0x355dce),_0x2a3bc3=validateJourneyDef(_0x2404f5,{'source':_0x355dce,'document':_0x28b886},{'skipSchema':!![]});if(!_0x2a3bc3[_0x376375(0x1bc)]){const _0x2dc417=a152_0x822047[_0x376375(0x15a)](_0x2953af,_0x2b9893);_0x4e388b[_0x376375(0x1ae)]({'filePath':_0x2dc417,'source':_0x355dce,'result':_0x2a3bc3,'isJourney':!![]});}}return _0x4e388b;}export function formatValidationErrors(_0x57ea24){const _0x1607f4=a152_0x59916b,_0x1f35e9=[];for(const {filePath:_0x1efe27,source:_0x40d57c,result:_0x136d68,isJourney:_0x54bd2c}of _0x57ea24){const _0x2fb4f2=_0x54bd2c?'journey':_0x1607f4(0x240);_0x1f35e9[_0x1607f4(0x1ae)]('\x0a'+_0x1efe27+'\x20('+_0x2fb4f2+_0x1607f4(0x226)+_0x136d68['errors'][_0x1607f4(0x1fd)]+'\x20error(s)'),_0x1f35e9[_0x1607f4(0x1ae)](formatValidationResult(_0x136d68,_0x40d57c,_0x1efe27));}return _0x1f35e9[_0x1607f4(0x1d3)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4fa36d){const _0x2212b8=a152_0x59916b,_0x222537=new Set(),_0x305b93=new Map(),_0x5dbd86=collectSegmentUsageCounts(_0x4fa36d);if(_0x4fa36d[_0x2212b8(0x23d)])for(const [_0x29e06d,_0x27430e]of Object[_0x2212b8(0x199)](_0x4fa36d[_0x2212b8(0x23d)])){_0x222537['add'](_0x29e06d);if(_0x27430e[_0x2212b8(0x176)]){const _0x1a4229=yamlRuleToApi(_0x27430e[_0x2212b8(0x176)]),_0x2a5b38=apiRuleToYaml(_0x1a4229);_0x305b93[_0x2212b8(0x172)](_0x29e06d,_0x2a5b38);}}const _0x70eef4=new Map();let _0x53af23=0x0;for(const [_0x27305a,_0x39c0ed]of _0x305b93){const _0x4372a2=serializeExpandedRule(_0x39c0ed,_0x305b93),_0x2671d7=_0x70eef4[_0x2212b8(0x21c)](_0x4372a2)||[];_0x2671d7[_0x2212b8(0x1ae)]({'name':_0x27305a,'index':_0x53af23}),_0x70eef4[_0x2212b8(0x172)](_0x4372a2,_0x2671d7),_0x53af23++;}const _0x5ba125=new Map();for(const [_0xea3cd4,_0x7b70ac]of _0x70eef4){const _0x115c08=_0x7b70ac[_0x2212b8(0x1d9)]()[_0x2212b8(0x1a1)]((_0x278699,_0x3e893b)=>{const _0x15912f=_0x2212b8,_0x1d32c4=_0x5dbd86['get'](_0x278699[_0x15912f(0x1ce)])||0x0,_0x3b6f31=_0x5dbd86[_0x15912f(0x21c)](_0x3e893b[_0x15912f(0x1ce)])||0x0;if(_0x1d32c4!==_0x3b6f31)return _0x3b6f31-_0x1d32c4;return _0x278699[_0x15912f(0x1a4)]-_0x3e893b[_0x15912f(0x1a4)];})[_0x2212b8(0x1da)](_0x442572=>_0x442572[_0x2212b8(0x1ce)]),_0x2b04db=[];for(const _0xda22d5 of _0x115c08){const _0x95ea08=_0x5dbd86['get'](_0xda22d5)||0x0,_0x4d2e86=Math[_0x2212b8(0x204)](_0x95ea08,0x1);for(let _0x55ed5e=0x0;_0x55ed5e<_0x4d2e86;_0x55ed5e++){_0x2b04db[_0x2212b8(0x1ae)](_0xda22d5);}}_0x5ba125[_0x2212b8(0x172)](_0xea3cd4,_0x2b04db);}return{'existingLocalSegmentNames':_0x222537,'localSegmentRules':_0x305b93,'localExpandedRuleToNames':_0x5ba125};}export function createSegmentIdResolver(_0x3e6707,_0x407dbd){return async _0xfa3dc8=>{const _0x16bf08=a152_0x54b0,_0x125bb4=_0x3e6707[_0x16bf08(0x21c)](_0xfa3dc8);if(!_0x125bb4)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x16bf08(0x213)+_0xfa3dc8+_0x16bf08(0x149)+_0x407dbd+'\x27)');return _0x125bb4;};}export function extractRootFolderId(_0xeec8f3){const _0x2a71ba=a152_0x59916b;return _0xeec8f3[_0x2a71ba(0x1ef)]?.[_0x2a71ba(0x22f)]?.[_0x2a71ba(0x1b6)]?.['id']||_0xeec8f3[_0x2a71ba(0x1ef)]?.['parentFolder']?.[_0x2a71ba(0x1b6)]?.['id'];}export function buildConnectionMaps(_0x492530){const _0x49377d=a152_0x59916b,_0x2a3b25=new Map(),_0x1880e7=new Map(),_0x5da601=new Map();for(const _0x27426f of _0x492530){_0x2a3b25[_0x49377d(0x172)](_0x27426f[_0x49377d(0x1ce)],parseInt(_0x27426f['id'],0xa)),_0x1880e7[_0x49377d(0x172)](_0x27426f['id'],_0x27426f['name']),_0x5da601['set'](_0x27426f['name'],_0x27426f[_0x49377d(0x216)]);}return{'nameToId':_0x2a3b25,'idToName':_0x1880e7,'nameToType':_0x5da601};}export function calculatePushStats(_0x40feca,_0x1b94a3,_0x2b8fbd,_0x57a439,_0x33374c,_0x44cfd7,_0x20b05e){const _0x3f7a34=a152_0x59916b,_0x164c3c=_0x40feca[_0x3f7a34(0x197)](_0xcd86e5=>_0xcd86e5['isNew']),_0x5cd377=_0x40feca[_0x3f7a34(0x197)](_0x340123=>!_0x340123[_0x3f7a34(0x190)]&&_0x340123[_0x3f7a34(0x1f7)]),_0x18b76d=_0x40feca[_0x3f7a34(0x197)](_0x46dc6d=>!_0x46dc6d[_0x3f7a34(0x190)]&&!_0x46dc6d['hasChanges']),_0x454394=_0x44cfd7?_0x57a439:[],_0x1f0ef2=_0x1b94a3['filter'](_0x2238b4=>_0x2238b4[_0x3f7a34(0x190)]),_0x592e26=_0x1b94a3[_0x3f7a34(0x197)](_0x13b137=>!_0x13b137[_0x3f7a34(0x190)]&&_0x13b137[_0x3f7a34(0x1f7)]),_0x1b1539=_0x1b94a3[_0x3f7a34(0x197)](_0x5f4333=>!_0x5f4333['isNew']&&!_0x5f4333[_0x3f7a34(0x1f7)]),_0x2bb857=_0x44cfd7?_0x33374c:[],_0x48771f=_0x40feca['flatMap'](_0xf4c441=>_0xf4c441[_0x3f7a34(0x242)]),_0x4210af=_0x48771f[_0x3f7a34(0x197)](_0x459745=>_0x459745[_0x3f7a34(0x216)]===_0x3f7a34(0x241)),_0xc6fc33=_0x48771f[_0x3f7a34(0x197)](_0x605ee5=>_0x605ee5[_0x3f7a34(0x216)]===_0x3f7a34(0x1b1)),_0x335604=_0x48771f['filter'](_0x52f8cc=>_0x52f8cc[_0x3f7a34(0x216)]===_0x3f7a34(0x193)),_0x543561=Array[_0x3f7a34(0x146)](_0x2b8fbd)[_0x3f7a34(0x1a1)](),_0x1b40db=_0x20b05e?![]:_0x164c3c[_0x3f7a34(0x1fd)]>0x0||_0x5cd377[_0x3f7a34(0x1fd)]>0x0||_0x454394[_0x3f7a34(0x1fd)]>0x0,_0x356425=_0x1f0ef2['length']>0x0||_0x592e26['length']>0x0||_0x2bb857[_0x3f7a34(0x1fd)]>0x0,_0x4f7b99=_0x20b05e?![]:_0x48771f['length']>0x0,_0x2350f1=_0x543561[_0x3f7a34(0x1fd)]>0x0;return{'segments':{'new':_0x164c3c,'changed':_0x5cd377,'unchanged':_0x18b76d,'toDelete':_0x454394},'journeys':{'new':_0x1f0ef2,'changed':_0x592e26,'unchanged':_0x1b1539,'toDelete':_0x2bb857},'activations':{'all':_0x48771f,'toCreate':_0x4210af,'toUpdate':_0xc6fc33,'toDelete':_0x335604},'folders':{'toCreate':_0x543561},'counts':{'segments':{'new':_0x164c3c[_0x3f7a34(0x1fd)],'changed':_0x5cd377[_0x3f7a34(0x1fd)],'unchanged':_0x18b76d[_0x3f7a34(0x1fd)],'toDelete':_0x454394['length']},'journeys':{'new':_0x1f0ef2[_0x3f7a34(0x1fd)],'changed':_0x592e26[_0x3f7a34(0x1fd)],'unchanged':_0x1b1539[_0x3f7a34(0x1fd)],'toDelete':_0x2bb857[_0x3f7a34(0x1fd)]},'activations':{'create':_0x4210af[_0x3f7a34(0x1fd)],'update':_0xc6fc33['length'],'delete':_0x335604[_0x3f7a34(0x1fd)]},'folders':_0x543561['length']},'hasChanges':_0x1b40db||_0x356425||_0x4f7b99||_0x2350f1};}export async function buildPushExecutionContext(_0x157c19,_0x407489,_0x1dfdcd,_0x58d0ac,_0x52a8cc,_0x50e85d){const _0x4b9d6a=a152_0x59916b,_0x72b821=extractRootFolderId(_0x1dfdcd),{pathToId:_0x274587,idToPath:_0x2f4168}=buildFolderMaps(_0x52a8cc),_0x121a62=buildSegmentNameToIdMap(_0x58d0ac),_0x52255f=new Map(),{batchAsync:_0x3f2276}=await import('../../utils/async.js'),[_0x5d8cad,_0x200f81]=await Promise[_0x4b9d6a(0x153)]([_0x157c19['user'][_0x4b9d6a(0x159)](),_0x157c19[_0x4b9d6a(0x208)][_0x4b9d6a(0x246)](),((async()=>{const _0x404c26=_0x4b9d6a;!_0x50e85d&&_0x58d0ac[_0x404c26(0x1fd)]>0x0&&await _0x3f2276(_0x58d0ac,async _0x2ee4a5=>{const _0x5c5f0c=_0x404c26,_0x4af888=await _0x157c19['segment'][_0x5c5f0c(0x1ee)](_0x407489,_0x2ee4a5['id']);_0x52255f[_0x5c5f0c(0x172)](_0x2ee4a5['id'],_0x4af888);});})())]),{emailToId:_0x53bb70,idToEmail:_0x3aac9d}=_0x5d8cad,_0x2ad7ab=buildConnectionMaps(_0x200f81);return{'rootFolderId':_0x72b821,'folderPathToId':_0x274587,'folderIdToPath':_0x2f4168,'segmentNameToId':_0x121a62,'activationsBySegmentId':_0x52255f,'emailToIdMap':_0x53bb70,'idToEmailMap':_0x3aac9d,'connectionNameToIdMap':_0x2ad7ab['nameToId'],'connectionIdToNameMap':_0x2ad7ab[_0x4b9d6a(0x220)],'connectionNameToTypeMap':_0x2ad7ab['nameToType']};}export function createPushYamlContextForBundle(_0x583450,_0x3206f3,_0xaf91ad,_0x2f188c,_0x444363,_0x797514,_0x419ca5,_0x36c585){const {existingLocalSegmentNames:_0x1cb67f,localExpandedRuleToNames:_0x34b9e8}=_0x2f188c,_0x383f34=new Set(),_0x5c6d44=new Map(),_0x5044fc=new Map(),_0x308c94=new Map(),_0x292d6e=createJumpTargetCache(),_0x2986a4=new Map(),_0x2eea8a=new Map(),_0x386c9b=new Set();let _0x302c75;const _0xd63835=_0x150acf=>{const _0x2fddc7={'resolveSegment':async _0xbf337c=>{const _0x5e90fc=a152_0x54b0,_0x5b7d62=_0x308c94[_0x5e90fc(0x21c)](_0xbf337c);if(_0x5b7d62!==undefined)return{'name':_0x5b7d62,'isJourneyLocal':!![]};try{const _0x5bb411=await fetchSegment(_0x583450,_0x3206f3,_0xbf337c,_0xaf91ad);if(!_0x5bb411)throw new Error(_0x5e90fc(0x209));const _0x4ae411=generateJourneyLocalName(_0x5bb411[_0x5e90fc(0x1ce)]),_0x5e432e=_0x5bb411[_0x5e90fc(0x191)]===SEGMENT_KIND_JOURNEY&&_0x4ae411!==undefined;let _0x2ae1c7=_0x5bb411[_0x5e90fc(0x1ce)],_0x3af4dc;if(_0x5e432e&&_0x5bb411['rule']){const _0x1202b1=apiRuleToYaml(_0x5bb411[_0x5e90fc(0x176)]);_0x2eea8a[_0x5e90fc(0x172)](_0xbf337c,_0x1202b1);const _0x12abf8=async _0x57501c=>{const _0x3f467d=_0x5e90fc,_0x2d7ad9=collectSegmentRefsFromRule(_0x57501c);for(const _0x4ccd92 of _0x2d7ad9){if(!_0x2eea8a[_0x3f467d(0x145)](_0x4ccd92))try{const _0x23cacf=await fetchSegment(_0x583450,_0x3206f3,_0x4ccd92,_0xaf91ad);if(_0x23cacf?.[_0x3f467d(0x176)]){const _0x40d47e=apiRuleToYaml(_0x23cacf[_0x3f467d(0x176)]);_0x2eea8a[_0x3f467d(0x172)](_0x4ccd92,_0x40d47e),await _0x12abf8(_0x40d47e);}}catch(_0x132beb){logger['debug'](_0x3f467d(0x1d2)+_0x4ccd92+':\x20'+_0x132beb);}}};await _0x12abf8(_0x1202b1);const _0x4e2f70=serializeExpandedRule(_0x1202b1,_0x2eea8a),_0x5e32e5=_0x34b9e8[_0x5e90fc(0x21c)](_0x4e2f70);if(_0x5e32e5&&_0x5e32e5[_0x5e90fc(0x1fd)]>0x0){const _0x49178b=_0x5c6d44[_0x5e90fc(0x21c)](_0x4e2f70)||0x0,_0x975881=_0x5e32e5[_0x49178b]||_0x5e32e5[_0x5e32e5['length']-0x1];_0x5c6d44[_0x5e90fc(0x172)](_0x4e2f70,_0x49178b+0x1),_0x2ae1c7=_0x975881,_0x383f34[_0x5e90fc(0x180)](_0x2ae1c7),_0x308c94['set'](_0xbf337c,_0x2ae1c7);const _0x11fa67=await resolveRuleSegmentRefs(_0x1202b1,async _0xfa465d=>{const _0x47b46b=_0x5e90fc,_0x239748=_0x308c94[_0x47b46b(0x21c)](_0xfa465d);if(_0x239748)return _0x239748;const _0x337ae5=await _0x302c75[_0x47b46b(0x166)](_0xfa465d);return _0x337ae5[_0x47b46b(0x1ce)];});_0x3af4dc={'description':_0x5bb411[_0x5e90fc(0x1a3)],'rule':_0x11fa67};}else{const _0x167a7f=_0x2986a4[_0x5e90fc(0x21c)](_0x4e2f70);if(_0x167a7f)_0x2ae1c7=_0x167a7f,_0x308c94[_0x5e90fc(0x172)](_0xbf337c,_0x2ae1c7);else{if(_0x4ae411){let _0x44305b=_0x4ae411,_0x231134=0x2;while(_0x383f34['has'](_0x44305b)||_0x1cb67f['has'](_0x44305b)){_0x44305b=_0x4ae411+'_'+_0x231134,_0x231134++;}_0x383f34[_0x5e90fc(0x180)](_0x44305b),_0x2ae1c7=_0x44305b;}_0x308c94['set'](_0xbf337c,_0x2ae1c7),_0x2986a4[_0x5e90fc(0x172)](_0x4e2f70,_0x2ae1c7);const _0x2b642c=await resolveRuleSegmentRefs(_0x1202b1,async _0x3cd97f=>{const _0x19c6e5=_0x308c94['get'](_0x3cd97f);if(_0x19c6e5)return _0x19c6e5;const _0x472fbf=await _0x302c75['resolveSegment'](_0x3cd97f);return _0x472fbf['name'];});_0x3af4dc={'description':_0x5bb411[_0x5e90fc(0x1a3)],'rule':_0x2b642c};}}}return{'name':_0x2ae1c7,'isJourneyLocal':_0x5e432e,'definition':_0x3af4dc};}catch(_0x1e1d2b){return logger[_0x5e90fc(0x186)](_0x5e90fc(0x154)+_0xbf337c+':\x20'+_0x1e1d2b),{'name':_0xbf337c,'isJourneyLocal':![]};}},'resolveActivation':async _0x407c11=>{const _0x366db3=a152_0x54b0,_0x559c19=_0x5044fc[_0x366db3(0x21c)](_0x407c11);if(_0x559c19!==undefined)return{'name':_0x559c19,'isJourneyLocal':!![]};try{let _0x65358=_0x419ca5?.['get'](_0x407c11);!_0x65358&&(_0x65358=await _0x583450[_0x366db3(0x13e)][_0x366db3(0x156)](_0x150acf,_0x407c11));const _0x32b44a=_0x65358[_0x366db3(0x211)]['activationParams']['name']||_0x407c11,_0x3172be=sanitizeYamlKey(_0x32b44a)||_0x366db3(0x14d)+_0x407c11,_0x5dd6d1=_0x3172be;_0x5044fc[_0x366db3(0x172)](_0x407c11,_0x5dd6d1);const _0x53028c=journeyActivationStepToYaml(_0x65358,_0x444363,_0x797514);return{'name':_0x5dd6d1,'isJourneyLocal':!![],'definition':_0x53028c};}catch(_0x16be4b){return logger[_0x366db3(0x186)]('Failed\x20to\x20resolve\x20activation\x20'+_0x407c11+':\x20'+_0x16be4b),{'name':_0x407c11,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x43015b,_0x48211d)=>resolveJumpTarget(_0x43015b,_0x48211d,_0x292d6e,async _0x1957b5=>{const _0x22720a=a152_0x54b0,_0x4eec75=_0x36c585?.[_0x22720a(0x21c)](_0x1957b5);if(_0x4eec75)return _0x4eec75;return _0x583450[_0x22720a(0x13e)][_0x22720a(0x229)](_0x1957b5);})};return _0x302c75=_0x2fddc7,_0x2fddc7;},_0x1c7190=async _0x4ec62d=>{const _0x4c3ee8=a152_0x54b0,{collectSegmentIdsFromJourneyApi:_0x18b53f}=await import(_0x4c3ee8(0x13f)),{batchAsync:_0x466468}=await import('../../utils/async.js'),_0x217a66=new Set();for(const _0x3bfe7d of _0x4ec62d){let _0x260845=_0x36c585?.[_0x4c3ee8(0x21c)](_0x3bfe7d);!_0x260845&&(_0x260845=await _0x583450[_0x4c3ee8(0x13e)][_0x4c3ee8(0x229)](_0x3bfe7d));const _0x19dd94=_0x18b53f(_0x260845);for(const _0x4a6afb of _0x19dd94){_0x217a66[_0x4c3ee8(0x180)](_0x4a6afb);}}let _0x2cffa1=Array[_0x4c3ee8(0x146)](_0x217a66);while(_0x2cffa1[_0x4c3ee8(0x1fd)]>0x0){const _0xecc5dc=_0x2cffa1['filter'](_0x3b2b15=>!_0x386c9b['has'](_0x3b2b15));if(_0xecc5dc[_0x4c3ee8(0x1fd)]===0x0)break;const _0x2a1471=await _0x466468(_0xecc5dc,async _0x419902=>{const _0x5330c1=_0x4c3ee8;_0x386c9b[_0x5330c1(0x180)](_0x419902);const _0x2c112b=await fetchSegment(_0x583450,_0x3206f3,_0x419902,_0xaf91ad);if(!_0x2c112b)return null;return{'segmentId':_0x419902,'segment':_0x2c112b};},0xa),_0x46cb6c=new Set();for(const _0x4ccdf2 of _0x2a1471){if(!_0x4ccdf2?.[_0x4c3ee8(0x240)]?.[_0x4c3ee8(0x176)])continue;const _0x2dbf11=apiRuleToYaml(_0x4ccdf2['segment'][_0x4c3ee8(0x176)]);_0x2eea8a[_0x4c3ee8(0x172)](_0x4ccdf2[_0x4c3ee8(0x16d)],_0x2dbf11);const _0x5e4ea0=collectSegmentRefsFromRule(_0x2dbf11);for(const _0x67f442 of _0x5e4ea0){!_0x386c9b[_0x4c3ee8(0x145)](_0x67f442)&&_0x46cb6c[_0x4c3ee8(0x180)](_0x67f442);}}_0x2cffa1=Array[_0x4c3ee8(0x146)](_0x46cb6c);}};return{'createYamlContext':_0xd63835,'prefetchJourneySegments':_0x1c7190};}export async function executePushSegments(_0x63d245,_0x4e74dc,_0x17ef44,_0x439987,_0x445ab7){const _0x2f9ad0=a152_0x59916b,{segmentDefToCreateRequest:_0x52ff48,segmentDefToUpdateRequest:_0x4b69d5}=await import('./child-segment-yaml.js'),_0x2bf66b=_0x17ef44['folderPathToId'],_0x416ec5=0x5,_0x43996b=async _0x88eccf=>{const _0x2f6c5d=a152_0x54b0,_0x2156aa=_0x88eccf[_0x2f6c5d(0x14e)]?_0x2bf66b[_0x2f6c5d(0x21c)](_0x88eccf[_0x2f6c5d(0x14e)]):undefined;let _0x4ca952;const _0xc9607d={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x11d7c4=_0x88eccf[_0x2f6c5d(0x245)];if(_0x88eccf['yamlConfig']['rule']){const _0x447dd6=createSegmentIdResolver(_0x17ef44[_0x2f6c5d(0x20d)],_0x88eccf['yamlConfig'][_0x2f6c5d(0x1ce)]),_0x2687ac=await resolveRuleSegmentIds(_0x88eccf['yamlConfig'][_0x2f6c5d(0x176)],_0x447dd6);_0x11d7c4={..._0x88eccf[_0x2f6c5d(0x245)],'rule':_0x2687ac};}try{if(_0x88eccf['isNew']){_0x445ab7[_0x2f6c5d(0x224)]?.({'type':_0x2f6c5d(0x1dd),'name':_0x88eccf['yamlConfig'][_0x2f6c5d(0x1ce)]});const _0x485fa1=_0x52ff48(_0x11d7c4,_0x2156aa),_0x4c3abf=await _0x445ab7[_0x2f6c5d(0x23e)]('Creating\x20segment\x20\x27'+_0x88eccf['yamlConfig']['name']+_0x2f6c5d(0x1aa),()=>_0x63d245[_0x2f6c5d(0x240)]['createSegment'](_0x439987[_0x2f6c5d(0x1c5)],_0x485fa1));_0x4ca952=_0x4c3abf['data']['id'],_0x17ef44[_0x2f6c5d(0x20d)]['set'](_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)],_0x4ca952),_0xc9607d[_0x2f6c5d(0x161)]={'name':_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)],'id':_0x4ca952},_0x445ab7[_0x2f6c5d(0x224)]?.({'type':_0x2f6c5d(0x1fb),'name':_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)],'segmentId':_0x4ca952}),_0x445ab7[_0x2f6c5d(0x1e6)]?.(_0x2f6c5d(0x18c)+_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)]+'\x27'),_0xc9607d['created']=0x1;}else{if(_0x88eccf[_0x2f6c5d(0x1f7)]){_0x445ab7[_0x2f6c5d(0x224)]?.({'type':_0x2f6c5d(0x17e),'name':_0x88eccf[_0x2f6c5d(0x245)]['name']});const _0x1ab5b4=_0x4b69d5(_0x11d7c4);_0x2156aa!==_0x88eccf[_0x2f6c5d(0x1f6)]?.[_0x2f6c5d(0x228)]&&(_0x1ab5b4['segmentFolderId']=_0x2156aa?parseInt(_0x2156aa,0xa):undefined),await _0x445ab7[_0x2f6c5d(0x23e)](_0x2f6c5d(0x163)+_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)]+_0x2f6c5d(0x1aa),()=>_0x63d245[_0x2f6c5d(0x240)]['updateSegmentById'](_0x439987[_0x2f6c5d(0x1c5)],_0x88eccf[_0x2f6c5d(0x1f6)]['id'],_0x1ab5b4)),_0x4ca952=_0x88eccf[_0x2f6c5d(0x1f6)]['id'],_0x445ab7[_0x2f6c5d(0x224)]?.({'type':_0x2f6c5d(0x1a5),'name':_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)]}),_0x445ab7[_0x2f6c5d(0x1e6)]?.('Updated\x20segment\x20\x27'+_0x88eccf['yamlConfig'][_0x2f6c5d(0x1ce)]+'\x27'),_0xc9607d[_0x2f6c5d(0x17c)]=0x1;}else _0x4ca952=_0x88eccf['existingSegment']['id'];}}catch(_0x2f8165){const _0x406cec=isHttp400Error(_0x2f8165),_0x128ae9=_0x406cec?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x2f6c5d(0x1c3)],_0x15cfc1=getErrorMessage(_0x2f8165);throw new SDKError(_0x128ae9,'Failed\x20to\x20'+(_0x88eccf[_0x2f6c5d(0x190)]?_0x2f6c5d(0x241):_0x2f6c5d(0x1b1))+_0x2f6c5d(0x20e)+_0x88eccf[_0x2f6c5d(0x202)]+_0x2f6c5d(0x1ab)+_0x15cfc1,_0x2f8165);}try{const _0x557955=await syncActivationsForSegment(_0x63d245,_0x439987[_0x2f6c5d(0x1c5)],_0x4ca952,_0x88eccf['yamlConfig'][_0x2f6c5d(0x1ce)],_0x88eccf[_0x2f6c5d(0x242)],_0x445ab7,_0x88eccf[_0x2f6c5d(0x202)]);_0xc9607d[_0x2f6c5d(0x1df)]=_0x557955;}catch(_0xc5f7d4){if(_0xc5f7d4 instanceof SDKError)throw _0xc5f7d4;throw new SDKError(ErrorCode[_0x2f6c5d(0x1cc)],_0x2f6c5d(0x196)+_0x88eccf[_0x2f6c5d(0x245)][_0x2f6c5d(0x1ce)]+_0x2f6c5d(0x142)+_0x88eccf[_0x2f6c5d(0x202)]+'\x0a\x20\x20'+getErrorMessage(_0xc5f7d4),_0xc5f7d4);}return _0xc9607d;},_0x5d9334=await batchAsync(_0x4e74dc,_0x43996b,_0x416ec5),_0x5f4bc3={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1a0582 of _0x5d9334){_0x5f4bc3['created']+=_0x1a0582[_0x2f9ad0(0x1dc)],_0x5f4bc3[_0x2f9ad0(0x17c)]+=_0x1a0582[_0x2f9ad0(0x17c)],_0x1a0582[_0x2f9ad0(0x161)]&&_0x5f4bc3[_0x2f9ad0(0x200)][_0x2f9ad0(0x172)](_0x1a0582[_0x2f9ad0(0x161)]['name'],_0x1a0582[_0x2f9ad0(0x161)]['id']),_0x5f4bc3[_0x2f9ad0(0x1df)][_0x2f9ad0(0x1dc)]+=_0x1a0582[_0x2f9ad0(0x1df)][_0x2f9ad0(0x1dc)],_0x5f4bc3[_0x2f9ad0(0x1df)][_0x2f9ad0(0x17c)]+=_0x1a0582[_0x2f9ad0(0x1df)][_0x2f9ad0(0x17c)],_0x5f4bc3[_0x2f9ad0(0x1df)][_0x2f9ad0(0x1c7)]+=_0x1a0582['activations'][_0x2f9ad0(0x1c7)];}return _0x5f4bc3;}async function syncActivationsForSegment(_0x2cefd8,_0xe1c161,_0x4cd661,_0x39ca84,_0x369e83,_0x25a881,_0x359c99){const _0x3562e2=a152_0x59916b,_0xcb1fd8={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xbc1bc4 of _0x369e83){try{if(_0xbc1bc4[_0x3562e2(0x216)]==='create'&&_0xbc1bc4['validatedRequest'])_0x25a881[_0x3562e2(0x224)]?.({'type':'activation_creating','segmentName':_0x39ca84,'activationName':_0xbc1bc4[_0x3562e2(0x1ce)]}),await _0x25a881[_0x3562e2(0x23e)]('Creating\x20activation\x20\x27'+_0xbc1bc4[_0x3562e2(0x1ce)]+_0x3562e2(0x1aa),()=>_0x2cefd8[_0x3562e2(0x240)][_0x3562e2(0x143)](_0xe1c161,_0x4cd661,_0xbc1bc4[_0x3562e2(0x152)])),_0x25a881['onProgress']?.({'type':'activation_created','segmentName':_0x39ca84,'activationName':_0xbc1bc4['name']}),_0x25a881['logSuccess']?.(_0x3562e2(0x222)+_0xbc1bc4['name']+'\x27'),_0xcb1fd8[_0x3562e2(0x1dc)]++;else{if(_0xbc1bc4[_0x3562e2(0x216)]===_0x3562e2(0x1b1)&&_0xbc1bc4[_0x3562e2(0x152)]&&_0xbc1bc4['existingActivation'])_0x25a881[_0x3562e2(0x224)]?.({'type':_0x3562e2(0x244),'segmentName':_0x39ca84,'activationName':_0xbc1bc4[_0x3562e2(0x1ce)]}),await _0x25a881['withProgress']('Updating\x20activation\x20\x27'+_0xbc1bc4[_0x3562e2(0x1ce)]+_0x3562e2(0x1aa),()=>_0x2cefd8['segment'][_0x3562e2(0x1d8)](_0xe1c161,_0x4cd661,_0xbc1bc4[_0x3562e2(0x1af)]['id'],_0xbc1bc4[_0x3562e2(0x152)])),_0x25a881[_0x3562e2(0x224)]?.({'type':_0x3562e2(0x21b),'segmentName':_0x39ca84,'activationName':_0xbc1bc4[_0x3562e2(0x1ce)]}),_0x25a881['logSuccess']?.(_0x3562e2(0x150)+_0xbc1bc4['name']+'\x27'),_0xcb1fd8['updated']++;else _0xbc1bc4['type']===_0x3562e2(0x193)&&_0xbc1bc4[_0x3562e2(0x1af)]&&(_0x25a881[_0x3562e2(0x224)]?.({'type':_0x3562e2(0x214),'segmentName':_0x39ca84,'activationName':_0xbc1bc4[_0x3562e2(0x1ce)]}),await _0x25a881[_0x3562e2(0x23e)](_0x3562e2(0x182)+_0xbc1bc4[_0x3562e2(0x1ce)]+_0x3562e2(0x1aa),()=>_0x2cefd8[_0x3562e2(0x240)][_0x3562e2(0x1f4)](_0xe1c161,_0x4cd661,_0xbc1bc4[_0x3562e2(0x1af)]['id'])),_0x25a881[_0x3562e2(0x224)]?.({'type':'activation_deleted','segmentName':_0x39ca84,'activationName':_0xbc1bc4[_0x3562e2(0x1ce)]}),_0x25a881[_0x3562e2(0x16b)]?.(_0x3562e2(0x1bb)+_0xbc1bc4[_0x3562e2(0x1ce)]+'\x27'),_0xcb1fd8[_0x3562e2(0x1c7)]++);}}catch(_0x4010af){const _0x15bf09=isHttp400Error(_0x4010af),_0xafbbe5=_0x15bf09?ErrorCode[_0x3562e2(0x165)]:ErrorCode[_0x3562e2(0x1cc)],_0x121a92=getErrorMessage(_0x4010af);throw new SDKError(_0xafbbe5,_0x3562e2(0x184)+_0xbc1bc4[_0x3562e2(0x216)]+_0x3562e2(0x17f)+_0xbc1bc4[_0x3562e2(0x1ce)]+_0x3562e2(0x142)+_0x359c99+_0x3562e2(0x1ab)+_0x121a92,_0x4010af);}}return _0xcb1fd8;}export async function executePushFolders(_0x3d07a5,_0x327f0d,_0x189ecd,_0xeb48c1,_0x440b1a){const _0x50514a=a152_0x59916b,_0x205fe7=new Map(_0x189ecd),_0x3933b0=sortFoldersByDepth(_0x327f0d);for(const _0x33c87a of _0x3933b0){const _0x508381=_0x33c87a[_0x50514a(0x1e8)]('/'),_0x533c20=_0x508381[_0x508381[_0x50514a(0x1fd)]-0x1],_0x22548f=_0x508381['slice'](0x0,-0x1)['join']('/'),_0x194fd3=_0x205fe7['get'](_0x22548f);_0x440b1a[_0x50514a(0x224)]?.({'type':_0x50514a(0x174),'folder':_0x33c87a});const _0x24283f={'name':_0x533c20,'parentFolderId':_0x194fd3},_0x2aa1c1=await _0x440b1a[_0x50514a(0x23e)]('Creating\x20folder\x20\x27'+_0x33c87a+_0x50514a(0x1aa),()=>_0x3d07a5[_0x50514a(0x240)][_0x50514a(0x1ea)](_0xeb48c1[_0x50514a(0x1c5)],_0x24283f));_0x205fe7[_0x50514a(0x172)](_0x33c87a,_0x2aa1c1['data']['id']),_0x440b1a[_0x50514a(0x224)]?.({'type':_0x50514a(0x151),'folder':_0x33c87a,'folderId':_0x2aa1c1[_0x50514a(0x1b6)]['id']}),_0x440b1a[_0x50514a(0x185)]?.('Created\x20folder\x20\x27'+_0x33c87a+'\x27');}return _0x205fe7;}export async function executePushSegmentDeletions(_0x1068cc,_0x859a7,_0x13ad19){const _0x22f52d=a152_0x59916b;if(_0x859a7[_0x22f52d(0x1fd)]===0x0)return 0x0;const {batchAsync:_0x3f3164}=await import(_0x22f52d(0x158)),_0x2436a4=0x5,_0x39f5d8=await _0x3f3164(_0x859a7,async _0x472953=>{const _0x442197=_0x22f52d;return _0x13ad19[_0x442197(0x224)]?.({'type':_0x442197(0x178),'name':_0x472953[_0x442197(0x1ce)]}),await _0x1068cc['segment'][_0x442197(0x22e)](_0x472953['id']),_0x13ad19['onProgress']?.({'type':_0x442197(0x1b9),'name':_0x472953[_0x442197(0x1ce)]}),_0x13ad19[_0x442197(0x16b)]?.('Deleted\x20segment\x20\x27'+_0x472953[_0x442197(0x1ce)]+'\x27'),0x1;},_0x2436a4);return _0x39f5d8[_0x22f52d(0x21e)]((_0x332287,_0x2b2ea8)=>_0x332287+_0x2b2ea8,0x0);}export async function executePushJourneys(_0x5f1422,_0x2b7610,_0x21aa85,_0x3d4280,_0x49444e){const _0x4c3656=a152_0x59916b,{journeyDefToRequest:_0x462a49}=await import(_0x4c3656(0x13f)),{activationDefToCreateRequest:_0x17d97b,yamlRuleToApi:_0x1856f0,validateSegmentRule:_0x1af0f4}=await import(_0x4c3656(0x20c)),_0x58b820={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4c42bf=new Map(_0x21aa85['segmentNameToId']),_0x3f0173=0x5;for(let _0x3a2eea=0x0;_0x3a2eea<_0x2b7610[_0x4c3656(0x1fd)];_0x3a2eea+=_0x3f0173){const _0x51817a=_0x2b7610['slice'](_0x3a2eea,_0x3a2eea+_0x3f0173),_0x6f670=await Promise['all'](_0x51817a[_0x4c3656(0x1da)](async _0x4b0f62=>{const _0x33c20e=_0x4c3656;if(!_0x4b0f62[_0x33c20e(0x190)]&&!_0x4b0f62[_0x33c20e(0x1f7)])return{'action':_0x33c20e(0x181),'name':_0x4b0f62[_0x33c20e(0x245)][_0x33c20e(0x1ce)],'journeyId':_0x4b0f62[_0x33c20e(0x1f0)]?.['id']};const _0x45acad=_0x4b0f62[_0x33c20e(0x14e)]?_0x21aa85[_0x33c20e(0x1b0)][_0x33c20e(0x21c)](_0x4b0f62[_0x33c20e(0x14e)]):undefined;_0x49444e[_0x33c20e(0x224)]?.({'type':_0x4b0f62[_0x33c20e(0x190)]?_0x33c20e(0x201):_0x33c20e(0x234),'name':_0x4b0f62['yamlConfig'][_0x33c20e(0x1ce)]});try{const _0xbfae44=await executeSingleJourneyPush(_0x5f1422,_0x4b0f62,{..._0x21aa85,'segmentNameToId':_0x4c42bf},{'parentId':_0x3d4280[_0x33c20e(0x1c5)],'rootFolderId':_0x3d4280[_0x33c20e(0x1e4)],'folderId':_0x45acad,'verbose':_0x3d4280[_0x33c20e(0x195)]},_0x49444e,{'journeyDefToRequest':_0x462a49,'activationDefToCreateRequest':_0x17d97b,'yamlRuleToApi':_0x1856f0,'validateSegmentRule':_0x1af0f4});for(const [_0x55b2c3,_0x50713a]of _0xbfae44[_0x33c20e(0x1eb)]){_0x4c42bf[_0x33c20e(0x172)](_0x55b2c3,_0x50713a),_0x58b820[_0x33c20e(0x1eb)][_0x33c20e(0x172)](_0x55b2c3,_0x50713a);}if(_0xbfae44['action']===_0x33c20e(0x1dc))_0x49444e[_0x33c20e(0x224)]?.({'type':_0x33c20e(0x22a),'name':_0x4b0f62[_0x33c20e(0x245)][_0x33c20e(0x1ce)],'journeyId':_0xbfae44[_0x33c20e(0x223)]}),_0x49444e['logSuccess']?.('Created\x20journey\x20\x27'+_0x4b0f62[_0x33c20e(0x245)]['name']+'\x27'),_0x58b820[_0x33c20e(0x1dc)]++;else _0xbfae44[_0x33c20e(0x1b7)]==='updated'&&(_0x49444e[_0x33c20e(0x224)]?.({'type':_0x33c20e(0x160),'name':_0x4b0f62[_0x33c20e(0x245)][_0x33c20e(0x1ce)]}),_0x49444e[_0x33c20e(0x1e6)]?.(_0x33c20e(0x1bd)+_0x4b0f62[_0x33c20e(0x245)]['name']+'\x27'),_0x58b820[_0x33c20e(0x17c)]++);return{'action':_0xbfae44[_0x33c20e(0x1b7)],'name':_0x4b0f62[_0x33c20e(0x245)][_0x33c20e(0x1ce)],'journeyId':_0xbfae44[_0x33c20e(0x223)]};}catch(_0x152caa){const _0x13fdb9=isHttp400Error(_0x152caa),_0xc51b96=_0x13fdb9?ErrorCode[_0x33c20e(0x19b)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x22fa48=getErrorMessage(_0x152caa);throw new SDKError(_0xc51b96,_0x33c20e(0x184)+(_0x4b0f62['isNew']?_0x33c20e(0x241):_0x33c20e(0x1b1))+'\x20journey\x20from\x20file:\x20'+_0x4b0f62[_0x33c20e(0x202)]+'\x0a\x20\x20'+_0x22fa48,_0x152caa);}}));_0x58b820['results'][_0x4c3656(0x1ae)](..._0x6f670);}return _0x58b820;}async function matchExistingJourneySegments(_0x4115e2,_0x47cb7e,_0x36dbb8,_0x552acf,_0x3d6f91){const _0x59e8a1=a152_0x59916b;if(!_0x47cb7e[_0x59e8a1(0x1f0)]||!_0x47cb7e[_0x59e8a1(0x245)][_0x59e8a1(0x23d)])return;const _0x24b240=new Map(),_0x41d105=new Set();for(const _0x1496d2 of Object[_0x59e8a1(0x141)](_0x47cb7e['yamlConfig']['segments'])){const _0x1f6e85=generateDeterministicJourneySegmentName(_0x47cb7e[_0x59e8a1(0x245)][_0x59e8a1(0x1ce)],_0x1496d2);_0x24b240[_0x59e8a1(0x172)](_0x1f6e85,_0x1496d2),_0x41d105[_0x59e8a1(0x180)](_0x1496d2);}const _0x4d0f07=[],_0x4969ed=collectSegmentIdsFromJourneyApi(_0x47cb7e[_0x59e8a1(0x1f0)]);for(const _0x3fba49 of _0x4969ed){const _0x49b58e=await fetchSegment(_0x4115e2,_0x36dbb8,_0x3fba49,_0x552acf);if(!_0x49b58e?.[_0x59e8a1(0x1ce)])continue;const _0x50139c=_0x24b240[_0x59e8a1(0x21c)](_0x49b58e[_0x59e8a1(0x1ce)]);_0x50139c?(_0x3d6f91['set'](_0x50139c,_0x3fba49),_0x41d105[_0x59e8a1(0x193)](_0x50139c)):_0x4d0f07[_0x59e8a1(0x1ae)]({'id':_0x3fba49,'seg':_0x49b58e});}if(_0x41d105[_0x59e8a1(0x1ff)]>0x0&&_0x4d0f07[_0x59e8a1(0x1fd)]>0x0){const {localExpandedRuleToNames:_0x4589ca}=buildLocalExpandedRuleMappings(_0x47cb7e['yamlConfig']),_0x3ec683=new Map();for(const {id:_0x2d0d39,seg:_0x373dc2}of _0x4d0f07){if(_0x373dc2[_0x59e8a1(0x176)]){const _0x119a43=apiRuleToYaml(_0x373dc2[_0x59e8a1(0x176)]);_0x3ec683[_0x59e8a1(0x172)](_0x2d0d39,_0x119a43);}}for(const {id:_0xde403,seg:_0xc6b2f2}of _0x4d0f07){if(!_0xc6b2f2[_0x59e8a1(0x176)])continue;const _0x14e6d3=_0x3ec683[_0x59e8a1(0x21c)](_0xde403);if(!_0x14e6d3)continue;const _0x5e9316=serializeExpandedRule(_0x14e6d3,_0x3ec683),_0x52e184=_0x4589ca[_0x59e8a1(0x21c)](_0x5e9316);if(_0x52e184){const _0x50a840=_0x52e184[_0x59e8a1(0x16c)](_0x3fb4ec=>_0x41d105[_0x59e8a1(0x145)](_0x3fb4ec));_0x50a840&&(_0x3d6f91['set'](_0x50a840,_0xde403),_0x41d105[_0x59e8a1(0x193)](_0x50a840),logger[_0x59e8a1(0x186)](_0x59e8a1(0x183)+_0xc6b2f2[_0x59e8a1(0x1ce)]+_0x59e8a1(0x1e0)+_0x50a840+_0x59e8a1(0x17a)));}}}}async function executeSingleJourneyPush(_0x43f726,_0x2e525e,_0x26386d,_0x4e74da,_0x2c2f8f,_0x56b4d1){const _0xe4749c=a152_0x59916b,{journeyDefToRequest:_0x1452d3,activationDefToCreateRequest:_0x4c826a,yamlRuleToApi:_0x5a9b64,validateSegmentRule:_0x2965f7}=_0x56b4d1,_0x4286e6=new Map(),_0x1143c9=new Map();recoverSegmentIdsFromPushRecovery(_0x2e525e,_0x4286e6,_0x26386d['segmentNameToId']);const _0x2e4dd0=new Map(),_0x1da4b0=new Map(),_0x7af2ad=new Map();let _0x1d58b1;const _0x81162=async()=>{const _0x220232=a152_0x54b0;if(_0x1d58b1)return;_0x1d58b1=new Map();if(!_0x2e525e['existingJourney'])return;const _0x35f6fd=await _0x43f726[_0x220232(0x13e)][_0x220232(0x1ee)](_0x2e525e[_0x220232(0x1f0)]['id']);for(const _0x36163b of _0x35f6fd){const _0x1b7ae1=journeyActivationStepToYaml(_0x36163b,_0x26386d['idToEmailMap'],_0x26386d[_0x220232(0x247)]),_0x3a7046=activationSignature(_0x1b7ae1);!_0x1d58b1[_0x220232(0x145)](_0x3a7046)&&_0x1d58b1[_0x220232(0x172)](_0x3a7046,_0x36163b['id']),_0x1b7ae1[_0x220232(0x1ce)]&&_0x1143c9[_0x220232(0x172)](_0x1b7ae1[_0x220232(0x1ce)],_0x36163b['id']);}};await matchExistingJourneySegments(_0x43f726,_0x2e525e,_0x4e74da['parentId'],_0x26386d[_0xe4749c(0x1bf)],_0x26386d['segmentNameToId']);const _0x53bd51={'resolveSegmentId':async _0x5c1858=>{const _0x4e1fd7=_0xe4749c,_0x2d0fe0=_0x26386d[_0x4e1fd7(0x20d)][_0x4e1fd7(0x21c)](_0x5c1858);if(!_0x2d0fe0)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4e1fd7(0x213)+_0x5c1858+_0x4e1fd7(0x177)+_0x2e525e[_0x4e1fd7(0x245)]['name']+')');return _0x2d0fe0;},'resolveEmbeddedSegmentId':async(_0x130ec0,_0x173808)=>{const _0x3073ce=_0xe4749c,_0x13669f=_0x26386d[_0x3073ce(0x20d)]['get'](_0x130ec0);if(_0x13669f)return _0x13669f;const _0x154669=_0x26386d[_0x3073ce(0x1bf)][_0x3073ce(0x16c)](_0xd8f6e=>_0xd8f6e[_0x3073ce(0x1ce)]===_0x130ec0);if(_0x154669)return _0x26386d['segmentNameToId'][_0x3073ce(0x172)](_0x130ec0,_0x154669['id']),_0x154669['id'];if(_0x2e525e[_0x3073ce(0x190)]){const {stageName:_0x1c037a,criteriaName:_0x47f62e}=findSegmentCriteriaLocation(_0x2e525e[_0x3073ce(0x245)],_0x130ec0);return _0x2965f7(_0x130ec0,_0x173808[_0x3073ce(0x176)]),_0x1da4b0[_0x3073ce(0x172)](_0x130ec0,{'definition':_0x173808,'stageName':_0x1c037a,'criteriaName':_0x47f62e}),createPendingSegmentId(_0x130ec0);}const _0x320b60=_0x2e525e[_0x3073ce(0x1f0)]?.['id'];if(!_0x320b60)throw new SDKError(ErrorCode[_0x3073ce(0x1e2)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x4dbf6e=_0x2e4dd0['get'](_0x130ec0);if(_0x4dbf6e)return _0x4dbf6e;const _0x323695=((async()=>{const _0xa929bb=_0x3073ce;_0x2965f7(_0x130ec0,_0x173808[_0xa929bb(0x176)]);const _0x100520=generateDeterministicJourneySegmentName(_0x2e525e[_0xa929bb(0x245)][_0xa929bb(0x1ce)],_0x130ec0),_0x2f15e7=_0x26386d[_0xa929bb(0x1bf)][_0xa929bb(0x16c)](_0x2f6398=>_0x2f6398[_0xa929bb(0x1ce)]===_0x100520),_0x33c6e0=createSegmentIdResolver(_0x26386d[_0xa929bb(0x20d)],_0x130ec0),_0x3c3cf8=await resolveRuleSegmentIds(_0x173808[_0xa929bb(0x176)],_0x33c6e0);let _0x30ccc8;return _0x2f15e7?(await _0x43f726[_0xa929bb(0x240)][_0xa929bb(0x1ad)](_0x4e74da[_0xa929bb(0x1c5)],_0x2f15e7['id'],{'description':_0x173808[_0xa929bb(0x1a3)]||_0xa929bb(0x1f8)+_0x130ec0,'rule':_0x5a9b64(_0x3c3cf8,!![]),'countPopulation':!![]}),_0x30ccc8=_0x2f15e7['id'],saveSegmentToPushRecovery(_0x2e525e[_0xa929bb(0x202)],_0x2e525e[_0xa929bb(0x245)][_0xa929bb(0x1ce)],_0x130ec0,{'segmentId':_0x30ccc8,'uniqueServerName':_0x100520,'createdAt':new Date()[_0xa929bb(0x22d)]()})):_0x30ccc8=await createOrRecoverEmbeddedSegment(_0x43f726,_0x2e525e,{'localName':_0x130ec0,'uniqueSegmentName':_0x100520,'description':_0x173808[_0xa929bb(0x1a3)]||'Entry\x20criteria:\x20'+_0x130ec0,'journeyId':_0x320b60,'resolvedRule':_0x3c3cf8,'parentId':_0x4e74da['parentId'],'folderId':_0x4e74da[_0xa929bb(0x1e4)]||''},_0x5a9b64),_0x26386d[_0xa929bb(0x20d)]['set'](_0x130ec0,_0x30ccc8),_0x4286e6[_0xa929bb(0x172)](_0x130ec0,_0x30ccc8),_0x30ccc8;})());_0x2e4dd0[_0x3073ce(0x172)](_0x130ec0,_0x323695);try{return await _0x323695;}finally{_0x2e4dd0[_0x3073ce(0x193)](_0x130ec0);}},'resolveActivationId':async _0x412dfd=>{const _0x3d5e01=_0xe4749c,_0x14306a=_0x1143c9[_0x3d5e01(0x21c)](_0x412dfd);if(_0x14306a)return _0x14306a;if(_0x2e525e[_0x3d5e01(0x1f0)]){await _0x81162();const _0x3f9e8f=_0x1143c9[_0x3d5e01(0x21c)](_0x412dfd);if(_0x3f9e8f)return _0x3f9e8f;}throw new SDKError(ErrorCode[_0x3d5e01(0x15f)],_0x3d5e01(0x198)+_0x412dfd+_0x3d5e01(0x177)+_0x2e525e[_0x3d5e01(0x245)][_0x3d5e01(0x1ce)]+_0x3d5e01(0x21f)+_0x3d5e01(0x170));},'resolveEmbeddedActivationId':async(_0x5de786,_0x3f0c2d)=>{const _0x15b1c9=_0xe4749c,_0x18be07=_0x1143c9[_0x15b1c9(0x21c)](_0x5de786);if(_0x18be07)return _0x18be07;if(_0x2e525e['isNew'])return _0x7af2ad['set'](_0x5de786,_0x3f0c2d),createPendingActivationId(_0x5de786);if(_0x2e525e[_0x15b1c9(0x1f0)]){await _0x81162();const _0x5354df=_0x1143c9[_0x15b1c9(0x21c)](_0x3f0c2d[_0x15b1c9(0x1ce)]);if(_0x5354df)return _0x1143c9['set'](_0x5de786,_0x5354df),_0x5354df;const _0x41df67=activationSignature(_0x3f0c2d),_0x3c9f7d=_0x1d58b1?.['get'](_0x41df67);if(_0x3c9f7d)return _0x1143c9['set'](_0x5de786,_0x3c9f7d),_0x3c9f7d;const _0x20c667=await _0x4c826a(_0x3f0c2d,_0x26386d[_0x15b1c9(0x1b8)]),_0x1aadce={..._0x20c667,..._0x3f0c2d[_0x15b1c9(0x179)]!==undefined&&{'runAfterJourneyRefresh':_0x3f0c2d[_0x15b1c9(0x179)]}},_0x565582=await _0x43f726['journey'][_0x15b1c9(0x143)](_0x2e525e[_0x15b1c9(0x1f0)]['id'],_0x1aadce);return _0x1143c9[_0x15b1c9(0x172)](_0x5de786,_0x565582['id']),_0x565582['id'];}throw new SDKError(ErrorCode[_0x15b1c9(0x1e2)],_0x15b1c9(0x18e));},'resolveJourneyId':async _0x3f3a18=>{const _0x10651e=_0xe4749c;try{return await _0x43f726[_0x10651e(0x13e)][_0x10651e(0x23f)](_0x4e74da[_0x10651e(0x1c5)],_0x3f3a18);}catch(_0x4d3ad1){throw new SDKError(ErrorCode['NOT_FOUND'],_0x10651e(0x18b)+_0x3f3a18+_0x10651e(0x1d0)+_0x2e525e[_0x10651e(0x245)][_0x10651e(0x1ce)]+'\x27)',_0x4d3ad1);}},'resolveStageId':async(_0x355a56,_0xdd0803)=>{const _0x29c347=_0xe4749c,_0x5bf2f6=await _0x43f726[_0x29c347(0x13e)][_0x29c347(0x229)](_0x355a56),_0x24f640=_0x5bf2f6[_0x29c347(0x211)][_0x29c347(0x1ca)]['find'](_0x5af390=>_0x5af390['name'][_0x29c347(0x1d1)]()===_0xdd0803[_0x29c347(0x1d1)]());if(!_0x24f640?.['id'])throw new SDKError(ErrorCode[_0x29c347(0x15f)],_0x29c347(0x19e)+_0xdd0803+_0x29c347(0x239)+(_0x5bf2f6['attributes'][_0x29c347(0x15c)]||_0x5bf2f6[_0x29c347(0x211)][_0x29c347(0x1ce)])+'\x27');return _0x24f640['id'];}},_0x2b1519=await _0x1452d3(_0x2e525e[_0xe4749c(0x245)],_0x4e74da[_0xe4749c(0x1c5)],_0x53bd51),_0x46d0bf=_0x4e74da[_0xe4749c(0x169)]||_0x4e74da[_0xe4749c(0x1e4)];_0x46d0bf&&(_0x2b1519[_0xe4749c(0x1ef)]={'parentFolder':{'data':{'id':_0x46d0bf,'type':_0xe4749c(0x19a)}}});if(_0x2e525e[_0xe4749c(0x190)]){if(_0x1da4b0[_0xe4749c(0x1ff)]>0x0||_0x7af2ad[_0xe4749c(0x1ff)]>0x0)return await executeThreeStepJourneyCreate(_0x43f726,_0x2e525e,_0x2b1519,{'pendingEmbeddedSegments':_0x1da4b0,'pendingEmbeddedActivations':_0x7af2ad,'embeddedSegmentNameToId':_0x4286e6,'journeyActivationNameToId':_0x1143c9},{..._0x4e74da,'effectiveFolderId':_0x46d0bf},_0x26386d,_0x2c2f8f,_0x56b4d1);else{ensureJourneyDefaults(_0x2b1519[_0xe4749c(0x211)]);const _0x3590f8=await _0x43f726[_0xe4749c(0x13e)][_0xe4749c(0x241)](_0x2b1519);return deletePushRecovery(_0x2e525e[_0xe4749c(0x202)]),{'action':'created','journeyId':_0x3590f8['id'],'embeddedSegmentNameToId':_0x4286e6};}}else{if(_0x2e525e[_0xe4749c(0x1f7)]&&_0x2e525e[_0xe4749c(0x1f0)]){_0x2b1519['id']=_0x2e525e[_0xe4749c(0x1f0)]['id'];const _0x3da5bf=_0x2b1519[_0xe4749c(0x211)];_0x2e525e['existingJourney'][_0xe4749c(0x211)]?.[_0xe4749c(0x15c)]&&(_0x3da5bf['journeyBundleName']=_0x2e525e['existingJourney'][_0xe4749c(0x211)][_0xe4749c(0x15c)]);const _0x3769fe=_0x2e525e['existingJourney'][_0xe4749c(0x211)]?.[_0xe4749c(0x1ca)];return _0x3769fe&&_0x2b1519[_0xe4749c(0x211)][_0xe4749c(0x1ca)]&&injectExistingStageIds(_0x2b1519[_0xe4749c(0x211)][_0xe4749c(0x1ca)],_0x3769fe),ensureJourneyDefaults(_0x3da5bf),await _0x43f726['journey'][_0xe4749c(0x1b1)](_0x2e525e[_0xe4749c(0x1f0)]['id'],_0x2b1519),deletePushRecovery(_0x2e525e[_0xe4749c(0x202)]),{'action':_0xe4749c(0x17c),'journeyId':_0x2e525e[_0xe4749c(0x1f0)]['id'],'embeddedSegmentNameToId':_0x4286e6};}}return deletePushRecovery(_0x2e525e['absolutePath']),{'action':_0xe4749c(0x181),'journeyId':_0x2e525e[_0xe4749c(0x1f0)]?.['id'],'embeddedSegmentNameToId':_0x4286e6};}function findSegmentCriteriaLocation(_0x16fe36,_0x5ea9d3){const _0x18b84d=a152_0x59916b,_0x11c30f=_0x16fe36[_0x18b84d(0x1ba)]||_0x16fe36[_0x18b84d(0x232)]?.[0x0]?.[_0x18b84d(0x1ba)]||[];let _0x5528e8=_0x18b84d(0x16e),_0x5a646f=_0x5ea9d3;const _0x269714=_0x16fe36[_0x18b84d(0x227)]||_0x16fe36[_0x18b84d(0x232)]?.[0x0]?.[_0x18b84d(0x227)];if(_0x269714?.[_0x18b84d(0x240)]===_0x5ea9d3)return{'stageName':'goal','criteriaName':_0x269714[_0x18b84d(0x1ce)]||_0x5ea9d3};_0x215a08:for(const _0x97b1b4 of _0x11c30f){if(_0x97b1b4[_0x18b84d(0x20b)]?.['segment']===_0x5ea9d3){_0x5528e8=_0x97b1b4[_0x18b84d(0x1ce)],_0x5a646f=_0x97b1b4[_0x18b84d(0x20b)]['name']||_0x5ea9d3;break;}if(_0x97b1b4[_0x18b84d(0x18d)])for(const _0x594ad1 of _0x97b1b4[_0x18b84d(0x18d)]){if(_0x594ad1[_0x18b84d(0x216)]===_0x18b84d(0x18f)&&_0x594ad1[_0x18b84d(0x155)]?.['branches'])for(const _0x45913a of _0x594ad1[_0x18b84d(0x155)][_0x18b84d(0x210)]){if(_0x45913a['segment']===_0x5ea9d3){_0x5528e8=_0x97b1b4[_0x18b84d(0x1ce)],_0x5a646f=_0x45913a[_0x18b84d(0x1ce)]||_0x5ea9d3;break _0x215a08;}}}}return{'stageName':_0x5528e8,'criteriaName':_0x5a646f};}async function executeThreeStepJourneyCreate(_0x111b10,_0x4e323a,_0x16e2f4,_0x181b0b,_0x36211d,_0x35b752,_0x42d6f7,_0x1e6dd8){const _0x40f436=a152_0x59916b,{activationDefToCreateRequest:_0x5b23ef,yamlRuleToApi:_0x1ac70c}=_0x1e6dd8,{pendingEmbeddedSegments:_0x32f862,pendingEmbeddedActivations:_0x42847f,embeddedSegmentNameToId:_0x6739cd}=_0x181b0b,_0x1f00f8=JSON[_0x40f436(0x14c)](JSON[_0x40f436(0x18a)](_0x16e2f4));ensureJourneyDefaults(_0x1f00f8[_0x40f436(0x211)]),stripPendingIds(_0x1f00f8);const _0x15779c=await _0x111b10[_0x40f436(0x13e)]['create'](_0x1f00f8),_0x1bc42d=_0x15779c['id'],_0x5be842=new Map();for(const _0xbd7fad of _0x15779c[_0x40f436(0x211)][_0x40f436(0x1ca)]){_0x5be842[_0x40f436(0x172)](_0xbd7fad[_0x40f436(0x1ce)][_0x40f436(0x1d1)](),_0xbd7fad['id']);}recoverSegmentIdsFromPushRecovery(_0x4e323a,_0x6739cd,_0x35b752[_0x40f436(0x20d)]);for(const [_0x56eef1,{definition:_0x31e2f2}]of _0x32f862){if(_0x6739cd[_0x40f436(0x145)](_0x56eef1)){_0x42d6f7[_0x40f436(0x224)]?.({'type':_0x40f436(0x1a7),'journeyName':_0x4e323a[_0x40f436(0x245)][_0x40f436(0x1ce)],'segmentName':_0x56eef1});continue;}const _0x3fe8ef=generateDeterministicJourneySegmentName(_0x4e323a[_0x40f436(0x245)][_0x40f436(0x1ce)],_0x56eef1);_0x42d6f7[_0x40f436(0x224)]?.({'type':_0x40f436(0x1c2),'journeyName':_0x4e323a['yamlConfig'][_0x40f436(0x1ce)],'segmentName':_0x56eef1});const _0x4fe8aa=createSegmentIdResolver(_0x35b752['segmentNameToId'],_0x56eef1),_0x111c9c=await resolveRuleSegmentIds(_0x31e2f2[_0x40f436(0x176)],_0x4fe8aa),_0x209a2b=await createOrRecoverEmbeddedSegment(_0x111b10,_0x4e323a,{'localName':_0x56eef1,'uniqueSegmentName':_0x3fe8ef,'description':_0x31e2f2['description']||_0x40f436(0x1f8)+_0x56eef1,'journeyId':_0x1bc42d,'resolvedRule':_0x111c9c,'parentId':_0x36211d[_0x40f436(0x1c5)],'folderId':_0x36211d[_0x40f436(0x21a)]||''},_0x1ac70c);_0x6739cd[_0x40f436(0x172)](_0x56eef1,_0x209a2b),_0x35b752[_0x40f436(0x20d)][_0x40f436(0x172)](_0x56eef1,_0x209a2b),_0x42d6f7[_0x40f436(0x224)]?.({'type':_0x40f436(0x1a7),'journeyName':_0x4e323a[_0x40f436(0x245)][_0x40f436(0x1ce)],'segmentName':_0x56eef1});}const _0x32ccec=new Map();for(const [_0x2f8476,_0x2fd152]of _0x42847f){_0x42d6f7['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x4e323a[_0x40f436(0x245)]['name'],'activationName':_0x2f8476});const _0x523776=await _0x5b23ef(_0x2fd152,_0x35b752[_0x40f436(0x1b8)]),_0x52a627={..._0x523776,..._0x2fd152[_0x40f436(0x179)]!==undefined&&{'runAfterJourneyRefresh':_0x2fd152[_0x40f436(0x179)]}},_0x4bbae5=await _0x111b10['journey'][_0x40f436(0x143)](_0x1bc42d,_0x52a627);_0x32ccec[_0x40f436(0x172)](_0x2f8476,_0x4bbae5['id']),_0x181b0b[_0x40f436(0x215)][_0x40f436(0x172)](_0x2f8476,_0x4bbae5['id']),_0x42d6f7[_0x40f436(0x224)]?.({'type':_0x40f436(0x237),'journeyName':_0x4e323a['yamlConfig'][_0x40f436(0x1ce)],'activationName':_0x2f8476});}const _0x2cbc37=JSON['parse'](JSON['stringify'](_0x16e2f4));return _0x2cbc37['id']=_0x1bc42d,ensureJourneyDefaults(_0x2cbc37[_0x40f436(0x211)]),resolvePendingIdsInRequest(_0x2cbc37,_0x16e2f4,_0x5be842,_0x6739cd,_0x32ccec,_0x42d6f7),await _0x111b10[_0x40f436(0x13e)]['update'](_0x1bc42d,_0x2cbc37),deletePushRecovery(_0x4e323a[_0x40f436(0x202)]),{'action':'created','journeyId':_0x1bc42d,'embeddedSegmentNameToId':_0x6739cd};}export function stripWaitStepPendingIds(_0x20a5ac){const _0x3de059=a152_0x59916b,_0x22955b=_0x20a5ac[_0x3de059(0x21d)]&&isPendingSegmentId(_0x20a5ac[_0x3de059(0x21d)]),_0x2ceb84=_0x20a5ac['conditions']?.[_0x3de059(0x192)](_0x37411d=>_0x37411d[_0x3de059(0x16d)]&&isPendingSegmentId(_0x37411d[_0x3de059(0x16d)]));(_0x22955b||_0x2ceb84)&&(_0x20a5ac[_0x3de059(0x1e9)]=_0x3de059(0x1cf),_0x20a5ac[_0x3de059(0x17d)]=0x1,_0x20a5ac['waitStepUnit']=_0x3de059(0x16f),delete _0x20a5ac[_0x3de059(0x21d)],delete _0x20a5ac[_0x3de059(0x19d)],delete _0x20a5ac[_0x3de059(0x203)],delete _0x20a5ac[_0x3de059(0x1ed)]);}export function resolveWaitStepPendingIds(_0x56cfac,_0x1105eb,_0x4bad2b,_0x232a44){const _0x5cd8da=a152_0x59916b;if(_0x1105eb[_0x5cd8da(0x21d)]&&isPendingSegmentId(_0x1105eb[_0x5cd8da(0x21d)])){const _0x18267e=_0x4bad2b(_0x1105eb[_0x5cd8da(0x21d)],_0x5cd8da(0x1f9)+_0x232a44+'\x27\x20wait\x20condition');_0x18267e&&(_0x56cfac[_0x5cd8da(0x1e9)]=_0x5cd8da(0x243),_0x56cfac[_0x5cd8da(0x21d)]=_0x18267e,delete _0x56cfac['waitStep'],delete _0x56cfac[_0x5cd8da(0x205)],_0x1105eb[_0x5cd8da(0x19d)]!==undefined&&(_0x56cfac[_0x5cd8da(0x19d)]=_0x1105eb[_0x5cd8da(0x19d)]),_0x1105eb[_0x5cd8da(0x203)]&&(_0x56cfac['conditionTimeoutUnit']=_0x1105eb[_0x5cd8da(0x203)]));}if(_0x1105eb['conditions']){const _0x57d41e=_0x1105eb['conditions'][_0x5cd8da(0x192)](_0x447c52=>_0x447c52[_0x5cd8da(0x16d)]&&isPendingSegmentId(_0x447c52[_0x5cd8da(0x16d)]));if(_0x57d41e){const _0x1f484e=_0x1105eb[_0x5cd8da(0x1ed)][_0x5cd8da(0x1da)](_0x534963=>{const _0x66588f=_0x5cd8da;if(_0x534963['segmentId']&&isPendingSegmentId(_0x534963[_0x66588f(0x16d)])){const _0x2002fd=_0x4bad2b(_0x534963['segmentId'],_0x66588f(0x1f9)+_0x232a44+_0x66588f(0x1d6));return{..._0x534963,'segmentId':_0x2002fd||_0x534963[_0x66588f(0x16d)]};}return{..._0x534963};});_0x56cfac[_0x5cd8da(0x1e9)]=_0x5cd8da(0x243),_0x56cfac[_0x5cd8da(0x1ed)]=_0x1f484e,delete _0x56cfac[_0x5cd8da(0x17d)],delete _0x56cfac[_0x5cd8da(0x205)],delete _0x56cfac[_0x5cd8da(0x21d)],delete _0x56cfac[_0x5cd8da(0x19d)],delete _0x56cfac['conditionTimeoutUnit'];}}}function stripPendingIds(_0x506259){const _0x340f7a=a152_0x59916b;_0x506259['attributes'][_0x340f7a(0x227)]?.[_0x340f7a(0x16d)]&&isPendingSegmentId(_0x506259['attributes'][_0x340f7a(0x227)][_0x340f7a(0x16d)])&&delete _0x506259[_0x340f7a(0x211)][_0x340f7a(0x227)];for(const _0x2bc24f of _0x506259[_0x340f7a(0x211)][_0x340f7a(0x1ca)]||[]){_0x2bc24f[_0x340f7a(0x233)]?.[_0x340f7a(0x16d)]&&isPendingSegmentId(_0x2bc24f[_0x340f7a(0x233)][_0x340f7a(0x16d)])&&delete _0x2bc24f[_0x340f7a(0x233)];_0x2bc24f[_0x340f7a(0x19c)]?.[_0x340f7a(0x16d)]&&isPendingSegmentId(_0x2bc24f['milestone'][_0x340f7a(0x16d)])&&delete _0x2bc24f[_0x340f7a(0x19c)];_0x2bc24f[_0x340f7a(0x171)]&&(_0x2bc24f[_0x340f7a(0x171)]=_0x2bc24f[_0x340f7a(0x171)][_0x340f7a(0x197)](_0x289704=>!_0x289704[_0x340f7a(0x16d)]||!isPendingSegmentId(_0x289704[_0x340f7a(0x16d)])));if(_0x2bc24f[_0x340f7a(0x18d)])for(const _0xec5ad6 of Object['keys'](_0x2bc24f[_0x340f7a(0x18d)])){const _0x3cd292=_0x2bc24f['steps'][_0xec5ad6];_0x3cd292[_0x340f7a(0x216)]===_0x340f7a(0x23a)&&_0x3cd292['journeyActivationStepId']&&isPendingActivationId(_0x3cd292[_0x340f7a(0x1e5)])&&(_0x3cd292[_0x340f7a(0x1e5)]='');if(_0x3cd292['type']===_0x340f7a(0x15b)&&_0x3cd292[_0x340f7a(0x210)])for(const _0x488d93 of _0x3cd292[_0x340f7a(0x210)]){_0x488d93[_0x340f7a(0x16d)]&&isPendingSegmentId(_0x488d93[_0x340f7a(0x16d)])&&(_0x488d93[_0x340f7a(0x16d)]='');}_0x3cd292[_0x340f7a(0x216)]===_0x340f7a(0x1de)&&stripWaitStepPendingIds(_0x3cd292);}}}function resolvePendingIdsInRequest(_0x286472,_0x294d7d,_0x4287d6,_0x5180d8,_0x564360,_0x3b0d48){const _0xf752eb=a152_0x59916b,_0x3c47ca=(_0x2af67c,_0x4f6875)=>{const _0x5e8cb6=a152_0x54b0;if(!isPendingSegmentId(_0x2af67c))return _0x2af67c;const _0x2c91c3=extractPendingSegmentName(_0x2af67c),_0x547db1=_0x5180d8[_0x5e8cb6(0x21c)](_0x2c91c3);return!_0x547db1&&_0x3b0d48[_0x5e8cb6(0x16a)]?.(_0x5e8cb6(0x1c0)+_0x2c91c3+_0x5e8cb6(0x1ac)+_0x4f6875),_0x547db1;};if(_0x286472[_0xf752eb(0x211)]['goal']?.['segmentId']&&isPendingSegmentId(_0x286472['attributes'][_0xf752eb(0x227)]['segmentId'])){const _0x419e48=_0x3c47ca(_0x286472['attributes'][_0xf752eb(0x227)]['segmentId'],'goal\x20criteria');_0x419e48&&(_0x286472[_0xf752eb(0x211)][_0xf752eb(0x227)][_0xf752eb(0x16d)]=_0x419e48);}for(const _0x529792 of _0x286472[_0xf752eb(0x211)][_0xf752eb(0x1ca)]||[]){const _0x1dcc53=_0x4287d6[_0xf752eb(0x21c)](_0x529792[_0xf752eb(0x1ce)][_0xf752eb(0x1d1)]());_0x1dcc53&&(_0x529792['id']=_0x1dcc53);if(_0x529792['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x529792['entryCriteria'][_0xf752eb(0x16d)])){const _0x210df3=_0x3c47ca(_0x529792['entryCriteria'][_0xf752eb(0x16d)],_0xf752eb(0x1f9)+_0x529792[_0xf752eb(0x1ce)]+_0xf752eb(0x1a2));_0x210df3&&(_0x529792['entryCriteria'][_0xf752eb(0x16d)]=_0x210df3);}if(_0x529792['exitCriterias'])for(const _0x44a75b of _0x529792[_0xf752eb(0x171)]){if(_0x44a75b[_0xf752eb(0x16d)]&&isPendingSegmentId(_0x44a75b[_0xf752eb(0x16d)])){const _0x3ed467=_0x3c47ca(_0x44a75b[_0xf752eb(0x16d)],_0xf752eb(0x1f9)+_0x529792['name']+_0xf752eb(0x175));_0x3ed467&&(_0x44a75b[_0xf752eb(0x16d)]=_0x3ed467);}}if(_0x529792[_0xf752eb(0x19c)]?.[_0xf752eb(0x16d)]&&isPendingSegmentId(_0x529792[_0xf752eb(0x19c)][_0xf752eb(0x16d)])){const _0xb7d907=_0x3c47ca(_0x529792[_0xf752eb(0x19c)][_0xf752eb(0x16d)],_0xf752eb(0x1f9)+_0x529792[_0xf752eb(0x1ce)]+_0xf752eb(0x22c));_0xb7d907&&(_0x529792['milestone'][_0xf752eb(0x16d)]=_0xb7d907);}if(_0x529792['steps']){const _0x38b293=_0x8a3230=>_0x294d7d[_0xf752eb(0x211)][_0xf752eb(0x1ca)]?.[_0xf752eb(0x16c)](_0x5be044=>_0x5be044[_0xf752eb(0x1ce)][_0xf752eb(0x1d1)]()===_0x529792[_0xf752eb(0x1ce)][_0xf752eb(0x1d1)]())?.[_0xf752eb(0x18d)]?.[_0x8a3230];for(const _0x354582 of Object[_0xf752eb(0x141)](_0x529792[_0xf752eb(0x18d)])){const _0x1d5bd9=_0x529792[_0xf752eb(0x18d)][_0x354582],_0x5167bb=_0x38b293(_0x354582);if(_0x1d5bd9[_0xf752eb(0x216)]==='Activation'&&_0x1d5bd9[_0xf752eb(0x1e5)]&&(isPendingActivationId(_0x1d5bd9[_0xf752eb(0x1e5)])||_0x1d5bd9[_0xf752eb(0x1e5)]==='')){if(_0x5167bb?.[_0xf752eb(0x1e5)]&&isPendingActivationId(_0x5167bb['journeyActivationStepId'])){const _0x1082eb=extractPendingActivationName(_0x5167bb[_0xf752eb(0x1e5)]),_0x18f862=_0x564360['get'](_0x1082eb);_0x18f862&&(_0x1d5bd9[_0xf752eb(0x1e5)]=_0x18f862);}}if(_0x1d5bd9[_0xf752eb(0x216)]===_0xf752eb(0x15b)&&_0x1d5bd9['branches']&&_0x5167bb?.[_0xf752eb(0x210)])for(let _0x57a4ab=0x0;_0x57a4ab<_0x1d5bd9[_0xf752eb(0x210)]['length'];_0x57a4ab++){const _0x357b16=_0x1d5bd9[_0xf752eb(0x210)][_0x57a4ab],_0x4a39a3=_0x5167bb[_0xf752eb(0x210)][_0x57a4ab];if(_0x4a39a3?.[_0xf752eb(0x16d)]&&isPendingSegmentId(_0x4a39a3[_0xf752eb(0x16d)])){const _0x16fd61=_0x3c47ca(_0x4a39a3[_0xf752eb(0x16d)],_0xf752eb(0x1f9)+_0x529792[_0xf752eb(0x1ce)]+_0xf752eb(0x157)+(_0x357b16[_0xf752eb(0x1ce)]||_0x57a4ab)+'\x27');_0x16fd61&&(_0x357b16['segmentId']=_0x16fd61);}}_0x1d5bd9[_0xf752eb(0x216)]==='WaitStep'&&_0x5167bb?.[_0xf752eb(0x216)]===_0xf752eb(0x1de)&&resolveWaitStepPendingIds(_0x1d5bd9,_0x5167bb,_0x3c47ca,_0x529792['name']);}}}}
1
+ const a152_0x56096e=a152_0x3f60;(function(_0x11e792,_0x25607a){const _0x18c2e1=a152_0x3f60,_0x4dce29=_0x11e792();while(!![]){try{const _0x1cbca6=-parseInt(_0x18c2e1(0x209))/0x1+parseInt(_0x18c2e1(0x258))/0x2+-parseInt(_0x18c2e1(0x1dc))/0x3*(-parseInt(_0x18c2e1(0x1e2))/0x4)+-parseInt(_0x18c2e1(0x161))/0x5*(parseInt(_0x18c2e1(0x175))/0x6)+parseInt(_0x18c2e1(0x257))/0x7*(-parseInt(_0x18c2e1(0x20e))/0x8)+parseInt(_0x18c2e1(0x225))/0x9+parseInt(_0x18c2e1(0x22b))/0xa*(-parseInt(_0x18c2e1(0x237))/0xb);if(_0x1cbca6===_0x25607a)break;else _0x4dce29['push'](_0x4dce29['shift']());}catch(_0x4ac7c9){_0x4dce29['push'](_0x4dce29['shift']());}}}(a152_0x161f,0x3e2b1));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x56096e(0x1f6));export const PENDING_SEGMENT_PREFIX=a152_0x56096e(0x1af);export const PENDING_ACTIVATION_PREFIX=a152_0x56096e(0x1e3);export function createPendingSegmentId(_0x2e0f32){return''+PENDING_SEGMENT_PREFIX+_0x2e0f32+'__';}export function isPendingSegmentId(_0x4b0892){const _0x152e6c=a152_0x56096e;return _0x4b0892[_0x152e6c(0x200)](PENDING_SEGMENT_PREFIX)&&!_0x4b0892['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x32744a){const _0x4fb719=a152_0x56096e;return _0x32744a[_0x4fb719(0x216)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4cda8d){return''+PENDING_ACTIVATION_PREFIX+_0x4cda8d+'__';}function a152_0x161f(){const _0x319ce1=['\x20journey\x20from\x20file:\x20','digest','size','activationActions','embeddedSegmentNameToId','JOURNEY_SYNTAX_ERROR','message','Deleted\x20activation\x20\x27','has','stages','resolveSegment','__pending_','Updated\x20activation\x20\x27','parseDocument','getLatestJourneyId','\x20error(s)','\x27\x20entry\x20criteria','segmentId','with','results','notification','activation_created','ACTIVATION_SYNTAX_ERROR','Stage\x20\x27','add','conditionTimeoutUnit','join','entry_criteria','yamlActivation','logWarning','folderId','data','description','waitStepUnit','createJourneySegment','journeyBundleId','journeyId','stringify',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','activation_creating','parentSegmentFolder','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','getSegment\x20failed\x20for\x20','segment_updated','\x27\x20from\x20file:\x20','Updated\x20journey\x20\x27','unchanged','exitCriterias','Failed\x20to\x20','parse','existingActivation','folder_creating','create','journeyBundlesByFolderAndName','\x27\x20for\x20','Journey\x20\x27','65622mgIOSK','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','name','getJourney','filter','Fetching\x20','16RfitTv','__pending_act_','kind','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','\x27\x20to\x20local\x20\x27','some','length','map','errors','embedded_segment_created','index','journeyBundleName','\x27\x20wait\x20condition','effectiveFolderId','createdSegmentIds','slice','embedded_activation_creating','entries','Updating\x20activation\x20\x27','WaitStep','tdx.sdk.push-workflow','activation_updating','updated','keys','connection','activation_deleting','journeyStages','conditionTimeoutDuration','all_columns','.$1.push-recovery.json','startsWith','debug','object','journey_created','delete','goal','\x20activation\x20\x27','INTERNAL','milestone','167000KLSObr','existingJourney','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Deleting\x20activation\x20\x27','Created\x20activation\x20\x27','14520InopQa','nameToType','activation_updated','embedded_activation_created','progress','activation_template_id','verbose','Creating\x20folder\x20\x27','replace','journey_updating','Created\x20journey\x20\x27','logSuccess','day','../../utils/async.js','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','type','reduce','Segment\x20not\x20found:\x20','\x27\x20by\x20rule\x20content','behavior','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','journey_creating','deleted','1798416vXfmOO','Activation','Creating\x20segment\x20\x27','existingSegments','\x0a\x20\x20','./child-segment-yaml.js','2190NSxEmQ','logDeleted','update','Created\x20segment\x20\x27','Failed\x20to\x20resolve\x20segment\x20','segmentByFolderAndName','Embedded\x20segment\x20\x27','segment','onProgress','sort','decision_point','created','1870gVQirS','waitStep','deleteSegment','uniqueSegmentName','\x27\x20not\x20found\x20in\x20journey\x20\x27','Activation\x20not\x20found:\x20','user','Name\x20has\x20already\x20been\x20taken','waitStepType','yamlConfig','get','ACTIVATION_UPDATE_ERROR','attributes','hex','getSegmentEntity\x20also\x20failed\x20for\x20','journey','diff','activation_','segments','localName','createActivation','isNew','Segment\x20not\x20found','deleteActivation','columns','relationships','draft','folderPath','segment_created','idToEmailMap','action','connector_config','763oLRSJi','933672RdBVXS','conditionSegmentId','null','skipSegments','connectionIdToNameMap','steps','Failed\x20to\x20resolve\x20activation\x20','resolvedRule','activations','flatMap','fetchJourney','from','DecisionPoint','state','relative','segment_deleting','existingSegment','resolveJourneyId','hasChanges','updateSegmentById','folderPathToId','createFolder','stage\x20\x27','listActivations','5DFsKgD','Updating\x20segment\x20\x27','rootFolderId','schedule','withProgress','deps','list','./journey-yaml.js','Entry\x20criteria:\x20','embedded_segment_creating','\x27...','max','NOT_FOUND','conditions','toISOString','split','SEGMENT_NOT_FOUND','segment_deleted',').\x20','activationContext','584700pzplPS','journey_updated','all','JOURNEY_UPDATE_ERROR','journeyActivationNameToId','sha1','SEGMENT_UPDATE_ERROR','journeyActivationStepId','createdSegmentId','Delete\x20the\x20push\x20recovery\x20file\x20(','push','dirname','Deleted\x20segment\x20\x27','idToName','isArray','journeyName','journeys','\x20segment\x20from\x20file:\x20','utf-8','run_after_journey_refresh','validatedRequest','absolutePath','logInfo','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','goal\x20criteria','segmentFolderId','Condition','journeyById','uniqueServerName','\x20(referenced\x20in\x20journey\x20','buildUserMaps','segment_updating','toString','activationStepsById','entryCriteria','find','parentId','getActivation','versionNumber','\x27\x20milestone','toLowerCase','match','set','segmentNameToId','):\x20','branches','rule'];a152_0x161f=function(){return _0x319ce1;};return a152_0x161f();}export function isPendingActivationId(_0x44d381){const _0x4e3e74=a152_0x56096e;return _0x44d381[_0x4e3e74(0x200)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x5ecf0f){const _0x563cc6=a152_0x56096e;return _0x5ecf0f[_0x563cc6(0x216)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x1ef3ab,_0x8551d6){const _0x4d005b=a152_0x56096e,_0x1290a9=_0x1ef3ab+'::'+(_0x8551d6['trim']()||_0x4d005b(0x232)),_0x255aca=createHash(_0x4d005b(0x17a))[_0x4d005b(0x22d)](_0x1290a9)[_0x4d005b(0x1a5)](_0x4d005b(0x244))[_0x4d005b(0x1f1)](0x0,0xc);return'journey_entry_criteria_'+_0x255aca;}export function ensureJourneyDefaults(_0x2a7b78){const _0x46281b=a152_0x56096e;!_0x2a7b78[_0x46281b(0x1c4)]&&(_0x2a7b78[_0x46281b(0x1c4)]=''),!_0x2a7b78[_0x46281b(0x156)]&&(_0x2a7b78[_0x46281b(0x156)]=_0x46281b(0x251));}export function injectExistingStageIds(_0x145ad7,_0x4bfa7f){const _0xf52ab0=a152_0x56096e,_0x500d38=new Map(_0x4bfa7f[_0xf52ab0(0x1e9)](_0x47c0bf=>[_0x47c0bf['name'],_0x47c0bf['id']]));for(const _0x3da87f of _0x145ad7){if(!_0x3da87f['id']){const _0x2577d6=_0x500d38[_0xf52ab0(0x241)](_0x3da87f['name']);_0x2577d6&&(_0x3da87f['id']=_0x2577d6);}}}export function resolveTDFolderPath(_0x41ec13,_0x252262,_0x3d1307){if(!_0x252262)return _0x41ec13;if(_0x41ec13===_0x3d1307||_0x41ec13['startsWith'](_0x3d1307+'/'))return _0x41ec13;return _0x41ec13?_0x3d1307+'/'+_0x41ec13:_0x3d1307;}export function addFoldersToCreate(_0x41a1f6,_0x597cf2,_0x5694f8){const _0x1bef04=a152_0x56096e;if(!_0x41a1f6)return;if(_0x597cf2[_0x1bef04(0x1ac)](_0x41a1f6))return;const _0x1bef2f=_0x41a1f6[_0x1bef04(0x170)]('/');let _0x2292a5='';for(const _0x470926 of _0x1bef2f){_0x2292a5=_0x2292a5?_0x2292a5+'/'+_0x470926:_0x470926,!_0x597cf2[_0x1bef04(0x1ac)](_0x2292a5)&&_0x5694f8[_0x1bef04(0x1bc)](_0x2292a5);}}export function sortFoldersByDepth(_0x291a1a){const _0x1f1866=a152_0x56096e;return[..._0x291a1a][_0x1f1866(0x234)]((_0x3728d5,_0x30bbcc)=>{const _0x4fb0a4=_0x1f1866,_0x29696e=(_0x3728d5[_0x4fb0a4(0x19e)](/\//g)||[])['length'],_0x3b601a=(_0x30bbcc[_0x4fb0a4(0x19e)](/\//g)||[])[_0x4fb0a4(0x1e8)];return _0x29696e-_0x3b601a;});}import*as a152_0xbfd065 from'yaml';import{readFileSync}from'fs';import a152_0x51d9c3 from'path';import{isJourneyDef,parseYamlString as a152_0x3e5f8c,toYamlString as a152_0x2b0e63,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x34590b){const _0x201ae1=a152_0x56096e;if(Array[_0x201ae1(0x183)](_0x34590b))return'['+_0x34590b[_0x201ae1(0x1e9)](_0x43f01c=>stableStringify(_0x43f01c))[_0x201ae1(0x1be)](',')+']';if(_0x34590b&&typeof _0x34590b===_0x201ae1(0x202)){const _0x2a4c60=_0x34590b,_0x35c6ff=Object[_0x201ae1(0x1f9)](_0x2a4c60)[_0x201ae1(0x234)](),_0x275769=_0x35c6ff[_0x201ae1(0x1e9)](_0x3a891d=>'\x22'+_0x3a891d+'\x22:'+stableStringify(_0x2a4c60[_0x3a891d]));return'{'+_0x275769['join'](',')+'}';}const _0x10ff6d=JSON[_0x201ae1(0x1c9)](_0x34590b);return _0x10ff6d===undefined?_0x201ae1(0x25a):_0x10ff6d;}function activationSignature(_0x4fecd9){const _0x4047f4=a152_0x56096e,_0x49052a={'connection':_0x4fecd9[_0x4047f4(0x1fa)],..._0x4fecd9[_0x4047f4(0x1fe)]!==undefined&&{'all_columns':_0x4fecd9[_0x4047f4(0x1fe)]},..._0x4fecd9[_0x4047f4(0x24f)]!==undefined&&{'columns':_0x4fecd9[_0x4047f4(0x24f)]},..._0x4fecd9[_0x4047f4(0x221)]!==undefined&&{'behavior':_0x4fecd9['behavior']},..._0x4fecd9['schedule']!==undefined&&{'schedule':_0x4fecd9[_0x4047f4(0x164)]},..._0x4fecd9[_0x4047f4(0x1b8)]!==undefined&&{'notification':_0x4fecd9[_0x4047f4(0x1b8)]},..._0x4fecd9[_0x4047f4(0x256)]!==undefined&&{'connector_config':_0x4fecd9[_0x4047f4(0x256)]},..._0x4fecd9[_0x4047f4(0x213)]!==undefined&&{'activation_template_id':_0x4fecd9[_0x4047f4(0x213)]}};return stableStringify(_0x49052a);}async function fetchSegment(_0x5776da,_0x3dccfa,_0x2ee7b6,_0x4d274d){const _0x5c8a75=a152_0x56096e,_0x21e61c=_0x4d274d?.[_0x5c8a75(0x198)](_0x2bf270=>_0x2bf270['id']===_0x2ee7b6);if(_0x21e61c)return _0x21e61c;try{return await _0x5776da[_0x5c8a75(0x232)]['getSegment'](_0x3dccfa,_0x2ee7b6);}catch(_0x3d93f3){logger[_0x5c8a75(0x201)](_0x5c8a75(0x1ce)+_0x2ee7b6+_0x5c8a75(0x1ca)+_0x3d93f3);try{return await _0x5776da['segment']['getSegmentEntity'](_0x2ee7b6);}catch(_0x2917aa){return logger['debug'](_0x5c8a75(0x245)+_0x2ee7b6+':\x20'+_0x2917aa),null;}}}function recoverSegmentIdsFromPushRecovery(_0x2a87f6,_0x96ebc6,_0x1ae15e){const _0x36a145=a152_0x56096e,_0x14d897=readPushRecovery(_0x2a87f6[_0x36a145(0x18a)]);if(_0x14d897?.[_0x36a145(0x184)]===_0x2a87f6[_0x36a145(0x240)]['name'])for(const [_0x513b60,_0x86f69a]of Object[_0x36a145(0x1f3)](_0x14d897[_0x36a145(0x249)])){const _0x1881f6=generateDeterministicJourneySegmentName(_0x2a87f6[_0x36a145(0x240)][_0x36a145(0x1de)],_0x513b60);_0x86f69a[_0x36a145(0x191)]===_0x1881f6&&(_0x96ebc6[_0x36a145(0x19f)](_0x513b60,_0x86f69a[_0x36a145(0x1b5)]),_0x1ae15e['set'](_0x513b60,_0x86f69a[_0x36a145(0x1b5)]));}}async function createOrRecoverEmbeddedSegment(_0x2a9c13,_0x3d8d62,_0x3697c0,_0x46b106){const _0x513498=a152_0x56096e;let _0x5009f1;try{_0x5009f1=await _0x2a9c13[_0x513498(0x232)][_0x513498(0x1c6)]({'name':_0x3697c0['uniqueSegmentName'],'description':_0x3697c0['description'],'journeyId':_0x3697c0[_0x513498(0x1c8)],'rule':_0x46b106(_0x3697c0[_0x513498(0x150)],!![]),'countPopulation':!![],'parentFolderId':_0x3697c0[_0x513498(0x1c2)],'audienceId':_0x3697c0[_0x513498(0x199)]});}catch(_0x105fd9){const _0x4e96c9=_0x105fd9 instanceof Error&&_0x105fd9[_0x513498(0x1aa)]['includes'](_0x513498(0x23e));if(_0x4e96c9){const _0x1d1293=readPushRecovery(_0x3d8d62[_0x513498(0x18a)]),_0x58f6d2=_0x1d1293?.['journeyName']===_0x3d8d62[_0x513498(0x240)][_0x513498(0x1de)]?_0x1d1293[_0x513498(0x249)][_0x3697c0[_0x513498(0x24a)]]:undefined;if(_0x58f6d2?.['uniqueServerName']===_0x3697c0['uniqueSegmentName'])await _0x2a9c13[_0x513498(0x232)][_0x513498(0x15c)](_0x3697c0[_0x513498(0x199)],_0x58f6d2[_0x513498(0x1b5)],{'description':_0x3697c0[_0x513498(0x1c4)],'rule':_0x46b106(_0x3697c0[_0x513498(0x150)],!![]),'countPopulation':!![]}),_0x5009f1=_0x58f6d2[_0x513498(0x1b5)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x513498(0x231)+_0x3697c0[_0x513498(0x24a)]+_0x513498(0x1dd)+(_0x513498(0x17e)+_0x3d8d62[_0x513498(0x18a)][_0x513498(0x216)](/([^/]+)$/,_0x513498(0x1ff))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x105fd9);}else throw _0x105fd9;}return saveSegmentToPushRecovery(_0x3d8d62[_0x513498(0x18a)],_0x3d8d62[_0x513498(0x240)][_0x513498(0x1de)],_0x3697c0[_0x513498(0x24a)],{'segmentId':_0x5009f1,'uniqueServerName':_0x3697c0[_0x513498(0x23a)],'createdAt':new Date()[_0x513498(0x16f)]()}),_0x5009f1;}export async function prepareSegmentFiles(_0x3a42a6,_0x3ecb54,_0x3e9f11,_0x4b7ecc,_0x2a1b1f){const _0x524697=a152_0x56096e,{activationDefToCreateRequest:_0x41a711}=await import(_0x524697(0x22a)),_0xa46348=[],_0x7da6da=new Set();for(const {yamlConfig:_0x9eee7,folderPath:_0x496dff,sourcePath:_0x319ddc}of _0x3a42a6){const _0x4a91e2=resolveTDFolderPath(_0x496dff,_0x4b7ecc,_0x2a1b1f),_0x52fc64=_0x4a91e2+':'+_0x9eee7[_0x524697(0x1de)],_0x2bd4db=_0x3ecb54[_0x524697(0x230)][_0x524697(0x241)](_0x52fc64),_0x5398d2=_0x2bd4db?_0x3ecb54['activationsBySegmentId'][_0x524697(0x241)](_0x2bd4db['id'])||[]:[];addFoldersToCreate(_0x4a91e2,_0x3ecb54[_0x524697(0x15d)],_0x7da6da);const _0x438858=calculateActivationActions(_0x9eee7[_0x524697(0x151)]||[],_0x5398d2,_0x3ecb54[_0x524697(0x254)],_0x3ecb54['connectionIdToNameMap']);for(const _0x549904 of _0x438858){(_0x549904[_0x524697(0x21d)]===_0x524697(0x1d8)||_0x549904[_0x524697(0x21d)]==='update')&&_0x549904['yamlActivation']&&(_0x549904[_0x524697(0x189)]=await _0x41a711(_0x549904[_0x524697(0x1c0)],_0x3e9f11));}const _0x3f750f=calculateSegmentDiff(_0x9eee7,_0x2bd4db,_0x5398d2,_0x3ecb54[_0x524697(0x254)],_0x3ecb54['connectionIdToNameMap']);_0xa46348[_0x524697(0x17f)]({'relativePath':_0x9eee7[_0x524697(0x1de)],'absolutePath':_0x319ddc,'yamlConfig':_0x9eee7,'folderPath':_0x4a91e2,'existingSegment':_0x2bd4db,'existingActivations':_0x5398d2,'isNew':_0x3f750f[_0x524697(0x24c)],'hasChanges':_0x3f750f[_0x524697(0x15b)],'diff':_0x3f750f['diff'],'activationActions':_0x438858});}return{'segmentFiles':_0xa46348,'foldersToCreate':_0x7da6da};}export async function prepareJourneyFiles(_0x249a20,_0xc52406,_0x40e086,_0x1d3a4c){const _0x2a2735=a152_0x56096e,_0x48f20d=[],_0x562f5a=new Set();for(const {yamlConfig:_0x2c3712,folderPath:_0x2b50ef,sourcePath:_0x2d86d3}of _0x249a20){const _0x34f3da=resolveTDFolderPath(_0x2b50ef,_0x40e086,_0x1d3a4c),_0x528daf=_0x34f3da+':'+_0x2c3712[_0x2a2735(0x1de)],_0x54d3ba=_0xc52406[_0x2a2735(0x1d9)][_0x2a2735(0x241)](_0x528daf);let _0x241d4b,_0x45eecc;if(_0x54d3ba&&_0x54d3ba[_0x2a2735(0x1e8)]>0x0){const _0xeaae39=buildLocalExpandedRuleMappings(_0x2c3712),{createYamlContext:_0x2aba9d,prefetchJourneySegments:_0x4e44f7}=createPushYamlContextForBundle(_0xc52406['deps'],_0xc52406[_0x2a2735(0x199)],_0xc52406[_0x2a2735(0x228)],_0xeaae39,_0xc52406[_0x2a2735(0x254)],_0xc52406[_0x2a2735(0x14d)],_0xc52406[_0x2a2735(0x196)],_0xc52406[_0x2a2735(0x190)]);await _0x4e44f7(_0x54d3ba[_0x2a2735(0x1e9)](_0x2c4fb5=>_0x2c4fb5['id']));const _0x3eeab9=await _0xc52406[_0x2a2735(0x166)][_0x2a2735(0x246)][_0x2a2735(0x1b2)](_0x54d3ba[0x0][_0x2a2735(0x1c7)]),_0x39d480=hasMultipleVersions(_0x2c3712),_0x42c52c=async _0x325ccf=>{const _0x13f228=_0x2a2735,_0x5467fc=_0xc52406[_0x13f228(0x190)]?.[_0x13f228(0x241)](_0x325ccf);if(_0x5467fc)return _0x5467fc;return _0xc52406[_0x13f228(0x153)]({'journeyId':_0x325ccf,'journeyName':_0x2c3712[_0x13f228(0x1de)],'isMultiVersion':_0x54d3ba[_0x13f228(0x1e8)]>0x1});};if(_0x39d480&&_0x54d3ba['length']>0x1){const _0x4e6284=[];for(const _0x5d4c55 of _0x54d3ba){const _0x4b8307=_0x5d4c55[_0x2a2735(0x19b)]||0x1;_0xc52406[_0x2a2735(0x212)]?.[_0x2a2735(0x22d)](_0x2a2735(0x1e1)+_0x2c3712['name']+'\x20v'+_0x4b8307);const _0x127fae=await _0x42c52c(_0x5d4c55['id']),_0x515bf7=_0x2aba9d(_0x5d4c55['id']),_0x3ecbe4=await journeyResponseToDef(_0x127fae,_0x515bf7);_0x4e6284[_0x2a2735(0x17f)]({'item':_0x5d4c55,'yaml':_0x3ecbe4});}const _0x57d305=buildLocalRuleToNameMappingFromJourney(_0x2c3712);_0x45eecc=buildMergedJourneyDef(_0x4e6284,_0x57d305,_0x3eeab9);const _0x1498e1=Math[_0x2a2735(0x16c)](..._0x4e6284[_0x2a2735(0x1e9)](_0x5a3ca8=>_0x5a3ca8['item'][_0x2a2735(0x19b)]||0x0)),_0x193a50=_0x54d3ba[_0x2a2735(0x198)](_0x27c01e=>(_0x27c01e['versionNumber']||0x0)===_0x1498e1);_0x193a50&&(_0xc52406[_0x2a2735(0x212)]?.[_0x2a2735(0x22d)](_0x2a2735(0x1e1)+_0x2c3712[_0x2a2735(0x1de)]+'\x20v'+_0x1498e1),_0x241d4b=await _0x42c52c(_0x193a50['id']));}else{const _0xb34bb0=_0x54d3ba[_0x54d3ba[_0x2a2735(0x1e8)]-0x1];_0xc52406[_0x2a2735(0x212)]?.[_0x2a2735(0x22d)]('Fetching\x20'+_0x2c3712['name']),_0x241d4b=await _0x42c52c(_0xb34bb0['id']);const _0xac3f9f=_0x2aba9d(_0xb34bb0['id']),_0x18fa5c=await journeyResponseToDef(_0x241d4b,_0xac3f9f),_0x355038=buildLocalRuleToNameMappingFromJourney(_0x2c3712);_0x45eecc=buildMergedJourneyDef([{'item':_0xb34bb0,'yaml':_0x18fa5c}],_0x355038,_0x3eeab9);}}addFoldersToCreate(_0x34f3da,_0xc52406['folderPathToId'],_0x562f5a);const _0x798222=calculateJourneyDiff(_0x2c3712,_0x45eecc);_0x48f20d[_0x2a2735(0x17f)]({'relativePath':_0x2c3712[_0x2a2735(0x1de)],'absolutePath':_0x2d86d3,'yamlConfig':_0x2c3712,'folderPath':_0x34f3da,'existingJourney':_0x241d4b,'isNew':_0x798222[_0x2a2735(0x24c)],'hasChanges':_0x798222[_0x2a2735(0x15b)],'diff':_0x798222[_0x2a2735(0x247)]});}return{'journeyFiles':_0x48f20d,'foldersToCreate':_0x562f5a};}export function calculateActivationActions(_0x2e0ee2,_0x46a2b5,_0x409f9e,_0x2d6563){const _0x4c6848=a152_0x56096e,_0x10f2af=[],_0x435d4f=new Map();for(const _0x13c7d3 of _0x46a2b5){_0x435d4f[_0x4c6848(0x19f)](_0x13c7d3[_0x4c6848(0x1de)],_0x13c7d3);}const _0x10d6d8=new Map();for(const _0x1f2b25 of _0x2e0ee2){_0x10d6d8[_0x4c6848(0x19f)](_0x1f2b25['name'],_0x1f2b25);}for(const _0x5a9602 of _0x2e0ee2){const _0x540d9a=_0x435d4f[_0x4c6848(0x241)](_0x5a9602['name']);if(!_0x540d9a)_0x10f2af[_0x4c6848(0x17f)]({'type':_0x4c6848(0x1d8),'name':_0x5a9602[_0x4c6848(0x1de)],'yamlActivation':_0x5a9602});else{const _0x50d21b=activationResponseToDef(_0x540d9a,_0x409f9e,_0x2d6563),_0x420414=a152_0xbfd065[_0x4c6848(0x1c9)](_0x50d21b),_0x1f45ce=a152_0xbfd065['stringify'](_0x5a9602);_0x420414!==_0x1f45ce&&_0x10f2af[_0x4c6848(0x17f)]({'type':_0x4c6848(0x22d),'name':_0x5a9602['name'],'yamlActivation':_0x5a9602,'existingActivation':_0x540d9a});}}for(const _0x3f71a8 of _0x46a2b5){!_0x10d6d8[_0x4c6848(0x1ac)](_0x3f71a8[_0x4c6848(0x1de)])&&_0x10f2af[_0x4c6848(0x17f)]({'type':_0x4c6848(0x204),'name':_0x3f71a8['name'],'existingActivation':_0x3f71a8});}return _0x10f2af;}function calculateYamlDiff(_0x41a4cc,_0x3c3947){if(_0x3c3947){const _0x4f61fa=generateDiff(_0x3c3947,_0x41a4cc),_0x5bb7b9=hasChanges(_0x4f61fa);return{'isNew':![],'hasChanges':_0x5bb7b9,'diff':_0x5bb7b9?formatDiffWithColors(_0x4f61fa):undefined};}const _0x4da968=generateDiff('',_0x41a4cc);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4da968)};}export function calculateSegmentDiff(_0x456672,_0x4b9703,_0x2412fe,_0x413e49,_0x26c553){const _0x330dc3=segmentToYamlString(_0x456672),_0xf6cb3b=_0x4b9703?segmentToYamlString(segmentWithActivationsToYaml(_0x4b9703,_0x2412fe,undefined,_0x413e49,_0x26c553)):undefined;return calculateYamlDiff(_0x330dc3,_0xf6cb3b);}export function calculateJourneyDiff(_0x55ea09,_0x25580d){const _0x34ebbb=normalizeJourneyDef(_0x55ea09,_0x55ea09),_0x56ec75=a152_0x2b0e63(_0x34ebbb),_0x95772b=_0x25580d?a152_0x2b0e63(normalizeJourneyDef(_0x25580d,_0x55ea09)):undefined;return calculateYamlDiff(_0x56ec75,_0x95772b);}export function findSegmentsToDelete(_0x4afac6,_0x2911eb,_0x2ed9e4,_0x452ad3,_0x79df6f){const _0xa4ee05=new Set();for(const {yamlConfig:_0x32ecc6,folderPath:_0x152367}of _0x2911eb){_0xa4ee05['add'](_0x152367+':'+_0x32ecc6['name']);}return _0x4afac6['filter'](_0x56739d=>{const _0x4139d9=a152_0x3f60,_0x51711d=_0x56739d[_0x4139d9(0x18e)]?_0x2ed9e4[_0x4139d9(0x241)](_0x56739d[_0x4139d9(0x18e)][_0x4139d9(0x195)]())||'':'',_0x411aea=_0x51711d+':'+_0x56739d[_0x4139d9(0x1de)];if(_0xa4ee05[_0x4139d9(0x1ac)](_0x411aea))return![];if(_0x79df6f)return _0x51711d===_0x452ad3||_0x51711d[_0x4139d9(0x200)](_0x452ad3+'/');return!![];});}export function findJourneysToDelete(_0x140b9f,_0x31580e,_0x284590,_0x1b50bc,_0x418f9f){const _0x22edf0=a152_0x56096e,_0x8b154d=new Set();for(const {yamlConfig:_0x502311,folderPath:_0xb459b8}of _0x31580e){_0x8b154d[_0x22edf0(0x1bc)](_0xb459b8+':'+_0x502311['name']);}return _0x140b9f[_0x22edf0(0x1e0)](_0x410beb=>{const _0x32d97d=_0x22edf0,_0x423386=_0x410beb[_0x32d97d(0x1c2)]?_0x284590[_0x32d97d(0x241)](_0x410beb['folderId'])||'':'',_0x394ea6=_0x423386+':'+_0x410beb[_0x32d97d(0x1ed)];if(_0x8b154d['has'](_0x394ea6))return![];if(_0x418f9f)return _0x423386===_0x1b50bc||_0x423386[_0x32d97d(0x200)](_0x1b50bc+'/');return!![];});}export function buildSegmentLookupMap(_0xebcbb1,_0x9fb6d4){const _0x2988ed=a152_0x56096e,_0x533de5=new Map();for(const _0x5db29b of _0xebcbb1){const _0x5f3e00=_0x5db29b[_0x2988ed(0x18e)]?_0x9fb6d4[_0x2988ed(0x241)](_0x5db29b[_0x2988ed(0x18e)][_0x2988ed(0x195)]())||'':'',_0xd961d3=_0x5f3e00+':'+_0x5db29b[_0x2988ed(0x1de)];_0x533de5['set'](_0xd961d3,_0x5db29b);}return _0x533de5;}export function buildSegmentNameToIdMap(_0xf6ca8f){const _0x24a8e2=a152_0x56096e,_0x364bcd=new Map();for(const _0x1d6c59 of _0xf6ca8f){_0x364bcd[_0x24a8e2(0x19f)](_0x1d6c59['name'],_0x1d6c59['id']);}return _0x364bcd;}export function buildJourneyBundleLookupMap(_0x20db84,_0x570b53){const _0x19e629=a152_0x56096e,_0x3e0b29=new Map();for(const _0x4a3898 of _0x20db84){const _0x366558=_0x4a3898[_0x19e629(0x1c2)]?_0x570b53[_0x19e629(0x241)](_0x4a3898[_0x19e629(0x1c2)])||'':'',_0x7280a7=_0x366558+':'+_0x4a3898['journeyBundleName'];!_0x3e0b29['has'](_0x7280a7)&&_0x3e0b29[_0x19e629(0x19f)](_0x7280a7,[]),_0x3e0b29[_0x19e629(0x241)](_0x7280a7)[_0x19e629(0x17f)](_0x4a3898);}for(const _0x3b2e4d of _0x3e0b29['values']()){_0x3b2e4d[_0x19e629(0x234)]((_0x4c439b,_0xe2fe87)=>(_0x4c439b[_0x19e629(0x19b)]||0x0)-(_0xe2fe87[_0x19e629(0x19b)]||0x0));}return _0x3e0b29;}export function collectFoldersToCreate(_0x304c56,_0x4c3e6f){const _0x38f6e0=a152_0x56096e,_0x276a01=new Set();for(const _0x100320 of _0x304c56){if(!_0x100320)continue;if(_0x4c3e6f[_0x38f6e0(0x1ac)](_0x100320))continue;const _0xefb073=_0x100320[_0x38f6e0(0x170)]('/');let _0x58fddb='';for(const _0x5b12d3 of _0xefb073){_0x58fddb=_0x58fddb?_0x58fddb+'/'+_0x5b12d3:_0x5b12d3,!_0x4c3e6f[_0x38f6e0(0x1ac)](_0x58fddb)&&_0x276a01[_0x38f6e0(0x1bc)](_0x58fddb);}}return _0x276a01;}export function parseAndClassifyYamlFiles(_0xbd6823,_0x478650,_0x65ca5f){const _0x1a9de6=a152_0x56096e,_0x1cec46=[],_0x417660=[];for(const _0x457676 of _0xbd6823){const _0x212d85=a152_0x51d9c3['relative'](_0x478650,a152_0x51d9c3[_0x1a9de6(0x180)](_0x457676)),_0x39f237=_0x212d85==='.'?'':_0x212d85,_0xb42caa=readFileSync(_0x457676,_0x1a9de6(0x187)),_0x16760d=a152_0xbfd065[_0x1a9de6(0x1d5)](_0xb42caa);if(isJourneyDef(_0x16760d)){const _0x54c4f5=a152_0x3e5f8c(_0xb42caa);_0x417660[_0x1a9de6(0x17f)]({'yamlConfig':_0x54c4f5,'folderPath':_0x39f237,'sourcePath':_0x457676});}else{if(!_0x65ca5f?.[_0x1a9de6(0x25b)]){const _0x574832=parseSegmentYamlFile(_0xb42caa),_0x3585da=normalizeChildSegmentYaml(_0x574832);_0x1cec46[_0x1a9de6(0x17f)]({'yamlConfig':_0x3585da,'folderPath':_0x39f237,'sourcePath':_0x457676});}}}return{'segments':_0x1cec46,'journeys':_0x417660};}export function validateParsedFiles(_0x4315d2,_0x5eaf5a){const _0x4eccb0=a152_0x56096e,_0x484dba=[];for(const {yamlConfig:_0xf56042,sourcePath:_0x4dd8ca}of _0x4315d2[_0x4eccb0(0x249)]){const _0x52ce54=readFileSync(_0x4dd8ca,_0x4eccb0(0x187)),_0x393901=a152_0xbfd065[_0x4eccb0(0x1b1)](_0x52ce54),_0x2f0dfe=validateSegmentDef(_0xf56042,{'source':_0x52ce54,'document':_0x393901},{'skipSchema':!![]});if(!_0x2f0dfe['valid']){const _0xf8bff2=a152_0x51d9c3['relative'](_0x5eaf5a,_0x4dd8ca);_0x484dba['push']({'filePath':_0xf8bff2,'source':_0x52ce54,'result':_0x2f0dfe,'isJourney':![]});}}for(const {yamlConfig:_0x13e976,sourcePath:_0x24b219}of _0x4315d2[_0x4eccb0(0x185)]){const _0x56e946=readFileSync(_0x24b219,_0x4eccb0(0x187)),_0x50d1e2=a152_0xbfd065['parseDocument'](_0x56e946),_0x255c97=validateJourneyDef(_0x13e976,{'source':_0x56e946,'document':_0x50d1e2},{'skipSchema':!![]});if(!_0x255c97['valid']){const _0x409138=a152_0x51d9c3[_0x4eccb0(0x157)](_0x5eaf5a,_0x24b219);_0x484dba[_0x4eccb0(0x17f)]({'filePath':_0x409138,'source':_0x56e946,'result':_0x255c97,'isJourney':!![]});}}return _0x484dba;}export function formatValidationErrors(_0x1d0329){const _0x918429=a152_0x56096e,_0x38a800=[];for(const {filePath:_0xfa63d4,source:_0x3c8239,result:_0x508061,isJourney:_0x209a44}of _0x1d0329){const _0x3ceacb=_0x209a44?_0x918429(0x246):_0x918429(0x232);_0x38a800[_0x918429(0x17f)]('\x0a'+_0xfa63d4+'\x20('+_0x3ceacb+_0x918429(0x1a1)+_0x508061[_0x918429(0x1ea)][_0x918429(0x1e8)]+_0x918429(0x1b3)),_0x38a800[_0x918429(0x17f)](formatValidationResult(_0x508061,_0x3c8239,_0xfa63d4));}return _0x38a800[_0x918429(0x1be)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x56e35c){const _0xee5421=a152_0x56096e,_0x4b41ea=new Set(),_0x338d63=new Map(),_0x4f087a=collectSegmentUsageCounts(_0x56e35c);if(_0x56e35c[_0xee5421(0x249)])for(const [_0x1973b6,_0x3f3f53]of Object[_0xee5421(0x1f3)](_0x56e35c[_0xee5421(0x249)])){_0x4b41ea[_0xee5421(0x1bc)](_0x1973b6);if(_0x3f3f53[_0xee5421(0x1a3)]){const _0xef171a=yamlRuleToApi(_0x3f3f53[_0xee5421(0x1a3)]),_0x36df20=apiRuleToYaml(_0xef171a);_0x338d63[_0xee5421(0x19f)](_0x1973b6,_0x36df20);}}const _0x36f74c=new Map();let _0x2cd82d=0x0;for(const [_0x5368d6,_0x460acb]of _0x338d63){const _0x12d953=serializeExpandedRule(_0x460acb,_0x338d63),_0x5359b9=_0x36f74c[_0xee5421(0x241)](_0x12d953)||[];_0x5359b9[_0xee5421(0x17f)]({'name':_0x5368d6,'index':_0x2cd82d}),_0x36f74c[_0xee5421(0x19f)](_0x12d953,_0x5359b9),_0x2cd82d++;}const _0x2bbf72=new Map();for(const [_0x4e8289,_0x5c4901]of _0x36f74c){const _0xe40f7b=_0x5c4901[_0xee5421(0x1f1)]()[_0xee5421(0x234)]((_0x4b6086,_0x46b588)=>{const _0x421d73=_0xee5421,_0x439ca0=_0x4f087a[_0x421d73(0x241)](_0x4b6086['name'])||0x0,_0x3b45e1=_0x4f087a['get'](_0x46b588[_0x421d73(0x1de)])||0x0;if(_0x439ca0!==_0x3b45e1)return _0x3b45e1-_0x439ca0;return _0x4b6086[_0x421d73(0x1ec)]-_0x46b588['index'];})[_0xee5421(0x1e9)](_0x15f12f=>_0x15f12f[_0xee5421(0x1de)]),_0x569001=[];for(const _0x2919ec of _0xe40f7b){const _0x3487a3=_0x4f087a['get'](_0x2919ec)||0x0,_0x384bcb=Math[_0xee5421(0x16c)](_0x3487a3,0x1);for(let _0x5791df=0x0;_0x5791df<_0x384bcb;_0x5791df++){_0x569001[_0xee5421(0x17f)](_0x2919ec);}}_0x2bbf72['set'](_0x4e8289,_0x569001);}return{'existingLocalSegmentNames':_0x4b41ea,'localSegmentRules':_0x338d63,'localExpandedRuleToNames':_0x2bbf72};}export function createSegmentIdResolver(_0x1b7da8,_0x2b981b){return async _0x2459af=>{const _0x2c9446=a152_0x3f60,_0x2846af=_0x1b7da8[_0x2c9446(0x241)](_0x2459af);if(!_0x2846af)throw new SDKError(ErrorCode[_0x2c9446(0x171)],_0x2c9446(0x21f)+_0x2459af+_0x2c9446(0x18c)+_0x2b981b+'\x27)');return _0x2846af;};}export function extractRootFolderId(_0x3ff31b){const _0x2f20e4=a152_0x56096e;return _0x3ff31b[_0x2f20e4(0x250)]?.[_0x2f20e4(0x1cc)]?.[_0x2f20e4(0x1c3)]?.['id']||_0x3ff31b[_0x2f20e4(0x250)]?.['parentFolder']?.[_0x2f20e4(0x1c3)]?.['id'];}export function buildConnectionMaps(_0x1c9f5d){const _0x23554d=a152_0x56096e,_0x4dc4cd=new Map(),_0x42a13a=new Map(),_0x355330=new Map();for(const _0x2e21ca of _0x1c9f5d){_0x4dc4cd[_0x23554d(0x19f)](_0x2e21ca[_0x23554d(0x1de)],parseInt(_0x2e21ca['id'],0xa)),_0x42a13a['set'](_0x2e21ca['id'],_0x2e21ca[_0x23554d(0x1de)]),_0x355330[_0x23554d(0x19f)](_0x2e21ca['name'],_0x2e21ca[_0x23554d(0x21d)]);}return{'nameToId':_0x4dc4cd,'idToName':_0x42a13a,'nameToType':_0x355330};}export function calculatePushStats(_0x22fa9c,_0x500ce0,_0x3e19b8,_0x927ae8,_0x20fdb3,_0x1e6470,_0x45945c){const _0x48fe60=a152_0x56096e,_0x318130=_0x22fa9c['filter'](_0x2ca949=>_0x2ca949[_0x48fe60(0x24c)]),_0x93416f=_0x22fa9c[_0x48fe60(0x1e0)](_0x88859a=>!_0x88859a[_0x48fe60(0x24c)]&&_0x88859a[_0x48fe60(0x15b)]),_0x576184=_0x22fa9c['filter'](_0x498766=>!_0x498766[_0x48fe60(0x24c)]&&!_0x498766['hasChanges']),_0x2ed0c0=_0x1e6470?_0x927ae8:[],_0x180b06=_0x500ce0[_0x48fe60(0x1e0)](_0x12b05a=>_0x12b05a[_0x48fe60(0x24c)]),_0x5c5639=_0x500ce0[_0x48fe60(0x1e0)](_0x3160fe=>!_0x3160fe[_0x48fe60(0x24c)]&&_0x3160fe[_0x48fe60(0x15b)]),_0x3883de=_0x500ce0['filter'](_0x54f1d3=>!_0x54f1d3[_0x48fe60(0x24c)]&&!_0x54f1d3[_0x48fe60(0x15b)]),_0xbbdf9=_0x1e6470?_0x20fdb3:[],_0x104ece=_0x22fa9c[_0x48fe60(0x152)](_0x2a18bf=>_0x2a18bf[_0x48fe60(0x1a7)]),_0x4cab06=_0x104ece[_0x48fe60(0x1e0)](_0x37c714=>_0x37c714['type']===_0x48fe60(0x1d8)),_0x416563=_0x104ece['filter'](_0x4a8fd0=>_0x4a8fd0[_0x48fe60(0x21d)]===_0x48fe60(0x22d)),_0x5e57a7=_0x104ece['filter'](_0x18a00e=>_0x18a00e[_0x48fe60(0x21d)]===_0x48fe60(0x204)),_0x43e0fe=Array[_0x48fe60(0x154)](_0x3e19b8)[_0x48fe60(0x234)](),_0x23afc2=_0x45945c?![]:_0x318130[_0x48fe60(0x1e8)]>0x0||_0x93416f['length']>0x0||_0x2ed0c0[_0x48fe60(0x1e8)]>0x0,_0x41f5a8=_0x180b06['length']>0x0||_0x5c5639['length']>0x0||_0xbbdf9[_0x48fe60(0x1e8)]>0x0,_0x267f3e=_0x45945c?![]:_0x104ece[_0x48fe60(0x1e8)]>0x0,_0x4cc1ee=_0x43e0fe[_0x48fe60(0x1e8)]>0x0;return{'segments':{'new':_0x318130,'changed':_0x93416f,'unchanged':_0x576184,'toDelete':_0x2ed0c0},'journeys':{'new':_0x180b06,'changed':_0x5c5639,'unchanged':_0x3883de,'toDelete':_0xbbdf9},'activations':{'all':_0x104ece,'toCreate':_0x4cab06,'toUpdate':_0x416563,'toDelete':_0x5e57a7},'folders':{'toCreate':_0x43e0fe},'counts':{'segments':{'new':_0x318130['length'],'changed':_0x93416f[_0x48fe60(0x1e8)],'unchanged':_0x576184[_0x48fe60(0x1e8)],'toDelete':_0x2ed0c0[_0x48fe60(0x1e8)]},'journeys':{'new':_0x180b06['length'],'changed':_0x5c5639[_0x48fe60(0x1e8)],'unchanged':_0x3883de[_0x48fe60(0x1e8)],'toDelete':_0xbbdf9[_0x48fe60(0x1e8)]},'activations':{'create':_0x4cab06[_0x48fe60(0x1e8)],'update':_0x416563[_0x48fe60(0x1e8)],'delete':_0x5e57a7['length']},'folders':_0x43e0fe[_0x48fe60(0x1e8)]},'hasChanges':_0x23afc2||_0x41f5a8||_0x267f3e||_0x4cc1ee};}export async function buildPushExecutionContext(_0x1aecbe,_0x5d790a,_0x2129c3,_0x5ce38c,_0x40a997,_0x38cd62){const _0x3ea330=a152_0x56096e,_0x53ccac=extractRootFolderId(_0x2129c3),{pathToId:_0x196054,idToPath:_0x40705a}=buildFolderMaps(_0x40a997),_0x4a52de=buildSegmentNameToIdMap(_0x5ce38c),_0xaa9cb8=new Map(),{batchAsync:_0x363f2c}=await import('../../utils/async.js'),[_0x3ba475,_0x403583]=await Promise[_0x3ea330(0x177)]([_0x1aecbe[_0x3ea330(0x23d)][_0x3ea330(0x193)](),_0x1aecbe[_0x3ea330(0x1fa)][_0x3ea330(0x167)](),((async()=>{const _0x1ad9e0=_0x3ea330;!_0x38cd62&&_0x5ce38c[_0x1ad9e0(0x1e8)]>0x0&&await _0x363f2c(_0x5ce38c,async _0x270cb7=>{const _0x234422=_0x1ad9e0,_0x1e87f3=await _0x1aecbe['segment'][_0x234422(0x160)](_0x5d790a,_0x270cb7['id']);_0xaa9cb8['set'](_0x270cb7['id'],_0x1e87f3);});})())]),{emailToId:_0x8af3cf,idToEmail:_0x4075b9}=_0x3ba475,_0x5bacf1=buildConnectionMaps(_0x403583);return{'rootFolderId':_0x53ccac,'folderPathToId':_0x196054,'folderIdToPath':_0x40705a,'segmentNameToId':_0x4a52de,'activationsBySegmentId':_0xaa9cb8,'emailToIdMap':_0x8af3cf,'idToEmailMap':_0x4075b9,'connectionNameToIdMap':_0x5bacf1['nameToId'],'connectionIdToNameMap':_0x5bacf1[_0x3ea330(0x182)],'connectionNameToTypeMap':_0x5bacf1[_0x3ea330(0x20f)]};}export function createPushYamlContextForBundle(_0x36a86c,_0x2e23ed,_0x35fbe4,_0x215297,_0xbd8714,_0x4f439f,_0x58649c,_0x562ee0){const {existingLocalSegmentNames:_0x448b04,localExpandedRuleToNames:_0x53d50f}=_0x215297,_0x4acf27=new Set(),_0x549b9c=new Map(),_0x1e424b=new Map(),_0x17bf12=new Map(),_0x33b7c0=createJumpTargetCache(),_0x539c7b=new Map(),_0x5e6058=new Map(),_0x114cfc=new Set();let _0x4ebe4c;const _0x39df87=_0x1e921c=>{const _0x5f311f={'resolveSegment':async _0x5eb480=>{const _0x33e229=a152_0x3f60,_0x4755e1=_0x17bf12[_0x33e229(0x241)](_0x5eb480);if(_0x4755e1!==undefined)return{'name':_0x4755e1,'isJourneyLocal':!![]};try{const _0x15706b=await fetchSegment(_0x36a86c,_0x2e23ed,_0x5eb480,_0x35fbe4);if(!_0x15706b)throw new Error(_0x33e229(0x24d));const _0x2b1218=generateJourneyLocalName(_0x15706b['name']),_0x33f8a4=_0x15706b[_0x33e229(0x1e4)]===SEGMENT_KIND_JOURNEY&&_0x2b1218!==undefined;let _0x54cbe8=_0x15706b[_0x33e229(0x1de)],_0x503949;if(_0x33f8a4&&_0x15706b[_0x33e229(0x1a3)]){const _0x5c6a40=apiRuleToYaml(_0x15706b['rule']);_0x5e6058[_0x33e229(0x19f)](_0x5eb480,_0x5c6a40);const _0x148e4a=async _0x3fd569=>{const _0x2b8f72=_0x33e229,_0xfca2cb=collectSegmentRefsFromRule(_0x3fd569);for(const _0x50754e of _0xfca2cb){if(!_0x5e6058[_0x2b8f72(0x1ac)](_0x50754e))try{const _0x493da6=await fetchSegment(_0x36a86c,_0x2e23ed,_0x50754e,_0x35fbe4);if(_0x493da6?.['rule']){const _0x14e803=apiRuleToYaml(_0x493da6['rule']);_0x5e6058[_0x2b8f72(0x19f)](_0x50754e,_0x14e803),await _0x148e4a(_0x14e803);}}catch(_0x1e86e7){logger[_0x2b8f72(0x201)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x50754e+':\x20'+_0x1e86e7);}}};await _0x148e4a(_0x5c6a40);const _0x450e5d=serializeExpandedRule(_0x5c6a40,_0x5e6058),_0x3b423b=_0x53d50f['get'](_0x450e5d);if(_0x3b423b&&_0x3b423b[_0x33e229(0x1e8)]>0x0){const _0x493eab=_0x549b9c[_0x33e229(0x241)](_0x450e5d)||0x0,_0x563261=_0x3b423b[_0x493eab]||_0x3b423b[_0x3b423b['length']-0x1];_0x549b9c['set'](_0x450e5d,_0x493eab+0x1),_0x54cbe8=_0x563261,_0x4acf27['add'](_0x54cbe8),_0x17bf12[_0x33e229(0x19f)](_0x5eb480,_0x54cbe8);const _0x906764=await resolveRuleSegmentRefs(_0x5c6a40,async _0x23f7dd=>{const _0x260704=_0x33e229,_0x43abd9=_0x17bf12[_0x260704(0x241)](_0x23f7dd);if(_0x43abd9)return _0x43abd9;const _0x42e6d9=await _0x4ebe4c[_0x260704(0x1ae)](_0x23f7dd);return _0x42e6d9['name'];});_0x503949={'description':_0x15706b[_0x33e229(0x1c4)],'rule':_0x906764};}else{const _0x1ee11d=_0x539c7b[_0x33e229(0x241)](_0x450e5d);if(_0x1ee11d)_0x54cbe8=_0x1ee11d,_0x17bf12[_0x33e229(0x19f)](_0x5eb480,_0x54cbe8);else{if(_0x2b1218){let _0x47a5fb=_0x2b1218,_0x43ede1=0x2;while(_0x4acf27[_0x33e229(0x1ac)](_0x47a5fb)||_0x448b04['has'](_0x47a5fb)){_0x47a5fb=_0x2b1218+'_'+_0x43ede1,_0x43ede1++;}_0x4acf27[_0x33e229(0x1bc)](_0x47a5fb),_0x54cbe8=_0x47a5fb;}_0x17bf12[_0x33e229(0x19f)](_0x5eb480,_0x54cbe8),_0x539c7b[_0x33e229(0x19f)](_0x450e5d,_0x54cbe8);const _0x133fd4=await resolveRuleSegmentRefs(_0x5c6a40,async _0x1642e5=>{const _0x4f5b28=_0x33e229,_0x2947f3=_0x17bf12[_0x4f5b28(0x241)](_0x1642e5);if(_0x2947f3)return _0x2947f3;const _0x4d4ec9=await _0x4ebe4c['resolveSegment'](_0x1642e5);return _0x4d4ec9['name'];});_0x503949={'description':_0x15706b[_0x33e229(0x1c4)],'rule':_0x133fd4};}}}return{'name':_0x54cbe8,'isJourneyLocal':_0x33f8a4,'definition':_0x503949};}catch(_0x350438){return logger[_0x33e229(0x201)](_0x33e229(0x22f)+_0x5eb480+':\x20'+_0x350438),{'name':_0x5eb480,'isJourneyLocal':![]};}},'resolveActivation':async _0x42b744=>{const _0x2c1cd8=a152_0x3f60,_0x2ba91f=_0x1e424b[_0x2c1cd8(0x241)](_0x42b744);if(_0x2ba91f!==undefined)return{'name':_0x2ba91f,'isJourneyLocal':!![]};try{let _0x5298fd=_0x58649c?.[_0x2c1cd8(0x241)](_0x42b744);!_0x5298fd&&(_0x5298fd=await _0x36a86c[_0x2c1cd8(0x246)][_0x2c1cd8(0x19a)](_0x1e921c,_0x42b744));const _0x393f88=_0x5298fd[_0x2c1cd8(0x243)]['activationParams'][_0x2c1cd8(0x1de)]||_0x42b744,_0x59ddda=sanitizeYamlKey(_0x393f88)||_0x2c1cd8(0x248)+_0x42b744,_0x5497b9=_0x59ddda;_0x1e424b[_0x2c1cd8(0x19f)](_0x42b744,_0x5497b9);const _0x3059ef=journeyActivationStepToYaml(_0x5298fd,_0xbd8714,_0x4f439f);return{'name':_0x5497b9,'isJourneyLocal':!![],'definition':_0x3059ef};}catch(_0x32b60c){return logger[_0x2c1cd8(0x201)](_0x2c1cd8(0x14f)+_0x42b744+':\x20'+_0x32b60c),{'name':_0x42b744,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3254b4,_0x5d7409)=>resolveJumpTarget(_0x3254b4,_0x5d7409,_0x33b7c0,async _0x31cd3c=>{const _0x1ef579=a152_0x3f60,_0x5bfc61=_0x562ee0?.[_0x1ef579(0x241)](_0x31cd3c);if(_0x5bfc61)return _0x5bfc61;return _0x36a86c['journey'][_0x1ef579(0x1df)](_0x31cd3c);})};return _0x4ebe4c=_0x5f311f,_0x5f311f;},_0xd2f06f=async _0x22649d=>{const _0x697595=a152_0x3f60,{collectSegmentIdsFromJourneyApi:_0x10c473}=await import(_0x697595(0x168)),{batchAsync:_0x33b414}=await import('../../utils/async.js'),_0x28e31d=new Set();for(const _0x3c5820 of _0x22649d){let _0x5d9fcb=_0x562ee0?.['get'](_0x3c5820);!_0x5d9fcb&&(_0x5d9fcb=await _0x36a86c[_0x697595(0x246)][_0x697595(0x1df)](_0x3c5820));const _0x22a29e=_0x10c473(_0x5d9fcb);for(const _0x409009 of _0x22a29e){_0x28e31d[_0x697595(0x1bc)](_0x409009);}}let _0x59ada2=Array[_0x697595(0x154)](_0x28e31d);while(_0x59ada2['length']>0x0){const _0x1a4871=_0x59ada2[_0x697595(0x1e0)](_0x203f95=>!_0x114cfc['has'](_0x203f95));if(_0x1a4871[_0x697595(0x1e8)]===0x0)break;const _0xed69ee=await _0x33b414(_0x1a4871,async _0x304c12=>{const _0x26dfb7=_0x697595;_0x114cfc[_0x26dfb7(0x1bc)](_0x304c12);const _0x5b0e7e=await fetchSegment(_0x36a86c,_0x2e23ed,_0x304c12,_0x35fbe4);if(!_0x5b0e7e)return null;return{'segmentId':_0x304c12,'segment':_0x5b0e7e};},0xa),_0x519380=new Set();for(const _0x53b85d of _0xed69ee){if(!_0x53b85d?.[_0x697595(0x232)]?.[_0x697595(0x1a3)])continue;const _0x41c62e=apiRuleToYaml(_0x53b85d[_0x697595(0x232)][_0x697595(0x1a3)]);_0x5e6058[_0x697595(0x19f)](_0x53b85d['segmentId'],_0x41c62e);const _0x3d27a7=collectSegmentRefsFromRule(_0x41c62e);for(const _0x85d2e8 of _0x3d27a7){!_0x114cfc[_0x697595(0x1ac)](_0x85d2e8)&&_0x519380[_0x697595(0x1bc)](_0x85d2e8);}}_0x59ada2=Array[_0x697595(0x154)](_0x519380);}};return{'createYamlContext':_0x39df87,'prefetchJourneySegments':_0xd2f06f};}export async function executePushSegments(_0x2cd3c3,_0x2f64dd,_0x4747b4,_0x54430c,_0x4ae6d1){const _0x547d33=a152_0x56096e,{segmentDefToCreateRequest:_0x4f4f15,segmentDefToUpdateRequest:_0x4828c3}=await import('./child-segment-yaml.js'),_0x31faf6=_0x4747b4[_0x547d33(0x15d)],_0x138a63=0x5,_0x2ceb0b=async _0x199ba2=>{const _0x4a269a=_0x547d33,_0x4f781b=_0x199ba2[_0x4a269a(0x252)]?_0x31faf6['get'](_0x199ba2[_0x4a269a(0x252)]):undefined;let _0x1f1384;const _0x3e54ea={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x51972f=_0x199ba2['yamlConfig'];if(_0x199ba2['yamlConfig'][_0x4a269a(0x1a3)]){const _0x596537=createSegmentIdResolver(_0x4747b4[_0x4a269a(0x1a0)],_0x199ba2[_0x4a269a(0x240)][_0x4a269a(0x1de)]),_0x5e7d92=await resolveRuleSegmentIds(_0x199ba2[_0x4a269a(0x240)][_0x4a269a(0x1a3)],_0x596537);_0x51972f={..._0x199ba2['yamlConfig'],'rule':_0x5e7d92};}try{if(_0x199ba2['isNew']){_0x4ae6d1[_0x4a269a(0x233)]?.({'type':'segment_creating','name':_0x199ba2[_0x4a269a(0x240)][_0x4a269a(0x1de)]});const _0x1a3df5=_0x4f4f15(_0x51972f,_0x4f781b),_0x2b408e=await _0x4ae6d1[_0x4a269a(0x165)](_0x4a269a(0x227)+_0x199ba2[_0x4a269a(0x240)][_0x4a269a(0x1de)]+'\x27...',()=>_0x2cd3c3[_0x4a269a(0x232)]['createSegment'](_0x54430c['parentId'],_0x1a3df5));_0x1f1384=_0x2b408e[_0x4a269a(0x1c3)]['id'],_0x4747b4[_0x4a269a(0x1a0)][_0x4a269a(0x19f)](_0x199ba2[_0x4a269a(0x240)]['name'],_0x1f1384),_0x3e54ea['createdSegmentId']={'name':_0x199ba2['yamlConfig'][_0x4a269a(0x1de)],'id':_0x1f1384},_0x4ae6d1['onProgress']?.({'type':_0x4a269a(0x253),'name':_0x199ba2[_0x4a269a(0x240)][_0x4a269a(0x1de)],'segmentId':_0x1f1384}),_0x4ae6d1['logSuccess']?.(_0x4a269a(0x22e)+_0x199ba2[_0x4a269a(0x240)]['name']+'\x27'),_0x3e54ea[_0x4a269a(0x236)]=0x1;}else{if(_0x199ba2[_0x4a269a(0x15b)]){_0x4ae6d1['onProgress']?.({'type':_0x4a269a(0x194),'name':_0x199ba2[_0x4a269a(0x240)]['name']});const _0x3d52a2=_0x4828c3(_0x51972f);_0x4f781b!==_0x199ba2[_0x4a269a(0x159)]?.[_0x4a269a(0x18e)]&&(_0x3d52a2[_0x4a269a(0x18e)]=_0x4f781b?parseInt(_0x4f781b,0xa):undefined),await _0x4ae6d1['withProgress'](_0x4a269a(0x162)+_0x199ba2[_0x4a269a(0x240)][_0x4a269a(0x1de)]+_0x4a269a(0x16b),()=>_0x2cd3c3[_0x4a269a(0x232)][_0x4a269a(0x15c)](_0x54430c[_0x4a269a(0x199)],_0x199ba2['existingSegment']['id'],_0x3d52a2)),_0x1f1384=_0x199ba2[_0x4a269a(0x159)]['id'],_0x4ae6d1['onProgress']?.({'type':_0x4a269a(0x1cf),'name':_0x199ba2[_0x4a269a(0x240)][_0x4a269a(0x1de)]}),_0x4ae6d1[_0x4a269a(0x219)]?.('Updated\x20segment\x20\x27'+_0x199ba2['yamlConfig'][_0x4a269a(0x1de)]+'\x27'),_0x3e54ea[_0x4a269a(0x1f8)]=0x1;}else _0x1f1384=_0x199ba2[_0x4a269a(0x159)]['id'];}}catch(_0x27dff3){const _0xb2011b=isHttp400Error(_0x27dff3),_0x51c106=_0xb2011b?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x4a269a(0x17b)],_0x13ed22=getErrorMessage(_0x27dff3);throw new SDKError(_0x51c106,_0x4a269a(0x1d4)+(_0x199ba2[_0x4a269a(0x24c)]?_0x4a269a(0x1d8):'update')+_0x4a269a(0x186)+_0x199ba2[_0x4a269a(0x18a)]+_0x4a269a(0x229)+_0x13ed22,_0x27dff3);}try{const _0x203ecc=await syncActivationsForSegment(_0x2cd3c3,_0x54430c['parentId'],_0x1f1384,_0x199ba2[_0x4a269a(0x240)][_0x4a269a(0x1de)],_0x199ba2[_0x4a269a(0x1a7)],_0x4ae6d1,_0x199ba2[_0x4a269a(0x18a)]);_0x3e54ea['activations']=_0x203ecc;}catch(_0x320c4f){if(_0x320c4f instanceof SDKError)throw _0x320c4f;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x199ba2[_0x4a269a(0x240)][_0x4a269a(0x1de)]+'\x27\x20from\x20file:\x20'+_0x199ba2[_0x4a269a(0x18a)]+'\x0a\x20\x20'+getErrorMessage(_0x320c4f),_0x320c4f);}return _0x3e54ea;},_0x44570b=await batchAsync(_0x2f64dd,_0x2ceb0b,_0x138a63),_0x89229f={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x10d28d of _0x44570b){_0x89229f[_0x547d33(0x236)]+=_0x10d28d[_0x547d33(0x236)],_0x89229f[_0x547d33(0x1f8)]+=_0x10d28d[_0x547d33(0x1f8)],_0x10d28d[_0x547d33(0x17d)]&&_0x89229f[_0x547d33(0x1f0)][_0x547d33(0x19f)](_0x10d28d[_0x547d33(0x17d)][_0x547d33(0x1de)],_0x10d28d[_0x547d33(0x17d)]['id']),_0x89229f['activations']['created']+=_0x10d28d['activations'][_0x547d33(0x236)],_0x89229f[_0x547d33(0x151)][_0x547d33(0x1f8)]+=_0x10d28d[_0x547d33(0x151)]['updated'],_0x89229f[_0x547d33(0x151)]['deleted']+=_0x10d28d[_0x547d33(0x151)][_0x547d33(0x224)];}return _0x89229f;}async function syncActivationsForSegment(_0x3f335b,_0x4a0bda,_0x3ee6dd,_0x11e02e,_0x2aa226,_0x53fa3d,_0x3cf353){const _0x9d8f15=a152_0x56096e,_0x54cb77={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x392f56 of _0x2aa226){try{if(_0x392f56[_0x9d8f15(0x21d)]===_0x9d8f15(0x1d8)&&_0x392f56[_0x9d8f15(0x189)])_0x53fa3d[_0x9d8f15(0x233)]?.({'type':_0x9d8f15(0x1cb),'segmentName':_0x11e02e,'activationName':_0x392f56['name']}),await _0x53fa3d['withProgress']('Creating\x20activation\x20\x27'+_0x392f56[_0x9d8f15(0x1de)]+_0x9d8f15(0x16b),()=>_0x3f335b[_0x9d8f15(0x232)]['createActivation'](_0x4a0bda,_0x3ee6dd,_0x392f56['validatedRequest'])),_0x53fa3d[_0x9d8f15(0x233)]?.({'type':_0x9d8f15(0x1b9),'segmentName':_0x11e02e,'activationName':_0x392f56[_0x9d8f15(0x1de)]}),_0x53fa3d['logSuccess']?.(_0x9d8f15(0x20d)+_0x392f56[_0x9d8f15(0x1de)]+'\x27'),_0x54cb77[_0x9d8f15(0x236)]++;else{if(_0x392f56['type']==='update'&&_0x392f56[_0x9d8f15(0x189)]&&_0x392f56[_0x9d8f15(0x1d6)])_0x53fa3d['onProgress']?.({'type':_0x9d8f15(0x1f7),'segmentName':_0x11e02e,'activationName':_0x392f56[_0x9d8f15(0x1de)]}),await _0x53fa3d[_0x9d8f15(0x165)](_0x9d8f15(0x1f4)+_0x392f56['name']+'\x27...',()=>_0x3f335b[_0x9d8f15(0x232)]['updateActivation'](_0x4a0bda,_0x3ee6dd,_0x392f56[_0x9d8f15(0x1d6)]['id'],_0x392f56[_0x9d8f15(0x189)])),_0x53fa3d[_0x9d8f15(0x233)]?.({'type':_0x9d8f15(0x210),'segmentName':_0x11e02e,'activationName':_0x392f56[_0x9d8f15(0x1de)]}),_0x53fa3d['logSuccess']?.(_0x9d8f15(0x1b0)+_0x392f56[_0x9d8f15(0x1de)]+'\x27'),_0x54cb77[_0x9d8f15(0x1f8)]++;else _0x392f56[_0x9d8f15(0x21d)]===_0x9d8f15(0x204)&&_0x392f56[_0x9d8f15(0x1d6)]&&(_0x53fa3d[_0x9d8f15(0x233)]?.({'type':_0x9d8f15(0x1fb),'segmentName':_0x11e02e,'activationName':_0x392f56[_0x9d8f15(0x1de)]}),await _0x53fa3d[_0x9d8f15(0x165)](_0x9d8f15(0x20c)+_0x392f56['name']+_0x9d8f15(0x16b),()=>_0x3f335b[_0x9d8f15(0x232)][_0x9d8f15(0x24e)](_0x4a0bda,_0x3ee6dd,_0x392f56[_0x9d8f15(0x1d6)]['id'])),_0x53fa3d[_0x9d8f15(0x233)]?.({'type':'activation_deleted','segmentName':_0x11e02e,'activationName':_0x392f56[_0x9d8f15(0x1de)]}),_0x53fa3d['logDeleted']?.(_0x9d8f15(0x1ab)+_0x392f56['name']+'\x27'),_0x54cb77[_0x9d8f15(0x224)]++);}}catch(_0x3bc366){const _0x2e3a95=isHttp400Error(_0x3bc366),_0x3b920a=_0x2e3a95?ErrorCode[_0x9d8f15(0x1ba)]:ErrorCode[_0x9d8f15(0x242)],_0x40b849=getErrorMessage(_0x3bc366);throw new SDKError(_0x3b920a,_0x9d8f15(0x1d4)+_0x392f56[_0x9d8f15(0x21d)]+_0x9d8f15(0x206)+_0x392f56[_0x9d8f15(0x1de)]+_0x9d8f15(0x1d0)+_0x3cf353+'\x0a\x20\x20'+_0x40b849,_0x3bc366);}}return _0x54cb77;}export async function executePushFolders(_0x53c4fb,_0x96eb48,_0x49d28e,_0x3ddab8,_0x51b8d8){const _0xde44ed=a152_0x56096e,_0x655524=new Map(_0x49d28e),_0x3e70bd=sortFoldersByDepth(_0x96eb48);for(const _0x5c0957 of _0x3e70bd){const _0x5c2a44=_0x5c0957[_0xde44ed(0x170)]('/'),_0x4bcf09=_0x5c2a44[_0x5c2a44['length']-0x1],_0x1eb1df=_0x5c2a44['slice'](0x0,-0x1)[_0xde44ed(0x1be)]('/'),_0x2fa6cd=_0x655524[_0xde44ed(0x241)](_0x1eb1df);_0x51b8d8['onProgress']?.({'type':_0xde44ed(0x1d7),'folder':_0x5c0957});const _0x55d156={'name':_0x4bcf09,'parentFolderId':_0x2fa6cd},_0x412aee=await _0x51b8d8['withProgress'](_0xde44ed(0x215)+_0x5c0957+_0xde44ed(0x16b),()=>_0x53c4fb[_0xde44ed(0x232)][_0xde44ed(0x15e)](_0x3ddab8[_0xde44ed(0x199)],_0x55d156));_0x655524[_0xde44ed(0x19f)](_0x5c0957,_0x412aee[_0xde44ed(0x1c3)]['id']),_0x51b8d8['onProgress']?.({'type':'folder_created','folder':_0x5c0957,'folderId':_0x412aee['data']['id']}),_0x51b8d8[_0xde44ed(0x18b)]?.('Created\x20folder\x20\x27'+_0x5c0957+'\x27');}return _0x655524;}export async function executePushSegmentDeletions(_0x28ac0e,_0x35ad4d,_0x2f778f){const _0xa91df5=a152_0x56096e;if(_0x35ad4d[_0xa91df5(0x1e8)]===0x0)return 0x0;const {batchAsync:_0x474bb6}=await import(_0xa91df5(0x21b)),_0x1cf725=0x5,_0x41cf01=await _0x474bb6(_0x35ad4d,async _0x478c10=>{const _0x579b8d=_0xa91df5;return _0x2f778f[_0x579b8d(0x233)]?.({'type':_0x579b8d(0x158),'name':_0x478c10[_0x579b8d(0x1de)]}),await _0x28ac0e[_0x579b8d(0x232)][_0x579b8d(0x239)](_0x478c10['id']),_0x2f778f[_0x579b8d(0x233)]?.({'type':_0x579b8d(0x172),'name':_0x478c10['name']}),_0x2f778f[_0x579b8d(0x22c)]?.(_0x579b8d(0x181)+_0x478c10[_0x579b8d(0x1de)]+'\x27'),0x1;},_0x1cf725);return _0x41cf01[_0xa91df5(0x21e)]((_0x34a298,_0xa09694)=>_0x34a298+_0xa09694,0x0);}export async function executePushJourneys(_0x3f93f4,_0x4ff1e6,_0x35a9ca,_0x4d90da,_0x2763bc){const _0x1b07ce=a152_0x56096e,{journeyDefToRequest:_0x246cde}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x40226a,yamlRuleToApi:_0x27caaa,validateSegmentRule:_0x24948f}=await import('./child-segment-yaml.js'),_0x4485db={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x11c996=new Map(_0x35a9ca[_0x1b07ce(0x1a0)]),_0x5036e2=0x5;for(let _0x30af83=0x0;_0x30af83<_0x4ff1e6[_0x1b07ce(0x1e8)];_0x30af83+=_0x5036e2){const _0xb4c857=_0x4ff1e6[_0x1b07ce(0x1f1)](_0x30af83,_0x30af83+_0x5036e2),_0x289568=await Promise[_0x1b07ce(0x177)](_0xb4c857[_0x1b07ce(0x1e9)](async _0x1fd749=>{const _0x4f9329=_0x1b07ce;if(!_0x1fd749[_0x4f9329(0x24c)]&&!_0x1fd749[_0x4f9329(0x15b)])return{'action':_0x4f9329(0x1d2),'name':_0x1fd749[_0x4f9329(0x240)][_0x4f9329(0x1de)],'journeyId':_0x1fd749['existingJourney']?.['id']};const _0x50c28b=_0x1fd749[_0x4f9329(0x252)]?_0x35a9ca[_0x4f9329(0x15d)][_0x4f9329(0x241)](_0x1fd749[_0x4f9329(0x252)]):undefined;_0x2763bc['onProgress']?.({'type':_0x1fd749[_0x4f9329(0x24c)]?_0x4f9329(0x223):_0x4f9329(0x217),'name':_0x1fd749[_0x4f9329(0x240)][_0x4f9329(0x1de)]});try{const _0x44940f=await executeSingleJourneyPush(_0x3f93f4,_0x1fd749,{..._0x35a9ca,'segmentNameToId':_0x11c996},{'parentId':_0x4d90da[_0x4f9329(0x199)],'rootFolderId':_0x4d90da['rootFolderId'],'folderId':_0x50c28b,'verbose':_0x4d90da[_0x4f9329(0x214)]},_0x2763bc,{'journeyDefToRequest':_0x246cde,'activationDefToCreateRequest':_0x40226a,'yamlRuleToApi':_0x27caaa,'validateSegmentRule':_0x24948f});for(const [_0x59b336,_0x1c154a]of _0x44940f['embeddedSegmentNameToId']){_0x11c996[_0x4f9329(0x19f)](_0x59b336,_0x1c154a),_0x4485db[_0x4f9329(0x1a8)][_0x4f9329(0x19f)](_0x59b336,_0x1c154a);}if(_0x44940f[_0x4f9329(0x255)]===_0x4f9329(0x236))_0x2763bc[_0x4f9329(0x233)]?.({'type':_0x4f9329(0x203),'name':_0x1fd749['yamlConfig'][_0x4f9329(0x1de)],'journeyId':_0x44940f[_0x4f9329(0x1c8)]}),_0x2763bc[_0x4f9329(0x219)]?.(_0x4f9329(0x218)+_0x1fd749[_0x4f9329(0x240)]['name']+'\x27'),_0x4485db['created']++;else _0x44940f[_0x4f9329(0x255)]===_0x4f9329(0x1f8)&&(_0x2763bc['onProgress']?.({'type':_0x4f9329(0x176),'name':_0x1fd749[_0x4f9329(0x240)][_0x4f9329(0x1de)]}),_0x2763bc['logSuccess']?.(_0x4f9329(0x1d1)+_0x1fd749[_0x4f9329(0x240)][_0x4f9329(0x1de)]+'\x27'),_0x4485db[_0x4f9329(0x1f8)]++);return{'action':_0x44940f['action'],'name':_0x1fd749[_0x4f9329(0x240)][_0x4f9329(0x1de)],'journeyId':_0x44940f[_0x4f9329(0x1c8)]};}catch(_0x170ca1){const _0x211d9d=isHttp400Error(_0x170ca1),_0x3407b0=_0x211d9d?ErrorCode[_0x4f9329(0x1a9)]:ErrorCode[_0x4f9329(0x178)],_0x310add=getErrorMessage(_0x170ca1);throw new SDKError(_0x3407b0,_0x4f9329(0x1d4)+(_0x1fd749[_0x4f9329(0x24c)]?'create':_0x4f9329(0x22d))+_0x4f9329(0x1a4)+_0x1fd749[_0x4f9329(0x18a)]+_0x4f9329(0x229)+_0x310add,_0x170ca1);}}));_0x4485db[_0x1b07ce(0x1b7)][_0x1b07ce(0x17f)](..._0x289568);}return _0x4485db;}async function matchExistingJourneySegments(_0x449a31,_0x5cfd26,_0x42c636,_0x5df482,_0x32feab){const _0x50dfb9=a152_0x56096e;if(!_0x5cfd26[_0x50dfb9(0x20a)]||!_0x5cfd26['yamlConfig'][_0x50dfb9(0x249)])return;const _0x47a5c9=new Map(),_0x3c6149=new Set();for(const _0xfeb610 of Object[_0x50dfb9(0x1f9)](_0x5cfd26[_0x50dfb9(0x240)][_0x50dfb9(0x249)])){const _0x5886ce=generateDeterministicJourneySegmentName(_0x5cfd26['yamlConfig'][_0x50dfb9(0x1de)],_0xfeb610);_0x47a5c9['set'](_0x5886ce,_0xfeb610),_0x3c6149[_0x50dfb9(0x1bc)](_0xfeb610);}const _0x5a9bde=[],_0x17f3d1=collectSegmentIdsFromJourneyApi(_0x5cfd26[_0x50dfb9(0x20a)]);for(const _0xef68b of _0x17f3d1){const _0x1bbaa2=await fetchSegment(_0x449a31,_0x42c636,_0xef68b,_0x5df482);if(!_0x1bbaa2?.[_0x50dfb9(0x1de)])continue;const _0x5b3f18=_0x47a5c9[_0x50dfb9(0x241)](_0x1bbaa2[_0x50dfb9(0x1de)]);_0x5b3f18?(_0x32feab[_0x50dfb9(0x19f)](_0x5b3f18,_0xef68b),_0x3c6149[_0x50dfb9(0x204)](_0x5b3f18)):_0x5a9bde[_0x50dfb9(0x17f)]({'id':_0xef68b,'seg':_0x1bbaa2});}if(_0x3c6149[_0x50dfb9(0x1a6)]>0x0&&_0x5a9bde['length']>0x0){const {localExpandedRuleToNames:_0xa88fab}=buildLocalExpandedRuleMappings(_0x5cfd26['yamlConfig']),_0x1f9176=new Map();for(const {id:_0x402173,seg:_0x12e0b0}of _0x5a9bde){if(_0x12e0b0[_0x50dfb9(0x1a3)]){const _0x301d6d=apiRuleToYaml(_0x12e0b0['rule']);_0x1f9176['set'](_0x402173,_0x301d6d);}}for(const {id:_0x1887d1,seg:_0xba6ea1}of _0x5a9bde){if(!_0xba6ea1[_0x50dfb9(0x1a3)])continue;const _0x48f416=_0x1f9176[_0x50dfb9(0x241)](_0x1887d1);if(!_0x48f416)continue;const _0x7cafc2=serializeExpandedRule(_0x48f416,_0x1f9176),_0x515bcc=_0xa88fab['get'](_0x7cafc2);if(_0x515bcc){const _0x4eb6ee=_0x515bcc['find'](_0x382ecb=>_0x3c6149[_0x50dfb9(0x1ac)](_0x382ecb));_0x4eb6ee&&(_0x32feab['set'](_0x4eb6ee,_0x1887d1),_0x3c6149[_0x50dfb9(0x204)](_0x4eb6ee),logger['debug']('Matched\x20server\x20segment\x20\x27'+_0xba6ea1[_0x50dfb9(0x1de)]+_0x50dfb9(0x1e6)+_0x4eb6ee+_0x50dfb9(0x220)));}}}}async function executeSingleJourneyPush(_0x10d1ec,_0x262ee4,_0x1afa1d,_0x25f9cc,_0x285907,_0x371902){const _0x23add1=a152_0x56096e,{journeyDefToRequest:_0x196eed,activationDefToCreateRequest:_0x23229a,yamlRuleToApi:_0x9b3788,validateSegmentRule:_0x555ce3}=_0x371902,_0x75566=new Map(),_0x21babe=new Map();recoverSegmentIdsFromPushRecovery(_0x262ee4,_0x75566,_0x1afa1d[_0x23add1(0x1a0)]);const _0x4fa0f8=new Map(),_0x35ebca=new Map(),_0x387954=new Map();let _0x2dd85c;const _0x4c81c4=async()=>{const _0x4bf62f=_0x23add1;if(_0x2dd85c)return;_0x2dd85c=new Map();if(!_0x262ee4[_0x4bf62f(0x20a)])return;const _0x3b2a64=await _0x10d1ec[_0x4bf62f(0x246)][_0x4bf62f(0x160)](_0x262ee4[_0x4bf62f(0x20a)]['id']);for(const _0x4ca880 of _0x3b2a64){const _0x1506f7=journeyActivationStepToYaml(_0x4ca880,_0x1afa1d[_0x4bf62f(0x254)],_0x1afa1d['connectionIdToNameMap']),_0xdaa428=activationSignature(_0x1506f7);!_0x2dd85c[_0x4bf62f(0x1ac)](_0xdaa428)&&_0x2dd85c[_0x4bf62f(0x19f)](_0xdaa428,_0x4ca880['id']),_0x1506f7['name']&&_0x21babe[_0x4bf62f(0x19f)](_0x1506f7[_0x4bf62f(0x1de)],_0x4ca880['id']);}};await matchExistingJourneySegments(_0x10d1ec,_0x262ee4,_0x25f9cc[_0x23add1(0x199)],_0x1afa1d[_0x23add1(0x228)],_0x1afa1d['segmentNameToId']);const _0xd84a60={'resolveSegmentId':async _0x7b87d1=>{const _0x2b362c=_0x23add1,_0xad5577=_0x1afa1d[_0x2b362c(0x1a0)]['get'](_0x7b87d1);if(!_0xad5577)throw new SDKError(ErrorCode[_0x2b362c(0x171)],'Segment\x20not\x20found:\x20'+_0x7b87d1+_0x2b362c(0x192)+_0x262ee4['yamlConfig'][_0x2b362c(0x1de)]+')');return _0xad5577;},'resolveEmbeddedSegmentId':async(_0x2f0d49,_0x4a69f3)=>{const _0x358c6c=_0x23add1,_0x297699=_0x1afa1d[_0x358c6c(0x1a0)]['get'](_0x2f0d49);if(_0x297699)return _0x297699;const _0x1824c=_0x1afa1d[_0x358c6c(0x228)][_0x358c6c(0x198)](_0x346bf4=>_0x346bf4['name']===_0x2f0d49);if(_0x1824c)return _0x1afa1d[_0x358c6c(0x1a0)][_0x358c6c(0x19f)](_0x2f0d49,_0x1824c['id']),_0x1824c['id'];if(_0x262ee4[_0x358c6c(0x24c)]){const {stageName:_0x4d07cd,criteriaName:_0x4daad1}=findSegmentCriteriaLocation(_0x262ee4[_0x358c6c(0x240)],_0x2f0d49);return _0x555ce3(_0x2f0d49,_0x4a69f3['rule']),_0x35ebca['set'](_0x2f0d49,{'definition':_0x4a69f3,'stageName':_0x4d07cd,'criteriaName':_0x4daad1}),createPendingSegmentId(_0x2f0d49);}const _0x55e9ed=_0x262ee4[_0x358c6c(0x20a)]?.['id'];if(!_0x55e9ed)throw new SDKError(ErrorCode[_0x358c6c(0x207)],_0x358c6c(0x222));const _0x5f060d=_0x4fa0f8[_0x358c6c(0x241)](_0x2f0d49);if(_0x5f060d)return _0x5f060d;const _0x1efbba=((async()=>{const _0x93d315=_0x358c6c;_0x555ce3(_0x2f0d49,_0x4a69f3[_0x93d315(0x1a3)]);const _0x57b640=generateDeterministicJourneySegmentName(_0x262ee4[_0x93d315(0x240)]['name'],_0x2f0d49),_0x94b28d=_0x1afa1d[_0x93d315(0x228)][_0x93d315(0x198)](_0x3cb6d8=>_0x3cb6d8[_0x93d315(0x1de)]===_0x57b640),_0x331708=createSegmentIdResolver(_0x1afa1d[_0x93d315(0x1a0)],_0x2f0d49),_0x5c7051=await resolveRuleSegmentIds(_0x4a69f3[_0x93d315(0x1a3)],_0x331708);let _0xd20b3;return _0x94b28d?(await _0x10d1ec[_0x93d315(0x232)][_0x93d315(0x15c)](_0x25f9cc[_0x93d315(0x199)],_0x94b28d['id'],{'description':_0x4a69f3['description']||_0x93d315(0x169)+_0x2f0d49,'rule':_0x9b3788(_0x5c7051,!![]),'countPopulation':!![]}),_0xd20b3=_0x94b28d['id'],saveSegmentToPushRecovery(_0x262ee4[_0x93d315(0x18a)],_0x262ee4[_0x93d315(0x240)][_0x93d315(0x1de)],_0x2f0d49,{'segmentId':_0xd20b3,'uniqueServerName':_0x57b640,'createdAt':new Date()[_0x93d315(0x16f)]()})):_0xd20b3=await createOrRecoverEmbeddedSegment(_0x10d1ec,_0x262ee4,{'localName':_0x2f0d49,'uniqueSegmentName':_0x57b640,'description':_0x4a69f3[_0x93d315(0x1c4)]||_0x93d315(0x169)+_0x2f0d49,'journeyId':_0x55e9ed,'resolvedRule':_0x5c7051,'parentId':_0x25f9cc['parentId'],'folderId':_0x25f9cc[_0x93d315(0x163)]||''},_0x9b3788),_0x1afa1d[_0x93d315(0x1a0)][_0x93d315(0x19f)](_0x2f0d49,_0xd20b3),_0x75566[_0x93d315(0x19f)](_0x2f0d49,_0xd20b3),_0xd20b3;})());_0x4fa0f8['set'](_0x2f0d49,_0x1efbba);try{return await _0x1efbba;}finally{_0x4fa0f8[_0x358c6c(0x204)](_0x2f0d49);}},'resolveActivationId':async _0x23ab61=>{const _0x16d67c=_0x23add1,_0x1ce996=_0x21babe[_0x16d67c(0x241)](_0x23ab61);if(_0x1ce996)return _0x1ce996;if(_0x262ee4[_0x16d67c(0x20a)]){await _0x4c81c4();const _0x20c808=_0x21babe[_0x16d67c(0x241)](_0x23ab61);if(_0x20c808)return _0x20c808;}throw new SDKError(ErrorCode[_0x16d67c(0x16d)],_0x16d67c(0x23c)+_0x23ab61+_0x16d67c(0x192)+_0x262ee4['yamlConfig']['name']+_0x16d67c(0x173)+_0x16d67c(0x1e5));},'resolveEmbeddedActivationId':async(_0x5b358d,_0x450dd0)=>{const _0x5671cd=_0x23add1,_0x23048f=_0x21babe[_0x5671cd(0x241)](_0x5b358d);if(_0x23048f)return _0x23048f;if(_0x262ee4['isNew'])return _0x387954['set'](_0x5b358d,_0x450dd0),createPendingActivationId(_0x5b358d);if(_0x262ee4[_0x5671cd(0x20a)]){await _0x4c81c4();const _0x49779a=_0x21babe['get'](_0x450dd0[_0x5671cd(0x1de)]);if(_0x49779a)return _0x21babe[_0x5671cd(0x19f)](_0x5b358d,_0x49779a),_0x49779a;const _0x230196=activationSignature(_0x450dd0),_0x388ef5=_0x2dd85c?.[_0x5671cd(0x241)](_0x230196);if(_0x388ef5)return _0x21babe[_0x5671cd(0x19f)](_0x5b358d,_0x388ef5),_0x388ef5;const _0x3235fb=await _0x23229a(_0x450dd0,_0x1afa1d[_0x5671cd(0x174)]),_0x29bca8={..._0x3235fb,..._0x450dd0[_0x5671cd(0x188)]!==undefined&&{'runAfterJourneyRefresh':_0x450dd0['run_after_journey_refresh']}},_0x436801=await _0x10d1ec[_0x5671cd(0x246)]['createActivation'](_0x262ee4['existingJourney']['id'],_0x29bca8);return _0x21babe[_0x5671cd(0x19f)](_0x5b358d,_0x436801['id']),_0x436801['id'];}throw new SDKError(ErrorCode[_0x5671cd(0x207)],_0x5671cd(0x1cd));},'resolveJourneyId':async _0x1545d9=>{const _0x1daa8f=_0x23add1;try{return await _0x10d1ec[_0x1daa8f(0x246)][_0x1daa8f(0x15a)](_0x25f9cc[_0x1daa8f(0x199)],_0x1545d9);}catch(_0x3e8f0c){throw new SDKError(ErrorCode[_0x1daa8f(0x16d)],_0x1daa8f(0x1db)+_0x1545d9+_0x1daa8f(0x20b)+_0x262ee4[_0x1daa8f(0x240)][_0x1daa8f(0x1de)]+'\x27)',_0x3e8f0c);}},'resolveStageId':async(_0x4ff7e2,_0x2b9656)=>{const _0xbe775b=_0x23add1,_0x5dd856=await _0x10d1ec[_0xbe775b(0x246)][_0xbe775b(0x1df)](_0x4ff7e2),_0x16edca=_0x5dd856['attributes']['journeyStages'][_0xbe775b(0x198)](_0x64870f=>_0x64870f[_0xbe775b(0x1de)]['toLowerCase']()===_0x2b9656[_0xbe775b(0x19d)]());if(!_0x16edca?.['id'])throw new SDKError(ErrorCode[_0xbe775b(0x16d)],_0xbe775b(0x1bb)+_0x2b9656+_0xbe775b(0x23b)+(_0x5dd856['attributes']['journeyBundleName']||_0x5dd856[_0xbe775b(0x243)]['name'])+'\x27');return _0x16edca['id'];}},_0x445f63=await _0x196eed(_0x262ee4[_0x23add1(0x240)],_0x25f9cc[_0x23add1(0x199)],_0xd84a60),_0xed6f7a=_0x25f9cc[_0x23add1(0x1c2)]||_0x25f9cc['rootFolderId'];_0xed6f7a&&(_0x445f63[_0x23add1(0x250)]={'parentFolder':{'data':{'id':_0xed6f7a,'type':'folder'}}});if(_0x262ee4[_0x23add1(0x24c)]){if(_0x35ebca[_0x23add1(0x1a6)]>0x0||_0x387954['size']>0x0)return await executeThreeStepJourneyCreate(_0x10d1ec,_0x262ee4,_0x445f63,{'pendingEmbeddedSegments':_0x35ebca,'pendingEmbeddedActivations':_0x387954,'embeddedSegmentNameToId':_0x75566,'journeyActivationNameToId':_0x21babe},{..._0x25f9cc,'effectiveFolderId':_0xed6f7a},_0x1afa1d,_0x285907,_0x371902);else{ensureJourneyDefaults(_0x445f63[_0x23add1(0x243)]);const _0x11781b=await _0x10d1ec[_0x23add1(0x246)]['create'](_0x445f63);return deletePushRecovery(_0x262ee4[_0x23add1(0x18a)]),{'action':_0x23add1(0x236),'journeyId':_0x11781b['id'],'embeddedSegmentNameToId':_0x75566};}}else{if(_0x262ee4[_0x23add1(0x15b)]&&_0x262ee4[_0x23add1(0x20a)]){_0x445f63['id']=_0x262ee4['existingJourney']['id'];const _0x25d2b9=_0x445f63['attributes'];_0x262ee4['existingJourney'][_0x23add1(0x243)]?.['journeyBundleName']&&(_0x25d2b9['journeyBundleName']=_0x262ee4[_0x23add1(0x20a)][_0x23add1(0x243)][_0x23add1(0x1ed)]);const _0x3e7017=_0x262ee4[_0x23add1(0x20a)][_0x23add1(0x243)]?.[_0x23add1(0x1fc)];return _0x3e7017&&_0x445f63[_0x23add1(0x243)]['journeyStages']&&injectExistingStageIds(_0x445f63[_0x23add1(0x243)][_0x23add1(0x1fc)],_0x3e7017),ensureJourneyDefaults(_0x25d2b9),await _0x10d1ec[_0x23add1(0x246)][_0x23add1(0x22d)](_0x262ee4[_0x23add1(0x20a)]['id'],_0x445f63),deletePushRecovery(_0x262ee4[_0x23add1(0x18a)]),{'action':_0x23add1(0x1f8),'journeyId':_0x262ee4[_0x23add1(0x20a)]['id'],'embeddedSegmentNameToId':_0x75566};}}return deletePushRecovery(_0x262ee4['absolutePath']),{'action':_0x23add1(0x1d2),'journeyId':_0x262ee4[_0x23add1(0x20a)]?.['id'],'embeddedSegmentNameToId':_0x75566};}function findSegmentCriteriaLocation(_0xc9ec70,_0x4a23e){const _0xc0f04a=a152_0x56096e,_0x12a4ae=_0xc9ec70['stages']||_0xc9ec70[_0xc0f04a(0x185)]?.[0x0]?.[_0xc0f04a(0x1ad)]||[];let _0x4e6ab3='entry',_0x3c5e66=_0x4a23e;const _0x47a704=_0xc9ec70[_0xc0f04a(0x205)]||_0xc9ec70[_0xc0f04a(0x185)]?.[0x0]?.['goal'];if(_0x47a704?.['segment']===_0x4a23e)return{'stageName':'goal','criteriaName':_0x47a704[_0xc0f04a(0x1de)]||_0x4a23e};_0x17aa5c:for(const _0x5a8d7b of _0x12a4ae){if(_0x5a8d7b[_0xc0f04a(0x1bf)]?.[_0xc0f04a(0x232)]===_0x4a23e){_0x4e6ab3=_0x5a8d7b['name'],_0x3c5e66=_0x5a8d7b[_0xc0f04a(0x1bf)]['name']||_0x4a23e;break;}if(_0x5a8d7b[_0xc0f04a(0x14e)])for(const _0x3174df of _0x5a8d7b[_0xc0f04a(0x14e)]){if(_0x3174df['type']===_0xc0f04a(0x235)&&_0x3174df[_0xc0f04a(0x1b6)]?.['branches'])for(const _0x5a7606 of _0x3174df[_0xc0f04a(0x1b6)][_0xc0f04a(0x1a2)]){if(_0x5a7606[_0xc0f04a(0x232)]===_0x4a23e){_0x4e6ab3=_0x5a8d7b[_0xc0f04a(0x1de)],_0x3c5e66=_0x5a7606[_0xc0f04a(0x1de)]||_0x4a23e;break _0x17aa5c;}}}}return{'stageName':_0x4e6ab3,'criteriaName':_0x3c5e66};}async function executeThreeStepJourneyCreate(_0x1adee5,_0x4b406c,_0x2a57f7,_0x44b9b7,_0x5dbc86,_0x1a8fa7,_0x1418e3,_0x2421fa){const _0x426b3b=a152_0x56096e,{activationDefToCreateRequest:_0x2ce598,yamlRuleToApi:_0x37a2f3}=_0x2421fa,{pendingEmbeddedSegments:_0x2b2585,pendingEmbeddedActivations:_0x3b6d02,embeddedSegmentNameToId:_0x1f2975}=_0x44b9b7,_0x39dcc7=JSON[_0x426b3b(0x1d5)](JSON[_0x426b3b(0x1c9)](_0x2a57f7));ensureJourneyDefaults(_0x39dcc7['attributes']),stripPendingIds(_0x39dcc7);const _0x3d7199=await _0x1adee5[_0x426b3b(0x246)]['create'](_0x39dcc7),_0x535f2b=_0x3d7199['id'],_0x2129a6=new Map();for(const _0x81becc of _0x3d7199[_0x426b3b(0x243)][_0x426b3b(0x1fc)]){_0x2129a6[_0x426b3b(0x19f)](_0x81becc[_0x426b3b(0x1de)][_0x426b3b(0x19d)](),_0x81becc['id']);}recoverSegmentIdsFromPushRecovery(_0x4b406c,_0x1f2975,_0x1a8fa7[_0x426b3b(0x1a0)]);for(const [_0x1be92d,{definition:_0x5d959d}]of _0x2b2585){if(_0x1f2975['has'](_0x1be92d)){_0x1418e3[_0x426b3b(0x233)]?.({'type':_0x426b3b(0x1eb),'journeyName':_0x4b406c[_0x426b3b(0x240)][_0x426b3b(0x1de)],'segmentName':_0x1be92d});continue;}const _0x44ba85=generateDeterministicJourneySegmentName(_0x4b406c[_0x426b3b(0x240)][_0x426b3b(0x1de)],_0x1be92d);_0x1418e3['onProgress']?.({'type':_0x426b3b(0x16a),'journeyName':_0x4b406c['yamlConfig'][_0x426b3b(0x1de)],'segmentName':_0x1be92d});const _0x12401b=createSegmentIdResolver(_0x1a8fa7[_0x426b3b(0x1a0)],_0x1be92d),_0x51c234=await resolveRuleSegmentIds(_0x5d959d['rule'],_0x12401b),_0x5b9da3=await createOrRecoverEmbeddedSegment(_0x1adee5,_0x4b406c,{'localName':_0x1be92d,'uniqueSegmentName':_0x44ba85,'description':_0x5d959d['description']||_0x426b3b(0x169)+_0x1be92d,'journeyId':_0x535f2b,'resolvedRule':_0x51c234,'parentId':_0x5dbc86[_0x426b3b(0x199)],'folderId':_0x5dbc86[_0x426b3b(0x1ef)]||''},_0x37a2f3);_0x1f2975[_0x426b3b(0x19f)](_0x1be92d,_0x5b9da3),_0x1a8fa7[_0x426b3b(0x1a0)][_0x426b3b(0x19f)](_0x1be92d,_0x5b9da3),_0x1418e3[_0x426b3b(0x233)]?.({'type':_0x426b3b(0x1eb),'journeyName':_0x4b406c[_0x426b3b(0x240)][_0x426b3b(0x1de)],'segmentName':_0x1be92d});}const _0x4e5e5c=new Map();for(const [_0x566f01,_0x5e8009]of _0x3b6d02){_0x1418e3['onProgress']?.({'type':_0x426b3b(0x1f2),'journeyName':_0x4b406c[_0x426b3b(0x240)]['name'],'activationName':_0x566f01});const _0x55bd1f=await _0x2ce598(_0x5e8009,_0x1a8fa7[_0x426b3b(0x174)]),_0x744ce9={..._0x55bd1f,..._0x5e8009[_0x426b3b(0x188)]!==undefined&&{'runAfterJourneyRefresh':_0x5e8009['run_after_journey_refresh']}},_0x9cc626=await _0x1adee5[_0x426b3b(0x246)][_0x426b3b(0x24b)](_0x535f2b,_0x744ce9);_0x4e5e5c[_0x426b3b(0x19f)](_0x566f01,_0x9cc626['id']),_0x44b9b7[_0x426b3b(0x179)]['set'](_0x566f01,_0x9cc626['id']),_0x1418e3[_0x426b3b(0x233)]?.({'type':_0x426b3b(0x211),'journeyName':_0x4b406c['yamlConfig'][_0x426b3b(0x1de)],'activationName':_0x566f01});}const _0xc5ad7f=JSON['parse'](JSON[_0x426b3b(0x1c9)](_0x2a57f7));return _0xc5ad7f['id']=_0x535f2b,ensureJourneyDefaults(_0xc5ad7f['attributes']),resolvePendingIdsInRequest(_0xc5ad7f,_0x2a57f7,_0x2129a6,_0x1f2975,_0x4e5e5c,_0x1418e3),await _0x1adee5['journey'][_0x426b3b(0x22d)](_0x535f2b,_0xc5ad7f),deletePushRecovery(_0x4b406c['absolutePath']),{'action':_0x426b3b(0x236),'journeyId':_0x535f2b,'embeddedSegmentNameToId':_0x1f2975};}export function stripWaitStepPendingIds(_0x1b48eb){const _0x263dbf=a152_0x56096e,_0x27daa2=_0x1b48eb[_0x263dbf(0x259)]&&isPendingSegmentId(_0x1b48eb['conditionSegmentId']),_0x3a1b9e=_0x1b48eb[_0x263dbf(0x16e)]?.[_0x263dbf(0x1e7)](_0x575a5c=>_0x575a5c[_0x263dbf(0x1b5)]&&isPendingSegmentId(_0x575a5c[_0x263dbf(0x1b5)]));(_0x27daa2||_0x3a1b9e)&&(_0x1b48eb[_0x263dbf(0x23f)]='Duration',_0x1b48eb[_0x263dbf(0x238)]=0x1,_0x1b48eb[_0x263dbf(0x1c5)]=_0x263dbf(0x21a),delete _0x1b48eb[_0x263dbf(0x259)],delete _0x1b48eb[_0x263dbf(0x1fd)],delete _0x1b48eb[_0x263dbf(0x1bd)],delete _0x1b48eb[_0x263dbf(0x16e)]);}export function resolveWaitStepPendingIds(_0x5a88ba,_0x54b594,_0x2605d4,_0x54b30f){const _0x5f2d22=a152_0x56096e;if(_0x54b594[_0x5f2d22(0x259)]&&isPendingSegmentId(_0x54b594[_0x5f2d22(0x259)])){const _0x3d4475=_0x2605d4(_0x54b594[_0x5f2d22(0x259)],'stage\x20\x27'+_0x54b30f+_0x5f2d22(0x1ee));_0x3d4475&&(_0x5a88ba[_0x5f2d22(0x23f)]=_0x5f2d22(0x18f),_0x5a88ba[_0x5f2d22(0x259)]=_0x3d4475,delete _0x5a88ba[_0x5f2d22(0x238)],delete _0x5a88ba[_0x5f2d22(0x1c5)],_0x54b594[_0x5f2d22(0x1fd)]!==undefined&&(_0x5a88ba[_0x5f2d22(0x1fd)]=_0x54b594[_0x5f2d22(0x1fd)]),_0x54b594[_0x5f2d22(0x1bd)]&&(_0x5a88ba[_0x5f2d22(0x1bd)]=_0x54b594[_0x5f2d22(0x1bd)]));}if(_0x54b594[_0x5f2d22(0x16e)]){const _0x820c21=_0x54b594['conditions'][_0x5f2d22(0x1e7)](_0x5a5cc1=>_0x5a5cc1[_0x5f2d22(0x1b5)]&&isPendingSegmentId(_0x5a5cc1[_0x5f2d22(0x1b5)]));if(_0x820c21){const _0x103c2d=_0x54b594['conditions'][_0x5f2d22(0x1e9)](_0x199572=>{const _0x232f4d=_0x5f2d22;if(_0x199572[_0x232f4d(0x1b5)]&&isPendingSegmentId(_0x199572[_0x232f4d(0x1b5)])){const _0x5467ff=_0x2605d4(_0x199572[_0x232f4d(0x1b5)],'stage\x20\x27'+_0x54b30f+_0x232f4d(0x1ee));return{..._0x199572,'segmentId':_0x5467ff||_0x199572[_0x232f4d(0x1b5)]};}return{..._0x199572};});_0x5a88ba[_0x5f2d22(0x23f)]='Condition',_0x5a88ba[_0x5f2d22(0x16e)]=_0x103c2d,delete _0x5a88ba[_0x5f2d22(0x238)],delete _0x5a88ba[_0x5f2d22(0x1c5)],delete _0x5a88ba[_0x5f2d22(0x259)],delete _0x5a88ba['conditionTimeoutDuration'],delete _0x5a88ba[_0x5f2d22(0x1bd)];}}}function stripPendingIds(_0x559c78){const _0x224b58=a152_0x56096e;_0x559c78[_0x224b58(0x243)][_0x224b58(0x205)]?.[_0x224b58(0x1b5)]&&isPendingSegmentId(_0x559c78['attributes'][_0x224b58(0x205)][_0x224b58(0x1b5)])&&delete _0x559c78[_0x224b58(0x243)][_0x224b58(0x205)];for(const _0x565b46 of _0x559c78['attributes']['journeyStages']||[]){_0x565b46[_0x224b58(0x197)]?.[_0x224b58(0x1b5)]&&isPendingSegmentId(_0x565b46[_0x224b58(0x197)]['segmentId'])&&delete _0x565b46['entryCriteria'];_0x565b46[_0x224b58(0x208)]?.[_0x224b58(0x1b5)]&&isPendingSegmentId(_0x565b46[_0x224b58(0x208)][_0x224b58(0x1b5)])&&delete _0x565b46['milestone'];_0x565b46[_0x224b58(0x1d3)]&&(_0x565b46['exitCriterias']=_0x565b46[_0x224b58(0x1d3)][_0x224b58(0x1e0)](_0x16378e=>!_0x16378e[_0x224b58(0x1b5)]||!isPendingSegmentId(_0x16378e['segmentId'])));if(_0x565b46[_0x224b58(0x14e)])for(const _0x5c5bb8 of Object[_0x224b58(0x1f9)](_0x565b46['steps'])){const _0x348433=_0x565b46['steps'][_0x5c5bb8];_0x348433['type']===_0x224b58(0x226)&&_0x348433['journeyActivationStepId']&&isPendingActivationId(_0x348433[_0x224b58(0x17c)])&&(_0x348433[_0x224b58(0x17c)]='');if(_0x348433['type']===_0x224b58(0x155)&&_0x348433['branches'])for(const _0x2fd6d9 of _0x348433['branches']){_0x2fd6d9[_0x224b58(0x1b5)]&&isPendingSegmentId(_0x2fd6d9[_0x224b58(0x1b5)])&&(_0x2fd6d9[_0x224b58(0x1b5)]='');}_0x348433['type']===_0x224b58(0x1f5)&&stripWaitStepPendingIds(_0x348433);}}}function a152_0x3f60(_0x4ef396,_0x358c6d){_0x4ef396=_0x4ef396-0x14d;const _0x161f7a=a152_0x161f();let _0x3f6027=_0x161f7a[_0x4ef396];return _0x3f6027;}function resolvePendingIdsInRequest(_0x3935d7,_0x43ee75,_0x13f408,_0x29a058,_0x3807c4,_0x261fb1){const _0x516579=a152_0x56096e,_0x420e19=(_0xf6e465,_0x3cbf21)=>{const _0x5ce9fb=a152_0x3f60;if(!isPendingSegmentId(_0xf6e465))return _0xf6e465;const _0x382520=extractPendingSegmentName(_0xf6e465),_0x205966=_0x29a058['get'](_0x382520);return!_0x205966&&_0x261fb1[_0x5ce9fb(0x1c1)]?.(_0x5ce9fb(0x21c)+_0x382520+_0x5ce9fb(0x1da)+_0x3cbf21),_0x205966;};if(_0x3935d7[_0x516579(0x243)][_0x516579(0x205)]?.[_0x516579(0x1b5)]&&isPendingSegmentId(_0x3935d7[_0x516579(0x243)]['goal'][_0x516579(0x1b5)])){const _0x1593a7=_0x420e19(_0x3935d7['attributes'][_0x516579(0x205)][_0x516579(0x1b5)],_0x516579(0x18d));_0x1593a7&&(_0x3935d7[_0x516579(0x243)][_0x516579(0x205)][_0x516579(0x1b5)]=_0x1593a7);}for(const _0x2e9e05 of _0x3935d7[_0x516579(0x243)][_0x516579(0x1fc)]||[]){const _0x1b363e=_0x13f408[_0x516579(0x241)](_0x2e9e05[_0x516579(0x1de)][_0x516579(0x19d)]());_0x1b363e&&(_0x2e9e05['id']=_0x1b363e);if(_0x2e9e05[_0x516579(0x197)]?.[_0x516579(0x1b5)]&&isPendingSegmentId(_0x2e9e05[_0x516579(0x197)][_0x516579(0x1b5)])){const _0x2f9537=_0x420e19(_0x2e9e05['entryCriteria'][_0x516579(0x1b5)],'stage\x20\x27'+_0x2e9e05[_0x516579(0x1de)]+_0x516579(0x1b4));_0x2f9537&&(_0x2e9e05['entryCriteria']['segmentId']=_0x2f9537);}if(_0x2e9e05['exitCriterias'])for(const _0x3436e8 of _0x2e9e05[_0x516579(0x1d3)]){if(_0x3436e8[_0x516579(0x1b5)]&&isPendingSegmentId(_0x3436e8[_0x516579(0x1b5)])){const _0x29c0ad=_0x420e19(_0x3436e8[_0x516579(0x1b5)],_0x516579(0x15f)+_0x2e9e05[_0x516579(0x1de)]+'\x27\x20exit\x20criteria');_0x29c0ad&&(_0x3436e8[_0x516579(0x1b5)]=_0x29c0ad);}}if(_0x2e9e05[_0x516579(0x208)]?.['segmentId']&&isPendingSegmentId(_0x2e9e05['milestone']['segmentId'])){const _0x5f5953=_0x420e19(_0x2e9e05['milestone'][_0x516579(0x1b5)],_0x516579(0x15f)+_0x2e9e05[_0x516579(0x1de)]+_0x516579(0x19c));_0x5f5953&&(_0x2e9e05[_0x516579(0x208)][_0x516579(0x1b5)]=_0x5f5953);}if(_0x2e9e05[_0x516579(0x14e)]){const _0x5e0f1b=_0x45c0d7=>_0x43ee75[_0x516579(0x243)]['journeyStages']?.[_0x516579(0x198)](_0x67b8bf=>_0x67b8bf[_0x516579(0x1de)][_0x516579(0x19d)]()===_0x2e9e05['name'][_0x516579(0x19d)]())?.[_0x516579(0x14e)]?.[_0x45c0d7];for(const _0xe1558d of Object[_0x516579(0x1f9)](_0x2e9e05[_0x516579(0x14e)])){const _0x301523=_0x2e9e05[_0x516579(0x14e)][_0xe1558d],_0xb2b2e4=_0x5e0f1b(_0xe1558d);if(_0x301523[_0x516579(0x21d)]==='Activation'&&_0x301523[_0x516579(0x17c)]&&(isPendingActivationId(_0x301523[_0x516579(0x17c)])||_0x301523[_0x516579(0x17c)]==='')){if(_0xb2b2e4?.[_0x516579(0x17c)]&&isPendingActivationId(_0xb2b2e4['journeyActivationStepId'])){const _0x31ba01=extractPendingActivationName(_0xb2b2e4['journeyActivationStepId']),_0x3d1f1b=_0x3807c4[_0x516579(0x241)](_0x31ba01);_0x3d1f1b&&(_0x301523['journeyActivationStepId']=_0x3d1f1b);}}if(_0x301523[_0x516579(0x21d)]===_0x516579(0x155)&&_0x301523['branches']&&_0xb2b2e4?.[_0x516579(0x1a2)])for(let _0x50f19e=0x0;_0x50f19e<_0x301523['branches']['length'];_0x50f19e++){const _0x392dc6=_0x301523[_0x516579(0x1a2)][_0x50f19e],_0x3cdf2b=_0xb2b2e4[_0x516579(0x1a2)][_0x50f19e];if(_0x3cdf2b?.[_0x516579(0x1b5)]&&isPendingSegmentId(_0x3cdf2b['segmentId'])){const _0x4b491c=_0x420e19(_0x3cdf2b['segmentId'],_0x516579(0x15f)+_0x2e9e05[_0x516579(0x1de)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x392dc6[_0x516579(0x1de)]||_0x50f19e)+'\x27');_0x4b491c&&(_0x392dc6['segmentId']=_0x4b491c);}}_0x301523['type']===_0x516579(0x1f5)&&_0xb2b2e4?.[_0x516579(0x21d)]===_0x516579(0x1f5)&&resolveWaitStepPendingIds(_0x301523,_0xb2b2e4,_0x420e19,_0x2e9e05[_0x516579(0x1de)]);}}}}
@@ -1 +1 @@
1
- (function(_0x455e32,_0x43b296){const _0x14f28d=a153_0x4de1,_0x18e041=_0x455e32();while(!![]){try{const _0x157dd7=parseInt(_0x14f28d(0xbb))/0x1*(-parseInt(_0x14f28d(0xb8))/0x2)+-parseInt(_0x14f28d(0xbf))/0x3*(parseInt(_0x14f28d(0xba))/0x4)+-parseInt(_0x14f28d(0xbe))/0x5+-parseInt(_0x14f28d(0xb9))/0x6+parseInt(_0x14f28d(0xb2))/0x7*(-parseInt(_0x14f28d(0xb5))/0x8)+parseInt(_0x14f28d(0xb6))/0x9+-parseInt(_0x14f28d(0xb4))/0xa*(-parseInt(_0x14f28d(0xbc))/0xb);if(_0x157dd7===_0x43b296)break;else _0x18e041['push'](_0x18e041['shift']());}catch(_0xf21e88){_0x18e041['push'](_0x18e041['shift']());}}}(a153_0x5ed7,0x76ec7));export function buildFolderIdToPathMap(_0x3c822c){const _0x1a56f0=a153_0x4de1,_0x1942bf=new Map(),_0x8b773d=new Map();for(const _0x352c52 of _0x3c822c){_0x8b773d[_0x1a56f0(0xb3)](_0x352c52['id'],_0x352c52);}const _0x3c0747=new Set();for(const _0x301f44 of _0x3c822c){!_0x301f44[_0x1a56f0(0xc0)]&&_0x3c0747[_0x1a56f0(0xb7)](_0x301f44['id']);}function _0x578cbf(_0xba1268){const _0x41d75d=_0x1a56f0;if(_0x1942bf[_0x41d75d(0xb1)](_0xba1268['id']))return _0x1942bf['get'](_0xba1268['id']);if(_0x3c0747[_0x41d75d(0xb1)](_0xba1268['id']))return _0x1942bf[_0x41d75d(0xb3)](_0xba1268['id'],''),'';if(_0xba1268['parentFolderId']){const _0x15b84b=_0x8b773d[_0x41d75d(0xbd)](_0xba1268['parentFolderId']);if(_0x15b84b){const _0x45f8cc=_0x578cbf(_0x15b84b),_0x4167a6=_0x45f8cc?_0x45f8cc+'/'+_0xba1268[_0x41d75d(0xb0)]:_0xba1268['name'];return _0x1942bf[_0x41d75d(0xb3)](_0xba1268['id'],_0x4167a6),_0x4167a6;}}const _0x938cd4=_0xba1268['name'];return _0x1942bf[_0x41d75d(0xb3)](_0xba1268['id'],_0x938cd4),_0x938cd4;}for(const _0x4d1371 of _0x3c822c){_0x578cbf(_0x4d1371);}return _0x1942bf;}function a153_0x5ed7(){const _0x467191=['4GfwGcg','3YiliCs','91223XkEmkV','get','3211340tERhWk','155298ELlMyz','parentFolderId','name','has','2401819IYbkCX','set','3460jYeXwa','16tFCTYl','2400795RCPGOf','add','356360nccviZ','4405284LJfcEq'];a153_0x5ed7=function(){return _0x467191;};return a153_0x5ed7();}function a153_0x4de1(_0x367f9a,_0x200e10){_0x367f9a=_0x367f9a-0xb0;const _0x5ed7b9=a153_0x5ed7();let _0x4de125=_0x5ed7b9[_0x367f9a];return _0x4de125;}export function buildFolderPathToIdMap(_0x41c279){const _0x1f94dc=a153_0x4de1,_0x522682=new Map(),_0x43e052=new Map();for(const _0x5b4547 of _0x41c279){_0x43e052['set'](_0x5b4547['id'],_0x5b4547);}const _0x2301ab=new Set();for(const _0x2f02e2 of _0x41c279){!_0x2f02e2[_0x1f94dc(0xc0)]&&_0x2301ab[_0x1f94dc(0xb7)](_0x2f02e2['id']);}function _0x2d621f(_0x1bba51){const _0x9ac49e=_0x1f94dc;if(_0x2301ab[_0x9ac49e(0xb1)](_0x1bba51['id']))return'';if(_0x1bba51[_0x9ac49e(0xc0)]){const _0x2206ed=_0x43e052[_0x9ac49e(0xbd)](_0x1bba51[_0x9ac49e(0xc0)]);if(_0x2206ed){const _0x5a70f0=_0x2d621f(_0x2206ed);return _0x5a70f0?_0x5a70f0+'/'+_0x1bba51['name']:_0x1bba51[_0x9ac49e(0xb0)];}}return _0x1bba51[_0x9ac49e(0xb0)];}for(const _0x8fb70c of _0x41c279){const _0x2510fe=_0x2d621f(_0x8fb70c);_0x522682[_0x1f94dc(0xb3)](_0x2510fe,_0x8fb70c['id']);}return _0x522682;}export function buildFolderMaps(_0x3ef273){const _0x54eabb=a153_0x4de1,_0x3d6cf6=buildFolderIdToPathMap(_0x3ef273),_0x3d5ee3=new Map();for(const [_0x23c751,_0x4ad876]of _0x3d6cf6){_0x3d5ee3[_0x54eabb(0xb3)](_0x4ad876,_0x23c751);}return{'idToPath':_0x3d6cf6,'pathToId':_0x3d5ee3};}export function getFolderPath(_0x5d0948,_0x4c5a78){if(!_0x5d0948)return'';return _0x4c5a78['get'](_0x5d0948)??'';}
1
+ (function(_0x23873d,_0x274373){const _0x538d73=a153_0x1661,_0x4890ce=_0x23873d();while(!![]){try{const _0x24fcad=-parseInt(_0x538d73(0xb1))/0x1*(-parseInt(_0x538d73(0xa4))/0x2)+-parseInt(_0x538d73(0xab))/0x3*(-parseInt(_0x538d73(0xa0))/0x4)+-parseInt(_0x538d73(0xaa))/0x5*(parseInt(_0x538d73(0x9f))/0x6)+-parseInt(_0x538d73(0xa3))/0x7*(-parseInt(_0x538d73(0xa5))/0x8)+-parseInt(_0x538d73(0xac))/0x9*(-parseInt(_0x538d73(0xad))/0xa)+parseInt(_0x538d73(0xa1))/0xb+-parseInt(_0x538d73(0xa2))/0xc*(parseInt(_0x538d73(0xa7))/0xd);if(_0x24fcad===_0x274373)break;else _0x4890ce['push'](_0x4890ce['shift']());}catch(_0x37515e){_0x4890ce['push'](_0x4890ce['shift']());}}}(a153_0x1873,0xefbc1));export function buildFolderIdToPathMap(_0x105971){const _0x3a959c=a153_0x1661,_0x262288=new Map(),_0x225e49=new Map();for(const _0x380ee3 of _0x105971){_0x225e49[_0x3a959c(0xa9)](_0x380ee3['id'],_0x380ee3);}const _0x9a29de=new Set();for(const _0x5a8b4c of _0x105971){!_0x5a8b4c[_0x3a959c(0xaf)]&&_0x9a29de['add'](_0x5a8b4c['id']);}function _0x2c30bf(_0x197e62){const _0x4f491c=_0x3a959c;if(_0x262288[_0x4f491c(0xae)](_0x197e62['id']))return _0x262288[_0x4f491c(0xa8)](_0x197e62['id']);if(_0x9a29de[_0x4f491c(0xae)](_0x197e62['id']))return _0x262288[_0x4f491c(0xa9)](_0x197e62['id'],''),'';if(_0x197e62[_0x4f491c(0xaf)]){const _0xedec1e=_0x225e49['get'](_0x197e62[_0x4f491c(0xaf)]);if(_0xedec1e){const _0x3145de=_0x2c30bf(_0xedec1e),_0x18dfb0=_0x3145de?_0x3145de+'/'+_0x197e62[_0x4f491c(0xa6)]:_0x197e62['name'];return _0x262288['set'](_0x197e62['id'],_0x18dfb0),_0x18dfb0;}}const _0x5c69ed=_0x197e62['name'];return _0x262288[_0x4f491c(0xa9)](_0x197e62['id'],_0x5c69ed),_0x5c69ed;}for(const _0x54ecf1 of _0x105971){_0x2c30bf(_0x54ecf1);}return _0x262288;}function a153_0x1873(){const _0x26faac=['has','parentFolderId','add','34KMzrzA','10031790gUalDH','91932qVtHwo','4384347cFIoUN','83364OWJAks','28KeSKMp','108378LVygIJ','2612552DsvtoW','name','2652UHmrlb','get','set','5NOSGHp','63VWHtCJ','46332SsDcXG','80gofKXH'];a153_0x1873=function(){return _0x26faac;};return a153_0x1873();}export function buildFolderPathToIdMap(_0x69ea37){const _0x2234a1=a153_0x1661,_0x114f59=new Map(),_0x281525=new Map();for(const _0x17e046 of _0x69ea37){_0x281525[_0x2234a1(0xa9)](_0x17e046['id'],_0x17e046);}const _0x51afb9=new Set();for(const _0x52b282 of _0x69ea37){!_0x52b282[_0x2234a1(0xaf)]&&_0x51afb9[_0x2234a1(0xb0)](_0x52b282['id']);}function _0x3b1e46(_0x3ecb7a){const _0x3d500b=_0x2234a1;if(_0x51afb9[_0x3d500b(0xae)](_0x3ecb7a['id']))return'';if(_0x3ecb7a['parentFolderId']){const _0x2b0fb2=_0x281525[_0x3d500b(0xa8)](_0x3ecb7a[_0x3d500b(0xaf)]);if(_0x2b0fb2){const _0x9cd958=_0x3b1e46(_0x2b0fb2);return _0x9cd958?_0x9cd958+'/'+_0x3ecb7a[_0x3d500b(0xa6)]:_0x3ecb7a[_0x3d500b(0xa6)];}}return _0x3ecb7a[_0x3d500b(0xa6)];}for(const _0x319063 of _0x69ea37){const _0x291b14=_0x3b1e46(_0x319063);_0x114f59[_0x2234a1(0xa9)](_0x291b14,_0x319063['id']);}return _0x114f59;}function a153_0x1661(_0x128c8b,_0xcfa30b){_0x128c8b=_0x128c8b-0x9f;const _0x187370=a153_0x1873();let _0x1661bf=_0x187370[_0x128c8b];return _0x1661bf;}export function buildFolderMaps(_0x552195){const _0x542579=a153_0x1661,_0x1d00a6=buildFolderIdToPathMap(_0x552195),_0x4211a8=new Map();for(const [_0x590c4e,_0x454162]of _0x1d00a6){_0x4211a8[_0x542579(0xa9)](_0x454162,_0x590c4e);}return{'idToPath':_0x1d00a6,'pathToId':_0x4211a8};}export function getFolderPath(_0x17bda3,_0x392662){const _0x28700d=a153_0x1661;if(!_0x17bda3)return'';return _0x392662[_0x28700d(0xa8)](_0x17bda3)??'';}
@@ -1 +1 @@
1
- function a154_0x193a(_0x3737ef,_0x2ae0af){_0x3737ef=_0x3737ef-0x70;const _0x5ab76b=a154_0x5ab7();let _0x193a8e=_0x5ab76b[_0x3737ef];return _0x193a8e;}(function(_0x257a5e,_0x4e5929){const _0xa55544=a154_0x193a,_0x91afa8=_0x257a5e();while(!![]){try{const _0x56c200=-parseInt(_0xa55544(0x7f))/0x1*(parseInt(_0xa55544(0x84))/0x2)+-parseInt(_0xa55544(0x8e))/0x3+parseInt(_0xa55544(0x77))/0x4+parseInt(_0xa55544(0x82))/0x5*(-parseInt(_0xa55544(0x8c))/0x6)+parseInt(_0xa55544(0x70))/0x7*(parseInt(_0xa55544(0x8b))/0x8)+parseInt(_0xa55544(0x9a))/0x9*(-parseInt(_0xa55544(0x83))/0xa)+parseInt(_0xa55544(0x72))/0xb;if(_0x56c200===_0x4e5929)break;else _0x91afa8['push'](_0x91afa8['shift']());}catch(_0x56250c){_0x91afa8['push'](_0x91afa8['shift']());}}}(a154_0x5ab7,0x5c1fc));import a154_0x4dfb95 from'path';import{parse as a154_0x5a57dd}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x5897f9){const _0x5231b8=a154_0x193a;if(!_0x5897f9||_0x5897f9['trim']()==='')throw new Error(_0x5231b8(0x8f));const _0x19251d=_0x5897f9['trim']();if(_0x19251d==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5897f9};const _0x1ae24e=_0x19251d[_0x5231b8(0x71)]('/')?_0x19251d[_0x5231b8(0x97)](0x1):_0x19251d,_0x4ddd01=_0x1ae24e[_0x5231b8(0x9d)]('/')[_0x5231b8(0x9c)](_0x37da2f=>_0x37da2f!=='');if(_0x4ddd01[_0x5231b8(0x90)]===0x0)throw new Error(_0x5231b8(0x7c));const _0x4a6d2a=_0x19251d['startsWith']('/')||!isRelativePathSegment(_0x4ddd01[0x0]);for(const _0x137ba2 of _0x4ddd01){validatePathSegment(_0x137ba2);}return{'segments':_0x4ddd01,'isAbsolute':_0x4a6d2a,'raw':_0x5897f9};}function isRelativePathSegment(_0x4e00af){return _0x4e00af==='.'||_0x4e00af==='..';}function validatePathSegment(_0x422d22){const _0x21fa75=a154_0x193a;if(_0x422d22==='')throw new Error(_0x21fa75(0x80));if(_0x422d22==='.'||_0x422d22==='..')return;if(/[\x00-\x1F\x7F]/[_0x21fa75(0x73)](_0x422d22))throw new Error(_0x21fa75(0x93)+_0x422d22);if(_0x422d22!==_0x422d22[_0x21fa75(0x78)]()){}}export function validatePath(_0xa2d723){const _0x2a7415=a154_0x193a;if(_0xa2d723[_0x2a7415(0x7e)][_0x2a7415(0x90)]===0x0&&!_0xa2d723[_0x2a7415(0x7d)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0xa2d723[_0x2a7415(0x7d)]){if(_0xa2d723[_0x2a7415(0x7e)][0x0]==='..')throw new Error(_0x2a7415(0x8a));let _0x33c74f=0x0;for(const _0x311405 of _0xa2d723[_0x2a7415(0x7e)]){if(_0x311405==='..'){if(_0x33c74f===0x0)throw new Error(_0x2a7415(0x7a));_0x33c74f--;}else _0x311405!=='.'&&_0x33c74f++;}}}export function joinPaths(_0x5a9375,_0x431acd){const _0x56a409=a154_0x193a;if(!_0x5a9375||_0x5a9375==='/')return _0x431acd;if(!_0x431acd||_0x431acd==='.')return _0x5a9375;if(_0x431acd['startsWith']('/'))return _0x431acd;const _0x167688=parsePath(_0x5a9375),_0x2b3a67=parsePath(_0x431acd),_0x149cd3=[..._0x167688[_0x56a409(0x7e)]];for(const _0x425dc6 of _0x2b3a67[_0x56a409(0x7e)]){if(_0x425dc6==='.')continue;else{if(_0x425dc6==='..'){if(_0x149cd3[_0x56a409(0x90)]===0x0)throw new Error(_0x56a409(0x81));_0x149cd3['pop']();}else _0x149cd3[_0x56a409(0x79)](_0x425dc6);}}const _0x51336e=_0x149cd3[_0x56a409(0x88)]('/');return _0x167688[_0x56a409(0x94)][_0x56a409(0x71)]('/')?'/'+_0x51336e:_0x51336e;}export function normalizePath(_0x7df32f){const _0x15c0bb=a154_0x193a,_0x47c043=parsePath(_0x7df32f),_0x28d96b=[];for(const _0x2e90f2 of _0x47c043[_0x15c0bb(0x7e)]){if(_0x2e90f2==='.')continue;else{if(_0x2e90f2==='..'){if(_0x28d96b[_0x15c0bb(0x90)]===0x0){if(_0x47c043['isAbsolute'])throw new Error('Cannot\x20navigate\x20above\x20root');_0x28d96b['push']('..');}else _0x28d96b[_0x28d96b['length']-0x1]==='..'?_0x28d96b[_0x15c0bb(0x79)]('..'):_0x28d96b[_0x15c0bb(0x9b)]();}else _0x28d96b[_0x15c0bb(0x79)](_0x2e90f2);}}if(_0x28d96b[_0x15c0bb(0x90)]===0x0)return _0x47c043[_0x15c0bb(0x7d)]?'/':'.';const _0x322220=_0x28d96b[_0x15c0bb(0x88)]('/');return _0x47c043[_0x15c0bb(0x94)][_0x15c0bb(0x71)]('/')?'/'+_0x322220:_0x322220;}export function getParentPath(_0x5e07c9){const _0x4b762b=a154_0x193a,_0x1bc197=parsePath(_0x5e07c9);if(_0x1bc197[_0x4b762b(0x7e)]['length']<=0x1)return'/';const _0x262b1c=_0x1bc197[_0x4b762b(0x7e)][_0x4b762b(0x85)](0x0,-0x1)[_0x4b762b(0x88)]('/');return _0x1bc197['raw'][_0x4b762b(0x71)]('/')?'/'+_0x262b1c:_0x262b1c;}function a154_0x5ab7(){const _0x22042b=['1056966kNXxgV','replace','1305156ZScTHz','Path\x20cannot\x20be\x20empty','length','name','File\x20not\x20found:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','raw','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','journey','substring','root','Cannot\x20split\x20empty\x20path','326493QqJjtx','pop','filter','split','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','exists','196DNfSQd','startsWith','4183553eTLnDC','test','tdx.json','relative','readFile','1948756cEUSMX','trim','push','Path\x20attempts\x20to\x20navigate\x20above\x20root','parent_segment','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','isAbsolute','segments','12406IXCmWn','Path\x20segment\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','5Omngct','10GicvMG','14mvegaZ','slice','.yaml','dirname','join','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','69760JVggLw'];a154_0x5ab7=function(){return _0x22042b;};return a154_0x5ab7();}export function getBaseName(_0x496ad8){const _0x126788=a154_0x193a,_0x17b4e4=parsePath(_0x496ad8);return _0x17b4e4[_0x126788(0x7e)][_0x17b4e4[_0x126788(0x7e)]['length']-0x1]||'';}export function isChildPath(_0x6d1c69,_0x518491){const _0x3d62a6=a154_0x193a,_0x48bcc1=parsePath(_0x6d1c69),_0x505cee=parsePath(_0x518491);if(_0x48bcc1[_0x3d62a6(0x7e)][_0x3d62a6(0x90)]<=_0x505cee[_0x3d62a6(0x7e)]['length'])return![];for(let _0x5afdd6=0x0;_0x5afdd6<_0x505cee[_0x3d62a6(0x7e)][_0x3d62a6(0x90)];_0x5afdd6++){if(_0x48bcc1[_0x3d62a6(0x7e)][_0x5afdd6]!==_0x505cee[_0x3d62a6(0x7e)][_0x5afdd6])return![];}return!![];}export function splitPath(_0x19673c){const _0x280cb8=a154_0x193a,_0xc25723=parsePath(_0x19673c);if(_0xc25723[_0x280cb8(0x7e)][_0x280cb8(0x90)]===0x0)throw new Error(_0x280cb8(0x99));if(_0xc25723[_0x280cb8(0x7e)][_0x280cb8(0x90)]===0x1)return{'parent':_0xc25723[_0x280cb8(0x7e)][0x0]};return{'parent':_0xc25723[_0x280cb8(0x7e)][0x0],'child':_0xc25723[_0x280cb8(0x7e)][_0x280cb8(0x85)](0x1)[_0x280cb8(0x88)]('/')};}export function isYamlFilePath(_0x88b868){const _0x192546=a154_0x193a;return _0x88b868['endsWith']('.yml')||_0x88b868['endsWith'](_0x192546(0x86));}export async function resolveYamlFilePath(_0x128292,_0x206bab=nodeFileSystem){const _0x2eb15a=a154_0x193a,_0x25c30e=a154_0x4dfb95['resolve'](_0x128292);if(!await _0x206bab[_0x2eb15a(0x9f)](_0x25c30e))throw new Error(_0x2eb15a(0x92)+_0x128292);let _0x2eda18=a154_0x4dfb95[_0x2eb15a(0x87)](_0x25c30e),_0x266848=null,_0x5736ae=null;const _0x568a05=a154_0x4dfb95['parse'](_0x2eda18)[_0x2eb15a(0x98)];while(_0x2eda18!==_0x568a05){const _0x302ee2=a154_0x4dfb95[_0x2eb15a(0x88)](_0x2eda18,_0x2eb15a(0x74));if(await _0x206bab['exists'](_0x302ee2)){_0x266848=_0x302ee2,_0x5736ae=_0x2eda18;break;}_0x2eda18=a154_0x4dfb95['dirname'](_0x2eda18);}if(!_0x266848||!_0x5736ae)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x128292+'\x0a'+_0x2eb15a(0x95));const _0x5eadcc=await _0x206bab[_0x2eb15a(0x76)](_0x266848),_0x3e10be=JSON['parse'](_0x5eadcc),_0x9d0b3=_0x3e10be[_0x2eb15a(0x7b)];if(!_0x9d0b3)throw new Error(_0x2eb15a(0x9e));const _0x199c17=await _0x206bab[_0x2eb15a(0x76)](_0x25c30e),_0x1f314c=a154_0x5a57dd(_0x199c17),_0x4ffceb=_0x1f314c[_0x2eb15a(0x91)];if(!_0x4ffceb)throw new Error(_0x2eb15a(0x89)+_0x128292);const _0x29632f=_0x1f314c['type']===_0x2eb15a(0x96)?_0x2eb15a(0x96):'segment',_0x3a9891=a154_0x4dfb95[_0x2eb15a(0x75)](_0x5736ae,_0x25c30e),_0x599cb0=a154_0x4dfb95[_0x2eb15a(0x87)](_0x3a9891),_0x52ac93=_0x599cb0==='.'?'':_0x599cb0[_0x2eb15a(0x8d)](/\\/g,'/'),_0x4a8b6c=_0x52ac93?_0x9d0b3+'/'+_0x52ac93+'/'+_0x4ffceb:_0x9d0b3+'/'+_0x4ffceb;return{'parentSegment':_0x9d0b3,'segmentName':_0x4ffceb,'folderPath':_0x52ac93,'fullPath':_0x4a8b6c,'resourceType':_0x29632f,'content':_0x199c17};}
1
+ (function(_0x2cbafe,_0x3e8978){const _0x11385f=a154_0x1c6d,_0xbbfb5d=_0x2cbafe();while(!![]){try{const _0x3f9d05=parseInt(_0x11385f(0xba))/0x1+-parseInt(_0x11385f(0xb3))/0x2*(parseInt(_0x11385f(0xc9))/0x3)+-parseInt(_0x11385f(0xb8))/0x4*(parseInt(_0x11385f(0xd3))/0x5)+-parseInt(_0x11385f(0xb6))/0x6+-parseInt(_0x11385f(0xcd))/0x7*(-parseInt(_0x11385f(0xc3))/0x8)+parseInt(_0x11385f(0xbf))/0x9+parseInt(_0x11385f(0xca))/0xa;if(_0x3f9d05===_0x3e8978)break;else _0xbbfb5d['push'](_0xbbfb5d['shift']());}catch(_0x1020cc){_0xbbfb5d['push'](_0xbbfb5d['shift']());}}}(a154_0x289d,0x73d89));import a154_0x44e749 from'path';function a154_0x1c6d(_0x1e5ab9,_0x2d7356){_0x1e5ab9=_0x1e5ab9-0xad;const _0x289df4=a154_0x289d();let _0x1c6d2c=_0x289df4[_0x1e5ab9];return _0x1c6d2c;}function a154_0x289d(){const _0x1837ee=['Path\x20segment\x20cannot\x20be\x20empty','filter','384447UMWmqJ','name','push','split','journey','isAbsolute','605IzZIjs','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','slice','readFile','parse','length','replace','pop','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','resolve','raw','startsWith','Cannot\x20navigate\x20above\x20root','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','segments','tdx.json','segment','2mKACEp','type','Cannot\x20split\x20empty\x20path','2100198uMLCeF','File\x20not\x20found:\x20','18992ipmeQz','Relative\x20path\x20cannot\x20be\x20empty','115856XCsLji','exists','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','Path\x20cannot\x20be\x20empty','parent_segment','7355205Tdcexn','join','endsWith','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','80DWXDLZ','relative','root','dirname','Path\x20attempts\x20to\x20navigate\x20above\x20root','trim','2413227RTKrrr','7211440alfRqn'];a154_0x289d=function(){return _0x1837ee;};return a154_0x289d();}import{parse as a154_0x3a1277}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x4154b1){const _0x243767=a154_0x1c6d;if(!_0x4154b1||_0x4154b1[_0x243767(0xc8)]()==='')throw new Error(_0x243767(0xbd));const _0x177317=_0x4154b1[_0x243767(0xc8)]();if(_0x177317==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x4154b1};const _0x2de63d=_0x177317[_0x243767(0xad)]('/')?_0x177317['substring'](0x1):_0x177317,_0x13b1e8=_0x2de63d[_0x243767(0xd0)]('/')[_0x243767(0xcc)](_0x2a128e=>_0x2a128e!=='');if(_0x13b1e8[_0x243767(0xd8)]===0x0)throw new Error(_0x243767(0xd4));const _0x4eb382=_0x177317[_0x243767(0xad)]('/')||!isRelativePathSegment(_0x13b1e8[0x0]);for(const _0x1a6258 of _0x13b1e8){validatePathSegment(_0x1a6258);}return{'segments':_0x13b1e8,'isAbsolute':_0x4eb382,'raw':_0x4154b1};}function isRelativePathSegment(_0x1cf324){return _0x1cf324==='.'||_0x1cf324==='..';}function validatePathSegment(_0x340a71){const _0x439411=a154_0x1c6d;if(_0x340a71==='')throw new Error(_0x439411(0xcb));if(_0x340a71==='.'||_0x340a71==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x340a71))throw new Error(_0x439411(0xaf)+_0x340a71);if(_0x340a71!==_0x340a71[_0x439411(0xc8)]()){}}export function validatePath(_0x15138e){const _0x1f2fa0=a154_0x1c6d;if(_0x15138e['segments']['length']===0x0&&!_0x15138e['isAbsolute'])throw new Error(_0x1f2fa0(0xb9));if(_0x15138e['isAbsolute']){if(_0x15138e[_0x1f2fa0(0xb0)][0x0]==='..')throw new Error(_0x1f2fa0(0xc2));let _0x32004e=0x0;for(const _0x57b951 of _0x15138e[_0x1f2fa0(0xb0)]){if(_0x57b951==='..'){if(_0x32004e===0x0)throw new Error(_0x1f2fa0(0xc7));_0x32004e--;}else _0x57b951!=='.'&&_0x32004e++;}}}export function joinPaths(_0xc71cc9,_0x5f003b){const _0xcbb662=a154_0x1c6d;if(!_0xc71cc9||_0xc71cc9==='/')return _0x5f003b;if(!_0x5f003b||_0x5f003b==='.')return _0xc71cc9;if(_0x5f003b[_0xcbb662(0xad)]('/'))return _0x5f003b;const _0x1dc194=parsePath(_0xc71cc9),_0x121f21=parsePath(_0x5f003b),_0x16b719=[..._0x1dc194[_0xcbb662(0xb0)]];for(const _0x28124b of _0x121f21[_0xcbb662(0xb0)]){if(_0x28124b==='.')continue;else{if(_0x28124b==='..'){if(_0x16b719[_0xcbb662(0xd8)]===0x0)throw new Error(_0xcbb662(0xae));_0x16b719[_0xcbb662(0xda)]();}else _0x16b719[_0xcbb662(0xcf)](_0x28124b);}}const _0x33580a=_0x16b719[_0xcbb662(0xc0)]('/');return _0x1dc194[_0xcbb662(0xdd)][_0xcbb662(0xad)]('/')?'/'+_0x33580a:_0x33580a;}export function normalizePath(_0x434b01){const _0x1517a6=a154_0x1c6d,_0x11200f=parsePath(_0x434b01),_0x237de6=[];for(const _0xa430a3 of _0x11200f['segments']){if(_0xa430a3==='.')continue;else{if(_0xa430a3==='..'){if(_0x237de6[_0x1517a6(0xd8)]===0x0){if(_0x11200f[_0x1517a6(0xd2)])throw new Error(_0x1517a6(0xae));_0x237de6[_0x1517a6(0xcf)]('..');}else _0x237de6[_0x237de6[_0x1517a6(0xd8)]-0x1]==='..'?_0x237de6[_0x1517a6(0xcf)]('..'):_0x237de6['pop']();}else _0x237de6[_0x1517a6(0xcf)](_0xa430a3);}}if(_0x237de6[_0x1517a6(0xd8)]===0x0)return _0x11200f['isAbsolute']?'/':'.';const _0x2f723a=_0x237de6[_0x1517a6(0xc0)]('/');return _0x11200f[_0x1517a6(0xdd)][_0x1517a6(0xad)]('/')?'/'+_0x2f723a:_0x2f723a;}export function getParentPath(_0x4b2ff8){const _0x6ab9bf=a154_0x1c6d,_0x15f14a=parsePath(_0x4b2ff8);if(_0x15f14a['segments']['length']<=0x1)return'/';const _0x2e809a=_0x15f14a[_0x6ab9bf(0xb0)][_0x6ab9bf(0xd5)](0x0,-0x1)[_0x6ab9bf(0xc0)]('/');return _0x15f14a[_0x6ab9bf(0xdd)][_0x6ab9bf(0xad)]('/')?'/'+_0x2e809a:_0x2e809a;}export function getBaseName(_0x46a367){const _0x50e124=a154_0x1c6d,_0x465d85=parsePath(_0x46a367);return _0x465d85[_0x50e124(0xb0)][_0x465d85[_0x50e124(0xb0)]['length']-0x1]||'';}export function isChildPath(_0x4f7aeb,_0x420193){const _0x5b32fe=a154_0x1c6d,_0x232d42=parsePath(_0x4f7aeb),_0x433da5=parsePath(_0x420193);if(_0x232d42[_0x5b32fe(0xb0)][_0x5b32fe(0xd8)]<=_0x433da5[_0x5b32fe(0xb0)][_0x5b32fe(0xd8)])return![];for(let _0x125a98=0x0;_0x125a98<_0x433da5['segments'][_0x5b32fe(0xd8)];_0x125a98++){if(_0x232d42['segments'][_0x125a98]!==_0x433da5[_0x5b32fe(0xb0)][_0x125a98])return![];}return!![];}export function splitPath(_0x37c575){const _0x39063f=a154_0x1c6d,_0x5617c8=parsePath(_0x37c575);if(_0x5617c8['segments'][_0x39063f(0xd8)]===0x0)throw new Error(_0x39063f(0xb5));if(_0x5617c8['segments'][_0x39063f(0xd8)]===0x1)return{'parent':_0x5617c8[_0x39063f(0xb0)][0x0]};return{'parent':_0x5617c8['segments'][0x0],'child':_0x5617c8[_0x39063f(0xb0)]['slice'](0x1)[_0x39063f(0xc0)]('/')};}export function isYamlFilePath(_0x1a90be){const _0x4cbc5e=a154_0x1c6d;return _0x1a90be['endsWith']('.yml')||_0x1a90be[_0x4cbc5e(0xc1)]('.yaml');}export async function resolveYamlFilePath(_0x76ef8d,_0x154872=nodeFileSystem){const _0x28208a=a154_0x1c6d,_0x348d79=a154_0x44e749[_0x28208a(0xdc)](_0x76ef8d);if(!await _0x154872[_0x28208a(0xbb)](_0x348d79))throw new Error(_0x28208a(0xb7)+_0x76ef8d);let _0x4cb620=a154_0x44e749[_0x28208a(0xc6)](_0x348d79),_0xfeab37=null,_0x52cda3=null;const _0x2a3b59=a154_0x44e749[_0x28208a(0xd7)](_0x4cb620)[_0x28208a(0xc5)];while(_0x4cb620!==_0x2a3b59){const _0x27732b=a154_0x44e749['join'](_0x4cb620,_0x28208a(0xb1));if(await _0x154872[_0x28208a(0xbb)](_0x27732b)){_0xfeab37=_0x27732b,_0x52cda3=_0x4cb620;break;}_0x4cb620=a154_0x44e749[_0x28208a(0xc6)](_0x4cb620);}if(!_0xfeab37||!_0x52cda3)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x76ef8d+'\x0a'+_0x28208a(0xbc));const _0x4ea886=await _0x154872[_0x28208a(0xd6)](_0xfeab37),_0xfd4895=JSON['parse'](_0x4ea886),_0x1de21c=_0xfd4895[_0x28208a(0xbe)];if(!_0x1de21c)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x2c6a9a=await _0x154872[_0x28208a(0xd6)](_0x348d79),_0xf4cef5=a154_0x3a1277(_0x2c6a9a),_0x3ea410=_0xf4cef5[_0x28208a(0xce)];if(!_0x3ea410)throw new Error(_0x28208a(0xdb)+_0x76ef8d);const _0x1324f6=_0xf4cef5[_0x28208a(0xb4)]===_0x28208a(0xd1)?_0x28208a(0xd1):_0x28208a(0xb2),_0x113744=a154_0x44e749[_0x28208a(0xc4)](_0x52cda3,_0x348d79),_0x351856=a154_0x44e749[_0x28208a(0xc6)](_0x113744),_0x3bab50=_0x351856==='.'?'':_0x351856[_0x28208a(0xd9)](/\\/g,'/'),_0x5b754f=_0x3bab50?_0x1de21c+'/'+_0x3bab50+'/'+_0x3ea410:_0x1de21c+'/'+_0x3ea410;return{'parentSegment':_0x1de21c,'segmentName':_0x3ea410,'folderPath':_0x3bab50,'fullPath':_0x5b754f,'resourceType':_0x1324f6,'content':_0x2c6a9a};}
@@ -1 +1 @@
1
- (function(_0x33c70c,_0x53afe1){const _0xc00b92=a155_0x22c9,_0x1cd86f=_0x33c70c();while(!![]){try{const _0x49c083=-parseInt(_0xc00b92(0x179))/0x1*(-parseInt(_0xc00b92(0x180))/0x2)+-parseInt(_0xc00b92(0x177))/0x3+-parseInt(_0xc00b92(0x17f))/0x4*(parseInt(_0xc00b92(0x17d))/0x5)+parseInt(_0xc00b92(0x176))/0x6*(parseInt(_0xc00b92(0x178))/0x7)+-parseInt(_0xc00b92(0x17b))/0x8+-parseInt(_0xc00b92(0x174))/0x9+-parseInt(_0xc00b92(0x173))/0xa*(-parseInt(_0xc00b92(0x17a))/0xb);if(_0x49c083===_0x53afe1)break;else _0x1cd86f['push'](_0x1cd86f['shift']());}catch(_0x4a2e46){_0x1cd86f['push'](_0x1cd86f['shift']());}}}(a155_0x46a8,0x40342));function a155_0x46a8(){const _0x336796=['substring','70beqzzj','.\x20Parent\x20name\x20cannot\x20be\x20empty','111436BqHxPE','30loSHlH','13775290gMyyHV','4429836AkWpTn','Invalid\x20segment\x20reference\x20format:\x20','198MvNsjO','1565385dHhgfN','52255diGzql','30699eQkKql','11ZlybEK','3338848ySIpjD'];a155_0x46a8=function(){return _0x336796;};return a155_0x46a8();}function a155_0x22c9(_0x36828d,_0x3d77a0){_0x36828d=_0x36828d-0x173;const _0x46a8b9=a155_0x46a8();let _0x22c9f9=_0x46a8b9[_0x36828d];return _0x22c9f9;}export function parseSegmentRef(_0x5e59a0){const _0x39218f=a155_0x22c9,_0x325cdf=_0x5e59a0['indexOf']('/');if(_0x325cdf===-0x1)return{'parentId':_0x5e59a0};if(_0x325cdf===0x0)throw new Error(_0x39218f(0x175)+_0x5e59a0+_0x39218f(0x17e));const _0xf4a4fe=_0x5e59a0[_0x39218f(0x17c)](0x0,_0x325cdf),_0x3b5386=_0x5e59a0['substring'](_0x325cdf+0x1);if(_0x3b5386==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x5e59a0+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0xf4a4fe,'childId':_0x3b5386};}
1
+ (function(_0x323e14,_0x54ee37){const _0x4b13cc=a155_0x39a2,_0x4f8275=_0x323e14();while(!![]){try{const _0xd52629=-parseInt(_0x4b13cc(0xbc))/0x1*(parseInt(_0x4b13cc(0xbe))/0x2)+-parseInt(_0x4b13cc(0xc8))/0x3+parseInt(_0x4b13cc(0xc4))/0x4*(parseInt(_0x4b13cc(0xc5))/0x5)+-parseInt(_0x4b13cc(0xbf))/0x6+parseInt(_0x4b13cc(0xc7))/0x7*(parseInt(_0x4b13cc(0xc2))/0x8)+parseInt(_0x4b13cc(0xc1))/0x9+parseInt(_0x4b13cc(0xc6))/0xa;if(_0xd52629===_0x54ee37)break;else _0x4f8275['push'](_0x4f8275['shift']());}catch(_0xf49fa8){_0x4f8275['push'](_0x4f8275['shift']());}}}(a155_0x3d14,0xb2e0b));function a155_0x3d14(){const _0x4d4364=['substring','17700WhJGhR','760wiuXbZ','11612530nxbLpb','3318686ZFGlQD','4163901GnEfZg','1gBPwOs','indexOf','2566518CSiUoU','2965320BqzGiO','Invalid\x20segment\x20reference\x20format:\x20','5777838VyzhXV','24bbKoFg'];a155_0x3d14=function(){return _0x4d4364;};return a155_0x3d14();}function a155_0x39a2(_0x554454,_0x5027a3){_0x554454=_0x554454-0xbc;const _0x3d140a=a155_0x3d14();let _0x39a29e=_0x3d140a[_0x554454];return _0x39a29e;}export function parseSegmentRef(_0x7dcfd7){const _0x57d5a0=a155_0x39a2,_0x58fe63=_0x7dcfd7[_0x57d5a0(0xbd)]('/');if(_0x58fe63===-0x1)return{'parentId':_0x7dcfd7};if(_0x58fe63===0x0)throw new Error(_0x57d5a0(0xc0)+_0x7dcfd7+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0xbe9661=_0x7dcfd7[_0x57d5a0(0xc3)](0x0,_0x58fe63),_0x54c8b8=_0x7dcfd7['substring'](_0x58fe63+0x1);if(_0x54c8b8==='')throw new Error(_0x57d5a0(0xc0)+_0x7dcfd7+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0xbe9661,'childId':_0x54c8b8};}