@treasuredata/tdx 2026.4.22 → 2026.4.23

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 (224) 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/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.d.ts +7 -0
  81. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/passthrough-server.js.map +1 -1
  84. package/dist/proxy/sse-usage-parser.js +1 -1
  85. package/dist/sdk/agent/agent-config.js +1 -1
  86. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  87. package/dist/sdk/agent/agent-yaml.js +1 -1
  88. package/dist/sdk/agent/test/evaluator.js +1 -1
  89. package/dist/sdk/agent/test/executor.js +1 -1
  90. package/dist/sdk/agent/test/index.js +1 -1
  91. package/dist/sdk/agent/test/output.js +1 -1
  92. package/dist/sdk/agent/test/parser.js +1 -1
  93. package/dist/sdk/agent/tool-target-registry.js +1 -1
  94. package/dist/sdk/api.js +1 -1
  95. package/dist/sdk/cas/cas-api-client.js +1 -1
  96. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  97. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  98. package/dist/sdk/cas/index.js +1 -1
  99. package/dist/sdk/cas/pull-workflow.js +1 -1
  100. package/dist/sdk/cas/push-workflow.js +1 -1
  101. package/dist/sdk/client/cdp-api-client.js +1 -1
  102. package/dist/sdk/client/delivery-api-client.js +1 -1
  103. package/dist/sdk/client/endpoints.js +1 -1
  104. package/dist/sdk/client/engage-api-client.js +1 -1
  105. package/dist/sdk/client/http-client.js +1 -1
  106. package/dist/sdk/client/llm-api-client.js +1 -1
  107. package/dist/sdk/client/oauth-refresh.js +1 -1
  108. package/dist/sdk/client/rate-limiter.js +1 -1
  109. package/dist/sdk/client/td-api-client.js +1 -1
  110. package/dist/sdk/client/trino-api-client.js +1 -1
  111. package/dist/sdk/client/workflow-client.js +1 -1
  112. package/dist/sdk/connection-validator.js +1 -1
  113. package/dist/sdk/connection.js +1 -1
  114. package/dist/sdk/delivery.js +1 -1
  115. package/dist/sdk/engage/campaign-pull.js +1 -1
  116. package/dist/sdk/engage/campaign-push.js +1 -1
  117. package/dist/sdk/engage/campaign-validator.js +1 -1
  118. package/dist/sdk/engage/campaign-yaml.js +1 -1
  119. package/dist/sdk/engage/template-pull.js +1 -1
  120. package/dist/sdk/engage/template-push.js +1 -1
  121. package/dist/sdk/engage/template-validator.js +1 -1
  122. package/dist/sdk/engage/template-yaml.js +1 -1
  123. package/dist/sdk/engage/types/campaign-def.js +1 -1
  124. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  125. package/dist/sdk/engage/types/template-schema.js +1 -1
  126. package/dist/sdk/engage.js +1 -1
  127. package/dist/sdk/errors.js +1 -1
  128. package/dist/sdk/index.js +1 -1
  129. package/dist/sdk/io/index.js +1 -1
  130. package/dist/sdk/io/node-filesystem.js +1 -1
  131. package/dist/sdk/job.js +1 -1
  132. package/dist/sdk/journey.js +1 -1
  133. package/dist/sdk/llm/chat-cache.js +1 -1
  134. package/dist/sdk/llm/index.js +1 -1
  135. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  136. package/dist/sdk/llm/model-factors.js +1 -1
  137. package/dist/sdk/personalization.js +1 -1
  138. package/dist/sdk/policy.js +1 -1
  139. package/dist/sdk/query/index.js +1 -1
  140. package/dist/sdk/query/sql-parser.js +1 -1
  141. package/dist/sdk/realtime.js +1 -1
  142. package/dist/sdk/schedule.js +1 -1
  143. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  144. package/dist/sdk/segment/fields-display.js +1 -1
  145. package/dist/sdk/segment/file-discovery.js +1 -1
  146. package/dist/sdk/segment/journey-utils.js +1 -1
  147. package/dist/sdk/segment/journey-validator.js +1 -1
  148. package/dist/sdk/segment/journey-yaml.js +1 -1
  149. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  150. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  151. package/dist/sdk/segment/pull-workflow.js +1 -1
  152. package/dist/sdk/segment/push-recovery.js +1 -1
  153. package/dist/sdk/segment/push-workflow.js +1 -1
  154. package/dist/sdk/segment/resolution-context.js +1 -1
  155. package/dist/sdk/segment/segment-path-parser.js +1 -1
  156. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  157. package/dist/sdk/segment/segment-validator.js +1 -1
  158. package/dist/sdk/segment/target-resolution.js +1 -1
  159. package/dist/sdk/segment/tdx-config.js +1 -1
  160. package/dist/sdk/segment/types/activation-schema.js +1 -1
  161. package/dist/sdk/segment/types/journey-def.js +1 -1
  162. package/dist/sdk/segment/types/journey-schema.js +1 -1
  163. package/dist/sdk/segment/types/segment-def.js +1 -1
  164. package/dist/sdk/segment/types/segment-schema.js +1 -1
  165. package/dist/sdk/segment/validate-files.js +1 -1
  166. package/dist/sdk/segment/yaml-validator.js +1 -1
  167. package/dist/sdk/segment.js +1 -1
  168. package/dist/sdk/types/index.js +1 -1
  169. package/dist/sdk/types/progress.js +1 -1
  170. package/dist/sdk/types/workspace.js +1 -1
  171. package/dist/sdk/user.js +1 -1
  172. package/dist/sdk/util/format-detector.js +1 -1
  173. package/dist/sdk/util/formatters.js +1 -1
  174. package/dist/sdk/util/index.js +1 -1
  175. package/dist/sdk/util/paginate.js +1 -1
  176. package/dist/sdk/util/tree-formatter.js +1 -1
  177. package/dist/sdk/workflow/archive-validation.js +1 -1
  178. package/dist/sdk/workflow/clone-workflow.js +1 -1
  179. package/dist/sdk/workflow/index.js +1 -1
  180. package/dist/sdk/workflow/pull-workflow.js +1 -1
  181. package/dist/sdk/workflow/push-workflow.js +1 -1
  182. package/dist/sdk/workflow/task-graph.js +1 -1
  183. package/dist/sdk/workflow/tdx-config.js +1 -1
  184. package/dist/sdk/workflow/workflow-utils.js +1 -1
  185. package/dist/sdk/workspace/access-tracker.js +1 -1
  186. package/dist/sdk/workspace/frontmatter.js +1 -1
  187. package/dist/sdk/workspace/git.js +1 -1
  188. package/dist/sdk/workspace/index.js +1 -1
  189. package/dist/sdk/workspace/templates.js +1 -1
  190. package/dist/sdk/workspace/weekly.js +1 -1
  191. package/dist/sdk/workspace/wikilinks.js +1 -1
  192. package/dist/test-utils/command-runner.js +1 -1
  193. package/dist/test-utils/factories.js +1 -1
  194. package/dist/test-utils/fixtures.js +1 -1
  195. package/dist/test-utils/http-mock.js +1 -1
  196. package/dist/test-utils/index.js +1 -1
  197. package/dist/utils/async.js +1 -1
  198. package/dist/utils/colors.js +1 -1
  199. package/dist/utils/diff.js +1 -1
  200. package/dist/utils/file-permissions.js +1 -1
  201. package/dist/utils/file-reader.js +1 -1
  202. package/dist/utils/github-releases.js +1 -1
  203. package/dist/utils/global-cache.js +1 -1
  204. package/dist/utils/json-loader.js +1 -1
  205. package/dist/utils/local-cache.js +1 -1
  206. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  207. package/dist/utils/logger/formatters/index.js +1 -1
  208. package/dist/utils/logger/handlers/console-handler.js +1 -1
  209. package/dist/utils/logger/handlers/file-handler.js +1 -1
  210. package/dist/utils/logger/handlers/index.js +1 -1
  211. package/dist/utils/logger/handlers/null-handler.js +1 -1
  212. package/dist/utils/logger/index.js +1 -1
  213. package/dist/utils/logger/logger.js +1 -1
  214. package/dist/utils/logger/types.js +1 -1
  215. package/dist/utils/option-validation.js +1 -1
  216. package/dist/utils/process.js +1 -1
  217. package/dist/utils/prompt.js +1 -1
  218. package/dist/utils/spinner.js +1 -1
  219. package/dist/utils/sse-parser.js +1 -1
  220. package/dist/utils/string-utils.js +1 -1
  221. package/dist/utils/table-ref-parser.js +1 -1
  222. package/dist/utils/tdx-logger.js +1 -1
  223. package/dist/utils/version-check.js +1 -1
  224. package/package.json +1 -1
