@treasuredata/tdx 2026.7.6 → 2026.8.0

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 (325) 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.d.ts.map +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/api-command.js.map +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-command.js.map +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.d.ts.map +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/claude-command.js.map +1 -1
  21. package/dist/commands/claude-statusline-command.js +1 -1
  22. package/dist/commands/claude-usage-command.js +1 -1
  23. package/dist/commands/command.d.ts +8 -0
  24. package/dist/commands/command.d.ts.map +1 -1
  25. package/dist/commands/command.js +1 -1
  26. package/dist/commands/command.js.map +1 -1
  27. package/dist/commands/connection-command.js +1 -1
  28. package/dist/commands/databases.js +1 -1
  29. package/dist/commands/delivery-command.js +1 -1
  30. package/dist/commands/describe.js +1 -1
  31. package/dist/commands/engage-always-on-campaign-pull-command.d.ts +16 -0
  32. package/dist/commands/engage-always-on-campaign-pull-command.d.ts.map +1 -0
  33. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -0
  34. package/dist/commands/engage-always-on-campaign-pull-command.js.map +1 -0
  35. package/dist/commands/engage-always-on-campaign-push-command.d.ts +16 -0
  36. package/dist/commands/engage-always-on-campaign-push-command.d.ts.map +1 -0
  37. package/dist/commands/engage-always-on-campaign-push-command.js +1 -0
  38. package/dist/commands/engage-always-on-campaign-push-command.js.map +1 -0
  39. package/dist/commands/engage-always-on-campaign-validate-command.d.ts +16 -0
  40. package/dist/commands/engage-always-on-campaign-validate-command.d.ts.map +1 -0
  41. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -0
  42. package/dist/commands/engage-always-on-campaign-validate-command.js.map +1 -0
  43. package/dist/commands/engage-campaign-pull-command.js +1 -1
  44. package/dist/commands/engage-campaign-push-command.js +1 -1
  45. package/dist/commands/engage-campaign-validate-command.js +1 -1
  46. package/dist/commands/engage-command.d.ts +1 -1
  47. package/dist/commands/engage-command.js +1 -1
  48. package/dist/commands/engage-template-pull-command.js +1 -1
  49. package/dist/commands/engage-template-push-command.js +1 -1
  50. package/dist/commands/engage-template-validate-command.js +1 -1
  51. package/dist/commands/job-command.js +1 -1
  52. package/dist/commands/journey-command.js +1 -1
  53. package/dist/commands/journey-validate-command.js +1 -1
  54. package/dist/commands/llm-command.js +1 -1
  55. package/dist/commands/mcp-command.js +1 -1
  56. package/dist/commands/parent-segment-command.js +1 -1
  57. package/dist/commands/policy-command.js +1 -1
  58. package/dist/commands/profile-command.js +1 -1
  59. package/dist/commands/profile-command.js.map +1 -1
  60. package/dist/commands/profiles-command.js +1 -1
  61. package/dist/commands/query-command.js +1 -1
  62. package/dist/commands/schedule-command.js +1 -1
  63. package/dist/commands/segment-command.js +1 -1
  64. package/dist/commands/segment-create-command.js +1 -1
  65. package/dist/commands/segment-fields-command.js +1 -1
  66. package/dist/commands/segment-move-command.js +1 -1
  67. package/dist/commands/segment-pull-command.js +1 -1
  68. package/dist/commands/segment-push-command.d.ts.map +1 -1
  69. package/dist/commands/segment-push-command.js +1 -1
  70. package/dist/commands/segment-push-command.js.map +1 -1
  71. package/dist/commands/segment-update-command.js +1 -1
  72. package/dist/commands/segment-use-command.js +1 -1
  73. package/dist/commands/segment-validate-command.js +1 -1
  74. package/dist/commands/segments.js +1 -1
  75. package/dist/commands/show.js +1 -1
  76. package/dist/commands/status-command.d.ts.map +1 -1
  77. package/dist/commands/status-command.js +1 -1
  78. package/dist/commands/status-command.js.map +1 -1
  79. package/dist/commands/table-deleted.js +1 -1
  80. package/dist/commands/tables.js +1 -1
  81. package/dist/commands/unset-command.js +1 -1
  82. package/dist/commands/upgrade-command.js +1 -1
  83. package/dist/commands/use-command.d.ts.map +1 -1
  84. package/dist/commands/use-command.js +1 -1
  85. package/dist/commands/use-command.js.map +1 -1
  86. package/dist/commands/user-command.js +1 -1
  87. package/dist/commands/work-command.js +1 -1
  88. package/dist/commands/workflow-command.js +1 -1
  89. package/dist/core/auth.js +1 -1
  90. package/dist/core/command-output.js +1 -1
  91. package/dist/core/config.js +1 -1
  92. package/dist/core/connection-cache.js +1 -1
  93. package/dist/core/constants.js +1 -1
  94. package/dist/core/credential-cache.js +1 -1
  95. package/dist/core/global-context.d.ts +35 -1
  96. package/dist/core/global-context.d.ts.map +1 -1
  97. package/dist/core/global-context.js +1 -1
  98. package/dist/core/global-context.js.map +1 -1
  99. package/dist/core/keychain.js +1 -1
  100. package/dist/core/oauth-keychain.js +1 -1
  101. package/dist/core/oauth.js +1 -1
  102. package/dist/core/profile.js +1 -1
  103. package/dist/core/project-config.js +1 -1
  104. package/dist/core/session.js +1 -1
  105. package/dist/core/site-mismatch.d.ts +68 -0
  106. package/dist/core/site-mismatch.d.ts.map +1 -0
  107. package/dist/core/site-mismatch.js +1 -0
  108. package/dist/core/site-mismatch.js.map +1 -0
  109. package/dist/core/user-cache.js +1 -1
  110. package/dist/core/version.js +1 -1
  111. package/dist/index.js +1 -1
  112. package/dist/mcp/server.js +1 -1
  113. package/dist/mcp/tools/index.js +1 -1
  114. package/dist/mcp/tools/tdx-run.js +1 -1
  115. package/dist/mcp/tools/tdx-search.js +1 -1
  116. package/dist/mcp/tools/work-create-item.js +1 -1
  117. package/dist/mcp/utils.js +1 -1
  118. package/dist/proxy/claude-usage-tracker.js +1 -1
  119. package/dist/proxy/passthrough-server.js +1 -1
  120. package/dist/proxy/sse-usage-parser.js +1 -1
  121. package/dist/sdk/agent/agent-config.js +1 -1
  122. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  123. package/dist/sdk/agent/agent-yaml.js +1 -1
  124. package/dist/sdk/agent/test/evaluator.js +1 -1
  125. package/dist/sdk/agent/test/executor.js +1 -1
  126. package/dist/sdk/agent/test/index.js +1 -1
  127. package/dist/sdk/agent/test/output.js +1 -1
  128. package/dist/sdk/agent/test/parser.js +1 -1
  129. package/dist/sdk/agent/tool-target-registry.js +1 -1
  130. package/dist/sdk/api.js +1 -1
  131. package/dist/sdk/cas/cas-api-client.js +1 -1
  132. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  133. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  134. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  135. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  136. package/dist/sdk/cas/index.js +1 -1
  137. package/dist/sdk/cas/pull-workflow.js +1 -1
  138. package/dist/sdk/cas/push-workflow.js +1 -1
  139. package/dist/sdk/cas/validate-files.js +1 -1
  140. package/dist/sdk/client/cdp-api-client.js +1 -1
  141. package/dist/sdk/client/delivery-api-client.js +1 -1
  142. package/dist/sdk/client/endpoints.js +1 -1
  143. package/dist/sdk/client/engage-api-client.d.ts +1 -1
  144. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  145. package/dist/sdk/client/engage-api-client.js +1 -1
  146. package/dist/sdk/client/engage-api-client.js.map +1 -1
  147. package/dist/sdk/client/http-client.js +1 -1
  148. package/dist/sdk/client/llm-api-client.js +1 -1
  149. package/dist/sdk/client/oauth-refresh.js +1 -1
  150. package/dist/sdk/client/rate-limiter.js +1 -1
  151. package/dist/sdk/client/td-api-client.js +1 -1
  152. package/dist/sdk/client/trino-api-client.js +1 -1
  153. package/dist/sdk/client/workflow-client.js +1 -1
  154. package/dist/sdk/connection-validator.d.ts +7 -4
  155. package/dist/sdk/connection-validator.d.ts.map +1 -1
  156. package/dist/sdk/connection-validator.js +1 -1
  157. package/dist/sdk/connection-validator.js.map +1 -1
  158. package/dist/sdk/connection.d.ts +15 -0
  159. package/dist/sdk/connection.d.ts.map +1 -1
  160. package/dist/sdk/connection.js +1 -1
  161. package/dist/sdk/connection.js.map +1 -1
  162. package/dist/sdk/delivery.js +1 -1
  163. package/dist/sdk/engage/always-on-campaign-pull.d.ts +66 -0
  164. package/dist/sdk/engage/always-on-campaign-pull.d.ts.map +1 -0
  165. package/dist/sdk/engage/always-on-campaign-pull.js +1 -0
  166. package/dist/sdk/engage/always-on-campaign-pull.js.map +1 -0
  167. package/dist/sdk/engage/always-on-campaign-push.d.ts +93 -0
  168. package/dist/sdk/engage/always-on-campaign-push.d.ts.map +1 -0
  169. package/dist/sdk/engage/always-on-campaign-push.js +1 -0
  170. package/dist/sdk/engage/always-on-campaign-push.js.map +1 -0
  171. package/dist/sdk/engage/always-on-campaign-validator.d.ts +18 -0
  172. package/dist/sdk/engage/always-on-campaign-validator.d.ts.map +1 -0
  173. package/dist/sdk/engage/always-on-campaign-validator.js +1 -0
  174. package/dist/sdk/engage/always-on-campaign-validator.js.map +1 -0
  175. package/dist/sdk/engage/always-on-campaign-yaml.d.ts +62 -0
  176. package/dist/sdk/engage/always-on-campaign-yaml.d.ts.map +1 -0
  177. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -0
  178. package/dist/sdk/engage/always-on-campaign-yaml.js.map +1 -0
  179. package/dist/sdk/engage/campaign-pull.js +1 -1
  180. package/dist/sdk/engage/campaign-push.js +1 -1
  181. package/dist/sdk/engage/campaign-validator.js +1 -1
  182. package/dist/sdk/engage/campaign-yaml.js +1 -1
  183. package/dist/sdk/engage/campaign-yaml.js.map +1 -1
  184. package/dist/sdk/engage/template-pull.js +1 -1
  185. package/dist/sdk/engage/template-push.js +1 -1
  186. package/dist/sdk/engage/template-validator.js +1 -1
  187. package/dist/sdk/engage/template-yaml.js +1 -1
  188. package/dist/sdk/engage/types/always-on-campaign-schema.d.ts +125 -0
  189. package/dist/sdk/engage/types/always-on-campaign-schema.d.ts.map +1 -0
  190. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -0
  191. package/dist/sdk/engage/types/always-on-campaign-schema.js.map +1 -0
  192. package/dist/sdk/engage/types/campaign-def.js +1 -1
  193. package/dist/sdk/engage/types/campaign-schema.d.ts +8 -8
  194. package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
  195. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  196. package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
  197. package/dist/sdk/engage/types/template-schema.js +1 -1
  198. package/dist/sdk/engage.d.ts +20 -0
  199. package/dist/sdk/engage.d.ts.map +1 -1
  200. package/dist/sdk/engage.js +1 -1
  201. package/dist/sdk/engage.js.map +1 -1
  202. package/dist/sdk/errors.d.ts +13 -2
  203. package/dist/sdk/errors.d.ts.map +1 -1
  204. package/dist/sdk/errors.js +1 -1
  205. package/dist/sdk/errors.js.map +1 -1
  206. package/dist/sdk/index.js +1 -1
  207. package/dist/sdk/io/index.js +1 -1
  208. package/dist/sdk/io/node-filesystem.js +1 -1
  209. package/dist/sdk/job.js +1 -1
  210. package/dist/sdk/journey.js +1 -1
  211. package/dist/sdk/llm/chat-cache.js +1 -1
  212. package/dist/sdk/llm/index.js +1 -1
  213. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  214. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  215. package/dist/sdk/llm/model-factors.js +1 -1
  216. package/dist/sdk/llm/model-factors.js.map +1 -1
  217. package/dist/sdk/llm/user-settings.js +1 -1
  218. package/dist/sdk/personalization.js +1 -1
  219. package/dist/sdk/policy.js +1 -1
  220. package/dist/sdk/query/deleted-table-validation.js +1 -1
  221. package/dist/sdk/query/index.js +1 -1
  222. package/dist/sdk/query/sql-parser.js +1 -1
  223. package/dist/sdk/realtime.js +1 -1
  224. package/dist/sdk/schedule.js +1 -1
  225. package/dist/sdk/segment/child-segment-yaml.d.ts +12 -2
  226. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  227. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  228. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  229. package/dist/sdk/segment/fields-display.js +1 -1
  230. package/dist/sdk/segment/file-discovery.js +1 -1
  231. package/dist/sdk/segment/journey-utils.js +1 -1
  232. package/dist/sdk/segment/journey-validator.js +1 -1
  233. package/dist/sdk/segment/journey-yaml.js +1 -1
  234. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  235. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  236. package/dist/sdk/segment/pull-workflow.js +1 -1
  237. package/dist/sdk/segment/push-recovery.js +1 -1
  238. package/dist/sdk/segment/push-workflow.js +1 -1
  239. package/dist/sdk/segment/resolution-context.js +1 -1
  240. package/dist/sdk/segment/segment-path-parser.js +1 -1
  241. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  242. package/dist/sdk/segment/segment-validator.js +1 -1
  243. package/dist/sdk/segment/target-resolution.js +1 -1
  244. package/dist/sdk/segment/tdx-config.js +1 -1
  245. package/dist/sdk/segment/types/activation-schema.js +1 -1
  246. package/dist/sdk/segment/types/journey-def.js +1 -1
  247. package/dist/sdk/segment/types/journey-schema.js +1 -1
  248. package/dist/sdk/segment/types/segment-def.js +1 -1
  249. package/dist/sdk/segment/types/segment-schema.js +1 -1
  250. package/dist/sdk/segment/validate-files.d.ts +6 -1
  251. package/dist/sdk/segment/validate-files.d.ts.map +1 -1
  252. package/dist/sdk/segment/validate-files.js +1 -1
  253. package/dist/sdk/segment/validate-files.js.map +1 -1
  254. package/dist/sdk/segment/yaml-validator.js +1 -1
  255. package/dist/sdk/segment.js +1 -1
  256. package/dist/sdk/types/engage.d.ts +31 -5
  257. package/dist/sdk/types/engage.d.ts.map +1 -1
  258. package/dist/sdk/types/index.d.ts +1 -1
  259. package/dist/sdk/types/index.d.ts.map +1 -1
  260. package/dist/sdk/types/index.js +1 -1
  261. package/dist/sdk/types/progress.js +1 -1
  262. package/dist/sdk/types/workspace.js +1 -1
  263. package/dist/sdk/user.js +1 -1
  264. package/dist/sdk/util/format-detector.js +1 -1
  265. package/dist/sdk/util/formatters.js +1 -1
  266. package/dist/sdk/util/index.js +1 -1
  267. package/dist/sdk/util/paginate.js +1 -1
  268. package/dist/sdk/util/tree-formatter.js +1 -1
  269. package/dist/sdk/util/tree-search.js +1 -1
  270. package/dist/sdk/workflow/archive-validation.js +1 -1
  271. package/dist/sdk/workflow/clone-workflow.js +1 -1
  272. package/dist/sdk/workflow/index.js +1 -1
  273. package/dist/sdk/workflow/pull-workflow.js +1 -1
  274. package/dist/sdk/workflow/push-workflow.js +1 -1
  275. package/dist/sdk/workflow/task-graph.js +1 -1
  276. package/dist/sdk/workflow/tdx-config.js +1 -1
  277. package/dist/sdk/workflow/workflow-utils.js +1 -1
  278. package/dist/sdk/workspace/access-tracker.js +1 -1
  279. package/dist/sdk/workspace/frontmatter.js +1 -1
  280. package/dist/sdk/workspace/git.js +1 -1
  281. package/dist/sdk/workspace/index.js +1 -1
  282. package/dist/sdk/workspace/templates.js +1 -1
  283. package/dist/sdk/workspace/weekly.js +1 -1
  284. package/dist/sdk/workspace/wikilinks.js +1 -1
  285. package/dist/test-utils/command-runner.js +1 -1
  286. package/dist/test-utils/factories.d.ts +6 -0
  287. package/dist/test-utils/factories.d.ts.map +1 -1
  288. package/dist/test-utils/factories.js +1 -1
  289. package/dist/test-utils/factories.js.map +1 -1
  290. package/dist/test-utils/fixtures.js +1 -1
  291. package/dist/test-utils/http-mock.js +1 -1
  292. package/dist/test-utils/index.d.ts +1 -1
  293. package/dist/test-utils/index.d.ts.map +1 -1
  294. package/dist/test-utils/index.js +1 -1
  295. package/dist/test-utils/index.js.map +1 -1
  296. package/dist/utils/async.js +1 -1
  297. package/dist/utils/claude-code-state.js +1 -1
  298. package/dist/utils/colors.js +1 -1
  299. package/dist/utils/diff.js +1 -1
  300. package/dist/utils/file-permissions.js +1 -1
  301. package/dist/utils/file-reader.js +1 -1
  302. package/dist/utils/github-releases.js +1 -1
  303. package/dist/utils/global-cache.js +1 -1
  304. package/dist/utils/json-loader.js +1 -1
  305. package/dist/utils/local-cache.js +1 -1
  306. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  307. package/dist/utils/logger/formatters/index.js +1 -1
  308. package/dist/utils/logger/handlers/console-handler.js +1 -1
  309. package/dist/utils/logger/handlers/file-handler.js +1 -1
  310. package/dist/utils/logger/handlers/index.js +1 -1
  311. package/dist/utils/logger/handlers/null-handler.js +1 -1
  312. package/dist/utils/logger/index.js +1 -1
  313. package/dist/utils/logger/logger.js +1 -1
  314. package/dist/utils/logger/types.js +1 -1
  315. package/dist/utils/option-validation.js +1 -1
  316. package/dist/utils/process.js +1 -1
  317. package/dist/utils/prompt.js +1 -1
  318. package/dist/utils/proxy-fetch.js +1 -1
  319. package/dist/utils/spinner.js +1 -1
  320. package/dist/utils/sse-parser.js +1 -1
  321. package/dist/utils/string-utils.js +1 -1
  322. package/dist/utils/table-ref-parser.js +1 -1
  323. package/dist/utils/tdx-logger.js +1 -1
  324. package/dist/utils/version-check.js +1 -1
  325. package/package.json +1 -1
