@treasuredata/tdx 2026.8.6 → 2026.8.7

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 (291) 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-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/codex-command.d.ts +2 -1
  19. package/dist/commands/codex-command.d.ts.map +1 -1
  20. package/dist/commands/codex-command.js +1 -1
  21. package/dist/commands/codex-command.js.map +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/delivery-command.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  28. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  29. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  30. package/dist/commands/engage-campaign-pull-command.js +1 -1
  31. package/dist/commands/engage-campaign-push-command.js +1 -1
  32. package/dist/commands/engage-campaign-validate-command.js +1 -1
  33. package/dist/commands/engage-command.d.ts.map +1 -1
  34. package/dist/commands/engage-command.js +1 -1
  35. package/dist/commands/engage-command.js.map +1 -1
  36. package/dist/commands/engage-template-pull-command.js +1 -1
  37. package/dist/commands/engage-template-push-command.js +1 -1
  38. package/dist/commands/engage-template-validate-command.js +1 -1
  39. package/dist/commands/job-command.js +1 -1
  40. package/dist/commands/journey-command.js +1 -1
  41. package/dist/commands/journey-validate-command.js +1 -1
  42. package/dist/commands/llm-command.js +1 -1
  43. package/dist/commands/mcp-command.js +1 -1
  44. package/dist/commands/p13n-command.d.ts +16 -1
  45. package/dist/commands/p13n-command.d.ts.map +1 -1
  46. package/dist/commands/p13n-command.js +1 -1
  47. package/dist/commands/p13n-command.js.map +1 -1
  48. package/dist/commands/parent-segment-command.js +1 -1
  49. package/dist/commands/policy-command.js +1 -1
  50. package/dist/commands/profile-command.js +1 -1
  51. package/dist/commands/profiles-command.js +1 -1
  52. package/dist/commands/query-command.js +1 -1
  53. package/dist/commands/schedule-command.js +1 -1
  54. package/dist/commands/segment-command.js +1 -1
  55. package/dist/commands/segment-create-command.js +1 -1
  56. package/dist/commands/segment-fields-command.js +1 -1
  57. package/dist/commands/segment-move-command.js +1 -1
  58. package/dist/commands/segment-pull-command.js +1 -1
  59. package/dist/commands/segment-push-command.js +1 -1
  60. package/dist/commands/segment-update-command.js +1 -1
  61. package/dist/commands/segment-use-command.js +1 -1
  62. package/dist/commands/segment-validate-command.js +1 -1
  63. package/dist/commands/segments.js +1 -1
  64. package/dist/commands/show.js +1 -1
  65. package/dist/commands/status-command.js +1 -1
  66. package/dist/commands/table-deleted.js +1 -1
  67. package/dist/commands/tables.js +1 -1
  68. package/dist/commands/unset-command.d.ts +1 -0
  69. package/dist/commands/unset-command.d.ts.map +1 -1
  70. package/dist/commands/unset-command.js +1 -1
  71. package/dist/commands/unset-command.js.map +1 -1
  72. package/dist/commands/upgrade-command.js +1 -1
  73. package/dist/commands/use-command.d.ts +1 -0
  74. package/dist/commands/use-command.d.ts.map +1 -1
  75. package/dist/commands/use-command.js +1 -1
  76. package/dist/commands/use-command.js.map +1 -1
  77. package/dist/commands/user-command.js +1 -1
  78. package/dist/commands/work-command.js +1 -1
  79. package/dist/commands/workflow-command.js +1 -1
  80. package/dist/core/auth.js +1 -1
  81. package/dist/core/command-output.js +1 -1
  82. package/dist/core/config.js +1 -1
  83. package/dist/core/connection-cache.js +1 -1
  84. package/dist/core/constants.js +1 -1
  85. package/dist/core/credential-cache.js +1 -1
  86. package/dist/core/global-context.d.ts +1 -0
  87. package/dist/core/global-context.d.ts.map +1 -1
  88. package/dist/core/global-context.js +1 -1
  89. package/dist/core/global-context.js.map +1 -1
  90. package/dist/core/keychain.js +1 -1
  91. package/dist/core/oauth-keychain.js +1 -1
  92. package/dist/core/oauth.js +1 -1
  93. package/dist/core/profile.js +1 -1
  94. package/dist/core/project-config.js +1 -1
  95. package/dist/core/session.d.ts +2 -1
  96. package/dist/core/session.d.ts.map +1 -1
  97. package/dist/core/session.js +1 -1
  98. package/dist/core/session.js.map +1 -1
  99. package/dist/core/site-mismatch.js +1 -1
  100. package/dist/core/user-cache.js +1 -1
  101. package/dist/core/version.js +1 -1
  102. package/dist/index.js +1 -1
  103. package/dist/mcp/server.js +1 -1
  104. package/dist/mcp/tools/index.js +1 -1
  105. package/dist/mcp/tools/tdx-run.js +1 -1
  106. package/dist/mcp/tools/tdx-search.js +1 -1
  107. package/dist/mcp/tools/work-create-item.js +1 -1
  108. package/dist/mcp/utils.js +1 -1
  109. package/dist/proxy/claude-usage-tracker.js +1 -1
  110. package/dist/proxy/passthrough-server.js +1 -1
  111. package/dist/proxy/sse-usage-parser.js +1 -1
  112. package/dist/sdk/agent/agent-config.js +1 -1
  113. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  114. package/dist/sdk/agent/agent-yaml.js +1 -1
  115. package/dist/sdk/agent/test/evaluator.js +1 -1
  116. package/dist/sdk/agent/test/executor.js +1 -1
  117. package/dist/sdk/agent/test/index.js +1 -1
  118. package/dist/sdk/agent/test/output.js +1 -1
  119. package/dist/sdk/agent/test/parser.js +1 -1
  120. package/dist/sdk/agent/tool-target-registry.js +1 -1
  121. package/dist/sdk/api.js +1 -1
  122. package/dist/sdk/auth-token.js +1 -1
  123. package/dist/sdk/cas/cas-api-client.js +1 -1
  124. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  125. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  126. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  127. package/dist/sdk/cas/cas-segment-schema.js +1 -1
  128. package/dist/sdk/cas/cas-segment-validator.js +1 -1
  129. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  130. package/dist/sdk/cas/index.js +1 -1
  131. package/dist/sdk/cas/pull-workflow.js +1 -1
  132. package/dist/sdk/cas/push-workflow.js +1 -1
  133. package/dist/sdk/cas/validate-files.js +1 -1
  134. package/dist/sdk/client/cdp-api-client.js +1 -1
  135. package/dist/sdk/client/delivery-api-client.js +1 -1
  136. package/dist/sdk/client/endpoints.js +1 -1
  137. package/dist/sdk/client/engage-api-client.d.ts +10 -2
  138. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  139. package/dist/sdk/client/engage-api-client.js +1 -1
  140. package/dist/sdk/client/engage-api-client.js.map +1 -1
  141. package/dist/sdk/client/http-client.js +1 -1
  142. package/dist/sdk/client/llm-api-client.js +1 -1
  143. package/dist/sdk/client/oauth-refresh.js +1 -1
  144. package/dist/sdk/client/p13n-studio-api-client.d.ts +65 -1
  145. package/dist/sdk/client/p13n-studio-api-client.d.ts.map +1 -1
  146. package/dist/sdk/client/p13n-studio-api-client.js +1 -1
  147. package/dist/sdk/client/p13n-studio-api-client.js.map +1 -1
  148. package/dist/sdk/client/rate-limiter.js +1 -1
  149. package/dist/sdk/client/td-api-client.js +1 -1
  150. package/dist/sdk/client/trino-api-client.js +1 -1
  151. package/dist/sdk/client/workflow-client.js +1 -1
  152. package/dist/sdk/connection-validator.js +1 -1
  153. package/dist/sdk/connection.js +1 -1
  154. package/dist/sdk/delivery.js +1 -1
  155. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  156. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  157. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  158. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  159. package/dist/sdk/engage/campaign-pull.js +1 -1
  160. package/dist/sdk/engage/campaign-push.js +1 -1
  161. package/dist/sdk/engage/campaign-validator.js +1 -1
  162. package/dist/sdk/engage/campaign-yaml.js +1 -1
  163. package/dist/sdk/engage/template-pull.js +1 -1
  164. package/dist/sdk/engage/template-push.js +1 -1
  165. package/dist/sdk/engage/template-validator.js +1 -1
  166. package/dist/sdk/engage/template-yaml.js +1 -1
  167. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  168. package/dist/sdk/engage/types/campaign-def.js +1 -1
  169. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  170. package/dist/sdk/engage/types/template-schema.js +1 -1
  171. package/dist/sdk/engage.d.ts +7 -2
  172. package/dist/sdk/engage.d.ts.map +1 -1
  173. package/dist/sdk/engage.js +1 -1
  174. package/dist/sdk/engage.js.map +1 -1
  175. package/dist/sdk/errors.js +1 -1
  176. package/dist/sdk/index.d.ts +5 -1
  177. package/dist/sdk/index.d.ts.map +1 -1
  178. package/dist/sdk/index.js +1 -1
  179. package/dist/sdk/index.js.map +1 -1
  180. package/dist/sdk/io/index.js +1 -1
  181. package/dist/sdk/io/node-filesystem.js +1 -1
  182. package/dist/sdk/job.js +1 -1
  183. package/dist/sdk/journey.js +1 -1
  184. package/dist/sdk/llm/chat-cache.js +1 -1
  185. package/dist/sdk/llm/index.js +1 -1
  186. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  187. package/dist/sdk/llm/model-factors.js +1 -1
  188. package/dist/sdk/llm/user-settings.js +1 -1
  189. package/dist/sdk/p13n-studio.d.ts +148 -1
  190. package/dist/sdk/p13n-studio.d.ts.map +1 -1
  191. package/dist/sdk/p13n-studio.js +1 -1
  192. package/dist/sdk/p13n-studio.js.map +1 -1
  193. package/dist/sdk/personalization.js +1 -1
  194. package/dist/sdk/policy.js +1 -1
  195. package/dist/sdk/query/deleted-table-validation.js +1 -1
  196. package/dist/sdk/query/index.js +1 -1
  197. package/dist/sdk/query/sql-parser.js +1 -1
  198. package/dist/sdk/realtime.js +1 -1
  199. package/dist/sdk/schedule.js +1 -1
  200. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  201. package/dist/sdk/segment/fields-display.js +1 -1
  202. package/dist/sdk/segment/file-discovery.js +1 -1
  203. package/dist/sdk/segment/journey-utils.js +1 -1
  204. package/dist/sdk/segment/journey-validator.js +1 -1
  205. package/dist/sdk/segment/journey-yaml.js +1 -1
  206. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  207. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  208. package/dist/sdk/segment/pull-workflow.js +1 -1
  209. package/dist/sdk/segment/push-recovery.js +1 -1
  210. package/dist/sdk/segment/push-workflow.js +1 -1
  211. package/dist/sdk/segment/resolution-context.js +1 -1
  212. package/dist/sdk/segment/segment-path-parser.js +1 -1
  213. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  214. package/dist/sdk/segment/segment-validator.js +1 -1
  215. package/dist/sdk/segment/target-resolution.js +1 -1
  216. package/dist/sdk/segment/tdx-config.js +1 -1
  217. package/dist/sdk/segment/types/activation-schema.js +1 -1
  218. package/dist/sdk/segment/types/journey-def.js +1 -1
  219. package/dist/sdk/segment/types/journey-schema.js +1 -1
  220. package/dist/sdk/segment/types/segment-def.js +1 -1
  221. package/dist/sdk/segment/types/segment-schema.js +1 -1
  222. package/dist/sdk/segment/validate-files.js +1 -1
  223. package/dist/sdk/segment/yaml-validator.js +1 -1
  224. package/dist/sdk/segment.js +1 -1
  225. package/dist/sdk/types/engage.d.ts +41 -0
  226. package/dist/sdk/types/engage.d.ts.map +1 -1
  227. package/dist/sdk/types/index.d.ts +3 -2
  228. package/dist/sdk/types/index.d.ts.map +1 -1
  229. package/dist/sdk/types/index.js +1 -1
  230. package/dist/sdk/types/index.js.map +1 -1
  231. package/dist/sdk/types/p13n-studio.d.ts +73 -0
  232. package/dist/sdk/types/p13n-studio.d.ts.map +1 -1
  233. package/dist/sdk/types/progress.js +1 -1
  234. package/dist/sdk/types/workspace.js +1 -1
  235. package/dist/sdk/user.js +1 -1
  236. package/dist/sdk/util/format-detector.js +1 -1
  237. package/dist/sdk/util/formatters.js +1 -1
  238. package/dist/sdk/util/index.js +1 -1
  239. package/dist/sdk/util/paginate.js +1 -1
  240. package/dist/sdk/util/tree-formatter.js +1 -1
  241. package/dist/sdk/util/tree-search.js +1 -1
  242. package/dist/sdk/workflow/archive-validation.js +1 -1
  243. package/dist/sdk/workflow/clone-workflow.js +1 -1
  244. package/dist/sdk/workflow/index.js +1 -1
  245. package/dist/sdk/workflow/pull-workflow.js +1 -1
  246. package/dist/sdk/workflow/push-workflow.js +1 -1
  247. package/dist/sdk/workflow/task-graph.js +1 -1
  248. package/dist/sdk/workflow/tdx-config.js +1 -1
  249. package/dist/sdk/workflow/workflow-utils.js +1 -1
  250. package/dist/sdk/workspace/access-tracker.js +1 -1
  251. package/dist/sdk/workspace/frontmatter.js +1 -1
  252. package/dist/sdk/workspace/git.js +1 -1
  253. package/dist/sdk/workspace/index.js +1 -1
  254. package/dist/sdk/workspace/templates.js +1 -1
  255. package/dist/sdk/workspace/weekly.js +1 -1
  256. package/dist/sdk/workspace/wikilinks.js +1 -1
  257. package/dist/test-utils/command-runner.js +1 -1
  258. package/dist/test-utils/factories.js +1 -1
  259. package/dist/test-utils/fixtures.js +1 -1
  260. package/dist/test-utils/http-mock.js +1 -1
  261. package/dist/test-utils/index.js +1 -1
  262. package/dist/utils/async.js +1 -1
  263. package/dist/utils/claude-code-state.js +1 -1
  264. package/dist/utils/colors.js +1 -1
  265. package/dist/utils/diff.js +1 -1
  266. package/dist/utils/file-permissions.js +1 -1
  267. package/dist/utils/file-reader.js +1 -1
  268. package/dist/utils/github-releases.js +1 -1
  269. package/dist/utils/global-cache.js +1 -1
  270. package/dist/utils/json-loader.js +1 -1
  271. package/dist/utils/local-cache.js +1 -1
  272. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  273. package/dist/utils/logger/formatters/index.js +1 -1
  274. package/dist/utils/logger/handlers/console-handler.js +1 -1
  275. package/dist/utils/logger/handlers/file-handler.js +1 -1
  276. package/dist/utils/logger/handlers/index.js +1 -1
  277. package/dist/utils/logger/handlers/null-handler.js +1 -1
  278. package/dist/utils/logger/index.js +1 -1
  279. package/dist/utils/logger/logger.js +1 -1
  280. package/dist/utils/logger/types.js +1 -1
  281. package/dist/utils/option-validation.js +1 -1
  282. package/dist/utils/process.js +1 -1
  283. package/dist/utils/prompt.js +1 -1
  284. package/dist/utils/proxy-fetch.js +1 -1
  285. package/dist/utils/spinner.js +1 -1
  286. package/dist/utils/sse-parser.js +1 -1
  287. package/dist/utils/string-utils.js +1 -1
  288. package/dist/utils/table-ref-parser.js +1 -1
  289. package/dist/utils/tdx-logger.js +1 -1
  290. package/dist/utils/version-check.js +1 -1
  291. package/package.json +1 -1