@@ -1 +1 @@
1
- const a142_0x3680df=a142_0xe593;(function(_0xc28979,_0x8ba30c){const _0x13879d=a142_0xe593,_0x258444=_0xc28979();while(!![]){try{const _0x22146d=parseInt(_0x13879d(0x133))/0x1+parseInt(_0x13879d(0x17a))/0x2+-parseInt(_0x13879d(0x14d))/0x3*(-parseInt(_0x13879d(0x189))/0x4)+parseInt(_0x13879d(0x160))/0x5+-parseInt(_0x13879d(0x110))/0x6+parseInt(_0x13879d(0xe9))/0x7*(-parseInt(_0x13879d(0xe8))/0x8)+-parseInt(_0x13879d(0x15d))/0x9;if(_0x22146d===_0x8ba30c)break;else _0x258444['push'](_0x258444['shift']());}catch(_0x2875fc){_0x258444['push'](_0x258444['shift']());}}}(a142_0x2b43,0x47c2e));import*as a142_0x1a537b from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';import{ActivationDefSchema}from'./types/activation-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a142_0x3680df(0x14f),'hourly':'hour','weekly':a142_0x3680df(0xeb),'monthly':a142_0x3680df(0x18e),'minutes_interval':'minute'},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a142_0x3680df(0x11e),'hour':'hourly','week':a142_0x3680df(0x120),'month':a142_0x3680df(0x159),'minute':a142_0x3680df(0x196)};function filterRuleAsRuleDef(_0x65fd59){return _0x65fd59;}function ruleDefAsFilterRule(_0x38a7cc){return _0x38a7cc;}export function segmentResponseToDefSync(_0x22f7d8,_0x1e88cb){const _0x1096f1=a142_0x3680df,_0x2a3caa=_0x22f7d8[_0x1096f1(0xef)]&&_0x1096f1(0x190)in _0x22f7d8['rule']&&_0x22f7d8[_0x1096f1(0xef)][_0x1096f1(0x190)];return{'type':_0x1096f1(0x16c),'name':_0x22f7d8[_0x1096f1(0x12e)],..._0x22f7d8[_0x1096f1(0x111)]&&{'description':_0x22f7d8[_0x1096f1(0x111)]},..._0x1e88cb&&{'folder':_0x1e88cb},..._0x2a3caa&&{'rule':apiRuleToYaml(_0x22f7d8[_0x1096f1(0xef)])},..._0x22f7d8[_0x1096f1(0x13a)]!==undefined&&{'kind':_0x22f7d8['kind']===0x0?_0x1096f1(0x18d):_0x22f7d8[_0x1096f1(0x13a)]===0x1?'realtime':'funnel_stage'},..._0x22f7d8['isVisible']!==undefined&&{'visible':_0x22f7d8['isVisible']}};}export async function segmentResponseToDef(_0x3cfbb1,_0x2c13d3,_0x12728f){const _0x418914=a142_0x3680df,_0xe77602=segmentResponseToDefSync(_0x3cfbb1,_0x12728f);if(!_0x2c13d3||!_0x2c13d3[_0x418914(0xf7)])return _0xe77602;return _0xe77602[_0x418914(0xef)]&&(_0xe77602['rule']=await resolveRuleSegmentRefs(_0xe77602[_0x418914(0xef)],_0x2c13d3[_0x418914(0xf7)])),_0xe77602;}export function apiRuleToYaml(_0x221cd9){const _0xa6d93a=a142_0x3680df,_0x4636e5=(_0x221cd9[_0xa6d93a(0x163)]||[])[_0xa6d93a(0x12d)](_0x20c907=>{const _0x11afd5=_0xa6d93a,_0x1a5301=apiConditionToYaml(_0x20c907);if(isCompositeType(_0x1a5301)&&_0x1a5301[_0x11afd5(0x111)]!==undefined){const _0x5c7bdb=_0x1a5301;if(_0x5c7bdb[_0x11afd5(0x163)][_0x11afd5(0xea)]===0x1)return _0x5c7bdb[_0x11afd5(0x163)];return[{'type':_0x5c7bdb[_0x11afd5(0x190)],'conditions':_0x5c7bdb[_0x11afd5(0x163)]}];}return[_0x1a5301];});if(_0x4636e5[_0xa6d93a(0xea)]===0x1&&!_0x221cd9[_0xa6d93a(0x111)]&&isCompositeType(_0x4636e5[0x0])){const _0x34cfc1=_0x4636e5[0x0];if(_0x34cfc1[_0xa6d93a(0x190)]===_0x221cd9[_0xa6d93a(0x190)]&&_0x34cfc1[_0xa6d93a(0x163)]&&_0x34cfc1[_0xa6d93a(0x111)]===undefined)return{'type':_0x221cd9['type'],'conditions':_0x34cfc1[_0xa6d93a(0x163)]};}return{'type':_0x221cd9[_0xa6d93a(0x190)],'conditions':_0x4636e5};}export async function resolveRuleSegmentRefs(_0x46ca3f,_0x444862){const _0x53fd65=a142_0x3680df;return transformRuleSegmentRefs(_0x46ca3f,_0x444862,_0x257eee=>/^\d+$/[_0x53fd65(0x162)](_0x257eee));}async function transformConditionSegmentRefs(_0x38588a,_0x2b1cb0,_0x19ea4c,_0x114bd6){const _0x133d5b=a142_0x3680df;if(_0x133d5b(0x16c)in _0x38588a&&(_0x38588a['type']===_0x133d5b(0x11c)||_0x38588a['type']==='exclude')){const _0x3aaeaf=_0x38588a;if(_0x19ea4c(_0x3aaeaf[_0x133d5b(0x16c)]))return{..._0x3aaeaf,'segment':await _0x2b1cb0(_0x3aaeaf[_0x133d5b(0x16c)])};return _0x38588a;}if(_0x133d5b(0x163)in _0x38588a&&_0x38588a[_0x133d5b(0x163)]){const _0x1027ef=_0x38588a,_0x1a0e36=await Promise[_0x133d5b(0xf6)](_0x1027ef[_0x133d5b(0x163)]['map'](_0x2d14e8=>transformConditionSegmentRefs(_0x2d14e8,_0x2b1cb0,_0x19ea4c,_0x114bd6)));return{..._0x1027ef,'conditions':_0x1a0e36};}if(_0x133d5b(0x10e)in _0x38588a&&_0x38588a[_0x133d5b(0x10e)]){const _0x26b71b=_0x38588a,_0x470ff9=await _0x114bd6(filterRuleAsRuleDef(_0x26b71b[_0x133d5b(0x10e)]),_0x2b1cb0);return{..._0x26b71b,'filter':ruleDefAsFilterRule(_0x470ff9)};}return _0x38588a;}async function transformRuleSegmentRefs(_0x3818bd,_0x35ed2e,_0x30c421){const _0x344fd4=(_0x5bc4fa,_0x39c4c5)=>transformRuleSegmentRefs(_0x5bc4fa,_0x39c4c5,_0x30c421),_0x26a794=await Promise['all'](_0x3818bd['conditions']['map'](_0x2ded7d=>transformConditionSegmentRefs(_0x2ded7d,_0x35ed2e,_0x30c421,_0x344fd4)));return{..._0x3818bd,'conditions':_0x26a794};}export async function resolveRuleSegmentIds(_0x478cc4,_0x55bcb1){const _0x4e866a=a142_0x3680df;return transformRuleSegmentRefs(_0x478cc4,_0x55bcb1,_0x412fc9=>!/^\d+$/[_0x4e866a(0x162)](_0x412fc9));}function isCompositeType(_0x526980){const _0x2082c5=a142_0x3680df;return _0x526980[_0x2082c5(0x190)]==='And'||_0x526980[_0x2082c5(0x190)]==='Or';}function isBehaviorApiCondition(_0x5a3111){const _0xb9647=a142_0x3680df;if(!_0x5a3111[_0xb9647(0x135)]?.['source']?.[_0xb9647(0x12e)])return![];return!![];}function apiConditionToYaml(_0x204318){const _0x5db950=a142_0x3680df;if(_0x204318['type']===_0x5db950(0x194)||_0x204318[_0x5db950(0x190)]==='Or'){if(_0x204318[_0x5db950(0x163)]){const _0x4358d2=_0x204318['conditions'][_0x5db950(0x126)](apiConditionToYaml),_0x189276=_0x204318[_0x5db950(0x111)]!==undefined;if(_0x4358d2['length']===0x1&&!_0x189276)return _0x4358d2[0x0];return{'type':_0x204318[_0x5db950(0x190)],'conditions':_0x4358d2,..._0x204318['description']!==undefined&&{'description':_0x204318[_0x5db950(0x111)]}};}}if(_0x204318['type']===_0x5db950(0x16a)&&_0x204318[_0x5db950(0x135)]&&_0x204318[_0x5db950(0x152)]){const _0x119c1e=_0x204318[_0x5db950(0x135)][_0x5db950(0x180)]?buildAggregationDefFromApi(_0x204318[_0x5db950(0x135)][_0x5db950(0x180)]):undefined;if(isBehaviorApiCondition(_0x204318)){const _0x2965a9=_0x204318[_0x5db950(0x135)][_0x5db950(0x136)][_0x5db950(0x12e)];return{'type':'Behavior','attribute':'','operator':apiOperatorToYaml(_0x204318[_0x5db950(0x152)]),..._0x204318[_0x5db950(0x16f)]&&_0x204318['arrayMatching']!==_0x5db950(0x13b)?{'arrayMatching':_0x204318[_0x5db950(0x16f)]}:{},..._0x204318[_0x5db950(0x132)]?{'exclude':_0x204318[_0x5db950(0x132)]}:{},..._0x119c1e?{'aggregation':_0x119c1e}:{},'source':_0x2965a9,..._0x204318[_0x5db950(0x135)]['filter']?{'filter':apiRuleToYaml(_0x204318[_0x5db950(0x135)][_0x5db950(0x10e)])}:{},..._0x204318[_0x5db950(0x191)]!==undefined&&_0x204318[_0x5db950(0x191)]!==null?{'limit':_0x204318[_0x5db950(0x191)]}:{}};}return{'type':'Value','attribute':_0x204318['leftValue'][_0x5db950(0x12e)]||'','operator':apiOperatorToYaml(_0x204318[_0x5db950(0x152)]),..._0x204318[_0x5db950(0x16f)]&&_0x204318[_0x5db950(0x16f)]!=='any'?{'arrayMatching':_0x204318[_0x5db950(0x16f)]}:{},..._0x204318[_0x5db950(0x132)]?{'exclude':_0x204318['exclude']}:{},..._0x119c1e?{'aggregation':_0x119c1e}:{},..._0x204318[_0x5db950(0x135)][_0x5db950(0x10e)]?{'filter':apiRuleToYaml(_0x204318[_0x5db950(0x135)][_0x5db950(0x10e)])}:{},..._0x204318['limit']!==undefined&&_0x204318[_0x5db950(0x191)]!==null?{'limit':_0x204318[_0x5db950(0x191)]}:{}};}if(_0x204318[_0x5db950(0x190)]===_0x5db950(0x18f)&&_0x204318[_0x5db950(0x166)]&&_0x204318[_0x5db950(0x152)])return{'type':_0x5db950(0x18f),'column':_0x204318[_0x5db950(0x166)],'operator':apiOperatorToYaml(_0x204318[_0x5db950(0x152)])};if(_0x204318['type']===_0x5db950(0x100)&&_0x204318['id'])return{'type':_0x204318[_0x5db950(0x132)]?'exclude':'include','segment':_0x204318['id']};return{'type':_0x5db950(0x194),'conditions':[]};}function isTemporalOperator(_0x3bc140){const _0x124aff=a142_0x3680df;return _0x3bc140==='TimeWithinPast'||_0x3bc140===_0x124aff(0x101);}function isBetweenOperator(_0x288ae1){const _0x3d6961=a142_0x3680df;return _0x288ae1===_0x3d6961(0x165);}function getEffectiveValue(_0x405195){const _0x3029c5=a142_0x3680df,_0xcfa472=_0x405195[_0x3029c5(0x173)];return _0x405195[_0x3029c5(0x13c)]??_0xcfa472;}function parseNumericValue(_0xed1769){const _0x5ca17a=a142_0x3680df;if(typeof _0xed1769===_0x5ca17a(0x10f)&&_0xed1769!==null)return _0xed1769;if(_0xed1769==='')return _0xed1769;const _0x186c66=Number(_0xed1769);return Number['isFinite'](_0x186c66)?_0x186c66:_0xed1769;}function apiOperatorToYaml(_0x43fb8c){const _0x4a0935=a142_0x3680df;if(isBetweenOperator(_0x43fb8c['type']))return{'type':mapApiOperatorType(_0x43fb8c[_0x4a0935(0x190)]),..._0x43fb8c[_0x4a0935(0x128)]!==undefined&&{'not':_0x43fb8c[_0x4a0935(0x128)]},..._0x43fb8c[_0x4a0935(0x103)]!==undefined&&{'min':parseNumericValue(_0x43fb8c[_0x4a0935(0x103)])},..._0x43fb8c['maxValue']!==undefined&&{'max':parseNumericValue(_0x43fb8c['maxValue'])}};if(_0x43fb8c['type']===_0x4a0935(0x15a))return{'type':'TimeRange',..._0x43fb8c[_0x4a0935(0x128)]!==undefined&&{'not':_0x43fb8c[_0x4a0935(0x128)]},..._0x43fb8c[_0x4a0935(0x139)]!==undefined&&{'duration':_0x43fb8c[_0x4a0935(0x139)]},..._0x43fb8c['from']!==undefined&&{'from':_0x43fb8c[_0x4a0935(0xfb)]},..._0x43fb8c[_0x4a0935(0x14e)]!==undefined&&{'reverse':_0x43fb8c[_0x4a0935(0x14e)]}};let _0x360651;if(_0x43fb8c[_0x4a0935(0x116)]&&_0x43fb8c['rightValues'][_0x4a0935(0xea)]>0x0)_0x360651=_0x43fb8c[_0x4a0935(0x116)];else{if(_0x43fb8c[_0x4a0935(0x197)]!==undefined)_0x360651=_0x43fb8c[_0x4a0935(0x197)];else isTemporalOperator(_0x43fb8c['type'])&&_0x43fb8c[_0x4a0935(0x13c)]!==undefined&&(_0x360651=_0x43fb8c[_0x4a0935(0x13c)]);}return{'type':mapApiOperatorType(_0x43fb8c[_0x4a0935(0x190)]),..._0x43fb8c[_0x4a0935(0x128)]!==undefined&&{'not':_0x43fb8c[_0x4a0935(0x128)]},..._0x360651!==undefined&&{'value':_0x360651},..._0x43fb8c['unit']!==undefined&&{'unit':_0x43fb8c[_0x4a0935(0x121)]}};}function mapApiOperatorType(_0x8761b1){return _0x8761b1;}export function segmentDefToCreateRequest(_0x206a8b,_0x4902bb){const _0x1c0070=a142_0x3680df,_0xeb9a42={'name':_0x206a8b[_0x1c0070(0x12e)]};return _0x206a8b['description']&&(_0xeb9a42['description']=_0x206a8b[_0x1c0070(0x111)]),_0x206a8b[_0x1c0070(0xef)]&&(_0xeb9a42['rule']=yamlRuleToApi(_0x206a8b[_0x1c0070(0xef)])),_0x206a8b[_0x1c0070(0x13a)]&&(_0xeb9a42['kind']=_0x206a8b[_0x1c0070(0x13a)]===_0x1c0070(0x18d)?0x0:_0x206a8b[_0x1c0070(0x13a)]==='realtime'?0x1:0x2),_0x206a8b[_0x1c0070(0x164)]!==undefined&&(_0xeb9a42[_0x1c0070(0x140)]=_0x206a8b['visible']),_0x4902bb&&(_0xeb9a42[_0x1c0070(0x188)]=_0x4902bb),_0xeb9a42;}export function segmentDefToUpdateRequest(_0x4986c8){const _0x2d916e=a142_0x3680df,_0x3754c9={'name':_0x4986c8['name']};return _0x4986c8['description']!==undefined&&(_0x3754c9[_0x2d916e(0x111)]=_0x4986c8[_0x2d916e(0x111)]),_0x4986c8['rule']&&(_0x3754c9[_0x2d916e(0xef)]=yamlRuleToApi(_0x4986c8[_0x2d916e(0xef)])),_0x4986c8[_0x2d916e(0x13a)]&&(_0x3754c9[_0x2d916e(0x13a)]=_0x4986c8['kind']===_0x2d916e(0x18d)?0x0:_0x4986c8[_0x2d916e(0x13a)]===_0x2d916e(0x104)?0x1:0x2),_0x3754c9;}export function yamlRuleToApi(_0x3270aa){const _0x307a32=a142_0x3680df,_0x3ea348=_0x3270aa[_0x307a32(0x163)][_0x307a32(0x126)](yamlConditionToApi),_0x25a35b=_0x3ea348['every'](_0x4cd599=>isCompositeType(_0x4cd599)&&_0x4cd599['description']!==undefined);if(!_0x25a35b&&_0x3ea348[_0x307a32(0xea)]>0x0){const _0x1f130c=[];for(const _0x5a1be0 of _0x3ea348){isCompositeType(_0x5a1be0)&&_0x5a1be0[_0x307a32(0x111)]===undefined&&_0x5a1be0[_0x307a32(0x163)]&&_0x5a1be0[_0x307a32(0x163)][_0x307a32(0x18a)](_0x944344=>!isCompositeType(_0x944344))?_0x1f130c[_0x307a32(0x143)]({'type':_0x5a1be0['type'],'description':'','conditions':_0x5a1be0[_0x307a32(0x163)]}):_0x1f130c['push']({'type':_0x307a32(0x194),'description':_0x3270aa[_0x307a32(0x111)]||'','conditions':[_0x5a1be0]});}return{'type':_0x3270aa[_0x307a32(0x190)],'conditions':_0x1f130c};}return{'type':_0x3270aa['type'],'conditions':_0x3ea348,..._0x3270aa[_0x307a32(0x111)]&&{'description':_0x3270aa[_0x307a32(0x111)]}};}function yamlFilterRuleToApi(_0xd4bd9){const _0x49e34d=a142_0x3680df,_0x1dd5b0=_0xd4bd9[_0x49e34d(0x163)]['map'](yamlConditionToApi);return{'type':_0xd4bd9['type'],'conditions':_0x1dd5b0};}function yamlConditionToApi(_0x481343){const _0x57ee30=a142_0x3680df;if(_0x57ee30(0x16c)in _0x481343&&(_0x481343['type']===_0x57ee30(0x11c)||_0x481343['type']===_0x57ee30(0x132))){const _0x8a1f20=_0x481343;return{'type':'Reference','id':_0x8a1f20['segment'],'exclude':_0x8a1f20['type']===_0x57ee30(0x132)};}if(_0x481343[_0x57ee30(0x190)]===_0x57ee30(0x194)||_0x481343[_0x57ee30(0x190)]==='Or'){const _0x380343=_0x481343;return{'type':_0x380343[_0x57ee30(0x190)],'conditions':_0x380343[_0x57ee30(0x163)][_0x57ee30(0x126)](yamlConditionToApi),..._0x380343[_0x57ee30(0x111)]&&{'description':_0x380343['description']}};}if(_0x57ee30(0x166)in _0x481343&&_0x481343[_0x57ee30(0x190)]===_0x57ee30(0x18f)){const _0x2cf275=_0x481343;return{'type':_0x57ee30(0x18f),'column':_0x2cf275[_0x57ee30(0x166)],'operator':yamlOperatorToApi(_0x2cf275['operator'])};}const _0x12ed11=_0x481343,_0x58174e={'type':_0x57ee30(0x16a),'leftValue':buildLeftValue(_0x12ed11),'operator':yamlOperatorToApi(_0x12ed11[_0x57ee30(0x152)]),'exclude':_0x12ed11[_0x57ee30(0x132)]??![],'arrayMatching':_0x12ed11[_0x57ee30(0x16f)]??_0x57ee30(0x13b)};return _0x12ed11[_0x57ee30(0x191)]!==undefined&&(_0x58174e[_0x57ee30(0x191)]=_0x12ed11['limit']),_0x58174e;}function buildAggregationDefFromApi(_0x215495){const _0x559a09=a142_0x3680df,_0x25a3f7=_0x215495[_0x559a09(0x190)];if(_0x25a3f7===_0x559a09(0x17b))return{'type':_0x25a3f7,'columns':_0x215495[_0x559a09(0x134)]??[]};if(_0x25a3f7==='First'||_0x25a3f7===_0x559a09(0x174))return{'type':_0x25a3f7,'column':_0x215495[_0x559a09(0x166)]??'','orderColumn':_0x215495[_0x559a09(0x119)]??'',..._0x215495['groupingColumns']&&{'groupingColumns':_0x215495[_0x559a09(0x186)]}};if(_0x25a3f7==='Count')return{'type':_0x25a3f7,..._0x215495[_0x559a09(0x186)]&&{'groupingColumns':_0x215495['groupingColumns']}};return{'type':_0x25a3f7,'column':_0x215495[_0x559a09(0x166)]??'',..._0x215495[_0x559a09(0x186)]&&{'groupingColumns':_0x215495['groupingColumns']}};}function buildLeftValue(_0x53c2f7){const _0x298271=a142_0x3680df,_0xf05d51={};_0x53c2f7[_0x298271(0x15e)]&&_0x53c2f7['type']!=='Behavior'&&(_0xf05d51[_0x298271(0x12e)]=_0x53c2f7[_0x298271(0x15e)]);if(_0x53c2f7[_0x298271(0x180)]){const _0x4524b6=_0x53c2f7[_0x298271(0x180)];if(_0x4524b6[_0x298271(0x190)]==='CountDistinct')_0xf05d51[_0x298271(0x180)]={'type':_0x298271(0x17b),'columns':_0x4524b6['columns']};else{if(_0x4524b6[_0x298271(0x190)]==='First'||_0x4524b6[_0x298271(0x190)]===_0x298271(0x174))_0xf05d51[_0x298271(0x180)]={'type':_0x4524b6[_0x298271(0x190)],'column':_0x4524b6[_0x298271(0x166)],'orderColumn':_0x4524b6[_0x298271(0x119)],..._0x4524b6[_0x298271(0x186)]&&{'groupingColumns':_0x4524b6['groupingColumns']}};else _0x4524b6['type']==='Count'?_0xf05d51[_0x298271(0x180)]={'type':'Count',..._0x4524b6[_0x298271(0x186)]&&{'groupingColumns':_0x4524b6['groupingColumns']}}:_0xf05d51[_0x298271(0x180)]={'type':_0x4524b6['type'],'column':_0x4524b6['column'],..._0x4524b6['groupingColumns']&&{'groupingColumns':_0x4524b6[_0x298271(0x186)]}};}}return _0x53c2f7[_0x298271(0x136)]&&(_0xf05d51['source']={'name':_0x53c2f7['source']}),_0x53c2f7[_0x298271(0x10e)]&&(_0xf05d51['filter']=yamlFilterRuleToApi(filterRuleAsRuleDef(_0x53c2f7['filter']))),_0xf05d51;}function yamlOperatorToApi(_0xd15ed4){const _0x4b8190=a142_0x3680df,_0x15c973={'type':mapYamlOperatorType(_0xd15ed4[_0x4b8190(0x190)]),'not':_0xd15ed4['not']??![]};if(isBetweenOperator(_0xd15ed4[_0x4b8190(0x190)]))return _0xd15ed4[_0x4b8190(0x19a)]!==undefined&&(_0x15c973[_0x4b8190(0x103)]=typeof _0xd15ed4['min']===_0x4b8190(0x10f)?_0xd15ed4[_0x4b8190(0x19a)]:String(_0xd15ed4['min'])),_0xd15ed4['max']!==undefined&&(_0x15c973[_0x4b8190(0x130)]=typeof _0xd15ed4[_0x4b8190(0x12f)]===_0x4b8190(0x10f)?_0xd15ed4[_0x4b8190(0x12f)]:String(_0xd15ed4['max'])),_0x15c973;if(_0xd15ed4[_0x4b8190(0x190)]==='TimeRange')return _0xd15ed4[_0x4b8190(0x139)]&&(_0x15c973[_0x4b8190(0x139)]=_0xd15ed4[_0x4b8190(0x139)]),_0xd15ed4['from']&&(_0x15c973['from']=_0xd15ed4[_0x4b8190(0xfb)]),_0xd15ed4[_0x4b8190(0x14e)]!==undefined&&(_0x15c973[_0x4b8190(0x14e)]=_0xd15ed4[_0x4b8190(0x14e)]),_0x15c973;const _0x27c28b=getEffectiveValue(_0xd15ed4);if(_0x27c28b!==undefined){if(Array[_0x4b8190(0x175)](_0x27c28b))_0x15c973[_0x4b8190(0x116)]=_0x27c28b;else isTemporalOperator(_0xd15ed4[_0x4b8190(0x190)])?_0x15c973[_0x4b8190(0x13c)]=_0x27c28b:_0x15c973['rightValue']=_0x27c28b;}return _0xd15ed4[_0x4b8190(0x121)]&&(_0x15c973['unit']=_0xd15ed4[_0x4b8190(0x121)]),_0x15c973;}function mapYamlOperatorType(_0x1b2c30){return _0x1b2c30;}export function toYamlString(_0x4b2abf){const _0x3168d2=a142_0x3680df,_0x215d0f=JSON[_0x3168d2(0xff)](JSON[_0x3168d2(0x167)](_0x4b2abf)),_0x18e6ad=a142_0x1a537b[_0x3168d2(0x167)](_0x215d0f,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x47ae20=[_0x3168d2(0x115)];let _0x3676e0=_0x18e6ad;for(const _0x4e5309 of _0x47ae20){_0x3676e0=_0x3676e0[_0x3168d2(0x122)](new RegExp('^('+_0x4e5309+')','m'),(_0x553e78,_0x3df1b3,_0x1ede22)=>{if(_0x1ede22===0x0||_0x3676e0[_0x1ede22-0x1]==='\x0a'&&_0x3676e0[_0x1ede22-0x2]==='\x0a')return _0x3df1b3;return'\x0a'+_0x3df1b3;});}return _0x3676e0;}export function parseYamlString(_0x224aa6){return parseSegmentYamlFile(_0x224aa6);}export function isSegmentYaml(_0xbee7d9){const _0x31d2c1=a142_0x3680df;if(typeof _0xbee7d9!=='object'||_0xbee7d9===null)return![];const _0x7948eb=_0xbee7d9;return _0x7948eb[_0x31d2c1(0x190)]===_0x31d2c1(0x16c)||_0x7948eb[_0x31d2c1(0x190)]===undefined;}export function generateTemplate(_0x45a201=a142_0x3680df(0xec)){const _0xbd8741=a142_0x3680df,_0x394274={'type':_0xbd8741(0x16c),'name':_0x45a201,'description':'Segment\x20description','rule':{'type':_0xbd8741(0x194),'conditions':[{'type':_0xbd8741(0x16a),'attribute':_0xbd8741(0x195),'operator':{'type':_0xbd8741(0xed),'value':_0xbd8741(0x13c)}}]}};return toYamlString(_0x394274);}export function segmentToYamlString(_0x40833f){const _0x44b3db=a142_0x3680df,_0x2e7491=JSON[_0x44b3db(0xff)](JSON[_0x44b3db(0x167)](_0x40833f)),_0x9fdcbd=a142_0x1a537b[_0x44b3db(0x167)](_0x2e7491,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x44b3db(0x109)}),_0x1f2b28=['rule:','activations:'];let _0x4e3d6d=_0x9fdcbd;for(const _0x24a561 of _0x1f2b28){_0x4e3d6d=_0x4e3d6d['replace'](new RegExp('^('+_0x24a561+')','m'),(_0x5a9abb,_0xa819fe,_0x32c279)=>{if(_0x32c279===0x0||_0x4e3d6d[_0x32c279-0x1]==='\x0a'&&_0x4e3d6d[_0x32c279-0x2]==='\x0a')return _0xa819fe;return'\x0a'+_0xa819fe;});}return _0x4e3d6d;}export function parseSegmentYamlFile(_0x39b4a1){return safeParseYaml(_0x39b4a1,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x591934){const _0x4126ae=a142_0x3680df;return{'type':_0x4126ae(0x16c),'name':_0x591934[_0x4126ae(0x12e)],..._0x591934[_0x4126ae(0x111)]!==undefined&&{'description':_0x591934['description']},..._0x591934[_0x4126ae(0x137)]!==undefined&&{'folder':_0x591934[_0x4126ae(0x137)]},..._0x591934[_0x4126ae(0xef)]&&{'rule':normalizeRule(_0x591934[_0x4126ae(0xef)])},..._0x591934['kind']!==undefined&&{'kind':_0x591934[_0x4126ae(0x13a)]},..._0x591934[_0x4126ae(0x164)]!==undefined&&{'visible':_0x591934[_0x4126ae(0x164)]},..._0x591934[_0x4126ae(0x14b)]&&{'activations':_0x591934['activations'][_0x4126ae(0x126)](normalizeActivation)}};}export function normalizeRule(_0x4adae8){const _0x306877=a142_0x3680df;return{'type':_0x4adae8[_0x306877(0x190)],'conditions':_0x4adae8['conditions'][_0x306877(0x126)](normalizeCondition),..._0x4adae8['description']!==undefined&&{'description':_0x4adae8[_0x306877(0x111)]}};}function normalizeCondition(_0x3df5ed){const _0x572346=a142_0x3680df;if(_0x572346(0x16c)in _0x3df5ed&&(_0x3df5ed[_0x572346(0x190)]==='include'||_0x3df5ed[_0x572346(0x190)]===_0x572346(0x132))){const _0x3a25cd=_0x3df5ed;return{'type':_0x3a25cd[_0x572346(0x190)],'segment':_0x3a25cd[_0x572346(0x16c)]};}if(_0x3df5ed['type']===_0x572346(0x194)||_0x3df5ed['type']==='Or'){const _0x3376be=_0x3df5ed;return{'type':_0x3376be[_0x572346(0x190)],'conditions':_0x3376be[_0x572346(0x163)]['map'](normalizeCondition),..._0x3376be[_0x572346(0x111)]!==undefined&&{'description':_0x3376be['description']}};}if(_0x572346(0x166)in _0x3df5ed&&_0x3df5ed[_0x572346(0x190)]===_0x572346(0x18f)){const _0x5c5bb9=_0x3df5ed;return{'type':_0x572346(0x18f),'column':_0x5c5bb9['column'],'operator':normalizeOperator(_0x5c5bb9[_0x572346(0x152)])};}if(_0x3df5ed[_0x572346(0x190)]===_0x572346(0xe7)){const _0xf66fd4=_0x3df5ed;return{'type':'Behavior','attribute':_0xf66fd4[_0x572346(0x15e)],'operator':normalizeOperator(_0xf66fd4[_0x572346(0x152)]),..._0xf66fd4[_0x572346(0x16f)]!==undefined&&{'arrayMatching':_0xf66fd4[_0x572346(0x16f)]},..._0xf66fd4[_0x572346(0x132)]!==undefined&&{'exclude':_0xf66fd4['exclude']},..._0xf66fd4[_0x572346(0x180)]!==undefined&&{'aggregation':_0xf66fd4[_0x572346(0x180)]},..._0xf66fd4[_0x572346(0x136)]!==undefined&&{'source':_0xf66fd4['source']},..._0xf66fd4['filter']!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0xf66fd4[_0x572346(0x10e)])))},..._0xf66fd4[_0x572346(0xee)]!==undefined&&{'timeWindow':_0xf66fd4[_0x572346(0xee)]},..._0xf66fd4[_0x572346(0x191)]!==undefined&&{'limit':_0xf66fd4[_0x572346(0x191)]}};}const _0xee6869=_0x3df5ed;return{'type':_0x572346(0x16a),'attribute':_0xee6869['attribute'],'operator':normalizeOperator(_0xee6869[_0x572346(0x152)]),..._0xee6869['arrayMatching']!==undefined&&{'arrayMatching':_0xee6869[_0x572346(0x16f)]},..._0xee6869[_0x572346(0x132)]!==undefined&&{'exclude':_0xee6869[_0x572346(0x132)]},..._0xee6869['aggregation']!==undefined&&{'aggregation':_0xee6869[_0x572346(0x180)]},..._0xee6869[_0x572346(0x136)]!==undefined&&{'source':_0xee6869[_0x572346(0x136)]},..._0xee6869['filter']!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0xee6869[_0x572346(0x10e)])))},..._0xee6869[_0x572346(0x191)]!==undefined&&{'limit':_0xee6869[_0x572346(0x191)]}};}function normalizeOperator(_0x1348e2){const _0x4d55dd=a142_0x3680df;if(isBetweenOperator(_0x1348e2[_0x4d55dd(0x190)]))return{'type':_0x1348e2[_0x4d55dd(0x190)],..._0x1348e2[_0x4d55dd(0x128)]!==undefined&&{'not':_0x1348e2['not']},..._0x1348e2[_0x4d55dd(0x19a)]!==undefined&&{'min':_0x1348e2[_0x4d55dd(0x19a)]},..._0x1348e2[_0x4d55dd(0x12f)]!==undefined&&{'max':_0x1348e2[_0x4d55dd(0x12f)]}};const _0x4174f8=getEffectiveValue(_0x1348e2);return{'type':_0x1348e2['type'],..._0x1348e2[_0x4d55dd(0x128)]!==undefined&&{'not':_0x1348e2[_0x4d55dd(0x128)]},..._0x4174f8!==undefined&&{'value':_0x4174f8},..._0x1348e2[_0x4d55dd(0x121)]!==undefined&&{'unit':_0x1348e2[_0x4d55dd(0x121)]},..._0x1348e2[_0x4d55dd(0x139)]!==undefined&&{'duration':_0x1348e2[_0x4d55dd(0x139)]},..._0x1348e2[_0x4d55dd(0xfb)]!==undefined&&{'from':_0x1348e2[_0x4d55dd(0xfb)]},..._0x1348e2[_0x4d55dd(0x14e)]!==undefined&&{'reverse':_0x1348e2[_0x4d55dd(0x14e)]}};}function normalizeActivation(_0x1b79b0){const _0x27ede2=a142_0x3680df;return{'name':_0x1b79b0[_0x27ede2(0x12e)],'connection':_0x1b79b0[_0x27ede2(0x150)],..._0x1b79b0['description']!==undefined&&{'description':_0x1b79b0[_0x27ede2(0x111)]},..._0x1b79b0[_0x27ede2(0x198)]!==undefined&&{'all_columns':_0x1b79b0[_0x27ede2(0x198)]},..._0x1b79b0[_0x27ede2(0x134)]!==undefined&&{'columns':_0x1b79b0[_0x27ede2(0x134)]},..._0x1b79b0[_0x27ede2(0x124)]!==undefined&&{'behavior':_0x1b79b0[_0x27ede2(0x124)]},..._0x1b79b0[_0x27ede2(0x17e)]!==undefined&&{'schedule':_0x1b79b0['schedule']},..._0x1b79b0[_0x27ede2(0x154)]!==undefined&&{'notification':_0x1b79b0[_0x27ede2(0x154)]},..._0x1b79b0['connector_config']!==undefined&&{'connector_config':_0x1b79b0[_0x27ede2(0x18b)]},..._0x1b79b0[_0x27ede2(0x13f)]!==undefined&&{'activation_template_id':_0x1b79b0[_0x27ede2(0x13f)]},..._0x1b79b0['nested_workflow_project_name']!==undefined&&{'nested_workflow_project_name':_0x1b79b0[_0x27ede2(0x147)]},..._0x1b79b0['nested_workflow_name']!==undefined&&{'nested_workflow_name':_0x1b79b0[_0x27ede2(0x158)]},..._0x1b79b0[_0x27ede2(0x13e)]!==undefined&&{'lock_enabled':_0x1b79b0[_0x27ede2(0x13e)]}};}function getColumnName(_0x21c43c){const _0x5a9027=a142_0x3680df;return _0x21c43c['column']||_0x21c43c[_0x5a9027(0x12e)];}export function activationResponseToDef(_0x241cf1,_0x2f63ec,_0x903912){const _0x4ccf86=a142_0x3680df,_0x4cfa92=_0x241cf1[_0x4ccf86(0x105)]||'',_0x476ff4=_0x903912?.[_0x4ccf86(0xf8)](_0x4cfa92)??_0x4cfa92,_0x32cfb6={'name':_0x241cf1[_0x4ccf86(0x12e)],'connection':_0x476ff4};_0x241cf1['description']&&(_0x32cfb6[_0x4ccf86(0x111)]=_0x241cf1['description']);let _0x2d0d41=[];_0x241cf1['columns']&&_0x241cf1[_0x4ccf86(0x134)][_0x4ccf86(0xea)]>0x0&&(_0x2d0d41=_0x241cf1['columns']['filter'](_0x53b909=>_0x53b909&&getColumnName(_0x53b909))[_0x4ccf86(0x126)](_0x28ad1b=>{const _0x459e16=_0x4ccf86,_0x57fab4=getColumnName(_0x28ad1b);if(_0x28ad1b[_0x459e16(0x190)]||_0x28ad1b['visibility'])return{'name':_0x57fab4,..._0x28ad1b[_0x459e16(0x190)]&&{'type':_0x28ad1b[_0x459e16(0x190)]},..._0x28ad1b[_0x459e16(0x148)]&&{'visibility':_0x28ad1b[_0x459e16(0x148)]}};return _0x57fab4;}));_0x2d0d41['length']>0x0&&(_0x32cfb6[_0x4ccf86(0x134)]=_0x2d0d41);_0x241cf1[_0x4ccf86(0x13d)]!==undefined&&(_0x241cf1[_0x4ccf86(0x13d)]===![]&&_0x2d0d41[_0x4ccf86(0xea)]===0x0?_0x32cfb6[_0x4ccf86(0x198)]=!![]:_0x32cfb6[_0x4ccf86(0x198)]=_0x241cf1[_0x4ccf86(0x13d)]);const _0x245b7a={};let _0x34c26=![];_0x241cf1[_0x4ccf86(0x193)]&&(_0x245b7a[_0x4ccf86(0x190)]=_0x241cf1[_0x4ccf86(0x193)],_0x34c26=!![]);_0x241cf1['repeatUnit']&&(_0x245b7a[_0x4ccf86(0x144)]=_0x241cf1['repeatUnit'],_0x34c26=!![]);_0x241cf1['repeatFrequency']!==undefined&&_0x241cf1['repeatFrequency']!==null&&(_0x245b7a[_0x4ccf86(0x170)]=_0x241cf1['repeatFrequency'],_0x34c26=!![]);_0x241cf1[_0x4ccf86(0x106)]&&_0x241cf1['repeatSubFrequency']['length']>0x0&&(_0x245b7a[_0x4ccf86(0x146)]=_0x241cf1[_0x4ccf86(0x106)],_0x34c26=!![]);_0x241cf1['startAt']!==undefined&&(_0x245b7a[_0x4ccf86(0x114)]=_0x241cf1[_0x4ccf86(0x117)],_0x34c26=!![]);_0x241cf1[_0x4ccf86(0x14a)]!==undefined&&(_0x245b7a['end_on']=_0x241cf1[_0x4ccf86(0x14a)],_0x34c26=!![]);_0x241cf1['timezone']&&(_0x245b7a[_0x4ccf86(0x157)]=_0x241cf1[_0x4ccf86(0x157)],_0x34c26=!![]);_0x34c26&&(_0x32cfb6['schedule']=_0x245b7a);(_0x241cf1['notifyOn']&&_0x241cf1[_0x4ccf86(0xf2)][_0x4ccf86(0xea)]>0x0||_0x241cf1[_0x4ccf86(0x155)]&&_0x241cf1[_0x4ccf86(0x155)][_0x4ccf86(0xea)]>0x0)&&(_0x32cfb6[_0x4ccf86(0x154)]={},_0x241cf1[_0x4ccf86(0xf2)]&&_0x241cf1[_0x4ccf86(0xf2)][_0x4ccf86(0xea)]>0x0&&(_0x32cfb6[_0x4ccf86(0x154)][_0x4ccf86(0xe6)]=_0x241cf1[_0x4ccf86(0xf2)]),_0x241cf1['emailRecipients']&&_0x241cf1[_0x4ccf86(0x155)][_0x4ccf86(0xea)]>0x0&&(_0x32cfb6[_0x4ccf86(0x154)]['email_recipients']=_0x241cf1[_0x4ccf86(0x155)][_0x4ccf86(0x126)](_0x207e14=>{const _0xc85e62=_0x4ccf86,_0xc3d4c7=_0x2f63ec?.[_0xc85e62(0xf8)](_0x207e14);return _0xc3d4c7??String(_0x207e14);})));_0x241cf1['connectorConfig']&&Object[_0x4ccf86(0x112)](_0x241cf1[_0x4ccf86(0x15c)])['length']>0x0&&(_0x32cfb6[_0x4ccf86(0x18b)]=normalizeConnectorConfigForYaml(_0x241cf1['connectorConfig']));_0x241cf1['activationTemplateId']&&(_0x32cfb6['activation_template_id']=_0x241cf1[_0x4ccf86(0x125)]);if(_0x241cf1['syndicationBehavior']){const _0x10c379={},_0xd370e5=_0x241cf1['syndicationBehavior'];_0xd370e5[_0x4ccf86(0x134)]&&_0xd370e5['columns'][_0x4ccf86(0xea)]>0x0&&(_0x10c379[_0x4ccf86(0x134)]=_0xd370e5['columns'][_0x4ccf86(0x10e)](_0x894c5c=>_0x894c5c&&getColumnName(_0x894c5c))[_0x4ccf86(0x126)](_0x5590ae=>({'name':getColumnName(_0x5590ae),..._0x5590ae['type']&&{'type':_0x5590ae[_0x4ccf86(0x190)]},..._0x5590ae[_0x4ccf86(0x148)]&&{'visibility':_0x5590ae[_0x4ccf86(0x148)]}}))),_0xd370e5[_0x4ccf86(0x12b)]&&(_0x10c379[_0x4ccf86(0x102)]=_0xd370e5[_0x4ccf86(0x12b)]),_0xd370e5['joinRow']!==undefined&&(_0x10c379['join_row']=_0xd370e5[_0x4ccf86(0x15f)]),_0xd370e5['joinStrategy']&&(_0x10c379['join_strategy']=_0xd370e5[_0x4ccf86(0x16d)]),_0xd370e5[_0x4ccf86(0x185)]&&(_0x10c379[_0x4ccf86(0x185)]=_0xd370e5[_0x4ccf86(0x185)]),_0xd370e5['orderBy']&&_0xd370e5['orderBy'][_0x4ccf86(0xea)]>0x0&&(_0x10c379[_0x4ccf86(0x161)]=_0xd370e5[_0x4ccf86(0xfd)]),Object[_0x4ccf86(0x112)](_0x10c379)[_0x4ccf86(0xea)]>0x0&&(_0x32cfb6[_0x4ccf86(0x124)]=_0x10c379);}return _0x241cf1[_0x4ccf86(0x10c)]&&(_0x32cfb6[_0x4ccf86(0x147)]=_0x241cf1[_0x4ccf86(0x10c)]),_0x241cf1[_0x4ccf86(0x138)]&&(_0x32cfb6[_0x4ccf86(0x158)]=_0x241cf1['nestedWorkflowName']),_0x241cf1[_0x4ccf86(0x156)]!==undefined&&(_0x32cfb6[_0x4ccf86(0x13e)]=_0x241cf1[_0x4ccf86(0x156)]),_0x32cfb6;}export function journeyActivationStepToYaml(_0x131dab,_0x1dd36e,_0x58f2d5){const _0xaa12f8=a142_0x3680df,_0x29a904=_0x131dab[_0xaa12f8(0x10a)][_0xaa12f8(0x192)],_0x332f46=_0x29a904[_0xaa12f8(0x105)]||'',_0x4c8631=_0x58f2d5?.['get'](_0x332f46)??_0x332f46,_0x484a55={'name':_0x29a904[_0xaa12f8(0x12e)]||'','connection':_0x4c8631};_0x131dab[_0xaa12f8(0x10a)][_0xaa12f8(0x107)]&&(_0x484a55[_0xaa12f8(0xf5)]=!![]);_0x29a904[_0xaa12f8(0x111)]&&(_0x484a55['description']=_0x29a904['description']);let _0x1c5281=[];_0x29a904[_0xaa12f8(0x134)]&&_0x29a904['columns']['length']>0x0&&(_0x1c5281=_0x29a904[_0xaa12f8(0x134)]['filter'](_0x919848=>_0x919848&&getColumnName(_0x919848))[_0xaa12f8(0x126)](_0x1d2aa2=>{const _0x4c5f02=_0xaa12f8,_0x1a0d10=getColumnName(_0x1d2aa2);if(_0x1d2aa2['type']||_0x1d2aa2['visibility'])return{'name':_0x1a0d10,..._0x1d2aa2['type']&&{'type':_0x1d2aa2['type']},..._0x1d2aa2['visibility']&&{'visibility':_0x1d2aa2[_0x4c5f02(0x148)]}};return _0x1a0d10;}));_0x1c5281[_0xaa12f8(0xea)]>0x0&&(_0x484a55[_0xaa12f8(0x134)]=_0x1c5281);_0x29a904[_0xaa12f8(0x13d)]!==undefined&&(_0x29a904[_0xaa12f8(0x13d)]===![]&&_0x1c5281[_0xaa12f8(0xea)]===0x0?_0x484a55[_0xaa12f8(0x198)]=!![]:_0x484a55[_0xaa12f8(0x198)]=_0x29a904[_0xaa12f8(0x13d)]);const _0x3f1434={};let _0x32e546=![];_0x29a904[_0xaa12f8(0x193)]&&(_0x3f1434[_0xaa12f8(0x190)]=_0x29a904[_0xaa12f8(0x193)],_0x32e546=!![]);_0x29a904[_0xaa12f8(0x182)]&&(_0x3f1434[_0xaa12f8(0x144)]=_0x29a904['repeatUnit'],_0x32e546=!![]);_0x29a904[_0xaa12f8(0x15b)]!==undefined&&_0x29a904[_0xaa12f8(0x15b)]!==null&&(_0x3f1434[_0xaa12f8(0x170)]=_0x29a904[_0xaa12f8(0x15b)],_0x32e546=!![]);_0x29a904[_0xaa12f8(0x117)]!==undefined&&(_0x3f1434[_0xaa12f8(0x114)]=_0x29a904['startAt'],_0x32e546=!![]);_0x29a904['endOn']!==undefined&&(_0x3f1434[_0xaa12f8(0x171)]=_0x29a904[_0xaa12f8(0x14a)],_0x32e546=!![]);_0x29a904[_0xaa12f8(0x157)]&&(_0x3f1434[_0xaa12f8(0x157)]=_0x29a904[_0xaa12f8(0x157)],_0x32e546=!![]);_0x32e546&&(_0x484a55[_0xaa12f8(0x17e)]=_0x3f1434);(_0x29a904[_0xaa12f8(0xf2)]&&_0x29a904['notifyOn'][_0xaa12f8(0xea)]>0x0||_0x29a904[_0xaa12f8(0x155)]&&_0x29a904[_0xaa12f8(0x155)][_0xaa12f8(0xea)]>0x0)&&(_0x484a55['notification']={},_0x29a904['notifyOn']&&_0x29a904[_0xaa12f8(0xf2)][_0xaa12f8(0xea)]>0x0&&(_0x484a55[_0xaa12f8(0x154)][_0xaa12f8(0xe6)]=_0x29a904[_0xaa12f8(0xf2)]),_0x29a904[_0xaa12f8(0x155)]&&_0x29a904[_0xaa12f8(0x155)][_0xaa12f8(0xea)]>0x0&&(_0x484a55[_0xaa12f8(0x154)][_0xaa12f8(0x168)]=_0x29a904[_0xaa12f8(0x155)][_0xaa12f8(0x126)](_0x479e71=>{const _0x2e0aea=_0x1dd36e?.['get'](_0x479e71);return _0x2e0aea??String(_0x479e71);})));_0x29a904[_0xaa12f8(0x15c)]&&Object[_0xaa12f8(0x112)](_0x29a904[_0xaa12f8(0x15c)])[_0xaa12f8(0xea)]>0x0&&(_0x484a55[_0xaa12f8(0x18b)]=normalizeConnectorConfigForYaml(_0x29a904['connectorConfig']));_0x29a904['activationTemplateId']&&(_0x484a55['activation_template_id']=_0x29a904[_0xaa12f8(0x125)]);if(_0x29a904[_0xaa12f8(0xf3)]){const _0x4d0c1b={},_0x3a23d0=_0x29a904[_0xaa12f8(0xf3)];_0x3a23d0['columns']&&_0x3a23d0[_0xaa12f8(0x134)]['length']>0x0&&(_0x4d0c1b[_0xaa12f8(0x134)]=_0x3a23d0[_0xaa12f8(0x134)][_0xaa12f8(0x10e)](_0x589c18=>_0x589c18&&getColumnName(_0x589c18))[_0xaa12f8(0x126)](_0x38a682=>({'name':getColumnName(_0x38a682),..._0x38a682[_0xaa12f8(0x190)]&&{'type':_0x38a682[_0xaa12f8(0x190)]},..._0x38a682[_0xaa12f8(0x148)]&&{'visibility':_0x38a682[_0xaa12f8(0x148)]}}))),_0x3a23d0['behaviorTableName']&&(_0x4d0c1b[_0xaa12f8(0x102)]=_0x3a23d0[_0xaa12f8(0x12b)]),_0x3a23d0[_0xaa12f8(0x15f)]!==undefined&&(_0x4d0c1b[_0xaa12f8(0x108)]=_0x3a23d0[_0xaa12f8(0x15f)]),_0x3a23d0[_0xaa12f8(0x16d)]&&(_0x4d0c1b['join_strategy']=_0x3a23d0[_0xaa12f8(0x16d)]),_0x3a23d0[_0xaa12f8(0x185)]&&(_0x4d0c1b['formatting']=_0x3a23d0[_0xaa12f8(0x185)]),_0x3a23d0['orderBy']&&_0x3a23d0['orderBy'][_0xaa12f8(0xea)]>0x0&&(_0x4d0c1b[_0xaa12f8(0x161)]=_0x3a23d0[_0xaa12f8(0xfd)]),Object[_0xaa12f8(0x112)](_0x4d0c1b)[_0xaa12f8(0xea)]>0x0&&(_0x484a55[_0xaa12f8(0x124)]=_0x4d0c1b);}return _0x484a55;}export function segmentWithActivationsToYaml(_0x35c962,_0x1c70d1,_0x47b0b7,_0x156516,_0x2746fe){const _0x26561d=a142_0x3680df,_0x5483b8=segmentResponseToDefSync(_0x35c962,_0x47b0b7);return _0x1c70d1[_0x26561d(0xea)]>0x0&&(_0x5483b8[_0x26561d(0x14b)]=_0x1c70d1['map'](_0x35b1f8=>activationResponseToDef(_0x35b1f8,_0x156516,_0x2746fe))),_0x5483b8;}function normalizeColumn(_0x494ed8){const _0x42cac8=a142_0x3680df;if(typeof _0x494ed8===_0x42cac8(0xe5))return{'column':_0x494ed8,'source':{'column':_0x494ed8}};return{'column':_0x494ed8[_0x42cac8(0x12e)],'source':{'column':_0x494ed8[_0x42cac8(0x12e)]},..._0x494ed8[_0x42cac8(0x190)]&&{'type':_0x494ed8[_0x42cac8(0x190)]},..._0x494ed8['visibility']&&{'visibility':_0x494ed8[_0x42cac8(0x148)]}};}const KNOWN_ACTIVATION_FIELDS=new Set(Object['keys'](ActivationDefSchema['shape']));export function warnUnrecognizedActivationFields(_0x441263,_0x41bb27){const _0x45764f=a142_0x3680df,_0x546229=Object['keys'](_0x441263)['filter'](_0x1f6514=>!KNOWN_ACTIVATION_FIELDS['has'](_0x1f6514));if(_0x546229['length']>0x0){const _0xf66fa4=_0x546229[_0x45764f(0x126)](_0x4a1bc1=>_0x45764f(0x12c)+_0x4a1bc1+'\x22')[_0x45764f(0x16b)]('\x0a');console['warn'](_0x45764f(0x141)+_0x41bb27+'\x22\x20has\x20unrecognized\x20fields\x20(will\x20be\x20ignored):\x0a'+_0xf66fa4);}}export async function activationDefToCreateRequest(_0x22d79f,_0x579d54){const _0x317c7a=a142_0x3680df;warnUnrecognizedActivationFields(_0x22d79f,_0x22d79f[_0x317c7a(0x12e)]);const _0xc7324b=_0x579d54?.[_0x317c7a(0x123)],_0xec3758=_0x579d54?.[_0x317c7a(0xf9)],_0x17a25d=_0x22d79f['connection'];let _0x2c5cea;const _0x2b4e01=parseInt(_0x17a25d,0xa);if(!isNaN(_0x2b4e01)&&String(_0x2b4e01)===_0x17a25d)_0x2c5cea=_0x2b4e01;else{const _0x4866db=_0xec3758?.[_0x317c7a(0xf8)](_0x17a25d);if(_0x4866db===undefined)throw new SDKError(ErrorCode['CONNECTION_NOT_FOUND'],_0x317c7a(0x131)+_0x17a25d,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x2c5cea=_0x4866db;}const _0x321348={'name':_0x22d79f[_0x317c7a(0x12e)],'connectionId':_0x2c5cea};_0x22d79f[_0x317c7a(0x111)]&&(_0x321348[_0x317c7a(0x111)]=_0x22d79f[_0x317c7a(0x111)]);let _0x1be3c0=[];_0x22d79f['columns']&&_0x22d79f['columns'][_0x317c7a(0xea)]>0x0&&(_0x1be3c0=_0x22d79f[_0x317c7a(0x134)][_0x317c7a(0x10e)](_0x1cb754=>_0x1cb754!=null)[_0x317c7a(0x126)](normalizeColumn));_0x1be3c0[_0x317c7a(0xea)]>0x0&&(_0x321348[_0x317c7a(0x134)]=_0x1be3c0);_0x22d79f['all_columns']!==undefined&&(_0x22d79f[_0x317c7a(0x198)]===![]&&_0x1be3c0[_0x317c7a(0xea)]===0x0?_0x321348[_0x317c7a(0x13d)]=!![]:_0x321348[_0x317c7a(0x13d)]=_0x22d79f[_0x317c7a(0x198)]);if(_0x22d79f[_0x317c7a(0x17e)]){const _0xab6fb7=_0x22d79f['schedule'],_0x25436b=_0xab6fb7[_0x317c7a(0x190)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0xab6fb7['repeat_unit']];_0x25436b&&(_0x321348[_0x317c7a(0x193)]=_0x25436b);const _0x161c17=_0xab6fb7[_0x317c7a(0x144)]??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0xab6fb7[_0x317c7a(0x190)]];_0x161c17&&(_0x321348[_0x317c7a(0x182)]=_0x161c17);_0xab6fb7[_0x317c7a(0x170)]!==undefined&&(_0x321348['repeatFrequency']=_0xab6fb7['repeat_frequency']);_0xab6fb7['repeat_sub_frequency']&&(_0x321348[_0x317c7a(0x106)]=_0xab6fb7[_0x317c7a(0x146)]);_0xab6fb7[_0x317c7a(0x114)]!==undefined&&(_0x321348[_0x317c7a(0x117)]=_0xab6fb7['start_at']);_0xab6fb7[_0x317c7a(0x171)]!==undefined&&(_0x321348[_0x317c7a(0x14a)]=_0xab6fb7[_0x317c7a(0x171)]);_0xab6fb7[_0x317c7a(0x157)]&&(_0x321348[_0x317c7a(0x157)]=_0xab6fb7[_0x317c7a(0x157)]);if(_0x25436b&&_0x25436b!=='none'&&_0x25436b!==_0x317c7a(0xf1)&&_0xab6fb7[_0x317c7a(0x114)]){const _0x243c14=_0xab6fb7[_0x317c7a(0x114)][_0x317c7a(0x17d)](/T(\d{2}:\d{2})/);_0x243c14&&(_0x321348[_0x317c7a(0x118)]=_0x243c14[0x1]);}}_0x22d79f[_0x317c7a(0x154)]&&(_0x22d79f['notification'][_0x317c7a(0xe6)]&&(_0x321348[_0x317c7a(0xf2)]=_0x22d79f[_0x317c7a(0x154)][_0x317c7a(0xe6)]),_0x22d79f['notification'][_0x317c7a(0x168)]&&(_0x321348[_0x317c7a(0x155)]=_0x22d79f[_0x317c7a(0x154)]['email_recipients'][_0x317c7a(0x126)](_0x1cbcd3=>{const _0x263613=_0x317c7a,_0x525dd1=Number(_0x1cbcd3);if(!isNaN(_0x525dd1)&&String(_0x525dd1)===_0x1cbcd3)return _0x525dd1;const _0x5dac9d=_0xc7324b?.['get'](_0x1cbcd3[_0x263613(0x127)]());if(_0x5dac9d===undefined)throw new SDKError(ErrorCode[_0x263613(0xf4)],_0x263613(0x172)+_0x1cbcd3+_0x263613(0x113));return _0x5dac9d;})));if(_0x22d79f['connector_config']){const _0x5b19c6=_0x579d54?.[_0x317c7a(0xfa)]?.[_0x317c7a(0xf8)](_0x17a25d);if(_0x5b19c6&&_0x579d54?.[_0x317c7a(0x181)])try{const _0x45c84c=await _0x579d54['getSchema'](_0x5b19c6),_0x581e47=validateConnectorConfig(_0x22d79f[_0x317c7a(0x18b)],_0x45c84c);if(!_0x581e47[_0x317c7a(0x149)])throw new SDKError(ErrorCode['CONNECTOR_INVALID_CONFIG'],_0x317c7a(0x14c)+_0x22d79f[_0x317c7a(0x12e)]+'\x22:\x0a'+formatValidationErrors(_0x581e47[_0x317c7a(0xfc)]),undefined,{'helpText':_0x317c7a(0x11b)+_0x5b19c6+_0x317c7a(0x12a)+formatSchemaAsHelp(_0x45c84c)});if(_0x581e47[_0x317c7a(0x11a)][_0x317c7a(0xea)]>0x0){const _0x51c88=formatValidationWarnings(_0x581e47['warnings']);console[_0x317c7a(0x142)](_0x317c7a(0x18c)+_0x22d79f[_0x317c7a(0x12e)]+_0x317c7a(0x145)+_0x51c88);}_0x321348[_0x317c7a(0x15c)]=transformConfigToLegacy(_0x22d79f['connector_config'],_0x45c84c);}catch(_0xc70567){if(_0xc70567 instanceof SDKError&&_0xc70567[_0x317c7a(0x187)]===ErrorCode[_0x317c7a(0x176)])_0x321348[_0x317c7a(0x15c)]=_0x22d79f['connector_config'];else throw _0xc70567;}else _0x321348[_0x317c7a(0x15c)]=_0x22d79f[_0x317c7a(0x18b)];}_0x22d79f[_0x317c7a(0x13f)]!==undefined&&(_0x321348[_0x317c7a(0x125)]=_0x22d79f['activation_template_id']);if(_0x22d79f[_0x317c7a(0x124)]){const _0x118334=_0x22d79f[_0x317c7a(0x124)],_0x44d31c={};if(_0x118334[_0x317c7a(0x134)]&&_0x118334[_0x317c7a(0x134)]['length']>0x0){const _0x1bb940=_0x118334[_0x317c7a(0x134)][_0x317c7a(0x10e)](_0x4b9212=>_0x4b9212&&_0x4b9212[_0x317c7a(0x12e)])[_0x317c7a(0x126)](normalizeColumn);_0x1bb940['length']>0x0&&(_0x44d31c[_0x317c7a(0x134)]=_0x1bb940);}_0x118334[_0x317c7a(0x102)]&&(_0x44d31c['behaviorTableName']=_0x118334[_0x317c7a(0x102)]);_0x118334[_0x317c7a(0x169)]&&(_0x44d31c[_0x317c7a(0x16d)]=_0x118334[_0x317c7a(0x169)]);if(_0x118334['join_row']!==undefined)_0x44d31c[_0x317c7a(0x15f)]=_0x118334[_0x317c7a(0x108)];else{if(_0x118334['join_strategy']===_0x317c7a(0x174)||_0x118334[_0x317c7a(0x169)]===_0x317c7a(0x10b))_0x44d31c['joinRow']=0x1;else _0x118334['join_strategy']===_0x317c7a(0x11f)&&(_0x44d31c[_0x317c7a(0x15f)]=null);}_0x118334[_0x317c7a(0x185)]&&(_0x44d31c[_0x317c7a(0x185)]=_0x118334[_0x317c7a(0x185)]),_0x118334[_0x317c7a(0x161)]&&(_0x44d31c[_0x317c7a(0xfd)]=_0x118334['order_by']),_0x321348['syndicationBehavior']=_0x44d31c;}return _0x22d79f['nested_workflow_project_name']&&(_0x321348[_0x317c7a(0x10c)]=_0x22d79f[_0x317c7a(0x147)]),_0x22d79f['nested_workflow_name']&&(_0x321348[_0x317c7a(0x138)]=_0x22d79f[_0x317c7a(0x158)]),_0x22d79f[_0x317c7a(0x13e)]!==undefined&&(_0x321348[_0x317c7a(0x156)]=_0x22d79f[_0x317c7a(0x13e)]),_0x321348;}export async function activationDefToUpdateRequest(_0xbeac72,_0x396f3a){return activationDefToCreateRequest(_0xbeac72,_0x396f3a);}export function deepSortObject(_0x19bf92){const _0x19c348=a142_0x3680df;if(_0x19bf92===null||typeof _0x19bf92!==_0x19c348(0x10f))return _0x19bf92;if(Array['isArray'](_0x19bf92))return _0x19bf92['map'](deepSortObject)[_0x19c348(0x17c)]((_0xe2455a,_0x39b102)=>JSON[_0x19c348(0x167)](_0xe2455a)[_0x19c348(0x178)](JSON[_0x19c348(0x167)](_0x39b102)));const _0x3b65bb={};for(const _0x4dcc8e of Object[_0x19c348(0x112)](_0x19bf92)[_0x19c348(0x17c)]()){_0x3b65bb[_0x4dcc8e]=deepSortObject(_0x19bf92[_0x4dcc8e]);}return _0x3b65bb;}function a142_0xe593(_0x7e3d7c,_0x50b7cf){_0x7e3d7c=_0x7e3d7c-0xe5;const _0x2b438a=a142_0x2b43();let _0xe5938b=_0x2b438a[_0x7e3d7c];return _0xe5938b;}export function serializeRule(_0x23954b){const _0x535128=a142_0x3680df;return JSON[_0x535128(0x167)](deepSortObject(_0x23954b));}export function normalizeRuleForMatching(_0x4ed369){return normalizeConditionsForMatching(_0x4ed369);}function normalizeConditionsForMatching(_0x1cfe10){const _0x2ba885=a142_0x3680df;if(_0x1cfe10===null||typeof _0x1cfe10!==_0x2ba885(0x10f))return _0x1cfe10;if(Array[_0x2ba885(0x175)](_0x1cfe10))return _0x1cfe10[_0x2ba885(0x126)](normalizeConditionsForMatching);const _0x40f764=_0x1cfe10;if((_0x40f764[_0x2ba885(0x190)]===_0x2ba885(0x11c)||_0x40f764[_0x2ba885(0x190)]==='exclude')&&typeof _0x40f764['segment']===_0x2ba885(0xe5))return{..._0x40f764,'segment':'__SEGMENT_REF__'};const _0x2caa21={};for(const _0x3373f4 of Object[_0x2ba885(0x112)](_0x40f764)){_0x2caa21[_0x3373f4]=normalizeConditionsForMatching(_0x40f764[_0x3373f4]);}return _0x2caa21;}export function serializeRuleForMatching(_0x14fde4){return JSON['stringify'](deepSortObject(normalizeRuleForMatching(_0x14fde4)));}export function expandSegmentReferences(_0xdec767,_0x562184,_0xe6fb6d=new Set()){return expandConditions(_0xdec767,_0x562184,_0xe6fb6d);}function expandConditions(_0x579d36,_0x180e93,_0x2d1023){const _0x2bef14=a142_0x3680df;if(_0x579d36===null||typeof _0x579d36!==_0x2bef14(0x10f))return _0x579d36;if(Array['isArray'](_0x579d36))return _0x579d36['map'](_0x37b639=>expandConditions(_0x37b639,_0x180e93,_0x2d1023));const _0xb09851=_0x579d36;if((_0xb09851['type']===_0x2bef14(0x11c)||_0xb09851[_0x2bef14(0x190)]===_0x2bef14(0x132))&&typeof _0xb09851[_0x2bef14(0x16c)]==='string'){const _0x3ec729=_0xb09851[_0x2bef14(0x16c)],_0x53b431=_0x180e93['get'](_0x3ec729);if(_0x53b431&&!_0x2d1023[_0x2bef14(0x10d)](_0x3ec729)){const _0x1d88ae=new Set(_0x2d1023);_0x1d88ae[_0x2bef14(0x153)](_0x3ec729);const _0x5076bf=expandConditions(_0x53b431,_0x180e93,_0x1d88ae);return{'type':_0xb09851[_0x2bef14(0x190)],'expanded_rule':_0x5076bf};}return{'type':_0xb09851[_0x2bef14(0x190)],'expanded_rule':_0x2bef14(0x177)};}const _0x5e1a0f={};for(const _0x25b7f5 of Object['keys'](_0xb09851)){_0x5e1a0f[_0x25b7f5]=expandConditions(_0xb09851[_0x25b7f5],_0x180e93,_0x2d1023);}return _0x5e1a0f;}function a142_0x2b43(){const _0x1d7e14=['attribute_name','minutes_interval','rightValue','all_columns','JOURNEY_SYNTAX_ERROR','min','string','notify_on','Behavior','17256Irvtlr','945ywudUn','length','week','New\x20Segment','Equal','timeWindow','rule','Please\x20specify\x20a\x20valid\x20attribute\x20name.','cron','notifyOn','syndicationBehavior','INVALID_ARGUMENT','run_after_journey_refresh','all','resolveSegmentName','get','connectionNameToIdMap','connectionNameToTypeMap','from','errors','orderBy','entries','parse','Reference','TimeWithinNext','behavior_table','minValue','realtime','connectionId','repeatSubFrequency','runAfterJourneyRefresh','join_row','null','attributes','First','nestedWorkflowProjectName','has','filter','object','958044arOVzp','description','keys','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','start_at','rule:','rightValues','startAt','scheduleOption','orderColumn','warnings','Connector:\x20','include','localRuleToName','daily','All','weekly','unit','replace','emailToIdMap','behavior','activationTemplateId','map','toLowerCase','not','ruleHashToName','\x0a\x0aAvailable\x20fields:\x0a','behaviorTableName','\x20\x20-\x20\x22','flatMap','name','max','maxValue','Unknown\x20connection:\x20','exclude','480767iCdUPF','columns','leftValue','source','folder','nestedWorkflowName','duration','kind','any','value','allColumns','lock_enabled','activation_template_id','isVisible','Warning:\x20activation\x20\x22','warn','push','repeat_unit','\x22:\x0a','repeat_sub_frequency','nested_workflow_project_name','visibility','valid','endOn','activations','Invalid\x20connector_config\x20for\x20activation\x20\x22','1338651CyjLfk','reverse','day','connection','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','operator','add','notification','emailRecipients','lockEnabled','timezone','nested_workflow_name','monthly','TimeRange','repeatFrequency','connectorConfig','6404463ptYcUV','attribute','joinRow','2206450WgGRzl','order_by','test','conditions','visible','Between','column','stringify','email_recipients','join_strategy','Value','join','segment','joinStrategy','usedNames','arrayMatching','repeat_frequency','end_on','Unknown\x20email\x20recipient:\x20','values','Last','isArray','CONNECTOR_SCHEMA_NOT_FOUND','__UNRESOLVED__','localeCompare','set','176272MWAoNB','CountDistinct','sort','match','schedule','\x27:\x20','aggregation','getSchema','repeatUnit','].attribute\x20cannot\x20be\x20empty.\x0a','conditions[','formatting','groupingColumns','code','segmentFolderId','4Nwyavl','every','connector_config','connector_config\x20for\x20activation\x20\x22','batch','month','Column','type','limit','activationParams','scheduleType','And'];a142_0x2b43=function(){return _0x1d7e14;};return a142_0x2b43();}export function serializeExpandedRule(_0x573820,_0x460382){const _0x5dca79=a142_0x3680df,_0x5d94df=expandSegmentReferences(_0x573820,_0x460382);return JSON[_0x5dca79(0x167)](deepSortObject(_0x5d94df));}export function createSegmentNameContext(_0x219bea){const _0x2e7eb3=a142_0x3680df,_0x20f708=new Set(),_0x360ea0=new Map(),_0x1d4a1c=new Map();if(_0x219bea)for(const [_0x8f1ddb,_0x4231d1]of Object[_0x2e7eb3(0xfe)](_0x219bea)){if(_0x4231d1[_0x2e7eb3(0xef)]){const _0x350dff=serializeRule(_0x4231d1[_0x2e7eb3(0xef)]);_0x1d4a1c[_0x2e7eb3(0x179)](_0x350dff,_0x8f1ddb),_0x20f708[_0x2e7eb3(0x153)](_0x8f1ddb);}}return{'usedNames':_0x20f708,'ruleHashToName':_0x360ea0,'localRuleToName':_0x219bea?_0x1d4a1c:undefined};}export function resolveSegmentName(_0x209a57,_0x41246d,_0x3b0f29,_0x44a6df){const _0x26efa4=a142_0x3680df,_0x4731ca=serializeRule(_0x41246d);if(_0x3b0f29[_0x26efa4(0x11d)]){const _0xaccbcc=_0x3b0f29[_0x26efa4(0x11d)][_0x26efa4(0xf8)](_0x4731ca);if(_0xaccbcc)return{'name':_0xaccbcc,'isDuplicate':![],'isLocalMatch':!![]};}const _0x3a2551=_0x3b0f29[_0x26efa4(0x129)]['get'](_0x4731ca);if(_0x3a2551)return{'name':_0x3a2551,'isDuplicate':!![],'isLocalMatch':![]};const _0x5162ec=_0x44a6df(_0x209a57);let _0x3ca3e8=_0x5162ec||_0x209a57,_0x3f1286=_0x3ca3e8,_0x2eba3b=0x2;while(_0x3b0f29[_0x26efa4(0x16e)][_0x26efa4(0x10d)](_0x3f1286)){_0x3f1286=_0x3ca3e8+'_'+_0x2eba3b,_0x2eba3b++;}return _0x3b0f29[_0x26efa4(0x16e)][_0x26efa4(0x153)](_0x3f1286),_0x3b0f29[_0x26efa4(0x129)][_0x26efa4(0x179)](_0x4731ca,_0x3f1286),{'name':_0x3f1286,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x3ff3fd){const _0x593fa4=[],_0x21157b=_0x11907b=>{const _0x409b38=a142_0xe593;if(!_0x11907b||typeof _0x11907b!==_0x409b38(0x10f))return;if(Array[_0x409b38(0x175)](_0x11907b)){_0x11907b['forEach'](_0x21157b);return;}const _0x29e05e=_0x11907b;(_0x29e05e[_0x409b38(0x190)]==='include'||_0x29e05e[_0x409b38(0x190)]===_0x409b38(0x132))&&typeof _0x29e05e[_0x409b38(0x16c)]===_0x409b38(0xe5)&&_0x593fa4[_0x409b38(0x143)](_0x29e05e[_0x409b38(0x16c)]);for(const _0x308e6a of Object[_0x409b38(0x173)](_0x29e05e)){_0x21157b(_0x308e6a);}};return _0x21157b(_0x3ff3fd),_0x593fa4;}export function validateSegmentRule(_0x129856,_0x9ff7ac){const _0x325d0f=a142_0x3680df;if(!_0x9ff7ac||!_0x9ff7ac[_0x325d0f(0x163)])return;for(let _0x226fb5=0x0;_0x226fb5<_0x9ff7ac['conditions'][_0x325d0f(0xea)];_0x226fb5++){const _0x37694a=_0x9ff7ac['conditions'][_0x226fb5];if(_0x325d0f(0x190)in _0x37694a&&_0x37694a['type']===_0x325d0f(0x16a)){const _0x5e942d=_0x37694a,_0x35493e=_0x5e942d[_0x325d0f(0x136)]||_0x5e942d['aggregation'];if((!_0x5e942d[_0x325d0f(0x15e)]||_0x5e942d[_0x325d0f(0x15e)]==='')&&!_0x35493e)throw new SDKError(ErrorCode[_0x325d0f(0x199)],_0x325d0f(0x151)+_0x129856+_0x325d0f(0x17f)+(_0x325d0f(0x184)+_0x226fb5+_0x325d0f(0x183))+_0x325d0f(0xf0));}}}
1
+ const a142_0x54aecb=a142_0x327e;(function(_0x486c93,_0x1d6757){const _0x44ffc3=a142_0x327e,_0x2407d8=_0x486c93();while(!![]){try{const _0x4e5384=parseInt(_0x44ffc3(0x143))/0x1*(parseInt(_0x44ffc3(0xfa))/0x2)+parseInt(_0x44ffc3(0x154))/0x3*(parseInt(_0x44ffc3(0xc8))/0x4)+parseInt(_0x44ffc3(0x13f))/0x5+parseInt(_0x44ffc3(0x139))/0x6*(parseInt(_0x44ffc3(0x115))/0x7)+parseInt(_0x44ffc3(0xd2))/0x8+parseInt(_0x44ffc3(0x117))/0x9+-parseInt(_0x44ffc3(0x15e))/0xa;if(_0x4e5384===_0x1d6757)break;else _0x2407d8['push'](_0x2407d8['shift']());}catch(_0xef59c){_0x2407d8['push'](_0x2407d8['shift']());}}}(a142_0x23ae,0xe5040));import*as a142_0x228d11 from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';import{ActivationDefSchema}from'./types/activation-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a142_0x54aecb(0x121),'hourly':'hour','weekly':a142_0x54aecb(0x11c),'monthly':'month','minutes_interval':a142_0x54aecb(0xf9)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a142_0x54aecb(0xf4),'hour':a142_0x54aecb(0x111),'week':'weekly','month':a142_0x54aecb(0x13e),'minute':'minutes_interval'};function filterRuleAsRuleDef(_0x1f01c4){return _0x1f01c4;}function ruleDefAsFilterRule(_0x3b242f){return _0x3b242f;}export function segmentResponseToDefSync(_0x4a5690,_0x3aa39a){const _0x1dda18=a142_0x54aecb,_0x280807=_0x4a5690[_0x1dda18(0x10c)]&&_0x1dda18(0xd0)in _0x4a5690[_0x1dda18(0x10c)]&&_0x4a5690[_0x1dda18(0x10c)]['type'];return{'type':'segment','name':_0x4a5690[_0x1dda18(0x132)],..._0x4a5690[_0x1dda18(0xc7)]&&{'description':_0x4a5690[_0x1dda18(0xc7)]},..._0x3aa39a&&{'folder':_0x3aa39a},..._0x280807&&{'rule':apiRuleToYaml(_0x4a5690[_0x1dda18(0x10c)])},..._0x4a5690[_0x1dda18(0x167)]!==undefined&&{'kind':_0x4a5690['kind']===0x0?_0x1dda18(0x109):_0x4a5690[_0x1dda18(0x167)]===0x1?_0x1dda18(0x10a):_0x1dda18(0xcd)},..._0x4a5690[_0x1dda18(0x14d)]!==undefined&&{'visible':_0x4a5690[_0x1dda18(0x14d)]}};}export async function segmentResponseToDef(_0x1b7bda,_0x5ecfee,_0x42395b){const _0x1566cf=a142_0x54aecb,_0x547556=segmentResponseToDefSync(_0x1b7bda,_0x42395b);if(!_0x5ecfee||!_0x5ecfee[_0x1566cf(0xdb)])return _0x547556;return _0x547556[_0x1566cf(0x10c)]&&(_0x547556[_0x1566cf(0x10c)]=await resolveRuleSegmentRefs(_0x547556[_0x1566cf(0x10c)],_0x5ecfee[_0x1566cf(0xdb)])),_0x547556;}export function apiRuleToYaml(_0x4027d0){const _0x5ef7a7=a142_0x54aecb,_0x8b07de=(_0x4027d0[_0x5ef7a7(0xcc)]||[])[_0x5ef7a7(0xc6)](_0x36a21b=>{const _0x16f253=_0x5ef7a7,_0x2a665a=apiConditionToYaml(_0x36a21b);if(isCompositeType(_0x2a665a)&&_0x2a665a[_0x16f253(0xc7)]!==undefined){const _0x5e3288=_0x2a665a;if(_0x5e3288[_0x16f253(0xcc)][_0x16f253(0xce)]===0x1)return _0x5e3288[_0x16f253(0xcc)];return[{'type':_0x5e3288[_0x16f253(0xd0)],'conditions':_0x5e3288['conditions']}];}return[_0x2a665a];});if(_0x8b07de[_0x5ef7a7(0xce)]===0x1&&!_0x4027d0['description']&&isCompositeType(_0x8b07de[0x0])){const _0x5d781b=_0x8b07de[0x0];if(_0x5d781b[_0x5ef7a7(0xd0)]===_0x4027d0[_0x5ef7a7(0xd0)]&&_0x5d781b[_0x5ef7a7(0xcc)]&&_0x5d781b[_0x5ef7a7(0xc7)]===undefined)return{'type':_0x4027d0[_0x5ef7a7(0xd0)],'conditions':_0x5d781b[_0x5ef7a7(0xcc)]};}return{'type':_0x4027d0[_0x5ef7a7(0xd0)],'conditions':_0x8b07de};}export async function resolveRuleSegmentRefs(_0x3d10ae,_0x5ba2d5){const _0x5ce0ff=a142_0x54aecb;return transformRuleSegmentRefs(_0x3d10ae,_0x5ba2d5,_0x12aabc=>/^\d+$/[_0x5ce0ff(0x164)](_0x12aabc));}function a142_0x327e(_0x5e0c2b,_0x272bb4){_0x5e0c2b=_0x5e0c2b-0xc3;const _0x23ae24=a142_0x23ae();let _0x327e2a=_0x23ae24[_0x5e0c2b];return _0x327e2a;}async function transformConditionSegmentRefs(_0x3c3f89,_0x16cfe1,_0x6eb844,_0x528f7b){const _0x424073=a142_0x54aecb;if(_0x424073(0xd8)in _0x3c3f89&&(_0x3c3f89['type']==='include'||_0x3c3f89[_0x424073(0xd0)]===_0x424073(0x123))){const _0x321a8f=_0x3c3f89;if(_0x6eb844(_0x321a8f[_0x424073(0xd8)]))return{..._0x321a8f,'segment':await _0x16cfe1(_0x321a8f[_0x424073(0xd8)])};return _0x3c3f89;}if(_0x424073(0xcc)in _0x3c3f89&&_0x3c3f89['conditions']){const _0x3bcdce=_0x3c3f89,_0x42bc90=await Promise[_0x424073(0xf5)](_0x3bcdce[_0x424073(0xcc)][_0x424073(0x16b)](_0x42a397=>transformConditionSegmentRefs(_0x42a397,_0x16cfe1,_0x6eb844,_0x528f7b)));return{..._0x3bcdce,'conditions':_0x42bc90};}if(_0x424073(0x120)in _0x3c3f89&&_0x3c3f89[_0x424073(0x120)]){const _0x1508d1=_0x3c3f89,_0xd25b0e=await _0x528f7b(filterRuleAsRuleDef(_0x1508d1[_0x424073(0x120)]),_0x16cfe1);return{..._0x1508d1,'filter':ruleDefAsFilterRule(_0xd25b0e)};}return _0x3c3f89;}async function transformRuleSegmentRefs(_0x16b784,_0x18abd2,_0x19996e){const _0x51de09=a142_0x54aecb,_0x41625c=(_0x1a5c38,_0x22c765)=>transformRuleSegmentRefs(_0x1a5c38,_0x22c765,_0x19996e),_0x180a0c=await Promise['all'](_0x16b784[_0x51de09(0xcc)][_0x51de09(0x16b)](_0x39072d=>transformConditionSegmentRefs(_0x39072d,_0x18abd2,_0x19996e,_0x41625c)));return{..._0x16b784,'conditions':_0x180a0c};}export async function resolveRuleSegmentIds(_0x521fd4,_0x26c2d0){const _0x5a4344=a142_0x54aecb;return transformRuleSegmentRefs(_0x521fd4,_0x26c2d0,_0x3f0e48=>!/^\d+$/[_0x5a4344(0x164)](_0x3f0e48));}function isCompositeType(_0x6769a7){const _0x3f080a=a142_0x54aecb;return _0x6769a7['type']===_0x3f080a(0x13c)||_0x6769a7[_0x3f080a(0xd0)]==='Or';}function isBehaviorApiCondition(_0x7d782b){const _0x12f7d6=a142_0x54aecb;if(!_0x7d782b[_0x12f7d6(0x100)]?.['source']?.[_0x12f7d6(0x132)])return![];return!![];}function apiConditionToYaml(_0x1dc05a){const _0x8d568a=a142_0x54aecb;if(_0x1dc05a[_0x8d568a(0xd0)]==='And'||_0x1dc05a['type']==='Or'){if(_0x1dc05a[_0x8d568a(0xcc)]){const _0xf69085=_0x1dc05a[_0x8d568a(0xcc)]['map'](apiConditionToYaml),_0x523dc7=_0x1dc05a[_0x8d568a(0xc7)]!==undefined;if(_0xf69085['length']===0x1&&!_0x523dc7)return _0xf69085[0x0];return{'type':_0x1dc05a['type'],'conditions':_0xf69085,..._0x1dc05a[_0x8d568a(0xc7)]!==undefined&&{'description':_0x1dc05a[_0x8d568a(0xc7)]}};}}if(_0x1dc05a['type']==='Value'&&_0x1dc05a[_0x8d568a(0x100)]&&_0x1dc05a['operator']){const _0x6e1a2e=_0x1dc05a[_0x8d568a(0x100)][_0x8d568a(0xd5)]?buildAggregationDefFromApi(_0x1dc05a[_0x8d568a(0x100)][_0x8d568a(0xd5)]):undefined;if(isBehaviorApiCondition(_0x1dc05a)){const _0x5665de=_0x1dc05a[_0x8d568a(0x100)][_0x8d568a(0x113)][_0x8d568a(0x132)];return{'type':_0x8d568a(0x149),'attribute':'','operator':apiOperatorToYaml(_0x1dc05a['operator']),..._0x1dc05a[_0x8d568a(0xed)]&&_0x1dc05a[_0x8d568a(0xed)]!==_0x8d568a(0xe0)?{'arrayMatching':_0x1dc05a[_0x8d568a(0xed)]}:{},..._0x1dc05a[_0x8d568a(0x123)]?{'exclude':_0x1dc05a[_0x8d568a(0x123)]}:{},..._0x6e1a2e?{'aggregation':_0x6e1a2e}:{},'source':_0x5665de,..._0x1dc05a[_0x8d568a(0x100)][_0x8d568a(0x120)]?{'filter':apiRuleToYaml(_0x1dc05a['leftValue']['filter'])}:{},..._0x1dc05a[_0x8d568a(0x137)]!==undefined&&_0x1dc05a['limit']!==null?{'limit':_0x1dc05a[_0x8d568a(0x137)]}:{}};}return{'type':_0x8d568a(0x159),'attribute':_0x1dc05a[_0x8d568a(0x100)][_0x8d568a(0x132)]||'','operator':apiOperatorToYaml(_0x1dc05a[_0x8d568a(0xe3)]),..._0x1dc05a[_0x8d568a(0xed)]&&_0x1dc05a['arrayMatching']!==_0x8d568a(0xe0)?{'arrayMatching':_0x1dc05a[_0x8d568a(0xed)]}:{},..._0x1dc05a[_0x8d568a(0x123)]?{'exclude':_0x1dc05a[_0x8d568a(0x123)]}:{},..._0x6e1a2e?{'aggregation':_0x6e1a2e}:{},..._0x1dc05a[_0x8d568a(0x100)][_0x8d568a(0x120)]?{'filter':apiRuleToYaml(_0x1dc05a[_0x8d568a(0x100)][_0x8d568a(0x120)])}:{},..._0x1dc05a['limit']!==undefined&&_0x1dc05a[_0x8d568a(0x137)]!==null?{'limit':_0x1dc05a[_0x8d568a(0x137)]}:{}};}if(_0x1dc05a[_0x8d568a(0xd0)]===_0x8d568a(0x11f)&&_0x1dc05a[_0x8d568a(0xfc)]&&_0x1dc05a[_0x8d568a(0xe3)])return{'type':_0x8d568a(0x11f),'column':_0x1dc05a[_0x8d568a(0xfc)],'operator':apiOperatorToYaml(_0x1dc05a[_0x8d568a(0xe3)])};if(_0x1dc05a[_0x8d568a(0xd0)]===_0x8d568a(0xe7)&&_0x1dc05a['id'])return{'type':_0x1dc05a['exclude']?_0x8d568a(0x123):_0x8d568a(0x155),'segment':_0x1dc05a['id']};return{'type':_0x8d568a(0x13c),'conditions':[]};}function isTemporalOperator(_0x34600e){const _0x4862f6=a142_0x54aecb;return _0x34600e===_0x4862f6(0x166)||_0x34600e===_0x4862f6(0xd9);}function isBetweenOperator(_0x5bb2a1){const _0x12d08a=a142_0x54aecb;return _0x5bb2a1===_0x12d08a(0xca);}function getEffectiveValue(_0x33f84c){const _0x8bb307=a142_0x54aecb,_0x18b73e=_0x33f84c[_0x8bb307(0x176)];return _0x33f84c[_0x8bb307(0xf0)]??_0x18b73e;}function parseNumericValue(_0x378bec){const _0x715227=a142_0x54aecb;if(typeof _0x378bec===_0x715227(0x118)&&_0x378bec!==null)return _0x378bec;if(_0x378bec==='')return _0x378bec;const _0x5ed645=Number(_0x378bec);return Number['isFinite'](_0x5ed645)?_0x5ed645:_0x378bec;}function apiOperatorToYaml(_0x37d835){const _0x351c86=a142_0x54aecb;if(isBetweenOperator(_0x37d835[_0x351c86(0xd0)]))return{'type':mapApiOperatorType(_0x37d835[_0x351c86(0xd0)]),..._0x37d835[_0x351c86(0x124)]!==undefined&&{'not':_0x37d835['not']},..._0x37d835['minValue']!==undefined&&{'min':parseNumericValue(_0x37d835[_0x351c86(0x119)])},..._0x37d835[_0x351c86(0xe9)]!==undefined&&{'max':parseNumericValue(_0x37d835[_0x351c86(0xe9)])}};if(_0x37d835['type']==='TimeRange')return{'type':_0x351c86(0x11b),..._0x37d835[_0x351c86(0x124)]!==undefined&&{'not':_0x37d835[_0x351c86(0x124)]},..._0x37d835[_0x351c86(0x161)]!==undefined&&{'duration':_0x37d835[_0x351c86(0x161)]},..._0x37d835[_0x351c86(0x15c)]!==undefined&&{'from':_0x37d835['from']},..._0x37d835[_0x351c86(0x150)]!==undefined&&{'reverse':_0x37d835[_0x351c86(0x150)]}};let _0x5eb635;if(_0x37d835[_0x351c86(0xc5)]&&_0x37d835[_0x351c86(0xc5)][_0x351c86(0xce)]>0x0)_0x5eb635=_0x37d835[_0x351c86(0xc5)];else{if(_0x37d835['rightValue']!==undefined)_0x5eb635=_0x37d835['rightValue'];else isTemporalOperator(_0x37d835['type'])&&_0x37d835[_0x351c86(0xf0)]!==undefined&&(_0x5eb635=_0x37d835['value']);}return{'type':mapApiOperatorType(_0x37d835[_0x351c86(0xd0)]),..._0x37d835[_0x351c86(0x124)]!==undefined&&{'not':_0x37d835['not']},..._0x5eb635!==undefined&&{'value':_0x5eb635},..._0x37d835[_0x351c86(0xd7)]!==undefined&&{'unit':_0x37d835[_0x351c86(0xd7)]}};}function mapApiOperatorType(_0x1586be){return _0x1586be;}export function segmentDefToCreateRequest(_0x1c271f,_0x21148a){const _0x3bc545=a142_0x54aecb,_0x4f9ff7={'name':_0x1c271f['name']};return _0x1c271f[_0x3bc545(0xc7)]&&(_0x4f9ff7['description']=_0x1c271f[_0x3bc545(0xc7)]),_0x1c271f[_0x3bc545(0x10c)]&&(_0x4f9ff7['rule']=yamlRuleToApi(_0x1c271f[_0x3bc545(0x10c)])),_0x1c271f['kind']&&(_0x4f9ff7['kind']=_0x1c271f[_0x3bc545(0x167)]===_0x3bc545(0x109)?0x0:_0x1c271f['kind']===_0x3bc545(0x10a)?0x1:0x2),_0x1c271f['visible']!==undefined&&(_0x4f9ff7[_0x3bc545(0x14d)]=_0x1c271f[_0x3bc545(0x10e)]),_0x21148a&&(_0x4f9ff7[_0x3bc545(0xf8)]=_0x21148a),_0x4f9ff7;}export function segmentDefToUpdateRequest(_0x4a4080){const _0x2abc59=a142_0x54aecb,_0x56061d={'name':_0x4a4080[_0x2abc59(0x132)]};return _0x4a4080[_0x2abc59(0xc7)]!==undefined&&(_0x56061d['description']=_0x4a4080['description']),_0x4a4080['rule']&&(_0x56061d[_0x2abc59(0x10c)]=yamlRuleToApi(_0x4a4080[_0x2abc59(0x10c)])),_0x4a4080['kind']&&(_0x56061d['kind']=_0x4a4080[_0x2abc59(0x167)]==='batch'?0x0:_0x4a4080[_0x2abc59(0x167)]===_0x2abc59(0x10a)?0x1:0x2),_0x56061d;}export function yamlRuleToApi(_0x2ef734){const _0x35da7b=a142_0x54aecb,_0x1ba325=_0x2ef734[_0x35da7b(0xcc)][_0x35da7b(0x16b)](yamlConditionToApi),_0x3555a8=_0x1ba325[_0x35da7b(0x141)](_0x3d6915=>isCompositeType(_0x3d6915)&&_0x3d6915[_0x35da7b(0xc7)]!==undefined);if(!_0x3555a8&&_0x1ba325[_0x35da7b(0xce)]>0x0){const _0x5205d0=[];for(const _0xfa47b5 of _0x1ba325){isCompositeType(_0xfa47b5)&&_0xfa47b5[_0x35da7b(0xc7)]===undefined&&_0xfa47b5[_0x35da7b(0xcc)]&&_0xfa47b5[_0x35da7b(0xcc)]['every'](_0x30c736=>!isCompositeType(_0x30c736))?_0x5205d0[_0x35da7b(0x177)]({'type':_0xfa47b5['type'],'description':'','conditions':_0xfa47b5[_0x35da7b(0xcc)]}):_0x5205d0[_0x35da7b(0x177)]({'type':'And','description':_0x2ef734[_0x35da7b(0xc7)]||'','conditions':[_0xfa47b5]});}return{'type':_0x2ef734[_0x35da7b(0xd0)],'conditions':_0x5205d0};}return{'type':_0x2ef734[_0x35da7b(0xd0)],'conditions':_0x1ba325,..._0x2ef734[_0x35da7b(0xc7)]&&{'description':_0x2ef734[_0x35da7b(0xc7)]}};}function yamlFilterRuleToApi(_0x11f4c7){const _0x5d4108=a142_0x54aecb,_0x3e9636=_0x11f4c7[_0x5d4108(0xcc)][_0x5d4108(0x16b)](yamlConditionToApi);return{'type':_0x11f4c7[_0x5d4108(0xd0)],'conditions':_0x3e9636};}function yamlConditionToApi(_0x7308fa){const _0x27f099=a142_0x54aecb;if(_0x27f099(0xd8)in _0x7308fa&&(_0x7308fa[_0x27f099(0xd0)]===_0x27f099(0x155)||_0x7308fa[_0x27f099(0xd0)]===_0x27f099(0x123))){const _0x345e5f=_0x7308fa;return{'type':_0x27f099(0xe7),'id':_0x345e5f[_0x27f099(0xd8)],'exclude':_0x345e5f[_0x27f099(0xd0)]===_0x27f099(0x123)};}if(_0x7308fa[_0x27f099(0xd0)]===_0x27f099(0x13c)||_0x7308fa[_0x27f099(0xd0)]==='Or'){const _0x41834c=_0x7308fa;return{'type':_0x41834c[_0x27f099(0xd0)],'conditions':_0x41834c[_0x27f099(0xcc)][_0x27f099(0x16b)](yamlConditionToApi),..._0x41834c[_0x27f099(0xc7)]&&{'description':_0x41834c[_0x27f099(0xc7)]}};}if(_0x27f099(0xfc)in _0x7308fa&&_0x7308fa[_0x27f099(0xd0)]===_0x27f099(0x11f)){const _0x5da2c0=_0x7308fa;return{'type':_0x27f099(0x11f),'column':_0x5da2c0[_0x27f099(0xfc)],'operator':yamlOperatorToApi(_0x5da2c0[_0x27f099(0xe3)])};}const _0xbcd244=_0x7308fa,_0x5aca62={'type':_0x27f099(0x159),'leftValue':buildLeftValue(_0xbcd244),'operator':yamlOperatorToApi(_0xbcd244[_0x27f099(0xe3)]),'exclude':_0xbcd244[_0x27f099(0x123)]??![],'arrayMatching':_0xbcd244[_0x27f099(0xed)]??_0x27f099(0xe0)};return _0xbcd244[_0x27f099(0x137)]!==undefined&&(_0x5aca62[_0x27f099(0x137)]=_0xbcd244[_0x27f099(0x137)]),_0x5aca62;}function buildAggregationDefFromApi(_0x2b5577){const _0x3f54eb=a142_0x54aecb,_0x4ef532=_0x2b5577[_0x3f54eb(0xd0)];if(_0x4ef532===_0x3f54eb(0x103))return{'type':_0x4ef532,'columns':_0x2b5577[_0x3f54eb(0x144)]??[]};if(_0x4ef532===_0x3f54eb(0x138)||_0x4ef532===_0x3f54eb(0x130))return{'type':_0x4ef532,'column':_0x2b5577[_0x3f54eb(0xfc)]??'','orderColumn':_0x2b5577['orderColumn']??'',..._0x2b5577[_0x3f54eb(0xe8)]&&{'groupingColumns':_0x2b5577[_0x3f54eb(0xe8)]}};if(_0x4ef532===_0x3f54eb(0xf6))return{'type':_0x4ef532,..._0x2b5577[_0x3f54eb(0xe8)]&&{'groupingColumns':_0x2b5577[_0x3f54eb(0xe8)]}};return{'type':_0x4ef532,'column':_0x2b5577[_0x3f54eb(0xfc)]??'',..._0x2b5577['groupingColumns']&&{'groupingColumns':_0x2b5577[_0x3f54eb(0xe8)]}};}function buildLeftValue(_0xb579){const _0x1232dd=a142_0x54aecb,_0x1b4702={};_0xb579['attribute']&&_0xb579[_0x1232dd(0xd0)]!=='Behavior'&&(_0x1b4702['name']=_0xb579[_0x1232dd(0x148)]);if(_0xb579[_0x1232dd(0xd5)]){const _0x54fec8=_0xb579[_0x1232dd(0xd5)];if(_0x54fec8[_0x1232dd(0xd0)]===_0x1232dd(0x103))_0x1b4702[_0x1232dd(0xd5)]={'type':_0x1232dd(0x103),'columns':_0x54fec8[_0x1232dd(0x144)]};else{if(_0x54fec8[_0x1232dd(0xd0)]===_0x1232dd(0x138)||_0x54fec8[_0x1232dd(0xd0)]===_0x1232dd(0x130))_0x1b4702['aggregation']={'type':_0x54fec8['type'],'column':_0x54fec8['column'],'orderColumn':_0x54fec8[_0x1232dd(0xef)],..._0x54fec8['groupingColumns']&&{'groupingColumns':_0x54fec8[_0x1232dd(0xe8)]}};else _0x54fec8['type']==='Count'?_0x1b4702[_0x1232dd(0xd5)]={'type':_0x1232dd(0xf6),..._0x54fec8[_0x1232dd(0xe8)]&&{'groupingColumns':_0x54fec8[_0x1232dd(0xe8)]}}:_0x1b4702['aggregation']={'type':_0x54fec8['type'],'column':_0x54fec8[_0x1232dd(0xfc)],..._0x54fec8['groupingColumns']&&{'groupingColumns':_0x54fec8[_0x1232dd(0xe8)]}};}}return _0xb579[_0x1232dd(0x113)]&&(_0x1b4702[_0x1232dd(0x113)]={'name':_0xb579[_0x1232dd(0x113)]}),_0xb579['filter']&&(_0x1b4702[_0x1232dd(0x120)]=yamlFilterRuleToApi(filterRuleAsRuleDef(_0xb579['filter']))),_0x1b4702;}function yamlOperatorToApi(_0x575d97){const _0x28418d=a142_0x54aecb,_0x59045c={'type':mapYamlOperatorType(_0x575d97[_0x28418d(0xd0)]),'not':_0x575d97[_0x28418d(0x124)]??![]};if(isBetweenOperator(_0x575d97[_0x28418d(0xd0)]))return _0x575d97[_0x28418d(0x105)]!==undefined&&(_0x59045c[_0x28418d(0x119)]=typeof _0x575d97[_0x28418d(0x105)]===_0x28418d(0x118)?_0x575d97['min']:String(_0x575d97[_0x28418d(0x105)])),_0x575d97[_0x28418d(0x146)]!==undefined&&(_0x59045c[_0x28418d(0xe9)]=typeof _0x575d97['max']===_0x28418d(0x118)?_0x575d97[_0x28418d(0x146)]:String(_0x575d97[_0x28418d(0x146)])),_0x59045c;if(_0x575d97[_0x28418d(0xd0)]==='TimeRange')return _0x575d97[_0x28418d(0x161)]&&(_0x59045c['duration']=_0x575d97['duration']),_0x575d97['from']&&(_0x59045c[_0x28418d(0x15c)]=_0x575d97[_0x28418d(0x15c)]),_0x575d97['reverse']!==undefined&&(_0x59045c[_0x28418d(0x150)]=_0x575d97[_0x28418d(0x150)]),_0x59045c;const _0x508b3e=getEffectiveValue(_0x575d97);if(_0x508b3e!==undefined){if(Array[_0x28418d(0x108)](_0x508b3e))_0x59045c[_0x28418d(0xc5)]=_0x508b3e;else isTemporalOperator(_0x575d97[_0x28418d(0xd0)])?_0x59045c[_0x28418d(0xf0)]=_0x508b3e:_0x59045c[_0x28418d(0x152)]=_0x508b3e;}return _0x575d97[_0x28418d(0xd7)]&&(_0x59045c[_0x28418d(0xd7)]=_0x575d97['unit']),_0x59045c;}function mapYamlOperatorType(_0x3924db){return _0x3924db;}export function toYamlString(_0xfe9092){const _0x288493=a142_0x54aecb,_0x5a3cc4=JSON[_0x288493(0x131)](JSON[_0x288493(0x15d)](_0xfe9092)),_0xb71305=a142_0x228d11[_0x288493(0x15d)](_0x5a3cc4,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x288493(0xcf)}),_0x307deb=['rule:'];let _0x500c50=_0xb71305;for(const _0x3c7336 of _0x307deb){_0x500c50=_0x500c50[_0x288493(0x134)](new RegExp('^('+_0x3c7336+')','m'),(_0x54f029,_0x55f8cb,_0x31c4df)=>{if(_0x31c4df===0x0||_0x500c50[_0x31c4df-0x1]==='\x0a'&&_0x500c50[_0x31c4df-0x2]==='\x0a')return _0x55f8cb;return'\x0a'+_0x55f8cb;});}return _0x500c50;}export function parseYamlString(_0x42dc9b){return parseSegmentYamlFile(_0x42dc9b);}export function isSegmentYaml(_0x4e63d8){const _0x293e11=a142_0x54aecb;if(typeof _0x4e63d8!==_0x293e11(0x118)||_0x4e63d8===null)return![];const _0x5c7006=_0x4e63d8;return _0x5c7006[_0x293e11(0xd0)]===_0x293e11(0xd8)||_0x5c7006[_0x293e11(0xd0)]===undefined;}function a142_0x23ae(){const _0x25d1bc=['isVisible','shape','notify_on','reverse','connectionNameToIdMap','rightValue','sort','3903EIExvK','include','scheduleType','lockEnabled','__SEGMENT_REF__','Value','connector_config','Warning:\x20activation\x20\x22','from','stringify','61159870juoMtb','repeatFrequency','join','duration','\x20\x20-\x20\x22','string','test','\x22:\x0a','TimeWithinPast','kind','formatting','behavior','connectionId','map','attribute_name','errors','entries','end_on','__UNRESOLVED__','nested_workflow_name','allColumns','].attribute\x20cannot\x20be\x20empty.\x0a','CONNECTOR_SCHEMA_NOT_FOUND','notifyOn','values','push','keys','cron','rightValues','flatMap','description','4984wIgMnC','email_recipients','Between','activation_template_id','conditions','funnel_stage','length','null','type','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','7152888zZwzSs','folder','add','aggregation','\x27:\x20','unit','segment','TimeWithinNext','joinStrategy','resolveSegmentName','conditions[','repeat_sub_frequency','timezone','emailRecipients','any','INVALID_ARGUMENT','localRuleToName','operator','schedule','lock_enabled','repeatSubFrequency','Reference','groupingColumns','maxValue','match','nested_workflow_project_name','has','arrayMatching','set','orderColumn','value','connection','\x22\x20has\x20unrecognized\x20fields\x20(will\x20be\x20ignored):\x0a','warn','daily','all','Count','activationTemplateId','segmentFolderId','minute','132fxrLvp','Segment\x20description','column','endOn','connectionNameToTypeMap','rule:','leftValue','notification','repeat_frequency','CountDistinct','connectorConfig','min','activationParams','syndicationBehavior','isArray','batch','realtime','repeat_unit','rule','Unknown\x20email\x20recipient:\x20','visible','join_row','nestedWorkflowProjectName','hourly','start_at','source','Please\x20specify\x20a\x20valid\x20attribute\x20name.','476ZEXsNT','order_by','14148162oZObjp','object','minValue','visibility','TimeRange','week','CONNECTION_NOT_FOUND','New\x20Segment','Column','filter','day','join_strategy','exclude','not','get','\x0a\x0aAvailable\x20fields:\x0a','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','behaviorTableName','behavior_table','activations','run_after_journey_refresh','runAfterJourneyRefresh','getSchema','nestedWorkflowName','orderBy','Last','parse','name','emailToIdMap','replace','repeatUnit','code','limit','First','120090ifQJWV','warnings','usedNames','And','localeCompare','monthly','3618420ecYlGR','ruleHashToName','every','All','13366DRarpj','columns','attributes','max','timeWindow','attribute','Behavior','startAt','all_columns','joinRow'];a142_0x23ae=function(){return _0x25d1bc;};return a142_0x23ae();}export function generateTemplate(_0x2eaf6e=a142_0x54aecb(0x11e)){const _0xb9a446=a142_0x54aecb,_0x3aceb2={'type':_0xb9a446(0xd8),'name':_0x2eaf6e,'description':_0xb9a446(0xfb),'rule':{'type':_0xb9a446(0x13c),'conditions':[{'type':_0xb9a446(0x159),'attribute':_0xb9a446(0x16c),'operator':{'type':'Equal','value':_0xb9a446(0xf0)}}]}};return toYamlString(_0x3aceb2);}export function segmentToYamlString(_0x326960){const _0x57d39d=a142_0x54aecb,_0x5db453=JSON[_0x57d39d(0x131)](JSON[_0x57d39d(0x15d)](_0x326960)),_0x353b4d=a142_0x228d11[_0x57d39d(0x15d)](_0x5db453,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x57d39d(0xcf)}),_0x5e465e=[_0x57d39d(0xff),'activations:'];let _0x10705c=_0x353b4d;for(const _0x246930 of _0x5e465e){_0x10705c=_0x10705c['replace'](new RegExp('^('+_0x246930+')','m'),(_0x1878e8,_0x5dfe3c,_0x47b5b5)=>{if(_0x47b5b5===0x0||_0x10705c[_0x47b5b5-0x1]==='\x0a'&&_0x10705c[_0x47b5b5-0x2]==='\x0a')return _0x5dfe3c;return'\x0a'+_0x5dfe3c;});}return _0x10705c;}export function parseSegmentYamlFile(_0x5267f5){return safeParseYaml(_0x5267f5,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x533171){const _0x55f995=a142_0x54aecb;return{'type':_0x55f995(0xd8),'name':_0x533171['name'],..._0x533171['description']!==undefined&&{'description':_0x533171['description']},..._0x533171[_0x55f995(0xd3)]!==undefined&&{'folder':_0x533171[_0x55f995(0xd3)]},..._0x533171[_0x55f995(0x10c)]&&{'rule':normalizeRule(_0x533171[_0x55f995(0x10c)])},..._0x533171[_0x55f995(0x167)]!==undefined&&{'kind':_0x533171['kind']},..._0x533171[_0x55f995(0x10e)]!==undefined&&{'visible':_0x533171['visible']},..._0x533171['activations']&&{'activations':_0x533171['activations']['map'](normalizeActivation)}};}export function normalizeRule(_0x5a1245){const _0x6e1cbc=a142_0x54aecb;return{'type':_0x5a1245[_0x6e1cbc(0xd0)],'conditions':_0x5a1245[_0x6e1cbc(0xcc)]['map'](normalizeCondition),..._0x5a1245[_0x6e1cbc(0xc7)]!==undefined&&{'description':_0x5a1245[_0x6e1cbc(0xc7)]}};}function normalizeCondition(_0x5017d1){const _0x84400f=a142_0x54aecb;if('segment'in _0x5017d1&&(_0x5017d1[_0x84400f(0xd0)]==='include'||_0x5017d1[_0x84400f(0xd0)]==='exclude')){const _0x5440c4=_0x5017d1;return{'type':_0x5440c4[_0x84400f(0xd0)],'segment':_0x5440c4[_0x84400f(0xd8)]};}if(_0x5017d1['type']==='And'||_0x5017d1[_0x84400f(0xd0)]==='Or'){const _0x205800=_0x5017d1;return{'type':_0x205800[_0x84400f(0xd0)],'conditions':_0x205800['conditions'][_0x84400f(0x16b)](normalizeCondition),..._0x205800['description']!==undefined&&{'description':_0x205800[_0x84400f(0xc7)]}};}if('column'in _0x5017d1&&_0x5017d1['type']===_0x84400f(0x11f)){const _0x4e167d=_0x5017d1;return{'type':_0x84400f(0x11f),'column':_0x4e167d[_0x84400f(0xfc)],'operator':normalizeOperator(_0x4e167d['operator'])};}if(_0x5017d1[_0x84400f(0xd0)]==='Behavior'){const _0x37f7d9=_0x5017d1;return{'type':_0x84400f(0x149),'attribute':_0x37f7d9[_0x84400f(0x148)],'operator':normalizeOperator(_0x37f7d9[_0x84400f(0xe3)]),..._0x37f7d9[_0x84400f(0xed)]!==undefined&&{'arrayMatching':_0x37f7d9[_0x84400f(0xed)]},..._0x37f7d9[_0x84400f(0x123)]!==undefined&&{'exclude':_0x37f7d9['exclude']},..._0x37f7d9[_0x84400f(0xd5)]!==undefined&&{'aggregation':_0x37f7d9[_0x84400f(0xd5)]},..._0x37f7d9[_0x84400f(0x113)]!==undefined&&{'source':_0x37f7d9[_0x84400f(0x113)]},..._0x37f7d9[_0x84400f(0x120)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x37f7d9['filter'])))},..._0x37f7d9[_0x84400f(0x147)]!==undefined&&{'timeWindow':_0x37f7d9[_0x84400f(0x147)]},..._0x37f7d9['limit']!==undefined&&{'limit':_0x37f7d9[_0x84400f(0x137)]}};}const _0x2bf8b8=_0x5017d1;return{'type':_0x84400f(0x159),'attribute':_0x2bf8b8[_0x84400f(0x148)],'operator':normalizeOperator(_0x2bf8b8['operator']),..._0x2bf8b8[_0x84400f(0xed)]!==undefined&&{'arrayMatching':_0x2bf8b8[_0x84400f(0xed)]},..._0x2bf8b8['exclude']!==undefined&&{'exclude':_0x2bf8b8[_0x84400f(0x123)]},..._0x2bf8b8[_0x84400f(0xd5)]!==undefined&&{'aggregation':_0x2bf8b8[_0x84400f(0xd5)]},..._0x2bf8b8['source']!==undefined&&{'source':_0x2bf8b8['source']},..._0x2bf8b8[_0x84400f(0x120)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x2bf8b8[_0x84400f(0x120)])))},..._0x2bf8b8[_0x84400f(0x137)]!==undefined&&{'limit':_0x2bf8b8[_0x84400f(0x137)]}};}function normalizeOperator(_0x171e04){const _0xb21164=a142_0x54aecb;if(isBetweenOperator(_0x171e04[_0xb21164(0xd0)]))return{'type':_0x171e04[_0xb21164(0xd0)],..._0x171e04['not']!==undefined&&{'not':_0x171e04['not']},..._0x171e04[_0xb21164(0x105)]!==undefined&&{'min':_0x171e04['min']},..._0x171e04[_0xb21164(0x146)]!==undefined&&{'max':_0x171e04[_0xb21164(0x146)]}};const _0x2d246a=getEffectiveValue(_0x171e04);return{'type':_0x171e04['type'],..._0x171e04[_0xb21164(0x124)]!==undefined&&{'not':_0x171e04[_0xb21164(0x124)]},..._0x2d246a!==undefined&&{'value':_0x2d246a},..._0x171e04[_0xb21164(0xd7)]!==undefined&&{'unit':_0x171e04[_0xb21164(0xd7)]},..._0x171e04[_0xb21164(0x161)]!==undefined&&{'duration':_0x171e04[_0xb21164(0x161)]},..._0x171e04[_0xb21164(0x15c)]!==undefined&&{'from':_0x171e04[_0xb21164(0x15c)]},..._0x171e04['reverse']!==undefined&&{'reverse':_0x171e04[_0xb21164(0x150)]}};}function normalizeActivation(_0x5aed91){const _0x4a3f64=a142_0x54aecb;return{'name':_0x5aed91[_0x4a3f64(0x132)],'connection':_0x5aed91[_0x4a3f64(0xf1)],..._0x5aed91[_0x4a3f64(0xc7)]!==undefined&&{'description':_0x5aed91[_0x4a3f64(0xc7)]},..._0x5aed91[_0x4a3f64(0x14b)]!==undefined&&{'all_columns':_0x5aed91['all_columns']},..._0x5aed91[_0x4a3f64(0x144)]!==undefined&&{'columns':_0x5aed91[_0x4a3f64(0x144)]},..._0x5aed91[_0x4a3f64(0x169)]!==undefined&&{'behavior':_0x5aed91[_0x4a3f64(0x169)]},..._0x5aed91[_0x4a3f64(0xe4)]!==undefined&&{'schedule':_0x5aed91[_0x4a3f64(0xe4)]},..._0x5aed91[_0x4a3f64(0x101)]!==undefined&&{'notification':_0x5aed91[_0x4a3f64(0x101)]},..._0x5aed91[_0x4a3f64(0x15a)]!==undefined&&{'connector_config':_0x5aed91[_0x4a3f64(0x15a)]},..._0x5aed91[_0x4a3f64(0xcb)]!==undefined&&{'activation_template_id':_0x5aed91[_0x4a3f64(0xcb)]},..._0x5aed91['nested_workflow_project_name']!==undefined&&{'nested_workflow_project_name':_0x5aed91[_0x4a3f64(0xeb)]},..._0x5aed91['nested_workflow_name']!==undefined&&{'nested_workflow_name':_0x5aed91[_0x4a3f64(0x171)]},..._0x5aed91[_0x4a3f64(0xe5)]!==undefined&&{'lock_enabled':_0x5aed91['lock_enabled']}};}function getColumnName(_0x4c85e3){return _0x4c85e3['column']||_0x4c85e3['name'];}export function activationResponseToDef(_0x20724a,_0x16f9e3,_0x53e4a7){const _0x55f164=a142_0x54aecb,_0x9b0774=_0x20724a['connectionId']||'',_0x4302d0=_0x53e4a7?.[_0x55f164(0x125)](_0x9b0774)??_0x9b0774,_0x30465b={'name':_0x20724a[_0x55f164(0x132)],'connection':_0x4302d0};_0x20724a[_0x55f164(0xc7)]&&(_0x30465b[_0x55f164(0xc7)]=_0x20724a[_0x55f164(0xc7)]);let _0x482906=[];_0x20724a[_0x55f164(0x144)]&&_0x20724a[_0x55f164(0x144)][_0x55f164(0xce)]>0x0&&(_0x482906=_0x20724a[_0x55f164(0x144)][_0x55f164(0x120)](_0x38ffbd=>_0x38ffbd&&getColumnName(_0x38ffbd))[_0x55f164(0x16b)](_0x12d63a=>{const _0x17ec37=_0x55f164,_0x33ad49=getColumnName(_0x12d63a);if(_0x12d63a[_0x17ec37(0xd0)]||_0x12d63a['visibility'])return{'name':_0x33ad49,..._0x12d63a['type']&&{'type':_0x12d63a['type']},..._0x12d63a[_0x17ec37(0x11a)]&&{'visibility':_0x12d63a[_0x17ec37(0x11a)]}};return _0x33ad49;}));_0x482906[_0x55f164(0xce)]>0x0&&(_0x30465b['columns']=_0x482906);_0x20724a['allColumns']!==undefined&&(_0x20724a['allColumns']===![]&&_0x482906[_0x55f164(0xce)]===0x0?_0x30465b['all_columns']=!![]:_0x30465b['all_columns']=_0x20724a[_0x55f164(0x172)]);const _0x1e6806={};let _0x5493ae=![];_0x20724a['scheduleType']&&(_0x1e6806['type']=_0x20724a[_0x55f164(0x156)],_0x5493ae=!![]);_0x20724a[_0x55f164(0x135)]&&(_0x1e6806['repeat_unit']=_0x20724a[_0x55f164(0x135)],_0x5493ae=!![]);_0x20724a[_0x55f164(0x15f)]!==undefined&&_0x20724a['repeatFrequency']!==null&&(_0x1e6806[_0x55f164(0x102)]=_0x20724a['repeatFrequency'],_0x5493ae=!![]);_0x20724a[_0x55f164(0xe6)]&&_0x20724a[_0x55f164(0xe6)][_0x55f164(0xce)]>0x0&&(_0x1e6806['repeat_sub_frequency']=_0x20724a[_0x55f164(0xe6)],_0x5493ae=!![]);_0x20724a[_0x55f164(0x14a)]!==undefined&&(_0x1e6806[_0x55f164(0x112)]=_0x20724a[_0x55f164(0x14a)],_0x5493ae=!![]);_0x20724a[_0x55f164(0xfd)]!==undefined&&(_0x1e6806[_0x55f164(0x16f)]=_0x20724a[_0x55f164(0xfd)],_0x5493ae=!![]);_0x20724a[_0x55f164(0xde)]&&(_0x1e6806[_0x55f164(0xde)]=_0x20724a[_0x55f164(0xde)],_0x5493ae=!![]);_0x5493ae&&(_0x30465b[_0x55f164(0xe4)]=_0x1e6806);(_0x20724a['notifyOn']&&_0x20724a[_0x55f164(0x175)]['length']>0x0||_0x20724a[_0x55f164(0xdf)]&&_0x20724a[_0x55f164(0xdf)][_0x55f164(0xce)]>0x0)&&(_0x30465b[_0x55f164(0x101)]={},_0x20724a[_0x55f164(0x175)]&&_0x20724a['notifyOn'][_0x55f164(0xce)]>0x0&&(_0x30465b[_0x55f164(0x101)]['notify_on']=_0x20724a['notifyOn']),_0x20724a[_0x55f164(0xdf)]&&_0x20724a[_0x55f164(0xdf)]['length']>0x0&&(_0x30465b[_0x55f164(0x101)][_0x55f164(0xc9)]=_0x20724a[_0x55f164(0xdf)]['map'](_0x142813=>{const _0x2e330b=_0x16f9e3?.['get'](_0x142813);return _0x2e330b??String(_0x142813);})));_0x20724a[_0x55f164(0x104)]&&Object[_0x55f164(0xc3)](_0x20724a[_0x55f164(0x104)])[_0x55f164(0xce)]>0x0&&(_0x30465b['connector_config']=normalizeConnectorConfigForYaml(_0x20724a[_0x55f164(0x104)]));_0x20724a[_0x55f164(0xf7)]&&(_0x30465b['activation_template_id']=_0x20724a[_0x55f164(0xf7)]);if(_0x20724a[_0x55f164(0x107)]){const _0x423541={},_0x47fb92=_0x20724a[_0x55f164(0x107)];_0x47fb92['columns']&&_0x47fb92[_0x55f164(0x144)][_0x55f164(0xce)]>0x0&&(_0x423541[_0x55f164(0x144)]=_0x47fb92[_0x55f164(0x144)][_0x55f164(0x120)](_0x5be0b6=>_0x5be0b6&&getColumnName(_0x5be0b6))[_0x55f164(0x16b)](_0xdd5f9e=>({'name':getColumnName(_0xdd5f9e),..._0xdd5f9e[_0x55f164(0xd0)]&&{'type':_0xdd5f9e[_0x55f164(0xd0)]},..._0xdd5f9e[_0x55f164(0x11a)]&&{'visibility':_0xdd5f9e['visibility']}}))),_0x47fb92[_0x55f164(0x128)]&&(_0x423541[_0x55f164(0x129)]=_0x47fb92['behaviorTableName']),_0x47fb92[_0x55f164(0x14c)]!==undefined&&(_0x423541[_0x55f164(0x10f)]=_0x47fb92['joinRow']),_0x47fb92[_0x55f164(0xda)]&&(_0x423541[_0x55f164(0x122)]=_0x47fb92[_0x55f164(0xda)]),_0x47fb92[_0x55f164(0x168)]&&(_0x423541['formatting']=_0x47fb92[_0x55f164(0x168)]),_0x47fb92['orderBy']&&_0x47fb92[_0x55f164(0x12f)][_0x55f164(0xce)]>0x0&&(_0x423541[_0x55f164(0x116)]=_0x47fb92['orderBy']),Object[_0x55f164(0xc3)](_0x423541)[_0x55f164(0xce)]>0x0&&(_0x30465b[_0x55f164(0x169)]=_0x423541);}return _0x20724a[_0x55f164(0x110)]&&(_0x30465b[_0x55f164(0xeb)]=_0x20724a[_0x55f164(0x110)]),_0x20724a[_0x55f164(0x12e)]&&(_0x30465b[_0x55f164(0x171)]=_0x20724a[_0x55f164(0x12e)]),_0x20724a['lockEnabled']!==undefined&&(_0x30465b[_0x55f164(0xe5)]=_0x20724a[_0x55f164(0x157)]),_0x30465b;}export function journeyActivationStepToYaml(_0x2151d5,_0x1516d2,_0x2e35b6){const _0xb0ce24=a142_0x54aecb,_0x384b3c=_0x2151d5[_0xb0ce24(0x145)][_0xb0ce24(0x106)],_0x534dde=_0x384b3c[_0xb0ce24(0x16a)]||'',_0x333346=_0x2e35b6?.[_0xb0ce24(0x125)](_0x534dde)??_0x534dde,_0x1efa68={'name':_0x384b3c['name']||'','connection':_0x333346};_0x2151d5[_0xb0ce24(0x145)][_0xb0ce24(0x12c)]&&(_0x1efa68[_0xb0ce24(0x12b)]=!![]);_0x384b3c[_0xb0ce24(0xc7)]&&(_0x1efa68[_0xb0ce24(0xc7)]=_0x384b3c[_0xb0ce24(0xc7)]);let _0x4f69d2=[];_0x384b3c[_0xb0ce24(0x144)]&&_0x384b3c[_0xb0ce24(0x144)]['length']>0x0&&(_0x4f69d2=_0x384b3c['columns'][_0xb0ce24(0x120)](_0x72ea7e=>_0x72ea7e&&getColumnName(_0x72ea7e))[_0xb0ce24(0x16b)](_0x3d1f21=>{const _0x273f8a=_0xb0ce24,_0x13329d=getColumnName(_0x3d1f21);if(_0x3d1f21[_0x273f8a(0xd0)]||_0x3d1f21['visibility'])return{'name':_0x13329d,..._0x3d1f21[_0x273f8a(0xd0)]&&{'type':_0x3d1f21[_0x273f8a(0xd0)]},..._0x3d1f21['visibility']&&{'visibility':_0x3d1f21[_0x273f8a(0x11a)]}};return _0x13329d;}));_0x4f69d2[_0xb0ce24(0xce)]>0x0&&(_0x1efa68[_0xb0ce24(0x144)]=_0x4f69d2);_0x384b3c[_0xb0ce24(0x172)]!==undefined&&(_0x384b3c['allColumns']===![]&&_0x4f69d2['length']===0x0?_0x1efa68[_0xb0ce24(0x14b)]=!![]:_0x1efa68['all_columns']=_0x384b3c[_0xb0ce24(0x172)]);const _0x1b207f={};let _0x1ef856=![];_0x384b3c[_0xb0ce24(0x156)]&&(_0x1b207f[_0xb0ce24(0xd0)]=_0x384b3c['scheduleType'],_0x1ef856=!![]);_0x384b3c['repeatUnit']&&(_0x1b207f[_0xb0ce24(0x10b)]=_0x384b3c['repeatUnit'],_0x1ef856=!![]);_0x384b3c[_0xb0ce24(0x15f)]!==undefined&&_0x384b3c[_0xb0ce24(0x15f)]!==null&&(_0x1b207f[_0xb0ce24(0x102)]=_0x384b3c[_0xb0ce24(0x15f)],_0x1ef856=!![]);_0x384b3c[_0xb0ce24(0x14a)]!==undefined&&(_0x1b207f[_0xb0ce24(0x112)]=_0x384b3c['startAt'],_0x1ef856=!![]);_0x384b3c['endOn']!==undefined&&(_0x1b207f[_0xb0ce24(0x16f)]=_0x384b3c['endOn'],_0x1ef856=!![]);_0x384b3c[_0xb0ce24(0xde)]&&(_0x1b207f[_0xb0ce24(0xde)]=_0x384b3c[_0xb0ce24(0xde)],_0x1ef856=!![]);_0x1ef856&&(_0x1efa68[_0xb0ce24(0xe4)]=_0x1b207f);(_0x384b3c[_0xb0ce24(0x175)]&&_0x384b3c[_0xb0ce24(0x175)][_0xb0ce24(0xce)]>0x0||_0x384b3c['emailRecipients']&&_0x384b3c['emailRecipients'][_0xb0ce24(0xce)]>0x0)&&(_0x1efa68['notification']={},_0x384b3c[_0xb0ce24(0x175)]&&_0x384b3c[_0xb0ce24(0x175)][_0xb0ce24(0xce)]>0x0&&(_0x1efa68[_0xb0ce24(0x101)][_0xb0ce24(0x14f)]=_0x384b3c[_0xb0ce24(0x175)]),_0x384b3c[_0xb0ce24(0xdf)]&&_0x384b3c[_0xb0ce24(0xdf)][_0xb0ce24(0xce)]>0x0&&(_0x1efa68[_0xb0ce24(0x101)][_0xb0ce24(0xc9)]=_0x384b3c['emailRecipients'][_0xb0ce24(0x16b)](_0xf8d946=>{const _0x550670=_0x1516d2?.['get'](_0xf8d946);return _0x550670??String(_0xf8d946);})));_0x384b3c[_0xb0ce24(0x104)]&&Object['keys'](_0x384b3c[_0xb0ce24(0x104)])[_0xb0ce24(0xce)]>0x0&&(_0x1efa68['connector_config']=normalizeConnectorConfigForYaml(_0x384b3c[_0xb0ce24(0x104)]));_0x384b3c[_0xb0ce24(0xf7)]&&(_0x1efa68[_0xb0ce24(0xcb)]=_0x384b3c[_0xb0ce24(0xf7)]);if(_0x384b3c[_0xb0ce24(0x107)]){const _0xa6c477={},_0x450c1d=_0x384b3c[_0xb0ce24(0x107)];_0x450c1d[_0xb0ce24(0x144)]&&_0x450c1d[_0xb0ce24(0x144)][_0xb0ce24(0xce)]>0x0&&(_0xa6c477['columns']=_0x450c1d[_0xb0ce24(0x144)]['filter'](_0xfff35f=>_0xfff35f&&getColumnName(_0xfff35f))[_0xb0ce24(0x16b)](_0x533424=>({'name':getColumnName(_0x533424),..._0x533424[_0xb0ce24(0xd0)]&&{'type':_0x533424[_0xb0ce24(0xd0)]},..._0x533424[_0xb0ce24(0x11a)]&&{'visibility':_0x533424[_0xb0ce24(0x11a)]}}))),_0x450c1d[_0xb0ce24(0x128)]&&(_0xa6c477[_0xb0ce24(0x129)]=_0x450c1d[_0xb0ce24(0x128)]),_0x450c1d[_0xb0ce24(0x14c)]!==undefined&&(_0xa6c477[_0xb0ce24(0x10f)]=_0x450c1d['joinRow']),_0x450c1d[_0xb0ce24(0xda)]&&(_0xa6c477[_0xb0ce24(0x122)]=_0x450c1d[_0xb0ce24(0xda)]),_0x450c1d['formatting']&&(_0xa6c477[_0xb0ce24(0x168)]=_0x450c1d[_0xb0ce24(0x168)]),_0x450c1d[_0xb0ce24(0x12f)]&&_0x450c1d[_0xb0ce24(0x12f)][_0xb0ce24(0xce)]>0x0&&(_0xa6c477[_0xb0ce24(0x116)]=_0x450c1d[_0xb0ce24(0x12f)]),Object[_0xb0ce24(0xc3)](_0xa6c477)[_0xb0ce24(0xce)]>0x0&&(_0x1efa68['behavior']=_0xa6c477);}return _0x1efa68;}export function segmentWithActivationsToYaml(_0x3ff7dd,_0x389fa4,_0x52991c,_0x10d528,_0x464972){const _0x211196=a142_0x54aecb,_0x4ed4e5=segmentResponseToDefSync(_0x3ff7dd,_0x52991c);return _0x389fa4[_0x211196(0xce)]>0x0&&(_0x4ed4e5[_0x211196(0x12a)]=_0x389fa4[_0x211196(0x16b)](_0x39cf90=>activationResponseToDef(_0x39cf90,_0x10d528,_0x464972))),_0x4ed4e5;}function normalizeColumn(_0x128a76){const _0x31c25f=a142_0x54aecb;if(typeof _0x128a76==='string')return{'column':_0x128a76,'source':{'column':_0x128a76}};return{'column':_0x128a76[_0x31c25f(0x132)],'source':{'column':_0x128a76[_0x31c25f(0x132)]},..._0x128a76['type']&&{'type':_0x128a76[_0x31c25f(0xd0)]},..._0x128a76[_0x31c25f(0x11a)]&&{'visibility':_0x128a76[_0x31c25f(0x11a)]}};}const KNOWN_ACTIVATION_FIELDS=new Set(Object[a142_0x54aecb(0xc3)](ActivationDefSchema[a142_0x54aecb(0x14e)]));export function warnUnrecognizedActivationFields(_0x39da1b,_0x40d2de){const _0x525325=a142_0x54aecb,_0x33ce48=Object[_0x525325(0xc3)](_0x39da1b)[_0x525325(0x120)](_0x5ecf27=>!KNOWN_ACTIVATION_FIELDS[_0x525325(0xec)](_0x5ecf27));if(_0x33ce48[_0x525325(0xce)]>0x0){const _0x4f345e=_0x33ce48[_0x525325(0x16b)](_0x38e351=>_0x525325(0x162)+_0x38e351+'\x22')[_0x525325(0x160)]('\x0a');console[_0x525325(0xf3)](_0x525325(0x15b)+_0x40d2de+_0x525325(0xf2)+_0x4f345e);}}export async function activationDefToCreateRequest(_0x2dc660,_0x235a93){const _0x2f9066=a142_0x54aecb;warnUnrecognizedActivationFields(_0x2dc660,_0x2dc660[_0x2f9066(0x132)]);const _0x597b87=_0x235a93?.[_0x2f9066(0x133)],_0x45d04a=_0x235a93?.[_0x2f9066(0x151)],_0x294e68=_0x2dc660[_0x2f9066(0xf1)];let _0x156527;const _0x453a45=parseInt(_0x294e68,0xa);if(!isNaN(_0x453a45)&&String(_0x453a45)===_0x294e68)_0x156527=_0x453a45;else{const _0x33fd55=_0x45d04a?.['get'](_0x294e68);if(_0x33fd55===undefined)throw new SDKError(ErrorCode[_0x2f9066(0x11d)],'Unknown\x20connection:\x20'+_0x294e68,undefined,{'helpText':_0x2f9066(0xd1)});_0x156527=_0x33fd55;}const _0x579d35={'name':_0x2dc660[_0x2f9066(0x132)],'connectionId':_0x156527};_0x2dc660[_0x2f9066(0xc7)]&&(_0x579d35[_0x2f9066(0xc7)]=_0x2dc660[_0x2f9066(0xc7)]);let _0x3c2e75=[];_0x2dc660[_0x2f9066(0x144)]&&_0x2dc660[_0x2f9066(0x144)][_0x2f9066(0xce)]>0x0&&(_0x3c2e75=_0x2dc660[_0x2f9066(0x144)]['filter'](_0x155537=>_0x155537!=null)[_0x2f9066(0x16b)](normalizeColumn));_0x3c2e75[_0x2f9066(0xce)]>0x0&&(_0x579d35[_0x2f9066(0x144)]=_0x3c2e75);_0x2dc660[_0x2f9066(0x14b)]!==undefined&&(_0x2dc660[_0x2f9066(0x14b)]===![]&&_0x3c2e75[_0x2f9066(0xce)]===0x0?_0x579d35['allColumns']=!![]:_0x579d35['allColumns']=_0x2dc660[_0x2f9066(0x14b)]);if(_0x2dc660[_0x2f9066(0xe4)]){const _0x1a9d36=_0x2dc660[_0x2f9066(0xe4)],_0x108461=_0x1a9d36['type']??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x1a9d36[_0x2f9066(0x10b)]];_0x108461&&(_0x579d35['scheduleType']=_0x108461);const _0x3437e2=_0x1a9d36[_0x2f9066(0x10b)]??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x1a9d36[_0x2f9066(0xd0)]];_0x3437e2&&(_0x579d35[_0x2f9066(0x135)]=_0x3437e2);_0x1a9d36[_0x2f9066(0x102)]!==undefined&&(_0x579d35[_0x2f9066(0x15f)]=_0x1a9d36[_0x2f9066(0x102)]);_0x1a9d36[_0x2f9066(0xdd)]&&(_0x579d35[_0x2f9066(0xe6)]=_0x1a9d36['repeat_sub_frequency']);_0x1a9d36[_0x2f9066(0x112)]!==undefined&&(_0x579d35['startAt']=_0x1a9d36[_0x2f9066(0x112)]);_0x1a9d36[_0x2f9066(0x16f)]!==undefined&&(_0x579d35[_0x2f9066(0xfd)]=_0x1a9d36['end_on']);_0x1a9d36[_0x2f9066(0xde)]&&(_0x579d35[_0x2f9066(0xde)]=_0x1a9d36[_0x2f9066(0xde)]);if(_0x108461&&_0x108461!=='none'&&_0x108461!==_0x2f9066(0xc4)&&_0x1a9d36[_0x2f9066(0x112)]){const _0x227f0c=_0x1a9d36[_0x2f9066(0x112)][_0x2f9066(0xea)](/T(\d{2}:\d{2})/);_0x227f0c&&(_0x579d35['scheduleOption']=_0x227f0c[0x1]);}}_0x2dc660['notification']&&(_0x2dc660[_0x2f9066(0x101)][_0x2f9066(0x14f)]&&(_0x579d35['notifyOn']=_0x2dc660[_0x2f9066(0x101)][_0x2f9066(0x14f)]),_0x2dc660[_0x2f9066(0x101)][_0x2f9066(0xc9)]&&(_0x579d35['emailRecipients']=_0x2dc660[_0x2f9066(0x101)][_0x2f9066(0xc9)][_0x2f9066(0x16b)](_0x3585b1=>{const _0x3f9c77=_0x2f9066,_0x48c252=Number(_0x3585b1);if(!isNaN(_0x48c252)&&String(_0x48c252)===_0x3585b1)return _0x48c252;const _0x20a648=_0x597b87?.['get'](_0x3585b1['toLowerCase']());if(_0x20a648===undefined)throw new SDKError(ErrorCode[_0x3f9c77(0xe1)],_0x3f9c77(0x10d)+_0x3585b1+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x20a648;})));if(_0x2dc660[_0x2f9066(0x15a)]){const _0x55cfa7=_0x235a93?.[_0x2f9066(0xfe)]?.[_0x2f9066(0x125)](_0x294e68);if(_0x55cfa7&&_0x235a93?.[_0x2f9066(0x12d)])try{const _0x379564=await _0x235a93[_0x2f9066(0x12d)](_0x55cfa7),_0x298444=validateConnectorConfig(_0x2dc660[_0x2f9066(0x15a)],_0x379564);if(!_0x298444['valid'])throw new SDKError(ErrorCode['CONNECTOR_INVALID_CONFIG'],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x2dc660[_0x2f9066(0x132)]+_0x2f9066(0x165)+formatValidationErrors(_0x298444[_0x2f9066(0x16d)]),undefined,{'helpText':'Connector:\x20'+_0x55cfa7+_0x2f9066(0x126)+formatSchemaAsHelp(_0x379564)});if(_0x298444[_0x2f9066(0x13a)][_0x2f9066(0xce)]>0x0){const _0x25d6b9=formatValidationWarnings(_0x298444[_0x2f9066(0x13a)]);console[_0x2f9066(0xf3)]('connector_config\x20for\x20activation\x20\x22'+_0x2dc660[_0x2f9066(0x132)]+_0x2f9066(0x165)+_0x25d6b9);}_0x579d35[_0x2f9066(0x104)]=transformConfigToLegacy(_0x2dc660[_0x2f9066(0x15a)],_0x379564);}catch(_0x406e55){if(_0x406e55 instanceof SDKError&&_0x406e55[_0x2f9066(0x136)]===ErrorCode[_0x2f9066(0x174)])_0x579d35[_0x2f9066(0x104)]=_0x2dc660[_0x2f9066(0x15a)];else throw _0x406e55;}else _0x579d35[_0x2f9066(0x104)]=_0x2dc660[_0x2f9066(0x15a)];}_0x2dc660['activation_template_id']!==undefined&&(_0x579d35[_0x2f9066(0xf7)]=_0x2dc660[_0x2f9066(0xcb)]);if(_0x2dc660[_0x2f9066(0x169)]){const _0x549e18=_0x2dc660['behavior'],_0x2827d0={};if(_0x549e18[_0x2f9066(0x144)]&&_0x549e18[_0x2f9066(0x144)]['length']>0x0){const _0x2ecd4f=_0x549e18['columns'][_0x2f9066(0x120)](_0x52f957=>_0x52f957&&_0x52f957[_0x2f9066(0x132)])[_0x2f9066(0x16b)](normalizeColumn);_0x2ecd4f['length']>0x0&&(_0x2827d0[_0x2f9066(0x144)]=_0x2ecd4f);}_0x549e18['behavior_table']&&(_0x2827d0[_0x2f9066(0x128)]=_0x549e18[_0x2f9066(0x129)]);_0x549e18['join_strategy']&&(_0x2827d0['joinStrategy']=_0x549e18[_0x2f9066(0x122)]);if(_0x549e18[_0x2f9066(0x10f)]!==undefined)_0x2827d0[_0x2f9066(0x14c)]=_0x549e18[_0x2f9066(0x10f)];else{if(_0x549e18[_0x2f9066(0x122)]===_0x2f9066(0x130)||_0x549e18[_0x2f9066(0x122)]===_0x2f9066(0x138))_0x2827d0['joinRow']=0x1;else _0x549e18[_0x2f9066(0x122)]===_0x2f9066(0x142)&&(_0x2827d0[_0x2f9066(0x14c)]=null);}_0x549e18['formatting']&&(_0x2827d0[_0x2f9066(0x168)]=_0x549e18['formatting']),_0x549e18[_0x2f9066(0x116)]&&(_0x2827d0[_0x2f9066(0x12f)]=_0x549e18['order_by']),_0x579d35['syndicationBehavior']=_0x2827d0;}return _0x2dc660[_0x2f9066(0xeb)]&&(_0x579d35[_0x2f9066(0x110)]=_0x2dc660[_0x2f9066(0xeb)]),_0x2dc660[_0x2f9066(0x171)]&&(_0x579d35[_0x2f9066(0x12e)]=_0x2dc660[_0x2f9066(0x171)]),_0x2dc660[_0x2f9066(0xe5)]!==undefined&&(_0x579d35[_0x2f9066(0x157)]=_0x2dc660['lock_enabled']),_0x579d35;}export async function activationDefToUpdateRequest(_0x384a93,_0x27e299){return activationDefToCreateRequest(_0x384a93,_0x27e299);}export function deepSortObject(_0x4d3dd6){const _0x1974c2=a142_0x54aecb;if(_0x4d3dd6===null||typeof _0x4d3dd6!==_0x1974c2(0x118))return _0x4d3dd6;if(Array[_0x1974c2(0x108)](_0x4d3dd6))return _0x4d3dd6[_0x1974c2(0x16b)](deepSortObject)['sort']((_0x2bcc28,_0x33aa62)=>JSON[_0x1974c2(0x15d)](_0x2bcc28)[_0x1974c2(0x13d)](JSON[_0x1974c2(0x15d)](_0x33aa62)));const _0x48a957={};for(const _0x3f9933 of Object['keys'](_0x4d3dd6)[_0x1974c2(0x153)]()){_0x48a957[_0x3f9933]=deepSortObject(_0x4d3dd6[_0x3f9933]);}return _0x48a957;}export function serializeRule(_0x14a5fb){const _0xf917c5=a142_0x54aecb;return JSON[_0xf917c5(0x15d)](deepSortObject(_0x14a5fb));}export function normalizeRuleForMatching(_0x41bfe9){return normalizeConditionsForMatching(_0x41bfe9);}function normalizeConditionsForMatching(_0x18abf4){const _0x3b560e=a142_0x54aecb;if(_0x18abf4===null||typeof _0x18abf4!==_0x3b560e(0x118))return _0x18abf4;if(Array[_0x3b560e(0x108)](_0x18abf4))return _0x18abf4[_0x3b560e(0x16b)](normalizeConditionsForMatching);const _0xcf5284=_0x18abf4;if((_0xcf5284['type']===_0x3b560e(0x155)||_0xcf5284[_0x3b560e(0xd0)]===_0x3b560e(0x123))&&typeof _0xcf5284[_0x3b560e(0xd8)]===_0x3b560e(0x163))return{..._0xcf5284,'segment':_0x3b560e(0x158)};const _0x50bc46={};for(const _0x183415 of Object[_0x3b560e(0xc3)](_0xcf5284)){_0x50bc46[_0x183415]=normalizeConditionsForMatching(_0xcf5284[_0x183415]);}return _0x50bc46;}export function serializeRuleForMatching(_0x37ab74){const _0x4b3acf=a142_0x54aecb;return JSON[_0x4b3acf(0x15d)](deepSortObject(normalizeRuleForMatching(_0x37ab74)));}export function expandSegmentReferences(_0x5726f5,_0x5befe8,_0x43d4bd=new Set()){return expandConditions(_0x5726f5,_0x5befe8,_0x43d4bd);}function expandConditions(_0x54e87b,_0x1b04b3,_0x1ffc5d){const _0x30c15e=a142_0x54aecb;if(_0x54e87b===null||typeof _0x54e87b!==_0x30c15e(0x118))return _0x54e87b;if(Array[_0x30c15e(0x108)](_0x54e87b))return _0x54e87b['map'](_0x1f9eb4=>expandConditions(_0x1f9eb4,_0x1b04b3,_0x1ffc5d));const _0x4cb22c=_0x54e87b;if((_0x4cb22c[_0x30c15e(0xd0)]==='include'||_0x4cb22c[_0x30c15e(0xd0)]==='exclude')&&typeof _0x4cb22c[_0x30c15e(0xd8)]===_0x30c15e(0x163)){const _0x4d5391=_0x4cb22c[_0x30c15e(0xd8)],_0x29bca2=_0x1b04b3[_0x30c15e(0x125)](_0x4d5391);if(_0x29bca2&&!_0x1ffc5d[_0x30c15e(0xec)](_0x4d5391)){const _0x235a79=new Set(_0x1ffc5d);_0x235a79[_0x30c15e(0xd4)](_0x4d5391);const _0x493a32=expandConditions(_0x29bca2,_0x1b04b3,_0x235a79);return{'type':_0x4cb22c[_0x30c15e(0xd0)],'expanded_rule':_0x493a32};}return{'type':_0x4cb22c[_0x30c15e(0xd0)],'expanded_rule':_0x30c15e(0x170)};}const _0x2b24d7={};for(const _0x13150b of Object[_0x30c15e(0xc3)](_0x4cb22c)){_0x2b24d7[_0x13150b]=expandConditions(_0x4cb22c[_0x13150b],_0x1b04b3,_0x1ffc5d);}return _0x2b24d7;}export function serializeExpandedRule(_0x45562a,_0x4d509c){const _0x1e7e6d=a142_0x54aecb,_0x1156bc=expandSegmentReferences(_0x45562a,_0x4d509c);return JSON[_0x1e7e6d(0x15d)](deepSortObject(_0x1156bc));}export function createSegmentNameContext(_0x37f8b4){const _0x5b0185=a142_0x54aecb,_0x2f7d95=new Set(),_0x1b1a54=new Map(),_0x41f736=new Map();if(_0x37f8b4)for(const [_0x332fad,_0x4de064]of Object[_0x5b0185(0x16e)](_0x37f8b4)){if(_0x4de064[_0x5b0185(0x10c)]){const _0x57a02b=serializeRule(_0x4de064['rule']);_0x41f736['set'](_0x57a02b,_0x332fad),_0x2f7d95[_0x5b0185(0xd4)](_0x332fad);}}return{'usedNames':_0x2f7d95,'ruleHashToName':_0x1b1a54,'localRuleToName':_0x37f8b4?_0x41f736:undefined};}export function resolveSegmentName(_0x5430fc,_0x234538,_0x543df7,_0x4de3b2){const _0x2cf9ca=a142_0x54aecb,_0x524263=serializeRule(_0x234538);if(_0x543df7[_0x2cf9ca(0xe2)]){const _0x8c5dd=_0x543df7[_0x2cf9ca(0xe2)][_0x2cf9ca(0x125)](_0x524263);if(_0x8c5dd)return{'name':_0x8c5dd,'isDuplicate':![],'isLocalMatch':!![]};}const _0x1c027a=_0x543df7[_0x2cf9ca(0x140)][_0x2cf9ca(0x125)](_0x524263);if(_0x1c027a)return{'name':_0x1c027a,'isDuplicate':!![],'isLocalMatch':![]};const _0x4a9fdb=_0x4de3b2(_0x5430fc);let _0x4e4896=_0x4a9fdb||_0x5430fc,_0x1f46b2=_0x4e4896,_0x1a49c3=0x2;while(_0x543df7[_0x2cf9ca(0x13b)][_0x2cf9ca(0xec)](_0x1f46b2)){_0x1f46b2=_0x4e4896+'_'+_0x1a49c3,_0x1a49c3++;}return _0x543df7['usedNames'][_0x2cf9ca(0xd4)](_0x1f46b2),_0x543df7['ruleHashToName'][_0x2cf9ca(0xee)](_0x524263,_0x1f46b2),{'name':_0x1f46b2,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x3deac0){const _0xcd9882=[],_0x436b46=_0x2fa95a=>{const _0x571b41=a142_0x327e;if(!_0x2fa95a||typeof _0x2fa95a!==_0x571b41(0x118))return;if(Array[_0x571b41(0x108)](_0x2fa95a)){_0x2fa95a['forEach'](_0x436b46);return;}const _0x54ab2e=_0x2fa95a;(_0x54ab2e[_0x571b41(0xd0)]===_0x571b41(0x155)||_0x54ab2e[_0x571b41(0xd0)]==='exclude')&&typeof _0x54ab2e[_0x571b41(0xd8)]===_0x571b41(0x163)&&_0xcd9882[_0x571b41(0x177)](_0x54ab2e[_0x571b41(0xd8)]);for(const _0x50e065 of Object[_0x571b41(0x176)](_0x54ab2e)){_0x436b46(_0x50e065);}};return _0x436b46(_0x3deac0),_0xcd9882;}export function validateSegmentRule(_0x4e50c8,_0x545bc4){const _0x59004e=a142_0x54aecb;if(!_0x545bc4||!_0x545bc4[_0x59004e(0xcc)])return;for(let _0x2b253a=0x0;_0x2b253a<_0x545bc4[_0x59004e(0xcc)][_0x59004e(0xce)];_0x2b253a++){const _0x5e8a01=_0x545bc4['conditions'][_0x2b253a];if(_0x59004e(0xd0)in _0x5e8a01&&_0x5e8a01[_0x59004e(0xd0)]==='Value'){const _0x8110b=_0x5e8a01,_0x384e87=_0x8110b['source']||_0x8110b[_0x59004e(0xd5)];if((!_0x8110b[_0x59004e(0x148)]||_0x8110b[_0x59004e(0x148)]==='')&&!_0x384e87)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x59004e(0x127)+_0x4e50c8+_0x59004e(0xd6)+(_0x59004e(0xdc)+_0x2b253a+_0x59004e(0x173))+_0x59004e(0x114));}}}
@@ -1 +1 @@
1
- (function(_0x33211e,_0x33bc9d){const _0x44692f=a143_0x2ee4,_0x27680d=_0x33211e();while(!![]){try{const _0x54a13e=parseInt(_0x44692f(0x14b))/0x1+-parseInt(_0x44692f(0x13f))/0x2+-parseInt(_0x44692f(0x14a))/0x3*(-parseInt(_0x44692f(0x12f))/0x4)+-parseInt(_0x44692f(0x133))/0x5*(-parseInt(_0x44692f(0x14c))/0x6)+-parseInt(_0x44692f(0x138))/0x7*(-parseInt(_0x44692f(0x125))/0x8)+parseInt(_0x44692f(0x137))/0x9*(parseInt(_0x44692f(0x135))/0xa)+parseInt(_0x44692f(0x122))/0xb*(-parseInt(_0x44692f(0x144))/0xc);if(_0x54a13e===_0x33bc9d)break;else _0x27680d['push'](_0x27680d['shift']());}catch(_0x504269){_0x27680d['push'](_0x27680d['shift']());}}}(a143_0x4aed,0xe735e));import a143_0x25d9d2 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x179566){const _0x5e5e2e=a143_0x2ee4,_0x151ff2=_0x179566[_0x5e5e2e(0x146)]['map'](_0x1fb461=>({'column_name':_0x1fb461[_0x5e5e2e(0x134)],'column_type':_0x1fb461[_0x5e5e2e(0x131)],'null':'YES','key':null,'default':null,'extra':null}));return{..._0x179566,'columns':[{'name':_0x5e5e2e(0x130),'type':_0x5e5e2e(0x149)},{'name':_0x5e5e2e(0x145),'type':'varchar'},{'name':_0x5e5e2e(0x154),'type':_0x5e5e2e(0x149)},{'name':'key','type':'varchar'},{'name':'default','type':_0x5e5e2e(0x149)},{'name':_0x5e5e2e(0x12e),'type':_0x5e5e2e(0x149)}],'data':_0x151ff2};}export async function executeSchemaQuery(_0x13b9a7,_0x396528,_0x4b83b8){const _0x2d0626=a143_0x2ee4,_0x52cf5f=_0x13b9a7['trim']()[_0x2d0626(0x151)](/;+$/,''),_0x50aad0=_0x2d0626(0x141)+_0x52cf5f+'\x0a)\x20AS\x20segment_query\x20LIMIT\x200';_0x4b83b8['verbose']&&console[_0x2d0626(0x129)]('Schema\x20query:\x0a'+_0x50aad0);const _0x575448=await withProgressSpinner(_0x2d0626(0x12d),async _0x41af69=>{const _0x116607=_0x2d0626,_0x333ada=await _0x396528[_0x116607(0x14f)][_0x116607(0x127)](_0x50aad0,{'catalog':'td','schema':_0x116607(0x13b),'onJobId':_0xf023b5=>{_0x41af69['setJobId'](_0xf023b5);}});return _0x333ada;},{'verbose':_0x4b83b8['verbose']});return buildSchemaResult(_0x575448[_0x2d0626(0x143)]);}function columnName(_0x220d81){const _0x529718=a143_0x2ee4;return _0x220d81['matrixColumnName']||_0x220d81[_0x529718(0x120)]||_0x220d81[_0x529718(0x134)];}function a143_0x2ee4(_0x26dcaa,_0x209edf){_0x26dcaa=_0x26dcaa-0x11e;const _0x4aed8a=a143_0x4aed();let _0x2ee4e2=_0x4aed8a[_0x26dcaa];return _0x2ee4e2;}function a143_0x4aed(){const _0x4cf754=['matrixColumnName','attribute','null','Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).','behavior','parentColumn','size','2623027juEHvj','push','displayName','4821064khRxLv','dim','execute','sort','error','Attributes','fields','matrixTableName','Fetching\x20schema...','extra','5384cWemjb','column_name','type','cyan','121460KNpZXF','name','14470miwiSC','\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.','8271ReomYT','21wQETxl','length','parentTableName','information_schema','some','localeCompare','entries','2831956ooFEvL','filter','SELECT\x20*\x20FROM\x20(\x0a','tableName','data','276vycrSC','column_type','columns','bold','slice','varchar','3516sYAVgB','1407591xpQVSe','426DTrhdi','get','\x20\x20\x20\x20','query','source','replace'];a143_0x4aed=function(){return _0x4cf754;};return a143_0x4aed();}function formatFieldLine(_0x1cf4af,_0x23a7fd,_0x247b6c){const _0x53d7fb=a143_0x2ee4,_0x594778=_0x1cf4af!==_0x23a7fd?'\x20'+a143_0x25d9d2[_0x53d7fb(0x126)]('('+_0x23a7fd+')'):'';return _0x53d7fb(0x14e)+_0x1cf4af+_0x594778+':\x20'+a143_0x25d9d2[_0x53d7fb(0x132)](_0x247b6c);}function sortByColumnName(_0x5bf00d){const _0x3288d2=a143_0x2ee4;return[..._0x5bf00d][_0x3288d2(0x128)]((_0x111f37,_0x3399db)=>columnName(_0x111f37)[_0x3288d2(0x13d)](columnName(_0x3399db)));}export function displayFieldsHumanReadable(_0x29c0af,_0x38f539){const _0x459184=a143_0x2ee4,_0x54e0a3=_0x29c0af[_0x459184(0x140)](_0x40d684=>_0x40d684[_0x459184(0x150)]===_0x459184(0x153)),_0x1a9197=_0x29c0af[_0x459184(0x140)](_0x5aad83=>_0x5aad83[_0x459184(0x150)]===_0x459184(0x11f)),_0x5eb106=new Map();for(const _0x58d4a8 of _0x54e0a3){const _0x2157f7=_0x58d4a8['groupingName']||_0x58d4a8[_0x459184(0x13a)]||'Unknown',_0xaeb623=_0x5eb106[_0x459184(0x14d)](_0x2157f7);_0xaeb623?_0xaeb623[_0x459184(0x12b)]['push'](_0x58d4a8):_0x5eb106['set'](_0x2157f7,{'displayName':_0x2157f7,'tableName':_0x58d4a8[_0x459184(0x13a)],'fields':[_0x58d4a8]});}const _0xa5e2aa=new Map();for(const _0x12a521 of _0x1a9197){const _0x5d627b=_0x12a521['behaviorName']||'Unknown',_0x3b0067=_0xa5e2aa[_0x459184(0x14d)](_0x5d627b)||[];_0x3b0067[_0x459184(0x123)](_0x12a521),_0xa5e2aa['set'](_0x5d627b,_0x3b0067);}console[_0x459184(0x129)]('\x0a'+a143_0x25d9d2[_0x459184(0x147)](_0x38f539));if(_0x5eb106[_0x459184(0x121)]>0x0){console[_0x459184(0x129)]('\x0a'+a143_0x25d9d2[_0x459184(0x126)](_0x459184(0x12a)));const _0x4f76cc=[..._0x5eb106[_0x459184(0x13e)]()][_0x459184(0x128)]((_0x50344e,_0x349aac)=>_0x50344e[0x0][_0x459184(0x13d)](_0x349aac[0x0]));for(const [,_0x347ec5]of _0x4f76cc){const _0x1985ff=_0x347ec5[_0x459184(0x142)]&&_0x347ec5[_0x459184(0x142)]!==_0x347ec5[_0x459184(0x124)]?'\x20'+a143_0x25d9d2[_0x459184(0x126)]('('+_0x347ec5[_0x459184(0x142)]+')'):'';console[_0x459184(0x129)]('\x20\x20'+a143_0x25d9d2[_0x459184(0x147)](_0x347ec5[_0x459184(0x124)])+_0x1985ff);for(const _0x36040f of sortByColumnName(_0x347ec5[_0x459184(0x12b)])){console[_0x459184(0x129)](formatFieldLine(columnName(_0x36040f),_0x36040f['name'],_0x36040f[_0x459184(0x131)]));}}}if(_0xa5e2aa[_0x459184(0x121)]>0x0){console[_0x459184(0x129)]('\x0a'+a143_0x25d9d2['dim']('Behaviors'));const _0x5c5afc=[..._0xa5e2aa[_0x459184(0x13e)]()][_0x459184(0x128)]((_0x4c417b,_0x1f35d7)=>_0x4c417b[0x0][_0x459184(0x13d)](_0x1f35d7[0x0]));for(const [_0x53ef3a,_0x237209]of _0x5c5afc){const _0x5efd95=_0x237209[0x0],_0x11b294=_0x5efd95?.[_0x459184(0x12c)];if(_0x11b294){const _0x542a56=_0x11b294!==_0x53ef3a?'\x20'+a143_0x25d9d2[_0x459184(0x126)]('('+_0x53ef3a+')'):'';console[_0x459184(0x129)]('\x20\x20'+a143_0x25d9d2[_0x459184(0x147)](_0x11b294)+_0x542a56);}else{const _0x5c68ad=_0x5efd95?.[_0x459184(0x13a)]||'';console[_0x459184(0x129)]('\x20\x20'+a143_0x25d9d2[_0x459184(0x147)](_0x53ef3a)+(_0x5c68ad?'\x20'+a143_0x25d9d2[_0x459184(0x126)]('('+_0x5c68ad+')'):''));}for(const _0x4f0c4e of sortByColumnName(_0x237209)){const _0x45bbbc=_0x4f0c4e['name']['startsWith'](_0x53ef3a+'.')?_0x4f0c4e['name'][_0x459184(0x148)](_0x53ef3a[_0x459184(0x139)]+0x1):_0x4f0c4e[_0x459184(0x134)];console[_0x459184(0x129)](formatFieldLine(columnName(_0x4f0c4e),_0x45bbbc,_0x4f0c4e['type']));}}}const _0x13d94f=_0x29c0af[_0x459184(0x13c)](_0x1d3428=>_0x1d3428[_0x459184(0x152)]||_0x1d3428['matrixTableName']);_0x13d94f&&(console[_0x459184(0x129)]('\x0a'+a143_0x25d9d2[_0x459184(0x126)](_0x459184(0x11e))),console[_0x459184(0x129)](a143_0x25d9d2[_0x459184(0x126)](_0x459184(0x136)))),console[_0x459184(0x129)]('');}
1
+ (function(_0x2b7e81,_0x16f9f4){const _0x30b150=a143_0x2913,_0x1b5752=_0x2b7e81();while(!![]){try{const _0x548a82=-parseInt(_0x30b150(0x187))/0x1+parseInt(_0x30b150(0x160))/0x2*(parseInt(_0x30b150(0x159))/0x3)+parseInt(_0x30b150(0x18a))/0x4*(parseInt(_0x30b150(0x192))/0x5)+parseInt(_0x30b150(0x173))/0x6+-parseInt(_0x30b150(0x195))/0x7*(parseInt(_0x30b150(0x166))/0x8)+parseInt(_0x30b150(0x17b))/0x9+parseInt(_0x30b150(0x16b))/0xa*(-parseInt(_0x30b150(0x168))/0xb);if(_0x548a82===_0x16f9f4)break;else _0x1b5752['push'](_0x1b5752['shift']());}catch(_0xb3a7e5){_0x1b5752['push'](_0x1b5752['shift']());}}}(a143_0x2a64,0xbad04));import a143_0x21ad64 from'chalk';function a143_0x2a64(){const _0x125efe=['Unknown','data','YES','behaviorName','65KfIUbw','map','slice','7oqCBbL','Fetching\x20schema...','Behaviors','parentTableName','column_name','36FUvkMV','source','default','size','length','fields','\x20\x20\x20\x20','185830jyMTve','Schema\x20query:\x0a','filter','get','behavior','trim','8357512FXajjS','Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).','1621114SOePFO','groupingName','sort','160QpTJvw','columns','execute','key','set','query','Attributes','startsWith','8390004dNEpco','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','entries','verbose','varchar','replace','type','dim','12646143rDMjKF','push','bold','tableName','matrixTableName','extra','some','displayName','error','attribute','null','name','351232Mukkjn','localeCompare','parentColumn','184816LMmyZg','SELECT\x20*\x20FROM\x20(\x0a','matrixColumnName','column_type'];a143_0x2a64=function(){return _0x125efe;};return a143_0x2a64();}import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x525416){const _0x3358bc=a143_0x2913,_0x59c796=_0x525416[_0x3358bc(0x16c)][_0x3358bc(0x193)](_0x2fa89a=>({'column_name':_0x2fa89a[_0x3358bc(0x186)],'column_type':_0x2fa89a[_0x3358bc(0x179)],'null':_0x3358bc(0x190),'key':null,'default':null,'extra':null}));return{..._0x525416,'columns':[{'name':_0x3358bc(0x158),'type':'varchar'},{'name':_0x3358bc(0x18d),'type':'varchar'},{'name':_0x3358bc(0x185),'type':_0x3358bc(0x177)},{'name':_0x3358bc(0x16e),'type':_0x3358bc(0x177)},{'name':_0x3358bc(0x15b),'type':_0x3358bc(0x177)},{'name':_0x3358bc(0x180),'type':_0x3358bc(0x177)}],'data':_0x59c796};}export async function executeSchemaQuery(_0x2fc930,_0x2e26ea,_0x1cd9c1){const _0x4c7a4d=a143_0x2913,_0x533827=_0x2fc930[_0x4c7a4d(0x165)]()[_0x4c7a4d(0x178)](/;+$/,''),_0xa29b27=_0x4c7a4d(0x18b)+_0x533827+_0x4c7a4d(0x174);_0x1cd9c1[_0x4c7a4d(0x176)]&&console[_0x4c7a4d(0x183)](_0x4c7a4d(0x161)+_0xa29b27);const _0x5da8fd=await withProgressSpinner(_0x4c7a4d(0x196),async _0x173937=>{const _0x458d80=_0x4c7a4d,_0x178ea=await _0x2e26ea[_0x458d80(0x170)][_0x458d80(0x16d)](_0xa29b27,{'catalog':'td','schema':'information_schema','onJobId':_0xf4eb8=>{_0x173937['setJobId'](_0xf4eb8);}});return _0x178ea;},{'verbose':_0x1cd9c1[_0x4c7a4d(0x176)]});return buildSchemaResult(_0x5da8fd[_0x4c7a4d(0x18f)]);}function columnName(_0x5a7dbf){const _0x5dfc50=a143_0x2913;return _0x5a7dbf[_0x5dfc50(0x18c)]||_0x5a7dbf[_0x5dfc50(0x189)]||_0x5a7dbf[_0x5dfc50(0x186)];}function a143_0x2913(_0xbac6b3,_0x3deaab){_0xbac6b3=_0xbac6b3-0x158;const _0x2a6433=a143_0x2a64();let _0x2913bc=_0x2a6433[_0xbac6b3];return _0x2913bc;}function formatFieldLine(_0x3fd0d8,_0x262ce0,_0x571b56){const _0x17cbe8=a143_0x2913,_0x3435c4=_0x3fd0d8!==_0x262ce0?'\x20'+a143_0x21ad64[_0x17cbe8(0x17a)]('('+_0x262ce0+')'):'';return _0x17cbe8(0x15f)+_0x3fd0d8+_0x3435c4+':\x20'+a143_0x21ad64['cyan'](_0x571b56);}function sortByColumnName(_0x9d56dc){const _0xa4a091=a143_0x2913;return[..._0x9d56dc][_0xa4a091(0x16a)]((_0x161d8e,_0x1a06eb)=>columnName(_0x161d8e)[_0xa4a091(0x188)](columnName(_0x1a06eb)));}export function displayFieldsHumanReadable(_0x40bd67,_0x2f7491){const _0xd9cdd2=a143_0x2913,_0x57038a=_0x40bd67['filter'](_0x38c320=>_0x38c320[_0xd9cdd2(0x15a)]===_0xd9cdd2(0x184)),_0x315573=_0x40bd67[_0xd9cdd2(0x162)](_0x4bbbec=>_0x4bbbec[_0xd9cdd2(0x15a)]===_0xd9cdd2(0x164)),_0x5c4135=new Map();for(const _0x3973d3 of _0x57038a){const _0xcc12d8=_0x3973d3[_0xd9cdd2(0x169)]||_0x3973d3[_0xd9cdd2(0x198)]||_0xd9cdd2(0x18e),_0x5d11ad=_0x5c4135[_0xd9cdd2(0x163)](_0xcc12d8);_0x5d11ad?_0x5d11ad['fields'][_0xd9cdd2(0x17c)](_0x3973d3):_0x5c4135['set'](_0xcc12d8,{'displayName':_0xcc12d8,'tableName':_0x3973d3[_0xd9cdd2(0x198)],'fields':[_0x3973d3]});}const _0x12a201=new Map();for(const _0x458b9b of _0x315573){const _0x1c7815=_0x458b9b[_0xd9cdd2(0x191)]||_0xd9cdd2(0x18e),_0x4a4f9d=_0x12a201[_0xd9cdd2(0x163)](_0x1c7815)||[];_0x4a4f9d[_0xd9cdd2(0x17c)](_0x458b9b),_0x12a201[_0xd9cdd2(0x16f)](_0x1c7815,_0x4a4f9d);}console[_0xd9cdd2(0x183)]('\x0a'+a143_0x21ad64['bold'](_0x2f7491));if(_0x5c4135[_0xd9cdd2(0x15c)]>0x0){console[_0xd9cdd2(0x183)]('\x0a'+a143_0x21ad64[_0xd9cdd2(0x17a)](_0xd9cdd2(0x171)));const _0x18fb31=[..._0x5c4135[_0xd9cdd2(0x175)]()][_0xd9cdd2(0x16a)]((_0x2900e2,_0x1f50df)=>_0x2900e2[0x0]['localeCompare'](_0x1f50df[0x0]));for(const [,_0x585a67]of _0x18fb31){const _0x478924=_0x585a67['tableName']&&_0x585a67[_0xd9cdd2(0x17e)]!==_0x585a67[_0xd9cdd2(0x182)]?'\x20'+a143_0x21ad64[_0xd9cdd2(0x17a)]('('+_0x585a67['tableName']+')'):'';console[_0xd9cdd2(0x183)]('\x20\x20'+a143_0x21ad64['bold'](_0x585a67['displayName'])+_0x478924);for(const _0xe93231 of sortByColumnName(_0x585a67[_0xd9cdd2(0x15e)])){console[_0xd9cdd2(0x183)](formatFieldLine(columnName(_0xe93231),_0xe93231[_0xd9cdd2(0x186)],_0xe93231['type']));}}}if(_0x12a201[_0xd9cdd2(0x15c)]>0x0){console[_0xd9cdd2(0x183)]('\x0a'+a143_0x21ad64[_0xd9cdd2(0x17a)](_0xd9cdd2(0x197)));const _0x206607=[..._0x12a201[_0xd9cdd2(0x175)]()][_0xd9cdd2(0x16a)]((_0x26c0f8,_0x1fbd0f)=>_0x26c0f8[0x0][_0xd9cdd2(0x188)](_0x1fbd0f[0x0]));for(const [_0x192c78,_0x5ed0e7]of _0x206607){const _0x46a9ce=_0x5ed0e7[0x0],_0x3931f8=_0x46a9ce?.['matrixTableName'];if(_0x3931f8){const _0x1d4099=_0x3931f8!==_0x192c78?'\x20'+a143_0x21ad64[_0xd9cdd2(0x17a)]('('+_0x192c78+')'):'';console[_0xd9cdd2(0x183)]('\x20\x20'+a143_0x21ad64[_0xd9cdd2(0x17d)](_0x3931f8)+_0x1d4099);}else{const _0x167f33=_0x46a9ce?.['parentTableName']||'';console[_0xd9cdd2(0x183)]('\x20\x20'+a143_0x21ad64['bold'](_0x192c78)+(_0x167f33?'\x20'+a143_0x21ad64[_0xd9cdd2(0x17a)]('('+_0x167f33+')'):''));}for(const _0x433039 of sortByColumnName(_0x5ed0e7)){const _0x1f8710=_0x433039['name'][_0xd9cdd2(0x172)](_0x192c78+'.')?_0x433039['name'][_0xd9cdd2(0x194)](_0x192c78[_0xd9cdd2(0x15d)]+0x1):_0x433039['name'];console['error'](formatFieldLine(columnName(_0x433039),_0x1f8710,_0x433039['type']));}}}const _0x38d0fd=_0x40bd67[_0xd9cdd2(0x181)](_0x56ba96=>_0x56ba96['matrixColumnName']||_0x56ba96[_0xd9cdd2(0x17f)]);_0x38d0fd&&(console[_0xd9cdd2(0x183)]('\x0a'+a143_0x21ad64[_0xd9cdd2(0x17a)](_0xd9cdd2(0x167))),console[_0xd9cdd2(0x183)](a143_0x21ad64[_0xd9cdd2(0x17a)]('\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.'))),console[_0xd9cdd2(0x183)]('');}
@@ -1 +1 @@
1
- function a144_0x27ef(_0x9b2048,_0x1caa40){_0x9b2048=_0x9b2048-0xbc;const _0x4ad3c8=a144_0x4ad3();let _0x27ef6b=_0x4ad3c8[_0x9b2048];return _0x27ef6b;}(function(_0x4b285f,_0x5e48c8){const _0x1d2f85=a144_0x27ef,_0xaae123=_0x4b285f();while(!![]){try{const _0x2d8f35=-parseInt(_0x1d2f85(0xcb))/0x1*(-parseInt(_0x1d2f85(0xcf))/0x2)+parseInt(_0x1d2f85(0xc8))/0x3+parseInt(_0x1d2f85(0xc6))/0x4*(parseInt(_0x1d2f85(0xca))/0x5)+-parseInt(_0x1d2f85(0xcd))/0x6+-parseInt(_0x1d2f85(0xbe))/0x7+-parseInt(_0x1d2f85(0xc9))/0x8*(parseInt(_0x1d2f85(0xc5))/0x9)+parseInt(_0x1d2f85(0xcc))/0xa*(-parseInt(_0x1d2f85(0xc0))/0xb);if(_0x2d8f35===_0x5e48c8)break;else _0xaae123['push'](_0xaae123['shift']());}catch(_0x4fe6de){_0xaae123['push'](_0xaae123['shift']());}}}(a144_0x4ad3,0xbfde9));function a144_0x4ad3(){const _0x227136=['99043FObxcw','23110IcIlvj','3256050geejWp','endsWith','14otJowE','join','.yaml','relative','6426819VWFiqx','map','1166jojQgQ','toLowerCase','replace','isDirectory','.yml','9iHrOFg','4433804WVpurO','name','3745515adeuur','4468816crKIET','5lyrdAa'];a144_0x4ad3=function(){return _0x227136;};return a144_0x4ad3();}import{readdirSync,statSync}from'fs';import a144_0x43fcea from'path';export function findYamlFiles(_0x4d30d2){const _0xa29d49=[];function _0x51e98e(_0x4cc8c9){const _0x574e42=a144_0x27ef,_0x12fdb0=readdirSync(_0x4cc8c9,{'withFileTypes':!![]});for(const _0x1297ff of _0x12fdb0){const _0x19c343=a144_0x43fcea[_0x574e42(0xd0)](_0x4cc8c9,_0x1297ff[_0x574e42(0xc7)]);if(_0x1297ff[_0x574e42(0xc3)]())_0x51e98e(_0x19c343);else(_0x1297ff[_0x574e42(0xc7)][_0x574e42(0xce)](_0x574e42(0xc4))||_0x1297ff[_0x574e42(0xc7)][_0x574e42(0xce)](_0x574e42(0xbc)))&&_0xa29d49['push'](_0x19c343);}}return _0x51e98e(_0x4d30d2),_0xa29d49;}export function discoverYamlFiles(_0x12e43d){const _0x988859=a144_0x27ef,_0x42ca84=findYamlFiles(_0x12e43d);return _0x42ca84[_0x988859(0xbf)](_0x2dee6c=>{const _0x2292b5=_0x988859,_0x263708=a144_0x43fcea[_0x2292b5(0xbd)](_0x12e43d,_0x2dee6c),_0x2e1dd7=a144_0x43fcea['dirname'](_0x263708);return{'absolutePath':_0x2dee6c,'relativePath':_0x263708,'folderPath':_0x2e1dd7==='.'?'':_0x2e1dd7[_0x2292b5(0xc2)](/\\/g,'/')};});}export function isYamlFile(_0x1b79e0){const _0x5aca70=a144_0x27ef;try{const _0x400a4b=statSync(_0x1b79e0);if(!_0x400a4b['isFile']())return![];const _0x32eabb=a144_0x43fcea['extname'](_0x1b79e0)[_0x5aca70(0xc1)]();return _0x32eabb===_0x5aca70(0xc4)||_0x32eabb===_0x5aca70(0xbc);}catch{return![];}}
1
+ (function(_0x2b1465,_0x5434ca){const _0x16751e=a144_0x38c2,_0xacef59=_0x2b1465();while(!![]){try{const _0x3ba61e=parseInt(_0x16751e(0x97))/0x1*(-parseInt(_0x16751e(0x96))/0x2)+parseInt(_0x16751e(0x92))/0x3+parseInt(_0x16751e(0x8f))/0x4*(-parseInt(_0x16751e(0x91))/0x5)+parseInt(_0x16751e(0x86))/0x6+-parseInt(_0x16751e(0x8a))/0x7*(-parseInt(_0x16751e(0x8d))/0x8)+-parseInt(_0x16751e(0x87))/0x9+parseInt(_0x16751e(0x99))/0xa;if(_0x3ba61e===_0x5434ca)break;else _0xacef59['push'](_0xacef59['shift']());}catch(_0x53bc2f){_0xacef59['push'](_0xacef59['shift']());}}}(a144_0x1fb0,0x708c4));import{readdirSync,statSync}from'fs';import a144_0x450f65 from'path';export function findYamlFiles(_0x4df15f){const _0x45cb80=[];function _0x4957a5(_0x1868f5){const _0x1bb850=a144_0x38c2,_0x363a3b=readdirSync(_0x1868f5,{'withFileTypes':!![]});for(const _0x31e7b3 of _0x363a3b){const _0x1a0ec8=a144_0x450f65[_0x1bb850(0x85)](_0x1868f5,_0x31e7b3[_0x1bb850(0x9a)]);if(_0x31e7b3[_0x1bb850(0x8c)]())_0x4957a5(_0x1a0ec8);else(_0x31e7b3[_0x1bb850(0x9a)]['endsWith'](_0x1bb850(0x88))||_0x31e7b3['name'][_0x1bb850(0x9c)](_0x1bb850(0x89)))&&_0x45cb80[_0x1bb850(0x9b)](_0x1a0ec8);}}return _0x4957a5(_0x4df15f),_0x45cb80;}function a144_0x38c2(_0x21d687,_0x231817){_0x21d687=_0x21d687-0x85;const _0x1fb08d=a144_0x1fb0();let _0x38c2dc=_0x1fb08d[_0x21d687];return _0x38c2dc;}export function discoverYamlFiles(_0x3def0d){const _0x1b87a6=a144_0x38c2,_0x530474=findYamlFiles(_0x3def0d);return _0x530474[_0x1b87a6(0x95)](_0x1a96f4=>{const _0x1c5c94=_0x1b87a6,_0x31472e=a144_0x450f65[_0x1c5c94(0x90)](_0x3def0d,_0x1a96f4),_0x496c06=a144_0x450f65[_0x1c5c94(0x8e)](_0x31472e);return{'absolutePath':_0x1a96f4,'relativePath':_0x31472e,'folderPath':_0x496c06==='.'?'':_0x496c06[_0x1c5c94(0x8b)](/\\/g,'/')};});}function a144_0x1fb0(){const _0x4d392b=['37845bhvwqH','extname','9894880CoBUDt','name','push','endsWith','join','4560354KRBNfC','6697179TpzLev','.yml','.yaml','42Njqago','replace','isDirectory','38024IsrXam','dirname','12kwEhLg','relative','815735UFXjQk','1225464iVNsvC','toLowerCase','isFile','map','26qCejBv'];a144_0x1fb0=function(){return _0x4d392b;};return a144_0x1fb0();}export function isYamlFile(_0x5ae150){const _0x4fde24=a144_0x38c2;try{const _0x4ba0c9=statSync(_0x5ae150);if(!_0x4ba0c9[_0x4fde24(0x94)]())return![];const _0x49602c=a144_0x450f65[_0x4fde24(0x98)](_0x5ae150)[_0x4fde24(0x93)]();return _0x49602c===_0x4fde24(0x88)||_0x49602c===_0x4fde24(0x89);}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x112f7d,_0x2fd796){const _0xe65b46=a145_0x22f7,_0x296d12=_0x112f7d();while(!![]){try{const _0x17e41f=parseInt(_0xe65b46(0x1c0))/0x1+-parseInt(_0xe65b46(0x202))/0x2*(parseInt(_0xe65b46(0x1cf))/0x3)+-parseInt(_0xe65b46(0x1d5))/0x4*(parseInt(_0xe65b46(0x1ed))/0x5)+-parseInt(_0xe65b46(0x1c5))/0x6+parseInt(_0xe65b46(0x1fd))/0x7+parseInt(_0xe65b46(0x1ee))/0x8+parseInt(_0xe65b46(0x208))/0x9*(parseInt(_0xe65b46(0x1ea))/0xa);if(_0x17e41f===_0x2fd796)break;else _0x296d12['push'](_0x296d12['shift']());}catch(_0x10a557){_0x296d12['push'](_0x296d12['shift']());}}}(a145_0xe62d,0x5de97));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x37d9f7){const _0x18959f=a145_0x22f7;return _0x37d9f7[_0x18959f(0x1d6)]()['replace'](/\s+/g,'_')[_0x18959f(0x1e7)](/[^a-z0-9_\p{L}\p{N}]/gu,'')[_0x18959f(0x1e7)](/_+/g,'_')[_0x18959f(0x1e7)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x5dd404){const _0x22a762=a145_0x22f7,_0x4f9367=_0x5dd404[_0x22a762(0x1c9)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x4f9367){const _0x4c1f99=_0x4f9367[0x1][_0x22a762(0x1d6)](),_0x2d42d2=_0x4f9367[0x2],_0x3d96b4=_0x2d42d2['replace'](/-/g,'')[_0x22a762(0x1dc)](0x0,0x4)[_0x22a762(0x1d6)]();return _0x4c1f99+'_'+_0x3d96b4;}const _0x3fb374=_0x5dd404[_0x22a762(0x1c9)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x3fb374){const _0x39125b=_0x3fb374[0x1],_0x4efc1d=_0x3fb374[0x2][_0x22a762(0x1d6)](),_0x1fd38c=_0x39125b[_0x22a762(0x1e7)](/-/g,'')[_0x22a762(0x1dc)](0x0,0x4)['toLowerCase']();return _0x4efc1d+'_'+_0x1fd38c;}return undefined;}function stableStringify(_0x119377){const _0xb8fc58=a145_0x22f7;if(Array[_0xb8fc58(0x1fa)](_0x119377))return'['+_0x119377[_0xb8fc58(0x1d8)](_0x3c91fa=>stableStringify(_0x3c91fa))[_0xb8fc58(0x1da)](',')+']';if(_0x119377&&typeof _0x119377===_0xb8fc58(0x1d2)){const _0x32655e=_0x119377,_0x1eb5f6=Object[_0xb8fc58(0x206)](_0x32655e)[_0xb8fc58(0x1be)](),_0x47cebc=_0x1eb5f6['map'](_0x426660=>'\x22'+_0x426660+'\x22:'+stableStringify(_0x32655e[_0x426660]));return'{'+_0x47cebc['join'](',')+'}';}const _0x2fd23f=JSON[_0xb8fc58(0x1c3)](_0x119377);return _0x2fd23f===undefined?_0xb8fc58(0x1c4):_0x2fd23f;}export function consolidateActivationsByContent(_0xa48313){const _0x12bc7b=a145_0x22f7,_0xa7f96a={},_0x55f3f5=new Map(),_0x5c84c0=new Map();for(const _0x442d77 of _0xa48313){if(!_0x442d77)continue;for(const [_0x1891ac,_0x357235]of Object[_0x12bc7b(0x1c7)](_0x442d77)){const _0x2a6807={'name':_0x357235[_0x12bc7b(0x1e0)],'connection':_0x357235[_0x12bc7b(0x204)],..._0x357235[_0x12bc7b(0x1d3)]!==undefined&&{'all_columns':_0x357235[_0x12bc7b(0x1d3)]},..._0x357235['columns']!==undefined&&{'columns':_0x357235[_0x12bc7b(0x1bd)]},..._0x357235['behavior']!==undefined&&{'behavior':_0x357235['behavior']},..._0x357235[_0x12bc7b(0x1f0)]!==undefined&&{'schedule':_0x357235[_0x12bc7b(0x1f0)]},..._0x357235[_0x12bc7b(0x1f8)]!==undefined&&{'notification':_0x357235[_0x12bc7b(0x1f8)]},..._0x357235[_0x12bc7b(0x1e4)]!==undefined&&{'connector_config':_0x357235[_0x12bc7b(0x1e4)]},..._0x357235[_0x12bc7b(0x1f6)]!==undefined&&{'activation_template_id':_0x357235[_0x12bc7b(0x1f6)]}},_0x19c90d=stableStringify(_0x2a6807),_0x2cb321=_0x5c84c0[_0x12bc7b(0x1bb)](_0x19c90d);_0x2cb321?_0x55f3f5['set'](_0x1891ac,_0x2cb321):(_0xa7f96a[_0x1891ac]=_0x357235,_0x55f3f5['set'](_0x1891ac,_0x1891ac),_0x5c84c0[_0x12bc7b(0x1e6)](_0x19c90d,_0x1891ac));}}return{'merged':_0xa7f96a,'nameMapping':_0x55f3f5};}export function updateActivationReferences(_0x5eb813,_0x502154){const _0x16658d=a145_0x22f7;if(!_0x5eb813)return;for(const _0x1a7144 of _0x5eb813){if(!_0x1a7144[_0x16658d(0x1bf)])continue;for(const _0xc76f26 of _0x1a7144[_0x16658d(0x1bf)]){if(_0xc76f26[_0x16658d(0x1fc)]===_0x16658d(0x1c8)&&_0xc76f26[_0x16658d(0x1f2)]?.[_0x16658d(0x1c8)]){const _0x209c98=_0x502154[_0x16658d(0x1bb)](_0xc76f26[_0x16658d(0x1f2)]['activation']);_0x209c98&&_0x209c98!==_0xc76f26[_0x16658d(0x1f2)][_0x16658d(0x1c8)]&&(_0xc76f26[_0x16658d(0x1f2)][_0x16658d(0x1c8)]=_0x209c98);}}}}function a145_0x22f7(_0x378927,_0x14d00c){_0x378927=_0x378927-0x1ba;const _0xe62d2f=a145_0xe62d();let _0x22f708=_0xe62d2f[_0x378927];return _0x22f708;}export function consolidateSegmentsByContent(_0x52ba2d,_0xa68a33){const _0xf726ce=a145_0x22f7,_0x2a6427={},_0x32514a=new Map(),_0x1f2fcb=new Map();for(const _0x482fe5 of _0x52ba2d){if(!_0x482fe5)continue;for(const [_0x5047f8,_0x2a8f98]of Object[_0xf726ce(0x1c7)](_0x482fe5)){if(!_0x2a8f98[_0xf726ce(0x200)]){_0x2a6427[_0x5047f8]=_0x2a8f98,_0x32514a[_0xf726ce(0x1e6)](_0x5047f8,_0x5047f8);continue;}const _0x456dcd=_0x2a8f98[_0xf726ce(0x1ec)]&&_0x2a8f98[_0xf726ce(0x1ec)][_0xf726ce(0x1f9)]()?_0x2a8f98[_0xf726ce(0x1ec)]:undefined,_0x5a00a7=JSON[_0xf726ce(0x1c3)]({'description':_0x456dcd,'rule':deepSortObject(_0x2a8f98[_0xf726ce(0x200)])}),_0x838322=_0x1f2fcb[_0xf726ce(0x1bb)](_0x5a00a7);if(_0x838322){const _0x35ecda={..._0x2a8f98['description']!==undefined&&{'description':_0x2a8f98[_0xf726ce(0x1ec)]},'rule':_0x2a8f98[_0xf726ce(0x200)]?deepSortObject(_0x2a8f98[_0xf726ce(0x200)]):_0x2a8f98[_0xf726ce(0x200)]};if(_0x5047f8<_0x838322){_0x2a6427[_0x5047f8]=_0x35ecda,delete _0x2a6427[_0x838322];for(const [_0xebf7d2,_0x10fd6f]of _0x32514a[_0xf726ce(0x1c7)]()){_0x10fd6f===_0x838322&&_0x32514a[_0xf726ce(0x1e6)](_0xebf7d2,_0x5047f8);}_0x32514a[_0xf726ce(0x1e6)](_0x5047f8,_0x5047f8),_0x1f2fcb['set'](_0x5a00a7,_0x5047f8);}else _0x2a6427[_0x838322]=_0x35ecda,_0x32514a[_0xf726ce(0x1e6)](_0x5047f8,_0x838322);}else{let _0x246d5c=_0x5047f8;if(_0xa68a33){const _0x142f01=_0xa68a33[_0xf726ce(0x1bb)](_0x5a00a7);_0x142f01&&_0x142f01[_0xf726ce(0x1db)]>0x0&&(_0x246d5c=_0x142f01[_0xf726ce(0x1dc)]()[_0xf726ce(0x1be)]()[0x0]);}const _0xba1ae4={..._0x2a8f98[_0xf726ce(0x1ec)]!==undefined&&{'description':_0x2a8f98[_0xf726ce(0x1ec)]},'rule':_0x2a8f98[_0xf726ce(0x200)]?deepSortObject(_0x2a8f98['rule']):_0x2a8f98['rule']};_0x2a6427[_0x246d5c]=_0xba1ae4,_0x32514a[_0xf726ce(0x1e6)](_0x5047f8,_0x246d5c),_0x1f2fcb[_0xf726ce(0x1e6)](_0x5a00a7,_0x246d5c);}}}return{'merged':_0x2a6427,'nameMapping':_0x32514a};}export function updateSegmentReferences(_0x4d668d,_0x4af224){const _0x2d8fa7=a145_0x22f7;if(!_0x4d668d)return;for(const _0x2d56ef of _0x4d668d){if(_0x2d56ef['entry_criteria']?.[_0x2d8fa7(0x1e9)]){const _0x3a3fc7=_0x4af224[_0x2d8fa7(0x1bb)](_0x2d56ef[_0x2d8fa7(0x1f7)][_0x2d8fa7(0x1e9)]);_0x3a3fc7&&(_0x2d56ef[_0x2d8fa7(0x1f7)][_0x2d8fa7(0x1e9)]=_0x3a3fc7);}if(_0x2d56ef[_0x2d8fa7(0x1e1)])for(const _0x1ad4e4 of _0x2d56ef[_0x2d8fa7(0x1e1)]){if(_0x1ad4e4[_0x2d8fa7(0x1e9)]){const _0x10fe9e=_0x4af224['get'](_0x1ad4e4[_0x2d8fa7(0x1e9)]);_0x10fe9e&&(_0x1ad4e4[_0x2d8fa7(0x1e9)]=_0x10fe9e);}}if(_0x2d56ef[_0x2d8fa7(0x1d1)]?.[_0x2d8fa7(0x1e9)]){const _0x210897=_0x4af224[_0x2d8fa7(0x1bb)](_0x2d56ef['milestone'][_0x2d8fa7(0x1e9)]);_0x210897&&(_0x2d56ef['milestone']['segment']=_0x210897);}if(_0x2d56ef['steps'])for(const _0x3beec0 of _0x2d56ef[_0x2d8fa7(0x1bf)]){if(_0x3beec0[_0x2d8fa7(0x1fc)]===_0x2d8fa7(0x1ef)&&_0x3beec0[_0x2d8fa7(0x1f2)]?.['branches'])for(const _0x5d9347 of _0x3beec0[_0x2d8fa7(0x1f2)][_0x2d8fa7(0x1de)]){if(_0x5d9347[_0x2d8fa7(0x1e9)]){const _0x2cd4ed=_0x4af224['get'](_0x5d9347[_0x2d8fa7(0x1e9)]);_0x2cd4ed&&(_0x5d9347['segment']=_0x2cd4ed);}}if(_0x3beec0['type']==='wait'&&_0x3beec0[_0x2d8fa7(0x1f2)]?.[_0x2d8fa7(0x1f1)]?.[_0x2d8fa7(0x1e9)]){const _0x34f991=_0x4af224['get'](_0x3beec0[_0x2d8fa7(0x1f2)][_0x2d8fa7(0x1f1)][_0x2d8fa7(0x1e9)]);_0x34f991&&(_0x3beec0[_0x2d8fa7(0x1f2)][_0x2d8fa7(0x1f1)][_0x2d8fa7(0x1e9)]=_0x34f991);}}}}export function updateSegmentRefsInSegments(_0x2b9464,_0x363e3f){const _0xad3b5d=a145_0x22f7;for(const _0x54707f of Object[_0xad3b5d(0x1d9)](_0x2b9464)){_0x54707f[_0xad3b5d(0x200)]&&updateSegmentRefsInRule(_0x54707f[_0xad3b5d(0x200)],_0x363e3f);}}function updateSegmentRefsInRule(_0x4f348d,_0x45ebc6){const _0x491858=a145_0x22f7;if(_0x4f348d===null||typeof _0x4f348d!==_0x491858(0x1d2))return;if(Array[_0x491858(0x1fa)](_0x4f348d)){for(const _0x328a54 of _0x4f348d){updateSegmentRefsInRule(_0x328a54,_0x45ebc6);}return;}const _0x16a297=_0x4f348d;if((_0x16a297[_0x491858(0x1fc)]===_0x491858(0x1ff)||_0x16a297[_0x491858(0x1fc)]===_0x491858(0x1cd))&&typeof _0x16a297[_0x491858(0x1e9)]===_0x491858(0x1d0)){const _0x51df42=_0x45ebc6['get'](_0x16a297['segment']);_0x51df42&&(_0x16a297[_0x491858(0x1e9)]=_0x51df42);}if(_0x16a297[_0x491858(0x1d7)]&&Array['isArray'](_0x16a297[_0x491858(0x1d7)]))for(const _0x3348ec of _0x16a297['conditions']){updateSegmentRefsInRule(_0x3348ec,_0x45ebc6);}}export function buildJourneysArray(_0x50a9f3,_0x4c8e2f){return _0x50a9f3['map'](_0x1c3324=>{const _0x1dd336=a145_0x22f7,_0x28cd22=_0x4c8e2f?_0x1c3324[_0x1dd336(0x1ce)]['id']===_0x4c8e2f:_0x50a9f3[_0x1dd336(0x1db)]===0x1,_0x3ace9b=_0x1c3324[_0x1dd336(0x1df)][_0x1dd336(0x1c6)]?.[0x0],_0x509af9=_0x3ace9b?.[_0x1dd336(0x1fb)]||_0x1c3324[_0x1dd336(0x1df)][_0x1dd336(0x1fb)],_0x499973={'version':_0x3ace9b?.[_0x1dd336(0x1f4)]||_0x1c3324[_0x1dd336(0x1df)][_0x1dd336(0x1f4)]||_0x1c3324['item'][_0x1dd336(0x1e0)],'state':_0x1c3324[_0x1dd336(0x1ce)][_0x1dd336(0x1e3)]===_0x1dd336(0x1bc)?_0x1dd336(0x1bc):_0x1dd336(0x205),'stages':_0x3ace9b?.[_0x1dd336(0x207)]||_0x1c3324[_0x1dd336(0x1df)][_0x1dd336(0x207)]||[],'id':_0x3ace9b?.['id']||_0x1c3324[_0x1dd336(0x1df)]['id'],'version_number':_0x3ace9b?.[_0x1dd336(0x1d4)]||_0x1c3324[_0x1dd336(0x1df)][_0x1dd336(0x1d4)]};return _0x509af9&&(_0x499973['goal']=_0x509af9),_0x28cd22&&(_0x499973['latest']=!![]),_0x499973;});}export function buildMergedJourneyDef(_0x50aab4,_0x5f1aad,_0x5d0c28){const _0x33209e=a145_0x22f7,_0x40e08f=_0x50aab4[0x0][_0x33209e(0x1df)],_0x53bc82=buildJourneysArray(_0x50aab4,_0x5d0c28),{merged:_0x50f441,nameMapping:_0x2be704}=consolidateSegmentsByContent(_0x50aab4[_0x33209e(0x1d8)](_0x306425=>_0x306425[_0x33209e(0x1df)][_0x33209e(0x1fe)]),_0x5f1aad);updateSegmentRefsInSegments(_0x50f441,_0x2be704);const _0x47cde5=Array[_0x33209e(0x1c1)](_0x2be704[_0x33209e(0x1c7)]())['some'](([_0xc91ced,_0x1892fe])=>_0xc91ced!==_0x1892fe&&_0xc91ced[_0x33209e(0x1eb)]('entry_criteria'));let _0x14b6b9=_0x50f441,_0x38a85b=new Map();if(_0x47cde5){const _0x5256b8=consolidateSegmentsByContent([_0x50f441],_0x5f1aad);_0x14b6b9=_0x5256b8[_0x33209e(0x1f5)],_0x38a85b=_0x5256b8[_0x33209e(0x201)];}const _0x4bdc60=new Map(_0x2be704);for(const [_0x572799,_0xe166a2]of _0x38a85b[_0x33209e(0x1c7)]()){_0x4bdc60[_0x33209e(0x1e6)](_0x572799,_0xe166a2);}for(const [_0x400be3,_0x48da2]of _0x4bdc60['entries']()){let _0x522502=_0x48da2,_0x51aa02=0x0;while(_0x4bdc60[_0x33209e(0x1cb)](_0x522502)&&_0x4bdc60['get'](_0x522502)!==_0x522502&&_0x51aa02<MAX_MAPPING_CHAIN_DEPTH){_0x522502=_0x4bdc60[_0x33209e(0x1bb)](_0x522502),_0x51aa02++;}_0x522502!==_0x48da2&&_0x4bdc60[_0x33209e(0x1e6)](_0x400be3,_0x522502);}for(const _0x53092c of _0x53bc82){updateSegmentReferences(_0x53092c[_0x33209e(0x207)],_0x4bdc60);}const {merged:_0x4872c6,nameMapping:_0x332511}=consolidateActivationsByContent(_0x50aab4[_0x33209e(0x1d8)](_0x465692=>_0x465692[_0x33209e(0x1df)][_0x33209e(0x1e5)]));for(const _0x321723 of _0x53bc82){updateActivationReferences(_0x321723[_0x33209e(0x207)],_0x332511);}let _0x123563=_0x40e08f[_0x33209e(0x1fb)];if(_0x123563?.['segment']){const _0x75b4eb=_0x4bdc60[_0x33209e(0x1bb)](_0x123563[_0x33209e(0x1e9)]);_0x75b4eb&&(_0x123563={..._0x123563,'segment':_0x75b4eb});}for(const _0xd99222 of _0x53bc82){if(_0xd99222[_0x33209e(0x1fb)]?.['segment']){const _0x20b450=_0x4bdc60[_0x33209e(0x1bb)](_0xd99222[_0x33209e(0x1fb)]['segment']);_0x20b450&&(_0xd99222[_0x33209e(0x1fb)]={..._0xd99222[_0x33209e(0x1fb)],'segment':_0x20b450});}}return _0x53bc82['some'](_0x43b74b=>_0x43b74b[_0x33209e(0x1fb)])&&(_0x123563=undefined),{'type':'journey','name':_0x40e08f[_0x33209e(0x1e0)],'description':_0x40e08f['description'],'goal':_0x123563,'reentry':_0x40e08f[_0x33209e(0x1dd)],'segments':Object[_0x33209e(0x206)](_0x14b6b9)[_0x33209e(0x1db)]>0x0?_0x14b6b9:undefined,'activations':Object[_0x33209e(0x206)](_0x4872c6)['length']>0x0?_0x4872c6:undefined,'journeys':_0x53bc82,'bundle_id':_0x40e08f[_0x33209e(0x1ba)],'bundle_name':_0x40e08f[_0x33209e(0x1c2)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x4948b4,_0x2d02d6,_0x44825a,_0x11109c){const _0x44dbce=a145_0x22f7,_0x2cd42e=_0x4948b4+':'+_0x2d02d6,_0x53fd3e=_0x44825a['get'](_0x2cd42e);if(_0x53fd3e)return _0x53fd3e;const _0x2c7397=await _0x11109c(_0x4948b4),_0x90765d=_0x2c7397[_0x44dbce(0x1cc)][_0x44dbce(0x1e8)]||_0x2c7397[_0x44dbce(0x1cc)][_0x44dbce(0x1e0)],_0x5c7a64=_0x2c7397[_0x44dbce(0x1cc)][_0x44dbce(0x203)]['find'](_0x511de0=>String(_0x511de0['id'])===String(_0x2d02d6)),_0x782e35=_0x5c7a64?.[_0x44dbce(0x1e0)]||_0x2d02d6,_0x520a30={'journeyName':_0x90765d,'stageName':_0x782e35};return _0x44825a[_0x44dbce(0x1e6)](_0x2cd42e,_0x520a30),_0x520a30;}function a145_0xe62d(){const _0x141153=['get','launched','columns','sort','steps','645685BjaUCM','from','bundle_name','stringify','null','2781414suxtNk','journeys','entries','activation','match','endsWith','has','attributes','exclude','item','3CUVnND','string','milestone','object','all_columns','version_number','732aUeSMJ','toLowerCase','conditions','map','values','join','length','slice','reentry','branches','yaml','name','exit_criteria','push','state','connector_config','activations','set','replace','journeyBundleName','segment','410wThTgT','startsWith','description','19330ZjpmNm','1832160KacSAi','decision_point','schedule','condition','with','wait','version','merged','activation_template_id','entry_criteria','notification','trim','isArray','goal','type','3909143NznJJY','segments','include','rule','nameMapping','700594fndXPV','journeyStages','connection','draft','keys','stages','103797zhTcrD','bundle_id'];a145_0xe62d=function(){return _0x141153;};return a145_0xe62d();}export function formatApiJourneyName(_0x1f5072,_0x7909ce){return _0x7909ce+'\x20('+_0x1f5072+')';}export function isLocalJourneyRef(_0x318954){const _0x4a84b0=a145_0x22f7;return _0x318954[_0x4a84b0(0x1ca)]('.yml')||_0x318954[_0x4a84b0(0x1ca)]('.yaml');}export function buildLocalRuleToNameMapping(_0x57c9a5){const _0x2aadd0=a145_0x22f7,_0x395bc9=new Map();if(!_0x57c9a5)return _0x395bc9;for(const [_0x5838d7,_0xb0064e]of Object['entries'](_0x57c9a5)){if(_0xb0064e[_0x2aadd0(0x200)]){const _0x4cd565=serializeRule(_0xb0064e[_0x2aadd0(0x200)]),_0x134491=_0x395bc9[_0x2aadd0(0x1bb)](_0x4cd565)||[];_0x134491[_0x2aadd0(0x1e2)](_0x5838d7),_0x395bc9[_0x2aadd0(0x1e6)](_0x4cd565,_0x134491);}}return _0x395bc9;}export function buildLocalRuleToNameMappingFromJourney(_0x53ede0){const _0xdc3671=a145_0x22f7,_0x4fd833=_0x53ede0[_0xdc3671(0x1fe)];if(!_0x4fd833)return new Map();const _0x3c135e=collectSegmentUsageCounts(_0x53ede0),_0x146265=new Map();let _0x2898be=0x0;for(const [_0x272573,_0x5e923c]of Object['entries'](_0x4fd833)){if(!_0x5e923c[_0xdc3671(0x200)]){_0x2898be++;continue;}const _0x224be4=serializeRule(_0x5e923c[_0xdc3671(0x200)]),_0x28cc4c=_0x146265['get'](_0x224be4)||[];_0x28cc4c[_0xdc3671(0x1e2)]({'name':_0x272573,'index':_0x2898be}),_0x146265[_0xdc3671(0x1e6)](_0x224be4,_0x28cc4c),_0x2898be++;}const _0x5e8aa7=new Map();for(const [_0x157d25,_0x171037]of _0x146265){const _0x3e6218=_0x171037[_0xdc3671(0x1dc)]()[_0xdc3671(0x1be)]((_0x5326b9,_0x3980c8)=>{const _0xfa8d8c=_0xdc3671,_0xd8a955=_0x3c135e[_0xfa8d8c(0x1bb)](_0x5326b9[_0xfa8d8c(0x1e0)])||0x0,_0x37f85d=_0x3c135e['get'](_0x3980c8[_0xfa8d8c(0x1e0)])||0x0;if(_0xd8a955!==_0x37f85d)return _0x37f85d-_0xd8a955;return _0x5326b9['index']-_0x3980c8['index'];})[_0xdc3671(0x1d8)](_0x8955a3=>_0x8955a3[_0xdc3671(0x1e0)]);_0x5e8aa7[_0xdc3671(0x1e6)](_0x157d25,_0x3e6218);}return _0x5e8aa7;}export function collectSegmentUsageCounts(_0x488b64){const _0x435e6a=a145_0x22f7,_0x35c28b=new Map(),_0x4f21ca=_0x4eac62=>{const _0x956fe9=a145_0x22f7;if(!_0x4eac62)return;_0x35c28b[_0x956fe9(0x1e6)](_0x4eac62,(_0x35c28b[_0x956fe9(0x1bb)](_0x4eac62)||0x0)+0x1);},_0x23461e=_0x4a9fd2=>{const _0x312041=a145_0x22f7;for(const _0x2cbb10 of _0x4a9fd2){_0x4f21ca(_0x2cbb10[_0x312041(0x1f7)]?.[_0x312041(0x1e9)]);if(_0x2cbb10[_0x312041(0x1e1)])for(const _0x22133d of _0x2cbb10[_0x312041(0x1e1)]){_0x4f21ca(_0x22133d[_0x312041(0x1e9)]);}_0x4f21ca(_0x2cbb10[_0x312041(0x1d1)]?.[_0x312041(0x1e9)]);if(_0x2cbb10[_0x312041(0x1bf)])for(const _0x5c80a4 of _0x2cbb10[_0x312041(0x1bf)]){if(_0x5c80a4[_0x312041(0x1fc)]==='decision_point')for(const _0xdb29f9 of _0x5c80a4[_0x312041(0x1f2)][_0x312041(0x1de)]){_0x4f21ca(_0xdb29f9[_0x312041(0x1e9)]);}else _0x5c80a4[_0x312041(0x1fc)]===_0x312041(0x1f3)&&_0x4f21ca(_0x5c80a4[_0x312041(0x1f2)][_0x312041(0x1f1)]?.[_0x312041(0x1e9)]);}}};_0x4f21ca(_0x488b64[_0x435e6a(0x1fb)]?.[_0x435e6a(0x1e9)]);if(_0x488b64[_0x435e6a(0x1c6)])for(const _0xbc34ce of _0x488b64['journeys']){_0x4f21ca(_0xbc34ce[_0x435e6a(0x1fb)]?.[_0x435e6a(0x1e9)]),_0x23461e(_0xbc34ce[_0x435e6a(0x207)]);}_0x488b64['stages']&&_0x23461e(_0x488b64[_0x435e6a(0x207)]);if(_0x488b64['versions'])for(const _0x1ff089 of _0x488b64['versions']){_0x23461e(_0x1ff089[_0x435e6a(0x207)]);}return _0x35c28b;}
1
+ (function(_0x99cccc,_0x41f9fe){const _0x161476=a145_0x4ecf,_0xa69acb=_0x99cccc();while(!![]){try{const _0x2e2b1e=-parseInt(_0x161476(0x193))/0x1*(-parseInt(_0x161476(0x191))/0x2)+parseInt(_0x161476(0x163))/0x3+-parseInt(_0x161476(0x145))/0x4+-parseInt(_0x161476(0x15d))/0x5*(parseInt(_0x161476(0x18e))/0x6)+-parseInt(_0x161476(0x180))/0x7+parseInt(_0x161476(0x160))/0x8+-parseInt(_0x161476(0x15c))/0x9*(-parseInt(_0x161476(0x15e))/0xa);if(_0x2e2b1e===_0x41f9fe)break;else _0xa69acb['push'](_0xa69acb['shift']());}catch(_0x349b7a){_0xa69acb['push'](_0xa69acb['shift']());}}}(a145_0x3a8b,0xcfeec));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x6ce6f0){const _0x3ffc26=a145_0x4ecf;return _0x6ce6f0[_0x3ffc26(0x166)]()[_0x3ffc26(0x17c)](/\s+/g,'_')['replace'](/[^a-z0-9_\p{L}\p{N}]/gu,'')[_0x3ffc26(0x17c)](/_+/g,'_')['replace'](/^_|_$/g,'');}export function generateJourneyLocalName(_0x48ba7c){const _0x3edc90=a145_0x4ecf,_0xf300f4=_0x48ba7c[_0x3edc90(0x16e)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0xf300f4){const _0x1acaa6=_0xf300f4[0x1][_0x3edc90(0x166)](),_0x38e8ef=_0xf300f4[0x2],_0x1a67ef=_0x38e8ef[_0x3edc90(0x17c)](/-/g,'')['slice'](0x0,0x4)['toLowerCase']();return _0x1acaa6+'_'+_0x1a67ef;}const _0x3b9472=_0x48ba7c[_0x3edc90(0x16e)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x3b9472){const _0xac3dcf=_0x3b9472[0x1],_0x308964=_0x3b9472[0x2][_0x3edc90(0x166)](),_0x525fe6=_0xac3dcf[_0x3edc90(0x17c)](/-/g,'')[_0x3edc90(0x153)](0x0,0x4)[_0x3edc90(0x166)]();return _0x308964+'_'+_0x525fe6;}return undefined;}function stableStringify(_0x48ab10){const _0x4fa6da=a145_0x4ecf;if(Array[_0x4fa6da(0x190)](_0x48ab10))return'['+_0x48ab10['map'](_0x58bdea=>stableStringify(_0x58bdea))[_0x4fa6da(0x147)](',')+']';if(_0x48ab10&&typeof _0x48ab10===_0x4fa6da(0x17d)){const _0xe813a7=_0x48ab10,_0x183254=Object[_0x4fa6da(0x17a)](_0xe813a7)[_0x4fa6da(0x14f)](),_0x2f4fa6=_0x183254['map'](_0x189e07=>'\x22'+_0x189e07+'\x22:'+stableStringify(_0xe813a7[_0x189e07]));return'{'+_0x2f4fa6[_0x4fa6da(0x147)](',')+'}';}const _0x551b28=JSON[_0x4fa6da(0x14c)](_0x48ab10);return _0x551b28===undefined?_0x4fa6da(0x158):_0x551b28;}export function consolidateActivationsByContent(_0x472c48){const _0x5313c9=a145_0x4ecf,_0x46abd0={},_0x350db5=new Map(),_0x433afe=new Map();for(const _0x3d23f4 of _0x472c48){if(!_0x3d23f4)continue;for(const [_0x4ef848,_0x10bf09]of Object[_0x5313c9(0x173)](_0x3d23f4)){const _0x342994={'name':_0x10bf09[_0x5313c9(0x171)],'connection':_0x10bf09[_0x5313c9(0x14d)],..._0x10bf09[_0x5313c9(0x17e)]!==undefined&&{'all_columns':_0x10bf09['all_columns']},..._0x10bf09[_0x5313c9(0x168)]!==undefined&&{'columns':_0x10bf09[_0x5313c9(0x168)]},..._0x10bf09[_0x5313c9(0x16d)]!==undefined&&{'behavior':_0x10bf09[_0x5313c9(0x16d)]},..._0x10bf09[_0x5313c9(0x154)]!==undefined&&{'schedule':_0x10bf09[_0x5313c9(0x154)]},..._0x10bf09['notification']!==undefined&&{'notification':_0x10bf09[_0x5313c9(0x186)]},..._0x10bf09[_0x5313c9(0x156)]!==undefined&&{'connector_config':_0x10bf09[_0x5313c9(0x156)]},..._0x10bf09['activation_template_id']!==undefined&&{'activation_template_id':_0x10bf09[_0x5313c9(0x146)]}},_0x5a3729=stableStringify(_0x342994),_0x5c9d08=_0x433afe[_0x5313c9(0x179)](_0x5a3729);_0x5c9d08?_0x350db5['set'](_0x4ef848,_0x5c9d08):(_0x46abd0[_0x4ef848]=_0x10bf09,_0x350db5['set'](_0x4ef848,_0x4ef848),_0x433afe[_0x5313c9(0x188)](_0x5a3729,_0x4ef848));}}return{'merged':_0x46abd0,'nameMapping':_0x350db5};}export function updateActivationReferences(_0x22b932,_0x1ff1ca){const _0x708717=a145_0x4ecf;if(!_0x22b932)return;for(const _0x14122f of _0x22b932){if(!_0x14122f[_0x708717(0x164)])continue;for(const _0x9e0f57 of _0x14122f[_0x708717(0x164)]){if(_0x9e0f57['type']===_0x708717(0x178)&&_0x9e0f57[_0x708717(0x149)]?.[_0x708717(0x178)]){const _0x1d7b2d=_0x1ff1ca[_0x708717(0x179)](_0x9e0f57[_0x708717(0x149)][_0x708717(0x178)]);_0x1d7b2d&&_0x1d7b2d!==_0x9e0f57[_0x708717(0x149)][_0x708717(0x178)]&&(_0x9e0f57['with'][_0x708717(0x178)]=_0x1d7b2d);}}}}export function consolidateSegmentsByContent(_0x64b0b3,_0x356d4d){const _0x20b6b3=a145_0x4ecf,_0x428253={},_0x33a390=new Map(),_0x288652=new Map();for(const _0x4c9be4 of _0x64b0b3){if(!_0x4c9be4)continue;for(const [_0x451537,_0x296f22]of Object[_0x20b6b3(0x173)](_0x4c9be4)){if(!_0x296f22['rule']){_0x428253[_0x451537]=_0x296f22,_0x33a390[_0x20b6b3(0x188)](_0x451537,_0x451537);continue;}const _0x30cc6c=_0x296f22[_0x20b6b3(0x162)]&&_0x296f22['description'][_0x20b6b3(0x18f)]()?_0x296f22[_0x20b6b3(0x162)]:undefined,_0x22fd6a=JSON[_0x20b6b3(0x14c)]({'description':_0x30cc6c,'rule':deepSortObject(_0x296f22[_0x20b6b3(0x150)])}),_0x4dcf32=_0x288652['get'](_0x22fd6a);if(_0x4dcf32){const _0x50ba5e={..._0x296f22[_0x20b6b3(0x162)]!==undefined&&{'description':_0x296f22[_0x20b6b3(0x162)]},'rule':_0x296f22[_0x20b6b3(0x150)]?deepSortObject(_0x296f22[_0x20b6b3(0x150)]):_0x296f22[_0x20b6b3(0x150)]};if(_0x451537<_0x4dcf32){_0x428253[_0x451537]=_0x50ba5e,delete _0x428253[_0x4dcf32];for(const [_0xc2ce7c,_0x83182f]of _0x33a390['entries']()){_0x83182f===_0x4dcf32&&_0x33a390[_0x20b6b3(0x188)](_0xc2ce7c,_0x451537);}_0x33a390['set'](_0x451537,_0x451537),_0x288652['set'](_0x22fd6a,_0x451537);}else _0x428253[_0x4dcf32]=_0x50ba5e,_0x33a390['set'](_0x451537,_0x4dcf32);}else{let _0x5cfe1b=_0x451537;if(_0x356d4d){const _0x5781dd=_0x356d4d[_0x20b6b3(0x179)](_0x22fd6a);_0x5781dd&&_0x5781dd[_0x20b6b3(0x194)]>0x0&&(_0x5cfe1b=_0x5781dd['slice']()[_0x20b6b3(0x14f)]()[0x0]);}const _0x1b6b3d={..._0x296f22[_0x20b6b3(0x162)]!==undefined&&{'description':_0x296f22['description']},'rule':_0x296f22[_0x20b6b3(0x150)]?deepSortObject(_0x296f22[_0x20b6b3(0x150)]):_0x296f22[_0x20b6b3(0x150)]};_0x428253[_0x5cfe1b]=_0x1b6b3d,_0x33a390['set'](_0x451537,_0x5cfe1b),_0x288652['set'](_0x22fd6a,_0x5cfe1b);}}}return{'merged':_0x428253,'nameMapping':_0x33a390};}export function updateSegmentReferences(_0x597ce3,_0x397f52){const _0x5a2503=a145_0x4ecf;if(!_0x597ce3)return;for(const _0x51b844 of _0x597ce3){if(_0x51b844[_0x5a2503(0x189)]?.[_0x5a2503(0x165)]){const _0x3871b6=_0x397f52[_0x5a2503(0x179)](_0x51b844[_0x5a2503(0x189)][_0x5a2503(0x165)]);_0x3871b6&&(_0x51b844[_0x5a2503(0x189)][_0x5a2503(0x165)]=_0x3871b6);}if(_0x51b844[_0x5a2503(0x15b)])for(const _0x230827 of _0x51b844[_0x5a2503(0x15b)]){if(_0x230827['segment']){const _0x7fd8ea=_0x397f52[_0x5a2503(0x179)](_0x230827[_0x5a2503(0x165)]);_0x7fd8ea&&(_0x230827[_0x5a2503(0x165)]=_0x7fd8ea);}}if(_0x51b844[_0x5a2503(0x18c)]?.[_0x5a2503(0x165)]){const _0x27153c=_0x397f52[_0x5a2503(0x179)](_0x51b844[_0x5a2503(0x18c)][_0x5a2503(0x165)]);_0x27153c&&(_0x51b844[_0x5a2503(0x18c)][_0x5a2503(0x165)]=_0x27153c);}if(_0x51b844[_0x5a2503(0x164)])for(const _0x1add37 of _0x51b844[_0x5a2503(0x164)]){if(_0x1add37['type']===_0x5a2503(0x18d)&&_0x1add37[_0x5a2503(0x149)]?.['branches'])for(const _0x34358b of _0x1add37[_0x5a2503(0x149)][_0x5a2503(0x170)]){if(_0x34358b['segment']){const _0xd34ca0=_0x397f52[_0x5a2503(0x179)](_0x34358b[_0x5a2503(0x165)]);_0xd34ca0&&(_0x34358b[_0x5a2503(0x165)]=_0xd34ca0);}}if(_0x1add37[_0x5a2503(0x14b)]==='wait'&&_0x1add37['with']?.['condition']?.[_0x5a2503(0x165)]){const _0x330679=_0x397f52[_0x5a2503(0x179)](_0x1add37[_0x5a2503(0x149)][_0x5a2503(0x15f)]['segment']);_0x330679&&(_0x1add37['with'][_0x5a2503(0x15f)][_0x5a2503(0x165)]=_0x330679);}}}}export function updateSegmentRefsInSegments(_0x246ea5,_0x195bf6){const _0x41c84b=a145_0x4ecf;for(const _0x30ee5f of Object[_0x41c84b(0x15a)](_0x246ea5)){_0x30ee5f[_0x41c84b(0x150)]&&updateSegmentRefsInRule(_0x30ee5f['rule'],_0x195bf6);}}function updateSegmentRefsInRule(_0x565e01,_0x105c56){const _0xd5e262=a145_0x4ecf;if(_0x565e01===null||typeof _0x565e01!==_0xd5e262(0x17d))return;if(Array[_0xd5e262(0x190)](_0x565e01)){for(const _0x4d3f19 of _0x565e01){updateSegmentRefsInRule(_0x4d3f19,_0x105c56);}return;}const _0x42e954=_0x565e01;if((_0x42e954['type']==='include'||_0x42e954['type']==='exclude')&&typeof _0x42e954['segment']===_0xd5e262(0x14e)){const _0x1b4436=_0x105c56['get'](_0x42e954[_0xd5e262(0x165)]);_0x1b4436&&(_0x42e954[_0xd5e262(0x165)]=_0x1b4436);}if(_0x42e954[_0xd5e262(0x14a)]&&Array[_0xd5e262(0x190)](_0x42e954['conditions']))for(const _0x58e321 of _0x42e954['conditions']){updateSegmentRefsInRule(_0x58e321,_0x105c56);}}function a145_0x4ecf(_0x58e0cb,_0x38aa0){_0x58e0cb=_0x58e0cb-0x143;const _0x3a8b03=a145_0x3a8b();let _0x4ecff2=_0x3a8b03[_0x58e0cb];return _0x4ecff2;}export function buildJourneysArray(_0x31828e,_0x56c4d8){const _0x24ec7e=a145_0x4ecf;return _0x31828e[_0x24ec7e(0x192)](_0x3ff518=>{const _0x10875a=_0x24ec7e,_0x57f851=_0x56c4d8?_0x3ff518[_0x10875a(0x183)]['id']===_0x56c4d8:_0x31828e[_0x10875a(0x194)]===0x1,_0x2fe333=_0x3ff518[_0x10875a(0x181)][_0x10875a(0x167)]?.[0x0],_0x59b2fa=_0x2fe333?.[_0x10875a(0x18a)]||_0x3ff518[_0x10875a(0x181)][_0x10875a(0x18a)],_0x10272a={'version':_0x2fe333?.[_0x10875a(0x172)]||_0x3ff518[_0x10875a(0x181)]['version']||_0x3ff518['item'][_0x10875a(0x171)],'state':_0x3ff518[_0x10875a(0x183)][_0x10875a(0x155)]===_0x10875a(0x143)?_0x10875a(0x143):_0x10875a(0x187),'stages':_0x2fe333?.[_0x10875a(0x176)]||_0x3ff518[_0x10875a(0x181)][_0x10875a(0x176)]||[],'id':_0x2fe333?.['id']||_0x3ff518[_0x10875a(0x181)]['id'],'version_number':_0x2fe333?.[_0x10875a(0x174)]||_0x3ff518['yaml'][_0x10875a(0x174)]};return _0x59b2fa&&(_0x10272a['goal']=_0x59b2fa),_0x57f851&&(_0x10272a[_0x10875a(0x16c)]=!![]),_0x10272a;});}function a145_0x3a8b(){const _0x296294=['index','branches','name','version','entries','version_number','journeyStages','stages','endsWith','activation','get','keys','versions','replace','object','all_columns','wait','10101413FLEnCT','yaml','find','item','startsWith','.yaml','notification','draft','set','entry_criteria','goal','reentry','milestone','decision_point','6unnsTq','trim','isArray','21014AFEdUL','map','100mCJFFo','length','launched','bundle_id','6793796SMxzvM','activation_template_id','join','segments','with','conditions','type','stringify','connection','string','sort','rule','activations','bundle_name','slice','schedule','state','connector_config','merged','null','journeyBundleName','values','exit_criteria','18oHrSxi','4727295oDSyhD','13557680mkasCz','condition','9038880FlLrck','journey','description','139689CxYpcL','steps','segment','toLowerCase','journeys','columns','push','some','attributes','latest','behavior','match'];a145_0x3a8b=function(){return _0x296294;};return a145_0x3a8b();}export function buildMergedJourneyDef(_0x22f6fe,_0x1d6e42,_0x3bce7f){const _0x27f5d8=a145_0x4ecf,_0xa4b233=_0x22f6fe[0x0]['yaml'],_0x2931a6=buildJourneysArray(_0x22f6fe,_0x3bce7f),{merged:_0x4e9d66,nameMapping:_0x1ed67c}=consolidateSegmentsByContent(_0x22f6fe[_0x27f5d8(0x192)](_0x5c76e3=>_0x5c76e3[_0x27f5d8(0x181)][_0x27f5d8(0x148)]),_0x1d6e42);updateSegmentRefsInSegments(_0x4e9d66,_0x1ed67c);const _0x50c52b=Array['from'](_0x1ed67c[_0x27f5d8(0x173)]())[_0x27f5d8(0x16a)](([_0x5d9179,_0x19db01])=>_0x5d9179!==_0x19db01&&_0x5d9179[_0x27f5d8(0x184)](_0x27f5d8(0x189)));let _0x13c900=_0x4e9d66,_0x26c3a5=new Map();if(_0x50c52b){const _0x42db74=consolidateSegmentsByContent([_0x4e9d66],_0x1d6e42);_0x13c900=_0x42db74[_0x27f5d8(0x157)],_0x26c3a5=_0x42db74['nameMapping'];}const _0x5888ca=new Map(_0x1ed67c);for(const [_0x242135,_0x4b3981]of _0x26c3a5['entries']()){_0x5888ca['set'](_0x242135,_0x4b3981);}for(const [_0xc9da23,_0x575a14]of _0x5888ca['entries']()){let _0x26c555=_0x575a14,_0x57a999=0x0;while(_0x5888ca['has'](_0x26c555)&&_0x5888ca[_0x27f5d8(0x179)](_0x26c555)!==_0x26c555&&_0x57a999<MAX_MAPPING_CHAIN_DEPTH){_0x26c555=_0x5888ca['get'](_0x26c555),_0x57a999++;}_0x26c555!==_0x575a14&&_0x5888ca['set'](_0xc9da23,_0x26c555);}for(const _0x339e50 of _0x2931a6){updateSegmentReferences(_0x339e50[_0x27f5d8(0x176)],_0x5888ca);}const {merged:_0x3f3105,nameMapping:_0x18faa3}=consolidateActivationsByContent(_0x22f6fe[_0x27f5d8(0x192)](_0x5c064a=>_0x5c064a[_0x27f5d8(0x181)][_0x27f5d8(0x151)]));for(const _0x3573d1 of _0x2931a6){updateActivationReferences(_0x3573d1[_0x27f5d8(0x176)],_0x18faa3);}let _0x471ef1=_0xa4b233[_0x27f5d8(0x18a)];if(_0x471ef1?.[_0x27f5d8(0x165)]){const _0x4b190a=_0x5888ca['get'](_0x471ef1[_0x27f5d8(0x165)]);_0x4b190a&&(_0x471ef1={..._0x471ef1,'segment':_0x4b190a});}for(const _0x51a097 of _0x2931a6){if(_0x51a097[_0x27f5d8(0x18a)]?.['segment']){const _0x3c8533=_0x5888ca[_0x27f5d8(0x179)](_0x51a097['goal'][_0x27f5d8(0x165)]);_0x3c8533&&(_0x51a097[_0x27f5d8(0x18a)]={..._0x51a097[_0x27f5d8(0x18a)],'segment':_0x3c8533});}}return _0x2931a6[_0x27f5d8(0x16a)](_0x2bc5f8=>_0x2bc5f8[_0x27f5d8(0x18a)])&&(_0x471ef1=undefined),{'type':_0x27f5d8(0x161),'name':_0xa4b233[_0x27f5d8(0x171)],'description':_0xa4b233[_0x27f5d8(0x162)],'goal':_0x471ef1,'reentry':_0xa4b233[_0x27f5d8(0x18b)],'segments':Object[_0x27f5d8(0x17a)](_0x13c900)['length']>0x0?_0x13c900:undefined,'activations':Object[_0x27f5d8(0x17a)](_0x3f3105)[_0x27f5d8(0x194)]>0x0?_0x3f3105:undefined,'journeys':_0x2931a6,'bundle_id':_0xa4b233[_0x27f5d8(0x144)],'bundle_name':_0xa4b233[_0x27f5d8(0x152)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x3c8a95,_0x3a2d0e,_0x1253f4,_0x2558d0){const _0x47f7cb=a145_0x4ecf,_0x3f752b=_0x3c8a95+':'+_0x3a2d0e,_0x29dbaa=_0x1253f4[_0x47f7cb(0x179)](_0x3f752b);if(_0x29dbaa)return _0x29dbaa;const _0x1fde78=await _0x2558d0(_0x3c8a95),_0x3c301e=_0x1fde78[_0x47f7cb(0x16b)][_0x47f7cb(0x159)]||_0x1fde78[_0x47f7cb(0x16b)][_0x47f7cb(0x171)],_0x4427e9=_0x1fde78[_0x47f7cb(0x16b)][_0x47f7cb(0x175)][_0x47f7cb(0x182)](_0x166af3=>String(_0x166af3['id'])===String(_0x3a2d0e)),_0x29ff14=_0x4427e9?.['name']||_0x3a2d0e,_0x2bc9e5={'journeyName':_0x3c301e,'stageName':_0x29ff14};return _0x1253f4['set'](_0x3f752b,_0x2bc9e5),_0x2bc9e5;}export function formatApiJourneyName(_0x2a1747,_0x2ea932){return _0x2ea932+'\x20('+_0x2a1747+')';}export function isLocalJourneyRef(_0x11ea03){const _0x11e1b0=a145_0x4ecf;return _0x11ea03['endsWith']('.yml')||_0x11ea03[_0x11e1b0(0x177)](_0x11e1b0(0x185));}export function buildLocalRuleToNameMapping(_0x180e3d){const _0x3bee91=a145_0x4ecf,_0x468072=new Map();if(!_0x180e3d)return _0x468072;for(const [_0x469eb3,_0x46a744]of Object[_0x3bee91(0x173)](_0x180e3d)){if(_0x46a744['rule']){const _0x18035e=serializeRule(_0x46a744[_0x3bee91(0x150)]),_0x287b9d=_0x468072[_0x3bee91(0x179)](_0x18035e)||[];_0x287b9d['push'](_0x469eb3),_0x468072[_0x3bee91(0x188)](_0x18035e,_0x287b9d);}}return _0x468072;}export function buildLocalRuleToNameMappingFromJourney(_0x103ab8){const _0x269df1=a145_0x4ecf,_0x16e520=_0x103ab8[_0x269df1(0x148)];if(!_0x16e520)return new Map();const _0x53e1ab=collectSegmentUsageCounts(_0x103ab8),_0x468a59=new Map();let _0x2fcbcc=0x0;for(const [_0x15dfad,_0x85c296]of Object[_0x269df1(0x173)](_0x16e520)){if(!_0x85c296[_0x269df1(0x150)]){_0x2fcbcc++;continue;}const _0x2012c4=serializeRule(_0x85c296[_0x269df1(0x150)]),_0x53f433=_0x468a59[_0x269df1(0x179)](_0x2012c4)||[];_0x53f433[_0x269df1(0x169)]({'name':_0x15dfad,'index':_0x2fcbcc}),_0x468a59['set'](_0x2012c4,_0x53f433),_0x2fcbcc++;}const _0x29b104=new Map();for(const [_0x3d5721,_0x370cd8]of _0x468a59){const _0x26c07a=_0x370cd8['slice']()[_0x269df1(0x14f)]((_0x229191,_0x3e408c)=>{const _0x55c81c=_0x269df1,_0x29425d=_0x53e1ab[_0x55c81c(0x179)](_0x229191['name'])||0x0,_0x46a9c0=_0x53e1ab['get'](_0x3e408c['name'])||0x0;if(_0x29425d!==_0x46a9c0)return _0x46a9c0-_0x29425d;return _0x229191[_0x55c81c(0x16f)]-_0x3e408c[_0x55c81c(0x16f)];})[_0x269df1(0x192)](_0x3bfa60=>_0x3bfa60[_0x269df1(0x171)]);_0x29b104[_0x269df1(0x188)](_0x3d5721,_0x26c07a);}return _0x29b104;}export function collectSegmentUsageCounts(_0x4fc69d){const _0x1196df=a145_0x4ecf,_0x76d871=new Map(),_0x562a7c=_0x416d5f=>{const _0x21f61b=a145_0x4ecf;if(!_0x416d5f)return;_0x76d871[_0x21f61b(0x188)](_0x416d5f,(_0x76d871['get'](_0x416d5f)||0x0)+0x1);},_0x429eb9=_0x1d598a=>{const _0x25ce04=a145_0x4ecf;for(const _0x320588 of _0x1d598a){_0x562a7c(_0x320588[_0x25ce04(0x189)]?.[_0x25ce04(0x165)]);if(_0x320588[_0x25ce04(0x15b)])for(const _0x300d2b of _0x320588[_0x25ce04(0x15b)]){_0x562a7c(_0x300d2b[_0x25ce04(0x165)]);}_0x562a7c(_0x320588[_0x25ce04(0x18c)]?.[_0x25ce04(0x165)]);if(_0x320588['steps'])for(const _0x47a0e5 of _0x320588[_0x25ce04(0x164)]){if(_0x47a0e5[_0x25ce04(0x14b)]===_0x25ce04(0x18d))for(const _0x40567b of _0x47a0e5[_0x25ce04(0x149)][_0x25ce04(0x170)]){_0x562a7c(_0x40567b[_0x25ce04(0x165)]);}else _0x47a0e5[_0x25ce04(0x14b)]===_0x25ce04(0x17f)&&_0x562a7c(_0x47a0e5[_0x25ce04(0x149)][_0x25ce04(0x15f)]?.[_0x25ce04(0x165)]);}}};_0x562a7c(_0x4fc69d[_0x1196df(0x18a)]?.['segment']);if(_0x4fc69d[_0x1196df(0x167)])for(const _0x364cbb of _0x4fc69d['journeys']){_0x562a7c(_0x364cbb[_0x1196df(0x18a)]?.[_0x1196df(0x165)]),_0x429eb9(_0x364cbb[_0x1196df(0x176)]);}_0x4fc69d[_0x1196df(0x176)]&&_0x429eb9(_0x4fc69d[_0x1196df(0x176)]);if(_0x4fc69d[_0x1196df(0x17b)])for(const _0x1166f5 of _0x4fc69d[_0x1196df(0x17b)]){_0x429eb9(_0x1166f5[_0x1196df(0x176)]);}return _0x76d871;}