@treasuredata/tdx 2026.6.1 → 2026.6.3

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 (241) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-command.js.map +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-pull-command.js +1 -1
  46. package/dist/commands/segment-push-command.js +1 -1
  47. package/dist/commands/segment-update-command.js +1 -1
  48. package/dist/commands/segment-use-command.js +1 -1
  49. package/dist/commands/segment-validate-command.js +1 -1
  50. package/dist/commands/segments.js +1 -1
  51. package/dist/commands/show.js +1 -1
  52. package/dist/commands/status-command.js +1 -1
  53. package/dist/commands/table-deleted.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/work-command.js +1 -1
  60. package/dist/commands/workflow-command.d.ts +2 -2
  61. package/dist/commands/workflow-command.d.ts.map +1 -1
  62. package/dist/commands/workflow-command.js +1 -1
  63. package/dist/commands/workflow-command.js.map +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/command-output.js +1 -1
  66. package/dist/core/config.js +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/tools/work-create-item.js +1 -1
  85. package/dist/mcp/utils.js +1 -1
  86. package/dist/proxy/claude-usage-tracker.js +1 -1
  87. package/dist/proxy/passthrough-server.js +1 -1
  88. package/dist/proxy/sse-usage-parser.js +1 -1
  89. package/dist/sdk/agent/agent-config.js +1 -1
  90. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  91. package/dist/sdk/agent/agent-yaml.js +1 -1
  92. package/dist/sdk/agent/test/evaluator.js +1 -1
  93. package/dist/sdk/agent/test/executor.js +1 -1
  94. package/dist/sdk/agent/test/index.js +1 -1
  95. package/dist/sdk/agent/test/output.js +1 -1
  96. package/dist/sdk/agent/test/parser.js +1 -1
  97. package/dist/sdk/agent/tool-target-registry.js +1 -1
  98. package/dist/sdk/api.js +1 -1
  99. package/dist/sdk/cas/cas-api-client.js +1 -1
  100. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  101. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  102. package/dist/sdk/cas/index.js +1 -1
  103. package/dist/sdk/cas/pull-workflow.js +1 -1
  104. package/dist/sdk/cas/push-workflow.js +1 -1
  105. package/dist/sdk/client/cdp-api-client.js +1 -1
  106. package/dist/sdk/client/delivery-api-client.js +1 -1
  107. package/dist/sdk/client/endpoints.js +1 -1
  108. package/dist/sdk/client/engage-api-client.js +1 -1
  109. package/dist/sdk/client/http-client.js +1 -1
  110. package/dist/sdk/client/llm-api-client.js +1 -1
  111. package/dist/sdk/client/oauth-refresh.js +1 -1
  112. package/dist/sdk/client/rate-limiter.js +1 -1
  113. package/dist/sdk/client/td-api-client.js +1 -1
  114. package/dist/sdk/client/trino-api-client.js +1 -1
  115. package/dist/sdk/client/workflow-client.d.ts +23 -1
  116. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  117. package/dist/sdk/client/workflow-client.js +1 -1
  118. package/dist/sdk/client/workflow-client.js.map +1 -1
  119. package/dist/sdk/connection-validator.js +1 -1
  120. package/dist/sdk/connection.js +1 -1
  121. package/dist/sdk/delivery.js +1 -1
  122. package/dist/sdk/engage/campaign-pull.js +1 -1
  123. package/dist/sdk/engage/campaign-push.js +1 -1
  124. package/dist/sdk/engage/campaign-validator.js +1 -1
  125. package/dist/sdk/engage/campaign-yaml.js +1 -1
  126. package/dist/sdk/engage/template-pull.js +1 -1
  127. package/dist/sdk/engage/template-push.js +1 -1
  128. package/dist/sdk/engage/template-validator.js +1 -1
  129. package/dist/sdk/engage/template-yaml.js +1 -1
  130. package/dist/sdk/engage/types/campaign-def.js +1 -1
  131. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  132. package/dist/sdk/engage/types/template-schema.js +1 -1
  133. package/dist/sdk/engage.js +1 -1
  134. package/dist/sdk/errors.js +1 -1
  135. package/dist/sdk/index.js +1 -1
  136. package/dist/sdk/io/index.js +1 -1
  137. package/dist/sdk/io/node-filesystem.js +1 -1
  138. package/dist/sdk/job.js +1 -1
  139. package/dist/sdk/journey.js +1 -1
  140. package/dist/sdk/llm/chat-cache.js +1 -1
  141. package/dist/sdk/llm/index.js +1 -1
  142. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  143. package/dist/sdk/llm/model-factors.js +1 -1
  144. package/dist/sdk/llm/user-settings.js +1 -1
  145. package/dist/sdk/personalization.js +1 -1
  146. package/dist/sdk/policy.js +1 -1
  147. package/dist/sdk/query/deleted-table-validation.js +1 -1
  148. package/dist/sdk/query/index.js +1 -1
  149. package/dist/sdk/query/sql-parser.js +1 -1
  150. package/dist/sdk/realtime.js +1 -1
  151. package/dist/sdk/schedule.js +1 -1
  152. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  153. package/dist/sdk/segment/fields-display.js +1 -1
  154. package/dist/sdk/segment/file-discovery.js +1 -1
  155. package/dist/sdk/segment/journey-utils.js +1 -1
  156. package/dist/sdk/segment/journey-validator.js +1 -1
  157. package/dist/sdk/segment/journey-yaml.js +1 -1
  158. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  159. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  160. package/dist/sdk/segment/pull-workflow.js +1 -1
  161. package/dist/sdk/segment/push-recovery.js +1 -1
  162. package/dist/sdk/segment/push-workflow.js +1 -1
  163. package/dist/sdk/segment/resolution-context.js +1 -1
  164. package/dist/sdk/segment/segment-path-parser.js +1 -1
  165. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  166. package/dist/sdk/segment/segment-validator.js +1 -1
  167. package/dist/sdk/segment/target-resolution.js +1 -1
  168. package/dist/sdk/segment/tdx-config.js +1 -1
  169. package/dist/sdk/segment/types/activation-schema.js +1 -1
  170. package/dist/sdk/segment/types/journey-def.js +1 -1
  171. package/dist/sdk/segment/types/journey-schema.js +1 -1
  172. package/dist/sdk/segment/types/segment-def.js +1 -1
  173. package/dist/sdk/segment/types/segment-schema.js +1 -1
  174. package/dist/sdk/segment/validate-files.js +1 -1
  175. package/dist/sdk/segment/yaml-validator.js +1 -1
  176. package/dist/sdk/segment.js +1 -1
  177. package/dist/sdk/types/index.js +1 -1
  178. package/dist/sdk/types/progress.js +1 -1
  179. package/dist/sdk/types/workflow.d.ts +1 -1
  180. package/dist/sdk/types/workflow.d.ts.map +1 -1
  181. package/dist/sdk/types/workspace.js +1 -1
  182. package/dist/sdk/user.js +1 -1
  183. package/dist/sdk/util/format-detector.js +1 -1
  184. package/dist/sdk/util/formatters.js +1 -1
  185. package/dist/sdk/util/index.js +1 -1
  186. package/dist/sdk/util/paginate.js +1 -1
  187. package/dist/sdk/util/tree-formatter.js +1 -1
  188. package/dist/sdk/workflow/archive-validation.js +1 -1
  189. package/dist/sdk/workflow/clone-workflow.js +1 -1
  190. package/dist/sdk/workflow/index.d.ts +23 -2
  191. package/dist/sdk/workflow/index.d.ts.map +1 -1
  192. package/dist/sdk/workflow/index.js +1 -1
  193. package/dist/sdk/workflow/index.js.map +1 -1
  194. package/dist/sdk/workflow/pull-workflow.js +1 -1
  195. package/dist/sdk/workflow/push-workflow.d.ts +4 -0
  196. package/dist/sdk/workflow/push-workflow.d.ts.map +1 -1
  197. package/dist/sdk/workflow/push-workflow.js +1 -1
  198. package/dist/sdk/workflow/push-workflow.js.map +1 -1
  199. package/dist/sdk/workflow/task-graph.js +1 -1
  200. package/dist/sdk/workflow/tdx-config.js +1 -1
  201. package/dist/sdk/workflow/workflow-utils.js +1 -1
  202. package/dist/sdk/workspace/access-tracker.js +1 -1
  203. package/dist/sdk/workspace/frontmatter.js +1 -1
  204. package/dist/sdk/workspace/git.js +1 -1
  205. package/dist/sdk/workspace/index.js +1 -1
  206. package/dist/sdk/workspace/templates.js +1 -1
  207. package/dist/sdk/workspace/weekly.js +1 -1
  208. package/dist/sdk/workspace/wikilinks.js +1 -1
  209. package/dist/test-utils/command-runner.js +1 -1
  210. package/dist/test-utils/factories.js +1 -1
  211. package/dist/test-utils/fixtures.js +1 -1
  212. package/dist/test-utils/http-mock.js +1 -1
  213. package/dist/test-utils/index.js +1 -1
  214. package/dist/utils/async.js +1 -1
  215. package/dist/utils/colors.js +1 -1
  216. package/dist/utils/diff.js +1 -1
  217. package/dist/utils/file-permissions.js +1 -1
  218. package/dist/utils/file-reader.js +1 -1
  219. package/dist/utils/github-releases.js +1 -1
  220. package/dist/utils/global-cache.js +1 -1
  221. package/dist/utils/json-loader.js +1 -1
  222. package/dist/utils/local-cache.js +1 -1
  223. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  224. package/dist/utils/logger/formatters/index.js +1 -1
  225. package/dist/utils/logger/handlers/console-handler.js +1 -1
  226. package/dist/utils/logger/handlers/file-handler.js +1 -1
  227. package/dist/utils/logger/handlers/index.js +1 -1
  228. package/dist/utils/logger/handlers/null-handler.js +1 -1
  229. package/dist/utils/logger/index.js +1 -1
  230. package/dist/utils/logger/logger.js +1 -1
  231. package/dist/utils/logger/types.js +1 -1
  232. package/dist/utils/option-validation.js +1 -1
  233. package/dist/utils/process.js +1 -1
  234. package/dist/utils/prompt.js +1 -1
  235. package/dist/utils/spinner.js +1 -1
  236. package/dist/utils/sse-parser.js +1 -1
  237. package/dist/utils/string-utils.js +1 -1
  238. package/dist/utils/table-ref-parser.js +1 -1
  239. package/dist/utils/tdx-logger.js +1 -1
  240. package/dist/utils/version-check.js +1 -1
  241. package/package.json +1 -1