@@ -1 +1 @@
1
- const a175_0x6e2f89=a175_0x1875;(function(_0x990d44,_0x5d3a12){const _0x598b73=a175_0x1875,_0x5e542a=_0x990d44();while(!![]){try{const _0x4e1795=parseInt(_0x598b73(0x121))/0x1*(-parseInt(_0x598b73(0x1cc))/0x2)+parseInt(_0x598b73(0x1e0))/0x3+parseInt(_0x598b73(0x199))/0x4+parseInt(_0x598b73(0x143))/0x5*(parseInt(_0x598b73(0x140))/0x6)+parseInt(_0x598b73(0x1db))/0x7+-parseInt(_0x598b73(0x138))/0x8+parseInt(_0x598b73(0x1a1))/0x9*(parseInt(_0x598b73(0x18e))/0xa);if(_0x4e1795===_0x5d3a12)break;else _0x5e542a['push'](_0x5e542a['shift']());}catch(_0x1156ec){_0x5e542a['push'](_0x5e542a['shift']());}}}(a175_0x3308,0x5792d));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a175_0x6e2f89(0x1c4);export const PENDING_ACTIVATION_PREFIX=a175_0x6e2f89(0xf5);export function createPendingSegmentId(_0x4139cc){return''+PENDING_SEGMENT_PREFIX+_0x4139cc+'__';}export function isPendingSegmentId(_0x3aadf1){const _0x360b41=a175_0x6e2f89;return _0x3aadf1['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x3aadf1[_0x360b41(0x1cb)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x4bea01){const _0x41bd28=a175_0x6e2f89;return _0x4bea01[_0x41bd28(0xe8)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1d6034){return''+PENDING_ACTIVATION_PREFIX+_0x1d6034+'__';}export function isPendingActivationId(_0x23ed7e){const _0x1d244b=a175_0x6e2f89;return _0x23ed7e[_0x1d244b(0x1cb)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x155128){const _0x6d0d3d=a175_0x6e2f89;return _0x155128[_0x6d0d3d(0xe8)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4d6b7f,_0x2703c0){const _0x13da7c=a175_0x6e2f89,_0x312c24=_0x4d6b7f+'::'+(_0x2703c0['trim']()||_0x13da7c(0x109)),_0x48bb3f=createHash('sha1')[_0x13da7c(0x15c)](_0x312c24)[_0x13da7c(0x13a)]('hex')[_0x13da7c(0x1c6)](0x0,0xc);return _0x13da7c(0x1ac)+_0x48bb3f;}export function ensureJourneyDefaults(_0x3be292){const _0x5e3f2f=a175_0x6e2f89;!_0x3be292[_0x5e3f2f(0x198)]&&(_0x3be292[_0x5e3f2f(0x198)]=''),!_0x3be292[_0x5e3f2f(0x106)]&&(_0x3be292[_0x5e3f2f(0x106)]='draft');}export function injectExistingStageIds(_0x4b9b47,_0x76d706){const _0x40b2da=a175_0x6e2f89,_0x3fb1d3=new Map(_0x76d706[_0x40b2da(0x1ca)](_0x487717=>[_0x487717[_0x40b2da(0x1af)],_0x487717['id']]));for(const _0x31fc91 of _0x4b9b47){if(!_0x31fc91['id']){const _0x456821=_0x3fb1d3['get'](_0x31fc91[_0x40b2da(0x1af)]);_0x456821&&(_0x31fc91['id']=_0x456821);}}}export function resolveTDFolderPath(_0x18dcab,_0x3c4eac,_0x1b03b3){const _0x5f1285=a175_0x6e2f89;if(!_0x3c4eac)return _0x18dcab;if(_0x18dcab===_0x1b03b3||_0x18dcab[_0x5f1285(0x1cb)](_0x1b03b3+'/'))return _0x18dcab;return _0x18dcab?_0x1b03b3+'/'+_0x18dcab:_0x1b03b3;}export function addFoldersToCreate(_0x203b05,_0x204928,_0x11fc8f){const _0x416958=a175_0x6e2f89;if(!_0x203b05)return;if(_0x204928[_0x416958(0x18b)](_0x203b05))return;const _0x7e5b06=_0x203b05[_0x416958(0x163)]('/');let _0x1044c2='';for(const _0x5ed607 of _0x7e5b06){_0x1044c2=_0x1044c2?_0x1044c2+'/'+_0x5ed607:_0x5ed607,!_0x204928[_0x416958(0x18b)](_0x1044c2)&&_0x11fc8f[_0x416958(0xf3)](_0x1044c2);}}export function sortFoldersByDepth(_0x57fda6){const _0x457043=a175_0x6e2f89;return[..._0x57fda6][_0x457043(0x142)]((_0x55ae52,_0x1cc4b3)=>{const _0x502c35=_0x457043,_0x4fb172=(_0x55ae52[_0x502c35(0x160)](/\//g)||[])['length'],_0x589a30=(_0x1cc4b3[_0x502c35(0x160)](/\//g)||[])[_0x502c35(0x108)];return _0x4fb172-_0x589a30;});}import*as a175_0x38ac7e from'yaml';import{readFileSync}from'fs';import a175_0xa4eed from'path';import{isJourneyDef,parseYamlString as a175_0x3c1213,toYamlString as a175_0xc347c8,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';function a175_0x1875(_0x3d91f5,_0x56327e){_0x3d91f5=_0x3d91f5-0xe4;const _0x330826=a175_0x3308();let _0x1875b6=_0x330826[_0x3d91f5];return _0x1875b6;}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(_0x36057d){const _0x5ecec5=a175_0x6e2f89;if(Array[_0x5ecec5(0x14c)](_0x36057d))return'['+_0x36057d['map'](_0xa9558b=>stableStringify(_0xa9558b))[_0x5ecec5(0x102)](',')+']';if(_0x36057d&&typeof _0x36057d===_0x5ecec5(0x197)){const _0x5eac36=_0x36057d,_0x172d02=Object[_0x5ecec5(0x17c)](_0x5eac36)[_0x5ecec5(0x142)](),_0xf9d08=_0x172d02[_0x5ecec5(0x1ca)](_0x890d5c=>'\x22'+_0x890d5c+'\x22:'+stableStringify(_0x5eac36[_0x890d5c]));return'{'+_0xf9d08[_0x5ecec5(0x102)](',')+'}';}const _0x4ba5bd=JSON[_0x5ecec5(0x131)](_0x36057d);return _0x4ba5bd===undefined?_0x5ecec5(0xe7):_0x4ba5bd;}function activationSignature(_0x5aa8d7){const _0x4f074e=a175_0x6e2f89,_0x251ec2={'connection':_0x5aa8d7['connection'],..._0x5aa8d7[_0x4f074e(0x1a0)]!==undefined&&{'all_columns':_0x5aa8d7[_0x4f074e(0x1a0)]},..._0x5aa8d7[_0x4f074e(0x12d)]!==undefined&&{'columns':_0x5aa8d7[_0x4f074e(0x12d)]},..._0x5aa8d7[_0x4f074e(0xfd)]!==undefined&&{'behavior':_0x5aa8d7['behavior']},..._0x5aa8d7[_0x4f074e(0xea)]!==undefined&&{'behaviors':_0x5aa8d7[_0x4f074e(0xea)]},..._0x5aa8d7[_0x4f074e(0x1df)]!==undefined&&{'schedule':_0x5aa8d7[_0x4f074e(0x1df)]},..._0x5aa8d7[_0x4f074e(0x17d)]!==undefined&&{'notification':_0x5aa8d7['notification']},..._0x5aa8d7[_0x4f074e(0x1cf)]!==undefined&&{'connector_config':_0x5aa8d7[_0x4f074e(0x1cf)]},..._0x5aa8d7[_0x4f074e(0xff)]!==undefined&&{'activation_template_id':_0x5aa8d7['activation_template_id']}};return stableStringify(_0x251ec2);}async function fetchSegment(_0x3c9a23,_0x150a4d,_0x4f7427,_0x5a5ece){const _0x46f245=a175_0x6e2f89,_0x4717bf=_0x5a5ece?.[_0x46f245(0x114)](_0x3913af=>_0x3913af['id']===_0x4f7427);if(_0x4717bf)return _0x4717bf;try{return await _0x3c9a23['segment'][_0x46f245(0x12a)](_0x150a4d,_0x4f7427);}catch(_0x1c3201){logger['debug'](_0x46f245(0x1c7)+_0x4f7427+_0x46f245(0xf9)+_0x1c3201);try{return await _0x3c9a23[_0x46f245(0x109)][_0x46f245(0x1c3)](_0x4f7427);}catch(_0x1440a3){return logger[_0x46f245(0x1a2)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x4f7427+':\x20'+_0x1440a3),null;}}}function recoverSegmentIdsFromPushRecovery(_0x50e30f,_0x2e53c5,_0x582558){const _0x34100e=a175_0x6e2f89,_0xc1daab=readPushRecovery(_0x50e30f[_0x34100e(0xed)]);if(_0xc1daab?.[_0x34100e(0x1b4)]===_0x50e30f[_0x34100e(0x11c)][_0x34100e(0x1af)])for(const [_0x55b8a5,_0x540c53]of Object['entries'](_0xc1daab[_0x34100e(0xfa)])){const _0x3ba890=generateDeterministicJourneySegmentName(_0x50e30f[_0x34100e(0x11c)][_0x34100e(0x1af)],_0x55b8a5);_0x540c53['uniqueServerName']===_0x3ba890&&(_0x2e53c5[_0x34100e(0x177)](_0x55b8a5,_0x540c53[_0x34100e(0x118)]),_0x582558[_0x34100e(0x177)](_0x55b8a5,_0x540c53[_0x34100e(0x118)]));}}async function createOrRecoverEmbeddedSegment(_0x5a9924,_0xf4f7ce,_0x1b56ae,_0xfe0d45){const _0x52b43e=a175_0x6e2f89;let _0x49c0ef;try{_0x49c0ef=await _0x5a9924[_0x52b43e(0x109)]['createJourneySegment']({'name':_0x1b56ae[_0x52b43e(0xfc)],'description':_0x1b56ae[_0x52b43e(0x198)],'journeyId':_0x1b56ae[_0x52b43e(0x119)],'rule':_0xfe0d45(_0x1b56ae['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x1b56ae[_0x52b43e(0xfb)],'audienceId':_0x1b56ae[_0x52b43e(0x136)]});}catch(_0x476be4){const _0x1ae82c=_0x476be4 instanceof Error&&_0x476be4[_0x52b43e(0x1a3)][_0x52b43e(0x12f)](_0x52b43e(0x125));if(_0x1ae82c){const _0x4be542=readPushRecovery(_0xf4f7ce[_0x52b43e(0xed)]),_0x4b9f53=_0x4be542?.[_0x52b43e(0x1b4)]===_0xf4f7ce['yamlConfig'][_0x52b43e(0x1af)]?_0x4be542[_0x52b43e(0xfa)][_0x1b56ae[_0x52b43e(0x16b)]]:undefined;if(_0x4b9f53?.[_0x52b43e(0x15d)]===_0x1b56ae[_0x52b43e(0xfc)])await _0x5a9924['segment'][_0x52b43e(0x103)](_0x1b56ae[_0x52b43e(0x136)],_0x4b9f53[_0x52b43e(0x118)],{'description':_0x1b56ae[_0x52b43e(0x198)],'rule':_0xfe0d45(_0x1b56ae['resolvedRule'],!![]),'countPopulation':!![]}),_0x49c0ef=_0x4b9f53[_0x52b43e(0x118)];else throw new SDKError(ErrorCode[_0x52b43e(0x117)],'Embedded\x20segment\x20\x27'+_0x1b56ae[_0x52b43e(0x16b)]+_0x52b43e(0x145)+(_0x52b43e(0x1b9)+_0xf4f7ce['absolutePath'][_0x52b43e(0xe8)](/([^/]+)$/,_0x52b43e(0x152))+')\x20')+_0x52b43e(0x176),_0x476be4);}else throw _0x476be4;}return saveSegmentToPushRecovery(_0xf4f7ce[_0x52b43e(0xed)],_0xf4f7ce[_0x52b43e(0x11c)]['name'],_0x1b56ae[_0x52b43e(0x16b)],{'segmentId':_0x49c0ef,'uniqueServerName':_0x1b56ae[_0x52b43e(0xfc)],'createdAt':new Date()[_0x52b43e(0xf7)]()}),_0x49c0ef;}export async function prepareSegmentFiles(_0x5120b1,_0x5197ea,_0x177539,_0x2160cc,_0x13098b){const _0x1fdbc9=a175_0x6e2f89,{activationDefToCreateRequest:_0x16f479}=await import(_0x1fdbc9(0x158)),_0x1a17e7=[],_0x38f09f=new Set();for(const {yamlConfig:_0x38d83a,folderPath:_0x3ab863,sourcePath:_0x239107}of _0x5120b1){const _0x13e2d0=resolveTDFolderPath(_0x3ab863,_0x2160cc,_0x13098b),_0x54d0fd=_0x13e2d0+':'+_0x38d83a[_0x1fdbc9(0x1af)],_0xa19ad=_0x5197ea[_0x1fdbc9(0xef)]['get'](_0x54d0fd),_0x19d990=_0xa19ad?_0x5197ea[_0x1fdbc9(0xf4)][_0x1fdbc9(0x1a7)](_0xa19ad['id'])||[]:[];addFoldersToCreate(_0x13e2d0,_0x5197ea['folderPathToId'],_0x38f09f);const _0xcb8b2e=calculateActivationActions(_0x38d83a[_0x1fdbc9(0x1e6)]||[],_0x19d990,_0x5197ea[_0x1fdbc9(0x154)],_0x5197ea[_0x1fdbc9(0x14f)]);for(const _0x32bb3c of _0xcb8b2e){(_0x32bb3c[_0x1fdbc9(0x181)]==='create'||_0x32bb3c[_0x1fdbc9(0x181)]===_0x1fdbc9(0x15c))&&_0x32bb3c['yamlActivation']&&(_0x32bb3c[_0x1fdbc9(0x1c8)]=await _0x16f479(_0x32bb3c[_0x1fdbc9(0x137)],_0x177539));}const _0x1b847a=calculateSegmentDiff(_0x38d83a,_0xa19ad,_0x19d990,_0x5197ea['idToEmailMap'],_0x5197ea[_0x1fdbc9(0x14f)]);_0x1a17e7['push']({'relativePath':_0x38d83a[_0x1fdbc9(0x1af)],'absolutePath':_0x239107,'yamlConfig':_0x38d83a,'folderPath':_0x13e2d0,'existingSegment':_0xa19ad,'existingActivations':_0x19d990,'isNew':_0x1b847a['isNew'],'hasChanges':_0x1b847a[_0x1fdbc9(0x15a)],'diff':_0x1b847a[_0x1fdbc9(0x186)],'activationActions':_0xcb8b2e});}return{'segmentFiles':_0x1a17e7,'foldersToCreate':_0x38f09f};}export async function prepareJourneyFiles(_0xc5d428,_0x1c521a,_0x31e91c,_0x4e21fc){const _0x370f85=a175_0x6e2f89,_0x5fa478=[],_0x365238=new Set();for(const {yamlConfig:_0x5bc02b,folderPath:_0xacee21,sourcePath:_0x42b2cd}of _0xc5d428){const _0x1ea48c=resolveTDFolderPath(_0xacee21,_0x31e91c,_0x4e21fc),_0x57005e=_0x1ea48c+':'+_0x5bc02b[_0x370f85(0x1af)],_0x3f340d=_0x1c521a[_0x370f85(0x1a6)][_0x370f85(0x1a7)](_0x57005e);let _0x143462,_0x23ba3d;if(_0x3f340d&&_0x3f340d[_0x370f85(0x108)]>0x0){const _0x4c9e9c=buildLocalExpandedRuleMappings(_0x5bc02b),{createYamlContext:_0x477e34,prefetchJourneySegments:_0x52eed1}=createPushYamlContextForBundle(_0x1c521a[_0x370f85(0x18d)],_0x1c521a[_0x370f85(0x136)],_0x1c521a[_0x370f85(0x13b)],_0x4c9e9c,_0x1c521a[_0x370f85(0x154)],_0x1c521a[_0x370f85(0x14f)],_0x1c521a['activationStepsById'],_0x1c521a[_0x370f85(0x15f)]);await _0x52eed1(_0x3f340d[_0x370f85(0x1ca)](_0x276fb0=>_0x276fb0['id']));const _0xed431e=await _0x1c521a[_0x370f85(0x18d)][_0x370f85(0x17a)][_0x370f85(0x1d1)](_0x3f340d[0x0][_0x370f85(0x182)]),_0x328055=hasMultipleVersions(_0x5bc02b),_0x202eb7=async _0x3cf417=>{const _0x3d908e=_0x370f85,_0x19b0f1=_0x1c521a[_0x3d908e(0x15f)]?.[_0x3d908e(0x1a7)](_0x3cf417);if(_0x19b0f1)return _0x19b0f1;return _0x1c521a[_0x3d908e(0x16c)]({'journeyId':_0x3cf417,'journeyName':_0x5bc02b[_0x3d908e(0x1af)],'isMultiVersion':_0x3f340d[_0x3d908e(0x108)]>0x1});};if(_0x328055&&_0x3f340d[_0x370f85(0x108)]>0x1){const _0x5c52a4=[];for(const _0x5c83d3 of _0x3f340d){const _0x2324f5=_0x5c83d3[_0x370f85(0x1b2)]||0x1;_0x1c521a[_0x370f85(0x1c5)]?.['update'](_0x370f85(0x147)+_0x5bc02b[_0x370f85(0x1af)]+'\x20v'+_0x2324f5);const _0x47810e=await _0x202eb7(_0x5c83d3['id']),_0x916d5d=_0x477e34(_0x5c83d3['id']),_0xbde11b=await journeyResponseToDef(_0x47810e,_0x916d5d);_0x5c52a4[_0x370f85(0x1e1)]({'item':_0x5c83d3,'yaml':_0xbde11b});}const _0x4713e0=buildLocalRuleToNameMappingFromJourney(_0x5bc02b);_0x23ba3d=buildMergedJourneyDef(_0x5c52a4,_0x4713e0,_0xed431e);const _0x4286b1=Math[_0x370f85(0x115)](..._0x5c52a4[_0x370f85(0x1ca)](_0x32f7d7=>_0x32f7d7[_0x370f85(0x19e)][_0x370f85(0x1b2)]||0x0)),_0x23784b=_0x3f340d[_0x370f85(0x114)](_0x2257b8=>(_0x2257b8[_0x370f85(0x1b2)]||0x0)===_0x4286b1);_0x23784b&&(_0x1c521a[_0x370f85(0x1c5)]?.[_0x370f85(0x15c)]('Fetching\x20'+_0x5bc02b[_0x370f85(0x1af)]+'\x20v'+_0x4286b1),_0x143462=await _0x202eb7(_0x23784b['id']));}else{const _0x49de47=_0x3f340d[_0x3f340d[_0x370f85(0x108)]-0x1];_0x1c521a[_0x370f85(0x1c5)]?.[_0x370f85(0x15c)]('Fetching\x20'+_0x5bc02b['name']),_0x143462=await _0x202eb7(_0x49de47['id']);const _0x2e8ce1=_0x477e34(_0x49de47['id']),_0x29e1ee=await journeyResponseToDef(_0x143462,_0x2e8ce1),_0x46b532=buildLocalRuleToNameMappingFromJourney(_0x5bc02b);_0x23ba3d=buildMergedJourneyDef([{'item':_0x49de47,'yaml':_0x29e1ee}],_0x46b532,_0xed431e);}}addFoldersToCreate(_0x1ea48c,_0x1c521a[_0x370f85(0x1bb)],_0x365238);const _0xb2e2fe=calculateJourneyDiff(_0x5bc02b,_0x23ba3d);_0x5fa478[_0x370f85(0x1e1)]({'relativePath':_0x5bc02b[_0x370f85(0x1af)],'absolutePath':_0x42b2cd,'yamlConfig':_0x5bc02b,'folderPath':_0x1ea48c,'existingJourney':_0x143462,'isNew':_0xb2e2fe[_0x370f85(0x14a)],'hasChanges':_0xb2e2fe[_0x370f85(0x15a)],'diff':_0xb2e2fe[_0x370f85(0x186)]});}return{'journeyFiles':_0x5fa478,'foldersToCreate':_0x365238};}export function calculateActivationActions(_0x33f473,_0x34a51d,_0x45a775,_0x4641a3){const _0x44f439=a175_0x6e2f89,_0x4c19b=[],_0x3780bb=new Map();for(const _0x1bd67c of _0x34a51d){_0x3780bb[_0x44f439(0x177)](_0x1bd67c[_0x44f439(0x1af)],_0x1bd67c);}const _0x210ffb=new Map();for(const _0x1df53e of _0x33f473){_0x210ffb[_0x44f439(0x177)](_0x1df53e[_0x44f439(0x1af)],_0x1df53e);}for(const _0x111469 of _0x33f473){const _0x27a136=_0x3780bb[_0x44f439(0x1a7)](_0x111469['name']);if(!_0x27a136)_0x4c19b[_0x44f439(0x1e1)]({'type':'create','name':_0x111469[_0x44f439(0x1af)],'yamlActivation':_0x111469});else{const _0x4c62c6=activationResponseToDef(_0x27a136,_0x45a775,_0x4641a3),_0xb2e2a8=a175_0x38ac7e[_0x44f439(0x131)](_0x4c62c6),_0xa7eaa6=a175_0x38ac7e[_0x44f439(0x131)](_0x111469);_0xb2e2a8!==_0xa7eaa6&&_0x4c19b[_0x44f439(0x1e1)]({'type':_0x44f439(0x15c),'name':_0x111469[_0x44f439(0x1af)],'yamlActivation':_0x111469,'existingActivation':_0x27a136});}}for(const _0x229944 of _0x34a51d){!_0x210ffb['has'](_0x229944['name'])&&_0x4c19b['push']({'type':_0x44f439(0x19a),'name':_0x229944['name'],'existingActivation':_0x229944});}return _0x4c19b;}function calculateYamlDiff(_0x47ce7b,_0x64bc7){if(_0x64bc7){const _0x7588a8=generateDiff(_0x64bc7,_0x47ce7b),_0x1ab7ee=hasChanges(_0x7588a8);return{'isNew':![],'hasChanges':_0x1ab7ee,'diff':_0x1ab7ee?formatDiffWithColors(_0x7588a8):undefined};}const _0x5546fe=generateDiff('',_0x47ce7b);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5546fe)};}export function calculateSegmentDiff(_0x182674,_0x2f34e7,_0x39804e,_0x36071b,_0x4a70cf){const _0x5bf716=segmentToYamlString(_0x182674),_0x287c39=_0x2f34e7?segmentToYamlString(segmentWithActivationsToYaml(_0x2f34e7,_0x39804e,undefined,_0x36071b,_0x4a70cf)):undefined;return calculateYamlDiff(_0x5bf716,_0x287c39);}export function calculateJourneyDiff(_0x133b10,_0x1051db){const _0x20de7e=normalizeJourneyDef(_0x133b10,_0x133b10),_0x1f0ae0=a175_0xc347c8(_0x20de7e),_0x39a149=_0x1051db?a175_0xc347c8(normalizeJourneyDef(_0x1051db,_0x133b10)):undefined;return calculateYamlDiff(_0x1f0ae0,_0x39a149);}export function findSegmentsToDelete(_0x4847e5,_0x12ab27,_0x16684b,_0x5a128b,_0x1324fd){const _0x2ca7d6=a175_0x6e2f89,_0x2ae1ae=new Set();for(const {yamlConfig:_0x2bfa8b,folderPath:_0x1e8306}of _0x12ab27){_0x2ae1ae[_0x2ca7d6(0xf3)](_0x1e8306+':'+_0x2bfa8b[_0x2ca7d6(0x1af)]);}return _0x4847e5[_0x2ca7d6(0x17e)](_0x23a7b4=>{const _0x1146c9=_0x2ca7d6,_0x619911=_0x23a7b4[_0x1146c9(0x190)]?_0x16684b[_0x1146c9(0x1a7)](_0x23a7b4['segmentFolderId'][_0x1146c9(0x1dc)]())||'':'',_0xcde351=_0x619911+':'+_0x23a7b4[_0x1146c9(0x1af)];if(_0x2ae1ae[_0x1146c9(0x18b)](_0xcde351))return![];if(_0x1324fd)return _0x619911===_0x5a128b||_0x619911[_0x1146c9(0x1cb)](_0x5a128b+'/');return!![];});}export function findJourneysToDelete(_0x5a8c41,_0x3c7de0,_0x5b9439,_0x3787e4,_0x5eea54){const _0x51387f=a175_0x6e2f89,_0x3c5f90=new Set();for(const {yamlConfig:_0x1ff08c,folderPath:_0x5aab63}of _0x3c7de0){_0x3c5f90[_0x51387f(0xf3)](_0x5aab63+':'+_0x1ff08c[_0x51387f(0x1af)]);}return _0x5a8c41[_0x51387f(0x17e)](_0x4a167b=>{const _0x8e9b98=_0x51387f,_0x91b483=_0x4a167b['folderId']?_0x5b9439[_0x8e9b98(0x1a7)](_0x4a167b[_0x8e9b98(0xfb)])||'':'',_0x50d36f=_0x91b483+':'+_0x4a167b[_0x8e9b98(0x149)];if(_0x3c5f90['has'](_0x50d36f))return![];if(_0x5eea54)return _0x91b483===_0x3787e4||_0x91b483[_0x8e9b98(0x1cb)](_0x3787e4+'/');return!![];});}export function buildSegmentLookupMap(_0xb9a6bc,_0x94cce3){const _0x323504=a175_0x6e2f89,_0x57a29e=new Map();for(const _0x21dc3b of _0xb9a6bc){const _0x346736=_0x21dc3b[_0x323504(0x190)]?_0x94cce3[_0x323504(0x1a7)](_0x21dc3b[_0x323504(0x190)]['toString']())||'':'',_0x24a3dd=_0x346736+':'+_0x21dc3b['name'];_0x57a29e[_0x323504(0x177)](_0x24a3dd,_0x21dc3b);}return _0x57a29e;}export function buildSegmentNameToIdMap(_0xbebdf4){const _0x56d83f=a175_0x6e2f89,_0x29bd6e=new Map();for(const _0x524ee7 of _0xbebdf4){_0x29bd6e[_0x56d83f(0x177)](_0x524ee7[_0x56d83f(0x1af)],_0x524ee7['id']);}return _0x29bd6e;}export function buildJourneyBundleLookupMap(_0x33f767,_0x373c7b){const _0x1cf26f=a175_0x6e2f89,_0x3488e3=new Map();for(const _0x4586f3 of _0x33f767){const _0x2795b4=_0x4586f3['folderId']?_0x373c7b['get'](_0x4586f3[_0x1cf26f(0xfb)])||'':'',_0x685e0a=_0x2795b4+':'+_0x4586f3[_0x1cf26f(0x149)];!_0x3488e3[_0x1cf26f(0x18b)](_0x685e0a)&&_0x3488e3['set'](_0x685e0a,[]),_0x3488e3[_0x1cf26f(0x1a7)](_0x685e0a)[_0x1cf26f(0x1e1)](_0x4586f3);}for(const _0x45287b of _0x3488e3['values']()){_0x45287b['sort']((_0x5cd8fe,_0x4e06b6)=>(_0x5cd8fe[_0x1cf26f(0x1b2)]||0x0)-(_0x4e06b6['versionNumber']||0x0));}return _0x3488e3;}export function collectFoldersToCreate(_0x1d69f8,_0x4df9b1){const _0x25222=a175_0x6e2f89,_0x1e4f6d=new Set();for(const _0x1f8ad9 of _0x1d69f8){if(!_0x1f8ad9)continue;if(_0x4df9b1['has'](_0x1f8ad9))continue;const _0x18ccdf=_0x1f8ad9[_0x25222(0x163)]('/');let _0x222e6e='';for(const _0x5279ba of _0x18ccdf){_0x222e6e=_0x222e6e?_0x222e6e+'/'+_0x5279ba:_0x5279ba,!_0x4df9b1[_0x25222(0x18b)](_0x222e6e)&&_0x1e4f6d['add'](_0x222e6e);}}return _0x1e4f6d;}export function parseAndClassifyYamlFiles(_0x427912,_0x157ccb,_0x229e72){const _0x4af594=a175_0x6e2f89,_0x289fc4=[],_0x8c27f6=[];for(const _0x1bad15 of _0x427912){const _0x5e7f99=a175_0xa4eed[_0x4af594(0x1b7)](_0x157ccb,a175_0xa4eed['dirname'](_0x1bad15)),_0x24025f=_0x5e7f99==='.'?'':_0x5e7f99['replace'](/\\/g,'/'),_0x20b0ef=readFileSync(_0x1bad15,'utf-8'),_0x19302d=a175_0x38ac7e['parse'](_0x20b0ef);if(isJourneyDef(_0x19302d,_0x1bad15)){const _0x531d38=a175_0x3c1213(_0x20b0ef);_0x8c27f6[_0x4af594(0x1e1)]({'yamlConfig':_0x531d38,'folderPath':_0x24025f,'sourcePath':_0x1bad15});}else{if(!_0x229e72?.[_0x4af594(0x1e3)]){const _0xca8b16=parseSegmentYamlFile(_0x20b0ef),_0x43c504=normalizeChildSegmentYaml(_0xca8b16);_0x289fc4[_0x4af594(0x1e1)]({'yamlConfig':_0x43c504,'folderPath':_0x24025f,'sourcePath':_0x1bad15});}}}return{'segments':_0x289fc4,'journeys':_0x8c27f6};}export function validateParsedFiles(_0x28088f,_0xcaaa43){const _0x8f1a21=a175_0x6e2f89,_0x40d7e8=[];for(const {yamlConfig:_0x2f26e1,sourcePath:_0x5a4f91}of _0x28088f[_0x8f1a21(0xfa)]){const _0x5321d5=readFileSync(_0x5a4f91,_0x8f1a21(0x101)),_0x20584e=a175_0x38ac7e[_0x8f1a21(0x10d)](_0x5321d5),_0x4b6196=validateSegmentDef(_0x2f26e1,{'source':_0x5321d5,'document':_0x20584e},{'skipSchema':!![]});if(!_0x4b6196[_0x8f1a21(0x14e)]){const _0x4a1063=a175_0xa4eed['relative'](_0xcaaa43,_0x5a4f91);_0x40d7e8[_0x8f1a21(0x1e1)]({'filePath':_0x4a1063,'source':_0x5321d5,'result':_0x4b6196,'isJourney':![]});}}for(const {yamlConfig:_0x4723c3,sourcePath:_0x2c761e}of _0x28088f[_0x8f1a21(0x153)]){const _0x3aedf7=readFileSync(_0x2c761e,_0x8f1a21(0x101)),_0x9c3f23=a175_0x38ac7e[_0x8f1a21(0x10d)](_0x3aedf7),_0x7c7c55=validateJourneyDef(_0x4723c3,{'source':_0x3aedf7,'document':_0x9c3f23},{'skipSchema':!![]});if(!_0x7c7c55[_0x8f1a21(0x14e)]){const _0x40a342=a175_0xa4eed[_0x8f1a21(0x1b7)](_0xcaaa43,_0x2c761e);_0x40d7e8[_0x8f1a21(0x1e1)]({'filePath':_0x40a342,'source':_0x3aedf7,'result':_0x7c7c55,'isJourney':!![]});}}return _0x40d7e8;}export function formatValidationErrors(_0x542ca4){const _0x52c9b2=a175_0x6e2f89,_0x1f0e69=[];for(const {filePath:_0x31d073,source:_0x3f5ed4,result:_0x119e27,isJourney:_0x51455e}of _0x542ca4){const _0x2169f5=_0x51455e?_0x52c9b2(0x17a):'segment';_0x1f0e69[_0x52c9b2(0x1e1)]('\x0a'+_0x31d073+'\x20('+_0x2169f5+'):\x20'+_0x119e27[_0x52c9b2(0x1da)][_0x52c9b2(0x108)]+_0x52c9b2(0x11a)),_0x1f0e69[_0x52c9b2(0x1e1)](formatValidationResult(_0x119e27,_0x3f5ed4,_0x31d073));}return _0x1f0e69['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x34ad93){const _0x54cc3a=a175_0x6e2f89,_0x50647d=new Set(),_0x19efbc=new Map(),_0x2662fd=collectSegmentUsageCounts(_0x34ad93);if(_0x34ad93[_0x54cc3a(0xfa)])for(const [_0x8dc38f,_0x283909]of Object['entries'](_0x34ad93[_0x54cc3a(0xfa)])){_0x50647d[_0x54cc3a(0xf3)](_0x8dc38f);if(_0x283909[_0x54cc3a(0x178)]){const _0x1459ca=yamlRuleToApi(_0x283909[_0x54cc3a(0x178)]),_0x442049=apiRuleToYaml(_0x1459ca);_0x19efbc[_0x54cc3a(0x177)](_0x8dc38f,_0x442049);}}const _0x2d80cc=new Map();let _0x35996e=0x0;for(const [_0x3d33c9,_0xe282e1]of _0x19efbc){const _0x10aa5a=serializeExpandedRule(_0xe282e1,_0x19efbc),_0x483be6=_0x2d80cc[_0x54cc3a(0x1a7)](_0x10aa5a)||[];_0x483be6[_0x54cc3a(0x1e1)]({'name':_0x3d33c9,'index':_0x35996e}),_0x2d80cc[_0x54cc3a(0x177)](_0x10aa5a,_0x483be6),_0x35996e++;}const _0x26dc9d=new Map();for(const [_0x37ebec,_0x4d4313]of _0x2d80cc){const _0x445577=_0x4d4313[_0x54cc3a(0x1c6)]()[_0x54cc3a(0x142)]((_0x36945b,_0xc157d3)=>{const _0x414b81=_0x54cc3a,_0xfe1b2d=_0x2662fd[_0x414b81(0x1a7)](_0x36945b['name'])||0x0,_0x57a483=_0x2662fd[_0x414b81(0x1a7)](_0xc157d3[_0x414b81(0x1af)])||0x0;if(_0xfe1b2d!==_0x57a483)return _0x57a483-_0xfe1b2d;return _0x36945b[_0x414b81(0x195)]-_0xc157d3[_0x414b81(0x195)];})[_0x54cc3a(0x1ca)](_0x48be48=>_0x48be48[_0x54cc3a(0x1af)]),_0x480aab=[];for(const _0xfa52d5 of _0x445577){const _0x9ea97b=_0x2662fd[_0x54cc3a(0x1a7)](_0xfa52d5)||0x0,_0x5b1cb3=Math[_0x54cc3a(0x115)](_0x9ea97b,0x1);for(let _0x1b29f4=0x0;_0x1b29f4<_0x5b1cb3;_0x1b29f4++){_0x480aab['push'](_0xfa52d5);}}_0x26dc9d[_0x54cc3a(0x177)](_0x37ebec,_0x480aab);}return{'existingLocalSegmentNames':_0x50647d,'localSegmentRules':_0x19efbc,'localExpandedRuleToNames':_0x26dc9d};}export function createSegmentIdResolver(_0x2bb460,_0x2b26fc){return async _0x5ce66e=>{const _0xd0fc3e=a175_0x1875,_0x51431a=_0x2bb460[_0xd0fc3e(0x1a7)](_0x5ce66e);if(!_0x51431a)throw new SDKError(ErrorCode[_0xd0fc3e(0x16d)],_0xd0fc3e(0x11d)+_0x5ce66e+_0xd0fc3e(0x169)+_0x2b26fc+'\x27)');return _0x51431a;};}function a175_0x3308(){const _0x127bb4=['journey','resolveJourneyId','keys','notification','filter','Creating\x20segment\x20\x27','goal','type','journeyBundleId','Created\x20folder\x20\x27','\x27\x20for\x20','./journey-yaml.js','diff','Updated\x20journey\x20\x27','../../utils/async.js','segment_updating','Entry\x20criteria:\x20','has','folder_creating','deps','44360LmloJW','segment_creating','segmentFolderId','with','existingActivation','segment_created','day','index','logDeleted','object','description','2436620yAdMQa','delete','entry','from','segmentNameToId','item','\x27\x20wait\x20condition','all_columns','180VEyzvs','debug','message','journey_created','Matched\x20server\x20segment\x20\x27','journeyBundlesByFolderAndName','get','activationContext','nameToId','logWarning','activation_creating','journey_entry_criteria_','Creating\x20folder\x20\x27','DecisionPoint','name','existingJourney','data','versionNumber','buildUserMaps','journeyName','\x20journey\x20from\x20file:\x20','\x27\x20milestone','relative','segment_updated','Delete\x20the\x20push\x20recovery\x20file\x20(','folderPath','folderPathToId','Updating\x20segment\x20\x27','connection','Created\x20activation\x20\x27','NOT_FOUND','run_after_journey_refresh','Deleted\x20segment\x20\x27','createActivation','getSegmentEntity','__pending_','progress','slice','getSegment\x20failed\x20for\x20','validatedRequest','relationships','map','startsWith','404tPgulX','SEGMENT_SYNTAX_ERROR','kind','connector_config','created','getLatestJourneyId','activationActions','embedded_activation_creating','embedded_segment_creating','listActivations','Deleting\x20activation\x20\x27','Failed\x20to\x20resolve\x20activation\x20','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','Updating\x20activation\x20\x27','errors','546910kRUADw','toString','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','exitCriterias','schedule','245448GiTeRR','push','segment_deleting','skipSegments','rootFolderId','getJourney','activations','updateActivation','\x27...','embedded_segment_created','null','replace','conditions','behaviors','entryCriteria',').\x20','absolutePath','Updated\x20segment\x20\x27','segmentByFolderAndName','size','activation_updated','effectiveFolderId','add','activationsBySegmentId','__pending_act_','stage\x20\x27','toISOString','deleteActivation',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','segments','folderId','uniqueSegmentName','behavior','Failed\x20to\x20','activation_template_id','logSuccess','utf-8','join','updateSegmentById','ACTIVATION_UPDATE_ERROR','action','state','nameToType','length','segment','existingSegment','activation_created','Duration','parseDocument','create','journeyStages','journeyActivationStepId','\x20(referenced\x20in\x20journey\x20','activation_','branches','find','max','waitStepType','SEGMENT_UPDATE_ERROR','segmentId','journeyId','\x20error(s)','\x27\x20from\x20file:\x20','yamlConfig','Segment\x20not\x20found:\x20','toLowerCase','Updated\x20activation\x20\x27','folder_created','3416VOXtsc','embeddedSegmentNameToId','createdSegmentId','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Name\x20has\x20already\x20been\x20taken','JOURNEY_UPDATE_ERROR','waitStep','updated','Stage\x20\x27','getSegment','Creating\x20activation\x20\x27','conditionTimeoutUnit','columns','deleted','includes','\x0a\x20\x20','stringify','journeyActivationNameToId','withProgress','Condition','Created\x20journey\x20\x27','parentId','yamlActivation','1327488JPMZBP','getActivation','digest','existingSegments','all','Failed\x20to\x20resolve\x20segment\x20','Activation\x20not\x20found:\x20','\x27\x20to\x20local\x20\x27','96yduVkT','logInfo','sort','111515HOCNtB','list','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Activation','Fetching\x20','decision_point','journeyBundleName','isNew','idToName','isArray','\x27\x20by\x20rule\x20content','valid','connectionIdToNameMap','activation_deleted','activation_deleting','.$1.push-recovery.json','journeys','idToEmailMap','\x20activation\x20\x27','createdSegmentIds','attributes','./child-segment-yaml.js','\x27\x20exit\x20criteria','hasChanges','parentSegmentFolder','update','uniqueServerName','parse','journeyById','match','activationParams','onProgress','split','conditionSegmentId','results','conditionTimeoutDuration','steps','journey_updated','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','milestone','localName','fetchJourney','SEGMENT_NOT_FOUND','waitStepUnit','deleteSegment','goal\x20criteria','\x27\x20not\x20found\x20in\x20journey\x20\x27','WaitStep','entry_criteria','unchanged','flatMap','and\x20the\x20server\x20segment,\x20then\x20retry.','set','rule','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'];a175_0x3308=function(){return _0x127bb4;};return a175_0x3308();}export function extractRootFolderId(_0x12c43c){const _0x1be617=a175_0x6e2f89;return _0x12c43c[_0x1be617(0x1c9)]?.[_0x1be617(0x15b)]?.[_0x1be617(0x1b1)]?.['id']||_0x12c43c[_0x1be617(0x1c9)]?.['parentFolder']?.[_0x1be617(0x1b1)]?.['id'];}export function buildConnectionMaps(_0x15e1a7){const _0x49de3d=a175_0x6e2f89,_0x4eabb1=new Map(),_0x266118=new Map(),_0x4bb25a=new Map();for(const _0x2e7d6f of _0x15e1a7){_0x4eabb1[_0x49de3d(0x177)](_0x2e7d6f[_0x49de3d(0x1af)],parseInt(_0x2e7d6f['id'],0xa)),_0x266118[_0x49de3d(0x177)](_0x2e7d6f['id'],_0x2e7d6f[_0x49de3d(0x1af)]),_0x4bb25a[_0x49de3d(0x177)](_0x2e7d6f[_0x49de3d(0x1af)],_0x2e7d6f[_0x49de3d(0x181)]);}return{'nameToId':_0x4eabb1,'idToName':_0x266118,'nameToType':_0x4bb25a};}export function calculatePushStats(_0x48ec80,_0x118451,_0x26d4cb,_0x5f1b07,_0x468749,_0x572597,_0x7650a0){const _0x362b43=a175_0x6e2f89,_0x52ad6e=_0x48ec80[_0x362b43(0x17e)](_0x568e89=>_0x568e89[_0x362b43(0x14a)]),_0x27c626=_0x48ec80['filter'](_0x3e6187=>!_0x3e6187[_0x362b43(0x14a)]&&_0x3e6187[_0x362b43(0x15a)]),_0x9ddd72=_0x48ec80[_0x362b43(0x17e)](_0x2b54f9=>!_0x2b54f9[_0x362b43(0x14a)]&&!_0x2b54f9[_0x362b43(0x15a)]),_0x1c2f5c=_0x572597?_0x5f1b07:[],_0x55eb16=_0x118451['filter'](_0x8f7b75=>_0x8f7b75['isNew']),_0x11f0ff=_0x118451[_0x362b43(0x17e)](_0x1a14b2=>!_0x1a14b2['isNew']&&_0x1a14b2[_0x362b43(0x15a)]),_0x1e427f=_0x118451[_0x362b43(0x17e)](_0x1497a7=>!_0x1497a7['isNew']&&!_0x1497a7[_0x362b43(0x15a)]),_0x33e564=_0x572597?_0x468749:[],_0x19ffcc=_0x48ec80[_0x362b43(0x175)](_0x367f69=>_0x367f69[_0x362b43(0x1d2)]),_0x3fcc37=_0x19ffcc[_0x362b43(0x17e)](_0x21460f=>_0x21460f[_0x362b43(0x181)]===_0x362b43(0x10e)),_0x4ae92d=_0x19ffcc[_0x362b43(0x17e)](_0x1d73be=>_0x1d73be[_0x362b43(0x181)]===_0x362b43(0x15c)),_0xb44e0=_0x19ffcc[_0x362b43(0x17e)](_0x4a9c11=>_0x4a9c11[_0x362b43(0x181)]===_0x362b43(0x19a)),_0x44b8a3=Array[_0x362b43(0x19c)](_0x26d4cb)[_0x362b43(0x142)](),_0x1106ff=_0x7650a0?![]:_0x52ad6e[_0x362b43(0x108)]>0x0||_0x27c626['length']>0x0||_0x1c2f5c['length']>0x0,_0x383539=_0x55eb16['length']>0x0||_0x11f0ff[_0x362b43(0x108)]>0x0||_0x33e564[_0x362b43(0x108)]>0x0,_0x513c49=_0x7650a0?![]:_0x19ffcc['length']>0x0,_0xff4534=_0x44b8a3['length']>0x0;return{'segments':{'new':_0x52ad6e,'changed':_0x27c626,'unchanged':_0x9ddd72,'toDelete':_0x1c2f5c},'journeys':{'new':_0x55eb16,'changed':_0x11f0ff,'unchanged':_0x1e427f,'toDelete':_0x33e564},'activations':{'all':_0x19ffcc,'toCreate':_0x3fcc37,'toUpdate':_0x4ae92d,'toDelete':_0xb44e0},'folders':{'toCreate':_0x44b8a3},'counts':{'segments':{'new':_0x52ad6e[_0x362b43(0x108)],'changed':_0x27c626[_0x362b43(0x108)],'unchanged':_0x9ddd72[_0x362b43(0x108)],'toDelete':_0x1c2f5c[_0x362b43(0x108)]},'journeys':{'new':_0x55eb16[_0x362b43(0x108)],'changed':_0x11f0ff[_0x362b43(0x108)],'unchanged':_0x1e427f[_0x362b43(0x108)],'toDelete':_0x33e564['length']},'activations':{'create':_0x3fcc37[_0x362b43(0x108)],'update':_0x4ae92d[_0x362b43(0x108)],'delete':_0xb44e0[_0x362b43(0x108)]},'folders':_0x44b8a3[_0x362b43(0x108)]},'hasChanges':_0x1106ff||_0x383539||_0x513c49||_0xff4534};}export async function buildPushExecutionContext(_0x262ab5,_0x136da8,_0x2370b4,_0x1771fd,_0x176f73,_0x4d5db5){const _0x1c92f2=a175_0x6e2f89,_0x13fc8f=extractRootFolderId(_0x2370b4),{pathToId:_0x1a756d,idToPath:_0x414cc4}=buildFolderMaps(_0x176f73),_0x57c73c=buildSegmentNameToIdMap(_0x1771fd),_0x542b57=new Map(),{batchAsync:_0x1fc5bf}=await import(_0x1c92f2(0x188)),[_0x5ecc9f,_0x5546e3]=await Promise[_0x1c92f2(0x13c)]([_0x262ab5['user'][_0x1c92f2(0x1b3)](),_0x262ab5[_0x1c92f2(0x1bd)][_0x1c92f2(0x144)](),((async()=>{const _0x266492=_0x1c92f2;!_0x4d5db5&&_0x1771fd[_0x266492(0x108)]>0x0&&await _0x1fc5bf(_0x1771fd,async _0x289714=>{const _0x4668f3=_0x266492,_0x121516=await _0x262ab5[_0x4668f3(0x109)][_0x4668f3(0x1d5)](_0x136da8,_0x289714['id']);_0x542b57[_0x4668f3(0x177)](_0x289714['id'],_0x121516);});})())]),{emailToId:_0x5d97f5,idToEmail:_0x5e6b83}=_0x5ecc9f,_0x12a4be=buildConnectionMaps(_0x5546e3);return{'rootFolderId':_0x13fc8f,'folderPathToId':_0x1a756d,'folderIdToPath':_0x414cc4,'segmentNameToId':_0x57c73c,'activationsBySegmentId':_0x542b57,'emailToIdMap':_0x5d97f5,'idToEmailMap':_0x5e6b83,'connectionNameToIdMap':_0x12a4be[_0x1c92f2(0x1a9)],'connectionIdToNameMap':_0x12a4be[_0x1c92f2(0x14b)],'connectionNameToTypeMap':_0x12a4be[_0x1c92f2(0x107)]};}export function createPushYamlContextForBundle(_0x515913,_0x210bf1,_0x543dbb,_0x4db471,_0x5c18ed,_0x22f377,_0x134058,_0x590e63){const {existingLocalSegmentNames:_0x2c4730,localExpandedRuleToNames:_0x51b2ae}=_0x4db471,_0xd529b2=new Set(),_0x1fcd0d=new Map(),_0x52d79c=new Map(),_0x542e93=new Map(),_0xcce4=createJumpTargetCache(),_0x2328dc=new Map(),_0x46b8e6=new Map(),_0x17318f=new Set();let _0x29c76f;const _0x11b4de=_0x1e8055=>{const _0x841774={'resolveSegment':async _0x75ca3f=>{const _0x272eab=a175_0x1875,_0x21ef58=_0x542e93[_0x272eab(0x1a7)](_0x75ca3f);if(_0x21ef58!==undefined)return{'name':_0x21ef58,'isJourneyLocal':!![]};try{const _0x5a43e7=await fetchSegment(_0x515913,_0x210bf1,_0x75ca3f,_0x543dbb);if(!_0x5a43e7)throw new Error('Segment\x20not\x20found');const _0x3ff6ee=generateJourneyLocalName(_0x5a43e7[_0x272eab(0x1af)]),_0x21a78a=_0x5a43e7[_0x272eab(0x1ce)]===SEGMENT_KIND_JOURNEY&&_0x3ff6ee!==undefined;let _0x176572=_0x5a43e7[_0x272eab(0x1af)],_0x4b0b78;if(_0x21a78a&&_0x5a43e7['rule']){const _0x44ca19=apiRuleToYaml(_0x5a43e7['rule']);_0x46b8e6[_0x272eab(0x177)](_0x75ca3f,_0x44ca19);const _0x58d7a5=async _0xaccf5c=>{const _0x57beb2=_0x272eab,_0x5b5d66=collectSegmentRefsFromRule(_0xaccf5c);for(const _0x5ee7c7 of _0x5b5d66){if(!_0x46b8e6[_0x57beb2(0x18b)](_0x5ee7c7))try{const _0x448aca=await fetchSegment(_0x515913,_0x210bf1,_0x5ee7c7,_0x543dbb);if(_0x448aca?.[_0x57beb2(0x178)]){const _0x10927a=apiRuleToYaml(_0x448aca[_0x57beb2(0x178)]);_0x46b8e6[_0x57beb2(0x177)](_0x5ee7c7,_0x10927a),await _0x58d7a5(_0x10927a);}}catch(_0x20fdb3){logger['debug']('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x5ee7c7+':\x20'+_0x20fdb3);}}};await _0x58d7a5(_0x44ca19);const _0x116242=serializeExpandedRule(_0x44ca19,_0x46b8e6),_0x3a0bf2=_0x51b2ae[_0x272eab(0x1a7)](_0x116242);if(_0x3a0bf2&&_0x3a0bf2[_0x272eab(0x108)]>0x0){const _0x2c0148=_0x1fcd0d[_0x272eab(0x1a7)](_0x116242)||0x0,_0x2ca2f5=_0x3a0bf2[_0x2c0148]||_0x3a0bf2[_0x3a0bf2[_0x272eab(0x108)]-0x1];_0x1fcd0d['set'](_0x116242,_0x2c0148+0x1),_0x176572=_0x2ca2f5,_0xd529b2['add'](_0x176572),_0x542e93['set'](_0x75ca3f,_0x176572);const _0x1b9ca9=await resolveRuleSegmentRefs(_0x44ca19,async _0x2174ee=>{const _0x1b60ec=_0x272eab,_0x4f1d4d=_0x542e93[_0x1b60ec(0x1a7)](_0x2174ee);if(_0x4f1d4d)return _0x4f1d4d;const _0x2d96fd=await _0x29c76f['resolveSegment'](_0x2174ee);return _0x2d96fd[_0x1b60ec(0x1af)];});_0x4b0b78={'description':_0x5a43e7[_0x272eab(0x198)],'rule':_0x1b9ca9};}else{const _0x37bc3e=_0x2328dc[_0x272eab(0x1a7)](_0x116242);if(_0x37bc3e)_0x176572=_0x37bc3e,_0x542e93[_0x272eab(0x177)](_0x75ca3f,_0x176572);else{if(_0x3ff6ee){let _0x122da2=_0x3ff6ee,_0x1c4d02=0x2;while(_0xd529b2['has'](_0x122da2)||_0x2c4730[_0x272eab(0x18b)](_0x122da2)){_0x122da2=_0x3ff6ee+'_'+_0x1c4d02,_0x1c4d02++;}_0xd529b2[_0x272eab(0xf3)](_0x122da2),_0x176572=_0x122da2;}_0x542e93[_0x272eab(0x177)](_0x75ca3f,_0x176572),_0x2328dc[_0x272eab(0x177)](_0x116242,_0x176572);const _0x15e58a=await resolveRuleSegmentRefs(_0x44ca19,async _0x9c7fc6=>{const _0x56bba9=_0x542e93['get'](_0x9c7fc6);if(_0x56bba9)return _0x56bba9;const _0x5644fe=await _0x29c76f['resolveSegment'](_0x9c7fc6);return _0x5644fe['name'];});_0x4b0b78={'description':_0x5a43e7['description'],'rule':_0x15e58a};}}}return{'name':_0x176572,'isJourneyLocal':_0x21a78a,'definition':_0x4b0b78};}catch(_0x52482d){return logger[_0x272eab(0x1a2)](_0x272eab(0x13d)+_0x75ca3f+':\x20'+_0x52482d),{'name':_0x75ca3f,'isJourneyLocal':![]};}},'resolveActivation':async _0x5d70cb=>{const _0x5a5bf8=a175_0x1875,_0x34cea5=_0x52d79c[_0x5a5bf8(0x1a7)](_0x5d70cb);if(_0x34cea5!==undefined)return{'name':_0x34cea5,'isJourneyLocal':!![]};try{let _0x25fb0e=_0x134058?.[_0x5a5bf8(0x1a7)](_0x5d70cb);!_0x25fb0e&&(_0x25fb0e=await _0x515913['journey'][_0x5a5bf8(0x139)](_0x1e8055,_0x5d70cb));const _0x421f86=_0x25fb0e['attributes'][_0x5a5bf8(0x161)][_0x5a5bf8(0x1af)]||_0x5d70cb,_0xa49894=sanitizeYamlKey(_0x421f86)||_0x5a5bf8(0x112)+_0x5d70cb,_0xdd7bdb=_0xa49894;_0x52d79c['set'](_0x5d70cb,_0xdd7bdb);const _0x491d04=journeyActivationStepToYaml(_0x25fb0e,_0x5c18ed,_0x22f377);return{'name':_0xdd7bdb,'isJourneyLocal':!![],'definition':_0x491d04};}catch(_0x1eb56a){return logger[_0x5a5bf8(0x1a2)](_0x5a5bf8(0x1d7)+_0x5d70cb+':\x20'+_0x1eb56a),{'name':_0x5d70cb,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1faa33,_0x2e85ec)=>resolveJumpTarget(_0x1faa33,_0x2e85ec,_0xcce4,async _0x1e89aa=>{const _0x50aee4=a175_0x1875,_0x462820=_0x590e63?.[_0x50aee4(0x1a7)](_0x1e89aa);if(_0x462820)return _0x462820;return _0x515913['journey'][_0x50aee4(0x1e5)](_0x1e89aa);})};return _0x29c76f=_0x841774,_0x841774;},_0x55cefc=async _0x19bfa6=>{const _0xc46dc4=a175_0x1875,{collectSegmentIdsFromJourneyApi:_0x4ba9dd}=await import(_0xc46dc4(0x185)),{batchAsync:_0x54423d}=await import(_0xc46dc4(0x188)),_0x117390=new Set();for(const _0x465a68 of _0x19bfa6){let _0x337190=_0x590e63?.[_0xc46dc4(0x1a7)](_0x465a68);!_0x337190&&(_0x337190=await _0x515913['journey']['getJourney'](_0x465a68));const _0x315d43=_0x4ba9dd(_0x337190);for(const _0x4fe1cf of _0x315d43){_0x117390[_0xc46dc4(0xf3)](_0x4fe1cf);}}let _0x5187db=Array['from'](_0x117390);while(_0x5187db[_0xc46dc4(0x108)]>0x0){const _0x202b26=_0x5187db[_0xc46dc4(0x17e)](_0x5a845e=>!_0x17318f['has'](_0x5a845e));if(_0x202b26[_0xc46dc4(0x108)]===0x0)break;const _0x1c373d=await _0x54423d(_0x202b26,async _0x464d68=>{const _0x4e3728=_0xc46dc4;_0x17318f[_0x4e3728(0xf3)](_0x464d68);const _0x45f3a3=await fetchSegment(_0x515913,_0x210bf1,_0x464d68,_0x543dbb);if(!_0x45f3a3)return null;return{'segmentId':_0x464d68,'segment':_0x45f3a3};},0xa),_0x5f14fe=new Set();for(const _0x596bbc of _0x1c373d){if(!_0x596bbc?.[_0xc46dc4(0x109)]?.['rule'])continue;const _0x166865=apiRuleToYaml(_0x596bbc['segment']['rule']);_0x46b8e6[_0xc46dc4(0x177)](_0x596bbc[_0xc46dc4(0x118)],_0x166865);const _0x4535bd=collectSegmentRefsFromRule(_0x166865);for(const _0x5389c9 of _0x4535bd){!_0x17318f[_0xc46dc4(0x18b)](_0x5389c9)&&_0x5f14fe[_0xc46dc4(0xf3)](_0x5389c9);}}_0x5187db=Array[_0xc46dc4(0x19c)](_0x5f14fe);}};return{'createYamlContext':_0x11b4de,'prefetchJourneySegments':_0x55cefc};}export async function executePushSegments(_0x3c099d,_0x39a5b8,_0x300e86,_0x442a5b,_0x3c0fd1){const _0x597381=a175_0x6e2f89,{segmentDefToCreateRequest:_0x44f752,segmentDefToUpdateRequest:_0x6d26}=await import(_0x597381(0x158)),_0x289469=_0x300e86[_0x597381(0x1bb)],_0x58753a=0x5,_0x508663=async _0x187b79=>{const _0x544c69=_0x597381,_0x5a710c=_0x187b79['folderPath']?_0x289469[_0x544c69(0x1a7)](_0x187b79[_0x544c69(0x1ba)]):undefined;let _0x7e7ac4;const _0x1cdd2f={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x20a611=_0x187b79[_0x544c69(0x11c)];if(_0x187b79['yamlConfig'][_0x544c69(0x178)]){const _0x56c157=createSegmentIdResolver(_0x300e86[_0x544c69(0x19d)],_0x187b79[_0x544c69(0x11c)]['name']),_0x8f2dae=await resolveRuleSegmentIds(_0x187b79[_0x544c69(0x11c)][_0x544c69(0x178)],_0x56c157);_0x20a611={..._0x187b79[_0x544c69(0x11c)],'rule':_0x8f2dae};}try{if(_0x187b79[_0x544c69(0x14a)]){_0x3c0fd1['onProgress']?.({'type':_0x544c69(0x18f),'name':_0x187b79[_0x544c69(0x11c)][_0x544c69(0x1af)]});const _0x1f71db=_0x44f752(_0x20a611,_0x5a710c),_0x260e7e=await _0x3c0fd1[_0x544c69(0x133)](_0x544c69(0x17f)+_0x187b79[_0x544c69(0x11c)]['name']+'\x27...',()=>_0x3c099d[_0x544c69(0x109)]['createSegment'](_0x442a5b['parentId'],_0x1f71db));_0x7e7ac4=_0x260e7e[_0x544c69(0x1b1)]['id'],_0x300e86[_0x544c69(0x19d)]['set'](_0x187b79['yamlConfig'][_0x544c69(0x1af)],_0x7e7ac4),_0x1cdd2f[_0x544c69(0x123)]={'name':_0x187b79['yamlConfig']['name'],'id':_0x7e7ac4},_0x3c0fd1[_0x544c69(0x162)]?.({'type':_0x544c69(0x193),'name':_0x187b79['yamlConfig'][_0x544c69(0x1af)],'segmentId':_0x7e7ac4}),_0x3c0fd1['logSuccess']?.('Created\x20segment\x20\x27'+_0x187b79['yamlConfig'][_0x544c69(0x1af)]+'\x27'),_0x1cdd2f[_0x544c69(0x1d0)]=0x1;}else{if(_0x187b79['hasChanges']){_0x3c0fd1[_0x544c69(0x162)]?.({'type':_0x544c69(0x189),'name':_0x187b79['yamlConfig']['name']});const _0x17aedc=_0x6d26(_0x20a611);_0x5a710c!==_0x187b79[_0x544c69(0x10a)]?.['segmentFolderId']&&(_0x17aedc[_0x544c69(0x190)]=_0x5a710c?parseInt(_0x5a710c,0xa):undefined),await _0x3c0fd1[_0x544c69(0x133)](_0x544c69(0x1bc)+_0x187b79[_0x544c69(0x11c)][_0x544c69(0x1af)]+_0x544c69(0xe5),()=>_0x3c099d[_0x544c69(0x109)][_0x544c69(0x103)](_0x442a5b['parentId'],_0x187b79['existingSegment']['id'],_0x17aedc)),_0x7e7ac4=_0x187b79[_0x544c69(0x10a)]['id'],_0x3c0fd1[_0x544c69(0x162)]?.({'type':_0x544c69(0x1b8),'name':_0x187b79[_0x544c69(0x11c)][_0x544c69(0x1af)]}),_0x3c0fd1[_0x544c69(0x100)]?.(_0x544c69(0xee)+_0x187b79[_0x544c69(0x11c)][_0x544c69(0x1af)]+'\x27'),_0x1cdd2f[_0x544c69(0x128)]=0x1;}else _0x7e7ac4=_0x187b79[_0x544c69(0x10a)]['id'];}}catch(_0x1dce7c){const _0x419abe=isHttp400Error(_0x1dce7c),_0xd845d1=_0x419abe?ErrorCode[_0x544c69(0x1cd)]:ErrorCode[_0x544c69(0x117)],_0x298391=getErrorMessage(_0x1dce7c);throw new SDKError(_0xd845d1,_0x544c69(0xfe)+(_0x187b79['isNew']?_0x544c69(0x10e):_0x544c69(0x15c))+'\x20segment\x20from\x20file:\x20'+_0x187b79[_0x544c69(0xed)]+_0x544c69(0x130)+_0x298391,_0x1dce7c);}try{const _0xa703bb=await syncActivationsForSegment(_0x3c099d,_0x442a5b[_0x544c69(0x136)],_0x7e7ac4,_0x187b79[_0x544c69(0x11c)][_0x544c69(0x1af)],_0x187b79[_0x544c69(0x1d2)],_0x3c0fd1,_0x187b79[_0x544c69(0xed)]);_0x1cdd2f['activations']=_0xa703bb;}catch(_0x588aed){if(_0x588aed instanceof SDKError)throw _0x588aed;throw new SDKError(ErrorCode[_0x544c69(0x104)],_0x544c69(0x124)+_0x187b79[_0x544c69(0x11c)][_0x544c69(0x1af)]+_0x544c69(0x11b)+_0x187b79[_0x544c69(0xed)]+'\x0a\x20\x20'+getErrorMessage(_0x588aed),_0x588aed);}return _0x1cdd2f;},_0x2db048=await batchAsync(_0x39a5b8,_0x508663,_0x58753a),_0x2e723d={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1e593b of _0x2db048){_0x2e723d[_0x597381(0x1d0)]+=_0x1e593b['created'],_0x2e723d[_0x597381(0x128)]+=_0x1e593b[_0x597381(0x128)],_0x1e593b['createdSegmentId']&&_0x2e723d[_0x597381(0x156)][_0x597381(0x177)](_0x1e593b['createdSegmentId'][_0x597381(0x1af)],_0x1e593b[_0x597381(0x123)]['id']),_0x2e723d['activations'][_0x597381(0x1d0)]+=_0x1e593b[_0x597381(0x1e6)][_0x597381(0x1d0)],_0x2e723d[_0x597381(0x1e6)][_0x597381(0x128)]+=_0x1e593b['activations'][_0x597381(0x128)],_0x2e723d['activations'][_0x597381(0x12e)]+=_0x1e593b[_0x597381(0x1e6)]['deleted'];}return _0x2e723d;}async function syncActivationsForSegment(_0x248745,_0x1467f8,_0x10d819,_0xf42164,_0x2a4d58,_0x1da287,_0x387283){const _0x41ff46=a175_0x6e2f89,_0x51c4bd={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5d7133 of _0x2a4d58){try{if(_0x5d7133[_0x41ff46(0x181)]===_0x41ff46(0x10e)&&_0x5d7133['validatedRequest'])_0x1da287[_0x41ff46(0x162)]?.({'type':_0x41ff46(0x1ab),'segmentName':_0xf42164,'activationName':_0x5d7133[_0x41ff46(0x1af)]}),await _0x1da287['withProgress'](_0x41ff46(0x12b)+_0x5d7133[_0x41ff46(0x1af)]+'\x27...',()=>_0x248745[_0x41ff46(0x109)][_0x41ff46(0x1c2)](_0x1467f8,_0x10d819,_0x5d7133['validatedRequest'])),_0x1da287[_0x41ff46(0x162)]?.({'type':_0x41ff46(0x10b),'segmentName':_0xf42164,'activationName':_0x5d7133[_0x41ff46(0x1af)]}),_0x1da287[_0x41ff46(0x100)]?.(_0x41ff46(0x1be)+_0x5d7133[_0x41ff46(0x1af)]+'\x27'),_0x51c4bd['created']++;else{if(_0x5d7133[_0x41ff46(0x181)]===_0x41ff46(0x15c)&&_0x5d7133[_0x41ff46(0x1c8)]&&_0x5d7133[_0x41ff46(0x192)])_0x1da287[_0x41ff46(0x162)]?.({'type':'activation_updating','segmentName':_0xf42164,'activationName':_0x5d7133['name']}),await _0x1da287[_0x41ff46(0x133)](_0x41ff46(0x1d9)+_0x5d7133[_0x41ff46(0x1af)]+_0x41ff46(0xe5),()=>_0x248745['segment'][_0x41ff46(0xe4)](_0x1467f8,_0x10d819,_0x5d7133[_0x41ff46(0x192)]['id'],_0x5d7133[_0x41ff46(0x1c8)])),_0x1da287[_0x41ff46(0x162)]?.({'type':_0x41ff46(0xf1),'segmentName':_0xf42164,'activationName':_0x5d7133[_0x41ff46(0x1af)]}),_0x1da287[_0x41ff46(0x100)]?.(_0x41ff46(0x11f)+_0x5d7133[_0x41ff46(0x1af)]+'\x27'),_0x51c4bd['updated']++;else _0x5d7133[_0x41ff46(0x181)]===_0x41ff46(0x19a)&&_0x5d7133[_0x41ff46(0x192)]&&(_0x1da287[_0x41ff46(0x162)]?.({'type':_0x41ff46(0x151),'segmentName':_0xf42164,'activationName':_0x5d7133['name']}),await _0x1da287[_0x41ff46(0x133)](_0x41ff46(0x1d6)+_0x5d7133[_0x41ff46(0x1af)]+_0x41ff46(0xe5),()=>_0x248745[_0x41ff46(0x109)][_0x41ff46(0xf8)](_0x1467f8,_0x10d819,_0x5d7133['existingActivation']['id'])),_0x1da287[_0x41ff46(0x162)]?.({'type':_0x41ff46(0x150),'segmentName':_0xf42164,'activationName':_0x5d7133[_0x41ff46(0x1af)]}),_0x1da287[_0x41ff46(0x196)]?.('Deleted\x20activation\x20\x27'+_0x5d7133[_0x41ff46(0x1af)]+'\x27'),_0x51c4bd[_0x41ff46(0x12e)]++);}}catch(_0x1add90){const _0x2cd22c=isHttp400Error(_0x1add90),_0x3f893d=_0x2cd22c?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x41ff46(0x104)],_0x2089f5=getErrorMessage(_0x1add90);throw new SDKError(_0x3f893d,_0x41ff46(0xfe)+_0x5d7133[_0x41ff46(0x181)]+_0x41ff46(0x155)+_0x5d7133['name']+_0x41ff46(0x11b)+_0x387283+_0x41ff46(0x130)+_0x2089f5,_0x1add90);}}return _0x51c4bd;}export async function executePushFolders(_0x482cb9,_0x1f49ed,_0x1e73c4,_0x460d9e,_0x2d068d){const _0x402f4f=a175_0x6e2f89,_0x5531f2=new Map(_0x1e73c4),_0x3e61ae=sortFoldersByDepth(_0x1f49ed);for(const _0x3eb6c0 of _0x3e61ae){const _0x29d293=_0x3eb6c0[_0x402f4f(0x163)]('/'),_0x28831b=_0x29d293[_0x29d293[_0x402f4f(0x108)]-0x1],_0x4e0e40=_0x29d293[_0x402f4f(0x1c6)](0x0,-0x1)['join']('/'),_0xbc61d5=_0x5531f2['get'](_0x4e0e40);_0x2d068d[_0x402f4f(0x162)]?.({'type':_0x402f4f(0x18c),'folder':_0x3eb6c0});const _0x3db744={'name':_0x28831b,'parentFolderId':_0xbc61d5},_0x47c4d0=await _0x2d068d[_0x402f4f(0x133)](_0x402f4f(0x1ad)+_0x3eb6c0+_0x402f4f(0xe5),()=>_0x482cb9[_0x402f4f(0x109)]['createFolder'](_0x460d9e[_0x402f4f(0x136)],_0x3db744));_0x5531f2[_0x402f4f(0x177)](_0x3eb6c0,_0x47c4d0[_0x402f4f(0x1b1)]['id']),_0x2d068d[_0x402f4f(0x162)]?.({'type':_0x402f4f(0x120),'folder':_0x3eb6c0,'folderId':_0x47c4d0[_0x402f4f(0x1b1)]['id']}),_0x2d068d[_0x402f4f(0x141)]?.(_0x402f4f(0x183)+_0x3eb6c0+'\x27');}return _0x5531f2;}export async function executePushSegmentDeletions(_0x2cd5b8,_0x253fea,_0x3c21a0){if(_0x253fea['length']===0x0)return 0x0;const {batchAsync:_0x4f4bc7}=await import('../../utils/async.js'),_0x756686=0x5,_0x236284=await _0x4f4bc7(_0x253fea,async _0x216efe=>{const _0x590f09=a175_0x1875;return _0x3c21a0['onProgress']?.({'type':_0x590f09(0x1e2),'name':_0x216efe[_0x590f09(0x1af)]}),await _0x2cd5b8[_0x590f09(0x109)][_0x590f09(0x16f)](_0x216efe['id']),_0x3c21a0[_0x590f09(0x162)]?.({'type':'segment_deleted','name':_0x216efe[_0x590f09(0x1af)]}),_0x3c21a0[_0x590f09(0x196)]?.(_0x590f09(0x1c1)+_0x216efe['name']+'\x27'),0x1;},_0x756686);return _0x236284['reduce']((_0x2a99f8,_0x53f0db)=>_0x2a99f8+_0x53f0db,0x0);}export async function executePushJourneys(_0x2bc8b3,_0x57382a,_0x28184f,_0x17a8e2,_0x2db4ce){const _0x1ed002=a175_0x6e2f89,{journeyDefToRequest:_0x5ecad4}=await import(_0x1ed002(0x185)),{activationDefToCreateRequest:_0x32eb3b,yamlRuleToApi:_0x47fa5e,validateSegmentRule:_0x5bc89d}=await import(_0x1ed002(0x158)),_0x2bc29c={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4b5d1a=new Map(_0x28184f['segmentNameToId']),_0x4ca8a6=0x5;for(let _0x13510e=0x0;_0x13510e<_0x57382a['length'];_0x13510e+=_0x4ca8a6){const _0x1384f8=_0x57382a[_0x1ed002(0x1c6)](_0x13510e,_0x13510e+_0x4ca8a6),_0xcc96d8=await Promise[_0x1ed002(0x13c)](_0x1384f8[_0x1ed002(0x1ca)](async _0x5956ac=>{const _0x70cf49=_0x1ed002;if(!_0x5956ac[_0x70cf49(0x14a)]&&!_0x5956ac['hasChanges'])return{'action':'unchanged','name':_0x5956ac[_0x70cf49(0x11c)][_0x70cf49(0x1af)],'journeyId':_0x5956ac[_0x70cf49(0x1b0)]?.['id']};const _0x290034=_0x5956ac[_0x70cf49(0x1ba)]?_0x28184f[_0x70cf49(0x1bb)][_0x70cf49(0x1a7)](_0x5956ac[_0x70cf49(0x1ba)]):undefined;_0x2db4ce[_0x70cf49(0x162)]?.({'type':_0x5956ac[_0x70cf49(0x14a)]?'journey_creating':'journey_updating','name':_0x5956ac[_0x70cf49(0x11c)]['name']});try{const _0x48d8ac=await executeSingleJourneyPush(_0x2bc8b3,_0x5956ac,{..._0x28184f,'segmentNameToId':_0x4b5d1a},{'parentId':_0x17a8e2[_0x70cf49(0x136)],'rootFolderId':_0x17a8e2[_0x70cf49(0x1e4)],'folderId':_0x290034,'verbose':_0x17a8e2['verbose']},_0x2db4ce,{'journeyDefToRequest':_0x5ecad4,'activationDefToCreateRequest':_0x32eb3b,'yamlRuleToApi':_0x47fa5e,'validateSegmentRule':_0x5bc89d});for(const [_0x37f4c3,_0xa72c3d]of _0x48d8ac[_0x70cf49(0x122)]){_0x4b5d1a[_0x70cf49(0x177)](_0x37f4c3,_0xa72c3d),_0x2bc29c['embeddedSegmentNameToId'][_0x70cf49(0x177)](_0x37f4c3,_0xa72c3d);}if(_0x48d8ac['action']===_0x70cf49(0x1d0))_0x2db4ce[_0x70cf49(0x162)]?.({'type':_0x70cf49(0x1a4),'name':_0x5956ac['yamlConfig'][_0x70cf49(0x1af)],'journeyId':_0x48d8ac['journeyId']}),_0x2db4ce[_0x70cf49(0x100)]?.(_0x70cf49(0x135)+_0x5956ac[_0x70cf49(0x11c)]['name']+'\x27'),_0x2bc29c[_0x70cf49(0x1d0)]++;else _0x48d8ac[_0x70cf49(0x105)]==='updated'&&(_0x2db4ce[_0x70cf49(0x162)]?.({'type':_0x70cf49(0x168),'name':_0x5956ac[_0x70cf49(0x11c)][_0x70cf49(0x1af)]}),_0x2db4ce[_0x70cf49(0x100)]?.(_0x70cf49(0x187)+_0x5956ac['yamlConfig'][_0x70cf49(0x1af)]+'\x27'),_0x2bc29c[_0x70cf49(0x128)]++);return{'action':_0x48d8ac[_0x70cf49(0x105)],'name':_0x5956ac[_0x70cf49(0x11c)][_0x70cf49(0x1af)],'journeyId':_0x48d8ac[_0x70cf49(0x119)]};}catch(_0x5692dd){const _0x5936de=isHttp400Error(_0x5692dd),_0x3aec93=_0x5936de?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x70cf49(0x126)],_0x41281a=getErrorMessage(_0x5692dd);throw new SDKError(_0x3aec93,_0x70cf49(0xfe)+(_0x5956ac[_0x70cf49(0x14a)]?_0x70cf49(0x10e):_0x70cf49(0x15c))+_0x70cf49(0x1b5)+_0x5956ac[_0x70cf49(0xed)]+'\x0a\x20\x20'+_0x41281a,_0x5692dd);}}));_0x2bc29c[_0x1ed002(0x165)][_0x1ed002(0x1e1)](..._0xcc96d8);}return _0x2bc29c;}async function matchExistingJourneySegments(_0x3db177,_0x38e41d,_0x426cc1,_0x30aaa0,_0xa45764){const _0x401b87=a175_0x6e2f89;if(!_0x38e41d[_0x401b87(0x1b0)]||!_0x38e41d[_0x401b87(0x11c)][_0x401b87(0xfa)])return;const _0x9dcbb7=new Map(),_0x32909f=new Set();for(const _0x27c7ac of Object[_0x401b87(0x17c)](_0x38e41d['yamlConfig'][_0x401b87(0xfa)])){const _0x58e6dc=generateDeterministicJourneySegmentName(_0x38e41d[_0x401b87(0x11c)][_0x401b87(0x1af)],_0x27c7ac);_0x9dcbb7['set'](_0x58e6dc,_0x27c7ac),_0x32909f[_0x401b87(0xf3)](_0x27c7ac);}const _0x50e06a=[],_0x1f293d=collectSegmentIdsFromJourneyApi(_0x38e41d['existingJourney']);for(const _0x5068a5 of _0x1f293d){const _0x230075=await fetchSegment(_0x3db177,_0x426cc1,_0x5068a5,_0x30aaa0);if(!_0x230075?.[_0x401b87(0x1af)])continue;const _0x2df191=_0x9dcbb7[_0x401b87(0x1a7)](_0x230075[_0x401b87(0x1af)]);_0x2df191?(_0xa45764[_0x401b87(0x177)](_0x2df191,_0x5068a5),_0x32909f[_0x401b87(0x19a)](_0x2df191)):_0x50e06a['push']({'id':_0x5068a5,'seg':_0x230075});}if(_0x32909f['size']>0x0&&_0x50e06a[_0x401b87(0x108)]>0x0){const {localExpandedRuleToNames:_0x22f5e3}=buildLocalExpandedRuleMappings(_0x38e41d[_0x401b87(0x11c)]),_0x2d5078=new Map();for(const {id:_0x48b0b9,seg:_0xf58120}of _0x50e06a){if(_0xf58120['rule']){const _0x5aff80=apiRuleToYaml(_0xf58120['rule']);_0x2d5078[_0x401b87(0x177)](_0x48b0b9,_0x5aff80);}}for(const {id:_0x2aade7,seg:_0x3d5320}of _0x50e06a){if(!_0x3d5320[_0x401b87(0x178)])continue;const _0x5e5883=_0x2d5078['get'](_0x2aade7);if(!_0x5e5883)continue;const _0x23229f=serializeExpandedRule(_0x5e5883,_0x2d5078),_0x2527f8=_0x22f5e3['get'](_0x23229f);if(_0x2527f8){const _0xa2c556=_0x2527f8[_0x401b87(0x114)](_0x472f57=>_0x32909f['has'](_0x472f57));_0xa2c556&&(_0xa45764[_0x401b87(0x177)](_0xa2c556,_0x2aade7),_0x32909f[_0x401b87(0x19a)](_0xa2c556),logger['debug'](_0x401b87(0x1a5)+_0x3d5320[_0x401b87(0x1af)]+_0x401b87(0x13f)+_0xa2c556+_0x401b87(0x14d)));}}}}async function executeSingleJourneyPush(_0x15b8db,_0x54bd98,_0x1d6983,_0x5c6d06,_0x11e181,_0x17a76a){const _0x55b847=a175_0x6e2f89,{journeyDefToRequest:_0x3a8b11,activationDefToCreateRequest:_0x58aadc,yamlRuleToApi:_0x4fb5ac,validateSegmentRule:_0x318a57}=_0x17a76a,_0x354b18=new Map(),_0x5371d1=new Map();recoverSegmentIdsFromPushRecovery(_0x54bd98,_0x354b18,_0x1d6983[_0x55b847(0x19d)]);const _0x17bee1=new Map(),_0x36a23a=new Map(),_0x292678=new Map();let _0x436106;const _0x498ee2=async()=>{const _0x15d9d4=_0x55b847;if(_0x436106)return;_0x436106=new Map();if(!_0x54bd98[_0x15d9d4(0x1b0)])return;const _0x5e9a17=await _0x15b8db[_0x15d9d4(0x17a)][_0x15d9d4(0x1d5)](_0x54bd98['existingJourney']['id']);for(const _0xedf41b of _0x5e9a17){const _0x59d3a1=journeyActivationStepToYaml(_0xedf41b,_0x1d6983[_0x15d9d4(0x154)],_0x1d6983[_0x15d9d4(0x14f)]),_0x5a85b8=activationSignature(_0x59d3a1);!_0x436106['has'](_0x5a85b8)&&_0x436106['set'](_0x5a85b8,_0xedf41b['id']),_0x59d3a1['name']&&_0x5371d1['set'](_0x59d3a1[_0x15d9d4(0x1af)],_0xedf41b['id']);}};await matchExistingJourneySegments(_0x15b8db,_0x54bd98,_0x5c6d06['parentId'],_0x1d6983[_0x55b847(0x13b)],_0x1d6983['segmentNameToId']);const _0x528228={'resolveSegmentId':async _0x223c4f=>{const _0x51c2b7=_0x55b847,_0x33d2a1=_0x1d6983['segmentNameToId'][_0x51c2b7(0x1a7)](_0x223c4f);if(!_0x33d2a1)throw new SDKError(ErrorCode[_0x51c2b7(0x16d)],_0x51c2b7(0x11d)+_0x223c4f+_0x51c2b7(0x111)+_0x54bd98['yamlConfig'][_0x51c2b7(0x1af)]+')');return _0x33d2a1;},'resolveEmbeddedSegmentId':async(_0x11b760,_0x48d256)=>{const _0x5d13d3=_0x55b847,_0x273885=_0x1d6983[_0x5d13d3(0x19d)][_0x5d13d3(0x1a7)](_0x11b760);if(_0x273885)return _0x273885;const _0x15843a=_0x1d6983[_0x5d13d3(0x13b)][_0x5d13d3(0x114)](_0x19cd13=>_0x19cd13[_0x5d13d3(0x1af)]===_0x11b760);if(_0x15843a)return _0x1d6983[_0x5d13d3(0x19d)][_0x5d13d3(0x177)](_0x11b760,_0x15843a['id']),_0x15843a['id'];if(_0x54bd98[_0x5d13d3(0x14a)]){const {stageName:_0x4ab216,criteriaName:_0xf42ab3}=findSegmentCriteriaLocation(_0x54bd98[_0x5d13d3(0x11c)],_0x11b760);return _0x318a57(_0x11b760,_0x48d256[_0x5d13d3(0x178)]),_0x36a23a[_0x5d13d3(0x177)](_0x11b760,{'definition':_0x48d256,'stageName':_0x4ab216,'criteriaName':_0xf42ab3}),createPendingSegmentId(_0x11b760);}const _0x2be491=_0x54bd98[_0x5d13d3(0x1b0)]?.['id'];if(!_0x2be491)throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x40e982=_0x17bee1[_0x5d13d3(0x1a7)](_0x11b760);if(_0x40e982)return _0x40e982;const _0x4fc396=((async()=>{const _0x374cf8=_0x5d13d3;_0x318a57(_0x11b760,_0x48d256[_0x374cf8(0x178)]);const _0x3182a9=generateDeterministicJourneySegmentName(_0x54bd98[_0x374cf8(0x11c)][_0x374cf8(0x1af)],_0x11b760),_0x5adef0=_0x1d6983[_0x374cf8(0x13b)][_0x374cf8(0x114)](_0x2d9259=>_0x2d9259[_0x374cf8(0x1af)]===_0x3182a9),_0x2cface=createSegmentIdResolver(_0x1d6983[_0x374cf8(0x19d)],_0x11b760),_0x232b82=await resolveRuleSegmentIds(_0x48d256[_0x374cf8(0x178)],_0x2cface);let _0x55b6a4;return _0x5adef0?(await _0x15b8db[_0x374cf8(0x109)][_0x374cf8(0x103)](_0x5c6d06['parentId'],_0x5adef0['id'],{'description':_0x48d256[_0x374cf8(0x198)]||_0x374cf8(0x18a)+_0x11b760,'rule':_0x4fb5ac(_0x232b82),'countPopulation':!![]}),_0x55b6a4=_0x5adef0['id'],saveSegmentToPushRecovery(_0x54bd98['absolutePath'],_0x54bd98[_0x374cf8(0x11c)]['name'],_0x11b760,{'segmentId':_0x55b6a4,'uniqueServerName':_0x3182a9,'createdAt':new Date()['toISOString']()})):_0x55b6a4=await createOrRecoverEmbeddedSegment(_0x15b8db,_0x54bd98,{'localName':_0x11b760,'uniqueSegmentName':_0x3182a9,'description':_0x48d256['description']||_0x374cf8(0x18a)+_0x11b760,'journeyId':_0x2be491,'resolvedRule':_0x232b82,'parentId':_0x5c6d06[_0x374cf8(0x136)],'folderId':_0x5c6d06['rootFolderId']||''},_0x4fb5ac),_0x1d6983[_0x374cf8(0x19d)][_0x374cf8(0x177)](_0x11b760,_0x55b6a4),_0x354b18[_0x374cf8(0x177)](_0x11b760,_0x55b6a4),_0x55b6a4;})());_0x17bee1['set'](_0x11b760,_0x4fc396);try{return await _0x4fc396;}finally{_0x17bee1[_0x5d13d3(0x19a)](_0x11b760);}},'resolveActivationId':async _0x5e562f=>{const _0xa47cd8=_0x55b847,_0x4e5392=_0x5371d1[_0xa47cd8(0x1a7)](_0x5e562f);if(_0x4e5392)return _0x4e5392;if(_0x54bd98[_0xa47cd8(0x1b0)]){await _0x498ee2();const _0x301d59=_0x5371d1[_0xa47cd8(0x1a7)](_0x5e562f);if(_0x301d59)return _0x301d59;}throw new SDKError(ErrorCode['NOT_FOUND'],_0xa47cd8(0x13e)+_0x5e562f+_0xa47cd8(0x111)+_0x54bd98[_0xa47cd8(0x11c)][_0xa47cd8(0x1af)]+_0xa47cd8(0xec)+_0xa47cd8(0x1dd));},'resolveEmbeddedActivationId':async(_0x1c0863,_0x5db8b1)=>{const _0x52d327=_0x55b847,_0x4d2da3=_0x5371d1['get'](_0x1c0863);if(_0x4d2da3)return _0x4d2da3;if(_0x54bd98[_0x52d327(0x14a)])return _0x292678[_0x52d327(0x177)](_0x1c0863,_0x5db8b1),createPendingActivationId(_0x1c0863);if(_0x54bd98[_0x52d327(0x1b0)]){await _0x498ee2();const _0x213cc3=_0x5371d1[_0x52d327(0x1a7)](_0x5db8b1['name']);if(_0x213cc3)return _0x5371d1[_0x52d327(0x177)](_0x1c0863,_0x213cc3),_0x213cc3;const _0x3d14cc=activationSignature(_0x5db8b1),_0x14fb00=_0x436106?.[_0x52d327(0x1a7)](_0x3d14cc);if(_0x14fb00)return _0x5371d1[_0x52d327(0x177)](_0x1c0863,_0x14fb00),_0x14fb00;const _0x2a0a32=await _0x58aadc(_0x5db8b1,_0x1d6983[_0x52d327(0x1a8)]),_0x1849e3={..._0x2a0a32,..._0x5db8b1[_0x52d327(0x1c0)]!==undefined&&{'runAfterJourneyRefresh':_0x5db8b1[_0x52d327(0x1c0)]}},_0x374632=await _0x15b8db['journey'][_0x52d327(0x1c2)](_0x54bd98[_0x52d327(0x1b0)]['id'],_0x1849e3);return _0x5371d1['set'](_0x1c0863,_0x374632['id']),_0x374632['id'];}throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x32716b=>{const _0x386bd3=_0x55b847;try{return await _0x15b8db[_0x386bd3(0x17a)][_0x386bd3(0x17b)](_0x5c6d06[_0x386bd3(0x136)],_0x32716b);}catch(_0x1d2009){throw new SDKError(ErrorCode[_0x386bd3(0x1bf)],'Journey\x20\x27'+_0x32716b+_0x386bd3(0x179)+_0x54bd98[_0x386bd3(0x11c)][_0x386bd3(0x1af)]+'\x27)',_0x1d2009);}},'resolveStageId':async(_0x322338,_0x520670)=>{const _0x55d677=_0x55b847,_0x32e1c1=await _0x15b8db[_0x55d677(0x17a)]['getJourney'](_0x322338),_0x4c6316=_0x32e1c1[_0x55d677(0x157)]['journeyStages'][_0x55d677(0x114)](_0x225322=>_0x225322[_0x55d677(0x1af)][_0x55d677(0x11e)]()===_0x520670['toLowerCase']());if(!_0x4c6316?.['id'])throw new SDKError(ErrorCode[_0x55d677(0x1bf)],_0x55d677(0x129)+_0x520670+_0x55d677(0x171)+(_0x32e1c1['attributes'][_0x55d677(0x149)]||_0x32e1c1[_0x55d677(0x157)][_0x55d677(0x1af)])+'\x27');return _0x4c6316['id'];}},_0x184d97=await _0x3a8b11(_0x54bd98['yamlConfig'],_0x5c6d06[_0x55b847(0x136)],_0x528228),_0x50f81e=_0x5c6d06['folderId']||_0x5c6d06['rootFolderId'];_0x50f81e&&(_0x184d97['relationships']={'parentFolder':{'data':{'id':_0x50f81e,'type':'folder'}}});if(_0x54bd98['isNew']){if(_0x36a23a[_0x55b847(0xf0)]>0x0||_0x292678['size']>0x0)return await executeThreeStepJourneyCreate(_0x15b8db,_0x54bd98,_0x184d97,{'pendingEmbeddedSegments':_0x36a23a,'pendingEmbeddedActivations':_0x292678,'embeddedSegmentNameToId':_0x354b18,'journeyActivationNameToId':_0x5371d1},{..._0x5c6d06,'effectiveFolderId':_0x50f81e},_0x1d6983,_0x11e181,_0x17a76a);else{ensureJourneyDefaults(_0x184d97['attributes']);const _0x21aa70=await _0x15b8db[_0x55b847(0x17a)]['create'](_0x184d97);return deletePushRecovery(_0x54bd98[_0x55b847(0xed)]),{'action':_0x55b847(0x1d0),'journeyId':_0x21aa70['id'],'embeddedSegmentNameToId':_0x354b18};}}else{if(_0x54bd98[_0x55b847(0x15a)]&&_0x54bd98['existingJourney']){_0x184d97['id']=_0x54bd98[_0x55b847(0x1b0)]['id'];const _0x205444=_0x184d97[_0x55b847(0x157)];_0x54bd98['existingJourney'][_0x55b847(0x157)]?.['journeyBundleName']&&(_0x205444['journeyBundleName']=_0x54bd98[_0x55b847(0x1b0)]['attributes'][_0x55b847(0x149)]);const _0x5a4ba1=_0x54bd98['existingJourney'][_0x55b847(0x157)]?.[_0x55b847(0x10f)];return _0x5a4ba1&&_0x184d97[_0x55b847(0x157)]['journeyStages']&&injectExistingStageIds(_0x184d97['attributes'][_0x55b847(0x10f)],_0x5a4ba1),ensureJourneyDefaults(_0x205444),await _0x15b8db[_0x55b847(0x17a)][_0x55b847(0x15c)](_0x54bd98['existingJourney']['id'],_0x184d97),deletePushRecovery(_0x54bd98['absolutePath']),{'action':_0x55b847(0x128),'journeyId':_0x54bd98[_0x55b847(0x1b0)]['id'],'embeddedSegmentNameToId':_0x354b18};}}return deletePushRecovery(_0x54bd98[_0x55b847(0xed)]),{'action':_0x55b847(0x174),'journeyId':_0x54bd98[_0x55b847(0x1b0)]?.['id'],'embeddedSegmentNameToId':_0x354b18};}function findSegmentCriteriaLocation(_0xb47d82,_0x5c9121){const _0x57af31=a175_0x6e2f89,_0x5d870a=_0xb47d82['stages']||_0xb47d82[_0x57af31(0x153)]?.[0x0]?.['stages']||[];let _0x381ee7=_0x57af31(0x19b),_0x19c807=_0x5c9121;const _0x4faaae=_0xb47d82[_0x57af31(0x180)]||_0xb47d82['journeys']?.[0x0]?.[_0x57af31(0x180)];if(_0x4faaae?.[_0x57af31(0x109)]===_0x5c9121)return{'stageName':'goal','criteriaName':_0x4faaae[_0x57af31(0x1af)]||_0x5c9121};_0x443de9:for(const _0x248652 of _0x5d870a){if(_0x248652['entry_criteria']?.[_0x57af31(0x109)]===_0x5c9121){_0x381ee7=_0x248652['name'],_0x19c807=_0x248652[_0x57af31(0x173)][_0x57af31(0x1af)]||_0x5c9121;break;}if(_0x248652[_0x57af31(0x167)])for(const _0xe2a0a9 of _0x248652[_0x57af31(0x167)]){if(_0xe2a0a9['type']===_0x57af31(0x148)&&_0xe2a0a9[_0x57af31(0x191)]?.[_0x57af31(0x113)])for(const _0x444882 of _0xe2a0a9['with'][_0x57af31(0x113)]){if(_0x444882[_0x57af31(0x109)]===_0x5c9121){_0x381ee7=_0x248652['name'],_0x19c807=_0x444882[_0x57af31(0x1af)]||_0x5c9121;break _0x443de9;}}}}return{'stageName':_0x381ee7,'criteriaName':_0x19c807};}async function executeThreeStepJourneyCreate(_0x4bca52,_0x41e967,_0x4ed5df,_0x40e3d9,_0x337717,_0x541aeb,_0x3b725c,_0x6184a3){const _0x51da20=a175_0x6e2f89,{activationDefToCreateRequest:_0x3df1d8,yamlRuleToApi:_0x2b1f0e}=_0x6184a3,{pendingEmbeddedSegments:_0xf96cba,pendingEmbeddedActivations:_0x33316b,embeddedSegmentNameToId:_0x21bf50}=_0x40e3d9,_0x172652=JSON[_0x51da20(0x15e)](JSON[_0x51da20(0x131)](_0x4ed5df));ensureJourneyDefaults(_0x172652[_0x51da20(0x157)]),stripPendingIds(_0x172652);const _0x149790=await _0x4bca52[_0x51da20(0x17a)][_0x51da20(0x10e)](_0x172652),_0x271e57=_0x149790['id'],_0x2383e3=new Map();for(const _0x49282b of _0x149790['attributes'][_0x51da20(0x10f)]){_0x2383e3[_0x51da20(0x177)](_0x49282b['name'][_0x51da20(0x11e)](),_0x49282b['id']);}recoverSegmentIdsFromPushRecovery(_0x41e967,_0x21bf50,_0x541aeb[_0x51da20(0x19d)]);for(const [_0x55369f,{definition:_0xb2edfe}]of _0xf96cba){if(_0x21bf50[_0x51da20(0x18b)](_0x55369f)){_0x3b725c[_0x51da20(0x162)]?.({'type':_0x51da20(0xe6),'journeyName':_0x41e967[_0x51da20(0x11c)][_0x51da20(0x1af)],'segmentName':_0x55369f});continue;}const _0x1cff29=generateDeterministicJourneySegmentName(_0x41e967[_0x51da20(0x11c)][_0x51da20(0x1af)],_0x55369f);_0x3b725c[_0x51da20(0x162)]?.({'type':_0x51da20(0x1d4),'journeyName':_0x41e967[_0x51da20(0x11c)]['name'],'segmentName':_0x55369f});const _0x42d06a=createSegmentIdResolver(_0x541aeb['segmentNameToId'],_0x55369f),_0xfb6f00=await resolveRuleSegmentIds(_0xb2edfe[_0x51da20(0x178)],_0x42d06a),_0x4c039a=await createOrRecoverEmbeddedSegment(_0x4bca52,_0x41e967,{'localName':_0x55369f,'uniqueSegmentName':_0x1cff29,'description':_0xb2edfe[_0x51da20(0x198)]||_0x51da20(0x18a)+_0x55369f,'journeyId':_0x271e57,'resolvedRule':_0xfb6f00,'parentId':_0x337717['parentId'],'folderId':_0x337717[_0x51da20(0xf2)]||''},_0x2b1f0e);_0x21bf50['set'](_0x55369f,_0x4c039a),_0x541aeb['segmentNameToId'][_0x51da20(0x177)](_0x55369f,_0x4c039a),_0x3b725c[_0x51da20(0x162)]?.({'type':_0x51da20(0xe6),'journeyName':_0x41e967[_0x51da20(0x11c)]['name'],'segmentName':_0x55369f});}const _0x43c14b=new Map();for(const [_0x2c4e5b,_0x40f9e4]of _0x33316b){_0x3b725c[_0x51da20(0x162)]?.({'type':_0x51da20(0x1d3),'journeyName':_0x41e967[_0x51da20(0x11c)][_0x51da20(0x1af)],'activationName':_0x2c4e5b});const _0x395805=await _0x3df1d8(_0x40f9e4,_0x541aeb[_0x51da20(0x1a8)]),_0x262339={..._0x395805,..._0x40f9e4['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x40f9e4['run_after_journey_refresh']}},_0x45e123=await _0x4bca52[_0x51da20(0x17a)][_0x51da20(0x1c2)](_0x271e57,_0x262339);_0x43c14b[_0x51da20(0x177)](_0x2c4e5b,_0x45e123['id']),_0x40e3d9[_0x51da20(0x132)][_0x51da20(0x177)](_0x2c4e5b,_0x45e123['id']),_0x3b725c[_0x51da20(0x162)]?.({'type':'embedded_activation_created','journeyName':_0x41e967[_0x51da20(0x11c)][_0x51da20(0x1af)],'activationName':_0x2c4e5b});}const _0x5a0901=JSON[_0x51da20(0x15e)](JSON[_0x51da20(0x131)](_0x4ed5df));return _0x5a0901['id']=_0x271e57,ensureJourneyDefaults(_0x5a0901['attributes']),resolvePendingIdsInRequest(_0x5a0901,_0x4ed5df,_0x2383e3,_0x21bf50,_0x43c14b,_0x3b725c),await _0x4bca52[_0x51da20(0x17a)][_0x51da20(0x15c)](_0x271e57,_0x5a0901),deletePushRecovery(_0x41e967['absolutePath']),{'action':'created','journeyId':_0x271e57,'embeddedSegmentNameToId':_0x21bf50};}export function stripWaitStepPendingIds(_0x217b77){const _0xb41ca=a175_0x6e2f89,_0x529b06=_0x217b77['conditionSegmentId']&&isPendingSegmentId(_0x217b77['conditionSegmentId']),_0x2b03c2=_0x217b77[_0xb41ca(0xe9)]?.['some'](_0x135c45=>_0x135c45[_0xb41ca(0x118)]&&isPendingSegmentId(_0x135c45[_0xb41ca(0x118)]));(_0x529b06||_0x2b03c2)&&(_0x217b77[_0xb41ca(0x116)]=_0xb41ca(0x10c),_0x217b77['waitStep']=0x1,_0x217b77[_0xb41ca(0x16e)]=_0xb41ca(0x194),delete _0x217b77[_0xb41ca(0x164)],delete _0x217b77[_0xb41ca(0x166)],delete _0x217b77[_0xb41ca(0x12c)],delete _0x217b77[_0xb41ca(0xe9)]);}export function resolveWaitStepPendingIds(_0xf9479e,_0x42f835,_0x57256a,_0x51ac20){const _0x405719=a175_0x6e2f89;if(_0x42f835[_0x405719(0x164)]&&isPendingSegmentId(_0x42f835['conditionSegmentId'])){const _0x591eac=_0x57256a(_0x42f835['conditionSegmentId'],'stage\x20\x27'+_0x51ac20+_0x405719(0x19f));_0x591eac&&(_0xf9479e[_0x405719(0x116)]=_0x405719(0x134),_0xf9479e[_0x405719(0x164)]=_0x591eac,delete _0xf9479e['waitStep'],delete _0xf9479e[_0x405719(0x16e)],_0x42f835['conditionTimeoutDuration']!==undefined&&(_0xf9479e[_0x405719(0x166)]=_0x42f835[_0x405719(0x166)]),_0x42f835['conditionTimeoutUnit']&&(_0xf9479e[_0x405719(0x12c)]=_0x42f835[_0x405719(0x12c)]));}if(_0x42f835[_0x405719(0xe9)]){const _0x4edbb1=_0x42f835[_0x405719(0xe9)]['some'](_0x40b076=>_0x40b076['segmentId']&&isPendingSegmentId(_0x40b076[_0x405719(0x118)]));if(_0x4edbb1){const _0x4465c5=_0x42f835['conditions'][_0x405719(0x1ca)](_0x25b89b=>{const _0x302493=_0x405719;if(_0x25b89b[_0x302493(0x118)]&&isPendingSegmentId(_0x25b89b['segmentId'])){const _0x7e636d=_0x57256a(_0x25b89b['segmentId'],'stage\x20\x27'+_0x51ac20+_0x302493(0x19f));return{..._0x25b89b,'segmentId':_0x7e636d||_0x25b89b[_0x302493(0x118)]};}return{..._0x25b89b};});_0xf9479e[_0x405719(0x116)]='Condition',_0xf9479e[_0x405719(0xe9)]=_0x4465c5,delete _0xf9479e[_0x405719(0x127)],delete _0xf9479e['waitStepUnit'],delete _0xf9479e['conditionSegmentId'],delete _0xf9479e[_0x405719(0x166)],delete _0xf9479e['conditionTimeoutUnit'];}}}function stripPendingIds(_0x370c29){const _0x5e0259=a175_0x6e2f89;_0x370c29[_0x5e0259(0x157)][_0x5e0259(0x180)]?.['segmentId']&&isPendingSegmentId(_0x370c29['attributes'][_0x5e0259(0x180)]['segmentId'])&&delete _0x370c29[_0x5e0259(0x157)][_0x5e0259(0x180)];for(const _0x32c96f of _0x370c29[_0x5e0259(0x157)][_0x5e0259(0x10f)]||[]){_0x32c96f['entryCriteria']?.[_0x5e0259(0x118)]&&isPendingSegmentId(_0x32c96f[_0x5e0259(0xeb)]['segmentId'])&&delete _0x32c96f[_0x5e0259(0xeb)];_0x32c96f['milestone']?.['segmentId']&&isPendingSegmentId(_0x32c96f[_0x5e0259(0x16a)][_0x5e0259(0x118)])&&delete _0x32c96f['milestone'];_0x32c96f[_0x5e0259(0x1de)]&&(_0x32c96f[_0x5e0259(0x1de)]=_0x32c96f['exitCriterias'][_0x5e0259(0x17e)](_0x1d2d56=>!_0x1d2d56[_0x5e0259(0x118)]||!isPendingSegmentId(_0x1d2d56[_0x5e0259(0x118)])));if(_0x32c96f[_0x5e0259(0x167)])for(const _0x44b6cd of Object[_0x5e0259(0x17c)](_0x32c96f['steps'])){const _0x5c2de9=_0x32c96f['steps'][_0x44b6cd];_0x5c2de9[_0x5e0259(0x181)]===_0x5e0259(0x146)&&_0x5c2de9['journeyActivationStepId']&&isPendingActivationId(_0x5c2de9[_0x5e0259(0x110)])&&(_0x5c2de9[_0x5e0259(0x110)]='');if(_0x5c2de9['type']===_0x5e0259(0x1ae)&&_0x5c2de9[_0x5e0259(0x113)])for(const _0x37f489 of _0x5c2de9[_0x5e0259(0x113)]){_0x37f489[_0x5e0259(0x118)]&&isPendingSegmentId(_0x37f489[_0x5e0259(0x118)])&&(_0x37f489[_0x5e0259(0x118)]='');}_0x5c2de9[_0x5e0259(0x181)]==='WaitStep'&&stripWaitStepPendingIds(_0x5c2de9);}}}function resolvePendingIdsInRequest(_0x5421b3,_0xaea94,_0x193080,_0x4d3543,_0x2bd244,_0xba30c6){const _0x5f1d10=a175_0x6e2f89,_0x5bdbf2=(_0x4a752a,_0x10366a)=>{const _0x1de2d2=a175_0x1875;if(!isPendingSegmentId(_0x4a752a))return _0x4a752a;const _0x4922cc=extractPendingSegmentName(_0x4a752a),_0x4ca792=_0x4d3543['get'](_0x4922cc);return!_0x4ca792&&_0xba30c6[_0x1de2d2(0x1aa)]?.(_0x1de2d2(0x1d8)+_0x4922cc+_0x1de2d2(0x184)+_0x10366a),_0x4ca792;};if(_0x5421b3[_0x5f1d10(0x157)][_0x5f1d10(0x180)]?.['segmentId']&&isPendingSegmentId(_0x5421b3[_0x5f1d10(0x157)][_0x5f1d10(0x180)]['segmentId'])){const _0x1a13f4=_0x5bdbf2(_0x5421b3['attributes'][_0x5f1d10(0x180)][_0x5f1d10(0x118)],_0x5f1d10(0x170));_0x1a13f4&&(_0x5421b3[_0x5f1d10(0x157)][_0x5f1d10(0x180)]['segmentId']=_0x1a13f4);}for(const _0x280158 of _0x5421b3[_0x5f1d10(0x157)][_0x5f1d10(0x10f)]||[]){const _0x35c4fa=_0x193080[_0x5f1d10(0x1a7)](_0x280158[_0x5f1d10(0x1af)]['toLowerCase']());_0x35c4fa&&(_0x280158['id']=_0x35c4fa);if(_0x280158[_0x5f1d10(0xeb)]?.[_0x5f1d10(0x118)]&&isPendingSegmentId(_0x280158[_0x5f1d10(0xeb)][_0x5f1d10(0x118)])){const _0x377b22=_0x5bdbf2(_0x280158[_0x5f1d10(0xeb)]['segmentId'],_0x5f1d10(0xf6)+_0x280158['name']+'\x27\x20entry\x20criteria');_0x377b22&&(_0x280158['entryCriteria']['segmentId']=_0x377b22);}if(_0x280158[_0x5f1d10(0x1de)])for(const _0x15b269 of _0x280158['exitCriterias']){if(_0x15b269[_0x5f1d10(0x118)]&&isPendingSegmentId(_0x15b269[_0x5f1d10(0x118)])){const _0x3a9120=_0x5bdbf2(_0x15b269[_0x5f1d10(0x118)],_0x5f1d10(0xf6)+_0x280158[_0x5f1d10(0x1af)]+_0x5f1d10(0x159));_0x3a9120&&(_0x15b269[_0x5f1d10(0x118)]=_0x3a9120);}}if(_0x280158[_0x5f1d10(0x16a)]?.[_0x5f1d10(0x118)]&&isPendingSegmentId(_0x280158['milestone']['segmentId'])){const _0x4a2f83=_0x5bdbf2(_0x280158[_0x5f1d10(0x16a)][_0x5f1d10(0x118)],_0x5f1d10(0xf6)+_0x280158['name']+_0x5f1d10(0x1b6));_0x4a2f83&&(_0x280158[_0x5f1d10(0x16a)][_0x5f1d10(0x118)]=_0x4a2f83);}if(_0x280158[_0x5f1d10(0x167)]){const _0x19aebb=_0xa89e68=>_0xaea94[_0x5f1d10(0x157)][_0x5f1d10(0x10f)]?.[_0x5f1d10(0x114)](_0x3fc70b=>_0x3fc70b[_0x5f1d10(0x1af)][_0x5f1d10(0x11e)]()===_0x280158[_0x5f1d10(0x1af)][_0x5f1d10(0x11e)]())?.[_0x5f1d10(0x167)]?.[_0xa89e68];for(const _0x5ea27b of Object[_0x5f1d10(0x17c)](_0x280158[_0x5f1d10(0x167)])){const _0xbd257d=_0x280158[_0x5f1d10(0x167)][_0x5ea27b],_0x17739c=_0x19aebb(_0x5ea27b);if(_0xbd257d[_0x5f1d10(0x181)]===_0x5f1d10(0x146)&&_0xbd257d[_0x5f1d10(0x110)]&&(isPendingActivationId(_0xbd257d[_0x5f1d10(0x110)])||_0xbd257d[_0x5f1d10(0x110)]==='')){if(_0x17739c?.['journeyActivationStepId']&&isPendingActivationId(_0x17739c[_0x5f1d10(0x110)])){const _0x1235a4=extractPendingActivationName(_0x17739c[_0x5f1d10(0x110)]),_0x5b4e59=_0x2bd244['get'](_0x1235a4);_0x5b4e59&&(_0xbd257d[_0x5f1d10(0x110)]=_0x5b4e59);}}if(_0xbd257d[_0x5f1d10(0x181)]===_0x5f1d10(0x1ae)&&_0xbd257d[_0x5f1d10(0x113)]&&_0x17739c?.[_0x5f1d10(0x113)])for(let _0x12e4c7=0x0;_0x12e4c7<_0xbd257d[_0x5f1d10(0x113)][_0x5f1d10(0x108)];_0x12e4c7++){const _0x5a3696=_0xbd257d[_0x5f1d10(0x113)][_0x12e4c7],_0x4f230f=_0x17739c[_0x5f1d10(0x113)][_0x12e4c7];if(_0x4f230f?.[_0x5f1d10(0x118)]&&isPendingSegmentId(_0x4f230f[_0x5f1d10(0x118)])){const _0x2eb620=_0x5bdbf2(_0x4f230f[_0x5f1d10(0x118)],'stage\x20\x27'+_0x280158[_0x5f1d10(0x1af)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x5a3696[_0x5f1d10(0x1af)]||_0x12e4c7)+'\x27');_0x2eb620&&(_0x5a3696[_0x5f1d10(0x118)]=_0x2eb620);}}_0xbd257d[_0x5f1d10(0x181)]===_0x5f1d10(0x172)&&_0x17739c?.[_0x5f1d10(0x181)]==='WaitStep'&&resolveWaitStepPendingIds(_0xbd257d,_0x17739c,_0x5bdbf2,_0x280158[_0x5f1d10(0x1af)]);}}}}
1
+ const a175_0x2205f5=a175_0x3619;(function(_0x10e602,_0x42faac){const _0x4907f8=a175_0x3619,_0x5bd7e5=_0x10e602();while(!![]){try{const _0x3aa2b4=parseInt(_0x4907f8(0x153))/0x1+-parseInt(_0x4907f8(0x1a7))/0x2+-parseInt(_0x4907f8(0x19c))/0x3*(parseInt(_0x4907f8(0x13f))/0x4)+-parseInt(_0x4907f8(0x11d))/0x5*(-parseInt(_0x4907f8(0x16c))/0x6)+parseInt(_0x4907f8(0xe1))/0x7*(-parseInt(_0x4907f8(0x127))/0x8)+-parseInt(_0x4907f8(0x100))/0x9+parseInt(_0x4907f8(0x13d))/0xa*(parseInt(_0x4907f8(0xe8))/0xb);if(_0x3aa2b4===_0x42faac)break;else _0x5bd7e5['push'](_0x5bd7e5['shift']());}catch(_0x2d52f3){_0x5bd7e5['push'](_0x5bd7e5['shift']());}}}(a175_0x9f8a,0xb461f));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a175_0x2205f5(0x199);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x55974d){return''+PENDING_SEGMENT_PREFIX+_0x55974d+'__';}export function isPendingSegmentId(_0x1ee879){const _0x27d742=a175_0x2205f5;return _0x1ee879[_0x27d742(0x120)](PENDING_SEGMENT_PREFIX)&&!_0x1ee879[_0x27d742(0x120)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x294f19){return _0x294f19['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x57699b){return''+PENDING_ACTIVATION_PREFIX+_0x57699b+'__';}export function isPendingActivationId(_0x1344ce){const _0xccaf08=a175_0x2205f5;return _0x1344ce[_0xccaf08(0x120)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1b5f21){const _0x4d4d3b=a175_0x2205f5;return _0x1b5f21[_0x4d4d3b(0x103)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x42b3e6,_0x402719){const _0x13c40f=a175_0x2205f5,_0x4c7692=_0x42b3e6+'::'+(_0x402719[_0x13c40f(0xee)]()||'segment'),_0x4789c4=createHash(_0x13c40f(0x137))['update'](_0x4c7692)[_0x13c40f(0x116)](_0x13c40f(0x10c))[_0x13c40f(0x1d1)](0x0,0xc);return _0x13c40f(0x193)+_0x4789c4;}export function ensureJourneyDefaults(_0x22931d){const _0x215cd9=a175_0x2205f5;!_0x22931d[_0x215cd9(0x135)]&&(_0x22931d['description']=''),!_0x22931d[_0x215cd9(0xe6)]&&(_0x22931d[_0x215cd9(0xe6)]=_0x215cd9(0x1a8));}export function injectExistingStageIds(_0x19a943,_0x11f7a6){const _0x526f95=a175_0x2205f5,_0x28f66c=new Map(_0x11f7a6[_0x526f95(0x12e)](_0x59a3c9=>[_0x59a3c9[_0x526f95(0x168)],_0x59a3c9['id']]));for(const _0x4a2050 of _0x19a943){if(!_0x4a2050['id']){const _0x3367eb=_0x28f66c[_0x526f95(0x1b0)](_0x4a2050['name']);_0x3367eb&&(_0x4a2050['id']=_0x3367eb);}}}export function resolveTDFolderPath(_0x28a3f6,_0x29a529,_0x3251aa){const _0x2985dd=a175_0x2205f5;if(!_0x29a529)return _0x28a3f6;if(_0x28a3f6===_0x3251aa||_0x28a3f6[_0x2985dd(0x120)](_0x3251aa+'/'))return _0x28a3f6;return _0x28a3f6?_0x3251aa+'/'+_0x28a3f6:_0x3251aa;}export function addFoldersToCreate(_0xc60942,_0x21e7b9,_0x1862f8){const _0xeaacba=a175_0x2205f5;if(!_0xc60942)return;if(_0x21e7b9[_0xeaacba(0x1b9)](_0xc60942))return;const _0x954e4=_0xc60942[_0xeaacba(0x148)]('/');let _0x4160be='';for(const _0x5014c8 of _0x954e4){_0x4160be=_0x4160be?_0x4160be+'/'+_0x5014c8:_0x5014c8,!_0x21e7b9[_0xeaacba(0x1b9)](_0x4160be)&&_0x1862f8[_0xeaacba(0x140)](_0x4160be);}}export function sortFoldersByDepth(_0xac043c){const _0x3aa7ca=a175_0x2205f5;return[..._0xac043c][_0x3aa7ca(0x114)]((_0x11c5e0,_0xe24357)=>{const _0x3fc143=_0x3aa7ca,_0x2b008e=(_0x11c5e0[_0x3fc143(0x1bf)](/\//g)||[])[_0x3fc143(0xe4)],_0x159146=(_0xe24357['match'](/\//g)||[])['length'];return _0x2b008e-_0x159146;});}import*as a175_0x12209f from'yaml';import{readFileSync}from'fs';import a175_0x32919d from'path';import{isJourneyDef,parseYamlString as a175_0x2951ba,toYamlString as a175_0x12068e,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(_0xb2a89c){const _0x5551bd=a175_0x2205f5;if(Array['isArray'](_0xb2a89c))return'['+_0xb2a89c[_0x5551bd(0x12e)](_0xcdbda0=>stableStringify(_0xcdbda0))['join'](',')+']';if(_0xb2a89c&&typeof _0xb2a89c===_0x5551bd(0x1d8)){const _0x120f90=_0xb2a89c,_0xd2b4e3=Object[_0x5551bd(0xd7)](_0x120f90)[_0x5551bd(0x114)](),_0x1ff93f=_0xd2b4e3[_0x5551bd(0x12e)](_0x2dda1a=>'\x22'+_0x2dda1a+'\x22:'+stableStringify(_0x120f90[_0x2dda1a]));return'{'+_0x1ff93f[_0x5551bd(0x112)](',')+'}';}const _0x2db374=JSON[_0x5551bd(0x17b)](_0xb2a89c);return _0x2db374===undefined?'null':_0x2db374;}function activationSignature(_0x4f0438){const _0x3a6958=a175_0x2205f5,_0x33043a={'connection':_0x4f0438[_0x3a6958(0x12a)],..._0x4f0438[_0x3a6958(0xea)]!==undefined&&{'all_columns':_0x4f0438[_0x3a6958(0xea)]},..._0x4f0438[_0x3a6958(0x125)]!==undefined&&{'columns':_0x4f0438[_0x3a6958(0x125)]},..._0x4f0438[_0x3a6958(0x157)]!==undefined&&{'behavior':_0x4f0438[_0x3a6958(0x157)]},..._0x4f0438[_0x3a6958(0x108)]!==undefined&&{'behaviors':_0x4f0438[_0x3a6958(0x108)]},..._0x4f0438[_0x3a6958(0xdb)]!==undefined&&{'schedule':_0x4f0438[_0x3a6958(0xdb)]},..._0x4f0438[_0x3a6958(0x19b)]!==undefined&&{'notification':_0x4f0438[_0x3a6958(0x19b)]},..._0x4f0438['connector_config']!==undefined&&{'connector_config':_0x4f0438[_0x3a6958(0x105)]},..._0x4f0438[_0x3a6958(0x12d)]!==undefined&&{'activation_template_id':_0x4f0438['activation_template_id']}};return stableStringify(_0x33043a);}async function fetchSegment(_0x32e28e,_0x4a5fca,_0x25a37d,_0x2ad296){const _0xbb7d6d=a175_0x2205f5,_0x2f8b97=_0x2ad296?.[_0xbb7d6d(0x14a)](_0xb9cf13=>_0xb9cf13['id']===_0x25a37d);if(_0x2f8b97)return _0x2f8b97;try{return await _0x32e28e[_0xbb7d6d(0x183)][_0xbb7d6d(0x115)](_0x4a5fca,_0x25a37d);}catch(_0x1a528d){logger['debug'](_0xbb7d6d(0x119)+_0x25a37d+_0xbb7d6d(0x138)+_0x1a528d);try{return await _0x32e28e[_0xbb7d6d(0x183)][_0xbb7d6d(0x1a5)](_0x25a37d);}catch(_0x6a7636){return logger[_0xbb7d6d(0x1a3)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x25a37d+':\x20'+_0x6a7636),null;}}}function recoverSegmentIdsFromPushRecovery(_0x46a246,_0x35f3f0,_0x30114b){const _0x558fac=a175_0x2205f5,_0x4cf06d=readPushRecovery(_0x46a246[_0x558fac(0x1b3)]);if(_0x4cf06d?.['journeyName']===_0x46a246[_0x558fac(0x198)][_0x558fac(0x168)])for(const [_0x1a97d9,_0x59ed7d]of Object['entries'](_0x4cf06d['segments'])){const _0x4563d0=generateDeterministicJourneySegmentName(_0x46a246[_0x558fac(0x198)][_0x558fac(0x168)],_0x1a97d9);_0x59ed7d['uniqueServerName']===_0x4563d0&&(_0x35f3f0['set'](_0x1a97d9,_0x59ed7d[_0x558fac(0x1bc)]),_0x30114b[_0x558fac(0x150)](_0x1a97d9,_0x59ed7d['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x101e85,_0xe6bf3b,_0x503f3c,_0x35dd1a){const _0x3c75ec=a175_0x2205f5;let _0x3decb4;try{_0x3decb4=await _0x101e85[_0x3c75ec(0x183)][_0x3c75ec(0x1cc)]({'name':_0x503f3c[_0x3c75ec(0x160)],'description':_0x503f3c[_0x3c75ec(0x135)],'journeyId':_0x503f3c[_0x3c75ec(0x1ce)],'rule':_0x35dd1a(_0x503f3c[_0x3c75ec(0x182)],!![]),'countPopulation':!![],'parentFolderId':_0x503f3c['folderId'],'audienceId':_0x503f3c['parentId']});}catch(_0x51e4eb){const _0x41dcaa=_0x51e4eb instanceof Error&&_0x51e4eb['message'][_0x3c75ec(0x169)]('Name\x20has\x20already\x20been\x20taken');if(_0x41dcaa){const _0x208114=readPushRecovery(_0xe6bf3b[_0x3c75ec(0x1b3)]),_0x5ae383=_0x208114?.['journeyName']===_0xe6bf3b[_0x3c75ec(0x198)][_0x3c75ec(0x168)]?_0x208114[_0x3c75ec(0x179)][_0x503f3c[_0x3c75ec(0xfe)]]:undefined;if(_0x5ae383?.[_0x3c75ec(0x173)]===_0x503f3c[_0x3c75ec(0x160)])await _0x101e85['segment'][_0x3c75ec(0xf7)](_0x503f3c[_0x3c75ec(0x130)],_0x5ae383[_0x3c75ec(0x1bc)],{'description':_0x503f3c[_0x3c75ec(0x135)],'rule':_0x35dd1a(_0x503f3c[_0x3c75ec(0x182)],!![]),'countPopulation':!![]}),_0x3decb4=_0x5ae383[_0x3c75ec(0x1bc)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],'Embedded\x20segment\x20\x27'+_0x503f3c[_0x3c75ec(0xfe)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x3c75ec(0x10b)+_0xe6bf3b[_0x3c75ec(0x1b3)]['replace'](/([^/]+)$/,_0x3c75ec(0x1a9))+')\x20')+_0x3c75ec(0x155),_0x51e4eb);}else throw _0x51e4eb;}return saveSegmentToPushRecovery(_0xe6bf3b[_0x3c75ec(0x1b3)],_0xe6bf3b[_0x3c75ec(0x198)]['name'],_0x503f3c[_0x3c75ec(0xfe)],{'segmentId':_0x3decb4,'uniqueServerName':_0x503f3c[_0x3c75ec(0x160)],'createdAt':new Date()[_0x3c75ec(0x1a4)]()}),_0x3decb4;}export async function prepareSegmentFiles(_0x311017,_0x5b6d94,_0xd2d363,_0x18d17f,_0x962890){const _0x22589c=a175_0x2205f5,{activationDefToCreateRequest:_0x5b8bb1}=await import(_0x22589c(0x16d)),_0x53081b=[],_0x30fe08=new Set();for(const {yamlConfig:_0x5606e4,folderPath:_0x586ae5,sourcePath:_0x1c8196}of _0x311017){const _0x51036a=resolveTDFolderPath(_0x586ae5,_0x18d17f,_0x962890),_0x14cd29=_0x51036a+':'+_0x5606e4[_0x22589c(0x168)],_0x1fee17=_0x5b6d94['segmentByFolderAndName'][_0x22589c(0x1b0)](_0x14cd29),_0x49285b=_0x1fee17?_0x5b6d94['activationsBySegmentId'][_0x22589c(0x1b0)](_0x1fee17['id'])||[]:[];addFoldersToCreate(_0x51036a,_0x5b6d94['folderPathToId'],_0x30fe08);const _0x34d647=calculateActivationActions(_0x5606e4[_0x22589c(0x113)]||[],_0x49285b,_0x5b6d94['idToEmailMap'],_0x5b6d94[_0x22589c(0x1ba)]);for(const _0x9d1846 of _0x34d647){(_0x9d1846[_0x22589c(0xd3)]===_0x22589c(0x12c)||_0x9d1846[_0x22589c(0xd3)]===_0x22589c(0x1c1))&&_0x9d1846[_0x22589c(0xd8)]&&(_0x9d1846[_0x22589c(0xf3)]=await _0x5b8bb1(_0x9d1846['yamlActivation'],_0xd2d363));}const _0x5166c7=calculateSegmentDiff(_0x5606e4,_0x1fee17,_0x49285b,_0x5b6d94[_0x22589c(0x1a2)],_0x5b6d94[_0x22589c(0x1ba)]);_0x53081b[_0x22589c(0x151)]({'relativePath':_0x5606e4['name'],'absolutePath':_0x1c8196,'yamlConfig':_0x5606e4,'folderPath':_0x51036a,'existingSegment':_0x1fee17,'existingActivations':_0x49285b,'isNew':_0x5166c7[_0x22589c(0xff)],'hasChanges':_0x5166c7['hasChanges'],'diff':_0x5166c7['diff'],'activationActions':_0x34d647});}return{'segmentFiles':_0x53081b,'foldersToCreate':_0x30fe08};}export async function prepareJourneyFiles(_0x16de6a,_0x2a47a7,_0x521e02,_0x2e1de6){const _0x4c053a=a175_0x2205f5,_0x29eb0b=[],_0x1a27e1=new Set();for(const {yamlConfig:_0x146a61,folderPath:_0xd1f446,sourcePath:_0x3a63dc}of _0x16de6a){const _0xaf7b2b=resolveTDFolderPath(_0xd1f446,_0x521e02,_0x2e1de6),_0x3762cd=_0xaf7b2b+':'+_0x146a61[_0x4c053a(0x168)],_0x13c3b4=_0x2a47a7[_0x4c053a(0xd2)][_0x4c053a(0x1b0)](_0x3762cd);let _0x518df9,_0xd7acf5;if(_0x13c3b4&&_0x13c3b4[_0x4c053a(0xe4)]>0x0){const _0x3f1bb8=buildLocalExpandedRuleMappings(_0x146a61),{createYamlContext:_0x1aedc8,prefetchJourneySegments:_0x32295d}=createPushYamlContextForBundle(_0x2a47a7[_0x4c053a(0x132)],_0x2a47a7[_0x4c053a(0x130)],_0x2a47a7[_0x4c053a(0x165)],_0x3f1bb8,_0x2a47a7[_0x4c053a(0x1a2)],_0x2a47a7[_0x4c053a(0x1ba)],_0x2a47a7[_0x4c053a(0x111)],_0x2a47a7[_0x4c053a(0x10f)]);await _0x32295d(_0x13c3b4[_0x4c053a(0x12e)](_0x37bc8e=>_0x37bc8e['id']));const _0x5402fc=await _0x2a47a7[_0x4c053a(0x132)][_0x4c053a(0x16b)][_0x4c053a(0x154)](_0x13c3b4[0x0][_0x4c053a(0x191)]),_0x59f203=hasMultipleVersions(_0x146a61),_0x4c875a=async _0x3a82d3=>{const _0x4a22b9=_0x4c053a,_0x48c7f9=_0x2a47a7[_0x4a22b9(0x10f)]?.[_0x4a22b9(0x1b0)](_0x3a82d3);if(_0x48c7f9)return _0x48c7f9;return _0x2a47a7[_0x4a22b9(0x123)]({'journeyId':_0x3a82d3,'journeyName':_0x146a61[_0x4a22b9(0x168)],'isMultiVersion':_0x13c3b4['length']>0x1});};if(_0x59f203&&_0x13c3b4['length']>0x1){const _0x1f4171=[];for(const _0x4c6869 of _0x13c3b4){const _0x46d44a=_0x4c6869[_0x4c053a(0x17a)]||0x1;_0x2a47a7[_0x4c053a(0x109)]?.[_0x4c053a(0x1c1)]('Fetching\x20'+_0x146a61['name']+'\x20v'+_0x46d44a);const _0x27cee3=await _0x4c875a(_0x4c6869['id']),_0x524f36=_0x1aedc8(_0x4c6869['id']),_0x39abd2=await journeyResponseToDef(_0x27cee3,_0x524f36);_0x1f4171['push']({'item':_0x4c6869,'yaml':_0x39abd2});}const _0x5b9d47=buildLocalRuleToNameMappingFromJourney(_0x146a61);_0xd7acf5=buildMergedJourneyDef(_0x1f4171,_0x5b9d47,_0x5402fc);const _0x5608a4=Math[_0x4c053a(0x149)](..._0x1f4171['map'](_0x2e01ff=>_0x2e01ff[_0x4c053a(0x13c)][_0x4c053a(0x17a)]||0x0)),_0x5523aa=_0x13c3b4[_0x4c053a(0x14a)](_0x1fc4b4=>(_0x1fc4b4[_0x4c053a(0x17a)]||0x0)===_0x5608a4);_0x5523aa&&(_0x2a47a7['progress']?.[_0x4c053a(0x1c1)](_0x4c053a(0x1ac)+_0x146a61[_0x4c053a(0x168)]+'\x20v'+_0x5608a4),_0x518df9=await _0x4c875a(_0x5523aa['id']));}else{const _0x5838d4=_0x13c3b4[_0x13c3b4['length']-0x1];_0x2a47a7['progress']?.[_0x4c053a(0x1c1)](_0x4c053a(0x1ac)+_0x146a61[_0x4c053a(0x168)]),_0x518df9=await _0x4c875a(_0x5838d4['id']);const _0x4c7a2d=_0x1aedc8(_0x5838d4['id']),_0x37a8c5=await journeyResponseToDef(_0x518df9,_0x4c7a2d),_0x5b4909=buildLocalRuleToNameMappingFromJourney(_0x146a61);_0xd7acf5=buildMergedJourneyDef([{'item':_0x5838d4,'yaml':_0x37a8c5}],_0x5b4909,_0x5402fc);}}addFoldersToCreate(_0xaf7b2b,_0x2a47a7[_0x4c053a(0xdd)],_0x1a27e1);const _0x4f5d4c=calculateJourneyDiff(_0x146a61,_0xd7acf5);_0x29eb0b['push']({'relativePath':_0x146a61[_0x4c053a(0x168)],'absolutePath':_0x3a63dc,'yamlConfig':_0x146a61,'folderPath':_0xaf7b2b,'existingJourney':_0x518df9,'isNew':_0x4f5d4c[_0x4c053a(0xff)],'hasChanges':_0x4f5d4c[_0x4c053a(0x1b1)],'diff':_0x4f5d4c[_0x4c053a(0xd5)]});}return{'journeyFiles':_0x29eb0b,'foldersToCreate':_0x1a27e1};}export function calculateActivationActions(_0xddcbc2,_0x27e0a9,_0x3e5ce2,_0x9c981c){const _0xf664d8=a175_0x2205f5,_0x3a8f0f=[],_0x1ce6e0=new Map();for(const _0x27fac5 of _0x27e0a9){_0x1ce6e0[_0xf664d8(0x150)](_0x27fac5[_0xf664d8(0x168)],_0x27fac5);}const _0x44782e=new Map();for(const _0x5be77b of _0xddcbc2){_0x44782e[_0xf664d8(0x150)](_0x5be77b[_0xf664d8(0x168)],_0x5be77b);}for(const _0x4ccfa3 of _0xddcbc2){const _0xa08013=_0x1ce6e0[_0xf664d8(0x1b0)](_0x4ccfa3[_0xf664d8(0x168)]);if(!_0xa08013)_0x3a8f0f[_0xf664d8(0x151)]({'type':_0xf664d8(0x12c),'name':_0x4ccfa3[_0xf664d8(0x168)],'yamlActivation':_0x4ccfa3});else{const _0x9a892e=activationResponseToDef(_0xa08013,_0x3e5ce2,_0x9c981c),_0x239920=a175_0x12209f['stringify'](_0x9a892e),_0x5c8c44=a175_0x12209f[_0xf664d8(0x17b)](_0x4ccfa3);_0x239920!==_0x5c8c44&&_0x3a8f0f[_0xf664d8(0x151)]({'type':'update','name':_0x4ccfa3[_0xf664d8(0x168)],'yamlActivation':_0x4ccfa3,'existingActivation':_0xa08013});}}for(const _0x18866b of _0x27e0a9){!_0x44782e[_0xf664d8(0x1b9)](_0x18866b['name'])&&_0x3a8f0f[_0xf664d8(0x151)]({'type':_0xf664d8(0x161),'name':_0x18866b[_0xf664d8(0x168)],'existingActivation':_0x18866b});}return _0x3a8f0f;}function calculateYamlDiff(_0x11cf64,_0x32e3ed){if(_0x32e3ed){const _0x430d97=generateDiff(_0x32e3ed,_0x11cf64),_0x3dcfb3=hasChanges(_0x430d97);return{'isNew':![],'hasChanges':_0x3dcfb3,'diff':_0x3dcfb3?formatDiffWithColors(_0x430d97):undefined};}const _0x3fbb33=generateDiff('',_0x11cf64);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3fbb33)};}export function calculateSegmentDiff(_0x2a332d,_0x5f0eaa,_0x5da4f1,_0x2d3f7a,_0x3ef300){const _0x92727f=segmentToYamlString(_0x2a332d),_0x18b0ef=_0x5f0eaa?segmentToYamlString(segmentWithActivationsToYaml(_0x5f0eaa,_0x5da4f1,undefined,_0x2d3f7a,_0x3ef300)):undefined;return calculateYamlDiff(_0x92727f,_0x18b0ef);}export function calculateJourneyDiff(_0x23ff58,_0x4bff19){const _0x2dd861=normalizeJourneyDef(_0x23ff58,_0x23ff58),_0x334534=a175_0x12068e(_0x2dd861),_0x50a7f2=_0x4bff19?a175_0x12068e(normalizeJourneyDef(_0x4bff19,_0x23ff58)):undefined;return calculateYamlDiff(_0x334534,_0x50a7f2);}export function findSegmentsToDelete(_0x2b3ed7,_0x302c1d,_0x4e5e58,_0x4772af,_0x5e4959){const _0x638324=a175_0x2205f5,_0x35c652=new Set();for(const {yamlConfig:_0x25031e,folderPath:_0x48d496}of _0x302c1d){_0x35c652[_0x638324(0x140)](_0x48d496+':'+_0x25031e[_0x638324(0x168)]);}return _0x2b3ed7[_0x638324(0xdc)](_0x24c43a=>{const _0x300522=_0x638324,_0x4b5398=_0x24c43a[_0x300522(0xf8)]?_0x4e5e58[_0x300522(0x1b0)](_0x24c43a[_0x300522(0xf8)][_0x300522(0xf1)]())||'':'',_0x375501=_0x4b5398+':'+_0x24c43a[_0x300522(0x168)];if(_0x35c652[_0x300522(0x1b9)](_0x375501))return![];if(_0x5e4959)return _0x4b5398===_0x4772af||_0x4b5398['startsWith'](_0x4772af+'/');return!![];});}export function findJourneysToDelete(_0x391fb5,_0x1d0b8c,_0x175ef5,_0x55364e,_0x3dea0b){const _0x5c0ecd=a175_0x2205f5,_0xf85b62=new Set();for(const {yamlConfig:_0x54cbc5,folderPath:_0x2fa121}of _0x1d0b8c){_0xf85b62[_0x5c0ecd(0x140)](_0x2fa121+':'+_0x54cbc5[_0x5c0ecd(0x168)]);}return _0x391fb5[_0x5c0ecd(0xdc)](_0x557090=>{const _0x9c35a1=_0x5c0ecd,_0x384dce=_0x557090[_0x9c35a1(0x104)]?_0x175ef5['get'](_0x557090[_0x9c35a1(0x104)])||'':'',_0x33ba0c=_0x384dce+':'+_0x557090[_0x9c35a1(0x174)];if(_0xf85b62[_0x9c35a1(0x1b9)](_0x33ba0c))return![];if(_0x3dea0b)return _0x384dce===_0x55364e||_0x384dce[_0x9c35a1(0x120)](_0x55364e+'/');return!![];});}export function buildSegmentLookupMap(_0x4cb853,_0x2a415a){const _0x5d43f4=a175_0x2205f5,_0x558e4c=new Map();for(const _0x4f4ff2 of _0x4cb853){const _0x50fad7=_0x4f4ff2[_0x5d43f4(0xf8)]?_0x2a415a['get'](_0x4f4ff2[_0x5d43f4(0xf8)]['toString']())||'':'',_0x291257=_0x50fad7+':'+_0x4f4ff2['name'];_0x558e4c['set'](_0x291257,_0x4f4ff2);}return _0x558e4c;}export function buildSegmentNameToIdMap(_0x3c4016){const _0x2c4e35=a175_0x2205f5,_0x47cc77=new Map();for(const _0x384591 of _0x3c4016){_0x47cc77[_0x2c4e35(0x150)](_0x384591[_0x2c4e35(0x168)],_0x384591['id']);}return _0x47cc77;}export function buildJourneyBundleLookupMap(_0xd4f350,_0x57dea0){const _0x40a903=a175_0x2205f5,_0x54087e=new Map();for(const _0x418b2a of _0xd4f350){const _0x234e24=_0x418b2a['folderId']?_0x57dea0[_0x40a903(0x1b0)](_0x418b2a[_0x40a903(0x104)])||'':'',_0x322e95=_0x234e24+':'+_0x418b2a[_0x40a903(0x174)];!_0x54087e[_0x40a903(0x1b9)](_0x322e95)&&_0x54087e['set'](_0x322e95,[]),_0x54087e[_0x40a903(0x1b0)](_0x322e95)[_0x40a903(0x151)](_0x418b2a);}for(const _0x4ac7c2 of _0x54087e[_0x40a903(0x141)]()){_0x4ac7c2[_0x40a903(0x114)]((_0x53f028,_0x34a074)=>(_0x53f028['versionNumber']||0x0)-(_0x34a074[_0x40a903(0x17a)]||0x0));}return _0x54087e;}export function collectFoldersToCreate(_0x3786e7,_0x461fd3){const _0x5e1e87=a175_0x2205f5,_0x35ea35=new Set();for(const _0x468c11 of _0x3786e7){if(!_0x468c11)continue;if(_0x461fd3[_0x5e1e87(0x1b9)](_0x468c11))continue;const _0x3f8da7=_0x468c11[_0x5e1e87(0x148)]('/');let _0x108f3a='';for(const _0x5820c3 of _0x3f8da7){_0x108f3a=_0x108f3a?_0x108f3a+'/'+_0x5820c3:_0x5820c3,!_0x461fd3[_0x5e1e87(0x1b9)](_0x108f3a)&&_0x35ea35['add'](_0x108f3a);}}return _0x35ea35;}export function parseAndClassifyYamlFiles(_0x188fb6,_0x40d50f,_0x346035){const _0x545a7d=a175_0x2205f5,_0x2984e6=[],_0x47b452=[];for(const _0x29b014 of _0x188fb6){const _0x4026cf=a175_0x32919d['relative'](_0x40d50f,a175_0x32919d[_0x545a7d(0x1b2)](_0x29b014)),_0x32d231=_0x4026cf==='.'?'':_0x4026cf['replace'](/\\/g,'/'),_0x10550a=readFileSync(_0x29b014,_0x545a7d(0x1d3)),_0x365cbb=a175_0x12209f[_0x545a7d(0x189)](_0x10550a);if(isJourneyDef(_0x365cbb,_0x29b014)){const _0x158d74=a175_0x2951ba(_0x10550a);_0x47b452[_0x545a7d(0x151)]({'yamlConfig':_0x158d74,'folderPath':_0x32d231,'sourcePath':_0x29b014});}else{if(!_0x346035?.[_0x545a7d(0x19d)]){const _0x322340=parseSegmentYamlFile(_0x10550a),_0x5ed1a2=normalizeChildSegmentYaml(_0x322340);_0x2984e6[_0x545a7d(0x151)]({'yamlConfig':_0x5ed1a2,'folderPath':_0x32d231,'sourcePath':_0x29b014});}}}return{'segments':_0x2984e6,'journeys':_0x47b452};}export function validateParsedFiles(_0x14c15b,_0x1e4763){const _0x379eba=a175_0x2205f5,_0x44f2d4=[];for(const {yamlConfig:_0x30124a,sourcePath:_0x28e461}of _0x14c15b[_0x379eba(0x179)]){const _0x1cda53=readFileSync(_0x28e461,_0x379eba(0x1d3)),_0x38bb68=a175_0x12209f[_0x379eba(0x1b8)](_0x1cda53),_0x2f5691=validateSegmentDef(_0x30124a,{'source':_0x1cda53,'document':_0x38bb68},{'skipSchema':!![]});if(!_0x2f5691[_0x379eba(0x163)]){const _0x56dd07=a175_0x32919d['relative'](_0x1e4763,_0x28e461);_0x44f2d4[_0x379eba(0x151)]({'filePath':_0x56dd07,'source':_0x1cda53,'result':_0x2f5691,'isJourney':![]});}}for(const {yamlConfig:_0x1a6574,sourcePath:_0x5827b6}of _0x14c15b[_0x379eba(0x147)]){const _0x3e5c2d=readFileSync(_0x5827b6,'utf-8'),_0xb9a20e=a175_0x12209f[_0x379eba(0x1b8)](_0x3e5c2d),_0x4353ca=validateJourneyDef(_0x1a6574,{'source':_0x3e5c2d,'document':_0xb9a20e},{'skipSchema':!![]});if(!_0x4353ca[_0x379eba(0x163)]){const _0x486f80=a175_0x32919d[_0x379eba(0xf2)](_0x1e4763,_0x5827b6);_0x44f2d4[_0x379eba(0x151)]({'filePath':_0x486f80,'source':_0x3e5c2d,'result':_0x4353ca,'isJourney':!![]});}}return _0x44f2d4;}function a175_0x9f8a(){const _0x2a5d8f=['segment_deleted','some','journeyBundlesByFolderAndName','type','deleteActivation','diff','embedded_segment_created','keys','yamlActivation','rootFolderId','getJourney','schedule','filter','folderPathToId','entry','Failed\x20to\x20','steps','5064353XISFIf','getActivation','index','length','conditions','state','Created\x20activation\x20\x27','11sOCwgB','segment_created','all_columns','toLowerCase','embedded_activation_creating','existingSegment','trim','journeyActivationNameToId','waitStepType','toString','relative','validatedRequest','Updated\x20segment\x20\x27','waitStepUnit','size','updateSegmentById','segmentFolderId','activationParams','Journey\x20\x27','Deleted\x20segment\x20\x27','entry_criteria','createdSegmentId','localName','isNew','8066907JoruZR','Entry\x20criteria:\x20','nameToId','replace','folderId','connector_config','\x27\x20wait\x20condition','existingActivation','behaviors','progress','\x0a\x20\x20','Delete\x20the\x20push\x20recovery\x20file\x20(','hex','./journey-yaml.js','run_after_journey_refresh','journeyById','data','activationStepsById','join','activations','sort','getSegment','digest','journey_created','withProgress','getSegment\x20failed\x20for\x20','NOT_FOUND','activation_created','Activation\x20not\x20found:\x20','6538115IqEnDG','Creating\x20folder\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','startsWith','Failed\x20to\x20resolve\x20activation\x20','conditionSegmentId','fetchJourney','action','columns','embedded_activation_created','16lqDJJV','kind','verbose','connection','entries','create','activation_template_id','map','DecisionPoint','parentId','conditionTimeoutUnit','deps','rule','Updated\x20journey\x20\x27','description','\x27\x20to\x20local\x20\x27','sha1',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','Activation','\x27\x20by\x20rule\x20content','stage\x20\x27','item','28976270WmENNp','Creating\x20segment\x20\x27','3936dhwfDc','add','values','\x27\x20entry\x20criteria','logInfo','waitStep','journeyActivationStepId','reduce','journeys','split','max','find','branches','createActivation','JOURNEY_SYNTAX_ERROR','Segment\x20not\x20found:\x20','listActivations','set','push','nameToType','589474TVSjPK','getLatestJourneyId','and\x20the\x20server\x20segment,\x20then\x20retry.','deleted','behavior','\x27...','createdSegmentIds','activation_updating','Condition','folder','activationActions','resolveSegment','Updated\x20activation\x20\x27','uniqueSegmentName','delete','logSuccess','valid','exitCriterias','existingSegments','goal','from','name','includes','journey_updated','journey','6fAznwj','./child-segment-yaml.js','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','existingJourney','updated','Updating\x20activation\x20\x27','goal\x20criteria','uniqueServerName','journeyBundleName','ACTIVATION_SYNTAX_ERROR','segment_updating','results','segment_creating','segments','versionNumber','stringify','user','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','segment_deleting','unchanged','list','logWarning','resolvedRule','segment','relationships','logDeleted','milestone','folderPath','WaitStep','parse','\x27\x20from\x20file:\x20','created','entryCriteria','createSegment','with','Failed\x20to\x20resolve\x20segment\x20','Created\x20segment\x20\x27','journeyBundleId','SEGMENT_NOT_FOUND','journey_entry_criteria_','Deleted\x20activation\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','journey_creating','segment_updated','yamlConfig','__pending_','segmentNameToId','notification','4020MrawPi','skipSegments','Deleting\x20activation\x20\x27','deleteSegment','\x27\x20milestone','decision_point','idToEmailMap','debug','toISOString','getSegmentEntity','conditionTimeoutDuration','788072VjvzNP','draft','.$1.push-recovery.json','buildUserMaps','\x20(referenced\x20in\x20journey\x20','Fetching\x20','activation_deleting','../../utils/async.js','\x27\x20decision\x20point\x20branch\x20\x27','get','hasChanges','dirname','absolutePath','all',').\x20','parentFolder','):\x20','parseDocument','has','connectionIdToNameMap','\x20segment\x20from\x20file:\x20','segmentId','journey_updating','journeyStages','match','idToName','update','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','SEGMENT_UPDATE_ERROR','onProgress','\x20activation\x20\x27','Stage\x20\x27','INTERNAL','\x27\x20exit\x20criteria','attributes','embedded_segment_creating','Segment\x20not\x20found','createJourneySegment','effectiveFolderId','journeyId','stages','Created\x20journey\x20\x27','slice','JOURNEY_UPDATE_ERROR','utf-8','SEGMENT_SYNTAX_ERROR','activationContext','createFolder','ACTIVATION_UPDATE_ERROR','object','\x27\x20not\x20found\x20in\x20journey\x20\x27'];a175_0x9f8a=function(){return _0x2a5d8f;};return a175_0x9f8a();}export function formatValidationErrors(_0x4d354d){const _0x4b95a9=a175_0x2205f5,_0x305670=[];for(const {filePath:_0x321a31,source:_0x91e49a,result:_0x3adabc,isJourney:_0x56b0d9}of _0x4d354d){const _0x598864=_0x56b0d9?_0x4b95a9(0x16b):_0x4b95a9(0x183);_0x305670[_0x4b95a9(0x151)]('\x0a'+_0x321a31+'\x20('+_0x598864+_0x4b95a9(0x1b7)+_0x3adabc['errors']['length']+'\x20error(s)'),_0x305670[_0x4b95a9(0x151)](formatValidationResult(_0x3adabc,_0x91e49a,_0x321a31));}return _0x305670[_0x4b95a9(0x112)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x31cafb){const _0x593d32=a175_0x2205f5,_0x3a1479=new Set(),_0x405136=new Map(),_0x36011c=collectSegmentUsageCounts(_0x31cafb);if(_0x31cafb[_0x593d32(0x179)])for(const [_0x26069e,_0x51036e]of Object[_0x593d32(0x12b)](_0x31cafb[_0x593d32(0x179)])){_0x3a1479[_0x593d32(0x140)](_0x26069e);if(_0x51036e['rule']){const _0x5737fc=yamlRuleToApi(_0x51036e[_0x593d32(0x133)]),_0x19acf7=apiRuleToYaml(_0x5737fc);_0x405136[_0x593d32(0x150)](_0x26069e,_0x19acf7);}}const _0x53a8bf=new Map();let _0x3acede=0x0;for(const [_0x3c796b,_0x57122c]of _0x405136){const _0x44ed30=serializeExpandedRule(_0x57122c,_0x405136),_0x31bd92=_0x53a8bf[_0x593d32(0x1b0)](_0x44ed30)||[];_0x31bd92[_0x593d32(0x151)]({'name':_0x3c796b,'index':_0x3acede}),_0x53a8bf['set'](_0x44ed30,_0x31bd92),_0x3acede++;}const _0x1bad88=new Map();for(const [_0x145be0,_0x2c3c1d]of _0x53a8bf){const _0x303e45=_0x2c3c1d[_0x593d32(0x1d1)]()[_0x593d32(0x114)]((_0x44e7e6,_0x41292b)=>{const _0x5f3dc9=_0x593d32,_0xd677a3=_0x36011c[_0x5f3dc9(0x1b0)](_0x44e7e6[_0x5f3dc9(0x168)])||0x0,_0xa42f9d=_0x36011c[_0x5f3dc9(0x1b0)](_0x41292b[_0x5f3dc9(0x168)])||0x0;if(_0xd677a3!==_0xa42f9d)return _0xa42f9d-_0xd677a3;return _0x44e7e6['index']-_0x41292b[_0x5f3dc9(0xe3)];})[_0x593d32(0x12e)](_0x2bcdd2=>_0x2bcdd2[_0x593d32(0x168)]),_0xcd3919=[];for(const _0x79aac6 of _0x303e45){const _0x40abb7=_0x36011c[_0x593d32(0x1b0)](_0x79aac6)||0x0,_0x8493a0=Math['max'](_0x40abb7,0x1);for(let _0x485d84=0x0;_0x485d84<_0x8493a0;_0x485d84++){_0xcd3919['push'](_0x79aac6);}}_0x1bad88[_0x593d32(0x150)](_0x145be0,_0xcd3919);}return{'existingLocalSegmentNames':_0x3a1479,'localSegmentRules':_0x405136,'localExpandedRuleToNames':_0x1bad88};}export function createSegmentIdResolver(_0x516a6d,_0x2a57a0){return async _0x47b74d=>{const _0x1040fa=a175_0x3619,_0x5da8e2=_0x516a6d['get'](_0x47b74d);if(!_0x5da8e2)throw new SDKError(ErrorCode[_0x1040fa(0x192)],'Segment\x20not\x20found:\x20'+_0x47b74d+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x2a57a0+'\x27)');return _0x5da8e2;};}export function extractRootFolderId(_0xe7af7d){const _0x2c8d9a=a175_0x2205f5;return _0xe7af7d[_0x2c8d9a(0x184)]?.['parentSegmentFolder']?.[_0x2c8d9a(0x110)]?.['id']||_0xe7af7d[_0x2c8d9a(0x184)]?.[_0x2c8d9a(0x1b6)]?.[_0x2c8d9a(0x110)]?.['id'];}export function buildConnectionMaps(_0x362dce){const _0x479213=a175_0x2205f5,_0x143b35=new Map(),_0x30f98e=new Map(),_0x3386e5=new Map();for(const _0xe6e2f9 of _0x362dce){_0x143b35[_0x479213(0x150)](_0xe6e2f9[_0x479213(0x168)],parseInt(_0xe6e2f9['id'],0xa)),_0x30f98e[_0x479213(0x150)](_0xe6e2f9['id'],_0xe6e2f9[_0x479213(0x168)]),_0x3386e5['set'](_0xe6e2f9[_0x479213(0x168)],_0xe6e2f9[_0x479213(0xd3)]);}return{'nameToId':_0x143b35,'idToName':_0x30f98e,'nameToType':_0x3386e5};}export function calculatePushStats(_0x285e39,_0x5cbee6,_0x784a97,_0x2b28f8,_0x3b70d1,_0x520be9,_0x31d962){const _0x5ab4eb=a175_0x2205f5,_0x234b45=_0x285e39['filter'](_0x2f2d42=>_0x2f2d42[_0x5ab4eb(0xff)]),_0x2083b6=_0x285e39[_0x5ab4eb(0xdc)](_0x346b0b=>!_0x346b0b[_0x5ab4eb(0xff)]&&_0x346b0b[_0x5ab4eb(0x1b1)]),_0x392b51=_0x285e39[_0x5ab4eb(0xdc)](_0x3eb578=>!_0x3eb578[_0x5ab4eb(0xff)]&&!_0x3eb578['hasChanges']),_0x185d99=_0x520be9?_0x2b28f8:[],_0x2a2be1=_0x5cbee6[_0x5ab4eb(0xdc)](_0x4029e5=>_0x4029e5[_0x5ab4eb(0xff)]),_0x3a198e=_0x5cbee6[_0x5ab4eb(0xdc)](_0xd22d22=>!_0xd22d22['isNew']&&_0xd22d22[_0x5ab4eb(0x1b1)]),_0x479923=_0x5cbee6[_0x5ab4eb(0xdc)](_0x32ee44=>!_0x32ee44[_0x5ab4eb(0xff)]&&!_0x32ee44[_0x5ab4eb(0x1b1)]),_0x3fe650=_0x520be9?_0x3b70d1:[],_0x1039f1=_0x285e39['flatMap'](_0x37ffe0=>_0x37ffe0[_0x5ab4eb(0x15d)]),_0x3c731c=_0x1039f1[_0x5ab4eb(0xdc)](_0x49a461=>_0x49a461[_0x5ab4eb(0xd3)]===_0x5ab4eb(0x12c)),_0x4ec3b7=_0x1039f1[_0x5ab4eb(0xdc)](_0x1e512f=>_0x1e512f[_0x5ab4eb(0xd3)]==='update'),_0x1bc0c4=_0x1039f1[_0x5ab4eb(0xdc)](_0x3338b2=>_0x3338b2[_0x5ab4eb(0xd3)]===_0x5ab4eb(0x161)),_0x2eeae8=Array[_0x5ab4eb(0x167)](_0x784a97)[_0x5ab4eb(0x114)](),_0x219457=_0x31d962?![]:_0x234b45[_0x5ab4eb(0xe4)]>0x0||_0x2083b6[_0x5ab4eb(0xe4)]>0x0||_0x185d99[_0x5ab4eb(0xe4)]>0x0,_0x3ccac9=_0x2a2be1[_0x5ab4eb(0xe4)]>0x0||_0x3a198e[_0x5ab4eb(0xe4)]>0x0||_0x3fe650[_0x5ab4eb(0xe4)]>0x0,_0x17ff9a=_0x31d962?![]:_0x1039f1[_0x5ab4eb(0xe4)]>0x0,_0x4cbcf2=_0x2eeae8[_0x5ab4eb(0xe4)]>0x0;return{'segments':{'new':_0x234b45,'changed':_0x2083b6,'unchanged':_0x392b51,'toDelete':_0x185d99},'journeys':{'new':_0x2a2be1,'changed':_0x3a198e,'unchanged':_0x479923,'toDelete':_0x3fe650},'activations':{'all':_0x1039f1,'toCreate':_0x3c731c,'toUpdate':_0x4ec3b7,'toDelete':_0x1bc0c4},'folders':{'toCreate':_0x2eeae8},'counts':{'segments':{'new':_0x234b45[_0x5ab4eb(0xe4)],'changed':_0x2083b6[_0x5ab4eb(0xe4)],'unchanged':_0x392b51[_0x5ab4eb(0xe4)],'toDelete':_0x185d99['length']},'journeys':{'new':_0x2a2be1[_0x5ab4eb(0xe4)],'changed':_0x3a198e[_0x5ab4eb(0xe4)],'unchanged':_0x479923[_0x5ab4eb(0xe4)],'toDelete':_0x3fe650[_0x5ab4eb(0xe4)]},'activations':{'create':_0x3c731c[_0x5ab4eb(0xe4)],'update':_0x4ec3b7[_0x5ab4eb(0xe4)],'delete':_0x1bc0c4[_0x5ab4eb(0xe4)]},'folders':_0x2eeae8[_0x5ab4eb(0xe4)]},'hasChanges':_0x219457||_0x3ccac9||_0x17ff9a||_0x4cbcf2};}export async function buildPushExecutionContext(_0x46a7ba,_0x2eb3a1,_0x1ad83d,_0x2c8060,_0x52c88f,_0x24f1bc){const _0x5f383e=a175_0x2205f5,_0x46e8b7=extractRootFolderId(_0x1ad83d),{pathToId:_0x2cf279,idToPath:_0x4586ab}=buildFolderMaps(_0x52c88f),_0x2d56c9=buildSegmentNameToIdMap(_0x2c8060),_0x2efb0e=new Map(),{batchAsync:_0x21823e}=await import(_0x5f383e(0x1ae)),[_0x362f21,_0x45c601]=await Promise[_0x5f383e(0x1b4)]([_0x46a7ba[_0x5f383e(0x17c)][_0x5f383e(0x1aa)](),_0x46a7ba[_0x5f383e(0x12a)][_0x5f383e(0x180)](),((async()=>{const _0xcbc5c3=_0x5f383e;!_0x24f1bc&&_0x2c8060[_0xcbc5c3(0xe4)]>0x0&&await _0x21823e(_0x2c8060,async _0xe50d61=>{const _0x1affd3=_0xcbc5c3,_0x2bb0fc=await _0x46a7ba[_0x1affd3(0x183)][_0x1affd3(0x14f)](_0x2eb3a1,_0xe50d61['id']);_0x2efb0e[_0x1affd3(0x150)](_0xe50d61['id'],_0x2bb0fc);});})())]),{emailToId:_0x4288e5,idToEmail:_0x210f59}=_0x362f21,_0x46618b=buildConnectionMaps(_0x45c601);return{'rootFolderId':_0x46e8b7,'folderPathToId':_0x2cf279,'folderIdToPath':_0x4586ab,'segmentNameToId':_0x2d56c9,'activationsBySegmentId':_0x2efb0e,'emailToIdMap':_0x4288e5,'idToEmailMap':_0x210f59,'connectionNameToIdMap':_0x46618b[_0x5f383e(0x102)],'connectionIdToNameMap':_0x46618b[_0x5f383e(0x1c0)],'connectionNameToTypeMap':_0x46618b[_0x5f383e(0x152)]};}export function createPushYamlContextForBundle(_0x420bff,_0x341716,_0x376df7,_0x2b551e,_0x12a582,_0x37d4f7,_0x1b92c9,_0x272004){const {existingLocalSegmentNames:_0x1ba3d0,localExpandedRuleToNames:_0xcba0a8}=_0x2b551e,_0xaf2795=new Set(),_0x9c150=new Map(),_0x476915=new Map(),_0x1ee10c=new Map(),_0x50de49=createJumpTargetCache(),_0x6a4ca8=new Map(),_0xb4b2cd=new Map(),_0xde2417=new Set();let _0x250259;const _0x4dd1f9=_0xaae6a7=>{const _0x3e36eb={'resolveSegment':async _0x10a774=>{const _0x39d11e=a175_0x3619,_0x1067ce=_0x1ee10c['get'](_0x10a774);if(_0x1067ce!==undefined)return{'name':_0x1067ce,'isJourneyLocal':!![]};try{const _0x511310=await fetchSegment(_0x420bff,_0x341716,_0x10a774,_0x376df7);if(!_0x511310)throw new Error(_0x39d11e(0x1cb));const _0x158496=generateJourneyLocalName(_0x511310['name']),_0x55cc98=_0x511310[_0x39d11e(0x128)]===SEGMENT_KIND_JOURNEY&&_0x158496!==undefined;let _0x992ef=_0x511310[_0x39d11e(0x168)],_0x27eee7;if(_0x55cc98&&_0x511310[_0x39d11e(0x133)]){const _0x312492=apiRuleToYaml(_0x511310['rule']);_0xb4b2cd['set'](_0x10a774,_0x312492);const _0xc26a3d=async _0x2f65cf=>{const _0x3dc61d=_0x39d11e,_0x506d0f=collectSegmentRefsFromRule(_0x2f65cf);for(const _0x35f978 of _0x506d0f){if(!_0xb4b2cd['has'](_0x35f978))try{const _0x45737e=await fetchSegment(_0x420bff,_0x341716,_0x35f978,_0x376df7);if(_0x45737e?.['rule']){const _0x1fa97d=apiRuleToYaml(_0x45737e['rule']);_0xb4b2cd[_0x3dc61d(0x150)](_0x35f978,_0x1fa97d),await _0xc26a3d(_0x1fa97d);}}catch(_0x1d936a){logger[_0x3dc61d(0x1a3)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x35f978+':\x20'+_0x1d936a);}}};await _0xc26a3d(_0x312492);const _0x275675=serializeExpandedRule(_0x312492,_0xb4b2cd),_0x285b17=_0xcba0a8[_0x39d11e(0x1b0)](_0x275675);if(_0x285b17&&_0x285b17[_0x39d11e(0xe4)]>0x0){const _0x366033=_0x9c150[_0x39d11e(0x1b0)](_0x275675)||0x0,_0x5bee69=_0x285b17[_0x366033]||_0x285b17[_0x285b17[_0x39d11e(0xe4)]-0x1];_0x9c150[_0x39d11e(0x150)](_0x275675,_0x366033+0x1),_0x992ef=_0x5bee69,_0xaf2795[_0x39d11e(0x140)](_0x992ef),_0x1ee10c[_0x39d11e(0x150)](_0x10a774,_0x992ef);const _0x30a234=await resolveRuleSegmentRefs(_0x312492,async _0x4ce1fe=>{const _0x827b72=_0x39d11e,_0x272d39=_0x1ee10c[_0x827b72(0x1b0)](_0x4ce1fe);if(_0x272d39)return _0x272d39;const _0x527cd3=await _0x250259[_0x827b72(0x15e)](_0x4ce1fe);return _0x527cd3[_0x827b72(0x168)];});_0x27eee7={'description':_0x511310[_0x39d11e(0x135)],'rule':_0x30a234};}else{const _0x4b6bfb=_0x6a4ca8[_0x39d11e(0x1b0)](_0x275675);if(_0x4b6bfb)_0x992ef=_0x4b6bfb,_0x1ee10c[_0x39d11e(0x150)](_0x10a774,_0x992ef);else{if(_0x158496){let _0x4a066d=_0x158496,_0x2733b1=0x2;while(_0xaf2795[_0x39d11e(0x1b9)](_0x4a066d)||_0x1ba3d0[_0x39d11e(0x1b9)](_0x4a066d)){_0x4a066d=_0x158496+'_'+_0x2733b1,_0x2733b1++;}_0xaf2795[_0x39d11e(0x140)](_0x4a066d),_0x992ef=_0x4a066d;}_0x1ee10c[_0x39d11e(0x150)](_0x10a774,_0x992ef),_0x6a4ca8[_0x39d11e(0x150)](_0x275675,_0x992ef);const _0x4b2944=await resolveRuleSegmentRefs(_0x312492,async _0x5a94ae=>{const _0x5cfc9f=_0x39d11e,_0x3b75fd=_0x1ee10c[_0x5cfc9f(0x1b0)](_0x5a94ae);if(_0x3b75fd)return _0x3b75fd;const _0x4d2d9d=await _0x250259[_0x5cfc9f(0x15e)](_0x5a94ae);return _0x4d2d9d[_0x5cfc9f(0x168)];});_0x27eee7={'description':_0x511310[_0x39d11e(0x135)],'rule':_0x4b2944};}}}return{'name':_0x992ef,'isJourneyLocal':_0x55cc98,'definition':_0x27eee7};}catch(_0x173840){return logger[_0x39d11e(0x1a3)](_0x39d11e(0x18f)+_0x10a774+':\x20'+_0x173840),{'name':_0x10a774,'isJourneyLocal':![]};}},'resolveActivation':async _0x1a3261=>{const _0x229b3c=a175_0x3619,_0x22b553=_0x476915[_0x229b3c(0x1b0)](_0x1a3261);if(_0x22b553!==undefined)return{'name':_0x22b553,'isJourneyLocal':!![]};try{let _0x244480=_0x1b92c9?.[_0x229b3c(0x1b0)](_0x1a3261);!_0x244480&&(_0x244480=await _0x420bff['journey'][_0x229b3c(0xe2)](_0xaae6a7,_0x1a3261));const _0x358178=_0x244480['attributes'][_0x229b3c(0xf9)][_0x229b3c(0x168)]||_0x1a3261,_0x652347=sanitizeYamlKey(_0x358178)||'activation_'+_0x1a3261,_0x1d7521=_0x652347;_0x476915[_0x229b3c(0x150)](_0x1a3261,_0x1d7521);const _0x65e6a9=journeyActivationStepToYaml(_0x244480,_0x12a582,_0x37d4f7);return{'name':_0x1d7521,'isJourneyLocal':!![],'definition':_0x65e6a9};}catch(_0x84991d){return logger['debug'](_0x229b3c(0x121)+_0x1a3261+':\x20'+_0x84991d),{'name':_0x1a3261,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1407ef,_0xed1197)=>resolveJumpTarget(_0x1407ef,_0xed1197,_0x50de49,async _0x4a0f15=>{const _0x2c3451=a175_0x3619,_0x43a2e3=_0x272004?.[_0x2c3451(0x1b0)](_0x4a0f15);if(_0x43a2e3)return _0x43a2e3;return _0x420bff[_0x2c3451(0x16b)][_0x2c3451(0xda)](_0x4a0f15);})};return _0x250259=_0x3e36eb,_0x3e36eb;},_0x1dd852=async _0x5cd7d7=>{const _0x3ca2d0=a175_0x3619,{collectSegmentIdsFromJourneyApi:_0x2e2091}=await import(_0x3ca2d0(0x10d)),{batchAsync:_0xed6163}=await import(_0x3ca2d0(0x1ae)),_0xfda81a=new Set();for(const _0x40659a of _0x5cd7d7){let _0x196f09=_0x272004?.[_0x3ca2d0(0x1b0)](_0x40659a);!_0x196f09&&(_0x196f09=await _0x420bff['journey'][_0x3ca2d0(0xda)](_0x40659a));const _0x99849c=_0x2e2091(_0x196f09);for(const _0x5877e7 of _0x99849c){_0xfda81a[_0x3ca2d0(0x140)](_0x5877e7);}}let _0x1c9149=Array['from'](_0xfda81a);while(_0x1c9149[_0x3ca2d0(0xe4)]>0x0){const _0x3fcbc9=_0x1c9149[_0x3ca2d0(0xdc)](_0x1ab6aa=>!_0xde2417['has'](_0x1ab6aa));if(_0x3fcbc9[_0x3ca2d0(0xe4)]===0x0)break;const _0x471043=await _0xed6163(_0x3fcbc9,async _0x50d54f=>{const _0xc804a=_0x3ca2d0;_0xde2417[_0xc804a(0x140)](_0x50d54f);const _0x524a2d=await fetchSegment(_0x420bff,_0x341716,_0x50d54f,_0x376df7);if(!_0x524a2d)return null;return{'segmentId':_0x50d54f,'segment':_0x524a2d};},0xa),_0x39d989=new Set();for(const _0x2f34bc of _0x471043){if(!_0x2f34bc?.[_0x3ca2d0(0x183)]?.[_0x3ca2d0(0x133)])continue;const _0x19788a=apiRuleToYaml(_0x2f34bc['segment'][_0x3ca2d0(0x133)]);_0xb4b2cd['set'](_0x2f34bc['segmentId'],_0x19788a);const _0x299aa5=collectSegmentRefsFromRule(_0x19788a);for(const _0x39da7e of _0x299aa5){!_0xde2417[_0x3ca2d0(0x1b9)](_0x39da7e)&&_0x39d989[_0x3ca2d0(0x140)](_0x39da7e);}}_0x1c9149=Array[_0x3ca2d0(0x167)](_0x39d989);}};return{'createYamlContext':_0x4dd1f9,'prefetchJourneySegments':_0x1dd852};}export async function executePushSegments(_0x234249,_0x554a9a,_0x3f3279,_0x322182,_0x2af25c){const _0x2203a6=a175_0x2205f5,{segmentDefToCreateRequest:_0x598366,segmentDefToUpdateRequest:_0x1758c2}=await import('./child-segment-yaml.js'),_0x19a043=_0x3f3279[_0x2203a6(0xdd)],_0x54228f=0x5,_0x2fb836=async _0x51a33f=>{const _0x2e2e7c=_0x2203a6,_0x6a4664=_0x51a33f['folderPath']?_0x19a043[_0x2e2e7c(0x1b0)](_0x51a33f['folderPath']):undefined;let _0xd2cb07;const _0x4c4f92={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x493835=_0x51a33f[_0x2e2e7c(0x198)];if(_0x51a33f['yamlConfig'][_0x2e2e7c(0x133)]){const _0x105ab3=createSegmentIdResolver(_0x3f3279['segmentNameToId'],_0x51a33f['yamlConfig'][_0x2e2e7c(0x168)]),_0x5b0c71=await resolveRuleSegmentIds(_0x51a33f['yamlConfig'][_0x2e2e7c(0x133)],_0x105ab3);_0x493835={..._0x51a33f[_0x2e2e7c(0x198)],'rule':_0x5b0c71};}try{if(_0x51a33f[_0x2e2e7c(0xff)]){_0x2af25c[_0x2e2e7c(0x1c4)]?.({'type':_0x2e2e7c(0x178),'name':_0x51a33f['yamlConfig']['name']});const _0x3e4866=_0x598366(_0x493835,_0x6a4664),_0x255101=await _0x2af25c['withProgress'](_0x2e2e7c(0x13e)+_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)]+_0x2e2e7c(0x158),()=>_0x234249[_0x2e2e7c(0x183)][_0x2e2e7c(0x18d)](_0x322182[_0x2e2e7c(0x130)],_0x3e4866));_0xd2cb07=_0x255101[_0x2e2e7c(0x110)]['id'],_0x3f3279[_0x2e2e7c(0x19a)]['set'](_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)],_0xd2cb07),_0x4c4f92[_0x2e2e7c(0xfd)]={'name':_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)],'id':_0xd2cb07},_0x2af25c[_0x2e2e7c(0x1c4)]?.({'type':_0x2e2e7c(0xe9),'name':_0x51a33f[_0x2e2e7c(0x198)]['name'],'segmentId':_0xd2cb07}),_0x2af25c['logSuccess']?.(_0x2e2e7c(0x190)+_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)]+'\x27'),_0x4c4f92['created']=0x1;}else{if(_0x51a33f['hasChanges']){_0x2af25c[_0x2e2e7c(0x1c4)]?.({'type':_0x2e2e7c(0x176),'name':_0x51a33f[_0x2e2e7c(0x198)]['name']});const _0x53c4f2=_0x1758c2(_0x493835);_0x6a4664!==_0x51a33f[_0x2e2e7c(0xed)]?.['segmentFolderId']&&(_0x53c4f2['segmentFolderId']=_0x6a4664?parseInt(_0x6a4664,0xa):undefined),await _0x2af25c[_0x2e2e7c(0x118)]('Updating\x20segment\x20\x27'+_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)]+'\x27...',()=>_0x234249[_0x2e2e7c(0x183)][_0x2e2e7c(0xf7)](_0x322182['parentId'],_0x51a33f[_0x2e2e7c(0xed)]['id'],_0x53c4f2)),_0xd2cb07=_0x51a33f['existingSegment']['id'],_0x2af25c[_0x2e2e7c(0x1c4)]?.({'type':_0x2e2e7c(0x197),'name':_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)]}),_0x2af25c[_0x2e2e7c(0x162)]?.(_0x2e2e7c(0xf4)+_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)]+'\x27'),_0x4c4f92[_0x2e2e7c(0x170)]=0x1;}else _0xd2cb07=_0x51a33f[_0x2e2e7c(0xed)]['id'];}}catch(_0x125d0c){const _0x21c072=isHttp400Error(_0x125d0c),_0x379258=_0x21c072?ErrorCode[_0x2e2e7c(0x1d4)]:ErrorCode[_0x2e2e7c(0x1c3)],_0x5dc70e=getErrorMessage(_0x125d0c);throw new SDKError(_0x379258,_0x2e2e7c(0xdf)+(_0x51a33f[_0x2e2e7c(0xff)]?_0x2e2e7c(0x12c):'update')+_0x2e2e7c(0x1bb)+_0x51a33f[_0x2e2e7c(0x1b3)]+_0x2e2e7c(0x10a)+_0x5dc70e,_0x125d0c);}try{const _0x309c0a=await syncActivationsForSegment(_0x234249,_0x322182[_0x2e2e7c(0x130)],_0xd2cb07,_0x51a33f[_0x2e2e7c(0x198)]['name'],_0x51a33f['activationActions'],_0x2af25c,_0x51a33f[_0x2e2e7c(0x1b3)]);_0x4c4f92[_0x2e2e7c(0x113)]=_0x309c0a;}catch(_0x31a0a1){if(_0x31a0a1 instanceof SDKError)throw _0x31a0a1;throw new SDKError(ErrorCode[_0x2e2e7c(0x1d7)],_0x2e2e7c(0x195)+_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)]+'\x27\x20from\x20file:\x20'+_0x51a33f[_0x2e2e7c(0x1b3)]+_0x2e2e7c(0x10a)+getErrorMessage(_0x31a0a1),_0x31a0a1);}return _0x4c4f92;},_0x19dc02=await batchAsync(_0x554a9a,_0x2fb836,_0x54228f),_0x5618c3={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x50ad63 of _0x19dc02){_0x5618c3['created']+=_0x50ad63['created'],_0x5618c3[_0x2203a6(0x170)]+=_0x50ad63[_0x2203a6(0x170)],_0x50ad63[_0x2203a6(0xfd)]&&_0x5618c3[_0x2203a6(0x159)]['set'](_0x50ad63[_0x2203a6(0xfd)]['name'],_0x50ad63[_0x2203a6(0xfd)]['id']),_0x5618c3[_0x2203a6(0x113)][_0x2203a6(0x18b)]+=_0x50ad63[_0x2203a6(0x113)][_0x2203a6(0x18b)],_0x5618c3[_0x2203a6(0x113)][_0x2203a6(0x170)]+=_0x50ad63[_0x2203a6(0x113)][_0x2203a6(0x170)],_0x5618c3[_0x2203a6(0x113)][_0x2203a6(0x156)]+=_0x50ad63[_0x2203a6(0x113)][_0x2203a6(0x156)];}return _0x5618c3;}async function syncActivationsForSegment(_0xe31ec7,_0x3e7226,_0x389192,_0x53a3fe,_0x13465a,_0x1c3b2a,_0x445bbd){const _0xffc15f=a175_0x2205f5,_0x16e77b={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x140772 of _0x13465a){try{if(_0x140772[_0xffc15f(0xd3)]===_0xffc15f(0x12c)&&_0x140772['validatedRequest'])_0x1c3b2a[_0xffc15f(0x1c4)]?.({'type':'activation_creating','segmentName':_0x53a3fe,'activationName':_0x140772[_0xffc15f(0x168)]}),await _0x1c3b2a[_0xffc15f(0x118)]('Creating\x20activation\x20\x27'+_0x140772[_0xffc15f(0x168)]+_0xffc15f(0x158),()=>_0xe31ec7[_0xffc15f(0x183)]['createActivation'](_0x3e7226,_0x389192,_0x140772[_0xffc15f(0xf3)])),_0x1c3b2a[_0xffc15f(0x1c4)]?.({'type':_0xffc15f(0x11b),'segmentName':_0x53a3fe,'activationName':_0x140772[_0xffc15f(0x168)]}),_0x1c3b2a[_0xffc15f(0x162)]?.(_0xffc15f(0xe7)+_0x140772[_0xffc15f(0x168)]+'\x27'),_0x16e77b['created']++;else{if(_0x140772['type']==='update'&&_0x140772[_0xffc15f(0xf3)]&&_0x140772[_0xffc15f(0x107)])_0x1c3b2a[_0xffc15f(0x1c4)]?.({'type':_0xffc15f(0x15a),'segmentName':_0x53a3fe,'activationName':_0x140772[_0xffc15f(0x168)]}),await _0x1c3b2a[_0xffc15f(0x118)](_0xffc15f(0x171)+_0x140772[_0xffc15f(0x168)]+_0xffc15f(0x158),()=>_0xe31ec7['segment']['updateActivation'](_0x3e7226,_0x389192,_0x140772['existingActivation']['id'],_0x140772[_0xffc15f(0xf3)])),_0x1c3b2a[_0xffc15f(0x1c4)]?.({'type':'activation_updated','segmentName':_0x53a3fe,'activationName':_0x140772['name']}),_0x1c3b2a[_0xffc15f(0x162)]?.(_0xffc15f(0x15f)+_0x140772[_0xffc15f(0x168)]+'\x27'),_0x16e77b[_0xffc15f(0x170)]++;else _0x140772[_0xffc15f(0xd3)]===_0xffc15f(0x161)&&_0x140772[_0xffc15f(0x107)]&&(_0x1c3b2a[_0xffc15f(0x1c4)]?.({'type':_0xffc15f(0x1ad),'segmentName':_0x53a3fe,'activationName':_0x140772[_0xffc15f(0x168)]}),await _0x1c3b2a['withProgress'](_0xffc15f(0x19e)+_0x140772[_0xffc15f(0x168)]+_0xffc15f(0x158),()=>_0xe31ec7[_0xffc15f(0x183)][_0xffc15f(0xd4)](_0x3e7226,_0x389192,_0x140772[_0xffc15f(0x107)]['id'])),_0x1c3b2a[_0xffc15f(0x1c4)]?.({'type':'activation_deleted','segmentName':_0x53a3fe,'activationName':_0x140772[_0xffc15f(0x168)]}),_0x1c3b2a[_0xffc15f(0x185)]?.(_0xffc15f(0x194)+_0x140772[_0xffc15f(0x168)]+'\x27'),_0x16e77b['deleted']++);}}catch(_0x4a6f62){const _0x151bb2=isHttp400Error(_0x4a6f62),_0x4f139a=_0x151bb2?ErrorCode[_0xffc15f(0x175)]:ErrorCode[_0xffc15f(0x1d7)],_0x324634=getErrorMessage(_0x4a6f62);throw new SDKError(_0x4f139a,_0xffc15f(0xdf)+_0x140772[_0xffc15f(0xd3)]+_0xffc15f(0x1c5)+_0x140772[_0xffc15f(0x168)]+_0xffc15f(0x18a)+_0x445bbd+_0xffc15f(0x10a)+_0x324634,_0x4a6f62);}}return _0x16e77b;}export async function executePushFolders(_0x397ce0,_0x3e157a,_0x11691f,_0x37084c,_0x53ca75){const _0x56c24a=a175_0x2205f5,_0x381b9a=new Map(_0x11691f),_0xc3ed52=sortFoldersByDepth(_0x3e157a);for(const _0x51515c of _0xc3ed52){const _0x480a62=_0x51515c[_0x56c24a(0x148)]('/'),_0x417301=_0x480a62[_0x480a62[_0x56c24a(0xe4)]-0x1],_0x481c3b=_0x480a62[_0x56c24a(0x1d1)](0x0,-0x1)['join']('/'),_0x313757=_0x381b9a[_0x56c24a(0x1b0)](_0x481c3b);_0x53ca75[_0x56c24a(0x1c4)]?.({'type':'folder_creating','folder':_0x51515c});const _0x2012a6={'name':_0x417301,'parentFolderId':_0x313757},_0x5b02b6=await _0x53ca75[_0x56c24a(0x118)](_0x56c24a(0x11e)+_0x51515c+_0x56c24a(0x158),()=>_0x397ce0[_0x56c24a(0x183)][_0x56c24a(0x1d6)](_0x37084c[_0x56c24a(0x130)],_0x2012a6));_0x381b9a[_0x56c24a(0x150)](_0x51515c,_0x5b02b6[_0x56c24a(0x110)]['id']),_0x53ca75['onProgress']?.({'type':'folder_created','folder':_0x51515c,'folderId':_0x5b02b6['data']['id']}),_0x53ca75[_0x56c24a(0x143)]?.('Created\x20folder\x20\x27'+_0x51515c+'\x27');}return _0x381b9a;}export async function executePushSegmentDeletions(_0x3d895e,_0xe1aa63,_0x1e3990){const _0x1e11ad=a175_0x2205f5;if(_0xe1aa63[_0x1e11ad(0xe4)]===0x0)return 0x0;const {batchAsync:_0x2ae4a5}=await import(_0x1e11ad(0x1ae)),_0x10315d=0x5,_0x25b8ad=await _0x2ae4a5(_0xe1aa63,async _0x43c49a=>{const _0x4c2367=_0x1e11ad;return _0x1e3990['onProgress']?.({'type':_0x4c2367(0x17e),'name':_0x43c49a[_0x4c2367(0x168)]}),await _0x3d895e[_0x4c2367(0x183)][_0x4c2367(0x19f)](_0x43c49a['id']),_0x1e3990[_0x4c2367(0x1c4)]?.({'type':_0x4c2367(0x1da),'name':_0x43c49a['name']}),_0x1e3990[_0x4c2367(0x185)]?.(_0x4c2367(0xfb)+_0x43c49a[_0x4c2367(0x168)]+'\x27'),0x1;},_0x10315d);return _0x25b8ad[_0x1e11ad(0x146)]((_0x357151,_0x22a136)=>_0x357151+_0x22a136,0x0);}export async function executePushJourneys(_0x4050a7,_0x391df7,_0x1008f6,_0xa719f6,_0x3691ee){const _0x41dd04=a175_0x2205f5,{journeyDefToRequest:_0x235123}=await import(_0x41dd04(0x10d)),{activationDefToCreateRequest:_0xa0d197,yamlRuleToApi:_0x2c2653,validateSegmentRule:_0x313b86}=await import(_0x41dd04(0x16d)),_0x3b9093={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4e4458=new Map(_0x1008f6['segmentNameToId']),_0x36fd79=0x5;for(let _0x144879=0x0;_0x144879<_0x391df7[_0x41dd04(0xe4)];_0x144879+=_0x36fd79){const _0x2536a9=_0x391df7[_0x41dd04(0x1d1)](_0x144879,_0x144879+_0x36fd79),_0x100517=await Promise['all'](_0x2536a9[_0x41dd04(0x12e)](async _0x52e97e=>{const _0x4dc0d9=_0x41dd04;if(!_0x52e97e['isNew']&&!_0x52e97e['hasChanges'])return{'action':_0x4dc0d9(0x17f),'name':_0x52e97e[_0x4dc0d9(0x198)][_0x4dc0d9(0x168)],'journeyId':_0x52e97e[_0x4dc0d9(0x16f)]?.['id']};const _0x348912=_0x52e97e[_0x4dc0d9(0x187)]?_0x1008f6[_0x4dc0d9(0xdd)][_0x4dc0d9(0x1b0)](_0x52e97e[_0x4dc0d9(0x187)]):undefined;_0x3691ee['onProgress']?.({'type':_0x52e97e['isNew']?_0x4dc0d9(0x196):_0x4dc0d9(0x1bd),'name':_0x52e97e['yamlConfig'][_0x4dc0d9(0x168)]});try{const _0x12a92c=await executeSingleJourneyPush(_0x4050a7,_0x52e97e,{..._0x1008f6,'segmentNameToId':_0x4e4458},{'parentId':_0xa719f6['parentId'],'rootFolderId':_0xa719f6[_0x4dc0d9(0xd9)],'folderId':_0x348912,'verbose':_0xa719f6[_0x4dc0d9(0x129)]},_0x3691ee,{'journeyDefToRequest':_0x235123,'activationDefToCreateRequest':_0xa0d197,'yamlRuleToApi':_0x2c2653,'validateSegmentRule':_0x313b86});for(const [_0xb9d96b,_0x5456b0]of _0x12a92c['embeddedSegmentNameToId']){_0x4e4458[_0x4dc0d9(0x150)](_0xb9d96b,_0x5456b0),_0x3b9093['embeddedSegmentNameToId'][_0x4dc0d9(0x150)](_0xb9d96b,_0x5456b0);}if(_0x12a92c[_0x4dc0d9(0x124)]===_0x4dc0d9(0x18b))_0x3691ee[_0x4dc0d9(0x1c4)]?.({'type':_0x4dc0d9(0x117),'name':_0x52e97e[_0x4dc0d9(0x198)][_0x4dc0d9(0x168)],'journeyId':_0x12a92c['journeyId']}),_0x3691ee[_0x4dc0d9(0x162)]?.(_0x4dc0d9(0x1d0)+_0x52e97e['yamlConfig'][_0x4dc0d9(0x168)]+'\x27'),_0x3b9093[_0x4dc0d9(0x18b)]++;else _0x12a92c[_0x4dc0d9(0x124)]===_0x4dc0d9(0x170)&&(_0x3691ee[_0x4dc0d9(0x1c4)]?.({'type':_0x4dc0d9(0x16a),'name':_0x52e97e['yamlConfig'][_0x4dc0d9(0x168)]}),_0x3691ee[_0x4dc0d9(0x162)]?.(_0x4dc0d9(0x134)+_0x52e97e[_0x4dc0d9(0x198)]['name']+'\x27'),_0x3b9093['updated']++);return{'action':_0x12a92c['action'],'name':_0x52e97e[_0x4dc0d9(0x198)][_0x4dc0d9(0x168)],'journeyId':_0x12a92c['journeyId']};}catch(_0x1f0476){const _0x46d923=isHttp400Error(_0x1f0476),_0x1d4f2b=_0x46d923?ErrorCode[_0x4dc0d9(0x14d)]:ErrorCode[_0x4dc0d9(0x1d2)],_0x5e5cde=getErrorMessage(_0x1f0476);throw new SDKError(_0x1d4f2b,_0x4dc0d9(0xdf)+(_0x52e97e['isNew']?_0x4dc0d9(0x12c):_0x4dc0d9(0x1c1))+'\x20journey\x20from\x20file:\x20'+_0x52e97e[_0x4dc0d9(0x1b3)]+'\x0a\x20\x20'+_0x5e5cde,_0x1f0476);}}));_0x3b9093[_0x41dd04(0x177)][_0x41dd04(0x151)](..._0x100517);}return _0x3b9093;}async function matchExistingJourneySegments(_0x436dcf,_0x7a576a,_0x877c42,_0x3756c9,_0x1cb2b4){const _0x8412dc=a175_0x2205f5;if(!_0x7a576a[_0x8412dc(0x16f)]||!_0x7a576a['yamlConfig']['segments'])return;const _0x5651fc=new Map(),_0x555849=new Set();for(const _0x1448b5 of Object[_0x8412dc(0xd7)](_0x7a576a[_0x8412dc(0x198)][_0x8412dc(0x179)])){const _0xd8f7e=generateDeterministicJourneySegmentName(_0x7a576a[_0x8412dc(0x198)][_0x8412dc(0x168)],_0x1448b5);_0x5651fc[_0x8412dc(0x150)](_0xd8f7e,_0x1448b5),_0x555849[_0x8412dc(0x140)](_0x1448b5);}const _0xe20592=[],_0x4a15ae=collectSegmentIdsFromJourneyApi(_0x7a576a['existingJourney']);for(const _0x3b4ecf of _0x4a15ae){const _0x48ab34=await fetchSegment(_0x436dcf,_0x877c42,_0x3b4ecf,_0x3756c9);if(!_0x48ab34?.[_0x8412dc(0x168)])continue;const _0x5bcca2=_0x5651fc[_0x8412dc(0x1b0)](_0x48ab34['name']);_0x5bcca2?(_0x1cb2b4[_0x8412dc(0x150)](_0x5bcca2,_0x3b4ecf),_0x555849[_0x8412dc(0x161)](_0x5bcca2)):_0xe20592[_0x8412dc(0x151)]({'id':_0x3b4ecf,'seg':_0x48ab34});}if(_0x555849[_0x8412dc(0xf6)]>0x0&&_0xe20592['length']>0x0){const {localExpandedRuleToNames:_0x3b0d69}=buildLocalExpandedRuleMappings(_0x7a576a[_0x8412dc(0x198)]),_0x5ba8bc=new Map();for(const {id:_0x4df9de,seg:_0x1b2a3e}of _0xe20592){if(_0x1b2a3e[_0x8412dc(0x133)]){const _0x38558a=apiRuleToYaml(_0x1b2a3e[_0x8412dc(0x133)]);_0x5ba8bc[_0x8412dc(0x150)](_0x4df9de,_0x38558a);}}for(const {id:_0x1b02d1,seg:_0x31c1cc}of _0xe20592){if(!_0x31c1cc[_0x8412dc(0x133)])continue;const _0x1c70cf=_0x5ba8bc[_0x8412dc(0x1b0)](_0x1b02d1);if(!_0x1c70cf)continue;const _0x9c23d=serializeExpandedRule(_0x1c70cf,_0x5ba8bc),_0x5bd899=_0x3b0d69[_0x8412dc(0x1b0)](_0x9c23d);if(_0x5bd899){const _0x42100c=_0x5bd899['find'](_0x5977fc=>_0x555849[_0x8412dc(0x1b9)](_0x5977fc));_0x42100c&&(_0x1cb2b4[_0x8412dc(0x150)](_0x42100c,_0x1b02d1),_0x555849[_0x8412dc(0x161)](_0x42100c),logger[_0x8412dc(0x1a3)]('Matched\x20server\x20segment\x20\x27'+_0x31c1cc[_0x8412dc(0x168)]+_0x8412dc(0x136)+_0x42100c+_0x8412dc(0x13a)));}}}}function a175_0x3619(_0x418369,_0x3d3c2e){_0x418369=_0x418369-0xd2;const _0x9f8a81=a175_0x9f8a();let _0x36192d=_0x9f8a81[_0x418369];return _0x36192d;}async function executeSingleJourneyPush(_0x187f6b,_0xe45ba1,_0x27b000,_0x58ac7d,_0x4f0187,_0x250753){const _0x191a25=a175_0x2205f5,{journeyDefToRequest:_0x143dc2,activationDefToCreateRequest:_0x40965f,yamlRuleToApi:_0xc83fbe,validateSegmentRule:_0x5a9ee6}=_0x250753,_0x3d80e9=new Map(),_0x39fb64=new Map();recoverSegmentIdsFromPushRecovery(_0xe45ba1,_0x3d80e9,_0x27b000[_0x191a25(0x19a)]);const _0x2b0313=new Map(),_0x117538=new Map(),_0x490ca1=new Map();let _0x2da08d;const _0x5cf248=async()=>{const _0x584002=_0x191a25;if(_0x2da08d)return;_0x2da08d=new Map();if(!_0xe45ba1[_0x584002(0x16f)])return;const _0x2b6f98=await _0x187f6b[_0x584002(0x16b)][_0x584002(0x14f)](_0xe45ba1[_0x584002(0x16f)]['id']);for(const _0x17d2fd of _0x2b6f98){const _0x2c53ca=journeyActivationStepToYaml(_0x17d2fd,_0x27b000[_0x584002(0x1a2)],_0x27b000[_0x584002(0x1ba)]),_0x40a38d=activationSignature(_0x2c53ca);!_0x2da08d[_0x584002(0x1b9)](_0x40a38d)&&_0x2da08d[_0x584002(0x150)](_0x40a38d,_0x17d2fd['id']),_0x2c53ca['name']&&_0x39fb64[_0x584002(0x150)](_0x2c53ca[_0x584002(0x168)],_0x17d2fd['id']);}};await matchExistingJourneySegments(_0x187f6b,_0xe45ba1,_0x58ac7d['parentId'],_0x27b000[_0x191a25(0x165)],_0x27b000[_0x191a25(0x19a)]);const _0xf08e49={'resolveSegmentId':async _0x2ae31f=>{const _0x3cce2c=_0x191a25,_0x586def=_0x27b000[_0x3cce2c(0x19a)][_0x3cce2c(0x1b0)](_0x2ae31f);if(!_0x586def)throw new SDKError(ErrorCode[_0x3cce2c(0x192)],_0x3cce2c(0x14e)+_0x2ae31f+'\x20(referenced\x20in\x20journey\x20'+_0xe45ba1[_0x3cce2c(0x198)][_0x3cce2c(0x168)]+')');return _0x586def;},'resolveEmbeddedSegmentId':async(_0x46431c,_0x2920a2)=>{const _0x4d81d3=_0x191a25,_0x5b3aa4=_0x27b000[_0x4d81d3(0x19a)][_0x4d81d3(0x1b0)](_0x46431c);if(_0x5b3aa4)return _0x5b3aa4;const _0x26db24=_0x27b000['existingSegments']['find'](_0x2653bb=>_0x2653bb[_0x4d81d3(0x168)]===_0x46431c);if(_0x26db24)return _0x27b000['segmentNameToId'][_0x4d81d3(0x150)](_0x46431c,_0x26db24['id']),_0x26db24['id'];if(_0xe45ba1[_0x4d81d3(0xff)]){const {stageName:_0x1f9dc6,criteriaName:_0x394f36}=findSegmentCriteriaLocation(_0xe45ba1[_0x4d81d3(0x198)],_0x46431c);return _0x5a9ee6(_0x46431c,_0x2920a2[_0x4d81d3(0x133)]),_0x117538[_0x4d81d3(0x150)](_0x46431c,{'definition':_0x2920a2,'stageName':_0x1f9dc6,'criteriaName':_0x394f36}),createPendingSegmentId(_0x46431c);}const _0x3e23df=_0xe45ba1[_0x4d81d3(0x16f)]?.['id'];if(!_0x3e23df)throw new SDKError(ErrorCode[_0x4d81d3(0x1c7)],_0x4d81d3(0x17d));const _0x3cb161=_0x2b0313[_0x4d81d3(0x1b0)](_0x46431c);if(_0x3cb161)return _0x3cb161;const _0x4dc41a=((async()=>{const _0x540512=_0x4d81d3;_0x5a9ee6(_0x46431c,_0x2920a2[_0x540512(0x133)]);const _0x162b75=generateDeterministicJourneySegmentName(_0xe45ba1[_0x540512(0x198)]['name'],_0x46431c),_0x7e1819=_0x27b000[_0x540512(0x165)][_0x540512(0x14a)](_0x3bc7e9=>_0x3bc7e9[_0x540512(0x168)]===_0x162b75),_0x292c53=createSegmentIdResolver(_0x27b000[_0x540512(0x19a)],_0x46431c),_0x5cb33c=await resolveRuleSegmentIds(_0x2920a2[_0x540512(0x133)],_0x292c53);let _0x5872ba;return _0x7e1819?(await _0x187f6b[_0x540512(0x183)][_0x540512(0xf7)](_0x58ac7d['parentId'],_0x7e1819['id'],{'description':_0x2920a2[_0x540512(0x135)]||'Entry\x20criteria:\x20'+_0x46431c,'rule':_0xc83fbe(_0x5cb33c),'countPopulation':!![]}),_0x5872ba=_0x7e1819['id'],saveSegmentToPushRecovery(_0xe45ba1[_0x540512(0x1b3)],_0xe45ba1[_0x540512(0x198)][_0x540512(0x168)],_0x46431c,{'segmentId':_0x5872ba,'uniqueServerName':_0x162b75,'createdAt':new Date()[_0x540512(0x1a4)]()})):_0x5872ba=await createOrRecoverEmbeddedSegment(_0x187f6b,_0xe45ba1,{'localName':_0x46431c,'uniqueSegmentName':_0x162b75,'description':_0x2920a2['description']||_0x540512(0x101)+_0x46431c,'journeyId':_0x3e23df,'resolvedRule':_0x5cb33c,'parentId':_0x58ac7d[_0x540512(0x130)],'folderId':_0x58ac7d[_0x540512(0xd9)]||''},_0xc83fbe),_0x27b000[_0x540512(0x19a)][_0x540512(0x150)](_0x46431c,_0x5872ba),_0x3d80e9[_0x540512(0x150)](_0x46431c,_0x5872ba),_0x5872ba;})());_0x2b0313['set'](_0x46431c,_0x4dc41a);try{return await _0x4dc41a;}finally{_0x2b0313['delete'](_0x46431c);}},'resolveActivationId':async _0x341974=>{const _0x2670cd=_0x191a25,_0x458939=_0x39fb64[_0x2670cd(0x1b0)](_0x341974);if(_0x458939)return _0x458939;if(_0xe45ba1[_0x2670cd(0x16f)]){await _0x5cf248();const _0x1bca01=_0x39fb64[_0x2670cd(0x1b0)](_0x341974);if(_0x1bca01)return _0x1bca01;}throw new SDKError(ErrorCode[_0x2670cd(0x11a)],_0x2670cd(0x11c)+_0x341974+_0x2670cd(0x1ab)+_0xe45ba1[_0x2670cd(0x198)][_0x2670cd(0x168)]+_0x2670cd(0x1b5)+_0x2670cd(0x16e));},'resolveEmbeddedActivationId':async(_0x37aabe,_0x29e937)=>{const _0x3c0c7e=_0x191a25,_0x3f1c88=_0x39fb64[_0x3c0c7e(0x1b0)](_0x37aabe);if(_0x3f1c88)return _0x3f1c88;if(_0xe45ba1['isNew'])return _0x490ca1[_0x3c0c7e(0x150)](_0x37aabe,_0x29e937),createPendingActivationId(_0x37aabe);if(_0xe45ba1[_0x3c0c7e(0x16f)]){await _0x5cf248();const _0x2c7de2=_0x39fb64['get'](_0x29e937[_0x3c0c7e(0x168)]);if(_0x2c7de2)return _0x39fb64[_0x3c0c7e(0x150)](_0x37aabe,_0x2c7de2),_0x2c7de2;const _0x2443df=activationSignature(_0x29e937),_0x5edcc3=_0x2da08d?.[_0x3c0c7e(0x1b0)](_0x2443df);if(_0x5edcc3)return _0x39fb64[_0x3c0c7e(0x150)](_0x37aabe,_0x5edcc3),_0x5edcc3;const _0x658dee=await _0x40965f(_0x29e937,_0x27b000['activationContext']),_0x3fa191={..._0x658dee,..._0x29e937['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x29e937[_0x3c0c7e(0x10e)]}},_0x126f95=await _0x187f6b[_0x3c0c7e(0x16b)][_0x3c0c7e(0x14c)](_0xe45ba1[_0x3c0c7e(0x16f)]['id'],_0x3fa191);return _0x39fb64[_0x3c0c7e(0x150)](_0x37aabe,_0x126f95['id']),_0x126f95['id'];}throw new SDKError(ErrorCode[_0x3c0c7e(0x1c7)],_0x3c0c7e(0x11f));},'resolveJourneyId':async _0x3014c3=>{const _0x448d79=_0x191a25;try{return await _0x187f6b[_0x448d79(0x16b)]['resolveJourneyId'](_0x58ac7d['parentId'],_0x3014c3);}catch(_0x3f14aa){throw new SDKError(ErrorCode['NOT_FOUND'],_0x448d79(0xfa)+_0x3014c3+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0xe45ba1[_0x448d79(0x198)][_0x448d79(0x168)]+'\x27)',_0x3f14aa);}},'resolveStageId':async(_0x17aa40,_0x13fa99)=>{const _0x576cf9=_0x191a25,_0x1dc6d9=await _0x187f6b[_0x576cf9(0x16b)][_0x576cf9(0xda)](_0x17aa40),_0x1df5a8=_0x1dc6d9[_0x576cf9(0x1c9)][_0x576cf9(0x1be)][_0x576cf9(0x14a)](_0xb090de=>_0xb090de[_0x576cf9(0x168)][_0x576cf9(0xeb)]()===_0x13fa99['toLowerCase']());if(!_0x1df5a8?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x576cf9(0x1c6)+_0x13fa99+_0x576cf9(0x1d9)+(_0x1dc6d9[_0x576cf9(0x1c9)][_0x576cf9(0x174)]||_0x1dc6d9['attributes'][_0x576cf9(0x168)])+'\x27');return _0x1df5a8['id'];}},_0x290224=await _0x143dc2(_0xe45ba1[_0x191a25(0x198)],_0x58ac7d[_0x191a25(0x130)],_0xf08e49),_0xb95d75=_0x58ac7d[_0x191a25(0x104)]||_0x58ac7d[_0x191a25(0xd9)];_0xb95d75&&(_0x290224[_0x191a25(0x184)]={'parentFolder':{'data':{'id':_0xb95d75,'type':_0x191a25(0x15c)}}});if(_0xe45ba1[_0x191a25(0xff)]){if(_0x117538[_0x191a25(0xf6)]>0x0||_0x490ca1['size']>0x0)return await executeThreeStepJourneyCreate(_0x187f6b,_0xe45ba1,_0x290224,{'pendingEmbeddedSegments':_0x117538,'pendingEmbeddedActivations':_0x490ca1,'embeddedSegmentNameToId':_0x3d80e9,'journeyActivationNameToId':_0x39fb64},{..._0x58ac7d,'effectiveFolderId':_0xb95d75},_0x27b000,_0x4f0187,_0x250753);else{ensureJourneyDefaults(_0x290224[_0x191a25(0x1c9)]);const _0x2c3ad9=await _0x187f6b[_0x191a25(0x16b)][_0x191a25(0x12c)](_0x290224);return deletePushRecovery(_0xe45ba1['absolutePath']),{'action':'created','journeyId':_0x2c3ad9['id'],'embeddedSegmentNameToId':_0x3d80e9};}}else{if(_0xe45ba1[_0x191a25(0x1b1)]&&_0xe45ba1[_0x191a25(0x16f)]){_0x290224['id']=_0xe45ba1[_0x191a25(0x16f)]['id'];const _0x2e5605=_0x290224[_0x191a25(0x1c9)];_0xe45ba1[_0x191a25(0x16f)][_0x191a25(0x1c9)]?.[_0x191a25(0x174)]&&(_0x2e5605[_0x191a25(0x174)]=_0xe45ba1[_0x191a25(0x16f)][_0x191a25(0x1c9)]['journeyBundleName']);const _0x1d2fea=_0xe45ba1['existingJourney']['attributes']?.[_0x191a25(0x1be)];return _0x1d2fea&&_0x290224['attributes'][_0x191a25(0x1be)]&&injectExistingStageIds(_0x290224[_0x191a25(0x1c9)][_0x191a25(0x1be)],_0x1d2fea),ensureJourneyDefaults(_0x2e5605),await _0x187f6b['journey'][_0x191a25(0x1c1)](_0xe45ba1[_0x191a25(0x16f)]['id'],_0x290224),deletePushRecovery(_0xe45ba1[_0x191a25(0x1b3)]),{'action':_0x191a25(0x170),'journeyId':_0xe45ba1['existingJourney']['id'],'embeddedSegmentNameToId':_0x3d80e9};}}return deletePushRecovery(_0xe45ba1[_0x191a25(0x1b3)]),{'action':_0x191a25(0x17f),'journeyId':_0xe45ba1[_0x191a25(0x16f)]?.['id'],'embeddedSegmentNameToId':_0x3d80e9};}function findSegmentCriteriaLocation(_0x385776,_0x4ea042){const _0x2d622b=a175_0x2205f5,_0x6a1e84=_0x385776[_0x2d622b(0x1cf)]||_0x385776[_0x2d622b(0x147)]?.[0x0]?.['stages']||[];let _0x513acc=_0x2d622b(0xde),_0x58b52c=_0x4ea042;const _0xae0031=_0x385776[_0x2d622b(0x166)]||_0x385776['journeys']?.[0x0]?.[_0x2d622b(0x166)];if(_0xae0031?.['segment']===_0x4ea042)return{'stageName':_0x2d622b(0x166),'criteriaName':_0xae0031['name']||_0x4ea042};_0x22c1f8:for(const _0x3b5d69 of _0x6a1e84){if(_0x3b5d69[_0x2d622b(0xfc)]?.[_0x2d622b(0x183)]===_0x4ea042){_0x513acc=_0x3b5d69[_0x2d622b(0x168)],_0x58b52c=_0x3b5d69[_0x2d622b(0xfc)]['name']||_0x4ea042;break;}if(_0x3b5d69['steps'])for(const _0xe56baa of _0x3b5d69[_0x2d622b(0xe0)]){if(_0xe56baa[_0x2d622b(0xd3)]===_0x2d622b(0x1a1)&&_0xe56baa[_0x2d622b(0x18e)]?.[_0x2d622b(0x14b)])for(const _0x2ea9d9 of _0xe56baa[_0x2d622b(0x18e)][_0x2d622b(0x14b)]){if(_0x2ea9d9[_0x2d622b(0x183)]===_0x4ea042){_0x513acc=_0x3b5d69[_0x2d622b(0x168)],_0x58b52c=_0x2ea9d9[_0x2d622b(0x168)]||_0x4ea042;break _0x22c1f8;}}}}return{'stageName':_0x513acc,'criteriaName':_0x58b52c};}async function executeThreeStepJourneyCreate(_0x8c9c27,_0x1fce2c,_0x28b069,_0x2791fa,_0x2f4282,_0x45a9b7,_0x7b9cb5,_0xa614b9){const _0x1d6d4d=a175_0x2205f5,{activationDefToCreateRequest:_0x5b3982,yamlRuleToApi:_0x5ecf60}=_0xa614b9,{pendingEmbeddedSegments:_0x25638c,pendingEmbeddedActivations:_0x494ff1,embeddedSegmentNameToId:_0x18d2cf}=_0x2791fa,_0x479ca2=JSON[_0x1d6d4d(0x189)](JSON[_0x1d6d4d(0x17b)](_0x28b069));ensureJourneyDefaults(_0x479ca2[_0x1d6d4d(0x1c9)]),stripPendingIds(_0x479ca2);const _0x2a7070=await _0x8c9c27['journey'][_0x1d6d4d(0x12c)](_0x479ca2),_0x23b332=_0x2a7070['id'],_0x1d6abe=new Map();for(const _0x16179c of _0x2a7070[_0x1d6d4d(0x1c9)][_0x1d6d4d(0x1be)]){_0x1d6abe[_0x1d6d4d(0x150)](_0x16179c[_0x1d6d4d(0x168)][_0x1d6d4d(0xeb)](),_0x16179c['id']);}recoverSegmentIdsFromPushRecovery(_0x1fce2c,_0x18d2cf,_0x45a9b7[_0x1d6d4d(0x19a)]);for(const [_0x466fa0,{definition:_0x12bb31}]of _0x25638c){if(_0x18d2cf[_0x1d6d4d(0x1b9)](_0x466fa0)){_0x7b9cb5[_0x1d6d4d(0x1c4)]?.({'type':_0x1d6d4d(0xd6),'journeyName':_0x1fce2c[_0x1d6d4d(0x198)][_0x1d6d4d(0x168)],'segmentName':_0x466fa0});continue;}const _0x2fbae3=generateDeterministicJourneySegmentName(_0x1fce2c[_0x1d6d4d(0x198)][_0x1d6d4d(0x168)],_0x466fa0);_0x7b9cb5[_0x1d6d4d(0x1c4)]?.({'type':_0x1d6d4d(0x1ca),'journeyName':_0x1fce2c[_0x1d6d4d(0x198)][_0x1d6d4d(0x168)],'segmentName':_0x466fa0});const _0x533766=createSegmentIdResolver(_0x45a9b7[_0x1d6d4d(0x19a)],_0x466fa0),_0x17b465=await resolveRuleSegmentIds(_0x12bb31[_0x1d6d4d(0x133)],_0x533766),_0x591a6a=await createOrRecoverEmbeddedSegment(_0x8c9c27,_0x1fce2c,{'localName':_0x466fa0,'uniqueSegmentName':_0x2fbae3,'description':_0x12bb31[_0x1d6d4d(0x135)]||_0x1d6d4d(0x101)+_0x466fa0,'journeyId':_0x23b332,'resolvedRule':_0x17b465,'parentId':_0x2f4282['parentId'],'folderId':_0x2f4282[_0x1d6d4d(0x1cd)]||''},_0x5ecf60);_0x18d2cf[_0x1d6d4d(0x150)](_0x466fa0,_0x591a6a),_0x45a9b7[_0x1d6d4d(0x19a)][_0x1d6d4d(0x150)](_0x466fa0,_0x591a6a),_0x7b9cb5[_0x1d6d4d(0x1c4)]?.({'type':_0x1d6d4d(0xd6),'journeyName':_0x1fce2c['yamlConfig']['name'],'segmentName':_0x466fa0});}const _0x1730a4=new Map();for(const [_0x383ce6,_0x667f4f]of _0x494ff1){_0x7b9cb5['onProgress']?.({'type':_0x1d6d4d(0xec),'journeyName':_0x1fce2c[_0x1d6d4d(0x198)]['name'],'activationName':_0x383ce6});const _0x387d67=await _0x5b3982(_0x667f4f,_0x45a9b7[_0x1d6d4d(0x1d5)]),_0x235c98={..._0x387d67,..._0x667f4f['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x667f4f[_0x1d6d4d(0x10e)]}},_0x269775=await _0x8c9c27[_0x1d6d4d(0x16b)][_0x1d6d4d(0x14c)](_0x23b332,_0x235c98);_0x1730a4['set'](_0x383ce6,_0x269775['id']),_0x2791fa[_0x1d6d4d(0xef)][_0x1d6d4d(0x150)](_0x383ce6,_0x269775['id']),_0x7b9cb5[_0x1d6d4d(0x1c4)]?.({'type':_0x1d6d4d(0x126),'journeyName':_0x1fce2c[_0x1d6d4d(0x198)][_0x1d6d4d(0x168)],'activationName':_0x383ce6});}const _0x74fefd=JSON[_0x1d6d4d(0x189)](JSON[_0x1d6d4d(0x17b)](_0x28b069));return _0x74fefd['id']=_0x23b332,ensureJourneyDefaults(_0x74fefd[_0x1d6d4d(0x1c9)]),resolvePendingIdsInRequest(_0x74fefd,_0x28b069,_0x1d6abe,_0x18d2cf,_0x1730a4,_0x7b9cb5),await _0x8c9c27[_0x1d6d4d(0x16b)][_0x1d6d4d(0x1c1)](_0x23b332,_0x74fefd),deletePushRecovery(_0x1fce2c[_0x1d6d4d(0x1b3)]),{'action':'created','journeyId':_0x23b332,'embeddedSegmentNameToId':_0x18d2cf};}export function stripWaitStepPendingIds(_0x562fab){const _0x37b090=a175_0x2205f5,_0x4639ea=_0x562fab['conditionSegmentId']&&isPendingSegmentId(_0x562fab[_0x37b090(0x122)]),_0x47c9f6=_0x562fab[_0x37b090(0xe5)]?.[_0x37b090(0x1db)](_0x4c9973=>_0x4c9973['segmentId']&&isPendingSegmentId(_0x4c9973[_0x37b090(0x1bc)]));(_0x4639ea||_0x47c9f6)&&(_0x562fab[_0x37b090(0xf0)]='Duration',_0x562fab['waitStep']=0x1,_0x562fab['waitStepUnit']='day',delete _0x562fab['conditionSegmentId'],delete _0x562fab[_0x37b090(0x1a6)],delete _0x562fab['conditionTimeoutUnit'],delete _0x562fab[_0x37b090(0xe5)]);}export function resolveWaitStepPendingIds(_0x9675fe,_0x3a9b30,_0x135842,_0x257fad){const _0x537055=a175_0x2205f5;if(_0x3a9b30[_0x537055(0x122)]&&isPendingSegmentId(_0x3a9b30[_0x537055(0x122)])){const _0x5f46ba=_0x135842(_0x3a9b30[_0x537055(0x122)],_0x537055(0x13b)+_0x257fad+_0x537055(0x106));_0x5f46ba&&(_0x9675fe[_0x537055(0xf0)]='Condition',_0x9675fe['conditionSegmentId']=_0x5f46ba,delete _0x9675fe[_0x537055(0x144)],delete _0x9675fe[_0x537055(0xf5)],_0x3a9b30['conditionTimeoutDuration']!==undefined&&(_0x9675fe[_0x537055(0x1a6)]=_0x3a9b30['conditionTimeoutDuration']),_0x3a9b30[_0x537055(0x131)]&&(_0x9675fe[_0x537055(0x131)]=_0x3a9b30[_0x537055(0x131)]));}if(_0x3a9b30['conditions']){const _0x2a6959=_0x3a9b30[_0x537055(0xe5)][_0x537055(0x1db)](_0x318d45=>_0x318d45['segmentId']&&isPendingSegmentId(_0x318d45[_0x537055(0x1bc)]));if(_0x2a6959){const _0x10f9a7=_0x3a9b30['conditions'][_0x537055(0x12e)](_0x58b756=>{const _0x319b6d=_0x537055;if(_0x58b756[_0x319b6d(0x1bc)]&&isPendingSegmentId(_0x58b756[_0x319b6d(0x1bc)])){const _0x3e3f92=_0x135842(_0x58b756[_0x319b6d(0x1bc)],'stage\x20\x27'+_0x257fad+_0x319b6d(0x106));return{..._0x58b756,'segmentId':_0x3e3f92||_0x58b756[_0x319b6d(0x1bc)]};}return{..._0x58b756};});_0x9675fe['waitStepType']=_0x537055(0x15b),_0x9675fe['conditions']=_0x10f9a7,delete _0x9675fe[_0x537055(0x144)],delete _0x9675fe['waitStepUnit'],delete _0x9675fe[_0x537055(0x122)],delete _0x9675fe['conditionTimeoutDuration'],delete _0x9675fe[_0x537055(0x131)];}}}function stripPendingIds(_0x3c456f){const _0x467918=a175_0x2205f5;_0x3c456f[_0x467918(0x1c9)]['goal']?.[_0x467918(0x1bc)]&&isPendingSegmentId(_0x3c456f[_0x467918(0x1c9)][_0x467918(0x166)][_0x467918(0x1bc)])&&delete _0x3c456f[_0x467918(0x1c9)][_0x467918(0x166)];for(const _0x4533d0 of _0x3c456f[_0x467918(0x1c9)][_0x467918(0x1be)]||[]){_0x4533d0[_0x467918(0x18c)]?.[_0x467918(0x1bc)]&&isPendingSegmentId(_0x4533d0[_0x467918(0x18c)][_0x467918(0x1bc)])&&delete _0x4533d0['entryCriteria'];_0x4533d0[_0x467918(0x186)]?.[_0x467918(0x1bc)]&&isPendingSegmentId(_0x4533d0[_0x467918(0x186)]['segmentId'])&&delete _0x4533d0[_0x467918(0x186)];_0x4533d0[_0x467918(0x164)]&&(_0x4533d0[_0x467918(0x164)]=_0x4533d0[_0x467918(0x164)][_0x467918(0xdc)](_0x1390d8=>!_0x1390d8[_0x467918(0x1bc)]||!isPendingSegmentId(_0x1390d8[_0x467918(0x1bc)])));if(_0x4533d0[_0x467918(0xe0)])for(const _0x4d6798 of Object[_0x467918(0xd7)](_0x4533d0[_0x467918(0xe0)])){const _0x5b87a6=_0x4533d0['steps'][_0x4d6798];_0x5b87a6[_0x467918(0xd3)]==='Activation'&&_0x5b87a6['journeyActivationStepId']&&isPendingActivationId(_0x5b87a6[_0x467918(0x145)])&&(_0x5b87a6[_0x467918(0x145)]='');if(_0x5b87a6[_0x467918(0xd3)]===_0x467918(0x12f)&&_0x5b87a6[_0x467918(0x14b)])for(const _0x31066a of _0x5b87a6[_0x467918(0x14b)]){_0x31066a[_0x467918(0x1bc)]&&isPendingSegmentId(_0x31066a[_0x467918(0x1bc)])&&(_0x31066a[_0x467918(0x1bc)]='');}_0x5b87a6[_0x467918(0xd3)]===_0x467918(0x188)&&stripWaitStepPendingIds(_0x5b87a6);}}}function resolvePendingIdsInRequest(_0x32a476,_0x303503,_0x5e69b8,_0x1ea504,_0x4dcc52,_0x23e25c){const _0x510f69=a175_0x2205f5,_0x18165e=(_0x193cc1,_0x3b19fd)=>{const _0x91e4d1=a175_0x3619;if(!isPendingSegmentId(_0x193cc1))return _0x193cc1;const _0x4be3cb=extractPendingSegmentName(_0x193cc1),_0x4fd121=_0x1ea504[_0x91e4d1(0x1b0)](_0x4be3cb);return!_0x4fd121&&_0x23e25c[_0x91e4d1(0x181)]?.(_0x91e4d1(0x1c2)+_0x4be3cb+'\x27\x20for\x20'+_0x3b19fd),_0x4fd121;};if(_0x32a476[_0x510f69(0x1c9)]['goal']?.['segmentId']&&isPendingSegmentId(_0x32a476[_0x510f69(0x1c9)]['goal']['segmentId'])){const _0x49c7b2=_0x18165e(_0x32a476[_0x510f69(0x1c9)][_0x510f69(0x166)][_0x510f69(0x1bc)],_0x510f69(0x172));_0x49c7b2&&(_0x32a476[_0x510f69(0x1c9)]['goal'][_0x510f69(0x1bc)]=_0x49c7b2);}for(const _0x1f53dc of _0x32a476[_0x510f69(0x1c9)][_0x510f69(0x1be)]||[]){const _0x8f7760=_0x5e69b8[_0x510f69(0x1b0)](_0x1f53dc[_0x510f69(0x168)]['toLowerCase']());_0x8f7760&&(_0x1f53dc['id']=_0x8f7760);if(_0x1f53dc[_0x510f69(0x18c)]?.[_0x510f69(0x1bc)]&&isPendingSegmentId(_0x1f53dc[_0x510f69(0x18c)][_0x510f69(0x1bc)])){const _0x9ea7fb=_0x18165e(_0x1f53dc[_0x510f69(0x18c)][_0x510f69(0x1bc)],_0x510f69(0x13b)+_0x1f53dc['name']+_0x510f69(0x142));_0x9ea7fb&&(_0x1f53dc['entryCriteria'][_0x510f69(0x1bc)]=_0x9ea7fb);}if(_0x1f53dc[_0x510f69(0x164)])for(const _0x377dad of _0x1f53dc[_0x510f69(0x164)]){if(_0x377dad[_0x510f69(0x1bc)]&&isPendingSegmentId(_0x377dad[_0x510f69(0x1bc)])){const _0x26c0c5=_0x18165e(_0x377dad[_0x510f69(0x1bc)],_0x510f69(0x13b)+_0x1f53dc[_0x510f69(0x168)]+_0x510f69(0x1c8));_0x26c0c5&&(_0x377dad['segmentId']=_0x26c0c5);}}if(_0x1f53dc[_0x510f69(0x186)]?.['segmentId']&&isPendingSegmentId(_0x1f53dc['milestone'][_0x510f69(0x1bc)])){const _0xd3edaf=_0x18165e(_0x1f53dc['milestone'][_0x510f69(0x1bc)],_0x510f69(0x13b)+_0x1f53dc[_0x510f69(0x168)]+_0x510f69(0x1a0));_0xd3edaf&&(_0x1f53dc[_0x510f69(0x186)][_0x510f69(0x1bc)]=_0xd3edaf);}if(_0x1f53dc['steps']){const _0x166f9b=_0x1e8600=>_0x303503[_0x510f69(0x1c9)][_0x510f69(0x1be)]?.[_0x510f69(0x14a)](_0x423c42=>_0x423c42['name'][_0x510f69(0xeb)]()===_0x1f53dc[_0x510f69(0x168)]['toLowerCase']())?.[_0x510f69(0xe0)]?.[_0x1e8600];for(const _0x3a6ca2 of Object[_0x510f69(0xd7)](_0x1f53dc[_0x510f69(0xe0)])){const _0x24591d=_0x1f53dc[_0x510f69(0xe0)][_0x3a6ca2],_0xdea7f7=_0x166f9b(_0x3a6ca2);if(_0x24591d['type']===_0x510f69(0x139)&&_0x24591d[_0x510f69(0x145)]&&(isPendingActivationId(_0x24591d[_0x510f69(0x145)])||_0x24591d[_0x510f69(0x145)]==='')){if(_0xdea7f7?.[_0x510f69(0x145)]&&isPendingActivationId(_0xdea7f7[_0x510f69(0x145)])){const _0x6a7f44=extractPendingActivationName(_0xdea7f7[_0x510f69(0x145)]),_0x20bc12=_0x4dcc52[_0x510f69(0x1b0)](_0x6a7f44);_0x20bc12&&(_0x24591d[_0x510f69(0x145)]=_0x20bc12);}}if(_0x24591d[_0x510f69(0xd3)]===_0x510f69(0x12f)&&_0x24591d[_0x510f69(0x14b)]&&_0xdea7f7?.[_0x510f69(0x14b)])for(let _0x3f35f4=0x0;_0x3f35f4<_0x24591d[_0x510f69(0x14b)][_0x510f69(0xe4)];_0x3f35f4++){const _0x40c6ff=_0x24591d['branches'][_0x3f35f4],_0x34b32d=_0xdea7f7[_0x510f69(0x14b)][_0x3f35f4];if(_0x34b32d?.['segmentId']&&isPendingSegmentId(_0x34b32d['segmentId'])){const _0x159dc6=_0x18165e(_0x34b32d['segmentId'],_0x510f69(0x13b)+_0x1f53dc[_0x510f69(0x168)]+_0x510f69(0x1af)+(_0x40c6ff[_0x510f69(0x168)]||_0x3f35f4)+'\x27');_0x159dc6&&(_0x40c6ff['segmentId']=_0x159dc6);}}_0x24591d[_0x510f69(0xd3)]===_0x510f69(0x188)&&_0xdea7f7?.[_0x510f69(0xd3)]===_0x510f69(0x188)&&resolveWaitStepPendingIds(_0x24591d,_0xdea7f7,_0x18165e,_0x1f53dc[_0x510f69(0x168)]);}}}}
@@ -1 +1 @@
1
- function a176_0x4b5d(){const _0x29d77a=['60715ZoUwkF','name','32268eGJCwt','parentFolderId','388526jCjmUu','3222882pvEdiB','1158WNAckO','2614997EXJKln','has','set','8DxrJAJ','get','709364HqgCLk','add','3330ZBQjfI'];a176_0x4b5d=function(){return _0x29d77a;};return a176_0x4b5d();}(function(_0x407c7d,_0x4c9e83){const _0x5ee325=a176_0x15c6,_0x408374=_0x407c7d();while(!![]){try{const _0xaceaba=parseInt(_0x5ee325(0x132))/0x1+parseInt(_0x5ee325(0x12d))/0x2*(parseInt(_0x5ee325(0x134))/0x3)+parseInt(_0x5ee325(0x12b))/0x4+parseInt(_0x5ee325(0x12e))/0x5+parseInt(_0x5ee325(0x130))/0x6+-parseInt(_0x5ee325(0x135))/0x7*(parseInt(_0x5ee325(0x138))/0x8)+-parseInt(_0x5ee325(0x133))/0x9;if(_0xaceaba===_0x4c9e83)break;else _0x408374['push'](_0x408374['shift']());}catch(_0x369515){_0x408374['push'](_0x408374['shift']());}}}(a176_0x4b5d,0x78b49));export function buildFolderIdToPathMap(_0x441310){const _0x62d073=a176_0x15c6,_0x3000fb=new Map(),_0x2460db=new Map();for(const _0x3936b6 of _0x441310){_0x2460db[_0x62d073(0x137)](_0x3936b6['id'],_0x3936b6);}const _0x3fc02e=new Set();for(const _0x86c702 of _0x441310){!_0x86c702[_0x62d073(0x131)]&&_0x3fc02e[_0x62d073(0x12c)](_0x86c702['id']);}function _0x2f8888(_0x123dbf){const _0x1309c9=_0x62d073;if(_0x3000fb[_0x1309c9(0x136)](_0x123dbf['id']))return _0x3000fb['get'](_0x123dbf['id']);if(_0x3fc02e[_0x1309c9(0x136)](_0x123dbf['id']))return _0x3000fb[_0x1309c9(0x137)](_0x123dbf['id'],''),'';if(_0x123dbf['parentFolderId']){const _0x278b8a=_0x2460db['get'](_0x123dbf[_0x1309c9(0x131)]);if(_0x278b8a){const _0x326bf7=_0x2f8888(_0x278b8a),_0x565cf7=_0x326bf7?_0x326bf7+'/'+_0x123dbf['name']:_0x123dbf[_0x1309c9(0x12f)];return _0x3000fb[_0x1309c9(0x137)](_0x123dbf['id'],_0x565cf7),_0x565cf7;}}const _0x37612a=_0x123dbf[_0x1309c9(0x12f)];return _0x3000fb[_0x1309c9(0x137)](_0x123dbf['id'],_0x37612a),_0x37612a;}for(const _0x2bb7a8 of _0x441310){_0x2f8888(_0x2bb7a8);}return _0x3000fb;}function a176_0x15c6(_0x5e6c52,_0x147bdd){_0x5e6c52=_0x5e6c52-0x12b;const _0x4b5dc8=a176_0x4b5d();let _0x15c6c3=_0x4b5dc8[_0x5e6c52];return _0x15c6c3;}export function buildFolderPathToIdMap(_0x22407d){const _0x41c8b1=a176_0x15c6,_0x585394=new Map(),_0xf3f7a8=new Map();for(const _0x5c47d9 of _0x22407d){_0xf3f7a8['set'](_0x5c47d9['id'],_0x5c47d9);}const _0xf0df14=new Set();for(const _0x46064e of _0x22407d){!_0x46064e[_0x41c8b1(0x131)]&&_0xf0df14[_0x41c8b1(0x12c)](_0x46064e['id']);}function _0x3427ff(_0x4a977f){const _0x5889e8=_0x41c8b1;if(_0xf0df14[_0x5889e8(0x136)](_0x4a977f['id']))return'';if(_0x4a977f[_0x5889e8(0x131)]){const _0x3b9907=_0xf3f7a8[_0x5889e8(0x139)](_0x4a977f['parentFolderId']);if(_0x3b9907){const _0x44000c=_0x3427ff(_0x3b9907);return _0x44000c?_0x44000c+'/'+_0x4a977f[_0x5889e8(0x12f)]:_0x4a977f[_0x5889e8(0x12f)];}}return _0x4a977f[_0x5889e8(0x12f)];}for(const _0x29c30a of _0x22407d){const _0x3fd150=_0x3427ff(_0x29c30a);_0x585394['set'](_0x3fd150,_0x29c30a['id']);}return _0x585394;}export function buildFolderMaps(_0x3afacb){const _0x47e631=a176_0x15c6,_0x1409ae=buildFolderIdToPathMap(_0x3afacb),_0x172727=new Map();for(const [_0x33768d,_0x2e62a9]of _0x1409ae){_0x172727[_0x47e631(0x137)](_0x2e62a9,_0x33768d);}return{'idToPath':_0x1409ae,'pathToId':_0x172727};}export function getFolderPath(_0x4f7c3d,_0x45bb5b){const _0xa5938b=a176_0x15c6;if(!_0x4f7c3d)return'';return _0x45bb5b[_0xa5938b(0x139)](_0x4f7c3d)??'';}
1
+ (function(_0x242ea9,_0x88bdb9){const _0x25ab36=a176_0x26aa,_0x22732d=_0x242ea9();while(!![]){try{const _0x3ac231=parseInt(_0x25ab36(0x1cd))/0x1*(parseInt(_0x25ab36(0x1c8))/0x2)+parseInt(_0x25ab36(0x1c3))/0x3*(-parseInt(_0x25ab36(0x1c9))/0x4)+-parseInt(_0x25ab36(0x1c4))/0x5+-parseInt(_0x25ab36(0x1ce))/0x6+-parseInt(_0x25ab36(0x1cc))/0x7*(parseInt(_0x25ab36(0x1d0))/0x8)+-parseInt(_0x25ab36(0x1d3))/0x9*(parseInt(_0x25ab36(0x1cf))/0xa)+-parseInt(_0x25ab36(0x1d1))/0xb*(-parseInt(_0x25ab36(0x1c5))/0xc);if(_0x3ac231===_0x88bdb9)break;else _0x22732d['push'](_0x22732d['shift']());}catch(_0x32971e){_0x22732d['push'](_0x22732d['shift']());}}}(a176_0x3035,0x3d48c));function a176_0x3035(){const _0x4c713a=['1895945SqvoBR','24NxyTqD','get','add','2mtmNgf','413332FOhBvA','has','name','63SENMcp','276116DHSivr','1971252tXQxEB','10YuTbHe','406960JYTJtt','8697777sNdgvb','parentFolderId','248553JfMCQB','set','12oalmUp'];a176_0x3035=function(){return _0x4c713a;};return a176_0x3035();}export function buildFolderIdToPathMap(_0x599d79){const _0x5df7d6=a176_0x26aa,_0xb5a935=new Map(),_0x3a70f3=new Map();for(const _0x532d3e of _0x599d79){_0x3a70f3['set'](_0x532d3e['id'],_0x532d3e);}const _0xc2807f=new Set();for(const _0x23759a of _0x599d79){!_0x23759a[_0x5df7d6(0x1d2)]&&_0xc2807f[_0x5df7d6(0x1c7)](_0x23759a['id']);}function _0x5bb86a(_0x1da2f4){const _0x20f2c0=_0x5df7d6;if(_0xb5a935[_0x20f2c0(0x1ca)](_0x1da2f4['id']))return _0xb5a935['get'](_0x1da2f4['id']);if(_0xc2807f[_0x20f2c0(0x1ca)](_0x1da2f4['id']))return _0xb5a935[_0x20f2c0(0x1d4)](_0x1da2f4['id'],''),'';if(_0x1da2f4[_0x20f2c0(0x1d2)]){const _0x8c4a25=_0x3a70f3['get'](_0x1da2f4[_0x20f2c0(0x1d2)]);if(_0x8c4a25){const _0x530d8f=_0x5bb86a(_0x8c4a25),_0x4be203=_0x530d8f?_0x530d8f+'/'+_0x1da2f4[_0x20f2c0(0x1cb)]:_0x1da2f4[_0x20f2c0(0x1cb)];return _0xb5a935[_0x20f2c0(0x1d4)](_0x1da2f4['id'],_0x4be203),_0x4be203;}}const _0x572278=_0x1da2f4[_0x20f2c0(0x1cb)];return _0xb5a935[_0x20f2c0(0x1d4)](_0x1da2f4['id'],_0x572278),_0x572278;}for(const _0x38ed86 of _0x599d79){_0x5bb86a(_0x38ed86);}return _0xb5a935;}export function buildFolderPathToIdMap(_0x4e59cf){const _0x1bf432=a176_0x26aa,_0x11829d=new Map(),_0x1d08e2=new Map();for(const _0x16930e of _0x4e59cf){_0x1d08e2['set'](_0x16930e['id'],_0x16930e);}const _0x16ec87=new Set();for(const _0x4c94f9 of _0x4e59cf){!_0x4c94f9['parentFolderId']&&_0x16ec87[_0x1bf432(0x1c7)](_0x4c94f9['id']);}function _0x38d541(_0x3e6661){const _0x2972ea=_0x1bf432;if(_0x16ec87[_0x2972ea(0x1ca)](_0x3e6661['id']))return'';if(_0x3e6661[_0x2972ea(0x1d2)]){const _0x1bfca6=_0x1d08e2[_0x2972ea(0x1c6)](_0x3e6661[_0x2972ea(0x1d2)]);if(_0x1bfca6){const _0x5a4c4c=_0x38d541(_0x1bfca6);return _0x5a4c4c?_0x5a4c4c+'/'+_0x3e6661[_0x2972ea(0x1cb)]:_0x3e6661[_0x2972ea(0x1cb)];}}return _0x3e6661[_0x2972ea(0x1cb)];}for(const _0x303c82 of _0x4e59cf){const _0x50ea02=_0x38d541(_0x303c82);_0x11829d['set'](_0x50ea02,_0x303c82['id']);}return _0x11829d;}export function buildFolderMaps(_0x36077b){const _0x151d46=a176_0x26aa,_0xcc6913=buildFolderIdToPathMap(_0x36077b),_0x486915=new Map();for(const [_0x6c77ca,_0x107c63]of _0xcc6913){_0x486915[_0x151d46(0x1d4)](_0x107c63,_0x6c77ca);}return{'idToPath':_0xcc6913,'pathToId':_0x486915};}function a176_0x26aa(_0x28f4fe,_0x335026){_0x28f4fe=_0x28f4fe-0x1c3;const _0x303571=a176_0x3035();let _0x26aa7b=_0x303571[_0x28f4fe];return _0x26aa7b;}export function getFolderPath(_0x10252b,_0x48af38){const _0x4673b7=a176_0x26aa;if(!_0x10252b)return'';return _0x48af38[_0x4673b7(0x1c6)](_0x10252b)??'';}
@@ -1 +1 @@
1
- (function(_0x2b69ac,_0x1098dc){const _0x14030d=a177_0x1827,_0x1bdfee=_0x2b69ac();while(!![]){try{const _0x4d4dde=-parseInt(_0x14030d(0x1b7))/0x1*(-parseInt(_0x14030d(0x1b1))/0x2)+parseInt(_0x14030d(0x1c1))/0x3*(parseInt(_0x14030d(0x1ba))/0x4)+parseInt(_0x14030d(0x1a8))/0x5+parseInt(_0x14030d(0x1cd))/0x6+-parseInt(_0x14030d(0x1c8))/0x7+parseInt(_0x14030d(0x1a6))/0x8*(parseInt(_0x14030d(0x1b6))/0x9)+-parseInt(_0x14030d(0x1ac))/0xa;if(_0x4d4dde===_0x1098dc)break;else _0x1bdfee['push'](_0x1bdfee['shift']());}catch(_0x5ebe96){_0x1bdfee['push'](_0x1bdfee['shift']());}}}(a177_0x1867,0x8eb0b));import a177_0x18e58b from'path';import{parse as a177_0x141b7b}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0x350e1c){const _0x351dd0=a177_0x1827;if(!_0x350e1c||_0x350e1c[_0x351dd0(0x1ca)]()==='')throw new Error(_0x351dd0(0x1be));const _0x216eb4=_0x350e1c[_0x351dd0(0x1ca)]();if(_0x216eb4==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x350e1c};const _0x5a2510=_0x216eb4[_0x351dd0(0x1cb)]('/')?_0x216eb4[_0x351dd0(0x1c3)](0x1):_0x216eb4,_0x4c3207=_0x5a2510['split']('/')['filter'](_0x37bc36=>_0x37bc36!=='');if(_0x4c3207[_0x351dd0(0x1c9)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x2df3c4=_0x216eb4['startsWith']('/')||!isRelativePathSegment(_0x4c3207[0x0]);for(const _0xeb0424 of _0x4c3207){validatePathSegment(_0xeb0424);}return{'segments':_0x4c3207,'isAbsolute':_0x2df3c4,'raw':_0x350e1c};}function a177_0x1867(){const _0x42dc20=['6559721dBrgeI','length','trim','startsWith','.yaml','3406866nkmJWn','Path\x20segment\x20cannot\x20be\x20empty','segments','Cannot\x20navigate\x20above\x20root','8807104vsFayd','slice','1441750tPhVMq','relative','isAbsolute','exists','17042800phhhqC','join','raw','name','pop','101590lNlobF','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','dirname','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','resolve','9GviGrQ','3emuEsy','segment','readFile','558204NxoKUj','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','push','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Path\x20cannot\x20be\x20empty','journey','parse','24CgNCoI','Cannot\x20split\x20empty\x20path','substring','endsWith','No\x20tdx.json\x20found\x20for\x20file:\x20','replace','tdx.json'];a177_0x1867=function(){return _0x42dc20;};return a177_0x1867();}function isRelativePathSegment(_0x5b0238){return _0x5b0238==='.'||_0x5b0238==='..';}function validatePathSegment(_0x5772e8){const _0x8331e4=a177_0x1827;if(_0x5772e8==='')throw new Error(_0x8331e4(0x1ce));if(_0x5772e8==='.'||_0x5772e8==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x5772e8))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x5772e8);if(_0x5772e8!==_0x5772e8[_0x8331e4(0x1ca)]()){}}export function validatePath(_0x1085ed){const _0x376066=a177_0x1827;if(_0x1085ed[_0x376066(0x1cf)][_0x376066(0x1c9)]===0x0&&!_0x1085ed[_0x376066(0x1aa)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x1085ed[_0x376066(0x1aa)]){if(_0x1085ed['segments'][0x0]==='..')throw new Error(_0x376066(0x1bb));let _0x831543=0x0;for(const _0x2f1f7d of _0x1085ed['segments']){if(_0x2f1f7d==='..'){if(_0x831543===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x831543--;}else _0x2f1f7d!=='.'&&_0x831543++;}}}export function joinPaths(_0x5a5bce,_0x26fabc){const _0x191909=a177_0x1827;if(!_0x5a5bce||_0x5a5bce==='/')return _0x26fabc;if(!_0x26fabc||_0x26fabc==='.')return _0x5a5bce;if(_0x26fabc[_0x191909(0x1cb)]('/'))return _0x26fabc;const _0x24c2c6=parsePath(_0x5a5bce),_0x2b6d2e=parsePath(_0x26fabc),_0x461495=[..._0x24c2c6[_0x191909(0x1cf)]];for(const _0x59b8f7 of _0x2b6d2e[_0x191909(0x1cf)]){if(_0x59b8f7==='.')continue;else{if(_0x59b8f7==='..'){if(_0x461495[_0x191909(0x1c9)]===0x0)throw new Error(_0x191909(0x1d0));_0x461495[_0x191909(0x1b0)]();}else _0x461495['push'](_0x59b8f7);}}const _0x22eb14=_0x461495[_0x191909(0x1ad)]('/');return _0x24c2c6[_0x191909(0x1ae)]['startsWith']('/')?'/'+_0x22eb14:_0x22eb14;}export function normalizePath(_0x3aad44){const _0x2bc4ce=a177_0x1827,_0x18e731=parsePath(_0x3aad44),_0x1f40e7=[];for(const _0x157f53 of _0x18e731[_0x2bc4ce(0x1cf)]){if(_0x157f53==='.')continue;else{if(_0x157f53==='..'){if(_0x1f40e7['length']===0x0){if(_0x18e731[_0x2bc4ce(0x1aa)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x1f40e7[_0x2bc4ce(0x1bc)]('..');}else _0x1f40e7[_0x1f40e7['length']-0x1]==='..'?_0x1f40e7[_0x2bc4ce(0x1bc)]('..'):_0x1f40e7[_0x2bc4ce(0x1b0)]();}else _0x1f40e7['push'](_0x157f53);}}if(_0x1f40e7[_0x2bc4ce(0x1c9)]===0x0)return _0x18e731[_0x2bc4ce(0x1aa)]?'/':'.';const _0x24f019=_0x1f40e7[_0x2bc4ce(0x1ad)]('/');return _0x18e731[_0x2bc4ce(0x1ae)]['startsWith']('/')?'/'+_0x24f019:_0x24f019;}export function getParentPath(_0xaea13d){const _0x4c8ef1=a177_0x1827,_0x38e2d1=parsePath(_0xaea13d);if(_0x38e2d1[_0x4c8ef1(0x1cf)][_0x4c8ef1(0x1c9)]<=0x1)return'/';const _0x31a52b=_0x38e2d1[_0x4c8ef1(0x1cf)][_0x4c8ef1(0x1a7)](0x0,-0x1)[_0x4c8ef1(0x1ad)]('/');return _0x38e2d1[_0x4c8ef1(0x1ae)]['startsWith']('/')?'/'+_0x31a52b:_0x31a52b;}function a177_0x1827(_0x2c0f55,_0x1b58ac){_0x2c0f55=_0x2c0f55-0x1a6;const _0x18671a=a177_0x1867();let _0x18272f=_0x18671a[_0x2c0f55];return _0x18272f;}export function getBaseName(_0x306057){const _0x91b3fa=a177_0x1827,_0x862569=parsePath(_0x306057);return _0x862569[_0x91b3fa(0x1cf)][_0x862569['segments']['length']-0x1]||'';}export function isChildPath(_0x599cf2,_0x187df7){const _0x36b3f4=a177_0x1827,_0x23ad3f=parsePath(_0x599cf2),_0xf08e04=parsePath(_0x187df7);if(_0x23ad3f[_0x36b3f4(0x1cf)][_0x36b3f4(0x1c9)]<=_0xf08e04[_0x36b3f4(0x1cf)][_0x36b3f4(0x1c9)])return![];for(let _0x2455cc=0x0;_0x2455cc<_0xf08e04[_0x36b3f4(0x1cf)][_0x36b3f4(0x1c9)];_0x2455cc++){if(_0x23ad3f[_0x36b3f4(0x1cf)][_0x2455cc]!==_0xf08e04[_0x36b3f4(0x1cf)][_0x2455cc])return![];}return!![];}export function splitPath(_0x31919d){const _0x1d9ba6=a177_0x1827,_0x5946f8=parsePath(_0x31919d);if(_0x5946f8['segments']['length']===0x0)throw new Error(_0x1d9ba6(0x1c2));if(_0x5946f8[_0x1d9ba6(0x1cf)]['length']===0x1)return{'parent':_0x5946f8[_0x1d9ba6(0x1cf)][0x0]};return{'parent':_0x5946f8['segments'][0x0],'child':_0x5946f8[_0x1d9ba6(0x1cf)][_0x1d9ba6(0x1a7)](0x1)[_0x1d9ba6(0x1ad)]('/')};}export function isYamlFilePath(_0x3e5fb4){const _0x118fbb=a177_0x1827;return _0x3e5fb4[_0x118fbb(0x1c4)]('.yml')||_0x3e5fb4[_0x118fbb(0x1c4)](_0x118fbb(0x1cc));}export async function resolveYamlFilePath(_0x41026d,_0x329e92=nodeFileSystem){const _0x1455ce=a177_0x1827,_0x23a944=a177_0x18e58b[_0x1455ce(0x1b5)](_0x41026d);if(!await _0x329e92[_0x1455ce(0x1ab)](_0x23a944))throw new Error('File\x20not\x20found:\x20'+_0x41026d);let _0x55d565=a177_0x18e58b[_0x1455ce(0x1b3)](_0x23a944),_0x231f79=null,_0x3cdc93=null;const _0x14c014=a177_0x18e58b[_0x1455ce(0x1c0)](_0x55d565)['root'];while(_0x55d565!==_0x14c014){const _0x104b0c=a177_0x18e58b[_0x1455ce(0x1ad)](_0x55d565,_0x1455ce(0x1c7));if(await _0x329e92[_0x1455ce(0x1ab)](_0x104b0c)){_0x231f79=_0x104b0c,_0x3cdc93=_0x55d565;break;}_0x55d565=a177_0x18e58b[_0x1455ce(0x1b3)](_0x55d565);}if(!_0x231f79||!_0x3cdc93)throw new Error(_0x1455ce(0x1c5)+_0x41026d+'\x0a'+_0x1455ce(0x1b4));const _0x39ce91=await _0x329e92['readFile'](_0x231f79),_0x1cde9f=JSON[_0x1455ce(0x1c0)](_0x39ce91),_0x42aa6e=_0x1cde9f['parent_segment'];if(!_0x42aa6e)throw new Error(_0x1455ce(0x1b2));const _0x5a0f5a=await _0x329e92[_0x1455ce(0x1b9)](_0x23a944),_0x21d039=a177_0x141b7b(_0x5a0f5a),_0x1e1ee2=_0x21d039[_0x1455ce(0x1af)];if(!_0x1e1ee2)throw new Error(_0x1455ce(0x1bd)+_0x41026d);const _0x241516=isJourneyDef(_0x21d039,_0x23a944)?_0x1455ce(0x1bf):_0x1455ce(0x1b8),_0x52dacf=a177_0x18e58b[_0x1455ce(0x1a9)](_0x3cdc93,_0x23a944),_0x534ae9=a177_0x18e58b[_0x1455ce(0x1b3)](_0x52dacf),_0x50dcf3=_0x534ae9==='.'?'':_0x534ae9[_0x1455ce(0x1c6)](/\\/g,'/'),_0x4c119b=_0x50dcf3?_0x42aa6e+'/'+_0x50dcf3+'/'+_0x1e1ee2:_0x42aa6e+'/'+_0x1e1ee2;return{'parentSegment':_0x42aa6e,'segmentName':_0x1e1ee2,'folderPath':_0x50dcf3,'fullPath':_0x4c119b,'resourceType':_0x241516,'content':_0x5a0f5a};}
1
+ function a177_0xf91b(_0x274161,_0x502cf7){_0x274161=_0x274161-0x1f0;const _0x5d0e78=a177_0x5d0e();let _0xf91b39=_0x5d0e78[_0x274161];return _0xf91b39;}(function(_0x180407,_0x52d69a){const _0x24dfb0=a177_0xf91b,_0x1ec56f=_0x180407();while(!![]){try{const _0x34d5ef=-parseInt(_0x24dfb0(0x1f0))/0x1*(parseInt(_0x24dfb0(0x208))/0x2)+parseInt(_0x24dfb0(0x20e))/0x3+parseInt(_0x24dfb0(0x217))/0x4*(parseInt(_0x24dfb0(0x201))/0x5)+parseInt(_0x24dfb0(0x1f6))/0x6*(-parseInt(_0x24dfb0(0x21b))/0x7)+-parseInt(_0x24dfb0(0x1f5))/0x8*(parseInt(_0x24dfb0(0x205))/0x9)+parseInt(_0x24dfb0(0x1f2))/0xa*(parseInt(_0x24dfb0(0x221))/0xb)+parseInt(_0x24dfb0(0x20f))/0xc*(parseInt(_0x24dfb0(0x213))/0xd);if(_0x34d5ef===_0x52d69a)break;else _0x1ec56f['push'](_0x1ec56f['shift']());}catch(_0x5f36b1){_0x1ec56f['push'](_0x1ec56f['shift']());}}}(a177_0x5d0e,0x27266));import a177_0x6f2cfa from'path';import{parse as a177_0x295ea4}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0x32bde2){const _0x544de6=a177_0xf91b;if(!_0x32bde2||_0x32bde2['trim']()==='')throw new Error(_0x544de6(0x211));const _0x4a8fb7=_0x32bde2[_0x544de6(0x1fc)]();if(_0x4a8fb7==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x32bde2};const _0x36f15d=_0x4a8fb7['startsWith']('/')?_0x4a8fb7[_0x544de6(0x203)](0x1):_0x4a8fb7,_0x5a34cf=_0x36f15d[_0x544de6(0x206)]('/')['filter'](_0x25dc26=>_0x25dc26!=='');if(_0x5a34cf[_0x544de6(0x1f7)]===0x0)throw new Error(_0x544de6(0x222));const _0x3a5590=_0x4a8fb7[_0x544de6(0x20c)]('/')||!isRelativePathSegment(_0x5a34cf[0x0]);for(const _0x5e7867 of _0x5a34cf){validatePathSegment(_0x5e7867);}return{'segments':_0x5a34cf,'isAbsolute':_0x3a5590,'raw':_0x32bde2};}function isRelativePathSegment(_0x5503f8){return _0x5503f8==='.'||_0x5503f8==='..';}function validatePathSegment(_0x3a682b){const _0x373cc6=a177_0xf91b;if(_0x3a682b==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x3a682b==='.'||_0x3a682b==='..')return;if(/[\x00-\x1F\x7F]/[_0x373cc6(0x20a)](_0x3a682b))throw new Error(_0x373cc6(0x215)+_0x3a682b);if(_0x3a682b!==_0x3a682b[_0x373cc6(0x1fc)]()){}}export function validatePath(_0x355c00){const _0x1e6847=a177_0xf91b;if(_0x355c00[_0x1e6847(0x204)][_0x1e6847(0x1f7)]===0x0&&!_0x355c00[_0x1e6847(0x1fa)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x355c00[_0x1e6847(0x1fa)]){if(_0x355c00[_0x1e6847(0x204)][0x0]==='..')throw new Error(_0x1e6847(0x219));let _0x3f3653=0x0;for(const _0x10c3f8 of _0x355c00['segments']){if(_0x10c3f8==='..'){if(_0x3f3653===0x0)throw new Error(_0x1e6847(0x1fe));_0x3f3653--;}else _0x10c3f8!=='.'&&_0x3f3653++;}}}export function joinPaths(_0x235287,_0x561863){const _0x326c54=a177_0xf91b;if(!_0x235287||_0x235287==='/')return _0x561863;if(!_0x561863||_0x561863==='.')return _0x235287;if(_0x561863['startsWith']('/'))return _0x561863;const _0x45bb67=parsePath(_0x235287),_0x2a6d32=parsePath(_0x561863),_0x480134=[..._0x45bb67[_0x326c54(0x204)]];for(const _0x3ebe40 of _0x2a6d32[_0x326c54(0x204)]){if(_0x3ebe40==='.')continue;else{if(_0x3ebe40==='..'){if(_0x480134['length']===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x480134[_0x326c54(0x209)]();}else _0x480134[_0x326c54(0x220)](_0x3ebe40);}}const _0x2dd810=_0x480134[_0x326c54(0x1f9)]('/');return _0x45bb67[_0x326c54(0x21f)]['startsWith']('/')?'/'+_0x2dd810:_0x2dd810;}export function normalizePath(_0x4681a8){const _0x50709d=a177_0xf91b,_0x387b43=parsePath(_0x4681a8),_0x9e5634=[];for(const _0x58523e of _0x387b43[_0x50709d(0x204)]){if(_0x58523e==='.')continue;else{if(_0x58523e==='..'){if(_0x9e5634[_0x50709d(0x1f7)]===0x0){if(_0x387b43[_0x50709d(0x1fa)])throw new Error(_0x50709d(0x20b));_0x9e5634[_0x50709d(0x220)]('..');}else _0x9e5634[_0x9e5634[_0x50709d(0x1f7)]-0x1]==='..'?_0x9e5634[_0x50709d(0x220)]('..'):_0x9e5634[_0x50709d(0x209)]();}else _0x9e5634[_0x50709d(0x220)](_0x58523e);}}if(_0x9e5634[_0x50709d(0x1f7)]===0x0)return _0x387b43[_0x50709d(0x1fa)]?'/':'.';const _0x57ef3c=_0x9e5634[_0x50709d(0x1f9)]('/');return _0x387b43[_0x50709d(0x21f)][_0x50709d(0x20c)]('/')?'/'+_0x57ef3c:_0x57ef3c;}export function getParentPath(_0x10538f){const _0x53153a=a177_0xf91b,_0x2568d3=parsePath(_0x10538f);if(_0x2568d3[_0x53153a(0x204)][_0x53153a(0x1f7)]<=0x1)return'/';const _0x213ad5=_0x2568d3[_0x53153a(0x204)][_0x53153a(0x1ff)](0x0,-0x1)['join']('/');return _0x2568d3[_0x53153a(0x21f)]['startsWith']('/')?'/'+_0x213ad5:_0x213ad5;}export function getBaseName(_0xa5b0ae){const _0x754a9b=a177_0xf91b,_0x94a53a=parsePath(_0xa5b0ae);return _0x94a53a[_0x754a9b(0x204)][_0x94a53a[_0x754a9b(0x204)][_0x754a9b(0x1f7)]-0x1]||'';}function a177_0x5d0e(){const _0x350873=['2292SyQqAl','pop','test','Cannot\x20navigate\x20above\x20root','startsWith','.yaml','466044EonXsv','84bvdRQk','root','Path\x20cannot\x20be\x20empty','replace','446888uEkaGA','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','tdx.json','88nJncNh','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','name','15358YNyZjy','segment','relative','dirname','raw','push','638dUqyac','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','107ItUJiD','No\x20tdx.json\x20found\x20for\x20file:\x20','23230dYAXfz','parse','exists','16pRTGZX','750BOnCcM','length','journey','join','isAbsolute','readFile','trim','Cannot\x20split\x20empty\x20path','Path\x20attempts\x20to\x20navigate\x20above\x20root','slice','endsWith','57725azGoTi','resolve','substring','segments','1023633JCKvWj','split','File\x20not\x20found:\x20'];a177_0x5d0e=function(){return _0x350873;};return a177_0x5d0e();}export function isChildPath(_0x571fec,_0x3f8ee8){const _0x3884b5=a177_0xf91b,_0x37c9fc=parsePath(_0x571fec),_0x54b9b2=parsePath(_0x3f8ee8);if(_0x37c9fc[_0x3884b5(0x204)][_0x3884b5(0x1f7)]<=_0x54b9b2['segments'][_0x3884b5(0x1f7)])return![];for(let _0x44d6fd=0x0;_0x44d6fd<_0x54b9b2[_0x3884b5(0x204)]['length'];_0x44d6fd++){if(_0x37c9fc[_0x3884b5(0x204)][_0x44d6fd]!==_0x54b9b2[_0x3884b5(0x204)][_0x44d6fd])return![];}return!![];}export function splitPath(_0x22a62d){const _0x518cf1=a177_0xf91b,_0x10e9d1=parsePath(_0x22a62d);if(_0x10e9d1[_0x518cf1(0x204)][_0x518cf1(0x1f7)]===0x0)throw new Error(_0x518cf1(0x1fd));if(_0x10e9d1['segments'][_0x518cf1(0x1f7)]===0x1)return{'parent':_0x10e9d1['segments'][0x0]};return{'parent':_0x10e9d1[_0x518cf1(0x204)][0x0],'child':_0x10e9d1['segments'][_0x518cf1(0x1ff)](0x1)[_0x518cf1(0x1f9)]('/')};}export function isYamlFilePath(_0x4324e2){const _0x414c05=a177_0xf91b;return _0x4324e2[_0x414c05(0x200)]('.yml')||_0x4324e2[_0x414c05(0x200)](_0x414c05(0x20d));}export async function resolveYamlFilePath(_0x3f6c5b,_0x427ade=nodeFileSystem){const _0x1768f3=a177_0xf91b,_0x340cff=a177_0x6f2cfa[_0x1768f3(0x202)](_0x3f6c5b);if(!await _0x427ade[_0x1768f3(0x1f4)](_0x340cff))throw new Error(_0x1768f3(0x207)+_0x3f6c5b);let _0x16144b=a177_0x6f2cfa[_0x1768f3(0x21e)](_0x340cff),_0x14b2e5=null,_0x473919=null;const _0x54378c=a177_0x6f2cfa[_0x1768f3(0x1f3)](_0x16144b)[_0x1768f3(0x210)];while(_0x16144b!==_0x54378c){const _0x27d9f5=a177_0x6f2cfa[_0x1768f3(0x1f9)](_0x16144b,_0x1768f3(0x216));if(await _0x427ade[_0x1768f3(0x1f4)](_0x27d9f5)){_0x14b2e5=_0x27d9f5,_0x473919=_0x16144b;break;}_0x16144b=a177_0x6f2cfa[_0x1768f3(0x21e)](_0x16144b);}if(!_0x14b2e5||!_0x473919)throw new Error(_0x1768f3(0x1f1)+_0x3f6c5b+'\x0a'+_0x1768f3(0x214));const _0x4af12f=await _0x427ade[_0x1768f3(0x1fb)](_0x14b2e5),_0xfce8d8=JSON[_0x1768f3(0x1f3)](_0x4af12f),_0x300a9e=_0xfce8d8['parent_segment'];if(!_0x300a9e)throw new Error(_0x1768f3(0x218));const _0x124d8d=await _0x427ade[_0x1768f3(0x1fb)](_0x340cff),_0x490150=a177_0x295ea4(_0x124d8d),_0x228c36=_0x490150[_0x1768f3(0x21a)];if(!_0x228c36)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x3f6c5b);const _0x600d2f=isJourneyDef(_0x490150,_0x340cff)?_0x1768f3(0x1f8):_0x1768f3(0x21c),_0x36cd58=a177_0x6f2cfa[_0x1768f3(0x21d)](_0x473919,_0x340cff),_0x54b0ca=a177_0x6f2cfa[_0x1768f3(0x21e)](_0x36cd58),_0x31edae=_0x54b0ca==='.'?'':_0x54b0ca[_0x1768f3(0x212)](/\\/g,'/'),_0x14c3bb=_0x31edae?_0x300a9e+'/'+_0x31edae+'/'+_0x228c36:_0x300a9e+'/'+_0x228c36;return{'parentSegment':_0x300a9e,'segmentName':_0x228c36,'folderPath':_0x31edae,'fullPath':_0x14c3bb,'resourceType':_0x600d2f,'content':_0x124d8d};}
@@ -1 +1 @@
1
- function a178_0xd942(){const _0x186c6e=['substring','1353660wTngBI','43630xulnxW','3659tjjzrL','154CiuZVJ','1631216ZFkuCi','indexOf','6LxqYtU','567mVPviu','.\x20Parent\x20name\x20cannot\x20be\x20empty','102888VDnrfR','984705qDRmoH','1283405flOFOf','116SLMmYq','Invalid\x20segment\x20reference\x20format:\x20'];a178_0xd942=function(){return _0x186c6e;};return a178_0xd942();}(function(_0x5148ef,_0x32fd75){const _0x3f92be=a178_0x18f7,_0x28b6c7=_0x5148ef();while(!![]){try{const _0x236eec=-parseInt(_0x3f92be(0x1e4))/0x1*(parseInt(_0x3f92be(0x1ee))/0x2)+-parseInt(_0x3f92be(0x1ec))/0x3+parseInt(_0x3f92be(0x1e6))/0x4+-parseInt(_0x3f92be(0x1ed))/0x5*(-parseInt(_0x3f92be(0x1e8))/0x6)+parseInt(_0x3f92be(0x1e5))/0x7*(-parseInt(_0x3f92be(0x1eb))/0x8)+-parseInt(_0x3f92be(0x1e9))/0x9*(-parseInt(_0x3f92be(0x1e3))/0xa)+parseInt(_0x3f92be(0x1f1))/0xb;if(_0x236eec===_0x32fd75)break;else _0x28b6c7['push'](_0x28b6c7['shift']());}catch(_0x1b3bed){_0x28b6c7['push'](_0x28b6c7['shift']());}}}(a178_0xd942,0x3a5a7));function a178_0x18f7(_0x2a4009,_0xfdba88){_0x2a4009=_0x2a4009-0x1e3;const _0xd9420a=a178_0xd942();let _0x18f797=_0xd9420a[_0x2a4009];return _0x18f797;}export function parseSegmentRef(_0x1703ff){const _0x4245e2=a178_0x18f7,_0x41cae5=_0x1703ff[_0x4245e2(0x1e7)]('/');if(_0x41cae5===-0x1)return{'parentId':_0x1703ff};if(_0x41cae5===0x0)throw new Error(_0x4245e2(0x1ef)+_0x1703ff+_0x4245e2(0x1ea));const _0x11c119=_0x1703ff[_0x4245e2(0x1f0)](0x0,_0x41cae5),_0x10f959=_0x1703ff[_0x4245e2(0x1f0)](_0x41cae5+0x1);if(_0x10f959==='')throw new Error(_0x4245e2(0x1ef)+_0x1703ff+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x11c119,'childId':_0x10f959};}
1
+ function a178_0x3591(){const _0x330d6f=['.\x20Parent\x20name\x20cannot\x20be\x20empty','1897lOPnDs','4GZYbIX','393188hWvapJ','3858090JYulby','27354zOuLVE','10jSUjRK','2ntREWm','24249804kikDbF','Invalid\x20segment\x20reference\x20format:\x20','10952139XkTBsh','3225879HtSpyT','13Mzivgb','2902233QepepU','indexOf','substring','8KfOXEp'];a178_0x3591=function(){return _0x330d6f;};return a178_0x3591();}(function(_0x3b4cb3,_0x2fe3d1){const _0xa5f0de=a178_0x1d53,_0x404508=_0x3b4cb3();while(!![]){try{const _0x362940=parseInt(_0xa5f0de(0xb0))/0x1*(parseInt(_0xa5f0de(0xb4))/0x2)+parseInt(_0xa5f0de(0xa9))/0x3*(-parseInt(_0xa5f0de(0xaf))/0x4)+parseInt(_0xa5f0de(0xb1))/0x5+-parseInt(_0xa5f0de(0xb2))/0x6*(-parseInt(_0xa5f0de(0xae))/0x7)+parseInt(_0xa5f0de(0xac))/0x8*(parseInt(_0xa5f0de(0xa7))/0x9)+-parseInt(_0xa5f0de(0xb3))/0xa*(-parseInt(_0xa5f0de(0xb7))/0xb)+-parseInt(_0xa5f0de(0xb5))/0xc*(parseInt(_0xa5f0de(0xa8))/0xd);if(_0x362940===_0x2fe3d1)break;else _0x404508['push'](_0x404508['shift']());}catch(_0x3c9703){_0x404508['push'](_0x404508['shift']());}}}(a178_0x3591,0xbb0c3));function a178_0x1d53(_0x1810c9,_0xfdafd4){_0x1810c9=_0x1810c9-0xa7;const _0x3591c8=a178_0x3591();let _0x1d5306=_0x3591c8[_0x1810c9];return _0x1d5306;}export function parseSegmentRef(_0x48aacd){const _0x5e1785=a178_0x1d53,_0x4336ce=_0x48aacd[_0x5e1785(0xaa)]('/');if(_0x4336ce===-0x1)return{'parentId':_0x48aacd};if(_0x4336ce===0x0)throw new Error(_0x5e1785(0xb6)+_0x48aacd+_0x5e1785(0xad));const _0x1b9c88=_0x48aacd['substring'](0x0,_0x4336ce),_0x36b6e2=_0x48aacd[_0x5e1785(0xab)](_0x4336ce+0x1);if(_0x36b6e2==='')throw new Error(_0x5e1785(0xb6)+_0x48aacd+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x1b9c88,'childId':_0x36b6e2};}
@@ -1 +1 @@
1
- (function(_0xea2ea5,_0x5ef93a){const _0x34681d=a179_0x50f7,_0x2283c2=_0xea2ea5();while(!![]){try{const _0x23cf26=-parseInt(_0x34681d(0xfc))/0x1+-parseInt(_0x34681d(0x13c))/0x2+-parseInt(_0x34681d(0x14b))/0x3*(-parseInt(_0x34681d(0x10f))/0x4)+-parseInt(_0x34681d(0x122))/0x5+-parseInt(_0x34681d(0x134))/0x6*(-parseInt(_0x34681d(0x12f))/0x7)+parseInt(_0x34681d(0x120))/0x8+-parseInt(_0x34681d(0x10a))/0x9*(parseInt(_0x34681d(0x13d))/0xa);if(_0x23cf26===_0x5ef93a)break;else _0x2283c2['push'](_0x2283c2['shift']());}catch(_0x3fc30a){_0x2283c2['push'](_0x2283c2['shift']());}}}(a179_0x1bda,0x88a77));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x425e65,_0x3fb689={},_0x3619ea={}){const _0x2f4c8e=a179_0x50f7;if(_0x3619ea[_0x2f4c8e(0x110)])return runSemanticChecks(_0x425e65,_0x3fb689);const _0x2ebb1b=SegmentDefSchema[_0x2f4c8e(0x12d)](_0x425e65);if(_0x2ebb1b['success'])return runSemanticChecks(_0x2ebb1b[_0x2f4c8e(0x124)],_0x3fb689);return zodErrorsToValidationResult(_0x2ebb1b[_0x2f4c8e(0xfa)],_0x3fb689);}function a179_0x1bda(){const _0xf1cd81=['operator','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','2722485NedGPx','source','custom','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','rule.type','Attribute\x20\x27','MISSING_BETWEEN_BOUNDS','error','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','369754cDoNqu','type','includes','description','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','push','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','attribute','.source','Value','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','NESTED_CONDITION_GROUP','message','180KDCJVv','issues','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','.segment','params','4kYaZWV','skipSchema','rule','.type','INVALID_OPERATOR_TYPE','invalid_value','MISSING_TIME_UNIT','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','MISSING_SEGMENT_REFERENCE','success','not','filter','level','.operator.not','.attribute','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','map','212928kzygjQ','path','1788715wuDBlW','.operator.type','data','.filter','.conditions[','\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20','Behavior\x20source\x20\x27','EMPTY_ATTRIBUTE','MISSING_CONDITIONS','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','conditions','safeParse','MISSING_OPERATOR_VALUE','21oBQtAG','.conditions','Operator\x20\x27','Attribute\x20name\x20cannot\x20be\x20empty','And','1357986PLxrrl','INVALID_RULE_TYPE','TEMPORAL_NEGATION_UNSUPPORTED','INVALID_ARRAY_MATCHING','symbol','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','TimeWithinPast','286464OFDzuz','91320UikOED','document','EMPTY_CONDITIONS','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','length','code','Composite','warning','endsWith','aggregation','\x27\x20with\x20attribute\x20\x27','validationCode'];a179_0x1bda=function(){return _0xf1cd81;};return a179_0x1bda();}export function validateRuleDef(_0x419d81,_0x21d485,_0xdfd54e){const _0x2ead60=a179_0x50f7;if(!_0x419d81)return[];const _0x292fee=RuleDefSchema[_0x2ead60(0x12d)](_0x419d81);if(_0x292fee[_0x2ead60(0x118)])return checkRule(_0x292fee[_0x2ead60(0x124)],_0x21d485,_0xdfd54e);const _0x2029b3=flattenZodIssues(_0x292fee['error'][_0x2ead60(0x10b)]);return _0x2029b3[_0x2ead60(0x11f)](_0x1656a3=>{const _0x3caf6e=_0x2ead60,_0x242106=formatZodPath(_0x1656a3[_0x3caf6e(0x121)]),_0x18a826=_0x242106?_0x21d485+'.'+_0x242106:_0x21d485,_0x2dffcd=mapZodIssueToCode(_0x1656a3,_0x242106),_0x17e58c=getLocationFromPath(_0xdfd54e[_0x3caf6e(0x13e)],_0xdfd54e[_0x3caf6e(0x14c)],pathToArray(_0x18a826));return{'level':'error','path':_0x18a826,'code':_0x2dffcd,'message':_0x1656a3[_0x3caf6e(0x109)],..._0x17e58c&&{'location':_0x17e58c}};});}function zodErrorsToValidationResult(_0x446539,_0x283076){const _0x59c98d=a179_0x50f7,_0x190543=flattenZodIssues(_0x446539['issues']),_0x48eb26=_0x190543[_0x59c98d(0x11f)](_0x1e46b0=>{const _0x98fe2a=_0x59c98d,_0x5ce45c=formatZodPath(_0x1e46b0['path']),_0x1d5028=mapZodIssueToCode(_0x1e46b0,_0x5ce45c),_0x4a901e=getLocationFromPath(_0x283076['document'],_0x283076['source'],_0x1e46b0[_0x98fe2a(0x121)][_0x98fe2a(0x11f)](_0x1cdb48=>typeof _0x1cdb48===_0x98fe2a(0x138)?String(_0x1cdb48):_0x1cdb48));return{'level':_0x98fe2a(0xfa),'path':_0x5ce45c,'code':_0x1d5028,'message':_0x1e46b0[_0x98fe2a(0x109)],..._0x4a901e&&{'location':_0x4a901e}};});return{'valid':![],'errors':_0x48eb26,'warnings':[]};}function mapZodIssueToCode(_0x44cb32,_0xddab2b){const _0x36890a=a179_0x50f7,_0x2ae6f9=_0x44cb32[_0x36890a(0x142)]===_0x36890a(0x14d)?_0x44cb32[_0x36890a(0x10e)]:undefined;if(_0xddab2b==='name')return'MISSING_NAME';if(_0xddab2b===_0x36890a(0x14f)||_0xddab2b['endsWith'](_0x36890a(0x112))){if(_0x44cb32[_0x36890a(0x142)]===_0x36890a(0x114)){if(_0xddab2b===_0x36890a(0x14f)||_0xddab2b['match'](/\.conditions\[\d+\]\.type$/))return _0x36890a(0x135);}}if(_0xddab2b[_0x36890a(0x145)](_0x36890a(0x123)))return _0x36890a(0x113);if(_0xddab2b[_0x36890a(0x145)]('.operator.value'))return _0x36890a(0x12e);if(_0x2ae6f9?.[_0x36890a(0x148)]===_0x36890a(0xf9))return _0x36890a(0xf9);if(_0x2ae6f9?.[_0x36890a(0x148)]===_0x36890a(0x115))return _0x36890a(0x115);if(_0xddab2b[_0x36890a(0x145)](_0x36890a(0x130))||_0xddab2b===_0x36890a(0x12c))return _0x36890a(0x12a);if(_0xddab2b[_0x36890a(0xfe)]('arrayMatching'))return _0x36890a(0x137);if(_0xddab2b[_0x36890a(0x145)](_0x36890a(0x10d)))return _0x36890a(0x117);return'SEGMENT_SCHEMA_ERROR';}function a179_0x50f7(_0x57e944,_0x5807d2){_0x57e944=_0x57e944-0xf9;const _0x1bda7a=a179_0x1bda();let _0x50f7c2=_0x1bda7a[_0x57e944];return _0x50f7c2;}function runSemanticChecks(_0x5a9d7b,_0x58549e){const _0x4715ec=a179_0x50f7,_0x59f402=[];_0x5a9d7b['rule']&&_0x59f402[_0x4715ec(0x101)](...checkRule(_0x5a9d7b[_0x4715ec(0x111)],_0x4715ec(0x111),_0x58549e));const _0x1fd90c=_0x59f402[_0x4715ec(0x11a)](_0x51d3d2=>_0x51d3d2[_0x4715ec(0x11b)]===_0x4715ec(0xfa)),_0x54eea4=_0x59f402[_0x4715ec(0x11a)](_0xcece11=>_0xcece11[_0x4715ec(0x11b)]===_0x4715ec(0x144));return{'valid':_0x1fd90c['length']===0x0,'errors':_0x1fd90c,'warnings':_0x54eea4};}function checkRule(_0x55523a,_0xe38932,_0x304a24){const _0x116ad0=a179_0x50f7,_0x2df773=[];if(_0x55523a[_0x116ad0(0x12c)][_0x116ad0(0x141)]===0x0)return _0x2df773[_0x116ad0(0x101)]({'level':_0x116ad0(0xfa),'path':_0xe38932+'.conditions','code':'EMPTY_CONDITIONS','message':_0x116ad0(0x13a),'location':getLocationFromPath(_0x304a24[_0x116ad0(0x13e)],_0x304a24[_0x116ad0(0x14c)],pathToArray(_0xe38932+_0x116ad0(0x130)))}),_0x2df773;return _0x2df773['push'](...checkConditions(_0x55523a['conditions'],_0xe38932,_0x304a24)),_0x2df773;}function checkConditions(_0x5f31ac,_0x522aba,_0x2bf8ce){const _0x3909e7=a179_0x50f7,_0x3e871f=[];for(let _0x3836ce=0x0;_0x3836ce<_0x5f31ac[_0x3909e7(0x141)];_0x3836ce++){const _0x5c0217=_0x5f31ac[_0x3836ce],_0x142928=_0x522aba+_0x3909e7(0x126)+_0x3836ce+']';_0x3e871f['push'](...checkCondition(_0x5c0217,_0x142928,_0x2bf8ce));}return _0x3e871f;}function checkCondition(_0x3f09b5,_0x263fa5,_0xbf29f1){const _0x2a75b6=a179_0x50f7,_0x1f0c35=[];if(_0x3f09b5[_0x2a75b6(0xfd)]===_0x2a75b6(0x133)||_0x3f09b5['type']==='Or'||_0x3f09b5[_0x2a75b6(0xfd)]===_0x2a75b6(0x143)){if(_0x3f09b5[_0x2a75b6(0x12c)][_0x2a75b6(0x141)]===0x0)_0x1f0c35['push']({'level':_0x2a75b6(0xfa),'path':_0x263fa5+_0x2a75b6(0x130),'code':_0x2a75b6(0x13f),'message':_0x3f09b5[_0x2a75b6(0xfd)]+_0x2a75b6(0x14e),'location':getLocationFromPath(_0xbf29f1['document'],_0xbf29f1[_0x2a75b6(0x14c)],pathToArray(_0x263fa5+_0x2a75b6(0x130)))});else{const _0x452cc9=_0x3f09b5[_0x2a75b6(0xff)]!==undefined,_0x48582e=_0x3f09b5[_0x2a75b6(0xfd)]===_0x2a75b6(0x143);!_0x452cc9&&!_0x48582e&&_0x1f0c35[_0x2a75b6(0x101)]({'level':_0x2a75b6(0x144),'path':_0x263fa5,'code':_0x2a75b6(0x108),'message':_0x3f09b5[_0x2a75b6(0xfd)]+_0x2a75b6(0x116)+_0x2a75b6(0x14a)+_0x2a75b6(0x10c),'location':getLocationFromPath(_0xbf29f1[_0x2a75b6(0x13e)],_0xbf29f1[_0x2a75b6(0x14c)],pathToArray(_0x263fa5))}),_0x1f0c35[_0x2a75b6(0x101)](...checkConditions(_0x3f09b5[_0x2a75b6(0x12c)],_0x263fa5,_0xbf29f1));}return _0x1f0c35;}if(_0x3f09b5['type']===_0x2a75b6(0x106)||_0x3f09b5[_0x2a75b6(0xfd)]==='Behavior'){const _0x79dedc=_0x3f09b5,_0x31b2e4=_0x79dedc[_0x2a75b6(0x14c)],_0x24ac55=_0x79dedc[_0x2a75b6(0x146)],_0x18c686=_0x31b2e4||_0x24ac55,_0x55eb3c=_0x79dedc[_0x2a75b6(0x149)]?.[_0x2a75b6(0xfd)];if((_0x55eb3c===_0x2a75b6(0x13b)||_0x55eb3c==='TimeWithinNext')&&_0x79dedc['operator']?.[_0x2a75b6(0x119)]!==undefined){const _0x442659=_0x79dedc['operator'][_0x2a75b6(0x119)]===!![];_0x1f0c35[_0x2a75b6(0x101)]({'level':_0x442659?_0x2a75b6(0xfa):'warning','path':_0x263fa5+'.operator.not','code':_0x2a75b6(0x136),'message':_0x442659?_0x2a75b6(0x131)+_0x55eb3c+_0x2a75b6(0x100)+_0x2a75b6(0x103)+_0x2a75b6(0x107):'Operator\x20\x27'+_0x55eb3c+_0x2a75b6(0x127)+'Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','location':getLocationFromPath(_0xbf29f1[_0x2a75b6(0x13e)],_0xbf29f1['source'],pathToArray(_0x263fa5+_0x2a75b6(0x11c)))});}(!_0x79dedc['attribute']||_0x79dedc[_0x2a75b6(0x104)]==='')&&(!_0x18c686&&_0x1f0c35[_0x2a75b6(0x101)]({'level':_0x2a75b6(0xfa),'path':_0x263fa5+_0x2a75b6(0x11d),'code':_0x2a75b6(0x129),'message':_0x2a75b6(0x132),'location':getLocationFromPath(_0xbf29f1['document'],_0xbf29f1[_0x2a75b6(0x14c)],pathToArray(_0x263fa5+_0x2a75b6(0x11d)))}));_0x79dedc[_0x2a75b6(0x11a)]&&_0x1f0c35['push'](...checkRule(_0x79dedc[_0x2a75b6(0x11a)],_0x263fa5+_0x2a75b6(0x125),_0xbf29f1));if(_0x79dedc[_0x2a75b6(0x14c)]){const _0x140c40=_0x79dedc[_0x2a75b6(0x104)]&&_0x79dedc[_0x2a75b6(0x104)]!=='';_0x140c40&&!_0x79dedc[_0x2a75b6(0x11a)]&&_0x1f0c35[_0x2a75b6(0x101)]({'level':_0x2a75b6(0xfa),'path':_0x263fa5+'.source','code':'BEHAVIOR_SOURCE_MISSING_FILTER','message':_0x2a75b6(0x128)+_0x79dedc[_0x2a75b6(0x14c)]+_0x2a75b6(0x147)+_0x79dedc[_0x2a75b6(0x104)]+'\x27\x20'+_0x2a75b6(0x140)+_0x2a75b6(0x11e)+_0x2a75b6(0xfb),'location':getLocationFromPath(_0xbf29f1[_0x2a75b6(0x13e)],_0xbf29f1[_0x2a75b6(0x14c)],pathToArray(_0x263fa5+_0x2a75b6(0x105)))}),_0x140c40&&_0x79dedc[_0x2a75b6(0x11a)]&&_0x1f0c35['push']({'level':_0x2a75b6(0x144),'path':_0x263fa5+'.attribute','code':_0x2a75b6(0x139),'message':_0x2a75b6(0x150)+_0x79dedc[_0x2a75b6(0x104)]+_0x2a75b6(0x102)+_0x2a75b6(0x12b),'location':getLocationFromPath(_0xbf29f1[_0x2a75b6(0x13e)],_0xbf29f1['source'],pathToArray(_0x263fa5+'.attribute'))});}}return _0x1f0c35;}
1
+ (function(_0x71f408,_0x4f2453){const _0x48a0fa=a179_0x5b5d,_0x26f719=_0x71f408();while(!![]){try{const _0x168cf2=-parseInt(_0x48a0fa(0x1f5))/0x1*(-parseInt(_0x48a0fa(0x1fd))/0x2)+parseInt(_0x48a0fa(0x1ee))/0x3*(parseInt(_0x48a0fa(0x1dc))/0x4)+parseInt(_0x48a0fa(0x1ff))/0x5*(-parseInt(_0x48a0fa(0x1d6))/0x6)+-parseInt(_0x48a0fa(0x1db))/0x7+-parseInt(_0x48a0fa(0x1d8))/0x8+-parseInt(_0x48a0fa(0x206))/0x9+parseInt(_0x48a0fa(0x1c5))/0xa;if(_0x168cf2===_0x4f2453)break;else _0x26f719['push'](_0x26f719['shift']());}catch(_0x4efb0c){_0x26f719['push'](_0x26f719['shift']());}}}(a179_0x12d3,0x24989));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x343f50,_0x46bc99={},_0x3f26df={}){const _0x26d15f=a179_0x5b5d;if(_0x3f26df[_0x26d15f(0x1d1)])return runSemanticChecks(_0x343f50,_0x46bc99);const _0x142ba2=SegmentDefSchema[_0x26d15f(0x1c6)](_0x343f50);if(_0x142ba2[_0x26d15f(0x1fc)])return runSemanticChecks(_0x142ba2[_0x26d15f(0x1f4)],_0x46bc99);return zodErrorsToValidationResult(_0x142ba2[_0x26d15f(0x1e8)],_0x46bc99);}export function validateRuleDef(_0xb84da2,_0x5462c9,_0x14cb66){const _0x4400e2=a179_0x5b5d;if(!_0xb84da2)return[];const _0xbfd22f=RuleDefSchema[_0x4400e2(0x1c6)](_0xb84da2);if(_0xbfd22f[_0x4400e2(0x1fc)])return checkRule(_0xbfd22f['data'],_0x5462c9,_0x14cb66);const _0x1c222b=flattenZodIssues(_0xbfd22f['error'][_0x4400e2(0x208)]);return _0x1c222b[_0x4400e2(0x1c4)](_0x44c07b=>{const _0x3285c7=_0x4400e2,_0x489230=formatZodPath(_0x44c07b[_0x3285c7(0x1fb)]),_0x3b35c5=_0x489230?_0x5462c9+'.'+_0x489230:_0x5462c9,_0x395485=mapZodIssueToCode(_0x44c07b,_0x489230),_0x4368f5=getLocationFromPath(_0x14cb66['document'],_0x14cb66[_0x3285c7(0x209)],pathToArray(_0x3b35c5));return{'level':_0x3285c7(0x1e8),'path':_0x3b35c5,'code':_0x395485,'message':_0x44c07b[_0x3285c7(0x1eb)],..._0x4368f5&&{'location':_0x4368f5}};});}function zodErrorsToValidationResult(_0x4241d0,_0x44c916){const _0x7c55c4=a179_0x5b5d,_0x2f95ec=flattenZodIssues(_0x4241d0[_0x7c55c4(0x208)]),_0x3e5b23=_0x2f95ec[_0x7c55c4(0x1c4)](_0x120166=>{const _0x41acb9=_0x7c55c4,_0x57105c=formatZodPath(_0x120166['path']),_0x48084e=mapZodIssueToCode(_0x120166,_0x57105c),_0x38471b=getLocationFromPath(_0x44c916[_0x41acb9(0x1c7)],_0x44c916[_0x41acb9(0x209)],_0x120166[_0x41acb9(0x1fb)]['map'](_0xd5e703=>typeof _0xd5e703===_0x41acb9(0x1bd)?String(_0xd5e703):_0xd5e703));return{'level':_0x41acb9(0x1e8),'path':_0x57105c,'code':_0x48084e,'message':_0x120166[_0x41acb9(0x1eb)],..._0x38471b&&{'location':_0x38471b}};});return{'valid':![],'errors':_0x3e5b23,'warnings':[]};}function mapZodIssueToCode(_0x3d22a2,_0x12ee18){const _0x389c56=a179_0x5b5d,_0x153c38=_0x3d22a2['code']==='custom'?_0x3d22a2['params']:undefined;if(_0x12ee18===_0x389c56(0x1c1))return _0x389c56(0x1da);if(_0x12ee18===_0x389c56(0x1ec)||_0x12ee18[_0x389c56(0x1be)](_0x389c56(0x20d))){if(_0x3d22a2[_0x389c56(0x1c3)]===_0x389c56(0x202)){if(_0x12ee18===_0x389c56(0x1ec)||_0x12ee18[_0x389c56(0x1f7)](/\.conditions\[\d+\]\.type$/))return'INVALID_RULE_TYPE';}}if(_0x12ee18[_0x389c56(0x1be)](_0x389c56(0x1df)))return _0x389c56(0x201);if(_0x12ee18['endsWith'](_0x389c56(0x1ca)))return'MISSING_OPERATOR_VALUE';if(_0x153c38?.[_0x389c56(0x1e6)]==='MISSING_BETWEEN_BOUNDS')return'MISSING_BETWEEN_BOUNDS';if(_0x153c38?.[_0x389c56(0x1e6)]===_0x389c56(0x1d4))return _0x389c56(0x1d4);if(_0x12ee18[_0x389c56(0x1be)](_0x389c56(0x1e7))||_0x12ee18===_0x389c56(0x20c))return'MISSING_CONDITIONS';if(_0x12ee18[_0x389c56(0x1c0)](_0x389c56(0x1cb)))return _0x389c56(0x204);if(_0x12ee18[_0x389c56(0x1be)](_0x389c56(0x1f6)))return _0x389c56(0x1d0);return'SEGMENT_SCHEMA_ERROR';}function a179_0x12d3(){const _0x269997=['error','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','.attribute','message','rule.type','type','295020edNfdb','warning','\x27\x20with\x20attribute\x20\x27','And','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','Value','data','6TsLIHl','.segment','match','filter','not','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','path','success','62772YQinmc','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','1465LAberE','.conditions[','INVALID_OPERATOR_TYPE','invalid_value','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','INVALID_ARRAY_MATCHING','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','1789542tJwbfO','level','issues','source','.operator.not','EMPTY_CONDITIONS','conditions','.type','push','NESTED_CONDITION_GROUP','symbol','endsWith','BEHAVIOR_SOURCE_MISSING_FILTER','includes','name','operator','code','map','3271480gBgwqI','safeParse','document','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','.source','.operator.value','arrayMatching','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','description','MISSING_SEGMENT_REFERENCE','skipSchema','EMPTY_ATTRIBUTE','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','MISSING_TIME_UNIT','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','4866WdJQQd','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','893216PwGATm','aggregation','MISSING_NAME','787318JAQoCW','12uavnjM','length','TimeWithinPast','.operator.type','attribute','rule','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','TEMPORAL_NEGATION_UNSUPPORTED','Behavior','TimeWithinNext','validationCode','.conditions'];a179_0x12d3=function(){return _0x269997;};return a179_0x12d3();}function a179_0x5b5d(_0x5d25e8,_0x4e767c){_0x5d25e8=_0x5d25e8-0x1bb;const _0x12d33f=a179_0x12d3();let _0x5b5d2c=_0x12d33f[_0x5d25e8];return _0x5b5d2c;}function runSemanticChecks(_0x5e49a8,_0x42ccb0){const _0x590dbd=a179_0x5b5d,_0x1dbdae=[];_0x5e49a8[_0x590dbd(0x1e1)]&&_0x1dbdae[_0x590dbd(0x1bb)](...checkRule(_0x5e49a8[_0x590dbd(0x1e1)],'rule',_0x42ccb0));const _0x105cd5=_0x1dbdae[_0x590dbd(0x1f8)](_0x119e4d=>_0x119e4d['level']==='error'),_0x4b8762=_0x1dbdae[_0x590dbd(0x1f8)](_0x169825=>_0x169825[_0x590dbd(0x207)]===_0x590dbd(0x1ef));return{'valid':_0x105cd5[_0x590dbd(0x1dd)]===0x0,'errors':_0x105cd5,'warnings':_0x4b8762};}function checkRule(_0x6a37ed,_0x4e029a,_0x2c4ed0){const _0x2fa011=a179_0x5b5d,_0x101737=[];if(_0x6a37ed[_0x2fa011(0x20c)][_0x2fa011(0x1dd)]===0x0)return _0x101737['push']({'level':'error','path':_0x4e029a+_0x2fa011(0x1e7),'code':'EMPTY_CONDITIONS','message':_0x2fa011(0x1f2),'location':getLocationFromPath(_0x2c4ed0[_0x2fa011(0x1c7)],_0x2c4ed0[_0x2fa011(0x209)],pathToArray(_0x4e029a+'.conditions'))}),_0x101737;return _0x101737[_0x2fa011(0x1bb)](...checkConditions(_0x6a37ed[_0x2fa011(0x20c)],_0x4e029a,_0x2c4ed0)),_0x101737;}function checkConditions(_0xe3e703,_0xd83f6e,_0x57925d){const _0x361e90=a179_0x5b5d,_0xe55265=[];for(let _0x4f6846=0x0;_0x4f6846<_0xe3e703['length'];_0x4f6846++){const _0x4a7367=_0xe3e703[_0x4f6846],_0x35b649=_0xd83f6e+_0x361e90(0x200)+_0x4f6846+']';_0xe55265[_0x361e90(0x1bb)](...checkCondition(_0x4a7367,_0x35b649,_0x57925d));}return _0xe55265;}function checkCondition(_0x256687,_0x18bbdd,_0x49822e){const _0x3d09e3=a179_0x5b5d,_0x359500=[];if(_0x256687['type']===_0x3d09e3(0x1f1)||_0x256687[_0x3d09e3(0x1ed)]==='Or'||_0x256687['type']==='Composite'){if(_0x256687[_0x3d09e3(0x20c)]['length']===0x0)_0x359500[_0x3d09e3(0x1bb)]({'level':_0x3d09e3(0x1e8),'path':_0x18bbdd+_0x3d09e3(0x1e7),'code':_0x3d09e3(0x20b),'message':_0x256687['type']+_0x3d09e3(0x1fe),'location':getLocationFromPath(_0x49822e[_0x3d09e3(0x1c7)],_0x49822e[_0x3d09e3(0x209)],pathToArray(_0x18bbdd+'.conditions'))});else{const _0x374f75=_0x256687[_0x3d09e3(0x1cf)]!==undefined,_0x5b722c=_0x256687[_0x3d09e3(0x1ed)]==='Composite';!_0x374f75&&!_0x5b722c&&_0x359500[_0x3d09e3(0x1bb)]({'level':_0x3d09e3(0x1ef),'path':_0x18bbdd,'code':_0x3d09e3(0x1bc),'message':_0x256687[_0x3d09e3(0x1ed)]+_0x3d09e3(0x1d7)+_0x3d09e3(0x1e9)+_0x3d09e3(0x1ce),'location':getLocationFromPath(_0x49822e[_0x3d09e3(0x1c7)],_0x49822e[_0x3d09e3(0x209)],pathToArray(_0x18bbdd))}),_0x359500[_0x3d09e3(0x1bb)](...checkConditions(_0x256687['conditions'],_0x18bbdd,_0x49822e));}return _0x359500;}if(_0x256687[_0x3d09e3(0x1ed)]===_0x3d09e3(0x1f3)||_0x256687[_0x3d09e3(0x1ed)]===_0x3d09e3(0x1e4)){const _0x38ba71=_0x256687,_0x3e245f=_0x38ba71[_0x3d09e3(0x209)],_0xd04312=_0x38ba71[_0x3d09e3(0x1d9)],_0x537ddd=_0x3e245f||_0xd04312,_0x480aea=_0x38ba71['operator']?.[_0x3d09e3(0x1ed)];if((_0x480aea===_0x3d09e3(0x1de)||_0x480aea===_0x3d09e3(0x1e5))&&_0x38ba71[_0x3d09e3(0x1c2)]?.[_0x3d09e3(0x1f9)]!==undefined){const _0x877779=_0x38ba71[_0x3d09e3(0x1c2)][_0x3d09e3(0x1f9)]===!![];_0x359500[_0x3d09e3(0x1bb)]({'level':_0x877779?_0x3d09e3(0x1e8):'warning','path':_0x18bbdd+_0x3d09e3(0x20a),'code':_0x3d09e3(0x1e3),'message':_0x877779?'Operator\x20\x27'+_0x480aea+_0x3d09e3(0x1e2)+_0x3d09e3(0x203)+_0x3d09e3(0x1cc):'Operator\x20\x27'+_0x480aea+_0x3d09e3(0x1cd)+'Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','location':getLocationFromPath(_0x49822e[_0x3d09e3(0x1c7)],_0x49822e['source'],pathToArray(_0x18bbdd+_0x3d09e3(0x20a)))});}(!_0x38ba71[_0x3d09e3(0x1e0)]||_0x38ba71['attribute']==='')&&(!_0x537ddd&&_0x359500[_0x3d09e3(0x1bb)]({'level':_0x3d09e3(0x1e8),'path':_0x18bbdd+_0x3d09e3(0x1ea),'code':_0x3d09e3(0x1d2),'message':'Attribute\x20name\x20cannot\x20be\x20empty','location':getLocationFromPath(_0x49822e[_0x3d09e3(0x1c7)],_0x49822e[_0x3d09e3(0x209)],pathToArray(_0x18bbdd+'.attribute'))}));_0x38ba71[_0x3d09e3(0x1f8)]&&_0x359500[_0x3d09e3(0x1bb)](...checkRule(_0x38ba71[_0x3d09e3(0x1f8)],_0x18bbdd+'.filter',_0x49822e));if(_0x38ba71[_0x3d09e3(0x209)]){const _0x175e9f=_0x38ba71[_0x3d09e3(0x1e0)]&&_0x38ba71[_0x3d09e3(0x1e0)]!=='';_0x175e9f&&!_0x38ba71[_0x3d09e3(0x1f8)]&&_0x359500[_0x3d09e3(0x1bb)]({'level':'error','path':_0x18bbdd+_0x3d09e3(0x1c9),'code':_0x3d09e3(0x1bf),'message':'Behavior\x20source\x20\x27'+_0x38ba71[_0x3d09e3(0x209)]+_0x3d09e3(0x1f0)+_0x38ba71[_0x3d09e3(0x1e0)]+'\x27\x20'+_0x3d09e3(0x1d3)+_0x3d09e3(0x205)+'Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','location':getLocationFromPath(_0x49822e[_0x3d09e3(0x1c7)],_0x49822e['source'],pathToArray(_0x18bbdd+_0x3d09e3(0x1c9)))}),_0x175e9f&&_0x38ba71[_0x3d09e3(0x1f8)]&&_0x359500[_0x3d09e3(0x1bb)]({'level':_0x3d09e3(0x1ef),'path':_0x18bbdd+'.attribute','code':_0x3d09e3(0x1d5),'message':'Attribute\x20\x27'+_0x38ba71['attribute']+_0x3d09e3(0x1fa)+_0x3d09e3(0x1c8),'location':getLocationFromPath(_0x49822e[_0x3d09e3(0x1c7)],_0x49822e['source'],pathToArray(_0x18bbdd+_0x3d09e3(0x1ea)))});}}return _0x359500;}