@@ -1 +1 @@
1
- const a158_0x3f476a=a158_0x4eba;(function(_0x21b47a,_0x33dbb2){const _0x5baa9a=a158_0x4eba,_0xd139eb=_0x21b47a();while(!![]){try{const _0x17da37=-parseInt(_0x5baa9a(0x100))/0x1+parseInt(_0x5baa9a(0x108))/0x2*(-parseInt(_0x5baa9a(0x110))/0x3)+parseInt(_0x5baa9a(0xfd))/0x4+-parseInt(_0x5baa9a(0x101))/0x5*(-parseInt(_0x5baa9a(0xf6))/0x6)+-parseInt(_0x5baa9a(0x102))/0x7*(-parseInt(_0x5baa9a(0x107))/0x8)+-parseInt(_0x5baa9a(0x104))/0x9+parseInt(_0x5baa9a(0xfe))/0xa;if(_0x17da37===_0x33dbb2)break;else _0xd139eb['push'](_0xd139eb['shift']());}catch(_0x2f38e4){_0xd139eb['push'](_0xd139eb['shift']());}}}(a158_0x353f,0xd0d2f));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';function a158_0x4eba(_0x4de1f8,_0x1102c6){_0x4de1f8=_0x4de1f8-0xf4;const _0x353f02=a158_0x353f();let _0x4eba0e=_0x353f02[_0x4de1f8];return _0x4eba0e;}import a158_0x235e05 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a158_0x3f476a(0x10e));export function getPushRecoveryPath(_0x123c8e){const _0x13db0f=a158_0x3f476a,_0x4ff7bd=a158_0x235e05['dirname'](_0x123c8e),_0x2f8f5a=a158_0x235e05[_0x13db0f(0xf7)](_0x123c8e);return a158_0x235e05[_0x13db0f(0x10f)](_0x4ff7bd,'.'+_0x2f8f5a+_0x13db0f(0xfa));}export function readPushRecovery(_0x368107){const _0x275160=a158_0x3f476a,_0x28c931=getPushRecoveryPath(_0x368107);if(!existsSync(_0x28c931))return undefined;try{const _0x467503=readFileSync(_0x28c931,_0x275160(0xf4)),_0x5ae950=JSON[_0x275160(0xf5)](_0x467503);if(_0x5ae950?.[_0x275160(0x10d)]!==0x1||typeof _0x5ae950[_0x275160(0xf8)]!==_0x275160(0xf9))return undefined;return _0x5ae950;}catch(_0x4567f8){return _0x4567f8 instanceof SyntaxError?logger['debug'](_0x275160(0x105)+_0x4567f8):logger[_0x275160(0xff)](_0x275160(0x106)+_0x4567f8),undefined;}}export function writePushRecovery(_0x1101e2,_0x1e2a06){const _0x42af8e=a158_0x3f476a,_0x4c267a=getPushRecoveryPath(_0x1101e2),_0x3c932d=_0x4c267a+_0x42af8e(0xfc);writeFileSync(_0x3c932d,JSON[_0x42af8e(0x10c)](_0x1e2a06,null,0x2)+'\x0a',_0x42af8e(0xf4)),renameSync(_0x3c932d,_0x4c267a);}function a158_0x353f(){const _0x5a51aa=['10310967depyYP','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','8fprqeE','6740kWLOEJ','ENOENT','code','debug','stringify','version','tdx.sdk.push-recovery','join','393KwYpXe','utf-8','parse','430566jkuKTm','basename','journeyName','string','.push-recovery.json','segments','.tmp','4346312BVOTnH','19482480FhAUXV','warn','1687704MQJaqx','40tmZRIr','3648862FhcVfY','toISOString'];a158_0x353f=function(){return _0x5a51aa;};return a158_0x353f();}export function deletePushRecovery(_0x9c7134){const _0x509822=a158_0x3f476a,_0x11a20d=getPushRecoveryPath(_0x9c7134);try{unlinkSync(_0x11a20d);}catch(_0x3ee03b){_0x3ee03b[_0x509822(0x10a)]!==_0x509822(0x109)&&logger[_0x509822(0x10b)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x3ee03b);}}export function saveSegmentToPushRecovery(_0x9be635,_0x51951d,_0x884744,_0x4e6ee3){const _0x59948e=a158_0x3f476a,_0x23a756=readPushRecovery(_0x9be635),_0x1702df=_0x23a756?.[_0x59948e(0xf8)]===_0x51951d?{..._0x23a756,'updatedAt':new Date()[_0x59948e(0x103)]()}:{'version':0x1,'journeyName':_0x51951d,'updatedAt':new Date()[_0x59948e(0x103)](),'segments':{}};_0x1702df[_0x59948e(0xfb)][_0x884744]=_0x4e6ee3,writePushRecovery(_0x9be635,_0x1702df);}
1
+ function a167_0x7d98(_0x23ca0b,_0x3e2861){_0x23ca0b=_0x23ca0b-0x146;const _0xd27f02=a167_0xd27f();let _0x7d989=_0xd27f02[_0x23ca0b];return _0x7d989;}(function(_0x55a41c,_0x4cda77){const _0x130cd8=a167_0x7d98,_0x16ef87=_0x55a41c();while(!![]){try{const _0x34c37c=parseInt(_0x130cd8(0x150))/0x1+parseInt(_0x130cd8(0x14a))/0x2*(parseInt(_0x130cd8(0x157))/0x3)+-parseInt(_0x130cd8(0x147))/0x4+parseInt(_0x130cd8(0x14f))/0x5+parseInt(_0x130cd8(0x15d))/0x6+parseInt(_0x130cd8(0x15c))/0x7+-parseInt(_0x130cd8(0x158))/0x8*(parseInt(_0x130cd8(0x149))/0x9);if(_0x34c37c===_0x4cda77)break;else _0x16ef87['push'](_0x16ef87['shift']());}catch(_0x4f0106){_0x16ef87['push'](_0x16ef87['shift']());}}}(a167_0xd27f,0xa5e5b));function a167_0xd27f(){const _0x1bac9e=['1103994xVfTII','24328936AQJOLI','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','parse','.tmp','3720346OEjnNO','7312158bUUUww','join','utf-8','stringify','207192PTiolQ','ENOENT','9ktXJGx','4HJbVHW','version','code','journeyName','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','2091445YGLSal','867974kDrVNn','toISOString','dirname','string','debug','warn','basename'];a167_0xd27f=function(){return _0x1bac9e;};return a167_0xd27f();}import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a167_0x476d40 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x20795d){const _0x4b40c6=a167_0x7d98,_0xcb9947=a167_0x476d40[_0x4b40c6(0x152)](_0x20795d),_0xc27bb6=a167_0x476d40[_0x4b40c6(0x156)](_0x20795d);return a167_0x476d40[_0x4b40c6(0x15e)](_0xcb9947,'.'+_0xc27bb6+'.push-recovery.json');}export function readPushRecovery(_0x91671){const _0x28d08a=a167_0x7d98,_0x288626=getPushRecoveryPath(_0x91671);if(!existsSync(_0x288626))return undefined;try{const _0x358313=readFileSync(_0x288626,'utf-8'),_0x56d01c=JSON[_0x28d08a(0x15a)](_0x358313);if(_0x56d01c?.[_0x28d08a(0x14b)]!==0x1||typeof _0x56d01c[_0x28d08a(0x14d)]!==_0x28d08a(0x153))return undefined;return _0x56d01c;}catch(_0x5960af){return _0x5960af instanceof SyntaxError?logger[_0x28d08a(0x154)](_0x28d08a(0x159)+_0x5960af):logger[_0x28d08a(0x155)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x5960af),undefined;}}export function writePushRecovery(_0x33da70,_0x22af26){const _0x142256=a167_0x7d98,_0x3dadfe=getPushRecoveryPath(_0x33da70),_0xca2f1b=_0x3dadfe+_0x142256(0x15b);writeFileSync(_0xca2f1b,JSON[_0x142256(0x146)](_0x22af26,null,0x2)+'\x0a',_0x142256(0x15f)),renameSync(_0xca2f1b,_0x3dadfe);}export function deletePushRecovery(_0x34943c){const _0x1220ae=a167_0x7d98,_0x3902b5=getPushRecoveryPath(_0x34943c);try{unlinkSync(_0x3902b5);}catch(_0x23659f){_0x23659f[_0x1220ae(0x14c)]!==_0x1220ae(0x148)&&logger[_0x1220ae(0x154)](_0x1220ae(0x14e)+_0x23659f);}}export function saveSegmentToPushRecovery(_0x737bd9,_0x164cd2,_0x1c9c14,_0x419b5d){const _0x1e2a90=a167_0x7d98,_0x151427=readPushRecovery(_0x737bd9),_0x3497e3=_0x151427?.[_0x1e2a90(0x14d)]===_0x164cd2?{..._0x151427,'updatedAt':new Date()[_0x1e2a90(0x151)]()}:{'version':0x1,'journeyName':_0x164cd2,'updatedAt':new Date()[_0x1e2a90(0x151)](),'segments':{}};_0x3497e3['segments'][_0x1c9c14]=_0x419b5d,writePushRecovery(_0x737bd9,_0x3497e3);}
@@ -1 +1 @@
1
- const a159_0x2fc205=a159_0x1b1a;(function(_0x5609d4,_0x514bc7){const _0x1ef2a5=a159_0x1b1a,_0x51a13d=_0x5609d4();while(!![]){try{const _0x4e359a=parseInt(_0x1ef2a5(0x287))/0x1*(parseInt(_0x1ef2a5(0x221))/0x2)+parseInt(_0x1ef2a5(0x1e8))/0x3*(parseInt(_0x1ef2a5(0x215))/0x4)+-parseInt(_0x1ef2a5(0x1d5))/0x5*(-parseInt(_0x1ef2a5(0x1ec))/0x6)+-parseInt(_0x1ef2a5(0x1e5))/0x7+parseInt(_0x1ef2a5(0x296))/0x8+-parseInt(_0x1ef2a5(0x28c))/0x9*(-parseInt(_0x1ef2a5(0x269))/0xa)+-parseInt(_0x1ef2a5(0x230))/0xb*(parseInt(_0x1ef2a5(0x259))/0xc);if(_0x4e359a===_0x514bc7)break;else _0x51a13d['push'](_0x51a13d['shift']());}catch(_0x5362de){_0x51a13d['push'](_0x51a13d['shift']());}}}(a159_0x7767,0x5690a));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a159_0x2fc205(0x1e1);function a159_0x7767(){const _0x1a5931=['add','entry','uniqueServerName','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','SEGMENT_UPDATE_ERROR','\x20journey\x20from\x20file:\x20','\x27\x20for\x20','Activation','listActivations','yamlActivation','embedded_activation_created','activation_creating',').\x20','getSegment\x20failed\x20for\x20','existingSegments','isNew','null','Delete\x20the\x20push\x20recovery\x20file\x20(','folderId','draft','exitCriterias','deleted','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Updated\x20activation\x20\x27','291473qQBpPx','journeyBundlesByFolderAndName','replace','NOT_FOUND','existingSegment','8343DnvYhL','INTERNAL','get','sort','embeddedSegmentNameToId','hasChanges','Created\x20folder\x20\x27','user','activationStepsById','rootFolderId','5087336WIZNlO','values','size','createActivation','Deleting\x20activation\x20\x27','\x20activation\x20\x27','waitStepUnit','\x27\x20entry\x20criteria','uniqueSegmentName','parseDocument','utf-8','created','SEGMENT_NOT_FOUND','Created\x20journey\x20\x27','updated','branches','activation_deleting','yamlConfig','errors','journeyBundleId','journeyActivationStepId','Entry\x20criteria:\x20','journeyId','\x20error(s)','activation_updated','results','delete','columns','activationActions','activations','entries','folderPathToId','../../utils/async.js','\x20(referenced\x20in\x20journey\x20','getSegmentEntity','goal','stage\x20\x27','behavior','index','getLatestJourneyId','progress','ACTIVATION_UPDATE_ERROR','Creating\x20segment\x20\x27','parentId','Updated\x20segment\x20\x27','validatedRequest','existingActivation','folder','set','deps','with','flatMap','entry_criteria','reduce','Creating\x20folder\x20\x27','\x27\x20exit\x20criteria','Deleted\x20activation\x20\x27','behaviors','stringify','data','milestone','updateActivation','journeyStages','fetchJourney','):\x20','from','resolveJourneyId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','journeyById','Updating\x20activation\x20\x27','activation_','10pwFbIM','segment','day','resolvedRule','skipSegments','rule','segmentByFolderAndName','find','segmentNameToId','parentFolder','JOURNEY_SYNTAX_ERROR','list','__pending_','verbose','notification','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','1991094SyDfQO','journey_created','./child-segment-yaml.js','48ONNoSb','isArray','localName','buildUserMaps','742890osssPR','Failed\x20to\x20fetch\x20referenced\x20segment\x20','conditionTimeoutDuration','\x27\x20from\x20file:\x20','folder_creating','toString','Failed\x20to\x20resolve\x20segment\x20','Updating\x20segment\x20\x27','split','createSegment','relationships','Activation\x20not\x20found:\x20','digest','segment_updated','action','segmentId','trim','\x20segment\x20from\x20file:\x20','logDeleted','conditions','conditionSegmentId','activationContext','schedule','versionNumber','object','effectiveFolderId','sha1','\x27\x20not\x20found\x20in\x20journey\x20\x27','\x0a\x20\x20','segment_creating','relative','createJourneySegment','createdSegmentId','WaitStep','onProgress','state','conditionTimeoutUnit','getSegment','Duration','withProgress','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','94728jPcRSs','slice','./journey-yaml.js','journey','dirname','logWarning','getJourney','all_columns','absolutePath','has','activation_updating','journeyActivationNameToId','2JajoAL','decision_point','create','connector_config','activationsBySegmentId','filter','attributes','entryCriteria','startsWith','join','createFolder','Failed\x20to\x20','Journey\x20\x27','idToEmailMap','journeys','10278257KfugOW','segmentFolderId','segment_updating','\x27\x20wait\x20condition','message','parse','Stage\x20\x27','connectionIdToNameMap','valid','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','keys','Embedded\x20segment\x20\x27','resolveSegment','Updated\x20journey\x20\x27','folder_created','\x27...','Created\x20activation\x20\x27','description','waitStep','update','toLowerCase','parentSegmentFolder','embedded_segment_created','activationParams','push','waitStepType','steps','\x27\x20by\x20rule\x20content','run_after_journey_refresh','match','embedded_segment_creating','DecisionPoint','existingJourney','folderPath','activation_deleted','journey_updated','type',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','item','activation_template_id','debug','12wQlUbJ','all','Fetching\x20','segments','length','unchanged','Condition','map','journeyName','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','name','deleteActivation','Deleted\x20segment\x20\x27','journeyBundleName','journey_updating','logSuccess','210hLceUP','kind','max','updateSegmentById','activation_created','Created\x20segment\x20\x27'];a159_0x7767=function(){return _0x1a5931;};return a159_0x7767();}export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x1a1658){return''+PENDING_SEGMENT_PREFIX+_0x1a1658+'__';}export function isPendingSegmentId(_0x11f766){const _0x755638=a159_0x2fc205;return _0x11f766[_0x755638(0x229)](PENDING_SEGMENT_PREFIX)&&!_0x11f766[_0x755638(0x229)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x43584b){return _0x43584b['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x38c64e){return''+PENDING_ACTIVATION_PREFIX+_0x38c64e+'__';}export function isPendingActivationId(_0x2366d6){const _0xaced7e=a159_0x2fc205;return _0x2366d6[_0xaced7e(0x229)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x34aac3){return _0x34aac3['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4c6137,_0x433da9){const _0x52ea07=a159_0x2fc205,_0x3ee405=_0x4c6137+'::'+(_0x433da9[_0x52ea07(0x1fc)]()||'segment'),_0x4bc823=createHash(_0x52ea07(0x206))[_0x52ea07(0x243)](_0x3ee405)[_0x52ea07(0x1f8)]('hex')[_0x52ea07(0x216)](0x0,0xc);return'journey_entry_criteria_'+_0x4bc823;}export function ensureJourneyDefaults(_0x24f6ff){const _0x219ae0=a159_0x2fc205;!_0x24f6ff['description']&&(_0x24f6ff[_0x219ae0(0x241)]=''),!_0x24f6ff[_0x219ae0(0x20f)]&&(_0x24f6ff[_0x219ae0(0x20f)]=_0x219ae0(0x282));}export function injectExistingStageIds(_0x2c4dbe,_0x3bcf8a){const _0x36b0e9=a159_0x2fc205,_0x3a6f24=new Map(_0x3bcf8a[_0x36b0e9(0x260)](_0x5c0b67=>[_0x5c0b67[_0x36b0e9(0x263)],_0x5c0b67['id']]));for(const _0x2b487a of _0x2c4dbe){if(!_0x2b487a['id']){const _0x2eb2b4=_0x3a6f24[_0x36b0e9(0x28e)](_0x2b487a['name']);_0x2eb2b4&&(_0x2b487a['id']=_0x2eb2b4);}}}export function resolveTDFolderPath(_0x42f2ae,_0x30fec1,_0x52cddb){const _0x172791=a159_0x2fc205;if(!_0x30fec1)return _0x42f2ae;if(_0x42f2ae===_0x52cddb||_0x42f2ae[_0x172791(0x229)](_0x52cddb+'/'))return _0x42f2ae;return _0x42f2ae?_0x52cddb+'/'+_0x42f2ae:_0x52cddb;}export function addFoldersToCreate(_0x22d024,_0xf6c270,_0x100322){const _0x6a0d29=a159_0x2fc205;if(!_0x22d024)return;if(_0xf6c270[_0x6a0d29(0x21e)](_0x22d024))return;const _0x10e48e=_0x22d024[_0x6a0d29(0x1f4)]('/');let _0xaad7c2='';for(const _0x573206 of _0x10e48e){_0xaad7c2=_0xaad7c2?_0xaad7c2+'/'+_0x573206:_0x573206,!_0xf6c270[_0x6a0d29(0x21e)](_0xaad7c2)&&_0x100322[_0x6a0d29(0x26f)](_0xaad7c2);}}export function sortFoldersByDepth(_0x26ce05){return[..._0x26ce05]['sort']((_0x56a9f0,_0x51102e)=>{const _0x138f45=a159_0x1b1a,_0x2c5ffb=(_0x56a9f0[_0x138f45(0x24d)](/\//g)||[])[_0x138f45(0x25d)],_0x1fe7a9=(_0x51102e[_0x138f45(0x24d)](/\//g)||[])[_0x138f45(0x25d)];return _0x2c5ffb-_0x1fe7a9;});}import*as a159_0x12c7d7 from'yaml';import{readFileSync}from'fs';import a159_0x21ac3d from'path';import{isJourneyDef,parseYamlString as a159_0x54c9f5,toYamlString as a159_0x273875,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(_0x12787f){const _0xec267f=a159_0x2fc205;if(Array[_0xec267f(0x1e9)](_0x12787f))return'['+_0x12787f[_0xec267f(0x260)](_0x20844e=>stableStringify(_0x20844e))[_0xec267f(0x22a)](',')+']';if(_0x12787f&&typeof _0x12787f===_0xec267f(0x204)){const _0x18fd16=_0x12787f,_0x16dbc2=Object['keys'](_0x18fd16)[_0xec267f(0x28f)](),_0x275703=_0x16dbc2['map'](_0xe8f0e2=>'\x22'+_0xe8f0e2+'\x22:'+stableStringify(_0x18fd16[_0xe8f0e2]));return'{'+_0x275703[_0xec267f(0x22a)](',')+'}';}const _0x567eb2=JSON[_0xec267f(0x2d0)](_0x12787f);return _0x567eb2===undefined?_0xec267f(0x27f):_0x567eb2;}function activationSignature(_0x5bda76){const _0x485852=a159_0x2fc205,_0x49ce23={'connection':_0x5bda76['connection'],..._0x5bda76[_0x485852(0x21c)]!==undefined&&{'all_columns':_0x5bda76[_0x485852(0x21c)]},..._0x5bda76[_0x485852(0x2b1)]!==undefined&&{'columns':_0x5bda76[_0x485852(0x2b1)]},..._0x5bda76[_0x485852(0x2bb)]!==undefined&&{'behavior':_0x5bda76[_0x485852(0x2bb)]},..._0x5bda76[_0x485852(0x2cf)]!==undefined&&{'behaviors':_0x5bda76[_0x485852(0x2cf)]},..._0x5bda76[_0x485852(0x202)]!==undefined&&{'schedule':_0x5bda76['schedule']},..._0x5bda76[_0x485852(0x1e3)]!==undefined&&{'notification':_0x5bda76['notification']},..._0x5bda76[_0x485852(0x224)]!==undefined&&{'connector_config':_0x5bda76['connector_config']},..._0x5bda76[_0x485852(0x257)]!==undefined&&{'activation_template_id':_0x5bda76['activation_template_id']}};return stableStringify(_0x49ce23);}async function fetchSegment(_0x3ef47d,_0x47c185,_0x2d0fae,_0x3ce8a6){const _0x49d26a=a159_0x2fc205,_0x405b03=_0x3ce8a6?.[_0x49d26a(0x1dc)](_0x320281=>_0x320281['id']===_0x2d0fae);if(_0x405b03)return _0x405b03;try{return await _0x3ef47d[_0x49d26a(0x1d6)][_0x49d26a(0x211)](_0x47c185,_0x2d0fae);}catch(_0x44dad6){logger[_0x49d26a(0x258)](_0x49d26a(0x27c)+_0x2d0fae+_0x49d26a(0x255)+_0x44dad6);try{return await _0x3ef47d[_0x49d26a(0x1d6)][_0x49d26a(0x2b8)](_0x2d0fae);}catch(_0x15df76){return logger[_0x49d26a(0x258)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x2d0fae+':\x20'+_0x15df76),null;}}}function recoverSegmentIdsFromPushRecovery(_0x48a005,_0x4bd432,_0x1e81de){const _0xe95b7d=a159_0x2fc205,_0xe51452=readPushRecovery(_0x48a005[_0xe95b7d(0x21d)]);if(_0xe51452?.['journeyName']===_0x48a005['yamlConfig'][_0xe95b7d(0x263)])for(const [_0x2dff06,_0x469203]of Object[_0xe95b7d(0x2b4)](_0xe51452[_0xe95b7d(0x25c)])){const _0x29250d=generateDeterministicJourneySegmentName(_0x48a005[_0xe95b7d(0x2a7)][_0xe95b7d(0x263)],_0x2dff06);_0x469203[_0xe95b7d(0x271)]===_0x29250d&&(_0x4bd432['set'](_0x2dff06,_0x469203[_0xe95b7d(0x1fb)]),_0x1e81de[_0xe95b7d(0x2c6)](_0x2dff06,_0x469203[_0xe95b7d(0x1fb)]));}}async function createOrRecoverEmbeddedSegment(_0x185bf6,_0x5c4e0d,_0x57474e,_0x15982f){const _0x32d636=a159_0x2fc205;let _0xb208d5;try{_0xb208d5=await _0x185bf6[_0x32d636(0x1d6)][_0x32d636(0x20b)]({'name':_0x57474e[_0x32d636(0x29e)],'description':_0x57474e[_0x32d636(0x241)],'journeyId':_0x57474e[_0x32d636(0x2ac)],'rule':_0x15982f(_0x57474e[_0x32d636(0x1d8)],!![]),'countPopulation':!![],'parentFolderId':_0x57474e[_0x32d636(0x281)],'audienceId':_0x57474e[_0x32d636(0x2c1)]});}catch(_0x461dc3){const _0xd185b0=_0x461dc3 instanceof Error&&_0x461dc3[_0x32d636(0x234)]['includes']('Name\x20has\x20already\x20been\x20taken');if(_0xd185b0){const _0x373aa3=readPushRecovery(_0x5c4e0d[_0x32d636(0x21d)]),_0x2c48e5=_0x373aa3?.[_0x32d636(0x261)]===_0x5c4e0d['yamlConfig']['name']?_0x373aa3[_0x32d636(0x25c)][_0x57474e[_0x32d636(0x1ea)]]:undefined;if(_0x2c48e5?.[_0x32d636(0x271)]===_0x57474e[_0x32d636(0x29e)])await _0x185bf6[_0x32d636(0x1d6)][_0x32d636(0x26c)](_0x57474e[_0x32d636(0x2c1)],_0x2c48e5['segmentId'],{'description':_0x57474e['description'],'rule':_0x15982f(_0x57474e[_0x32d636(0x1d8)],!![]),'countPopulation':!![]}),_0xb208d5=_0x2c48e5[_0x32d636(0x1fb)];else throw new SDKError(ErrorCode[_0x32d636(0x273)],_0x32d636(0x23b)+_0x57474e['localName']+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x32d636(0x280)+_0x5c4e0d[_0x32d636(0x21d)][_0x32d636(0x289)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x461dc3);}else throw _0x461dc3;}return saveSegmentToPushRecovery(_0x5c4e0d['absolutePath'],_0x5c4e0d[_0x32d636(0x2a7)][_0x32d636(0x263)],_0x57474e[_0x32d636(0x1ea)],{'segmentId':_0xb208d5,'uniqueServerName':_0x57474e[_0x32d636(0x29e)],'createdAt':new Date()['toISOString']()}),_0xb208d5;}export async function prepareSegmentFiles(_0x325900,_0x3dcf54,_0x283c54,_0x55b520,_0x304069){const _0x4feb5b=a159_0x2fc205,{activationDefToCreateRequest:_0x4bba16}=await import(_0x4feb5b(0x1e7)),_0x1d0f89=[],_0x121b04=new Set();for(const {yamlConfig:_0x57b9a4,folderPath:_0x129b42,sourcePath:_0x58a8d2}of _0x325900){const _0x57db12=resolveTDFolderPath(_0x129b42,_0x55b520,_0x304069),_0x3473e7=_0x57db12+':'+_0x57b9a4[_0x4feb5b(0x263)],_0x249a5e=_0x3dcf54[_0x4feb5b(0x1db)][_0x4feb5b(0x28e)](_0x3473e7),_0x30304a=_0x249a5e?_0x3dcf54[_0x4feb5b(0x225)][_0x4feb5b(0x28e)](_0x249a5e['id'])||[]:[];addFoldersToCreate(_0x57db12,_0x3dcf54['folderPathToId'],_0x121b04);const _0x39dee2=calculateActivationActions(_0x57b9a4[_0x4feb5b(0x2b3)]||[],_0x30304a,_0x3dcf54[_0x4feb5b(0x22e)],_0x3dcf54['connectionIdToNameMap']);for(const _0x5a8118 of _0x39dee2){(_0x5a8118[_0x4feb5b(0x254)]===_0x4feb5b(0x223)||_0x5a8118[_0x4feb5b(0x254)]===_0x4feb5b(0x243))&&_0x5a8118[_0x4feb5b(0x278)]&&(_0x5a8118[_0x4feb5b(0x2c3)]=await _0x4bba16(_0x5a8118[_0x4feb5b(0x278)],_0x283c54));}const _0x4d5613=calculateSegmentDiff(_0x57b9a4,_0x249a5e,_0x30304a,_0x3dcf54[_0x4feb5b(0x22e)],_0x3dcf54[_0x4feb5b(0x237)]);_0x1d0f89[_0x4feb5b(0x248)]({'relativePath':_0x57b9a4['name'],'absolutePath':_0x58a8d2,'yamlConfig':_0x57b9a4,'folderPath':_0x57db12,'existingSegment':_0x249a5e,'existingActivations':_0x30304a,'isNew':_0x4d5613[_0x4feb5b(0x27e)],'hasChanges':_0x4d5613['hasChanges'],'diff':_0x4d5613['diff'],'activationActions':_0x39dee2});}return{'segmentFiles':_0x1d0f89,'foldersToCreate':_0x121b04};}export async function prepareJourneyFiles(_0x3a314a,_0x58d124,_0x20a7d3,_0x22548e){const _0x599f85=a159_0x2fc205,_0x5c52df=[],_0x299ebb=new Set();for(const {yamlConfig:_0x3c96c7,folderPath:_0x2af8d3,sourcePath:_0x38eef4}of _0x3a314a){const _0x29e658=resolveTDFolderPath(_0x2af8d3,_0x20a7d3,_0x22548e),_0x318b5b=_0x29e658+':'+_0x3c96c7[_0x599f85(0x263)],_0x12277a=_0x58d124[_0x599f85(0x288)][_0x599f85(0x28e)](_0x318b5b);let _0xff88a0,_0xc943f3;if(_0x12277a&&_0x12277a[_0x599f85(0x25d)]>0x0){const _0x2f42c4=buildLocalExpandedRuleMappings(_0x3c96c7),{createYamlContext:_0x29c6dc,prefetchJourneySegments:_0x31b4fb}=createPushYamlContextForBundle(_0x58d124[_0x599f85(0x2c7)],_0x58d124[_0x599f85(0x2c1)],_0x58d124[_0x599f85(0x27d)],_0x2f42c4,_0x58d124[_0x599f85(0x22e)],_0x58d124[_0x599f85(0x237)],_0x58d124[_0x599f85(0x294)],_0x58d124[_0x599f85(0x1d2)]);await _0x31b4fb(_0x12277a[_0x599f85(0x260)](_0x2be1d7=>_0x2be1d7['id']));const _0x23edb1=await _0x58d124[_0x599f85(0x2c7)][_0x599f85(0x218)][_0x599f85(0x2bd)](_0x12277a[0x0][_0x599f85(0x2a9)]),_0x26dc44=hasMultipleVersions(_0x3c96c7),_0x23f894=async _0x315e43=>{const _0x2ae946=_0x599f85,_0x92e615=_0x58d124[_0x2ae946(0x1d2)]?.[_0x2ae946(0x28e)](_0x315e43);if(_0x92e615)return _0x92e615;return _0x58d124[_0x2ae946(0x1cd)]({'journeyId':_0x315e43,'journeyName':_0x3c96c7[_0x2ae946(0x263)],'isMultiVersion':_0x12277a[_0x2ae946(0x25d)]>0x1});};if(_0x26dc44&&_0x12277a[_0x599f85(0x25d)]>0x1){const _0x21b363=[];for(const _0x54c061 of _0x12277a){const _0xf2ba9e=_0x54c061[_0x599f85(0x203)]||0x1;_0x58d124['progress']?.[_0x599f85(0x243)](_0x599f85(0x25b)+_0x3c96c7[_0x599f85(0x263)]+'\x20v'+_0xf2ba9e);const _0x25a746=await _0x23f894(_0x54c061['id']),_0x257e89=_0x29c6dc(_0x54c061['id']),_0x386296=await journeyResponseToDef(_0x25a746,_0x257e89);_0x21b363[_0x599f85(0x248)]({'item':_0x54c061,'yaml':_0x386296});}const _0x1ecd33=buildLocalRuleToNameMappingFromJourney(_0x3c96c7);_0xc943f3=buildMergedJourneyDef(_0x21b363,_0x1ecd33,_0x23edb1);const _0x4fafd5=Math[_0x599f85(0x26b)](..._0x21b363[_0x599f85(0x260)](_0x2ec2aa=>_0x2ec2aa[_0x599f85(0x256)][_0x599f85(0x203)]||0x0)),_0x2f8c6c=_0x12277a[_0x599f85(0x1dc)](_0x3ff488=>(_0x3ff488['versionNumber']||0x0)===_0x4fafd5);_0x2f8c6c&&(_0x58d124[_0x599f85(0x2be)]?.['update'](_0x599f85(0x25b)+_0x3c96c7[_0x599f85(0x263)]+'\x20v'+_0x4fafd5),_0xff88a0=await _0x23f894(_0x2f8c6c['id']));}else{const _0x554faa=_0x12277a[_0x12277a[_0x599f85(0x25d)]-0x1];_0x58d124[_0x599f85(0x2be)]?.[_0x599f85(0x243)]('Fetching\x20'+_0x3c96c7['name']),_0xff88a0=await _0x23f894(_0x554faa['id']);const _0x4a688b=_0x29c6dc(_0x554faa['id']),_0x537cc4=await journeyResponseToDef(_0xff88a0,_0x4a688b),_0x2cf087=buildLocalRuleToNameMappingFromJourney(_0x3c96c7);_0xc943f3=buildMergedJourneyDef([{'item':_0x554faa,'yaml':_0x537cc4}],_0x2cf087,_0x23edb1);}}addFoldersToCreate(_0x29e658,_0x58d124[_0x599f85(0x2b5)],_0x299ebb);const _0x4f2fe4=calculateJourneyDiff(_0x3c96c7,_0xc943f3);_0x5c52df[_0x599f85(0x248)]({'relativePath':_0x3c96c7[_0x599f85(0x263)],'absolutePath':_0x38eef4,'yamlConfig':_0x3c96c7,'folderPath':_0x29e658,'existingJourney':_0xff88a0,'isNew':_0x4f2fe4[_0x599f85(0x27e)],'hasChanges':_0x4f2fe4[_0x599f85(0x291)],'diff':_0x4f2fe4['diff']});}return{'journeyFiles':_0x5c52df,'foldersToCreate':_0x299ebb};}export function calculateActivationActions(_0x24689c,_0x317cf5,_0x253d1e,_0x483131){const _0x2a63a7=a159_0x2fc205,_0x405263=[],_0x1cdce0=new Map();for(const _0xc69ddf of _0x317cf5){_0x1cdce0[_0x2a63a7(0x2c6)](_0xc69ddf[_0x2a63a7(0x263)],_0xc69ddf);}const _0x4c063e=new Map();for(const _0x9f2831 of _0x24689c){_0x4c063e[_0x2a63a7(0x2c6)](_0x9f2831[_0x2a63a7(0x263)],_0x9f2831);}for(const _0xbc318e of _0x24689c){const _0x3c8c29=_0x1cdce0[_0x2a63a7(0x28e)](_0xbc318e[_0x2a63a7(0x263)]);if(!_0x3c8c29)_0x405263[_0x2a63a7(0x248)]({'type':_0x2a63a7(0x223),'name':_0xbc318e['name'],'yamlActivation':_0xbc318e});else{const _0x1cf74a=activationResponseToDef(_0x3c8c29,_0x253d1e,_0x483131),_0x50bf10=a159_0x12c7d7[_0x2a63a7(0x2d0)](_0x1cf74a),_0x36ea32=a159_0x12c7d7[_0x2a63a7(0x2d0)](_0xbc318e);_0x50bf10!==_0x36ea32&&_0x405263['push']({'type':_0x2a63a7(0x243),'name':_0xbc318e[_0x2a63a7(0x263)],'yamlActivation':_0xbc318e,'existingActivation':_0x3c8c29});}}for(const _0x3db28f of _0x317cf5){!_0x4c063e[_0x2a63a7(0x21e)](_0x3db28f[_0x2a63a7(0x263)])&&_0x405263['push']({'type':_0x2a63a7(0x2b0),'name':_0x3db28f[_0x2a63a7(0x263)],'existingActivation':_0x3db28f});}return _0x405263;}function calculateYamlDiff(_0x1ef7c5,_0x3352a9){if(_0x3352a9){const _0x513018=generateDiff(_0x3352a9,_0x1ef7c5),_0x1a37e0=hasChanges(_0x513018);return{'isNew':![],'hasChanges':_0x1a37e0,'diff':_0x1a37e0?formatDiffWithColors(_0x513018):undefined};}const _0x156ace=generateDiff('',_0x1ef7c5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x156ace)};}export function calculateSegmentDiff(_0x171119,_0x316c23,_0x31a422,_0x537558,_0x5945e0){const _0x56c9e4=segmentToYamlString(_0x171119),_0x1ca505=_0x316c23?segmentToYamlString(segmentWithActivationsToYaml(_0x316c23,_0x31a422,undefined,_0x537558,_0x5945e0)):undefined;return calculateYamlDiff(_0x56c9e4,_0x1ca505);}export function calculateJourneyDiff(_0x55cd96,_0x5942b9){const _0x54b8cc=normalizeJourneyDef(_0x55cd96,_0x55cd96),_0x3ba001=a159_0x273875(_0x54b8cc),_0x57cb22=_0x5942b9?a159_0x273875(normalizeJourneyDef(_0x5942b9,_0x55cd96)):undefined;return calculateYamlDiff(_0x3ba001,_0x57cb22);}export function findSegmentsToDelete(_0x2609ae,_0x108e7f,_0x2778c2,_0x4bfc45,_0x189cb4){const _0x5374dd=a159_0x2fc205,_0x11acb8=new Set();for(const {yamlConfig:_0x4a77e4,folderPath:_0x482845}of _0x108e7f){_0x11acb8[_0x5374dd(0x26f)](_0x482845+':'+_0x4a77e4[_0x5374dd(0x263)]);}return _0x2609ae[_0x5374dd(0x226)](_0x18d739=>{const _0x8a94c4=_0x5374dd,_0x1e7b9f=_0x18d739[_0x8a94c4(0x231)]?_0x2778c2[_0x8a94c4(0x28e)](_0x18d739[_0x8a94c4(0x231)][_0x8a94c4(0x1f1)]())||'':'',_0x5989fe=_0x1e7b9f+':'+_0x18d739[_0x8a94c4(0x263)];if(_0x11acb8[_0x8a94c4(0x21e)](_0x5989fe))return![];if(_0x189cb4)return _0x1e7b9f===_0x4bfc45||_0x1e7b9f[_0x8a94c4(0x229)](_0x4bfc45+'/');return!![];});}export function findJourneysToDelete(_0x2a7cab,_0x2556a8,_0x5da763,_0x16815e,_0x129cf1){const _0x114134=a159_0x2fc205,_0x36c71f=new Set();for(const {yamlConfig:_0x1758ab,folderPath:_0x23041f}of _0x2556a8){_0x36c71f[_0x114134(0x26f)](_0x23041f+':'+_0x1758ab[_0x114134(0x263)]);}return _0x2a7cab['filter'](_0x2e7b11=>{const _0xba80e0=_0x114134,_0x30b654=_0x2e7b11[_0xba80e0(0x281)]?_0x5da763[_0xba80e0(0x28e)](_0x2e7b11[_0xba80e0(0x281)])||'':'',_0x269b1d=_0x30b654+':'+_0x2e7b11['journeyBundleName'];if(_0x36c71f[_0xba80e0(0x21e)](_0x269b1d))return![];if(_0x129cf1)return _0x30b654===_0x16815e||_0x30b654[_0xba80e0(0x229)](_0x16815e+'/');return!![];});}function a159_0x1b1a(_0x46d448,_0x20ae66){_0x46d448=_0x46d448-0x1cd;const _0x7767dd=a159_0x7767();let _0x1b1ad2=_0x7767dd[_0x46d448];return _0x1b1ad2;}export function buildSegmentLookupMap(_0x218aef,_0x565fea){const _0x2a446a=a159_0x2fc205,_0x428d37=new Map();for(const _0x5ddf71 of _0x218aef){const _0x13dfb2=_0x5ddf71[_0x2a446a(0x231)]?_0x565fea['get'](_0x5ddf71[_0x2a446a(0x231)][_0x2a446a(0x1f1)]())||'':'',_0x39752e=_0x13dfb2+':'+_0x5ddf71[_0x2a446a(0x263)];_0x428d37[_0x2a446a(0x2c6)](_0x39752e,_0x5ddf71);}return _0x428d37;}export function buildSegmentNameToIdMap(_0x33b842){const _0x45e3ba=a159_0x2fc205,_0xffe965=new Map();for(const _0x5f2c18 of _0x33b842){_0xffe965[_0x45e3ba(0x2c6)](_0x5f2c18[_0x45e3ba(0x263)],_0x5f2c18['id']);}return _0xffe965;}export function buildJourneyBundleLookupMap(_0x274952,_0x2e398f){const _0x35a69f=a159_0x2fc205,_0x185aa2=new Map();for(const _0x407556 of _0x274952){const _0x343523=_0x407556[_0x35a69f(0x281)]?_0x2e398f['get'](_0x407556[_0x35a69f(0x281)])||'':'',_0x143f2e=_0x343523+':'+_0x407556[_0x35a69f(0x266)];!_0x185aa2[_0x35a69f(0x21e)](_0x143f2e)&&_0x185aa2[_0x35a69f(0x2c6)](_0x143f2e,[]),_0x185aa2[_0x35a69f(0x28e)](_0x143f2e)[_0x35a69f(0x248)](_0x407556);}for(const _0x32802a of _0x185aa2[_0x35a69f(0x297)]()){_0x32802a['sort']((_0x2478f6,_0x1c949f)=>(_0x2478f6[_0x35a69f(0x203)]||0x0)-(_0x1c949f[_0x35a69f(0x203)]||0x0));}return _0x185aa2;}export function collectFoldersToCreate(_0x13d080,_0x23afa0){const _0x4fbd3f=a159_0x2fc205,_0x42f797=new Set();for(const _0x2e56f3 of _0x13d080){if(!_0x2e56f3)continue;if(_0x23afa0['has'](_0x2e56f3))continue;const _0x276c5b=_0x2e56f3[_0x4fbd3f(0x1f4)]('/');let _0x31b9a4='';for(const _0x2b31b1 of _0x276c5b){_0x31b9a4=_0x31b9a4?_0x31b9a4+'/'+_0x2b31b1:_0x2b31b1,!_0x23afa0[_0x4fbd3f(0x21e)](_0x31b9a4)&&_0x42f797[_0x4fbd3f(0x26f)](_0x31b9a4);}}return _0x42f797;}export function parseAndClassifyYamlFiles(_0x29fc4b,_0xbd031a,_0x22dd69){const _0x1fd588=a159_0x2fc205,_0x3b900e=[],_0x2d96c4=[];for(const _0x5a748a of _0x29fc4b){const _0x36dbde=a159_0x21ac3d['relative'](_0xbd031a,a159_0x21ac3d[_0x1fd588(0x219)](_0x5a748a)),_0x44dfc3=_0x36dbde==='.'?'':_0x36dbde[_0x1fd588(0x289)](/\\/g,'/'),_0x11d6c2=readFileSync(_0x5a748a,_0x1fd588(0x2a0)),_0x5140be=a159_0x12c7d7[_0x1fd588(0x235)](_0x11d6c2);if(isJourneyDef(_0x5140be,_0x5a748a)){const _0x21cf45=a159_0x54c9f5(_0x11d6c2);_0x2d96c4[_0x1fd588(0x248)]({'yamlConfig':_0x21cf45,'folderPath':_0x44dfc3,'sourcePath':_0x5a748a});}else{if(!_0x22dd69?.[_0x1fd588(0x1d9)]){const _0x104cf3=parseSegmentYamlFile(_0x11d6c2),_0xc3a2c7=normalizeChildSegmentYaml(_0x104cf3);_0x3b900e[_0x1fd588(0x248)]({'yamlConfig':_0xc3a2c7,'folderPath':_0x44dfc3,'sourcePath':_0x5a748a});}}}return{'segments':_0x3b900e,'journeys':_0x2d96c4};}export function validateParsedFiles(_0x1a969d,_0x5e9026){const _0x3c7364=a159_0x2fc205,_0x14d7d1=[];for(const {yamlConfig:_0xeae98e,sourcePath:_0x319720}of _0x1a969d['segments']){const _0x23c157=readFileSync(_0x319720,_0x3c7364(0x2a0)),_0x47d7c3=a159_0x12c7d7[_0x3c7364(0x29f)](_0x23c157),_0x31f21b=validateSegmentDef(_0xeae98e,{'source':_0x23c157,'document':_0x47d7c3},{'skipSchema':!![]});if(!_0x31f21b[_0x3c7364(0x238)]){const _0x5e0a58=a159_0x21ac3d['relative'](_0x5e9026,_0x319720);_0x14d7d1[_0x3c7364(0x248)]({'filePath':_0x5e0a58,'source':_0x23c157,'result':_0x31f21b,'isJourney':![]});}}for(const {yamlConfig:_0x53a897,sourcePath:_0x5341c8}of _0x1a969d['journeys']){const _0x3b8c19=readFileSync(_0x5341c8,_0x3c7364(0x2a0)),_0x2e13d5=a159_0x12c7d7[_0x3c7364(0x29f)](_0x3b8c19),_0x3684e7=validateJourneyDef(_0x53a897,{'source':_0x3b8c19,'document':_0x2e13d5},{'skipSchema':!![]});if(!_0x3684e7[_0x3c7364(0x238)]){const _0x1e65d4=a159_0x21ac3d[_0x3c7364(0x20a)](_0x5e9026,_0x5341c8);_0x14d7d1[_0x3c7364(0x248)]({'filePath':_0x1e65d4,'source':_0x3b8c19,'result':_0x3684e7,'isJourney':!![]});}}return _0x14d7d1;}export function formatValidationErrors(_0x115414){const _0x54a9ec=a159_0x2fc205,_0x3f19ce=[];for(const {filePath:_0x288eaa,source:_0x3d6a55,result:_0x247787,isJourney:_0x2ea99e}of _0x115414){const _0x26b87a=_0x2ea99e?_0x54a9ec(0x218):_0x54a9ec(0x1d6);_0x3f19ce[_0x54a9ec(0x248)]('\x0a'+_0x288eaa+'\x20('+_0x26b87a+_0x54a9ec(0x1ce)+_0x247787[_0x54a9ec(0x2a8)][_0x54a9ec(0x25d)]+_0x54a9ec(0x2ad)),_0x3f19ce['push'](formatValidationResult(_0x247787,_0x3d6a55,_0x288eaa));}return _0x3f19ce[_0x54a9ec(0x22a)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4915be){const _0x4a055d=a159_0x2fc205,_0x1061cd=new Set(),_0x3eda2c=new Map(),_0x32357e=collectSegmentUsageCounts(_0x4915be);if(_0x4915be['segments'])for(const [_0x3fe473,_0x212148]of Object[_0x4a055d(0x2b4)](_0x4915be[_0x4a055d(0x25c)])){_0x1061cd[_0x4a055d(0x26f)](_0x3fe473);if(_0x212148[_0x4a055d(0x1da)]){const _0x36e55d=yamlRuleToApi(_0x212148[_0x4a055d(0x1da)]),_0x3d70be=apiRuleToYaml(_0x36e55d);_0x3eda2c[_0x4a055d(0x2c6)](_0x3fe473,_0x3d70be);}}const _0x34ac2a=new Map();let _0xa50a4=0x0;for(const [_0x2793df,_0x3cfd84]of _0x3eda2c){const _0x5673c7=serializeExpandedRule(_0x3cfd84,_0x3eda2c),_0x4cc34d=_0x34ac2a[_0x4a055d(0x28e)](_0x5673c7)||[];_0x4cc34d[_0x4a055d(0x248)]({'name':_0x2793df,'index':_0xa50a4}),_0x34ac2a[_0x4a055d(0x2c6)](_0x5673c7,_0x4cc34d),_0xa50a4++;}const _0x576358=new Map();for(const [_0x5b15cd,_0x6557ff]of _0x34ac2a){const _0x2d926c=_0x6557ff[_0x4a055d(0x216)]()[_0x4a055d(0x28f)]((_0x35b41b,_0x56a219)=>{const _0x490ae4=_0x4a055d,_0x2904ce=_0x32357e[_0x490ae4(0x28e)](_0x35b41b[_0x490ae4(0x263)])||0x0,_0x226e3a=_0x32357e[_0x490ae4(0x28e)](_0x56a219[_0x490ae4(0x263)])||0x0;if(_0x2904ce!==_0x226e3a)return _0x226e3a-_0x2904ce;return _0x35b41b[_0x490ae4(0x2bc)]-_0x56a219['index'];})[_0x4a055d(0x260)](_0x4c530f=>_0x4c530f[_0x4a055d(0x263)]),_0x239ae2=[];for(const _0xa501dd of _0x2d926c){const _0x2e5d52=_0x32357e[_0x4a055d(0x28e)](_0xa501dd)||0x0,_0x6cd48a=Math[_0x4a055d(0x26b)](_0x2e5d52,0x1);for(let _0xe23677=0x0;_0xe23677<_0x6cd48a;_0xe23677++){_0x239ae2[_0x4a055d(0x248)](_0xa501dd);}}_0x576358[_0x4a055d(0x2c6)](_0x5b15cd,_0x239ae2);}return{'existingLocalSegmentNames':_0x1061cd,'localSegmentRules':_0x3eda2c,'localExpandedRuleToNames':_0x576358};}export function createSegmentIdResolver(_0x25b2c4,_0xbe2a0d){return async _0x4ef117=>{const _0x62ff7=a159_0x1b1a,_0x3491f4=_0x25b2c4[_0x62ff7(0x28e)](_0x4ef117);if(!_0x3491f4)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x4ef117+_0x62ff7(0x262)+_0xbe2a0d+'\x27)');return _0x3491f4;};}export function extractRootFolderId(_0x45c48c){const _0x327fcd=a159_0x2fc205;return _0x45c48c[_0x327fcd(0x1f6)]?.[_0x327fcd(0x245)]?.[_0x327fcd(0x2d1)]?.['id']||_0x45c48c[_0x327fcd(0x1f6)]?.[_0x327fcd(0x1de)]?.[_0x327fcd(0x2d1)]?.['id'];}export function buildConnectionMaps(_0xad716e){const _0x12af06=a159_0x2fc205,_0x40cbcf=new Map(),_0x4f89d5=new Map(),_0x127b23=new Map();for(const _0x3ff738 of _0xad716e){_0x40cbcf[_0x12af06(0x2c6)](_0x3ff738['name'],parseInt(_0x3ff738['id'],0xa)),_0x4f89d5[_0x12af06(0x2c6)](_0x3ff738['id'],_0x3ff738[_0x12af06(0x263)]),_0x127b23[_0x12af06(0x2c6)](_0x3ff738[_0x12af06(0x263)],_0x3ff738[_0x12af06(0x254)]);}return{'nameToId':_0x40cbcf,'idToName':_0x4f89d5,'nameToType':_0x127b23};}export function calculatePushStats(_0x1dccea,_0x5745b1,_0x55230d,_0x18dd53,_0x1ee004,_0x1a4ccc,_0x200f79){const _0x516410=a159_0x2fc205,_0x5703cd=_0x1dccea[_0x516410(0x226)](_0x58d006=>_0x58d006[_0x516410(0x27e)]),_0x455f32=_0x1dccea[_0x516410(0x226)](_0x13193f=>!_0x13193f[_0x516410(0x27e)]&&_0x13193f[_0x516410(0x291)]),_0x5af8ee=_0x1dccea[_0x516410(0x226)](_0x1bcb54=>!_0x1bcb54[_0x516410(0x27e)]&&!_0x1bcb54[_0x516410(0x291)]),_0x814286=_0x1a4ccc?_0x18dd53:[],_0x2e1b05=_0x5745b1['filter'](_0x36c6fd=>_0x36c6fd['isNew']),_0x5a52f7=_0x5745b1[_0x516410(0x226)](_0x38fd9f=>!_0x38fd9f['isNew']&&_0x38fd9f[_0x516410(0x291)]),_0x444d6b=_0x5745b1[_0x516410(0x226)](_0x405ac3=>!_0x405ac3[_0x516410(0x27e)]&&!_0x405ac3[_0x516410(0x291)]),_0x1942dd=_0x1a4ccc?_0x1ee004:[],_0x3bb93c=_0x1dccea[_0x516410(0x2c9)](_0x47ba09=>_0x47ba09[_0x516410(0x2b2)]),_0x5f37b2=_0x3bb93c['filter'](_0x18e2d3=>_0x18e2d3[_0x516410(0x254)]==='create'),_0x199751=_0x3bb93c['filter'](_0x2d94bb=>_0x2d94bb[_0x516410(0x254)]===_0x516410(0x243)),_0x2d5f6f=_0x3bb93c['filter'](_0x41941c=>_0x41941c[_0x516410(0x254)]===_0x516410(0x2b0)),_0xcd57a4=Array[_0x516410(0x1cf)](_0x55230d)['sort'](),_0x34ece4=_0x200f79?![]:_0x5703cd[_0x516410(0x25d)]>0x0||_0x455f32[_0x516410(0x25d)]>0x0||_0x814286['length']>0x0,_0x31af6f=_0x2e1b05[_0x516410(0x25d)]>0x0||_0x5a52f7[_0x516410(0x25d)]>0x0||_0x1942dd[_0x516410(0x25d)]>0x0,_0x2c5c04=_0x200f79?![]:_0x3bb93c['length']>0x0,_0x58c301=_0xcd57a4[_0x516410(0x25d)]>0x0;return{'segments':{'new':_0x5703cd,'changed':_0x455f32,'unchanged':_0x5af8ee,'toDelete':_0x814286},'journeys':{'new':_0x2e1b05,'changed':_0x5a52f7,'unchanged':_0x444d6b,'toDelete':_0x1942dd},'activations':{'all':_0x3bb93c,'toCreate':_0x5f37b2,'toUpdate':_0x199751,'toDelete':_0x2d5f6f},'folders':{'toCreate':_0xcd57a4},'counts':{'segments':{'new':_0x5703cd[_0x516410(0x25d)],'changed':_0x455f32[_0x516410(0x25d)],'unchanged':_0x5af8ee[_0x516410(0x25d)],'toDelete':_0x814286[_0x516410(0x25d)]},'journeys':{'new':_0x2e1b05[_0x516410(0x25d)],'changed':_0x5a52f7['length'],'unchanged':_0x444d6b[_0x516410(0x25d)],'toDelete':_0x1942dd[_0x516410(0x25d)]},'activations':{'create':_0x5f37b2[_0x516410(0x25d)],'update':_0x199751[_0x516410(0x25d)],'delete':_0x2d5f6f[_0x516410(0x25d)]},'folders':_0xcd57a4['length']},'hasChanges':_0x34ece4||_0x31af6f||_0x2c5c04||_0x58c301};}export async function buildPushExecutionContext(_0x31eb73,_0x257d67,_0x550757,_0x3b77aa,_0x9829ea,_0x18e5b8){const _0x2a5bb8=a159_0x2fc205,_0x114eb6=extractRootFolderId(_0x550757),{pathToId:_0x3173b1,idToPath:_0x2056ee}=buildFolderMaps(_0x9829ea),_0x448809=buildSegmentNameToIdMap(_0x3b77aa),_0x3e168e=new Map(),{batchAsync:_0x10bc13}=await import('../../utils/async.js'),[_0x51b91e,_0x121f69]=await Promise[_0x2a5bb8(0x25a)]([_0x31eb73[_0x2a5bb8(0x293)][_0x2a5bb8(0x1eb)](),_0x31eb73['connection'][_0x2a5bb8(0x1e0)](),((async()=>{const _0x550d28=_0x2a5bb8;!_0x18e5b8&&_0x3b77aa[_0x550d28(0x25d)]>0x0&&await _0x10bc13(_0x3b77aa,async _0x561ae8=>{const _0x3bdad7=_0x550d28,_0xa77a41=await _0x31eb73[_0x3bdad7(0x1d6)][_0x3bdad7(0x277)](_0x257d67,_0x561ae8['id']);_0x3e168e[_0x3bdad7(0x2c6)](_0x561ae8['id'],_0xa77a41);});})())]),{emailToId:_0x3c5f11,idToEmail:_0xa3e38d}=_0x51b91e,_0x239d55=buildConnectionMaps(_0x121f69);return{'rootFolderId':_0x114eb6,'folderPathToId':_0x3173b1,'folderIdToPath':_0x2056ee,'segmentNameToId':_0x448809,'activationsBySegmentId':_0x3e168e,'emailToIdMap':_0x3c5f11,'idToEmailMap':_0xa3e38d,'connectionNameToIdMap':_0x239d55['nameToId'],'connectionIdToNameMap':_0x239d55['idToName'],'connectionNameToTypeMap':_0x239d55['nameToType']};}export function createPushYamlContextForBundle(_0x21e382,_0x4781b2,_0x534412,_0x1b47de,_0x428503,_0x309d2a,_0x4fcfde,_0x3b6398){const {existingLocalSegmentNames:_0x3ce91b,localExpandedRuleToNames:_0x49dbbc}=_0x1b47de,_0x5d16cc=new Set(),_0x108914=new Map(),_0x4147a0=new Map(),_0x1caaaf=new Map(),_0x1331e2=createJumpTargetCache(),_0x1e7d41=new Map(),_0x3f25f2=new Map(),_0x39b2eb=new Set();let _0x506d14;const _0x48a465=_0x589147=>{const _0x46eb00={'resolveSegment':async _0x5f01d9=>{const _0x569152=a159_0x1b1a,_0x2cfa6f=_0x1caaaf[_0x569152(0x28e)](_0x5f01d9);if(_0x2cfa6f!==undefined)return{'name':_0x2cfa6f,'isJourneyLocal':!![]};try{const _0x366d29=await fetchSegment(_0x21e382,_0x4781b2,_0x5f01d9,_0x534412);if(!_0x366d29)throw new Error('Segment\x20not\x20found');const _0x206cfc=generateJourneyLocalName(_0x366d29[_0x569152(0x263)]),_0x2a0aa0=_0x366d29[_0x569152(0x26a)]===SEGMENT_KIND_JOURNEY&&_0x206cfc!==undefined;let _0x1315f7=_0x366d29[_0x569152(0x263)],_0x196f5c;if(_0x2a0aa0&&_0x366d29[_0x569152(0x1da)]){const _0x2aaa37=apiRuleToYaml(_0x366d29[_0x569152(0x1da)]);_0x3f25f2[_0x569152(0x2c6)](_0x5f01d9,_0x2aaa37);const _0x1a44b7=async _0x2a3d1b=>{const _0xb2d2f8=_0x569152,_0x257d39=collectSegmentRefsFromRule(_0x2a3d1b);for(const _0x302ddb of _0x257d39){if(!_0x3f25f2[_0xb2d2f8(0x21e)](_0x302ddb))try{const _0x5784b9=await fetchSegment(_0x21e382,_0x4781b2,_0x302ddb,_0x534412);if(_0x5784b9?.[_0xb2d2f8(0x1da)]){const _0x44677a=apiRuleToYaml(_0x5784b9[_0xb2d2f8(0x1da)]);_0x3f25f2[_0xb2d2f8(0x2c6)](_0x302ddb,_0x44677a),await _0x1a44b7(_0x44677a);}}catch(_0x9363b9){logger['debug'](_0xb2d2f8(0x1ed)+_0x302ddb+':\x20'+_0x9363b9);}}};await _0x1a44b7(_0x2aaa37);const _0x48745b=serializeExpandedRule(_0x2aaa37,_0x3f25f2),_0x111b27=_0x49dbbc[_0x569152(0x28e)](_0x48745b);if(_0x111b27&&_0x111b27[_0x569152(0x25d)]>0x0){const _0x217d94=_0x108914[_0x569152(0x28e)](_0x48745b)||0x0,_0x68d3cc=_0x111b27[_0x217d94]||_0x111b27[_0x111b27[_0x569152(0x25d)]-0x1];_0x108914['set'](_0x48745b,_0x217d94+0x1),_0x1315f7=_0x68d3cc,_0x5d16cc[_0x569152(0x26f)](_0x1315f7),_0x1caaaf[_0x569152(0x2c6)](_0x5f01d9,_0x1315f7);const _0x24c137=await resolveRuleSegmentRefs(_0x2aaa37,async _0x3fe062=>{const _0x2582f7=_0x569152,_0x390a05=_0x1caaaf[_0x2582f7(0x28e)](_0x3fe062);if(_0x390a05)return _0x390a05;const _0x5b07dc=await _0x506d14[_0x2582f7(0x23c)](_0x3fe062);return _0x5b07dc[_0x2582f7(0x263)];});_0x196f5c={'description':_0x366d29['description'],'rule':_0x24c137};}else{const _0x2ca1ae=_0x1e7d41[_0x569152(0x28e)](_0x48745b);if(_0x2ca1ae)_0x1315f7=_0x2ca1ae,_0x1caaaf[_0x569152(0x2c6)](_0x5f01d9,_0x1315f7);else{if(_0x206cfc){let _0x58ffbb=_0x206cfc,_0x1b4e29=0x2;while(_0x5d16cc[_0x569152(0x21e)](_0x58ffbb)||_0x3ce91b[_0x569152(0x21e)](_0x58ffbb)){_0x58ffbb=_0x206cfc+'_'+_0x1b4e29,_0x1b4e29++;}_0x5d16cc[_0x569152(0x26f)](_0x58ffbb),_0x1315f7=_0x58ffbb;}_0x1caaaf['set'](_0x5f01d9,_0x1315f7),_0x1e7d41[_0x569152(0x2c6)](_0x48745b,_0x1315f7);const _0x2f744e=await resolveRuleSegmentRefs(_0x2aaa37,async _0x1bc8ec=>{const _0x33438c=_0x569152,_0x460638=_0x1caaaf[_0x33438c(0x28e)](_0x1bc8ec);if(_0x460638)return _0x460638;const _0x2fa735=await _0x506d14['resolveSegment'](_0x1bc8ec);return _0x2fa735[_0x33438c(0x263)];});_0x196f5c={'description':_0x366d29[_0x569152(0x241)],'rule':_0x2f744e};}}}return{'name':_0x1315f7,'isJourneyLocal':_0x2a0aa0,'definition':_0x196f5c};}catch(_0x2db7eb){return logger[_0x569152(0x258)](_0x569152(0x1f2)+_0x5f01d9+':\x20'+_0x2db7eb),{'name':_0x5f01d9,'isJourneyLocal':![]};}},'resolveActivation':async _0xf55d7e=>{const _0x313b5f=a159_0x1b1a,_0x5c2de6=_0x4147a0['get'](_0xf55d7e);if(_0x5c2de6!==undefined)return{'name':_0x5c2de6,'isJourneyLocal':!![]};try{let _0xad15ce=_0x4fcfde?.[_0x313b5f(0x28e)](_0xf55d7e);!_0xad15ce&&(_0xad15ce=await _0x21e382[_0x313b5f(0x218)]['getActivation'](_0x589147,_0xf55d7e));const _0x428132=_0xad15ce[_0x313b5f(0x227)][_0x313b5f(0x247)][_0x313b5f(0x263)]||_0xf55d7e,_0x316187=sanitizeYamlKey(_0x428132)||_0x313b5f(0x1d4)+_0xf55d7e,_0x1bd025=_0x316187;_0x4147a0['set'](_0xf55d7e,_0x1bd025);const _0x4bba68=journeyActivationStepToYaml(_0xad15ce,_0x428503,_0x309d2a);return{'name':_0x1bd025,'isJourneyLocal':!![],'definition':_0x4bba68};}catch(_0x27a29d){return logger[_0x313b5f(0x258)]('Failed\x20to\x20resolve\x20activation\x20'+_0xf55d7e+':\x20'+_0x27a29d),{'name':_0xf55d7e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1ddf73,_0x1650fa)=>resolveJumpTarget(_0x1ddf73,_0x1650fa,_0x1331e2,async _0x24f275=>{const _0x32aea8=a159_0x1b1a,_0xe02574=_0x3b6398?.['get'](_0x24f275);if(_0xe02574)return _0xe02574;return _0x21e382[_0x32aea8(0x218)][_0x32aea8(0x21b)](_0x24f275);})};return _0x506d14=_0x46eb00,_0x46eb00;},_0x3bdc48=async _0x3a1c76=>{const _0x678843=a159_0x1b1a,{collectSegmentIdsFromJourneyApi:_0x34e559}=await import(_0x678843(0x217)),{batchAsync:_0x36ca7c}=await import(_0x678843(0x2b6)),_0x3732d4=new Set();for(const _0xe26d38 of _0x3a1c76){let _0x3f7435=_0x3b6398?.['get'](_0xe26d38);!_0x3f7435&&(_0x3f7435=await _0x21e382[_0x678843(0x218)][_0x678843(0x21b)](_0xe26d38));const _0x59f0f4=_0x34e559(_0x3f7435);for(const _0x2c7600 of _0x59f0f4){_0x3732d4[_0x678843(0x26f)](_0x2c7600);}}let _0x30f7f9=Array[_0x678843(0x1cf)](_0x3732d4);while(_0x30f7f9['length']>0x0){const _0x3cbe0f=_0x30f7f9['filter'](_0x368dbb=>!_0x39b2eb['has'](_0x368dbb));if(_0x3cbe0f[_0x678843(0x25d)]===0x0)break;const _0x2e1921=await _0x36ca7c(_0x3cbe0f,async _0x358c07=>{const _0x49645f=_0x678843;_0x39b2eb[_0x49645f(0x26f)](_0x358c07);const _0x39f2f7=await fetchSegment(_0x21e382,_0x4781b2,_0x358c07,_0x534412);if(!_0x39f2f7)return null;return{'segmentId':_0x358c07,'segment':_0x39f2f7};},0xa),_0x151c9d=new Set();for(const _0xe72c4b of _0x2e1921){if(!_0xe72c4b?.[_0x678843(0x1d6)]?.[_0x678843(0x1da)])continue;const _0x4b67bd=apiRuleToYaml(_0xe72c4b['segment']['rule']);_0x3f25f2[_0x678843(0x2c6)](_0xe72c4b[_0x678843(0x1fb)],_0x4b67bd);const _0x49b1bb=collectSegmentRefsFromRule(_0x4b67bd);for(const _0x58644 of _0x49b1bb){!_0x39b2eb['has'](_0x58644)&&_0x151c9d[_0x678843(0x26f)](_0x58644);}}_0x30f7f9=Array['from'](_0x151c9d);}};return{'createYamlContext':_0x48a465,'prefetchJourneySegments':_0x3bdc48};}export async function executePushSegments(_0x395c3f,_0x5934d3,_0x12ba66,_0x30c898,_0x826adf){const _0x2f44c3=a159_0x2fc205,{segmentDefToCreateRequest:_0xa895e5,segmentDefToUpdateRequest:_0x1fa7e3}=await import(_0x2f44c3(0x1e7)),_0x4846c6=_0x12ba66[_0x2f44c3(0x2b5)],_0x49366f=0x5,_0x27a305=async _0x5f5279=>{const _0x2013a9=_0x2f44c3,_0x6b0f7c=_0x5f5279['folderPath']?_0x4846c6['get'](_0x5f5279[_0x2013a9(0x251)]):undefined;let _0x1bb59f;const _0x303fdd={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x4bb364=_0x5f5279[_0x2013a9(0x2a7)];if(_0x5f5279[_0x2013a9(0x2a7)][_0x2013a9(0x1da)]){const _0x473b5e=createSegmentIdResolver(_0x12ba66[_0x2013a9(0x1dd)],_0x5f5279['yamlConfig'][_0x2013a9(0x263)]),_0x313eb=await resolveRuleSegmentIds(_0x5f5279[_0x2013a9(0x2a7)]['rule'],_0x473b5e);_0x4bb364={..._0x5f5279['yamlConfig'],'rule':_0x313eb};}try{if(_0x5f5279[_0x2013a9(0x27e)]){_0x826adf['onProgress']?.({'type':_0x2013a9(0x209),'name':_0x5f5279[_0x2013a9(0x2a7)]['name']});const _0x9e7446=_0xa895e5(_0x4bb364,_0x6b0f7c),_0x2f7595=await _0x826adf['withProgress'](_0x2013a9(0x2c0)+_0x5f5279[_0x2013a9(0x2a7)][_0x2013a9(0x263)]+_0x2013a9(0x23f),()=>_0x395c3f[_0x2013a9(0x1d6)][_0x2013a9(0x1f5)](_0x30c898[_0x2013a9(0x2c1)],_0x9e7446));_0x1bb59f=_0x2f7595['data']['id'],_0x12ba66['segmentNameToId'][_0x2013a9(0x2c6)](_0x5f5279[_0x2013a9(0x2a7)][_0x2013a9(0x263)],_0x1bb59f),_0x303fdd[_0x2013a9(0x20c)]={'name':_0x5f5279['yamlConfig'][_0x2013a9(0x263)],'id':_0x1bb59f},_0x826adf[_0x2013a9(0x20e)]?.({'type':'segment_created','name':_0x5f5279[_0x2013a9(0x2a7)][_0x2013a9(0x263)],'segmentId':_0x1bb59f}),_0x826adf['logSuccess']?.(_0x2013a9(0x26e)+_0x5f5279['yamlConfig'][_0x2013a9(0x263)]+'\x27'),_0x303fdd['created']=0x1;}else{if(_0x5f5279[_0x2013a9(0x291)]){_0x826adf[_0x2013a9(0x20e)]?.({'type':_0x2013a9(0x232),'name':_0x5f5279['yamlConfig'][_0x2013a9(0x263)]});const _0x5a0139=_0x1fa7e3(_0x4bb364);_0x6b0f7c!==_0x5f5279['existingSegment']?.[_0x2013a9(0x231)]&&(_0x5a0139[_0x2013a9(0x231)]=_0x6b0f7c?parseInt(_0x6b0f7c,0xa):undefined),await _0x826adf[_0x2013a9(0x213)](_0x2013a9(0x1f3)+_0x5f5279['yamlConfig']['name']+_0x2013a9(0x23f),()=>_0x395c3f[_0x2013a9(0x1d6)][_0x2013a9(0x26c)](_0x30c898[_0x2013a9(0x2c1)],_0x5f5279[_0x2013a9(0x28b)]['id'],_0x5a0139)),_0x1bb59f=_0x5f5279[_0x2013a9(0x28b)]['id'],_0x826adf[_0x2013a9(0x20e)]?.({'type':_0x2013a9(0x1f9),'name':_0x5f5279[_0x2013a9(0x2a7)][_0x2013a9(0x263)]}),_0x826adf['logSuccess']?.(_0x2013a9(0x2c2)+_0x5f5279[_0x2013a9(0x2a7)][_0x2013a9(0x263)]+'\x27'),_0x303fdd[_0x2013a9(0x2a4)]=0x1;}else _0x1bb59f=_0x5f5279['existingSegment']['id'];}}catch(_0x3d5251){const _0x2ad279=isHttp400Error(_0x3d5251),_0x14c13e=_0x2ad279?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4786da=getErrorMessage(_0x3d5251);throw new SDKError(_0x14c13e,'Failed\x20to\x20'+(_0x5f5279[_0x2013a9(0x27e)]?'create':_0x2013a9(0x243))+_0x2013a9(0x1fd)+_0x5f5279[_0x2013a9(0x21d)]+_0x2013a9(0x208)+_0x4786da,_0x3d5251);}try{const _0x599aee=await syncActivationsForSegment(_0x395c3f,_0x30c898[_0x2013a9(0x2c1)],_0x1bb59f,_0x5f5279[_0x2013a9(0x2a7)][_0x2013a9(0x263)],_0x5f5279[_0x2013a9(0x2b2)],_0x826adf,_0x5f5279[_0x2013a9(0x21d)]);_0x303fdd['activations']=_0x599aee;}catch(_0x4bb1a6){if(_0x4bb1a6 instanceof SDKError)throw _0x4bb1a6;throw new SDKError(ErrorCode[_0x2013a9(0x2bf)],_0x2013a9(0x214)+_0x5f5279[_0x2013a9(0x2a7)][_0x2013a9(0x263)]+_0x2013a9(0x1ef)+_0x5f5279[_0x2013a9(0x21d)]+_0x2013a9(0x208)+getErrorMessage(_0x4bb1a6),_0x4bb1a6);}return _0x303fdd;},_0x41bd93=await batchAsync(_0x5934d3,_0x27a305,_0x49366f),_0x48deb4={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x561f62 of _0x41bd93){_0x48deb4['created']+=_0x561f62['created'],_0x48deb4[_0x2f44c3(0x2a4)]+=_0x561f62[_0x2f44c3(0x2a4)],_0x561f62[_0x2f44c3(0x20c)]&&_0x48deb4['createdSegmentIds'][_0x2f44c3(0x2c6)](_0x561f62[_0x2f44c3(0x20c)][_0x2f44c3(0x263)],_0x561f62[_0x2f44c3(0x20c)]['id']),_0x48deb4['activations'][_0x2f44c3(0x2a1)]+=_0x561f62[_0x2f44c3(0x2b3)][_0x2f44c3(0x2a1)],_0x48deb4[_0x2f44c3(0x2b3)][_0x2f44c3(0x2a4)]+=_0x561f62[_0x2f44c3(0x2b3)]['updated'],_0x48deb4[_0x2f44c3(0x2b3)][_0x2f44c3(0x284)]+=_0x561f62[_0x2f44c3(0x2b3)][_0x2f44c3(0x284)];}return _0x48deb4;}async function syncActivationsForSegment(_0x5063b5,_0xc8afad,_0x537739,_0x50d8ec,_0x18c633,_0x4d3138,_0x1b6031){const _0x13ff43=a159_0x2fc205,_0x476c13={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x56e90b of _0x18c633){try{if(_0x56e90b[_0x13ff43(0x254)]==='create'&&_0x56e90b[_0x13ff43(0x2c3)])_0x4d3138[_0x13ff43(0x20e)]?.({'type':_0x13ff43(0x27a),'segmentName':_0x50d8ec,'activationName':_0x56e90b[_0x13ff43(0x263)]}),await _0x4d3138[_0x13ff43(0x213)]('Creating\x20activation\x20\x27'+_0x56e90b[_0x13ff43(0x263)]+_0x13ff43(0x23f),()=>_0x5063b5[_0x13ff43(0x1d6)][_0x13ff43(0x299)](_0xc8afad,_0x537739,_0x56e90b[_0x13ff43(0x2c3)])),_0x4d3138[_0x13ff43(0x20e)]?.({'type':_0x13ff43(0x26d),'segmentName':_0x50d8ec,'activationName':_0x56e90b[_0x13ff43(0x263)]}),_0x4d3138[_0x13ff43(0x268)]?.(_0x13ff43(0x240)+_0x56e90b[_0x13ff43(0x263)]+'\x27'),_0x476c13[_0x13ff43(0x2a1)]++;else{if(_0x56e90b[_0x13ff43(0x254)]===_0x13ff43(0x243)&&_0x56e90b[_0x13ff43(0x2c3)]&&_0x56e90b[_0x13ff43(0x2c4)])_0x4d3138[_0x13ff43(0x20e)]?.({'type':_0x13ff43(0x21f),'segmentName':_0x50d8ec,'activationName':_0x56e90b['name']}),await _0x4d3138[_0x13ff43(0x213)](_0x13ff43(0x1d3)+_0x56e90b[_0x13ff43(0x263)]+_0x13ff43(0x23f),()=>_0x5063b5['segment'][_0x13ff43(0x2d3)](_0xc8afad,_0x537739,_0x56e90b['existingActivation']['id'],_0x56e90b[_0x13ff43(0x2c3)])),_0x4d3138[_0x13ff43(0x20e)]?.({'type':_0x13ff43(0x2ae),'segmentName':_0x50d8ec,'activationName':_0x56e90b[_0x13ff43(0x263)]}),_0x4d3138['logSuccess']?.(_0x13ff43(0x286)+_0x56e90b[_0x13ff43(0x263)]+'\x27'),_0x476c13['updated']++;else _0x56e90b[_0x13ff43(0x254)]===_0x13ff43(0x2b0)&&_0x56e90b['existingActivation']&&(_0x4d3138['onProgress']?.({'type':_0x13ff43(0x2a6),'segmentName':_0x50d8ec,'activationName':_0x56e90b[_0x13ff43(0x263)]}),await _0x4d3138[_0x13ff43(0x213)](_0x13ff43(0x29a)+_0x56e90b[_0x13ff43(0x263)]+'\x27...',()=>_0x5063b5[_0x13ff43(0x1d6)][_0x13ff43(0x264)](_0xc8afad,_0x537739,_0x56e90b['existingActivation']['id'])),_0x4d3138[_0x13ff43(0x20e)]?.({'type':_0x13ff43(0x252),'segmentName':_0x50d8ec,'activationName':_0x56e90b['name']}),_0x4d3138['logDeleted']?.(_0x13ff43(0x2ce)+_0x56e90b['name']+'\x27'),_0x476c13[_0x13ff43(0x284)]++);}}catch(_0x5242d2){const _0x475f13=isHttp400Error(_0x5242d2),_0x2ce83b=_0x475f13?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x13ff43(0x2bf)],_0x1ba1a1=getErrorMessage(_0x5242d2);throw new SDKError(_0x2ce83b,'Failed\x20to\x20'+_0x56e90b[_0x13ff43(0x254)]+_0x13ff43(0x29b)+_0x56e90b['name']+_0x13ff43(0x1ef)+_0x1b6031+_0x13ff43(0x208)+_0x1ba1a1,_0x5242d2);}}return _0x476c13;}export async function executePushFolders(_0x4f8ece,_0xfa48df,_0x5e9fdf,_0x2f6fd9,_0x23f45b){const _0x262b7e=a159_0x2fc205,_0x53b6b1=new Map(_0x5e9fdf),_0xc83911=sortFoldersByDepth(_0xfa48df);for(const _0x574ae2 of _0xc83911){const _0x4365e4=_0x574ae2[_0x262b7e(0x1f4)]('/'),_0x5aa02f=_0x4365e4[_0x4365e4[_0x262b7e(0x25d)]-0x1],_0x365620=_0x4365e4['slice'](0x0,-0x1)[_0x262b7e(0x22a)]('/'),_0x443092=_0x53b6b1[_0x262b7e(0x28e)](_0x365620);_0x23f45b[_0x262b7e(0x20e)]?.({'type':_0x262b7e(0x1f0),'folder':_0x574ae2});const _0x294d17={'name':_0x5aa02f,'parentFolderId':_0x443092},_0x222922=await _0x23f45b['withProgress'](_0x262b7e(0x2cc)+_0x574ae2+_0x262b7e(0x23f),()=>_0x4f8ece[_0x262b7e(0x1d6)][_0x262b7e(0x22b)](_0x2f6fd9[_0x262b7e(0x2c1)],_0x294d17));_0x53b6b1[_0x262b7e(0x2c6)](_0x574ae2,_0x222922[_0x262b7e(0x2d1)]['id']),_0x23f45b[_0x262b7e(0x20e)]?.({'type':_0x262b7e(0x23e),'folder':_0x574ae2,'folderId':_0x222922['data']['id']}),_0x23f45b['logInfo']?.(_0x262b7e(0x292)+_0x574ae2+'\x27');}return _0x53b6b1;}export async function executePushSegmentDeletions(_0x548635,_0x1c36f3,_0x467fb3){const _0x37b512=a159_0x2fc205;if(_0x1c36f3[_0x37b512(0x25d)]===0x0)return 0x0;const {batchAsync:_0x8f1263}=await import('../../utils/async.js'),_0x38196a=0x5,_0x2e931e=await _0x8f1263(_0x1c36f3,async _0x4d5577=>{const _0xfa945d=_0x37b512;return _0x467fb3[_0xfa945d(0x20e)]?.({'type':'segment_deleting','name':_0x4d5577[_0xfa945d(0x263)]}),await _0x548635[_0xfa945d(0x1d6)]['deleteSegment'](_0x4d5577['id']),_0x467fb3[_0xfa945d(0x20e)]?.({'type':'segment_deleted','name':_0x4d5577[_0xfa945d(0x263)]}),_0x467fb3[_0xfa945d(0x1fe)]?.(_0xfa945d(0x265)+_0x4d5577[_0xfa945d(0x263)]+'\x27'),0x1;},_0x38196a);return _0x2e931e[_0x37b512(0x2cb)]((_0x4ffc75,_0x3fa144)=>_0x4ffc75+_0x3fa144,0x0);}export async function executePushJourneys(_0x2c4883,_0x55d4c9,_0x11aa77,_0x572bd4,_0x2688c7){const _0x4bbb29=a159_0x2fc205,{journeyDefToRequest:_0x5cf3ae}=await import(_0x4bbb29(0x217)),{activationDefToCreateRequest:_0x2fc933,yamlRuleToApi:_0x4e4ee6,validateSegmentRule:_0x442ef2}=await import('./child-segment-yaml.js'),_0x6f23f5={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x8884eb=new Map(_0x11aa77[_0x4bbb29(0x1dd)]),_0x14b86c=0x5;for(let _0x4dd450=0x0;_0x4dd450<_0x55d4c9[_0x4bbb29(0x25d)];_0x4dd450+=_0x14b86c){const _0x244942=_0x55d4c9[_0x4bbb29(0x216)](_0x4dd450,_0x4dd450+_0x14b86c),_0x13959a=await Promise[_0x4bbb29(0x25a)](_0x244942['map'](async _0x2088bb=>{const _0x14efed=_0x4bbb29;if(!_0x2088bb[_0x14efed(0x27e)]&&!_0x2088bb[_0x14efed(0x291)])return{'action':_0x14efed(0x25e),'name':_0x2088bb[_0x14efed(0x2a7)]['name'],'journeyId':_0x2088bb[_0x14efed(0x250)]?.['id']};const _0x433e97=_0x2088bb[_0x14efed(0x251)]?_0x11aa77[_0x14efed(0x2b5)][_0x14efed(0x28e)](_0x2088bb[_0x14efed(0x251)]):undefined;_0x2688c7['onProgress']?.({'type':_0x2088bb[_0x14efed(0x27e)]?'journey_creating':_0x14efed(0x267),'name':_0x2088bb[_0x14efed(0x2a7)][_0x14efed(0x263)]});try{const _0x1c5212=await executeSingleJourneyPush(_0x2c4883,_0x2088bb,{..._0x11aa77,'segmentNameToId':_0x8884eb},{'parentId':_0x572bd4[_0x14efed(0x2c1)],'rootFolderId':_0x572bd4[_0x14efed(0x295)],'folderId':_0x433e97,'verbose':_0x572bd4[_0x14efed(0x1e2)]},_0x2688c7,{'journeyDefToRequest':_0x5cf3ae,'activationDefToCreateRequest':_0x2fc933,'yamlRuleToApi':_0x4e4ee6,'validateSegmentRule':_0x442ef2});for(const [_0x4f678e,_0xd2f036]of _0x1c5212[_0x14efed(0x290)]){_0x8884eb['set'](_0x4f678e,_0xd2f036),_0x6f23f5[_0x14efed(0x290)][_0x14efed(0x2c6)](_0x4f678e,_0xd2f036);}if(_0x1c5212[_0x14efed(0x1fa)]===_0x14efed(0x2a1))_0x2688c7[_0x14efed(0x20e)]?.({'type':_0x14efed(0x1e6),'name':_0x2088bb[_0x14efed(0x2a7)][_0x14efed(0x263)],'journeyId':_0x1c5212[_0x14efed(0x2ac)]}),_0x2688c7['logSuccess']?.(_0x14efed(0x2a3)+_0x2088bb[_0x14efed(0x2a7)][_0x14efed(0x263)]+'\x27'),_0x6f23f5[_0x14efed(0x2a1)]++;else _0x1c5212[_0x14efed(0x1fa)]==='updated'&&(_0x2688c7[_0x14efed(0x20e)]?.({'type':_0x14efed(0x253),'name':_0x2088bb['yamlConfig'][_0x14efed(0x263)]}),_0x2688c7['logSuccess']?.(_0x14efed(0x23d)+_0x2088bb[_0x14efed(0x2a7)]['name']+'\x27'),_0x6f23f5[_0x14efed(0x2a4)]++);return{'action':_0x1c5212['action'],'name':_0x2088bb['yamlConfig']['name'],'journeyId':_0x1c5212[_0x14efed(0x2ac)]};}catch(_0x438b84){const _0x5eb2e1=isHttp400Error(_0x438b84),_0x6e067b=_0x5eb2e1?ErrorCode[_0x14efed(0x1df)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x141e75=getErrorMessage(_0x438b84);throw new SDKError(_0x6e067b,_0x14efed(0x22c)+(_0x2088bb[_0x14efed(0x27e)]?_0x14efed(0x223):_0x14efed(0x243))+_0x14efed(0x274)+_0x2088bb[_0x14efed(0x21d)]+_0x14efed(0x208)+_0x141e75,_0x438b84);}}));_0x6f23f5[_0x4bbb29(0x2af)][_0x4bbb29(0x248)](..._0x13959a);}return _0x6f23f5;}async function matchExistingJourneySegments(_0x5ca5d6,_0x4cd8ce,_0x5212db,_0x5771e5,_0x102a48){const _0x1589ce=a159_0x2fc205;if(!_0x4cd8ce[_0x1589ce(0x250)]||!_0x4cd8ce['yamlConfig'][_0x1589ce(0x25c)])return;const _0x3c1b68=new Map(),_0x115113=new Set();for(const _0x44f31a of Object[_0x1589ce(0x23a)](_0x4cd8ce[_0x1589ce(0x2a7)][_0x1589ce(0x25c)])){const _0x561814=generateDeterministicJourneySegmentName(_0x4cd8ce[_0x1589ce(0x2a7)][_0x1589ce(0x263)],_0x44f31a);_0x3c1b68[_0x1589ce(0x2c6)](_0x561814,_0x44f31a),_0x115113[_0x1589ce(0x26f)](_0x44f31a);}const _0x34f0e6=[],_0x231a15=collectSegmentIdsFromJourneyApi(_0x4cd8ce[_0x1589ce(0x250)]);for(const _0x1e8d0e of _0x231a15){const _0x5eec41=await fetchSegment(_0x5ca5d6,_0x5212db,_0x1e8d0e,_0x5771e5);if(!_0x5eec41?.['name'])continue;const _0x16e7ed=_0x3c1b68[_0x1589ce(0x28e)](_0x5eec41[_0x1589ce(0x263)]);_0x16e7ed?(_0x102a48[_0x1589ce(0x2c6)](_0x16e7ed,_0x1e8d0e),_0x115113[_0x1589ce(0x2b0)](_0x16e7ed)):_0x34f0e6[_0x1589ce(0x248)]({'id':_0x1e8d0e,'seg':_0x5eec41});}if(_0x115113['size']>0x0&&_0x34f0e6[_0x1589ce(0x25d)]>0x0){const {localExpandedRuleToNames:_0x4af0e9}=buildLocalExpandedRuleMappings(_0x4cd8ce[_0x1589ce(0x2a7)]),_0x5b8818=new Map();for(const {id:_0x262852,seg:_0x5ba418}of _0x34f0e6){if(_0x5ba418[_0x1589ce(0x1da)]){const _0x195abe=apiRuleToYaml(_0x5ba418[_0x1589ce(0x1da)]);_0x5b8818['set'](_0x262852,_0x195abe);}}for(const {id:_0x5ad3fc,seg:_0x22b146}of _0x34f0e6){if(!_0x22b146['rule'])continue;const _0x57d79b=_0x5b8818[_0x1589ce(0x28e)](_0x5ad3fc);if(!_0x57d79b)continue;const _0x54f7ea=serializeExpandedRule(_0x57d79b,_0x5b8818),_0x1f9f1b=_0x4af0e9['get'](_0x54f7ea);if(_0x1f9f1b){const _0x14e910=_0x1f9f1b['find'](_0x5817ae=>_0x115113[_0x1589ce(0x21e)](_0x5817ae));_0x14e910&&(_0x102a48[_0x1589ce(0x2c6)](_0x14e910,_0x5ad3fc),_0x115113['delete'](_0x14e910),logger['debug']('Matched\x20server\x20segment\x20\x27'+_0x22b146['name']+'\x27\x20to\x20local\x20\x27'+_0x14e910+_0x1589ce(0x24b)));}}}}async function executeSingleJourneyPush(_0x2e75ed,_0xf9062f,_0x2c26ca,_0x287625,_0x171004,_0x2f5c58){const _0x299b9b=a159_0x2fc205,{journeyDefToRequest:_0x55621e,activationDefToCreateRequest:_0x5a18d5,yamlRuleToApi:_0x478e22,validateSegmentRule:_0x4abe1b}=_0x2f5c58,_0x279699=new Map(),_0x411eae=new Map();recoverSegmentIdsFromPushRecovery(_0xf9062f,_0x279699,_0x2c26ca[_0x299b9b(0x1dd)]);const _0x4ffbb2=new Map(),_0x950c3=new Map(),_0x5469f6=new Map();let _0x1bc852;const _0x3e9526=async()=>{const _0x1d8459=_0x299b9b;if(_0x1bc852)return;_0x1bc852=new Map();if(!_0xf9062f[_0x1d8459(0x250)])return;const _0x351845=await _0x2e75ed[_0x1d8459(0x218)][_0x1d8459(0x277)](_0xf9062f[_0x1d8459(0x250)]['id']);for(const _0xfd426e of _0x351845){const _0x28f9ef=journeyActivationStepToYaml(_0xfd426e,_0x2c26ca[_0x1d8459(0x22e)],_0x2c26ca[_0x1d8459(0x237)]),_0x2b7bcb=activationSignature(_0x28f9ef);!_0x1bc852[_0x1d8459(0x21e)](_0x2b7bcb)&&_0x1bc852[_0x1d8459(0x2c6)](_0x2b7bcb,_0xfd426e['id']),_0x28f9ef['name']&&_0x411eae['set'](_0x28f9ef[_0x1d8459(0x263)],_0xfd426e['id']);}};await matchExistingJourneySegments(_0x2e75ed,_0xf9062f,_0x287625[_0x299b9b(0x2c1)],_0x2c26ca[_0x299b9b(0x27d)],_0x2c26ca[_0x299b9b(0x1dd)]);const _0x378f59={'resolveSegmentId':async _0xedb3e=>{const _0x300813=_0x299b9b,_0x556327=_0x2c26ca[_0x300813(0x1dd)]['get'](_0xedb3e);if(!_0x556327)throw new SDKError(ErrorCode[_0x300813(0x2a2)],'Segment\x20not\x20found:\x20'+_0xedb3e+_0x300813(0x2b7)+_0xf9062f[_0x300813(0x2a7)][_0x300813(0x263)]+')');return _0x556327;},'resolveEmbeddedSegmentId':async(_0x407384,_0x2d82fc)=>{const _0x7ddee5=_0x299b9b,_0x226b73=_0x2c26ca['segmentNameToId'][_0x7ddee5(0x28e)](_0x407384);if(_0x226b73)return _0x226b73;const _0x4b57c7=_0x2c26ca[_0x7ddee5(0x27d)]['find'](_0x4f5ef1=>_0x4f5ef1['name']===_0x407384);if(_0x4b57c7)return _0x2c26ca[_0x7ddee5(0x1dd)]['set'](_0x407384,_0x4b57c7['id']),_0x4b57c7['id'];if(_0xf9062f[_0x7ddee5(0x27e)]){const {stageName:_0x46085d,criteriaName:_0x1bc0ce}=findSegmentCriteriaLocation(_0xf9062f[_0x7ddee5(0x2a7)],_0x407384);return _0x4abe1b(_0x407384,_0x2d82fc[_0x7ddee5(0x1da)]),_0x950c3['set'](_0x407384,{'definition':_0x2d82fc,'stageName':_0x46085d,'criteriaName':_0x1bc0ce}),createPendingSegmentId(_0x407384);}const _0x50fc03=_0xf9062f[_0x7ddee5(0x250)]?.['id'];if(!_0x50fc03)throw new SDKError(ErrorCode[_0x7ddee5(0x28d)],_0x7ddee5(0x272));const _0x1bbf1b=_0x4ffbb2[_0x7ddee5(0x28e)](_0x407384);if(_0x1bbf1b)return _0x1bbf1b;const _0xe9bd4b=((async()=>{const _0x5b7bdf=_0x7ddee5;_0x4abe1b(_0x407384,_0x2d82fc[_0x5b7bdf(0x1da)]);const _0x3eb932=generateDeterministicJourneySegmentName(_0xf9062f[_0x5b7bdf(0x2a7)]['name'],_0x407384),_0x1ed393=_0x2c26ca[_0x5b7bdf(0x27d)]['find'](_0x118d2e=>_0x118d2e[_0x5b7bdf(0x263)]===_0x3eb932),_0xf9d871=createSegmentIdResolver(_0x2c26ca[_0x5b7bdf(0x1dd)],_0x407384),_0x3a1442=await resolveRuleSegmentIds(_0x2d82fc[_0x5b7bdf(0x1da)],_0xf9d871);let _0x552048;return _0x1ed393?(await _0x2e75ed['segment'][_0x5b7bdf(0x26c)](_0x287625[_0x5b7bdf(0x2c1)],_0x1ed393['id'],{'description':_0x2d82fc[_0x5b7bdf(0x241)]||_0x5b7bdf(0x2ab)+_0x407384,'rule':_0x478e22(_0x3a1442),'countPopulation':!![]}),_0x552048=_0x1ed393['id'],saveSegmentToPushRecovery(_0xf9062f[_0x5b7bdf(0x21d)],_0xf9062f[_0x5b7bdf(0x2a7)]['name'],_0x407384,{'segmentId':_0x552048,'uniqueServerName':_0x3eb932,'createdAt':new Date()['toISOString']()})):_0x552048=await createOrRecoverEmbeddedSegment(_0x2e75ed,_0xf9062f,{'localName':_0x407384,'uniqueSegmentName':_0x3eb932,'description':_0x2d82fc['description']||_0x5b7bdf(0x2ab)+_0x407384,'journeyId':_0x50fc03,'resolvedRule':_0x3a1442,'parentId':_0x287625['parentId'],'folderId':_0x287625['rootFolderId']||''},_0x478e22),_0x2c26ca[_0x5b7bdf(0x1dd)][_0x5b7bdf(0x2c6)](_0x407384,_0x552048),_0x279699[_0x5b7bdf(0x2c6)](_0x407384,_0x552048),_0x552048;})());_0x4ffbb2[_0x7ddee5(0x2c6)](_0x407384,_0xe9bd4b);try{return await _0xe9bd4b;}finally{_0x4ffbb2[_0x7ddee5(0x2b0)](_0x407384);}},'resolveActivationId':async _0x5a501e=>{const _0x36630f=_0x299b9b,_0x36216b=_0x411eae[_0x36630f(0x28e)](_0x5a501e);if(_0x36216b)return _0x36216b;if(_0xf9062f[_0x36630f(0x250)]){await _0x3e9526();const _0xba53ff=_0x411eae[_0x36630f(0x28e)](_0x5a501e);if(_0xba53ff)return _0xba53ff;}throw new SDKError(ErrorCode[_0x36630f(0x28a)],_0x36630f(0x1f7)+_0x5a501e+_0x36630f(0x2b7)+_0xf9062f[_0x36630f(0x2a7)][_0x36630f(0x263)]+_0x36630f(0x27b)+_0x36630f(0x239));},'resolveEmbeddedActivationId':async(_0x1380ee,_0x31b65e)=>{const _0x3dcc6c=_0x299b9b,_0x811496=_0x411eae['get'](_0x1380ee);if(_0x811496)return _0x811496;if(_0xf9062f['isNew'])return _0x5469f6[_0x3dcc6c(0x2c6)](_0x1380ee,_0x31b65e),createPendingActivationId(_0x1380ee);if(_0xf9062f[_0x3dcc6c(0x250)]){await _0x3e9526();const _0x253b63=_0x411eae['get'](_0x31b65e['name']);if(_0x253b63)return _0x411eae['set'](_0x1380ee,_0x253b63),_0x253b63;const _0x3e78d8=activationSignature(_0x31b65e),_0x4991b7=_0x1bc852?.['get'](_0x3e78d8);if(_0x4991b7)return _0x411eae[_0x3dcc6c(0x2c6)](_0x1380ee,_0x4991b7),_0x4991b7;const _0x547059=await _0x5a18d5(_0x31b65e,_0x2c26ca['activationContext']),_0x5d921d={..._0x547059,..._0x31b65e[_0x3dcc6c(0x24c)]!==undefined&&{'runAfterJourneyRefresh':_0x31b65e[_0x3dcc6c(0x24c)]}},_0x1bc99c=await _0x2e75ed[_0x3dcc6c(0x218)][_0x3dcc6c(0x299)](_0xf9062f[_0x3dcc6c(0x250)]['id'],_0x5d921d);return _0x411eae[_0x3dcc6c(0x2c6)](_0x1380ee,_0x1bc99c['id']),_0x1bc99c['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x3dcc6c(0x285));},'resolveJourneyId':async _0x135430=>{const _0x4ec5b9=_0x299b9b;try{return await _0x2e75ed['journey'][_0x4ec5b9(0x1d0)](_0x287625[_0x4ec5b9(0x2c1)],_0x135430);}catch(_0x2b3428){throw new SDKError(ErrorCode['NOT_FOUND'],_0x4ec5b9(0x22d)+_0x135430+_0x4ec5b9(0x1e4)+_0xf9062f[_0x4ec5b9(0x2a7)][_0x4ec5b9(0x263)]+'\x27)',_0x2b3428);}},'resolveStageId':async(_0x54b9d0,_0xe80440)=>{const _0x2b26af=_0x299b9b,_0x1733f2=await _0x2e75ed['journey'][_0x2b26af(0x21b)](_0x54b9d0),_0x2df4d7=_0x1733f2[_0x2b26af(0x227)]['journeyStages'][_0x2b26af(0x1dc)](_0x18a36c=>_0x18a36c[_0x2b26af(0x263)][_0x2b26af(0x244)]()===_0xe80440[_0x2b26af(0x244)]());if(!_0x2df4d7?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x2b26af(0x236)+_0xe80440+_0x2b26af(0x207)+(_0x1733f2[_0x2b26af(0x227)][_0x2b26af(0x266)]||_0x1733f2[_0x2b26af(0x227)]['name'])+'\x27');return _0x2df4d7['id'];}},_0x75fca2=await _0x55621e(_0xf9062f['yamlConfig'],_0x287625[_0x299b9b(0x2c1)],_0x378f59),_0x442fc2=_0x287625[_0x299b9b(0x281)]||_0x287625[_0x299b9b(0x295)];_0x442fc2&&(_0x75fca2['relationships']={'parentFolder':{'data':{'id':_0x442fc2,'type':_0x299b9b(0x2c5)}}});if(_0xf9062f[_0x299b9b(0x27e)]){if(_0x950c3[_0x299b9b(0x298)]>0x0||_0x5469f6['size']>0x0)return await executeThreeStepJourneyCreate(_0x2e75ed,_0xf9062f,_0x75fca2,{'pendingEmbeddedSegments':_0x950c3,'pendingEmbeddedActivations':_0x5469f6,'embeddedSegmentNameToId':_0x279699,'journeyActivationNameToId':_0x411eae},{..._0x287625,'effectiveFolderId':_0x442fc2},_0x2c26ca,_0x171004,_0x2f5c58);else{ensureJourneyDefaults(_0x75fca2['attributes']);const _0x451e42=await _0x2e75ed[_0x299b9b(0x218)][_0x299b9b(0x223)](_0x75fca2);return deletePushRecovery(_0xf9062f['absolutePath']),{'action':_0x299b9b(0x2a1),'journeyId':_0x451e42['id'],'embeddedSegmentNameToId':_0x279699};}}else{if(_0xf9062f[_0x299b9b(0x291)]&&_0xf9062f[_0x299b9b(0x250)]){_0x75fca2['id']=_0xf9062f['existingJourney']['id'];const _0x179481=_0x75fca2[_0x299b9b(0x227)];_0xf9062f['existingJourney'][_0x299b9b(0x227)]?.['journeyBundleName']&&(_0x179481['journeyBundleName']=_0xf9062f[_0x299b9b(0x250)][_0x299b9b(0x227)][_0x299b9b(0x266)]);const _0xe4ed68=_0xf9062f[_0x299b9b(0x250)][_0x299b9b(0x227)]?.[_0x299b9b(0x2d4)];return _0xe4ed68&&_0x75fca2['attributes'][_0x299b9b(0x2d4)]&&injectExistingStageIds(_0x75fca2[_0x299b9b(0x227)][_0x299b9b(0x2d4)],_0xe4ed68),ensureJourneyDefaults(_0x179481),await _0x2e75ed['journey']['update'](_0xf9062f[_0x299b9b(0x250)]['id'],_0x75fca2),deletePushRecovery(_0xf9062f['absolutePath']),{'action':_0x299b9b(0x2a4),'journeyId':_0xf9062f[_0x299b9b(0x250)]['id'],'embeddedSegmentNameToId':_0x279699};}}return deletePushRecovery(_0xf9062f['absolutePath']),{'action':_0x299b9b(0x25e),'journeyId':_0xf9062f['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x279699};}function findSegmentCriteriaLocation(_0x184ed9,_0x5cc667){const _0x52712f=a159_0x2fc205,_0x2b98fc=_0x184ed9['stages']||_0x184ed9[_0x52712f(0x22f)]?.[0x0]?.['stages']||[];let _0x1afd0b=_0x52712f(0x270),_0x23c4ac=_0x5cc667;const _0x3e58d8=_0x184ed9[_0x52712f(0x2b9)]||_0x184ed9['journeys']?.[0x0]?.[_0x52712f(0x2b9)];if(_0x3e58d8?.[_0x52712f(0x1d6)]===_0x5cc667)return{'stageName':_0x52712f(0x2b9),'criteriaName':_0x3e58d8['name']||_0x5cc667};_0x5a1201:for(const _0x35be8e of _0x2b98fc){if(_0x35be8e[_0x52712f(0x2ca)]?.[_0x52712f(0x1d6)]===_0x5cc667){_0x1afd0b=_0x35be8e['name'],_0x23c4ac=_0x35be8e['entry_criteria'][_0x52712f(0x263)]||_0x5cc667;break;}if(_0x35be8e[_0x52712f(0x24a)])for(const _0x5c95f5 of _0x35be8e[_0x52712f(0x24a)]){if(_0x5c95f5['type']===_0x52712f(0x222)&&_0x5c95f5[_0x52712f(0x2c8)]?.[_0x52712f(0x2a5)])for(const _0xa4c9ee of _0x5c95f5[_0x52712f(0x2c8)]['branches']){if(_0xa4c9ee[_0x52712f(0x1d6)]===_0x5cc667){_0x1afd0b=_0x35be8e[_0x52712f(0x263)],_0x23c4ac=_0xa4c9ee['name']||_0x5cc667;break _0x5a1201;}}}}return{'stageName':_0x1afd0b,'criteriaName':_0x23c4ac};}async function executeThreeStepJourneyCreate(_0x2438e6,_0x2bf2ec,_0x1367a6,_0x409e0d,_0x55447f,_0x4fd9eb,_0x4a492c,_0x2e8c22){const _0x46bda9=a159_0x2fc205,{activationDefToCreateRequest:_0x36c5ee,yamlRuleToApi:_0x13340b}=_0x2e8c22,{pendingEmbeddedSegments:_0x3a94c9,pendingEmbeddedActivations:_0x254da6,embeddedSegmentNameToId:_0x452677}=_0x409e0d,_0x37e075=JSON[_0x46bda9(0x235)](JSON[_0x46bda9(0x2d0)](_0x1367a6));ensureJourneyDefaults(_0x37e075['attributes']),stripPendingIds(_0x37e075);const _0x1bc060=await _0x2438e6[_0x46bda9(0x218)][_0x46bda9(0x223)](_0x37e075),_0x4f813b=_0x1bc060['id'],_0x25ffe0=new Map();for(const _0x2816b8 of _0x1bc060[_0x46bda9(0x227)]['journeyStages']){_0x25ffe0[_0x46bda9(0x2c6)](_0x2816b8[_0x46bda9(0x263)][_0x46bda9(0x244)](),_0x2816b8['id']);}recoverSegmentIdsFromPushRecovery(_0x2bf2ec,_0x452677,_0x4fd9eb['segmentNameToId']);for(const [_0x45ebf7,{definition:_0x1c115f}]of _0x3a94c9){if(_0x452677[_0x46bda9(0x21e)](_0x45ebf7)){_0x4a492c[_0x46bda9(0x20e)]?.({'type':_0x46bda9(0x246),'journeyName':_0x2bf2ec[_0x46bda9(0x2a7)][_0x46bda9(0x263)],'segmentName':_0x45ebf7});continue;}const _0x54e21c=generateDeterministicJourneySegmentName(_0x2bf2ec[_0x46bda9(0x2a7)][_0x46bda9(0x263)],_0x45ebf7);_0x4a492c[_0x46bda9(0x20e)]?.({'type':_0x46bda9(0x24e),'journeyName':_0x2bf2ec[_0x46bda9(0x2a7)][_0x46bda9(0x263)],'segmentName':_0x45ebf7});const _0x451912=createSegmentIdResolver(_0x4fd9eb['segmentNameToId'],_0x45ebf7),_0x44f109=await resolveRuleSegmentIds(_0x1c115f[_0x46bda9(0x1da)],_0x451912),_0xcf766d=await createOrRecoverEmbeddedSegment(_0x2438e6,_0x2bf2ec,{'localName':_0x45ebf7,'uniqueSegmentName':_0x54e21c,'description':_0x1c115f[_0x46bda9(0x241)]||_0x46bda9(0x2ab)+_0x45ebf7,'journeyId':_0x4f813b,'resolvedRule':_0x44f109,'parentId':_0x55447f['parentId'],'folderId':_0x55447f[_0x46bda9(0x205)]||''},_0x13340b);_0x452677[_0x46bda9(0x2c6)](_0x45ebf7,_0xcf766d),_0x4fd9eb[_0x46bda9(0x1dd)][_0x46bda9(0x2c6)](_0x45ebf7,_0xcf766d),_0x4a492c['onProgress']?.({'type':'embedded_segment_created','journeyName':_0x2bf2ec[_0x46bda9(0x2a7)][_0x46bda9(0x263)],'segmentName':_0x45ebf7});}const _0xc9b0d4=new Map();for(const [_0x795f6c,_0x2870f0]of _0x254da6){_0x4a492c[_0x46bda9(0x20e)]?.({'type':'embedded_activation_creating','journeyName':_0x2bf2ec[_0x46bda9(0x2a7)][_0x46bda9(0x263)],'activationName':_0x795f6c});const _0x1b2ad7=await _0x36c5ee(_0x2870f0,_0x4fd9eb[_0x46bda9(0x201)]),_0x26bd49={..._0x1b2ad7,..._0x2870f0[_0x46bda9(0x24c)]!==undefined&&{'runAfterJourneyRefresh':_0x2870f0[_0x46bda9(0x24c)]}},_0x1ef041=await _0x2438e6[_0x46bda9(0x218)][_0x46bda9(0x299)](_0x4f813b,_0x26bd49);_0xc9b0d4['set'](_0x795f6c,_0x1ef041['id']),_0x409e0d[_0x46bda9(0x220)][_0x46bda9(0x2c6)](_0x795f6c,_0x1ef041['id']),_0x4a492c[_0x46bda9(0x20e)]?.({'type':_0x46bda9(0x279),'journeyName':_0x2bf2ec[_0x46bda9(0x2a7)]['name'],'activationName':_0x795f6c});}const _0x2134ec=JSON[_0x46bda9(0x235)](JSON[_0x46bda9(0x2d0)](_0x1367a6));return _0x2134ec['id']=_0x4f813b,ensureJourneyDefaults(_0x2134ec[_0x46bda9(0x227)]),resolvePendingIdsInRequest(_0x2134ec,_0x1367a6,_0x25ffe0,_0x452677,_0xc9b0d4,_0x4a492c),await _0x2438e6[_0x46bda9(0x218)]['update'](_0x4f813b,_0x2134ec),deletePushRecovery(_0x2bf2ec[_0x46bda9(0x21d)]),{'action':'created','journeyId':_0x4f813b,'embeddedSegmentNameToId':_0x452677};}export function stripWaitStepPendingIds(_0x3ac4f5){const _0x17bdc2=a159_0x2fc205,_0x45384a=_0x3ac4f5[_0x17bdc2(0x200)]&&isPendingSegmentId(_0x3ac4f5[_0x17bdc2(0x200)]),_0x4cc41b=_0x3ac4f5[_0x17bdc2(0x1ff)]?.['some'](_0x45a149=>_0x45a149[_0x17bdc2(0x1fb)]&&isPendingSegmentId(_0x45a149[_0x17bdc2(0x1fb)]));(_0x45384a||_0x4cc41b)&&(_0x3ac4f5[_0x17bdc2(0x249)]=_0x17bdc2(0x212),_0x3ac4f5[_0x17bdc2(0x242)]=0x1,_0x3ac4f5[_0x17bdc2(0x29c)]=_0x17bdc2(0x1d7),delete _0x3ac4f5[_0x17bdc2(0x200)],delete _0x3ac4f5[_0x17bdc2(0x1ee)],delete _0x3ac4f5[_0x17bdc2(0x210)],delete _0x3ac4f5['conditions']);}export function resolveWaitStepPendingIds(_0x529de4,_0x13ac56,_0x57dba8,_0x521352){const _0x1645ef=a159_0x2fc205;if(_0x13ac56[_0x1645ef(0x200)]&&isPendingSegmentId(_0x13ac56[_0x1645ef(0x200)])){const _0x409e03=_0x57dba8(_0x13ac56[_0x1645ef(0x200)],_0x1645ef(0x2ba)+_0x521352+_0x1645ef(0x233));_0x409e03&&(_0x529de4['waitStepType']='Condition',_0x529de4[_0x1645ef(0x200)]=_0x409e03,delete _0x529de4[_0x1645ef(0x242)],delete _0x529de4[_0x1645ef(0x29c)],_0x13ac56['conditionTimeoutDuration']!==undefined&&(_0x529de4[_0x1645ef(0x1ee)]=_0x13ac56[_0x1645ef(0x1ee)]),_0x13ac56[_0x1645ef(0x210)]&&(_0x529de4[_0x1645ef(0x210)]=_0x13ac56[_0x1645ef(0x210)]));}if(_0x13ac56[_0x1645ef(0x1ff)]){const _0x123b71=_0x13ac56[_0x1645ef(0x1ff)]['some'](_0x125068=>_0x125068[_0x1645ef(0x1fb)]&&isPendingSegmentId(_0x125068[_0x1645ef(0x1fb)]));if(_0x123b71){const _0x25e679=_0x13ac56[_0x1645ef(0x1ff)]['map'](_0x286694=>{const _0x45d762=_0x1645ef;if(_0x286694['segmentId']&&isPendingSegmentId(_0x286694[_0x45d762(0x1fb)])){const _0x5cb490=_0x57dba8(_0x286694[_0x45d762(0x1fb)],_0x45d762(0x2ba)+_0x521352+_0x45d762(0x233));return{..._0x286694,'segmentId':_0x5cb490||_0x286694['segmentId']};}return{..._0x286694};});_0x529de4[_0x1645ef(0x249)]=_0x1645ef(0x25f),_0x529de4[_0x1645ef(0x1ff)]=_0x25e679,delete _0x529de4[_0x1645ef(0x242)],delete _0x529de4['waitStepUnit'],delete _0x529de4['conditionSegmentId'],delete _0x529de4[_0x1645ef(0x1ee)],delete _0x529de4[_0x1645ef(0x210)];}}}function stripPendingIds(_0x1b3302){const _0x41091c=a159_0x2fc205;_0x1b3302[_0x41091c(0x227)]['goal']?.[_0x41091c(0x1fb)]&&isPendingSegmentId(_0x1b3302[_0x41091c(0x227)]['goal'][_0x41091c(0x1fb)])&&delete _0x1b3302[_0x41091c(0x227)]['goal'];for(const _0x11ce9a of _0x1b3302[_0x41091c(0x227)][_0x41091c(0x2d4)]||[]){_0x11ce9a[_0x41091c(0x228)]?.['segmentId']&&isPendingSegmentId(_0x11ce9a[_0x41091c(0x228)][_0x41091c(0x1fb)])&&delete _0x11ce9a[_0x41091c(0x228)];_0x11ce9a[_0x41091c(0x2d2)]?.[_0x41091c(0x1fb)]&&isPendingSegmentId(_0x11ce9a[_0x41091c(0x2d2)]['segmentId'])&&delete _0x11ce9a['milestone'];_0x11ce9a['exitCriterias']&&(_0x11ce9a[_0x41091c(0x283)]=_0x11ce9a[_0x41091c(0x283)][_0x41091c(0x226)](_0x3a1108=>!_0x3a1108['segmentId']||!isPendingSegmentId(_0x3a1108[_0x41091c(0x1fb)])));if(_0x11ce9a['steps'])for(const _0x44b31e of Object[_0x41091c(0x23a)](_0x11ce9a[_0x41091c(0x24a)])){const _0x230045=_0x11ce9a[_0x41091c(0x24a)][_0x44b31e];_0x230045[_0x41091c(0x254)]===_0x41091c(0x276)&&_0x230045[_0x41091c(0x2aa)]&&isPendingActivationId(_0x230045[_0x41091c(0x2aa)])&&(_0x230045[_0x41091c(0x2aa)]='');if(_0x230045[_0x41091c(0x254)]===_0x41091c(0x24f)&&_0x230045[_0x41091c(0x2a5)])for(const _0x1c101c of _0x230045['branches']){_0x1c101c['segmentId']&&isPendingSegmentId(_0x1c101c[_0x41091c(0x1fb)])&&(_0x1c101c[_0x41091c(0x1fb)]='');}_0x230045[_0x41091c(0x254)]===_0x41091c(0x20d)&&stripWaitStepPendingIds(_0x230045);}}}function resolvePendingIdsInRequest(_0x2e0179,_0x33493a,_0x642f11,_0x450493,_0x1b0dc8,_0x15e9c0){const _0x533fc5=a159_0x2fc205,_0x3b64db=(_0x56b03a,_0x43e9cb)=>{const _0x13bc13=a159_0x1b1a;if(!isPendingSegmentId(_0x56b03a))return _0x56b03a;const _0x3759f4=extractPendingSegmentName(_0x56b03a),_0xdb0ac5=_0x450493[_0x13bc13(0x28e)](_0x3759f4);return!_0xdb0ac5&&_0x15e9c0[_0x13bc13(0x21a)]?.(_0x13bc13(0x1d1)+_0x3759f4+_0x13bc13(0x275)+_0x43e9cb),_0xdb0ac5;};if(_0x2e0179[_0x533fc5(0x227)]['goal']?.[_0x533fc5(0x1fb)]&&isPendingSegmentId(_0x2e0179['attributes']['goal']['segmentId'])){const _0x439ad8=_0x3b64db(_0x2e0179['attributes'][_0x533fc5(0x2b9)][_0x533fc5(0x1fb)],'goal\x20criteria');_0x439ad8&&(_0x2e0179[_0x533fc5(0x227)]['goal'][_0x533fc5(0x1fb)]=_0x439ad8);}for(const _0x50163b of _0x2e0179[_0x533fc5(0x227)][_0x533fc5(0x2d4)]||[]){const _0x57c976=_0x642f11[_0x533fc5(0x28e)](_0x50163b[_0x533fc5(0x263)][_0x533fc5(0x244)]());_0x57c976&&(_0x50163b['id']=_0x57c976);if(_0x50163b['entryCriteria']?.[_0x533fc5(0x1fb)]&&isPendingSegmentId(_0x50163b['entryCriteria'][_0x533fc5(0x1fb)])){const _0x2b9ca6=_0x3b64db(_0x50163b['entryCriteria'][_0x533fc5(0x1fb)],_0x533fc5(0x2ba)+_0x50163b[_0x533fc5(0x263)]+_0x533fc5(0x29d));_0x2b9ca6&&(_0x50163b[_0x533fc5(0x228)][_0x533fc5(0x1fb)]=_0x2b9ca6);}if(_0x50163b[_0x533fc5(0x283)])for(const _0x3fc3cd of _0x50163b[_0x533fc5(0x283)]){if(_0x3fc3cd['segmentId']&&isPendingSegmentId(_0x3fc3cd[_0x533fc5(0x1fb)])){const _0x53a649=_0x3b64db(_0x3fc3cd['segmentId'],_0x533fc5(0x2ba)+_0x50163b[_0x533fc5(0x263)]+_0x533fc5(0x2cd));_0x53a649&&(_0x3fc3cd[_0x533fc5(0x1fb)]=_0x53a649);}}if(_0x50163b[_0x533fc5(0x2d2)]?.[_0x533fc5(0x1fb)]&&isPendingSegmentId(_0x50163b[_0x533fc5(0x2d2)][_0x533fc5(0x1fb)])){const _0x9b5a74=_0x3b64db(_0x50163b[_0x533fc5(0x2d2)]['segmentId'],_0x533fc5(0x2ba)+_0x50163b['name']+'\x27\x20milestone');_0x9b5a74&&(_0x50163b[_0x533fc5(0x2d2)]['segmentId']=_0x9b5a74);}if(_0x50163b[_0x533fc5(0x24a)]){const _0x1dfcad=_0x490a1f=>_0x33493a[_0x533fc5(0x227)]['journeyStages']?.['find'](_0x389286=>_0x389286[_0x533fc5(0x263)][_0x533fc5(0x244)]()===_0x50163b[_0x533fc5(0x263)][_0x533fc5(0x244)]())?.['steps']?.[_0x490a1f];for(const _0x39d2bc of Object[_0x533fc5(0x23a)](_0x50163b['steps'])){const _0x133fca=_0x50163b[_0x533fc5(0x24a)][_0x39d2bc],_0x17baa0=_0x1dfcad(_0x39d2bc);if(_0x133fca[_0x533fc5(0x254)]===_0x533fc5(0x276)&&_0x133fca['journeyActivationStepId']&&(isPendingActivationId(_0x133fca[_0x533fc5(0x2aa)])||_0x133fca[_0x533fc5(0x2aa)]==='')){if(_0x17baa0?.[_0x533fc5(0x2aa)]&&isPendingActivationId(_0x17baa0['journeyActivationStepId'])){const _0x11af41=extractPendingActivationName(_0x17baa0[_0x533fc5(0x2aa)]),_0x1ace3c=_0x1b0dc8[_0x533fc5(0x28e)](_0x11af41);_0x1ace3c&&(_0x133fca[_0x533fc5(0x2aa)]=_0x1ace3c);}}if(_0x133fca['type']===_0x533fc5(0x24f)&&_0x133fca['branches']&&_0x17baa0?.['branches'])for(let _0x3af26e=0x0;_0x3af26e<_0x133fca[_0x533fc5(0x2a5)][_0x533fc5(0x25d)];_0x3af26e++){const _0x3cd70e=_0x133fca[_0x533fc5(0x2a5)][_0x3af26e],_0x1bdc03=_0x17baa0[_0x533fc5(0x2a5)][_0x3af26e];if(_0x1bdc03?.[_0x533fc5(0x1fb)]&&isPendingSegmentId(_0x1bdc03[_0x533fc5(0x1fb)])){const _0x2f8882=_0x3b64db(_0x1bdc03[_0x533fc5(0x1fb)],_0x533fc5(0x2ba)+_0x50163b[_0x533fc5(0x263)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x3cd70e['name']||_0x3af26e)+'\x27');_0x2f8882&&(_0x3cd70e[_0x533fc5(0x1fb)]=_0x2f8882);}}_0x133fca['type']===_0x533fc5(0x20d)&&_0x17baa0?.['type']==='WaitStep'&&resolveWaitStepPendingIds(_0x133fca,_0x17baa0,_0x3b64db,_0x50163b['name']);}}}}
1
+ const a168_0x5cf043=a168_0x51ba;(function(_0x4a76cd,_0x3af289){const _0x57b75f=a168_0x51ba,_0x289498=_0x4a76cd();while(!![]){try{const _0x313817=parseInt(_0x57b75f(0x13d))/0x1*(-parseInt(_0x57b75f(0xf7))/0x2)+parseInt(_0x57b75f(0x182))/0x3*(parseInt(_0x57b75f(0x1d0))/0x4)+-parseInt(_0x57b75f(0x1b9))/0x5+parseInt(_0x57b75f(0x14a))/0x6*(-parseInt(_0x57b75f(0x1c1))/0x7)+-parseInt(_0x57b75f(0x148))/0x8*(-parseInt(_0x57b75f(0x18f))/0x9)+-parseInt(_0x57b75f(0x12e))/0xa+-parseInt(_0x57b75f(0x195))/0xb*(parseInt(_0x57b75f(0x163))/0xc);if(_0x313817===_0x3af289)break;else _0x289498['push'](_0x289498['shift']());}catch(_0x34b727){_0x289498['push'](_0x289498['shift']());}}}(a168_0x5e19,0xa466b));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a168_0x5cf043(0x1a0));function a168_0x51ba(_0x145301,_0x4e6b14){_0x145301=_0x145301-0xdb;const _0x5e19dd=a168_0x5e19();let _0x51bad9=_0x5e19dd[_0x145301];return _0x51bad9;}export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a168_0x5cf043(0x188);export function createPendingSegmentId(_0x4439cd){return''+PENDING_SEGMENT_PREFIX+_0x4439cd+'__';}export function isPendingSegmentId(_0x2699d6){const _0x2cf4ac=a168_0x5cf043;return _0x2699d6['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x2699d6[_0x2cf4ac(0xfc)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x541901){const _0x5168b9=a168_0x5cf043;return _0x541901[_0x5168b9(0x1d5)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x746c12){return''+PENDING_ACTIVATION_PREFIX+_0x746c12+'__';}export function isPendingActivationId(_0x42ed19){const _0x2d6179=a168_0x5cf043;return _0x42ed19[_0x2d6179(0xfc)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x467d7c){const _0x369dbf=a168_0x5cf043;return _0x467d7c[_0x369dbf(0x1d5)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x508b7f,_0x5ddef6){const _0xa6b842=a168_0x5cf043,_0x528478=_0x508b7f+'::'+(_0x5ddef6[_0xa6b842(0x146)]()||_0xa6b842(0x160)),_0x15509d=createHash('sha1')['update'](_0x528478)['digest']('hex')[_0xa6b842(0x1c8)](0x0,0xc);return _0xa6b842(0x102)+_0x15509d;}export function ensureJourneyDefaults(_0x3b4407){const _0x45cd9b=a168_0x5cf043;!_0x3b4407[_0x45cd9b(0x1cb)]&&(_0x3b4407[_0x45cd9b(0x1cb)]=''),!_0x3b4407[_0x45cd9b(0xf6)]&&(_0x3b4407[_0x45cd9b(0xf6)]=_0x45cd9b(0x149));}export function injectExistingStageIds(_0x573da5,_0x309bba){const _0x468bc5=a168_0x5cf043,_0x11d8ad=new Map(_0x309bba[_0x468bc5(0xe6)](_0x2a4f64=>[_0x2a4f64[_0x468bc5(0x170)],_0x2a4f64['id']]));for(const _0x432bef of _0x573da5){if(!_0x432bef['id']){const _0x296075=_0x11d8ad['get'](_0x432bef[_0x468bc5(0x170)]);_0x296075&&(_0x432bef['id']=_0x296075);}}}export function resolveTDFolderPath(_0x3f5157,_0x32eaa8,_0x2fda92){const _0x256e7d=a168_0x5cf043;if(!_0x32eaa8)return _0x3f5157;if(_0x3f5157===_0x2fda92||_0x3f5157[_0x256e7d(0xfc)](_0x2fda92+'/'))return _0x3f5157;return _0x3f5157?_0x2fda92+'/'+_0x3f5157:_0x2fda92;}export function addFoldersToCreate(_0x5f0610,_0x470172,_0x249259){const _0x5a1ebd=a168_0x5cf043;if(!_0x5f0610)return;if(_0x470172[_0x5a1ebd(0x15a)](_0x5f0610))return;const _0x15e8d9=_0x5f0610[_0x5a1ebd(0xdb)]('/');let _0x51b55f='';for(const _0x821fbb of _0x15e8d9){_0x51b55f=_0x51b55f?_0x51b55f+'/'+_0x821fbb:_0x821fbb,!_0x470172[_0x5a1ebd(0x15a)](_0x51b55f)&&_0x249259['add'](_0x51b55f);}}export function sortFoldersByDepth(_0x11e951){const _0x4f3378=a168_0x5cf043;return[..._0x11e951][_0x4f3378(0x13e)]((_0x4eddd9,_0x2e2249)=>{const _0x2904e4=_0x4f3378,_0x409d58=(_0x4eddd9[_0x2904e4(0x1ba)](/\//g)||[])['length'],_0x1622e2=(_0x2e2249['match'](/\//g)||[])[_0x2904e4(0xdc)];return _0x409d58-_0x1622e2;});}import*as a168_0x54cead from'yaml';import{readFileSync}from'fs';import a168_0x1426cc from'path';import{isJourneyDef,parseYamlString as a168_0x2e04ad,toYamlString as a168_0x25b02b,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(_0x4d40d2){const _0x434de2=a168_0x5cf043;if(Array[_0x434de2(0x175)](_0x4d40d2))return'['+_0x4d40d2[_0x434de2(0xe6)](_0x59310b=>stableStringify(_0x59310b))['join'](',')+']';if(_0x4d40d2&&typeof _0x4d40d2==='object'){const _0x3bcf25=_0x4d40d2,_0x309eda=Object['keys'](_0x3bcf25)['sort'](),_0x655a47=_0x309eda[_0x434de2(0xe6)](_0xb24fef=>'\x22'+_0xb24fef+'\x22:'+stableStringify(_0x3bcf25[_0xb24fef]));return'{'+_0x655a47[_0x434de2(0x1b4)](',')+'}';}const _0x35229d=JSON[_0x434de2(0x10b)](_0x4d40d2);return _0x35229d===undefined?_0x434de2(0x194):_0x35229d;}function activationSignature(_0x50a3a7){const _0x3921a5=a168_0x5cf043,_0x337d1b={'connection':_0x50a3a7[_0x3921a5(0x1c5)],..._0x50a3a7[_0x3921a5(0x18d)]!==undefined&&{'all_columns':_0x50a3a7['all_columns']},..._0x50a3a7[_0x3921a5(0x19f)]!==undefined&&{'columns':_0x50a3a7[_0x3921a5(0x19f)]},..._0x50a3a7[_0x3921a5(0x1c9)]!==undefined&&{'behavior':_0x50a3a7[_0x3921a5(0x1c9)]},..._0x50a3a7[_0x3921a5(0x197)]!==undefined&&{'behaviors':_0x50a3a7[_0x3921a5(0x197)]},..._0x50a3a7[_0x3921a5(0xfb)]!==undefined&&{'schedule':_0x50a3a7[_0x3921a5(0xfb)]},..._0x50a3a7[_0x3921a5(0x111)]!==undefined&&{'notification':_0x50a3a7[_0x3921a5(0x111)]},..._0x50a3a7[_0x3921a5(0x107)]!==undefined&&{'connector_config':_0x50a3a7[_0x3921a5(0x107)]},..._0x50a3a7[_0x3921a5(0x1d6)]!==undefined&&{'activation_template_id':_0x50a3a7[_0x3921a5(0x1d6)]}};return stableStringify(_0x337d1b);}async function fetchSegment(_0x12610a,_0x2ad920,_0x2ac65b,_0x13a0ed){const _0xb4156d=a168_0x5cf043,_0x1c5730=_0x13a0ed?.[_0xb4156d(0x11b)](_0x2575d1=>_0x2575d1['id']===_0x2ac65b);if(_0x1c5730)return _0x1c5730;try{return await _0x12610a[_0xb4156d(0x160)][_0xb4156d(0x13c)](_0x2ad920,_0x2ac65b);}catch(_0x202092){logger[_0xb4156d(0x142)](_0xb4156d(0x199)+_0x2ac65b+_0xb4156d(0x192)+_0x202092);try{return await _0x12610a[_0xb4156d(0x160)]['getSegmentEntity'](_0x2ac65b);}catch(_0x4aaac4){return logger[_0xb4156d(0x142)](_0xb4156d(0x1b5)+_0x2ac65b+':\x20'+_0x4aaac4),null;}}}function recoverSegmentIdsFromPushRecovery(_0x485fb7,_0x26fb8f,_0x53f306){const _0x3e0c35=a168_0x5cf043,_0x849992=readPushRecovery(_0x485fb7[_0x3e0c35(0x139)]);if(_0x849992?.[_0x3e0c35(0x120)]===_0x485fb7[_0x3e0c35(0x152)][_0x3e0c35(0x170)])for(const [_0x134652,_0xf1f8c0]of Object[_0x3e0c35(0x1ad)](_0x849992[_0x3e0c35(0x17e)])){const _0x9a32cf=generateDeterministicJourneySegmentName(_0x485fb7['yamlConfig'][_0x3e0c35(0x170)],_0x134652);_0xf1f8c0[_0x3e0c35(0xfa)]===_0x9a32cf&&(_0x26fb8f[_0x3e0c35(0x1ce)](_0x134652,_0xf1f8c0[_0x3e0c35(0x14b)]),_0x53f306[_0x3e0c35(0x1ce)](_0x134652,_0xf1f8c0[_0x3e0c35(0x14b)]));}}async function createOrRecoverEmbeddedSegment(_0x1c6fc4,_0x3da9c8,_0x2c6968,_0x4a4317){const _0x355c4f=a168_0x5cf043;let _0x32ba6a;try{_0x32ba6a=await _0x1c6fc4[_0x355c4f(0x160)][_0x355c4f(0x168)]({'name':_0x2c6968['uniqueSegmentName'],'description':_0x2c6968[_0x355c4f(0x1cb)],'journeyId':_0x2c6968['journeyId'],'rule':_0x4a4317(_0x2c6968['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x2c6968['folderId'],'audienceId':_0x2c6968[_0x355c4f(0x180)]});}catch(_0x605f1d){const _0x4fb381=_0x605f1d instanceof Error&&_0x605f1d['message'][_0x355c4f(0xe1)](_0x355c4f(0x1a4));if(_0x4fb381){const _0x55acc1=readPushRecovery(_0x3da9c8[_0x355c4f(0x139)]),_0x170400=_0x55acc1?.['journeyName']===_0x3da9c8['yamlConfig'][_0x355c4f(0x170)]?_0x55acc1[_0x355c4f(0x17e)][_0x2c6968[_0x355c4f(0x113)]]:undefined;if(_0x170400?.['uniqueServerName']===_0x2c6968[_0x355c4f(0xed)])await _0x1c6fc4[_0x355c4f(0x160)][_0x355c4f(0xff)](_0x2c6968[_0x355c4f(0x180)],_0x170400[_0x355c4f(0x14b)],{'description':_0x2c6968['description'],'rule':_0x4a4317(_0x2c6968[_0x355c4f(0xe2)],!![]),'countPopulation':!![]}),_0x32ba6a=_0x170400[_0x355c4f(0x14b)];else throw new SDKError(ErrorCode[_0x355c4f(0x109)],'Embedded\x20segment\x20\x27'+_0x2c6968[_0x355c4f(0x113)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x355c4f(0x145)+_0x3da9c8['absolutePath'][_0x355c4f(0x1d5)](/([^/]+)$/,_0x355c4f(0x17b))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x605f1d);}else throw _0x605f1d;}return saveSegmentToPushRecovery(_0x3da9c8['absolutePath'],_0x3da9c8[_0x355c4f(0x152)][_0x355c4f(0x170)],_0x2c6968[_0x355c4f(0x113)],{'segmentId':_0x32ba6a,'uniqueServerName':_0x2c6968['uniqueSegmentName'],'createdAt':new Date()[_0x355c4f(0x143)]()}),_0x32ba6a;}export async function prepareSegmentFiles(_0x1bc919,_0x95fad8,_0x4e93bb,_0x83f607,_0x151519){const _0x29d9bd=a168_0x5cf043,{activationDefToCreateRequest:_0x44842d}=await import(_0x29d9bd(0x173)),_0x329084=[],_0xa6743d=new Set();for(const {yamlConfig:_0x4b082e,folderPath:_0x3c484a,sourcePath:_0x32ca30}of _0x1bc919){const _0x345874=resolveTDFolderPath(_0x3c484a,_0x83f607,_0x151519),_0xdc6e05=_0x345874+':'+_0x4b082e[_0x29d9bd(0x170)],_0x4c8978=_0x95fad8[_0x29d9bd(0x18c)]['get'](_0xdc6e05),_0x5529e9=_0x4c8978?_0x95fad8[_0x29d9bd(0x172)][_0x29d9bd(0x11e)](_0x4c8978['id'])||[]:[];addFoldersToCreate(_0x345874,_0x95fad8[_0x29d9bd(0x136)],_0xa6743d);const _0x2d9d98=calculateActivationActions(_0x4b082e[_0x29d9bd(0x1d9)]||[],_0x5529e9,_0x95fad8['idToEmailMap'],_0x95fad8[_0x29d9bd(0x156)]);for(const _0x654c46 of _0x2d9d98){(_0x654c46['type']===_0x29d9bd(0x10f)||_0x654c46[_0x29d9bd(0xe9)]===_0x29d9bd(0xfd))&&_0x654c46[_0x29d9bd(0x17f)]&&(_0x654c46['validatedRequest']=await _0x44842d(_0x654c46['yamlActivation'],_0x4e93bb));}const _0x4b1cc2=calculateSegmentDiff(_0x4b082e,_0x4c8978,_0x5529e9,_0x95fad8['idToEmailMap'],_0x95fad8[_0x29d9bd(0x156)]);_0x329084['push']({'relativePath':_0x4b082e[_0x29d9bd(0x170)],'absolutePath':_0x32ca30,'yamlConfig':_0x4b082e,'folderPath':_0x345874,'existingSegment':_0x4c8978,'existingActivations':_0x5529e9,'isNew':_0x4b1cc2[_0x29d9bd(0x1c4)],'hasChanges':_0x4b1cc2['hasChanges'],'diff':_0x4b1cc2['diff'],'activationActions':_0x2d9d98});}return{'segmentFiles':_0x329084,'foldersToCreate':_0xa6743d};}export async function prepareJourneyFiles(_0x3b3d3e,_0x51659d,_0x7963b3,_0x45355c){const _0x4cc796=a168_0x5cf043,_0x3afacd=[],_0x34ff78=new Set();for(const {yamlConfig:_0x2ae3aa,folderPath:_0x3b68c8,sourcePath:_0x3c1cc8}of _0x3b3d3e){const _0x432ae5=resolveTDFolderPath(_0x3b68c8,_0x7963b3,_0x45355c),_0x599dd0=_0x432ae5+':'+_0x2ae3aa[_0x4cc796(0x170)],_0x5241ef=_0x51659d[_0x4cc796(0xf2)][_0x4cc796(0x11e)](_0x599dd0);let _0x593350,_0x413c5c;if(_0x5241ef&&_0x5241ef[_0x4cc796(0xdc)]>0x0){const _0x1cdd21=buildLocalExpandedRuleMappings(_0x2ae3aa),{createYamlContext:_0x5c7965,prefetchJourneySegments:_0x4db13a}=createPushYamlContextForBundle(_0x51659d[_0x4cc796(0x114)],_0x51659d['parentId'],_0x51659d[_0x4cc796(0x169)],_0x1cdd21,_0x51659d[_0x4cc796(0x196)],_0x51659d[_0x4cc796(0x156)],_0x51659d[_0x4cc796(0x13b)],_0x51659d[_0x4cc796(0x11a)]);await _0x4db13a(_0x5241ef['map'](_0x2ed6f4=>_0x2ed6f4['id']));const _0x49ec97=await _0x51659d[_0x4cc796(0x114)][_0x4cc796(0x12b)][_0x4cc796(0x14e)](_0x5241ef[0x0][_0x4cc796(0x191)]),_0x35a202=hasMultipleVersions(_0x2ae3aa),_0x327e9c=async _0x5abcd5=>{const _0xa087ab=_0x4cc796,_0xe16f0b=_0x51659d[_0xa087ab(0x11a)]?.[_0xa087ab(0x11e)](_0x5abcd5);if(_0xe16f0b)return _0xe16f0b;return _0x51659d['fetchJourney']({'journeyId':_0x5abcd5,'journeyName':_0x2ae3aa[_0xa087ab(0x170)],'isMultiVersion':_0x5241ef['length']>0x1});};if(_0x35a202&&_0x5241ef[_0x4cc796(0xdc)]>0x1){const _0x457bbc=[];for(const _0x59ecc3 of _0x5241ef){const _0xb79c0c=_0x59ecc3[_0x4cc796(0x11f)]||0x1;_0x51659d[_0x4cc796(0x155)]?.[_0x4cc796(0xfd)]('Fetching\x20'+_0x2ae3aa[_0x4cc796(0x170)]+'\x20v'+_0xb79c0c);const _0x3e90bf=await _0x327e9c(_0x59ecc3['id']),_0xdded05=_0x5c7965(_0x59ecc3['id']),_0x318fc1=await journeyResponseToDef(_0x3e90bf,_0xdded05);_0x457bbc[_0x4cc796(0x164)]({'item':_0x59ecc3,'yaml':_0x318fc1});}const _0x187500=buildLocalRuleToNameMappingFromJourney(_0x2ae3aa);_0x413c5c=buildMergedJourneyDef(_0x457bbc,_0x187500,_0x49ec97);const _0x19d0d3=Math[_0x4cc796(0x190)](..._0x457bbc[_0x4cc796(0xe6)](_0x2613af=>_0x2613af['item'][_0x4cc796(0x11f)]||0x0)),_0x4f2faf=_0x5241ef[_0x4cc796(0x11b)](_0x561a1a=>(_0x561a1a[_0x4cc796(0x11f)]||0x0)===_0x19d0d3);_0x4f2faf&&(_0x51659d['progress']?.[_0x4cc796(0xfd)](_0x4cc796(0x126)+_0x2ae3aa[_0x4cc796(0x170)]+'\x20v'+_0x19d0d3),_0x593350=await _0x327e9c(_0x4f2faf['id']));}else{const _0x27e0b6=_0x5241ef[_0x5241ef[_0x4cc796(0xdc)]-0x1];_0x51659d['progress']?.[_0x4cc796(0xfd)](_0x4cc796(0x126)+_0x2ae3aa[_0x4cc796(0x170)]),_0x593350=await _0x327e9c(_0x27e0b6['id']);const _0x28df19=_0x5c7965(_0x27e0b6['id']),_0x4962d1=await journeyResponseToDef(_0x593350,_0x28df19),_0x215467=buildLocalRuleToNameMappingFromJourney(_0x2ae3aa);_0x413c5c=buildMergedJourneyDef([{'item':_0x27e0b6,'yaml':_0x4962d1}],_0x215467,_0x49ec97);}}addFoldersToCreate(_0x432ae5,_0x51659d['folderPathToId'],_0x34ff78);const _0x5375db=calculateJourneyDiff(_0x2ae3aa,_0x413c5c);_0x3afacd['push']({'relativePath':_0x2ae3aa['name'],'absolutePath':_0x3c1cc8,'yamlConfig':_0x2ae3aa,'folderPath':_0x432ae5,'existingJourney':_0x593350,'isNew':_0x5375db['isNew'],'hasChanges':_0x5375db[_0x4cc796(0x1a7)],'diff':_0x5375db['diff']});}return{'journeyFiles':_0x3afacd,'foldersToCreate':_0x34ff78};}export function calculateActivationActions(_0x1023a0,_0x532b81,_0x14fa0e,_0x3ad99a){const _0x113710=a168_0x5cf043,_0x28cfe0=[],_0x2a1cdf=new Map();for(const _0x4e29fe of _0x532b81){_0x2a1cdf[_0x113710(0x1ce)](_0x4e29fe['name'],_0x4e29fe);}const _0x24aea2=new Map();for(const _0x33dc87 of _0x1023a0){_0x24aea2[_0x113710(0x1ce)](_0x33dc87[_0x113710(0x170)],_0x33dc87);}for(const _0x517981 of _0x1023a0){const _0x40b5cf=_0x2a1cdf[_0x113710(0x11e)](_0x517981[_0x113710(0x170)]);if(!_0x40b5cf)_0x28cfe0[_0x113710(0x164)]({'type':_0x113710(0x10f),'name':_0x517981[_0x113710(0x170)],'yamlActivation':_0x517981});else{const _0x3d8f1a=activationResponseToDef(_0x40b5cf,_0x14fa0e,_0x3ad99a),_0x334862=a168_0x54cead[_0x113710(0x10b)](_0x3d8f1a),_0x11ca26=a168_0x54cead[_0x113710(0x10b)](_0x517981);_0x334862!==_0x11ca26&&_0x28cfe0['push']({'type':_0x113710(0xfd),'name':_0x517981[_0x113710(0x170)],'yamlActivation':_0x517981,'existingActivation':_0x40b5cf});}}for(const _0x206b78 of _0x532b81){!_0x24aea2['has'](_0x206b78['name'])&&_0x28cfe0[_0x113710(0x164)]({'type':_0x113710(0xdf),'name':_0x206b78[_0x113710(0x170)],'existingActivation':_0x206b78});}return _0x28cfe0;}function calculateYamlDiff(_0x57c84e,_0x3a4589){if(_0x3a4589){const _0x865e32=generateDiff(_0x3a4589,_0x57c84e),_0x59dd65=hasChanges(_0x865e32);return{'isNew':![],'hasChanges':_0x59dd65,'diff':_0x59dd65?formatDiffWithColors(_0x865e32):undefined};}const _0x4b3e5a=generateDiff('',_0x57c84e);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4b3e5a)};}export function calculateSegmentDiff(_0x5dee8e,_0x417ee8,_0x1469f6,_0x40004b,_0x2088bd){const _0x3fa0ad=segmentToYamlString(_0x5dee8e),_0x89310e=_0x417ee8?segmentToYamlString(segmentWithActivationsToYaml(_0x417ee8,_0x1469f6,undefined,_0x40004b,_0x2088bd)):undefined;return calculateYamlDiff(_0x3fa0ad,_0x89310e);}export function calculateJourneyDiff(_0x2802be,_0x557eee){const _0x3e9999=normalizeJourneyDef(_0x2802be,_0x2802be),_0x53abde=a168_0x25b02b(_0x3e9999),_0x454cad=_0x557eee?a168_0x25b02b(normalizeJourneyDef(_0x557eee,_0x2802be)):undefined;return calculateYamlDiff(_0x53abde,_0x454cad);}export function findSegmentsToDelete(_0x531f3a,_0x705f88,_0x3e5007,_0x237e22,_0xa0d5ed){const _0x47f14e=a168_0x5cf043,_0x12a152=new Set();for(const {yamlConfig:_0x50940b,folderPath:_0x40941a}of _0x705f88){_0x12a152[_0x47f14e(0x16c)](_0x40941a+':'+_0x50940b[_0x47f14e(0x170)]);}return _0x531f3a['filter'](_0x136537=>{const _0x5e85e7=_0x47f14e,_0x8144b8=_0x136537[_0x5e85e7(0x150)]?_0x3e5007[_0x5e85e7(0x11e)](_0x136537[_0x5e85e7(0x150)][_0x5e85e7(0x178)]())||'':'',_0x4313e0=_0x8144b8+':'+_0x136537[_0x5e85e7(0x170)];if(_0x12a152[_0x5e85e7(0x15a)](_0x4313e0))return![];if(_0xa0d5ed)return _0x8144b8===_0x237e22||_0x8144b8[_0x5e85e7(0xfc)](_0x237e22+'/');return!![];});}export function findJourneysToDelete(_0x49bca5,_0x3dd1ba,_0x41ef9f,_0x4bc9c7,_0xc18b20){const _0x5c3b9a=a168_0x5cf043,_0xee11fd=new Set();for(const {yamlConfig:_0x5370ff,folderPath:_0x55b734}of _0x3dd1ba){_0xee11fd[_0x5c3b9a(0x16c)](_0x55b734+':'+_0x5370ff['name']);}return _0x49bca5['filter'](_0xa6d3df=>{const _0x58756a=_0x5c3b9a,_0x282ea3=_0xa6d3df[_0x58756a(0x15f)]?_0x41ef9f[_0x58756a(0x11e)](_0xa6d3df[_0x58756a(0x15f)])||'':'',_0x42f523=_0x282ea3+':'+_0xa6d3df[_0x58756a(0x138)];if(_0xee11fd[_0x58756a(0x15a)](_0x42f523))return![];if(_0xc18b20)return _0x282ea3===_0x4bc9c7||_0x282ea3[_0x58756a(0xfc)](_0x4bc9c7+'/');return!![];});}export function buildSegmentLookupMap(_0x4b74b7,_0x50da9a){const _0x2c110f=a168_0x5cf043,_0x4f2a6f=new Map();for(const _0x4a5e79 of _0x4b74b7){const _0x279a9a=_0x4a5e79[_0x2c110f(0x150)]?_0x50da9a['get'](_0x4a5e79[_0x2c110f(0x150)][_0x2c110f(0x178)]())||'':'',_0x29851a=_0x279a9a+':'+_0x4a5e79[_0x2c110f(0x170)];_0x4f2a6f[_0x2c110f(0x1ce)](_0x29851a,_0x4a5e79);}return _0x4f2a6f;}export function buildSegmentNameToIdMap(_0x4aec0e){const _0x1f1420=a168_0x5cf043,_0x1d61c6=new Map();for(const _0x1ac2f6 of _0x4aec0e){_0x1d61c6[_0x1f1420(0x1ce)](_0x1ac2f6[_0x1f1420(0x170)],_0x1ac2f6['id']);}return _0x1d61c6;}export function buildJourneyBundleLookupMap(_0x4d4116,_0x41eaeb){const _0x42c932=a168_0x5cf043,_0x3c4ab2=new Map();for(const _0x97743f of _0x4d4116){const _0x265eb3=_0x97743f[_0x42c932(0x15f)]?_0x41eaeb[_0x42c932(0x11e)](_0x97743f[_0x42c932(0x15f)])||'':'',_0x5de2e1=_0x265eb3+':'+_0x97743f[_0x42c932(0x138)];!_0x3c4ab2[_0x42c932(0x15a)](_0x5de2e1)&&_0x3c4ab2['set'](_0x5de2e1,[]),_0x3c4ab2[_0x42c932(0x11e)](_0x5de2e1)[_0x42c932(0x164)](_0x97743f);}for(const _0x385f02 of _0x3c4ab2[_0x42c932(0x12a)]()){_0x385f02['sort']((_0x4a8f8a,_0x3c613f)=>(_0x4a8f8a[_0x42c932(0x11f)]||0x0)-(_0x3c613f[_0x42c932(0x11f)]||0x0));}return _0x3c4ab2;}export function collectFoldersToCreate(_0x1203aa,_0xb4ec){const _0x3207c6=a168_0x5cf043,_0x49bd2b=new Set();for(const _0x506851 of _0x1203aa){if(!_0x506851)continue;if(_0xb4ec[_0x3207c6(0x15a)](_0x506851))continue;const _0x446932=_0x506851['split']('/');let _0x5eeffc='';for(const _0x52ce00 of _0x446932){_0x5eeffc=_0x5eeffc?_0x5eeffc+'/'+_0x52ce00:_0x52ce00,!_0xb4ec[_0x3207c6(0x15a)](_0x5eeffc)&&_0x49bd2b['add'](_0x5eeffc);}}return _0x49bd2b;}export function parseAndClassifyYamlFiles(_0x3da1b1,_0x3b7f03,_0x44b084){const _0x3605a9=a168_0x5cf043,_0x56f843=[],_0x154a54=[];for(const _0x15c297 of _0x3da1b1){const _0xd68242=a168_0x1426cc[_0x3605a9(0x158)](_0x3b7f03,a168_0x1426cc[_0x3605a9(0x1d2)](_0x15c297)),_0x438b87=_0xd68242==='.'?'':_0xd68242[_0x3605a9(0x1d5)](/\\/g,'/'),_0x263d98=readFileSync(_0x15c297,_0x3605a9(0x19d)),_0x4d950b=a168_0x54cead['parse'](_0x263d98);if(isJourneyDef(_0x4d950b,_0x15c297)){const _0x8c4cd6=a168_0x2e04ad(_0x263d98);_0x154a54[_0x3605a9(0x164)]({'yamlConfig':_0x8c4cd6,'folderPath':_0x438b87,'sourcePath':_0x15c297});}else{if(!_0x44b084?.[_0x3605a9(0x141)]){const _0x148437=parseSegmentYamlFile(_0x263d98),_0x23bdd5=normalizeChildSegmentYaml(_0x148437);_0x56f843[_0x3605a9(0x164)]({'yamlConfig':_0x23bdd5,'folderPath':_0x438b87,'sourcePath':_0x15c297});}}}return{'segments':_0x56f843,'journeys':_0x154a54};}export function validateParsedFiles(_0x1bb764,_0x5aaa55){const _0x58f636=a168_0x5cf043,_0x51c76c=[];for(const {yamlConfig:_0x4b2df5,sourcePath:_0x46265b}of _0x1bb764[_0x58f636(0x17e)]){const _0x1db5a6=readFileSync(_0x46265b,_0x58f636(0x19d)),_0x2f37c0=a168_0x54cead[_0x58f636(0x1b6)](_0x1db5a6),_0x34875c=validateSegmentDef(_0x4b2df5,{'source':_0x1db5a6,'document':_0x2f37c0},{'skipSchema':!![]});if(!_0x34875c[_0x58f636(0x179)]){const _0x5a52ed=a168_0x1426cc[_0x58f636(0x158)](_0x5aaa55,_0x46265b);_0x51c76c[_0x58f636(0x164)]({'filePath':_0x5a52ed,'source':_0x1db5a6,'result':_0x34875c,'isJourney':![]});}}for(const {yamlConfig:_0x16be9d,sourcePath:_0x571a0f}of _0x1bb764[_0x58f636(0x108)]){const _0x40cd17=readFileSync(_0x571a0f,_0x58f636(0x19d)),_0x4305fd=a168_0x54cead[_0x58f636(0x1b6)](_0x40cd17),_0x551bd7=validateJourneyDef(_0x16be9d,{'source':_0x40cd17,'document':_0x4305fd},{'skipSchema':!![]});if(!_0x551bd7['valid']){const _0x5ab347=a168_0x1426cc[_0x58f636(0x158)](_0x5aaa55,_0x571a0f);_0x51c76c[_0x58f636(0x164)]({'filePath':_0x5ab347,'source':_0x40cd17,'result':_0x551bd7,'isJourney':!![]});}}return _0x51c76c;}export function formatValidationErrors(_0x5d8682){const _0x4e89de=a168_0x5cf043,_0x507cff=[];for(const {filePath:_0x3ee463,source:_0x18a57b,result:_0x10e7bb,isJourney:_0x209d6c}of _0x5d8682){const _0x201c19=_0x209d6c?_0x4e89de(0x12b):'segment';_0x507cff[_0x4e89de(0x164)]('\x0a'+_0x3ee463+'\x20('+_0x201c19+_0x4e89de(0xee)+_0x10e7bb[_0x4e89de(0x1b1)][_0x4e89de(0xdc)]+'\x20error(s)'),_0x507cff[_0x4e89de(0x164)](formatValidationResult(_0x10e7bb,_0x18a57b,_0x3ee463));}return _0x507cff[_0x4e89de(0x1b4)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x27b487){const _0x49393c=a168_0x5cf043,_0x5bd342=new Set(),_0x455b15=new Map(),_0xbfdc9=collectSegmentUsageCounts(_0x27b487);if(_0x27b487[_0x49393c(0x17e)])for(const [_0x102909,_0x385b4f]of Object[_0x49393c(0x1ad)](_0x27b487['segments'])){_0x5bd342['add'](_0x102909);if(_0x385b4f[_0x49393c(0x116)]){const _0x3593ec=yamlRuleToApi(_0x385b4f['rule']),_0x3df486=apiRuleToYaml(_0x3593ec);_0x455b15[_0x49393c(0x1ce)](_0x102909,_0x3df486);}}const _0x56f637=new Map();let _0x24b841=0x0;for(const [_0x1e1325,_0x7e02a]of _0x455b15){const _0xd6ff29=serializeExpandedRule(_0x7e02a,_0x455b15),_0x3c49b1=_0x56f637['get'](_0xd6ff29)||[];_0x3c49b1['push']({'name':_0x1e1325,'index':_0x24b841}),_0x56f637[_0x49393c(0x1ce)](_0xd6ff29,_0x3c49b1),_0x24b841++;}const _0x1f5b2d=new Map();for(const [_0x53545e,_0x20678d]of _0x56f637){const _0x3ff8fa=_0x20678d[_0x49393c(0x1c8)]()[_0x49393c(0x13e)]((_0x5eb75e,_0x6c8fc0)=>{const _0x54c21b=_0x49393c,_0x12cdf0=_0xbfdc9[_0x54c21b(0x11e)](_0x5eb75e['name'])||0x0,_0x3774a1=_0xbfdc9[_0x54c21b(0x11e)](_0x6c8fc0[_0x54c21b(0x170)])||0x0;if(_0x12cdf0!==_0x3774a1)return _0x3774a1-_0x12cdf0;return _0x5eb75e[_0x54c21b(0x183)]-_0x6c8fc0[_0x54c21b(0x183)];})['map'](_0x2330bb=>_0x2330bb[_0x49393c(0x170)]),_0x3c0e66=[];for(const _0x27cad3 of _0x3ff8fa){const _0x411b3a=_0xbfdc9[_0x49393c(0x11e)](_0x27cad3)||0x0,_0x3f2b9e=Math[_0x49393c(0x190)](_0x411b3a,0x1);for(let _0x18ea67=0x0;_0x18ea67<_0x3f2b9e;_0x18ea67++){_0x3c0e66[_0x49393c(0x164)](_0x27cad3);}}_0x1f5b2d[_0x49393c(0x1ce)](_0x53545e,_0x3c0e66);}return{'existingLocalSegmentNames':_0x5bd342,'localSegmentRules':_0x455b15,'localExpandedRuleToNames':_0x1f5b2d};}export function createSegmentIdResolver(_0xd4f03d,_0x49d232){return async _0x29f939=>{const _0x486ec3=a168_0x51ba,_0x45b23a=_0xd4f03d['get'](_0x29f939);if(!_0x45b23a)throw new SDKError(ErrorCode[_0x486ec3(0xeb)],'Segment\x20not\x20found:\x20'+_0x29f939+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x49d232+'\x27)');return _0x45b23a;};}export function extractRootFolderId(_0x4480c9){const _0x3b05f8=a168_0x5cf043;return _0x4480c9['relationships']?.[_0x3b05f8(0x1ac)]?.[_0x3b05f8(0x1d3)]?.['id']||_0x4480c9[_0x3b05f8(0x1d4)]?.['parentFolder']?.[_0x3b05f8(0x1d3)]?.['id'];}export function buildConnectionMaps(_0x4ca390){const _0x392eff=a168_0x5cf043,_0xc2b9c0=new Map(),_0x393df5=new Map(),_0x2a6a29=new Map();for(const _0x4b0126 of _0x4ca390){_0xc2b9c0[_0x392eff(0x1ce)](_0x4b0126['name'],parseInt(_0x4b0126['id'],0xa)),_0x393df5['set'](_0x4b0126['id'],_0x4b0126['name']),_0x2a6a29[_0x392eff(0x1ce)](_0x4b0126['name'],_0x4b0126[_0x392eff(0xe9)]);}return{'nameToId':_0xc2b9c0,'idToName':_0x393df5,'nameToType':_0x2a6a29};}function a168_0x5e19(){const _0x59a3b2=['Deleted\x20activation\x20\x27','uniqueSegmentName','):\x20','idToName','\x27\x20not\x20found\x20in\x20journey\x20\x27','conditionTimeoutUnit','journeyBundlesByFolderAndName','resolveSegment','getActivation','folderPath','state','1398nYfKaF','Failed\x20to\x20fetch\x20referenced\x20segment\x20','existingJourney','uniqueServerName','schedule','startsWith','update','existingActivation','updateSegmentById','branches','Deleting\x20activation\x20\x27','journey_entry_criteria_','goal\x20criteria','attributes','\x27\x20wait\x20condition','folder','connector_config','journeys','SEGMENT_UPDATE_ERROR','Segment\x20not\x20found','stringify','deleteActivation','goal','Updating\x20segment\x20\x27','create','segment_deleting','notification','filter','localName','deps','Failed\x20to\x20','rule','logInfo','Updating\x20activation\x20\x27','WaitStep','journeyById','find','embeddedSegmentNameToId','\x27\x20milestone','get','versionNumber','journeyName','steps','logSuccess','toLowerCase','created','conditionTimeoutDuration','Fetching\x20','createdSegmentIds','conditionSegmentId','entry_criteria','values','journey','\x0a\x20\x20','createdSegmentId','285720BEaHjB','NOT_FOUND','ACTIVATION_SYNTAX_ERROR','Updated\x20activation\x20\x27','Stage\x20\x27','Failed\x20to\x20resolve\x20segment\x20','kind','Updated\x20journey\x20\x27','folderPathToId','createSegment','journeyBundleName','absolutePath','with','activationStepsById','getSegment','419IueGGH','sort','Created\x20activation\x20\x27','buildUserMaps','skipSegments','debug','toISOString','unchanged','Delete\x20the\x20push\x20recovery\x20file\x20(','trim','keys','16OlRrlb','draft','1757040KyUkvs','segmentId','\x27...','verbose','getLatestJourneyId','Segment\x20not\x20found:\x20','segmentFolderId','\x27\x20to\x20local\x20\x27','yamlConfig','\x27\x20exit\x20criteria','ACTIVATION_UPDATE_ERROR','progress','connectionIdToNameMap','validatedRequest','relative','from','has','journey_updating','journey_created','Creating\x20activation\x20\x27','deleted','folderId','segment','Entry\x20criteria:\x20','stages','2388USHvmU','push','rootFolderId','activation_updating','getJourney','createJourneySegment','existingSegments','Updated\x20segment\x20\x27','entry','add','user','journeyActivationStepId','JOURNEY_UPDATE_ERROR','name','action','activationsBySegmentId','./child-segment-yaml.js','all','isArray','some','Deleted\x20segment\x20\x27','toString','valid','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','.$1.push-recovery.json','list','Journey\x20\x27','segments','yamlActivation','parentId','journeyActivationNameToId','172461IPMQAa','index','Matched\x20server\x20segment\x20\x27','entryCriteria','Condition','conditions','__pending_act_','updated','segmentNameToId','../../utils/async.js','segmentByFolderAndName','all_columns','journeyId','4119273zgQeVo','max','journeyBundleId',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','embedded_activation_creating','null','23859WoGVEB','idToEmailMap','behaviors','withProgress','getSegment\x20failed\x20for\x20','folder_created','results','logDeleted','utf-8','journeyStages','columns','tdx.sdk.push-workflow','Created\x20journey\x20\x27','activation_creating','folder_creating','Name\x20has\x20already\x20been\x20taken','DecisionPoint','\x20journey\x20from\x20file:\x20','hasChanges','./journey-yaml.js','activationActions','\x27\x20entry\x20criteria','Activation','parentSegmentFolder','entries','INTERNAL','Creating\x20segment\x20\x27','\x27\x20from\x20file:\x20','errors','run_after_journey_refresh','existingSegment','join','getSegmentEntity\x20also\x20failed\x20for\x20','parseDocument','reduce','listActivations','2016550NTktRl','match','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','embedded_segment_creating','segment_deleted','waitStepUnit','activationParams','SEGMENT_SYNTAX_ERROR','7pFxcga','Created\x20segment\x20\x27','logWarning','isNew','connection','\x20(referenced\x20in\x20journey\x20','milestone','slice','behavior','size','description','flatMap','segment_created','set','effectiveFolderId','84jRnDPq','Duration','dirname','data','relationships','replace','activation_template_id','createActivation','nameToId','activations','split','length','exitCriterias','waitStep','delete','activation_deleting','includes','resolvedRule','activationContext','resolveJourneyId','onProgress','map','stage\x20\x27','waitStepType','type','embedded_segment_created','SEGMENT_NOT_FOUND'];a168_0x5e19=function(){return _0x59a3b2;};return a168_0x5e19();}export function calculatePushStats(_0x408f0f,_0x4d9cb7,_0x216b83,_0x2b42cf,_0x294ce4,_0x2c5e85,_0x1cbd14){const _0x39fa17=a168_0x5cf043,_0x5a5e93=_0x408f0f['filter'](_0x4ffa35=>_0x4ffa35['isNew']),_0x1d20c1=_0x408f0f[_0x39fa17(0x112)](_0x5f2b67=>!_0x5f2b67[_0x39fa17(0x1c4)]&&_0x5f2b67[_0x39fa17(0x1a7)]),_0x57a08d=_0x408f0f[_0x39fa17(0x112)](_0x4be8c8=>!_0x4be8c8[_0x39fa17(0x1c4)]&&!_0x4be8c8[_0x39fa17(0x1a7)]),_0x44657a=_0x2c5e85?_0x2b42cf:[],_0x25b27e=_0x4d9cb7[_0x39fa17(0x112)](_0x3c869c=>_0x3c869c[_0x39fa17(0x1c4)]),_0x246cbf=_0x4d9cb7[_0x39fa17(0x112)](_0x1aafba=>!_0x1aafba[_0x39fa17(0x1c4)]&&_0x1aafba[_0x39fa17(0x1a7)]),_0x49480d=_0x4d9cb7[_0x39fa17(0x112)](_0x1b90bd=>!_0x1b90bd[_0x39fa17(0x1c4)]&&!_0x1b90bd[_0x39fa17(0x1a7)]),_0x2d7390=_0x2c5e85?_0x294ce4:[],_0x134e05=_0x408f0f[_0x39fa17(0x1cc)](_0x3c3c12=>_0x3c3c12['activationActions']),_0x41efed=_0x134e05[_0x39fa17(0x112)](_0x4ff0b6=>_0x4ff0b6[_0x39fa17(0xe9)]===_0x39fa17(0x10f)),_0x2dc9b6=_0x134e05[_0x39fa17(0x112)](_0x3624c0=>_0x3624c0['type']===_0x39fa17(0xfd)),_0x14db0e=_0x134e05[_0x39fa17(0x112)](_0x3b435a=>_0x3b435a[_0x39fa17(0xe9)]===_0x39fa17(0xdf)),_0x310282=Array[_0x39fa17(0x159)](_0x216b83)[_0x39fa17(0x13e)](),_0xf294ab=_0x1cbd14?![]:_0x5a5e93[_0x39fa17(0xdc)]>0x0||_0x1d20c1[_0x39fa17(0xdc)]>0x0||_0x44657a[_0x39fa17(0xdc)]>0x0,_0x11fe2e=_0x25b27e[_0x39fa17(0xdc)]>0x0||_0x246cbf[_0x39fa17(0xdc)]>0x0||_0x2d7390[_0x39fa17(0xdc)]>0x0,_0x246afe=_0x1cbd14?![]:_0x134e05[_0x39fa17(0xdc)]>0x0,_0x4eeb35=_0x310282['length']>0x0;return{'segments':{'new':_0x5a5e93,'changed':_0x1d20c1,'unchanged':_0x57a08d,'toDelete':_0x44657a},'journeys':{'new':_0x25b27e,'changed':_0x246cbf,'unchanged':_0x49480d,'toDelete':_0x2d7390},'activations':{'all':_0x134e05,'toCreate':_0x41efed,'toUpdate':_0x2dc9b6,'toDelete':_0x14db0e},'folders':{'toCreate':_0x310282},'counts':{'segments':{'new':_0x5a5e93[_0x39fa17(0xdc)],'changed':_0x1d20c1['length'],'unchanged':_0x57a08d[_0x39fa17(0xdc)],'toDelete':_0x44657a[_0x39fa17(0xdc)]},'journeys':{'new':_0x25b27e['length'],'changed':_0x246cbf[_0x39fa17(0xdc)],'unchanged':_0x49480d[_0x39fa17(0xdc)],'toDelete':_0x2d7390['length']},'activations':{'create':_0x41efed[_0x39fa17(0xdc)],'update':_0x2dc9b6[_0x39fa17(0xdc)],'delete':_0x14db0e[_0x39fa17(0xdc)]},'folders':_0x310282['length']},'hasChanges':_0xf294ab||_0x11fe2e||_0x246afe||_0x4eeb35};}export async function buildPushExecutionContext(_0x80ab30,_0x54aee0,_0xf3ab79,_0x475693,_0x36c4b0,_0x269810){const _0xd737c8=a168_0x5cf043,_0x4ed12a=extractRootFolderId(_0xf3ab79),{pathToId:_0x1f0979,idToPath:_0x11588e}=buildFolderMaps(_0x36c4b0),_0x4ca5db=buildSegmentNameToIdMap(_0x475693),_0x29d44c=new Map(),{batchAsync:_0x3b4f88}=await import(_0xd737c8(0x18b)),[_0x50a5ef,_0x5d3f14]=await Promise[_0xd737c8(0x174)]([_0x80ab30[_0xd737c8(0x16d)][_0xd737c8(0x140)](),_0x80ab30[_0xd737c8(0x1c5)][_0xd737c8(0x17c)](),((async()=>{const _0x18620f=_0xd737c8;!_0x269810&&_0x475693[_0x18620f(0xdc)]>0x0&&await _0x3b4f88(_0x475693,async _0x538458=>{const _0x269824=_0x18620f,_0x3f3fb8=await _0x80ab30[_0x269824(0x160)][_0x269824(0x1b8)](_0x54aee0,_0x538458['id']);_0x29d44c[_0x269824(0x1ce)](_0x538458['id'],_0x3f3fb8);});})())]),{emailToId:_0x4ef16b,idToEmail:_0x2d95a7}=_0x50a5ef,_0xfc9d89=buildConnectionMaps(_0x5d3f14);return{'rootFolderId':_0x4ed12a,'folderPathToId':_0x1f0979,'folderIdToPath':_0x11588e,'segmentNameToId':_0x4ca5db,'activationsBySegmentId':_0x29d44c,'emailToIdMap':_0x4ef16b,'idToEmailMap':_0x2d95a7,'connectionNameToIdMap':_0xfc9d89[_0xd737c8(0x1d8)],'connectionIdToNameMap':_0xfc9d89[_0xd737c8(0xef)],'connectionNameToTypeMap':_0xfc9d89['nameToType']};}export function createPushYamlContextForBundle(_0x22ae8e,_0x35baf6,_0x24eebc,_0x92085e,_0x1f2d2f,_0x922461,_0xac0fd9,_0x40f930){const {existingLocalSegmentNames:_0x541f83,localExpandedRuleToNames:_0xf37207}=_0x92085e,_0x1c2124=new Set(),_0x36956a=new Map(),_0x3998c6=new Map(),_0xacc52f=new Map(),_0x40acff=createJumpTargetCache(),_0x2dcd15=new Map(),_0x4a01e6=new Map(),_0x34bc55=new Set();let _0x444267;const _0x3d2eb7=_0x49a97c=>{const _0x49a935={'resolveSegment':async _0xcf53a9=>{const _0x45792b=a168_0x51ba,_0x345f1f=_0xacc52f[_0x45792b(0x11e)](_0xcf53a9);if(_0x345f1f!==undefined)return{'name':_0x345f1f,'isJourneyLocal':!![]};try{const _0x33ec05=await fetchSegment(_0x22ae8e,_0x35baf6,_0xcf53a9,_0x24eebc);if(!_0x33ec05)throw new Error(_0x45792b(0x10a));const _0x24064e=generateJourneyLocalName(_0x33ec05[_0x45792b(0x170)]),_0x5c4b55=_0x33ec05[_0x45792b(0x134)]===SEGMENT_KIND_JOURNEY&&_0x24064e!==undefined;let _0x2bac69=_0x33ec05[_0x45792b(0x170)],_0x34c437;if(_0x5c4b55&&_0x33ec05[_0x45792b(0x116)]){const _0x4189c0=apiRuleToYaml(_0x33ec05['rule']);_0x4a01e6[_0x45792b(0x1ce)](_0xcf53a9,_0x4189c0);const _0x2cf199=async _0x5a95bf=>{const _0x4dec5e=_0x45792b,_0xf1a0c5=collectSegmentRefsFromRule(_0x5a95bf);for(const _0x5c91b1 of _0xf1a0c5){if(!_0x4a01e6[_0x4dec5e(0x15a)](_0x5c91b1))try{const _0x461b25=await fetchSegment(_0x22ae8e,_0x35baf6,_0x5c91b1,_0x24eebc);if(_0x461b25?.[_0x4dec5e(0x116)]){const _0x1e60c3=apiRuleToYaml(_0x461b25[_0x4dec5e(0x116)]);_0x4a01e6[_0x4dec5e(0x1ce)](_0x5c91b1,_0x1e60c3),await _0x2cf199(_0x1e60c3);}}catch(_0xc6ff3){logger['debug'](_0x4dec5e(0xf8)+_0x5c91b1+':\x20'+_0xc6ff3);}}};await _0x2cf199(_0x4189c0);const _0xf07af9=serializeExpandedRule(_0x4189c0,_0x4a01e6),_0x50770d=_0xf37207[_0x45792b(0x11e)](_0xf07af9);if(_0x50770d&&_0x50770d[_0x45792b(0xdc)]>0x0){const _0x33a4e6=_0x36956a['get'](_0xf07af9)||0x0,_0x1ca255=_0x50770d[_0x33a4e6]||_0x50770d[_0x50770d[_0x45792b(0xdc)]-0x1];_0x36956a[_0x45792b(0x1ce)](_0xf07af9,_0x33a4e6+0x1),_0x2bac69=_0x1ca255,_0x1c2124['add'](_0x2bac69),_0xacc52f['set'](_0xcf53a9,_0x2bac69);const _0x7bd921=await resolveRuleSegmentRefs(_0x4189c0,async _0x4b764e=>{const _0x11956d=_0x45792b,_0x454703=_0xacc52f[_0x11956d(0x11e)](_0x4b764e);if(_0x454703)return _0x454703;const _0x4af0d5=await _0x444267[_0x11956d(0xf3)](_0x4b764e);return _0x4af0d5[_0x11956d(0x170)];});_0x34c437={'description':_0x33ec05['description'],'rule':_0x7bd921};}else{const _0x38319c=_0x2dcd15[_0x45792b(0x11e)](_0xf07af9);if(_0x38319c)_0x2bac69=_0x38319c,_0xacc52f[_0x45792b(0x1ce)](_0xcf53a9,_0x2bac69);else{if(_0x24064e){let _0x72d2c9=_0x24064e,_0x2794d9=0x2;while(_0x1c2124[_0x45792b(0x15a)](_0x72d2c9)||_0x541f83[_0x45792b(0x15a)](_0x72d2c9)){_0x72d2c9=_0x24064e+'_'+_0x2794d9,_0x2794d9++;}_0x1c2124[_0x45792b(0x16c)](_0x72d2c9),_0x2bac69=_0x72d2c9;}_0xacc52f[_0x45792b(0x1ce)](_0xcf53a9,_0x2bac69),_0x2dcd15[_0x45792b(0x1ce)](_0xf07af9,_0x2bac69);const _0x517ebe=await resolveRuleSegmentRefs(_0x4189c0,async _0x3d3548=>{const _0x7381db=_0x45792b,_0x4aa335=_0xacc52f[_0x7381db(0x11e)](_0x3d3548);if(_0x4aa335)return _0x4aa335;const _0x4deb47=await _0x444267['resolveSegment'](_0x3d3548);return _0x4deb47[_0x7381db(0x170)];});_0x34c437={'description':_0x33ec05['description'],'rule':_0x517ebe};}}}return{'name':_0x2bac69,'isJourneyLocal':_0x5c4b55,'definition':_0x34c437};}catch(_0x211be9){return logger[_0x45792b(0x142)](_0x45792b(0x133)+_0xcf53a9+':\x20'+_0x211be9),{'name':_0xcf53a9,'isJourneyLocal':![]};}},'resolveActivation':async _0x2b1a91=>{const _0x3ec0bf=a168_0x51ba,_0x894e43=_0x3998c6[_0x3ec0bf(0x11e)](_0x2b1a91);if(_0x894e43!==undefined)return{'name':_0x894e43,'isJourneyLocal':!![]};try{let _0x4590d6=_0xac0fd9?.[_0x3ec0bf(0x11e)](_0x2b1a91);!_0x4590d6&&(_0x4590d6=await _0x22ae8e[_0x3ec0bf(0x12b)][_0x3ec0bf(0xf4)](_0x49a97c,_0x2b1a91));const _0x512c5b=_0x4590d6[_0x3ec0bf(0x104)][_0x3ec0bf(0x1bf)][_0x3ec0bf(0x170)]||_0x2b1a91,_0x41c766=sanitizeYamlKey(_0x512c5b)||'activation_'+_0x2b1a91,_0x1c8400=_0x41c766;_0x3998c6['set'](_0x2b1a91,_0x1c8400);const _0x1a3c4f=journeyActivationStepToYaml(_0x4590d6,_0x1f2d2f,_0x922461);return{'name':_0x1c8400,'isJourneyLocal':!![],'definition':_0x1a3c4f};}catch(_0x597c45){return logger[_0x3ec0bf(0x142)]('Failed\x20to\x20resolve\x20activation\x20'+_0x2b1a91+':\x20'+_0x597c45),{'name':_0x2b1a91,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xea22dc,_0x57e591)=>resolveJumpTarget(_0xea22dc,_0x57e591,_0x40acff,async _0x2ee192=>{const _0x2c14e8=a168_0x51ba,_0x441798=_0x40f930?.[_0x2c14e8(0x11e)](_0x2ee192);if(_0x441798)return _0x441798;return _0x22ae8e['journey'][_0x2c14e8(0x167)](_0x2ee192);})};return _0x444267=_0x49a935,_0x49a935;},_0x240eb5=async _0xc298=>{const _0x205457=a168_0x51ba,{collectSegmentIdsFromJourneyApi:_0x38dd9c}=await import(_0x205457(0x1a8)),{batchAsync:_0x33ee08}=await import(_0x205457(0x18b)),_0x4c2288=new Set();for(const _0x16f470 of _0xc298){let _0x52748d=_0x40f930?.[_0x205457(0x11e)](_0x16f470);!_0x52748d&&(_0x52748d=await _0x22ae8e[_0x205457(0x12b)]['getJourney'](_0x16f470));const _0x4ac2eb=_0x38dd9c(_0x52748d);for(const _0x4ae821 of _0x4ac2eb){_0x4c2288[_0x205457(0x16c)](_0x4ae821);}}let _0x3c32b1=Array[_0x205457(0x159)](_0x4c2288);while(_0x3c32b1[_0x205457(0xdc)]>0x0){const _0x2214d7=_0x3c32b1[_0x205457(0x112)](_0x14f182=>!_0x34bc55['has'](_0x14f182));if(_0x2214d7['length']===0x0)break;const _0x36b94b=await _0x33ee08(_0x2214d7,async _0x1a04e4=>{const _0xa7de7d=_0x205457;_0x34bc55[_0xa7de7d(0x16c)](_0x1a04e4);const _0x3eb3bb=await fetchSegment(_0x22ae8e,_0x35baf6,_0x1a04e4,_0x24eebc);if(!_0x3eb3bb)return null;return{'segmentId':_0x1a04e4,'segment':_0x3eb3bb};},0xa),_0x56ab59=new Set();for(const _0x590165 of _0x36b94b){if(!_0x590165?.[_0x205457(0x160)]?.[_0x205457(0x116)])continue;const _0x4157a9=apiRuleToYaml(_0x590165[_0x205457(0x160)][_0x205457(0x116)]);_0x4a01e6[_0x205457(0x1ce)](_0x590165[_0x205457(0x14b)],_0x4157a9);const _0x3c58dd=collectSegmentRefsFromRule(_0x4157a9);for(const _0x2c4249 of _0x3c58dd){!_0x34bc55[_0x205457(0x15a)](_0x2c4249)&&_0x56ab59[_0x205457(0x16c)](_0x2c4249);}}_0x3c32b1=Array['from'](_0x56ab59);}};return{'createYamlContext':_0x3d2eb7,'prefetchJourneySegments':_0x240eb5};}export async function executePushSegments(_0x56be91,_0x3607ec,_0x14ae1a,_0x345bd5,_0x1f214f){const _0x523323=a168_0x5cf043,{segmentDefToCreateRequest:_0x4a93c4,segmentDefToUpdateRequest:_0x39c549}=await import('./child-segment-yaml.js'),_0x314186=_0x14ae1a['folderPathToId'],_0x30acf3=0x5,_0x339106=async _0x380eee=>{const _0x18ccbf=a168_0x51ba,_0x2e42ba=_0x380eee[_0x18ccbf(0xf5)]?_0x314186['get'](_0x380eee[_0x18ccbf(0xf5)]):undefined;let _0x265a6a;const _0x401ba0={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xb49b49=_0x380eee[_0x18ccbf(0x152)];if(_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x116)]){const _0x2b01db=createSegmentIdResolver(_0x14ae1a[_0x18ccbf(0x18a)],_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]),_0x3bc7fb=await resolveRuleSegmentIds(_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x116)],_0x2b01db);_0xb49b49={..._0x380eee[_0x18ccbf(0x152)],'rule':_0x3bc7fb};}try{if(_0x380eee['isNew']){_0x1f214f[_0x18ccbf(0xe5)]?.({'type':'segment_creating','name':_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]});const _0x3aa895=_0x4a93c4(_0xb49b49,_0x2e42ba),_0x5c3035=await _0x1f214f['withProgress'](_0x18ccbf(0x1af)+_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]+_0x18ccbf(0x14c),()=>_0x56be91[_0x18ccbf(0x160)][_0x18ccbf(0x137)](_0x345bd5[_0x18ccbf(0x180)],_0x3aa895));_0x265a6a=_0x5c3035[_0x18ccbf(0x1d3)]['id'],_0x14ae1a[_0x18ccbf(0x18a)][_0x18ccbf(0x1ce)](_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)],_0x265a6a),_0x401ba0[_0x18ccbf(0x12d)]={'name':_0x380eee['yamlConfig']['name'],'id':_0x265a6a},_0x1f214f['onProgress']?.({'type':_0x18ccbf(0x1cd),'name':_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)],'segmentId':_0x265a6a}),_0x1f214f[_0x18ccbf(0x122)]?.(_0x18ccbf(0x1c2)+_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]+'\x27'),_0x401ba0['created']=0x1;}else{if(_0x380eee['hasChanges']){_0x1f214f[_0x18ccbf(0xe5)]?.({'type':'segment_updating','name':_0x380eee['yamlConfig']['name']});const _0x2ab9f1=_0x39c549(_0xb49b49);_0x2e42ba!==_0x380eee[_0x18ccbf(0x1b3)]?.[_0x18ccbf(0x150)]&&(_0x2ab9f1[_0x18ccbf(0x150)]=_0x2e42ba?parseInt(_0x2e42ba,0xa):undefined),await _0x1f214f['withProgress'](_0x18ccbf(0x10e)+_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]+_0x18ccbf(0x14c),()=>_0x56be91[_0x18ccbf(0x160)][_0x18ccbf(0xff)](_0x345bd5['parentId'],_0x380eee[_0x18ccbf(0x1b3)]['id'],_0x2ab9f1)),_0x265a6a=_0x380eee[_0x18ccbf(0x1b3)]['id'],_0x1f214f[_0x18ccbf(0xe5)]?.({'type':'segment_updated','name':_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]}),_0x1f214f[_0x18ccbf(0x122)]?.(_0x18ccbf(0x16a)+_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)]+'\x27'),_0x401ba0['updated']=0x1;}else _0x265a6a=_0x380eee[_0x18ccbf(0x1b3)]['id'];}}catch(_0x165809){const _0x16eb46=isHttp400Error(_0x165809),_0x36e5fb=_0x16eb46?ErrorCode[_0x18ccbf(0x1c0)]:ErrorCode[_0x18ccbf(0x109)],_0x538872=getErrorMessage(_0x165809);throw new SDKError(_0x36e5fb,_0x18ccbf(0x115)+(_0x380eee[_0x18ccbf(0x1c4)]?_0x18ccbf(0x10f):'update')+'\x20segment\x20from\x20file:\x20'+_0x380eee[_0x18ccbf(0x139)]+_0x18ccbf(0x12c)+_0x538872,_0x165809);}try{const _0x2cbcb3=await syncActivationsForSegment(_0x56be91,_0x345bd5['parentId'],_0x265a6a,_0x380eee[_0x18ccbf(0x152)][_0x18ccbf(0x170)],_0x380eee[_0x18ccbf(0x1a9)],_0x1f214f,_0x380eee[_0x18ccbf(0x139)]);_0x401ba0[_0x18ccbf(0x1d9)]=_0x2cbcb3;}catch(_0xb4867d){if(_0xb4867d instanceof SDKError)throw _0xb4867d;throw new SDKError(ErrorCode[_0x18ccbf(0x154)],_0x18ccbf(0x1bb)+_0x380eee[_0x18ccbf(0x152)]['name']+_0x18ccbf(0x1b0)+_0x380eee['absolutePath']+'\x0a\x20\x20'+getErrorMessage(_0xb4867d),_0xb4867d);}return _0x401ba0;},_0x1a95ed=await batchAsync(_0x3607ec,_0x339106,_0x30acf3),_0x29e993={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x59dd34 of _0x1a95ed){_0x29e993[_0x523323(0x124)]+=_0x59dd34['created'],_0x29e993[_0x523323(0x189)]+=_0x59dd34[_0x523323(0x189)],_0x59dd34['createdSegmentId']&&_0x29e993[_0x523323(0x127)][_0x523323(0x1ce)](_0x59dd34['createdSegmentId'][_0x523323(0x170)],_0x59dd34[_0x523323(0x12d)]['id']),_0x29e993['activations'][_0x523323(0x124)]+=_0x59dd34[_0x523323(0x1d9)]['created'],_0x29e993[_0x523323(0x1d9)][_0x523323(0x189)]+=_0x59dd34[_0x523323(0x1d9)][_0x523323(0x189)],_0x29e993[_0x523323(0x1d9)][_0x523323(0x15e)]+=_0x59dd34[_0x523323(0x1d9)][_0x523323(0x15e)];}return _0x29e993;}async function syncActivationsForSegment(_0x2c14b6,_0x1fd0c7,_0x182e7f,_0x13e9cf,_0x3f7d4a,_0x1569bd,_0x5a3bd3){const _0x436b56=a168_0x5cf043,_0x33d6b7={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x23e011 of _0x3f7d4a){try{if(_0x23e011['type']===_0x436b56(0x10f)&&_0x23e011[_0x436b56(0x157)])_0x1569bd[_0x436b56(0xe5)]?.({'type':_0x436b56(0x1a2),'segmentName':_0x13e9cf,'activationName':_0x23e011[_0x436b56(0x170)]}),await _0x1569bd['withProgress'](_0x436b56(0x15d)+_0x23e011['name']+_0x436b56(0x14c),()=>_0x2c14b6[_0x436b56(0x160)][_0x436b56(0x1d7)](_0x1fd0c7,_0x182e7f,_0x23e011[_0x436b56(0x157)])),_0x1569bd[_0x436b56(0xe5)]?.({'type':'activation_created','segmentName':_0x13e9cf,'activationName':_0x23e011[_0x436b56(0x170)]}),_0x1569bd[_0x436b56(0x122)]?.(_0x436b56(0x13f)+_0x23e011['name']+'\x27'),_0x33d6b7[_0x436b56(0x124)]++;else{if(_0x23e011[_0x436b56(0xe9)]==='update'&&_0x23e011[_0x436b56(0x157)]&&_0x23e011[_0x436b56(0xfe)])_0x1569bd['onProgress']?.({'type':_0x436b56(0x166),'segmentName':_0x13e9cf,'activationName':_0x23e011['name']}),await _0x1569bd[_0x436b56(0x198)](_0x436b56(0x118)+_0x23e011[_0x436b56(0x170)]+_0x436b56(0x14c),()=>_0x2c14b6['segment']['updateActivation'](_0x1fd0c7,_0x182e7f,_0x23e011[_0x436b56(0xfe)]['id'],_0x23e011[_0x436b56(0x157)])),_0x1569bd[_0x436b56(0xe5)]?.({'type':'activation_updated','segmentName':_0x13e9cf,'activationName':_0x23e011[_0x436b56(0x170)]}),_0x1569bd[_0x436b56(0x122)]?.(_0x436b56(0x131)+_0x23e011[_0x436b56(0x170)]+'\x27'),_0x33d6b7[_0x436b56(0x189)]++;else _0x23e011['type']===_0x436b56(0xdf)&&_0x23e011[_0x436b56(0xfe)]&&(_0x1569bd[_0x436b56(0xe5)]?.({'type':_0x436b56(0xe0),'segmentName':_0x13e9cf,'activationName':_0x23e011[_0x436b56(0x170)]}),await _0x1569bd[_0x436b56(0x198)](_0x436b56(0x101)+_0x23e011[_0x436b56(0x170)]+_0x436b56(0x14c),()=>_0x2c14b6['segment'][_0x436b56(0x10c)](_0x1fd0c7,_0x182e7f,_0x23e011['existingActivation']['id'])),_0x1569bd[_0x436b56(0xe5)]?.({'type':'activation_deleted','segmentName':_0x13e9cf,'activationName':_0x23e011[_0x436b56(0x170)]}),_0x1569bd[_0x436b56(0x19c)]?.(_0x436b56(0xec)+_0x23e011[_0x436b56(0x170)]+'\x27'),_0x33d6b7[_0x436b56(0x15e)]++);}}catch(_0x8aada7){const _0x4cbee0=isHttp400Error(_0x8aada7),_0x2333cb=_0x4cbee0?ErrorCode[_0x436b56(0x130)]:ErrorCode[_0x436b56(0x154)],_0x5e5c84=getErrorMessage(_0x8aada7);throw new SDKError(_0x2333cb,_0x436b56(0x115)+_0x23e011[_0x436b56(0xe9)]+'\x20activation\x20\x27'+_0x23e011[_0x436b56(0x170)]+_0x436b56(0x1b0)+_0x5a3bd3+'\x0a\x20\x20'+_0x5e5c84,_0x8aada7);}}return _0x33d6b7;}export async function executePushFolders(_0x219cc6,_0x37fa11,_0x3bc246,_0x2df356,_0x4d02d5){const _0x3b93c6=a168_0x5cf043,_0x17793d=new Map(_0x3bc246),_0x5f374c=sortFoldersByDepth(_0x37fa11);for(const _0x9813b3 of _0x5f374c){const _0x3954f3=_0x9813b3[_0x3b93c6(0xdb)]('/'),_0x2a5f33=_0x3954f3[_0x3954f3['length']-0x1],_0x312a67=_0x3954f3[_0x3b93c6(0x1c8)](0x0,-0x1)[_0x3b93c6(0x1b4)]('/'),_0x47da2c=_0x17793d[_0x3b93c6(0x11e)](_0x312a67);_0x4d02d5['onProgress']?.({'type':_0x3b93c6(0x1a3),'folder':_0x9813b3});const _0x5ea425={'name':_0x2a5f33,'parentFolderId':_0x47da2c},_0x410129=await _0x4d02d5[_0x3b93c6(0x198)]('Creating\x20folder\x20\x27'+_0x9813b3+_0x3b93c6(0x14c),()=>_0x219cc6[_0x3b93c6(0x160)]['createFolder'](_0x2df356[_0x3b93c6(0x180)],_0x5ea425));_0x17793d[_0x3b93c6(0x1ce)](_0x9813b3,_0x410129[_0x3b93c6(0x1d3)]['id']),_0x4d02d5['onProgress']?.({'type':_0x3b93c6(0x19a),'folder':_0x9813b3,'folderId':_0x410129['data']['id']}),_0x4d02d5[_0x3b93c6(0x117)]?.('Created\x20folder\x20\x27'+_0x9813b3+'\x27');}return _0x17793d;}export async function executePushSegmentDeletions(_0x2ae188,_0x472ef5,_0x4c7904){const _0x5067d3=a168_0x5cf043;if(_0x472ef5['length']===0x0)return 0x0;const {batchAsync:_0x1fef19}=await import(_0x5067d3(0x18b)),_0x9f7082=0x5,_0x2e8106=await _0x1fef19(_0x472ef5,async _0x212e84=>{const _0x5ed354=_0x5067d3;return _0x4c7904['onProgress']?.({'type':_0x5ed354(0x110),'name':_0x212e84['name']}),await _0x2ae188['segment']['deleteSegment'](_0x212e84['id']),_0x4c7904[_0x5ed354(0xe5)]?.({'type':_0x5ed354(0x1bd),'name':_0x212e84[_0x5ed354(0x170)]}),_0x4c7904[_0x5ed354(0x19c)]?.(_0x5ed354(0x177)+_0x212e84['name']+'\x27'),0x1;},_0x9f7082);return _0x2e8106[_0x5067d3(0x1b7)]((_0x5af1b9,_0x2a09ac)=>_0x5af1b9+_0x2a09ac,0x0);}export async function executePushJourneys(_0x4fb1af,_0x129214,_0x1a94a5,_0x3e285d,_0x181290){const _0x48985e=a168_0x5cf043,{journeyDefToRequest:_0x175dc3}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x1b908c,yamlRuleToApi:_0x4a3c2e,validateSegmentRule:_0x2987f6}=await import(_0x48985e(0x173)),_0xae3c89={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x30f0dd=new Map(_0x1a94a5[_0x48985e(0x18a)]),_0x1c764e=0x5;for(let _0x4f4741=0x0;_0x4f4741<_0x129214['length'];_0x4f4741+=_0x1c764e){const _0x57a9b6=_0x129214[_0x48985e(0x1c8)](_0x4f4741,_0x4f4741+_0x1c764e),_0x3218a9=await Promise['all'](_0x57a9b6['map'](async _0x4c4dc9=>{const _0xe2036a=_0x48985e;if(!_0x4c4dc9[_0xe2036a(0x1c4)]&&!_0x4c4dc9[_0xe2036a(0x1a7)])return{'action':_0xe2036a(0x144),'name':_0x4c4dc9[_0xe2036a(0x152)][_0xe2036a(0x170)],'journeyId':_0x4c4dc9[_0xe2036a(0xf9)]?.['id']};const _0x370d2e=_0x4c4dc9[_0xe2036a(0xf5)]?_0x1a94a5[_0xe2036a(0x136)][_0xe2036a(0x11e)](_0x4c4dc9[_0xe2036a(0xf5)]):undefined;_0x181290[_0xe2036a(0xe5)]?.({'type':_0x4c4dc9[_0xe2036a(0x1c4)]?'journey_creating':_0xe2036a(0x15b),'name':_0x4c4dc9[_0xe2036a(0x152)][_0xe2036a(0x170)]});try{const _0x12e930=await executeSingleJourneyPush(_0x4fb1af,_0x4c4dc9,{..._0x1a94a5,'segmentNameToId':_0x30f0dd},{'parentId':_0x3e285d[_0xe2036a(0x180)],'rootFolderId':_0x3e285d[_0xe2036a(0x165)],'folderId':_0x370d2e,'verbose':_0x3e285d[_0xe2036a(0x14d)]},_0x181290,{'journeyDefToRequest':_0x175dc3,'activationDefToCreateRequest':_0x1b908c,'yamlRuleToApi':_0x4a3c2e,'validateSegmentRule':_0x2987f6});for(const [_0x5e958d,_0x32df47]of _0x12e930[_0xe2036a(0x11c)]){_0x30f0dd[_0xe2036a(0x1ce)](_0x5e958d,_0x32df47),_0xae3c89[_0xe2036a(0x11c)][_0xe2036a(0x1ce)](_0x5e958d,_0x32df47);}if(_0x12e930['action']==='created')_0x181290['onProgress']?.({'type':_0xe2036a(0x15c),'name':_0x4c4dc9['yamlConfig']['name'],'journeyId':_0x12e930[_0xe2036a(0x18e)]}),_0x181290[_0xe2036a(0x122)]?.(_0xe2036a(0x1a1)+_0x4c4dc9[_0xe2036a(0x152)][_0xe2036a(0x170)]+'\x27'),_0xae3c89[_0xe2036a(0x124)]++;else _0x12e930[_0xe2036a(0x171)]===_0xe2036a(0x189)&&(_0x181290[_0xe2036a(0xe5)]?.({'type':'journey_updated','name':_0x4c4dc9[_0xe2036a(0x152)][_0xe2036a(0x170)]}),_0x181290['logSuccess']?.(_0xe2036a(0x135)+_0x4c4dc9[_0xe2036a(0x152)]['name']+'\x27'),_0xae3c89[_0xe2036a(0x189)]++);return{'action':_0x12e930['action'],'name':_0x4c4dc9[_0xe2036a(0x152)][_0xe2036a(0x170)],'journeyId':_0x12e930['journeyId']};}catch(_0x4f9e63){const _0x55dd39=isHttp400Error(_0x4f9e63),_0x274cf0=_0x55dd39?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0xe2036a(0x16f)],_0x269fc0=getErrorMessage(_0x4f9e63);throw new SDKError(_0x274cf0,_0xe2036a(0x115)+(_0x4c4dc9[_0xe2036a(0x1c4)]?'create':_0xe2036a(0xfd))+_0xe2036a(0x1a6)+_0x4c4dc9[_0xe2036a(0x139)]+_0xe2036a(0x12c)+_0x269fc0,_0x4f9e63);}}));_0xae3c89[_0x48985e(0x19b)][_0x48985e(0x164)](..._0x3218a9);}return _0xae3c89;}async function matchExistingJourneySegments(_0x5ad924,_0x89bf2a,_0x58d4cf,_0x145c7c,_0xa23727){const _0x273bfe=a168_0x5cf043;if(!_0x89bf2a['existingJourney']||!_0x89bf2a[_0x273bfe(0x152)][_0x273bfe(0x17e)])return;const _0x37b815=new Map(),_0x5af66d=new Set();for(const _0x47b835 of Object[_0x273bfe(0x147)](_0x89bf2a[_0x273bfe(0x152)][_0x273bfe(0x17e)])){const _0x5d90e6=generateDeterministicJourneySegmentName(_0x89bf2a['yamlConfig'][_0x273bfe(0x170)],_0x47b835);_0x37b815['set'](_0x5d90e6,_0x47b835),_0x5af66d['add'](_0x47b835);}const _0x112a5a=[],_0x4900f3=collectSegmentIdsFromJourneyApi(_0x89bf2a[_0x273bfe(0xf9)]);for(const _0x4491d8 of _0x4900f3){const _0x1d692d=await fetchSegment(_0x5ad924,_0x58d4cf,_0x4491d8,_0x145c7c);if(!_0x1d692d?.[_0x273bfe(0x170)])continue;const _0x417253=_0x37b815[_0x273bfe(0x11e)](_0x1d692d['name']);_0x417253?(_0xa23727[_0x273bfe(0x1ce)](_0x417253,_0x4491d8),_0x5af66d[_0x273bfe(0xdf)](_0x417253)):_0x112a5a[_0x273bfe(0x164)]({'id':_0x4491d8,'seg':_0x1d692d});}if(_0x5af66d[_0x273bfe(0x1ca)]>0x0&&_0x112a5a[_0x273bfe(0xdc)]>0x0){const {localExpandedRuleToNames:_0x14d7c6}=buildLocalExpandedRuleMappings(_0x89bf2a['yamlConfig']),_0x4782aa=new Map();for(const {id:_0x4c5ce5,seg:_0x5a25e9}of _0x112a5a){if(_0x5a25e9[_0x273bfe(0x116)]){const _0x357695=apiRuleToYaml(_0x5a25e9['rule']);_0x4782aa[_0x273bfe(0x1ce)](_0x4c5ce5,_0x357695);}}for(const {id:_0x1497e7,seg:_0xa97560}of _0x112a5a){if(!_0xa97560[_0x273bfe(0x116)])continue;const _0x123799=_0x4782aa[_0x273bfe(0x11e)](_0x1497e7);if(!_0x123799)continue;const _0x4b8d5f=serializeExpandedRule(_0x123799,_0x4782aa),_0x33c563=_0x14d7c6[_0x273bfe(0x11e)](_0x4b8d5f);if(_0x33c563){const _0x304216=_0x33c563[_0x273bfe(0x11b)](_0x397965=>_0x5af66d['has'](_0x397965));_0x304216&&(_0xa23727[_0x273bfe(0x1ce)](_0x304216,_0x1497e7),_0x5af66d['delete'](_0x304216),logger[_0x273bfe(0x142)](_0x273bfe(0x184)+_0xa97560[_0x273bfe(0x170)]+_0x273bfe(0x151)+_0x304216+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0xc19731,_0x3bc658,_0x413b01,_0x24202e,_0x1cf7fd,_0x5da938){const _0x333a62=a168_0x5cf043,{journeyDefToRequest:_0x52dcc6,activationDefToCreateRequest:_0x48ee5f,yamlRuleToApi:_0xbcc4d8,validateSegmentRule:_0x430093}=_0x5da938,_0xc32e38=new Map(),_0x45ca67=new Map();recoverSegmentIdsFromPushRecovery(_0x3bc658,_0xc32e38,_0x413b01[_0x333a62(0x18a)]);const _0x3a75cd=new Map(),_0x566e5b=new Map(),_0x3c7771=new Map();let _0x46643c;const _0x112ba8=async()=>{const _0x4b4110=_0x333a62;if(_0x46643c)return;_0x46643c=new Map();if(!_0x3bc658[_0x4b4110(0xf9)])return;const _0x4e12d8=await _0xc19731['journey']['listActivations'](_0x3bc658[_0x4b4110(0xf9)]['id']);for(const _0x4225f1 of _0x4e12d8){const _0x41d246=journeyActivationStepToYaml(_0x4225f1,_0x413b01['idToEmailMap'],_0x413b01[_0x4b4110(0x156)]),_0x3d3ea1=activationSignature(_0x41d246);!_0x46643c[_0x4b4110(0x15a)](_0x3d3ea1)&&_0x46643c[_0x4b4110(0x1ce)](_0x3d3ea1,_0x4225f1['id']),_0x41d246[_0x4b4110(0x170)]&&_0x45ca67['set'](_0x41d246[_0x4b4110(0x170)],_0x4225f1['id']);}};await matchExistingJourneySegments(_0xc19731,_0x3bc658,_0x24202e[_0x333a62(0x180)],_0x413b01[_0x333a62(0x169)],_0x413b01[_0x333a62(0x18a)]);const _0x185d60={'resolveSegmentId':async _0x2644f9=>{const _0x13c1c3=_0x333a62,_0x145eca=_0x413b01[_0x13c1c3(0x18a)][_0x13c1c3(0x11e)](_0x2644f9);if(!_0x145eca)throw new SDKError(ErrorCode[_0x13c1c3(0xeb)],_0x13c1c3(0x14f)+_0x2644f9+'\x20(referenced\x20in\x20journey\x20'+_0x3bc658[_0x13c1c3(0x152)]['name']+')');return _0x145eca;},'resolveEmbeddedSegmentId':async(_0x267ae5,_0x200a4a)=>{const _0x26e0e4=_0x333a62,_0xf7be2e=_0x413b01[_0x26e0e4(0x18a)][_0x26e0e4(0x11e)](_0x267ae5);if(_0xf7be2e)return _0xf7be2e;const _0x5a18e7=_0x413b01[_0x26e0e4(0x169)][_0x26e0e4(0x11b)](_0x2054dc=>_0x2054dc['name']===_0x267ae5);if(_0x5a18e7)return _0x413b01[_0x26e0e4(0x18a)]['set'](_0x267ae5,_0x5a18e7['id']),_0x5a18e7['id'];if(_0x3bc658[_0x26e0e4(0x1c4)]){const {stageName:_0x185227,criteriaName:_0x4e123c}=findSegmentCriteriaLocation(_0x3bc658[_0x26e0e4(0x152)],_0x267ae5);return _0x430093(_0x267ae5,_0x200a4a[_0x26e0e4(0x116)]),_0x566e5b[_0x26e0e4(0x1ce)](_0x267ae5,{'definition':_0x200a4a,'stageName':_0x185227,'criteriaName':_0x4e123c}),createPendingSegmentId(_0x267ae5);}const _0x27f043=_0x3bc658[_0x26e0e4(0xf9)]?.['id'];if(!_0x27f043)throw new SDKError(ErrorCode[_0x26e0e4(0x1ae)],_0x26e0e4(0x17a));const _0x21699d=_0x3a75cd['get'](_0x267ae5);if(_0x21699d)return _0x21699d;const _0xce3757=((async()=>{const _0x6fb576=_0x26e0e4;_0x430093(_0x267ae5,_0x200a4a[_0x6fb576(0x116)]);const _0x101176=generateDeterministicJourneySegmentName(_0x3bc658[_0x6fb576(0x152)][_0x6fb576(0x170)],_0x267ae5),_0x44ef34=_0x413b01[_0x6fb576(0x169)][_0x6fb576(0x11b)](_0xfb5560=>_0xfb5560[_0x6fb576(0x170)]===_0x101176),_0xeb5dd9=createSegmentIdResolver(_0x413b01[_0x6fb576(0x18a)],_0x267ae5),_0x1e9051=await resolveRuleSegmentIds(_0x200a4a['rule'],_0xeb5dd9);let _0x40a05c;return _0x44ef34?(await _0xc19731[_0x6fb576(0x160)][_0x6fb576(0xff)](_0x24202e[_0x6fb576(0x180)],_0x44ef34['id'],{'description':_0x200a4a[_0x6fb576(0x1cb)]||_0x6fb576(0x161)+_0x267ae5,'rule':_0xbcc4d8(_0x1e9051),'countPopulation':!![]}),_0x40a05c=_0x44ef34['id'],saveSegmentToPushRecovery(_0x3bc658['absolutePath'],_0x3bc658[_0x6fb576(0x152)][_0x6fb576(0x170)],_0x267ae5,{'segmentId':_0x40a05c,'uniqueServerName':_0x101176,'createdAt':new Date()[_0x6fb576(0x143)]()})):_0x40a05c=await createOrRecoverEmbeddedSegment(_0xc19731,_0x3bc658,{'localName':_0x267ae5,'uniqueSegmentName':_0x101176,'description':_0x200a4a[_0x6fb576(0x1cb)]||_0x6fb576(0x161)+_0x267ae5,'journeyId':_0x27f043,'resolvedRule':_0x1e9051,'parentId':_0x24202e[_0x6fb576(0x180)],'folderId':_0x24202e[_0x6fb576(0x165)]||''},_0xbcc4d8),_0x413b01[_0x6fb576(0x18a)]['set'](_0x267ae5,_0x40a05c),_0xc32e38[_0x6fb576(0x1ce)](_0x267ae5,_0x40a05c),_0x40a05c;})());_0x3a75cd[_0x26e0e4(0x1ce)](_0x267ae5,_0xce3757);try{return await _0xce3757;}finally{_0x3a75cd[_0x26e0e4(0xdf)](_0x267ae5);}},'resolveActivationId':async _0x91ca1=>{const _0x4dcc8b=_0x333a62,_0x274bac=_0x45ca67[_0x4dcc8b(0x11e)](_0x91ca1);if(_0x274bac)return _0x274bac;if(_0x3bc658[_0x4dcc8b(0xf9)]){await _0x112ba8();const _0x5596ac=_0x45ca67[_0x4dcc8b(0x11e)](_0x91ca1);if(_0x5596ac)return _0x5596ac;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x91ca1+_0x4dcc8b(0x1c6)+_0x3bc658[_0x4dcc8b(0x152)][_0x4dcc8b(0x170)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x3c11e9,_0x18a38e)=>{const _0xa8b82=_0x333a62,_0x57fa16=_0x45ca67[_0xa8b82(0x11e)](_0x3c11e9);if(_0x57fa16)return _0x57fa16;if(_0x3bc658[_0xa8b82(0x1c4)])return _0x3c7771[_0xa8b82(0x1ce)](_0x3c11e9,_0x18a38e),createPendingActivationId(_0x3c11e9);if(_0x3bc658['existingJourney']){await _0x112ba8();const _0x1d6b93=_0x45ca67[_0xa8b82(0x11e)](_0x18a38e[_0xa8b82(0x170)]);if(_0x1d6b93)return _0x45ca67[_0xa8b82(0x1ce)](_0x3c11e9,_0x1d6b93),_0x1d6b93;const _0x31fdb6=activationSignature(_0x18a38e),_0x7cdf64=_0x46643c?.[_0xa8b82(0x11e)](_0x31fdb6);if(_0x7cdf64)return _0x45ca67[_0xa8b82(0x1ce)](_0x3c11e9,_0x7cdf64),_0x7cdf64;const _0x4436c9=await _0x48ee5f(_0x18a38e,_0x413b01[_0xa8b82(0xe3)]),_0x155427={..._0x4436c9,..._0x18a38e[_0xa8b82(0x1b2)]!==undefined&&{'runAfterJourneyRefresh':_0x18a38e['run_after_journey_refresh']}},_0x6d3e2b=await _0xc19731[_0xa8b82(0x12b)][_0xa8b82(0x1d7)](_0x3bc658[_0xa8b82(0xf9)]['id'],_0x155427);return _0x45ca67[_0xa8b82(0x1ce)](_0x3c11e9,_0x6d3e2b['id']),_0x6d3e2b['id'];}throw new SDKError(ErrorCode[_0xa8b82(0x1ae)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x39ef11=>{const _0x44157d=_0x333a62;try{return await _0xc19731[_0x44157d(0x12b)][_0x44157d(0xe4)](_0x24202e['parentId'],_0x39ef11);}catch(_0x3e747f){throw new SDKError(ErrorCode[_0x44157d(0x12f)],_0x44157d(0x17d)+_0x39ef11+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x3bc658['yamlConfig'][_0x44157d(0x170)]+'\x27)',_0x3e747f);}},'resolveStageId':async(_0x112433,_0x5c5c45)=>{const _0x6083b=_0x333a62,_0x1be62f=await _0xc19731[_0x6083b(0x12b)][_0x6083b(0x167)](_0x112433),_0x474911=_0x1be62f['attributes'][_0x6083b(0x19e)][_0x6083b(0x11b)](_0x500c39=>_0x500c39['name']['toLowerCase']()===_0x5c5c45[_0x6083b(0x123)]());if(!_0x474911?.['id'])throw new SDKError(ErrorCode[_0x6083b(0x12f)],_0x6083b(0x132)+_0x5c5c45+_0x6083b(0xf0)+(_0x1be62f[_0x6083b(0x104)][_0x6083b(0x138)]||_0x1be62f[_0x6083b(0x104)][_0x6083b(0x170)])+'\x27');return _0x474911['id'];}},_0x3a9371=await _0x52dcc6(_0x3bc658[_0x333a62(0x152)],_0x24202e['parentId'],_0x185d60),_0x340f1c=_0x24202e[_0x333a62(0x15f)]||_0x24202e[_0x333a62(0x165)];_0x340f1c&&(_0x3a9371[_0x333a62(0x1d4)]={'parentFolder':{'data':{'id':_0x340f1c,'type':_0x333a62(0x106)}}});if(_0x3bc658[_0x333a62(0x1c4)]){if(_0x566e5b['size']>0x0||_0x3c7771['size']>0x0)return await executeThreeStepJourneyCreate(_0xc19731,_0x3bc658,_0x3a9371,{'pendingEmbeddedSegments':_0x566e5b,'pendingEmbeddedActivations':_0x3c7771,'embeddedSegmentNameToId':_0xc32e38,'journeyActivationNameToId':_0x45ca67},{..._0x24202e,'effectiveFolderId':_0x340f1c},_0x413b01,_0x1cf7fd,_0x5da938);else{ensureJourneyDefaults(_0x3a9371['attributes']);const _0x2d558d=await _0xc19731['journey'][_0x333a62(0x10f)](_0x3a9371);return deletePushRecovery(_0x3bc658[_0x333a62(0x139)]),{'action':'created','journeyId':_0x2d558d['id'],'embeddedSegmentNameToId':_0xc32e38};}}else{if(_0x3bc658[_0x333a62(0x1a7)]&&_0x3bc658[_0x333a62(0xf9)]){_0x3a9371['id']=_0x3bc658[_0x333a62(0xf9)]['id'];const _0xd7564b=_0x3a9371['attributes'];_0x3bc658[_0x333a62(0xf9)][_0x333a62(0x104)]?.[_0x333a62(0x138)]&&(_0xd7564b['journeyBundleName']=_0x3bc658[_0x333a62(0xf9)][_0x333a62(0x104)][_0x333a62(0x138)]);const _0xd8a934=_0x3bc658[_0x333a62(0xf9)][_0x333a62(0x104)]?.[_0x333a62(0x19e)];return _0xd8a934&&_0x3a9371[_0x333a62(0x104)][_0x333a62(0x19e)]&&injectExistingStageIds(_0x3a9371[_0x333a62(0x104)][_0x333a62(0x19e)],_0xd8a934),ensureJourneyDefaults(_0xd7564b),await _0xc19731[_0x333a62(0x12b)]['update'](_0x3bc658[_0x333a62(0xf9)]['id'],_0x3a9371),deletePushRecovery(_0x3bc658[_0x333a62(0x139)]),{'action':_0x333a62(0x189),'journeyId':_0x3bc658[_0x333a62(0xf9)]['id'],'embeddedSegmentNameToId':_0xc32e38};}}return deletePushRecovery(_0x3bc658['absolutePath']),{'action':'unchanged','journeyId':_0x3bc658[_0x333a62(0xf9)]?.['id'],'embeddedSegmentNameToId':_0xc32e38};}function findSegmentCriteriaLocation(_0x17c28a,_0x1e4171){const _0x296bb4=a168_0x5cf043,_0xaee381=_0x17c28a[_0x296bb4(0x162)]||_0x17c28a['journeys']?.[0x0]?.[_0x296bb4(0x162)]||[];let _0x2891b9=_0x296bb4(0x16b),_0x509e73=_0x1e4171;const _0x1ed0f7=_0x17c28a[_0x296bb4(0x10d)]||_0x17c28a['journeys']?.[0x0]?.[_0x296bb4(0x10d)];if(_0x1ed0f7?.['segment']===_0x1e4171)return{'stageName':_0x296bb4(0x10d),'criteriaName':_0x1ed0f7[_0x296bb4(0x170)]||_0x1e4171};_0x194a80:for(const _0x102329 of _0xaee381){if(_0x102329[_0x296bb4(0x129)]?.[_0x296bb4(0x160)]===_0x1e4171){_0x2891b9=_0x102329[_0x296bb4(0x170)],_0x509e73=_0x102329['entry_criteria'][_0x296bb4(0x170)]||_0x1e4171;break;}if(_0x102329['steps'])for(const _0x16d8a8 of _0x102329['steps']){if(_0x16d8a8[_0x296bb4(0xe9)]==='decision_point'&&_0x16d8a8[_0x296bb4(0x13a)]?.[_0x296bb4(0x100)])for(const _0x4671c8 of _0x16d8a8[_0x296bb4(0x13a)]['branches']){if(_0x4671c8[_0x296bb4(0x160)]===_0x1e4171){_0x2891b9=_0x102329[_0x296bb4(0x170)],_0x509e73=_0x4671c8['name']||_0x1e4171;break _0x194a80;}}}}return{'stageName':_0x2891b9,'criteriaName':_0x509e73};}async function executeThreeStepJourneyCreate(_0x34248c,_0x24800,_0x1a102c,_0x6150c0,_0x4f4b19,_0x35f6b5,_0x13a189,_0x804d80){const _0x1c3faa=a168_0x5cf043,{activationDefToCreateRequest:_0x106865,yamlRuleToApi:_0x1f0964}=_0x804d80,{pendingEmbeddedSegments:_0x4d2b49,pendingEmbeddedActivations:_0x2888a1,embeddedSegmentNameToId:_0xad4558}=_0x6150c0,_0x437b20=JSON['parse'](JSON['stringify'](_0x1a102c));ensureJourneyDefaults(_0x437b20[_0x1c3faa(0x104)]),stripPendingIds(_0x437b20);const _0x385c7e=await _0x34248c['journey'][_0x1c3faa(0x10f)](_0x437b20),_0x37052a=_0x385c7e['id'],_0x49e9bc=new Map();for(const _0x55b3e2 of _0x385c7e[_0x1c3faa(0x104)][_0x1c3faa(0x19e)]){_0x49e9bc[_0x1c3faa(0x1ce)](_0x55b3e2[_0x1c3faa(0x170)][_0x1c3faa(0x123)](),_0x55b3e2['id']);}recoverSegmentIdsFromPushRecovery(_0x24800,_0xad4558,_0x35f6b5['segmentNameToId']);for(const [_0x4f0e27,{definition:_0xbfccdc}]of _0x4d2b49){if(_0xad4558[_0x1c3faa(0x15a)](_0x4f0e27)){_0x13a189[_0x1c3faa(0xe5)]?.({'type':_0x1c3faa(0xea),'journeyName':_0x24800['yamlConfig'][_0x1c3faa(0x170)],'segmentName':_0x4f0e27});continue;}const _0x552838=generateDeterministicJourneySegmentName(_0x24800[_0x1c3faa(0x152)][_0x1c3faa(0x170)],_0x4f0e27);_0x13a189['onProgress']?.({'type':_0x1c3faa(0x1bc),'journeyName':_0x24800[_0x1c3faa(0x152)][_0x1c3faa(0x170)],'segmentName':_0x4f0e27});const _0x10f1c5=createSegmentIdResolver(_0x35f6b5[_0x1c3faa(0x18a)],_0x4f0e27),_0x1b44fe=await resolveRuleSegmentIds(_0xbfccdc[_0x1c3faa(0x116)],_0x10f1c5),_0xee5158=await createOrRecoverEmbeddedSegment(_0x34248c,_0x24800,{'localName':_0x4f0e27,'uniqueSegmentName':_0x552838,'description':_0xbfccdc['description']||_0x1c3faa(0x161)+_0x4f0e27,'journeyId':_0x37052a,'resolvedRule':_0x1b44fe,'parentId':_0x4f4b19[_0x1c3faa(0x180)],'folderId':_0x4f4b19[_0x1c3faa(0x1cf)]||''},_0x1f0964);_0xad4558['set'](_0x4f0e27,_0xee5158),_0x35f6b5['segmentNameToId'][_0x1c3faa(0x1ce)](_0x4f0e27,_0xee5158),_0x13a189['onProgress']?.({'type':_0x1c3faa(0xea),'journeyName':_0x24800['yamlConfig'][_0x1c3faa(0x170)],'segmentName':_0x4f0e27});}const _0x4e2123=new Map();for(const [_0x395a7f,_0x43bf29]of _0x2888a1){_0x13a189[_0x1c3faa(0xe5)]?.({'type':_0x1c3faa(0x193),'journeyName':_0x24800['yamlConfig'][_0x1c3faa(0x170)],'activationName':_0x395a7f});const _0x3598c3=await _0x106865(_0x43bf29,_0x35f6b5[_0x1c3faa(0xe3)]),_0x3ecb49={..._0x3598c3,..._0x43bf29[_0x1c3faa(0x1b2)]!==undefined&&{'runAfterJourneyRefresh':_0x43bf29[_0x1c3faa(0x1b2)]}},_0x39456b=await _0x34248c[_0x1c3faa(0x12b)][_0x1c3faa(0x1d7)](_0x37052a,_0x3ecb49);_0x4e2123[_0x1c3faa(0x1ce)](_0x395a7f,_0x39456b['id']),_0x6150c0[_0x1c3faa(0x181)]['set'](_0x395a7f,_0x39456b['id']),_0x13a189[_0x1c3faa(0xe5)]?.({'type':'embedded_activation_created','journeyName':_0x24800[_0x1c3faa(0x152)][_0x1c3faa(0x170)],'activationName':_0x395a7f});}const _0x4d1fe4=JSON['parse'](JSON[_0x1c3faa(0x10b)](_0x1a102c));return _0x4d1fe4['id']=_0x37052a,ensureJourneyDefaults(_0x4d1fe4[_0x1c3faa(0x104)]),resolvePendingIdsInRequest(_0x4d1fe4,_0x1a102c,_0x49e9bc,_0xad4558,_0x4e2123,_0x13a189),await _0x34248c[_0x1c3faa(0x12b)][_0x1c3faa(0xfd)](_0x37052a,_0x4d1fe4),deletePushRecovery(_0x24800['absolutePath']),{'action':_0x1c3faa(0x124),'journeyId':_0x37052a,'embeddedSegmentNameToId':_0xad4558};}export function stripWaitStepPendingIds(_0x80f659){const _0x53b4c6=a168_0x5cf043,_0x443e57=_0x80f659['conditionSegmentId']&&isPendingSegmentId(_0x80f659[_0x53b4c6(0x128)]),_0x96ea5f=_0x80f659[_0x53b4c6(0x187)]?.[_0x53b4c6(0x176)](_0x257d69=>_0x257d69['segmentId']&&isPendingSegmentId(_0x257d69[_0x53b4c6(0x14b)]));(_0x443e57||_0x96ea5f)&&(_0x80f659[_0x53b4c6(0xe8)]=_0x53b4c6(0x1d1),_0x80f659[_0x53b4c6(0xde)]=0x1,_0x80f659[_0x53b4c6(0x1be)]='day',delete _0x80f659['conditionSegmentId'],delete _0x80f659['conditionTimeoutDuration'],delete _0x80f659[_0x53b4c6(0xf1)],delete _0x80f659['conditions']);}export function resolveWaitStepPendingIds(_0x3d7d87,_0x124e77,_0x317238,_0x205af2){const _0x245a9f=a168_0x5cf043;if(_0x124e77['conditionSegmentId']&&isPendingSegmentId(_0x124e77[_0x245a9f(0x128)])){const _0x733a08=_0x317238(_0x124e77[_0x245a9f(0x128)],_0x245a9f(0xe7)+_0x205af2+'\x27\x20wait\x20condition');_0x733a08&&(_0x3d7d87['waitStepType']='Condition',_0x3d7d87[_0x245a9f(0x128)]=_0x733a08,delete _0x3d7d87[_0x245a9f(0xde)],delete _0x3d7d87['waitStepUnit'],_0x124e77[_0x245a9f(0x125)]!==undefined&&(_0x3d7d87[_0x245a9f(0x125)]=_0x124e77[_0x245a9f(0x125)]),_0x124e77[_0x245a9f(0xf1)]&&(_0x3d7d87[_0x245a9f(0xf1)]=_0x124e77[_0x245a9f(0xf1)]));}if(_0x124e77[_0x245a9f(0x187)]){const _0x504f91=_0x124e77[_0x245a9f(0x187)][_0x245a9f(0x176)](_0x272d3f=>_0x272d3f['segmentId']&&isPendingSegmentId(_0x272d3f[_0x245a9f(0x14b)]));if(_0x504f91){const _0x4ebd95=_0x124e77[_0x245a9f(0x187)]['map'](_0x4b3445=>{const _0x9d9c40=_0x245a9f;if(_0x4b3445[_0x9d9c40(0x14b)]&&isPendingSegmentId(_0x4b3445['segmentId'])){const _0x1908a0=_0x317238(_0x4b3445[_0x9d9c40(0x14b)],'stage\x20\x27'+_0x205af2+_0x9d9c40(0x105));return{..._0x4b3445,'segmentId':_0x1908a0||_0x4b3445[_0x9d9c40(0x14b)]};}return{..._0x4b3445};});_0x3d7d87['waitStepType']=_0x245a9f(0x186),_0x3d7d87[_0x245a9f(0x187)]=_0x4ebd95,delete _0x3d7d87['waitStep'],delete _0x3d7d87['waitStepUnit'],delete _0x3d7d87['conditionSegmentId'],delete _0x3d7d87[_0x245a9f(0x125)],delete _0x3d7d87[_0x245a9f(0xf1)];}}}function stripPendingIds(_0x132bc8){const _0x1254ef=a168_0x5cf043;_0x132bc8[_0x1254ef(0x104)][_0x1254ef(0x10d)]?.[_0x1254ef(0x14b)]&&isPendingSegmentId(_0x132bc8[_0x1254ef(0x104)]['goal']['segmentId'])&&delete _0x132bc8[_0x1254ef(0x104)][_0x1254ef(0x10d)];for(const _0x5afe6e of _0x132bc8['attributes']['journeyStages']||[]){_0x5afe6e[_0x1254ef(0x185)]?.[_0x1254ef(0x14b)]&&isPendingSegmentId(_0x5afe6e[_0x1254ef(0x185)]['segmentId'])&&delete _0x5afe6e[_0x1254ef(0x185)];_0x5afe6e[_0x1254ef(0x1c7)]?.['segmentId']&&isPendingSegmentId(_0x5afe6e[_0x1254ef(0x1c7)][_0x1254ef(0x14b)])&&delete _0x5afe6e[_0x1254ef(0x1c7)];_0x5afe6e[_0x1254ef(0xdd)]&&(_0x5afe6e['exitCriterias']=_0x5afe6e['exitCriterias'][_0x1254ef(0x112)](_0x283c04=>!_0x283c04[_0x1254ef(0x14b)]||!isPendingSegmentId(_0x283c04[_0x1254ef(0x14b)])));if(_0x5afe6e[_0x1254ef(0x121)])for(const _0x2d7abe of Object[_0x1254ef(0x147)](_0x5afe6e[_0x1254ef(0x121)])){const _0x4d1db7=_0x5afe6e['steps'][_0x2d7abe];_0x4d1db7[_0x1254ef(0xe9)]===_0x1254ef(0x1ab)&&_0x4d1db7['journeyActivationStepId']&&isPendingActivationId(_0x4d1db7['journeyActivationStepId'])&&(_0x4d1db7[_0x1254ef(0x16e)]='');if(_0x4d1db7[_0x1254ef(0xe9)]==='DecisionPoint'&&_0x4d1db7[_0x1254ef(0x100)])for(const _0x115b68 of _0x4d1db7[_0x1254ef(0x100)]){_0x115b68[_0x1254ef(0x14b)]&&isPendingSegmentId(_0x115b68[_0x1254ef(0x14b)])&&(_0x115b68[_0x1254ef(0x14b)]='');}_0x4d1db7[_0x1254ef(0xe9)]==='WaitStep'&&stripWaitStepPendingIds(_0x4d1db7);}}}function resolvePendingIdsInRequest(_0x732e8e,_0x18ba14,_0x59cd0b,_0x4957fd,_0x23459a,_0x4db761){const _0x4b43d3=a168_0x5cf043,_0x42539f=(_0x5e7b37,_0x223c71)=>{const _0x4201aa=a168_0x51ba;if(!isPendingSegmentId(_0x5e7b37))return _0x5e7b37;const _0x486737=extractPendingSegmentName(_0x5e7b37),_0x30f2ba=_0x4957fd[_0x4201aa(0x11e)](_0x486737);return!_0x30f2ba&&_0x4db761[_0x4201aa(0x1c3)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x486737+'\x27\x20for\x20'+_0x223c71),_0x30f2ba;};if(_0x732e8e[_0x4b43d3(0x104)][_0x4b43d3(0x10d)]?.[_0x4b43d3(0x14b)]&&isPendingSegmentId(_0x732e8e[_0x4b43d3(0x104)][_0x4b43d3(0x10d)]['segmentId'])){const _0x2bae5e=_0x42539f(_0x732e8e[_0x4b43d3(0x104)][_0x4b43d3(0x10d)][_0x4b43d3(0x14b)],_0x4b43d3(0x103));_0x2bae5e&&(_0x732e8e[_0x4b43d3(0x104)][_0x4b43d3(0x10d)][_0x4b43d3(0x14b)]=_0x2bae5e);}for(const _0x334e99 of _0x732e8e[_0x4b43d3(0x104)][_0x4b43d3(0x19e)]||[]){const _0x37f7bb=_0x59cd0b[_0x4b43d3(0x11e)](_0x334e99[_0x4b43d3(0x170)][_0x4b43d3(0x123)]());_0x37f7bb&&(_0x334e99['id']=_0x37f7bb);if(_0x334e99['entryCriteria']?.[_0x4b43d3(0x14b)]&&isPendingSegmentId(_0x334e99[_0x4b43d3(0x185)][_0x4b43d3(0x14b)])){const _0x478a58=_0x42539f(_0x334e99[_0x4b43d3(0x185)][_0x4b43d3(0x14b)],_0x4b43d3(0xe7)+_0x334e99[_0x4b43d3(0x170)]+_0x4b43d3(0x1aa));_0x478a58&&(_0x334e99[_0x4b43d3(0x185)]['segmentId']=_0x478a58);}if(_0x334e99[_0x4b43d3(0xdd)])for(const _0x3e00ba of _0x334e99['exitCriterias']){if(_0x3e00ba[_0x4b43d3(0x14b)]&&isPendingSegmentId(_0x3e00ba[_0x4b43d3(0x14b)])){const _0x45b5c9=_0x42539f(_0x3e00ba[_0x4b43d3(0x14b)],_0x4b43d3(0xe7)+_0x334e99[_0x4b43d3(0x170)]+_0x4b43d3(0x153));_0x45b5c9&&(_0x3e00ba['segmentId']=_0x45b5c9);}}if(_0x334e99[_0x4b43d3(0x1c7)]?.[_0x4b43d3(0x14b)]&&isPendingSegmentId(_0x334e99[_0x4b43d3(0x1c7)][_0x4b43d3(0x14b)])){const _0x37a6a8=_0x42539f(_0x334e99[_0x4b43d3(0x1c7)][_0x4b43d3(0x14b)],_0x4b43d3(0xe7)+_0x334e99[_0x4b43d3(0x170)]+_0x4b43d3(0x11d));_0x37a6a8&&(_0x334e99[_0x4b43d3(0x1c7)][_0x4b43d3(0x14b)]=_0x37a6a8);}if(_0x334e99['steps']){const _0x4725f8=_0x9105de=>_0x18ba14[_0x4b43d3(0x104)][_0x4b43d3(0x19e)]?.[_0x4b43d3(0x11b)](_0x19902b=>_0x19902b[_0x4b43d3(0x170)][_0x4b43d3(0x123)]()===_0x334e99[_0x4b43d3(0x170)][_0x4b43d3(0x123)]())?.[_0x4b43d3(0x121)]?.[_0x9105de];for(const _0x465a38 of Object[_0x4b43d3(0x147)](_0x334e99[_0x4b43d3(0x121)])){const _0x5bc473=_0x334e99['steps'][_0x465a38],_0x3f9de3=_0x4725f8(_0x465a38);if(_0x5bc473['type']===_0x4b43d3(0x1ab)&&_0x5bc473[_0x4b43d3(0x16e)]&&(isPendingActivationId(_0x5bc473['journeyActivationStepId'])||_0x5bc473['journeyActivationStepId']==='')){if(_0x3f9de3?.[_0x4b43d3(0x16e)]&&isPendingActivationId(_0x3f9de3[_0x4b43d3(0x16e)])){const _0x3e12c4=extractPendingActivationName(_0x3f9de3[_0x4b43d3(0x16e)]),_0x3229d7=_0x23459a[_0x4b43d3(0x11e)](_0x3e12c4);_0x3229d7&&(_0x5bc473[_0x4b43d3(0x16e)]=_0x3229d7);}}if(_0x5bc473['type']===_0x4b43d3(0x1a5)&&_0x5bc473[_0x4b43d3(0x100)]&&_0x3f9de3?.[_0x4b43d3(0x100)])for(let _0x5471b8=0x0;_0x5471b8<_0x5bc473[_0x4b43d3(0x100)][_0x4b43d3(0xdc)];_0x5471b8++){const _0x485585=_0x5bc473[_0x4b43d3(0x100)][_0x5471b8],_0x5c92d0=_0x3f9de3[_0x4b43d3(0x100)][_0x5471b8];if(_0x5c92d0?.['segmentId']&&isPendingSegmentId(_0x5c92d0['segmentId'])){const _0x205371=_0x42539f(_0x5c92d0['segmentId'],_0x4b43d3(0xe7)+_0x334e99[_0x4b43d3(0x170)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x485585[_0x4b43d3(0x170)]||_0x5471b8)+'\x27');_0x205371&&(_0x485585[_0x4b43d3(0x14b)]=_0x205371);}}_0x5bc473['type']===_0x4b43d3(0x119)&&_0x3f9de3?.['type']==='WaitStep'&&resolveWaitStepPendingIds(_0x5bc473,_0x3f9de3,_0x42539f,_0x334e99[_0x4b43d3(0x170)]);}}}}
@@ -1 +1 @@
1
- (function(_0x31eada,_0x426b18){const _0x188fc2=a160_0x389a,_0x2c3766=_0x31eada();while(!![]){try{const _0x189505=-parseInt(_0x188fc2(0x167))/0x1+-parseInt(_0x188fc2(0x160))/0x2*(-parseInt(_0x188fc2(0x161))/0x3)+parseInt(_0x188fc2(0x169))/0x4*(-parseInt(_0x188fc2(0x16a))/0x5)+-parseInt(_0x188fc2(0x15b))/0x6*(parseInt(_0x188fc2(0x15e))/0x7)+parseInt(_0x188fc2(0x164))/0x8+-parseInt(_0x188fc2(0x166))/0x9*(parseInt(_0x188fc2(0x168))/0xa)+parseInt(_0x188fc2(0x162))/0xb;if(_0x189505===_0x426b18)break;else _0x2c3766['push'](_0x2c3766['shift']());}catch(_0x39d766){_0x2c3766['push'](_0x2c3766['shift']());}}}(a160_0x3304,0xc7149));export function buildFolderIdToPathMap(_0x56577d){const _0x577088=a160_0x389a,_0x3f43ce=new Map(),_0x3b9ed0=new Map();for(const _0x187df2 of _0x56577d){_0x3b9ed0[_0x577088(0x15d)](_0x187df2['id'],_0x187df2);}const _0x52a3fd=new Set();for(const _0x484e8c of _0x56577d){!_0x484e8c[_0x577088(0x15c)]&&_0x52a3fd[_0x577088(0x163)](_0x484e8c['id']);}function _0x2907e4(_0x1b8a73){const _0x2436b0=_0x577088;if(_0x3f43ce[_0x2436b0(0x165)](_0x1b8a73['id']))return _0x3f43ce[_0x2436b0(0x16b)](_0x1b8a73['id']);if(_0x52a3fd[_0x2436b0(0x165)](_0x1b8a73['id']))return _0x3f43ce['set'](_0x1b8a73['id'],''),'';if(_0x1b8a73[_0x2436b0(0x15c)]){const _0x87761d=_0x3b9ed0[_0x2436b0(0x16b)](_0x1b8a73[_0x2436b0(0x15c)]);if(_0x87761d){const _0x59d6a3=_0x2907e4(_0x87761d),_0x45faaf=_0x59d6a3?_0x59d6a3+'/'+_0x1b8a73[_0x2436b0(0x15f)]:_0x1b8a73[_0x2436b0(0x15f)];return _0x3f43ce['set'](_0x1b8a73['id'],_0x45faaf),_0x45faaf;}}const _0x4fd96a=_0x1b8a73[_0x2436b0(0x15f)];return _0x3f43ce[_0x2436b0(0x15d)](_0x1b8a73['id'],_0x4fd96a),_0x4fd96a;}for(const _0x1e5ee8 of _0x56577d){_0x2907e4(_0x1e5ee8);}return _0x3f43ce;}function a160_0x389a(_0x715320,_0x4ee90d){_0x715320=_0x715320-0x15b;const _0x33042d=a160_0x3304();let _0x389a54=_0x33042d[_0x715320];return _0x389a54;}export function buildFolderPathToIdMap(_0x5a2b71){const _0x5b843f=a160_0x389a,_0x48149e=new Map(),_0x1f976c=new Map();for(const _0x4e5d78 of _0x5a2b71){_0x1f976c[_0x5b843f(0x15d)](_0x4e5d78['id'],_0x4e5d78);}const _0x2e4680=new Set();for(const _0x2df6fa of _0x5a2b71){!_0x2df6fa['parentFolderId']&&_0x2e4680['add'](_0x2df6fa['id']);}function _0xf477ed(_0x2c3b14){const _0x528bba=_0x5b843f;if(_0x2e4680[_0x528bba(0x165)](_0x2c3b14['id']))return'';if(_0x2c3b14[_0x528bba(0x15c)]){const _0x209ddf=_0x1f976c[_0x528bba(0x16b)](_0x2c3b14[_0x528bba(0x15c)]);if(_0x209ddf){const _0x396350=_0xf477ed(_0x209ddf);return _0x396350?_0x396350+'/'+_0x2c3b14[_0x528bba(0x15f)]:_0x2c3b14[_0x528bba(0x15f)];}}return _0x2c3b14[_0x528bba(0x15f)];}for(const _0x37e015 of _0x5a2b71){const _0x1e2155=_0xf477ed(_0x37e015);_0x48149e[_0x5b843f(0x15d)](_0x1e2155,_0x37e015['id']);}return _0x48149e;}export function buildFolderMaps(_0x2c1909){const _0x578e30=a160_0x389a,_0x17c672=buildFolderIdToPathMap(_0x2c1909),_0x295e82=new Map();for(const [_0x43d394,_0x44cd53]of _0x17c672){_0x295e82[_0x578e30(0x15d)](_0x44cd53,_0x43d394);}return{'idToPath':_0x17c672,'pathToId':_0x295e82};}export function getFolderPath(_0x1d469c,_0x359d15){const _0x459ee1=a160_0x389a;if(!_0x1d469c)return'';return _0x359d15[_0x459ee1(0x16b)](_0x1d469c)??'';}function a160_0x3304(){const _0x3deb9a=['504423SZemDn','1318622KXNxVm','90xIOVbv','16BQrfIC','1066080uYNANd','get','6LvpZnq','parentFolderId','set','6383601MSQTZG','name','2wofOBO','3331596IFngrQ','32652774SOHNwl','add','2594552mlCmWq','has'];a160_0x3304=function(){return _0x3deb9a;};return a160_0x3304();}
1
+ (function(_0x136566,_0x4d44c1){const _0x337967=a169_0x4cf2,_0x2ec916=_0x136566();while(!![]){try{const _0x330945=-parseInt(_0x337967(0x1b2))/0x1*(-parseInt(_0x337967(0x1ae))/0x2)+-parseInt(_0x337967(0x1bb))/0x3+parseInt(_0x337967(0x1b7))/0x4*(parseInt(_0x337967(0x1b9))/0x5)+-parseInt(_0x337967(0x1ab))/0x6+-parseInt(_0x337967(0x1ba))/0x7+parseInt(_0x337967(0x1ac))/0x8*(parseInt(_0x337967(0x1b6))/0x9)+-parseInt(_0x337967(0x1b8))/0xa*(-parseInt(_0x337967(0x1b1))/0xb);if(_0x330945===_0x4d44c1)break;else _0x2ec916['push'](_0x2ec916['shift']());}catch(_0x253fd7){_0x2ec916['push'](_0x2ec916['shift']());}}}(a169_0x305a,0x1cf32));export function buildFolderIdToPathMap(_0x47bad0){const _0x5c253e=a169_0x4cf2,_0xceb18b=new Map(),_0x43d615=new Map();for(const _0x3df524 of _0x47bad0){_0x43d615[_0x5c253e(0x1af)](_0x3df524['id'],_0x3df524);}const _0x314b5d=new Set();for(const _0x239cc9 of _0x47bad0){!_0x239cc9[_0x5c253e(0x1b4)]&&_0x314b5d[_0x5c253e(0x1b3)](_0x239cc9['id']);}function _0x3df08c(_0xf812dd){const _0x5439df=_0x5c253e;if(_0xceb18b['has'](_0xf812dd['id']))return _0xceb18b[_0x5439df(0x1b5)](_0xf812dd['id']);if(_0x314b5d[_0x5439df(0x1ad)](_0xf812dd['id']))return _0xceb18b[_0x5439df(0x1af)](_0xf812dd['id'],''),'';if(_0xf812dd[_0x5439df(0x1b4)]){const _0x3cf1da=_0x43d615[_0x5439df(0x1b5)](_0xf812dd[_0x5439df(0x1b4)]);if(_0x3cf1da){const _0x122a8e=_0x3df08c(_0x3cf1da),_0x493aec=_0x122a8e?_0x122a8e+'/'+_0xf812dd['name']:_0xf812dd['name'];return _0xceb18b[_0x5439df(0x1af)](_0xf812dd['id'],_0x493aec),_0x493aec;}}const _0x56d26a=_0xf812dd['name'];return _0xceb18b[_0x5439df(0x1af)](_0xf812dd['id'],_0x56d26a),_0x56d26a;}for(const _0x590cb4 of _0x47bad0){_0x3df08c(_0x590cb4);}return _0xceb18b;}export function buildFolderPathToIdMap(_0x25cedc){const _0x106152=a169_0x4cf2,_0x202d3a=new Map(),_0x2be276=new Map();for(const _0x4b6347 of _0x25cedc){_0x2be276['set'](_0x4b6347['id'],_0x4b6347);}const _0x1ced9c=new Set();for(const _0x46dbde of _0x25cedc){!_0x46dbde[_0x106152(0x1b4)]&&_0x1ced9c[_0x106152(0x1b3)](_0x46dbde['id']);}function _0x3a46fd(_0xa3df16){const _0x11f9dc=_0x106152;if(_0x1ced9c[_0x11f9dc(0x1ad)](_0xa3df16['id']))return'';if(_0xa3df16[_0x11f9dc(0x1b4)]){const _0x2b001c=_0x2be276['get'](_0xa3df16['parentFolderId']);if(_0x2b001c){const _0x1135b0=_0x3a46fd(_0x2b001c);return _0x1135b0?_0x1135b0+'/'+_0xa3df16[_0x11f9dc(0x1b0)]:_0xa3df16['name'];}}return _0xa3df16['name'];}for(const _0x568605 of _0x25cedc){const _0x34cb33=_0x3a46fd(_0x568605);_0x202d3a[_0x106152(0x1af)](_0x34cb33,_0x568605['id']);}return _0x202d3a;}function a169_0x4cf2(_0x5e73c8,_0x1f5f64){_0x5e73c8=_0x5e73c8-0x1ab;const _0x305aa6=a169_0x305a();let _0x4cf2c8=_0x305aa6[_0x5e73c8];return _0x4cf2c8;}function a169_0x305a(){const _0x5d6ffe=['834309UPzlyV','578721IXGsQb','641124YutTIa','305464zkgXjv','has','219108mwGcGS','set','name','88209VcliKL','1zDUDHV','add','parentFolderId','get','27BnYPBP','4TTcmHg','360fcWkvx','123695fZAZuP'];a169_0x305a=function(){return _0x5d6ffe;};return a169_0x305a();}export function buildFolderMaps(_0x2f0423){const _0x4b0b6b=buildFolderIdToPathMap(_0x2f0423),_0xdee6ff=new Map();for(const [_0x3ae025,_0x3f7596]of _0x4b0b6b){_0xdee6ff['set'](_0x3f7596,_0x3ae025);}return{'idToPath':_0x4b0b6b,'pathToId':_0xdee6ff};}export function getFolderPath(_0x23d3b8,_0x1e991d){const _0x18454a=a169_0x4cf2;if(!_0x23d3b8)return'';return _0x1e991d[_0x18454a(0x1b5)](_0x23d3b8)??'';}
@@ -1 +1 @@
1
- (function(_0x5552df,_0x102752){const _0x5dd4a1=a161_0x41f6,_0x412150=_0x5552df();while(!![]){try{const _0x46be4b=parseInt(_0x5dd4a1(0xd1))/0x1*(parseInt(_0x5dd4a1(0xe3))/0x2)+parseInt(_0x5dd4a1(0xc6))/0x3*(-parseInt(_0x5dd4a1(0xe7))/0x4)+parseInt(_0x5dd4a1(0xb9))/0x5+parseInt(_0x5dd4a1(0xd7))/0x6*(parseInt(_0x5dd4a1(0xcb))/0x7)+parseInt(_0x5dd4a1(0xc8))/0x8*(parseInt(_0x5dd4a1(0xc9))/0x9)+-parseInt(_0x5dd4a1(0xe2))/0xa*(-parseInt(_0x5dd4a1(0xdf))/0xb)+-parseInt(_0x5dd4a1(0xe0))/0xc*(parseInt(_0x5dd4a1(0xc5))/0xd);if(_0x46be4b===_0x102752)break;else _0x412150['push'](_0x412150['shift']());}catch(_0x394a62){_0x412150['push'](_0x412150['shift']());}}}(a161_0x4d76,0x5a4ac));import a161_0x2cb8bf from'path';import{parse as a161_0xc3ba55}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0x2441c6){const _0x1f6b6c=a161_0x41f6;if(!_0x2441c6||_0x2441c6[_0x1f6b6c(0xd6)]()==='')throw new Error(_0x1f6b6c(0xc0));const _0x4a2ae4=_0x2441c6[_0x1f6b6c(0xd6)]();if(_0x4a2ae4==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x2441c6};const _0x25f903=_0x4a2ae4[_0x1f6b6c(0xbd)]('/')?_0x4a2ae4[_0x1f6b6c(0xbf)](0x1):_0x4a2ae4,_0x53d1d8=_0x25f903['split']('/')[_0x1f6b6c(0xe4)](_0x3c5d6a=>_0x3c5d6a!=='');if(_0x53d1d8[_0x1f6b6c(0xd8)]===0x0)throw new Error(_0x1f6b6c(0xbb));const _0x2406d9=_0x4a2ae4[_0x1f6b6c(0xbd)]('/')||!isRelativePathSegment(_0x53d1d8[0x0]);for(const _0x39065d of _0x53d1d8){validatePathSegment(_0x39065d);}return{'segments':_0x53d1d8,'isAbsolute':_0x2406d9,'raw':_0x2441c6};}function isRelativePathSegment(_0x285902){return _0x285902==='.'||_0x285902==='..';}function validatePathSegment(_0x495ade){const _0x5721b7=a161_0x41f6;if(_0x495ade==='')throw new Error(_0x5721b7(0xd5));if(_0x495ade==='.'||_0x495ade==='..')return;if(/[\x00-\x1F\x7F]/[_0x5721b7(0xe1)](_0x495ade))throw new Error(_0x5721b7(0xde)+_0x495ade);if(_0x495ade!==_0x495ade[_0x5721b7(0xd6)]()){}}export function validatePath(_0xb51150){const _0x17fde8=a161_0x41f6;if(_0xb51150[_0x17fde8(0xdb)][_0x17fde8(0xd8)]===0x0&&!_0xb51150[_0x17fde8(0xdc)])throw new Error(_0x17fde8(0xc7));if(_0xb51150[_0x17fde8(0xdc)]){if(_0xb51150[_0x17fde8(0xdb)][0x0]==='..')throw new Error(_0x17fde8(0xbc));let _0x425b5c=0x0;for(const _0x12ae68 of _0xb51150[_0x17fde8(0xdb)]){if(_0x12ae68==='..'){if(_0x425b5c===0x0)throw new Error(_0x17fde8(0xd3));_0x425b5c--;}else _0x12ae68!=='.'&&_0x425b5c++;}}}function a161_0x4d76(){const _0x10c65a=['68720pGfyTo','39982vEclrZ','filter','name','slice','1036FdHzOf','Cannot\x20navigate\x20above\x20root','endsWith','1599605WvGCbL','segment','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','startsWith','exists','substring','Path\x20cannot\x20be\x20empty','replace','dirname','parent_segment','No\x20tdx.json\x20found\x20for\x20file:\x20','2249INUSAO','7197yhFhPR','Relative\x20path\x20cannot\x20be\x20empty','928eFejtN','37377vkpTbC','raw','1827jCOLoz','join','parse','push','root','resolve','17LcrzIv','journey','Path\x20attempts\x20to\x20navigate\x20above\x20root','pop','Path\x20segment\x20cannot\x20be\x20empty','trim','10626okIPSZ','length','.yml','Cannot\x20split\x20empty\x20path','segments','isAbsolute','readFile','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','748sMKNcm','74904HXTlpH','test'];a161_0x4d76=function(){return _0x10c65a;};return a161_0x4d76();}function a161_0x41f6(_0x460b5a,_0x528fb0){_0x460b5a=_0x460b5a-0xb7;const _0x4d7646=a161_0x4d76();let _0x41f6d8=_0x4d7646[_0x460b5a];return _0x41f6d8;}export function joinPaths(_0x457673,_0x4ffb31){const _0x82524b=a161_0x41f6;if(!_0x457673||_0x457673==='/')return _0x4ffb31;if(!_0x4ffb31||_0x4ffb31==='.')return _0x457673;if(_0x4ffb31['startsWith']('/'))return _0x4ffb31;const _0x501ba4=parsePath(_0x457673),_0x4dfdde=parsePath(_0x4ffb31),_0x2b023b=[..._0x501ba4[_0x82524b(0xdb)]];for(const _0x3b1114 of _0x4dfdde['segments']){if(_0x3b1114==='.')continue;else{if(_0x3b1114==='..'){if(_0x2b023b['length']===0x0)throw new Error(_0x82524b(0xb7));_0x2b023b['pop']();}else _0x2b023b[_0x82524b(0xce)](_0x3b1114);}}const _0x356513=_0x2b023b[_0x82524b(0xcc)]('/');return _0x501ba4[_0x82524b(0xca)][_0x82524b(0xbd)]('/')?'/'+_0x356513:_0x356513;}export function normalizePath(_0x5b1c2c){const _0x48d2f1=a161_0x41f6,_0x248979=parsePath(_0x5b1c2c),_0x195acb=[];for(const _0x67e146 of _0x248979['segments']){if(_0x67e146==='.')continue;else{if(_0x67e146==='..'){if(_0x195acb[_0x48d2f1(0xd8)]===0x0){if(_0x248979[_0x48d2f1(0xdc)])throw new Error(_0x48d2f1(0xb7));_0x195acb[_0x48d2f1(0xce)]('..');}else _0x195acb[_0x195acb[_0x48d2f1(0xd8)]-0x1]==='..'?_0x195acb[_0x48d2f1(0xce)]('..'):_0x195acb[_0x48d2f1(0xd4)]();}else _0x195acb[_0x48d2f1(0xce)](_0x67e146);}}if(_0x195acb[_0x48d2f1(0xd8)]===0x0)return _0x248979[_0x48d2f1(0xdc)]?'/':'.';const _0x5147ff=_0x195acb[_0x48d2f1(0xcc)]('/');return _0x248979['raw'][_0x48d2f1(0xbd)]('/')?'/'+_0x5147ff:_0x5147ff;}export function getParentPath(_0xde361b){const _0x34f935=a161_0x41f6,_0x4d7c48=parsePath(_0xde361b);if(_0x4d7c48[_0x34f935(0xdb)][_0x34f935(0xd8)]<=0x1)return'/';const _0x387820=_0x4d7c48[_0x34f935(0xdb)]['slice'](0x0,-0x1)[_0x34f935(0xcc)]('/');return _0x4d7c48['raw'][_0x34f935(0xbd)]('/')?'/'+_0x387820:_0x387820;}export function getBaseName(_0x3f80f2){const _0x4ee0ec=a161_0x41f6,_0x5367cf=parsePath(_0x3f80f2);return _0x5367cf[_0x4ee0ec(0xdb)][_0x5367cf[_0x4ee0ec(0xdb)]['length']-0x1]||'';}export function isChildPath(_0x1e71cd,_0x35fc2b){const _0x26a16a=a161_0x41f6,_0xf174e9=parsePath(_0x1e71cd),_0x4f6e3d=parsePath(_0x35fc2b);if(_0xf174e9[_0x26a16a(0xdb)][_0x26a16a(0xd8)]<=_0x4f6e3d[_0x26a16a(0xdb)][_0x26a16a(0xd8)])return![];for(let _0x2be6aa=0x0;_0x2be6aa<_0x4f6e3d[_0x26a16a(0xdb)][_0x26a16a(0xd8)];_0x2be6aa++){if(_0xf174e9['segments'][_0x2be6aa]!==_0x4f6e3d['segments'][_0x2be6aa])return![];}return!![];}export function splitPath(_0x115824){const _0x2c3a61=a161_0x41f6,_0x5d1a57=parsePath(_0x115824);if(_0x5d1a57[_0x2c3a61(0xdb)][_0x2c3a61(0xd8)]===0x0)throw new Error(_0x2c3a61(0xda));if(_0x5d1a57[_0x2c3a61(0xdb)][_0x2c3a61(0xd8)]===0x1)return{'parent':_0x5d1a57[_0x2c3a61(0xdb)][0x0]};return{'parent':_0x5d1a57['segments'][0x0],'child':_0x5d1a57[_0x2c3a61(0xdb)][_0x2c3a61(0xe6)](0x1)[_0x2c3a61(0xcc)]('/')};}export function isYamlFilePath(_0x51d225){const _0xc3ae87=a161_0x41f6;return _0x51d225[_0xc3ae87(0xb8)](_0xc3ae87(0xd9))||_0x51d225[_0xc3ae87(0xb8)]('.yaml');}export async function resolveYamlFilePath(_0x580155,_0x1244f2=nodeFileSystem){const _0x3fb6d5=a161_0x41f6,_0x1f5304=a161_0x2cb8bf[_0x3fb6d5(0xd0)](_0x580155);if(!await _0x1244f2[_0x3fb6d5(0xbe)](_0x1f5304))throw new Error('File\x20not\x20found:\x20'+_0x580155);let _0x56499f=a161_0x2cb8bf[_0x3fb6d5(0xc2)](_0x1f5304),_0x1deaea=null,_0x217dab=null;const _0x33ccb0=a161_0x2cb8bf[_0x3fb6d5(0xcd)](_0x56499f)[_0x3fb6d5(0xcf)];while(_0x56499f!==_0x33ccb0){const _0x27064c=a161_0x2cb8bf['join'](_0x56499f,'tdx.json');if(await _0x1244f2[_0x3fb6d5(0xbe)](_0x27064c)){_0x1deaea=_0x27064c,_0x217dab=_0x56499f;break;}_0x56499f=a161_0x2cb8bf[_0x3fb6d5(0xc2)](_0x56499f);}if(!_0x1deaea||!_0x217dab)throw new Error(_0x3fb6d5(0xc4)+_0x580155+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x572230=await _0x1244f2[_0x3fb6d5(0xdd)](_0x1deaea),_0x125363=JSON[_0x3fb6d5(0xcd)](_0x572230),_0x412296=_0x125363[_0x3fb6d5(0xc3)];if(!_0x412296)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x58330d=await _0x1244f2[_0x3fb6d5(0xdd)](_0x1f5304),_0x7a86dd=a161_0xc3ba55(_0x58330d),_0x53cd5e=_0x7a86dd[_0x3fb6d5(0xe5)];if(!_0x53cd5e)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x580155);const _0x14b4f9=isJourneyDef(_0x7a86dd,_0x1f5304)?_0x3fb6d5(0xd2):_0x3fb6d5(0xba),_0xaeb508=a161_0x2cb8bf['relative'](_0x217dab,_0x1f5304),_0x169aa8=a161_0x2cb8bf[_0x3fb6d5(0xc2)](_0xaeb508),_0x1428c0=_0x169aa8==='.'?'':_0x169aa8[_0x3fb6d5(0xc1)](/\\/g,'/'),_0x2c94cf=_0x1428c0?_0x412296+'/'+_0x1428c0+'/'+_0x53cd5e:_0x412296+'/'+_0x53cd5e;return{'parentSegment':_0x412296,'segmentName':_0x53cd5e,'folderPath':_0x1428c0,'fullPath':_0x2c94cf,'resourceType':_0x14b4f9,'content':_0x58330d};}
1
+ (function(_0x29bf1e,_0x114610){const _0x53eaf3=a170_0x50f0,_0x3d2475=_0x29bf1e();while(!![]){try{const _0x589055=parseInt(_0x53eaf3(0x196))/0x1+parseInt(_0x53eaf3(0x197))/0x2*(-parseInt(_0x53eaf3(0x185))/0x3)+parseInt(_0x53eaf3(0x18f))/0x4*(-parseInt(_0x53eaf3(0x192))/0x5)+parseInt(_0x53eaf3(0x1a5))/0x6*(-parseInt(_0x53eaf3(0x18e))/0x7)+-parseInt(_0x53eaf3(0x19d))/0x8*(-parseInt(_0x53eaf3(0x1a2))/0x9)+parseInt(_0x53eaf3(0x191))/0xa+-parseInt(_0x53eaf3(0x1a9))/0xb;if(_0x589055===_0x114610)break;else _0x3d2475['push'](_0x3d2475['shift']());}catch(_0x55f62b){_0x3d2475['push'](_0x3d2475['shift']());}}}(a170_0x59c4,0x2707e));import a170_0x4c10e0 from'path';function a170_0x50f0(_0x24ee7d,_0x3b61f4){_0x24ee7d=_0x24ee7d-0x182;const _0x59c4bd=a170_0x59c4();let _0x50f032=_0x59c4bd[_0x24ee7d];return _0x50f032;}import{parse as a170_0x24916d}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0x506e83){const _0x884653=a170_0x50f0;if(!_0x506e83||_0x506e83[_0x884653(0x183)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x17e80b=_0x506e83[_0x884653(0x183)]();if(_0x17e80b==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x506e83};const _0x38f2b2=_0x17e80b['startsWith']('/')?_0x17e80b[_0x884653(0x1a8)](0x1):_0x17e80b,_0x6d0cba=_0x38f2b2[_0x884653(0x19e)]('/')[_0x884653(0x182)](_0x2346d2=>_0x2346d2!=='');if(_0x6d0cba[_0x884653(0x19c)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x5f218b=_0x17e80b['startsWith']('/')||!isRelativePathSegment(_0x6d0cba[0x0]);for(const _0x3fddf3 of _0x6d0cba){validatePathSegment(_0x3fddf3);}return{'segments':_0x6d0cba,'isAbsolute':_0x5f218b,'raw':_0x506e83};}function a170_0x59c4(){const _0x21330a=['name','Path\x20attempts\x20to\x20navigate\x20above\x20root','.yaml','endsWith','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','isAbsolute','7qzJNhs','554876KhKNhQ','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','3150310IRjTqm','5NpwmVY','File\x20not\x20found:\x20','pop','Cannot\x20split\x20empty\x20path','234885nwoDPZ','182jxKLcD','Path\x20segment\x20cannot\x20be\x20empty','tdx.json','dirname','segment','length','102632GybBJg','split','journey','readFile','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','135GXaMlC','Cannot\x20navigate\x20above\x20root','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','845238sqzlqK','parse','exists','substring','2377826AzTJnc','No\x20tdx.json\x20found\x20for\x20file:\x20','resolve','push','raw','root','Relative\x20path\x20cannot\x20be\x20empty','join','startsWith','segments','relative','filter','trim','.yml','2859TdKpSR','slice','test'];a170_0x59c4=function(){return _0x21330a;};return a170_0x59c4();}function isRelativePathSegment(_0x5b2b40){return _0x5b2b40==='.'||_0x5b2b40==='..';}function validatePathSegment(_0x5eedf2){const _0x27e397=a170_0x50f0;if(_0x5eedf2==='')throw new Error(_0x27e397(0x198));if(_0x5eedf2==='.'||_0x5eedf2==='..')return;if(/[\x00-\x1F\x7F]/[_0x27e397(0x187)](_0x5eedf2))throw new Error(_0x27e397(0x1a4)+_0x5eedf2);if(_0x5eedf2!==_0x5eedf2[_0x27e397(0x183)]()){}}export function validatePath(_0x574d55){const _0x4cb9f9=a170_0x50f0;if(_0x574d55[_0x4cb9f9(0x1b2)][_0x4cb9f9(0x19c)]===0x0&&!_0x574d55[_0x4cb9f9(0x18d)])throw new Error(_0x4cb9f9(0x1af));if(_0x574d55['isAbsolute']){if(_0x574d55[_0x4cb9f9(0x1b2)][0x0]==='..')throw new Error(_0x4cb9f9(0x1a1));let _0x1e0114=0x0;for(const _0xcba25f of _0x574d55[_0x4cb9f9(0x1b2)]){if(_0xcba25f==='..'){if(_0x1e0114===0x0)throw new Error(_0x4cb9f9(0x189));_0x1e0114--;}else _0xcba25f!=='.'&&_0x1e0114++;}}}export function joinPaths(_0x4a886a,_0x13159a){const _0x5eb1a9=a170_0x50f0;if(!_0x4a886a||_0x4a886a==='/')return _0x13159a;if(!_0x13159a||_0x13159a==='.')return _0x4a886a;if(_0x13159a[_0x5eb1a9(0x1b1)]('/'))return _0x13159a;const _0x182064=parsePath(_0x4a886a),_0x40b90c=parsePath(_0x13159a),_0x53ebc4=[..._0x182064[_0x5eb1a9(0x1b2)]];for(const _0x43170b of _0x40b90c[_0x5eb1a9(0x1b2)]){if(_0x43170b==='.')continue;else{if(_0x43170b==='..'){if(_0x53ebc4['length']===0x0)throw new Error(_0x5eb1a9(0x1a3));_0x53ebc4[_0x5eb1a9(0x194)]();}else _0x53ebc4[_0x5eb1a9(0x1ac)](_0x43170b);}}const _0x48b760=_0x53ebc4[_0x5eb1a9(0x1b0)]('/');return _0x182064['raw']['startsWith']('/')?'/'+_0x48b760:_0x48b760;}export function normalizePath(_0x1ceafd){const _0x103a9b=a170_0x50f0,_0x2e29ad=parsePath(_0x1ceafd),_0x533ce1=[];for(const _0x588cba of _0x2e29ad[_0x103a9b(0x1b2)]){if(_0x588cba==='.')continue;else{if(_0x588cba==='..'){if(_0x533ce1[_0x103a9b(0x19c)]===0x0){if(_0x2e29ad[_0x103a9b(0x18d)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x533ce1[_0x103a9b(0x1ac)]('..');}else _0x533ce1[_0x533ce1[_0x103a9b(0x19c)]-0x1]==='..'?_0x533ce1['push']('..'):_0x533ce1[_0x103a9b(0x194)]();}else _0x533ce1['push'](_0x588cba);}}if(_0x533ce1[_0x103a9b(0x19c)]===0x0)return _0x2e29ad[_0x103a9b(0x18d)]?'/':'.';const _0x4de025=_0x533ce1[_0x103a9b(0x1b0)]('/');return _0x2e29ad[_0x103a9b(0x1ad)][_0x103a9b(0x1b1)]('/')?'/'+_0x4de025:_0x4de025;}export function getParentPath(_0x4df2f7){const _0x204948=a170_0x50f0,_0x1ae74c=parsePath(_0x4df2f7);if(_0x1ae74c[_0x204948(0x1b2)][_0x204948(0x19c)]<=0x1)return'/';const _0x29d376=_0x1ae74c[_0x204948(0x1b2)][_0x204948(0x186)](0x0,-0x1)['join']('/');return _0x1ae74c['raw'][_0x204948(0x1b1)]('/')?'/'+_0x29d376:_0x29d376;}export function getBaseName(_0x5122cc){const _0x425a7f=a170_0x50f0,_0x1c4f5c=parsePath(_0x5122cc);return _0x1c4f5c[_0x425a7f(0x1b2)][_0x1c4f5c['segments'][_0x425a7f(0x19c)]-0x1]||'';}export function isChildPath(_0x444f7a,_0x49954e){const _0x2ec323=a170_0x50f0,_0x49b4a1=parsePath(_0x444f7a),_0x3566d8=parsePath(_0x49954e);if(_0x49b4a1['segments'][_0x2ec323(0x19c)]<=_0x3566d8[_0x2ec323(0x1b2)]['length'])return![];for(let _0x2c612d=0x0;_0x2c612d<_0x3566d8[_0x2ec323(0x1b2)]['length'];_0x2c612d++){if(_0x49b4a1[_0x2ec323(0x1b2)][_0x2c612d]!==_0x3566d8[_0x2ec323(0x1b2)][_0x2c612d])return![];}return!![];}export function splitPath(_0x5baad8){const _0x4c73f5=a170_0x50f0,_0x1472ff=parsePath(_0x5baad8);if(_0x1472ff[_0x4c73f5(0x1b2)]['length']===0x0)throw new Error(_0x4c73f5(0x195));if(_0x1472ff[_0x4c73f5(0x1b2)][_0x4c73f5(0x19c)]===0x1)return{'parent':_0x1472ff[_0x4c73f5(0x1b2)][0x0]};return{'parent':_0x1472ff[_0x4c73f5(0x1b2)][0x0],'child':_0x1472ff[_0x4c73f5(0x1b2)][_0x4c73f5(0x186)](0x1)['join']('/')};}export function isYamlFilePath(_0xb5b438){const _0x542ea1=a170_0x50f0;return _0xb5b438['endsWith'](_0x542ea1(0x184))||_0xb5b438[_0x542ea1(0x18b)](_0x542ea1(0x18a));}export async function resolveYamlFilePath(_0x3ef182,_0x5cb670=nodeFileSystem){const _0xa82e93=a170_0x50f0,_0x2f4749=a170_0x4c10e0[_0xa82e93(0x1ab)](_0x3ef182);if(!await _0x5cb670[_0xa82e93(0x1a7)](_0x2f4749))throw new Error(_0xa82e93(0x193)+_0x3ef182);let _0x17bc59=a170_0x4c10e0[_0xa82e93(0x19a)](_0x2f4749),_0x104919=null,_0x8888ab=null;const _0x40385a=a170_0x4c10e0[_0xa82e93(0x1a6)](_0x17bc59)[_0xa82e93(0x1ae)];while(_0x17bc59!==_0x40385a){const _0x597e67=a170_0x4c10e0[_0xa82e93(0x1b0)](_0x17bc59,_0xa82e93(0x199));if(await _0x5cb670['exists'](_0x597e67)){_0x104919=_0x597e67,_0x8888ab=_0x17bc59;break;}_0x17bc59=a170_0x4c10e0[_0xa82e93(0x19a)](_0x17bc59);}if(!_0x104919||!_0x8888ab)throw new Error(_0xa82e93(0x1aa)+_0x3ef182+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x4b9c2f=await _0x5cb670[_0xa82e93(0x1a0)](_0x104919),_0x3e3d05=JSON[_0xa82e93(0x1a6)](_0x4b9c2f),_0x3d802d=_0x3e3d05['parent_segment'];if(!_0x3d802d)throw new Error(_0xa82e93(0x18c));const _0x1946ae=await _0x5cb670[_0xa82e93(0x1a0)](_0x2f4749),_0x38a6ef=a170_0x24916d(_0x1946ae),_0x2b6174=_0x38a6ef[_0xa82e93(0x188)];if(!_0x2b6174)throw new Error(_0xa82e93(0x190)+_0x3ef182);const _0x55a866=isJourneyDef(_0x38a6ef,_0x2f4749)?_0xa82e93(0x19f):_0xa82e93(0x19b),_0x369925=a170_0x4c10e0[_0xa82e93(0x1b3)](_0x8888ab,_0x2f4749),_0x297a59=a170_0x4c10e0['dirname'](_0x369925),_0x44fd8e=_0x297a59==='.'?'':_0x297a59['replace'](/\\/g,'/'),_0x4233ea=_0x44fd8e?_0x3d802d+'/'+_0x44fd8e+'/'+_0x2b6174:_0x3d802d+'/'+_0x2b6174;return{'parentSegment':_0x3d802d,'segmentName':_0x2b6174,'folderPath':_0x44fd8e,'fullPath':_0x4233ea,'resourceType':_0x55a866,'content':_0x1946ae};}
@@ -1 +1 @@
1
- function a162_0x3aef(){const _0x19dea4=['indexOf','2969106UfxyeJ','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring','Invalid\x20segment\x20reference\x20format:\x20','1194021OVZQFb','2373604PpvVPb','5983025BpoXkB','4791564YtNqBS','10887uHXPAe','32eiHRkL','2782503OiPvuY','640HKxXbD'];a162_0x3aef=function(){return _0x19dea4;};return a162_0x3aef();}(function(_0x3015dd,_0x2c07bc){const _0x2ded32=a162_0x58b0,_0xafdd13=_0x3015dd();while(!![]){try{const _0x2f576b=-parseInt(_0x2ded32(0xd4))/0x1+parseInt(_0x2ded32(0xd5))/0x2+parseInt(_0x2ded32(0xd8))/0x3*(-parseInt(_0x2ded32(0xdb))/0x4)+parseInt(_0x2ded32(0xd6))/0x5+-parseInt(_0x2ded32(0xd7))/0x6+-parseInt(_0x2ded32(0xdd))/0x7+-parseInt(_0x2ded32(0xd9))/0x8*(-parseInt(_0x2ded32(0xda))/0x9);if(_0x2f576b===_0x2c07bc)break;else _0xafdd13['push'](_0xafdd13['shift']());}catch(_0x5d99a1){_0xafdd13['push'](_0xafdd13['shift']());}}}(a162_0x3aef,0x98046));function a162_0x58b0(_0x1cb7cf,_0x771aff){_0x1cb7cf=_0x1cb7cf-0xd1;const _0x3aef00=a162_0x3aef();let _0x58b006=_0x3aef00[_0x1cb7cf];return _0x58b006;}export function parseSegmentRef(_0x2ded05){const _0x2fcb34=a162_0x58b0,_0x1808b8=_0x2ded05[_0x2fcb34(0xdc)]('/');if(_0x1808b8===-0x1)return{'parentId':_0x2ded05};if(_0x1808b8===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2ded05+_0x2fcb34(0xd1));const _0x33047a=_0x2ded05[_0x2fcb34(0xd2)](0x0,_0x1808b8),_0x50a1b8=_0x2ded05[_0x2fcb34(0xd2)](_0x1808b8+0x1);if(_0x50a1b8==='')throw new Error(_0x2fcb34(0xd3)+_0x2ded05+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x33047a,'childId':_0x50a1b8};}
1
+ (function(_0x4da345,_0x23e731){const _0x4cee94=a171_0x185f,_0x2b2ec0=_0x4da345();while(!![]){try{const _0x48402a=-parseInt(_0x4cee94(0x162))/0x1+parseInt(_0x4cee94(0x15d))/0x2+-parseInt(_0x4cee94(0x163))/0x3*(-parseInt(_0x4cee94(0x15b))/0x4)+parseInt(_0x4cee94(0x158))/0x5*(parseInt(_0x4cee94(0x165))/0x6)+parseInt(_0x4cee94(0x160))/0x7*(parseInt(_0x4cee94(0x15e))/0x8)+parseInt(_0x4cee94(0x15a))/0x9+parseInt(_0x4cee94(0x159))/0xa*(-parseInt(_0x4cee94(0x15c))/0xb);if(_0x48402a===_0x23e731)break;else _0x2b2ec0['push'](_0x2b2ec0['shift']());}catch(_0x24dffc){_0x2b2ec0['push'](_0x2b2ec0['shift']());}}}(a171_0x1a35,0x6e977));function a171_0x185f(_0x59d820,_0xc3c591){_0x59d820=_0x59d820-0x156;const _0x1a3517=a171_0x1a35();let _0x185f6d=_0x1a3517[_0x59d820];return _0x185f6d;}export function parseSegmentRef(_0x35d4d8){const _0x3b4a92=a171_0x185f,_0x2aec25=_0x35d4d8[_0x3b4a92(0x156)]('/');if(_0x2aec25===-0x1)return{'parentId':_0x35d4d8};if(_0x2aec25===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x35d4d8+_0x3b4a92(0x157));const _0x40a75b=_0x35d4d8[_0x3b4a92(0x15f)](0x0,_0x2aec25),_0x189d16=_0x35d4d8[_0x3b4a92(0x15f)](_0x2aec25+0x1);if(_0x189d16==='')throw new Error(_0x3b4a92(0x164)+_0x35d4d8+_0x3b4a92(0x161));return{'parentId':_0x40a75b,'childId':_0x189d16};}function a171_0x1a35(){const _0x4c9242=['.\x20Child\x20name\x20cannot\x20be\x20empty','795625yYOlXy','3xLrrNQ','Invalid\x20segment\x20reference\x20format:\x20','18HQAuLl','indexOf','.\x20Parent\x20name\x20cannot\x20be\x20empty','135115jtYses','7893560PGiILL','2145150sMFaSE','1314412zYMUEY','11FftXTI','1414306YAzBvS','5462312ZkxrHa','substring','7QzMUov'];a171_0x1a35=function(){return _0x4c9242;};return a171_0x1a35();}