@treasuredata/tdx 0.28.3 → 0.28.4

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 (184) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-utils.js.map +1 -1
  122. package/dist/sdk/segment/journey-validator.js +1 -1
  123. package/dist/sdk/segment/journey-validator.js.map +1 -1
  124. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  125. package/dist/sdk/segment/journey-yaml.js +1 -1
  126. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  127. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  128. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/pull-workflow.js +1 -1
  130. package/dist/sdk/segment/push-recovery.js +1 -1
  131. package/dist/sdk/segment/push-workflow.js +1 -1
  132. package/dist/sdk/segment/resolution-context.js +1 -1
  133. package/dist/sdk/segment/segment-path-parser.js +1 -1
  134. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  135. package/dist/sdk/segment/target-resolution.js +1 -1
  136. package/dist/sdk/segment/tdx-config.js +1 -1
  137. package/dist/sdk/segment/validate-files.js +1 -1
  138. package/dist/sdk/segment/yaml-validator.js +1 -1
  139. package/dist/sdk/segment.js +1 -1
  140. package/dist/sdk/types/index.js +1 -1
  141. package/dist/sdk/types/progress.js +1 -1
  142. package/dist/sdk/user.js +1 -1
  143. package/dist/sdk/util/format-detector.js +1 -1
  144. package/dist/sdk/util/formatters.js +1 -1
  145. package/dist/sdk/util/index.js +1 -1
  146. package/dist/sdk/util/tree-formatter.js +1 -1
  147. package/dist/sdk/workflow/archive-validation.js +1 -1
  148. package/dist/sdk/workflow/clone-workflow.js +1 -1
  149. package/dist/sdk/workflow/index.js +1 -1
  150. package/dist/sdk/workflow/pull-workflow.js +1 -1
  151. package/dist/sdk/workflow/push-workflow.js +1 -1
  152. package/dist/sdk/workflow/tdx-config.js +1 -1
  153. package/dist/sdk/workflow/workflow-utils.js +1 -1
  154. package/dist/test-utils/command-runner.js +1 -1
  155. package/dist/test-utils/factories.js +1 -1
  156. package/dist/test-utils/fixtures.js +1 -1
  157. package/dist/test-utils/http-mock.js +1 -1
  158. package/dist/test-utils/index.js +1 -1
  159. package/dist/utils/async.js +1 -1
  160. package/dist/utils/colors.js +1 -1
  161. package/dist/utils/diff.js +1 -1
  162. package/dist/utils/file-permissions.js +1 -1
  163. package/dist/utils/global-cache.js +1 -1
  164. package/dist/utils/json-loader.js +1 -1
  165. package/dist/utils/local-cache.js +1 -1
  166. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  167. package/dist/utils/logger/formatters/index.js +1 -1
  168. package/dist/utils/logger/handlers/console-handler.js +1 -1
  169. package/dist/utils/logger/handlers/file-handler.js +1 -1
  170. package/dist/utils/logger/handlers/index.js +1 -1
  171. package/dist/utils/logger/handlers/null-handler.js +1 -1
  172. package/dist/utils/logger/index.js +1 -1
  173. package/dist/utils/logger/logger.js +1 -1
  174. package/dist/utils/logger/types.js +1 -1
  175. package/dist/utils/option-validation.js +1 -1
  176. package/dist/utils/process.js +1 -1
  177. package/dist/utils/prompt.js +1 -1
  178. package/dist/utils/spinner.js +1 -1
  179. package/dist/utils/sse-parser.js +1 -1
  180. package/dist/utils/string-utils.js +1 -1
  181. package/dist/utils/table-ref-parser.js +1 -1
  182. package/dist/utils/tdx-logger.js +1 -1
  183. package/dist/utils/version-check.js +1 -1
  184. package/package.json +1 -1