@@ -1 +1 @@
1
- const a155_0x3e8afc=a155_0x4ade;(function(_0x45304d,_0x1874d4){const _0x3b7323=a155_0x4ade,_0x58f268=_0x45304d();while(!![]){try{const _0x4438e6=parseInt(_0x3b7323(0x158))/0x1*(parseInt(_0x3b7323(0x143))/0x2)+-parseInt(_0x3b7323(0x18d))/0x3+parseInt(_0x3b7323(0x197))/0x4*(-parseInt(_0x3b7323(0x1e5))/0x5)+parseInt(_0x3b7323(0x149))/0x6*(parseInt(_0x3b7323(0x14f))/0x7)+parseInt(_0x3b7323(0x1cb))/0x8*(-parseInt(_0x3b7323(0x1a3))/0x9)+-parseInt(_0x3b7323(0x228))/0xa*(-parseInt(_0x3b7323(0x161))/0xb)+parseInt(_0x3b7323(0x1c3))/0xc*(-parseInt(_0x3b7323(0x178))/0xd);if(_0x4438e6===_0x1874d4)break;else _0x58f268['push'](_0x58f268['shift']());}catch(_0x4680a8){_0x58f268['push'](_0x58f268['shift']());}}}(a155_0x3ac6,0x3a503));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a155_0x3e8afc(0x211));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a155_0x3e8afc(0x1ad);export function createPendingSegmentId(_0x5d9d86){return''+PENDING_SEGMENT_PREFIX+_0x5d9d86+'__';}export function isPendingSegmentId(_0x379c86){const _0x1c598a=a155_0x3e8afc;return _0x379c86['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x379c86[_0x1c598a(0x238)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x114a00){const _0x493668=a155_0x3e8afc;return _0x114a00[_0x493668(0x199)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x57709f){return''+PENDING_ACTIVATION_PREFIX+_0x57709f+'__';}export function isPendingActivationId(_0x37e375){return _0x37e375['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x111bfb){return _0x111bfb['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x575a81,_0x1e8c63){const _0x323385=a155_0x3e8afc,_0x2b45a2=_0x575a81+'::'+(_0x1e8c63[_0x323385(0x23d)]()||_0x323385(0x1cf)),_0x708fde=createHash(_0x323385(0x200))[_0x323385(0x206)](_0x2b45a2)['digest'](_0x323385(0x1a1))[_0x323385(0x195)](0x0,0xc);return _0x323385(0x14d)+_0x708fde;}export function ensureJourneyDefaults(_0x316b01){const _0x1764bd=a155_0x3e8afc;!_0x316b01[_0x1764bd(0x214)]&&(_0x316b01['description']=''),!_0x316b01['state']&&(_0x316b01['state']=_0x1764bd(0x18b));}export function injectExistingStageIds(_0x19ae9e,_0x51cdf6){const _0x28e2b1=a155_0x3e8afc,_0x81d7c7=new Map(_0x51cdf6[_0x28e2b1(0x1ef)](_0x50458f=>[_0x50458f[_0x28e2b1(0x1ea)],_0x50458f['id']]));for(const _0x45a01c of _0x19ae9e){if(!_0x45a01c['id']){const _0x3af461=_0x81d7c7[_0x28e2b1(0x1bd)](_0x45a01c[_0x28e2b1(0x1ea)]);_0x3af461&&(_0x45a01c['id']=_0x3af461);}}}export function resolveTDFolderPath(_0x5d861c,_0x148959,_0x45b650){const _0xa8e920=a155_0x3e8afc;if(!_0x148959)return _0x5d861c;if(_0x5d861c===_0x45b650||_0x5d861c[_0xa8e920(0x238)](_0x45b650+'/'))return _0x5d861c;return _0x5d861c?_0x45b650+'/'+_0x5d861c:_0x45b650;}export function addFoldersToCreate(_0x3f6ef8,_0x4ec148,_0x3e95e2){const _0x4fa041=a155_0x3e8afc;if(!_0x3f6ef8)return;if(_0x4ec148[_0x4fa041(0x1c9)](_0x3f6ef8))return;const _0x26d32e=_0x3f6ef8['split']('/');let _0x2fe9a2='';for(const _0x45dff4 of _0x26d32e){_0x2fe9a2=_0x2fe9a2?_0x2fe9a2+'/'+_0x45dff4:_0x45dff4,!_0x4ec148['has'](_0x2fe9a2)&&_0x3e95e2['add'](_0x2fe9a2);}}export function sortFoldersByDepth(_0xf8e381){return[..._0xf8e381]['sort']((_0x3a6657,_0x568c9e)=>{const _0x2778f9=a155_0x4ade,_0x5867fd=(_0x3a6657[_0x2778f9(0x236)](/\//g)||[])['length'],_0x37ec8e=(_0x568c9e['match'](/\//g)||[])[_0x2778f9(0x140)];return _0x5867fd-_0x37ec8e;});}import*as a155_0x3e9382 from'yaml';import{readFileSync}from'fs';import a155_0x405b9f from'path';import{isJourneyDef,parseYamlString as a155_0x273a5a,toYamlString as a155_0xf7453a,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';function a155_0x4ade(_0x389954,_0x476ccf){_0x389954=_0x389954-0x13d;const _0x3ac689=a155_0x3ac6();let _0x4ade46=_0x3ac689[_0x389954];return _0x4ade46;}import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x398e05){const _0x53a42b=a155_0x3e8afc;if(Array[_0x53a42b(0x21e)](_0x398e05))return'['+_0x398e05[_0x53a42b(0x1ef)](_0x4f5a26=>stableStringify(_0x4f5a26))[_0x53a42b(0x23a)](',')+']';if(_0x398e05&&typeof _0x398e05===_0x53a42b(0x1e0)){const _0x89d658=_0x398e05,_0x225469=Object[_0x53a42b(0x1f0)](_0x89d658)[_0x53a42b(0x180)](),_0x62cbed=_0x225469[_0x53a42b(0x1ef)](_0x555616=>'\x22'+_0x555616+'\x22:'+stableStringify(_0x89d658[_0x555616]));return'{'+_0x62cbed[_0x53a42b(0x23a)](',')+'}';}const _0x5719c8=JSON[_0x53a42b(0x22e)](_0x398e05);return _0x5719c8===undefined?_0x53a42b(0x153):_0x5719c8;}function activationSignature(_0x2a2c9f){const _0x262714=a155_0x3e8afc,_0x577d11={'connection':_0x2a2c9f[_0x262714(0x1d1)],..._0x2a2c9f[_0x262714(0x1b9)]!==undefined&&{'all_columns':_0x2a2c9f[_0x262714(0x1b9)]},..._0x2a2c9f[_0x262714(0x203)]!==undefined&&{'columns':_0x2a2c9f[_0x262714(0x203)]},..._0x2a2c9f[_0x262714(0x1da)]!==undefined&&{'behavior':_0x2a2c9f[_0x262714(0x1da)]},..._0x2a2c9f[_0x262714(0x1e6)]!==undefined&&{'schedule':_0x2a2c9f[_0x262714(0x1e6)]},..._0x2a2c9f['notification']!==undefined&&{'notification':_0x2a2c9f[_0x262714(0x1bc)]},..._0x2a2c9f[_0x262714(0x1f6)]!==undefined&&{'connector_config':_0x2a2c9f[_0x262714(0x1f6)]},..._0x2a2c9f['activation_template_id']!==undefined&&{'activation_template_id':_0x2a2c9f[_0x262714(0x172)]}};return stableStringify(_0x577d11);}async function fetchSegment(_0x20c2fa,_0x8fcdb4,_0x3aeebd,_0x17f31d){const _0x4f5ec1=a155_0x3e8afc,_0x4f0520=_0x17f31d?.[_0x4f5ec1(0x1d4)](_0x2483c6=>_0x2483c6['id']===_0x3aeebd);if(_0x4f0520)return _0x4f0520;try{return await _0x20c2fa[_0x4f5ec1(0x1cf)][_0x4f5ec1(0x188)](_0x8fcdb4,_0x3aeebd);}catch(_0x5d6f00){logger[_0x4f5ec1(0x22b)](_0x4f5ec1(0x1a7)+_0x3aeebd+_0x4f5ec1(0x1f2)+_0x5d6f00);try{return await _0x20c2fa[_0x4f5ec1(0x1cf)][_0x4f5ec1(0x18a)](_0x3aeebd);}catch(_0x4bad8e){return logger[_0x4f5ec1(0x22b)](_0x4f5ec1(0x1b0)+_0x3aeebd+':\x20'+_0x4bad8e),null;}}}function recoverSegmentIdsFromPushRecovery(_0x5cbf6d,_0x59c17a,_0x983c03){const _0x5c6cca=a155_0x3e8afc,_0x3237d0=readPushRecovery(_0x5cbf6d[_0x5c6cca(0x1fd)]);if(_0x3237d0?.[_0x5c6cca(0x16b)]===_0x5cbf6d[_0x5c6cca(0x1d8)][_0x5c6cca(0x1ea)])for(const [_0xf6979b,_0xf19dea]of Object[_0x5c6cca(0x1a6)](_0x3237d0[_0x5c6cca(0x156)])){const _0x4573d0=generateDeterministicJourneySegmentName(_0x5cbf6d[_0x5c6cca(0x1d8)][_0x5c6cca(0x1ea)],_0xf6979b);_0xf19dea['uniqueServerName']===_0x4573d0&&(_0x59c17a[_0x5c6cca(0x226)](_0xf6979b,_0xf19dea[_0x5c6cca(0x1a0)]),_0x983c03[_0x5c6cca(0x226)](_0xf6979b,_0xf19dea[_0x5c6cca(0x1a0)]));}}async function createOrRecoverEmbeddedSegment(_0x58ebed,_0x50e9c4,_0x62049b,_0x9d9cd7){const _0x109522=a155_0x3e8afc;let _0x53bee8;try{_0x53bee8=await _0x58ebed[_0x109522(0x1cf)][_0x109522(0x230)]({'name':_0x62049b['uniqueSegmentName'],'description':_0x62049b['description'],'journeyId':_0x62049b[_0x109522(0x181)],'rule':_0x9d9cd7(_0x62049b[_0x109522(0x224)],!![]),'countPopulation':!![],'parentFolderId':_0x62049b[_0x109522(0x1cd)],'audienceId':_0x62049b[_0x109522(0x212)]});}catch(_0x1d4c93){const _0xd01470=_0x1d4c93 instanceof Error&&_0x1d4c93['message'][_0x109522(0x15a)](_0x109522(0x233));if(_0xd01470){const _0x700b03=readPushRecovery(_0x50e9c4[_0x109522(0x1fd)]),_0x4f1939=_0x700b03?.[_0x109522(0x16b)]===_0x50e9c4[_0x109522(0x1d8)][_0x109522(0x1ea)]?_0x700b03[_0x109522(0x156)][_0x62049b[_0x109522(0x1f8)]]:undefined;if(_0x4f1939?.[_0x109522(0x194)]===_0x62049b[_0x109522(0x240)])await _0x58ebed[_0x109522(0x1cf)]['updateSegmentById'](_0x62049b[_0x109522(0x212)],_0x4f1939['segmentId'],{'description':_0x62049b[_0x109522(0x214)],'rule':_0x9d9cd7(_0x62049b[_0x109522(0x224)],!![]),'countPopulation':!![]}),_0x53bee8=_0x4f1939[_0x109522(0x1a0)];else throw new SDKError(ErrorCode[_0x109522(0x14b)],'Embedded\x20segment\x20\x27'+_0x62049b[_0x109522(0x1f8)]+_0x109522(0x1fe)+(_0x109522(0x229)+_0x50e9c4[_0x109522(0x1fd)][_0x109522(0x199)](/([^/]+)$/,_0x109522(0x227))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x1d4c93);}else throw _0x1d4c93;}return saveSegmentToPushRecovery(_0x50e9c4[_0x109522(0x1fd)],_0x50e9c4[_0x109522(0x1d8)][_0x109522(0x1ea)],_0x62049b[_0x109522(0x1f8)],{'segmentId':_0x53bee8,'uniqueServerName':_0x62049b[_0x109522(0x240)],'createdAt':new Date()['toISOString']()}),_0x53bee8;}export async function prepareSegmentFiles(_0x4f3a9e,_0x122d40,_0x2b9b6d,_0xc1fea,_0x472c8e){const _0x58afb9=a155_0x3e8afc,{activationDefToCreateRequest:_0x52deba}=await import('./child-segment-yaml.js'),_0x3b9b62=[],_0x21b15e=new Set();for(const {yamlConfig:_0x4a8c4c,folderPath:_0xe939c4,sourcePath:_0x2436d9}of _0x4f3a9e){const _0x51cf27=resolveTDFolderPath(_0xe939c4,_0xc1fea,_0x472c8e),_0x5ac887=_0x51cf27+':'+_0x4a8c4c[_0x58afb9(0x1ea)],_0x38fd67=_0x122d40[_0x58afb9(0x14c)]['get'](_0x5ac887),_0x353236=_0x38fd67?_0x122d40['activationsBySegmentId'][_0x58afb9(0x1bd)](_0x38fd67['id'])||[]:[];addFoldersToCreate(_0x51cf27,_0x122d40['folderPathToId'],_0x21b15e);const _0x16a588=calculateActivationActions(_0x4a8c4c['activations']||[],_0x353236,_0x122d40[_0x58afb9(0x1f7)],_0x122d40['connectionIdToNameMap']);for(const _0x33dcfc of _0x16a588){(_0x33dcfc[_0x58afb9(0x20c)]===_0x58afb9(0x148)||_0x33dcfc['type']===_0x58afb9(0x206))&&_0x33dcfc['yamlActivation']&&(_0x33dcfc[_0x58afb9(0x1b5)]=await _0x52deba(_0x33dcfc[_0x58afb9(0x213)],_0x2b9b6d));}const _0x2b61f8=calculateSegmentDiff(_0x4a8c4c,_0x38fd67,_0x353236,_0x122d40[_0x58afb9(0x1f7)],_0x122d40['connectionIdToNameMap']);_0x3b9b62[_0x58afb9(0x209)]({'relativePath':_0x4a8c4c[_0x58afb9(0x1ea)],'absolutePath':_0x2436d9,'yamlConfig':_0x4a8c4c,'folderPath':_0x51cf27,'existingSegment':_0x38fd67,'existingActivations':_0x353236,'isNew':_0x2b61f8['isNew'],'hasChanges':_0x2b61f8[_0x58afb9(0x21c)],'diff':_0x2b61f8[_0x58afb9(0x231)],'activationActions':_0x16a588});}return{'segmentFiles':_0x3b9b62,'foldersToCreate':_0x21b15e};}export async function prepareJourneyFiles(_0x434e48,_0x247edf,_0x38c17a,_0x6d233c){const _0x6be047=a155_0x3e8afc,_0x1d9d23=[],_0x31c1d1=new Set();for(const {yamlConfig:_0x5045d7,folderPath:_0x46d3be,sourcePath:_0x1dc750}of _0x434e48){const _0x2191fa=resolveTDFolderPath(_0x46d3be,_0x38c17a,_0x6d233c),_0x1fb0f1=_0x2191fa+':'+_0x5045d7[_0x6be047(0x1ea)],_0x35efeb=_0x247edf[_0x6be047(0x147)][_0x6be047(0x1bd)](_0x1fb0f1);let _0x5d8863,_0x4f2311;if(_0x35efeb&&_0x35efeb[_0x6be047(0x140)]>0x0){const _0x17954e=buildLocalExpandedRuleMappings(_0x5045d7),{createYamlContext:_0x566564,prefetchJourneySegments:_0x5607c8}=createPushYamlContextForBundle(_0x247edf['deps'],_0x247edf[_0x6be047(0x212)],_0x247edf[_0x6be047(0x15b)],_0x17954e,_0x247edf[_0x6be047(0x1f7)],_0x247edf[_0x6be047(0x19d)],_0x247edf[_0x6be047(0x157)],_0x247edf[_0x6be047(0x1aa)]);await _0x5607c8(_0x35efeb[_0x6be047(0x1ef)](_0x1c962e=>_0x1c962e['id']));const _0x4bbb02=await _0x247edf[_0x6be047(0x1a2)][_0x6be047(0x1e4)][_0x6be047(0x239)](_0x35efeb[0x0][_0x6be047(0x22c)]),_0x5a5642=hasMultipleVersions(_0x5045d7),_0x49745d=async _0x2c3846=>{const _0x119b9f=_0x6be047,_0x8ba404=_0x247edf[_0x119b9f(0x1aa)]?.[_0x119b9f(0x1bd)](_0x2c3846);if(_0x8ba404)return _0x8ba404;return _0x247edf['fetchJourney']({'journeyId':_0x2c3846,'journeyName':_0x5045d7['name'],'isMultiVersion':_0x35efeb[_0x119b9f(0x140)]>0x1});};if(_0x5a5642&&_0x35efeb[_0x6be047(0x140)]>0x1){const _0x3a65e5=[];for(const _0xa1bcb4 of _0x35efeb){const _0x14f2a5=_0xa1bcb4[_0x6be047(0x1d0)]||0x1;_0x247edf['progress']?.[_0x6be047(0x206)](_0x6be047(0x1ba)+_0x5045d7[_0x6be047(0x1ea)]+'\x20v'+_0x14f2a5);const _0x9ef8ec=await _0x49745d(_0xa1bcb4['id']),_0x58931b=_0x566564(_0xa1bcb4['id']),_0x33921a=await journeyResponseToDef(_0x9ef8ec,_0x58931b);_0x3a65e5[_0x6be047(0x209)]({'item':_0xa1bcb4,'yaml':_0x33921a});}const _0x95c0a0=buildLocalRuleToNameMappingFromJourney(_0x5045d7);_0x4f2311=buildMergedJourneyDef(_0x3a65e5,_0x95c0a0,_0x4bbb02);const _0x2f1c3b=Math[_0x6be047(0x198)](..._0x3a65e5[_0x6be047(0x1ef)](_0x5b3c8b=>_0x5b3c8b[_0x6be047(0x23f)]['versionNumber']||0x0)),_0x50b8e6=_0x35efeb[_0x6be047(0x1d4)](_0x1ad251=>(_0x1ad251[_0x6be047(0x1d0)]||0x0)===_0x2f1c3b);_0x50b8e6&&(_0x247edf[_0x6be047(0x187)]?.[_0x6be047(0x206)]('Fetching\x20'+_0x5045d7[_0x6be047(0x1ea)]+'\x20v'+_0x2f1c3b),_0x5d8863=await _0x49745d(_0x50b8e6['id']));}else{const _0x38825f=_0x35efeb[_0x35efeb['length']-0x1];_0x247edf[_0x6be047(0x187)]?.[_0x6be047(0x206)](_0x6be047(0x1ba)+_0x5045d7[_0x6be047(0x1ea)]),_0x5d8863=await _0x49745d(_0x38825f['id']);const _0xd916da=_0x566564(_0x38825f['id']),_0x50e5ab=await journeyResponseToDef(_0x5d8863,_0xd916da),_0x1b44ad=buildLocalRuleToNameMappingFromJourney(_0x5045d7);_0x4f2311=buildMergedJourneyDef([{'item':_0x38825f,'yaml':_0x50e5ab}],_0x1b44ad,_0x4bbb02);}}addFoldersToCreate(_0x2191fa,_0x247edf['folderPathToId'],_0x31c1d1);const _0x50786a=calculateJourneyDiff(_0x5045d7,_0x4f2311);_0x1d9d23[_0x6be047(0x209)]({'relativePath':_0x5045d7[_0x6be047(0x1ea)],'absolutePath':_0x1dc750,'yamlConfig':_0x5045d7,'folderPath':_0x2191fa,'existingJourney':_0x5d8863,'isNew':_0x50786a[_0x6be047(0x1f1)],'hasChanges':_0x50786a[_0x6be047(0x21c)],'diff':_0x50786a[_0x6be047(0x231)]});}return{'journeyFiles':_0x1d9d23,'foldersToCreate':_0x31c1d1};}export function calculateActivationActions(_0x50a2a1,_0x355166,_0x1a99fc,_0x2c8a33){const _0x3297a7=a155_0x3e8afc,_0x5a9355=[],_0x229522=new Map();for(const _0x1e46df of _0x355166){_0x229522[_0x3297a7(0x226)](_0x1e46df[_0x3297a7(0x1ea)],_0x1e46df);}const _0x14a142=new Map();for(const _0x5e23c3 of _0x50a2a1){_0x14a142['set'](_0x5e23c3[_0x3297a7(0x1ea)],_0x5e23c3);}for(const _0x21eb14 of _0x50a2a1){const _0x3d0f88=_0x229522[_0x3297a7(0x1bd)](_0x21eb14[_0x3297a7(0x1ea)]);if(!_0x3d0f88)_0x5a9355[_0x3297a7(0x209)]({'type':_0x3297a7(0x148),'name':_0x21eb14[_0x3297a7(0x1ea)],'yamlActivation':_0x21eb14});else{const _0x3add0b=activationResponseToDef(_0x3d0f88,_0x1a99fc,_0x2c8a33),_0x3b3404=a155_0x3e9382[_0x3297a7(0x22e)](_0x3add0b),_0x4bb94d=a155_0x3e9382[_0x3297a7(0x22e)](_0x21eb14);_0x3b3404!==_0x4bb94d&&_0x5a9355[_0x3297a7(0x209)]({'type':_0x3297a7(0x206),'name':_0x21eb14[_0x3297a7(0x1ea)],'yamlActivation':_0x21eb14,'existingActivation':_0x3d0f88});}}for(const _0x270c20 of _0x355166){!_0x14a142[_0x3297a7(0x1c9)](_0x270c20[_0x3297a7(0x1ea)])&&_0x5a9355[_0x3297a7(0x209)]({'type':_0x3297a7(0x235),'name':_0x270c20[_0x3297a7(0x1ea)],'existingActivation':_0x270c20});}return _0x5a9355;}function calculateYamlDiff(_0xcc43af,_0x462d6b){if(_0x462d6b){const _0x161878=generateDiff(_0x462d6b,_0xcc43af),_0x50d4d5=hasChanges(_0x161878);return{'isNew':![],'hasChanges':_0x50d4d5,'diff':_0x50d4d5?formatDiffWithColors(_0x161878):undefined};}const _0x4dfb80=generateDiff('',_0xcc43af);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4dfb80)};}function a155_0x3ac6(){const _0x57a3f2=['\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','\x27\x20to\x20local\x20\x27','resolveSegment','Updating\x20activation\x20\x27','utf-8','object','embedded_segment_created','activations','\x20activation\x20\x27','journey','25pkSZzP','schedule','user','segmentFolderId','segmentNameToId','name','journeyActivationStepId','Created\x20journey\x20\x27','getActivation','WaitStep','map','keys','isNew',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','segment_created','deleteSegment','steps','connector_config','idToEmailMap','localName','activation_deleted','reduce','\x27...','SEGMENT_SYNTAX_ERROR','absolutePath','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','created','sha1','add','Creating\x20segment\x20\x27','columns','ACTIVATION_SYNTAX_ERROR','deleted','update','createdSegmentIds','toString','push','JOURNEY_SYNTAX_ERROR','Failed\x20to\x20resolve\x20activation\x20','type',').\x20','some','waitStep','Segment\x20not\x20found','tdx.sdk.push-workflow','parentId','yamlActivation','description','ACTIVATION_UPDATE_ERROR','list','size','entry_criteria','folderPath','waitStepUnit','segment_deleting','hasChanges','unchanged','isArray','conditions','filter','goal','resolveJourneyId','Activation','resolvedRule','action','set','.$1.push-recovery.json','4320950inhJNH','Delete\x20the\x20push\x20recovery\x20file\x20(','journeyActivationNameToId','debug','journeyBundleId','\x27\x20not\x20found\x20in\x20journey\x20\x27','stringify','relationships','createJourneySegment','diff','valid','Name\x20has\x20already\x20been\x20taken','Deleting\x20activation\x20\x27','delete','match','rule','startsWith','getLatestJourneyId','join','segment_updating','updated','trim','Condition','item','uniqueSegmentName','goal\x20criteria','onProgress','Activation\x20not\x20found:\x20','\x27\x20from\x20file:\x20','data','length','\x27\x20exit\x20criteria','flatMap','218MGgmIj','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Failed\x20to\x20','buildUserMaps','journeyBundlesByFolderAndName','create','128094YVcFBs','embedded_activation_created','SEGMENT_UPDATE_ERROR','segmentByFolderAndName','journey_entry_criteria_','activation_deleting','154ulRevl','existingSegment','createActivation','nameToId','null','\x27\x20by\x20rule\x20content','rootFolderId','segments','activationStepsById','1912JRDgFv','\x27\x20entry\x20criteria','includes','existingSegments','Journey\x20\x27','run_after_journey_refresh','kind','parse','relative','11dLWVxB','index','activation_','parentFolder','embeddedSegmentNameToId','activation_creating','activationActions','conditionTimeoutUnit','attributes','journeyStages','journeyName','with','createSegment','branches','conditionTimeoutDuration','segment_deleted','./child-segment-yaml.js','activation_template_id','Created\x20activation\x20\x27','journeyBundleName','logDeleted','from','\x27\x20wait\x20condition','169GdjHpP','):\x20','parseDocument','exitCriterias','embedded_activation_creating','Segment\x20not\x20found:\x20','parentSegmentFolder','listActivations','sort','journeyId','conditionSegmentId','journey_updating','Failed\x20to\x20resolve\x20segment\x20','segment_creating','Stage\x20\x27','progress','getSegment','waitStepType','getSegmentEntity','draft','dirname','560424JTbCiZ','segment_updated','nameToType','DecisionPoint','split','existingActivation','folderPathToId','uniqueServerName','slice','entryCriteria','172992LJldAS','max','replace','journey_creating','\x20segment\x20from\x20file:\x20','\x20journey\x20from\x20file:\x20','connectionIdToNameMap','activationContext','createdSegmentId','segmentId','hex','deps','176859mNYRZY','Updated\x20activation\x20\x27','SEGMENT_NOT_FOUND','entries','getSegment\x20failed\x20for\x20','../../utils/async.js','Deleted\x20segment\x20\x27','journeyById','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x20(referenced\x20in\x20journey\x20','__pending_act_','day','milestone','getSegmentEntity\x20also\x20failed\x20for\x20','stage\x20\x27','logInfo','\x27\x20milestone','activation_updated','validatedRequest','journeys','NOT_FOUND','Entry\x20criteria:\x20','all_columns','Fetching\x20','existingJourney','notification','get','logSuccess','toLowerCase','updateSegmentById','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','skipSegments','87612RDreFH','withProgress','Duration','journey_created','./journey-yaml.js','values','has','\x0a\x20\x20','152uRhLOt','results','folderId','JOURNEY_UPDATE_ERROR','segment','versionNumber','connection','folder_creating','Updated\x20journey\x20\x27','find','updateActivation','Updated\x20segment\x20\x27','getJourney','yamlConfig','INTERNAL','behavior'];a155_0x3ac6=function(){return _0x57a3f2;};return a155_0x3ac6();}export function calculateSegmentDiff(_0x46a00e,_0x3a5a95,_0x2eb6a1,_0x3f1211,_0x29d5d7){const _0xf0d31e=segmentToYamlString(_0x46a00e),_0x2d9a85=_0x3a5a95?segmentToYamlString(segmentWithActivationsToYaml(_0x3a5a95,_0x2eb6a1,undefined,_0x3f1211,_0x29d5d7)):undefined;return calculateYamlDiff(_0xf0d31e,_0x2d9a85);}export function calculateJourneyDiff(_0x44b661,_0x472fc2){const _0x5af34b=normalizeJourneyDef(_0x44b661,_0x44b661),_0x34a97b=a155_0xf7453a(_0x5af34b),_0x335882=_0x472fc2?a155_0xf7453a(normalizeJourneyDef(_0x472fc2,_0x44b661)):undefined;return calculateYamlDiff(_0x34a97b,_0x335882);}export function findSegmentsToDelete(_0x5bdb26,_0x399bd9,_0xa43a3,_0x18b27e,_0x2b1646){const _0x20b798=a155_0x3e8afc,_0x35be86=new Set();for(const {yamlConfig:_0x5ad60c,folderPath:_0xaf0c9d}of _0x399bd9){_0x35be86['add'](_0xaf0c9d+':'+_0x5ad60c[_0x20b798(0x1ea)]);}return _0x5bdb26[_0x20b798(0x220)](_0xbf7a1=>{const _0x25b5b4=_0x20b798,_0x5ca8c2=_0xbf7a1[_0x25b5b4(0x1e8)]?_0xa43a3[_0x25b5b4(0x1bd)](_0xbf7a1[_0x25b5b4(0x1e8)][_0x25b5b4(0x208)]())||'':'',_0x11a761=_0x5ca8c2+':'+_0xbf7a1[_0x25b5b4(0x1ea)];if(_0x35be86[_0x25b5b4(0x1c9)](_0x11a761))return![];if(_0x2b1646)return _0x5ca8c2===_0x18b27e||_0x5ca8c2[_0x25b5b4(0x238)](_0x18b27e+'/');return!![];});}export function findJourneysToDelete(_0x2c854e,_0xe00316,_0x49085f,_0x42d506,_0x1c6f81){const _0x4d0221=a155_0x3e8afc,_0x59ece5=new Set();for(const {yamlConfig:_0x1eb8e8,folderPath:_0x1ad7e0}of _0xe00316){_0x59ece5[_0x4d0221(0x201)](_0x1ad7e0+':'+_0x1eb8e8['name']);}return _0x2c854e[_0x4d0221(0x220)](_0x967121=>{const _0x28ebb3=_0x4d0221,_0x10fa67=_0x967121['folderId']?_0x49085f[_0x28ebb3(0x1bd)](_0x967121['folderId'])||'':'',_0x26ecc7=_0x10fa67+':'+_0x967121[_0x28ebb3(0x174)];if(_0x59ece5[_0x28ebb3(0x1c9)](_0x26ecc7))return![];if(_0x1c6f81)return _0x10fa67===_0x42d506||_0x10fa67['startsWith'](_0x42d506+'/');return!![];});}export function buildSegmentLookupMap(_0x2bba65,_0x304f2a){const _0x334399=a155_0x3e8afc,_0x46a236=new Map();for(const _0x25af9e of _0x2bba65){const _0x41f9d8=_0x25af9e[_0x334399(0x1e8)]?_0x304f2a[_0x334399(0x1bd)](_0x25af9e[_0x334399(0x1e8)][_0x334399(0x208)]())||'':'',_0xc38b4b=_0x41f9d8+':'+_0x25af9e[_0x334399(0x1ea)];_0x46a236[_0x334399(0x226)](_0xc38b4b,_0x25af9e);}return _0x46a236;}export function buildSegmentNameToIdMap(_0x1c2b79){const _0x57cf6d=a155_0x3e8afc,_0x5a88e0=new Map();for(const _0x2b8710 of _0x1c2b79){_0x5a88e0[_0x57cf6d(0x226)](_0x2b8710[_0x57cf6d(0x1ea)],_0x2b8710['id']);}return _0x5a88e0;}export function buildJourneyBundleLookupMap(_0x15c5ef,_0x54265d){const _0x5625c0=a155_0x3e8afc,_0x28bfc8=new Map();for(const _0x37afad of _0x15c5ef){const _0x1232f8=_0x37afad['folderId']?_0x54265d[_0x5625c0(0x1bd)](_0x37afad[_0x5625c0(0x1cd)])||'':'',_0x175aeb=_0x1232f8+':'+_0x37afad['journeyBundleName'];!_0x28bfc8['has'](_0x175aeb)&&_0x28bfc8[_0x5625c0(0x226)](_0x175aeb,[]),_0x28bfc8[_0x5625c0(0x1bd)](_0x175aeb)[_0x5625c0(0x209)](_0x37afad);}for(const _0x2aebf9 of _0x28bfc8[_0x5625c0(0x1c8)]()){_0x2aebf9[_0x5625c0(0x180)]((_0x4d8534,_0x3281b2)=>(_0x4d8534[_0x5625c0(0x1d0)]||0x0)-(_0x3281b2[_0x5625c0(0x1d0)]||0x0));}return _0x28bfc8;}export function collectFoldersToCreate(_0x1dbdb5,_0x1e2ad7){const _0x448312=a155_0x3e8afc,_0x1451c8=new Set();for(const _0x4ec888 of _0x1dbdb5){if(!_0x4ec888)continue;if(_0x1e2ad7[_0x448312(0x1c9)](_0x4ec888))continue;const _0x3b801e=_0x4ec888[_0x448312(0x191)]('/');let _0x702f7e='';for(const _0x2edbd1 of _0x3b801e){_0x702f7e=_0x702f7e?_0x702f7e+'/'+_0x2edbd1:_0x2edbd1,!_0x1e2ad7[_0x448312(0x1c9)](_0x702f7e)&&_0x1451c8['add'](_0x702f7e);}}return _0x1451c8;}export function parseAndClassifyYamlFiles(_0x4c2f70,_0x27ca64,_0x410b1c){const _0x2b9305=a155_0x3e8afc,_0x13f962=[],_0x4f215c=[];for(const _0x1d6f66 of _0x4c2f70){const _0x16e2b3=a155_0x405b9f['relative'](_0x27ca64,a155_0x405b9f[_0x2b9305(0x18c)](_0x1d6f66)),_0x4c7cf1=_0x16e2b3==='.'?'':_0x16e2b3[_0x2b9305(0x199)](/\\/g,'/'),_0xd1aecc=readFileSync(_0x1d6f66,'utf-8'),_0x28743d=a155_0x3e9382[_0x2b9305(0x15f)](_0xd1aecc);if(isJourneyDef(_0x28743d)){const _0x735f9=a155_0x273a5a(_0xd1aecc);_0x4f215c[_0x2b9305(0x209)]({'yamlConfig':_0x735f9,'folderPath':_0x4c7cf1,'sourcePath':_0x1d6f66});}else{if(!_0x410b1c?.[_0x2b9305(0x1c2)]){const _0x382929=parseSegmentYamlFile(_0xd1aecc),_0x212975=normalizeChildSegmentYaml(_0x382929);_0x13f962[_0x2b9305(0x209)]({'yamlConfig':_0x212975,'folderPath':_0x4c7cf1,'sourcePath':_0x1d6f66});}}}return{'segments':_0x13f962,'journeys':_0x4f215c};}export function validateParsedFiles(_0x24dd3e,_0x4b1366){const _0x530acd=a155_0x3e8afc,_0x5b3d22=[];for(const {yamlConfig:_0x291212,sourcePath:_0x1270cf}of _0x24dd3e[_0x530acd(0x156)]){const _0x173579=readFileSync(_0x1270cf,_0x530acd(0x1df)),_0x97b394=a155_0x3e9382['parseDocument'](_0x173579),_0x67347=validateSegmentDef(_0x291212,{'source':_0x173579,'document':_0x97b394},{'skipSchema':!![]});if(!_0x67347[_0x530acd(0x232)]){const _0x3379f9=a155_0x405b9f['relative'](_0x4b1366,_0x1270cf);_0x5b3d22[_0x530acd(0x209)]({'filePath':_0x3379f9,'source':_0x173579,'result':_0x67347,'isJourney':![]});}}for(const {yamlConfig:_0x36490c,sourcePath:_0x123b8e}of _0x24dd3e[_0x530acd(0x1b6)]){const _0x21b193=readFileSync(_0x123b8e,_0x530acd(0x1df)),_0x13fe88=a155_0x3e9382[_0x530acd(0x17a)](_0x21b193),_0x4d4678=validateJourneyDef(_0x36490c,{'source':_0x21b193,'document':_0x13fe88},{'skipSchema':!![]});if(!_0x4d4678[_0x530acd(0x232)]){const _0x2406af=a155_0x405b9f[_0x530acd(0x160)](_0x4b1366,_0x123b8e);_0x5b3d22[_0x530acd(0x209)]({'filePath':_0x2406af,'source':_0x21b193,'result':_0x4d4678,'isJourney':!![]});}}return _0x5b3d22;}export function formatValidationErrors(_0x2338f7){const _0xf2dcb8=a155_0x3e8afc,_0x3f2670=[];for(const {filePath:_0x4b5ab0,source:_0x69feb4,result:_0x1b207e,isJourney:_0x20858a}of _0x2338f7){const _0x25c71c=_0x20858a?'journey':_0xf2dcb8(0x1cf);_0x3f2670['push']('\x0a'+_0x4b5ab0+'\x20('+_0x25c71c+_0xf2dcb8(0x179)+_0x1b207e['errors'][_0xf2dcb8(0x140)]+'\x20error(s)'),_0x3f2670[_0xf2dcb8(0x209)](formatValidationResult(_0x1b207e,_0x69feb4,_0x4b5ab0));}return _0x3f2670[_0xf2dcb8(0x23a)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x1368ac){const _0x113d63=a155_0x3e8afc,_0x19dff9=new Set(),_0x46ed8c=new Map(),_0x407891=collectSegmentUsageCounts(_0x1368ac);if(_0x1368ac[_0x113d63(0x156)])for(const [_0x1ebf0f,_0x3272f6]of Object['entries'](_0x1368ac[_0x113d63(0x156)])){_0x19dff9['add'](_0x1ebf0f);if(_0x3272f6['rule']){const _0x371d1b=yamlRuleToApi(_0x3272f6[_0x113d63(0x237)]),_0x1a1cc9=apiRuleToYaml(_0x371d1b);_0x46ed8c[_0x113d63(0x226)](_0x1ebf0f,_0x1a1cc9);}}const _0x44ba13=new Map();let _0x4706e3=0x0;for(const [_0x413c86,_0xd924bd]of _0x46ed8c){const _0x3ee884=serializeExpandedRule(_0xd924bd,_0x46ed8c),_0x507fc4=_0x44ba13['get'](_0x3ee884)||[];_0x507fc4['push']({'name':_0x413c86,'index':_0x4706e3}),_0x44ba13[_0x113d63(0x226)](_0x3ee884,_0x507fc4),_0x4706e3++;}const _0x3dabaa=new Map();for(const [_0x322049,_0x835e20]of _0x44ba13){const _0x348084=_0x835e20[_0x113d63(0x195)]()[_0x113d63(0x180)]((_0x123f15,_0x49929b)=>{const _0x2511bc=_0x113d63,_0x3f0e56=_0x407891['get'](_0x123f15[_0x2511bc(0x1ea)])||0x0,_0x4c257a=_0x407891[_0x2511bc(0x1bd)](_0x49929b[_0x2511bc(0x1ea)])||0x0;if(_0x3f0e56!==_0x4c257a)return _0x4c257a-_0x3f0e56;return _0x123f15[_0x2511bc(0x162)]-_0x49929b['index'];})[_0x113d63(0x1ef)](_0x82f2b=>_0x82f2b[_0x113d63(0x1ea)]),_0x2abf29=[];for(const _0x5bf556 of _0x348084){const _0x3281c2=_0x407891['get'](_0x5bf556)||0x0,_0x14b95e=Math[_0x113d63(0x198)](_0x3281c2,0x1);for(let _0x78a62b=0x0;_0x78a62b<_0x14b95e;_0x78a62b++){_0x2abf29[_0x113d63(0x209)](_0x5bf556);}}_0x3dabaa[_0x113d63(0x226)](_0x322049,_0x2abf29);}return{'existingLocalSegmentNames':_0x19dff9,'localSegmentRules':_0x46ed8c,'localExpandedRuleToNames':_0x3dabaa};}export function createSegmentIdResolver(_0x2bf81c,_0x3c55d6){return async _0x11f007=>{const _0x4cccac=a155_0x4ade,_0x50471b=_0x2bf81c['get'](_0x11f007);if(!_0x50471b)throw new SDKError(ErrorCode[_0x4cccac(0x1a5)],_0x4cccac(0x17d)+_0x11f007+_0x4cccac(0x144)+_0x3c55d6+'\x27)');return _0x50471b;};}export function extractRootFolderId(_0xcd9459){const _0x180dc5=a155_0x3e8afc;return _0xcd9459[_0x180dc5(0x22f)]?.[_0x180dc5(0x17e)]?.[_0x180dc5(0x13f)]?.['id']||_0xcd9459[_0x180dc5(0x22f)]?.[_0x180dc5(0x164)]?.[_0x180dc5(0x13f)]?.['id'];}export function buildConnectionMaps(_0x447c5b){const _0x4199e2=a155_0x3e8afc,_0x17a2e0=new Map(),_0x486814=new Map(),_0x33d386=new Map();for(const _0x26b8bc of _0x447c5b){_0x17a2e0[_0x4199e2(0x226)](_0x26b8bc[_0x4199e2(0x1ea)],parseInt(_0x26b8bc['id'],0xa)),_0x486814[_0x4199e2(0x226)](_0x26b8bc['id'],_0x26b8bc['name']),_0x33d386[_0x4199e2(0x226)](_0x26b8bc[_0x4199e2(0x1ea)],_0x26b8bc[_0x4199e2(0x20c)]);}return{'nameToId':_0x17a2e0,'idToName':_0x486814,'nameToType':_0x33d386};}export function calculatePushStats(_0x575502,_0xf32ab7,_0x2e2778,_0x50f577,_0x4119dd,_0x909440,_0x449f42){const _0x1cec2d=a155_0x3e8afc,_0x2a3aa1=_0x575502[_0x1cec2d(0x220)](_0x550c26=>_0x550c26['isNew']),_0x4f58c7=_0x575502[_0x1cec2d(0x220)](_0x5e4c36=>!_0x5e4c36[_0x1cec2d(0x1f1)]&&_0x5e4c36[_0x1cec2d(0x21c)]),_0x406e74=_0x575502[_0x1cec2d(0x220)](_0x17f899=>!_0x17f899[_0x1cec2d(0x1f1)]&&!_0x17f899[_0x1cec2d(0x21c)]),_0x211bc1=_0x909440?_0x50f577:[],_0x663c9=_0xf32ab7[_0x1cec2d(0x220)](_0x65f974=>_0x65f974[_0x1cec2d(0x1f1)]),_0x595c49=_0xf32ab7[_0x1cec2d(0x220)](_0x427662=>!_0x427662['isNew']&&_0x427662[_0x1cec2d(0x21c)]),_0x13f75a=_0xf32ab7[_0x1cec2d(0x220)](_0xc6651f=>!_0xc6651f[_0x1cec2d(0x1f1)]&&!_0xc6651f[_0x1cec2d(0x21c)]),_0x12a91f=_0x909440?_0x4119dd:[],_0x4ce7a9=_0x575502[_0x1cec2d(0x142)](_0x2aba01=>_0x2aba01[_0x1cec2d(0x167)]),_0x52256c=_0x4ce7a9[_0x1cec2d(0x220)](_0x488807=>_0x488807[_0x1cec2d(0x20c)]===_0x1cec2d(0x148)),_0x58dd51=_0x4ce7a9['filter'](_0xa376ed=>_0xa376ed[_0x1cec2d(0x20c)]===_0x1cec2d(0x206)),_0x491ec0=_0x4ce7a9[_0x1cec2d(0x220)](_0x2d7d9c=>_0x2d7d9c[_0x1cec2d(0x20c)]===_0x1cec2d(0x235)),_0x5ac204=Array[_0x1cec2d(0x176)](_0x2e2778)[_0x1cec2d(0x180)](),_0x120dba=_0x449f42?![]:_0x2a3aa1['length']>0x0||_0x4f58c7[_0x1cec2d(0x140)]>0x0||_0x211bc1[_0x1cec2d(0x140)]>0x0,_0x4ba015=_0x663c9[_0x1cec2d(0x140)]>0x0||_0x595c49[_0x1cec2d(0x140)]>0x0||_0x12a91f[_0x1cec2d(0x140)]>0x0,_0x12d8b5=_0x449f42?![]:_0x4ce7a9[_0x1cec2d(0x140)]>0x0,_0x1634fb=_0x5ac204['length']>0x0;return{'segments':{'new':_0x2a3aa1,'changed':_0x4f58c7,'unchanged':_0x406e74,'toDelete':_0x211bc1},'journeys':{'new':_0x663c9,'changed':_0x595c49,'unchanged':_0x13f75a,'toDelete':_0x12a91f},'activations':{'all':_0x4ce7a9,'toCreate':_0x52256c,'toUpdate':_0x58dd51,'toDelete':_0x491ec0},'folders':{'toCreate':_0x5ac204},'counts':{'segments':{'new':_0x2a3aa1[_0x1cec2d(0x140)],'changed':_0x4f58c7[_0x1cec2d(0x140)],'unchanged':_0x406e74['length'],'toDelete':_0x211bc1[_0x1cec2d(0x140)]},'journeys':{'new':_0x663c9[_0x1cec2d(0x140)],'changed':_0x595c49['length'],'unchanged':_0x13f75a['length'],'toDelete':_0x12a91f['length']},'activations':{'create':_0x52256c[_0x1cec2d(0x140)],'update':_0x58dd51[_0x1cec2d(0x140)],'delete':_0x491ec0[_0x1cec2d(0x140)]},'folders':_0x5ac204[_0x1cec2d(0x140)]},'hasChanges':_0x120dba||_0x4ba015||_0x12d8b5||_0x1634fb};}export async function buildPushExecutionContext(_0x293d93,_0x386119,_0x9b087f,_0x37b283,_0x5774a5,_0x58337c){const _0x393242=a155_0x3e8afc,_0x3002e9=extractRootFolderId(_0x9b087f),{pathToId:_0x307bd9,idToPath:_0x1eee56}=buildFolderMaps(_0x5774a5),_0x57b79f=buildSegmentNameToIdMap(_0x37b283),_0x5ce808=new Map(),{batchAsync:_0x31f6cf}=await import(_0x393242(0x1a8)),[_0x2560fd,_0x27432f]=await Promise['all']([_0x293d93[_0x393242(0x1e7)][_0x393242(0x146)](),_0x293d93[_0x393242(0x1d1)][_0x393242(0x216)](),((async()=>{const _0x3108e9=_0x393242;!_0x58337c&&_0x37b283[_0x3108e9(0x140)]>0x0&&await _0x31f6cf(_0x37b283,async _0x307f3e=>{const _0x262530=_0x3108e9,_0x53c655=await _0x293d93[_0x262530(0x1cf)][_0x262530(0x17f)](_0x386119,_0x307f3e['id']);_0x5ce808[_0x262530(0x226)](_0x307f3e['id'],_0x53c655);});})())]),{emailToId:_0x5e92e3,idToEmail:_0x4a6208}=_0x2560fd,_0x3b6ab0=buildConnectionMaps(_0x27432f);return{'rootFolderId':_0x3002e9,'folderPathToId':_0x307bd9,'folderIdToPath':_0x1eee56,'segmentNameToId':_0x57b79f,'activationsBySegmentId':_0x5ce808,'emailToIdMap':_0x5e92e3,'idToEmailMap':_0x4a6208,'connectionNameToIdMap':_0x3b6ab0[_0x393242(0x152)],'connectionIdToNameMap':_0x3b6ab0['idToName'],'connectionNameToTypeMap':_0x3b6ab0[_0x393242(0x18f)]};}export function createPushYamlContextForBundle(_0x2801f5,_0x174031,_0x1adb85,_0x593d12,_0x1d8202,_0x4930fa,_0x29b469,_0x403b28){const {existingLocalSegmentNames:_0x21c146,localExpandedRuleToNames:_0x109722}=_0x593d12,_0x5ca435=new Set(),_0x44cbd=new Map(),_0x31b0a9=new Map(),_0x50b31a=new Map(),_0x18ec09=createJumpTargetCache(),_0x3aeabb=new Map(),_0x19e7a2=new Map(),_0x4db2b4=new Set();let _0x5c19ea;const _0x26acd7=_0x3c3151=>{const _0x20f263={'resolveSegment':async _0x360071=>{const _0x5d9fb2=a155_0x4ade,_0x5e9e60=_0x50b31a[_0x5d9fb2(0x1bd)](_0x360071);if(_0x5e9e60!==undefined)return{'name':_0x5e9e60,'isJourneyLocal':!![]};try{const _0x2965eb=await fetchSegment(_0x2801f5,_0x174031,_0x360071,_0x1adb85);if(!_0x2965eb)throw new Error(_0x5d9fb2(0x210));const _0x39904b=generateJourneyLocalName(_0x2965eb[_0x5d9fb2(0x1ea)]),_0x5857e9=_0x2965eb[_0x5d9fb2(0x15e)]===SEGMENT_KIND_JOURNEY&&_0x39904b!==undefined;let _0x57c5b0=_0x2965eb[_0x5d9fb2(0x1ea)],_0x12255f;if(_0x5857e9&&_0x2965eb[_0x5d9fb2(0x237)]){const _0x5cf297=apiRuleToYaml(_0x2965eb[_0x5d9fb2(0x237)]);_0x19e7a2[_0x5d9fb2(0x226)](_0x360071,_0x5cf297);const _0x163521=async _0x5a265e=>{const _0x9b0f40=_0x5d9fb2,_0x1e3378=collectSegmentRefsFromRule(_0x5a265e);for(const _0x349704 of _0x1e3378){if(!_0x19e7a2[_0x9b0f40(0x1c9)](_0x349704))try{const _0x46ea62=await fetchSegment(_0x2801f5,_0x174031,_0x349704,_0x1adb85);if(_0x46ea62?.[_0x9b0f40(0x237)]){const _0x3007cb=apiRuleToYaml(_0x46ea62[_0x9b0f40(0x237)]);_0x19e7a2[_0x9b0f40(0x226)](_0x349704,_0x3007cb),await _0x163521(_0x3007cb);}}catch(_0x5eda44){logger['debug']('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x349704+':\x20'+_0x5eda44);}}};await _0x163521(_0x5cf297);const _0x2b2bf2=serializeExpandedRule(_0x5cf297,_0x19e7a2),_0x31f0d4=_0x109722[_0x5d9fb2(0x1bd)](_0x2b2bf2);if(_0x31f0d4&&_0x31f0d4[_0x5d9fb2(0x140)]>0x0){const _0x3d3661=_0x44cbd[_0x5d9fb2(0x1bd)](_0x2b2bf2)||0x0,_0x2f1adb=_0x31f0d4[_0x3d3661]||_0x31f0d4[_0x31f0d4[_0x5d9fb2(0x140)]-0x1];_0x44cbd['set'](_0x2b2bf2,_0x3d3661+0x1),_0x57c5b0=_0x2f1adb,_0x5ca435[_0x5d9fb2(0x201)](_0x57c5b0),_0x50b31a[_0x5d9fb2(0x226)](_0x360071,_0x57c5b0);const _0x13f7e5=await resolveRuleSegmentRefs(_0x5cf297,async _0x2c40b7=>{const _0x218d0b=_0x5d9fb2,_0x2b87eb=_0x50b31a[_0x218d0b(0x1bd)](_0x2c40b7);if(_0x2b87eb)return _0x2b87eb;const _0x322c53=await _0x5c19ea[_0x218d0b(0x1dd)](_0x2c40b7);return _0x322c53[_0x218d0b(0x1ea)];});_0x12255f={'description':_0x2965eb[_0x5d9fb2(0x214)],'rule':_0x13f7e5};}else{const _0x4ea653=_0x3aeabb[_0x5d9fb2(0x1bd)](_0x2b2bf2);if(_0x4ea653)_0x57c5b0=_0x4ea653,_0x50b31a['set'](_0x360071,_0x57c5b0);else{if(_0x39904b){let _0x2109d5=_0x39904b,_0x3545a6=0x2;while(_0x5ca435[_0x5d9fb2(0x1c9)](_0x2109d5)||_0x21c146[_0x5d9fb2(0x1c9)](_0x2109d5)){_0x2109d5=_0x39904b+'_'+_0x3545a6,_0x3545a6++;}_0x5ca435[_0x5d9fb2(0x201)](_0x2109d5),_0x57c5b0=_0x2109d5;}_0x50b31a['set'](_0x360071,_0x57c5b0),_0x3aeabb['set'](_0x2b2bf2,_0x57c5b0);const _0x39a1bf=await resolveRuleSegmentRefs(_0x5cf297,async _0x19b470=>{const _0x1a822d=_0x5d9fb2,_0x163b33=_0x50b31a[_0x1a822d(0x1bd)](_0x19b470);if(_0x163b33)return _0x163b33;const _0x1230b2=await _0x5c19ea[_0x1a822d(0x1dd)](_0x19b470);return _0x1230b2[_0x1a822d(0x1ea)];});_0x12255f={'description':_0x2965eb[_0x5d9fb2(0x214)],'rule':_0x39a1bf};}}}return{'name':_0x57c5b0,'isJourneyLocal':_0x5857e9,'definition':_0x12255f};}catch(_0x1d7c42){return logger[_0x5d9fb2(0x22b)](_0x5d9fb2(0x184)+_0x360071+':\x20'+_0x1d7c42),{'name':_0x360071,'isJourneyLocal':![]};}},'resolveActivation':async _0x227aec=>{const _0x134cff=a155_0x4ade,_0x36a2b6=_0x31b0a9['get'](_0x227aec);if(_0x36a2b6!==undefined)return{'name':_0x36a2b6,'isJourneyLocal':!![]};try{let _0x32b6d2=_0x29b469?.[_0x134cff(0x1bd)](_0x227aec);!_0x32b6d2&&(_0x32b6d2=await _0x2801f5[_0x134cff(0x1e4)][_0x134cff(0x1ed)](_0x3c3151,_0x227aec));const _0x4366e4=_0x32b6d2[_0x134cff(0x169)]['activationParams'][_0x134cff(0x1ea)]||_0x227aec,_0x49c328=sanitizeYamlKey(_0x4366e4)||_0x134cff(0x163)+_0x227aec,_0x4f610c=_0x49c328;_0x31b0a9[_0x134cff(0x226)](_0x227aec,_0x4f610c);const _0x4e9642=journeyActivationStepToYaml(_0x32b6d2,_0x1d8202,_0x4930fa);return{'name':_0x4f610c,'isJourneyLocal':!![],'definition':_0x4e9642};}catch(_0x575540){return logger['debug'](_0x134cff(0x20b)+_0x227aec+':\x20'+_0x575540),{'name':_0x227aec,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x50e640,_0x24fd28)=>resolveJumpTarget(_0x50e640,_0x24fd28,_0x18ec09,async _0x46074c=>{const _0x2321cf=a155_0x4ade,_0xb86ba6=_0x403b28?.[_0x2321cf(0x1bd)](_0x46074c);if(_0xb86ba6)return _0xb86ba6;return _0x2801f5[_0x2321cf(0x1e4)][_0x2321cf(0x1d7)](_0x46074c);})};return _0x5c19ea=_0x20f263,_0x20f263;},_0x2749ba=async _0x189d50=>{const _0x2d4777=a155_0x4ade,{collectSegmentIdsFromJourneyApi:_0x153122}=await import(_0x2d4777(0x1c7)),{batchAsync:_0x2fd0d3}=await import('../../utils/async.js'),_0x48f8f7=new Set();for(const _0x1e6991 of _0x189d50){let _0xd116b0=_0x403b28?.[_0x2d4777(0x1bd)](_0x1e6991);!_0xd116b0&&(_0xd116b0=await _0x2801f5[_0x2d4777(0x1e4)][_0x2d4777(0x1d7)](_0x1e6991));const _0x2da71b=_0x153122(_0xd116b0);for(const _0x14feff of _0x2da71b){_0x48f8f7['add'](_0x14feff);}}let _0x3d53da=Array[_0x2d4777(0x176)](_0x48f8f7);while(_0x3d53da[_0x2d4777(0x140)]>0x0){const _0x4dccd6=_0x3d53da['filter'](_0x4805ed=>!_0x4db2b4['has'](_0x4805ed));if(_0x4dccd6[_0x2d4777(0x140)]===0x0)break;const _0x390df5=await _0x2fd0d3(_0x4dccd6,async _0x2b26d2=>{_0x4db2b4['add'](_0x2b26d2);const _0x274da6=await fetchSegment(_0x2801f5,_0x174031,_0x2b26d2,_0x1adb85);if(!_0x274da6)return null;return{'segmentId':_0x2b26d2,'segment':_0x274da6};},0xa),_0x5f2e50=new Set();for(const _0xd1858e of _0x390df5){if(!_0xd1858e?.[_0x2d4777(0x1cf)]?.[_0x2d4777(0x237)])continue;const _0x393e47=apiRuleToYaml(_0xd1858e['segment'][_0x2d4777(0x237)]);_0x19e7a2['set'](_0xd1858e['segmentId'],_0x393e47);const _0x964bd6=collectSegmentRefsFromRule(_0x393e47);for(const _0x16c502 of _0x964bd6){!_0x4db2b4[_0x2d4777(0x1c9)](_0x16c502)&&_0x5f2e50[_0x2d4777(0x201)](_0x16c502);}}_0x3d53da=Array['from'](_0x5f2e50);}};return{'createYamlContext':_0x26acd7,'prefetchJourneySegments':_0x2749ba};}export async function executePushSegments(_0xe51685,_0x1f3583,_0x549dfe,_0x15daf3,_0x1cee54){const _0x4d2367=a155_0x3e8afc,{segmentDefToCreateRequest:_0x4bb4c4,segmentDefToUpdateRequest:_0x1d7c0b}=await import(_0x4d2367(0x171)),_0x23f801=_0x549dfe[_0x4d2367(0x193)],_0x2112a6=0x5,_0x5ae251=async _0x3fb02a=>{const _0x307264=_0x4d2367,_0x43de5f=_0x3fb02a['folderPath']?_0x23f801[_0x307264(0x1bd)](_0x3fb02a[_0x307264(0x219)]):undefined;let _0x137b4b;const _0x255bc1={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x4ecdeb=_0x3fb02a[_0x307264(0x1d8)];if(_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x237)]){const _0x4b55ee=createSegmentIdResolver(_0x549dfe['segmentNameToId'],_0x3fb02a['yamlConfig'][_0x307264(0x1ea)]),_0x31b538=await resolveRuleSegmentIds(_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x237)],_0x4b55ee);_0x4ecdeb={..._0x3fb02a[_0x307264(0x1d8)],'rule':_0x31b538};}try{if(_0x3fb02a[_0x307264(0x1f1)]){_0x1cee54[_0x307264(0x242)]?.({'type':_0x307264(0x185),'name':_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]});const _0x41be83=_0x4bb4c4(_0x4ecdeb,_0x43de5f),_0x29e23c=await _0x1cee54[_0x307264(0x1c4)](_0x307264(0x202)+_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]+_0x307264(0x1fb),()=>_0xe51685[_0x307264(0x1cf)][_0x307264(0x16d)](_0x15daf3['parentId'],_0x41be83));_0x137b4b=_0x29e23c['data']['id'],_0x549dfe[_0x307264(0x1e9)][_0x307264(0x226)](_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)],_0x137b4b),_0x255bc1[_0x307264(0x19f)]={'name':_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)],'id':_0x137b4b},_0x1cee54[_0x307264(0x242)]?.({'type':_0x307264(0x1f3),'name':_0x3fb02a['yamlConfig'][_0x307264(0x1ea)],'segmentId':_0x137b4b}),_0x1cee54[_0x307264(0x1be)]?.('Created\x20segment\x20\x27'+_0x3fb02a[_0x307264(0x1d8)]['name']+'\x27'),_0x255bc1[_0x307264(0x1ff)]=0x1;}else{if(_0x3fb02a[_0x307264(0x21c)]){_0x1cee54['onProgress']?.({'type':_0x307264(0x23b),'name':_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]});const _0x349308=_0x1d7c0b(_0x4ecdeb);_0x43de5f!==_0x3fb02a[_0x307264(0x150)]?.[_0x307264(0x1e8)]&&(_0x349308[_0x307264(0x1e8)]=_0x43de5f?parseInt(_0x43de5f,0xa):undefined),await _0x1cee54[_0x307264(0x1c4)]('Updating\x20segment\x20\x27'+_0x3fb02a['yamlConfig'][_0x307264(0x1ea)]+_0x307264(0x1fb),()=>_0xe51685[_0x307264(0x1cf)][_0x307264(0x1c0)](_0x15daf3[_0x307264(0x212)],_0x3fb02a['existingSegment']['id'],_0x349308)),_0x137b4b=_0x3fb02a[_0x307264(0x150)]['id'],_0x1cee54[_0x307264(0x242)]?.({'type':_0x307264(0x18e),'name':_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]}),_0x1cee54[_0x307264(0x1be)]?.(_0x307264(0x1d6)+_0x3fb02a[_0x307264(0x1d8)]['name']+'\x27'),_0x255bc1[_0x307264(0x23c)]=0x1;}else _0x137b4b=_0x3fb02a[_0x307264(0x150)]['id'];}}catch(_0x249aed){const _0x5aed34=isHttp400Error(_0x249aed),_0x59e4cd=_0x5aed34?ErrorCode[_0x307264(0x1fc)]:ErrorCode[_0x307264(0x14b)],_0x3ad62a=getErrorMessage(_0x249aed);throw new SDKError(_0x59e4cd,_0x307264(0x145)+(_0x3fb02a[_0x307264(0x1f1)]?_0x307264(0x148):'update')+_0x307264(0x19b)+_0x3fb02a[_0x307264(0x1fd)]+_0x307264(0x1ca)+_0x3ad62a,_0x249aed);}try{const _0x2ccb13=await syncActivationsForSegment(_0xe51685,_0x15daf3['parentId'],_0x137b4b,_0x3fb02a['yamlConfig'][_0x307264(0x1ea)],_0x3fb02a['activationActions'],_0x1cee54,_0x3fb02a[_0x307264(0x1fd)]);_0x255bc1[_0x307264(0x1e2)]=_0x2ccb13;}catch(_0x19fbfd){if(_0x19fbfd instanceof SDKError)throw _0x19fbfd;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]+'\x27\x20from\x20file:\x20'+_0x3fb02a[_0x307264(0x1fd)]+_0x307264(0x1ca)+getErrorMessage(_0x19fbfd),_0x19fbfd);}return _0x255bc1;},_0x241bdb=await batchAsync(_0x1f3583,_0x5ae251,_0x2112a6),_0xaa31e9={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3c94c0 of _0x241bdb){_0xaa31e9[_0x4d2367(0x1ff)]+=_0x3c94c0['created'],_0xaa31e9[_0x4d2367(0x23c)]+=_0x3c94c0[_0x4d2367(0x23c)],_0x3c94c0[_0x4d2367(0x19f)]&&_0xaa31e9[_0x4d2367(0x207)]['set'](_0x3c94c0[_0x4d2367(0x19f)][_0x4d2367(0x1ea)],_0x3c94c0['createdSegmentId']['id']),_0xaa31e9['activations'][_0x4d2367(0x1ff)]+=_0x3c94c0[_0x4d2367(0x1e2)][_0x4d2367(0x1ff)],_0xaa31e9[_0x4d2367(0x1e2)][_0x4d2367(0x23c)]+=_0x3c94c0[_0x4d2367(0x1e2)][_0x4d2367(0x23c)],_0xaa31e9[_0x4d2367(0x1e2)][_0x4d2367(0x205)]+=_0x3c94c0[_0x4d2367(0x1e2)]['deleted'];}return _0xaa31e9;}async function syncActivationsForSegment(_0x46297,_0x14fcf0,_0x1e9d6c,_0x1e116d,_0x4399f6,_0x4a3b02,_0x1b7d28){const _0x1e343a=a155_0x3e8afc,_0x15ade6={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5406bf of _0x4399f6){try{if(_0x5406bf[_0x1e343a(0x20c)]===_0x1e343a(0x148)&&_0x5406bf[_0x1e343a(0x1b5)])_0x4a3b02['onProgress']?.({'type':_0x1e343a(0x166),'segmentName':_0x1e116d,'activationName':_0x5406bf['name']}),await _0x4a3b02[_0x1e343a(0x1c4)]('Creating\x20activation\x20\x27'+_0x5406bf['name']+_0x1e343a(0x1fb),()=>_0x46297[_0x1e343a(0x1cf)][_0x1e343a(0x151)](_0x14fcf0,_0x1e9d6c,_0x5406bf[_0x1e343a(0x1b5)])),_0x4a3b02['onProgress']?.({'type':'activation_created','segmentName':_0x1e116d,'activationName':_0x5406bf[_0x1e343a(0x1ea)]}),_0x4a3b02[_0x1e343a(0x1be)]?.(_0x1e343a(0x173)+_0x5406bf[_0x1e343a(0x1ea)]+'\x27'),_0x15ade6[_0x1e343a(0x1ff)]++;else{if(_0x5406bf['type']==='update'&&_0x5406bf[_0x1e343a(0x1b5)]&&_0x5406bf[_0x1e343a(0x192)])_0x4a3b02[_0x1e343a(0x242)]?.({'type':'activation_updating','segmentName':_0x1e116d,'activationName':_0x5406bf['name']}),await _0x4a3b02[_0x1e343a(0x1c4)](_0x1e343a(0x1de)+_0x5406bf[_0x1e343a(0x1ea)]+_0x1e343a(0x1fb),()=>_0x46297['segment'][_0x1e343a(0x1d5)](_0x14fcf0,_0x1e9d6c,_0x5406bf[_0x1e343a(0x192)]['id'],_0x5406bf[_0x1e343a(0x1b5)])),_0x4a3b02[_0x1e343a(0x242)]?.({'type':_0x1e343a(0x1b4),'segmentName':_0x1e116d,'activationName':_0x5406bf[_0x1e343a(0x1ea)]}),_0x4a3b02['logSuccess']?.(_0x1e343a(0x1a4)+_0x5406bf[_0x1e343a(0x1ea)]+'\x27'),_0x15ade6[_0x1e343a(0x23c)]++;else _0x5406bf[_0x1e343a(0x20c)]==='delete'&&_0x5406bf[_0x1e343a(0x192)]&&(_0x4a3b02[_0x1e343a(0x242)]?.({'type':_0x1e343a(0x14e),'segmentName':_0x1e116d,'activationName':_0x5406bf[_0x1e343a(0x1ea)]}),await _0x4a3b02[_0x1e343a(0x1c4)](_0x1e343a(0x234)+_0x5406bf['name']+_0x1e343a(0x1fb),()=>_0x46297[_0x1e343a(0x1cf)]['deleteActivation'](_0x14fcf0,_0x1e9d6c,_0x5406bf[_0x1e343a(0x192)]['id'])),_0x4a3b02[_0x1e343a(0x242)]?.({'type':_0x1e343a(0x1f9),'segmentName':_0x1e116d,'activationName':_0x5406bf['name']}),_0x4a3b02[_0x1e343a(0x175)]?.('Deleted\x20activation\x20\x27'+_0x5406bf[_0x1e343a(0x1ea)]+'\x27'),_0x15ade6[_0x1e343a(0x205)]++);}}catch(_0x4acdc9){const _0x3eb22c=isHttp400Error(_0x4acdc9),_0x2bd182=_0x3eb22c?ErrorCode[_0x1e343a(0x204)]:ErrorCode[_0x1e343a(0x215)],_0x54cf7d=getErrorMessage(_0x4acdc9);throw new SDKError(_0x2bd182,_0x1e343a(0x145)+_0x5406bf[_0x1e343a(0x20c)]+_0x1e343a(0x1e3)+_0x5406bf[_0x1e343a(0x1ea)]+_0x1e343a(0x13e)+_0x1b7d28+_0x1e343a(0x1ca)+_0x54cf7d,_0x4acdc9);}}return _0x15ade6;}export async function executePushFolders(_0x1c37ee,_0x33f160,_0x1b5a5d,_0x5446c8,_0xec07b3){const _0x1f70b7=a155_0x3e8afc,_0x577718=new Map(_0x1b5a5d),_0x4c3b14=sortFoldersByDepth(_0x33f160);for(const _0x1f582d of _0x4c3b14){const _0x184390=_0x1f582d[_0x1f70b7(0x191)]('/'),_0xa1bd14=_0x184390[_0x184390['length']-0x1],_0x2a7e4a=_0x184390[_0x1f70b7(0x195)](0x0,-0x1)[_0x1f70b7(0x23a)]('/'),_0x20dd15=_0x577718[_0x1f70b7(0x1bd)](_0x2a7e4a);_0xec07b3['onProgress']?.({'type':_0x1f70b7(0x1d2),'folder':_0x1f582d});const _0x183128={'name':_0xa1bd14,'parentFolderId':_0x20dd15},_0x780d1=await _0xec07b3[_0x1f70b7(0x1c4)]('Creating\x20folder\x20\x27'+_0x1f582d+_0x1f70b7(0x1fb),()=>_0x1c37ee[_0x1f70b7(0x1cf)]['createFolder'](_0x5446c8[_0x1f70b7(0x212)],_0x183128));_0x577718[_0x1f70b7(0x226)](_0x1f582d,_0x780d1[_0x1f70b7(0x13f)]['id']),_0xec07b3[_0x1f70b7(0x242)]?.({'type':'folder_created','folder':_0x1f582d,'folderId':_0x780d1[_0x1f70b7(0x13f)]['id']}),_0xec07b3[_0x1f70b7(0x1b2)]?.('Created\x20folder\x20\x27'+_0x1f582d+'\x27');}return _0x577718;}export async function executePushSegmentDeletions(_0x4155e6,_0x110263,_0x37e2cd){const _0x4f6e5e=a155_0x3e8afc;if(_0x110263[_0x4f6e5e(0x140)]===0x0)return 0x0;const {batchAsync:_0x1c7001}=await import(_0x4f6e5e(0x1a8)),_0x1dbc81=0x5,_0x100638=await _0x1c7001(_0x110263,async _0x1a45d4=>{const _0x131bd4=_0x4f6e5e;return _0x37e2cd[_0x131bd4(0x242)]?.({'type':_0x131bd4(0x21b),'name':_0x1a45d4[_0x131bd4(0x1ea)]}),await _0x4155e6['segment'][_0x131bd4(0x1f4)](_0x1a45d4['id']),_0x37e2cd[_0x131bd4(0x242)]?.({'type':_0x131bd4(0x170),'name':_0x1a45d4[_0x131bd4(0x1ea)]}),_0x37e2cd[_0x131bd4(0x175)]?.(_0x131bd4(0x1a9)+_0x1a45d4[_0x131bd4(0x1ea)]+'\x27'),0x1;},_0x1dbc81);return _0x100638[_0x4f6e5e(0x1fa)]((_0x5bbc05,_0x1d4751)=>_0x5bbc05+_0x1d4751,0x0);}export async function executePushJourneys(_0x237080,_0x516ebd,_0x1ca9ea,_0x5077f0,_0x389c64){const _0x2fe200=a155_0x3e8afc,{journeyDefToRequest:_0x55df89}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x336048,yamlRuleToApi:_0x498f8e,validateSegmentRule:_0x4d139f}=await import(_0x2fe200(0x171)),_0x2f49e0={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x29e6b9=new Map(_0x1ca9ea['segmentNameToId']),_0x5b2b17=0x5;for(let _0x38b414=0x0;_0x38b414<_0x516ebd[_0x2fe200(0x140)];_0x38b414+=_0x5b2b17){const _0x4dbaba=_0x516ebd[_0x2fe200(0x195)](_0x38b414,_0x38b414+_0x5b2b17),_0x5449e8=await Promise['all'](_0x4dbaba[_0x2fe200(0x1ef)](async _0x70f1e2=>{const _0x36b2a7=_0x2fe200;if(!_0x70f1e2[_0x36b2a7(0x1f1)]&&!_0x70f1e2[_0x36b2a7(0x21c)])return{'action':'unchanged','name':_0x70f1e2['yamlConfig'][_0x36b2a7(0x1ea)],'journeyId':_0x70f1e2[_0x36b2a7(0x1bb)]?.['id']};const _0x500fc7=_0x70f1e2[_0x36b2a7(0x219)]?_0x1ca9ea['folderPathToId']['get'](_0x70f1e2['folderPath']):undefined;_0x389c64[_0x36b2a7(0x242)]?.({'type':_0x70f1e2['isNew']?_0x36b2a7(0x19a):_0x36b2a7(0x183),'name':_0x70f1e2[_0x36b2a7(0x1d8)][_0x36b2a7(0x1ea)]});try{const _0x2aab2f=await executeSingleJourneyPush(_0x237080,_0x70f1e2,{..._0x1ca9ea,'segmentNameToId':_0x29e6b9},{'parentId':_0x5077f0[_0x36b2a7(0x212)],'rootFolderId':_0x5077f0['rootFolderId'],'folderId':_0x500fc7,'verbose':_0x5077f0['verbose']},_0x389c64,{'journeyDefToRequest':_0x55df89,'activationDefToCreateRequest':_0x336048,'yamlRuleToApi':_0x498f8e,'validateSegmentRule':_0x4d139f});for(const [_0x3138fc,_0x215ccb]of _0x2aab2f[_0x36b2a7(0x165)]){_0x29e6b9[_0x36b2a7(0x226)](_0x3138fc,_0x215ccb),_0x2f49e0['embeddedSegmentNameToId']['set'](_0x3138fc,_0x215ccb);}if(_0x2aab2f['action']===_0x36b2a7(0x1ff))_0x389c64['onProgress']?.({'type':_0x36b2a7(0x1c6),'name':_0x70f1e2[_0x36b2a7(0x1d8)]['name'],'journeyId':_0x2aab2f['journeyId']}),_0x389c64['logSuccess']?.(_0x36b2a7(0x1ec)+_0x70f1e2[_0x36b2a7(0x1d8)]['name']+'\x27'),_0x2f49e0['created']++;else _0x2aab2f[_0x36b2a7(0x225)]===_0x36b2a7(0x23c)&&(_0x389c64[_0x36b2a7(0x242)]?.({'type':'journey_updated','name':_0x70f1e2[_0x36b2a7(0x1d8)][_0x36b2a7(0x1ea)]}),_0x389c64[_0x36b2a7(0x1be)]?.(_0x36b2a7(0x1d3)+_0x70f1e2[_0x36b2a7(0x1d8)]['name']+'\x27'),_0x2f49e0[_0x36b2a7(0x23c)]++);return{'action':_0x2aab2f[_0x36b2a7(0x225)],'name':_0x70f1e2[_0x36b2a7(0x1d8)][_0x36b2a7(0x1ea)],'journeyId':_0x2aab2f[_0x36b2a7(0x181)]};}catch(_0x5dec90){const _0x280bc2=isHttp400Error(_0x5dec90),_0x1eb85e=_0x280bc2?ErrorCode[_0x36b2a7(0x20a)]:ErrorCode[_0x36b2a7(0x1ce)],_0x43a851=getErrorMessage(_0x5dec90);throw new SDKError(_0x1eb85e,_0x36b2a7(0x145)+(_0x70f1e2[_0x36b2a7(0x1f1)]?_0x36b2a7(0x148):_0x36b2a7(0x206))+_0x36b2a7(0x19c)+_0x70f1e2['absolutePath']+_0x36b2a7(0x1ca)+_0x43a851,_0x5dec90);}}));_0x2f49e0[_0x2fe200(0x1cc)][_0x2fe200(0x209)](..._0x5449e8);}return _0x2f49e0;}async function matchExistingJourneySegments(_0x2c016e,_0x2a2d33,_0x8add1a,_0x3ddd9d,_0xc424ee){const _0x28e1cd=a155_0x3e8afc;if(!_0x2a2d33[_0x28e1cd(0x1bb)]||!_0x2a2d33['yamlConfig'][_0x28e1cd(0x156)])return;const _0x213096=new Map(),_0x181add=new Set();for(const _0x474dce of Object[_0x28e1cd(0x1f0)](_0x2a2d33[_0x28e1cd(0x1d8)][_0x28e1cd(0x156)])){const _0x3ede26=generateDeterministicJourneySegmentName(_0x2a2d33[_0x28e1cd(0x1d8)][_0x28e1cd(0x1ea)],_0x474dce);_0x213096[_0x28e1cd(0x226)](_0x3ede26,_0x474dce),_0x181add[_0x28e1cd(0x201)](_0x474dce);}const _0x3dce37=[],_0x897542=collectSegmentIdsFromJourneyApi(_0x2a2d33[_0x28e1cd(0x1bb)]);for(const _0x435b09 of _0x897542){const _0x3c5094=await fetchSegment(_0x2c016e,_0x8add1a,_0x435b09,_0x3ddd9d);if(!_0x3c5094?.[_0x28e1cd(0x1ea)])continue;const _0x4850a5=_0x213096[_0x28e1cd(0x1bd)](_0x3c5094[_0x28e1cd(0x1ea)]);_0x4850a5?(_0xc424ee[_0x28e1cd(0x226)](_0x4850a5,_0x435b09),_0x181add[_0x28e1cd(0x235)](_0x4850a5)):_0x3dce37[_0x28e1cd(0x209)]({'id':_0x435b09,'seg':_0x3c5094});}if(_0x181add[_0x28e1cd(0x217)]>0x0&&_0x3dce37['length']>0x0){const {localExpandedRuleToNames:_0x4d63c3}=buildLocalExpandedRuleMappings(_0x2a2d33['yamlConfig']),_0xd9cc21=new Map();for(const {id:_0x2e6e61,seg:_0x2230d3}of _0x3dce37){if(_0x2230d3[_0x28e1cd(0x237)]){const _0x100f05=apiRuleToYaml(_0x2230d3[_0x28e1cd(0x237)]);_0xd9cc21[_0x28e1cd(0x226)](_0x2e6e61,_0x100f05);}}for(const {id:_0x2cfc76,seg:_0x44b1e5}of _0x3dce37){if(!_0x44b1e5[_0x28e1cd(0x237)])continue;const _0x725b95=_0xd9cc21[_0x28e1cd(0x1bd)](_0x2cfc76);if(!_0x725b95)continue;const _0x2b930a=serializeExpandedRule(_0x725b95,_0xd9cc21),_0xcce6e=_0x4d63c3[_0x28e1cd(0x1bd)](_0x2b930a);if(_0xcce6e){const _0x560e56=_0xcce6e[_0x28e1cd(0x1d4)](_0x2a158a=>_0x181add[_0x28e1cd(0x1c9)](_0x2a158a));_0x560e56&&(_0xc424ee[_0x28e1cd(0x226)](_0x560e56,_0x2cfc76),_0x181add[_0x28e1cd(0x235)](_0x560e56),logger[_0x28e1cd(0x22b)]('Matched\x20server\x20segment\x20\x27'+_0x44b1e5['name']+_0x28e1cd(0x1dc)+_0x560e56+_0x28e1cd(0x154)));}}}}async function executeSingleJourneyPush(_0x203680,_0x5086c1,_0x2e1f5a,_0x175d9c,_0x32c89d,_0x3dcbcb){const _0x109663=a155_0x3e8afc,{journeyDefToRequest:_0x592f0e,activationDefToCreateRequest:_0x1ec983,yamlRuleToApi:_0x230876,validateSegmentRule:_0x385163}=_0x3dcbcb,_0x42d3b2=new Map(),_0x5ae881=new Map();recoverSegmentIdsFromPushRecovery(_0x5086c1,_0x42d3b2,_0x2e1f5a[_0x109663(0x1e9)]);const _0x25ac48=new Map(),_0x29e407=new Map(),_0x45ecdf=new Map();let _0x535d3c;const _0x481186=async()=>{const _0x29a872=_0x109663;if(_0x535d3c)return;_0x535d3c=new Map();if(!_0x5086c1[_0x29a872(0x1bb)])return;const _0x176a33=await _0x203680[_0x29a872(0x1e4)][_0x29a872(0x17f)](_0x5086c1[_0x29a872(0x1bb)]['id']);for(const _0x116b5e of _0x176a33){const _0x551aa6=journeyActivationStepToYaml(_0x116b5e,_0x2e1f5a[_0x29a872(0x1f7)],_0x2e1f5a[_0x29a872(0x19d)]),_0x58a2bf=activationSignature(_0x551aa6);!_0x535d3c[_0x29a872(0x1c9)](_0x58a2bf)&&_0x535d3c[_0x29a872(0x226)](_0x58a2bf,_0x116b5e['id']),_0x551aa6[_0x29a872(0x1ea)]&&_0x5ae881['set'](_0x551aa6[_0x29a872(0x1ea)],_0x116b5e['id']);}};await matchExistingJourneySegments(_0x203680,_0x5086c1,_0x175d9c['parentId'],_0x2e1f5a[_0x109663(0x15b)],_0x2e1f5a[_0x109663(0x1e9)]);const _0x1bb984={'resolveSegmentId':async _0x502558=>{const _0x3bd9af=_0x109663,_0x3c31e4=_0x2e1f5a[_0x3bd9af(0x1e9)][_0x3bd9af(0x1bd)](_0x502558);if(!_0x3c31e4)throw new SDKError(ErrorCode[_0x3bd9af(0x1a5)],_0x3bd9af(0x17d)+_0x502558+_0x3bd9af(0x1ac)+_0x5086c1['yamlConfig']['name']+')');return _0x3c31e4;},'resolveEmbeddedSegmentId':async(_0x3f756f,_0x286df1)=>{const _0x3d779c=_0x109663,_0x1bbb56=_0x2e1f5a[_0x3d779c(0x1e9)][_0x3d779c(0x1bd)](_0x3f756f);if(_0x1bbb56)return _0x1bbb56;const _0x8ddc50=_0x2e1f5a['existingSegments']['find'](_0x509c32=>_0x509c32['name']===_0x3f756f);if(_0x8ddc50)return _0x2e1f5a[_0x3d779c(0x1e9)][_0x3d779c(0x226)](_0x3f756f,_0x8ddc50['id']),_0x8ddc50['id'];if(_0x5086c1['isNew']){const {stageName:_0x56416b,criteriaName:_0x180ffa}=findSegmentCriteriaLocation(_0x5086c1['yamlConfig'],_0x3f756f);return _0x385163(_0x3f756f,_0x286df1[_0x3d779c(0x237)]),_0x29e407[_0x3d779c(0x226)](_0x3f756f,{'definition':_0x286df1,'stageName':_0x56416b,'criteriaName':_0x180ffa}),createPendingSegmentId(_0x3f756f);}const _0x5a590d=_0x5086c1[_0x3d779c(0x1bb)]?.['id'];if(!_0x5a590d)throw new SDKError(ErrorCode[_0x3d779c(0x1d9)],_0x3d779c(0x1ab));const _0x4bd12a=_0x25ac48[_0x3d779c(0x1bd)](_0x3f756f);if(_0x4bd12a)return _0x4bd12a;const _0x14c88f=((async()=>{const _0x1e3160=_0x3d779c;_0x385163(_0x3f756f,_0x286df1[_0x1e3160(0x237)]);const _0x11231e=generateDeterministicJourneySegmentName(_0x5086c1[_0x1e3160(0x1d8)][_0x1e3160(0x1ea)],_0x3f756f),_0x2c4c1c=_0x2e1f5a[_0x1e3160(0x15b)]['find'](_0x2e3e57=>_0x2e3e57[_0x1e3160(0x1ea)]===_0x11231e),_0x596f70=createSegmentIdResolver(_0x2e1f5a[_0x1e3160(0x1e9)],_0x3f756f),_0x297dda=await resolveRuleSegmentIds(_0x286df1['rule'],_0x596f70);let _0x34c28a;return _0x2c4c1c?(await _0x203680['segment'][_0x1e3160(0x1c0)](_0x175d9c[_0x1e3160(0x212)],_0x2c4c1c['id'],{'description':_0x286df1['description']||_0x1e3160(0x1b8)+_0x3f756f,'rule':_0x230876(_0x297dda),'countPopulation':!![]}),_0x34c28a=_0x2c4c1c['id'],saveSegmentToPushRecovery(_0x5086c1[_0x1e3160(0x1fd)],_0x5086c1['yamlConfig'][_0x1e3160(0x1ea)],_0x3f756f,{'segmentId':_0x34c28a,'uniqueServerName':_0x11231e,'createdAt':new Date()['toISOString']()})):_0x34c28a=await createOrRecoverEmbeddedSegment(_0x203680,_0x5086c1,{'localName':_0x3f756f,'uniqueSegmentName':_0x11231e,'description':_0x286df1['description']||'Entry\x20criteria:\x20'+_0x3f756f,'journeyId':_0x5a590d,'resolvedRule':_0x297dda,'parentId':_0x175d9c['parentId'],'folderId':_0x175d9c[_0x1e3160(0x155)]||''},_0x230876),_0x2e1f5a[_0x1e3160(0x1e9)][_0x1e3160(0x226)](_0x3f756f,_0x34c28a),_0x42d3b2[_0x1e3160(0x226)](_0x3f756f,_0x34c28a),_0x34c28a;})());_0x25ac48[_0x3d779c(0x226)](_0x3f756f,_0x14c88f);try{return await _0x14c88f;}finally{_0x25ac48[_0x3d779c(0x235)](_0x3f756f);}},'resolveActivationId':async _0x4c7102=>{const _0x56647c=_0x109663,_0x46bd0d=_0x5ae881[_0x56647c(0x1bd)](_0x4c7102);if(_0x46bd0d)return _0x46bd0d;if(_0x5086c1['existingJourney']){await _0x481186();const _0x107331=_0x5ae881[_0x56647c(0x1bd)](_0x4c7102);if(_0x107331)return _0x107331;}throw new SDKError(ErrorCode[_0x56647c(0x1b7)],_0x56647c(0x13d)+_0x4c7102+_0x56647c(0x1ac)+_0x5086c1[_0x56647c(0x1d8)][_0x56647c(0x1ea)]+_0x56647c(0x20d)+_0x56647c(0x1c1));},'resolveEmbeddedActivationId':async(_0x1fb9a0,_0x34645a)=>{const _0xa09e3e=_0x109663,_0x34ae1e=_0x5ae881['get'](_0x1fb9a0);if(_0x34ae1e)return _0x34ae1e;if(_0x5086c1['isNew'])return _0x45ecdf[_0xa09e3e(0x226)](_0x1fb9a0,_0x34645a),createPendingActivationId(_0x1fb9a0);if(_0x5086c1[_0xa09e3e(0x1bb)]){await _0x481186();const _0x588748=_0x5ae881[_0xa09e3e(0x1bd)](_0x34645a[_0xa09e3e(0x1ea)]);if(_0x588748)return _0x5ae881[_0xa09e3e(0x226)](_0x1fb9a0,_0x588748),_0x588748;const _0x571241=activationSignature(_0x34645a),_0x459181=_0x535d3c?.[_0xa09e3e(0x1bd)](_0x571241);if(_0x459181)return _0x5ae881[_0xa09e3e(0x226)](_0x1fb9a0,_0x459181),_0x459181;const _0x1352bc=await _0x1ec983(_0x34645a,_0x2e1f5a[_0xa09e3e(0x19e)]),_0x2af3c4={..._0x1352bc,..._0x34645a[_0xa09e3e(0x15d)]!==undefined&&{'runAfterJourneyRefresh':_0x34645a['run_after_journey_refresh']}},_0x446aeb=await _0x203680[_0xa09e3e(0x1e4)][_0xa09e3e(0x151)](_0x5086c1['existingJourney']['id'],_0x2af3c4);return _0x5ae881[_0xa09e3e(0x226)](_0x1fb9a0,_0x446aeb['id']),_0x446aeb['id'];}throw new SDKError(ErrorCode[_0xa09e3e(0x1d9)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x3877fb=>{const _0x201a13=_0x109663;try{return await _0x203680[_0x201a13(0x1e4)][_0x201a13(0x222)](_0x175d9c[_0x201a13(0x212)],_0x3877fb);}catch(_0x4315df){throw new SDKError(ErrorCode[_0x201a13(0x1b7)],_0x201a13(0x15c)+_0x3877fb+_0x201a13(0x1db)+_0x5086c1[_0x201a13(0x1d8)]['name']+'\x27)',_0x4315df);}},'resolveStageId':async(_0x4eb4cd,_0x20b60c)=>{const _0xb13f05=_0x109663,_0x2c83a9=await _0x203680[_0xb13f05(0x1e4)][_0xb13f05(0x1d7)](_0x4eb4cd),_0x291466=_0x2c83a9['attributes'][_0xb13f05(0x16a)]['find'](_0x15daf8=>_0x15daf8[_0xb13f05(0x1ea)][_0xb13f05(0x1bf)]()===_0x20b60c[_0xb13f05(0x1bf)]());if(!_0x291466?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0xb13f05(0x186)+_0x20b60c+_0xb13f05(0x22d)+(_0x2c83a9[_0xb13f05(0x169)][_0xb13f05(0x174)]||_0x2c83a9[_0xb13f05(0x169)][_0xb13f05(0x1ea)])+'\x27');return _0x291466['id'];}},_0xe77327=await _0x592f0e(_0x5086c1['yamlConfig'],_0x175d9c['parentId'],_0x1bb984),_0x3bc7d1=_0x175d9c[_0x109663(0x1cd)]||_0x175d9c[_0x109663(0x155)];_0x3bc7d1&&(_0xe77327[_0x109663(0x22f)]={'parentFolder':{'data':{'id':_0x3bc7d1,'type':'folder'}}});if(_0x5086c1[_0x109663(0x1f1)]){if(_0x29e407['size']>0x0||_0x45ecdf[_0x109663(0x217)]>0x0)return await executeThreeStepJourneyCreate(_0x203680,_0x5086c1,_0xe77327,{'pendingEmbeddedSegments':_0x29e407,'pendingEmbeddedActivations':_0x45ecdf,'embeddedSegmentNameToId':_0x42d3b2,'journeyActivationNameToId':_0x5ae881},{..._0x175d9c,'effectiveFolderId':_0x3bc7d1},_0x2e1f5a,_0x32c89d,_0x3dcbcb);else{ensureJourneyDefaults(_0xe77327['attributes']);const _0x20e9ae=await _0x203680['journey'][_0x109663(0x148)](_0xe77327);return deletePushRecovery(_0x5086c1[_0x109663(0x1fd)]),{'action':'created','journeyId':_0x20e9ae['id'],'embeddedSegmentNameToId':_0x42d3b2};}}else{if(_0x5086c1[_0x109663(0x21c)]&&_0x5086c1['existingJourney']){_0xe77327['id']=_0x5086c1['existingJourney']['id'];const _0x12f904=_0xe77327['attributes'];_0x5086c1[_0x109663(0x1bb)][_0x109663(0x169)]?.['journeyBundleName']&&(_0x12f904['journeyBundleName']=_0x5086c1[_0x109663(0x1bb)][_0x109663(0x169)]['journeyBundleName']);const _0x133c50=_0x5086c1[_0x109663(0x1bb)][_0x109663(0x169)]?.[_0x109663(0x16a)];return _0x133c50&&_0xe77327[_0x109663(0x169)][_0x109663(0x16a)]&&injectExistingStageIds(_0xe77327[_0x109663(0x169)]['journeyStages'],_0x133c50),ensureJourneyDefaults(_0x12f904),await _0x203680[_0x109663(0x1e4)]['update'](_0x5086c1[_0x109663(0x1bb)]['id'],_0xe77327),deletePushRecovery(_0x5086c1[_0x109663(0x1fd)]),{'action':'updated','journeyId':_0x5086c1[_0x109663(0x1bb)]['id'],'embeddedSegmentNameToId':_0x42d3b2};}}return deletePushRecovery(_0x5086c1[_0x109663(0x1fd)]),{'action':_0x109663(0x21d),'journeyId':_0x5086c1['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x42d3b2};}function findSegmentCriteriaLocation(_0x11e085,_0x2f7a3e){const _0x14b7fa=a155_0x3e8afc,_0x170b22=_0x11e085['stages']||_0x11e085[_0x14b7fa(0x1b6)]?.[0x0]?.['stages']||[];let _0x33c795='entry',_0x4a8abe=_0x2f7a3e;const _0x39fe5e=_0x11e085[_0x14b7fa(0x221)]||_0x11e085['journeys']?.[0x0]?.['goal'];if(_0x39fe5e?.[_0x14b7fa(0x1cf)]===_0x2f7a3e)return{'stageName':'goal','criteriaName':_0x39fe5e['name']||_0x2f7a3e};_0x19f7f5:for(const _0x154352 of _0x170b22){if(_0x154352[_0x14b7fa(0x218)]?.[_0x14b7fa(0x1cf)]===_0x2f7a3e){_0x33c795=_0x154352[_0x14b7fa(0x1ea)],_0x4a8abe=_0x154352['entry_criteria'][_0x14b7fa(0x1ea)]||_0x2f7a3e;break;}if(_0x154352[_0x14b7fa(0x1f5)])for(const _0x3ebf84 of _0x154352[_0x14b7fa(0x1f5)]){if(_0x3ebf84['type']==='decision_point'&&_0x3ebf84['with']?.[_0x14b7fa(0x16e)])for(const _0x21ae37 of _0x3ebf84[_0x14b7fa(0x16c)][_0x14b7fa(0x16e)]){if(_0x21ae37[_0x14b7fa(0x1cf)]===_0x2f7a3e){_0x33c795=_0x154352[_0x14b7fa(0x1ea)],_0x4a8abe=_0x21ae37['name']||_0x2f7a3e;break _0x19f7f5;}}}}return{'stageName':_0x33c795,'criteriaName':_0x4a8abe};}async function executeThreeStepJourneyCreate(_0x3f04b7,_0x5ce3a0,_0xcc729f,_0xcb8a56,_0x3287d4,_0x4e0937,_0x4fd9b4,_0x5c3076){const _0x8f6373=a155_0x3e8afc,{activationDefToCreateRequest:_0x14b87f,yamlRuleToApi:_0x19739e}=_0x5c3076,{pendingEmbeddedSegments:_0x445344,pendingEmbeddedActivations:_0x3f78fa,embeddedSegmentNameToId:_0x101e07}=_0xcb8a56,_0x1319c1=JSON[_0x8f6373(0x15f)](JSON[_0x8f6373(0x22e)](_0xcc729f));ensureJourneyDefaults(_0x1319c1[_0x8f6373(0x169)]),stripPendingIds(_0x1319c1);const _0x1f8f95=await _0x3f04b7[_0x8f6373(0x1e4)]['create'](_0x1319c1),_0x5bef8c=_0x1f8f95['id'],_0x470bde=new Map();for(const _0x55e199 of _0x1f8f95['attributes'][_0x8f6373(0x16a)]){_0x470bde[_0x8f6373(0x226)](_0x55e199[_0x8f6373(0x1ea)][_0x8f6373(0x1bf)](),_0x55e199['id']);}recoverSegmentIdsFromPushRecovery(_0x5ce3a0,_0x101e07,_0x4e0937[_0x8f6373(0x1e9)]);for(const [_0x3886df,{definition:_0x247b9c}]of _0x445344){if(_0x101e07[_0x8f6373(0x1c9)](_0x3886df)){_0x4fd9b4[_0x8f6373(0x242)]?.({'type':_0x8f6373(0x1e1),'journeyName':_0x5ce3a0['yamlConfig'][_0x8f6373(0x1ea)],'segmentName':_0x3886df});continue;}const _0x39c492=generateDeterministicJourneySegmentName(_0x5ce3a0[_0x8f6373(0x1d8)][_0x8f6373(0x1ea)],_0x3886df);_0x4fd9b4[_0x8f6373(0x242)]?.({'type':'embedded_segment_creating','journeyName':_0x5ce3a0['yamlConfig'][_0x8f6373(0x1ea)],'segmentName':_0x3886df});const _0x254174=createSegmentIdResolver(_0x4e0937[_0x8f6373(0x1e9)],_0x3886df),_0x8e2c1f=await resolveRuleSegmentIds(_0x247b9c[_0x8f6373(0x237)],_0x254174),_0x40bf3d=await createOrRecoverEmbeddedSegment(_0x3f04b7,_0x5ce3a0,{'localName':_0x3886df,'uniqueSegmentName':_0x39c492,'description':_0x247b9c[_0x8f6373(0x214)]||'Entry\x20criteria:\x20'+_0x3886df,'journeyId':_0x5bef8c,'resolvedRule':_0x8e2c1f,'parentId':_0x3287d4['parentId'],'folderId':_0x3287d4['effectiveFolderId']||''},_0x19739e);_0x101e07[_0x8f6373(0x226)](_0x3886df,_0x40bf3d),_0x4e0937['segmentNameToId'][_0x8f6373(0x226)](_0x3886df,_0x40bf3d),_0x4fd9b4['onProgress']?.({'type':_0x8f6373(0x1e1),'journeyName':_0x5ce3a0[_0x8f6373(0x1d8)][_0x8f6373(0x1ea)],'segmentName':_0x3886df});}const _0x2f42ea=new Map();for(const [_0x4a38e9,_0x5cc95c]of _0x3f78fa){_0x4fd9b4[_0x8f6373(0x242)]?.({'type':_0x8f6373(0x17c),'journeyName':_0x5ce3a0[_0x8f6373(0x1d8)][_0x8f6373(0x1ea)],'activationName':_0x4a38e9});const _0x202b0b=await _0x14b87f(_0x5cc95c,_0x4e0937[_0x8f6373(0x19e)]),_0x412c41={..._0x202b0b,..._0x5cc95c[_0x8f6373(0x15d)]!==undefined&&{'runAfterJourneyRefresh':_0x5cc95c[_0x8f6373(0x15d)]}},_0x828842=await _0x3f04b7[_0x8f6373(0x1e4)]['createActivation'](_0x5bef8c,_0x412c41);_0x2f42ea['set'](_0x4a38e9,_0x828842['id']),_0xcb8a56[_0x8f6373(0x22a)]['set'](_0x4a38e9,_0x828842['id']),_0x4fd9b4['onProgress']?.({'type':_0x8f6373(0x14a),'journeyName':_0x5ce3a0['yamlConfig'][_0x8f6373(0x1ea)],'activationName':_0x4a38e9});}const _0x488fec=JSON[_0x8f6373(0x15f)](JSON[_0x8f6373(0x22e)](_0xcc729f));return _0x488fec['id']=_0x5bef8c,ensureJourneyDefaults(_0x488fec[_0x8f6373(0x169)]),resolvePendingIdsInRequest(_0x488fec,_0xcc729f,_0x470bde,_0x101e07,_0x2f42ea,_0x4fd9b4),await _0x3f04b7['journey'][_0x8f6373(0x206)](_0x5bef8c,_0x488fec),deletePushRecovery(_0x5ce3a0[_0x8f6373(0x1fd)]),{'action':_0x8f6373(0x1ff),'journeyId':_0x5bef8c,'embeddedSegmentNameToId':_0x101e07};}export function stripWaitStepPendingIds(_0x40bf2f){const _0x4e9a1b=a155_0x3e8afc,_0x4459b4=_0x40bf2f[_0x4e9a1b(0x182)]&&isPendingSegmentId(_0x40bf2f[_0x4e9a1b(0x182)]),_0x3d616b=_0x40bf2f['conditions']?.[_0x4e9a1b(0x20e)](_0x2aab19=>_0x2aab19[_0x4e9a1b(0x1a0)]&&isPendingSegmentId(_0x2aab19[_0x4e9a1b(0x1a0)]));(_0x4459b4||_0x3d616b)&&(_0x40bf2f[_0x4e9a1b(0x189)]=_0x4e9a1b(0x1c5),_0x40bf2f[_0x4e9a1b(0x20f)]=0x1,_0x40bf2f[_0x4e9a1b(0x21a)]=_0x4e9a1b(0x1ae),delete _0x40bf2f['conditionSegmentId'],delete _0x40bf2f[_0x4e9a1b(0x16f)],delete _0x40bf2f['conditionTimeoutUnit'],delete _0x40bf2f[_0x4e9a1b(0x21f)]);}export function resolveWaitStepPendingIds(_0x78d326,_0x1999b7,_0xef8343,_0x5aef09){const _0x21b826=a155_0x3e8afc;if(_0x1999b7[_0x21b826(0x182)]&&isPendingSegmentId(_0x1999b7[_0x21b826(0x182)])){const _0xeb05d3=_0xef8343(_0x1999b7['conditionSegmentId'],_0x21b826(0x1b1)+_0x5aef09+_0x21b826(0x177));_0xeb05d3&&(_0x78d326['waitStepType']=_0x21b826(0x23e),_0x78d326['conditionSegmentId']=_0xeb05d3,delete _0x78d326['waitStep'],delete _0x78d326[_0x21b826(0x21a)],_0x1999b7[_0x21b826(0x16f)]!==undefined&&(_0x78d326[_0x21b826(0x16f)]=_0x1999b7['conditionTimeoutDuration']),_0x1999b7[_0x21b826(0x168)]&&(_0x78d326[_0x21b826(0x168)]=_0x1999b7[_0x21b826(0x168)]));}if(_0x1999b7[_0x21b826(0x21f)]){const _0x15f8d2=_0x1999b7[_0x21b826(0x21f)][_0x21b826(0x20e)](_0x3bb161=>_0x3bb161[_0x21b826(0x1a0)]&&isPendingSegmentId(_0x3bb161[_0x21b826(0x1a0)]));if(_0x15f8d2){const _0x31c080=_0x1999b7[_0x21b826(0x21f)][_0x21b826(0x1ef)](_0x986975=>{const _0x3c53d7=_0x21b826;if(_0x986975[_0x3c53d7(0x1a0)]&&isPendingSegmentId(_0x986975[_0x3c53d7(0x1a0)])){const _0x447654=_0xef8343(_0x986975[_0x3c53d7(0x1a0)],_0x3c53d7(0x1b1)+_0x5aef09+'\x27\x20wait\x20condition');return{..._0x986975,'segmentId':_0x447654||_0x986975[_0x3c53d7(0x1a0)]};}return{..._0x986975};});_0x78d326[_0x21b826(0x189)]=_0x21b826(0x23e),_0x78d326[_0x21b826(0x21f)]=_0x31c080,delete _0x78d326[_0x21b826(0x20f)],delete _0x78d326[_0x21b826(0x21a)],delete _0x78d326[_0x21b826(0x182)],delete _0x78d326[_0x21b826(0x16f)],delete _0x78d326['conditionTimeoutUnit'];}}}function stripPendingIds(_0x557a6a){const _0x1562d3=a155_0x3e8afc;_0x557a6a['attributes'][_0x1562d3(0x221)]?.[_0x1562d3(0x1a0)]&&isPendingSegmentId(_0x557a6a['attributes'][_0x1562d3(0x221)][_0x1562d3(0x1a0)])&&delete _0x557a6a[_0x1562d3(0x169)][_0x1562d3(0x221)];for(const _0x1f3574 of _0x557a6a[_0x1562d3(0x169)][_0x1562d3(0x16a)]||[]){_0x1f3574[_0x1562d3(0x196)]?.[_0x1562d3(0x1a0)]&&isPendingSegmentId(_0x1f3574['entryCriteria'][_0x1562d3(0x1a0)])&&delete _0x1f3574[_0x1562d3(0x196)];_0x1f3574['milestone']?.[_0x1562d3(0x1a0)]&&isPendingSegmentId(_0x1f3574[_0x1562d3(0x1af)][_0x1562d3(0x1a0)])&&delete _0x1f3574[_0x1562d3(0x1af)];_0x1f3574['exitCriterias']&&(_0x1f3574['exitCriterias']=_0x1f3574[_0x1562d3(0x17b)][_0x1562d3(0x220)](_0x204638=>!_0x204638[_0x1562d3(0x1a0)]||!isPendingSegmentId(_0x204638[_0x1562d3(0x1a0)])));if(_0x1f3574[_0x1562d3(0x1f5)])for(const _0x126b73 of Object[_0x1562d3(0x1f0)](_0x1f3574[_0x1562d3(0x1f5)])){const _0x5e0396=_0x1f3574[_0x1562d3(0x1f5)][_0x126b73];_0x5e0396[_0x1562d3(0x20c)]===_0x1562d3(0x223)&&_0x5e0396[_0x1562d3(0x1eb)]&&isPendingActivationId(_0x5e0396[_0x1562d3(0x1eb)])&&(_0x5e0396[_0x1562d3(0x1eb)]='');if(_0x5e0396[_0x1562d3(0x20c)]===_0x1562d3(0x190)&&_0x5e0396[_0x1562d3(0x16e)])for(const _0x1d8898 of _0x5e0396[_0x1562d3(0x16e)]){_0x1d8898[_0x1562d3(0x1a0)]&&isPendingSegmentId(_0x1d8898[_0x1562d3(0x1a0)])&&(_0x1d8898[_0x1562d3(0x1a0)]='');}_0x5e0396[_0x1562d3(0x20c)]===_0x1562d3(0x1ee)&&stripWaitStepPendingIds(_0x5e0396);}}}function resolvePendingIdsInRequest(_0x4852c8,_0x456269,_0x548a1e,_0x8443d6,_0x37a340,_0x147cf3){const _0x2e45a1=a155_0x3e8afc,_0x5f1d28=(_0x418794,_0x4d464a)=>{const _0x31154d=a155_0x4ade;if(!isPendingSegmentId(_0x418794))return _0x418794;const _0x4e6807=extractPendingSegmentName(_0x418794),_0x11745e=_0x8443d6[_0x31154d(0x1bd)](_0x4e6807);return!_0x11745e&&_0x147cf3['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x4e6807+'\x27\x20for\x20'+_0x4d464a),_0x11745e;};if(_0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x221)]?.[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x221)][_0x2e45a1(0x1a0)])){const _0x10574d=_0x5f1d28(_0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x221)][_0x2e45a1(0x1a0)],_0x2e45a1(0x241));_0x10574d&&(_0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x221)][_0x2e45a1(0x1a0)]=_0x10574d);}for(const _0x48fcc9 of _0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x16a)]||[]){const _0x1be0ba=_0x548a1e[_0x2e45a1(0x1bd)](_0x48fcc9[_0x2e45a1(0x1ea)][_0x2e45a1(0x1bf)]());_0x1be0ba&&(_0x48fcc9['id']=_0x1be0ba);if(_0x48fcc9[_0x2e45a1(0x196)]?.[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x48fcc9['entryCriteria']['segmentId'])){const _0x33259d=_0x5f1d28(_0x48fcc9['entryCriteria'][_0x2e45a1(0x1a0)],'stage\x20\x27'+_0x48fcc9[_0x2e45a1(0x1ea)]+_0x2e45a1(0x159));_0x33259d&&(_0x48fcc9[_0x2e45a1(0x196)][_0x2e45a1(0x1a0)]=_0x33259d);}if(_0x48fcc9['exitCriterias'])for(const _0x150968 of _0x48fcc9[_0x2e45a1(0x17b)]){if(_0x150968[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x150968[_0x2e45a1(0x1a0)])){const _0x9f7d30=_0x5f1d28(_0x150968[_0x2e45a1(0x1a0)],_0x2e45a1(0x1b1)+_0x48fcc9[_0x2e45a1(0x1ea)]+_0x2e45a1(0x141));_0x9f7d30&&(_0x150968[_0x2e45a1(0x1a0)]=_0x9f7d30);}}if(_0x48fcc9[_0x2e45a1(0x1af)]?.[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x48fcc9[_0x2e45a1(0x1af)]['segmentId'])){const _0x5cfc16=_0x5f1d28(_0x48fcc9[_0x2e45a1(0x1af)][_0x2e45a1(0x1a0)],_0x2e45a1(0x1b1)+_0x48fcc9[_0x2e45a1(0x1ea)]+_0x2e45a1(0x1b3));_0x5cfc16&&(_0x48fcc9[_0x2e45a1(0x1af)][_0x2e45a1(0x1a0)]=_0x5cfc16);}if(_0x48fcc9[_0x2e45a1(0x1f5)]){const _0x58deca=_0x407b8d=>_0x456269[_0x2e45a1(0x169)][_0x2e45a1(0x16a)]?.['find'](_0x31f15c=>_0x31f15c['name']['toLowerCase']()===_0x48fcc9['name']['toLowerCase']())?.['steps']?.[_0x407b8d];for(const _0x57da17 of Object[_0x2e45a1(0x1f0)](_0x48fcc9[_0x2e45a1(0x1f5)])){const _0x5576ff=_0x48fcc9[_0x2e45a1(0x1f5)][_0x57da17],_0x1e90b8=_0x58deca(_0x57da17);if(_0x5576ff['type']===_0x2e45a1(0x223)&&_0x5576ff[_0x2e45a1(0x1eb)]&&(isPendingActivationId(_0x5576ff['journeyActivationStepId'])||_0x5576ff['journeyActivationStepId']==='')){if(_0x1e90b8?.[_0x2e45a1(0x1eb)]&&isPendingActivationId(_0x1e90b8[_0x2e45a1(0x1eb)])){const _0x3874c5=extractPendingActivationName(_0x1e90b8['journeyActivationStepId']),_0x5cfac3=_0x37a340[_0x2e45a1(0x1bd)](_0x3874c5);_0x5cfac3&&(_0x5576ff['journeyActivationStepId']=_0x5cfac3);}}if(_0x5576ff['type']===_0x2e45a1(0x190)&&_0x5576ff[_0x2e45a1(0x16e)]&&_0x1e90b8?.[_0x2e45a1(0x16e)])for(let _0x1ed25d=0x0;_0x1ed25d<_0x5576ff['branches'][_0x2e45a1(0x140)];_0x1ed25d++){const _0x2a2974=_0x5576ff[_0x2e45a1(0x16e)][_0x1ed25d],_0x8c2fb4=_0x1e90b8[_0x2e45a1(0x16e)][_0x1ed25d];if(_0x8c2fb4?.[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x8c2fb4['segmentId'])){const _0x4712e4=_0x5f1d28(_0x8c2fb4[_0x2e45a1(0x1a0)],_0x2e45a1(0x1b1)+_0x48fcc9[_0x2e45a1(0x1ea)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x2a2974[_0x2e45a1(0x1ea)]||_0x1ed25d)+'\x27');_0x4712e4&&(_0x2a2974[_0x2e45a1(0x1a0)]=_0x4712e4);}}_0x5576ff[_0x2e45a1(0x20c)]===_0x2e45a1(0x1ee)&&_0x1e90b8?.[_0x2e45a1(0x20c)]===_0x2e45a1(0x1ee)&&resolveWaitStepPendingIds(_0x5576ff,_0x1e90b8,_0x5f1d28,_0x48fcc9[_0x2e45a1(0x1ea)]);}}}}
1
+ (function(_0x15684c,_0x315bb3){const _0x3121f8=a155_0x2858,_0x26ee65=_0x15684c();while(!![]){try{const _0x3f4f9a=-parseInt(_0x3121f8(0x1f6))/0x1*(-parseInt(_0x3121f8(0x215))/0x2)+-parseInt(_0x3121f8(0x29e))/0x3*(-parseInt(_0x3121f8(0x1fd))/0x4)+-parseInt(_0x3121f8(0x2a2))/0x5*(-parseInt(_0x3121f8(0x21e))/0x6)+-parseInt(_0x3121f8(0x218))/0x7*(parseInt(_0x3121f8(0x1f1))/0x8)+-parseInt(_0x3121f8(0x281))/0x9+parseInt(_0x3121f8(0x282))/0xa+-parseInt(_0x3121f8(0x25d))/0xb;if(_0x3f4f9a===_0x315bb3)break;else _0x26ee65['push'](_0x26ee65['shift']());}catch(_0x333216){_0x26ee65['push'](_0x26ee65['shift']());}}}(a155_0x5a28,0xbc502));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x1dd188){return''+PENDING_SEGMENT_PREFIX+_0x1dd188+'__';}export function isPendingSegmentId(_0x3b8504){const _0x398e3c=a155_0x2858;return _0x3b8504[_0x398e3c(0x229)](PENDING_SEGMENT_PREFIX)&&!_0x3b8504['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x3eb337){const _0x47bd8b=a155_0x2858;return _0x3eb337[_0x47bd8b(0x290)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5c5f0b){return''+PENDING_ACTIVATION_PREFIX+_0x5c5f0b+'__';}export function isPendingActivationId(_0x452030){const _0x39403a=a155_0x2858;return _0x452030[_0x39403a(0x229)](PENDING_ACTIVATION_PREFIX);}function a155_0x2858(_0x3392a8,_0x413599){_0x3392a8=_0x3392a8-0x1bc;const _0x5a28bf=a155_0x5a28();let _0x2858d2=_0x5a28bf[_0x3392a8];return _0x2858d2;}export function extractPendingActivationName(_0x3966bb){const _0x109fab=a155_0x2858;return _0x3966bb[_0x109fab(0x290)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x47b896,_0x51c5ae){const _0x327235=a155_0x2858,_0x246973=_0x47b896+'::'+(_0x51c5ae['trim']()||'segment'),_0x409ba9=createHash('sha1')['update'](_0x246973)[_0x327235(0x2a9)](_0x327235(0x210))[_0x327235(0x2a1)](0x0,0xc);return'journey_entry_criteria_'+_0x409ba9;}export function ensureJourneyDefaults(_0x4db790){const _0x4adc93=a155_0x2858;!_0x4db790[_0x4adc93(0x25a)]&&(_0x4db790[_0x4adc93(0x25a)]=''),!_0x4db790[_0x4adc93(0x1da)]&&(_0x4db790[_0x4adc93(0x1da)]=_0x4adc93(0x28e));}export function injectExistingStageIds(_0x54758c,_0x45e3ec){const _0x3679f0=a155_0x2858,_0x20e1ec=new Map(_0x45e3ec[_0x3679f0(0x2a0)](_0x41ec14=>[_0x41ec14[_0x3679f0(0x243)],_0x41ec14['id']]));for(const _0x30d284 of _0x54758c){if(!_0x30d284['id']){const _0x621907=_0x20e1ec['get'](_0x30d284[_0x3679f0(0x243)]);_0x621907&&(_0x30d284['id']=_0x621907);}}}export function resolveTDFolderPath(_0x37d18f,_0x4dc149,_0x54ba9c){const _0x2efb87=a155_0x2858;if(!_0x4dc149)return _0x37d18f;if(_0x37d18f===_0x54ba9c||_0x37d18f[_0x2efb87(0x229)](_0x54ba9c+'/'))return _0x37d18f;return _0x37d18f?_0x54ba9c+'/'+_0x37d18f:_0x54ba9c;}export function addFoldersToCreate(_0xd68a66,_0x276714,_0x1ea277){const _0x4dd812=a155_0x2858;if(!_0xd68a66)return;if(_0x276714[_0x4dd812(0x1e8)](_0xd68a66))return;const _0xc255a9=_0xd68a66['split']('/');let _0x4bf690='';for(const _0x4832f1 of _0xc255a9){_0x4bf690=_0x4bf690?_0x4bf690+'/'+_0x4832f1:_0x4832f1,!_0x276714[_0x4dd812(0x1e8)](_0x4bf690)&&_0x1ea277[_0x4dd812(0x2ab)](_0x4bf690);}}export function sortFoldersByDepth(_0x3fee71){const _0x951ef1=a155_0x2858;return[..._0x3fee71][_0x951ef1(0x23c)]((_0x4f8dd7,_0x521181)=>{const _0x5cad52=_0x951ef1,_0x5684be=(_0x4f8dd7[_0x5cad52(0x26d)](/\//g)||[])[_0x5cad52(0x2bf)],_0x2aaa38=(_0x521181['match'](/\//g)||[])['length'];return _0x5684be-_0x2aaa38;});}import*as a155_0x4e0291 from'yaml';import{readFileSync}from'fs';import a155_0x3c0fa5 from'path';import{isJourneyDef,parseYamlString as a155_0x6de56d,toYamlString as a155_0x131aa0,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(_0x3e0c11){const _0x2a500d=a155_0x2858;if(Array['isArray'](_0x3e0c11))return'['+_0x3e0c11[_0x2a500d(0x2a0)](_0x5eaf2e=>stableStringify(_0x5eaf2e))['join'](',')+']';if(_0x3e0c11&&typeof _0x3e0c11===_0x2a500d(0x254)){const _0x52e345=_0x3e0c11,_0x301b6d=Object[_0x2a500d(0x1cb)](_0x52e345)[_0x2a500d(0x23c)](),_0x1abb31=_0x301b6d['map'](_0x2700d0=>'\x22'+_0x2700d0+'\x22:'+stableStringify(_0x52e345[_0x2700d0]));return'{'+_0x1abb31[_0x2a500d(0x1de)](',')+'}';}const _0x10b458=JSON[_0x2a500d(0x230)](_0x3e0c11);return _0x10b458===undefined?'null':_0x10b458;}function activationSignature(_0x5ddba4){const _0xb06d75=a155_0x2858,_0x10d8b4={'connection':_0x5ddba4[_0xb06d75(0x1f2)],..._0x5ddba4[_0xb06d75(0x25b)]!==undefined&&{'all_columns':_0x5ddba4['all_columns']},..._0x5ddba4['columns']!==undefined&&{'columns':_0x5ddba4[_0xb06d75(0x246)]},..._0x5ddba4[_0xb06d75(0x270)]!==undefined&&{'behavior':_0x5ddba4['behavior']},..._0x5ddba4['schedule']!==undefined&&{'schedule':_0x5ddba4[_0xb06d75(0x203)]},..._0x5ddba4['notification']!==undefined&&{'notification':_0x5ddba4[_0xb06d75(0x20b)]},..._0x5ddba4[_0xb06d75(0x2c1)]!==undefined&&{'connector_config':_0x5ddba4[_0xb06d75(0x2c1)]},..._0x5ddba4[_0xb06d75(0x216)]!==undefined&&{'activation_template_id':_0x5ddba4['activation_template_id']}};return stableStringify(_0x10d8b4);}async function fetchSegment(_0x268be6,_0x43af71,_0xec87d2,_0x507ff5){const _0x4408ee=a155_0x2858,_0x2ed33c=_0x507ff5?.[_0x4408ee(0x264)](_0x4d038c=>_0x4d038c['id']===_0xec87d2);if(_0x2ed33c)return _0x2ed33c;try{return await _0x268be6[_0x4408ee(0x1d9)][_0x4408ee(0x1ee)](_0x43af71,_0xec87d2);}catch(_0x3d4bf5){logger[_0x4408ee(0x2b6)](_0x4408ee(0x261)+_0xec87d2+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x3d4bf5);try{return await _0x268be6[_0x4408ee(0x1d9)][_0x4408ee(0x223)](_0xec87d2);}catch(_0x543195){return logger[_0x4408ee(0x2b6)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0xec87d2+':\x20'+_0x543195),null;}}}function recoverSegmentIdsFromPushRecovery(_0xaa540b,_0x439339,_0x29623a){const _0x12c053=a155_0x2858,_0x1f1e32=readPushRecovery(_0xaa540b['absolutePath']);if(_0x1f1e32?.[_0x12c053(0x211)]===_0xaa540b[_0x12c053(0x242)][_0x12c053(0x243)])for(const [_0x5092b1,_0x5d1dd6]of Object[_0x12c053(0x1e0)](_0x1f1e32[_0x12c053(0x26f)])){const _0x179574=generateDeterministicJourneySegmentName(_0xaa540b['yamlConfig'][_0x12c053(0x243)],_0x5092b1);_0x5d1dd6[_0x12c053(0x1cc)]===_0x179574&&(_0x439339['set'](_0x5092b1,_0x5d1dd6[_0x12c053(0x25e)]),_0x29623a[_0x12c053(0x1db)](_0x5092b1,_0x5d1dd6['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x4a384d,_0x1d82a5,_0x1202c8,_0x3fbf9d){const _0x27557c=a155_0x2858;let _0x2c2b5e;try{_0x2c2b5e=await _0x4a384d[_0x27557c(0x1d9)][_0x27557c(0x279)]({'name':_0x1202c8[_0x27557c(0x237)],'description':_0x1202c8[_0x27557c(0x25a)],'journeyId':_0x1202c8[_0x27557c(0x2ba)],'rule':_0x3fbf9d(_0x1202c8[_0x27557c(0x2b3)],!![]),'countPopulation':!![],'parentFolderId':_0x1202c8[_0x27557c(0x2b1)],'audienceId':_0x1202c8[_0x27557c(0x253)]});}catch(_0x1ac89e){const _0xa80462=_0x1ac89e instanceof Error&&_0x1ac89e['message'][_0x27557c(0x231)](_0x27557c(0x1c9));if(_0xa80462){const _0x240240=readPushRecovery(_0x1d82a5[_0x27557c(0x219)]),_0x4bf9ac=_0x240240?.[_0x27557c(0x211)]===_0x1d82a5[_0x27557c(0x242)]['name']?_0x240240[_0x27557c(0x26f)][_0x1202c8[_0x27557c(0x267)]]:undefined;if(_0x4bf9ac?.[_0x27557c(0x1cc)]===_0x1202c8['uniqueSegmentName'])await _0x4a384d['segment'][_0x27557c(0x22d)](_0x1202c8[_0x27557c(0x253)],_0x4bf9ac[_0x27557c(0x25e)],{'description':_0x1202c8['description'],'rule':_0x3fbf9d(_0x1202c8[_0x27557c(0x2b3)],!![]),'countPopulation':!![]}),_0x2c2b5e=_0x4bf9ac[_0x27557c(0x25e)];else throw new SDKError(ErrorCode[_0x27557c(0x29b)],_0x27557c(0x1fa)+_0x1202c8['localName']+_0x27557c(0x23e)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x1d82a5['absolutePath'][_0x27557c(0x290)](/([^/]+)$/,_0x27557c(0x1bc))+')\x20')+_0x27557c(0x2c3),_0x1ac89e);}else throw _0x1ac89e;}return saveSegmentToPushRecovery(_0x1d82a5[_0x27557c(0x219)],_0x1d82a5[_0x27557c(0x242)][_0x27557c(0x243)],_0x1202c8[_0x27557c(0x267)],{'segmentId':_0x2c2b5e,'uniqueServerName':_0x1202c8[_0x27557c(0x237)],'createdAt':new Date()['toISOString']()}),_0x2c2b5e;}export async function prepareSegmentFiles(_0x42b9c6,_0x3f5680,_0x3be6ae,_0x29e709,_0x94c5c3){const _0xf49da=a155_0x2858,{activationDefToCreateRequest:_0x213b46}=await import(_0xf49da(0x1ec)),_0x1ab3eb=[],_0xa64062=new Set();for(const {yamlConfig:_0x39d9a9,folderPath:_0x4427cc,sourcePath:_0x23c174}of _0x42b9c6){const _0x24b880=resolveTDFolderPath(_0x4427cc,_0x29e709,_0x94c5c3),_0x419509=_0x24b880+':'+_0x39d9a9['name'],_0x92db6e=_0x3f5680[_0xf49da(0x2af)][_0xf49da(0x28d)](_0x419509),_0x18f878=_0x92db6e?_0x3f5680['activationsBySegmentId'][_0xf49da(0x28d)](_0x92db6e['id'])||[]:[];addFoldersToCreate(_0x24b880,_0x3f5680[_0xf49da(0x25c)],_0xa64062);const _0x5d3e68=calculateActivationActions(_0x39d9a9['activations']||[],_0x18f878,_0x3f5680[_0xf49da(0x277)],_0x3f5680['connectionIdToNameMap']);for(const _0x5ae298 of _0x5d3e68){(_0x5ae298[_0xf49da(0x1df)]===_0xf49da(0x297)||_0x5ae298[_0xf49da(0x1df)]===_0xf49da(0x1d4))&&_0x5ae298[_0xf49da(0x1fc)]&&(_0x5ae298[_0xf49da(0x2a5)]=await _0x213b46(_0x5ae298[_0xf49da(0x1fc)],_0x3be6ae));}const _0x5505d0=calculateSegmentDiff(_0x39d9a9,_0x92db6e,_0x18f878,_0x3f5680[_0xf49da(0x277)],_0x3f5680['connectionIdToNameMap']);_0x1ab3eb[_0xf49da(0x25f)]({'relativePath':_0x39d9a9[_0xf49da(0x243)],'absolutePath':_0x23c174,'yamlConfig':_0x39d9a9,'folderPath':_0x24b880,'existingSegment':_0x92db6e,'existingActivations':_0x18f878,'isNew':_0x5505d0[_0xf49da(0x293)],'hasChanges':_0x5505d0[_0xf49da(0x21a)],'diff':_0x5505d0['diff'],'activationActions':_0x5d3e68});}return{'segmentFiles':_0x1ab3eb,'foldersToCreate':_0xa64062};}export async function prepareJourneyFiles(_0x5d80f2,_0x2ba0ed,_0x138897,_0x300f5c){const _0x1b51e5=a155_0x2858,_0x191c06=[],_0x2e79a8=new Set();for(const {yamlConfig:_0x2547f0,folderPath:_0x123841,sourcePath:_0x4c87a0}of _0x5d80f2){const _0x50434c=resolveTDFolderPath(_0x123841,_0x138897,_0x300f5c),_0x4c0627=_0x50434c+':'+_0x2547f0['name'],_0x156f18=_0x2ba0ed['journeyBundlesByFolderAndName'][_0x1b51e5(0x28d)](_0x4c0627);let _0x3a2a1f,_0x323e34;if(_0x156f18&&_0x156f18[_0x1b51e5(0x2bf)]>0x0){const _0x53b022=buildLocalExpandedRuleMappings(_0x2547f0),{createYamlContext:_0x345b6d,prefetchJourneySegments:_0x290275}=createPushYamlContextForBundle(_0x2ba0ed[_0x1b51e5(0x2b8)],_0x2ba0ed[_0x1b51e5(0x253)],_0x2ba0ed[_0x1b51e5(0x1e5)],_0x53b022,_0x2ba0ed[_0x1b51e5(0x277)],_0x2ba0ed['connectionIdToNameMap'],_0x2ba0ed[_0x1b51e5(0x217)],_0x2ba0ed[_0x1b51e5(0x2bc)]);await _0x290275(_0x156f18[_0x1b51e5(0x2a0)](_0x36f0cb=>_0x36f0cb['id']));const _0x4fedf7=await _0x2ba0ed[_0x1b51e5(0x2b8)][_0x1b51e5(0x2a8)][_0x1b51e5(0x257)](_0x156f18[0x0][_0x1b51e5(0x22f)]),_0x28a4e1=hasMultipleVersions(_0x2547f0),_0x3118ef=async _0x66042b=>{const _0x5a4a20=_0x1b51e5,_0x2abe2d=_0x2ba0ed[_0x5a4a20(0x2bc)]?.[_0x5a4a20(0x28d)](_0x66042b);if(_0x2abe2d)return _0x2abe2d;return _0x2ba0ed[_0x5a4a20(0x2ad)]({'journeyId':_0x66042b,'journeyName':_0x2547f0[_0x5a4a20(0x243)],'isMultiVersion':_0x156f18[_0x5a4a20(0x2bf)]>0x1});};if(_0x28a4e1&&_0x156f18[_0x1b51e5(0x2bf)]>0x1){const _0xd89c40=[];for(const _0x35541e of _0x156f18){const _0x4f5528=_0x35541e['versionNumber']||0x1;_0x2ba0ed[_0x1b51e5(0x288)]?.[_0x1b51e5(0x1d4)](_0x1b51e5(0x278)+_0x2547f0[_0x1b51e5(0x243)]+'\x20v'+_0x4f5528);const _0x287b8f=await _0x3118ef(_0x35541e['id']),_0x557630=_0x345b6d(_0x35541e['id']),_0x71a80f=await journeyResponseToDef(_0x287b8f,_0x557630);_0xd89c40[_0x1b51e5(0x25f)]({'item':_0x35541e,'yaml':_0x71a80f});}const _0x369fe0=buildLocalRuleToNameMappingFromJourney(_0x2547f0);_0x323e34=buildMergedJourneyDef(_0xd89c40,_0x369fe0,_0x4fedf7);const _0x27f91b=Math['max'](..._0xd89c40[_0x1b51e5(0x2a0)](_0x129b56=>_0x129b56[_0x1b51e5(0x221)][_0x1b51e5(0x1f8)]||0x0)),_0x15ee87=_0x156f18[_0x1b51e5(0x264)](_0x3f7f50=>(_0x3f7f50[_0x1b51e5(0x1f8)]||0x0)===_0x27f91b);_0x15ee87&&(_0x2ba0ed[_0x1b51e5(0x288)]?.[_0x1b51e5(0x1d4)](_0x1b51e5(0x278)+_0x2547f0[_0x1b51e5(0x243)]+'\x20v'+_0x27f91b),_0x3a2a1f=await _0x3118ef(_0x15ee87['id']));}else{const _0x3dc64b=_0x156f18[_0x156f18[_0x1b51e5(0x2bf)]-0x1];_0x2ba0ed[_0x1b51e5(0x288)]?.[_0x1b51e5(0x1d4)]('Fetching\x20'+_0x2547f0['name']),_0x3a2a1f=await _0x3118ef(_0x3dc64b['id']);const _0x1faf72=_0x345b6d(_0x3dc64b['id']),_0x2c78ca=await journeyResponseToDef(_0x3a2a1f,_0x1faf72),_0x28a800=buildLocalRuleToNameMappingFromJourney(_0x2547f0);_0x323e34=buildMergedJourneyDef([{'item':_0x3dc64b,'yaml':_0x2c78ca}],_0x28a800,_0x4fedf7);}}addFoldersToCreate(_0x50434c,_0x2ba0ed[_0x1b51e5(0x25c)],_0x2e79a8);const _0x5d3998=calculateJourneyDiff(_0x2547f0,_0x323e34);_0x191c06[_0x1b51e5(0x25f)]({'relativePath':_0x2547f0[_0x1b51e5(0x243)],'absolutePath':_0x4c87a0,'yamlConfig':_0x2547f0,'folderPath':_0x50434c,'existingJourney':_0x3a2a1f,'isNew':_0x5d3998[_0x1b51e5(0x293)],'hasChanges':_0x5d3998[_0x1b51e5(0x21a)],'diff':_0x5d3998[_0x1b51e5(0x245)]});}return{'journeyFiles':_0x191c06,'foldersToCreate':_0x2e79a8};}export function calculateActivationActions(_0x4d37dd,_0x10b0cf,_0x36cc7e,_0xd86f41){const _0x50c8cd=a155_0x2858,_0xdb7b53=[],_0x5df2e7=new Map();for(const _0x2e5011 of _0x10b0cf){_0x5df2e7['set'](_0x2e5011[_0x50c8cd(0x243)],_0x2e5011);}const _0x26874c=new Map();for(const _0x4154c0 of _0x4d37dd){_0x26874c[_0x50c8cd(0x1db)](_0x4154c0[_0x50c8cd(0x243)],_0x4154c0);}for(const _0x3495e0 of _0x4d37dd){const _0x11e372=_0x5df2e7[_0x50c8cd(0x28d)](_0x3495e0[_0x50c8cd(0x243)]);if(!_0x11e372)_0xdb7b53['push']({'type':'create','name':_0x3495e0[_0x50c8cd(0x243)],'yamlActivation':_0x3495e0});else{const _0x5b8cbf=activationResponseToDef(_0x11e372,_0x36cc7e,_0xd86f41),_0x468d86=a155_0x4e0291[_0x50c8cd(0x230)](_0x5b8cbf),_0x49ad8e=a155_0x4e0291[_0x50c8cd(0x230)](_0x3495e0);_0x468d86!==_0x49ad8e&&_0xdb7b53['push']({'type':_0x50c8cd(0x1d4),'name':_0x3495e0[_0x50c8cd(0x243)],'yamlActivation':_0x3495e0,'existingActivation':_0x11e372});}}for(const _0x49765b of _0x10b0cf){!_0x26874c['has'](_0x49765b['name'])&&_0xdb7b53['push']({'type':'delete','name':_0x49765b['name'],'existingActivation':_0x49765b});}return _0xdb7b53;}function calculateYamlDiff(_0x3e8f8f,_0xabdb96){if(_0xabdb96){const _0x3783dc=generateDiff(_0xabdb96,_0x3e8f8f),_0x414e1a=hasChanges(_0x3783dc);return{'isNew':![],'hasChanges':_0x414e1a,'diff':_0x414e1a?formatDiffWithColors(_0x3783dc):undefined};}const _0x43b681=generateDiff('',_0x3e8f8f);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x43b681)};}export function calculateSegmentDiff(_0x4cf4e7,_0x30c78e,_0x409e93,_0x5d2064,_0x2197ea){const _0x5088bf=segmentToYamlString(_0x4cf4e7),_0x1766d2=_0x30c78e?segmentToYamlString(segmentWithActivationsToYaml(_0x30c78e,_0x409e93,undefined,_0x5d2064,_0x2197ea)):undefined;return calculateYamlDiff(_0x5088bf,_0x1766d2);}export function calculateJourneyDiff(_0x1269e3,_0x2fec04){const _0x6ec99b=normalizeJourneyDef(_0x1269e3,_0x1269e3),_0x5920ab=a155_0x131aa0(_0x6ec99b),_0x203d73=_0x2fec04?a155_0x131aa0(normalizeJourneyDef(_0x2fec04,_0x1269e3)):undefined;return calculateYamlDiff(_0x5920ab,_0x203d73);}export function findSegmentsToDelete(_0x1a07ce,_0x1a6983,_0x53e95d,_0x26ceb4,_0x195c42){const _0x1469fd=a155_0x2858,_0x142bf5=new Set();for(const {yamlConfig:_0x587a4a,folderPath:_0x5d23cc}of _0x1a6983){_0x142bf5['add'](_0x5d23cc+':'+_0x587a4a[_0x1469fd(0x243)]);}return _0x1a07ce[_0x1469fd(0x27e)](_0x581bc5=>{const _0x34d11a=_0x1469fd,_0x202b2e=_0x581bc5[_0x34d11a(0x1cf)]?_0x53e95d[_0x34d11a(0x28d)](_0x581bc5['segmentFolderId'][_0x34d11a(0x2b4)]())||'':'',_0x7c9a2d=_0x202b2e+':'+_0x581bc5[_0x34d11a(0x243)];if(_0x142bf5[_0x34d11a(0x1e8)](_0x7c9a2d))return![];if(_0x195c42)return _0x202b2e===_0x26ceb4||_0x202b2e[_0x34d11a(0x229)](_0x26ceb4+'/');return!![];});}function a155_0x5a28(){const _0xa253e9=['validatedRequest','\x0a\x20\x20','existingSegment','journey','digest','Failed\x20to\x20resolve\x20segment\x20','add','DecisionPoint','fetchJourney','activation_updating','segmentByFolderAndName','created','folderId','nameToType','resolvedRule','toString','journey_updating','debug','toISOString','deps','run_after_journey_refresh','journeyId','conditions','journeyById','Stage\x20\x27','journeyStages','length','./journey-yaml.js','connector_config','activation_deleted','and\x20the\x20server\x20segment,\x20then\x20retry.','.$1.push-recovery.json','\x27\x20milestone','\x20activation\x20\x27','INTERNAL','activation_creating','\x27\x20entry\x20criteria','Updated\x20activation\x20\x27','skipSegments','Journey\x20\x27','NOT_FOUND','Failed\x20to\x20','flatMap','embedded_activation_created','Name\x20has\x20already\x20been\x20taken','results','keys','uniqueServerName','folderPath','conditionSegmentId','segmentFolderId','Activation','Matched\x20server\x20segment\x20\x27','createdSegmentId','rootFolderId','update','delete','segment_updated','relative','existingJourney','segment','state','set','Created\x20segment\x20\x27','waitStepUnit','join','type','entries','Creating\x20segment\x20\x27','listActivations','Entry\x20criteria:\x20','kind','existingSegments','folder','Segment\x20not\x20found','has','segment_updating','Creating\x20activation\x20\x27','segment_deleted','./child-segment-yaml.js','Creating\x20folder\x20\x27','getSegment','createFolder','day','10576pkLXpx','connection','Deleting\x20activation\x20\x27','journeyBundleName','\x20segment\x20from\x20file:\x20','1131859VFcOVg','journeyActivationNameToId','versionNumber','JOURNEY_UPDATE_ERROR','Embedded\x20segment\x20\x27','deleteSegment','yamlActivation','796dJIhcl','journeys','some','existingActivation','ACTIVATION_UPDATE_ERROR','verbose','schedule','branches','unchanged','waitStepType','values','stage\x20\x27','\x27\x20not\x20found\x20in\x20journey\x20\x27','parse','notification','max','index','activation_created','dirname','hex','journeyName','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','parentFolder','\x20error(s)','2fDBHGZ','activation_template_id','activationStepsById','77eWqlie','absolutePath','hasChanges','\x27...','Created\x20folder\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','1232172BzDhSE','activation_updated','journey_creating','item','size','getSegmentEntity','stages','segment_deleting','data','onProgress','attributes','startsWith','Created\x20activation\x20\x27','Activation\x20not\x20found:\x20','goal\x20criteria','updateSegmentById','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','journeyBundleId','stringify','includes','\x27\x20from\x20file:\x20','conditionTimeoutDuration','waitStep','activationContext','journeyActivationStepId','uniqueSegmentName','activations','reduce','Condition','connectionIdToNameMap','sort','entry_criteria','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','getActivation','Failed\x20to\x20resolve\x20activation\x20','embeddedSegmentNameToId','yamlConfig','name','rule','diff','columns','Updating\x20segment\x20\x27','Updated\x20segment\x20\x27','\x20journey\x20from\x20file:\x20','\x27\x20to\x20local\x20\x27','toLowerCase','from','Deleted\x20segment\x20\x27','list','parseDocument','entry','resolveSegment','):\x20','parentId','object','logDeleted','activation_deleting','getLatestJourneyId','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','user','description','all_columns','folderPathToId','8434151FgeqWX','segmentId','push','activationParams','getSegment\x20failed\x20for\x20','activationActions','segmentNameToId','find','updated','withProgress','localName','getJourney','milestone','journey_created','folder_creating','with','match','deleted','segments','behavior','action','WaitStep','exitCriterias','conditionTimeoutUnit','steps','decision_point','idToEmailMap','Fetching\x20','createJourneySegment','embedded_segment_created','all','valid','split','filter','\x27\x20decision\x20point\x20branch\x20\x27','logInfo','10670265OwojRD','5705560QZFxpU','\x27\x20exit\x20criteria','../../utils/async.js','SEGMENT_NOT_FOUND','createdSegmentIds','goal','progress','journey_updated','logWarning','createSegment','Segment\x20not\x20found:\x20','get','draft','createActivation','replace','\x27\x20by\x20rule\x20content','entryCriteria','isNew','effectiveFolderId','utf-8','logSuccess','create','\x20(referenced\x20in\x20journey\x20','SEGMENT_SYNTAX_ERROR','parentSegmentFolder','SEGMENT_UPDATE_ERROR','idToName','embedded_activation_creating','9423GMpKtg','deleteActivation','map','slice','10eHfADn','updateActivation','relationships'];a155_0x5a28=function(){return _0xa253e9;};return a155_0x5a28();}export function findJourneysToDelete(_0x5c1bb9,_0x1fba34,_0xf90f30,_0x41a3d6,_0x2bbb26){const _0x40e174=a155_0x2858,_0xb6f654=new Set();for(const {yamlConfig:_0x4733f3,folderPath:_0x593bae}of _0x1fba34){_0xb6f654[_0x40e174(0x2ab)](_0x593bae+':'+_0x4733f3[_0x40e174(0x243)]);}return _0x5c1bb9['filter'](_0x5929c6=>{const _0x138fb4=_0x40e174,_0xdf5565=_0x5929c6['folderId']?_0xf90f30[_0x138fb4(0x28d)](_0x5929c6[_0x138fb4(0x2b1)])||'':'',_0x3c1fad=_0xdf5565+':'+_0x5929c6[_0x138fb4(0x1f4)];if(_0xb6f654['has'](_0x3c1fad))return![];if(_0x2bbb26)return _0xdf5565===_0x41a3d6||_0xdf5565[_0x138fb4(0x229)](_0x41a3d6+'/');return!![];});}export function buildSegmentLookupMap(_0x2971d4,_0x52eeec){const _0xecd08e=a155_0x2858,_0x7f9bef=new Map();for(const _0x2df9ff of _0x2971d4){const _0x448041=_0x2df9ff['segmentFolderId']?_0x52eeec[_0xecd08e(0x28d)](_0x2df9ff[_0xecd08e(0x1cf)]['toString']())||'':'',_0x374521=_0x448041+':'+_0x2df9ff[_0xecd08e(0x243)];_0x7f9bef[_0xecd08e(0x1db)](_0x374521,_0x2df9ff);}return _0x7f9bef;}export function buildSegmentNameToIdMap(_0x2e82f2){const _0x1201c4=a155_0x2858,_0x38ab79=new Map();for(const _0x50001e of _0x2e82f2){_0x38ab79[_0x1201c4(0x1db)](_0x50001e['name'],_0x50001e['id']);}return _0x38ab79;}export function buildJourneyBundleLookupMap(_0x15610a,_0x55b442){const _0x3e1585=a155_0x2858,_0x20c4ea=new Map();for(const _0x445f4e of _0x15610a){const _0x18b0a1=_0x445f4e[_0x3e1585(0x2b1)]?_0x55b442[_0x3e1585(0x28d)](_0x445f4e[_0x3e1585(0x2b1)])||'':'',_0x4ed8b4=_0x18b0a1+':'+_0x445f4e[_0x3e1585(0x1f4)];!_0x20c4ea[_0x3e1585(0x1e8)](_0x4ed8b4)&&_0x20c4ea['set'](_0x4ed8b4,[]),_0x20c4ea[_0x3e1585(0x28d)](_0x4ed8b4)[_0x3e1585(0x25f)](_0x445f4e);}for(const _0x32b3ea of _0x20c4ea[_0x3e1585(0x207)]()){_0x32b3ea[_0x3e1585(0x23c)]((_0x1bb3c7,_0x420a5f)=>(_0x1bb3c7['versionNumber']||0x0)-(_0x420a5f[_0x3e1585(0x1f8)]||0x0));}return _0x20c4ea;}export function collectFoldersToCreate(_0x130dbd,_0x3c21fb){const _0x1cc493=a155_0x2858,_0x11a45e=new Set();for(const _0x2f88a2 of _0x130dbd){if(!_0x2f88a2)continue;if(_0x3c21fb[_0x1cc493(0x1e8)](_0x2f88a2))continue;const _0x21b528=_0x2f88a2[_0x1cc493(0x27d)]('/');let _0x103292='';for(const _0x3b05d0 of _0x21b528){_0x103292=_0x103292?_0x103292+'/'+_0x3b05d0:_0x3b05d0,!_0x3c21fb['has'](_0x103292)&&_0x11a45e[_0x1cc493(0x2ab)](_0x103292);}}return _0x11a45e;}export function parseAndClassifyYamlFiles(_0x19089b,_0x17278a,_0x4fd574){const _0x541ad0=a155_0x2858,_0x22871b=[],_0x207f4e=[];for(const _0x50fc7b of _0x19089b){const _0x2bbab3=a155_0x3c0fa5[_0x541ad0(0x1d7)](_0x17278a,a155_0x3c0fa5[_0x541ad0(0x20f)](_0x50fc7b)),_0x1e8f1e=_0x2bbab3==='.'?'':_0x2bbab3[_0x541ad0(0x290)](/\\/g,'/'),_0x583ff1=readFileSync(_0x50fc7b,_0x541ad0(0x295)),_0x5e79b=a155_0x4e0291['parse'](_0x583ff1);if(isJourneyDef(_0x5e79b)){const _0x3ef430=a155_0x6de56d(_0x583ff1);_0x207f4e['push']({'yamlConfig':_0x3ef430,'folderPath':_0x1e8f1e,'sourcePath':_0x50fc7b});}else{if(!_0x4fd574?.[_0x541ad0(0x1c3)]){const _0x3c8bde=parseSegmentYamlFile(_0x583ff1),_0x564356=normalizeChildSegmentYaml(_0x3c8bde);_0x22871b[_0x541ad0(0x25f)]({'yamlConfig':_0x564356,'folderPath':_0x1e8f1e,'sourcePath':_0x50fc7b});}}}return{'segments':_0x22871b,'journeys':_0x207f4e};}export function validateParsedFiles(_0x38b5a1,_0x3cefab){const _0x28c39e=a155_0x2858,_0x13fb53=[];for(const {yamlConfig:_0x399143,sourcePath:_0x1ed1d2}of _0x38b5a1[_0x28c39e(0x26f)]){const _0x33e12e=readFileSync(_0x1ed1d2,_0x28c39e(0x295)),_0x3d38bb=a155_0x4e0291['parseDocument'](_0x33e12e),_0x30e18c=validateSegmentDef(_0x399143,{'source':_0x33e12e,'document':_0x3d38bb},{'skipSchema':!![]});if(!_0x30e18c[_0x28c39e(0x27c)]){const _0x2f075d=a155_0x3c0fa5['relative'](_0x3cefab,_0x1ed1d2);_0x13fb53[_0x28c39e(0x25f)]({'filePath':_0x2f075d,'source':_0x33e12e,'result':_0x30e18c,'isJourney':![]});}}for(const {yamlConfig:_0x36d63a,sourcePath:_0x11d327}of _0x38b5a1[_0x28c39e(0x1fe)]){const _0x3eb665=readFileSync(_0x11d327,'utf-8'),_0xb83a22=a155_0x4e0291[_0x28c39e(0x24f)](_0x3eb665),_0x2c4200=validateJourneyDef(_0x36d63a,{'source':_0x3eb665,'document':_0xb83a22},{'skipSchema':!![]});if(!_0x2c4200['valid']){const _0x1bc5c9=a155_0x3c0fa5[_0x28c39e(0x1d7)](_0x3cefab,_0x11d327);_0x13fb53[_0x28c39e(0x25f)]({'filePath':_0x1bc5c9,'source':_0x3eb665,'result':_0x2c4200,'isJourney':!![]});}}return _0x13fb53;}export function formatValidationErrors(_0x955477){const _0x3b3501=a155_0x2858,_0x285aba=[];for(const {filePath:_0x340995,source:_0x393ac7,result:_0x3a5a06,isJourney:_0x2ada59}of _0x955477){const _0x3a344f=_0x2ada59?_0x3b3501(0x2a8):_0x3b3501(0x1d9);_0x285aba[_0x3b3501(0x25f)]('\x0a'+_0x340995+'\x20('+_0x3a344f+_0x3b3501(0x252)+_0x3a5a06['errors'][_0x3b3501(0x2bf)]+_0x3b3501(0x214)),_0x285aba['push'](formatValidationResult(_0x3a5a06,_0x393ac7,_0x340995));}return _0x285aba['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x3d7b2e){const _0x48ca8e=a155_0x2858,_0x47114d=new Set(),_0x2fa537=new Map(),_0x3842ab=collectSegmentUsageCounts(_0x3d7b2e);if(_0x3d7b2e[_0x48ca8e(0x26f)])for(const [_0x24f2b0,_0x4fe632]of Object[_0x48ca8e(0x1e0)](_0x3d7b2e['segments'])){_0x47114d[_0x48ca8e(0x2ab)](_0x24f2b0);if(_0x4fe632[_0x48ca8e(0x244)]){const _0x5ddaab=yamlRuleToApi(_0x4fe632[_0x48ca8e(0x244)]),_0x4b6427=apiRuleToYaml(_0x5ddaab);_0x2fa537[_0x48ca8e(0x1db)](_0x24f2b0,_0x4b6427);}}const _0x4a0c26=new Map();let _0x48def3=0x0;for(const [_0x1843be,_0x23a87e]of _0x2fa537){const _0x289d74=serializeExpandedRule(_0x23a87e,_0x2fa537),_0x28dd1c=_0x4a0c26[_0x48ca8e(0x28d)](_0x289d74)||[];_0x28dd1c[_0x48ca8e(0x25f)]({'name':_0x1843be,'index':_0x48def3}),_0x4a0c26[_0x48ca8e(0x1db)](_0x289d74,_0x28dd1c),_0x48def3++;}const _0x2d3412=new Map();for(const [_0x258bb8,_0x128de8]of _0x4a0c26){const _0x1aa499=_0x128de8['slice']()[_0x48ca8e(0x23c)]((_0xbcd8f8,_0x22607b)=>{const _0x2aacf9=_0x48ca8e,_0x1ce943=_0x3842ab[_0x2aacf9(0x28d)](_0xbcd8f8[_0x2aacf9(0x243)])||0x0,_0xdd25da=_0x3842ab['get'](_0x22607b[_0x2aacf9(0x243)])||0x0;if(_0x1ce943!==_0xdd25da)return _0xdd25da-_0x1ce943;return _0xbcd8f8[_0x2aacf9(0x20d)]-_0x22607b[_0x2aacf9(0x20d)];})[_0x48ca8e(0x2a0)](_0x2bbc54=>_0x2bbc54[_0x48ca8e(0x243)]),_0x3ece3d=[];for(const _0x55e70d of _0x1aa499){const _0x40cb9d=_0x3842ab[_0x48ca8e(0x28d)](_0x55e70d)||0x0,_0x4d7d0e=Math[_0x48ca8e(0x20c)](_0x40cb9d,0x1);for(let _0xe48d1a=0x0;_0xe48d1a<_0x4d7d0e;_0xe48d1a++){_0x3ece3d[_0x48ca8e(0x25f)](_0x55e70d);}}_0x2d3412[_0x48ca8e(0x1db)](_0x258bb8,_0x3ece3d);}return{'existingLocalSegmentNames':_0x47114d,'localSegmentRules':_0x2fa537,'localExpandedRuleToNames':_0x2d3412};}export function createSegmentIdResolver(_0x30ffd2,_0x42025b){return async _0x12cb1b=>{const _0x2826f9=a155_0x2858,_0x6cdb4a=_0x30ffd2['get'](_0x12cb1b);if(!_0x6cdb4a)throw new SDKError(ErrorCode[_0x2826f9(0x285)],_0x2826f9(0x28c)+_0x12cb1b+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x42025b+'\x27)');return _0x6cdb4a;};}export function extractRootFolderId(_0x1838a9){const _0x41d66d=a155_0x2858;return _0x1838a9[_0x41d66d(0x2a4)]?.[_0x41d66d(0x29a)]?.[_0x41d66d(0x226)]?.['id']||_0x1838a9[_0x41d66d(0x2a4)]?.[_0x41d66d(0x213)]?.['data']?.['id'];}export function buildConnectionMaps(_0x4fea3f){const _0x1f9d34=a155_0x2858,_0x3178cd=new Map(),_0x268db4=new Map(),_0x433849=new Map();for(const _0x4a95dc of _0x4fea3f){_0x3178cd['set'](_0x4a95dc[_0x1f9d34(0x243)],parseInt(_0x4a95dc['id'],0xa)),_0x268db4['set'](_0x4a95dc['id'],_0x4a95dc[_0x1f9d34(0x243)]),_0x433849[_0x1f9d34(0x1db)](_0x4a95dc[_0x1f9d34(0x243)],_0x4a95dc[_0x1f9d34(0x1df)]);}return{'nameToId':_0x3178cd,'idToName':_0x268db4,'nameToType':_0x433849};}export function calculatePushStats(_0x284474,_0x2dc866,_0x59402f,_0x2487ca,_0x48327e,_0x421fac,_0x36ce8c){const _0x4a6ec8=a155_0x2858,_0x4b4c83=_0x284474[_0x4a6ec8(0x27e)](_0x5d3302=>_0x5d3302['isNew']),_0x5cf3eb=_0x284474[_0x4a6ec8(0x27e)](_0x138e49=>!_0x138e49['isNew']&&_0x138e49[_0x4a6ec8(0x21a)]),_0x289137=_0x284474[_0x4a6ec8(0x27e)](_0x68ed4b=>!_0x68ed4b[_0x4a6ec8(0x293)]&&!_0x68ed4b[_0x4a6ec8(0x21a)]),_0x2a90fb=_0x421fac?_0x2487ca:[],_0x17e08c=_0x2dc866['filter'](_0x35f7cb=>_0x35f7cb[_0x4a6ec8(0x293)]),_0x4a1f32=_0x2dc866[_0x4a6ec8(0x27e)](_0x281c40=>!_0x281c40[_0x4a6ec8(0x293)]&&_0x281c40[_0x4a6ec8(0x21a)]),_0x931678=_0x2dc866['filter'](_0x2c8fbb=>!_0x2c8fbb[_0x4a6ec8(0x293)]&&!_0x2c8fbb[_0x4a6ec8(0x21a)]),_0x7304ec=_0x421fac?_0x48327e:[],_0x232915=_0x284474[_0x4a6ec8(0x1c7)](_0x56b471=>_0x56b471[_0x4a6ec8(0x262)]),_0x4f295c=_0x232915[_0x4a6ec8(0x27e)](_0x2149fc=>_0x2149fc[_0x4a6ec8(0x1df)]===_0x4a6ec8(0x297)),_0x453860=_0x232915[_0x4a6ec8(0x27e)](_0x580e8e=>_0x580e8e[_0x4a6ec8(0x1df)]===_0x4a6ec8(0x1d4)),_0x1448d3=_0x232915[_0x4a6ec8(0x27e)](_0x563601=>_0x563601['type']===_0x4a6ec8(0x1d5)),_0x4be2e6=Array[_0x4a6ec8(0x24c)](_0x59402f)['sort'](),_0x4bd21c=_0x36ce8c?![]:_0x4b4c83['length']>0x0||_0x5cf3eb['length']>0x0||_0x2a90fb[_0x4a6ec8(0x2bf)]>0x0,_0x5a4cce=_0x17e08c['length']>0x0||_0x4a1f32['length']>0x0||_0x7304ec[_0x4a6ec8(0x2bf)]>0x0,_0x1db2c9=_0x36ce8c?![]:_0x232915[_0x4a6ec8(0x2bf)]>0x0,_0x239b82=_0x4be2e6[_0x4a6ec8(0x2bf)]>0x0;return{'segments':{'new':_0x4b4c83,'changed':_0x5cf3eb,'unchanged':_0x289137,'toDelete':_0x2a90fb},'journeys':{'new':_0x17e08c,'changed':_0x4a1f32,'unchanged':_0x931678,'toDelete':_0x7304ec},'activations':{'all':_0x232915,'toCreate':_0x4f295c,'toUpdate':_0x453860,'toDelete':_0x1448d3},'folders':{'toCreate':_0x4be2e6},'counts':{'segments':{'new':_0x4b4c83[_0x4a6ec8(0x2bf)],'changed':_0x5cf3eb[_0x4a6ec8(0x2bf)],'unchanged':_0x289137[_0x4a6ec8(0x2bf)],'toDelete':_0x2a90fb[_0x4a6ec8(0x2bf)]},'journeys':{'new':_0x17e08c[_0x4a6ec8(0x2bf)],'changed':_0x4a1f32[_0x4a6ec8(0x2bf)],'unchanged':_0x931678[_0x4a6ec8(0x2bf)],'toDelete':_0x7304ec['length']},'activations':{'create':_0x4f295c[_0x4a6ec8(0x2bf)],'update':_0x453860[_0x4a6ec8(0x2bf)],'delete':_0x1448d3[_0x4a6ec8(0x2bf)]},'folders':_0x4be2e6[_0x4a6ec8(0x2bf)]},'hasChanges':_0x4bd21c||_0x5a4cce||_0x1db2c9||_0x239b82};}export async function buildPushExecutionContext(_0x3411ba,_0x211d82,_0x13197d,_0x9a6369,_0x44fa15,_0x4d2ef5){const _0x570268=a155_0x2858,_0x77d846=extractRootFolderId(_0x13197d),{pathToId:_0x5456d1,idToPath:_0xbf8b4e}=buildFolderMaps(_0x44fa15),_0x3efb90=buildSegmentNameToIdMap(_0x9a6369),_0x59297e=new Map(),{batchAsync:_0x21530c}=await import(_0x570268(0x284)),[_0x211f48,_0x2c1a72]=await Promise[_0x570268(0x27b)]([_0x3411ba[_0x570268(0x259)]['buildUserMaps'](),_0x3411ba[_0x570268(0x1f2)][_0x570268(0x24e)](),((async()=>{!_0x4d2ef5&&_0x9a6369['length']>0x0&&await _0x21530c(_0x9a6369,async _0x520360=>{const _0x5c84cc=a155_0x2858,_0x4b525f=await _0x3411ba[_0x5c84cc(0x1d9)][_0x5c84cc(0x1e2)](_0x211d82,_0x520360['id']);_0x59297e[_0x5c84cc(0x1db)](_0x520360['id'],_0x4b525f);});})())]),{emailToId:_0x148130,idToEmail:_0x31200e}=_0x211f48,_0xdae0fd=buildConnectionMaps(_0x2c1a72);return{'rootFolderId':_0x77d846,'folderPathToId':_0x5456d1,'folderIdToPath':_0xbf8b4e,'segmentNameToId':_0x3efb90,'activationsBySegmentId':_0x59297e,'emailToIdMap':_0x148130,'idToEmailMap':_0x31200e,'connectionNameToIdMap':_0xdae0fd['nameToId'],'connectionIdToNameMap':_0xdae0fd[_0x570268(0x29c)],'connectionNameToTypeMap':_0xdae0fd[_0x570268(0x2b2)]};}export function createPushYamlContextForBundle(_0x5591df,_0xbdda5d,_0x1a9373,_0x5a0703,_0x232094,_0x535e46,_0x7efdc7,_0x851b60){const {existingLocalSegmentNames:_0x2c6b7c,localExpandedRuleToNames:_0x4cae66}=_0x5a0703,_0x2498e2=new Set(),_0x2d3b29=new Map(),_0x24f6a5=new Map(),_0x21f132=new Map(),_0x21a9a8=createJumpTargetCache(),_0x40ae2c=new Map(),_0x233f56=new Map(),_0x53bcce=new Set();let _0x167feb;const _0x24179e=_0x19e23c=>{const _0x293ea1={'resolveSegment':async _0x404988=>{const _0x1c846a=a155_0x2858,_0x1a9897=_0x21f132[_0x1c846a(0x28d)](_0x404988);if(_0x1a9897!==undefined)return{'name':_0x1a9897,'isJourneyLocal':!![]};try{const _0x4e69a1=await fetchSegment(_0x5591df,_0xbdda5d,_0x404988,_0x1a9373);if(!_0x4e69a1)throw new Error(_0x1c846a(0x1e7));const _0x511e9d=generateJourneyLocalName(_0x4e69a1[_0x1c846a(0x243)]),_0x275e46=_0x4e69a1[_0x1c846a(0x1e4)]===SEGMENT_KIND_JOURNEY&&_0x511e9d!==undefined;let _0x235ec8=_0x4e69a1[_0x1c846a(0x243)],_0x4cca0;if(_0x275e46&&_0x4e69a1[_0x1c846a(0x244)]){const _0x35b462=apiRuleToYaml(_0x4e69a1[_0x1c846a(0x244)]);_0x233f56[_0x1c846a(0x1db)](_0x404988,_0x35b462);const _0x234fd0=async _0x6aafb7=>{const _0x55de6b=_0x1c846a,_0x5364c7=collectSegmentRefsFromRule(_0x6aafb7);for(const _0xd4cc2d of _0x5364c7){if(!_0x233f56[_0x55de6b(0x1e8)](_0xd4cc2d))try{const _0x38296c=await fetchSegment(_0x5591df,_0xbdda5d,_0xd4cc2d,_0x1a9373);if(_0x38296c?.['rule']){const _0x8444e9=apiRuleToYaml(_0x38296c[_0x55de6b(0x244)]);_0x233f56[_0x55de6b(0x1db)](_0xd4cc2d,_0x8444e9),await _0x234fd0(_0x8444e9);}}catch(_0x601e6c){logger[_0x55de6b(0x2b6)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0xd4cc2d+':\x20'+_0x601e6c);}}};await _0x234fd0(_0x35b462);const _0x1ffe97=serializeExpandedRule(_0x35b462,_0x233f56),_0x2294a9=_0x4cae66[_0x1c846a(0x28d)](_0x1ffe97);if(_0x2294a9&&_0x2294a9[_0x1c846a(0x2bf)]>0x0){const _0x5da488=_0x2d3b29['get'](_0x1ffe97)||0x0,_0x4dd870=_0x2294a9[_0x5da488]||_0x2294a9[_0x2294a9[_0x1c846a(0x2bf)]-0x1];_0x2d3b29['set'](_0x1ffe97,_0x5da488+0x1),_0x235ec8=_0x4dd870,_0x2498e2[_0x1c846a(0x2ab)](_0x235ec8),_0x21f132['set'](_0x404988,_0x235ec8);const _0xb578f0=await resolveRuleSegmentRefs(_0x35b462,async _0x4b9cb4=>{const _0x2b9b74=_0x1c846a,_0x1677de=_0x21f132['get'](_0x4b9cb4);if(_0x1677de)return _0x1677de;const _0x134ff5=await _0x167feb[_0x2b9b74(0x251)](_0x4b9cb4);return _0x134ff5[_0x2b9b74(0x243)];});_0x4cca0={'description':_0x4e69a1[_0x1c846a(0x25a)],'rule':_0xb578f0};}else{const _0x1aeead=_0x40ae2c[_0x1c846a(0x28d)](_0x1ffe97);if(_0x1aeead)_0x235ec8=_0x1aeead,_0x21f132[_0x1c846a(0x1db)](_0x404988,_0x235ec8);else{if(_0x511e9d){let _0x5ca687=_0x511e9d,_0x3c7bb2=0x2;while(_0x2498e2[_0x1c846a(0x1e8)](_0x5ca687)||_0x2c6b7c['has'](_0x5ca687)){_0x5ca687=_0x511e9d+'_'+_0x3c7bb2,_0x3c7bb2++;}_0x2498e2[_0x1c846a(0x2ab)](_0x5ca687),_0x235ec8=_0x5ca687;}_0x21f132[_0x1c846a(0x1db)](_0x404988,_0x235ec8),_0x40ae2c[_0x1c846a(0x1db)](_0x1ffe97,_0x235ec8);const _0x2010ba=await resolveRuleSegmentRefs(_0x35b462,async _0x504f43=>{const _0x14157d=_0x1c846a,_0x8980a2=_0x21f132[_0x14157d(0x28d)](_0x504f43);if(_0x8980a2)return _0x8980a2;const _0x55e9b7=await _0x167feb[_0x14157d(0x251)](_0x504f43);return _0x55e9b7['name'];});_0x4cca0={'description':_0x4e69a1[_0x1c846a(0x25a)],'rule':_0x2010ba};}}}return{'name':_0x235ec8,'isJourneyLocal':_0x275e46,'definition':_0x4cca0};}catch(_0x4eb9ab){return logger[_0x1c846a(0x2b6)](_0x1c846a(0x2aa)+_0x404988+':\x20'+_0x4eb9ab),{'name':_0x404988,'isJourneyLocal':![]};}},'resolveActivation':async _0xd7ba2e=>{const _0x5d6430=a155_0x2858,_0x4c506f=_0x24f6a5[_0x5d6430(0x28d)](_0xd7ba2e);if(_0x4c506f!==undefined)return{'name':_0x4c506f,'isJourneyLocal':!![]};try{let _0xd04a3f=_0x7efdc7?.[_0x5d6430(0x28d)](_0xd7ba2e);!_0xd04a3f&&(_0xd04a3f=await _0x5591df['journey'][_0x5d6430(0x23f)](_0x19e23c,_0xd7ba2e));const _0x5f2768=_0xd04a3f[_0x5d6430(0x228)][_0x5d6430(0x260)][_0x5d6430(0x243)]||_0xd7ba2e,_0x24faa0=sanitizeYamlKey(_0x5f2768)||'activation_'+_0xd7ba2e,_0x7bc328=_0x24faa0;_0x24f6a5[_0x5d6430(0x1db)](_0xd7ba2e,_0x7bc328);const _0x451200=journeyActivationStepToYaml(_0xd04a3f,_0x232094,_0x535e46);return{'name':_0x7bc328,'isJourneyLocal':!![],'definition':_0x451200};}catch(_0x2bd636){return logger[_0x5d6430(0x2b6)](_0x5d6430(0x240)+_0xd7ba2e+':\x20'+_0x2bd636),{'name':_0xd7ba2e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x479860,_0x271db4)=>resolveJumpTarget(_0x479860,_0x271db4,_0x21a9a8,async _0x5be7f9=>{const _0xdb702d=a155_0x2858,_0x1d5a42=_0x851b60?.[_0xdb702d(0x28d)](_0x5be7f9);if(_0x1d5a42)return _0x1d5a42;return _0x5591df[_0xdb702d(0x2a8)][_0xdb702d(0x268)](_0x5be7f9);})};return _0x167feb=_0x293ea1,_0x293ea1;},_0x2d3daf=async _0x3b1463=>{const _0x48777b=a155_0x2858,{collectSegmentIdsFromJourneyApi:_0xd1cc9c}=await import(_0x48777b(0x2c0)),{batchAsync:_0x2d1b75}=await import(_0x48777b(0x284)),_0x3c85ab=new Set();for(const _0x371e59 of _0x3b1463){let _0x1b8191=_0x851b60?.['get'](_0x371e59);!_0x1b8191&&(_0x1b8191=await _0x5591df[_0x48777b(0x2a8)][_0x48777b(0x268)](_0x371e59));const _0x21ca95=_0xd1cc9c(_0x1b8191);for(const _0xdf5820 of _0x21ca95){_0x3c85ab['add'](_0xdf5820);}}let _0x25831d=Array['from'](_0x3c85ab);while(_0x25831d['length']>0x0){const _0x38e12b=_0x25831d[_0x48777b(0x27e)](_0x3eb589=>!_0x53bcce[_0x48777b(0x1e8)](_0x3eb589));if(_0x38e12b[_0x48777b(0x2bf)]===0x0)break;const _0x5c6ca8=await _0x2d1b75(_0x38e12b,async _0x51847d=>{_0x53bcce['add'](_0x51847d);const _0xf969ca=await fetchSegment(_0x5591df,_0xbdda5d,_0x51847d,_0x1a9373);if(!_0xf969ca)return null;return{'segmentId':_0x51847d,'segment':_0xf969ca};},0xa),_0x1d2673=new Set();for(const _0xc16d8b of _0x5c6ca8){if(!_0xc16d8b?.[_0x48777b(0x1d9)]?.[_0x48777b(0x244)])continue;const _0x61757e=apiRuleToYaml(_0xc16d8b[_0x48777b(0x1d9)][_0x48777b(0x244)]);_0x233f56[_0x48777b(0x1db)](_0xc16d8b['segmentId'],_0x61757e);const _0x590fda=collectSegmentRefsFromRule(_0x61757e);for(const _0x3a352c of _0x590fda){!_0x53bcce[_0x48777b(0x1e8)](_0x3a352c)&&_0x1d2673['add'](_0x3a352c);}}_0x25831d=Array[_0x48777b(0x24c)](_0x1d2673);}};return{'createYamlContext':_0x24179e,'prefetchJourneySegments':_0x2d3daf};}export async function executePushSegments(_0x7a2ad7,_0x55e847,_0x5a88c1,_0x11b0ec,_0x5dc44b){const _0x19ac12=a155_0x2858,{segmentDefToCreateRequest:_0x24978e,segmentDefToUpdateRequest:_0x4e6324}=await import(_0x19ac12(0x1ec)),_0x2ccd18=_0x5a88c1[_0x19ac12(0x25c)],_0x4b7408=0x5,_0x1f9501=async _0x3767f0=>{const _0x3fb2a4=_0x19ac12,_0x370778=_0x3767f0[_0x3fb2a4(0x1cd)]?_0x2ccd18['get'](_0x3767f0[_0x3fb2a4(0x1cd)]):undefined;let _0x15d4c9;const _0x3a3787={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x5a2f85=_0x3767f0[_0x3fb2a4(0x242)];if(_0x3767f0[_0x3fb2a4(0x242)]['rule']){const _0x51105e=createSegmentIdResolver(_0x5a88c1[_0x3fb2a4(0x263)],_0x3767f0['yamlConfig'][_0x3fb2a4(0x243)]),_0x1656c2=await resolveRuleSegmentIds(_0x3767f0[_0x3fb2a4(0x242)][_0x3fb2a4(0x244)],_0x51105e);_0x5a2f85={..._0x3767f0[_0x3fb2a4(0x242)],'rule':_0x1656c2};}try{if(_0x3767f0['isNew']){_0x5dc44b[_0x3fb2a4(0x227)]?.({'type':'segment_creating','name':_0x3767f0['yamlConfig'][_0x3fb2a4(0x243)]});const _0x2de20a=_0x24978e(_0x5a2f85,_0x370778),_0xe9f0c8=await _0x5dc44b['withProgress'](_0x3fb2a4(0x1e1)+_0x3767f0[_0x3fb2a4(0x242)][_0x3fb2a4(0x243)]+_0x3fb2a4(0x21b),()=>_0x7a2ad7[_0x3fb2a4(0x1d9)][_0x3fb2a4(0x28b)](_0x11b0ec[_0x3fb2a4(0x253)],_0x2de20a));_0x15d4c9=_0xe9f0c8[_0x3fb2a4(0x226)]['id'],_0x5a88c1[_0x3fb2a4(0x263)][_0x3fb2a4(0x1db)](_0x3767f0[_0x3fb2a4(0x242)][_0x3fb2a4(0x243)],_0x15d4c9),_0x3a3787[_0x3fb2a4(0x1d2)]={'name':_0x3767f0[_0x3fb2a4(0x242)][_0x3fb2a4(0x243)],'id':_0x15d4c9},_0x5dc44b[_0x3fb2a4(0x227)]?.({'type':'segment_created','name':_0x3767f0[_0x3fb2a4(0x242)][_0x3fb2a4(0x243)],'segmentId':_0x15d4c9}),_0x5dc44b[_0x3fb2a4(0x296)]?.(_0x3fb2a4(0x1dc)+_0x3767f0[_0x3fb2a4(0x242)][_0x3fb2a4(0x243)]+'\x27'),_0x3a3787[_0x3fb2a4(0x2b0)]=0x1;}else{if(_0x3767f0[_0x3fb2a4(0x21a)]){_0x5dc44b['onProgress']?.({'type':_0x3fb2a4(0x1e9),'name':_0x3767f0[_0x3fb2a4(0x242)][_0x3fb2a4(0x243)]});const _0x30bf62=_0x4e6324(_0x5a2f85);_0x370778!==_0x3767f0[_0x3fb2a4(0x2a7)]?.[_0x3fb2a4(0x1cf)]&&(_0x30bf62['segmentFolderId']=_0x370778?parseInt(_0x370778,0xa):undefined),await _0x5dc44b[_0x3fb2a4(0x266)](_0x3fb2a4(0x247)+_0x3767f0[_0x3fb2a4(0x242)][_0x3fb2a4(0x243)]+_0x3fb2a4(0x21b),()=>_0x7a2ad7[_0x3fb2a4(0x1d9)][_0x3fb2a4(0x22d)](_0x11b0ec[_0x3fb2a4(0x253)],_0x3767f0[_0x3fb2a4(0x2a7)]['id'],_0x30bf62)),_0x15d4c9=_0x3767f0[_0x3fb2a4(0x2a7)]['id'],_0x5dc44b['onProgress']?.({'type':_0x3fb2a4(0x1d6),'name':_0x3767f0[_0x3fb2a4(0x242)]['name']}),_0x5dc44b[_0x3fb2a4(0x296)]?.(_0x3fb2a4(0x248)+_0x3767f0['yamlConfig'][_0x3fb2a4(0x243)]+'\x27'),_0x3a3787['updated']=0x1;}else _0x15d4c9=_0x3767f0[_0x3fb2a4(0x2a7)]['id'];}}catch(_0x5dcef4){const _0x43f25a=isHttp400Error(_0x5dcef4),_0x2d07cc=_0x43f25a?ErrorCode[_0x3fb2a4(0x299)]:ErrorCode[_0x3fb2a4(0x29b)],_0x2a5da6=getErrorMessage(_0x5dcef4);throw new SDKError(_0x2d07cc,_0x3fb2a4(0x1c6)+(_0x3767f0[_0x3fb2a4(0x293)]?_0x3fb2a4(0x297):_0x3fb2a4(0x1d4))+_0x3fb2a4(0x1f5)+_0x3767f0[_0x3fb2a4(0x219)]+'\x0a\x20\x20'+_0x2a5da6,_0x5dcef4);}try{const _0x56da9d=await syncActivationsForSegment(_0x7a2ad7,_0x11b0ec['parentId'],_0x15d4c9,_0x3767f0[_0x3fb2a4(0x242)][_0x3fb2a4(0x243)],_0x3767f0[_0x3fb2a4(0x262)],_0x5dc44b,_0x3767f0['absolutePath']);_0x3a3787[_0x3fb2a4(0x238)]=_0x56da9d;}catch(_0x1d54ba){if(_0x1d54ba instanceof SDKError)throw _0x1d54ba;throw new SDKError(ErrorCode[_0x3fb2a4(0x201)],_0x3fb2a4(0x22e)+_0x3767f0[_0x3fb2a4(0x242)][_0x3fb2a4(0x243)]+_0x3fb2a4(0x232)+_0x3767f0[_0x3fb2a4(0x219)]+_0x3fb2a4(0x2a6)+getErrorMessage(_0x1d54ba),_0x1d54ba);}return _0x3a3787;},_0x4bb622=await batchAsync(_0x55e847,_0x1f9501,_0x4b7408),_0x315b73={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x131f0b of _0x4bb622){_0x315b73[_0x19ac12(0x2b0)]+=_0x131f0b['created'],_0x315b73[_0x19ac12(0x265)]+=_0x131f0b[_0x19ac12(0x265)],_0x131f0b[_0x19ac12(0x1d2)]&&_0x315b73[_0x19ac12(0x286)][_0x19ac12(0x1db)](_0x131f0b[_0x19ac12(0x1d2)]['name'],_0x131f0b[_0x19ac12(0x1d2)]['id']),_0x315b73['activations']['created']+=_0x131f0b['activations']['created'],_0x315b73[_0x19ac12(0x238)][_0x19ac12(0x265)]+=_0x131f0b[_0x19ac12(0x238)][_0x19ac12(0x265)],_0x315b73[_0x19ac12(0x238)][_0x19ac12(0x26e)]+=_0x131f0b[_0x19ac12(0x238)][_0x19ac12(0x26e)];}return _0x315b73;}async function syncActivationsForSegment(_0x4b2faa,_0x513717,_0x2a26d3,_0x2d1b00,_0x301b88,_0xc93807,_0x5a596d){const _0x3c20b3=a155_0x2858,_0x2131fe={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xb72b3e of _0x301b88){try{if(_0xb72b3e['type']===_0x3c20b3(0x297)&&_0xb72b3e[_0x3c20b3(0x2a5)])_0xc93807[_0x3c20b3(0x227)]?.({'type':_0x3c20b3(0x1c0),'segmentName':_0x2d1b00,'activationName':_0xb72b3e[_0x3c20b3(0x243)]}),await _0xc93807[_0x3c20b3(0x266)](_0x3c20b3(0x1ea)+_0xb72b3e['name']+_0x3c20b3(0x21b),()=>_0x4b2faa['segment'][_0x3c20b3(0x28f)](_0x513717,_0x2a26d3,_0xb72b3e['validatedRequest'])),_0xc93807[_0x3c20b3(0x227)]?.({'type':_0x3c20b3(0x20e),'segmentName':_0x2d1b00,'activationName':_0xb72b3e[_0x3c20b3(0x243)]}),_0xc93807['logSuccess']?.(_0x3c20b3(0x22a)+_0xb72b3e['name']+'\x27'),_0x2131fe['created']++;else{if(_0xb72b3e[_0x3c20b3(0x1df)]===_0x3c20b3(0x1d4)&&_0xb72b3e['validatedRequest']&&_0xb72b3e[_0x3c20b3(0x200)])_0xc93807['onProgress']?.({'type':_0x3c20b3(0x2ae),'segmentName':_0x2d1b00,'activationName':_0xb72b3e[_0x3c20b3(0x243)]}),await _0xc93807[_0x3c20b3(0x266)]('Updating\x20activation\x20\x27'+_0xb72b3e['name']+_0x3c20b3(0x21b),()=>_0x4b2faa[_0x3c20b3(0x1d9)][_0x3c20b3(0x2a3)](_0x513717,_0x2a26d3,_0xb72b3e[_0x3c20b3(0x200)]['id'],_0xb72b3e[_0x3c20b3(0x2a5)])),_0xc93807['onProgress']?.({'type':_0x3c20b3(0x21f),'segmentName':_0x2d1b00,'activationName':_0xb72b3e[_0x3c20b3(0x243)]}),_0xc93807[_0x3c20b3(0x296)]?.(_0x3c20b3(0x1c2)+_0xb72b3e[_0x3c20b3(0x243)]+'\x27'),_0x2131fe[_0x3c20b3(0x265)]++;else _0xb72b3e['type']==='delete'&&_0xb72b3e[_0x3c20b3(0x200)]&&(_0xc93807['onProgress']?.({'type':_0x3c20b3(0x256),'segmentName':_0x2d1b00,'activationName':_0xb72b3e[_0x3c20b3(0x243)]}),await _0xc93807[_0x3c20b3(0x266)](_0x3c20b3(0x1f3)+_0xb72b3e[_0x3c20b3(0x243)]+_0x3c20b3(0x21b),()=>_0x4b2faa[_0x3c20b3(0x1d9)][_0x3c20b3(0x29f)](_0x513717,_0x2a26d3,_0xb72b3e[_0x3c20b3(0x200)]['id'])),_0xc93807[_0x3c20b3(0x227)]?.({'type':_0x3c20b3(0x2c2),'segmentName':_0x2d1b00,'activationName':_0xb72b3e[_0x3c20b3(0x243)]}),_0xc93807[_0x3c20b3(0x255)]?.('Deleted\x20activation\x20\x27'+_0xb72b3e[_0x3c20b3(0x243)]+'\x27'),_0x2131fe[_0x3c20b3(0x26e)]++);}}catch(_0x211e4b){const _0xa57c3b=isHttp400Error(_0x211e4b),_0x3eccbd=_0xa57c3b?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x3c20b3(0x201)],_0x16f551=getErrorMessage(_0x211e4b);throw new SDKError(_0x3eccbd,_0x3c20b3(0x1c6)+_0xb72b3e[_0x3c20b3(0x1df)]+_0x3c20b3(0x1be)+_0xb72b3e[_0x3c20b3(0x243)]+_0x3c20b3(0x232)+_0x5a596d+_0x3c20b3(0x2a6)+_0x16f551,_0x211e4b);}}return _0x2131fe;}export async function executePushFolders(_0x1dd02d,_0x13d453,_0x818a8e,_0x30f3ad,_0x4d7205){const _0x363d1e=a155_0x2858,_0x2f8cf4=new Map(_0x818a8e),_0x200276=sortFoldersByDepth(_0x13d453);for(const _0x578da8 of _0x200276){const _0x265b5d=_0x578da8[_0x363d1e(0x27d)]('/'),_0x2c8cb3=_0x265b5d[_0x265b5d[_0x363d1e(0x2bf)]-0x1],_0x1aa0d3=_0x265b5d[_0x363d1e(0x2a1)](0x0,-0x1)[_0x363d1e(0x1de)]('/'),_0x29db65=_0x2f8cf4['get'](_0x1aa0d3);_0x4d7205[_0x363d1e(0x227)]?.({'type':_0x363d1e(0x26b),'folder':_0x578da8});const _0x449a81={'name':_0x2c8cb3,'parentFolderId':_0x29db65},_0x3c8290=await _0x4d7205[_0x363d1e(0x266)](_0x363d1e(0x1ed)+_0x578da8+_0x363d1e(0x21b),()=>_0x1dd02d[_0x363d1e(0x1d9)][_0x363d1e(0x1ef)](_0x30f3ad['parentId'],_0x449a81));_0x2f8cf4[_0x363d1e(0x1db)](_0x578da8,_0x3c8290[_0x363d1e(0x226)]['id']),_0x4d7205[_0x363d1e(0x227)]?.({'type':'folder_created','folder':_0x578da8,'folderId':_0x3c8290[_0x363d1e(0x226)]['id']}),_0x4d7205[_0x363d1e(0x280)]?.(_0x363d1e(0x21c)+_0x578da8+'\x27');}return _0x2f8cf4;}export async function executePushSegmentDeletions(_0x36143e,_0x4e5e81,_0x1b836f){const _0xb1dd4e=a155_0x2858;if(_0x4e5e81['length']===0x0)return 0x0;const {batchAsync:_0x39208d}=await import(_0xb1dd4e(0x284)),_0x54ab31=0x5,_0x1863db=await _0x39208d(_0x4e5e81,async _0x32c139=>{const _0x304f00=_0xb1dd4e;return _0x1b836f[_0x304f00(0x227)]?.({'type':_0x304f00(0x225),'name':_0x32c139['name']}),await _0x36143e[_0x304f00(0x1d9)][_0x304f00(0x1fb)](_0x32c139['id']),_0x1b836f[_0x304f00(0x227)]?.({'type':_0x304f00(0x1eb),'name':_0x32c139[_0x304f00(0x243)]}),_0x1b836f[_0x304f00(0x255)]?.(_0x304f00(0x24d)+_0x32c139[_0x304f00(0x243)]+'\x27'),0x1;},_0x54ab31);return _0x1863db[_0xb1dd4e(0x239)]((_0x441f3a,_0x2deaa6)=>_0x441f3a+_0x2deaa6,0x0);}export async function executePushJourneys(_0x343484,_0x8062c4,_0x546216,_0xc03288,_0x2e13f0){const _0x3cc2f9=a155_0x2858,{journeyDefToRequest:_0x58b0ad}=await import(_0x3cc2f9(0x2c0)),{activationDefToCreateRequest:_0x4478f1,yamlRuleToApi:_0x2ac832,validateSegmentRule:_0x2f3dbe}=await import(_0x3cc2f9(0x1ec)),_0xc1c8a={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x413d6a=new Map(_0x546216['segmentNameToId']),_0x5130ef=0x5;for(let _0x69c43e=0x0;_0x69c43e<_0x8062c4[_0x3cc2f9(0x2bf)];_0x69c43e+=_0x5130ef){const _0xd96f1e=_0x8062c4['slice'](_0x69c43e,_0x69c43e+_0x5130ef),_0x32895d=await Promise[_0x3cc2f9(0x27b)](_0xd96f1e[_0x3cc2f9(0x2a0)](async _0x2b1dcd=>{const _0x36633e=_0x3cc2f9;if(!_0x2b1dcd['isNew']&&!_0x2b1dcd[_0x36633e(0x21a)])return{'action':_0x36633e(0x205),'name':_0x2b1dcd[_0x36633e(0x242)][_0x36633e(0x243)],'journeyId':_0x2b1dcd['existingJourney']?.['id']};const _0x35741a=_0x2b1dcd['folderPath']?_0x546216[_0x36633e(0x25c)][_0x36633e(0x28d)](_0x2b1dcd[_0x36633e(0x1cd)]):undefined;_0x2e13f0[_0x36633e(0x227)]?.({'type':_0x2b1dcd['isNew']?_0x36633e(0x220):_0x36633e(0x2b5),'name':_0x2b1dcd[_0x36633e(0x242)][_0x36633e(0x243)]});try{const _0x40c19d=await executeSingleJourneyPush(_0x343484,_0x2b1dcd,{..._0x546216,'segmentNameToId':_0x413d6a},{'parentId':_0xc03288[_0x36633e(0x253)],'rootFolderId':_0xc03288['rootFolderId'],'folderId':_0x35741a,'verbose':_0xc03288[_0x36633e(0x202)]},_0x2e13f0,{'journeyDefToRequest':_0x58b0ad,'activationDefToCreateRequest':_0x4478f1,'yamlRuleToApi':_0x2ac832,'validateSegmentRule':_0x2f3dbe});for(const [_0x4404cd,_0x584ba6]of _0x40c19d[_0x36633e(0x241)]){_0x413d6a[_0x36633e(0x1db)](_0x4404cd,_0x584ba6),_0xc1c8a['embeddedSegmentNameToId'][_0x36633e(0x1db)](_0x4404cd,_0x584ba6);}if(_0x40c19d[_0x36633e(0x271)]==='created')_0x2e13f0[_0x36633e(0x227)]?.({'type':_0x36633e(0x26a),'name':_0x2b1dcd[_0x36633e(0x242)][_0x36633e(0x243)],'journeyId':_0x40c19d[_0x36633e(0x2ba)]}),_0x2e13f0[_0x36633e(0x296)]?.('Created\x20journey\x20\x27'+_0x2b1dcd[_0x36633e(0x242)][_0x36633e(0x243)]+'\x27'),_0xc1c8a['created']++;else _0x40c19d['action']===_0x36633e(0x265)&&(_0x2e13f0['onProgress']?.({'type':_0x36633e(0x289),'name':_0x2b1dcd[_0x36633e(0x242)][_0x36633e(0x243)]}),_0x2e13f0[_0x36633e(0x296)]?.('Updated\x20journey\x20\x27'+_0x2b1dcd[_0x36633e(0x242)]['name']+'\x27'),_0xc1c8a[_0x36633e(0x265)]++);return{'action':_0x40c19d[_0x36633e(0x271)],'name':_0x2b1dcd[_0x36633e(0x242)][_0x36633e(0x243)],'journeyId':_0x40c19d['journeyId']};}catch(_0x204a90){const _0x5d6f00=isHttp400Error(_0x204a90),_0x2cf9bf=_0x5d6f00?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x36633e(0x1f9)],_0x5d1d93=getErrorMessage(_0x204a90);throw new SDKError(_0x2cf9bf,_0x36633e(0x1c6)+(_0x2b1dcd[_0x36633e(0x293)]?_0x36633e(0x297):'update')+_0x36633e(0x249)+_0x2b1dcd[_0x36633e(0x219)]+_0x36633e(0x2a6)+_0x5d1d93,_0x204a90);}}));_0xc1c8a[_0x3cc2f9(0x1ca)][_0x3cc2f9(0x25f)](..._0x32895d);}return _0xc1c8a;}async function matchExistingJourneySegments(_0x3d8c1e,_0x4faec9,_0x3a9669,_0x3fe9ce,_0x1b180e){const _0x335e95=a155_0x2858;if(!_0x4faec9['existingJourney']||!_0x4faec9['yamlConfig']['segments'])return;const _0x32e1c0=new Map(),_0x482aa3=new Set();for(const _0x5102c8 of Object[_0x335e95(0x1cb)](_0x4faec9[_0x335e95(0x242)]['segments'])){const _0x1c2f05=generateDeterministicJourneySegmentName(_0x4faec9['yamlConfig'][_0x335e95(0x243)],_0x5102c8);_0x32e1c0[_0x335e95(0x1db)](_0x1c2f05,_0x5102c8),_0x482aa3[_0x335e95(0x2ab)](_0x5102c8);}const _0x48721c=[],_0x41adb4=collectSegmentIdsFromJourneyApi(_0x4faec9['existingJourney']);for(const _0x55ad4f of _0x41adb4){const _0x17868c=await fetchSegment(_0x3d8c1e,_0x3a9669,_0x55ad4f,_0x3fe9ce);if(!_0x17868c?.[_0x335e95(0x243)])continue;const _0x2a489e=_0x32e1c0[_0x335e95(0x28d)](_0x17868c[_0x335e95(0x243)]);_0x2a489e?(_0x1b180e[_0x335e95(0x1db)](_0x2a489e,_0x55ad4f),_0x482aa3[_0x335e95(0x1d5)](_0x2a489e)):_0x48721c[_0x335e95(0x25f)]({'id':_0x55ad4f,'seg':_0x17868c});}if(_0x482aa3['size']>0x0&&_0x48721c[_0x335e95(0x2bf)]>0x0){const {localExpandedRuleToNames:_0xe0c72d}=buildLocalExpandedRuleMappings(_0x4faec9[_0x335e95(0x242)]),_0x1e0def=new Map();for(const {id:_0x4b2e2d,seg:_0x113793}of _0x48721c){if(_0x113793[_0x335e95(0x244)]){const _0x20dda5=apiRuleToYaml(_0x113793[_0x335e95(0x244)]);_0x1e0def['set'](_0x4b2e2d,_0x20dda5);}}for(const {id:_0x40db1a,seg:_0x5291b9}of _0x48721c){if(!_0x5291b9['rule'])continue;const _0x5155cf=_0x1e0def[_0x335e95(0x28d)](_0x40db1a);if(!_0x5155cf)continue;const _0x4c6763=serializeExpandedRule(_0x5155cf,_0x1e0def),_0x5913e3=_0xe0c72d['get'](_0x4c6763);if(_0x5913e3){const _0x1e781a=_0x5913e3[_0x335e95(0x264)](_0x2c8287=>_0x482aa3['has'](_0x2c8287));_0x1e781a&&(_0x1b180e[_0x335e95(0x1db)](_0x1e781a,_0x40db1a),_0x482aa3[_0x335e95(0x1d5)](_0x1e781a),logger[_0x335e95(0x2b6)](_0x335e95(0x1d1)+_0x5291b9[_0x335e95(0x243)]+_0x335e95(0x24a)+_0x1e781a+_0x335e95(0x291)));}}}}async function executeSingleJourneyPush(_0x5e3e64,_0x3543e2,_0x2c4c46,_0x4d4e5f,_0xa918a,_0x4ce4ad){const _0x2a8d7a=a155_0x2858,{journeyDefToRequest:_0x5e70db,activationDefToCreateRequest:_0x57fe24,yamlRuleToApi:_0x186997,validateSegmentRule:_0x38a1a2}=_0x4ce4ad,_0x10af87=new Map(),_0x478c70=new Map();recoverSegmentIdsFromPushRecovery(_0x3543e2,_0x10af87,_0x2c4c46[_0x2a8d7a(0x263)]);const _0x183e1a=new Map(),_0x39fcf7=new Map(),_0x57f007=new Map();let _0x514270;const _0x4e73a2=async()=>{const _0x3a5e96=_0x2a8d7a;if(_0x514270)return;_0x514270=new Map();if(!_0x3543e2['existingJourney'])return;const _0x404311=await _0x5e3e64[_0x3a5e96(0x2a8)][_0x3a5e96(0x1e2)](_0x3543e2[_0x3a5e96(0x1d8)]['id']);for(const _0x1adde6 of _0x404311){const _0x391650=journeyActivationStepToYaml(_0x1adde6,_0x2c4c46[_0x3a5e96(0x277)],_0x2c4c46[_0x3a5e96(0x23b)]),_0x41f84d=activationSignature(_0x391650);!_0x514270[_0x3a5e96(0x1e8)](_0x41f84d)&&_0x514270[_0x3a5e96(0x1db)](_0x41f84d,_0x1adde6['id']),_0x391650['name']&&_0x478c70[_0x3a5e96(0x1db)](_0x391650['name'],_0x1adde6['id']);}};await matchExistingJourneySegments(_0x5e3e64,_0x3543e2,_0x4d4e5f[_0x2a8d7a(0x253)],_0x2c4c46[_0x2a8d7a(0x1e5)],_0x2c4c46['segmentNameToId']);const _0x2a724c={'resolveSegmentId':async _0x151b8c=>{const _0x333e06=_0x2a8d7a,_0x27f438=_0x2c4c46[_0x333e06(0x263)][_0x333e06(0x28d)](_0x151b8c);if(!_0x27f438)throw new SDKError(ErrorCode[_0x333e06(0x285)],_0x333e06(0x28c)+_0x151b8c+_0x333e06(0x298)+_0x3543e2['yamlConfig'][_0x333e06(0x243)]+')');return _0x27f438;},'resolveEmbeddedSegmentId':async(_0x5a0b1a,_0x187431)=>{const _0x4010e0=_0x2a8d7a,_0x110b5b=_0x2c4c46['segmentNameToId'][_0x4010e0(0x28d)](_0x5a0b1a);if(_0x110b5b)return _0x110b5b;const _0x11ae9d=_0x2c4c46['existingSegments']['find'](_0x1d75d6=>_0x1d75d6[_0x4010e0(0x243)]===_0x5a0b1a);if(_0x11ae9d)return _0x2c4c46['segmentNameToId'][_0x4010e0(0x1db)](_0x5a0b1a,_0x11ae9d['id']),_0x11ae9d['id'];if(_0x3543e2[_0x4010e0(0x293)]){const {stageName:_0x3ee886,criteriaName:_0xeef826}=findSegmentCriteriaLocation(_0x3543e2[_0x4010e0(0x242)],_0x5a0b1a);return _0x38a1a2(_0x5a0b1a,_0x187431[_0x4010e0(0x244)]),_0x39fcf7[_0x4010e0(0x1db)](_0x5a0b1a,{'definition':_0x187431,'stageName':_0x3ee886,'criteriaName':_0xeef826}),createPendingSegmentId(_0x5a0b1a);}const _0x375649=_0x3543e2[_0x4010e0(0x1d8)]?.['id'];if(!_0x375649)throw new SDKError(ErrorCode[_0x4010e0(0x1bf)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x876c8f=_0x183e1a[_0x4010e0(0x28d)](_0x5a0b1a);if(_0x876c8f)return _0x876c8f;const _0x4b4f31=((async()=>{const _0x133dc1=_0x4010e0;_0x38a1a2(_0x5a0b1a,_0x187431[_0x133dc1(0x244)]);const _0x51b88f=generateDeterministicJourneySegmentName(_0x3543e2[_0x133dc1(0x242)][_0x133dc1(0x243)],_0x5a0b1a),_0x36d1da=_0x2c4c46[_0x133dc1(0x1e5)]['find'](_0x317c8c=>_0x317c8c['name']===_0x51b88f),_0x33eba1=createSegmentIdResolver(_0x2c4c46[_0x133dc1(0x263)],_0x5a0b1a),_0x579529=await resolveRuleSegmentIds(_0x187431[_0x133dc1(0x244)],_0x33eba1);let _0x125afa;return _0x36d1da?(await _0x5e3e64[_0x133dc1(0x1d9)][_0x133dc1(0x22d)](_0x4d4e5f[_0x133dc1(0x253)],_0x36d1da['id'],{'description':_0x187431[_0x133dc1(0x25a)]||_0x133dc1(0x1e3)+_0x5a0b1a,'rule':_0x186997(_0x579529),'countPopulation':!![]}),_0x125afa=_0x36d1da['id'],saveSegmentToPushRecovery(_0x3543e2['absolutePath'],_0x3543e2[_0x133dc1(0x242)][_0x133dc1(0x243)],_0x5a0b1a,{'segmentId':_0x125afa,'uniqueServerName':_0x51b88f,'createdAt':new Date()[_0x133dc1(0x2b7)]()})):_0x125afa=await createOrRecoverEmbeddedSegment(_0x5e3e64,_0x3543e2,{'localName':_0x5a0b1a,'uniqueSegmentName':_0x51b88f,'description':_0x187431[_0x133dc1(0x25a)]||'Entry\x20criteria:\x20'+_0x5a0b1a,'journeyId':_0x375649,'resolvedRule':_0x579529,'parentId':_0x4d4e5f['parentId'],'folderId':_0x4d4e5f[_0x133dc1(0x1d3)]||''},_0x186997),_0x2c4c46[_0x133dc1(0x263)][_0x133dc1(0x1db)](_0x5a0b1a,_0x125afa),_0x10af87[_0x133dc1(0x1db)](_0x5a0b1a,_0x125afa),_0x125afa;})());_0x183e1a[_0x4010e0(0x1db)](_0x5a0b1a,_0x4b4f31);try{return await _0x4b4f31;}finally{_0x183e1a[_0x4010e0(0x1d5)](_0x5a0b1a);}},'resolveActivationId':async _0x485bcc=>{const _0x35e9d6=_0x2a8d7a,_0x2c8e35=_0x478c70[_0x35e9d6(0x28d)](_0x485bcc);if(_0x2c8e35)return _0x2c8e35;if(_0x3543e2[_0x35e9d6(0x1d8)]){await _0x4e73a2();const _0x128405=_0x478c70[_0x35e9d6(0x28d)](_0x485bcc);if(_0x128405)return _0x128405;}throw new SDKError(ErrorCode[_0x35e9d6(0x1c5)],_0x35e9d6(0x22b)+_0x485bcc+_0x35e9d6(0x298)+_0x3543e2[_0x35e9d6(0x242)][_0x35e9d6(0x243)]+').\x20'+_0x35e9d6(0x258));},'resolveEmbeddedActivationId':async(_0x32037e,_0x26578b)=>{const _0x1d2b4e=_0x2a8d7a,_0x5af93f=_0x478c70[_0x1d2b4e(0x28d)](_0x32037e);if(_0x5af93f)return _0x5af93f;if(_0x3543e2['isNew'])return _0x57f007[_0x1d2b4e(0x1db)](_0x32037e,_0x26578b),createPendingActivationId(_0x32037e);if(_0x3543e2['existingJourney']){await _0x4e73a2();const _0x363201=_0x478c70[_0x1d2b4e(0x28d)](_0x26578b[_0x1d2b4e(0x243)]);if(_0x363201)return _0x478c70[_0x1d2b4e(0x1db)](_0x32037e,_0x363201),_0x363201;const _0x381020=activationSignature(_0x26578b),_0x1de73c=_0x514270?.['get'](_0x381020);if(_0x1de73c)return _0x478c70[_0x1d2b4e(0x1db)](_0x32037e,_0x1de73c),_0x1de73c;const _0x5b22a1=await _0x57fe24(_0x26578b,_0x2c4c46[_0x1d2b4e(0x235)]),_0x1052d3={..._0x5b22a1,..._0x26578b[_0x1d2b4e(0x2b9)]!==undefined&&{'runAfterJourneyRefresh':_0x26578b['run_after_journey_refresh']}},_0xbedc05=await _0x5e3e64[_0x1d2b4e(0x2a8)][_0x1d2b4e(0x28f)](_0x3543e2['existingJourney']['id'],_0x1052d3);return _0x478c70[_0x1d2b4e(0x1db)](_0x32037e,_0xbedc05['id']),_0xbedc05['id'];}throw new SDKError(ErrorCode[_0x1d2b4e(0x1bf)],_0x1d2b4e(0x21d));},'resolveJourneyId':async _0x49b7f8=>{const _0x40e216=_0x2a8d7a;try{return await _0x5e3e64[_0x40e216(0x2a8)]['resolveJourneyId'](_0x4d4e5f[_0x40e216(0x253)],_0x49b7f8);}catch(_0x21f62a){throw new SDKError(ErrorCode[_0x40e216(0x1c5)],_0x40e216(0x1c4)+_0x49b7f8+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x3543e2['yamlConfig'][_0x40e216(0x243)]+'\x27)',_0x21f62a);}},'resolveStageId':async(_0x3a37e5,_0x1025ab)=>{const _0x5c0a3f=_0x2a8d7a,_0x133fbb=await _0x5e3e64[_0x5c0a3f(0x2a8)][_0x5c0a3f(0x268)](_0x3a37e5),_0x3b3f42=_0x133fbb[_0x5c0a3f(0x228)][_0x5c0a3f(0x2be)]['find'](_0xa9ff07=>_0xa9ff07[_0x5c0a3f(0x243)][_0x5c0a3f(0x24b)]()===_0x1025ab[_0x5c0a3f(0x24b)]());if(!_0x3b3f42?.['id'])throw new SDKError(ErrorCode[_0x5c0a3f(0x1c5)],_0x5c0a3f(0x2bd)+_0x1025ab+_0x5c0a3f(0x209)+(_0x133fbb[_0x5c0a3f(0x228)]['journeyBundleName']||_0x133fbb[_0x5c0a3f(0x228)][_0x5c0a3f(0x243)])+'\x27');return _0x3b3f42['id'];}},_0x3b4672=await _0x5e70db(_0x3543e2[_0x2a8d7a(0x242)],_0x4d4e5f['parentId'],_0x2a724c),_0x2dba00=_0x4d4e5f[_0x2a8d7a(0x2b1)]||_0x4d4e5f[_0x2a8d7a(0x1d3)];_0x2dba00&&(_0x3b4672[_0x2a8d7a(0x2a4)]={'parentFolder':{'data':{'id':_0x2dba00,'type':_0x2a8d7a(0x1e6)}}});if(_0x3543e2[_0x2a8d7a(0x293)]){if(_0x39fcf7[_0x2a8d7a(0x222)]>0x0||_0x57f007[_0x2a8d7a(0x222)]>0x0)return await executeThreeStepJourneyCreate(_0x5e3e64,_0x3543e2,_0x3b4672,{'pendingEmbeddedSegments':_0x39fcf7,'pendingEmbeddedActivations':_0x57f007,'embeddedSegmentNameToId':_0x10af87,'journeyActivationNameToId':_0x478c70},{..._0x4d4e5f,'effectiveFolderId':_0x2dba00},_0x2c4c46,_0xa918a,_0x4ce4ad);else{ensureJourneyDefaults(_0x3b4672[_0x2a8d7a(0x228)]);const _0x4e8aae=await _0x5e3e64[_0x2a8d7a(0x2a8)][_0x2a8d7a(0x297)](_0x3b4672);return deletePushRecovery(_0x3543e2[_0x2a8d7a(0x219)]),{'action':_0x2a8d7a(0x2b0),'journeyId':_0x4e8aae['id'],'embeddedSegmentNameToId':_0x10af87};}}else{if(_0x3543e2[_0x2a8d7a(0x21a)]&&_0x3543e2[_0x2a8d7a(0x1d8)]){_0x3b4672['id']=_0x3543e2[_0x2a8d7a(0x1d8)]['id'];const _0x2e8480=_0x3b4672[_0x2a8d7a(0x228)];_0x3543e2[_0x2a8d7a(0x1d8)][_0x2a8d7a(0x228)]?.[_0x2a8d7a(0x1f4)]&&(_0x2e8480[_0x2a8d7a(0x1f4)]=_0x3543e2[_0x2a8d7a(0x1d8)][_0x2a8d7a(0x228)][_0x2a8d7a(0x1f4)]);const _0x433260=_0x3543e2[_0x2a8d7a(0x1d8)][_0x2a8d7a(0x228)]?.['journeyStages'];return _0x433260&&_0x3b4672[_0x2a8d7a(0x228)][_0x2a8d7a(0x2be)]&&injectExistingStageIds(_0x3b4672['attributes'][_0x2a8d7a(0x2be)],_0x433260),ensureJourneyDefaults(_0x2e8480),await _0x5e3e64[_0x2a8d7a(0x2a8)][_0x2a8d7a(0x1d4)](_0x3543e2[_0x2a8d7a(0x1d8)]['id'],_0x3b4672),deletePushRecovery(_0x3543e2['absolutePath']),{'action':_0x2a8d7a(0x265),'journeyId':_0x3543e2[_0x2a8d7a(0x1d8)]['id'],'embeddedSegmentNameToId':_0x10af87};}}return deletePushRecovery(_0x3543e2['absolutePath']),{'action':_0x2a8d7a(0x205),'journeyId':_0x3543e2[_0x2a8d7a(0x1d8)]?.['id'],'embeddedSegmentNameToId':_0x10af87};}function findSegmentCriteriaLocation(_0x5ca107,_0x446a4c){const _0x2e0123=a155_0x2858,_0x34c096=_0x5ca107[_0x2e0123(0x224)]||_0x5ca107['journeys']?.[0x0]?.[_0x2e0123(0x224)]||[];let _0x1957f8=_0x2e0123(0x250),_0x2f46d4=_0x446a4c;const _0x367150=_0x5ca107['goal']||_0x5ca107['journeys']?.[0x0]?.[_0x2e0123(0x287)];if(_0x367150?.[_0x2e0123(0x1d9)]===_0x446a4c)return{'stageName':'goal','criteriaName':_0x367150[_0x2e0123(0x243)]||_0x446a4c};_0x213eca:for(const _0xc7b23 of _0x34c096){if(_0xc7b23[_0x2e0123(0x23d)]?.['segment']===_0x446a4c){_0x1957f8=_0xc7b23[_0x2e0123(0x243)],_0x2f46d4=_0xc7b23[_0x2e0123(0x23d)]['name']||_0x446a4c;break;}if(_0xc7b23['steps'])for(const _0x2d5be of _0xc7b23[_0x2e0123(0x275)]){if(_0x2d5be[_0x2e0123(0x1df)]===_0x2e0123(0x276)&&_0x2d5be[_0x2e0123(0x26c)]?.[_0x2e0123(0x204)])for(const _0x3d42ac of _0x2d5be[_0x2e0123(0x26c)][_0x2e0123(0x204)]){if(_0x3d42ac[_0x2e0123(0x1d9)]===_0x446a4c){_0x1957f8=_0xc7b23['name'],_0x2f46d4=_0x3d42ac[_0x2e0123(0x243)]||_0x446a4c;break _0x213eca;}}}}return{'stageName':_0x1957f8,'criteriaName':_0x2f46d4};}async function executeThreeStepJourneyCreate(_0x1205df,_0x135d32,_0x392bd9,_0x161cc5,_0x2d7a61,_0x5d5796,_0x575605,_0x4b5c03){const _0x5bfce3=a155_0x2858,{activationDefToCreateRequest:_0x4b48ec,yamlRuleToApi:_0x3d5ff4}=_0x4b5c03,{pendingEmbeddedSegments:_0x6b19e3,pendingEmbeddedActivations:_0x45ca87,embeddedSegmentNameToId:_0x377f6b}=_0x161cc5,_0x18dc06=JSON[_0x5bfce3(0x20a)](JSON[_0x5bfce3(0x230)](_0x392bd9));ensureJourneyDefaults(_0x18dc06[_0x5bfce3(0x228)]),stripPendingIds(_0x18dc06);const _0x3dfe8c=await _0x1205df[_0x5bfce3(0x2a8)][_0x5bfce3(0x297)](_0x18dc06),_0x13e272=_0x3dfe8c['id'],_0x527654=new Map();for(const _0x273922 of _0x3dfe8c[_0x5bfce3(0x228)][_0x5bfce3(0x2be)]){_0x527654[_0x5bfce3(0x1db)](_0x273922[_0x5bfce3(0x243)]['toLowerCase'](),_0x273922['id']);}recoverSegmentIdsFromPushRecovery(_0x135d32,_0x377f6b,_0x5d5796[_0x5bfce3(0x263)]);for(const [_0x181643,{definition:_0x27b6a5}]of _0x6b19e3){if(_0x377f6b[_0x5bfce3(0x1e8)](_0x181643)){_0x575605[_0x5bfce3(0x227)]?.({'type':_0x5bfce3(0x27a),'journeyName':_0x135d32[_0x5bfce3(0x242)][_0x5bfce3(0x243)],'segmentName':_0x181643});continue;}const _0x517bd2=generateDeterministicJourneySegmentName(_0x135d32['yamlConfig'][_0x5bfce3(0x243)],_0x181643);_0x575605[_0x5bfce3(0x227)]?.({'type':'embedded_segment_creating','journeyName':_0x135d32[_0x5bfce3(0x242)]['name'],'segmentName':_0x181643});const _0x42c1da=createSegmentIdResolver(_0x5d5796['segmentNameToId'],_0x181643),_0x4ac54d=await resolveRuleSegmentIds(_0x27b6a5['rule'],_0x42c1da),_0x2bf6af=await createOrRecoverEmbeddedSegment(_0x1205df,_0x135d32,{'localName':_0x181643,'uniqueSegmentName':_0x517bd2,'description':_0x27b6a5[_0x5bfce3(0x25a)]||_0x5bfce3(0x1e3)+_0x181643,'journeyId':_0x13e272,'resolvedRule':_0x4ac54d,'parentId':_0x2d7a61['parentId'],'folderId':_0x2d7a61[_0x5bfce3(0x294)]||''},_0x3d5ff4);_0x377f6b[_0x5bfce3(0x1db)](_0x181643,_0x2bf6af),_0x5d5796[_0x5bfce3(0x263)]['set'](_0x181643,_0x2bf6af),_0x575605[_0x5bfce3(0x227)]?.({'type':_0x5bfce3(0x27a),'journeyName':_0x135d32[_0x5bfce3(0x242)][_0x5bfce3(0x243)],'segmentName':_0x181643});}const _0x3d8d2b=new Map();for(const [_0x14f583,_0x12be28]of _0x45ca87){_0x575605[_0x5bfce3(0x227)]?.({'type':_0x5bfce3(0x29d),'journeyName':_0x135d32[_0x5bfce3(0x242)]['name'],'activationName':_0x14f583});const _0x524e99=await _0x4b48ec(_0x12be28,_0x5d5796[_0x5bfce3(0x235)]),_0x374140={..._0x524e99,..._0x12be28['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x12be28[_0x5bfce3(0x2b9)]}},_0x1bb1d9=await _0x1205df['journey']['createActivation'](_0x13e272,_0x374140);_0x3d8d2b[_0x5bfce3(0x1db)](_0x14f583,_0x1bb1d9['id']),_0x161cc5[_0x5bfce3(0x1f7)]['set'](_0x14f583,_0x1bb1d9['id']),_0x575605[_0x5bfce3(0x227)]?.({'type':_0x5bfce3(0x1c8),'journeyName':_0x135d32[_0x5bfce3(0x242)][_0x5bfce3(0x243)],'activationName':_0x14f583});}const _0x1b9835=JSON[_0x5bfce3(0x20a)](JSON[_0x5bfce3(0x230)](_0x392bd9));return _0x1b9835['id']=_0x13e272,ensureJourneyDefaults(_0x1b9835[_0x5bfce3(0x228)]),resolvePendingIdsInRequest(_0x1b9835,_0x392bd9,_0x527654,_0x377f6b,_0x3d8d2b,_0x575605),await _0x1205df[_0x5bfce3(0x2a8)][_0x5bfce3(0x1d4)](_0x13e272,_0x1b9835),deletePushRecovery(_0x135d32['absolutePath']),{'action':_0x5bfce3(0x2b0),'journeyId':_0x13e272,'embeddedSegmentNameToId':_0x377f6b};}export function stripWaitStepPendingIds(_0x3603e6){const _0x44fe0b=a155_0x2858,_0x4e5c63=_0x3603e6['conditionSegmentId']&&isPendingSegmentId(_0x3603e6[_0x44fe0b(0x1ce)]),_0x29b2fb=_0x3603e6[_0x44fe0b(0x2bb)]?.['some'](_0x38c95d=>_0x38c95d[_0x44fe0b(0x25e)]&&isPendingSegmentId(_0x38c95d[_0x44fe0b(0x25e)]));(_0x4e5c63||_0x29b2fb)&&(_0x3603e6[_0x44fe0b(0x206)]='Duration',_0x3603e6[_0x44fe0b(0x234)]=0x1,_0x3603e6['waitStepUnit']=_0x44fe0b(0x1f0),delete _0x3603e6[_0x44fe0b(0x1ce)],delete _0x3603e6[_0x44fe0b(0x233)],delete _0x3603e6[_0x44fe0b(0x274)],delete _0x3603e6['conditions']);}export function resolveWaitStepPendingIds(_0x3dab3d,_0x5f3b6c,_0x5aa506,_0x2ef3db){const _0xd439cb=a155_0x2858;if(_0x5f3b6c['conditionSegmentId']&&isPendingSegmentId(_0x5f3b6c[_0xd439cb(0x1ce)])){const _0x171291=_0x5aa506(_0x5f3b6c[_0xd439cb(0x1ce)],_0xd439cb(0x208)+_0x2ef3db+'\x27\x20wait\x20condition');_0x171291&&(_0x3dab3d[_0xd439cb(0x206)]=_0xd439cb(0x23a),_0x3dab3d[_0xd439cb(0x1ce)]=_0x171291,delete _0x3dab3d[_0xd439cb(0x234)],delete _0x3dab3d[_0xd439cb(0x1dd)],_0x5f3b6c['conditionTimeoutDuration']!==undefined&&(_0x3dab3d[_0xd439cb(0x233)]=_0x5f3b6c[_0xd439cb(0x233)]),_0x5f3b6c['conditionTimeoutUnit']&&(_0x3dab3d[_0xd439cb(0x274)]=_0x5f3b6c[_0xd439cb(0x274)]));}if(_0x5f3b6c[_0xd439cb(0x2bb)]){const _0x30ce05=_0x5f3b6c[_0xd439cb(0x2bb)][_0xd439cb(0x1ff)](_0x17a807=>_0x17a807[_0xd439cb(0x25e)]&&isPendingSegmentId(_0x17a807[_0xd439cb(0x25e)]));if(_0x30ce05){const _0x521b21=_0x5f3b6c[_0xd439cb(0x2bb)][_0xd439cb(0x2a0)](_0x45e08f=>{const _0x2aff0d=_0xd439cb;if(_0x45e08f['segmentId']&&isPendingSegmentId(_0x45e08f[_0x2aff0d(0x25e)])){const _0x12a853=_0x5aa506(_0x45e08f[_0x2aff0d(0x25e)],'stage\x20\x27'+_0x2ef3db+'\x27\x20wait\x20condition');return{..._0x45e08f,'segmentId':_0x12a853||_0x45e08f[_0x2aff0d(0x25e)]};}return{..._0x45e08f};});_0x3dab3d['waitStepType']='Condition',_0x3dab3d[_0xd439cb(0x2bb)]=_0x521b21,delete _0x3dab3d['waitStep'],delete _0x3dab3d[_0xd439cb(0x1dd)],delete _0x3dab3d[_0xd439cb(0x1ce)],delete _0x3dab3d['conditionTimeoutDuration'],delete _0x3dab3d[_0xd439cb(0x274)];}}}function stripPendingIds(_0x188683){const _0x35f49a=a155_0x2858;_0x188683[_0x35f49a(0x228)][_0x35f49a(0x287)]?.['segmentId']&&isPendingSegmentId(_0x188683[_0x35f49a(0x228)]['goal'][_0x35f49a(0x25e)])&&delete _0x188683[_0x35f49a(0x228)]['goal'];for(const _0x5d0a1c of _0x188683['attributes'][_0x35f49a(0x2be)]||[]){_0x5d0a1c[_0x35f49a(0x292)]?.['segmentId']&&isPendingSegmentId(_0x5d0a1c[_0x35f49a(0x292)][_0x35f49a(0x25e)])&&delete _0x5d0a1c[_0x35f49a(0x292)];_0x5d0a1c[_0x35f49a(0x269)]?.[_0x35f49a(0x25e)]&&isPendingSegmentId(_0x5d0a1c['milestone'][_0x35f49a(0x25e)])&&delete _0x5d0a1c[_0x35f49a(0x269)];_0x5d0a1c[_0x35f49a(0x273)]&&(_0x5d0a1c[_0x35f49a(0x273)]=_0x5d0a1c[_0x35f49a(0x273)][_0x35f49a(0x27e)](_0x4ea818=>!_0x4ea818[_0x35f49a(0x25e)]||!isPendingSegmentId(_0x4ea818[_0x35f49a(0x25e)])));if(_0x5d0a1c['steps'])for(const _0xdb6a01 of Object[_0x35f49a(0x1cb)](_0x5d0a1c['steps'])){const _0xc6b7ca=_0x5d0a1c[_0x35f49a(0x275)][_0xdb6a01];_0xc6b7ca['type']===_0x35f49a(0x1d0)&&_0xc6b7ca[_0x35f49a(0x236)]&&isPendingActivationId(_0xc6b7ca[_0x35f49a(0x236)])&&(_0xc6b7ca[_0x35f49a(0x236)]='');if(_0xc6b7ca[_0x35f49a(0x1df)]===_0x35f49a(0x2ac)&&_0xc6b7ca['branches'])for(const _0x18a0c9 of _0xc6b7ca[_0x35f49a(0x204)]){_0x18a0c9[_0x35f49a(0x25e)]&&isPendingSegmentId(_0x18a0c9[_0x35f49a(0x25e)])&&(_0x18a0c9[_0x35f49a(0x25e)]='');}_0xc6b7ca['type']==='WaitStep'&&stripWaitStepPendingIds(_0xc6b7ca);}}}function resolvePendingIdsInRequest(_0x58be16,_0x3a88d8,_0x4a51aa,_0x5e0004,_0x349e49,_0x151c5f){const _0x346561=a155_0x2858,_0x53cd5a=(_0x258edf,_0x18196b)=>{const _0x2b1ca7=a155_0x2858;if(!isPendingSegmentId(_0x258edf))return _0x258edf;const _0x348bff=extractPendingSegmentName(_0x258edf),_0x1901c8=_0x5e0004['get'](_0x348bff);return!_0x1901c8&&_0x151c5f[_0x2b1ca7(0x28a)]?.(_0x2b1ca7(0x212)+_0x348bff+'\x27\x20for\x20'+_0x18196b),_0x1901c8;};if(_0x58be16[_0x346561(0x228)][_0x346561(0x287)]?.[_0x346561(0x25e)]&&isPendingSegmentId(_0x58be16[_0x346561(0x228)]['goal'][_0x346561(0x25e)])){const _0x456fbd=_0x53cd5a(_0x58be16[_0x346561(0x228)][_0x346561(0x287)][_0x346561(0x25e)],_0x346561(0x22c));_0x456fbd&&(_0x58be16[_0x346561(0x228)][_0x346561(0x287)]['segmentId']=_0x456fbd);}for(const _0x430098 of _0x58be16['attributes']['journeyStages']||[]){const _0x450f17=_0x4a51aa[_0x346561(0x28d)](_0x430098['name']['toLowerCase']());_0x450f17&&(_0x430098['id']=_0x450f17);if(_0x430098[_0x346561(0x292)]?.[_0x346561(0x25e)]&&isPendingSegmentId(_0x430098[_0x346561(0x292)]['segmentId'])){const _0x32ce6b=_0x53cd5a(_0x430098[_0x346561(0x292)][_0x346561(0x25e)],_0x346561(0x208)+_0x430098['name']+_0x346561(0x1c1));_0x32ce6b&&(_0x430098['entryCriteria'][_0x346561(0x25e)]=_0x32ce6b);}if(_0x430098[_0x346561(0x273)])for(const _0x526e2f of _0x430098['exitCriterias']){if(_0x526e2f[_0x346561(0x25e)]&&isPendingSegmentId(_0x526e2f['segmentId'])){const _0x2cdf26=_0x53cd5a(_0x526e2f[_0x346561(0x25e)],_0x346561(0x208)+_0x430098[_0x346561(0x243)]+_0x346561(0x283));_0x2cdf26&&(_0x526e2f['segmentId']=_0x2cdf26);}}if(_0x430098[_0x346561(0x269)]?.[_0x346561(0x25e)]&&isPendingSegmentId(_0x430098[_0x346561(0x269)][_0x346561(0x25e)])){const _0x59e26e=_0x53cd5a(_0x430098[_0x346561(0x269)][_0x346561(0x25e)],_0x346561(0x208)+_0x430098['name']+_0x346561(0x1bd));_0x59e26e&&(_0x430098[_0x346561(0x269)][_0x346561(0x25e)]=_0x59e26e);}if(_0x430098[_0x346561(0x275)]){const _0x3f7eb3=_0x6046f8=>_0x3a88d8[_0x346561(0x228)][_0x346561(0x2be)]?.[_0x346561(0x264)](_0x65d5c3=>_0x65d5c3[_0x346561(0x243)][_0x346561(0x24b)]()===_0x430098[_0x346561(0x243)][_0x346561(0x24b)]())?.[_0x346561(0x275)]?.[_0x6046f8];for(const _0x2ff609 of Object[_0x346561(0x1cb)](_0x430098[_0x346561(0x275)])){const _0x4d634a=_0x430098[_0x346561(0x275)][_0x2ff609],_0x5ae6ba=_0x3f7eb3(_0x2ff609);if(_0x4d634a['type']===_0x346561(0x1d0)&&_0x4d634a[_0x346561(0x236)]&&(isPendingActivationId(_0x4d634a[_0x346561(0x236)])||_0x4d634a['journeyActivationStepId']==='')){if(_0x5ae6ba?.[_0x346561(0x236)]&&isPendingActivationId(_0x5ae6ba[_0x346561(0x236)])){const _0x43fe6e=extractPendingActivationName(_0x5ae6ba[_0x346561(0x236)]),_0x58b09b=_0x349e49['get'](_0x43fe6e);_0x58b09b&&(_0x4d634a['journeyActivationStepId']=_0x58b09b);}}if(_0x4d634a[_0x346561(0x1df)]===_0x346561(0x2ac)&&_0x4d634a[_0x346561(0x204)]&&_0x5ae6ba?.[_0x346561(0x204)])for(let _0x123974=0x0;_0x123974<_0x4d634a[_0x346561(0x204)][_0x346561(0x2bf)];_0x123974++){const _0x3d316c=_0x4d634a['branches'][_0x123974],_0x2fdecb=_0x5ae6ba[_0x346561(0x204)][_0x123974];if(_0x2fdecb?.[_0x346561(0x25e)]&&isPendingSegmentId(_0x2fdecb[_0x346561(0x25e)])){const _0x490c81=_0x53cd5a(_0x2fdecb[_0x346561(0x25e)],_0x346561(0x208)+_0x430098[_0x346561(0x243)]+_0x346561(0x27f)+(_0x3d316c[_0x346561(0x243)]||_0x123974)+'\x27');_0x490c81&&(_0x3d316c[_0x346561(0x25e)]=_0x490c81);}}_0x4d634a['type']===_0x346561(0x272)&&_0x5ae6ba?.[_0x346561(0x1df)]===_0x346561(0x272)&&resolveWaitStepPendingIds(_0x4d634a,_0x5ae6ba,_0x53cd5a,_0x430098[_0x346561(0x243)]);}}}}
@@ -1 +1 @@
1
- function a156_0x3974(){const _0x5af274=['get','has','12BKpHeH','346754mrggOL','set','335630hicJKw','105InlImj','495htpUaM','name','1026171fTRwLx','add','parentFolderId','1422456kGAIfu','79844wKywES','3137337VJUHTg','3FhtfAo','6895024pXMDjI'];a156_0x3974=function(){return _0x5af274;};return a156_0x3974();}(function(_0x3c3a5f,_0x2dae5a){const _0x3ae55c=a156_0x4ee4,_0x54a412=_0x3c3a5f();while(!![]){try{const _0x221a09=parseInt(_0x3ae55c(0x1f6))/0x1*(parseInt(_0x3ae55c(0x1ea))/0x2)+parseInt(_0x3ae55c(0x1f0))/0x3+parseInt(_0x3ae55c(0x1f4))/0x4*(parseInt(_0x3ae55c(0x1ed))/0x5)+-parseInt(_0x3ae55c(0x1e9))/0x6*(-parseInt(_0x3ae55c(0x1f3))/0x7)+parseInt(_0x3ae55c(0x1f7))/0x8+-parseInt(_0x3ae55c(0x1f5))/0x9+parseInt(_0x3ae55c(0x1ec))/0xa*(-parseInt(_0x3ae55c(0x1ee))/0xb);if(_0x221a09===_0x2dae5a)break;else _0x54a412['push'](_0x54a412['shift']());}catch(_0x33b98c){_0x54a412['push'](_0x54a412['shift']());}}}(a156_0x3974,0xa8a2f));export function buildFolderIdToPathMap(_0x360d78){const _0x5ea414=a156_0x4ee4,_0x2b9410=new Map(),_0xf21de1=new Map();for(const _0x53d247 of _0x360d78){_0xf21de1[_0x5ea414(0x1eb)](_0x53d247['id'],_0x53d247);}const _0xb815dc=new Set();for(const _0x2e3652 of _0x360d78){!_0x2e3652['parentFolderId']&&_0xb815dc[_0x5ea414(0x1f1)](_0x2e3652['id']);}function _0x3192c1(_0x348bbd){const _0x2509e0=_0x5ea414;if(_0x2b9410[_0x2509e0(0x1e8)](_0x348bbd['id']))return _0x2b9410[_0x2509e0(0x1e7)](_0x348bbd['id']);if(_0xb815dc[_0x2509e0(0x1e8)](_0x348bbd['id']))return _0x2b9410[_0x2509e0(0x1eb)](_0x348bbd['id'],''),'';if(_0x348bbd[_0x2509e0(0x1f2)]){const _0x294d5b=_0xf21de1[_0x2509e0(0x1e7)](_0x348bbd[_0x2509e0(0x1f2)]);if(_0x294d5b){const _0x245feb=_0x3192c1(_0x294d5b),_0x4a2874=_0x245feb?_0x245feb+'/'+_0x348bbd[_0x2509e0(0x1ef)]:_0x348bbd[_0x2509e0(0x1ef)];return _0x2b9410[_0x2509e0(0x1eb)](_0x348bbd['id'],_0x4a2874),_0x4a2874;}}const _0x3f6f9a=_0x348bbd[_0x2509e0(0x1ef)];return _0x2b9410['set'](_0x348bbd['id'],_0x3f6f9a),_0x3f6f9a;}for(const _0x255f7a of _0x360d78){_0x3192c1(_0x255f7a);}return _0x2b9410;}function a156_0x4ee4(_0x28d0e8,_0x39f147){_0x28d0e8=_0x28d0e8-0x1e7;const _0x39745a=a156_0x3974();let _0x4ee4c0=_0x39745a[_0x28d0e8];return _0x4ee4c0;}export function buildFolderPathToIdMap(_0x5a04e5){const _0x2c505b=a156_0x4ee4,_0x5a428f=new Map(),_0x4a182b=new Map();for(const _0x580301 of _0x5a04e5){_0x4a182b[_0x2c505b(0x1eb)](_0x580301['id'],_0x580301);}const _0x2ee5c3=new Set();for(const _0x3acde4 of _0x5a04e5){!_0x3acde4['parentFolderId']&&_0x2ee5c3[_0x2c505b(0x1f1)](_0x3acde4['id']);}function _0x25548e(_0x12da4e){const _0xa9c578=_0x2c505b;if(_0x2ee5c3['has'](_0x12da4e['id']))return'';if(_0x12da4e['parentFolderId']){const _0x5ef24e=_0x4a182b['get'](_0x12da4e[_0xa9c578(0x1f2)]);if(_0x5ef24e){const _0x1e8b94=_0x25548e(_0x5ef24e);return _0x1e8b94?_0x1e8b94+'/'+_0x12da4e[_0xa9c578(0x1ef)]:_0x12da4e[_0xa9c578(0x1ef)];}}return _0x12da4e[_0xa9c578(0x1ef)];}for(const _0x5df317 of _0x5a04e5){const _0x15d0dd=_0x25548e(_0x5df317);_0x5a428f[_0x2c505b(0x1eb)](_0x15d0dd,_0x5df317['id']);}return _0x5a428f;}export function buildFolderMaps(_0x24bf43){const _0x44d10e=a156_0x4ee4,_0x55afea=buildFolderIdToPathMap(_0x24bf43),_0x583369=new Map();for(const [_0x59090a,_0x51ecd9]of _0x55afea){_0x583369[_0x44d10e(0x1eb)](_0x51ecd9,_0x59090a);}return{'idToPath':_0x55afea,'pathToId':_0x583369};}export function getFolderPath(_0x133cfd,_0x1f9aa4){const _0x5cc031=a156_0x4ee4;if(!_0x133cfd)return'';return _0x1f9aa4[_0x5cc031(0x1e7)](_0x133cfd)??'';}
1
+ (function(_0x53d2c9,_0x414495){const _0x25ca5e=a156_0x19b0,_0x2b6e68=_0x53d2c9();while(!![]){try{const _0x58d609=-parseInt(_0x25ca5e(0x157))/0x1*(-parseInt(_0x25ca5e(0x155))/0x2)+-parseInt(_0x25ca5e(0x153))/0x3+-parseInt(_0x25ca5e(0x15c))/0x4*(parseInt(_0x25ca5e(0x161))/0x5)+parseInt(_0x25ca5e(0x154))/0x6+-parseInt(_0x25ca5e(0x15a))/0x7+parseInt(_0x25ca5e(0x162))/0x8*(parseInt(_0x25ca5e(0x160))/0x9)+parseInt(_0x25ca5e(0x15b))/0xa*(-parseInt(_0x25ca5e(0x156))/0xb);if(_0x58d609===_0x414495)break;else _0x2b6e68['push'](_0x2b6e68['shift']());}catch(_0x4ab995){_0x2b6e68['push'](_0x2b6e68['shift']());}}}(a156_0x18aa,0x59185));function a156_0x19b0(_0x78a96b,_0x372213){_0x78a96b=_0x78a96b-0x153;const _0x18aae4=a156_0x18aa();let _0x19b082=_0x18aae4[_0x78a96b];return _0x19b082;}export function buildFolderIdToPathMap(_0x4a8399){const _0x3e9675=a156_0x19b0,_0x45890b=new Map(),_0x17d151=new Map();for(const _0x25f81b of _0x4a8399){_0x17d151['set'](_0x25f81b['id'],_0x25f81b);}const _0x4fa980=new Set();for(const _0x3d4c9d of _0x4a8399){!_0x3d4c9d[_0x3e9675(0x163)]&&_0x4fa980[_0x3e9675(0x15d)](_0x3d4c9d['id']);}function _0x3470fb(_0x3898f6){const _0x3c92c7=_0x3e9675;if(_0x45890b[_0x3c92c7(0x158)](_0x3898f6['id']))return _0x45890b['get'](_0x3898f6['id']);if(_0x4fa980[_0x3c92c7(0x158)](_0x3898f6['id']))return _0x45890b['set'](_0x3898f6['id'],''),'';if(_0x3898f6[_0x3c92c7(0x163)]){const _0x802b78=_0x17d151[_0x3c92c7(0x159)](_0x3898f6[_0x3c92c7(0x163)]);if(_0x802b78){const _0x8ab598=_0x3470fb(_0x802b78),_0x12165a=_0x8ab598?_0x8ab598+'/'+_0x3898f6[_0x3c92c7(0x15f)]:_0x3898f6[_0x3c92c7(0x15f)];return _0x45890b['set'](_0x3898f6['id'],_0x12165a),_0x12165a;}}const _0x32b245=_0x3898f6[_0x3c92c7(0x15f)];return _0x45890b[_0x3c92c7(0x15e)](_0x3898f6['id'],_0x32b245),_0x32b245;}for(const _0x1aa806 of _0x4a8399){_0x3470fb(_0x1aa806);}return _0x45890b;}export function buildFolderPathToIdMap(_0x5f4d52){const _0x281d16=new Map(),_0x15fbe5=new Map();for(const _0x5a331b of _0x5f4d52){_0x15fbe5['set'](_0x5a331b['id'],_0x5a331b);}const _0xa3d14c=new Set();for(const _0x29dd01 of _0x5f4d52){!_0x29dd01['parentFolderId']&&_0xa3d14c['add'](_0x29dd01['id']);}function _0x169731(_0x187c76){const _0x658b6c=a156_0x19b0;if(_0xa3d14c[_0x658b6c(0x158)](_0x187c76['id']))return'';if(_0x187c76['parentFolderId']){const _0x388f4=_0x15fbe5[_0x658b6c(0x159)](_0x187c76[_0x658b6c(0x163)]);if(_0x388f4){const _0x344ebd=_0x169731(_0x388f4);return _0x344ebd?_0x344ebd+'/'+_0x187c76[_0x658b6c(0x15f)]:_0x187c76['name'];}}return _0x187c76['name'];}for(const _0x594021 of _0x5f4d52){const _0x10c67e=_0x169731(_0x594021);_0x281d16['set'](_0x10c67e,_0x594021['id']);}return _0x281d16;}function a156_0x18aa(){const _0x4f032f=['11Kmgpxz','85197roTjaq','has','get','756196ampeiq','886910dbgYDG','76088nUnNxP','add','set','name','9Gfpkur','110AvZcun','30056tSVeMi','parentFolderId','406776lAIOhx','3604734WVtVqK','12RxvOqd'];a156_0x18aa=function(){return _0x4f032f;};return a156_0x18aa();}export function buildFolderMaps(_0x3d87e3){const _0x1c3d66=buildFolderIdToPathMap(_0x3d87e3),_0xddb8e6=new Map();for(const [_0x257f2b,_0x273000]of _0x1c3d66){_0xddb8e6['set'](_0x273000,_0x257f2b);}return{'idToPath':_0x1c3d66,'pathToId':_0xddb8e6};}export function getFolderPath(_0xd00f0a,_0x3404d9){const _0x3169cb=a156_0x19b0;if(!_0xd00f0a)return'';return _0x3404d9[_0x3169cb(0x159)](_0xd00f0a)??'';}
@@ -1 +1 @@
1
- (function(_0x469e84,_0x297e57){const _0x291116=a157_0x523d,_0x46fcf2=_0x469e84();while(!![]){try{const _0xd2db9f=parseInt(_0x291116(0x150))/0x1+parseInt(_0x291116(0x161))/0x2+parseInt(_0x291116(0x158))/0x3*(-parseInt(_0x291116(0x154))/0x4)+parseInt(_0x291116(0x16a))/0x5*(parseInt(_0x291116(0x166))/0x6)+parseInt(_0x291116(0x15d))/0x7+parseInt(_0x291116(0x14d))/0x8*(parseInt(_0x291116(0x152))/0x9)+parseInt(_0x291116(0x159))/0xa*(-parseInt(_0x291116(0x14c))/0xb);if(_0xd2db9f===_0x297e57)break;else _0x46fcf2['push'](_0x46fcf2['shift']());}catch(_0x233ff8){_0x46fcf2['push'](_0x46fcf2['shift']());}}}(a157_0x58c7,0xa3a03));import a157_0x396baa from'path';import{parse as a157_0x9d79cb}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x58896e){const _0x33a8fd=a157_0x523d;if(!_0x58896e||_0x58896e[_0x33a8fd(0x165)]()==='')throw new Error(_0x33a8fd(0x16d));const _0xfad6ad=_0x58896e['trim']();if(_0xfad6ad==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x58896e};const _0x31ce1d=_0xfad6ad[_0x33a8fd(0x13e)]('/')?_0xfad6ad[_0x33a8fd(0x153)](0x1):_0xfad6ad,_0xcfe981=_0x31ce1d[_0x33a8fd(0x155)]('/')[_0x33a8fd(0x15b)](_0x474e9b=>_0x474e9b!=='');if(_0xcfe981[_0x33a8fd(0x14b)]===0x0)throw new Error(_0x33a8fd(0x151));const _0x178293=_0xfad6ad[_0x33a8fd(0x13e)]('/')||!isRelativePathSegment(_0xcfe981[0x0]);for(const _0x416a7f of _0xcfe981){validatePathSegment(_0x416a7f);}return{'segments':_0xcfe981,'isAbsolute':_0x178293,'raw':_0x58896e};}function isRelativePathSegment(_0x2fc6e2){return _0x2fc6e2==='.'||_0x2fc6e2==='..';}function a157_0x523d(_0x3cf689,_0x3ee02d){_0x3cf689=_0x3cf689-0x13e;const _0x58c7a5=a157_0x58c7();let _0x523dbc=_0x58c7a5[_0x3cf689];return _0x523dbc;}function validatePathSegment(_0x943e17){const _0x103b19=a157_0x523d;if(_0x943e17==='')throw new Error(_0x103b19(0x14e));if(_0x943e17==='.'||_0x943e17==='..')return;if(/[\x00-\x1F\x7F]/[_0x103b19(0x16c)](_0x943e17))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x943e17);if(_0x943e17!==_0x943e17[_0x103b19(0x165)]()){}}export function validatePath(_0x3cbd00){const _0x23cd1d=a157_0x523d;if(_0x3cbd00[_0x23cd1d(0x167)]['length']===0x0&&!_0x3cbd00[_0x23cd1d(0x157)])throw new Error(_0x23cd1d(0x145));if(_0x3cbd00[_0x23cd1d(0x157)]){if(_0x3cbd00[_0x23cd1d(0x167)][0x0]==='..')throw new Error(_0x23cd1d(0x14f));let _0x476531=0x0;for(const _0x595f7a of _0x3cbd00['segments']){if(_0x595f7a==='..'){if(_0x476531===0x0)throw new Error(_0x23cd1d(0x16f));_0x476531--;}else _0x595f7a!=='.'&&_0x476531++;}}}export function joinPaths(_0x2d237d,_0x5de854){const _0x5df608=a157_0x523d;if(!_0x2d237d||_0x2d237d==='/')return _0x5de854;if(!_0x5de854||_0x5de854==='.')return _0x2d237d;if(_0x5de854[_0x5df608(0x13e)]('/'))return _0x5de854;const _0x1e5204=parsePath(_0x2d237d),_0x10ed53=parsePath(_0x5de854),_0x44938f=[..._0x1e5204[_0x5df608(0x167)]];for(const _0x22140b of _0x10ed53[_0x5df608(0x167)]){if(_0x22140b==='.')continue;else{if(_0x22140b==='..'){if(_0x44938f[_0x5df608(0x14b)]===0x0)throw new Error(_0x5df608(0x168));_0x44938f[_0x5df608(0x140)]();}else _0x44938f[_0x5df608(0x141)](_0x22140b);}}const _0x19a5ea=_0x44938f[_0x5df608(0x16e)]('/');return _0x1e5204[_0x5df608(0x148)][_0x5df608(0x13e)]('/')?'/'+_0x19a5ea:_0x19a5ea;}export function normalizePath(_0x5c050c){const _0x356fc8=a157_0x523d,_0x31736d=parsePath(_0x5c050c),_0x4dd1cd=[];for(const _0x470a87 of _0x31736d[_0x356fc8(0x167)]){if(_0x470a87==='.')continue;else{if(_0x470a87==='..'){if(_0x4dd1cd[_0x356fc8(0x14b)]===0x0){if(_0x31736d[_0x356fc8(0x157)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x4dd1cd[_0x356fc8(0x141)]('..');}else _0x4dd1cd[_0x4dd1cd[_0x356fc8(0x14b)]-0x1]==='..'?_0x4dd1cd[_0x356fc8(0x141)]('..'):_0x4dd1cd[_0x356fc8(0x140)]();}else _0x4dd1cd['push'](_0x470a87);}}if(_0x4dd1cd[_0x356fc8(0x14b)]===0x0)return _0x31736d[_0x356fc8(0x157)]?'/':'.';const _0x5c3986=_0x4dd1cd[_0x356fc8(0x16e)]('/');return _0x31736d[_0x356fc8(0x148)][_0x356fc8(0x13e)]('/')?'/'+_0x5c3986:_0x5c3986;}export function getParentPath(_0x3a3fa0){const _0x606497=a157_0x523d,_0x408fd9=parsePath(_0x3a3fa0);if(_0x408fd9[_0x606497(0x167)]['length']<=0x1)return'/';const _0x155aa5=_0x408fd9[_0x606497(0x167)]['slice'](0x0,-0x1)[_0x606497(0x16e)]('/');return _0x408fd9[_0x606497(0x148)]['startsWith']('/')?'/'+_0x155aa5:_0x155aa5;}export function getBaseName(_0x271cda){const _0x5e020b=a157_0x523d,_0x3ef6f1=parsePath(_0x271cda);return _0x3ef6f1[_0x5e020b(0x167)][_0x3ef6f1[_0x5e020b(0x167)][_0x5e020b(0x14b)]-0x1]||'';}export function isChildPath(_0x16a047,_0x58f03f){const _0xadcf7c=a157_0x523d,_0x3361fd=parsePath(_0x16a047),_0x1a3313=parsePath(_0x58f03f);if(_0x3361fd[_0xadcf7c(0x167)]['length']<=_0x1a3313[_0xadcf7c(0x167)][_0xadcf7c(0x14b)])return![];for(let _0x55422d=0x0;_0x55422d<_0x1a3313[_0xadcf7c(0x167)][_0xadcf7c(0x14b)];_0x55422d++){if(_0x3361fd[_0xadcf7c(0x167)][_0x55422d]!==_0x1a3313[_0xadcf7c(0x167)][_0x55422d])return![];}return!![];}function a157_0x58c7(){const _0x1e62b8=['11aFSyCM','48632keUdMv','Path\x20segment\x20cannot\x20be\x20empty','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','743692xGeDBm','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','333sFGriB','substring','100652haGGBI','split','parse','isAbsolute','51wMMZuR','19823070VoezRE','.yaml','filter','root','6769952hqTYQo','No\x20tdx.json\x20found\x20for\x20file:\x20','journey','Cannot\x20split\x20empty\x20path','2245586ZdXyZL','dirname','tdx.json','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','trim','26094AnEfsJ','segments','Cannot\x20navigate\x20above\x20root','.yml','25ZqpMcz','endsWith','test','Path\x20cannot\x20be\x20empty','join','Path\x20attempts\x20to\x20navigate\x20above\x20root','startsWith','exists','pop','push','readFile','name','replace','Relative\x20path\x20cannot\x20be\x20empty','segment','relative','raw','type','File\x20not\x20found:\x20','length'];a157_0x58c7=function(){return _0x1e62b8;};return a157_0x58c7();}export function splitPath(_0x103f4e){const _0x14edba=a157_0x523d,_0x4863c1=parsePath(_0x103f4e);if(_0x4863c1[_0x14edba(0x167)][_0x14edba(0x14b)]===0x0)throw new Error(_0x14edba(0x160));if(_0x4863c1[_0x14edba(0x167)][_0x14edba(0x14b)]===0x1)return{'parent':_0x4863c1[_0x14edba(0x167)][0x0]};return{'parent':_0x4863c1['segments'][0x0],'child':_0x4863c1[_0x14edba(0x167)]['slice'](0x1)[_0x14edba(0x16e)]('/')};}export function isYamlFilePath(_0x31e8d4){const _0x12f625=a157_0x523d;return _0x31e8d4[_0x12f625(0x16b)](_0x12f625(0x169))||_0x31e8d4[_0x12f625(0x16b)](_0x12f625(0x15a));}export async function resolveYamlFilePath(_0x4f4f13,_0x4ddb98=nodeFileSystem){const _0x2ca25d=a157_0x523d,_0x1af14e=a157_0x396baa['resolve'](_0x4f4f13);if(!await _0x4ddb98[_0x2ca25d(0x13f)](_0x1af14e))throw new Error(_0x2ca25d(0x14a)+_0x4f4f13);let _0x5bac67=a157_0x396baa[_0x2ca25d(0x162)](_0x1af14e),_0x3ddb9e=null,_0x25152c=null;const _0x3df286=a157_0x396baa[_0x2ca25d(0x156)](_0x5bac67)[_0x2ca25d(0x15c)];while(_0x5bac67!==_0x3df286){const _0x1aba83=a157_0x396baa[_0x2ca25d(0x16e)](_0x5bac67,_0x2ca25d(0x163));if(await _0x4ddb98[_0x2ca25d(0x13f)](_0x1aba83)){_0x3ddb9e=_0x1aba83,_0x25152c=_0x5bac67;break;}_0x5bac67=a157_0x396baa[_0x2ca25d(0x162)](_0x5bac67);}if(!_0x3ddb9e||!_0x25152c)throw new Error(_0x2ca25d(0x15e)+_0x4f4f13+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0xb5f15f=await _0x4ddb98[_0x2ca25d(0x142)](_0x3ddb9e),_0x3b08f4=JSON[_0x2ca25d(0x156)](_0xb5f15f),_0x2c2cbf=_0x3b08f4['parent_segment'];if(!_0x2c2cbf)throw new Error(_0x2ca25d(0x164));const _0xb107ad=await _0x4ddb98['readFile'](_0x1af14e),_0x1f8f90=a157_0x9d79cb(_0xb107ad),_0x77fa81=_0x1f8f90[_0x2ca25d(0x143)];if(!_0x77fa81)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x4f4f13);const _0x4997a6=_0x1f8f90[_0x2ca25d(0x149)]===_0x2ca25d(0x15f)?_0x2ca25d(0x15f):_0x2ca25d(0x146),_0x1452e0=a157_0x396baa[_0x2ca25d(0x147)](_0x25152c,_0x1af14e),_0x5ade1a=a157_0x396baa['dirname'](_0x1452e0),_0x22fffb=_0x5ade1a==='.'?'':_0x5ade1a[_0x2ca25d(0x144)](/\\/g,'/'),_0x48fdb4=_0x22fffb?_0x2c2cbf+'/'+_0x22fffb+'/'+_0x77fa81:_0x2c2cbf+'/'+_0x77fa81;return{'parentSegment':_0x2c2cbf,'segmentName':_0x77fa81,'folderPath':_0x22fffb,'fullPath':_0x48fdb4,'resourceType':_0x4997a6,'content':_0xb107ad};}
1
+ (function(_0x5e4bf3,_0x6fe988){const _0x5f2052=a157_0x406a,_0x519b39=_0x5e4bf3();while(!![]){try{const _0x1f6e37=-parseInt(_0x5f2052(0xc3))/0x1*(parseInt(_0x5f2052(0xc4))/0x2)+parseInt(_0x5f2052(0xd4))/0x3*(-parseInt(_0x5f2052(0xc6))/0x4)+-parseInt(_0x5f2052(0xbf))/0x5+-parseInt(_0x5f2052(0xe0))/0x6*(parseInt(_0x5f2052(0xd9))/0x7)+-parseInt(_0x5f2052(0xdb))/0x8*(-parseInt(_0x5f2052(0xb8))/0x9)+-parseInt(_0x5f2052(0xbc))/0xa+-parseInt(_0x5f2052(0xcd))/0xb*(-parseInt(_0x5f2052(0xe3))/0xc);if(_0x1f6e37===_0x6fe988)break;else _0x519b39['push'](_0x519b39['shift']());}catch(_0x347188){_0x519b39['push'](_0x519b39['shift']());}}}(a157_0x26ee,0x2313e));import a157_0x30ee73 from'path';import{parse as a157_0x3af7ad}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0xd7141){const _0x447669=a157_0x406a;if(!_0xd7141||_0xd7141['trim']()==='')throw new Error(_0x447669(0xe2));const _0x41455a=_0xd7141['trim']();if(_0x41455a==='/')return{'segments':[],'isAbsolute':!![],'raw':_0xd7141};const _0x308554=_0x41455a['startsWith']('/')?_0x41455a[_0x447669(0xb6)](0x1):_0x41455a,_0x444276=_0x308554[_0x447669(0xce)]('/')[_0x447669(0xd8)](_0x5d0968=>_0x5d0968!=='');if(_0x444276[_0x447669(0xb7)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x2ddea9=_0x41455a[_0x447669(0xc2)]('/')||!isRelativePathSegment(_0x444276[0x0]);for(const _0x7e277b of _0x444276){validatePathSegment(_0x7e277b);}return{'segments':_0x444276,'isAbsolute':_0x2ddea9,'raw':_0xd7141};}function isRelativePathSegment(_0x2ea7d0){return _0x2ea7d0==='.'||_0x2ea7d0==='..';}function a157_0x406a(_0x13f845,_0x3c0b42){_0x13f845=_0x13f845-0xb6;const _0x26ee30=a157_0x26ee();let _0x406af5=_0x26ee30[_0x13f845];return _0x406af5;}function validatePathSegment(_0xc743f4){const _0x92270b=a157_0x406a;if(_0xc743f4==='')throw new Error(_0x92270b(0xdc));if(_0xc743f4==='.'||_0xc743f4==='..')return;if(/[\x00-\x1F\x7F]/[_0x92270b(0xe4)](_0xc743f4))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0xc743f4);if(_0xc743f4!==_0xc743f4[_0x92270b(0xde)]()){}}function a157_0x26ee(){const _0x37e445=['push','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','dirname','11NkKvxZ','split','Cannot\x20navigate\x20above\x20root','journey','No\x20tdx.json\x20found\x20for\x20file:\x20','exists','Relative\x20path\x20cannot\x20be\x20empty','95673UFolxZ','Path\x20attempts\x20to\x20navigate\x20above\x20root','endsWith','pop','filter','1593389VEVbTa','segments','3496ApufBo','Path\x20segment\x20cannot\x20be\x20empty','isAbsolute','trim','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','6mIywWa','Cannot\x20split\x20empty\x20path','Path\x20cannot\x20be\x20empty','12998700DyDnoO','test','substring','length','2799MMLxcB','slice','readFile','type','1858330lcYmOu','name','parse','951695pMBiKV','File\x20not\x20found:\x20','join','startsWith','74GnYVYk','6714uRiYZQ','segment','28xzMekP','raw','parent_segment'];a157_0x26ee=function(){return _0x37e445;};return a157_0x26ee();}export function validatePath(_0x35638e){const _0xf8fb44=a157_0x406a;if(_0x35638e[_0xf8fb44(0xda)]['length']===0x0&&!_0x35638e['isAbsolute'])throw new Error(_0xf8fb44(0xd3));if(_0x35638e[_0xf8fb44(0xdd)]){if(_0x35638e[_0xf8fb44(0xda)][0x0]==='..')throw new Error(_0xf8fb44(0xcb));let _0xf14de=0x0;for(const _0x36f4ac of _0x35638e[_0xf8fb44(0xda)]){if(_0x36f4ac==='..'){if(_0xf14de===0x0)throw new Error(_0xf8fb44(0xd5));_0xf14de--;}else _0x36f4ac!=='.'&&_0xf14de++;}}}export function joinPaths(_0x1938c9,_0x47c8ad){const _0x4dea84=a157_0x406a;if(!_0x1938c9||_0x1938c9==='/')return _0x47c8ad;if(!_0x47c8ad||_0x47c8ad==='.')return _0x1938c9;if(_0x47c8ad[_0x4dea84(0xc2)]('/'))return _0x47c8ad;const _0x6b74bb=parsePath(_0x1938c9),_0x56b896=parsePath(_0x47c8ad),_0x425e97=[..._0x6b74bb[_0x4dea84(0xda)]];for(const _0xad6650 of _0x56b896[_0x4dea84(0xda)]){if(_0xad6650==='.')continue;else{if(_0xad6650==='..'){if(_0x425e97[_0x4dea84(0xb7)]===0x0)throw new Error(_0x4dea84(0xcf));_0x425e97[_0x4dea84(0xd7)]();}else _0x425e97[_0x4dea84(0xc9)](_0xad6650);}}const _0x46c8c8=_0x425e97['join']('/');return _0x6b74bb['raw'][_0x4dea84(0xc2)]('/')?'/'+_0x46c8c8:_0x46c8c8;}export function normalizePath(_0x2f675b){const _0x2f4a7d=a157_0x406a,_0x5e59ad=parsePath(_0x2f675b),_0x5ebb8e=[];for(const _0x125975 of _0x5e59ad[_0x2f4a7d(0xda)]){if(_0x125975==='.')continue;else{if(_0x125975==='..'){if(_0x5ebb8e['length']===0x0){if(_0x5e59ad[_0x2f4a7d(0xdd)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x5ebb8e[_0x2f4a7d(0xc9)]('..');}else _0x5ebb8e[_0x5ebb8e[_0x2f4a7d(0xb7)]-0x1]==='..'?_0x5ebb8e[_0x2f4a7d(0xc9)]('..'):_0x5ebb8e[_0x2f4a7d(0xd7)]();}else _0x5ebb8e[_0x2f4a7d(0xc9)](_0x125975);}}if(_0x5ebb8e[_0x2f4a7d(0xb7)]===0x0)return _0x5e59ad[_0x2f4a7d(0xdd)]?'/':'.';const _0x5f522a=_0x5ebb8e['join']('/');return _0x5e59ad[_0x2f4a7d(0xc7)][_0x2f4a7d(0xc2)]('/')?'/'+_0x5f522a:_0x5f522a;}export function getParentPath(_0x2a7d60){const _0x13c963=a157_0x406a,_0x56a6ad=parsePath(_0x2a7d60);if(_0x56a6ad['segments']['length']<=0x1)return'/';const _0x43a173=_0x56a6ad[_0x13c963(0xda)][_0x13c963(0xb9)](0x0,-0x1)[_0x13c963(0xc1)]('/');return _0x56a6ad[_0x13c963(0xc7)][_0x13c963(0xc2)]('/')?'/'+_0x43a173:_0x43a173;}export function getBaseName(_0x9d5261){const _0x53b35a=parsePath(_0x9d5261);return _0x53b35a['segments'][_0x53b35a['segments']['length']-0x1]||'';}export function isChildPath(_0x4fad7c,_0x1f82aa){const _0x5a6401=a157_0x406a,_0x2a26cf=parsePath(_0x4fad7c),_0x2a6560=parsePath(_0x1f82aa);if(_0x2a26cf[_0x5a6401(0xda)][_0x5a6401(0xb7)]<=_0x2a6560[_0x5a6401(0xda)][_0x5a6401(0xb7)])return![];for(let _0x4294e1=0x0;_0x4294e1<_0x2a6560['segments'][_0x5a6401(0xb7)];_0x4294e1++){if(_0x2a26cf[_0x5a6401(0xda)][_0x4294e1]!==_0x2a6560[_0x5a6401(0xda)][_0x4294e1])return![];}return!![];}export function splitPath(_0x5d4e15){const _0x4dc3da=a157_0x406a,_0xaee695=parsePath(_0x5d4e15);if(_0xaee695['segments'][_0x4dc3da(0xb7)]===0x0)throw new Error(_0x4dc3da(0xe1));if(_0xaee695[_0x4dc3da(0xda)]['length']===0x1)return{'parent':_0xaee695[_0x4dc3da(0xda)][0x0]};return{'parent':_0xaee695['segments'][0x0],'child':_0xaee695[_0x4dc3da(0xda)][_0x4dc3da(0xb9)](0x1)[_0x4dc3da(0xc1)]('/')};}export function isYamlFilePath(_0x1ac225){const _0x5189ad=a157_0x406a;return _0x1ac225[_0x5189ad(0xd6)]('.yml')||_0x1ac225[_0x5189ad(0xd6)]('.yaml');}export async function resolveYamlFilePath(_0x4d0a6b,_0x244de4=nodeFileSystem){const _0x5f9959=a157_0x406a,_0x1e08d0=a157_0x30ee73['resolve'](_0x4d0a6b);if(!await _0x244de4['exists'](_0x1e08d0))throw new Error(_0x5f9959(0xc0)+_0x4d0a6b);let _0xd7da41=a157_0x30ee73['dirname'](_0x1e08d0),_0x516878=null,_0xff3802=null;const _0x259ea2=a157_0x30ee73['parse'](_0xd7da41)['root'];while(_0xd7da41!==_0x259ea2){const _0x36b47f=a157_0x30ee73['join'](_0xd7da41,'tdx.json');if(await _0x244de4[_0x5f9959(0xd2)](_0x36b47f)){_0x516878=_0x36b47f,_0xff3802=_0xd7da41;break;}_0xd7da41=a157_0x30ee73[_0x5f9959(0xcc)](_0xd7da41);}if(!_0x516878||!_0xff3802)throw new Error(_0x5f9959(0xd1)+_0x4d0a6b+'\x0a'+_0x5f9959(0xca));const _0x3784e8=await _0x244de4['readFile'](_0x516878),_0x2b4d36=JSON[_0x5f9959(0xbe)](_0x3784e8),_0x2000f0=_0x2b4d36[_0x5f9959(0xc8)];if(!_0x2000f0)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x46b996=await _0x244de4[_0x5f9959(0xba)](_0x1e08d0),_0x3ea53c=a157_0x3af7ad(_0x46b996),_0x13e0f9=_0x3ea53c[_0x5f9959(0xbd)];if(!_0x13e0f9)throw new Error(_0x5f9959(0xdf)+_0x4d0a6b);const _0x2035c0=_0x3ea53c[_0x5f9959(0xbb)]==='journey'?_0x5f9959(0xd0):_0x5f9959(0xc5),_0xa86559=a157_0x30ee73['relative'](_0xff3802,_0x1e08d0),_0x20e525=a157_0x30ee73[_0x5f9959(0xcc)](_0xa86559),_0xaea2b7=_0x20e525==='.'?'':_0x20e525['replace'](/\\/g,'/'),_0x4ecebb=_0xaea2b7?_0x2000f0+'/'+_0xaea2b7+'/'+_0x13e0f9:_0x2000f0+'/'+_0x13e0f9;return{'parentSegment':_0x2000f0,'segmentName':_0x13e0f9,'folderPath':_0xaea2b7,'fullPath':_0x4ecebb,'resourceType':_0x2035c0,'content':_0x46b996};}
@@ -1 +1 @@
1
- (function(_0x42a617,_0x23fe76){const _0x444e7b=a158_0x56b2,_0x4f2798=_0x42a617();while(!![]){try{const _0x1c6714=-parseInt(_0x444e7b(0x16f))/0x1*(parseInt(_0x444e7b(0x16c))/0x2)+-parseInt(_0x444e7b(0x167))/0x3*(-parseInt(_0x444e7b(0x16e))/0x4)+parseInt(_0x444e7b(0x177))/0x5*(parseInt(_0x444e7b(0x16a))/0x6)+-parseInt(_0x444e7b(0x175))/0x7+parseInt(_0x444e7b(0x170))/0x8*(-parseInt(_0x444e7b(0x176))/0x9)+-parseInt(_0x444e7b(0x16b))/0xa+parseInt(_0x444e7b(0x173))/0xb*(parseInt(_0x444e7b(0x174))/0xc);if(_0x1c6714===_0x23fe76)break;else _0x4f2798['push'](_0x4f2798['shift']());}catch(_0x1e3754){_0x4f2798['push'](_0x4f2798['shift']());}}}(a158_0x1c8c,0xe912b));function a158_0x56b2(_0x325799,_0x2d4a28){_0x325799=_0x325799-0x167;const _0x1c8c37=a158_0x1c8c();let _0x56b262=_0x1c8c37[_0x325799];return _0x56b262;}export function parseSegmentRef(_0x26bedb){const _0x6b993a=a158_0x56b2,_0x19ef65=_0x26bedb[_0x6b993a(0x171)]('/');if(_0x19ef65===-0x1)return{'parentId':_0x26bedb};if(_0x19ef65===0x0)throw new Error(_0x6b993a(0x172)+_0x26bedb+_0x6b993a(0x169));const _0x4b77a8=_0x26bedb[_0x6b993a(0x16d)](0x0,_0x19ef65),_0xad25d2=_0x26bedb['substring'](_0x19ef65+0x1);if(_0xad25d2==='')throw new Error(_0x6b993a(0x172)+_0x26bedb+_0x6b993a(0x168));return{'parentId':_0x4b77a8,'childId':_0xad25d2};}function a158_0x1c8c(){const _0x17456b=['indexOf','Invalid\x20segment\x20reference\x20format:\x20','572NXhhvT','498156SQEgXE','7003297gViaAr','1161UMNGwE','5lvVmqt','148704XcHifz','.\x20Child\x20name\x20cannot\x20be\x20empty','.\x20Parent\x20name\x20cannot\x20be\x20empty','9750648PwQPZF','3240790fvjZNe','2768vaTiev','substring','152QMYQDJ','1103HZogQu','115448JbEGst'];a158_0x1c8c=function(){return _0x17456b;};return a158_0x1c8c();}
1
+ function a158_0x2cd0(_0x552412,_0x5bbac9){_0x552412=_0x552412-0xb0;const _0x5bc820=a158_0x5bc8();let _0x2cd021=_0x5bc820[_0x552412];return _0x2cd021;}(function(_0x4505a3,_0x40fc99){const _0x23aa50=a158_0x2cd0,_0xc7856=_0x4505a3();while(!![]){try{const _0x51260b=parseInt(_0x23aa50(0xb3))/0x1*(-parseInt(_0x23aa50(0xb4))/0x2)+-parseInt(_0x23aa50(0xb8))/0x3*(parseInt(_0x23aa50(0xbd))/0x4)+parseInt(_0x23aa50(0xb2))/0x5+parseInt(_0x23aa50(0xbe))/0x6*(parseInt(_0x23aa50(0xb1))/0x7)+parseInt(_0x23aa50(0xb5))/0x8+-parseInt(_0x23aa50(0xb7))/0x9*(parseInt(_0x23aa50(0xb9))/0xa)+parseInt(_0x23aa50(0xb6))/0xb*(parseInt(_0x23aa50(0xba))/0xc);if(_0x51260b===_0x40fc99)break;else _0xc7856['push'](_0xc7856['shift']());}catch(_0x1abc9c){_0xc7856['push'](_0xc7856['shift']());}}}(a158_0x5bc8,0x4d161));function a158_0x5bc8(){const _0x20965e=['11nfAZlO','171tknAaR','387PXPkZK','293320TEBdOk','4616736uJhfAK','.\x20Child\x20name\x20cannot\x20be\x20empty','Invalid\x20segment\x20reference\x20format:\x20','9584nqLgNR','1225320VNOaLy','substring','7gEAisC','1995935KBiYjL','25076WquRAJ','28UMSESq','4360528PQrqxc'];a158_0x5bc8=function(){return _0x20965e;};return a158_0x5bc8();}export function parseSegmentRef(_0xe6ba00){const _0x409bf9=a158_0x2cd0,_0x251336=_0xe6ba00['indexOf']('/');if(_0x251336===-0x1)return{'parentId':_0xe6ba00};if(_0x251336===0x0)throw new Error(_0x409bf9(0xbc)+_0xe6ba00+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x501e02=_0xe6ba00[_0x409bf9(0xb0)](0x0,_0x251336),_0x340375=_0xe6ba00[_0x409bf9(0xb0)](_0x251336+0x1);if(_0x340375==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0xe6ba00+_0x409bf9(0xbb));return{'parentId':_0x501e02,'childId':_0x340375};}
@@ -1 +1 @@
1
- function a159_0x5939(){const _0x21588e=['.operator.not','MISSING_OPERATOR_VALUE','conditions','.operator.type','type','source','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','352398cBoIbP','And','custom','path','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','MISSING_BETWEEN_BOUNDS','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','4rOXdwg','length','5471710YONwgL','error','aggregation','endsWith','80250QEZnzp','38856gpQGOD','filter','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','2096728sKOnyx','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','.attribute','.segment','push','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','warning','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','operator','1481540ZdzLin','message','symbol','.type','BEHAVIOR_SOURCE_MISSING_FILTER','448GQyCmr','attribute','3949qGKkpm','MISSING_TIME_UNIT','MISSING_NAME','.conditions','12nVxpxu','INVALID_ARRAY_MATCHING','TimeWithinNext','rule','rule.type','match','validationCode','NESTED_CONDITION_GROUP','description','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','Behavior\x20source\x20\x27','success','EMPTY_CONDITIONS','45MEfkDz','invalid_value','\x27\x20with\x20attribute\x20\x27','EMPTY_ATTRIBUTE','params','issues','969819LmantX','TimeWithinPast','level','TEMPORAL_NEGATION_UNSUPPORTED','data','INVALID_RULE_TYPE','.source','document','Attribute\x20name\x20cannot\x20be\x20empty','Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','Operator\x20\x27','map'];a159_0x5939=function(){return _0x21588e;};return a159_0x5939();}(function(_0x326a9c,_0x4f2b26){const _0x1b1c1d=a159_0xc0db,_0x4812c6=_0x326a9c();while(!![]){try{const _0x1e86b6=parseInt(_0x1b1c1d(0x152))/0x1*(-parseInt(_0x1b1c1d(0x14b))/0x2)+parseInt(_0x1b1c1d(0x138))/0x3*(-parseInt(_0x1b1c1d(0x170))/0x4)+parseInt(_0x1b1c1d(0x154))/0x5+-parseInt(_0x1b1c1d(0x158))/0x6*(-parseInt(_0x1b1c1d(0x16a))/0x7)+parseInt(_0x1b1c1d(0x15c))/0x8+-parseInt(_0x1b1c1d(0x132))/0x9*(parseInt(_0x1b1c1d(0x165))/0xa)+parseInt(_0x1b1c1d(0x16c))/0xb*(parseInt(_0x1b1c1d(0x159))/0xc);if(_0x1e86b6===_0x4f2b26)break;else _0x4812c6['push'](_0x4812c6['shift']());}catch(_0x7bea77){_0x4812c6['push'](_0x4812c6['shift']());}}}(a159_0x5939,0xea402));function a159_0xc0db(_0x4a8a31,_0x2ca8f1){_0x4a8a31=_0x4a8a31-0x12c;const _0x59397f=a159_0x5939();let _0xc0dbef=_0x59397f[_0x4a8a31];return _0xc0dbef;}import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x3f3b74,_0x748d3d={},_0x3dec2={}){const _0x49a8a2=a159_0xc0db;if(_0x3dec2['skipSchema'])return runSemanticChecks(_0x3f3b74,_0x748d3d);const _0x24cf87=SegmentDefSchema['safeParse'](_0x3f3b74);if(_0x24cf87[_0x49a8a2(0x130)])return runSemanticChecks(_0x24cf87[_0x49a8a2(0x13c)],_0x748d3d);return zodErrorsToValidationResult(_0x24cf87[_0x49a8a2(0x155)],_0x748d3d);}export function validateRuleDef(_0x2aef27,_0x178fd5,_0x51cf75){const _0x5543fa=a159_0xc0db;if(!_0x2aef27)return[];const _0x4b6414=RuleDefSchema['safeParse'](_0x2aef27);if(_0x4b6414[_0x5543fa(0x130)])return checkRule(_0x4b6414[_0x5543fa(0x13c)],_0x178fd5,_0x51cf75);const _0x2a5a34=flattenZodIssues(_0x4b6414['error'][_0x5543fa(0x137)]);return _0x2a5a34['map'](_0x444c3f=>{const _0x187cf9=_0x5543fa,_0x38130a=formatZodPath(_0x444c3f[_0x187cf9(0x14e)]),_0x5b6a3d=_0x38130a?_0x178fd5+'.'+_0x38130a:_0x178fd5,_0x415d41=mapZodIssueToCode(_0x444c3f,_0x38130a),_0x5a7fce=getLocationFromPath(_0x51cf75[_0x187cf9(0x13f)],_0x51cf75[_0x187cf9(0x149)],pathToArray(_0x5b6a3d));return{'level':_0x187cf9(0x155),'path':_0x5b6a3d,'code':_0x415d41,'message':_0x444c3f[_0x187cf9(0x166)],..._0x5a7fce&&{'location':_0x5a7fce}};});}function zodErrorsToValidationResult(_0x2c84f8,_0x5730ad){const _0x5e151b=a159_0xc0db,_0x26e87c=flattenZodIssues(_0x2c84f8[_0x5e151b(0x137)]),_0x3d450d=_0x26e87c[_0x5e151b(0x143)](_0x314dd7=>{const _0x46eeb3=_0x5e151b,_0x30de88=formatZodPath(_0x314dd7[_0x46eeb3(0x14e)]),_0xddb44b=mapZodIssueToCode(_0x314dd7,_0x30de88),_0x48c4e5=getLocationFromPath(_0x5730ad[_0x46eeb3(0x13f)],_0x5730ad['source'],_0x314dd7['path'][_0x46eeb3(0x143)](_0x36b547=>typeof _0x36b547===_0x46eeb3(0x167)?String(_0x36b547):_0x36b547));return{'level':_0x46eeb3(0x155),'path':_0x30de88,'code':_0xddb44b,'message':_0x314dd7[_0x46eeb3(0x166)],..._0x48c4e5&&{'location':_0x48c4e5}};});return{'valid':![],'errors':_0x3d450d,'warnings':[]};}function mapZodIssueToCode(_0x379942,_0x57b9d4){const _0x3bc54c=a159_0xc0db,_0x296059=_0x379942['code']===_0x3bc54c(0x14d)?_0x379942[_0x3bc54c(0x136)]:undefined;if(_0x57b9d4==='name')return _0x3bc54c(0x16e);if(_0x57b9d4===_0x3bc54c(0x174)||_0x57b9d4[_0x3bc54c(0x157)](_0x3bc54c(0x168))){if(_0x379942['code']===_0x3bc54c(0x133)){if(_0x57b9d4===_0x3bc54c(0x174)||_0x57b9d4[_0x3bc54c(0x175)](/\.conditions\[\d+\]\.type$/))return _0x3bc54c(0x13d);}}if(_0x57b9d4[_0x3bc54c(0x157)](_0x3bc54c(0x147)))return'INVALID_OPERATOR_TYPE';if(_0x57b9d4[_0x3bc54c(0x157)]('.operator.value'))return _0x3bc54c(0x145);if(_0x296059?.[_0x3bc54c(0x176)]===_0x3bc54c(0x150))return _0x3bc54c(0x150);if(_0x296059?.[_0x3bc54c(0x176)]===_0x3bc54c(0x16d))return _0x3bc54c(0x16d);if(_0x57b9d4[_0x3bc54c(0x157)](_0x3bc54c(0x16f))||_0x57b9d4===_0x3bc54c(0x146))return'MISSING_CONDITIONS';if(_0x57b9d4['includes']('arrayMatching'))return _0x3bc54c(0x171);if(_0x57b9d4['endsWith'](_0x3bc54c(0x15f)))return'MISSING_SEGMENT_REFERENCE';return'SEGMENT_SCHEMA_ERROR';}function runSemanticChecks(_0x2b24c4,_0x5d74fc){const _0x458449=a159_0xc0db,_0x55368c=[];_0x2b24c4[_0x458449(0x173)]&&_0x55368c[_0x458449(0x160)](...checkRule(_0x2b24c4[_0x458449(0x173)],_0x458449(0x173),_0x5d74fc));const _0x2e400f=_0x55368c[_0x458449(0x15a)](_0x16a515=>_0x16a515[_0x458449(0x13a)]==='error'),_0x8e921b=_0x55368c['filter'](_0x23301a=>_0x23301a[_0x458449(0x13a)]===_0x458449(0x162));return{'valid':_0x2e400f['length']===0x0,'errors':_0x2e400f,'warnings':_0x8e921b};}function checkRule(_0x5545ed,_0x425eed,_0x3951c6){const _0x4964f2=a159_0xc0db,_0x4919d8=[];if(_0x5545ed[_0x4964f2(0x146)][_0x4964f2(0x153)]===0x0)return _0x4919d8[_0x4964f2(0x160)]({'level':_0x4964f2(0x155),'path':_0x425eed+_0x4964f2(0x16f),'code':_0x4964f2(0x131),'message':_0x4964f2(0x161),'location':getLocationFromPath(_0x3951c6[_0x4964f2(0x13f)],_0x3951c6['source'],pathToArray(_0x425eed+'.conditions'))}),_0x4919d8;return _0x4919d8[_0x4964f2(0x160)](...checkConditions(_0x5545ed['conditions'],_0x425eed,_0x3951c6)),_0x4919d8;}function checkConditions(_0x1712d9,_0x500277,_0x43aebe){const _0x8cf1b7=a159_0xc0db,_0x531d79=[];for(let _0x2e3a8d=0x0;_0x2e3a8d<_0x1712d9[_0x8cf1b7(0x153)];_0x2e3a8d++){const _0x16e601=_0x1712d9[_0x2e3a8d],_0x3fc79e=_0x500277+'.conditions['+_0x2e3a8d+']';_0x531d79['push'](...checkCondition(_0x16e601,_0x3fc79e,_0x43aebe));}return _0x531d79;}function checkCondition(_0x386590,_0x4a3e62,_0x5d59b7){const _0x3abcf2=a159_0xc0db,_0x1118fd=[];if(_0x386590['type']===_0x3abcf2(0x14c)||_0x386590[_0x3abcf2(0x148)]==='Or'||_0x386590[_0x3abcf2(0x148)]==='Composite'){if(_0x386590[_0x3abcf2(0x146)]['length']===0x0)_0x1118fd[_0x3abcf2(0x160)]({'level':'error','path':_0x4a3e62+_0x3abcf2(0x16f),'code':_0x3abcf2(0x131),'message':_0x386590['type']+_0x3abcf2(0x151),'location':getLocationFromPath(_0x5d59b7[_0x3abcf2(0x13f)],_0x5d59b7[_0x3abcf2(0x149)],pathToArray(_0x4a3e62+_0x3abcf2(0x16f)))});else{const _0x289966=_0x386590[_0x3abcf2(0x178)]!==undefined,_0x462a52=_0x386590[_0x3abcf2(0x148)]==='Composite';!_0x289966&&!_0x462a52&&_0x1118fd['push']({'level':_0x3abcf2(0x162),'path':_0x4a3e62,'code':_0x3abcf2(0x177),'message':_0x386590[_0x3abcf2(0x148)]+'\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20'+'condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20'+_0x3abcf2(0x179),'location':getLocationFromPath(_0x5d59b7[_0x3abcf2(0x13f)],_0x5d59b7[_0x3abcf2(0x149)],pathToArray(_0x4a3e62))}),_0x1118fd['push'](...checkConditions(_0x386590[_0x3abcf2(0x146)],_0x4a3e62,_0x5d59b7));}return _0x1118fd;}if(_0x386590[_0x3abcf2(0x148)]==='Value'||_0x386590[_0x3abcf2(0x148)]==='Behavior'){const _0x21902e=_0x386590,_0xf1696a=_0x21902e[_0x3abcf2(0x149)],_0x40e044=_0x21902e[_0x3abcf2(0x156)],_0xb7fe89=_0xf1696a||_0x40e044,_0x2cdd8d=_0x21902e[_0x3abcf2(0x164)]?.[_0x3abcf2(0x148)];if((_0x2cdd8d===_0x3abcf2(0x139)||_0x2cdd8d===_0x3abcf2(0x172))&&_0x21902e[_0x3abcf2(0x164)]?.['not']!==undefined){const _0x25740a=_0x21902e[_0x3abcf2(0x164)]['not']===!![];_0x1118fd[_0x3abcf2(0x160)]({'level':_0x25740a?'error':'warning','path':_0x4a3e62+_0x3abcf2(0x144),'code':_0x3abcf2(0x13b),'message':_0x25740a?_0x3abcf2(0x142)+_0x2cdd8d+_0x3abcf2(0x15d)+_0x3abcf2(0x12c)+_0x3abcf2(0x163):_0x3abcf2(0x142)+_0x2cdd8d+_0x3abcf2(0x12d)+_0x3abcf2(0x141),'location':getLocationFromPath(_0x5d59b7[_0x3abcf2(0x13f)],_0x5d59b7['source'],pathToArray(_0x4a3e62+'.operator.not'))});}(!_0x21902e[_0x3abcf2(0x16b)]||_0x21902e[_0x3abcf2(0x16b)]==='')&&(!_0xb7fe89&&_0x1118fd['push']({'level':_0x3abcf2(0x155),'path':_0x4a3e62+_0x3abcf2(0x15e),'code':_0x3abcf2(0x135),'message':_0x3abcf2(0x140),'location':getLocationFromPath(_0x5d59b7['document'],_0x5d59b7['source'],pathToArray(_0x4a3e62+_0x3abcf2(0x15e)))}));_0x21902e[_0x3abcf2(0x15a)]&&_0x1118fd['push'](...checkRule(_0x21902e[_0x3abcf2(0x15a)],_0x4a3e62+'.filter',_0x5d59b7));if(_0x21902e['source']){const _0x39fdd7=_0x21902e[_0x3abcf2(0x16b)]&&_0x21902e['attribute']!=='';_0x39fdd7&&!_0x21902e[_0x3abcf2(0x15a)]&&_0x1118fd[_0x3abcf2(0x160)]({'level':_0x3abcf2(0x155),'path':_0x4a3e62+_0x3abcf2(0x13e),'code':_0x3abcf2(0x169),'message':_0x3abcf2(0x12f)+_0x21902e[_0x3abcf2(0x149)]+_0x3abcf2(0x134)+_0x21902e['attribute']+'\x27\x20'+'requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20'+_0x3abcf2(0x12e)+_0x3abcf2(0x15b),'location':getLocationFromPath(_0x5d59b7[_0x3abcf2(0x13f)],_0x5d59b7[_0x3abcf2(0x149)],pathToArray(_0x4a3e62+'.source'))}),_0x39fdd7&&_0x21902e[_0x3abcf2(0x15a)]&&_0x1118fd['push']({'level':_0x3abcf2(0x162),'path':_0x4a3e62+_0x3abcf2(0x15e),'code':_0x3abcf2(0x14f),'message':'Attribute\x20\x27'+_0x21902e[_0x3abcf2(0x16b)]+'\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20'+_0x3abcf2(0x14a),'location':getLocationFromPath(_0x5d59b7[_0x3abcf2(0x13f)],_0x5d59b7[_0x3abcf2(0x149)],pathToArray(_0x4a3e62+_0x3abcf2(0x15e)))});}}return _0x1118fd;}
1
+ (function(_0xb30290,_0x19cfe8){const _0x5bf392=a159_0x4336,_0x33cf4f=_0xb30290();while(!![]){try{const _0x59c9b5=-parseInt(_0x5bf392(0xbb))/0x1+parseInt(_0x5bf392(0x9a))/0x2+-parseInt(_0x5bf392(0x7f))/0x3*(-parseInt(_0x5bf392(0xa0))/0x4)+-parseInt(_0x5bf392(0xbe))/0x5*(-parseInt(_0x5bf392(0xaa))/0x6)+parseInt(_0x5bf392(0xb6))/0x7*(-parseInt(_0x5bf392(0xbd))/0x8)+parseInt(_0x5bf392(0xa2))/0x9*(parseInt(_0x5bf392(0x70))/0xa)+-parseInt(_0x5bf392(0x82))/0xb;if(_0x59c9b5===_0x19cfe8)break;else _0x33cf4f['push'](_0x33cf4f['shift']());}catch(_0x4e1179){_0x33cf4f['push'](_0x33cf4f['shift']());}}}(a159_0x180a,0x82470));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';function a159_0x4336(_0xf27a0c,_0x2fabaf){_0xf27a0c=_0xf27a0c-0x67;const _0x180ac5=a159_0x180a();let _0x43363c=_0x180ac5[_0xf27a0c];return _0x43363c;}import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x5e82bf,_0x15a5e7={},_0x415c41={}){const _0xca0156=a159_0x4336;if(_0x415c41[_0xca0156(0x8e)])return runSemanticChecks(_0x5e82bf,_0x15a5e7);const _0x421a72=SegmentDefSchema['safeParse'](_0x5e82bf);if(_0x421a72[_0xca0156(0x8c)])return runSemanticChecks(_0x421a72[_0xca0156(0x79)],_0x15a5e7);return zodErrorsToValidationResult(_0x421a72[_0xca0156(0x75)],_0x15a5e7);}export function validateRuleDef(_0x405b19,_0x5980af,_0x1f3f4c){const _0x1ffd75=a159_0x4336;if(!_0x405b19)return[];const _0x1883a5=RuleDefSchema['safeParse'](_0x405b19);if(_0x1883a5[_0x1ffd75(0x8c)])return checkRule(_0x1883a5[_0x1ffd75(0x79)],_0x5980af,_0x1f3f4c);const _0x4c6843=flattenZodIssues(_0x1883a5['error'][_0x1ffd75(0x74)]);return _0x4c6843[_0x1ffd75(0x78)](_0x5cf955=>{const _0x7a30a1=_0x1ffd75,_0x3b0a95=formatZodPath(_0x5cf955[_0x7a30a1(0x72)]),_0x2b5d9c=_0x3b0a95?_0x5980af+'.'+_0x3b0a95:_0x5980af,_0x1c0462=mapZodIssueToCode(_0x5cf955,_0x3b0a95),_0x75e320=getLocationFromPath(_0x1f3f4c[_0x7a30a1(0xad)],_0x1f3f4c[_0x7a30a1(0x7b)],pathToArray(_0x2b5d9c));return{'level':_0x7a30a1(0x75),'path':_0x2b5d9c,'code':_0x1c0462,'message':_0x5cf955[_0x7a30a1(0x68)],..._0x75e320&&{'location':_0x75e320}};});}function zodErrorsToValidationResult(_0x587440,_0x174007){const _0x398e62=a159_0x4336,_0x1baa98=flattenZodIssues(_0x587440[_0x398e62(0x74)]),_0x1cde19=_0x1baa98[_0x398e62(0x78)](_0x1dcd16=>{const _0xbce8b=_0x398e62,_0x54039c=formatZodPath(_0x1dcd16[_0xbce8b(0x72)]),_0x32dbaf=mapZodIssueToCode(_0x1dcd16,_0x54039c),_0x36ef72=getLocationFromPath(_0x174007[_0xbce8b(0xad)],_0x174007[_0xbce8b(0x7b)],_0x1dcd16[_0xbce8b(0x72)][_0xbce8b(0x78)](_0x4ee7e9=>typeof _0x4ee7e9===_0xbce8b(0xa4)?String(_0x4ee7e9):_0x4ee7e9));return{'level':_0xbce8b(0x75),'path':_0x54039c,'code':_0x32dbaf,'message':_0x1dcd16[_0xbce8b(0x68)],..._0x36ef72&&{'location':_0x36ef72}};});return{'valid':![],'errors':_0x1cde19,'warnings':[]};}function mapZodIssueToCode(_0x17789a,_0x35002b){const _0x50579d=a159_0x4336,_0x5e38a7=_0x17789a[_0x50579d(0x91)]===_0x50579d(0x95)?_0x17789a['params']:undefined;if(_0x35002b==='name')return _0x50579d(0xb2);if(_0x35002b===_0x50579d(0x8f)||_0x35002b[_0x50579d(0x69)]('.type')){if(_0x17789a[_0x50579d(0x91)]===_0x50579d(0x6c)){if(_0x35002b===_0x50579d(0x8f)||_0x35002b[_0x50579d(0xa6)](/\.conditions\[\d+\]\.type$/))return _0x50579d(0xb5);}}if(_0x35002b[_0x50579d(0x69)](_0x50579d(0xa3)))return _0x50579d(0xa9);if(_0x35002b[_0x50579d(0x69)](_0x50579d(0xb0)))return _0x50579d(0x83);if(_0x5e38a7?.[_0x50579d(0xbc)]===_0x50579d(0x6e))return _0x50579d(0x6e);if(_0x5e38a7?.[_0x50579d(0xbc)]===_0x50579d(0x85))return _0x50579d(0x85);if(_0x35002b[_0x50579d(0x69)](_0x50579d(0xb9))||_0x35002b===_0x50579d(0x89))return _0x50579d(0x81);if(_0x35002b[_0x50579d(0x6b)](_0x50579d(0x9c)))return _0x50579d(0xa8);if(_0x35002b[_0x50579d(0x69)]('.segment'))return _0x50579d(0x98);return _0x50579d(0x7a);}function runSemanticChecks(_0x59da1d,_0x1b1ebd){const _0x2a6ef5=a159_0x4336,_0x4faf24=[];_0x59da1d[_0x2a6ef5(0x7e)]&&_0x4faf24[_0x2a6ef5(0x7d)](...checkRule(_0x59da1d['rule'],_0x2a6ef5(0x7e),_0x1b1ebd));const _0x4a6515=_0x4faf24[_0x2a6ef5(0x6d)](_0x5e5e8b=>_0x5e5e8b[_0x2a6ef5(0xa1)]===_0x2a6ef5(0x75)),_0x9d1ed9=_0x4faf24[_0x2a6ef5(0x6d)](_0x405f3f=>_0x405f3f['level']===_0x2a6ef5(0xb7));return{'valid':_0x4a6515[_0x2a6ef5(0x8b)]===0x0,'errors':_0x4a6515,'warnings':_0x9d1ed9};}function checkRule(_0x5233e3,_0x3e79b7,_0x25b6e8){const _0x120f3c=a159_0x4336,_0xb1dea7=[];if(_0x5233e3[_0x120f3c(0x89)][_0x120f3c(0x8b)]===0x0)return _0xb1dea7['push']({'level':_0x120f3c(0x75),'path':_0x3e79b7+_0x120f3c(0xb9),'code':'EMPTY_CONDITIONS','message':'Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','location':getLocationFromPath(_0x25b6e8[_0x120f3c(0xad)],_0x25b6e8[_0x120f3c(0x7b)],pathToArray(_0x3e79b7+_0x120f3c(0xb9)))}),_0xb1dea7;return _0xb1dea7[_0x120f3c(0x7d)](...checkConditions(_0x5233e3[_0x120f3c(0x89)],_0x3e79b7,_0x25b6e8)),_0xb1dea7;}function checkConditions(_0x126fe7,_0x47b25e,_0x46f27f){const _0x1db6aa=a159_0x4336,_0x1ad1dd=[];for(let _0x2341f0=0x0;_0x2341f0<_0x126fe7[_0x1db6aa(0x8b)];_0x2341f0++){const _0x1e6fbc=_0x126fe7[_0x2341f0],_0x182944=_0x47b25e+_0x1db6aa(0x80)+_0x2341f0+']';_0x1ad1dd[_0x1db6aa(0x7d)](...checkCondition(_0x1e6fbc,_0x182944,_0x46f27f));}return _0x1ad1dd;}function a159_0x180a(){const _0x2c13c9=['match','operator','INVALID_ARRAY_MATCHING','INVALID_OPERATOR_TYPE','17310crbbBC','NESTED_CONDITION_GROUP','Operator\x20\x27','document','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','EMPTY_ATTRIBUTE','.operator.value','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','MISSING_NAME','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','Behavior\x20source\x20\x27','INVALID_RULE_TYPE','19579oQdriP','warning','attribute','.conditions','not','1058913cRmcHM','validationCode','312UolYMk','1735sKiATL','TEMPORAL_NEGATION_UNSUPPORTED','message','endsWith','TimeWithinPast','includes','invalid_value','filter','MISSING_BETWEEN_BOUNDS','TimeWithinNext','10pjpcqj','\x27\x20with\x20attribute\x20\x27','path','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','issues','error','.source','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','map','data','SEGMENT_SCHEMA_ERROR','source','Value','push','rule','6TiWtQS','.conditions[','MISSING_CONDITIONS','14982715qWGWMt','MISSING_OPERATOR_VALUE','Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','MISSING_TIME_UNIT','type','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','.attribute','conditions','Attribute\x20name\x20cannot\x20be\x20empty','length','success','.filter','skipSchema','rule.type','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','code','BEHAVIOR_SOURCE_MISSING_FILTER','Composite','Behavior','custom','EMPTY_CONDITIONS','.operator.not','MISSING_SEGMENT_REFERENCE','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','843076KKfTeF','description','arrayMatching','aggregation','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20','1199096bRrVdO','level','9373464TLrbyI','.operator.type','symbol','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20'];a159_0x180a=function(){return _0x2c13c9;};return a159_0x180a();}function checkCondition(_0x401584,_0x4acb88,_0x3dae44){const _0x5968dc=a159_0x4336,_0x38e0ee=[];if(_0x401584[_0x5968dc(0x86)]==='And'||_0x401584[_0x5968dc(0x86)]==='Or'||_0x401584[_0x5968dc(0x86)]===_0x5968dc(0x93)){if(_0x401584[_0x5968dc(0x89)][_0x5968dc(0x8b)]===0x0)_0x38e0ee['push']({'level':_0x5968dc(0x75),'path':_0x4acb88+_0x5968dc(0xb9),'code':_0x5968dc(0x96),'message':_0x401584[_0x5968dc(0x86)]+'\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','location':getLocationFromPath(_0x3dae44[_0x5968dc(0xad)],_0x3dae44[_0x5968dc(0x7b)],pathToArray(_0x4acb88+_0x5968dc(0xb9)))});else{const _0x396708=_0x401584[_0x5968dc(0x9b)]!==undefined,_0x443aa7=_0x401584[_0x5968dc(0x86)]===_0x5968dc(0x93);!_0x396708&&!_0x443aa7&&_0x38e0ee[_0x5968dc(0x7d)]({'level':'warning','path':_0x4acb88,'code':_0x5968dc(0xab),'message':_0x401584['type']+_0x5968dc(0x87)+_0x5968dc(0xb3)+'conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','location':getLocationFromPath(_0x3dae44[_0x5968dc(0xad)],_0x3dae44[_0x5968dc(0x7b)],pathToArray(_0x4acb88))}),_0x38e0ee['push'](...checkConditions(_0x401584[_0x5968dc(0x89)],_0x4acb88,_0x3dae44));}return _0x38e0ee;}if(_0x401584['type']===_0x5968dc(0x7c)||_0x401584[_0x5968dc(0x86)]===_0x5968dc(0x94)){const _0x291d26=_0x401584,_0x55abd3=_0x291d26[_0x5968dc(0x7b)],_0x54edcb=_0x291d26[_0x5968dc(0x9d)],_0x51d528=_0x55abd3||_0x54edcb,_0x1bf5f2=_0x291d26[_0x5968dc(0xa7)]?.['type'];if((_0x1bf5f2===_0x5968dc(0x6a)||_0x1bf5f2===_0x5968dc(0x6f))&&_0x291d26[_0x5968dc(0xa7)]?.['not']!==undefined){const _0x1ceea6=_0x291d26[_0x5968dc(0xa7)][_0x5968dc(0xba)]===!![];_0x38e0ee[_0x5968dc(0x7d)]({'level':_0x1ceea6?_0x5968dc(0x75):_0x5968dc(0xb7),'path':_0x4acb88+_0x5968dc(0x97),'code':_0x5968dc(0x67),'message':_0x1ceea6?'Operator\x20\x27'+_0x1bf5f2+_0x5968dc(0x73)+_0x5968dc(0x90)+_0x5968dc(0xae):_0x5968dc(0xac)+_0x1bf5f2+_0x5968dc(0x9f)+_0x5968dc(0x84),'location':getLocationFromPath(_0x3dae44[_0x5968dc(0xad)],_0x3dae44['source'],pathToArray(_0x4acb88+'.operator.not'))});}(!_0x291d26[_0x5968dc(0xb8)]||_0x291d26[_0x5968dc(0xb8)]==='')&&(!_0x51d528&&_0x38e0ee[_0x5968dc(0x7d)]({'level':_0x5968dc(0x75),'path':_0x4acb88+_0x5968dc(0x88),'code':_0x5968dc(0xaf),'message':_0x5968dc(0x8a),'location':getLocationFromPath(_0x3dae44[_0x5968dc(0xad)],_0x3dae44[_0x5968dc(0x7b)],pathToArray(_0x4acb88+_0x5968dc(0x88)))}));_0x291d26['filter']&&_0x38e0ee[_0x5968dc(0x7d)](...checkRule(_0x291d26['filter'],_0x4acb88+_0x5968dc(0x8d),_0x3dae44));if(_0x291d26[_0x5968dc(0x7b)]){const _0x35b175=_0x291d26[_0x5968dc(0xb8)]&&_0x291d26[_0x5968dc(0xb8)]!=='';_0x35b175&&!_0x291d26[_0x5968dc(0x6d)]&&_0x38e0ee['push']({'level':_0x5968dc(0x75),'path':_0x4acb88+_0x5968dc(0x76),'code':_0x5968dc(0x92),'message':_0x5968dc(0xb4)+_0x291d26[_0x5968dc(0x7b)]+_0x5968dc(0x71)+_0x291d26['attribute']+'\x27\x20'+_0x5968dc(0xa5)+_0x5968dc(0x99)+'Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','location':getLocationFromPath(_0x3dae44[_0x5968dc(0xad)],_0x3dae44[_0x5968dc(0x7b)],pathToArray(_0x4acb88+_0x5968dc(0x76)))}),_0x35b175&&_0x291d26[_0x5968dc(0x6d)]&&_0x38e0ee['push']({'level':_0x5968dc(0xb7),'path':_0x4acb88+_0x5968dc(0x88),'code':_0x5968dc(0xb1),'message':'Attribute\x20\x27'+_0x291d26[_0x5968dc(0xb8)]+_0x5968dc(0x77)+_0x5968dc(0x9e),'location':getLocationFromPath(_0x3dae44[_0x5968dc(0xad)],_0x3dae44[_0x5968dc(0x7b)],pathToArray(_0x4acb88+'.attribute'))});}}return _0x38e0ee;}