@treasuredata/tdx 0.29.3 → 0.29.5

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 (248) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +1 -1
  7. package/dist/cli.js.map +1 -1
  8. package/dist/commands/activations.js +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-test-command.js +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/auth-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.d.ts.map +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-command.js.map +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-command.js.map +1 -1
  29. package/dist/commands/engage-template-pull-command.d.ts +15 -0
  30. package/dist/commands/engage-template-pull-command.d.ts.map +1 -0
  31. package/dist/commands/engage-template-pull-command.js +1 -0
  32. package/dist/commands/engage-template-pull-command.js.map +1 -0
  33. package/dist/commands/engage-template-push-command.d.ts +16 -0
  34. package/dist/commands/engage-template-push-command.d.ts.map +1 -0
  35. package/dist/commands/engage-template-push-command.js +1 -0
  36. package/dist/commands/engage-template-push-command.js.map +1 -0
  37. package/dist/commands/engage-template-validate-command.d.ts +19 -0
  38. package/dist/commands/engage-template-validate-command.d.ts.map +1 -0
  39. package/dist/commands/engage-template-validate-command.js +1 -0
  40. package/dist/commands/engage-template-validate-command.js.map +1 -0
  41. package/dist/commands/job-command.js +1 -1
  42. package/dist/commands/journey-command.js +1 -1
  43. package/dist/commands/journey-validate-command.js +1 -1
  44. package/dist/commands/llm-command.js +1 -1
  45. package/dist/commands/mcp-command.js +1 -1
  46. package/dist/commands/parent-segment-command.js +1 -1
  47. package/dist/commands/profile-command.js +1 -1
  48. package/dist/commands/profiles-command.js +1 -1
  49. package/dist/commands/query-command.d.ts.map +1 -1
  50. package/dist/commands/query-command.js +1 -1
  51. package/dist/commands/query-command.js.map +1 -1
  52. package/dist/commands/schedule-command.js +1 -1
  53. package/dist/commands/segment-command.js +1 -1
  54. package/dist/commands/segment-create-command.js +1 -1
  55. package/dist/commands/segment-fields-command.js +1 -1
  56. package/dist/commands/segment-pull-command.js +1 -1
  57. package/dist/commands/segment-push-command.js +1 -1
  58. package/dist/commands/segment-update-command.js +1 -1
  59. package/dist/commands/segment-use-command.js +1 -1
  60. package/dist/commands/segment-validate-command.js +1 -1
  61. package/dist/commands/segments.js +1 -1
  62. package/dist/commands/show.js +1 -1
  63. package/dist/commands/status-command.js +1 -1
  64. package/dist/commands/tables.js +1 -1
  65. package/dist/commands/unset-command.js +1 -1
  66. package/dist/commands/upgrade-command.js +1 -1
  67. package/dist/commands/use-command.js +1 -1
  68. package/dist/commands/user-command.js +1 -1
  69. package/dist/commands/workflow-command.js +1 -1
  70. package/dist/core/auth.js +1 -1
  71. package/dist/core/command-output.d.ts +6 -0
  72. package/dist/core/command-output.d.ts.map +1 -1
  73. package/dist/core/command-output.js +1 -1
  74. package/dist/core/command-output.js.map +1 -1
  75. package/dist/core/config.js +1 -1
  76. package/dist/core/connection-cache.js +1 -1
  77. package/dist/core/constants.js +1 -1
  78. package/dist/core/credential-cache.js +1 -1
  79. package/dist/core/global-context.js +1 -1
  80. package/dist/core/keychain.js +1 -1
  81. package/dist/core/profile.js +1 -1
  82. package/dist/core/project-config.js +1 -1
  83. package/dist/core/session.js +1 -1
  84. package/dist/core/user-cache.js +1 -1
  85. package/dist/core/version.js +1 -1
  86. package/dist/index.js +1 -1
  87. package/dist/mcp/server.js +1 -1
  88. package/dist/mcp/tools/index.js +1 -1
  89. package/dist/mcp/tools/tdx-run.js +1 -1
  90. package/dist/mcp/tools/tdx-search.js +1 -1
  91. package/dist/mcp/utils.js +1 -1
  92. package/dist/proxy/claude-usage-tracker.js +1 -1
  93. package/dist/proxy/passthrough-server.js +1 -1
  94. package/dist/proxy/sse-usage-parser.js +1 -1
  95. package/dist/sdk/agent/agent-config.js +1 -1
  96. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  97. package/dist/sdk/agent/agent-yaml.js +1 -1
  98. package/dist/sdk/agent/test/evaluator.js +1 -1
  99. package/dist/sdk/agent/test/executor.js +1 -1
  100. package/dist/sdk/agent/test/index.js +1 -1
  101. package/dist/sdk/agent/test/output.js +1 -1
  102. package/dist/sdk/agent/test/parser.js +1 -1
  103. package/dist/sdk/agent/tool-target-registry.js +1 -1
  104. package/dist/sdk/api.js +1 -1
  105. package/dist/sdk/client/cdp-api-client.js +1 -1
  106. package/dist/sdk/client/delivery-api-client.js +1 -1
  107. package/dist/sdk/client/endpoints.d.ts +9 -0
  108. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  109. package/dist/sdk/client/endpoints.js +1 -1
  110. package/dist/sdk/client/endpoints.js.map +1 -1
  111. package/dist/sdk/client/engage-api-client.js +1 -1
  112. package/dist/sdk/client/http-client.js +1 -1
  113. package/dist/sdk/client/llm-api-client.js +1 -1
  114. package/dist/sdk/client/rate-limiter.js +1 -1
  115. package/dist/sdk/client/td-api-client.js +1 -1
  116. package/dist/sdk/client/trino-api-client.js +1 -1
  117. package/dist/sdk/client/workflow-client.js +1 -1
  118. package/dist/sdk/connection-validator.js +1 -1
  119. package/dist/sdk/connection.js +1 -1
  120. package/dist/sdk/delivery.js +1 -1
  121. package/dist/sdk/engage/campaign-pull.js +1 -1
  122. package/dist/sdk/engage/campaign-push.js +1 -1
  123. package/dist/sdk/engage/campaign-validator.js +1 -1
  124. package/dist/sdk/engage/campaign-yaml.js +1 -1
  125. package/dist/sdk/engage/template-pull.d.ts +73 -0
  126. package/dist/sdk/engage/template-pull.d.ts.map +1 -0
  127. package/dist/sdk/engage/template-pull.js +1 -0
  128. package/dist/sdk/engage/template-pull.js.map +1 -0
  129. package/dist/sdk/engage/template-push.d.ts +99 -0
  130. package/dist/sdk/engage/template-push.d.ts.map +1 -0
  131. package/dist/sdk/engage/template-push.js +1 -0
  132. package/dist/sdk/engage/template-push.js.map +1 -0
  133. package/dist/sdk/engage/template-validator.d.ts +18 -0
  134. package/dist/sdk/engage/template-validator.d.ts.map +1 -0
  135. package/dist/sdk/engage/template-validator.js +1 -0
  136. package/dist/sdk/engage/template-validator.js.map +1 -0
  137. package/dist/sdk/engage/template-yaml.d.ts +69 -0
  138. package/dist/sdk/engage/template-yaml.d.ts.map +1 -0
  139. package/dist/sdk/engage/template-yaml.js +1 -0
  140. package/dist/sdk/engage/template-yaml.js.map +1 -0
  141. package/dist/sdk/engage/types/campaign-def.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  143. package/dist/sdk/engage/types/template-schema.d.ts +33 -0
  144. package/dist/sdk/engage/types/template-schema.d.ts.map +1 -0
  145. package/dist/sdk/engage/types/template-schema.js +1 -0
  146. package/dist/sdk/engage/types/template-schema.js.map +1 -0
  147. package/dist/sdk/engage.d.ts +1 -0
  148. package/dist/sdk/engage.d.ts.map +1 -1
  149. package/dist/sdk/engage.js +1 -1
  150. package/dist/sdk/engage.js.map +1 -1
  151. package/dist/sdk/errors.js +1 -1
  152. package/dist/sdk/index.js +1 -1
  153. package/dist/sdk/io/index.js +1 -1
  154. package/dist/sdk/io/node-filesystem.js +1 -1
  155. package/dist/sdk/job.js +1 -1
  156. package/dist/sdk/journey.js +1 -1
  157. package/dist/sdk/llm/chat-cache.js +1 -1
  158. package/dist/sdk/llm/index.js +1 -1
  159. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  160. package/dist/sdk/llm/model-factors.js +1 -1
  161. package/dist/sdk/personalization.js +1 -1
  162. package/dist/sdk/query/index.js +1 -1
  163. package/dist/sdk/query/sql-parser.js +1 -1
  164. package/dist/sdk/realtime.js +1 -1
  165. package/dist/sdk/schedule.js +1 -1
  166. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  167. package/dist/sdk/segment/fields-display.js +1 -1
  168. package/dist/sdk/segment/file-discovery.js +1 -1
  169. package/dist/sdk/segment/journey-utils.js +1 -1
  170. package/dist/sdk/segment/journey-validator.js +1 -1
  171. package/dist/sdk/segment/journey-yaml.js +1 -1
  172. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  173. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  174. package/dist/sdk/segment/pull-workflow.js +1 -1
  175. package/dist/sdk/segment/push-recovery.js +1 -1
  176. package/dist/sdk/segment/push-workflow.js +1 -1
  177. package/dist/sdk/segment/resolution-context.js +1 -1
  178. package/dist/sdk/segment/segment-path-parser.js +1 -1
  179. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  180. package/dist/sdk/segment/segment-validator.js +1 -1
  181. package/dist/sdk/segment/target-resolution.js +1 -1
  182. package/dist/sdk/segment/tdx-config.js +1 -1
  183. package/dist/sdk/segment/types/activation-schema.js +1 -1
  184. package/dist/sdk/segment/types/journey-def.js +1 -1
  185. package/dist/sdk/segment/types/journey-schema.js +1 -1
  186. package/dist/sdk/segment/types/segment-def.js +1 -1
  187. package/dist/sdk/segment/types/segment-schema.js +1 -1
  188. package/dist/sdk/segment/validate-files.d.ts +6 -1
  189. package/dist/sdk/segment/validate-files.d.ts.map +1 -1
  190. package/dist/sdk/segment/validate-files.js +1 -1
  191. package/dist/sdk/segment/validate-files.js.map +1 -1
  192. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  193. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  194. package/dist/sdk/segment/yaml-validator.js +1 -1
  195. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  196. package/dist/sdk/segment.js +1 -1
  197. package/dist/sdk/types/engage.d.ts +2 -0
  198. package/dist/sdk/types/engage.d.ts.map +1 -1
  199. package/dist/sdk/types/index.js +1 -1
  200. package/dist/sdk/types/progress.js +1 -1
  201. package/dist/sdk/user.js +1 -1
  202. package/dist/sdk/util/format-detector.js +1 -1
  203. package/dist/sdk/util/formatters.js +1 -1
  204. package/dist/sdk/util/index.js +1 -1
  205. package/dist/sdk/util/tree-formatter.js +1 -1
  206. package/dist/sdk/workflow/archive-validation.js +1 -1
  207. package/dist/sdk/workflow/clone-workflow.js +1 -1
  208. package/dist/sdk/workflow/index.js +1 -1
  209. package/dist/sdk/workflow/pull-workflow.js +1 -1
  210. package/dist/sdk/workflow/push-workflow.js +1 -1
  211. package/dist/sdk/workflow/tdx-config.js +1 -1
  212. package/dist/sdk/workflow/workflow-utils.js +1 -1
  213. package/dist/test-utils/command-runner.js +1 -1
  214. package/dist/test-utils/factories.js +1 -1
  215. package/dist/test-utils/fixtures.js +1 -1
  216. package/dist/test-utils/http-mock.js +1 -1
  217. package/dist/test-utils/index.js +1 -1
  218. package/dist/utils/async.js +1 -1
  219. package/dist/utils/colors.js +1 -1
  220. package/dist/utils/diff.js +1 -1
  221. package/dist/utils/file-permissions.js +1 -1
  222. package/dist/utils/file-reader.js +1 -1
  223. package/dist/utils/github-releases.d.ts +17 -0
  224. package/dist/utils/github-releases.d.ts.map +1 -0
  225. package/dist/utils/github-releases.js +1 -0
  226. package/dist/utils/github-releases.js.map +1 -0
  227. package/dist/utils/global-cache.js +1 -1
  228. package/dist/utils/json-loader.js +1 -1
  229. package/dist/utils/local-cache.js +1 -1
  230. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  231. package/dist/utils/logger/formatters/index.js +1 -1
  232. package/dist/utils/logger/handlers/console-handler.js +1 -1
  233. package/dist/utils/logger/handlers/file-handler.js +1 -1
  234. package/dist/utils/logger/handlers/index.js +1 -1
  235. package/dist/utils/logger/handlers/null-handler.js +1 -1
  236. package/dist/utils/logger/index.js +1 -1
  237. package/dist/utils/logger/logger.js +1 -1
  238. package/dist/utils/logger/types.js +1 -1
  239. package/dist/utils/option-validation.js +1 -1
  240. package/dist/utils/process.js +1 -1
  241. package/dist/utils/prompt.js +1 -1
  242. package/dist/utils/spinner.js +1 -1
  243. package/dist/utils/sse-parser.js +1 -1
  244. package/dist/utils/string-utils.js +1 -1
  245. package/dist/utils/table-ref-parser.js +1 -1
  246. package/dist/utils/tdx-logger.js +1 -1
  247. package/dist/utils/version-check.js +1 -1
  248. package/package.json +1 -1