@@ -1 +1 @@
1
- const a122_0x1f799a=a122_0x36e5;(function(_0x168cbb,_0x11c025){const _0xec9793=a122_0x36e5,_0x311a11=_0x168cbb();while(!![]){try{const _0x2345a2=parseInt(_0xec9793(0x175))/0x1*(parseInt(_0xec9793(0x1eb))/0x2)+parseInt(_0xec9793(0x163))/0x3*(-parseInt(_0xec9793(0x196))/0x4)+parseInt(_0xec9793(0x179))/0x5+-parseInt(_0xec9793(0x1bc))/0x6*(-parseInt(_0xec9793(0x1f2))/0x7)+-parseInt(_0xec9793(0x1d5))/0x8+-parseInt(_0xec9793(0x192))/0x9*(-parseInt(_0xec9793(0x157))/0xa)+-parseInt(_0xec9793(0x1c5))/0xb*(parseInt(_0xec9793(0x132))/0xc);if(_0x2345a2===_0x11c025)break;else _0x311a11['push'](_0x311a11['shift']());}catch(_0x47f13f){_0x311a11['push'](_0x311a11['shift']());}}}(a122_0x1e8f,0xebf3c));import*as a122_0x3560f3 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x406023){const _0x350473=a122_0x36e5,_0x5d412c=_0x406023[_0x350473(0x1ea)]();if(_0x5d412c===_0x350473(0x1af)||_0x5d412c===_0x350473(0x172))return _0x350473(0x172);if(_0x5d412c===_0x350473(0x1cc)||_0x5d412c===_0x350473(0x1a0))return _0x350473(0x1a0);return _0x406023;}export function journeyResponseToDefSync(_0x2235cb){const _0x304fca=a122_0x36e5,_0x160c95=_0x2235cb[_0x304fca(0x197)],_0x19e369=_0x160c95[_0x304fca(0x186)]||_0x160c95[_0x304fca(0x16e)],_0x2f6b36={'stages':_0x160c95['journeyStages']['map'](convertApiStageToYaml),'id':_0x2235cb['id']};_0x160c95['name']&&_0x160c95['name']!==_0x19e369&&(_0x2f6b36[_0x304fca(0x1fa)]=_0x160c95['name']);_0x160c95[_0x304fca(0x1b3)]!==undefined&&(_0x2f6b36[_0x304fca(0x1bf)]=_0x160c95['versionNumber']);_0x160c95[_0x304fca(0x190)]&&(_0x2f6b36[_0x304fca(0x190)]=_0x160c95['state']===_0x304fca(0x15e)?_0x304fca(0x15e):'draft');const _0x291a71={'type':_0x304fca(0x1e9),'name':_0x19e369,'journeys':[_0x2f6b36]};_0x160c95['description']&&(_0x291a71[_0x304fca(0x12f)]=_0x160c95[_0x304fca(0x12f)]);_0x160c95[_0x304fca(0x168)]&&(_0x291a71[_0x304fca(0x168)]=convertApiCriteriaToYaml(_0x160c95['goal']));if(_0x160c95[_0x304fca(0x1ec)])_0x291a71['reentry']=_0x160c95[_0x304fca(0x1ec)];else _0x160c95[_0x304fca(0x171)]!==undefined&&(_0x291a71[_0x304fca(0x1c7)]=_0x160c95[_0x304fca(0x171)]?_0x304fca(0x17f):_0x304fca(0x19e));return _0x160c95['journeyBundleId']&&(_0x291a71[_0x304fca(0x148)]=_0x160c95[_0x304fca(0x150)]),_0x160c95[_0x304fca(0x186)]&&(_0x291a71[_0x304fca(0x1aa)]=_0x160c95[_0x304fca(0x186)]),_0x2235cb['relationships']?.[_0x304fca(0x1de)]?.[_0x304fca(0x1ab)]?.['id']&&(_0x291a71[_0x304fca(0x154)]=_0x2235cb[_0x304fca(0x1a2)][_0x304fca(0x1de)]['data']['id']),_0x291a71;}export async function journeyResponseToDef(_0x4638c7,_0x5ad911){const _0x5d2b59=a122_0x36e5,_0x4b8619=journeyResponseToDefSync(_0x4638c7);if(!_0x5ad911)return _0x4b8619;const _0x490db3=new Set();collectSegmentIdsFromJourney(_0x4b8619,_0x490db3);const _0x1cfec2=new Set();collectActivationIdsFromJourney(_0x4b8619,_0x1cfec2);const _0x19a68e={},_0x3fce44=new Map();for(const _0x3300af of Array[_0x5d2b59(0x195)](_0x490db3)['sort']()){if(_0x5ad911[_0x5d2b59(0x1f6)]){const _0x17aef9=await _0x5ad911[_0x5d2b59(0x1f6)](_0x3300af);if(_0x17aef9[_0x5d2b59(0x159)]){_0x3fce44[_0x5d2b59(0x1d1)](_0x3300af,_0x17aef9['name']);if(_0x17aef9[_0x5d2b59(0x1e4)]){const _0x374fd0={..._0x17aef9['definition'],'rule':deepSortObject(_0x17aef9['definition'][_0x5d2b59(0x1a5)])};_0x19a68e[_0x17aef9[_0x5d2b59(0x16e)]]=_0x374fd0;}}else _0x3fce44[_0x5d2b59(0x1d1)](_0x3300af,makeSegmentRef(_0x17aef9[_0x5d2b59(0x16e)]));}else{if(_0x5ad911[_0x5d2b59(0x1d2)]){const _0xd11d4d=await _0x5ad911[_0x5d2b59(0x1d2)](_0x3300af);_0x3fce44['set'](_0x3300af,_0xd11d4d);}}}const _0x2eddee={},_0x5129ee=new Map();for(const _0x354194 of Array[_0x5d2b59(0x195)](_0x1cfec2)[_0x5d2b59(0x1c4)]()){if(_0x5ad911['resolveActivation']){const _0x26b19f=await _0x5ad911['resolveActivation'](_0x354194);_0x26b19f[_0x5d2b59(0x159)]?(_0x5129ee['set'](_0x354194,_0x26b19f[_0x5d2b59(0x16e)]),_0x26b19f[_0x5d2b59(0x1e4)]&&(_0x2eddee[_0x26b19f[_0x5d2b59(0x16e)]]=_0x26b19f[_0x5d2b59(0x1e4)])):_0x5129ee[_0x5d2b59(0x1d1)](_0x354194,makeSegmentRef(_0x26b19f[_0x5d2b59(0x16e)]));}else{if(_0x5ad911['resolveActivationName']){const _0x47cab6=await _0x5ad911[_0x5d2b59(0x1be)](_0x354194);_0x5129ee[_0x5d2b59(0x1d1)](_0x354194,_0x47cab6);}}}_0x3fce44['size']>0x0&&replaceSegmentIdsInJourney(_0x4b8619,_0x3fce44);_0x5129ee[_0x5d2b59(0x158)]>0x0&&replaceActivationIdsInJourney(_0x4b8619,_0x5129ee);if(_0x5ad911['resolveJumpTarget']){const _0x434697=[];collectJumpTargetsFromJourney(_0x4b8619,_0x434697);if(_0x434697['length']>0x0){const _0x2f9b03=new Map();for(const _0x442c9f of _0x434697){try{const _0x28b44c=await _0x5ad911[_0x5d2b59(0x17b)](_0x442c9f[_0x5d2b59(0x14e)],_0x442c9f[_0x5d2b59(0x188)]);_0x2f9b03['set'](_0x442c9f['journeyId']+':'+_0x442c9f['stageId'],_0x28b44c);}catch{}}_0x2f9b03[_0x5d2b59(0x158)]>0x0&&replaceJumpTargetsInJourney(_0x4b8619,_0x2f9b03);}}return Object[_0x5d2b59(0x164)](_0x19a68e)[_0x5d2b59(0x1d9)]>0x0&&(_0x4b8619['segments']=_0x19a68e),Object[_0x5d2b59(0x164)](_0x2eddee)[_0x5d2b59(0x1d9)]>0x0&&(_0x4b8619[_0x5d2b59(0x12c)]=_0x2eddee),_0x4b8619;}function collectSegmentIdsFromJourney(_0x44b0fe,_0x3ddcbf){const _0x289b71=a122_0x36e5;_0x44b0fe[_0x289b71(0x168)]?.[_0x289b71(0x19c)]&&_0x3ddcbf[_0x289b71(0x1df)](_0x44b0fe[_0x289b71(0x168)][_0x289b71(0x19c)]);const _0x297c4c=_0x548c17=>{const _0x248829=_0x289b71;for(const _0x21164c of _0x548c17){_0x21164c[_0x248829(0x143)]?.[_0x248829(0x19c)]&&_0x3ddcbf['add'](_0x21164c[_0x248829(0x143)][_0x248829(0x19c)]);if(_0x21164c[_0x248829(0x166)])for(const _0x280a05 of _0x21164c[_0x248829(0x166)]){_0x280a05[_0x248829(0x19c)]&&_0x3ddcbf[_0x248829(0x1df)](_0x280a05[_0x248829(0x19c)]);}_0x21164c[_0x248829(0x18c)]?.[_0x248829(0x19c)]&&_0x3ddcbf[_0x248829(0x1df)](_0x21164c[_0x248829(0x18c)][_0x248829(0x19c)]);if(_0x21164c[_0x248829(0x1a7)])for(const _0x593bd8 of _0x21164c[_0x248829(0x1a7)]){if(_0x593bd8[_0x248829(0x145)]==='decision_point'){const _0x37595c=_0x593bd8;for(const _0x3e73f1 of _0x37595c[_0x248829(0x1b8)][_0x248829(0x12d)]){_0x3e73f1['segment']&&_0x3ddcbf[_0x248829(0x1df)](_0x3e73f1[_0x248829(0x19c)]);}}else{if(_0x593bd8[_0x248829(0x145)]===_0x248829(0x13b)){const _0x46a958=_0x593bd8;_0x46a958['with'][_0x248829(0x1cb)]?.['segment']&&_0x3ddcbf['add'](_0x46a958['with']['condition'][_0x248829(0x19c)]);}}}}};if(_0x44b0fe['journeys'])for(const _0x36fb9c of _0x44b0fe[_0x289b71(0x1b2)]){_0x36fb9c[_0x289b71(0x168)]?.[_0x289b71(0x19c)]&&_0x3ddcbf[_0x289b71(0x1df)](_0x36fb9c['goal'][_0x289b71(0x19c)]),_0x297c4c(_0x36fb9c[_0x289b71(0x17a)]);}_0x44b0fe[_0x289b71(0x17a)]&&_0x297c4c(_0x44b0fe[_0x289b71(0x17a)]);if(_0x44b0fe[_0x289b71(0x1b6)])for(const _0x531432 of _0x44b0fe[_0x289b71(0x1b6)]){_0x297c4c(_0x531432[_0x289b71(0x17a)]);}}function replaceSegmentIdsInJourney(_0x3a3aad,_0x2c2664){const _0xc9cffd=a122_0x36e5,_0x48680f=_0x426159=>_0x2c2664[_0xc9cffd(0x1f8)](_0x426159)||_0x426159;_0x3a3aad[_0xc9cffd(0x168)]?.[_0xc9cffd(0x19c)]&&(_0x3a3aad[_0xc9cffd(0x168)]['segment']=_0x48680f(_0x3a3aad[_0xc9cffd(0x168)][_0xc9cffd(0x19c)]));const _0x561ba6=_0x4134b2=>{const _0x291ebd=_0xc9cffd;for(const _0x250e0d of _0x4134b2){_0x250e0d[_0x291ebd(0x143)]?.[_0x291ebd(0x19c)]&&(_0x250e0d['entry_criteria']['segment']=_0x48680f(_0x250e0d[_0x291ebd(0x143)]['segment']));if(_0x250e0d[_0x291ebd(0x166)])for(const _0x476fe8 of _0x250e0d[_0x291ebd(0x166)]){_0x476fe8[_0x291ebd(0x19c)]&&(_0x476fe8['segment']=_0x48680f(_0x476fe8[_0x291ebd(0x19c)]));}_0x250e0d[_0x291ebd(0x18c)]?.[_0x291ebd(0x19c)]&&(_0x250e0d[_0x291ebd(0x18c)][_0x291ebd(0x19c)]=_0x48680f(_0x250e0d[_0x291ebd(0x18c)]['segment']));if(_0x250e0d[_0x291ebd(0x1a7)])for(const _0x506c8e of _0x250e0d[_0x291ebd(0x1a7)]){if(_0x506c8e[_0x291ebd(0x145)]===_0x291ebd(0x1ed)){const _0x289766=_0x506c8e;for(const _0x42a9bf of _0x289766['with'][_0x291ebd(0x12d)]){_0x42a9bf[_0x291ebd(0x19c)]&&(_0x42a9bf[_0x291ebd(0x19c)]=_0x48680f(_0x42a9bf[_0x291ebd(0x19c)]));}}else{if(_0x506c8e[_0x291ebd(0x145)]===_0x291ebd(0x13b)){const _0x449dc6=_0x506c8e;_0x449dc6[_0x291ebd(0x1b8)][_0x291ebd(0x1cb)]?.[_0x291ebd(0x19c)]&&(_0x449dc6[_0x291ebd(0x1b8)][_0x291ebd(0x1cb)][_0x291ebd(0x19c)]=_0x48680f(_0x449dc6['with'][_0x291ebd(0x1cb)]['segment']));}}}}};if(_0x3a3aad['journeys'])for(const _0x43f718 of _0x3a3aad[_0xc9cffd(0x1b2)]){_0x43f718[_0xc9cffd(0x168)]?.[_0xc9cffd(0x19c)]&&(_0x43f718['goal'][_0xc9cffd(0x19c)]=_0x48680f(_0x43f718['goal'][_0xc9cffd(0x19c)])),_0x561ba6(_0x43f718[_0xc9cffd(0x17a)]);}_0x3a3aad[_0xc9cffd(0x17a)]&&_0x561ba6(_0x3a3aad['stages']);if(_0x3a3aad[_0xc9cffd(0x1b6)])for(const _0x3c763b of _0x3a3aad[_0xc9cffd(0x1b6)]){_0x561ba6(_0x3c763b['stages']);}}function collectActivationIdsFromJourney(_0x25cef7,_0x1a2f62){const _0x5359b7=a122_0x36e5,_0x1eaf9d=_0xa97f4e=>{const _0x2d205e=a122_0x36e5;for(const _0x1092e8 of _0xa97f4e){if(_0x1092e8[_0x2d205e(0x1a7)])for(const _0x448e31 of _0x1092e8[_0x2d205e(0x1a7)]){if(_0x448e31[_0x2d205e(0x145)]===_0x2d205e(0x169)){const _0x6ae36=_0x448e31;_0x6ae36['with'][_0x2d205e(0x169)]&&/^\d+$/[_0x2d205e(0x153)](_0x6ae36[_0x2d205e(0x1b8)]['activation'])&&_0x1a2f62['add'](_0x6ae36['with'][_0x2d205e(0x169)]);}}}};if(_0x25cef7[_0x5359b7(0x1b2)])for(const _0x47c68d of _0x25cef7[_0x5359b7(0x1b2)]){_0x1eaf9d(_0x47c68d[_0x5359b7(0x17a)]);}_0x25cef7[_0x5359b7(0x17a)]&&_0x1eaf9d(_0x25cef7[_0x5359b7(0x17a)]);if(_0x25cef7[_0x5359b7(0x1b6)])for(const _0x367699 of _0x25cef7[_0x5359b7(0x1b6)]){_0x1eaf9d(_0x367699[_0x5359b7(0x17a)]);}}function replaceActivationIdsInJourney(_0x311524,_0x13253a){const _0x3b584e=a122_0x36e5,_0x5a066f=_0x23c477=>_0x13253a[_0x3b584e(0x1f8)](_0x23c477)||_0x23c477,_0x47c649=_0xaa1d79=>{const _0x456d1d=_0x3b584e;for(const _0x256f86 of _0xaa1d79){if(_0x256f86[_0x456d1d(0x1a7)])for(const _0x3eaffa of _0x256f86[_0x456d1d(0x1a7)]){if(_0x3eaffa[_0x456d1d(0x145)]===_0x456d1d(0x169)){const _0x1d90c8=_0x3eaffa;_0x1d90c8['with'][_0x456d1d(0x169)]&&(_0x1d90c8['with'][_0x456d1d(0x169)]=_0x5a066f(_0x1d90c8['with'][_0x456d1d(0x169)]));}}}};if(_0x311524['journeys'])for(const _0x2db2bc of _0x311524[_0x3b584e(0x1b2)]){_0x47c649(_0x2db2bc['stages']);}_0x311524[_0x3b584e(0x17a)]&&_0x47c649(_0x311524[_0x3b584e(0x17a)]);if(_0x311524[_0x3b584e(0x1b6)])for(const _0x4dbf52 of _0x311524['versions']){_0x47c649(_0x4dbf52[_0x3b584e(0x17a)]);}}function collectJumpTargetsFromJourney(_0x539a97,_0x29fdff){const _0x2abbb1=a122_0x36e5,_0x4865bb=new Set(),_0x17b5a0=_0x1ba4f1=>{const _0x2236ef=a122_0x36e5;for(const _0x1aeba5 of _0x1ba4f1){if(_0x1aeba5[_0x2236ef(0x1a7)])for(const _0x4fcfbf of _0x1aeba5['steps']){if(_0x4fcfbf[_0x2236ef(0x145)]===_0x2236ef(0x13a)){const _0x2724cc=_0x4fcfbf,_0x29c69a=_0x2724cc['with'][_0x2236ef(0x191)];if(_0x29c69a[_0x2236ef(0x1e9)]&&_0x29c69a[_0x2236ef(0x141)]&&/^\d+$/[_0x2236ef(0x153)](_0x29c69a[_0x2236ef(0x1e9)])&&/^\d+$/[_0x2236ef(0x153)](_0x29c69a['stage'])){const _0x1dff1f=_0x29c69a[_0x2236ef(0x1e9)]+':'+_0x29c69a[_0x2236ef(0x141)];!_0x4865bb[_0x2236ef(0x167)](_0x1dff1f)&&(_0x4865bb['add'](_0x1dff1f),_0x29fdff['push']({'journeyId':_0x29c69a[_0x2236ef(0x1e9)],'stageId':_0x29c69a[_0x2236ef(0x141)]}));}}}}};if(_0x539a97['journeys'])for(const _0x200bd9 of _0x539a97['journeys']){_0x17b5a0(_0x200bd9['stages']);}_0x539a97[_0x2abbb1(0x17a)]&&_0x17b5a0(_0x539a97[_0x2abbb1(0x17a)]);if(_0x539a97['versions'])for(const _0x2d4541 of _0x539a97['versions']){_0x17b5a0(_0x2d4541['stages']);}}function replaceJumpTargetsInJourney(_0x12623b,_0x1a4e99){const _0x3fec5f=a122_0x36e5,_0x3f61f3=_0x379a2b=>{const _0x54a4b8=a122_0x36e5;for(const _0x240c39 of _0x379a2b){if(_0x240c39[_0x54a4b8(0x1a7)])for(const _0x4be0ad of _0x240c39[_0x54a4b8(0x1a7)]){if(_0x4be0ad[_0x54a4b8(0x145)]===_0x54a4b8(0x13a)){const _0x1b8dcd=_0x4be0ad,_0x3777f9=_0x1b8dcd[_0x54a4b8(0x1b8)][_0x54a4b8(0x191)],_0x1c94b1=_0x3777f9[_0x54a4b8(0x1e9)]+':'+_0x3777f9['stage'],_0x370ead=_0x1a4e99[_0x54a4b8(0x1f8)](_0x1c94b1);_0x370ead&&(_0x3777f9[_0x54a4b8(0x1e9)]=_0x370ead[_0x54a4b8(0x1e5)],_0x3777f9['stage']=_0x370ead['stageName']);}}}};if(_0x12623b[_0x3fec5f(0x1b2)])for(const _0xb923fe of _0x12623b['journeys']){_0x3f61f3(_0xb923fe['stages']);}_0x12623b[_0x3fec5f(0x17a)]&&_0x3f61f3(_0x12623b[_0x3fec5f(0x17a)]);if(_0x12623b['versions'])for(const _0xbfca4b of _0x12623b[_0x3fec5f(0x1b6)]){_0x3f61f3(_0xbfca4b[_0x3fec5f(0x17a)]);}}function generateReadableStepName(_0x5c3e8c,_0x5b1e82){const _0x38bcde=a122_0x36e5;if(_0x5c3e8c[_0x38bcde(0x16e)]&&_0x5c3e8c[_0x38bcde(0x16e)]!==_0x5c3e8c[_0x38bcde(0x145)]){const _0x5b3833=_0x5c3e8c[_0x38bcde(0x16e)]['trim']();if(_0x5b3833&&/[a-z0-9]/i['test'](_0x5b3833))return _0x5b3833;}const _0x1cf593=_0x5c3e8c['type'][_0x38bcde(0x1ea)]()[_0x38bcde(0x140)](/step$/i,'');return _0x1cf593+'_'+(_0x5b1e82+0x1);}function getStepNextRefs(_0x2050d5){const _0x550898=a122_0x36e5,_0x9f7c28=[];if(_0x2050d5[_0x550898(0x142)])_0x9f7c28['push'](_0x2050d5['next']);if(_0x2050d5['branches'])for(const _0x1b712a of _0x2050d5[_0x550898(0x12d)]){if(_0x1b712a[_0x550898(0x142)])_0x9f7c28[_0x550898(0x1b4)](_0x1b712a[_0x550898(0x142)]);}if(_0x2050d5[_0x550898(0x14f)])for(const _0xdd42ad of _0x2050d5[_0x550898(0x14f)]){if(_0xdd42ad[_0x550898(0x142)])_0x9f7c28[_0x550898(0x1b4)](_0xdd42ad['next']);}if(_0x2050d5[_0x550898(0x1fb)])for(const _0x44b02c of _0x2050d5['conditions']){if(_0x44b02c[_0x550898(0x142)])_0x9f7c28[_0x550898(0x1b4)](_0x44b02c[_0x550898(0x142)]);}return _0x9f7c28;}function parseJumpTargetDisplayName(_0x3a8ff7){const _0x3f4e4e=a122_0x36e5,_0x3330f2=_0x3a8ff7['match'](/^(.+?)\s*\(([^/)]+)/);if(!_0x3330f2)return undefined;const _0x435ec7=_0x3330f2[0x1][_0x3f4e4e(0x193)](),_0x423eac=_0x3330f2[0x2][_0x3f4e4e(0x193)]();if(!_0x435ec7||!_0x423eac)return undefined;return{'stageName':_0x435ec7,'journeyName':_0x423eac};}function orderStepsFromRoot(_0x592601,_0xfbc9d6){const _0x492a5b=a122_0x36e5,_0x46d3b1=Object[_0x492a5b(0x184)](_0x592601);if(_0x46d3b1[_0x492a5b(0x1d9)]===0x0)return[];const _0x51443f=new Set(_0x46d3b1['map'](([_0x4b539])=>_0x4b539)),_0x38aa7c=new Set();for(const [,_0x7b7aef]of _0x46d3b1){for(const _0x22e995 of getStepNextRefs(_0x7b7aef)){if(_0x51443f[_0x492a5b(0x167)](_0x22e995))_0x38aa7c[_0x492a5b(0x1df)](_0x22e995);}}let _0x469585=_0xfbc9d6&&_0x51443f['has'](_0xfbc9d6)?_0xfbc9d6:undefined;if(!_0x469585){const _0x45cc67=_0x46d3b1[_0x492a5b(0x1cd)](([_0x35f353])=>!_0x38aa7c[_0x492a5b(0x167)](_0x35f353));_0x45cc67['length']>0x0?_0x469585=_0x45cc67[0x0][0x0]:_0x469585=_0x46d3b1[0x0][0x0];}const _0x1f23b8=[],_0x2e331a=new Set(),_0x5626c6=[_0x469585];while(_0x5626c6[_0x492a5b(0x1d9)]>0x0){const _0x39202d=_0x5626c6[_0x492a5b(0x19d)]();if(_0x2e331a['has'](_0x39202d))continue;_0x2e331a['add'](_0x39202d);const _0x421fde=_0x592601[_0x39202d];if(!_0x421fde)continue;_0x1f23b8[_0x492a5b(0x1b4)]({'uuid':_0x39202d,'step':_0x421fde});for(const _0x36f217 of getStepNextRefs(_0x421fde)){_0x51443f[_0x492a5b(0x167)](_0x36f217)&&!_0x2e331a[_0x492a5b(0x167)](_0x36f217)&&_0x5626c6[_0x492a5b(0x1b4)](_0x36f217);}}for(const [_0x4662b5,_0x12d186]of _0x46d3b1){!_0x2e331a['has'](_0x4662b5)&&_0x1f23b8[_0x492a5b(0x1b4)]({'uuid':_0x4662b5,'step':_0x12d186});}return _0x1f23b8;}function resolveStepReferences(_0xe5cfd5,_0x29fb75,_0x497388,_0x561d14){const _0x7cdf92=a122_0x36e5;if(_0xe5cfd5[_0x7cdf92(0x145)]!==_0x7cdf92(0x146)){_0xe5cfd5[_0x7cdf92(0x142)]&&_0x561d14[_0x7cdf92(0x167)](_0xe5cfd5['next'])&&(_0xe5cfd5[_0x7cdf92(0x142)]=_0x561d14['get'](_0xe5cfd5['next']));const _0x3d540a=_0x29fb75+0x1;if(_0x3d540a<_0x497388[_0x7cdf92(0x1d9)]){const _0x2746d7=_0x561d14[_0x7cdf92(0x1f8)](_0x497388[_0x3d540a][_0x7cdf92(0x155)]);_0xe5cfd5[_0x7cdf92(0x142)]===_0x2746d7&&delete _0xe5cfd5['next'];}}if(_0xe5cfd5['type']===_0x7cdf92(0x1ed))for(const _0x2da73e of _0xe5cfd5[_0x7cdf92(0x1b8)][_0x7cdf92(0x12d)]){_0x2da73e[_0x7cdf92(0x142)]&&_0x561d14[_0x7cdf92(0x167)](_0x2da73e[_0x7cdf92(0x142)])&&(_0x2da73e[_0x7cdf92(0x142)]=_0x561d14['get'](_0x2da73e[_0x7cdf92(0x142)]));}if(_0xe5cfd5['type']==='ab_test')for(const _0x47408a of _0xe5cfd5['with'][_0x7cdf92(0x14f)]){_0x47408a['next']&&_0x561d14[_0x7cdf92(0x167)](_0x47408a[_0x7cdf92(0x142)])&&(_0x47408a['next']=_0x561d14[_0x7cdf92(0x1f8)](_0x47408a[_0x7cdf92(0x142)]));}if(_0xe5cfd5[_0x7cdf92(0x145)]==='wait'&&_0xe5cfd5['with'][_0x7cdf92(0x1cb)]){const _0x3c4d68=_0xe5cfd5[_0x7cdf92(0x1b8)]['condition'];_0x3c4d68[_0x7cdf92(0x142)]&&_0x561d14[_0x7cdf92(0x167)](_0x3c4d68['next'])&&(_0x3c4d68['next']=_0x561d14[_0x7cdf92(0x1f8)](_0x3c4d68[_0x7cdf92(0x142)])),_0x3c4d68[_0x7cdf92(0x13c)]?.[_0x7cdf92(0x142)]&&_0x561d14[_0x7cdf92(0x167)](_0x3c4d68[_0x7cdf92(0x13c)][_0x7cdf92(0x142)])&&(_0x3c4d68[_0x7cdf92(0x13c)][_0x7cdf92(0x142)]=_0x561d14[_0x7cdf92(0x1f8)](_0x3c4d68[_0x7cdf92(0x13c)]['next']));}}function convertApiStageToYaml(_0x36c5ee){const _0x109755=a122_0x36e5,_0x31f4a2={'name':_0x36c5ee['name']};_0x36c5ee['id']&&(_0x31f4a2['id']=_0x36c5ee['id']);_0x36c5ee[_0x109755(0x12f)]&&(_0x31f4a2['description']=_0x36c5ee[_0x109755(0x12f)]);_0x36c5ee[_0x109755(0x1f7)]&&(_0x31f4a2['entry_criteria']=convertApiCriteriaToYaml(_0x36c5ee['entryCriteria']));_0x36c5ee[_0x109755(0x1d7)]&&_0x36c5ee[_0x109755(0x1d7)][_0x109755(0x1d9)]>0x0&&(_0x31f4a2[_0x109755(0x166)]=_0x36c5ee[_0x109755(0x1d7)][_0x109755(0x16a)](convertApiCriteriaToYaml));_0x36c5ee[_0x109755(0x18c)]&&(_0x31f4a2[_0x109755(0x18c)]=convertApiCriteriaToYaml(_0x36c5ee['milestone']));if(_0x36c5ee[_0x109755(0x1a7)]&&Object['keys'](_0x36c5ee[_0x109755(0x1a7)])[_0x109755(0x1d9)]>0x0){const _0x1e1efb=orderStepsFromRoot(_0x36c5ee['steps'],_0x36c5ee['rootStep']),_0x5a0d36=new Map(),_0x55c7ce=new Set();for(let _0x5ea4c7=0x0;_0x5ea4c7<_0x1e1efb[_0x109755(0x1d9)];_0x5ea4c7++){const {uuid:_0x1ed114,step:_0x5e0c74}=_0x1e1efb[_0x5ea4c7];let _0xd15693=generateReadableStepName(_0x5e0c74,_0x5ea4c7),_0x44e09a=_0xd15693,_0x548adb=0x2;while(_0x55c7ce['has'](_0x44e09a)){_0x44e09a=_0xd15693+'_'+_0x548adb,_0x548adb++;}_0x55c7ce[_0x109755(0x1df)](_0x44e09a),_0x5a0d36[_0x109755(0x1d1)](_0x1ed114,_0x44e09a);}_0x31f4a2[_0x109755(0x1a7)]=_0x1e1efb[_0x109755(0x16a)](({uuid:_0x1752e7,step:_0x4109e2},_0x2613cc)=>{const _0x270ca6=_0x109755,_0x281ca4=convertApiStepToYaml(_0x4109e2,_0x5a0d36[_0x270ca6(0x1f8)](_0x1752e7));return resolveStepReferences(_0x281ca4,_0x2613cc,_0x1e1efb,_0x5a0d36),_0x281ca4;});}return _0x31f4a2;}function convertApiCriteriaToYaml(_0x264b1a){const _0x180684=a122_0x36e5,_0x195645={'name':_0x264b1a['name'],'segment':_0x264b1a['segmentId']};_0x264b1a[_0x180684(0x12f)]&&(_0x195645[_0x180684(0x12f)]=_0x264b1a['description']);if(_0x264b1a[_0x180684(0x191)]){let _0x58988c=_0x264b1a[_0x180684(0x191)][_0x180684(0x14e)],_0x2fe61a=_0x264b1a[_0x180684(0x191)][_0x180684(0x18a)];if(_0x264b1a[_0x180684(0x191)][_0x180684(0x1e5)]){const _0x1aff59=parseJumpTargetDisplayName(_0x264b1a['target'][_0x180684(0x1e5)]);_0x1aff59&&(_0x2fe61a=_0x1aff59['stageName'],_0x58988c=_0x1aff59[_0x180684(0x1e5)]);}_0x195645['target']={'journey':_0x58988c,'stage':_0x2fe61a},_0x264b1a[_0x180684(0x191)][_0x180684(0x150)]&&(_0x195645[_0x180684(0x191)][_0x180684(0x148)]=_0x264b1a['target']['journeyBundleId']);}return _0x195645;}function convertApiStepToYaml(_0x5d3216,_0x4bbb5d){const _0x466913=a122_0x36e5;switch(_0x5d3216[_0x466913(0x145)]){case _0x466913(0x13d):{const _0x5dacd2={};if(_0x5d3216['waitStepType']===_0x466913(0x1c6)&&_0x5d3216[_0x466913(0x13e)]!==undefined)_0x5dacd2[_0x466913(0x14b)]=_0x5d3216[_0x466913(0x13e)],_0x5dacd2[_0x466913(0x17d)]=_0x5d3216[_0x466913(0x165)];else{if(_0x5d3216[_0x466913(0x19a)]===_0x466913(0x1ba)&&_0x5d3216[_0x466913(0x161)])_0x5dacd2[_0x466913(0x1b0)]=_0x5d3216[_0x466913(0x161)];else{if(_0x5d3216['waitStepType']===_0x466913(0x19f)&&_0x5d3216['daysOfWeek'])_0x5dacd2['days_of_week']=_0x5d3216[_0x466913(0x1e0)];else{if(_0x5d3216[_0x466913(0x19a)]==='Condition'){if(_0x5d3216[_0x466913(0x1fb)]&&_0x5d3216[_0x466913(0x1fb)]['length']>0x0){const _0x34d2bf=_0x5d3216[_0x466913(0x1fb)][_0x466913(0x147)](_0x61ed89=>!_0x61ed89['timedOutPath']),_0x1293a3=_0x5d3216[_0x466913(0x1fb)][_0x466913(0x147)](_0x591e41=>_0x591e41['timedOutPath']);_0x34d2bf?.[_0x466913(0x1dc)]&&(_0x5dacd2['condition']={'segment':_0x34d2bf['segmentId'],..._0x34d2bf['next']?{'next':_0x34d2bf[_0x466913(0x142)]}:{}},_0x1293a3&&_0x1293a3[_0x466913(0x1ce)]!==undefined&&_0x1293a3[_0x466913(0x17d)]&&(_0x5dacd2[_0x466913(0x1cb)][_0x466913(0x13c)]={'duration':_0x1293a3[_0x466913(0x1ce)],'unit':_0x1293a3[_0x466913(0x17d)],..._0x1293a3['next']?{'next':_0x1293a3[_0x466913(0x142)]}:{}}));}else _0x5d3216[_0x466913(0x14c)]&&(_0x5dacd2['condition']={'segment':_0x5d3216['conditionSegmentId']},_0x5d3216[_0x466913(0x135)]!==undefined&&_0x5d3216[_0x466913(0x182)]&&(_0x5dacd2['condition'][_0x466913(0x13c)]={'duration':_0x5d3216[_0x466913(0x135)],'unit':_0x5d3216[_0x466913(0x182)]}));}}}}const _0x380302={'type':_0x466913(0x13b),'name':_0x4bbb5d,..._0x5d3216['next']?{'next':_0x5d3216[_0x466913(0x142)]}:{},'with':_0x5dacd2};return _0x380302;}case _0x466913(0x1db):{const _0x206020={'type':_0x466913(0x169),'name':_0x4bbb5d,..._0x5d3216[_0x466913(0x142)]?{'next':_0x5d3216[_0x466913(0x142)]}:{},'with':{'activation':_0x5d3216['journeyActivationStepId']||''}};return _0x206020;}case _0x466913(0x1ae):{const _0x309fe1={'type':'decision_point','name':_0x4bbb5d,..._0x5d3216[_0x466913(0x142)]?{'next':_0x5d3216['next']}:{},'with':{'branches':(_0x5d3216['branches']||[])[_0x466913(0x16a)](_0x31c74b=>({'name':_0x31c74b[_0x466913(0x16e)],'segment':_0x31c74b[_0x466913(0x1dc)],'excluded':_0x31c74b['excludedPath'],..._0x31c74b['next']?{'next':_0x31c74b[_0x466913(0x142)]}:{}}))}};return _0x309fe1;}case _0x466913(0x187):case'AbTest':case _0x466913(0x1b7):{const _0xe33b1=_0x5d3216[_0x466913(0x14f)]||(_0x5d3216[_0x466913(0x12d)]||[])[_0x466913(0x16a)](_0x11886e=>({'name':_0x11886e[_0x466913(0x16e)],'percentage':0x0,'next':_0x11886e[_0x466913(0x142)]})),_0x4089fd={'type':_0x466913(0x16b),'name':_0x4bbb5d,..._0x5d3216[_0x466913(0x142)]?{'next':_0x5d3216['next']}:{},'with':{'customized_split':_0x5d3216[_0x466913(0x162)],'unique_id':_0x5d3216['uniqueId'],'variants':_0xe33b1[_0x466913(0x16a)](_0x2b66a4=>({'name':_0x2b66a4[_0x466913(0x16e)],'percentage':_0x2b66a4['percentage'],..._0x2b66a4[_0x466913(0x142)]?{'next':_0x2b66a4[_0x466913(0x142)]}:{}}))}};return _0x4089fd;}case _0x466913(0x149):{const _0x476552={'type':_0x466913(0x1c1),'name':_0x4bbb5d,..._0x5d3216['next']?{'next':_0x5d3216[_0x466913(0x142)]}:{}};return _0x476552;}case'Jump':{let _0x34d157='',_0x34338d='',_0x5a7f01;if(_0x5d3216[_0x466913(0x191)]){_0x34d157=_0x5d3216[_0x466913(0x191)]['journeyId'],_0x34338d=_0x5d3216['target'][_0x466913(0x18a)],_0x5a7f01=_0x5d3216[_0x466913(0x191)][_0x466913(0x150)];if(_0x5d3216[_0x466913(0x191)]['journeyName']){const _0x179963=parseJumpTargetDisplayName(_0x5d3216[_0x466913(0x191)]['journeyName']);_0x179963&&(_0x34338d=_0x179963[_0x466913(0x15b)],_0x34d157=_0x179963[_0x466913(0x1e5)]);}}const _0x416e1b={'type':_0x466913(0x13a),'name':_0x4bbb5d,..._0x5d3216[_0x466913(0x142)]?{'next':_0x5d3216[_0x466913(0x142)]}:{},'with':{'target':{'journey':_0x34d157,'stage':_0x34338d,..._0x5a7f01?{'bundle_id':_0x5a7f01}:{}}}};return _0x416e1b;}case _0x466913(0x12b):{const _0x562749={'type':'end','name':_0x4bbb5d};return _0x562749;}default:{const _0x1b4c50={'type':_0x466913(0x146),'name':_0x4bbb5d};return _0x1b4c50;}}}export async function journeyDefToRequest(_0x53e9e7,_0x123c9b,_0xd6550f){const _0x2e07c8=a122_0x36e5,_0x44b893=_0x53e9e7[_0x2e07c8(0x17a)]||getActiveStages(_0x53e9e7),_0x180c3f=isJourneysArrayMode(_0x53e9e7)||isMultiVersionMode(_0x53e9e7)?getLatestJourneyEntry(_0x53e9e7):undefined,_0x383725=_0x180c3f?.[_0x2e07c8(0x1fa)]??_0x53e9e7[_0x2e07c8(0x16e)],_0x2848c6=_0x53e9e7['segments']||{},_0x325e52=_0x53e9e7['activations']||{},_0x43f267={'type':'journey','attributes':{'name':_0x383725,'audienceId':_0x123c9b,'journeyStages':await Promise[_0x2e07c8(0x1d4)](_0x44b893[_0x2e07c8(0x16a)](_0x33f436=>convertYamlStageToApi(_0x33f436,_0xd6550f,_0x2848c6,_0x325e52)))}},_0x4449db=_0x180c3f?.['id']??_0x53e9e7['id'];_0x4449db&&(_0x43f267['id']=_0x4449db);_0x53e9e7[_0x2e07c8(0x12f)]&&(_0x43f267[_0x2e07c8(0x197)][_0x2e07c8(0x12f)]=_0x53e9e7[_0x2e07c8(0x12f)]);const _0x46c09f=getEffectiveGoal(_0x53e9e7);_0x46c09f&&(_0x43f267[_0x2e07c8(0x197)][_0x2e07c8(0x168)]=await convertYamlCriteriaToApi(_0x46c09f,_0xd6550f,_0x2848c6));const _0xf5c50a=getEffectiveReentry(_0x53e9e7);return _0xf5c50a&&(_0x43f267[_0x2e07c8(0x197)]['reentryMode']=_0xf5c50a,_0x43f267[_0x2e07c8(0x197)][_0x2e07c8(0x171)]=_0xf5c50a!==_0x2e07c8(0x19e)),_0x53e9e7['folder_id']&&(_0x43f267[_0x2e07c8(0x1a2)]={'parentFolder':{'data':{'id':_0x53e9e7['folder_id'],'type':_0x2e07c8(0x177)}}}),_0x43f267;}async function convertYamlStageToApi(_0x58b74e,_0x7f49bc,_0x53491a={},_0x10c999={}){const _0x24751e=a122_0x36e5,_0x1f5e5a={'name':_0x58b74e[_0x24751e(0x16e)]};_0x58b74e['id']&&(_0x1f5e5a['id']=_0x58b74e['id']);_0x58b74e['description']&&(_0x1f5e5a[_0x24751e(0x12f)]=_0x58b74e['description']);_0x58b74e[_0x24751e(0x143)]&&(_0x1f5e5a['entryCriteria']=await convertYamlCriteriaToApi(_0x58b74e['entry_criteria'],_0x7f49bc,_0x53491a));_0x58b74e[_0x24751e(0x166)]&&_0x58b74e[_0x24751e(0x166)][_0x24751e(0x1d9)]>0x0&&(_0x1f5e5a['exitCriterias']=await Promise[_0x24751e(0x1d4)](_0x58b74e[_0x24751e(0x166)][_0x24751e(0x16a)](_0x3dbe4c=>convertYamlCriteriaToApi(_0x3dbe4c,_0x7f49bc,_0x53491a))));_0x58b74e[_0x24751e(0x18c)]&&(_0x1f5e5a[_0x24751e(0x18c)]=await convertYamlCriteriaToApi(_0x58b74e[_0x24751e(0x18c)],_0x7f49bc,_0x53491a));if(_0x58b74e['steps']&&_0x58b74e['steps']['length']>0x0){const _0x1301ee={},_0x4100e3=_0x58b74e[_0x24751e(0x1a7)][_0x24751e(0x16a)]((_0x37f681,_0x43c658)=>{const _0x36cd11=_0x24751e,_0x381d84=_0x37f681[_0x36cd11(0x155)]||generateUUID(),_0x291856=_0x37f681[_0x36cd11(0x16e)]||_0x37f681[_0x36cd11(0x145)]+'_'+_0x43c658;return _0x1301ee[_0x291856]=_0x381d84,{..._0x37f681,'name':_0x291856};});_0x1f5e5a[_0x24751e(0x18b)]=_0x1301ee[_0x4100e3[0x0][_0x24751e(0x16e)]],_0x1f5e5a[_0x24751e(0x1a7)]={};for(let _0x158d71=0x0;_0x158d71<_0x4100e3[_0x24751e(0x1d9)];_0x158d71++){const _0x42082d=_0x4100e3[_0x158d71],_0x4b63c1=_0x1301ee[_0x42082d[_0x24751e(0x16e)]],_0x237a10=!_0x42082d[_0x24751e(0x142)]&&_0x158d71<_0x4100e3[_0x24751e(0x1d9)]-0x1&&_0x42082d[_0x24751e(0x145)]!==_0x24751e(0x146)?_0x4100e3[_0x158d71+0x1][_0x24751e(0x16e)]:_0x42082d['next'],_0x59fb21=_0x237a10!==_0x42082d[_0x24751e(0x142)]?{..._0x42082d,'next':_0x237a10}:_0x42082d;_0x1f5e5a[_0x24751e(0x1a7)][_0x4b63c1]=await convertYamlStepToApi(_0x59fb21,_0x7f49bc,_0x53491a,_0x1301ee,_0x10c999);}}else _0x58b74e[_0x24751e(0x1c2)]&&(_0x1f5e5a[_0x24751e(0x18b)]=_0x58b74e[_0x24751e(0x1c2)]);return _0x1f5e5a;}async function convertYamlCriteriaToApi(_0x2da688,_0x1c6d53,_0x2ed3aa={}){const _0xfffd93=a122_0x36e5;let _0x5eab28=_0x2da688[_0xfffd93(0x19c)];if(_0x5eab28&&!/^\d+$/['test'](_0x5eab28)){const _0x343a7f=parseSegmentRef(_0x5eab28);if(_0x343a7f[_0xfffd93(0x145)]===_0xfffd93(0x1a9))_0x1c6d53?.[_0xfffd93(0x1e1)]&&(_0x5eab28=await _0x1c6d53[_0xfffd93(0x1e1)](_0x343a7f['name']));else{if(_0x343a7f[_0xfffd93(0x145)]===_0xfffd93(0x1a6)&&_0x2ed3aa[_0x343a7f['name']])_0x1c6d53?.[_0xfffd93(0x1a4)]&&(_0x5eab28=await _0x1c6d53[_0xfffd93(0x1a4)](_0x343a7f['name'],_0x2ed3aa[_0x343a7f['name']]));else _0x1c6d53?.[_0xfffd93(0x1e1)]&&(_0x5eab28=await _0x1c6d53['resolveSegmentId'](_0x343a7f[_0xfffd93(0x16e)]));}}const _0x37b3cb={'name':_0x2da688[_0xfffd93(0x16e)],'segmentId':_0x5eab28};_0x2da688[_0xfffd93(0x12f)]&&(_0x37b3cb[_0xfffd93(0x12f)]=_0x2da688['description']);if(_0x2da688[_0xfffd93(0x191)]){const _0xb4f708=_0x2da688[_0xfffd93(0x191)][_0xfffd93(0x1e9)],_0x264c4d=_0x2da688['target'][_0xfffd93(0x141)];let _0x19b9d6=_0x2da688[_0xfffd93(0x191)][_0xfffd93(0x1e9)];_0x1c6d53?.[_0xfffd93(0x156)]&&!/^\d+$/[_0xfffd93(0x153)](_0x19b9d6)&&(_0x19b9d6=await _0x1c6d53[_0xfffd93(0x156)](_0x19b9d6));let _0x9ab39d=_0x2da688[_0xfffd93(0x191)][_0xfffd93(0x141)];_0x1c6d53?.[_0xfffd93(0x1f9)]&&!/^\d+$/['test'](_0x9ab39d)&&(_0x9ab39d=await _0x1c6d53[_0xfffd93(0x1f9)](_0x19b9d6,_0x9ab39d));const _0xe4333a=!/^\d+$/[_0xfffd93(0x153)](_0xb4f708)&&!isLocalJourneyRef(_0xb4f708)?formatApiJourneyName(_0xb4f708,_0x264c4d):undefined;_0x37b3cb[_0xfffd93(0x191)]={'journeyId':_0x19b9d6,'journeyStageId':_0x9ab39d,'journeyName':_0xe4333a,'confirmed':!![]},_0x2da688[_0xfffd93(0x191)][_0xfffd93(0x148)]&&(_0x37b3cb[_0xfffd93(0x191)][_0xfffd93(0x150)]=_0x2da688[_0xfffd93(0x191)][_0xfffd93(0x148)]);}return _0x37b3cb;}async function convertYamlStepToApi(_0x40813c,_0x42c4ba,_0x145fec={},_0x1e5ac1={},_0x7b3547={}){const _0x106372=a122_0x36e5,_0x242e05=async _0x34ef25=>{const _0x3ec9e1=a122_0x36e5;if(/^\d+$/[_0x3ec9e1(0x153)](_0x34ef25))return _0x34ef25;const _0x1fccac=parseSegmentRef(_0x34ef25);if(_0x1fccac['type']===_0x3ec9e1(0x1a9)){if(_0x42c4ba?.[_0x3ec9e1(0x1e1)])return await _0x42c4ba[_0x3ec9e1(0x1e1)](_0x1fccac[_0x3ec9e1(0x16e)]);}else{if(_0x1fccac[_0x3ec9e1(0x145)]===_0x3ec9e1(0x1a6)&&_0x145fec[_0x1fccac[_0x3ec9e1(0x16e)]]){if(_0x42c4ba?.[_0x3ec9e1(0x1a4)])return await _0x42c4ba[_0x3ec9e1(0x1a4)](_0x1fccac[_0x3ec9e1(0x16e)],_0x145fec[_0x1fccac[_0x3ec9e1(0x16e)]]);}else{if(_0x42c4ba?.[_0x3ec9e1(0x1e1)])return await _0x42c4ba[_0x3ec9e1(0x1e1)](_0x1fccac['name']);}}return _0x34ef25;},_0x1beb03=async _0x5a5345=>{const _0x176dfa=a122_0x36e5;if(/^\d+$/[_0x176dfa(0x153)](_0x5a5345))return _0x5a5345;const _0x5bb599=parseSegmentRef(_0x5a5345);if(_0x5bb599['type']===_0x176dfa(0x1a9)){if(_0x42c4ba?.[_0x176dfa(0x18d)])return await _0x42c4ba[_0x176dfa(0x18d)](_0x5bb599[_0x176dfa(0x16e)]);return _0x5bb599[_0x176dfa(0x16e)];}else{if(_0x5bb599[_0x176dfa(0x145)]===_0x176dfa(0x1a6)&&_0x7b3547[_0x5bb599[_0x176dfa(0x16e)]]){if(_0x42c4ba?.['resolveEmbeddedActivationId'])return await _0x42c4ba[_0x176dfa(0x133)](_0x5bb599[_0x176dfa(0x16e)],_0x7b3547[_0x5bb599[_0x176dfa(0x16e)]]);if(_0x42c4ba?.[_0x176dfa(0x18d)])return await _0x42c4ba[_0x176dfa(0x18d)](_0x5bb599['name']);}else{if(_0x42c4ba?.[_0x176dfa(0x18d)])return await _0x42c4ba['resolveActivationId'](_0x5bb599[_0x176dfa(0x16e)]);}}return _0x5a5345;},_0x2deb3a=_0x418198=>{const _0x4126ad=a122_0x36e5;if(!_0x418198)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x4126ad(0x153)](_0x418198))return _0x418198;return _0x1e5ac1[_0x418198]||_0x418198;};switch(_0x40813c[_0x106372(0x145)]){case _0x106372(0x13b):{const _0x21d81e=_0x40813c,_0x2c502a=_0x21d81e[_0x106372(0x1b8)],_0x23cba0={'type':_0x106372(0x13d),'name':_0x21d81e[_0x106372(0x16e)],'next':_0x2deb3a(_0x21d81e['next'])};if(_0x2c502a[_0x106372(0x14b)]!==undefined&&_0x2c502a[_0x106372(0x17d)])_0x23cba0[_0x106372(0x19a)]='Duration',_0x23cba0[_0x106372(0x13e)]=_0x2c502a[_0x106372(0x14b)],_0x23cba0[_0x106372(0x165)]=normalizeWaitUnit(_0x2c502a[_0x106372(0x17d)]);else{if(_0x2c502a[_0x106372(0x1b0)])_0x23cba0['waitStepType']=_0x106372(0x1ba),_0x23cba0[_0x106372(0x161)]=_0x2c502a['wait_until'];else{if(_0x2c502a[_0x106372(0x1f3)])_0x23cba0[_0x106372(0x19a)]='DaysOfTheWeek',_0x23cba0[_0x106372(0x1e0)]=_0x2c502a['days_of_week'];else{if(_0x2c502a[_0x106372(0x1cb)]){_0x23cba0[_0x106372(0x19a)]=_0x106372(0x13f);const _0x176e74=await _0x242e05(_0x2c502a[_0x106372(0x1cb)][_0x106372(0x19c)]),_0xda22a8=_0x2c502a[_0x106372(0x1cb)][_0x106372(0x13c)]?.['next']!==undefined;if(_0xda22a8){const _0x350c6d=[];_0x350c6d[_0x106372(0x1b4)]({'id':generateUUID(),'segmentId':_0x176e74,'timedOutPath':![],'name':'Met\x20condition(s)','next':_0x2deb3a(_0x2c502a[_0x106372(0x1cb)][_0x106372(0x142)]??_0x21d81e[_0x106372(0x142)])});if(_0x2c502a[_0x106372(0x1cb)][_0x106372(0x13c)]){const _0x154b59=_0x2c502a[_0x106372(0x1cb)][_0x106372(0x13c)][_0x106372(0x14b)],_0x132440=normalizeWaitUnit(_0x2c502a[_0x106372(0x1cb)][_0x106372(0x13c)][_0x106372(0x17d)]);_0x350c6d[_0x106372(0x1b4)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x106372(0x17e)+_0x154b59+'\x20'+_0x132440,'moveAfter':_0x154b59,'unit':_0x132440,'next':_0x2deb3a(_0x2c502a[_0x106372(0x1cb)][_0x106372(0x13c)]['next'])});}_0x23cba0[_0x106372(0x1fb)]=_0x350c6d,delete _0x23cba0[_0x106372(0x142)];}else _0x23cba0[_0x106372(0x14c)]=_0x176e74,_0x2c502a['condition'][_0x106372(0x13c)]&&(_0x23cba0[_0x106372(0x135)]=_0x2c502a[_0x106372(0x1cb)][_0x106372(0x13c)][_0x106372(0x14b)],_0x2c502a[_0x106372(0x1cb)][_0x106372(0x13c)][_0x106372(0x17d)]&&(_0x23cba0[_0x106372(0x182)]=normalizeWaitUnit(_0x2c502a[_0x106372(0x1cb)]['timeout'][_0x106372(0x17d)])));}}}}return _0x23cba0;}case _0x106372(0x169):{const _0x2bd6bb=_0x40813c,_0x576c6a=_0x2bd6bb[_0x106372(0x1b8)][_0x106372(0x169)],_0x25e110=await _0x1beb03(_0x576c6a);return{'type':'Activation','name':_0x2bd6bb[_0x106372(0x16e)],'journeyActivationStepId':_0x25e110,'next':_0x2deb3a(_0x2bd6bb[_0x106372(0x142)])};}case _0x106372(0x1ed):{const _0x1e2893=_0x40813c,_0x332b70=_0x1e2893[_0x106372(0x1b8)][_0x106372(0x12d)];return{'type':_0x106372(0x1ae),'name':_0x1e2893['name'],'branches':await Promise['all'](_0x332b70['map'](async _0x76d3b5=>{const _0x9626ef=_0x106372;let _0x45b8fc='';if(!_0x76d3b5[_0x9626ef(0x160)]){const _0x323680=_0x76d3b5[_0x9626ef(0x19c)]||_0x76d3b5[_0x9626ef(0x1bd)]||'';_0x45b8fc=_0x323680?await _0x242e05(_0x323680):'';}return{'id':crypto['randomUUID'](),'name':_0x76d3b5['name'],'description':null,'segmentId':_0x45b8fc,'excludedPath':_0x76d3b5['excluded']??![],'next':_0x2deb3a(_0x76d3b5[_0x9626ef(0x142)])};})),'next':_0x2deb3a(_0x1e2893[_0x106372(0x142)])};}case _0x106372(0x16b):{const _0x4b7e20=_0x40813c,_0x4f7f2c=_0x4b7e20[_0x106372(0x1b8)];return{'type':'ABTest','name':_0x4b7e20[_0x106372(0x16e)],'customizedSplit':_0x4f7f2c[_0x106372(0x1b5)],'uniqueId':_0x4f7f2c[_0x106372(0x1d0)],'variants':_0x4f7f2c[_0x106372(0x14f)]['map'](_0x578c2d=>({'id':_0x578c2d['id']||generateUUID(),'name':_0x578c2d[_0x106372(0x16e)],'percentage':_0x578c2d['percentage'],'next':_0x2deb3a(_0x578c2d[_0x106372(0x142)])})),'next':_0x2deb3a(_0x4b7e20['next'])};}case _0x106372(0x1c1):return{'type':'Merge','name':_0x40813c['name'],'next':_0x2deb3a(_0x40813c['next'])};case _0x106372(0x13a):{const _0x2edd5d=_0x40813c,_0x573d6c=_0x2edd5d[_0x106372(0x1b8)]['target'],_0x305537=_0x573d6c[_0x106372(0x1e9)],_0x37d790=_0x573d6c['stage'];let _0x743f8c=_0x573d6c[_0x106372(0x1e9)];_0x42c4ba?.[_0x106372(0x156)]&&!/^\d+$/[_0x106372(0x153)](_0x743f8c)&&(_0x743f8c=await _0x42c4ba[_0x106372(0x156)](_0x743f8c));let _0x2a1d58=_0x573d6c['stage'];_0x42c4ba?.[_0x106372(0x1f9)]&&!/^\d+$/['test'](_0x2a1d58)&&(_0x2a1d58=await _0x42c4ba[_0x106372(0x1f9)](_0x743f8c,_0x2a1d58));const _0x2de258=!/^\d+$/[_0x106372(0x153)](_0x305537)&&!isLocalJourneyRef(_0x305537)?formatApiJourneyName(_0x305537,_0x37d790):undefined;return{'type':_0x106372(0x1e7),'name':_0x2edd5d[_0x106372(0x16e)],'target':{'journeyId':_0x743f8c,'journeyStageId':_0x2a1d58,'journeyBundleId':_0x573d6c[_0x106372(0x148)],'journeyName':_0x2de258,'confirmed':!![]},'next':_0x2deb3a(_0x2edd5d['next'])};}case _0x106372(0x146):return{'type':_0x106372(0x12b),'name':_0x40813c[_0x106372(0x16e)]};default:{const _0x3d3207=_0x40813c;return{'type':'End','name':_0x3d3207[_0x106372(0x16e)]};}}}export function toYamlString(_0x4545e5){const _0x447b93=a122_0x36e5,_0x2adb2d=stripInternalFields(_0x4545e5),_0x3376db=a122_0x3560f3['stringify'](_0x2adb2d,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x447b93(0x181)}),_0x3ad800=[_0x447b93(0x1f0),'activations:','goal:',_0x447b93(0x1ad),_0x447b93(0x14a),_0x447b93(0x1d8),_0x447b93(0x183)];let _0x19eac7=_0x3376db;for(const _0x182aa6 of _0x3ad800){_0x19eac7=_0x19eac7[_0x447b93(0x140)](new RegExp('^('+_0x182aa6+')','m'),(_0x14f03a,_0xfc2946,_0x27a91b)=>{if(_0x27a91b===0x0||_0x19eac7[_0x27a91b-0x1]==='\x0a'&&_0x19eac7[_0x27a91b-0x2]==='\x0a')return _0xfc2946;return'\x0a'+_0xfc2946;});}return _0x19eac7;}function stripInternalFields(_0x3861b1){const _0x5af363=a122_0x36e5,{id:_0x57d144,folder_id:_0x52083e,bundle_id:_0x483086,bundle_name:_0x350ca7,version:_0x599158,version_number:_0x10e178,allow_reentry:_0x4ec678,..._0x4b1c63}=_0x3861b1;return _0x4b1c63[_0x5af363(0x1b2)]&&(_0x4b1c63[_0x5af363(0x1b2)]=_0x4b1c63[_0x5af363(0x1b2)][_0x5af363(0x16a)](_0x2a4d1f=>{const _0x13897d=_0x5af363,{id:_0x3b717f,version_number:_0x1e4b1f,..._0x318ea9}=_0x2a4d1f;return{..._0x318ea9,'stages':_0x318ea9['stages'][_0x13897d(0x16a)](stripStageInternalFields),..._0x2a4d1f[_0x13897d(0x1c0)]===!![]?{'latest':!![]}:{},..._0x4b1c63[_0x13897d(0x1b2)][_0x13897d(0x1d9)]===0x1&&_0x318ea9[_0x13897d(0x1fa)]==='v1'?{'version':undefined}:{}};})),_0x4b1c63[_0x5af363(0x17a)]&&(_0x4b1c63[_0x5af363(0x17a)]=_0x4b1c63[_0x5af363(0x17a)][_0x5af363(0x16a)](stripStageInternalFields)),_0x4b1c63[_0x5af363(0x1b6)]&&(_0x4b1c63[_0x5af363(0x1b6)]=_0x4b1c63[_0x5af363(0x1b6)][_0x5af363(0x16a)](_0x43d6ed=>{const _0x5d5df0=_0x5af363,{id:_0x272b8c,version_number:_0x97c229,..._0x1ee3f6}=_0x43d6ed;return{..._0x1ee3f6,'stages':_0x1ee3f6[_0x5d5df0(0x17a)][_0x5d5df0(0x16a)](stripStageInternalFields),..._0x43d6ed[_0x5d5df0(0x1c0)]===!![]?{'latest':!![]}:{}};})),_0x4b1c63;}function stripStageInternalFields(_0x4c3194){const {id:_0x65c1c8,..._0x49a27c}=_0x4c3194;return _0x49a27c;}export function parseYamlString(_0x499720){const _0xe13e3b=a122_0x36e5,_0x3c44e7=a122_0x3560f3['parse'](_0x499720);if(_0x3c44e7[_0xe13e3b(0x145)]!==_0xe13e3b(0x1e9))throw new SDKError(ErrorCode[_0xe13e3b(0x15c)],_0xe13e3b(0x178));if(!_0x3c44e7['name'])throw new SDKError(ErrorCode[_0xe13e3b(0x15c)],_0xe13e3b(0x137));const _0x22ddbe=_0x3c44e7[_0xe13e3b(0x1b2)]&&Array[_0xe13e3b(0x194)](_0x3c44e7['journeys'])&&_0x3c44e7['journeys'][_0xe13e3b(0x1d9)]>0x0,_0x1d37a1=_0x3c44e7[_0xe13e3b(0x17a)]&&Array[_0xe13e3b(0x194)](_0x3c44e7[_0xe13e3b(0x17a)])&&_0x3c44e7['stages'][_0xe13e3b(0x1d9)]>0x0,_0x179087=_0x3c44e7[_0xe13e3b(0x1b6)]&&Array[_0xe13e3b(0x194)](_0x3c44e7[_0xe13e3b(0x1b6)])&&_0x3c44e7[_0xe13e3b(0x1b6)]['length']>0x0,_0x48f680=[_0x22ddbe,_0x1d37a1,_0x179087][_0xe13e3b(0x1cd)](Boolean)[_0xe13e3b(0x1d9)];if(_0x48f680>0x1)throw new SDKError(ErrorCode[_0xe13e3b(0x15c)],'Journey\x20YAML\x20cannot\x20have\x20multiple\x20format\x20fields\x20(journeys,\x20stages,\x20versions).\x20Use\x20only\x20one\x20format.');if(_0x48f680===0x0)throw new SDKError(ErrorCode[_0xe13e3b(0x15c)],_0xe13e3b(0x1ac));if(_0x22ddbe){for(let _0x5db6f5=0x0;_0x5db6f5<_0x3c44e7[_0xe13e3b(0x1b2)][_0xe13e3b(0x1d9)];_0x5db6f5++){const _0x33e510=_0x3c44e7['journeys'][_0x5db6f5];if(!_0x33e510[_0xe13e3b(0x17a)]||!Array[_0xe13e3b(0x194)](_0x33e510[_0xe13e3b(0x17a)])||_0x33e510[_0xe13e3b(0x17a)][_0xe13e3b(0x1d9)]===0x0)throw new SDKError(ErrorCode[_0xe13e3b(0x15c)],_0xe13e3b(0x16f)+_0x5db6f5+_0xe13e3b(0x1c8));if(_0x33e510[_0xe13e3b(0x190)]&&![_0xe13e3b(0x1f4),_0xe13e3b(0x15e)][_0xe13e3b(0x18e)](_0x33e510[_0xe13e3b(0x190)]))throw new SDKError(ErrorCode[_0xe13e3b(0x15c)],'Journey\x20YAML\x20journeys['+_0x5db6f5+']\x20has\x20invalid\x20state:\x20'+_0x33e510['state']+_0xe13e3b(0x15a));validateStages(_0x33e510[_0xe13e3b(0x17a)],_0xe13e3b(0x1ef)+_0x5db6f5+'].stages');}const _0x3acbc5=_0x3c44e7[_0xe13e3b(0x1b2)]['filter'](_0x523f35=>_0x523f35[_0xe13e3b(0x1c0)]===!![])[_0xe13e3b(0x1d9)];if(_0x3acbc5>0x1)throw new SDKError(ErrorCode[_0xe13e3b(0x15c)],_0xe13e3b(0x1e2));}_0x1d37a1&&validateStages(_0x3c44e7[_0xe13e3b(0x17a)],_0xe13e3b(0x17a));if(_0x179087){for(let _0x42760b=0x0;_0x42760b<_0x3c44e7[_0xe13e3b(0x1b6)][_0xe13e3b(0x1d9)];_0x42760b++){const _0x35b329=_0x3c44e7[_0xe13e3b(0x1b6)][_0x42760b];if(!_0x35b329[_0xe13e3b(0x16e)])throw new SDKError(ErrorCode[_0xe13e3b(0x15c)],'Journey\x20YAML\x20versions['+_0x42760b+_0xe13e3b(0x1b1));if(!_0x35b329[_0xe13e3b(0x190)]||!['draft',_0xe13e3b(0x15e)][_0xe13e3b(0x18e)](_0x35b329[_0xe13e3b(0x190)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Journey\x20YAML\x20versions['+_0x42760b+_0xe13e3b(0x1d6)+_0x35b329['state']+_0xe13e3b(0x15a));if(!_0x35b329['stages']||!Array[_0xe13e3b(0x194)](_0x35b329[_0xe13e3b(0x17a)])||_0x35b329[_0xe13e3b(0x17a)][_0xe13e3b(0x1d9)]===0x0)throw new SDKError(ErrorCode[_0xe13e3b(0x15c)],_0xe13e3b(0x1a3)+_0x42760b+_0xe13e3b(0x1c8));validateStages(_0x35b329['stages'],'versions['+_0x42760b+_0xe13e3b(0x1ee));}const _0x45621c=_0x3c44e7['versions'][_0xe13e3b(0x1cd)](_0x2cef59=>_0x2cef59[_0xe13e3b(0x1c0)]===!![])[_0xe13e3b(0x1d9)];if(_0x45621c>0x1)throw new SDKError(ErrorCode[_0xe13e3b(0x15c)],_0xe13e3b(0x17c));}return _0x3c44e7;}function validateStages(_0x3ca7a0,_0x390475){const _0x185273=a122_0x36e5;if(_0x3ca7a0[_0x185273(0x1d9)]>0x8)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x185273(0x1bb)+_0x390475+_0x185273(0x180));}export function isJourneyDef(_0x27b84b){const _0x112ec4=a122_0x36e5;return typeof _0x27b84b===_0x112ec4(0x1d3)&&_0x27b84b!==null&&_0x112ec4(0x145)in _0x27b84b&&_0x27b84b[_0x112ec4(0x145)]===_0x112ec4(0x1e9);}export function generateTemplate(_0x2da6d9,_0x386818){const _0x58b2ef=a122_0x36e5,_0x42ce4b={'type':_0x58b2ef(0x1e9),'name':_0x2da6d9,'description':_0x58b2ef(0x170),'reentry':_0x58b2ef(0x19e),'goal':{'name':_0x58b2ef(0x152),'segment':_0x58b2ef(0x1f5)},'stages':[{'name':_0x58b2ef(0x1e6),'description':_0x58b2ef(0x1a8),'entry_criteria':{'name':_0x58b2ef(0x1e3),'segment':_0x386818},'steps':[{'type':'wait','name':_0x58b2ef(0x1da),'with':{'duration':0x1,'unit':_0x58b2ef(0x172)}},{'type':_0x58b2ef(0x169),'name':'Send\x20Notification','with':{'activation':_0x58b2ef(0x130)}},{'type':_0x58b2ef(0x146),'name':_0x58b2ef(0x1f1)}]}]};return toYamlString(_0x42ce4b);}function generateUUID(){return crypto['randomUUID']();}export const SEGMENT_REF_PREFIX=a122_0x1f799a(0x1b9);export function parseSegmentRef(_0xa79f88){const _0x2e5122=a122_0x1f799a;if(_0xa79f88[_0x2e5122(0x1fc)](SEGMENT_REF_PREFIX))return{'type':_0x2e5122(0x1a9),'name':_0xa79f88[_0x2e5122(0x16d)](SEGMENT_REF_PREFIX[_0x2e5122(0x1d9)])};if(/^\d+$/[_0x2e5122(0x153)](_0xa79f88))return{'type':'id','name':_0xa79f88};return{'type':_0x2e5122(0x1a6),'name':_0xa79f88};}export function makeSegmentRef(_0x26849e){return''+SEGMENT_REF_PREFIX+_0x26849e;}export function isExternalSegmentRef(_0x1a558a){return _0x1a558a['startsWith'](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x3440db){const _0x110993=a122_0x1f799a;return!!(_0x3440db[_0x110993(0x1b2)]&&_0x3440db[_0x110993(0x1b2)][_0x110993(0x1d9)]>0x0);}export function isMultiVersionMode(_0x4a16eb){const _0x5ed577=a122_0x1f799a;return!!(_0x4a16eb[_0x5ed577(0x1b6)]&&_0x4a16eb[_0x5ed577(0x1b6)][_0x5ed577(0x1d9)]>0x0);}export function isSingleVersionMode(_0x3caea5){const _0x38ddac=a122_0x1f799a;return!!(_0x3caea5[_0x38ddac(0x17a)]&&_0x3caea5[_0x38ddac(0x17a)]['length']>0x0);}export function hasMultipleVersions(_0x4f920e){if(isJourneysArrayMode(_0x4f920e))return(_0x4f920e['journeys']?.['length']||0x0)>0x1;if(isMultiVersionMode(_0x4f920e))return(_0x4f920e['versions']?.['length']||0x0)>0x1;return![];}function a122_0x36e5(_0xa6e9b7,_0x5866ef){_0xa6e9b7=_0xa6e9b7-0x12b;const _0x1e8f60=a122_0x1e8f();let _0x36e564=_0x1e8f60[_0xa6e9b7];return _0x36e564;}export function normalizeToJourneysFormat(_0x495999){const _0x263f22=a122_0x1f799a;if(isJourneysArrayMode(_0x495999))return _0x495999;if(isSingleVersionMode(_0x495999)){const {stages:_0x12e5b1,id:_0x484730,version:_0x291ad7,version_number:_0x27dd91,..._0x1e98bb}=_0x495999;return{..._0x1e98bb,'journeys':[{'version':_0x291ad7||'v1','stages':_0x12e5b1||[],'id':_0x484730,'version_number':_0x27dd91}]};}if(isMultiVersionMode(_0x495999)){const {versions:_0x263ff3,..._0x52b115}=_0x495999;return{..._0x52b115,'journeys':(_0x263ff3||[])[_0x263f22(0x16a)](_0x1bf955=>({'version':_0x1bf955[_0x263f22(0x16e)],'state':_0x1bf955[_0x263f22(0x190)],'latest':_0x1bf955[_0x263f22(0x1c0)],'stages':_0x1bf955[_0x263f22(0x17a)],'id':_0x1bf955['id'],'version_number':_0x1bf955[_0x263f22(0x1bf)]}))};}return _0x495999;}export function normalizeJourneyDef(_0x1af9c2,_0x11062f){const _0x39fbcd=a122_0x1f799a,_0x1dc10f=normalizeToJourneysFormat(_0x1af9c2),_0x396835=_0x11062f?.['segments']?Object['keys'](_0x11062f[_0x39fbcd(0x12e)]):undefined,_0xd59ec0=_0x11062f?.[_0x39fbcd(0x12c)]?Object[_0x39fbcd(0x164)](_0x11062f['activations']):undefined;return{'type':_0x39fbcd(0x1e9),'name':_0x1dc10f['name'],..._0x1dc10f[_0x39fbcd(0x12f)]!==undefined&&{'description':_0x1dc10f['description']},..._0x1dc10f[_0x39fbcd(0x168)]&&{'goal':normalizeJourneyCriteria(_0x1dc10f[_0x39fbcd(0x168)])},..._0x1dc10f[_0x39fbcd(0x1c7)]!==undefined&&{'reentry':_0x1dc10f[_0x39fbcd(0x1c7)]},..._0x1dc10f[_0x39fbcd(0x12e)]&&{'segments':normalizeEmbeddedSegments(_0x1dc10f[_0x39fbcd(0x12e)],_0x396835)},..._0x1dc10f[_0x39fbcd(0x12c)]&&{'activations':normalizeEmbeddedActivations(_0x1dc10f[_0x39fbcd(0x12c)],_0xd59ec0)},..._0x1dc10f['journeys']&&{'journeys':_0x1dc10f['journeys']['map'](_0x1adcea=>normalizeJourneyEntry(_0x1adcea,_0x1dc10f[_0x39fbcd(0x1b2)][_0x39fbcd(0x1d9)]===0x1))}};}function normalizeJourneyEntry(_0x3592fc,_0x55cf9f){const _0x9b2813=a122_0x1f799a;return{...!_0x55cf9f&&_0x3592fc[_0x9b2813(0x1fa)]!==undefined&&{'version':_0x3592fc[_0x9b2813(0x1fa)]},..._0x3592fc[_0x9b2813(0x190)]!==undefined&&{'state':_0x3592fc['state']},...!_0x55cf9f&&_0x3592fc[_0x9b2813(0x1c0)]!==undefined&&{'latest':_0x3592fc[_0x9b2813(0x1c0)]},..._0x3592fc['goal']&&{'goal':normalizeJourneyCriteria(_0x3592fc[_0x9b2813(0x168)])},..._0x3592fc[_0x9b2813(0x1c7)]!==undefined&&{'reentry':_0x3592fc[_0x9b2813(0x1c7)]},'stages':_0x3592fc[_0x9b2813(0x17a)][_0x9b2813(0x16a)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x298ea2){const _0x75e2e9=a122_0x1f799a;return{'name':_0x298ea2['name'],..._0x298ea2[_0x75e2e9(0x12f)]!==undefined&&{'description':_0x298ea2['description']},..._0x298ea2[_0x75e2e9(0x143)]&&{'entry_criteria':normalizeJourneyCriteria(_0x298ea2[_0x75e2e9(0x143)])},..._0x298ea2[_0x75e2e9(0x166)]&&{'exit_criteria':_0x298ea2['exit_criteria'][_0x75e2e9(0x16a)](normalizeJourneyCriteria)},..._0x298ea2['milestone']&&{'milestone':normalizeJourneyCriteria(_0x298ea2[_0x75e2e9(0x18c)])},..._0x298ea2[_0x75e2e9(0x1a7)]&&{'steps':normalizeStepsWithImplicitNext(_0x298ea2['steps'])}};}function normalizeStepsWithImplicitNext(_0x2a1b44){const _0x21fcdc=a122_0x1f799a;return _0x2a1b44[_0x21fcdc(0x16a)]((_0x175534,_0x5977c4)=>{const _0x3ece61=_0x21fcdc,_0x144397=_0x5977c4<_0x2a1b44[_0x3ece61(0x1d9)]-0x1?_0x2a1b44[_0x5977c4+0x1][_0x3ece61(0x16e)]:undefined;return normalizeJourneyStep(_0x175534,_0x144397);});}function normalizeJourneyCriteria(_0x49f7ea){const _0x38dd1a=a122_0x1f799a;return{'name':_0x49f7ea[_0x38dd1a(0x16e)],..._0x49f7ea[_0x38dd1a(0x12f)]!==undefined&&{'description':_0x49f7ea[_0x38dd1a(0x12f)]},'segment':_0x49f7ea[_0x38dd1a(0x19c)],..._0x49f7ea[_0x38dd1a(0x191)]&&{'target':normalizeJumpTarget(_0x49f7ea[_0x38dd1a(0x191)])}};}function normalizeJourneyStep(_0x4e1c98,_0x5eca3d){const _0x1dec6a=a122_0x1f799a,_0xba6764=_0x4e1c98[_0x1dec6a(0x142)]!==undefined&&_0x4e1c98[_0x1dec6a(0x142)]!==_0x5eca3d,_0x534471={'type':_0x4e1c98[_0x1dec6a(0x145)],'name':_0x4e1c98[_0x1dec6a(0x16e)],..._0xba6764&&{'next':_0x4e1c98['next']}};if(_0x1dec6a(0x1b8)in _0x4e1c98&&_0x4e1c98[_0x1dec6a(0x1b8)])return{..._0x534471,'with':normalizeStepParams(_0x4e1c98['type'],_0x4e1c98[_0x1dec6a(0x1b8)])};return _0x534471;}function normalizeStepParams(_0x57d4d7,_0x427e7a){const _0x337360=a122_0x1f799a;switch(_0x57d4d7){case'wait':{const _0x47e437=_0x427e7a;let _0x4224fb;return _0x47e437[_0x337360(0x1cb)]&&(_0x4224fb={'segment':_0x47e437[_0x337360(0x1cb)]['segment'],..._0x47e437[_0x337360(0x1cb)][_0x337360(0x142)]!==undefined&&{'next':_0x47e437['condition']['next']},..._0x47e437[_0x337360(0x1cb)]['timeout']&&{'timeout':{'duration':_0x47e437[_0x337360(0x1cb)]['timeout'][_0x337360(0x14b)],'unit':_0x47e437[_0x337360(0x1cb)][_0x337360(0x13c)][_0x337360(0x17d)],..._0x47e437[_0x337360(0x1cb)][_0x337360(0x13c)][_0x337360(0x142)]!==undefined&&{'next':_0x47e437[_0x337360(0x1cb)][_0x337360(0x13c)][_0x337360(0x142)]}}}}),{..._0x47e437[_0x337360(0x14b)]!==undefined&&{'duration':_0x47e437[_0x337360(0x14b)]},..._0x47e437['unit']!==undefined&&{'unit':_0x47e437[_0x337360(0x17d)]},..._0x47e437['wait_until']!==undefined&&{'wait_until':_0x47e437[_0x337360(0x1b0)]},..._0x47e437[_0x337360(0x1f3)]!==undefined&&{'days_of_week':_0x47e437[_0x337360(0x1f3)]},..._0x4224fb&&{'condition':_0x4224fb}};}case _0x337360(0x169):{const _0x287696=_0x427e7a;return{'activation':_0x287696[_0x337360(0x169)]};}case _0x337360(0x1ed):{const _0x1626c4=_0x427e7a;return{'branches':_0x1626c4[_0x337360(0x12d)][_0x337360(0x16a)](normalizeDecisionBranch)};}case'ab_test':{const _0xe42f3e=_0x427e7a;return{..._0xe42f3e[_0x337360(0x1b5)]!==undefined&&{'customized_split':_0xe42f3e[_0x337360(0x1b5)]},..._0xe42f3e[_0x337360(0x1d0)]!==undefined&&{'unique_id':_0xe42f3e[_0x337360(0x1d0)]},'variants':_0xe42f3e[_0x337360(0x14f)][_0x337360(0x16a)](normalizeAbTestVariant)};}case _0x337360(0x13a):{const _0x2e7b4c=_0x427e7a;return{'target':normalizeJumpTarget(_0x2e7b4c['target'])};}default:return _0x427e7a;}}function normalizeDecisionBranch(_0x19283b){const _0x4d0431=a122_0x1f799a;return{'name':_0x19283b['name'],..._0x19283b['segment']!==undefined&&{'segment':_0x19283b['segment']},..._0x19283b['excluded']!==undefined&&{'excluded':_0x19283b[_0x4d0431(0x160)]},..._0x19283b[_0x4d0431(0x142)]!==undefined&&{'next':_0x19283b[_0x4d0431(0x142)]}};}function normalizeAbTestVariant(_0x3473d7){const _0x41410b=a122_0x1f799a;return{..._0x3473d7['id']!==undefined&&{'id':_0x3473d7['id']},'name':_0x3473d7[_0x41410b(0x16e)],'percentage':_0x3473d7[_0x41410b(0x16c)],..._0x3473d7[_0x41410b(0x142)]!==undefined&&{'next':_0x3473d7[_0x41410b(0x142)]}};}function normalizeJumpTarget(_0x318ebf){const _0x141da2=a122_0x1f799a;return{'journey':_0x318ebf[_0x141da2(0x1e9)],'stage':_0x318ebf[_0x141da2(0x141)],..._0x318ebf[_0x141da2(0x148)]!==undefined&&{'bundle_id':_0x318ebf[_0x141da2(0x148)]}};}function normalizeEmbeddedSegments(_0x11f797,_0x551d20){const _0x4aa1c9=a122_0x1f799a,_0x10b184={},_0x4cfdc4=Object[_0x4aa1c9(0x164)](_0x11f797),_0x1044fe=_0x551d20?[..._0x551d20[_0x4aa1c9(0x1cd)](_0x10b647=>_0x4cfdc4[_0x4aa1c9(0x18e)](_0x10b647)),..._0x4cfdc4[_0x4aa1c9(0x1cd)](_0x171f6d=>!_0x551d20[_0x4aa1c9(0x18e)](_0x171f6d))[_0x4aa1c9(0x1c4)]()]:_0x4cfdc4[_0x4aa1c9(0x1c4)]();for(const _0x78fa73 of _0x1044fe){const _0x1c22f8=_0x11f797[_0x78fa73];if(_0x1c22f8[_0x4aa1c9(0x1a5)]){const _0x316a95=_0x1c22f8['rule'];if(_0x316a95[_0x4aa1c9(0x145)]!==_0x4aa1c9(0x189)&&_0x316a95[_0x4aa1c9(0x145)]!=='Or'){const _0x5df18e=_0x316a95[_0x4aa1c9(0x145)]??'(missing)';throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x4aa1c9(0x1ca)+_0x78fa73+'\x27:\x20'+(_0x4aa1c9(0x1c3)+_0x5df18e+_0x4aa1c9(0x15f))+_0x4aa1c9(0x1cf)+_0x4aa1c9(0x185)+'\x20\x20\x20\x20type:\x20And\x0a'+_0x4aa1c9(0x173)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x4aa1c9(0x144)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x316a95[_0x4aa1c9(0x1fb)]||!Array[_0x4aa1c9(0x194)](_0x316a95[_0x4aa1c9(0x1fb)]))throw new SDKError(ErrorCode[_0x4aa1c9(0x15c)],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x78fa73+_0x4aa1c9(0x138)+_0x4aa1c9(0x19b)+_0x4aa1c9(0x1cf)+_0x4aa1c9(0x185)+(_0x4aa1c9(0x1c9)+_0x316a95[_0x4aa1c9(0x145)]+'\x0a')+_0x4aa1c9(0x173)+_0x4aa1c9(0x18f)+_0x4aa1c9(0x144)+_0x4aa1c9(0x1e8));}_0x10b184[_0x78fa73]={..._0x1c22f8[_0x4aa1c9(0x12f)]&&_0x1c22f8[_0x4aa1c9(0x12f)][_0x4aa1c9(0x193)]()&&{'description':_0x1c22f8['description']},..._0x1c22f8[_0x4aa1c9(0x1a5)]&&{'rule':deepSortObject(_0x1c22f8[_0x4aa1c9(0x1a5)])}};}return _0x10b184;}function normalizeEmbeddedActivations(_0x3085e2,_0x45717b){const _0x127e4a=a122_0x1f799a,_0x3581b8={},_0x5975a6=Object[_0x127e4a(0x164)](_0x3085e2),_0x1df7cf=_0x45717b?[..._0x45717b[_0x127e4a(0x1cd)](_0x20bb39=>_0x5975a6[_0x127e4a(0x18e)](_0x20bb39)),..._0x5975a6[_0x127e4a(0x1cd)](_0x42ed51=>!_0x45717b[_0x127e4a(0x18e)](_0x42ed51))[_0x127e4a(0x1c4)]()]:_0x5975a6[_0x127e4a(0x1c4)]();for(const _0x42976b of _0x1df7cf){const _0x550b9d=_0x3085e2[_0x42976b];_0x3581b8[_0x42976b]={'name':_0x550b9d['name'],'connection':_0x550b9d[_0x127e4a(0x15d)],..._0x550b9d[_0x127e4a(0x12f)]!==undefined&&{'description':_0x550b9d['description']},..._0x550b9d['all_columns']!==undefined&&{'all_columns':_0x550b9d[_0x127e4a(0x1dd)]},..._0x550b9d[_0x127e4a(0x139)]!==undefined&&{'columns':_0x550b9d['columns']},..._0x550b9d['behavior']!==undefined&&{'behavior':_0x550b9d[_0x127e4a(0x14d)]},..._0x550b9d['schedule']!==undefined&&{'schedule':_0x550b9d[_0x127e4a(0x131)]},..._0x550b9d['notification']!==undefined&&{'notification':_0x550b9d[_0x127e4a(0x176)]},..._0x550b9d['connector_config']!==undefined&&{'connector_config':_0x550b9d[_0x127e4a(0x198)]},..._0x550b9d['activation_template_id']!==undefined&&{'activation_template_id':_0x550b9d[_0x127e4a(0x151)]}};}return _0x3581b8;}export function getActiveStages(_0x44e3fd){const _0x25d798=a122_0x1f799a;if(isJourneysArrayMode(_0x44e3fd)){const _0x4556a1=_0x44e3fd[_0x25d798(0x1b2)]||[],_0x21b929=_0x4556a1[_0x25d798(0x147)](_0x44da2a=>_0x44da2a['latest']===!![])||_0x4556a1[0x0];return _0x21b929?.[_0x25d798(0x17a)]||[];}if(isSingleVersionMode(_0x44e3fd))return _0x44e3fd[_0x25d798(0x17a)]||[];if(isMultiVersionMode(_0x44e3fd)){const _0x3de257=_0x44e3fd[_0x25d798(0x1b6)]||[],_0x581a90=_0x3de257['find'](_0x2ac550=>_0x2ac550[_0x25d798(0x1c0)]===!![])||_0x3de257[0x0];return _0x581a90?.[_0x25d798(0x17a)]||[];}return[];}export function getLatestJourneyEntry(_0x4c9c8b){const _0x10444d=a122_0x1f799a;if(isJourneysArrayMode(_0x4c9c8b)){const _0xd53c68=_0x4c9c8b['journeys']||[];return _0xd53c68['find'](_0x41f62a=>_0x41f62a[_0x10444d(0x1c0)]===!![])||_0xd53c68[0x0];}if(isMultiVersionMode(_0x4c9c8b)){const _0x1778ab=_0x4c9c8b['versions']||[],_0x35f572=_0x1778ab[_0x10444d(0x147)](_0x28989f=>_0x28989f[_0x10444d(0x1c0)]===!![])||_0x1778ab[0x0];if(_0x35f572)return{'version':_0x35f572['name'],'state':_0x35f572[_0x10444d(0x190)],'latest':_0x35f572[_0x10444d(0x1c0)],'stages':_0x35f572['stages'],'id':_0x35f572['id'],'version_number':_0x35f572['version_number']};}if(isSingleVersionMode(_0x4c9c8b))return{'version':_0x4c9c8b[_0x10444d(0x1fa)]||'v1','state':_0x10444d(0x1f4),'stages':_0x4c9c8b['stages']||[],'id':_0x4c9c8b['id'],'version_number':_0x4c9c8b['version_number'],'goal':_0x4c9c8b[_0x10444d(0x168)],'reentry':_0x4c9c8b[_0x10444d(0x1c7)]};return undefined;}function a122_0x1e8f(){const _0x270221=['journeyStages','conditionTimeoutDuration','values','Journey\x20YAML\x20missing\x20required\x20field:\x20name','\x27:\x20','columns','jump','wait','timeout','WaitStep','waitStep','Condition','replace','stage','next','entry_criteria','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','type','end','find','bundle_id','Merge','journeys:','duration','conditionSegmentId','behavior','journeyId','variants','journeyBundleId','activation_template_id','Goal\x20Achieved','test','folder_id','uuid','resolveJourneyId','10AHUGYl','size','isJourneyLocal','.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.','stageName','JOURNEY_SYNTAX_ERROR','connection','launched','\x27.\x0a','excluded','waitUntilDate','customizedSplit','9uUvRyj','keys','waitStepUnit','exit_criteria','has','goal','activation','map','ab_test','percentage','slice','name','Journey\x20YAML\x20journeys[','Journey\x20description','allowReentry','day','\x20\x20\x20\x20conditions:\x0a','waitCondition','1rKLqyr','notification','folder','Journey\x20YAML\x20must\x20have\x20type:\x20journey','340070zkDEEq','stages','resolveJumpTarget','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20version\x20with\x20latest:\x20true','unit','*Max\x20wait\x20','reentry_always',':\x20maximum\x208\x20stages\x20allowed','null','conditionTimeoutUnit','versions:','entries','\x20\x20rule:\x0a','journeyBundleName','ABTest','stageId','And','journeyStageId','rootStep','milestone','resolveActivationId','includes','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','state','target','13082301NHAQeL','trim','isArray','from','553348bNyRbJ','attributes','connector_config','Unknown\x20segment\x20\x22','waitStepType','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','segment','shift','no_reentry','DaysOfTheWeek','week','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','relationships','Journey\x20YAML\x20versions[','resolveEmbeddedSegmentId','rule','embedded','steps','First\x20stage\x20of\x20the\x20journey','ref','bundle_name','data','Journey\x20YAML\x20must\x20have\x20journeys\x20array\x20(recommended),\x20stages\x20(legacy),\x20or\x20versions\x20(legacy)','reentry:','DecisionPoint','days','wait_until',']\x20missing\x20required\x20field:\x20name','journeys','versionNumber','push','customized_split','versions','Variant','with','ref:','Date','Journey\x20YAML\x20','4068XxLlcY','segment_id','resolveActivationName','version_number','latest','merge','root_step','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','sort','1287SSTqeU','Duration','reentry',']\x20missing\x20required\x20field:\x20stages','\x20\x20\x20\x20type:\x20','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','condition','weeks','filter','moveAfter','Expected\x20format:\x0a','unique_id','set','resolveSegmentName','object','all','13855952EuAgLH',']\x20has\x20invalid\x20state:\x20','exitCriterias','stages:','length','Wait\x201\x20Day','Activation','segmentId','all_columns','parentFolder','add','daysOfWeek','resolveSegmentId','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20journey\x20entry\x20with\x20latest:\x20true','Entry\x20Criteria','definition','journeyName','Stage\x201','Jump','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','journey','toLowerCase','1021678eEcRdR','reentryMode','decision_point','].stages','journeys[','segments:','Stage\x20Complete','13223asVVVg','days_of_week','draft','goal-segment','resolveSegment','entryCriteria','get','resolveStageId','version','conditions','startsWith','End','activations','branches','segments','description','your-activation-name','schedule','20484uFGoiq','resolveEmbeddedActivationId'];a122_0x1e8f=function(){return _0x270221;};return a122_0x1e8f();}export function getLatestVersion(_0x20b53b){const _0x460157=a122_0x1f799a;if(!isMultiVersionMode(_0x20b53b))return undefined;const _0x48cb4a=_0x20b53b[_0x460157(0x1b6)]||[];return _0x48cb4a[_0x460157(0x147)](_0x136bef=>_0x136bef[_0x460157(0x1c0)]===!![])||_0x48cb4a[0x0];}export function getEffectiveGoal(_0x5bd2b3){const _0x1e8bb9=a122_0x1f799a,_0x1e294e=getLatestJourneyEntry(_0x5bd2b3);return _0x1e294e?.[_0x1e8bb9(0x168)]||_0x5bd2b3[_0x1e8bb9(0x168)];}export function getEffectiveReentry(_0x174b6e){const _0x6608ab=getLatestJourneyEntry(_0x174b6e);return _0x6608ab?.['reentry']||_0x174b6e['reentry'];}export function collectSegmentRefs(_0x52ec2b){const _0x38fe63=a122_0x1f799a,_0x14e9d8=new Set();_0x52ec2b['goal']?.[_0x38fe63(0x19c)]&&_0x14e9d8[_0x38fe63(0x1df)](_0x52ec2b[_0x38fe63(0x168)][_0x38fe63(0x19c)]);const _0x3e9396=_0x38ae8b=>{const _0x4b59d1=_0x38fe63;for(const _0x5358a7 of _0x38ae8b){_0x5358a7[_0x4b59d1(0x143)]?.['segment']&&_0x14e9d8[_0x4b59d1(0x1df)](_0x5358a7[_0x4b59d1(0x143)][_0x4b59d1(0x19c)]);if(_0x5358a7[_0x4b59d1(0x166)])for(const _0xb95c64 of _0x5358a7[_0x4b59d1(0x166)]){_0xb95c64[_0x4b59d1(0x19c)]&&_0x14e9d8[_0x4b59d1(0x1df)](_0xb95c64['segment']);}_0x5358a7[_0x4b59d1(0x18c)]?.[_0x4b59d1(0x19c)]&&_0x14e9d8[_0x4b59d1(0x1df)](_0x5358a7['milestone'][_0x4b59d1(0x19c)]);if(_0x5358a7[_0x4b59d1(0x1a7)])for(const _0x5b76ce of _0x5358a7['steps']){if(_0x5b76ce['type']===_0x4b59d1(0x1ed)){const _0x4bceeb=_0x5b76ce;for(const _0x43868c of _0x4bceeb[_0x4b59d1(0x1b8)][_0x4b59d1(0x12d)]){_0x43868c[_0x4b59d1(0x19c)]&&_0x14e9d8['add'](_0x43868c[_0x4b59d1(0x19c)]);}}else{if(_0x5b76ce[_0x4b59d1(0x145)]===_0x4b59d1(0x13b)){const _0x5657a3=_0x5b76ce;_0x5657a3['with'][_0x4b59d1(0x1cb)]?.['segment']&&_0x14e9d8[_0x4b59d1(0x1df)](_0x5657a3['with'][_0x4b59d1(0x1cb)]['segment']);}}}}};_0x52ec2b[_0x38fe63(0x17a)]&&_0x3e9396(_0x52ec2b['stages']);if(_0x52ec2b['versions'])for(const _0x5e77b0 of _0x52ec2b[_0x38fe63(0x1b6)]){_0x3e9396(_0x5e77b0['stages']);}return _0x14e9d8;}export function validateSegmentRefs(_0x26c6ae){const _0x30a065=a122_0x1f799a,_0x2ef6c9=[],_0x14f6c5=collectSegmentRefs(_0x26c6ae),_0x1105c7=new Set(Object['keys'](_0x26c6ae['segments']||{}));for(const _0x256d50 of _0x14f6c5){const _0xe41441=parseSegmentRef(_0x256d50);_0xe41441['type']===_0x30a065(0x1a6)&&!_0x1105c7[_0x30a065(0x167)](_0xe41441[_0x30a065(0x16e)])&&_0x2ef6c9[_0x30a065(0x1b4)](_0x30a065(0x199)+_0xe41441['name']+_0x30a065(0x1a1)+_0xe41441[_0x30a065(0x16e)]+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0x2ef6c9;}export function collectSegmentIdsFromJourneyApi(_0x7bf1f1){const _0xe6a63c=a122_0x1f799a,_0xc4ebde=new Set();_0x7bf1f1[_0xe6a63c(0x197)]['goal']?.[_0xe6a63c(0x1dc)]&&_0xc4ebde[_0xe6a63c(0x1df)](_0x7bf1f1[_0xe6a63c(0x197)][_0xe6a63c(0x168)][_0xe6a63c(0x1dc)]);const _0x2f6c33=_0x7bf1f1[_0xe6a63c(0x197)][_0xe6a63c(0x134)];if(Array[_0xe6a63c(0x194)](_0x2f6c33))for(const _0x1490bc of _0x2f6c33){_0x1490bc[_0xe6a63c(0x1f7)]?.[_0xe6a63c(0x1dc)]&&_0xc4ebde[_0xe6a63c(0x1df)](_0x1490bc[_0xe6a63c(0x1f7)]['segmentId']);const _0x58884a=_0x1490bc[_0xe6a63c(0x1d7)]??_0x1490bc['exitCriteria'];if(Array[_0xe6a63c(0x194)](_0x58884a))for(const _0x44832a of _0x58884a){_0x44832a[_0xe6a63c(0x1dc)]&&_0xc4ebde[_0xe6a63c(0x1df)](_0x44832a[_0xe6a63c(0x1dc)]);}_0x1490bc[_0xe6a63c(0x18c)]?.[_0xe6a63c(0x1dc)]&&_0xc4ebde[_0xe6a63c(0x1df)](_0x1490bc['milestone']['segmentId']);if(_0x1490bc['steps']&&typeof _0x1490bc[_0xe6a63c(0x1a7)]===_0xe6a63c(0x1d3)){const _0x4ab59b=Array[_0xe6a63c(0x194)](_0x1490bc[_0xe6a63c(0x1a7)])?_0x1490bc[_0xe6a63c(0x1a7)]:Object[_0xe6a63c(0x136)](_0x1490bc[_0xe6a63c(0x1a7)]);for(const _0x37e7b0 of _0x4ab59b){_0x37e7b0[_0xe6a63c(0x174)]?.[_0xe6a63c(0x1dc)]&&_0xc4ebde[_0xe6a63c(0x1df)](_0x37e7b0[_0xe6a63c(0x174)][_0xe6a63c(0x1dc)]);const _0x52ad21=_0x37e7b0;_0x52ad21[_0xe6a63c(0x14c)]&&_0xc4ebde['add'](_0x52ad21[_0xe6a63c(0x14c)]);if(Array[_0xe6a63c(0x194)](_0x52ad21[_0xe6a63c(0x1fb)]))for(const _0x2b8e1e of _0x52ad21[_0xe6a63c(0x1fb)]){_0x2b8e1e[_0xe6a63c(0x1dc)]&&_0xc4ebde[_0xe6a63c(0x1df)](_0x2b8e1e[_0xe6a63c(0x1dc)]);}if(Array[_0xe6a63c(0x194)](_0x37e7b0[_0xe6a63c(0x12d)]))for(const _0x35e956 of _0x37e7b0[_0xe6a63c(0x12d)]){_0x35e956[_0xe6a63c(0x1dc)]&&_0xc4ebde['add'](_0x35e956[_0xe6a63c(0x1dc)]);}}}}return _0xc4ebde;}
1
+ const a122_0x27d7ca=a122_0x5b89;(function(_0x3f8b26,_0x474f75){const _0x2048ad=a122_0x5b89,_0x28cbd4=_0x3f8b26();while(!![]){try{const _0x58fec0=parseInt(_0x2048ad(0x1fa))/0x1+parseInt(_0x2048ad(0x1b4))/0x2*(parseInt(_0x2048ad(0x185))/0x3)+-parseInt(_0x2048ad(0x1ab))/0x4+parseInt(_0x2048ad(0x15d))/0x5+-parseInt(_0x2048ad(0x1c2))/0x6*(parseInt(_0x2048ad(0x1b7))/0x7)+parseInt(_0x2048ad(0x174))/0x8*(parseInt(_0x2048ad(0x1bc))/0x9)+-parseInt(_0x2048ad(0x1f0))/0xa;if(_0x58fec0===_0x474f75)break;else _0x28cbd4['push'](_0x28cbd4['shift']());}catch(_0x33b71f){_0x28cbd4['push'](_0x28cbd4['shift']());}}}(a122_0x41f4,0x8c626));import*as a122_0x5edf9b from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x5e862b){const _0x33037e=a122_0x5b89,_0x385235=_0x5e862b[_0x33037e(0x1e5)]();if(_0x385235===_0x33037e(0x1a9)||_0x385235===_0x33037e(0x1db))return _0x33037e(0x1db);if(_0x385235==='weeks'||_0x385235===_0x33037e(0x194))return _0x33037e(0x194);return _0x5e862b;}export function journeyResponseToDefSync(_0x27b67a){const _0x573a0d=a122_0x5b89,_0x737702=_0x27b67a[_0x573a0d(0x1f9)],_0xcfaff3=_0x737702[_0x573a0d(0x1e2)]||_0x737702['name'],_0x4007f3={'stages':_0x737702['journeyStages'][_0x573a0d(0x1a3)](convertApiStageToYaml),'id':_0x27b67a['id']};_0x737702['goal']&&(_0x4007f3[_0x573a0d(0x1cc)]=convertApiCriteriaToYaml(_0x737702[_0x573a0d(0x1cc)]));_0x737702[_0x573a0d(0x17c)]&&_0x737702[_0x573a0d(0x17c)]!==_0xcfaff3&&(_0x4007f3['version']=_0x737702[_0x573a0d(0x17c)]);_0x737702[_0x573a0d(0x1d2)]!==undefined&&(_0x4007f3[_0x573a0d(0x191)]=_0x737702[_0x573a0d(0x1d2)]);_0x737702['state']&&(_0x4007f3[_0x573a0d(0x1f7)]=_0x737702['state']===_0x573a0d(0x13f)?_0x573a0d(0x13f):'draft');const _0x1e3eae={'type':'journey','name':_0xcfaff3,'journeys':[_0x4007f3]};_0x737702[_0x573a0d(0x1e1)]&&(_0x1e3eae[_0x573a0d(0x1e1)]=_0x737702[_0x573a0d(0x1e1)]);_0x737702[_0x573a0d(0x1cc)]&&(_0x1e3eae[_0x573a0d(0x1cc)]=convertApiCriteriaToYaml(_0x737702[_0x573a0d(0x1cc)]));if(_0x737702[_0x573a0d(0x1e6)])_0x1e3eae[_0x573a0d(0x15b)]=_0x737702[_0x573a0d(0x1e6)];else _0x737702[_0x573a0d(0x200)]!==undefined&&(_0x1e3eae[_0x573a0d(0x15b)]=_0x737702[_0x573a0d(0x200)]?_0x573a0d(0x15e):_0x573a0d(0x159));return _0x737702[_0x573a0d(0x188)]&&(_0x1e3eae['bundle_id']=_0x737702[_0x573a0d(0x188)]),_0x737702[_0x573a0d(0x1e2)]&&(_0x1e3eae[_0x573a0d(0x1e4)]=_0x737702[_0x573a0d(0x1e2)]),_0x27b67a[_0x573a0d(0x150)]?.[_0x573a0d(0x172)]?.[_0x573a0d(0x1ad)]?.['id']&&(_0x1e3eae[_0x573a0d(0x175)]=_0x27b67a[_0x573a0d(0x150)][_0x573a0d(0x172)][_0x573a0d(0x1ad)]['id']),_0x1e3eae;}export async function journeyResponseToDef(_0x259c43,_0x4208f6){const _0x239d21=a122_0x5b89,_0x63f65e=journeyResponseToDefSync(_0x259c43);if(!_0x4208f6)return _0x63f65e;const _0x56e837=new Set();collectSegmentIdsFromJourney(_0x63f65e,_0x56e837);const _0x3c9bba=new Set();collectActivationIdsFromJourney(_0x63f65e,_0x3c9bba);const _0x288f6a={},_0x1bb024=new Map();for(const _0x582633 of Array[_0x239d21(0x1be)](_0x56e837)['sort']()){if(_0x4208f6[_0x239d21(0x149)]){const _0x517079=await _0x4208f6[_0x239d21(0x149)](_0x582633);if(_0x517079['isJourneyLocal']){_0x1bb024[_0x239d21(0x1f4)](_0x582633,_0x517079['name']);if(_0x517079[_0x239d21(0x1d4)]){const _0x252643={..._0x517079['definition'],'rule':deepSortObject(_0x517079[_0x239d21(0x1d4)][_0x239d21(0x1aa)])};_0x288f6a[_0x517079[_0x239d21(0x17c)]]=_0x252643;}}else _0x1bb024['set'](_0x582633,makeSegmentRef(_0x517079[_0x239d21(0x17c)]));}else{if(_0x4208f6[_0x239d21(0x146)]){const _0x25494a=await _0x4208f6[_0x239d21(0x146)](_0x582633);_0x1bb024[_0x239d21(0x1f4)](_0x582633,_0x25494a);}}}const _0x3df4f9={},_0x30cd3d=new Map();for(const _0x300665 of Array[_0x239d21(0x1be)](_0x3c9bba)[_0x239d21(0x164)]()){if(_0x4208f6[_0x239d21(0x1ca)]){const _0x563bfd=await _0x4208f6[_0x239d21(0x1ca)](_0x300665);_0x563bfd[_0x239d21(0x142)]?(_0x30cd3d[_0x239d21(0x1f4)](_0x300665,_0x563bfd[_0x239d21(0x17c)]),_0x563bfd[_0x239d21(0x1d4)]&&(_0x3df4f9[_0x563bfd[_0x239d21(0x17c)]]=_0x563bfd[_0x239d21(0x1d4)])):_0x30cd3d[_0x239d21(0x1f4)](_0x300665,makeSegmentRef(_0x563bfd[_0x239d21(0x17c)]));}else{if(_0x4208f6[_0x239d21(0x1e7)]){const _0x20171b=await _0x4208f6['resolveActivationName'](_0x300665);_0x30cd3d['set'](_0x300665,_0x20171b);}}}_0x1bb024['size']>0x0&&replaceSegmentIdsInJourney(_0x63f65e,_0x1bb024);_0x30cd3d[_0x239d21(0x171)]>0x0&&replaceActivationIdsInJourney(_0x63f65e,_0x30cd3d);if(_0x4208f6['resolveJumpTarget']){const _0x24acc2=[];collectJumpTargetsFromJourney(_0x63f65e,_0x24acc2);if(_0x24acc2['length']>0x0){const _0x16b3ae=new Map();for(const _0xf8bb3f of _0x24acc2){try{const _0xf756e7=await _0x4208f6[_0x239d21(0x1e8)](_0xf8bb3f[_0x239d21(0x16e)],_0xf8bb3f['stageId']);_0x16b3ae[_0x239d21(0x1f4)](_0xf8bb3f[_0x239d21(0x16e)]+':'+_0xf8bb3f[_0x239d21(0x158)],_0xf756e7);}catch{}}_0x16b3ae[_0x239d21(0x171)]>0x0&&replaceJumpTargetsInJourney(_0x63f65e,_0x16b3ae);}}return Object[_0x239d21(0x1c3)](_0x288f6a)[_0x239d21(0x1d0)]>0x0&&(_0x63f65e['segments']=_0x288f6a),Object['keys'](_0x3df4f9)[_0x239d21(0x1d0)]>0x0&&(_0x63f65e[_0x239d21(0x155)]=_0x3df4f9),_0x63f65e;}function collectSegmentIdsFromJourney(_0x43b709,_0x3eb14c){const _0x3e4834=a122_0x5b89;_0x43b709[_0x3e4834(0x1cc)]?.[_0x3e4834(0x1ed)]&&_0x3eb14c[_0x3e4834(0x1b5)](_0x43b709[_0x3e4834(0x1cc)][_0x3e4834(0x1ed)]);const _0x19b2ef=_0x14696e=>{const _0x43aa40=_0x3e4834;for(const _0x25d453 of _0x14696e){_0x25d453[_0x43aa40(0x1c0)]?.[_0x43aa40(0x1ed)]&&_0x3eb14c[_0x43aa40(0x1b5)](_0x25d453[_0x43aa40(0x1c0)][_0x43aa40(0x1ed)]);if(_0x25d453['exit_criteria'])for(const _0x2df82a of _0x25d453['exit_criteria']){_0x2df82a[_0x43aa40(0x1ed)]&&_0x3eb14c[_0x43aa40(0x1b5)](_0x2df82a[_0x43aa40(0x1ed)]);}_0x25d453[_0x43aa40(0x1c4)]?.[_0x43aa40(0x1ed)]&&_0x3eb14c[_0x43aa40(0x1b5)](_0x25d453[_0x43aa40(0x1c4)]['segment']);if(_0x25d453[_0x43aa40(0x190)])for(const _0x13d62b of _0x25d453[_0x43aa40(0x190)]){if(_0x13d62b[_0x43aa40(0x14d)]===_0x43aa40(0x1ce)){const _0x5b1b16=_0x13d62b;for(const _0x20db18 of _0x5b1b16['with'][_0x43aa40(0x1f3)]){_0x20db18[_0x43aa40(0x1ed)]&&_0x3eb14c[_0x43aa40(0x1b5)](_0x20db18[_0x43aa40(0x1ed)]);}}else{if(_0x13d62b[_0x43aa40(0x14d)]==='wait'){const _0x127d3b=_0x13d62b;_0x127d3b[_0x43aa40(0x17b)]['condition']?.[_0x43aa40(0x1ed)]&&_0x3eb14c[_0x43aa40(0x1b5)](_0x127d3b['with'][_0x43aa40(0x1ae)][_0x43aa40(0x1ed)]);}}}}};if(_0x43b709[_0x3e4834(0x1da)])for(const _0x1c0337 of _0x43b709[_0x3e4834(0x1da)]){_0x1c0337[_0x3e4834(0x1cc)]?.[_0x3e4834(0x1ed)]&&_0x3eb14c[_0x3e4834(0x1b5)](_0x1c0337[_0x3e4834(0x1cc)][_0x3e4834(0x1ed)]),_0x19b2ef(_0x1c0337[_0x3e4834(0x156)]);}_0x43b709[_0x3e4834(0x156)]&&_0x19b2ef(_0x43b709[_0x3e4834(0x156)]);if(_0x43b709[_0x3e4834(0x17e)])for(const _0x378201 of _0x43b709[_0x3e4834(0x17e)]){_0x19b2ef(_0x378201['stages']);}}function replaceSegmentIdsInJourney(_0x38ef74,_0x462296){const _0x580d9d=a122_0x5b89,_0x4a7d84=_0x5c03ac=>_0x462296[_0x580d9d(0x1cb)](_0x5c03ac)||_0x5c03ac;_0x38ef74[_0x580d9d(0x1cc)]?.['segment']&&(_0x38ef74[_0x580d9d(0x1cc)][_0x580d9d(0x1ed)]=_0x4a7d84(_0x38ef74[_0x580d9d(0x1cc)][_0x580d9d(0x1ed)]));const _0x3167c0=_0x852b9b=>{const _0x1e0a76=_0x580d9d;for(const _0x59345e of _0x852b9b){_0x59345e['entry_criteria']?.['segment']&&(_0x59345e[_0x1e0a76(0x1c0)]['segment']=_0x4a7d84(_0x59345e[_0x1e0a76(0x1c0)][_0x1e0a76(0x1ed)]));if(_0x59345e[_0x1e0a76(0x1ef)])for(const _0x4b4688 of _0x59345e[_0x1e0a76(0x1ef)]){_0x4b4688['segment']&&(_0x4b4688[_0x1e0a76(0x1ed)]=_0x4a7d84(_0x4b4688['segment']));}_0x59345e[_0x1e0a76(0x1c4)]?.[_0x1e0a76(0x1ed)]&&(_0x59345e[_0x1e0a76(0x1c4)]['segment']=_0x4a7d84(_0x59345e[_0x1e0a76(0x1c4)][_0x1e0a76(0x1ed)]));if(_0x59345e['steps'])for(const _0x4b3654 of _0x59345e[_0x1e0a76(0x190)]){if(_0x4b3654['type']===_0x1e0a76(0x1ce)){const _0x490c96=_0x4b3654;for(const _0x2f98ab of _0x490c96['with'][_0x1e0a76(0x1f3)]){_0x2f98ab['segment']&&(_0x2f98ab['segment']=_0x4a7d84(_0x2f98ab[_0x1e0a76(0x1ed)]));}}else{if(_0x4b3654[_0x1e0a76(0x14d)]==='wait'){const _0x47a061=_0x4b3654;_0x47a061[_0x1e0a76(0x17b)][_0x1e0a76(0x1ae)]?.[_0x1e0a76(0x1ed)]&&(_0x47a061[_0x1e0a76(0x17b)]['condition'][_0x1e0a76(0x1ed)]=_0x4a7d84(_0x47a061[_0x1e0a76(0x17b)][_0x1e0a76(0x1ae)][_0x1e0a76(0x1ed)]));}}}}};if(_0x38ef74['journeys'])for(const _0x388663 of _0x38ef74[_0x580d9d(0x1da)]){_0x388663[_0x580d9d(0x1cc)]?.[_0x580d9d(0x1ed)]&&(_0x388663[_0x580d9d(0x1cc)][_0x580d9d(0x1ed)]=_0x4a7d84(_0x388663[_0x580d9d(0x1cc)]['segment'])),_0x3167c0(_0x388663[_0x580d9d(0x156)]);}_0x38ef74['stages']&&_0x3167c0(_0x38ef74[_0x580d9d(0x156)]);if(_0x38ef74['versions'])for(const _0x29ce78 of _0x38ef74[_0x580d9d(0x17e)]){_0x3167c0(_0x29ce78[_0x580d9d(0x156)]);}}function collectActivationIdsFromJourney(_0x29a8a3,_0x272973){const _0x2819aa=a122_0x5b89,_0x5de547=_0xe8562a=>{const _0x15247a=a122_0x5b89;for(const _0x2800e1 of _0xe8562a){if(_0x2800e1['steps'])for(const _0x5fdfbd of _0x2800e1['steps']){if(_0x5fdfbd[_0x15247a(0x14d)]===_0x15247a(0x1b8)){const _0x2f2f90=_0x5fdfbd;_0x2f2f90['with'][_0x15247a(0x1b8)]&&/^\d+$/[_0x15247a(0x1a1)](_0x2f2f90['with']['activation'])&&_0x272973[_0x15247a(0x1b5)](_0x2f2f90[_0x15247a(0x17b)]['activation']);}}}};if(_0x29a8a3[_0x2819aa(0x1da)])for(const _0x432dca of _0x29a8a3[_0x2819aa(0x1da)]){_0x5de547(_0x432dca['stages']);}_0x29a8a3[_0x2819aa(0x156)]&&_0x5de547(_0x29a8a3['stages']);if(_0x29a8a3['versions'])for(const _0x28a6cd of _0x29a8a3[_0x2819aa(0x17e)]){_0x5de547(_0x28a6cd[_0x2819aa(0x156)]);}}function replaceActivationIdsInJourney(_0x51bfe8,_0x12dd6f){const _0x409d09=a122_0x5b89,_0x5082b0=_0x174785=>_0x12dd6f[_0x409d09(0x1cb)](_0x174785)||_0x174785,_0x20c531=_0x3b320a=>{const _0x2fa40e=_0x409d09;for(const _0x50ad30 of _0x3b320a){if(_0x50ad30['steps'])for(const _0x2835a7 of _0x50ad30[_0x2fa40e(0x190)]){if(_0x2835a7[_0x2fa40e(0x14d)]==='activation'){const _0x5a40d4=_0x2835a7;_0x5a40d4['with'][_0x2fa40e(0x1b8)]&&(_0x5a40d4['with'][_0x2fa40e(0x1b8)]=_0x5082b0(_0x5a40d4[_0x2fa40e(0x17b)][_0x2fa40e(0x1b8)]));}}}};if(_0x51bfe8[_0x409d09(0x1da)])for(const _0x31148e of _0x51bfe8[_0x409d09(0x1da)]){_0x20c531(_0x31148e['stages']);}_0x51bfe8['stages']&&_0x20c531(_0x51bfe8[_0x409d09(0x156)]);if(_0x51bfe8[_0x409d09(0x17e)])for(const _0xe62542 of _0x51bfe8[_0x409d09(0x17e)]){_0x20c531(_0xe62542[_0x409d09(0x156)]);}}function collectJumpTargetsFromJourney(_0x5485c0,_0x34718c){const _0x16f15a=a122_0x5b89,_0x3f6b2c=new Set(),_0x2ef54b=_0x44df06=>{const _0x324778=a122_0x5b89;for(const _0x42dd47 of _0x44df06){if(_0x42dd47[_0x324778(0x190)])for(const _0x2d9cd3 of _0x42dd47[_0x324778(0x190)]){if(_0x2d9cd3[_0x324778(0x14d)]===_0x324778(0x1fe)){const _0x540c51=_0x2d9cd3,_0x4cf289=_0x540c51[_0x324778(0x17b)][_0x324778(0x1a6)];if(_0x4cf289[_0x324778(0x14e)]&&_0x4cf289[_0x324778(0x181)]&&/^\d+$/[_0x324778(0x1a1)](_0x4cf289['journey'])&&/^\d+$/['test'](_0x4cf289[_0x324778(0x181)])){const _0x11a0e6=_0x4cf289[_0x324778(0x14e)]+':'+_0x4cf289[_0x324778(0x181)];!_0x3f6b2c[_0x324778(0x1dd)](_0x11a0e6)&&(_0x3f6b2c[_0x324778(0x1b5)](_0x11a0e6),_0x34718c[_0x324778(0x178)]({'journeyId':_0x4cf289['journey'],'stageId':_0x4cf289[_0x324778(0x181)]}));}}}}};if(_0x5485c0[_0x16f15a(0x1da)])for(const _0x5e19dd of _0x5485c0[_0x16f15a(0x1da)]){_0x2ef54b(_0x5e19dd[_0x16f15a(0x156)]);}_0x5485c0['stages']&&_0x2ef54b(_0x5485c0[_0x16f15a(0x156)]);if(_0x5485c0[_0x16f15a(0x17e)])for(const _0x35f8cd of _0x5485c0[_0x16f15a(0x17e)]){_0x2ef54b(_0x35f8cd[_0x16f15a(0x156)]);}}function replaceJumpTargetsInJourney(_0x275f75,_0x4bee97){const _0x2724bb=a122_0x5b89,_0x456604=_0x4db82f=>{const _0x2ec305=a122_0x5b89;for(const _0x10ddc4 of _0x4db82f){if(_0x10ddc4[_0x2ec305(0x190)])for(const _0x14b750 of _0x10ddc4[_0x2ec305(0x190)]){if(_0x14b750[_0x2ec305(0x14d)]===_0x2ec305(0x1fe)){const _0xb43a48=_0x14b750,_0x361a9f=_0xb43a48[_0x2ec305(0x17b)][_0x2ec305(0x1a6)],_0x422c39=_0x361a9f[_0x2ec305(0x14e)]+':'+_0x361a9f[_0x2ec305(0x181)],_0x22ad3b=_0x4bee97[_0x2ec305(0x1cb)](_0x422c39);_0x22ad3b&&(_0x361a9f['journey']=_0x22ad3b[_0x2ec305(0x1a5)],_0x361a9f[_0x2ec305(0x181)]=_0x22ad3b['stageName']);}}}};if(_0x275f75[_0x2724bb(0x1da)])for(const _0x421c84 of _0x275f75[_0x2724bb(0x1da)]){_0x456604(_0x421c84['stages']);}_0x275f75['stages']&&_0x456604(_0x275f75[_0x2724bb(0x156)]);if(_0x275f75[_0x2724bb(0x17e)])for(const _0x2e1864 of _0x275f75['versions']){_0x456604(_0x2e1864['stages']);}}function generateReadableStepName(_0x13f0d2,_0x1f2e08){const _0xd823=a122_0x5b89;if(_0x13f0d2['name']&&_0x13f0d2[_0xd823(0x17c)]!==_0x13f0d2[_0xd823(0x14d)]){const _0x24a98c=_0x13f0d2['name']['trim']();if(_0x24a98c&&/[a-z0-9]/i[_0xd823(0x1a1)](_0x24a98c))return _0x24a98c;}const _0x90e1cd=_0x13f0d2[_0xd823(0x14d)][_0xd823(0x1e5)]()['replace'](/step$/i,'');return _0x90e1cd+'_'+(_0x1f2e08+0x1);}function getStepNextRefs(_0x59d530){const _0x5ae9dd=a122_0x5b89,_0x513e56=[];if(_0x59d530['next'])_0x513e56[_0x5ae9dd(0x178)](_0x59d530['next']);if(_0x59d530[_0x5ae9dd(0x1f3)])for(const _0x482251 of _0x59d530[_0x5ae9dd(0x1f3)]){if(_0x482251[_0x5ae9dd(0x1eb)])_0x513e56[_0x5ae9dd(0x178)](_0x482251[_0x5ae9dd(0x1eb)]);}if(_0x59d530[_0x5ae9dd(0x16d)])for(const _0x5a4f64 of _0x59d530['variants']){if(_0x5a4f64[_0x5ae9dd(0x1eb)])_0x513e56['push'](_0x5a4f64[_0x5ae9dd(0x1eb)]);}if(_0x59d530['conditions'])for(const _0x1578d1 of _0x59d530[_0x5ae9dd(0x1b1)]){if(_0x1578d1['next'])_0x513e56[_0x5ae9dd(0x178)](_0x1578d1[_0x5ae9dd(0x1eb)]);}return _0x513e56;}function parseJumpTargetDisplayName(_0x5831c0){const _0x4740ef=_0x5831c0['match'](/^(.+?)\s*\(([^/)]+)/);if(!_0x4740ef)return undefined;const _0x419230=_0x4740ef[0x1]['trim'](),_0x4f96b1=_0x4740ef[0x2]['trim']();if(!_0x419230||!_0x4f96b1)return undefined;return{'stageName':_0x419230,'journeyName':_0x4f96b1};}function orderStepsFromRoot(_0x433b10,_0x17126f){const _0xeb1a3b=a122_0x5b89,_0x4e85d7=Object[_0xeb1a3b(0x1f8)](_0x433b10);if(_0x4e85d7[_0xeb1a3b(0x1d0)]===0x0)return[];const _0xaf6b14=new Set(_0x4e85d7['map'](([_0x2c80d0])=>_0x2c80d0)),_0xe35e19=new Set();for(const [,_0x50e7b9]of _0x4e85d7){for(const _0x18101b of getStepNextRefs(_0x50e7b9)){if(_0xaf6b14[_0xeb1a3b(0x1dd)](_0x18101b))_0xe35e19['add'](_0x18101b);}}let _0x23f479=_0x17126f&&_0xaf6b14['has'](_0x17126f)?_0x17126f:undefined;if(!_0x23f479){const _0x21269b=_0x4e85d7['filter'](([_0x5876d3])=>!_0xe35e19[_0xeb1a3b(0x1dd)](_0x5876d3));_0x21269b[_0xeb1a3b(0x1d0)]>0x0?_0x23f479=_0x21269b[0x0][0x0]:_0x23f479=_0x4e85d7[0x0][0x0];}const _0x5870a5=[],_0x3d7d78=new Set(),_0x1088f3=[_0x23f479];while(_0x1088f3[_0xeb1a3b(0x1d0)]>0x0){const _0x289512=_0x1088f3[_0xeb1a3b(0x206)]();if(_0x3d7d78[_0xeb1a3b(0x1dd)](_0x289512))continue;_0x3d7d78[_0xeb1a3b(0x1b5)](_0x289512);const _0x44bb08=_0x433b10[_0x289512];if(!_0x44bb08)continue;_0x5870a5[_0xeb1a3b(0x178)]({'uuid':_0x289512,'step':_0x44bb08});for(const _0x40e31c of getStepNextRefs(_0x44bb08)){_0xaf6b14[_0xeb1a3b(0x1dd)](_0x40e31c)&&!_0x3d7d78[_0xeb1a3b(0x1dd)](_0x40e31c)&&_0x1088f3[_0xeb1a3b(0x178)](_0x40e31c);}}for(const [_0x4592e2,_0x2e37d9]of _0x4e85d7){!_0x3d7d78[_0xeb1a3b(0x1dd)](_0x4592e2)&&_0x5870a5['push']({'uuid':_0x4592e2,'step':_0x2e37d9});}return _0x5870a5;}function resolveStepReferences(_0x1254ed,_0x1bb05e,_0x2e3f7f,_0x16d77d){const _0x236488=a122_0x5b89;if(_0x1254ed['type']!==_0x236488(0x15a)){_0x1254ed[_0x236488(0x1eb)]&&_0x16d77d[_0x236488(0x1dd)](_0x1254ed['next'])&&(_0x1254ed[_0x236488(0x1eb)]=_0x16d77d['get'](_0x1254ed[_0x236488(0x1eb)]));const _0x52a3d9=_0x1bb05e+0x1;if(_0x52a3d9<_0x2e3f7f[_0x236488(0x1d0)]){const _0x365030=_0x16d77d['get'](_0x2e3f7f[_0x52a3d9]['uuid']);_0x1254ed[_0x236488(0x1eb)]===_0x365030&&delete _0x1254ed[_0x236488(0x1eb)];}}if(_0x1254ed[_0x236488(0x14d)]===_0x236488(0x1ce))for(const _0xa305f5 of _0x1254ed[_0x236488(0x17b)][_0x236488(0x1f3)]){_0xa305f5[_0x236488(0x1eb)]&&_0x16d77d[_0x236488(0x1dd)](_0xa305f5[_0x236488(0x1eb)])&&(_0xa305f5[_0x236488(0x1eb)]=_0x16d77d['get'](_0xa305f5[_0x236488(0x1eb)]));}if(_0x1254ed[_0x236488(0x14d)]===_0x236488(0x16c))for(const _0x1d64fe of _0x1254ed[_0x236488(0x17b)]['variants']){_0x1d64fe[_0x236488(0x1eb)]&&_0x16d77d[_0x236488(0x1dd)](_0x1d64fe['next'])&&(_0x1d64fe['next']=_0x16d77d[_0x236488(0x1cb)](_0x1d64fe[_0x236488(0x1eb)]));}if(_0x1254ed['type']===_0x236488(0x1ee)&&_0x1254ed['with'][_0x236488(0x1ae)]){const _0x56d6e3=_0x1254ed[_0x236488(0x17b)][_0x236488(0x1ae)];_0x56d6e3['next']&&_0x16d77d[_0x236488(0x1dd)](_0x56d6e3[_0x236488(0x1eb)])&&(_0x56d6e3[_0x236488(0x1eb)]=_0x16d77d['get'](_0x56d6e3[_0x236488(0x1eb)])),_0x56d6e3[_0x236488(0x17a)]?.[_0x236488(0x1eb)]&&_0x16d77d[_0x236488(0x1dd)](_0x56d6e3[_0x236488(0x17a)][_0x236488(0x1eb)])&&(_0x56d6e3[_0x236488(0x17a)]['next']=_0x16d77d[_0x236488(0x1cb)](_0x56d6e3[_0x236488(0x17a)]['next']));}}function a122_0x41f4(){const _0x26ddf6=['length','latest','versionNumber','goal:','definition','Journey\x20YAML\x20versions[','unit','rootStep','activation_template_id','resolveEmbeddedSegmentId','journeys','day',']\x20missing\x20required\x20field:\x20name','has','activations:','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','waitUntilDate','description','journeyBundleName','excludedPath','bundle_name','toLowerCase','reentryMode','resolveActivationName','resolveJumpTarget','Expected\x20format:\x0a',':\x20maximum\x208\x20stages\x20allowed','next','entryCriteria','segment','wait','exit_criteria','820430MkJhgI','startsWith','Merge','branches','set','versions[','unique_id','state','entries','attributes','395064WfMMHq','conditionTimeoutUnit','\x20\x20\x20\x20conditions:\x0a','JOURNEY_SYNTAX_ERROR','jump','segment_id','allowReentry','Activation','includes','trim','duration','root_step','shift','waitStepUnit','replace','First\x20stage\x20of\x20the\x20journey','Unknown\x20segment\x20\x22','ref','].stages','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','launched','percentage','goal-segment','isJourneyLocal','stages:','\x27:\x20','conditionTimeoutDuration','resolveSegmentName','\x20\x20\x20\x20type:\x20','DecisionPoint','resolveSegment','Entry\x20Criteria','Met\x20condition(s)','Journey\x20YAML\x20','type','journey','segmentId','relationships','waitStep','exitCriteria','End','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20version\x20with\x20latest:\x20true','activations','stages','WaitStep','stageId','no_reentry','end','reentry',']\x20missing\x20required\x20field:\x20stages','2511275AquiYD','reentry_always','uniqueId','version','filter','exitCriterias','daysOfWeek','sort','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20journey\x20entry\x20with\x20latest:\x20true','customized_split','Send\x20Notification','Goal\x20Achieved','journeys:','\x20\x20rule:\x0a','ab_test','variants','journeyId','schedule','waitCondition','size','parentFolder','journeyActivationStepId','24FarZzN','folder_id','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','find','push','ref:','timeout','with','name','object','versions','merge','columns','stage','resolveEmbeddedActivationId','DaysOfTheWeek','Jump','153fUFHBL','Journey\x20description','resolveActivationId','journeyBundleId','Condition','Journey\x20YAML\x20journeys[','\x27.\x0a','Variant','segments','randomUUID','isArray','steps','version_number','moveAfter','draft','week','embedded','wait_until','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','segments:','(missing)','journeyStageId','conditionSegmentId','resolveJourneyId','resolveStageId','stageName','notification','Stage\x201','test','Duration','map','ABTest','journeyName','target','\x20\x20\x20\x20type:\x20And\x0a','uuid','days','rule','824196qAbXen','reentry:','data','condition','timedOutPath','AbTest','conditions',']\x20has\x20invalid\x20state:\x20','connector_config','2188KurZTQ','add','days_of_week','238WUwMOz','activation','behavior','bundle_id','*Max\x20wait\x20','2945223zrIGZt','journeyStages','from','all_columns','entry_criteria','Wait\x201\x20Day','189132RBPjzm','keys','milestone','Date','excluded','all','resolveSegmentId','waitStepType','resolveActivation','get','goal','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','decision_point','.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.'];a122_0x41f4=function(){return _0x26ddf6;};return a122_0x41f4();}function convertApiStageToYaml(_0x19e96){const _0x235669=a122_0x5b89,_0x4faba0={'name':_0x19e96[_0x235669(0x17c)]};_0x19e96['id']&&(_0x4faba0['id']=_0x19e96['id']);_0x19e96[_0x235669(0x1e1)]&&(_0x4faba0['description']=_0x19e96[_0x235669(0x1e1)]);_0x19e96[_0x235669(0x1ec)]&&(_0x4faba0['entry_criteria']=convertApiCriteriaToYaml(_0x19e96[_0x235669(0x1ec)]));_0x19e96[_0x235669(0x162)]&&_0x19e96[_0x235669(0x162)][_0x235669(0x1d0)]>0x0&&(_0x4faba0[_0x235669(0x1ef)]=_0x19e96[_0x235669(0x162)][_0x235669(0x1a3)](convertApiCriteriaToYaml));_0x19e96['milestone']&&(_0x4faba0[_0x235669(0x1c4)]=convertApiCriteriaToYaml(_0x19e96['milestone']));if(_0x19e96[_0x235669(0x190)]&&Object[_0x235669(0x1c3)](_0x19e96[_0x235669(0x190)])['length']>0x0){const _0x3ef623=orderStepsFromRoot(_0x19e96[_0x235669(0x190)],_0x19e96[_0x235669(0x1d7)]),_0x45f87b=new Map(),_0x2cac24=new Set();for(let _0x35ee20=0x0;_0x35ee20<_0x3ef623[_0x235669(0x1d0)];_0x35ee20++){const {uuid:_0x5727e7,step:_0x5a5519}=_0x3ef623[_0x35ee20];let _0x2f8a11=generateReadableStepName(_0x5a5519,_0x35ee20),_0x3c0a9b=_0x2f8a11,_0x14b598=0x2;while(_0x2cac24[_0x235669(0x1dd)](_0x3c0a9b)){_0x3c0a9b=_0x2f8a11+'_'+_0x14b598,_0x14b598++;}_0x2cac24['add'](_0x3c0a9b),_0x45f87b[_0x235669(0x1f4)](_0x5727e7,_0x3c0a9b);}_0x4faba0[_0x235669(0x190)]=_0x3ef623[_0x235669(0x1a3)](({uuid:_0x2d0f39,step:_0x22dac0},_0x315a98)=>{const _0x55f7bb=_0x235669,_0x1b2aae=convertApiStepToYaml(_0x22dac0,_0x45f87b[_0x55f7bb(0x1cb)](_0x2d0f39));return resolveStepReferences(_0x1b2aae,_0x315a98,_0x3ef623,_0x45f87b),_0x1b2aae;});}return _0x4faba0;}function convertApiCriteriaToYaml(_0x88e338){const _0x54696f=a122_0x5b89,_0x52fb97={'name':_0x88e338[_0x54696f(0x17c)],'segment':_0x88e338['segmentId']};_0x88e338[_0x54696f(0x1e1)]&&(_0x52fb97[_0x54696f(0x1e1)]=_0x88e338[_0x54696f(0x1e1)]);if(_0x88e338[_0x54696f(0x1a6)]){let _0x42bb3b=_0x88e338['target']['journeyId'],_0x2a05f4=_0x88e338['target'][_0x54696f(0x19a)];if(_0x88e338['target'][_0x54696f(0x1a5)]){const _0xfaed4e=parseJumpTargetDisplayName(_0x88e338[_0x54696f(0x1a6)]['journeyName']);_0xfaed4e&&(_0x2a05f4=_0xfaed4e[_0x54696f(0x19e)],_0x42bb3b=_0xfaed4e[_0x54696f(0x1a5)]);}_0x52fb97['target']={'journey':_0x42bb3b,'stage':_0x2a05f4},_0x88e338[_0x54696f(0x1a6)]['journeyBundleId']&&(_0x52fb97[_0x54696f(0x1a6)][_0x54696f(0x1ba)]=_0x88e338['target'][_0x54696f(0x188)]);}return _0x52fb97;}function convertApiStepToYaml(_0x152849,_0x30369a){const _0x5b8702=a122_0x5b89;switch(_0x152849[_0x5b8702(0x14d)]){case _0x5b8702(0x157):{const _0x26475d={};if(_0x152849[_0x5b8702(0x1c9)]===_0x5b8702(0x1a2)&&_0x152849[_0x5b8702(0x151)]!==undefined)_0x26475d[_0x5b8702(0x204)]=_0x152849['waitStep'],_0x26475d['unit']=_0x152849[_0x5b8702(0x207)];else{if(_0x152849['waitStepType']===_0x5b8702(0x1c5)&&_0x152849[_0x5b8702(0x1e0)])_0x26475d[_0x5b8702(0x196)]=_0x152849['waitUntilDate'];else{if(_0x152849['waitStepType']===_0x5b8702(0x183)&&_0x152849[_0x5b8702(0x163)])_0x26475d[_0x5b8702(0x1b6)]=_0x152849['daysOfWeek'];else{if(_0x152849[_0x5b8702(0x1c9)]==='Condition'){if(_0x152849[_0x5b8702(0x1b1)]&&_0x152849[_0x5b8702(0x1b1)][_0x5b8702(0x1d0)]>0x0){const _0x5d72ba=_0x152849[_0x5b8702(0x1b1)][_0x5b8702(0x177)](_0x5933a7=>!_0x5933a7[_0x5b8702(0x1af)]),_0x3bd51e=_0x152849[_0x5b8702(0x1b1)]['find'](_0x519c6a=>_0x519c6a[_0x5b8702(0x1af)]);_0x5d72ba?.['segmentId']&&(_0x26475d[_0x5b8702(0x1ae)]={'segment':_0x5d72ba[_0x5b8702(0x14f)],..._0x5d72ba[_0x5b8702(0x1eb)]?{'next':_0x5d72ba[_0x5b8702(0x1eb)]}:{}},_0x3bd51e&&_0x3bd51e['moveAfter']!==undefined&&_0x3bd51e[_0x5b8702(0x1d6)]&&(_0x26475d['condition'][_0x5b8702(0x17a)]={'duration':_0x3bd51e[_0x5b8702(0x192)],'unit':_0x3bd51e['unit'],..._0x3bd51e[_0x5b8702(0x1eb)]?{'next':_0x3bd51e[_0x5b8702(0x1eb)]}:{}}));}else _0x152849[_0x5b8702(0x19b)]&&(_0x26475d[_0x5b8702(0x1ae)]={'segment':_0x152849[_0x5b8702(0x19b)]},_0x152849[_0x5b8702(0x145)]!==undefined&&_0x152849['conditionTimeoutUnit']&&(_0x26475d['condition']['timeout']={'duration':_0x152849[_0x5b8702(0x145)],'unit':_0x152849['conditionTimeoutUnit']}));}}}}const _0x21ce16={'type':'wait','name':_0x30369a,..._0x152849[_0x5b8702(0x1eb)]?{'next':_0x152849[_0x5b8702(0x1eb)]}:{},'with':_0x26475d};return _0x21ce16;}case _0x5b8702(0x201):{const _0x2f6cab={'type':_0x5b8702(0x1b8),'name':_0x30369a,..._0x152849[_0x5b8702(0x1eb)]?{'next':_0x152849[_0x5b8702(0x1eb)]}:{},'with':{'activation':_0x152849[_0x5b8702(0x173)]||''}};return _0x2f6cab;}case _0x5b8702(0x148):{const _0x385021={'type':_0x5b8702(0x1ce),'name':_0x30369a,..._0x152849['next']?{'next':_0x152849[_0x5b8702(0x1eb)]}:{},'with':{'branches':(_0x152849[_0x5b8702(0x1f3)]||[])[_0x5b8702(0x1a3)](_0x364261=>({'name':_0x364261['name'],'segment':_0x364261[_0x5b8702(0x14f)],'excluded':_0x364261[_0x5b8702(0x1e3)],..._0x364261[_0x5b8702(0x1eb)]?{'next':_0x364261[_0x5b8702(0x1eb)]}:{}}))}};return _0x385021;}case _0x5b8702(0x1a4):case _0x5b8702(0x1b0):case _0x5b8702(0x18c):{const _0x3f1f6e=_0x152849[_0x5b8702(0x16d)]||(_0x152849[_0x5b8702(0x1f3)]||[])[_0x5b8702(0x1a3)](_0x3b3b3e=>({'name':_0x3b3b3e['name'],'percentage':0x0,'next':_0x3b3b3e['next']})),_0x2fbeac={'type':_0x5b8702(0x16c),'name':_0x30369a,..._0x152849[_0x5b8702(0x1eb)]?{'next':_0x152849[_0x5b8702(0x1eb)]}:{},'with':{'customized_split':_0x152849['customizedSplit'],'unique_id':_0x152849[_0x5b8702(0x15f)],'variants':_0x3f1f6e[_0x5b8702(0x1a3)](_0x140c5d=>({'name':_0x140c5d[_0x5b8702(0x17c)],'percentage':_0x140c5d['percentage'],..._0x140c5d[_0x5b8702(0x1eb)]?{'next':_0x140c5d[_0x5b8702(0x1eb)]}:{}}))}};return _0x2fbeac;}case _0x5b8702(0x1f2):{const _0x931636={'type':'merge','name':_0x30369a,..._0x152849[_0x5b8702(0x1eb)]?{'next':_0x152849[_0x5b8702(0x1eb)]}:{}};return _0x931636;}case'Jump':{let _0x56a892='',_0x177d01='',_0x30c626;if(_0x152849[_0x5b8702(0x1a6)]){_0x56a892=_0x152849[_0x5b8702(0x1a6)][_0x5b8702(0x16e)],_0x177d01=_0x152849[_0x5b8702(0x1a6)][_0x5b8702(0x19a)],_0x30c626=_0x152849[_0x5b8702(0x1a6)][_0x5b8702(0x188)];if(_0x152849[_0x5b8702(0x1a6)][_0x5b8702(0x1a5)]){const _0x33e65d=parseJumpTargetDisplayName(_0x152849[_0x5b8702(0x1a6)][_0x5b8702(0x1a5)]);_0x33e65d&&(_0x177d01=_0x33e65d[_0x5b8702(0x19e)],_0x56a892=_0x33e65d[_0x5b8702(0x1a5)]);}}const _0x4521d0={'type':_0x5b8702(0x1fe),'name':_0x30369a,..._0x152849['next']?{'next':_0x152849[_0x5b8702(0x1eb)]}:{},'with':{'target':{'journey':_0x56a892,'stage':_0x177d01,..._0x30c626?{'bundle_id':_0x30c626}:{}}}};return _0x4521d0;}case'End':{const _0x479305={'type':_0x5b8702(0x15a),'name':_0x30369a};return _0x479305;}default:{const _0x50f527={'type':'end','name':_0x30369a};return _0x50f527;}}}export async function journeyDefToRequest(_0x11ec56,_0x227b6c,_0x1ddcbf){const _0x359ff1=a122_0x5b89,_0x45cf54=_0x11ec56[_0x359ff1(0x156)]||getActiveStages(_0x11ec56),_0xa6f4ce=isJourneysArrayMode(_0x11ec56)||isMultiVersionMode(_0x11ec56)?getLatestJourneyEntry(_0x11ec56):undefined,_0x52726a=_0xa6f4ce?.[_0x359ff1(0x160)]??_0x11ec56[_0x359ff1(0x17c)],_0x468920=_0x11ec56['segments']||{},_0x2ac3cf=_0x11ec56[_0x359ff1(0x155)]||{},_0xca0700={'type':_0x359ff1(0x14e),'attributes':{'name':_0x52726a,'audienceId':_0x227b6c,'journeyStages':await Promise[_0x359ff1(0x1c7)](_0x45cf54[_0x359ff1(0x1a3)](_0x5be668=>convertYamlStageToApi(_0x5be668,_0x1ddcbf,_0x468920,_0x2ac3cf)))}},_0x3e1785=_0xa6f4ce?.['id']??_0x11ec56['id'];_0x3e1785&&(_0xca0700['id']=_0x3e1785);_0x11ec56['description']&&(_0xca0700[_0x359ff1(0x1f9)][_0x359ff1(0x1e1)]=_0x11ec56[_0x359ff1(0x1e1)]);const _0x1485a4=getEffectiveGoal(_0x11ec56);_0x1485a4&&(_0xca0700[_0x359ff1(0x1f9)][_0x359ff1(0x1cc)]=await convertYamlCriteriaToApi(_0x1485a4,_0x1ddcbf,_0x468920));const _0x2e2a04=getEffectiveReentry(_0x11ec56);return _0x2e2a04&&(_0xca0700[_0x359ff1(0x1f9)]['reentryMode']=_0x2e2a04,_0xca0700[_0x359ff1(0x1f9)][_0x359ff1(0x200)]=_0x2e2a04!==_0x359ff1(0x159)),_0x11ec56['folder_id']&&(_0xca0700['relationships']={'parentFolder':{'data':{'id':_0x11ec56['folder_id'],'type':'folder'}}}),_0xca0700;}async function convertYamlStageToApi(_0x34600f,_0x566b40,_0x285827={},_0x4a8d28={}){const _0x3fe27c=a122_0x5b89,_0x58d2fe={'name':_0x34600f[_0x3fe27c(0x17c)]};_0x34600f['id']&&(_0x58d2fe['id']=_0x34600f['id']);_0x34600f[_0x3fe27c(0x1e1)]&&(_0x58d2fe[_0x3fe27c(0x1e1)]=_0x34600f[_0x3fe27c(0x1e1)]);_0x34600f[_0x3fe27c(0x1c0)]&&(_0x58d2fe[_0x3fe27c(0x1ec)]=await convertYamlCriteriaToApi(_0x34600f[_0x3fe27c(0x1c0)],_0x566b40,_0x285827));_0x34600f['exit_criteria']&&_0x34600f[_0x3fe27c(0x1ef)][_0x3fe27c(0x1d0)]>0x0&&(_0x58d2fe[_0x3fe27c(0x162)]=await Promise[_0x3fe27c(0x1c7)](_0x34600f[_0x3fe27c(0x1ef)][_0x3fe27c(0x1a3)](_0x46a686=>convertYamlCriteriaToApi(_0x46a686,_0x566b40,_0x285827))));_0x34600f[_0x3fe27c(0x1c4)]&&(_0x58d2fe['milestone']=await convertYamlCriteriaToApi(_0x34600f[_0x3fe27c(0x1c4)],_0x566b40,_0x285827));if(_0x34600f['steps']&&_0x34600f[_0x3fe27c(0x190)][_0x3fe27c(0x1d0)]>0x0){const _0x1d7746={},_0xf7ef2=_0x34600f[_0x3fe27c(0x190)][_0x3fe27c(0x1a3)]((_0x240854,_0x471a87)=>{const _0x40f831=_0x3fe27c,_0x2e7e14=_0x240854[_0x40f831(0x1a8)]||generateUUID(),_0xda4263=_0x240854[_0x40f831(0x17c)]||_0x240854[_0x40f831(0x14d)]+'_'+_0x471a87;return _0x1d7746[_0xda4263]=_0x2e7e14,{..._0x240854,'name':_0xda4263};});_0x58d2fe[_0x3fe27c(0x1d7)]=_0x1d7746[_0xf7ef2[0x0]['name']],_0x58d2fe[_0x3fe27c(0x190)]={};for(let _0x32d879=0x0;_0x32d879<_0xf7ef2[_0x3fe27c(0x1d0)];_0x32d879++){const _0x4bf68b=_0xf7ef2[_0x32d879],_0x5dd266=_0x1d7746[_0x4bf68b[_0x3fe27c(0x17c)]],_0x563223=!_0x4bf68b['next']&&_0x32d879<_0xf7ef2['length']-0x1&&_0x4bf68b['type']!==_0x3fe27c(0x15a)?_0xf7ef2[_0x32d879+0x1][_0x3fe27c(0x17c)]:_0x4bf68b['next'],_0x418edf=_0x563223!==_0x4bf68b[_0x3fe27c(0x1eb)]?{..._0x4bf68b,'next':_0x563223}:_0x4bf68b;_0x58d2fe[_0x3fe27c(0x190)][_0x5dd266]=await convertYamlStepToApi(_0x418edf,_0x566b40,_0x285827,_0x1d7746,_0x4a8d28);}}else _0x34600f[_0x3fe27c(0x205)]&&(_0x58d2fe[_0x3fe27c(0x1d7)]=_0x34600f['root_step']);return _0x58d2fe;}async function convertYamlCriteriaToApi(_0x1e41a4,_0x20f2ac,_0x293adb={}){const _0x212b3c=a122_0x5b89;let _0x37c8f8=_0x1e41a4[_0x212b3c(0x1ed)];if(_0x37c8f8&&!/^\d+$/[_0x212b3c(0x1a1)](_0x37c8f8)){const _0x3d3fe5=parseSegmentRef(_0x37c8f8);if(_0x3d3fe5[_0x212b3c(0x14d)]==='ref')_0x20f2ac?.['resolveSegmentId']&&(_0x37c8f8=await _0x20f2ac[_0x212b3c(0x1c8)](_0x3d3fe5['name']));else{if(_0x3d3fe5['type']===_0x212b3c(0x195)&&_0x293adb[_0x3d3fe5[_0x212b3c(0x17c)]])_0x20f2ac?.[_0x212b3c(0x1d9)]&&(_0x37c8f8=await _0x20f2ac[_0x212b3c(0x1d9)](_0x3d3fe5[_0x212b3c(0x17c)],_0x293adb[_0x3d3fe5[_0x212b3c(0x17c)]]));else _0x20f2ac?.[_0x212b3c(0x1c8)]&&(_0x37c8f8=await _0x20f2ac['resolveSegmentId'](_0x3d3fe5[_0x212b3c(0x17c)]));}}const _0x170f09={'name':_0x1e41a4['name'],'segmentId':_0x37c8f8};_0x1e41a4[_0x212b3c(0x1e1)]&&(_0x170f09[_0x212b3c(0x1e1)]=_0x1e41a4[_0x212b3c(0x1e1)]);if(_0x1e41a4[_0x212b3c(0x1a6)]){const _0x2110a9=_0x1e41a4[_0x212b3c(0x1a6)][_0x212b3c(0x14e)],_0x2ce913=_0x1e41a4[_0x212b3c(0x1a6)][_0x212b3c(0x181)];let _0x268566=_0x1e41a4[_0x212b3c(0x1a6)]['journey'];_0x20f2ac?.['resolveJourneyId']&&!/^\d+$/[_0x212b3c(0x1a1)](_0x268566)&&(_0x268566=await _0x20f2ac[_0x212b3c(0x19c)](_0x268566));let _0x5e0dc9=_0x1e41a4[_0x212b3c(0x1a6)]['stage'];_0x20f2ac?.['resolveStageId']&&!/^\d+$/[_0x212b3c(0x1a1)](_0x5e0dc9)&&(_0x5e0dc9=await _0x20f2ac[_0x212b3c(0x19d)](_0x268566,_0x5e0dc9));const _0x181d83=!/^\d+$/[_0x212b3c(0x1a1)](_0x2110a9)&&!isLocalJourneyRef(_0x2110a9)?formatApiJourneyName(_0x2110a9,_0x2ce913):undefined;_0x170f09[_0x212b3c(0x1a6)]={'journeyId':_0x268566,'journeyStageId':_0x5e0dc9,'journeyName':_0x181d83,'confirmed':!![]},_0x1e41a4['target'][_0x212b3c(0x1ba)]&&(_0x170f09[_0x212b3c(0x1a6)][_0x212b3c(0x188)]=_0x1e41a4[_0x212b3c(0x1a6)][_0x212b3c(0x1ba)]);}return _0x170f09;}async function convertYamlStepToApi(_0x14dd1c,_0x4d4ab6,_0x393da7={},_0x38f5ef={},_0x4180c1={}){const _0x28058b=a122_0x5b89,_0x42414b=async _0x5c1a6a=>{const _0x5929f3=a122_0x5b89;if(/^\d+$/[_0x5929f3(0x1a1)](_0x5c1a6a))return _0x5c1a6a;const _0x2b5963=parseSegmentRef(_0x5c1a6a);if(_0x2b5963[_0x5929f3(0x14d)]===_0x5929f3(0x20b)){if(_0x4d4ab6?.['resolveSegmentId'])return await _0x4d4ab6['resolveSegmentId'](_0x2b5963['name']);}else{if(_0x2b5963[_0x5929f3(0x14d)]===_0x5929f3(0x195)&&_0x393da7[_0x2b5963[_0x5929f3(0x17c)]]){if(_0x4d4ab6?.[_0x5929f3(0x1d9)])return await _0x4d4ab6['resolveEmbeddedSegmentId'](_0x2b5963[_0x5929f3(0x17c)],_0x393da7[_0x2b5963[_0x5929f3(0x17c)]]);}else{if(_0x4d4ab6?.['resolveSegmentId'])return await _0x4d4ab6[_0x5929f3(0x1c8)](_0x2b5963[_0x5929f3(0x17c)]);}}return _0x5c1a6a;},_0xd76324=async _0x2ef92e=>{const _0xbaab21=a122_0x5b89;if(/^\d+$/[_0xbaab21(0x1a1)](_0x2ef92e))return _0x2ef92e;const _0x53ff68=parseSegmentRef(_0x2ef92e);if(_0x53ff68[_0xbaab21(0x14d)]===_0xbaab21(0x20b)){if(_0x4d4ab6?.[_0xbaab21(0x187)])return await _0x4d4ab6['resolveActivationId'](_0x53ff68[_0xbaab21(0x17c)]);return _0x53ff68[_0xbaab21(0x17c)];}else{if(_0x53ff68[_0xbaab21(0x14d)]==='embedded'&&_0x4180c1[_0x53ff68[_0xbaab21(0x17c)]]){if(_0x4d4ab6?.[_0xbaab21(0x182)])return await _0x4d4ab6[_0xbaab21(0x182)](_0x53ff68[_0xbaab21(0x17c)],_0x4180c1[_0x53ff68[_0xbaab21(0x17c)]]);if(_0x4d4ab6?.['resolveActivationId'])return await _0x4d4ab6[_0xbaab21(0x187)](_0x53ff68[_0xbaab21(0x17c)]);}else{if(_0x4d4ab6?.['resolveActivationId'])return await _0x4d4ab6['resolveActivationId'](_0x53ff68[_0xbaab21(0x17c)]);}}return _0x2ef92e;},_0x4141f1=_0x101600=>{const _0x226482=a122_0x5b89;if(!_0x101600)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x226482(0x1a1)](_0x101600))return _0x101600;return _0x38f5ef[_0x101600]||_0x101600;};switch(_0x14dd1c[_0x28058b(0x14d)]){case _0x28058b(0x1ee):{const _0x4bfdb=_0x14dd1c,_0x54e0f8=_0x4bfdb[_0x28058b(0x17b)],_0x17e192={'type':_0x28058b(0x157),'name':_0x4bfdb[_0x28058b(0x17c)],'next':_0x4141f1(_0x4bfdb['next'])};if(_0x54e0f8[_0x28058b(0x204)]!==undefined&&_0x54e0f8['unit'])_0x17e192['waitStepType']=_0x28058b(0x1a2),_0x17e192[_0x28058b(0x151)]=_0x54e0f8[_0x28058b(0x204)],_0x17e192[_0x28058b(0x207)]=normalizeWaitUnit(_0x54e0f8[_0x28058b(0x1d6)]);else{if(_0x54e0f8['wait_until'])_0x17e192[_0x28058b(0x1c9)]=_0x28058b(0x1c5),_0x17e192[_0x28058b(0x1e0)]=_0x54e0f8[_0x28058b(0x196)];else{if(_0x54e0f8[_0x28058b(0x1b6)])_0x17e192[_0x28058b(0x1c9)]=_0x28058b(0x183),_0x17e192['daysOfWeek']=_0x54e0f8[_0x28058b(0x1b6)];else{if(_0x54e0f8[_0x28058b(0x1ae)]){_0x17e192[_0x28058b(0x1c9)]=_0x28058b(0x189);const _0x22672d=await _0x42414b(_0x54e0f8[_0x28058b(0x1ae)][_0x28058b(0x1ed)]),_0x41b1de=_0x54e0f8['condition']['timeout']?.['next']!==undefined;if(_0x41b1de){const _0x2bcfe7=[];_0x2bcfe7['push']({'id':generateUUID(),'segmentId':_0x22672d,'timedOutPath':![],'name':_0x28058b(0x14b),'next':_0x4141f1(_0x54e0f8[_0x28058b(0x1ae)][_0x28058b(0x1eb)]??_0x4bfdb[_0x28058b(0x1eb)])});if(_0x54e0f8['condition'][_0x28058b(0x17a)]){const _0x2815dd=_0x54e0f8['condition']['timeout'][_0x28058b(0x204)],_0x200fe2=normalizeWaitUnit(_0x54e0f8['condition'][_0x28058b(0x17a)][_0x28058b(0x1d6)]);_0x2bcfe7['push']({'id':generateUUID(),'timedOutPath':!![],'name':_0x28058b(0x1bb)+_0x2815dd+'\x20'+_0x200fe2,'moveAfter':_0x2815dd,'unit':_0x200fe2,'next':_0x4141f1(_0x54e0f8[_0x28058b(0x1ae)][_0x28058b(0x17a)][_0x28058b(0x1eb)])});}_0x17e192[_0x28058b(0x1b1)]=_0x2bcfe7,delete _0x17e192[_0x28058b(0x1eb)];}else _0x17e192[_0x28058b(0x19b)]=_0x22672d,_0x54e0f8['condition'][_0x28058b(0x17a)]&&(_0x17e192[_0x28058b(0x145)]=_0x54e0f8[_0x28058b(0x1ae)][_0x28058b(0x17a)]['duration'],_0x54e0f8['condition'][_0x28058b(0x17a)][_0x28058b(0x1d6)]&&(_0x17e192[_0x28058b(0x1fb)]=normalizeWaitUnit(_0x54e0f8[_0x28058b(0x1ae)][_0x28058b(0x17a)][_0x28058b(0x1d6)])));}}}}return _0x17e192;}case'activation':{const _0x48a3fb=_0x14dd1c,_0x5b1c4f=_0x48a3fb[_0x28058b(0x17b)][_0x28058b(0x1b8)],_0x4f4f9f=await _0xd76324(_0x5b1c4f);return{'type':_0x28058b(0x201),'name':_0x48a3fb[_0x28058b(0x17c)],'journeyActivationStepId':_0x4f4f9f,'next':_0x4141f1(_0x48a3fb[_0x28058b(0x1eb)])};}case _0x28058b(0x1ce):{const _0x4a4935=_0x14dd1c,_0x12d874=_0x4a4935[_0x28058b(0x17b)][_0x28058b(0x1f3)];return{'type':_0x28058b(0x148),'name':_0x4a4935[_0x28058b(0x17c)],'branches':await Promise['all'](_0x12d874['map'](async _0x5f3b3b=>{const _0x35189d=_0x28058b;let _0x39b9fe='';if(!_0x5f3b3b[_0x35189d(0x1c6)]){const _0x1412b8=_0x5f3b3b[_0x35189d(0x1ed)]||_0x5f3b3b[_0x35189d(0x1ff)]||'';_0x39b9fe=_0x1412b8?await _0x42414b(_0x1412b8):'';}return{'id':crypto[_0x35189d(0x18e)](),'name':_0x5f3b3b[_0x35189d(0x17c)],'description':null,'segmentId':_0x39b9fe,'excludedPath':_0x5f3b3b[_0x35189d(0x1c6)]??![],'next':_0x4141f1(_0x5f3b3b[_0x35189d(0x1eb)])};})),'next':_0x4141f1(_0x4a4935[_0x28058b(0x1eb)])};}case'ab_test':{const _0x5471e1=_0x14dd1c,_0x24f848=_0x5471e1[_0x28058b(0x17b)];return{'type':_0x28058b(0x1a4),'name':_0x5471e1[_0x28058b(0x17c)],'customizedSplit':_0x24f848[_0x28058b(0x167)],'uniqueId':_0x24f848['unique_id'],'variants':_0x24f848[_0x28058b(0x16d)][_0x28058b(0x1a3)](_0x32a12a=>({'id':_0x32a12a['id']||generateUUID(),'name':_0x32a12a['name'],'percentage':_0x32a12a[_0x28058b(0x140)],'next':_0x4141f1(_0x32a12a[_0x28058b(0x1eb)])})),'next':_0x4141f1(_0x5471e1[_0x28058b(0x1eb)])};}case _0x28058b(0x17f):return{'type':_0x28058b(0x1f2),'name':_0x14dd1c[_0x28058b(0x17c)],'next':_0x4141f1(_0x14dd1c[_0x28058b(0x1eb)])};case _0x28058b(0x1fe):{const _0x9b317=_0x14dd1c,_0x36e2f8=_0x9b317['with'][_0x28058b(0x1a6)],_0x3a3a8a=_0x36e2f8['journey'],_0x520074=_0x36e2f8[_0x28058b(0x181)];let _0xb4b3b=_0x36e2f8['journey'];_0x4d4ab6?.[_0x28058b(0x19c)]&&!/^\d+$/[_0x28058b(0x1a1)](_0xb4b3b)&&(_0xb4b3b=await _0x4d4ab6[_0x28058b(0x19c)](_0xb4b3b));let _0x12cb51=_0x36e2f8[_0x28058b(0x181)];_0x4d4ab6?.[_0x28058b(0x19d)]&&!/^\d+$/['test'](_0x12cb51)&&(_0x12cb51=await _0x4d4ab6[_0x28058b(0x19d)](_0xb4b3b,_0x12cb51));const _0x3133e3=!/^\d+$/[_0x28058b(0x1a1)](_0x3a3a8a)&&!isLocalJourneyRef(_0x3a3a8a)?formatApiJourneyName(_0x3a3a8a,_0x520074):undefined;return{'type':_0x28058b(0x184),'name':_0x9b317['name'],'target':{'journeyId':_0xb4b3b,'journeyStageId':_0x12cb51,'journeyBundleId':_0x36e2f8[_0x28058b(0x1ba)],'journeyName':_0x3133e3,'confirmed':!![]},'next':_0x4141f1(_0x9b317[_0x28058b(0x1eb)])};}case _0x28058b(0x15a):return{'type':_0x28058b(0x153),'name':_0x14dd1c[_0x28058b(0x17c)]};default:{const _0x85b594=_0x14dd1c;return{'type':_0x28058b(0x153),'name':_0x85b594['name']};}}}export function toYamlString(_0x46a947){const _0x20242a=a122_0x5b89,_0x46e135=stripInternalFields(_0x46a947),_0x1f80cc=a122_0x5edf9b['stringify'](_0x46e135,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x3af4b9=[_0x20242a(0x198),_0x20242a(0x1de),_0x20242a(0x1d3),_0x20242a(0x1ac),_0x20242a(0x16a),_0x20242a(0x143),'versions:'];let _0x57b822=_0x1f80cc;for(const _0x346a44 of _0x3af4b9){_0x57b822=_0x57b822[_0x20242a(0x208)](new RegExp('^('+_0x346a44+')','m'),(_0x33cf40,_0x234d45,_0x5cf38c)=>{if(_0x5cf38c===0x0||_0x57b822[_0x5cf38c-0x1]==='\x0a'&&_0x57b822[_0x5cf38c-0x2]==='\x0a')return _0x234d45;return'\x0a'+_0x234d45;});}return _0x57b822;}function stripInternalFields(_0x253edf){const _0x34d7e8=a122_0x5b89,{id:_0x55f00e,folder_id:_0x1407a6,bundle_id:_0x20fc12,bundle_name:_0x54909e,version:_0x10cd88,version_number:_0x4f01cf,allow_reentry:_0x5375d1,..._0x368395}=_0x253edf;return _0x368395[_0x34d7e8(0x1da)]&&(_0x368395[_0x34d7e8(0x1da)]=_0x368395[_0x34d7e8(0x1da)][_0x34d7e8(0x1a3)](_0x5af321=>{const _0xa686e2=_0x34d7e8,{id:_0x1b8d7a,version_number:_0x5c7f71,..._0x1234fd}=_0x5af321;return{..._0x1234fd,'stages':_0x1234fd['stages'][_0xa686e2(0x1a3)](stripStageInternalFields),..._0x5af321[_0xa686e2(0x1d1)]===!![]?{'latest':!![]}:{},..._0x368395[_0xa686e2(0x1da)][_0xa686e2(0x1d0)]===0x1&&_0x1234fd[_0xa686e2(0x160)]==='v1'?{'version':undefined}:{}};})),_0x368395[_0x34d7e8(0x156)]&&(_0x368395[_0x34d7e8(0x156)]=_0x368395[_0x34d7e8(0x156)][_0x34d7e8(0x1a3)](stripStageInternalFields)),_0x368395[_0x34d7e8(0x17e)]&&(_0x368395[_0x34d7e8(0x17e)]=_0x368395[_0x34d7e8(0x17e)][_0x34d7e8(0x1a3)](_0x27784c=>{const _0x20e113=_0x34d7e8,{id:_0xc9c157,version_number:_0x1988ab,..._0x3d3ac7}=_0x27784c;return{..._0x3d3ac7,'stages':_0x3d3ac7[_0x20e113(0x156)][_0x20e113(0x1a3)](stripStageInternalFields),..._0x27784c[_0x20e113(0x1d1)]===!![]?{'latest':!![]}:{}};})),_0x368395;}function stripStageInternalFields(_0x177d50){const {id:_0x586189,..._0x47fe23}=_0x177d50;return _0x47fe23;}export function parseYamlString(_0x401bb9){const _0x3a6236=a122_0x5b89,_0x28afae=a122_0x5edf9b['parse'](_0x401bb9);if(_0x28afae[_0x3a6236(0x14d)]!==_0x3a6236(0x14e))throw new SDKError(ErrorCode[_0x3a6236(0x1fd)],'Journey\x20YAML\x20must\x20have\x20type:\x20journey');if(!_0x28afae[_0x3a6236(0x17c)])throw new SDKError(ErrorCode[_0x3a6236(0x1fd)],'Journey\x20YAML\x20missing\x20required\x20field:\x20name');const _0x591b27=_0x28afae['journeys']&&Array[_0x3a6236(0x18f)](_0x28afae['journeys'])&&_0x28afae[_0x3a6236(0x1da)][_0x3a6236(0x1d0)]>0x0,_0x324fa5=_0x28afae[_0x3a6236(0x156)]&&Array[_0x3a6236(0x18f)](_0x28afae[_0x3a6236(0x156)])&&_0x28afae['stages'][_0x3a6236(0x1d0)]>0x0,_0x5a5d13=_0x28afae[_0x3a6236(0x17e)]&&Array[_0x3a6236(0x18f)](_0x28afae['versions'])&&_0x28afae[_0x3a6236(0x17e)]['length']>0x0,_0x4a60b2=[_0x591b27,_0x324fa5,_0x5a5d13][_0x3a6236(0x161)](Boolean)[_0x3a6236(0x1d0)];if(_0x4a60b2>0x1)throw new SDKError(ErrorCode[_0x3a6236(0x1fd)],'Journey\x20YAML\x20cannot\x20have\x20multiple\x20format\x20fields\x20(journeys,\x20stages,\x20versions).\x20Use\x20only\x20one\x20format.');if(_0x4a60b2===0x0)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Journey\x20YAML\x20must\x20have\x20journeys\x20array\x20(recommended),\x20stages\x20(legacy),\x20or\x20versions\x20(legacy)');if(_0x591b27){for(let _0x585d05=0x0;_0x585d05<_0x28afae[_0x3a6236(0x1da)]['length'];_0x585d05++){const _0x250cf0=_0x28afae[_0x3a6236(0x1da)][_0x585d05];if(!_0x250cf0[_0x3a6236(0x156)]||!Array['isArray'](_0x250cf0[_0x3a6236(0x156)])||_0x250cf0[_0x3a6236(0x156)][_0x3a6236(0x1d0)]===0x0)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Journey\x20YAML\x20journeys['+_0x585d05+_0x3a6236(0x15c));if(_0x250cf0[_0x3a6236(0x1f7)]&&![_0x3a6236(0x193),_0x3a6236(0x13f)][_0x3a6236(0x202)](_0x250cf0[_0x3a6236(0x1f7)]))throw new SDKError(ErrorCode[_0x3a6236(0x1fd)],_0x3a6236(0x18a)+_0x585d05+_0x3a6236(0x1b2)+_0x250cf0[_0x3a6236(0x1f7)]+'.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.');validateStages(_0x250cf0[_0x3a6236(0x156)],'journeys['+_0x585d05+_0x3a6236(0x13d));}const _0x28e7ad=_0x28afae['journeys']['filter'](_0xec16ff=>_0xec16ff[_0x3a6236(0x1d1)]===!![])[_0x3a6236(0x1d0)];if(_0x28e7ad>0x1)throw new SDKError(ErrorCode[_0x3a6236(0x1fd)],_0x3a6236(0x166));}_0x324fa5&&validateStages(_0x28afae[_0x3a6236(0x156)],_0x3a6236(0x156));if(_0x5a5d13){for(let _0x13de0d=0x0;_0x13de0d<_0x28afae[_0x3a6236(0x17e)][_0x3a6236(0x1d0)];_0x13de0d++){const _0x1b9cc4=_0x28afae[_0x3a6236(0x17e)][_0x13de0d];if(!_0x1b9cc4['name'])throw new SDKError(ErrorCode[_0x3a6236(0x1fd)],_0x3a6236(0x1d5)+_0x13de0d+_0x3a6236(0x1dc));if(!_0x1b9cc4['state']||![_0x3a6236(0x193),_0x3a6236(0x13f)][_0x3a6236(0x202)](_0x1b9cc4[_0x3a6236(0x1f7)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Journey\x20YAML\x20versions['+_0x13de0d+_0x3a6236(0x1b2)+_0x1b9cc4[_0x3a6236(0x1f7)]+_0x3a6236(0x1cf));if(!_0x1b9cc4[_0x3a6236(0x156)]||!Array[_0x3a6236(0x18f)](_0x1b9cc4[_0x3a6236(0x156)])||_0x1b9cc4['stages'][_0x3a6236(0x1d0)]===0x0)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x3a6236(0x1d5)+_0x13de0d+_0x3a6236(0x15c));validateStages(_0x1b9cc4[_0x3a6236(0x156)],_0x3a6236(0x1f5)+_0x13de0d+_0x3a6236(0x13d));}const _0x285e7d=_0x28afae[_0x3a6236(0x17e)][_0x3a6236(0x161)](_0x12dd75=>_0x12dd75[_0x3a6236(0x1d1)]===!![])['length'];if(_0x285e7d>0x1)throw new SDKError(ErrorCode[_0x3a6236(0x1fd)],_0x3a6236(0x154));}return _0x28afae;}function validateStages(_0x2ec1c3,_0x43a860){const _0x599a1d=a122_0x5b89;if(_0x2ec1c3[_0x599a1d(0x1d0)]>0x8)throw new SDKError(ErrorCode[_0x599a1d(0x1fd)],_0x599a1d(0x14c)+_0x43a860+_0x599a1d(0x1ea));}export function isJourneyDef(_0x39a7d6){const _0x1f0faf=a122_0x5b89;return typeof _0x39a7d6===_0x1f0faf(0x17d)&&_0x39a7d6!==null&&_0x1f0faf(0x14d)in _0x39a7d6&&_0x39a7d6['type']===_0x1f0faf(0x14e);}export function generateTemplate(_0x42d0ca,_0xc92dae){const _0x11a1a1=a122_0x5b89,_0x2c43ae={'type':_0x11a1a1(0x14e),'name':_0x42d0ca,'description':_0x11a1a1(0x186),'reentry':_0x11a1a1(0x159),'goal':{'name':_0x11a1a1(0x169),'segment':_0x11a1a1(0x141)},'stages':[{'name':_0x11a1a1(0x1a0),'description':_0x11a1a1(0x209),'entry_criteria':{'name':_0x11a1a1(0x14a),'segment':_0xc92dae},'steps':[{'type':_0x11a1a1(0x1ee),'name':_0x11a1a1(0x1c1),'with':{'duration':0x1,'unit':_0x11a1a1(0x1db)}},{'type':_0x11a1a1(0x1b8),'name':_0x11a1a1(0x168),'with':{'activation':'your-activation-name'}},{'type':'end','name':'Stage\x20Complete'}]}]};return toYamlString(_0x2c43ae);}function generateUUID(){const _0x1f1ac2=a122_0x5b89;return crypto[_0x1f1ac2(0x18e)]();}export const SEGMENT_REF_PREFIX=a122_0x27d7ca(0x179);export function parseSegmentRef(_0x40fb88){const _0x1c4294=a122_0x27d7ca;if(_0x40fb88[_0x1c4294(0x1f1)](SEGMENT_REF_PREFIX))return{'type':_0x1c4294(0x20b),'name':_0x40fb88['slice'](SEGMENT_REF_PREFIX[_0x1c4294(0x1d0)])};if(/^\d+$/[_0x1c4294(0x1a1)](_0x40fb88))return{'type':'id','name':_0x40fb88};return{'type':_0x1c4294(0x195),'name':_0x40fb88};}export function makeSegmentRef(_0xdc6423){return''+SEGMENT_REF_PREFIX+_0xdc6423;}export function isExternalSegmentRef(_0x1f9c53){const _0x4e923a=a122_0x27d7ca;return _0x1f9c53[_0x4e923a(0x1f1)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x21647){const _0x552ca2=a122_0x27d7ca;return!!(_0x21647[_0x552ca2(0x1da)]&&_0x21647[_0x552ca2(0x1da)][_0x552ca2(0x1d0)]>0x0);}export function isMultiVersionMode(_0x2f2235){const _0x271d85=a122_0x27d7ca;return!!(_0x2f2235['versions']&&_0x2f2235[_0x271d85(0x17e)][_0x271d85(0x1d0)]>0x0);}export function isSingleVersionMode(_0x55da50){const _0x3bb650=a122_0x27d7ca;return!!(_0x55da50[_0x3bb650(0x156)]&&_0x55da50['stages'][_0x3bb650(0x1d0)]>0x0);}export function hasMultipleVersions(_0x349b09){const _0x58d920=a122_0x27d7ca;if(isJourneysArrayMode(_0x349b09))return(_0x349b09[_0x58d920(0x1da)]?.[_0x58d920(0x1d0)]||0x0)>0x1;if(isMultiVersionMode(_0x349b09))return(_0x349b09[_0x58d920(0x17e)]?.[_0x58d920(0x1d0)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0xedc782){const _0x1ce201=a122_0x27d7ca;if(isJourneysArrayMode(_0xedc782))return _0xedc782;if(isSingleVersionMode(_0xedc782)){const {stages:_0x3a3003,id:_0x541e4e,version:_0x3a5f2e,version_number:_0x3ce566,..._0x25b926}=_0xedc782;return{..._0x25b926,'journeys':[{'version':_0x3a5f2e||'v1','stages':_0x3a3003||[],'id':_0x541e4e,'version_number':_0x3ce566}]};}if(isMultiVersionMode(_0xedc782)){const {versions:_0x3d2dd2,..._0x365a0a}=_0xedc782;return{..._0x365a0a,'journeys':(_0x3d2dd2||[])['map'](_0x4a0836=>({'version':_0x4a0836[_0x1ce201(0x17c)],'state':_0x4a0836[_0x1ce201(0x1f7)],'latest':_0x4a0836[_0x1ce201(0x1d1)],'stages':_0x4a0836[_0x1ce201(0x156)],'id':_0x4a0836['id'],'version_number':_0x4a0836['version_number']}))};}return _0xedc782;}export function normalizeJourneyDef(_0x1e1783,_0x23f044){const _0x70625a=a122_0x27d7ca,_0x307899=normalizeToJourneysFormat(_0x1e1783),_0x4ba0d5=_0x23f044?.['segments']?Object[_0x70625a(0x1c3)](_0x23f044[_0x70625a(0x18d)]):undefined,_0x24947e=_0x23f044?.[_0x70625a(0x155)]?Object[_0x70625a(0x1c3)](_0x23f044[_0x70625a(0x155)]):undefined;return{'type':_0x70625a(0x14e),'name':_0x307899['name'],..._0x307899[_0x70625a(0x1e1)]!==undefined&&{'description':_0x307899[_0x70625a(0x1e1)]},..._0x307899[_0x70625a(0x1cc)]&&{'goal':normalizeJourneyCriteria(_0x307899[_0x70625a(0x1cc)])},..._0x307899['reentry']!==undefined&&{'reentry':_0x307899['reentry']},..._0x307899[_0x70625a(0x18d)]&&{'segments':normalizeEmbeddedSegments(_0x307899[_0x70625a(0x18d)],_0x4ba0d5)},..._0x307899[_0x70625a(0x155)]&&{'activations':normalizeEmbeddedActivations(_0x307899[_0x70625a(0x155)],_0x24947e)},..._0x307899[_0x70625a(0x1da)]&&{'journeys':_0x307899[_0x70625a(0x1da)]['map'](_0x4f3a21=>normalizeJourneyEntry(_0x4f3a21,_0x307899[_0x70625a(0x1da)][_0x70625a(0x1d0)]===0x1))}};}function normalizeJourneyEntry(_0x1adfde,_0x3510f3){const _0x1049cd=a122_0x27d7ca;return{...!_0x3510f3&&_0x1adfde[_0x1049cd(0x160)]!==undefined&&{'version':_0x1adfde['version']},..._0x1adfde[_0x1049cd(0x1f7)]!==undefined&&{'state':_0x1adfde[_0x1049cd(0x1f7)]},...!_0x3510f3&&_0x1adfde[_0x1049cd(0x1d1)]!==undefined&&{'latest':_0x1adfde[_0x1049cd(0x1d1)]},..._0x1adfde[_0x1049cd(0x1cc)]&&{'goal':normalizeJourneyCriteria(_0x1adfde[_0x1049cd(0x1cc)])},..._0x1adfde['reentry']!==undefined&&{'reentry':_0x1adfde[_0x1049cd(0x15b)]},'stages':_0x1adfde[_0x1049cd(0x156)][_0x1049cd(0x1a3)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x138bf6){const _0x1e62ec=a122_0x27d7ca;return{'name':_0x138bf6[_0x1e62ec(0x17c)],..._0x138bf6[_0x1e62ec(0x1e1)]!==undefined&&{'description':_0x138bf6[_0x1e62ec(0x1e1)]},..._0x138bf6[_0x1e62ec(0x1c0)]&&{'entry_criteria':normalizeJourneyCriteria(_0x138bf6[_0x1e62ec(0x1c0)])},..._0x138bf6[_0x1e62ec(0x1ef)]&&{'exit_criteria':_0x138bf6['exit_criteria'][_0x1e62ec(0x1a3)](normalizeJourneyCriteria)},..._0x138bf6[_0x1e62ec(0x1c4)]&&{'milestone':normalizeJourneyCriteria(_0x138bf6[_0x1e62ec(0x1c4)])},..._0x138bf6['steps']&&{'steps':normalizeStepsWithImplicitNext(_0x138bf6['steps'])}};}function normalizeStepsWithImplicitNext(_0x4b77e4){return _0x4b77e4['map']((_0x3e972b,_0x5ecf05)=>{const _0x3523bb=a122_0x5b89,_0x35ea08=_0x5ecf05<_0x4b77e4[_0x3523bb(0x1d0)]-0x1?_0x4b77e4[_0x5ecf05+0x1][_0x3523bb(0x17c)]:undefined;return normalizeJourneyStep(_0x3e972b,_0x35ea08);});}function normalizeJourneyCriteria(_0x1db0ed){const _0x1d3d51=a122_0x27d7ca;return{'name':_0x1db0ed[_0x1d3d51(0x17c)],..._0x1db0ed[_0x1d3d51(0x1e1)]!==undefined&&{'description':_0x1db0ed['description']},'segment':_0x1db0ed[_0x1d3d51(0x1ed)],..._0x1db0ed[_0x1d3d51(0x1a6)]&&{'target':normalizeJumpTarget(_0x1db0ed['target'])}};}function normalizeJourneyStep(_0x4fcca1,_0x68a292){const _0x4acf93=a122_0x27d7ca,_0x552e0f=_0x4fcca1[_0x4acf93(0x1eb)]!==undefined&&_0x4fcca1['next']!==_0x68a292,_0x41b066={'type':_0x4fcca1[_0x4acf93(0x14d)],'name':_0x4fcca1[_0x4acf93(0x17c)],..._0x552e0f&&{'next':_0x4fcca1[_0x4acf93(0x1eb)]}};if(_0x4acf93(0x17b)in _0x4fcca1&&_0x4fcca1[_0x4acf93(0x17b)])return{..._0x41b066,'with':normalizeStepParams(_0x4fcca1[_0x4acf93(0x14d)],_0x4fcca1['with'])};return _0x41b066;}function normalizeStepParams(_0xe85ba,_0x259c0a){const _0x93a0be=a122_0x27d7ca;switch(_0xe85ba){case'wait':{const _0x118b45=_0x259c0a;let _0x3b30ca;return _0x118b45[_0x93a0be(0x1ae)]&&(_0x3b30ca={'segment':_0x118b45[_0x93a0be(0x1ae)][_0x93a0be(0x1ed)],..._0x118b45[_0x93a0be(0x1ae)][_0x93a0be(0x1eb)]!==undefined&&{'next':_0x118b45[_0x93a0be(0x1ae)][_0x93a0be(0x1eb)]},..._0x118b45[_0x93a0be(0x1ae)][_0x93a0be(0x17a)]&&{'timeout':{'duration':_0x118b45[_0x93a0be(0x1ae)]['timeout']['duration'],'unit':_0x118b45[_0x93a0be(0x1ae)][_0x93a0be(0x17a)][_0x93a0be(0x1d6)],..._0x118b45[_0x93a0be(0x1ae)][_0x93a0be(0x17a)][_0x93a0be(0x1eb)]!==undefined&&{'next':_0x118b45['condition']['timeout']['next']}}}}),{..._0x118b45[_0x93a0be(0x204)]!==undefined&&{'duration':_0x118b45['duration']},..._0x118b45[_0x93a0be(0x1d6)]!==undefined&&{'unit':_0x118b45['unit']},..._0x118b45[_0x93a0be(0x196)]!==undefined&&{'wait_until':_0x118b45[_0x93a0be(0x196)]},..._0x118b45[_0x93a0be(0x1b6)]!==undefined&&{'days_of_week':_0x118b45[_0x93a0be(0x1b6)]},..._0x3b30ca&&{'condition':_0x3b30ca}};}case _0x93a0be(0x1b8):{const _0x214ee9=_0x259c0a;return{'activation':_0x214ee9[_0x93a0be(0x1b8)]};}case _0x93a0be(0x1ce):{const _0x27f49c=_0x259c0a;return{'branches':_0x27f49c[_0x93a0be(0x1f3)][_0x93a0be(0x1a3)](normalizeDecisionBranch)};}case _0x93a0be(0x16c):{const _0x51ca1c=_0x259c0a;return{..._0x51ca1c[_0x93a0be(0x167)]!==undefined&&{'customized_split':_0x51ca1c[_0x93a0be(0x167)]},..._0x51ca1c[_0x93a0be(0x1f6)]!==undefined&&{'unique_id':_0x51ca1c[_0x93a0be(0x1f6)]},'variants':_0x51ca1c[_0x93a0be(0x16d)][_0x93a0be(0x1a3)](normalizeAbTestVariant)};}case _0x93a0be(0x1fe):{const _0x1e439d=_0x259c0a;return{'target':normalizeJumpTarget(_0x1e439d[_0x93a0be(0x1a6)])};}default:return _0x259c0a;}}function normalizeDecisionBranch(_0x352e62){const _0x32a7a5=a122_0x27d7ca;return{'name':_0x352e62['name'],..._0x352e62[_0x32a7a5(0x1ed)]!==undefined&&{'segment':_0x352e62['segment']},..._0x352e62['excluded']!==undefined&&{'excluded':_0x352e62[_0x32a7a5(0x1c6)]},..._0x352e62[_0x32a7a5(0x1eb)]!==undefined&&{'next':_0x352e62['next']}};}function normalizeAbTestVariant(_0xcb1ef7){const _0xd03902=a122_0x27d7ca;return{..._0xcb1ef7['id']!==undefined&&{'id':_0xcb1ef7['id']},'name':_0xcb1ef7[_0xd03902(0x17c)],'percentage':_0xcb1ef7[_0xd03902(0x140)],..._0xcb1ef7[_0xd03902(0x1eb)]!==undefined&&{'next':_0xcb1ef7['next']}};}function normalizeJumpTarget(_0x4f7c53){const _0x504d00=a122_0x27d7ca;return{'journey':_0x4f7c53[_0x504d00(0x14e)],'stage':_0x4f7c53[_0x504d00(0x181)],..._0x4f7c53[_0x504d00(0x1ba)]!==undefined&&{'bundle_id':_0x4f7c53['bundle_id']}};}function normalizeEmbeddedSegments(_0x3b33dd,_0x56bd92){const _0x27d226=a122_0x27d7ca,_0x44fb0e={},_0x4b6aad=Object[_0x27d226(0x1c3)](_0x3b33dd),_0x1840eb=_0x56bd92?[..._0x56bd92[_0x27d226(0x161)](_0x4787c4=>_0x4b6aad['includes'](_0x4787c4)),..._0x4b6aad[_0x27d226(0x161)](_0xac5848=>!_0x56bd92[_0x27d226(0x202)](_0xac5848))[_0x27d226(0x164)]()]:_0x4b6aad['sort']();for(const _0x5cb677 of _0x1840eb){const _0xe67dfe=_0x3b33dd[_0x5cb677];if(_0xe67dfe[_0x27d226(0x1aa)]){const _0x27f183=_0xe67dfe[_0x27d226(0x1aa)];if(_0x27f183[_0x27d226(0x14d)]!=='And'&&_0x27f183['type']!=='Or'){const _0x4ef8a6=_0x27f183[_0x27d226(0x14d)]??_0x27d226(0x199);throw new SDKError(ErrorCode[_0x27d226(0x1fd)],_0x27d226(0x165)+_0x5cb677+_0x27d226(0x144)+(_0x27d226(0x176)+_0x4ef8a6+_0x27d226(0x18b))+_0x27d226(0x1e9)+_0x27d226(0x16b)+_0x27d226(0x1a7)+_0x27d226(0x1fc)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x27f183['conditions']||!Array[_0x27d226(0x18f)](_0x27f183[_0x27d226(0x1b1)]))throw new SDKError(ErrorCode[_0x27d226(0x1fd)],_0x27d226(0x165)+_0x5cb677+_0x27d226(0x144)+_0x27d226(0x1cd)+_0x27d226(0x1e9)+_0x27d226(0x16b)+(_0x27d226(0x147)+_0x27f183[_0x27d226(0x14d)]+'\x0a')+_0x27d226(0x1fc)+_0x27d226(0x1df)+_0x27d226(0x197)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}_0x44fb0e[_0x5cb677]={..._0xe67dfe[_0x27d226(0x1e1)]&&_0xe67dfe['description'][_0x27d226(0x203)]()&&{'description':_0xe67dfe[_0x27d226(0x1e1)]},..._0xe67dfe[_0x27d226(0x1aa)]&&{'rule':deepSortObject(_0xe67dfe[_0x27d226(0x1aa)])}};}return _0x44fb0e;}function normalizeEmbeddedActivations(_0x172d49,_0x5b31be){const _0x449d18=a122_0x27d7ca,_0x3f0571={},_0x3dca27=Object[_0x449d18(0x1c3)](_0x172d49),_0x217698=_0x5b31be?[..._0x5b31be[_0x449d18(0x161)](_0x33bcaa=>_0x3dca27[_0x449d18(0x202)](_0x33bcaa)),..._0x3dca27[_0x449d18(0x161)](_0x1c75b8=>!_0x5b31be[_0x449d18(0x202)](_0x1c75b8))['sort']()]:_0x3dca27[_0x449d18(0x164)]();for(const _0x4ccd83 of _0x217698){const _0x37a636=_0x172d49[_0x4ccd83];_0x3f0571[_0x4ccd83]={'name':_0x37a636[_0x449d18(0x17c)],'connection':_0x37a636['connection'],..._0x37a636['description']!==undefined&&{'description':_0x37a636['description']},..._0x37a636[_0x449d18(0x1bf)]!==undefined&&{'all_columns':_0x37a636['all_columns']},..._0x37a636[_0x449d18(0x180)]!==undefined&&{'columns':_0x37a636[_0x449d18(0x180)]},..._0x37a636[_0x449d18(0x1b9)]!==undefined&&{'behavior':_0x37a636[_0x449d18(0x1b9)]},..._0x37a636[_0x449d18(0x16f)]!==undefined&&{'schedule':_0x37a636[_0x449d18(0x16f)]},..._0x37a636[_0x449d18(0x19f)]!==undefined&&{'notification':_0x37a636[_0x449d18(0x19f)]},..._0x37a636[_0x449d18(0x1b3)]!==undefined&&{'connector_config':_0x37a636[_0x449d18(0x1b3)]},..._0x37a636[_0x449d18(0x1d8)]!==undefined&&{'activation_template_id':_0x37a636[_0x449d18(0x1d8)]}};}return _0x3f0571;}export function getActiveStages(_0x51148c){const _0x3bb267=a122_0x27d7ca;if(isJourneysArrayMode(_0x51148c)){const _0x3a1b82=_0x51148c['journeys']||[],_0x4e19df=_0x3a1b82[_0x3bb267(0x177)](_0x3960c7=>_0x3960c7['latest']===!![])||_0x3a1b82[0x0];return _0x4e19df?.[_0x3bb267(0x156)]||[];}if(isSingleVersionMode(_0x51148c))return _0x51148c[_0x3bb267(0x156)]||[];if(isMultiVersionMode(_0x51148c)){const _0x11a578=_0x51148c['versions']||[],_0x39af96=_0x11a578[_0x3bb267(0x177)](_0x47ed7b=>_0x47ed7b[_0x3bb267(0x1d1)]===!![])||_0x11a578[0x0];return _0x39af96?.[_0x3bb267(0x156)]||[];}return[];}export function getLatestJourneyEntry(_0x4cd2b8){const _0x4e1212=a122_0x27d7ca;if(isJourneysArrayMode(_0x4cd2b8)){const _0x99da92=_0x4cd2b8[_0x4e1212(0x1da)]||[];return _0x99da92[_0x4e1212(0x177)](_0x2ea226=>_0x2ea226[_0x4e1212(0x1d1)]===!![])||_0x99da92[0x0];}if(isMultiVersionMode(_0x4cd2b8)){const _0x37dff3=_0x4cd2b8[_0x4e1212(0x17e)]||[],_0x1d2ac7=_0x37dff3[_0x4e1212(0x177)](_0x1ba97f=>_0x1ba97f[_0x4e1212(0x1d1)]===!![])||_0x37dff3[0x0];if(_0x1d2ac7)return{'version':_0x1d2ac7[_0x4e1212(0x17c)],'state':_0x1d2ac7[_0x4e1212(0x1f7)],'latest':_0x1d2ac7[_0x4e1212(0x1d1)],'stages':_0x1d2ac7[_0x4e1212(0x156)],'id':_0x1d2ac7['id'],'version_number':_0x1d2ac7['version_number']};}if(isSingleVersionMode(_0x4cd2b8))return{'version':_0x4cd2b8[_0x4e1212(0x160)]||'v1','state':_0x4e1212(0x193),'stages':_0x4cd2b8[_0x4e1212(0x156)]||[],'id':_0x4cd2b8['id'],'version_number':_0x4cd2b8[_0x4e1212(0x191)],'goal':_0x4cd2b8[_0x4e1212(0x1cc)],'reentry':_0x4cd2b8[_0x4e1212(0x15b)]};return undefined;}export function getLatestVersion(_0xd3322e){const _0x2b1e19=a122_0x27d7ca;if(!isMultiVersionMode(_0xd3322e))return undefined;const _0xbbb7ae=_0xd3322e[_0x2b1e19(0x17e)]||[];return _0xbbb7ae[_0x2b1e19(0x177)](_0x28322b=>_0x28322b[_0x2b1e19(0x1d1)]===!![])||_0xbbb7ae[0x0];}export function getEffectiveGoal(_0x324565){const _0x286d7c=a122_0x27d7ca,_0x5c2dea=getLatestJourneyEntry(_0x324565);return _0x5c2dea?.['goal']||_0x324565[_0x286d7c(0x1cc)];}export function getEffectiveReentry(_0x3b9351){const _0x50b64d=a122_0x27d7ca,_0x31f522=getLatestJourneyEntry(_0x3b9351);return _0x31f522?.['reentry']||_0x3b9351[_0x50b64d(0x15b)];}export function collectSegmentRefs(_0x4da55f){const _0x3a3264=a122_0x27d7ca,_0x4338b3=new Set();_0x4da55f[_0x3a3264(0x1cc)]?.[_0x3a3264(0x1ed)]&&_0x4338b3[_0x3a3264(0x1b5)](_0x4da55f['goal'][_0x3a3264(0x1ed)]);const _0x3bde28=_0x4eaeea=>{const _0x166118=_0x3a3264;for(const _0x416e5d of _0x4eaeea){_0x416e5d[_0x166118(0x1c0)]?.['segment']&&_0x4338b3[_0x166118(0x1b5)](_0x416e5d[_0x166118(0x1c0)][_0x166118(0x1ed)]);if(_0x416e5d[_0x166118(0x1ef)])for(const _0x6c81e8 of _0x416e5d['exit_criteria']){_0x6c81e8[_0x166118(0x1ed)]&&_0x4338b3[_0x166118(0x1b5)](_0x6c81e8['segment']);}_0x416e5d[_0x166118(0x1c4)]?.[_0x166118(0x1ed)]&&_0x4338b3['add'](_0x416e5d['milestone'][_0x166118(0x1ed)]);if(_0x416e5d[_0x166118(0x190)])for(const _0xc3dd4b of _0x416e5d[_0x166118(0x190)]){if(_0xc3dd4b[_0x166118(0x14d)]===_0x166118(0x1ce)){const _0x1ec148=_0xc3dd4b;for(const _0x58559d of _0x1ec148[_0x166118(0x17b)][_0x166118(0x1f3)]){_0x58559d['segment']&&_0x4338b3[_0x166118(0x1b5)](_0x58559d[_0x166118(0x1ed)]);}}else{if(_0xc3dd4b[_0x166118(0x14d)]===_0x166118(0x1ee)){const _0x119093=_0xc3dd4b;_0x119093[_0x166118(0x17b)][_0x166118(0x1ae)]?.[_0x166118(0x1ed)]&&_0x4338b3[_0x166118(0x1b5)](_0x119093['with'][_0x166118(0x1ae)][_0x166118(0x1ed)]);}}}}};_0x4da55f[_0x3a3264(0x156)]&&_0x3bde28(_0x4da55f['stages']);if(_0x4da55f[_0x3a3264(0x17e)])for(const _0x70b0de of _0x4da55f[_0x3a3264(0x17e)]){_0x3bde28(_0x70b0de[_0x3a3264(0x156)]);}return _0x4338b3;}function a122_0x5b89(_0x23dc7c,_0x1cde14){_0x23dc7c=_0x23dc7c-0x13d;const _0x41f4a2=a122_0x41f4();let _0x5b891d=_0x41f4a2[_0x23dc7c];return _0x5b891d;}export function validateSegmentRefs(_0x511a43){const _0x3be587=a122_0x27d7ca,_0x273512=[],_0x43dd8b=collectSegmentRefs(_0x511a43),_0x17f2ed=new Set(Object[_0x3be587(0x1c3)](_0x511a43['segments']||{}));for(const _0x442acb of _0x43dd8b){const _0x522282=parseSegmentRef(_0x442acb);_0x522282['type']===_0x3be587(0x195)&&!_0x17f2ed['has'](_0x522282[_0x3be587(0x17c)])&&_0x273512[_0x3be587(0x178)](_0x3be587(0x20a)+_0x522282['name']+'\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:'+_0x522282[_0x3be587(0x17c)]+_0x3be587(0x13e));}return _0x273512;}export function collectSegmentIdsFromJourneyApi(_0x36a6f7){const _0x3dfea0=a122_0x27d7ca,_0x585b49=new Set();_0x36a6f7[_0x3dfea0(0x1f9)]['goal']?.[_0x3dfea0(0x14f)]&&_0x585b49[_0x3dfea0(0x1b5)](_0x36a6f7[_0x3dfea0(0x1f9)][_0x3dfea0(0x1cc)][_0x3dfea0(0x14f)]);const _0x2ea608=_0x36a6f7[_0x3dfea0(0x1f9)][_0x3dfea0(0x1bd)];if(Array['isArray'](_0x2ea608))for(const _0x1c644f of _0x2ea608){_0x1c644f[_0x3dfea0(0x1ec)]?.['segmentId']&&_0x585b49[_0x3dfea0(0x1b5)](_0x1c644f[_0x3dfea0(0x1ec)][_0x3dfea0(0x14f)]);const _0x187759=_0x1c644f[_0x3dfea0(0x162)]??_0x1c644f[_0x3dfea0(0x152)];if(Array[_0x3dfea0(0x18f)](_0x187759))for(const _0x481014 of _0x187759){_0x481014['segmentId']&&_0x585b49[_0x3dfea0(0x1b5)](_0x481014[_0x3dfea0(0x14f)]);}_0x1c644f[_0x3dfea0(0x1c4)]?.[_0x3dfea0(0x14f)]&&_0x585b49[_0x3dfea0(0x1b5)](_0x1c644f['milestone'][_0x3dfea0(0x14f)]);if(_0x1c644f['steps']&&typeof _0x1c644f[_0x3dfea0(0x190)]===_0x3dfea0(0x17d)){const _0x502893=Array[_0x3dfea0(0x18f)](_0x1c644f[_0x3dfea0(0x190)])?_0x1c644f[_0x3dfea0(0x190)]:Object['values'](_0x1c644f[_0x3dfea0(0x190)]);for(const _0xfd4855 of _0x502893){_0xfd4855[_0x3dfea0(0x170)]?.[_0x3dfea0(0x14f)]&&_0x585b49[_0x3dfea0(0x1b5)](_0xfd4855[_0x3dfea0(0x170)][_0x3dfea0(0x14f)]);const _0x15b3db=_0xfd4855;_0x15b3db[_0x3dfea0(0x19b)]&&_0x585b49[_0x3dfea0(0x1b5)](_0x15b3db[_0x3dfea0(0x19b)]);if(Array['isArray'](_0x15b3db[_0x3dfea0(0x1b1)]))for(const _0x2b7885 of _0x15b3db[_0x3dfea0(0x1b1)]){_0x2b7885[_0x3dfea0(0x14f)]&&_0x585b49[_0x3dfea0(0x1b5)](_0x2b7885[_0x3dfea0(0x14f)]);}if(Array[_0x3dfea0(0x18f)](_0xfd4855['branches']))for(const _0x2861dd of _0xfd4855['branches']){_0x2861dd[_0x3dfea0(0x14f)]&&_0x585b49[_0x3dfea0(0x1b5)](_0x2861dd['segmentId']);}}}}return _0x585b49;}