@@ -1 +1 @@
1
- const a108_0x4687f6=a108_0x283c;(function(_0xe09e3e,_0x2ee51a){const _0x4f4634=a108_0x283c,_0x3788a5=_0xe09e3e();while(!![]){try{const _0x1159c3=-parseInt(_0x4f4634(0x1bb))/0x1*(-parseInt(_0x4f4634(0x1cb))/0x2)+parseInt(_0x4f4634(0x20a))/0x3+parseInt(_0x4f4634(0x1d5))/0x4*(parseInt(_0x4f4634(0x1fb))/0x5)+-parseInt(_0x4f4634(0x1ee))/0x6+-parseInt(_0x4f4634(0x1d0))/0x7+-parseInt(_0x4f4634(0x1f4))/0x8+-parseInt(_0x4f4634(0x1f1))/0x9*(-parseInt(_0x4f4634(0x1ec))/0xa);if(_0x1159c3===_0x2ee51a)break;else _0x3788a5['push'](_0x3788a5['shift']());}catch(_0x2c6906){_0x3788a5['push'](_0x3788a5['shift']());}}}(a108_0xedab,0x5267d));import{CDPApiClient}from'./client/cdp-api-client.js';import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0x113196){const _0x12548b=a108_0x283c;return _0x113196[_0x12548b(0x1e5)]??_0x113196[_0x12548b(0x22a)]?.[_0x12548b(0x1e5)]??undefined;}function getVersionNumber(_0x13642e){const _0x29b6d7=a108_0x283c;return _0x13642e[_0x29b6d7(0x227)]??_0x13642e['attributes']?.['versionNumber']??0x0;}export function deduplicateJourneysByBundle(_0x14572f){const _0x5341f0=a108_0x283c,_0x191d9e=new Map();let _0x54e8af=0x0;for(const _0x26bc68 of _0x14572f){const _0x47b47a=getBundleId(_0x26bc68);if(!_0x47b47a){const _0x35c2fe=_0x5341f0(0x22b)+(_0x26bc68['id']??_0x5341f0(0x1f8)+_0x54e8af++);_0x191d9e[_0x5341f0(0x1ce)](_0x35c2fe,_0x26bc68);continue;}const _0x30197b=_0x191d9e[_0x5341f0(0x23b)](_0x47b47a);if(!_0x30197b)_0x191d9e[_0x5341f0(0x1ce)](_0x47b47a,_0x26bc68);else{const _0x1cf34d=getVersionNumber(_0x30197b),_0x1c66b4=getVersionNumber(_0x26bc68);_0x1c66b4>_0x1cf34d&&_0x191d9e['set'](_0x47b47a,_0x26bc68);}}return Array[_0x5341f0(0x1cf)](_0x191d9e['values']());}const VALID_JOURNEY_STATES=new Set([a108_0x4687f6(0x20d),a108_0x4687f6(0x1d4),'launched']);export function parseJourneyState(_0xa46ad8){const _0xd7681=a108_0x4687f6;if(typeof _0xa46ad8===_0xd7681(0x1df)&&VALID_JOURNEY_STATES[_0xd7681(0x231)](_0xa46ad8))return _0xa46ad8;return _0xd7681(0x20d);}export function entityToJourneyListItem(_0x401d03,_0x15f657){const _0x308536=a108_0x4687f6,_0x4b1b6e=_0x401d03[_0x308536(0x22a)];return{'id':_0x401d03['id'],'name':_0x4b1b6e[_0x308536(0x1c9)]??'','journeyBundleName':_0x4b1b6e[_0x308536(0x215)]??_0x4b1b6e[_0x308536(0x1c9)]??'','journeyBundleId':_0x4b1b6e[_0x308536(0x1e5)]??'','versionNumber':_0x4b1b6e[_0x308536(0x227)],'description':_0x4b1b6e[_0x308536(0x205)]??null,'state':parseJourneyState(_0x4b1b6e[_0x308536(0x1ff)]),'paused':_0x4b1b6e[_0x308536(0x1d6)]??![],'audienceId':_0x15f657,'folderId':_0x4b1b6e[_0x308536(0x1b9)]??_0x401d03[_0x308536(0x230)]?.[_0x308536(0x239)]?.[_0x308536(0x1e1)]?.['id']??null,'createdAt':_0x4b1b6e['createdAt']??'','updatedAt':_0x4b1b6e[_0x308536(0x1d2)]??''};}function convertToColumnId(_0x3cefe2){return _0x3cefe2['replace'](/-/g,'_');}function getStepEntries(_0x5295f0){const _0x2ddfc3=a108_0x4687f6;if(!_0x5295f0)return[];if(Array['isArray'](_0x5295f0))return _0x5295f0[_0x2ddfc3(0x1e2)](_0x76c782=>[_0x76c782['id'],_0x76c782]);return Object['entries'](_0x5295f0);}export function flattenJourneyActivation(_0x11f61e){const _0x400ea2=a108_0x4687f6,{activationParams:_0x57d2f1,activationId:_0x546f31,runAfterJourneyRefresh:_0x2c9fdc}=_0x11f61e[_0x400ea2(0x22a)];return{'id':_0x11f61e['id'],'activationId':_0x546f31,'runAfterJourneyRefresh':_0x2c9fdc,..._0x57d2f1};}function a108_0xedab(){const _0x44af33=['size','289680iMVRXF','timedOutPath','audienceId','limit','idx-','listJourneyActivations','exitCriterias','5025rMxxzz','getColumnMapping','listSegmentFolders','goalInflux','state','enteredSize','exitOrJumpSize','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','_exit_','client','description','activationStepsById','find','push','history','31257DOUGvL','listJourneysWithDetailsFromParentSegment','_variant_','draft','type','getActivationSankeyChart','branches','_milestone','cdp_customer_id','createdAt','journeyStageId','journeyBundleName','filter','branch','conditionSegmentId','variants','conversion','getTrafficData','milestoneInflux','createVersion','waitCondition','Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle','listJourneysFromParentSegment','getStatistics','WaitStep','createJourneyActivation','entryInflux','folder-segment','includeAllVersions','versionNumber','latestJourneyId','exitOrJumpRate','attributes','no-bundle-','fetchTrafficRaw','listActivations','checkJourneyAppendable','steps','relationships','has','all','AbTest','Journey\x20activation\x20step\x20not\x20found:\x20','Journey\x20not\x20found:\x20','stage','conditions','journeys','parentFolder','getJourney','get','listJourneysWithDetails','goal','update','Wait','NOT_FOUND','segmentFolderId','listEntitiesByFolder','84457bJzxbC','outtime_stage_','goalSize','includeHistory','exit_criteria','journey_','step','isArray','journey','journeyStages','JOURNEY_NOT_FOUND','getConversionSankeyChart','applyVersionDeduplication','resumeJourney','name','listJourneys','4kQYPeZ','getBundle','variant','set','from','4121915qmnFNK','intime_goal','updatedAt','activation','simulation','2312dOXFve','paused','createJourneyVersion','cdp_audience_','intime_stage_','segmentId','fixed','pause','getLatestJourneyId','jumpInflux','string','getActivation','data','map','time','journeyId','journeyBundleId','out','reduce','entryCriteria','add','milestone','createJourney','57650iGUgsj','create','1310880LUuTJn','Excluded\x20profiles','length','657gDaNna','exitInflux'];a108_0xedab=function(){return _0x44af33;};return a108_0xedab();}function col(_0x2e0ea9,_0x48a31e={}){const _0x3fa59a=a108_0x4687f6;return{'column':_0x2e0ea9,'direction':null,'stageIndex':null,'stageName':null,'category':_0x3fa59a(0x1db),'stepType':null,'stepName':null,'stepId':null,'detail':null,..._0x48a31e};}export function generateColumnMapping(_0x5c84e3){const _0x17955f=a108_0x4687f6,_0xcc9363=[];_0xcc9363[_0x17955f(0x208)](col(_0x17955f(0x212))),_0xcc9363[_0x17955f(0x208)](col('intime_journey',{'direction':'in','category':_0x17955f(0x1c3)})),_0xcc9363[_0x17955f(0x208)](col('outtime_journey',{'direction':_0x17955f(0x1e6),'category':_0x17955f(0x1c3)}));_0x5c84e3['attributes'][_0x17955f(0x1b5)]&&_0xcc9363[_0x17955f(0x208)](col(_0x17955f(0x1d1),{'direction':'in','category':_0x17955f(0x1b5),'detail':_0x5c84e3[_0x17955f(0x22a)][_0x17955f(0x1b5)][_0x17955f(0x1c9)]||null}));const _0xa5b44=_0x5c84e3['attributes'][_0x17955f(0x1c4)]||[];for(let _0x2ce9b1=0x0;_0x2ce9b1<_0xa5b44[_0x17955f(0x1f0)];_0x2ce9b1++){const _0x1ece4b=_0xa5b44[_0x2ce9b1],_0x4ffc58=_0x1ece4b[_0x17955f(0x1c9)],_0x4e7098={'stageIndex':_0x2ce9b1,'stageName':_0x4ffc58},_0x22a23c=_0x1ece4b[_0x17955f(0x1e8)]?.[_0x17955f(0x1c9)]||null;_0xcc9363[_0x17955f(0x208)](col(_0x17955f(0x1d9)+_0x2ce9b1,{..._0x4e7098,'direction':'in','category':'stage','detail':_0x22a23c})),_0xcc9363[_0x17955f(0x208)](col(_0x17955f(0x1bc)+_0x2ce9b1,{..._0x4e7098,'direction':_0x17955f(0x1e6),'category':_0x17955f(0x236),'detail':_0x22a23c}));_0x1ece4b[_0x17955f(0x1ea)]&&_0xcc9363['push'](col(_0x17955f(0x1d9)+_0x2ce9b1+_0x17955f(0x211),{..._0x4e7098,'direction':'in','category':'milestone','detail':_0x1ece4b[_0x17955f(0x1ea)][_0x17955f(0x1c9)]||null}));const _0x194268=_0x1ece4b[_0x17955f(0x1fa)]||_0x1ece4b['exitCriteria']||[];for(let _0x4ed180=0x0;_0x4ed180<_0x194268[_0x17955f(0x1f0)];_0x4ed180++){_0xcc9363[_0x17955f(0x208)](col(_0x17955f(0x1d9)+_0x2ce9b1+_0x17955f(0x203)+_0x4ed180,{..._0x4e7098,'direction':'in','category':_0x17955f(0x1bf),'detail':_0x194268[_0x4ed180]['name']||null}));}const _0x41d899=getStepEntries(_0x1ece4b[_0x17955f(0x22f)]);for(const [_0x13842d,_0xcebc72]of _0x41d899){const _0x426d1b=convertToColumnId(_0x13842d),_0x4533ce=_0xcebc72['type']||null,_0x4292d6=_0xcebc72[_0x17955f(0x1c9)]||null,_0x2ff9e9={..._0x4e7098,'stepType':_0x4533ce,'stepName':_0x4292d6,'stepId':_0x13842d};_0xcc9363[_0x17955f(0x208)](col(_0x17955f(0x1d9)+_0x2ce9b1+'_'+_0x426d1b,{..._0x2ff9e9,'direction':'in','category':_0x17955f(0x1c1)})),_0xcc9363[_0x17955f(0x208)](col(_0x17955f(0x1bc)+_0x2ce9b1+'_'+_0x426d1b,{..._0x2ff9e9,'direction':_0x17955f(0x1e6),'category':_0x17955f(0x1c1)}));if(_0xcebc72[_0x17955f(0x20e)]==='DecisionPoint'&&_0xcebc72[_0x17955f(0x210)])for(const _0x145d1d of _0xcebc72[_0x17955f(0x210)]){_0x145d1d[_0x17955f(0x1da)]&&_0xcc9363[_0x17955f(0x208)](col('intime_stage_'+_0x2ce9b1+'_'+_0x426d1b+'_'+_0x145d1d[_0x17955f(0x1da)],{..._0x2ff9e9,'direction':'in','category':_0x17955f(0x217),'detail':_0x145d1d[_0x17955f(0x1c9)]||(_0x145d1d['excluded']?_0x17955f(0x1ef):null)}));}if((_0xcebc72['type']===_0x17955f(0x233)||_0xcebc72[_0x17955f(0x20e)]==='ABTest')&&_0xcebc72[_0x17955f(0x219)])for(const _0x5ea85e of _0xcebc72[_0x17955f(0x219)]){_0x5ea85e['id']&&_0xcc9363[_0x17955f(0x208)](col('intime_stage_'+_0x2ce9b1+'_'+_0x426d1b+_0x17955f(0x20c)+convertToColumnId(_0x5ea85e['id']),{..._0x2ff9e9,'direction':'in','category':_0x17955f(0x1cd),'detail':_0x5ea85e[_0x17955f(0x1c9)]||null}));}if(_0xcebc72[_0x17955f(0x20e)]===_0x17955f(0x222)||_0xcebc72[_0x17955f(0x20e)]===_0x17955f(0x1b7)){const _0x1358fd=[];if(_0xcebc72[_0x17955f(0x218)])_0x1358fd[_0x17955f(0x208)](_0xcebc72['conditionSegmentId']);else{if(Array[_0x17955f(0x1c2)](_0xcebc72[_0x17955f(0x237)]))for(const _0x41a884 of _0xcebc72['conditions']){_0x41a884['segmentId']&&!_0x41a884[_0x17955f(0x1f5)]&&_0x1358fd[_0x17955f(0x208)](_0x41a884['segmentId']);}else _0xcebc72[_0x17955f(0x21e)]?.['segmentId']&&_0x1358fd[_0x17955f(0x208)](_0xcebc72['waitCondition'][_0x17955f(0x1da)]);}for(const _0x21d21a of _0x1358fd){_0xcc9363[_0x17955f(0x208)](col('intime_stage_'+_0x2ce9b1+'_'+_0x426d1b+'_'+_0x21d21a,{..._0x2ff9e9,'direction':'in','category':_0x17955f(0x217)}));}}}}return _0xcc9363[_0x17955f(0x208)](col(_0x17955f(0x1e3))),_0xcc9363;}export function aggregateJourneyHistory(_0x320802){const _0x29db8b=a108_0x4687f6,_0x4a8300=_0x320802[_0x29db8b(0x1e7)]((_0x1ffa29,_0x272a02)=>_0x1ffa29+(_0x272a02[_0x29db8b(0x224)]??0x0),0x0),_0x1ad4b8=_0x320802[_0x29db8b(0x1e7)]((_0x2d81a7,_0x38d6ab)=>_0x2d81a7+(_0x38d6ab[_0x29db8b(0x1fe)]??0x0),0x0),_0x5a82fc=_0x320802[_0x29db8b(0x1e7)]((_0x39651c,_0x2f9e29)=>_0x39651c+((_0x2f9e29[_0x29db8b(0x1f2)]??0x0)+(_0x2f9e29[_0x29db8b(0x1de)]??0x0)),0x0),_0x51d9d4=_0x320802[_0x320802[_0x29db8b(0x1f0)]-0x1];return{'size':_0x51d9d4?.[_0x29db8b(0x1f3)]??0x0,'entered':_0x4a8300,'goal_achieved':_0x1ad4b8,'completion_rate':_0x1ad4b8&&_0x4a8300?_0x1ad4b8/_0x4a8300*0x64:0x0,'exit_or_jump':_0x5a82fc,'exit_or_jump_rate':_0x5a82fc&&_0x4a8300?_0x5a82fc/_0x4a8300*0x64:0x0};}export function aggregateStageHistory(_0x1f5dcf){const _0x995fb1=a108_0x4687f6,_0x548baf=_0x1f5dcf['reduce']((_0x2390f5,_0x54ba20)=>_0x2390f5+(_0x54ba20[_0x995fb1(0x224)]??0x0),0x0),_0x40cd94=_0x1f5dcf[_0x995fb1(0x1e7)]((_0x3c5649,_0x39ceb4)=>_0x3c5649+(_0x39ceb4[_0x995fb1(0x21c)]??0x0),0x0),_0x1cd3f5=_0x1f5dcf['reduce']((_0x4b8e71,_0x3b23f8)=>_0x4b8e71+((_0x3b23f8[_0x995fb1(0x1f2)]??0x0)+(_0x3b23f8[_0x995fb1(0x1de)]??0x0)),0x0),_0x39e0ab=_0x1f5dcf[_0x1f5dcf[_0x995fb1(0x1f0)]-0x1];return{'size':_0x39e0ab?.[_0x995fb1(0x1f3)]??0x0,'entered':_0x548baf,'milestone':_0x40cd94,'milestone_rate':_0x40cd94&&_0x548baf?_0x40cd94/_0x548baf*0x64:0x0,'exit_or_jump':_0x1cd3f5,'exit_or_jump_rate':_0x1cd3f5&&_0x548baf?_0x1cd3f5/_0x548baf*0x64:0x0};}export function assembleJourneyStats(_0x232085,_0x3d03db){const _0x21586b=a108_0x4687f6,_0x3e3e97=!!(_0x3d03db?.[_0x21586b(0x1cf)]||_0x3d03db?.['to'])&&!!_0x232085['history']?.[_0x21586b(0x1f0)];if(_0x3e3e97){const _0x122511=aggregateJourneyHistory(_0x232085[_0x21586b(0x209)]),_0x57411a={'journey_id':_0x232085[_0x21586b(0x1e4)],..._0x3d03db?.[_0x21586b(0x1cf)]&&{'from':_0x3d03db['from']},..._0x3d03db?.['to']&&{'to':_0x3d03db['to']},..._0x122511};return _0x3d03db?.[_0x21586b(0x1be)]&&(_0x57411a['history']=_0x232085['history']),_0x57411a;}return{'journey_id':_0x232085['journeyId'],'size':_0x232085[_0x21586b(0x1f3)],'entered':_0x232085[_0x21586b(0x200)],'goal_achieved':_0x232085[_0x21586b(0x1bd)],'completion_rate':_0x232085['completionRate'],'exit_or_jump':_0x232085[_0x21586b(0x201)],'exit_or_jump_rate':_0x232085[_0x21586b(0x229)]};}export function formatVersionsFromBundle(_0xeb3fd3){const _0x26989d=a108_0x4687f6,_0x481571=_0xeb3fd3['journeys']['map'](_0x348702=>({'journeyId':_0x348702['id'],'versionNumber':_0x348702[_0x26989d(0x22a)]['versionNumber']??0x0,'name':_0x348702['attributes'][_0x26989d(0x1c9)],'state':_0x348702[_0x26989d(0x22a)][_0x26989d(0x1ff)],'paused':_0x348702['attributes'][_0x26989d(0x1d6)],'createdAt':_0x348702[_0x26989d(0x22a)][_0x26989d(0x213)],'updatedAt':_0x348702[_0x26989d(0x22a)][_0x26989d(0x1d2)]}));return _0x481571['sort']((_0x49295a,_0x5904dd)=>_0x49295a['versionNumber']-_0x5904dd[_0x26989d(0x227)]),_0x481571;}export function synthesizePreBundleVersion(_0x4aaffc){const _0x5c0579=a108_0x4687f6;return{'journeyId':_0x4aaffc['id'],'versionNumber':0x1,'name':_0x4aaffc[_0x5c0579(0x22a)][_0x5c0579(0x1c9)],'state':_0x4aaffc[_0x5c0579(0x22a)][_0x5c0579(0x1ff)],'paused':_0x4aaffc[_0x5c0579(0x22a)][_0x5c0579(0x1d6)],'createdAt':_0x4aaffc[_0x5c0579(0x22a)]['createdAt'],'updatedAt':_0x4aaffc['attributes'][_0x5c0579(0x1d2)]};}export function buildStageNameMap(_0x169e80){const _0x2a16cb=a108_0x4687f6;return new Map(_0x169e80[_0x2a16cb(0x22a)][_0x2a16cb(0x1c4)]?.[_0x2a16cb(0x1e2)](_0x1fbdb7=>[_0x1fbdb7['id'],_0x1fbdb7['name']])??[]);}function a108_0x283c(_0x45a9a7,_0x149e89){_0x45a9a7=_0x45a9a7-0x1b5;const _0xedabf8=a108_0xedab();let _0x283c93=_0xedabf8[_0x45a9a7];return _0x283c93;}export class JourneySDK{[a108_0x4687f6(0x204)];constructor(_0x167104){const _0x4e39d4=a108_0x4687f6;this[_0x4e39d4(0x204)]=new CDPApiClient(_0x167104);}['applyVersionDeduplication'](_0x2f0b3f,_0xe3e224){return _0xe3e224?_0x2f0b3f:deduplicateJourneysByBundle(_0x2f0b3f);}async[a108_0x4687f6(0x23c)](_0x1b2003,_0x50a067){const _0xc80c0b=a108_0x4687f6;try{const _0x38372a=await this[_0xc80c0b(0x204)][_0xc80c0b(0x23c)](_0x1b2003);return{'journeys':this['applyVersionDeduplication'](_0x38372a['journeys'],_0x50a067),'activationStepsById':_0x38372a[_0xc80c0b(0x206)]};}catch(_0x2a5811){if(isHttp404Error(_0x2a5811))return{'journeys':[],'activationStepsById':new Map()};throw _0x2a5811;}}async[a108_0x4687f6(0x220)](_0x427cb4,_0xcefce0,_0x2b69f9){const _0x17a2fa=a108_0x4687f6;let _0x5ed32b=_0xcefce0;if(!_0x5ed32b)try{const _0x58971b=await this[_0x17a2fa(0x204)]['getParentSegmentFull'](_0x427cb4);_0x5ed32b=_0x58971b['rootFolderId']??undefined;}catch(_0x24bd7b){if(isHttp404Error(_0x24bd7b))return[];throw _0x24bd7b;}if(!_0x5ed32b)return[];let _0x381610;if(_0x2b69f9?.[_0x17a2fa(0x226)]){const _0x30fecb=await this[_0x17a2fa(0x204)][_0x17a2fa(0x1fd)](_0x427cb4),_0x2ab372=_0x30fecb[_0x17a2fa(0x1e2)](_0x131de6=>this['client'][_0x17a2fa(0x1ca)](_0x131de6['id'])),_0x2af25e=await Promise[_0x17a2fa(0x232)](_0x2ab372),_0x149ccc=new Set();_0x381610=_0x2af25e['flat']()[_0x17a2fa(0x216)](_0x53b1bc=>{const _0x559258=_0x17a2fa;if(_0x149ccc[_0x559258(0x231)](_0x53b1bc['id']))return![];return _0x149ccc[_0x559258(0x1e9)](_0x53b1bc['id']),!![];});}else{const _0x422a6c=await this[_0x17a2fa(0x204)][_0x17a2fa(0x1ba)](_0x5ed32b,0x20,![]),_0x19f708=_0x422a6c[_0x17a2fa(0x1e1)],_0x2b36bc=_0x19f708[_0x17a2fa(0x216)](_0x1b6e95=>_0x1b6e95[_0x17a2fa(0x20e)]===_0x17a2fa(0x1c3));_0x381610=_0x2b36bc['map'](_0x73a34e=>entityToJourneyListItem(_0x73a34e,_0x427cb4));}return this[_0x17a2fa(0x1c7)](_0x381610,_0x2b69f9?.[_0x17a2fa(0x226)]);}async['listJourneysWithFolders'](_0x5c295b,_0x2c5703,_0x138689){const _0x973feb=a108_0x4687f6;if(!_0x2c5703)return{'journeys':[],'folders':[]};const _0x332128=await this['client'][_0x973feb(0x1ba)](_0x2c5703,0x20,![]),_0xeef91e=_0x332128[_0x973feb(0x1e1)],_0x2028dc=_0xeef91e[_0x973feb(0x216)](_0x584cd8=>_0x584cd8['type']===_0x973feb(0x225)&&_0x584cd8['id']!==_0x2c5703),_0x3372f8=_0x2028dc[_0x973feb(0x1e2)](_0x403a66=>({'id':_0x403a66['id'],'name':_0x403a66[_0x973feb(0x22a)]['name']})),_0x5c959a=_0xeef91e[_0x973feb(0x216)](_0x5e4188=>_0x5e4188[_0x973feb(0x20e)]==='journey'),_0x50a00f=_0x5c959a[_0x973feb(0x1e2)](_0x2131c1=>entityToJourneyListItem(_0x2131c1,_0x5c295b));return{'journeys':this['applyVersionDeduplication'](_0x50a00f,_0x138689?.[_0x973feb(0x226)]),'folders':_0x3372f8};}async[a108_0x4687f6(0x20b)](_0x5eb4e2,_0x103ba0){const _0x2ba859=a108_0x4687f6;let _0x1e97ea;try{_0x1e97ea=await this[_0x2ba859(0x204)][_0x2ba859(0x1fd)](_0x5eb4e2);}catch(_0x837bad){if(isHttp404Error(_0x837bad))return{'journeys':[],'activationStepsById':new Map()};throw _0x837bad;}const _0x31de29=_0x1e97ea[_0x2ba859(0x1e2)](async _0x216f3b=>{const _0x20ab5c=_0x2ba859;return await this[_0x20ab5c(0x23c)](_0x216f3b['id'],_0x103ba0?.['includeAllVersions']);}),_0x22dc9f=await Promise[_0x2ba859(0x232)](_0x31de29),_0x5b4f38=new Map(),_0x166c7c=[];for(const _0x4878c0 of _0x22dc9f){_0x166c7c[_0x2ba859(0x208)](..._0x4878c0[_0x2ba859(0x238)]);for(const [_0x371400,_0x2bb0e0]of _0x4878c0[_0x2ba859(0x206)]){_0x5b4f38['set'](_0x371400,_0x2bb0e0);}}const _0x2db931=new Set(),_0x47a8b0=_0x166c7c['filter'](_0x34c73b=>{const _0x5ee57f=_0x2ba859;if(_0x2db931[_0x5ee57f(0x231)](_0x34c73b['id']))return![];return _0x2db931[_0x5ee57f(0x1e9)](_0x34c73b['id']),!![];});return{'journeys':this[_0x2ba859(0x1c7)](_0x47a8b0,_0x103ba0?.['includeAllVersions']),'activationStepsById':_0x5b4f38};}async[a108_0x4687f6(0x23a)](_0x388f51){const _0x139f77=a108_0x4687f6;try{return await this[_0x139f77(0x204)][_0x139f77(0x23a)](_0x388f51);}catch(_0x2b1222){if(isHttp404Error(_0x2b1222))throw new SDKError(ErrorCode[_0x139f77(0x1c5)],_0x139f77(0x235)+_0x388f51,_0x2b1222);throw _0x2b1222;}}async['resolveJourneyId'](_0x2e9fb6,_0x3af77e){const _0x45fd26=a108_0x4687f6,_0x1a8f71=await this[_0x45fd26(0x220)](_0x2e9fb6),_0x491305=_0x1a8f71[_0x45fd26(0x207)](_0x48d709=>_0x48d709[_0x45fd26(0x215)]['toLowerCase']()===_0x3af77e['toLowerCase']());if(!_0x491305)throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],_0x45fd26(0x235)+_0x3af77e,undefined,{'helpText':_0x45fd26(0x202)});return _0x491305['id'];}async[a108_0x4687f6(0x221)](_0x93105f,_0x2f25ec){const _0x26e81e=a108_0x4687f6;try{return await this[_0x26e81e(0x204)]['getJourneyStatistics'](_0x93105f,_0x2f25ec);}catch(_0x1a22ad){if(isHttp404Error(_0x1a22ad))throw new SDKError(ErrorCode[_0x26e81e(0x1c5)],_0x26e81e(0x235)+_0x93105f,_0x1a22ad);throw _0x1a22ad;}}async[a108_0x4687f6(0x21b)](_0x112833,_0xf0dc81){const _0x39530f=a108_0x4687f6,_0xe6da90={'from':_0xf0dc81?.[_0x39530f(0x1cf)],'to':_0xf0dc81?.['to'],'limit':_0xf0dc81?.[_0x39530f(0x1f7)]},_0x48af03=_0xf0dc81?.['type']!==_0x39530f(0x21a);try{const [_0x44b592,_0x15c6db]=await Promise[_0x39530f(0x232)]([this[_0x39530f(0x22c)](_0x112833,_0xf0dc81?.[_0x39530f(0x20e)],_0xe6da90),_0x48af03?this[_0x39530f(0x23a)](_0x112833):undefined]);if(_0x44b592[_0x39530f(0x1d3)]&&_0x15c6db){const _0x49ddf4=buildStageNameMap(_0x15c6db);_0x44b592[_0x39530f(0x1d3)]=_0x44b592['activation'][_0x39530f(0x1e2)](_0x4ad4ca=>({..._0x4ad4ca,'journeyStageName':_0x49ddf4[_0x39530f(0x23b)](_0x4ad4ca['journeyStageId'])??_0x4ad4ca[_0x39530f(0x214)]}));}return _0x44b592;}catch(_0x339c75){if(isHttp404Error(_0x339c75))throw new SDKError(ErrorCode[_0x39530f(0x1c5)],_0x39530f(0x235)+_0x112833,_0x339c75);throw _0x339c75;}}async['fetchTrafficRaw'](_0x1e89c1,_0x39bd2f,_0x52b254){const _0x4de64b=a108_0x4687f6;if(_0x39bd2f==='conversion'){const _0x37553e=await this['client'][_0x4de64b(0x1c6)](_0x1e89c1,_0x52b254);return{'conversion':_0x37553e};}if(_0x39bd2f==='activation'){const _0x1a009c=await this['client']['getActivationSankeyChart'](_0x1e89c1,_0x52b254);return{'activation':_0x1a009c};}const [_0x269b52,_0x494eae]=await Promise['all']([this[_0x4de64b(0x204)][_0x4de64b(0x1c6)](_0x1e89c1,_0x52b254),this['client'][_0x4de64b(0x20f)](_0x1e89c1,_0x52b254)]);return{'conversion':_0x269b52,'activation':_0x494eae};}async[a108_0x4687f6(0x1dc)](_0x88d22d){const _0xc5c9c3=a108_0x4687f6;try{return await this['client']['pauseJourney'](_0x88d22d);}catch(_0x5494bf){if(isHttp404Error(_0x5494bf))throw new SDKError(ErrorCode[_0xc5c9c3(0x1c5)],_0xc5c9c3(0x235)+_0x88d22d,_0x5494bf);throw _0x5494bf;}}async['resume'](_0xf22008){const _0x40afec=a108_0x4687f6;try{return await this['client'][_0x40afec(0x1c8)](_0xf22008);}catch(_0x5bbd10){if(isHttp404Error(_0x5bbd10))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],'Journey\x20not\x20found:\x20'+_0xf22008,_0x5bbd10);throw _0x5bbd10;}}async[a108_0x4687f6(0x1ed)](_0x562f17){const _0x2463ae=a108_0x4687f6;return await this[_0x2463ae(0x204)][_0x2463ae(0x1eb)](_0x562f17);}async[a108_0x4687f6(0x1b6)](_0x493c9f,_0x5118a1){const _0x5727dc=a108_0x4687f6;try{return await this['client']['updateJourney'](_0x493c9f,_0x5118a1);}catch(_0x21e0fa){if(isHttp404Error(_0x21e0fa))throw new SDKError(ErrorCode[_0x5727dc(0x1c5)],'Journey\x20not\x20found:\x20'+_0x493c9f,_0x21e0fa);throw _0x21e0fa;}}async[a108_0x4687f6(0x1e0)](_0x22312a,_0x42f7ef){const _0x24b3cc=a108_0x4687f6;try{return await this['client']['getJourneyActivation'](_0x22312a,_0x42f7ef);}catch(_0x3d0026){if(isHttp404Error(_0x3d0026))throw new SDKError(ErrorCode[_0x24b3cc(0x1b8)],_0x24b3cc(0x234)+_0x42f7ef+'\x20in\x20journey\x20'+_0x22312a,_0x3d0026);throw _0x3d0026;}}async[a108_0x4687f6(0x22d)](_0x147e55){const _0xe49b16=a108_0x4687f6;try{return await this[_0xe49b16(0x204)][_0xe49b16(0x1f9)](_0x147e55);}catch(_0x28ca9f){if(isHttp404Error(_0x28ca9f))return[];throw _0x28ca9f;}}async['listActivationsFlat'](_0x3dcdba){const _0x3104a9=a108_0x4687f6,_0x4f4af2=await this[_0x3104a9(0x22d)](_0x3dcdba);return _0x4f4af2[_0x3104a9(0x1e2)](flattenJourneyActivation);}async['createActivation'](_0xfbcfd4,_0x270908){const _0x3a01a6=a108_0x4687f6;return await this['client'][_0x3a01a6(0x223)](_0xfbcfd4,_0x270908);}async[a108_0x4687f6(0x1fc)](_0x53c83f){const _0x253607=a108_0x4687f6,_0x2f7c29=await this[_0x253607(0x23a)](_0x53c83f),_0x1012a8=generateColumnMapping(_0x2f7c29);return{'journeyId':_0x2f7c29['id'],'journeyName':_0x2f7c29['attributes'][_0x253607(0x1c9)],'database':_0x253607(0x1d8)+_0x2f7c29[_0x253607(0x22a)][_0x253607(0x1f6)],'table':_0x253607(0x1c0)+_0x2f7c29['id'],'columns':_0x1012a8};}async[a108_0x4687f6(0x1cc)](_0x4ee1cd){const _0x3c9766=a108_0x4687f6;return this[_0x3c9766(0x204)]['getJourneyBundle'](_0x4ee1cd);}async[a108_0x4687f6(0x1dd)](_0x196a3d){const _0xa806a9=a108_0x4687f6;if(!_0x196a3d)return undefined;try{const _0x31e792=await this[_0xa806a9(0x1cc)](_0x196a3d);return _0x31e792['latestJourneyId'];}catch{return undefined;}}async['listVersions'](_0x1aa038){const _0x3290c1=a108_0x4687f6,_0x13ee02=await this[_0x3290c1(0x23a)](_0x1aa038),_0x508b90=_0x13ee02[_0x3290c1(0x22a)][_0x3290c1(0x1e5)];if(!_0x508b90)return{'bundleId':'','bundleName':_0x13ee02['attributes'][_0x3290c1(0x1c9)],'bundleDescription':_0x13ee02[_0x3290c1(0x22a)]['description']??null,'latestJourneyId':_0x13ee02['id'],'versions':[synthesizePreBundleVersion(_0x13ee02)]};const _0x30344e=await this[_0x3290c1(0x1cc)](_0x508b90);return{'bundleId':_0x508b90,'bundleName':_0x30344e[_0x3290c1(0x1c9)],'bundleDescription':_0x30344e[_0x3290c1(0x205)]??null,'latestJourneyId':_0x30344e[_0x3290c1(0x228)],'versions':formatVersionsFromBundle(_0x30344e)};}async[a108_0x4687f6(0x21d)](_0x176365){const _0x300038=a108_0x4687f6,_0x1162cc=await this[_0x300038(0x23a)](_0x176365),_0x224eb7=_0x1162cc[_0x300038(0x22a)]['journeyBundleId'];if(!_0x224eb7)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x300038(0x21f));await this['client'][_0x300038(0x22e)](_0x224eb7);const _0x924b89=await this['client']['getJourneyBundle'](_0x224eb7),_0x190436=_0x924b89[_0x300038(0x1c9)]+'\x20v'+(_0x924b89['lastVersionNumber']+0x1);return this['client'][_0x300038(0x1d7)](_0x224eb7,{'sourceId':_0x176365,'attributes':{'name':_0x190436}});}}
1
+ const a116_0x19a12f=a116_0x49ec;(function(_0x5879b7,_0x4f3966){const _0x1c1d75=a116_0x49ec,_0x2604d8=_0x5879b7();while(!![]){try{const _0x55f5d4=parseInt(_0x1c1d75(0x226))/0x1+parseInt(_0x1c1d75(0x1dd))/0x2+parseInt(_0x1c1d75(0x245))/0x3*(-parseInt(_0x1c1d75(0x1f8))/0x4)+-parseInt(_0x1c1d75(0x1d6))/0x5*(-parseInt(_0x1c1d75(0x268))/0x6)+parseInt(_0x1c1d75(0x231))/0x7*(parseInt(_0x1c1d75(0x1d8))/0x8)+-parseInt(_0x1c1d75(0x222))/0x9*(parseInt(_0x1c1d75(0x21e))/0xa)+-parseInt(_0x1c1d75(0x21d))/0xb;if(_0x55f5d4===_0x4f3966)break;else _0x2604d8['push'](_0x2604d8['shift']());}catch(_0x172a04){_0x2604d8['push'](_0x2604d8['shift']());}}}(a116_0x5ecf,0xb0585));import{CDPApiClient}from'./client/cdp-api-client.js';import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0x34560c){const _0xecacb4=a116_0x49ec;return _0x34560c[_0xecacb4(0x246)]??_0x34560c[_0xecacb4(0x1e1)]?.['journeyBundleId']??undefined;}function getVersionNumber(_0x4dd7d4){const _0x19d7ba=a116_0x49ec;return _0x4dd7d4[_0x19d7ba(0x22b)]??_0x4dd7d4[_0x19d7ba(0x1e1)]?.[_0x19d7ba(0x22b)]??0x0;}export function deduplicateJourneysByBundle(_0x122769){const _0x284592=a116_0x49ec,_0x109eb9=new Map();let _0x4be97b=0x0;for(const _0x50db45 of _0x122769){const _0x5c4cac=getBundleId(_0x50db45);if(!_0x5c4cac){const _0x19f720=_0x284592(0x20f)+(_0x50db45['id']??_0x284592(0x21c)+_0x4be97b++);_0x109eb9['set'](_0x19f720,_0x50db45);continue;}const _0x3754e4=_0x109eb9['get'](_0x5c4cac);if(!_0x3754e4)_0x109eb9[_0x284592(0x202)](_0x5c4cac,_0x50db45);else{const _0x2d15aa=getVersionNumber(_0x3754e4),_0x7244b=getVersionNumber(_0x50db45);_0x7244b>_0x2d15aa&&_0x109eb9[_0x284592(0x202)](_0x5c4cac,_0x50db45);}}return Array['from'](_0x109eb9[_0x284592(0x262)]());}const VALID_JOURNEY_STATES=new Set([a116_0x19a12f(0x224),a116_0x19a12f(0x236),a116_0x19a12f(0x242)]);export function parseJourneyState(_0x431678){const _0x45c158=a116_0x19a12f;if(typeof _0x431678==='string'&&VALID_JOURNEY_STATES[_0x45c158(0x204)](_0x431678))return _0x431678;return _0x45c158(0x224);}export function entityToJourneyListItem(_0x1321b0,_0x5093dc){const _0x149fc7=a116_0x19a12f,_0x2e6cc8=_0x1321b0['attributes'];return{'id':_0x1321b0['id'],'name':_0x2e6cc8[_0x149fc7(0x209)]??'','journeyBundleName':_0x2e6cc8[_0x149fc7(0x267)]??_0x2e6cc8[_0x149fc7(0x209)]??'','journeyBundleId':_0x2e6cc8[_0x149fc7(0x246)]??'','versionNumber':_0x2e6cc8['versionNumber'],'description':_0x2e6cc8[_0x149fc7(0x24b)]??null,'state':parseJourneyState(_0x2e6cc8[_0x149fc7(0x1f4)]),'paused':_0x2e6cc8[_0x149fc7(0x252)]??![],'audienceId':_0x5093dc,'folderId':_0x2e6cc8['segmentFolderId']??_0x1321b0['relationships']?.[_0x149fc7(0x217)]?.[_0x149fc7(0x211)]?.['id']??null,'createdAt':_0x2e6cc8[_0x149fc7(0x207)]??'','updatedAt':_0x2e6cc8[_0x149fc7(0x24c)]??''};}function convertToColumnId(_0x1791eb){const _0x4e8f38=a116_0x19a12f;return _0x1791eb[_0x4e8f38(0x25e)](/-/g,'_');}function getStepEntries(_0x583969){const _0x6d88ff=a116_0x19a12f;if(!_0x583969)return[];if(Array[_0x6d88ff(0x1f5)](_0x583969))return _0x583969[_0x6d88ff(0x25c)](_0x5ddb9d=>[_0x5ddb9d['id'],_0x5ddb9d]);return Object[_0x6d88ff(0x1f9)](_0x583969);}function a116_0x5ecf(){const _0x4e1247=['journey','pauseJourney','branch','intime_goal','getJourneyStatistics','set','resolveJourneyId','has','getActivationSankeyChart','timedOutPath','createdAt','getJourney','name','Journey\x20not\x20found:\x20','exitCriteria','listVersions','getParentSegmentFull','journeyStageId','no-bundle-','listJourneysFromParentSegment','data','goalSize','size','intime_journey','listActivations','createVersion','parentFolder','all','ABTest','step','getBundle','idx-','20981763DgiajG','503430YiDVzm','listJourneyActivations','folder-segment','cdp_customer_id','99kunSGQ','listJourneysWithFolders','draft','DecisionPoint','1415750OFPbzU','fetchTrafficRaw','INVALID_ARGUMENT','latestJourneyId','listJourneysWithDetails','versionNumber','applyVersionDeduplication','JOURNEY_NOT_FOUND','goal','from','rootFolderId','45178luGCNZ','exitInflux','fixed','Wait','journey_','simulation','out','add','getJourneyActivation','enteredSize','_variant_','segmentId','getTrafficData','limit','type','sort','getColumnMapping','launched','exit_criteria','getConversionSankeyChart','6tjSazO','journeyBundleId','variant','outtime_journey','updateJourney','pause','description','updatedAt','outtime_stage_','branches','createJourneyVersion','checkJourneyAppendable','jumpInflux','paused','completionRate','resumeJourney','Journey\x20activation\x20step\x20not\x20found:\x20','AbTest','WaitStep','\x20in\x20journey\x20','listEntitiesByFolder','find','Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle','map','history','replace','entryInflux','createJourneyActivation','reduce','values','conditions','createJourney','includeAllVersions','intime_stage_','journeyBundleName','10866eOnMmo','toLowerCase','1715PbcDzo','createActivation','1656qeiTlY','resume','time','getActivation','getJourneyBundle','2177272rwTPPt','exitOrJumpSize','journeys','variants','attributes','conditionSegmentId','journeyStages','listSegmentFolders','filter','activation','exitOrJumpRate','listActivationsFlat','client','conversion','create','getStatistics','activationStepsById','_milestone','_exit_','Excluded\x20profiles','milestone','stage','journeyId','state','isArray','getLatestJourneyId','listJourneys','2556044ZiPpIB','entries','push','length','flat'];a116_0x5ecf=function(){return _0x4e1247;};return a116_0x5ecf();}export function flattenJourneyActivation(_0x179e21){const {activationParams:_0x54e008,activationId:_0x11ffb7,runAfterJourneyRefresh:_0x1d0298}=_0x179e21['attributes'];return{'id':_0x179e21['id'],'activationId':_0x11ffb7,'runAfterJourneyRefresh':_0x1d0298,..._0x54e008};}function col(_0x4099c5,_0x26acac={}){const _0xbd9dc5=a116_0x19a12f;return{'column':_0x4099c5,'direction':null,'stageIndex':null,'stageName':null,'category':_0xbd9dc5(0x233),'stepType':null,'stepName':null,'stepId':null,'detail':null,..._0x26acac};}function a116_0x49ec(_0x25babe,_0x5273cf){_0x25babe=_0x25babe-0x1d5;const _0x5ecfef=a116_0x5ecf();let _0x49eccd=_0x5ecfef[_0x25babe];return _0x49eccd;}export function generateColumnMapping(_0xb2329e){const _0x5b3aef=a116_0x19a12f,_0x23c0ed=[];_0x23c0ed['push'](col(_0x5b3aef(0x221))),_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x214),{'direction':'in','category':_0x5b3aef(0x1fd)})),_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x248),{'direction':_0x5b3aef(0x237),'category':_0x5b3aef(0x1fd)}));_0xb2329e[_0x5b3aef(0x1e1)]['goal']&&_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x200),{'direction':'in','category':_0x5b3aef(0x22e),'detail':_0xb2329e[_0x5b3aef(0x1e1)]['goal'][_0x5b3aef(0x209)]||null}));const _0x58d9fd=_0xb2329e['attributes'][_0x5b3aef(0x1e3)]||[];for(let _0x3b9dc4=0x0;_0x3b9dc4<_0x58d9fd[_0x5b3aef(0x1fb)];_0x3b9dc4++){const _0x3305f1=_0x58d9fd[_0x3b9dc4],_0x893d4a=_0x3305f1[_0x5b3aef(0x209)],_0x162e35={'stageIndex':_0x3b9dc4,'stageName':_0x893d4a},_0x57b156=_0x3305f1['entryCriteria']?.['name']||null;_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x266)+_0x3b9dc4,{..._0x162e35,'direction':'in','category':'stage','detail':_0x57b156})),_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x24d)+_0x3b9dc4,{..._0x162e35,'direction':_0x5b3aef(0x237),'category':_0x5b3aef(0x1f2),'detail':_0x57b156}));_0x3305f1[_0x5b3aef(0x1f1)]&&_0x23c0ed[_0x5b3aef(0x1fa)](col('intime_stage_'+_0x3b9dc4+_0x5b3aef(0x1ee),{..._0x162e35,'direction':'in','category':_0x5b3aef(0x1f1),'detail':_0x3305f1[_0x5b3aef(0x1f1)][_0x5b3aef(0x209)]||null}));const _0x452419=_0x3305f1['exitCriterias']||_0x3305f1[_0x5b3aef(0x20b)]||[];for(let _0x494872=0x0;_0x494872<_0x452419[_0x5b3aef(0x1fb)];_0x494872++){_0x23c0ed['push'](col(_0x5b3aef(0x266)+_0x3b9dc4+_0x5b3aef(0x1ef)+_0x494872,{..._0x162e35,'direction':'in','category':_0x5b3aef(0x243),'detail':_0x452419[_0x494872][_0x5b3aef(0x209)]||null}));}const _0x5b6d4f=getStepEntries(_0x3305f1['steps']);for(const [_0x203566,_0xc852dd]of _0x5b6d4f){const _0x17e478=convertToColumnId(_0x203566),_0x183514=_0xc852dd['type']||null,_0x1a3c7d=_0xc852dd['name']||null,_0x44f350={..._0x162e35,'stepType':_0x183514,'stepName':_0x1a3c7d,'stepId':_0x203566};_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x266)+_0x3b9dc4+'_'+_0x17e478,{..._0x44f350,'direction':'in','category':_0x5b3aef(0x21a)})),_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x24d)+_0x3b9dc4+'_'+_0x17e478,{..._0x44f350,'direction':_0x5b3aef(0x237),'category':'step'}));if(_0xc852dd[_0x5b3aef(0x23f)]===_0x5b3aef(0x225)&&_0xc852dd[_0x5b3aef(0x24e)])for(const _0x55b647 of _0xc852dd[_0x5b3aef(0x24e)]){_0x55b647['segmentId']&&_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x266)+_0x3b9dc4+'_'+_0x17e478+'_'+_0x55b647[_0x5b3aef(0x23c)],{..._0x44f350,'direction':'in','category':_0x5b3aef(0x1ff),'detail':_0x55b647['name']||(_0x55b647['excluded']?_0x5b3aef(0x1f0):null)}));}if((_0xc852dd[_0x5b3aef(0x23f)]===_0x5b3aef(0x256)||_0xc852dd[_0x5b3aef(0x23f)]===_0x5b3aef(0x219))&&_0xc852dd[_0x5b3aef(0x1e0)])for(const _0x3f16fd of _0xc852dd[_0x5b3aef(0x1e0)]){_0x3f16fd['id']&&_0x23c0ed[_0x5b3aef(0x1fa)](col('intime_stage_'+_0x3b9dc4+'_'+_0x17e478+_0x5b3aef(0x23b)+convertToColumnId(_0x3f16fd['id']),{..._0x44f350,'direction':'in','category':_0x5b3aef(0x247),'detail':_0x3f16fd[_0x5b3aef(0x209)]||null}));}if(_0xc852dd[_0x5b3aef(0x23f)]===_0x5b3aef(0x257)||_0xc852dd[_0x5b3aef(0x23f)]===_0x5b3aef(0x234)){const _0x44b095=[];if(_0xc852dd['conditionSegmentId'])_0x44b095['push'](_0xc852dd[_0x5b3aef(0x1e2)]);else{if(Array['isArray'](_0xc852dd['conditions']))for(const _0x113fb9 of _0xc852dd[_0x5b3aef(0x263)]){_0x113fb9[_0x5b3aef(0x23c)]&&!_0x113fb9[_0x5b3aef(0x206)]&&_0x44b095[_0x5b3aef(0x1fa)](_0x113fb9[_0x5b3aef(0x23c)]);}else _0xc852dd['waitCondition']?.[_0x5b3aef(0x23c)]&&_0x44b095[_0x5b3aef(0x1fa)](_0xc852dd['waitCondition'][_0x5b3aef(0x23c)]);}for(const _0xc853fc of _0x44b095){_0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x266)+_0x3b9dc4+'_'+_0x17e478+'_'+_0xc853fc,{..._0x44f350,'direction':'in','category':_0x5b3aef(0x1ff)}));}}}}return _0x23c0ed[_0x5b3aef(0x1fa)](col(_0x5b3aef(0x1da))),_0x23c0ed;}export function aggregateJourneyHistory(_0x279a43){const _0x3f5b34=a116_0x19a12f,_0x295e3d=_0x279a43['reduce']((_0x40768b,_0x135717)=>_0x40768b+(_0x135717[_0x3f5b34(0x25f)]??0x0),0x0),_0xb35d87=_0x279a43[_0x3f5b34(0x261)]((_0x5dfe92,_0xd8fb56)=>_0x5dfe92+(_0xd8fb56['goalInflux']??0x0),0x0),_0x53d6f8=_0x279a43[_0x3f5b34(0x261)]((_0x5ea4e2,_0x29b370)=>_0x5ea4e2+((_0x29b370[_0x3f5b34(0x232)]??0x0)+(_0x29b370[_0x3f5b34(0x251)]??0x0)),0x0),_0xf3debf=_0x279a43[_0x279a43[_0x3f5b34(0x1fb)]-0x1];return{'size':_0xf3debf?.[_0x3f5b34(0x213)]??0x0,'entered':_0x295e3d,'goal_achieved':_0xb35d87,'completion_rate':_0xb35d87&&_0x295e3d?_0xb35d87/_0x295e3d*0x64:0x0,'exit_or_jump':_0x53d6f8,'exit_or_jump_rate':_0x53d6f8&&_0x295e3d?_0x53d6f8/_0x295e3d*0x64:0x0};}export function aggregateStageHistory(_0x514019){const _0x303149=a116_0x19a12f,_0x2489a1=_0x514019[_0x303149(0x261)]((_0x2beb65,_0x466ed1)=>_0x2beb65+(_0x466ed1[_0x303149(0x25f)]??0x0),0x0),_0x24593f=_0x514019[_0x303149(0x261)]((_0x599c00,_0x44c26d)=>_0x599c00+(_0x44c26d['milestoneInflux']??0x0),0x0),_0x57a6ee=_0x514019['reduce']((_0x36f49d,_0xb41c22)=>_0x36f49d+((_0xb41c22[_0x303149(0x232)]??0x0)+(_0xb41c22[_0x303149(0x251)]??0x0)),0x0),_0x33b887=_0x514019[_0x514019[_0x303149(0x1fb)]-0x1];return{'size':_0x33b887?.['size']??0x0,'entered':_0x2489a1,'milestone':_0x24593f,'milestone_rate':_0x24593f&&_0x2489a1?_0x24593f/_0x2489a1*0x64:0x0,'exit_or_jump':_0x57a6ee,'exit_or_jump_rate':_0x57a6ee&&_0x2489a1?_0x57a6ee/_0x2489a1*0x64:0x0};}export function assembleJourneyStats(_0x2a492e,_0x186d76){const _0x22ad8c=a116_0x19a12f,_0x4ad4fc=!!(_0x186d76?.[_0x22ad8c(0x22f)]||_0x186d76?.['to'])&&!!_0x2a492e['history']?.[_0x22ad8c(0x1fb)];if(_0x4ad4fc){const _0x2224a6=aggregateJourneyHistory(_0x2a492e[_0x22ad8c(0x25d)]),_0x1f53ac={'journey_id':_0x2a492e['journeyId'],..._0x186d76?.['from']&&{'from':_0x186d76[_0x22ad8c(0x22f)]},..._0x186d76?.['to']&&{'to':_0x186d76['to']},..._0x2224a6};return _0x186d76?.['includeHistory']&&(_0x1f53ac[_0x22ad8c(0x25d)]=_0x2a492e[_0x22ad8c(0x25d)]),_0x1f53ac;}return{'journey_id':_0x2a492e[_0x22ad8c(0x1f3)],'size':_0x2a492e[_0x22ad8c(0x213)],'entered':_0x2a492e[_0x22ad8c(0x23a)],'goal_achieved':_0x2a492e[_0x22ad8c(0x212)],'completion_rate':_0x2a492e[_0x22ad8c(0x253)],'exit_or_jump':_0x2a492e[_0x22ad8c(0x1de)],'exit_or_jump_rate':_0x2a492e[_0x22ad8c(0x1e7)]};}export function formatVersionsFromBundle(_0x6bb128){const _0xf53688=a116_0x19a12f,_0x191f35=_0x6bb128[_0xf53688(0x1df)][_0xf53688(0x25c)](_0x482ac0=>({'journeyId':_0x482ac0['id'],'versionNumber':_0x482ac0[_0xf53688(0x1e1)]['versionNumber']??0x0,'name':_0x482ac0[_0xf53688(0x1e1)]['name'],'state':_0x482ac0[_0xf53688(0x1e1)][_0xf53688(0x1f4)],'paused':_0x482ac0[_0xf53688(0x1e1)][_0xf53688(0x252)],'createdAt':_0x482ac0[_0xf53688(0x1e1)][_0xf53688(0x207)],'updatedAt':_0x482ac0[_0xf53688(0x1e1)][_0xf53688(0x24c)]}));return _0x191f35[_0xf53688(0x240)]((_0x358896,_0x5aa680)=>_0x358896[_0xf53688(0x22b)]-_0x5aa680[_0xf53688(0x22b)]),_0x191f35;}export function synthesizePreBundleVersion(_0x56b703){const _0x3f2a61=a116_0x19a12f;return{'journeyId':_0x56b703['id'],'versionNumber':0x1,'name':_0x56b703['attributes'][_0x3f2a61(0x209)],'state':_0x56b703['attributes']['state'],'paused':_0x56b703['attributes'][_0x3f2a61(0x252)],'createdAt':_0x56b703[_0x3f2a61(0x1e1)][_0x3f2a61(0x207)],'updatedAt':_0x56b703['attributes'][_0x3f2a61(0x24c)]};}export function buildStageNameMap(_0x40f8db){const _0x400fee=a116_0x19a12f;return new Map(_0x40f8db[_0x400fee(0x1e1)][_0x400fee(0x1e3)]?.[_0x400fee(0x25c)](_0x359751=>[_0x359751['id'],_0x359751[_0x400fee(0x209)]])??[]);}export class JourneySDK{[a116_0x19a12f(0x1e9)];constructor(_0x4006b8){const _0x2adea7=a116_0x19a12f;this[_0x2adea7(0x1e9)]=new CDPApiClient(_0x4006b8);}[a116_0x19a12f(0x22c)](_0x59fb88,_0x1f3f10){return _0x1f3f10?_0x59fb88:deduplicateJourneysByBundle(_0x59fb88);}async[a116_0x19a12f(0x22a)](_0x3ae014,_0x43ff43){const _0x31c572=a116_0x19a12f;try{const _0x59252f=await this[_0x31c572(0x1e9)][_0x31c572(0x22a)](_0x3ae014);return{'journeys':this[_0x31c572(0x22c)](_0x59252f[_0x31c572(0x1df)],_0x43ff43),'activationStepsById':_0x59252f[_0x31c572(0x1ed)]};}catch(_0xda8998){if(isHttp404Error(_0xda8998))return{'journeys':[],'activationStepsById':new Map()};throw _0xda8998;}}async[a116_0x19a12f(0x210)](_0x1b3d64,_0x3820b9,_0x526e0f){const _0x2ab157=a116_0x19a12f;let _0x1b0887=_0x3820b9;if(!_0x1b0887)try{const _0x576751=await this['client'][_0x2ab157(0x20d)](_0x1b3d64);_0x1b0887=_0x576751[_0x2ab157(0x230)]??undefined;}catch(_0x56182b){if(isHttp404Error(_0x56182b))return[];throw _0x56182b;}if(!_0x1b0887)return[];let _0x4ab94d;if(_0x526e0f?.[_0x2ab157(0x265)]){const _0x4be49d=await this[_0x2ab157(0x1e9)]['listSegmentFolders'](_0x1b3d64),_0x4b955d=_0x4be49d[_0x2ab157(0x25c)](_0x585783=>this[_0x2ab157(0x1e9)][_0x2ab157(0x1f7)](_0x585783['id'])),_0xb6ced0=await Promise[_0x2ab157(0x218)](_0x4b955d),_0xfe6db=new Set();_0x4ab94d=_0xb6ced0[_0x2ab157(0x1fc)]()['filter'](_0x2fb6ad=>{const _0x4ff136=_0x2ab157;if(_0xfe6db[_0x4ff136(0x204)](_0x2fb6ad['id']))return![];return _0xfe6db[_0x4ff136(0x238)](_0x2fb6ad['id']),!![];});}else{const _0x4e2d94=await this[_0x2ab157(0x1e9)][_0x2ab157(0x259)](_0x1b0887,0x20,![]),_0x5dce89=_0x4e2d94[_0x2ab157(0x211)],_0x35737c=_0x5dce89[_0x2ab157(0x1e5)](_0x3ef259=>_0x3ef259[_0x2ab157(0x23f)]===_0x2ab157(0x1fd));_0x4ab94d=_0x35737c[_0x2ab157(0x25c)](_0x37a968=>entityToJourneyListItem(_0x37a968,_0x1b3d64));}return this['applyVersionDeduplication'](_0x4ab94d,_0x526e0f?.[_0x2ab157(0x265)]);}async[a116_0x19a12f(0x223)](_0x2c43b9,_0x4a1f36,_0x323829){const _0x559a2d=a116_0x19a12f;if(!_0x4a1f36)return{'journeys':[],'folders':[]};const _0x42028f=await this[_0x559a2d(0x1e9)][_0x559a2d(0x259)](_0x4a1f36,0x20,![]),_0x5538ab=_0x42028f[_0x559a2d(0x211)],_0x11b8a0=_0x5538ab['filter'](_0x5453b2=>_0x5453b2[_0x559a2d(0x23f)]===_0x559a2d(0x220)&&_0x5453b2['id']!==_0x4a1f36),_0x45f252=_0x11b8a0[_0x559a2d(0x25c)](_0x1ed21b=>({'id':_0x1ed21b['id'],'name':_0x1ed21b[_0x559a2d(0x1e1)][_0x559a2d(0x209)]})),_0x3b8eac=_0x5538ab['filter'](_0x42b2a7=>_0x42b2a7[_0x559a2d(0x23f)]===_0x559a2d(0x1fd)),_0x3591dd=_0x3b8eac[_0x559a2d(0x25c)](_0x2726d3=>entityToJourneyListItem(_0x2726d3,_0x2c43b9));return{'journeys':this[_0x559a2d(0x22c)](_0x3591dd,_0x323829?.[_0x559a2d(0x265)]),'folders':_0x45f252};}async['listJourneysWithDetailsFromParentSegment'](_0x4e8e22,_0x15f1ff){const _0x5c81cc=a116_0x19a12f;let _0x16245f;try{_0x16245f=await this[_0x5c81cc(0x1e9)][_0x5c81cc(0x1e4)](_0x4e8e22);}catch(_0xd7264e){if(isHttp404Error(_0xd7264e))return{'journeys':[],'activationStepsById':new Map()};throw _0xd7264e;}const _0x5dc603=_0x16245f[_0x5c81cc(0x25c)](async _0x1e740e=>{const _0x269798=_0x5c81cc;return await this[_0x269798(0x22a)](_0x1e740e['id'],_0x15f1ff?.['includeAllVersions']);}),_0x328e01=await Promise[_0x5c81cc(0x218)](_0x5dc603),_0x460a1f=new Map(),_0x89b128=[];for(const _0x1fd5f5 of _0x328e01){_0x89b128[_0x5c81cc(0x1fa)](..._0x1fd5f5['journeys']);for(const [_0x55abc7,_0x3180fc]of _0x1fd5f5[_0x5c81cc(0x1ed)]){_0x460a1f[_0x5c81cc(0x202)](_0x55abc7,_0x3180fc);}}const _0x4131e4=new Set(),_0x71b8d6=_0x89b128['filter'](_0x5e9530=>{const _0x243e7b=_0x5c81cc;if(_0x4131e4[_0x243e7b(0x204)](_0x5e9530['id']))return![];return _0x4131e4[_0x243e7b(0x238)](_0x5e9530['id']),!![];});return{'journeys':this[_0x5c81cc(0x22c)](_0x71b8d6,_0x15f1ff?.['includeAllVersions']),'activationStepsById':_0x460a1f};}async[a116_0x19a12f(0x208)](_0x3647bf){const _0x36a140=a116_0x19a12f;try{return await this[_0x36a140(0x1e9)][_0x36a140(0x208)](_0x3647bf);}catch(_0x2690a2){if(isHttp404Error(_0x2690a2))throw new SDKError(ErrorCode[_0x36a140(0x22d)],'Journey\x20not\x20found:\x20'+_0x3647bf,_0x2690a2);throw _0x2690a2;}}async[a116_0x19a12f(0x203)](_0xdb2df7,_0x17b30e){const _0x3d0e99=a116_0x19a12f,_0x3498f4=await this[_0x3d0e99(0x210)](_0xdb2df7),_0x6749f0=_0x3498f4[_0x3d0e99(0x25a)](_0x43e6e0=>_0x43e6e0[_0x3d0e99(0x267)][_0x3d0e99(0x1d5)]()===_0x17b30e[_0x3d0e99(0x1d5)]());if(!_0x6749f0)throw new SDKError(ErrorCode[_0x3d0e99(0x22d)],_0x3d0e99(0x20a)+_0x17b30e,undefined,{'helpText':'Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'});return _0x6749f0['id'];}async[a116_0x19a12f(0x1ec)](_0x1d516f,_0x1b1f44){const _0x139807=a116_0x19a12f;try{return await this[_0x139807(0x1e9)][_0x139807(0x201)](_0x1d516f,_0x1b1f44);}catch(_0x3856b6){if(isHttp404Error(_0x3856b6))throw new SDKError(ErrorCode[_0x139807(0x22d)],_0x139807(0x20a)+_0x1d516f,_0x3856b6);throw _0x3856b6;}}async[a116_0x19a12f(0x23d)](_0x502a2c,_0x298d58){const _0x1c725e=a116_0x19a12f,_0x2e6d3b={'from':_0x298d58?.[_0x1c725e(0x22f)],'to':_0x298d58?.['to'],'limit':_0x298d58?.[_0x1c725e(0x23e)]},_0xe0eb4c=_0x298d58?.[_0x1c725e(0x23f)]!==_0x1c725e(0x1ea);try{const [_0xa4f7f2,_0x204084]=await Promise[_0x1c725e(0x218)]([this[_0x1c725e(0x227)](_0x502a2c,_0x298d58?.[_0x1c725e(0x23f)],_0x2e6d3b),_0xe0eb4c?this['getJourney'](_0x502a2c):undefined]);if(_0xa4f7f2[_0x1c725e(0x1e6)]&&_0x204084){const _0x5461df=buildStageNameMap(_0x204084);_0xa4f7f2[_0x1c725e(0x1e6)]=_0xa4f7f2[_0x1c725e(0x1e6)][_0x1c725e(0x25c)](_0x49448f=>({..._0x49448f,'journeyStageName':_0x5461df['get'](_0x49448f[_0x1c725e(0x20e)])??_0x49448f[_0x1c725e(0x20e)]}));}return _0xa4f7f2;}catch(_0xc04a4e){if(isHttp404Error(_0xc04a4e))throw new SDKError(ErrorCode[_0x1c725e(0x22d)],_0x1c725e(0x20a)+_0x502a2c,_0xc04a4e);throw _0xc04a4e;}}async['fetchTrafficRaw'](_0x57bf63,_0x33fd0a,_0x394c74){const _0x154fb4=a116_0x19a12f;if(_0x33fd0a===_0x154fb4(0x1ea)){const _0x47f2a4=await this['client']['getConversionSankeyChart'](_0x57bf63,_0x394c74);return{'conversion':_0x47f2a4};}if(_0x33fd0a==='activation'){const _0x5ea9c8=await this[_0x154fb4(0x1e9)][_0x154fb4(0x205)](_0x57bf63,_0x394c74);return{'activation':_0x5ea9c8};}const [_0x4361e9,_0x4952d0]=await Promise['all']([this['client'][_0x154fb4(0x244)](_0x57bf63,_0x394c74),this[_0x154fb4(0x1e9)][_0x154fb4(0x205)](_0x57bf63,_0x394c74)]);return{'conversion':_0x4361e9,'activation':_0x4952d0};}async[a116_0x19a12f(0x24a)](_0x445aa8){const _0x11d062=a116_0x19a12f;try{return await this[_0x11d062(0x1e9)][_0x11d062(0x1fe)](_0x445aa8);}catch(_0x3e893d){if(isHttp404Error(_0x3e893d))throw new SDKError(ErrorCode[_0x11d062(0x22d)],_0x11d062(0x20a)+_0x445aa8,_0x3e893d);throw _0x3e893d;}}async[a116_0x19a12f(0x1d9)](_0x420608){const _0x447b4f=a116_0x19a12f;try{return await this[_0x447b4f(0x1e9)][_0x447b4f(0x254)](_0x420608);}catch(_0x229de1){if(isHttp404Error(_0x229de1))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],_0x447b4f(0x20a)+_0x420608,_0x229de1);throw _0x229de1;}}async[a116_0x19a12f(0x1eb)](_0x272122){const _0x2da182=a116_0x19a12f;return await this[_0x2da182(0x1e9)][_0x2da182(0x264)](_0x272122);}async['update'](_0x49e3d9,_0x3e1778){const _0x489117=a116_0x19a12f;try{return await this[_0x489117(0x1e9)][_0x489117(0x249)](_0x49e3d9,_0x3e1778);}catch(_0x149e2a){if(isHttp404Error(_0x149e2a))throw new SDKError(ErrorCode[_0x489117(0x22d)],_0x489117(0x20a)+_0x49e3d9,_0x149e2a);throw _0x149e2a;}}async[a116_0x19a12f(0x1db)](_0x310088,_0x40edf3){const _0x3b9e2b=a116_0x19a12f;try{return await this[_0x3b9e2b(0x1e9)][_0x3b9e2b(0x239)](_0x310088,_0x40edf3);}catch(_0x258283){if(isHttp404Error(_0x258283))throw new SDKError(ErrorCode['NOT_FOUND'],_0x3b9e2b(0x255)+_0x40edf3+_0x3b9e2b(0x258)+_0x310088,_0x258283);throw _0x258283;}}async[a116_0x19a12f(0x215)](_0xf8ebf){const _0x26ee26=a116_0x19a12f;try{return await this['client'][_0x26ee26(0x21f)](_0xf8ebf);}catch(_0x1403cf){if(isHttp404Error(_0x1403cf))return[];throw _0x1403cf;}}async[a116_0x19a12f(0x1e8)](_0x3c5b0d){const _0x3df45a=a116_0x19a12f,_0x3a35b0=await this[_0x3df45a(0x215)](_0x3c5b0d);return _0x3a35b0[_0x3df45a(0x25c)](flattenJourneyActivation);}async[a116_0x19a12f(0x1d7)](_0x425baf,_0x5259fe){const _0x57d6a2=a116_0x19a12f;return await this[_0x57d6a2(0x1e9)][_0x57d6a2(0x260)](_0x425baf,_0x5259fe);}async[a116_0x19a12f(0x241)](_0x317f24){const _0x5d84b7=a116_0x19a12f,_0x3645d7=await this[_0x5d84b7(0x208)](_0x317f24),_0x2930e1=generateColumnMapping(_0x3645d7);return{'journeyId':_0x3645d7['id'],'journeyName':_0x3645d7[_0x5d84b7(0x1e1)][_0x5d84b7(0x209)],'database':'cdp_audience_'+_0x3645d7[_0x5d84b7(0x1e1)]['audienceId'],'table':_0x5d84b7(0x235)+_0x3645d7['id'],'columns':_0x2930e1};}async[a116_0x19a12f(0x21b)](_0x1b008a){const _0x2bb3db=a116_0x19a12f;return this[_0x2bb3db(0x1e9)][_0x2bb3db(0x1dc)](_0x1b008a);}async[a116_0x19a12f(0x1f6)](_0x66b843){const _0x4bc6ba=a116_0x19a12f;if(!_0x66b843)return undefined;try{const _0x305a2a=await this[_0x4bc6ba(0x21b)](_0x66b843);return _0x305a2a[_0x4bc6ba(0x229)];}catch{return undefined;}}async[a116_0x19a12f(0x20c)](_0x268099){const _0x26740c=a116_0x19a12f,_0xa612a6=await this['getJourney'](_0x268099),_0x4292f1=_0xa612a6[_0x26740c(0x1e1)]['journeyBundleId'];if(!_0x4292f1)return{'bundleId':'','bundleName':_0xa612a6[_0x26740c(0x1e1)]['name'],'bundleDescription':_0xa612a6[_0x26740c(0x1e1)][_0x26740c(0x24b)]??null,'latestJourneyId':_0xa612a6['id'],'versions':[synthesizePreBundleVersion(_0xa612a6)]};const _0x4a5d66=await this[_0x26740c(0x21b)](_0x4292f1);return{'bundleId':_0x4292f1,'bundleName':_0x4a5d66[_0x26740c(0x209)],'bundleDescription':_0x4a5d66[_0x26740c(0x24b)]??null,'latestJourneyId':_0x4a5d66['latestJourneyId'],'versions':formatVersionsFromBundle(_0x4a5d66)};}async[a116_0x19a12f(0x216)](_0x334da5){const _0x2501c5=a116_0x19a12f,_0x24622f=await this['getJourney'](_0x334da5),_0xb47862=_0x24622f['attributes'][_0x2501c5(0x246)];if(!_0xb47862)throw new SDKError(ErrorCode[_0x2501c5(0x228)],_0x2501c5(0x25b));await this[_0x2501c5(0x1e9)][_0x2501c5(0x250)](_0xb47862);const _0x1adae8=await this[_0x2501c5(0x1e9)][_0x2501c5(0x1dc)](_0xb47862),_0x44785b=_0x1adae8[_0x2501c5(0x209)]+'\x20v'+(_0x1adae8['lastVersionNumber']+0x1);return this['client'][_0x2501c5(0x24f)](_0xb47862,{'sourceId':_0x334da5,'attributes':{'name':_0x44785b}});}}
@@ -1 +1 @@
1
- const a109_0x38d665=a109_0x3214;function a109_0x3214(_0x85940f,_0x5a295d){_0x85940f=_0x85940f-0x186;const _0x23ba84=a109_0x23ba();let _0x321418=_0x23ba84[_0x85940f];return _0x321418;}(function(_0xcf1c25,_0x47feae){const _0x3d71f3=a109_0x3214,_0x777434=_0xcf1c25();while(!![]){try{const _0x54fe18=-parseInt(_0x3d71f3(0x18d))/0x1*(parseInt(_0x3d71f3(0x194))/0x2)+-parseInt(_0x3d71f3(0x186))/0x3*(-parseInt(_0x3d71f3(0x187))/0x4)+-parseInt(_0x3d71f3(0x190))/0x5+-parseInt(_0x3d71f3(0x18a))/0x6+parseInt(_0x3d71f3(0x18b))/0x7+-parseInt(_0x3d71f3(0x189))/0x8+-parseInt(_0x3d71f3(0x18e))/0x9*(-parseInt(_0x3d71f3(0x18c))/0xa);if(_0x54fe18===_0x47feae)break;else _0x777434['push'](_0x777434['shift']());}catch(_0x4bb81c){_0x777434['push'](_0x777434['shift']());}}}(a109_0x23ba,0x8dda6));import{createTextCache}from'../../utils/local-cache.js';const chatIdCache=createTextCache(a109_0x38d665(0x191),a109_0x38d665(0x188));export function saveLastChatId(_0x25e3c2){const _0x5d765c=a109_0x38d665;chatIdCache[_0x5d765c(0x193)](_0x25e3c2);}export function loadLastChatId(){const _0x1d012c=a109_0x38d665;return chatIdCache[_0x1d012c(0x18f)]();}export function clearLastChatId(){const _0x11c722=a109_0x38d665;chatIdCache[_0x11c722(0x192)]();}function a109_0x23ba(){const _0x215766=['read','108640VVyCFa','last_chat_id','clear','write','2ChGfro','3EUMshe','1354796wjwoJE','llm/chat','2601232ixJGXz','6085182PkUTsf','5846855xWKsZV','40spQRlE','54331fOyjEI','1850571BIHQzt'];a109_0x23ba=function(){return _0x215766;};return a109_0x23ba();}
1
+ function a117_0x4fd9(_0x51c982,_0x36e05b){_0x51c982=_0x51c982-0x18c;const _0x455f45=a117_0x455f();let _0x4fd9ed=_0x455f45[_0x51c982];return _0x4fd9ed;}const a117_0x225fde=a117_0x4fd9;(function(_0x2ab3c7,_0x3c037b){const _0x18b661=a117_0x4fd9,_0x491aca=_0x2ab3c7();while(!![]){try{const _0x4ccf3b=parseInt(_0x18b661(0x194))/0x1*(parseInt(_0x18b661(0x193))/0x2)+parseInt(_0x18b661(0x18e))/0x3*(parseInt(_0x18b661(0x18f))/0x4)+-parseInt(_0x18b661(0x191))/0x5*(parseInt(_0x18b661(0x197))/0x6)+-parseInt(_0x18b661(0x18c))/0x7+-parseInt(_0x18b661(0x199))/0x8+-parseInt(_0x18b661(0x192))/0x9*(-parseInt(_0x18b661(0x198))/0xa)+parseInt(_0x18b661(0x19a))/0xb;if(_0x4ccf3b===_0x3c037b)break;else _0x491aca['push'](_0x491aca['shift']());}catch(_0x510c9c){_0x491aca['push'](_0x491aca['shift']());}}}(a117_0x455f,0x6b02a));import{createTextCache}from'../../utils/local-cache.js';function a117_0x455f(){const _0x51d686=['212062OTQnAu','1ONnaOz','last_chat_id','clear','20562DGdCZc','71530RIcUHl','3139696zfmMQm','7323162YXuPpD','3781610lvUAhQ','write','1027797khdfoc','4ZpmVuU','llm/chat','210zwyYvr','504vsXfJr'];a117_0x455f=function(){return _0x51d686;};return a117_0x455f();}const chatIdCache=createTextCache(a117_0x225fde(0x195),a117_0x225fde(0x190));export function saveLastChatId(_0x2c49ee){const _0x5804db=a117_0x225fde;chatIdCache[_0x5804db(0x18d)](_0x2c49ee);}export function loadLastChatId(){return chatIdCache['read']();}export function clearLastChatId(){const _0x46c1cd=a117_0x225fde;chatIdCache[_0x46c1cd(0x196)]();}