@treasuredata/tdx 2026.5.1 → 2026.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) 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/table-deleted.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/tools/work-create-item.js +1 -1
  79. package/dist/mcp/utils.js +1 -1
  80. package/dist/proxy/claude-usage-tracker.js +1 -1
  81. package/dist/proxy/passthrough-server.js +1 -1
  82. package/dist/proxy/sse-usage-parser.js +1 -1
  83. package/dist/sdk/agent/agent-config.js +1 -1
  84. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  85. package/dist/sdk/agent/agent-yaml.js +1 -1
  86. package/dist/sdk/agent/test/evaluator.js +1 -1
  87. package/dist/sdk/agent/test/executor.js +1 -1
  88. package/dist/sdk/agent/test/index.js +1 -1
  89. package/dist/sdk/agent/test/output.js +1 -1
  90. package/dist/sdk/agent/test/parser.js +1 -1
  91. package/dist/sdk/agent/tool-target-registry.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/cas/cas-api-client.js +1 -1
  94. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  95. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  96. package/dist/sdk/cas/index.js +1 -1
  97. package/dist/sdk/cas/pull-workflow.js +1 -1
  98. package/dist/sdk/cas/push-workflow.js +1 -1
  99. package/dist/sdk/client/cdp-api-client.js +1 -1
  100. package/dist/sdk/client/delivery-api-client.js +1 -1
  101. package/dist/sdk/client/endpoints.js +1 -1
  102. package/dist/sdk/client/engage-api-client.js +1 -1
  103. package/dist/sdk/client/http-client.js +1 -1
  104. package/dist/sdk/client/llm-api-client.js +1 -1
  105. package/dist/sdk/client/oauth-refresh.js +1 -1
  106. package/dist/sdk/client/rate-limiter.js +1 -1
  107. package/dist/sdk/client/td-api-client.js +1 -1
  108. package/dist/sdk/client/trino-api-client.js +1 -1
  109. package/dist/sdk/client/workflow-client.js +1 -1
  110. package/dist/sdk/connection-validator.js +1 -1
  111. package/dist/sdk/connection.js +1 -1
  112. package/dist/sdk/delivery.js +1 -1
  113. package/dist/sdk/engage/campaign-pull.js +1 -1
  114. package/dist/sdk/engage/campaign-push.js +1 -1
  115. package/dist/sdk/engage/campaign-validator.js +1 -1
  116. package/dist/sdk/engage/campaign-yaml.js +1 -1
  117. package/dist/sdk/engage/template-pull.js +1 -1
  118. package/dist/sdk/engage/template-push.js +1 -1
  119. package/dist/sdk/engage/template-validator.js +1 -1
  120. package/dist/sdk/engage/template-yaml.js +1 -1
  121. package/dist/sdk/engage/types/campaign-def.js +1 -1
  122. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  123. package/dist/sdk/engage/types/template-schema.js +1 -1
  124. package/dist/sdk/engage.js +1 -1
  125. package/dist/sdk/errors.js +1 -1
  126. package/dist/sdk/index.js +1 -1
  127. package/dist/sdk/io/index.js +1 -1
  128. package/dist/sdk/io/node-filesystem.js +1 -1
  129. package/dist/sdk/job.js +1 -1
  130. package/dist/sdk/journey.js +1 -1
  131. package/dist/sdk/llm/chat-cache.js +1 -1
  132. package/dist/sdk/llm/index.js +1 -1
  133. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  134. package/dist/sdk/llm/model-factors.js +1 -1
  135. package/dist/sdk/llm/user-settings.js +1 -1
  136. package/dist/sdk/personalization.js +1 -1
  137. package/dist/sdk/policy.js +1 -1
  138. package/dist/sdk/query/deleted-table-validation.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/segment-validator.js.map +1 -1
  159. package/dist/sdk/segment/target-resolution.js +1 -1
  160. package/dist/sdk/segment/tdx-config.js +1 -1
  161. package/dist/sdk/segment/types/activation-schema.js +1 -1
  162. package/dist/sdk/segment/types/journey-def.js +1 -1
  163. package/dist/sdk/segment/types/journey-schema.js +1 -1
  164. package/dist/sdk/segment/types/segment-def.js +1 -1
  165. package/dist/sdk/segment/types/segment-schema.js +1 -1
  166. package/dist/sdk/segment/validate-files.js +1 -1
  167. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  168. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  169. package/dist/sdk/segment/yaml-validator.js +1 -1
  170. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  171. package/dist/sdk/segment.js +1 -1
  172. package/dist/sdk/types/index.js +1 -1
  173. package/dist/sdk/types/progress.js +1 -1
  174. package/dist/sdk/types/workspace.js +1 -1
  175. package/dist/sdk/user.js +1 -1
  176. package/dist/sdk/util/format-detector.js +1 -1
  177. package/dist/sdk/util/formatters.js +1 -1
  178. package/dist/sdk/util/index.js +1 -1
  179. package/dist/sdk/util/paginate.js +1 -1
  180. package/dist/sdk/util/tree-formatter.js +1 -1
  181. package/dist/sdk/workflow/archive-validation.js +1 -1
  182. package/dist/sdk/workflow/clone-workflow.js +1 -1
  183. package/dist/sdk/workflow/index.js +1 -1
  184. package/dist/sdk/workflow/pull-workflow.js +1 -1
  185. package/dist/sdk/workflow/push-workflow.js +1 -1
  186. package/dist/sdk/workflow/task-graph.js +1 -1
  187. package/dist/sdk/workflow/tdx-config.js +1 -1
  188. package/dist/sdk/workflow/workflow-utils.js +1 -1
  189. package/dist/sdk/workspace/access-tracker.js +1 -1
  190. package/dist/sdk/workspace/frontmatter.js +1 -1
  191. package/dist/sdk/workspace/git.js +1 -1
  192. package/dist/sdk/workspace/index.js +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.js +1 -1
  196. package/dist/test-utils/command-runner.js +1 -1
  197. package/dist/test-utils/factories.js +1 -1
  198. package/dist/test-utils/fixtures.js +1 -1
  199. package/dist/test-utils/http-mock.js +1 -1
  200. package/dist/test-utils/index.js +1 -1
  201. package/dist/utils/async.js +1 -1
  202. package/dist/utils/colors.js +1 -1
  203. package/dist/utils/diff.js +1 -1
  204. package/dist/utils/file-permissions.js +1 -1
  205. package/dist/utils/file-reader.js +1 -1
  206. package/dist/utils/github-releases.js +1 -1
  207. package/dist/utils/global-cache.js +1 -1
  208. package/dist/utils/json-loader.js +1 -1
  209. package/dist/utils/local-cache.js +1 -1
  210. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  211. package/dist/utils/logger/formatters/index.js +1 -1
  212. package/dist/utils/logger/handlers/console-handler.js +1 -1
  213. package/dist/utils/logger/handlers/file-handler.js +1 -1
  214. package/dist/utils/logger/handlers/index.js +1 -1
  215. package/dist/utils/logger/handlers/null-handler.js +1 -1
  216. package/dist/utils/logger/index.js +1 -1
  217. package/dist/utils/logger/logger.js +1 -1
  218. package/dist/utils/logger/types.js +1 -1
  219. package/dist/utils/option-validation.js +1 -1
  220. package/dist/utils/process.js +1 -1
  221. package/dist/utils/prompt.js +1 -1
  222. package/dist/utils/spinner.js +1 -1
  223. package/dist/utils/sse-parser.js +1 -1
  224. package/dist/utils/string-utils.js +1 -1
  225. package/dist/utils/table-ref-parser.js +1 -1
  226. package/dist/utils/tdx-logger.js +1 -1
  227. package/dist/utils/version-check.js +1 -1
  228. package/package.json +1 -1
@@ -1 +1 @@
1
- const a155_0x30a951=a155_0x5a27;(function(_0x4fde03,_0x5836bc){const _0x5db042=a155_0x5a27,_0x2582f8=_0x4fde03();while(!![]){try{const _0x3b9d70=parseInt(_0x5db042(0x28f))/0x1+parseInt(_0x5db042(0x206))/0x2*(parseInt(_0x5db042(0x1cc))/0x3)+parseInt(_0x5db042(0x210))/0x4+parseInt(_0x5db042(0x20f))/0x5+-parseInt(_0x5db042(0x1bb))/0x6*(-parseInt(_0x5db042(0x1dc))/0x7)+parseInt(_0x5db042(0x281))/0x8+-parseInt(_0x5db042(0x1a9))/0x9;if(_0x3b9d70===_0x5836bc)break;else _0x2582f8['push'](_0x2582f8['shift']());}catch(_0x40303f){_0x2582f8['push'](_0x2582f8['shift']());}}}(a155_0x3980,0x29673));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a155_0x30a951(0x1ec));export const PENDING_SEGMENT_PREFIX=a155_0x30a951(0x29f);function a155_0x3980(){const _0x1b191a=['journey_created','skipSegments','resolveJourneyId','folderId','delete','milestone','withProgress','2370976TvtZQi','stages','createActivation','verbose','getSegment','Failed\x20to\x20fetch\x20referenced\x20segment\x20','folderPath','existingSegments','journey_updating','values','updated','activationContext','Creating\x20segment\x20\x27','reduce','229747YUuUVv','flatMap','split','Stage\x20\x27','stage\x20\x27','folder_created','connectionIdToNameMap','toISOString','journeyBundleName','Created\x20journey\x20\x27','activationStepsById','Entry\x20criteria:\x20','__pending_act_','toString','debug','match','__pending_','activation_template_id','run_after_journey_refresh','activation_','\x27\x20exit\x20criteria','behavior','columns','journeyById','11453130MVaGZq','Condition','Delete\x20the\x20push\x20recovery\x20file\x20(','getSegmentEntity\x20also\x20failed\x20for\x20','segment','connector_config','replace','Matched\x20server\x20segment\x20\x27','getSegmentEntity','uniqueSegmentName','entryCriteria','and\x20the\x20server\x20segment,\x20then\x20retry.','activation_updating','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','updateActivation','journeyBundlesByFolderAndName','from','\x20error(s)','915546rRRMsL','getJourney','embeddedSegmentNameToId','embedded_activation_creating','activationsBySegmentId','data','updateSegmentById','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','digest','JOURNEY_SYNTAX_ERROR','logDeleted','set','nameToType','embedded_segment_creating','resolvedRule','isArray','diff','3iPBsml','Segment\x20not\x20found','createdSegmentId','Updating\x20activation\x20\x27','logInfo','waitStep','idToEmailMap','parse','createFolder','getSegment\x20failed\x20for\x20','trim','journeyActivationNameToId','join','progress','unchanged','fetchJourney','7jUHedI','\x20(referenced\x20in\x20journey\x20','attributes','description','parentSegmentFolder','idToName','versionNumber','folder','ACTIVATION_SYNTAX_ERROR','keys','max','index','../../utils/async.js','\x20activation\x20\x27','localName','resolveSegment','tdx.sdk.push-workflow','exitCriterias','Name\x20has\x20already\x20been\x20taken','draft','push','toLowerCase','activationActions','length','get','sort','entries','startsWith','add','action','goal','Updated\x20journey\x20\x27','schedule','\x0a\x20\x20','\x27\x20for\x20','./journey-yaml.js','connection','filter','journeyId','all','segmentId','null','631586wjxCjC','conditionSegmentId','\x27\x20entry\x20criteria','name','effectiveFolderId','isNew','journey','\x27\x20decision\x20point\x20branch\x20\x27','type','1171710eMfGum','853248dMUndJ','deleted','user','ACTIVATION_UPDATE_ERROR','hasChanges','Failed\x20to\x20resolve\x20segment\x20','Updated\x20activation\x20\x27','Fetching\x20','hex','./child-segment-yaml.js','Created\x20segment\x20\x27','deps',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','some','branches','activation_created','rule','journeyStages','parentId','Failed\x20to\x20','yamlConfig','\x27...','journey_updated','find','folder_creating','buildUserMaps','waitStepUnit','createJourneySegment','\x27\x20wait\x20condition','segments','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Failed\x20to\x20resolve\x20activation\x20','embedded_segment_created','Duration','absolutePath','journeyActivationStepId','Activation\x20not\x20found:\x20','segmentByFolderAndName','journeyName','listActivations','activation_updated','has','onProgress','parseDocument','segmentFolderId','SEGMENT_UPDATE_ERROR','Creating\x20activation\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','segment_creating','utf-8','steps','slice','existingJourney','segmentNameToId','create','Deleting\x20activation\x20\x27','valid','segment_created','all_columns','uniqueServerName','stringify','Deleted\x20segment\x20\x27','results','logWarning','created','logSuccess','WaitStep','NOT_FOUND','Updated\x20segment\x20\x27','\x27\x20milestone','size','map','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','item','getActivation','activations','rootFolderId','conditionTimeoutUnit','SEGMENT_NOT_FOUND','entry','Updating\x20segment\x20\x27','conditions','journeys','\x27\x20from\x20file:\x20','kind','sha1','yamlActivation','relative','journey_entry_criteria_','Segment\x20not\x20found:\x20','update','DecisionPoint','state','deleteActivation','existingSegment','waitStepType','validatedRequest','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','entry_criteria','segment_deleted','Activation','INTERNAL','dirname','conditionTimeoutDuration','existingActivation'];a155_0x3980=function(){return _0x1b191a;};return a155_0x3980();}export const PENDING_ACTIVATION_PREFIX=a155_0x30a951(0x29b);export function createPendingSegmentId(_0x314e0a){return''+PENDING_SEGMENT_PREFIX+_0x314e0a+'__';}export function isPendingSegmentId(_0x3d18cc){const _0x178001=a155_0x30a951;return _0x3d18cc['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x3d18cc[_0x178001(0x1f7)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1c35c8){const _0x43b0bc=a155_0x30a951;return _0x1c35c8[_0x43b0bc(0x1af)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4d6680){return''+PENDING_ACTIVATION_PREFIX+_0x4d6680+'__';}export function isPendingActivationId(_0x4037f4){const _0x4db08c=a155_0x30a951;return _0x4037f4[_0x4db08c(0x1f7)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x21ace2){const _0x27068d=a155_0x30a951;return _0x21ace2[_0x27068d(0x1af)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x86a2e6,_0xf08637){const _0x56e036=a155_0x30a951,_0x4f5827=_0x86a2e6+'::'+(_0xf08637[_0x56e036(0x1d6)]()||_0x56e036(0x1ad)),_0x134def=createHash(_0x56e036(0x266))[_0x56e036(0x26b)](_0x4f5827)[_0x56e036(0x1c3)](_0x56e036(0x218))[_0x56e036(0x244)](0x0,0xc);return _0x56e036(0x269)+_0x134def;}export function ensureJourneyDefaults(_0x2f22ea){const _0x2286ed=a155_0x30a951;!_0x2f22ea[_0x2286ed(0x1df)]&&(_0x2f22ea[_0x2286ed(0x1df)]=''),!_0x2f22ea[_0x2286ed(0x26d)]&&(_0x2f22ea[_0x2286ed(0x26d)]=_0x2286ed(0x1ef));}export function injectExistingStageIds(_0x1e4dc4,_0x125b34){const _0x2372c4=a155_0x30a951,_0x20cb4b=new Map(_0x125b34[_0x2372c4(0x258)](_0x3082d4=>[_0x3082d4[_0x2372c4(0x209)],_0x3082d4['id']]));for(const _0x2bca89 of _0x1e4dc4){if(!_0x2bca89['id']){const _0x3087ab=_0x20cb4b[_0x2372c4(0x1f4)](_0x2bca89['name']);_0x3087ab&&(_0x2bca89['id']=_0x3087ab);}}}export function resolveTDFolderPath(_0x3d22c2,_0x4619c7,_0x45e2fb){const _0x1e5c2a=a155_0x30a951;if(!_0x4619c7)return _0x3d22c2;if(_0x3d22c2===_0x45e2fb||_0x3d22c2[_0x1e5c2a(0x1f7)](_0x45e2fb+'/'))return _0x3d22c2;return _0x3d22c2?_0x45e2fb+'/'+_0x3d22c2:_0x45e2fb;}export function addFoldersToCreate(_0x5679e2,_0x1009e4,_0x123d09){const _0x2245fa=a155_0x30a951;if(!_0x5679e2)return;if(_0x1009e4[_0x2245fa(0x239)](_0x5679e2))return;const _0x686b71=_0x5679e2[_0x2245fa(0x291)]('/');let _0x3249ee='';for(const _0x32ec82 of _0x686b71){_0x3249ee=_0x3249ee?_0x3249ee+'/'+_0x32ec82:_0x32ec82,!_0x1009e4[_0x2245fa(0x239)](_0x3249ee)&&_0x123d09['add'](_0x3249ee);}}export function sortFoldersByDepth(_0x532bb3){const _0x3bf5fd=a155_0x30a951;return[..._0x532bb3][_0x3bf5fd(0x1f5)]((_0x2129db,_0x3d7b5f)=>{const _0xe53c89=_0x3bf5fd,_0x1a6549=(_0x2129db[_0xe53c89(0x29e)](/\//g)||[])[_0xe53c89(0x1f3)],_0x458445=(_0x3d7b5f[_0xe53c89(0x29e)](/\//g)||[])[_0xe53c89(0x1f3)];return _0x1a6549-_0x458445;});}import*as a155_0x26d673 from'yaml';import{readFileSync}from'fs';import a155_0x5c2d81 from'path';import{isJourneyDef,parseYamlString as a155_0x14fa23,toYamlString as a155_0x199b9e,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x494c4c){const _0x356020=a155_0x30a951;if(Array[_0x356020(0x1ca)](_0x494c4c))return'['+_0x494c4c[_0x356020(0x258)](_0x38f83c=>stableStringify(_0x38f83c))[_0x356020(0x1d8)](',')+']';if(_0x494c4c&&typeof _0x494c4c==='object'){const _0x45266c=_0x494c4c,_0x347ee5=Object['keys'](_0x45266c)[_0x356020(0x1f5)](),_0x4e1030=_0x347ee5[_0x356020(0x258)](_0x4e8a24=>'\x22'+_0x4e8a24+'\x22:'+stableStringify(_0x45266c[_0x4e8a24]));return'{'+_0x4e1030['join'](',')+'}';}const _0x1dc8fe=JSON[_0x356020(0x24d)](_0x494c4c);return _0x1dc8fe===undefined?_0x356020(0x205):_0x1dc8fe;}function activationSignature(_0x3bffed){const _0x10fe79=a155_0x30a951,_0x292c94={'connection':_0x3bffed[_0x10fe79(0x200)],..._0x3bffed[_0x10fe79(0x24b)]!==undefined&&{'all_columns':_0x3bffed[_0x10fe79(0x24b)]},..._0x3bffed[_0x10fe79(0x1a7)]!==undefined&&{'columns':_0x3bffed['columns']},..._0x3bffed[_0x10fe79(0x2a4)]!==undefined&&{'behavior':_0x3bffed[_0x10fe79(0x2a4)]},..._0x3bffed[_0x10fe79(0x1fc)]!==undefined&&{'schedule':_0x3bffed['schedule']},..._0x3bffed['notification']!==undefined&&{'notification':_0x3bffed['notification']},..._0x3bffed[_0x10fe79(0x1ae)]!==undefined&&{'connector_config':_0x3bffed[_0x10fe79(0x1ae)]},..._0x3bffed['activation_template_id']!==undefined&&{'activation_template_id':_0x3bffed[_0x10fe79(0x2a0)]}};return stableStringify(_0x292c94);}async function fetchSegment(_0x4c3ff8,_0x1332fc,_0x55b62e,_0x2b1363){const _0x2c1aa1=a155_0x30a951,_0x1205be=_0x2b1363?.[_0x2c1aa1(0x227)](_0x1a6b93=>_0x1a6b93['id']===_0x55b62e);if(_0x1205be)return _0x1205be;try{return await _0x4c3ff8['segment'][_0x2c1aa1(0x285)](_0x1332fc,_0x55b62e);}catch(_0x4c7e7c){logger[_0x2c1aa1(0x29d)](_0x2c1aa1(0x1d5)+_0x55b62e+_0x2c1aa1(0x21c)+_0x4c7e7c);try{return await _0x4c3ff8[_0x2c1aa1(0x1ad)][_0x2c1aa1(0x1b1)](_0x55b62e);}catch(_0x572c3f){return logger[_0x2c1aa1(0x29d)](_0x2c1aa1(0x1ac)+_0x55b62e+':\x20'+_0x572c3f),null;}}}function recoverSegmentIdsFromPushRecovery(_0x13ade3,_0x3d88c7,_0x514641){const _0x1555a8=a155_0x30a951,_0x4da611=readPushRecovery(_0x13ade3['absolutePath']);if(_0x4da611?.[_0x1555a8(0x236)]===_0x13ade3[_0x1555a8(0x224)][_0x1555a8(0x209)])for(const [_0x289088,_0x2bc384]of Object['entries'](_0x4da611[_0x1555a8(0x22d)])){const _0x4cdc89=generateDeterministicJourneySegmentName(_0x13ade3[_0x1555a8(0x224)][_0x1555a8(0x209)],_0x289088);_0x2bc384[_0x1555a8(0x24c)]===_0x4cdc89&&(_0x3d88c7[_0x1555a8(0x1c6)](_0x289088,_0x2bc384[_0x1555a8(0x204)]),_0x514641[_0x1555a8(0x1c6)](_0x289088,_0x2bc384['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x504ecf,_0x5b37a7,_0x32571e,_0x3443e7){const _0x9df7de=a155_0x30a951;let _0x5319ec;try{_0x5319ec=await _0x504ecf[_0x9df7de(0x1ad)][_0x9df7de(0x22b)]({'name':_0x32571e[_0x9df7de(0x1b2)],'description':_0x32571e[_0x9df7de(0x1df)],'journeyId':_0x32571e[_0x9df7de(0x202)],'rule':_0x3443e7(_0x32571e[_0x9df7de(0x1c9)],!![]),'countPopulation':!![],'parentFolderId':_0x32571e[_0x9df7de(0x27d)],'audienceId':_0x32571e[_0x9df7de(0x222)]});}catch(_0x16a1b2){const _0x1dd958=_0x16a1b2 instanceof Error&&_0x16a1b2['message']['includes'](_0x9df7de(0x1ee));if(_0x1dd958){const _0x2e0b50=readPushRecovery(_0x5b37a7[_0x9df7de(0x232)]),_0x154df6=_0x2e0b50?.[_0x9df7de(0x236)]===_0x5b37a7['yamlConfig'][_0x9df7de(0x209)]?_0x2e0b50[_0x9df7de(0x22d)][_0x32571e[_0x9df7de(0x1ea)]]:undefined;if(_0x154df6?.[_0x9df7de(0x24c)]===_0x32571e[_0x9df7de(0x1b2)])await _0x504ecf['segment'][_0x9df7de(0x1c1)](_0x32571e[_0x9df7de(0x222)],_0x154df6['segmentId'],{'description':_0x32571e[_0x9df7de(0x1df)],'rule':_0x3443e7(_0x32571e[_0x9df7de(0x1c9)],!![]),'countPopulation':!![]}),_0x5319ec=_0x154df6[_0x9df7de(0x204)];else throw new SDKError(ErrorCode[_0x9df7de(0x23d)],'Embedded\x20segment\x20\x27'+_0x32571e['localName']+_0x9df7de(0x272)+(_0x9df7de(0x1ab)+_0x5b37a7[_0x9df7de(0x232)][_0x9df7de(0x1af)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x9df7de(0x1b4),_0x16a1b2);}else throw _0x16a1b2;}return saveSegmentToPushRecovery(_0x5b37a7[_0x9df7de(0x232)],_0x5b37a7['yamlConfig'][_0x9df7de(0x209)],_0x32571e['localName'],{'segmentId':_0x5319ec,'uniqueServerName':_0x32571e[_0x9df7de(0x1b2)],'createdAt':new Date()[_0x9df7de(0x296)]()}),_0x5319ec;}export async function prepareSegmentFiles(_0x3a52dd,_0xe5541f,_0x1a17e7,_0x455a47,_0xe9479d){const _0x505477=a155_0x30a951,{activationDefToCreateRequest:_0x5ffc62}=await import(_0x505477(0x219)),_0xefd141=[],_0x2ea80b=new Set();for(const {yamlConfig:_0x462832,folderPath:_0x350ef6,sourcePath:_0x33dbbc}of _0x3a52dd){const _0x10606b=resolveTDFolderPath(_0x350ef6,_0x455a47,_0xe9479d),_0x1f5bc1=_0x10606b+':'+_0x462832[_0x505477(0x209)],_0x5c89a0=_0xe5541f[_0x505477(0x235)][_0x505477(0x1f4)](_0x1f5bc1),_0x28936c=_0x5c89a0?_0xe5541f[_0x505477(0x1bf)][_0x505477(0x1f4)](_0x5c89a0['id'])||[]:[];addFoldersToCreate(_0x10606b,_0xe5541f['folderPathToId'],_0x2ea80b);const _0x5e1f55=calculateActivationActions(_0x462832['activations']||[],_0x28936c,_0xe5541f[_0x505477(0x1d2)],_0xe5541f[_0x505477(0x295)]);for(const _0x1312b8 of _0x5e1f55){(_0x1312b8['type']==='create'||_0x1312b8[_0x505477(0x20e)]===_0x505477(0x26b))&&_0x1312b8[_0x505477(0x267)]&&(_0x1312b8[_0x505477(0x271)]=await _0x5ffc62(_0x1312b8[_0x505477(0x267)],_0x1a17e7));}const _0xe0ab0d=calculateSegmentDiff(_0x462832,_0x5c89a0,_0x28936c,_0xe5541f[_0x505477(0x1d2)],_0xe5541f[_0x505477(0x295)]);_0xefd141[_0x505477(0x1f0)]({'relativePath':_0x462832['name'],'absolutePath':_0x33dbbc,'yamlConfig':_0x462832,'folderPath':_0x10606b,'existingSegment':_0x5c89a0,'existingActivations':_0x28936c,'isNew':_0xe0ab0d[_0x505477(0x20b)],'hasChanges':_0xe0ab0d[_0x505477(0x214)],'diff':_0xe0ab0d['diff'],'activationActions':_0x5e1f55});}return{'segmentFiles':_0xefd141,'foldersToCreate':_0x2ea80b};}export async function prepareJourneyFiles(_0x5905a7,_0x346cec,_0x2a4c51,_0x30aa0b){const _0x2f1115=a155_0x30a951,_0x5a5b38=[],_0x5dd846=new Set();for(const {yamlConfig:_0xe0a2df,folderPath:_0x9fad6f,sourcePath:_0x30d97c}of _0x5905a7){const _0x4850c9=resolveTDFolderPath(_0x9fad6f,_0x2a4c51,_0x30aa0b),_0x226241=_0x4850c9+':'+_0xe0a2df[_0x2f1115(0x209)],_0x2a6719=_0x346cec[_0x2f1115(0x1b8)][_0x2f1115(0x1f4)](_0x226241);let _0x3ec71a,_0x3ac0de;if(_0x2a6719&&_0x2a6719[_0x2f1115(0x1f3)]>0x0){const _0x451269=buildLocalExpandedRuleMappings(_0xe0a2df),{createYamlContext:_0x1e3786,prefetchJourneySegments:_0x4bfaef}=createPushYamlContextForBundle(_0x346cec[_0x2f1115(0x21b)],_0x346cec[_0x2f1115(0x222)],_0x346cec[_0x2f1115(0x288)],_0x451269,_0x346cec[_0x2f1115(0x1d2)],_0x346cec[_0x2f1115(0x295)],_0x346cec[_0x2f1115(0x299)],_0x346cec[_0x2f1115(0x1a8)]);await _0x4bfaef(_0x2a6719[_0x2f1115(0x258)](_0x53b051=>_0x53b051['id']));const _0x589858=await _0x346cec[_0x2f1115(0x21b)][_0x2f1115(0x20c)]['getLatestJourneyId'](_0x2a6719[0x0]['journeyBundleId']),_0x3e29bb=hasMultipleVersions(_0xe0a2df),_0x3ffe7d=async _0x42a18e=>{const _0x551eb0=_0x2f1115,_0x28f69a=_0x346cec[_0x551eb0(0x1a8)]?.[_0x551eb0(0x1f4)](_0x42a18e);if(_0x28f69a)return _0x28f69a;return _0x346cec[_0x551eb0(0x1db)]({'journeyId':_0x42a18e,'journeyName':_0xe0a2df[_0x551eb0(0x209)],'isMultiVersion':_0x2a6719[_0x551eb0(0x1f3)]>0x1});};if(_0x3e29bb&&_0x2a6719['length']>0x1){const _0x2ed059=[];for(const _0x303e2b of _0x2a6719){const _0x321b76=_0x303e2b[_0x2f1115(0x1e2)]||0x1;_0x346cec[_0x2f1115(0x1d9)]?.['update'](_0x2f1115(0x217)+_0xe0a2df[_0x2f1115(0x209)]+'\x20v'+_0x321b76);const _0x1de52c=await _0x3ffe7d(_0x303e2b['id']),_0x3b69a5=_0x1e3786(_0x303e2b['id']),_0xf2ff3b=await journeyResponseToDef(_0x1de52c,_0x3b69a5);_0x2ed059['push']({'item':_0x303e2b,'yaml':_0xf2ff3b});}const _0x1f2953=buildLocalRuleToNameMappingFromJourney(_0xe0a2df);_0x3ac0de=buildMergedJourneyDef(_0x2ed059,_0x1f2953,_0x589858);const _0x5ce3b5=Math[_0x2f1115(0x1e6)](..._0x2ed059[_0x2f1115(0x258)](_0x178d88=>_0x178d88[_0x2f1115(0x25a)][_0x2f1115(0x1e2)]||0x0)),_0x54210f=_0x2a6719[_0x2f1115(0x227)](_0x15da65=>(_0x15da65[_0x2f1115(0x1e2)]||0x0)===_0x5ce3b5);_0x54210f&&(_0x346cec[_0x2f1115(0x1d9)]?.[_0x2f1115(0x26b)]('Fetching\x20'+_0xe0a2df[_0x2f1115(0x209)]+'\x20v'+_0x5ce3b5),_0x3ec71a=await _0x3ffe7d(_0x54210f['id']));}else{const _0x28c914=_0x2a6719[_0x2a6719[_0x2f1115(0x1f3)]-0x1];_0x346cec[_0x2f1115(0x1d9)]?.[_0x2f1115(0x26b)](_0x2f1115(0x217)+_0xe0a2df[_0x2f1115(0x209)]),_0x3ec71a=await _0x3ffe7d(_0x28c914['id']);const _0x2a44be=_0x1e3786(_0x28c914['id']),_0x574644=await journeyResponseToDef(_0x3ec71a,_0x2a44be),_0x18c5a5=buildLocalRuleToNameMappingFromJourney(_0xe0a2df);_0x3ac0de=buildMergedJourneyDef([{'item':_0x28c914,'yaml':_0x574644}],_0x18c5a5,_0x589858);}}addFoldersToCreate(_0x4850c9,_0x346cec['folderPathToId'],_0x5dd846);const _0x57aed4=calculateJourneyDiff(_0xe0a2df,_0x3ac0de);_0x5a5b38[_0x2f1115(0x1f0)]({'relativePath':_0xe0a2df['name'],'absolutePath':_0x30d97c,'yamlConfig':_0xe0a2df,'folderPath':_0x4850c9,'existingJourney':_0x3ec71a,'isNew':_0x57aed4[_0x2f1115(0x20b)],'hasChanges':_0x57aed4[_0x2f1115(0x214)],'diff':_0x57aed4[_0x2f1115(0x1cb)]});}return{'journeyFiles':_0x5a5b38,'foldersToCreate':_0x5dd846};}export function calculateActivationActions(_0x296a78,_0x5c5a68,_0x1a604f,_0x12b47f){const _0x1488b7=a155_0x30a951,_0x2e7373=[],_0x2ee0f7=new Map();for(const _0xcaf8a0 of _0x5c5a68){_0x2ee0f7['set'](_0xcaf8a0[_0x1488b7(0x209)],_0xcaf8a0);}const _0x1939cf=new Map();for(const _0x561084 of _0x296a78){_0x1939cf['set'](_0x561084['name'],_0x561084);}for(const _0x4245b2 of _0x296a78){const _0x1366e4=_0x2ee0f7[_0x1488b7(0x1f4)](_0x4245b2[_0x1488b7(0x209)]);if(!_0x1366e4)_0x2e7373[_0x1488b7(0x1f0)]({'type':_0x1488b7(0x247),'name':_0x4245b2[_0x1488b7(0x209)],'yamlActivation':_0x4245b2});else{const _0x12d676=activationResponseToDef(_0x1366e4,_0x1a604f,_0x12b47f),_0xfae057=a155_0x26d673['stringify'](_0x12d676),_0x1fb6d1=a155_0x26d673[_0x1488b7(0x24d)](_0x4245b2);_0xfae057!==_0x1fb6d1&&_0x2e7373[_0x1488b7(0x1f0)]({'type':_0x1488b7(0x26b),'name':_0x4245b2[_0x1488b7(0x209)],'yamlActivation':_0x4245b2,'existingActivation':_0x1366e4});}}for(const _0x344318 of _0x5c5a68){!_0x1939cf[_0x1488b7(0x239)](_0x344318[_0x1488b7(0x209)])&&_0x2e7373[_0x1488b7(0x1f0)]({'type':_0x1488b7(0x27e),'name':_0x344318['name'],'existingActivation':_0x344318});}return _0x2e7373;}function calculateYamlDiff(_0x35326f,_0x7f27eb){if(_0x7f27eb){const _0x4e6fd5=generateDiff(_0x7f27eb,_0x35326f),_0x22d593=hasChanges(_0x4e6fd5);return{'isNew':![],'hasChanges':_0x22d593,'diff':_0x22d593?formatDiffWithColors(_0x4e6fd5):undefined};}const _0x32cc53=generateDiff('',_0x35326f);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x32cc53)};}export function calculateSegmentDiff(_0x5cee25,_0x43f445,_0x1f180f,_0x14d468,_0x261723){const _0xa5c577=segmentToYamlString(_0x5cee25),_0x3b716d=_0x43f445?segmentToYamlString(segmentWithActivationsToYaml(_0x43f445,_0x1f180f,undefined,_0x14d468,_0x261723)):undefined;return calculateYamlDiff(_0xa5c577,_0x3b716d);}export function calculateJourneyDiff(_0x42bb7b,_0xc3e7ef){const _0x453f29=normalizeJourneyDef(_0x42bb7b,_0x42bb7b),_0x366313=a155_0x199b9e(_0x453f29),_0x19ab07=_0xc3e7ef?a155_0x199b9e(normalizeJourneyDef(_0xc3e7ef,_0x42bb7b)):undefined;return calculateYamlDiff(_0x366313,_0x19ab07);}export function findSegmentsToDelete(_0x5c712b,_0x8eb1ce,_0x50d95b,_0x27498c,_0xe40d91){const _0x14eb4c=a155_0x30a951,_0x385ef2=new Set();for(const {yamlConfig:_0x70532f,folderPath:_0x317389}of _0x8eb1ce){_0x385ef2[_0x14eb4c(0x1f8)](_0x317389+':'+_0x70532f[_0x14eb4c(0x209)]);}return _0x5c712b[_0x14eb4c(0x201)](_0x5845c0=>{const _0x2fc024=_0x14eb4c,_0x420d61=_0x5845c0[_0x2fc024(0x23c)]?_0x50d95b['get'](_0x5845c0[_0x2fc024(0x23c)][_0x2fc024(0x29c)]())||'':'',_0x35797f=_0x420d61+':'+_0x5845c0[_0x2fc024(0x209)];if(_0x385ef2['has'](_0x35797f))return![];if(_0xe40d91)return _0x420d61===_0x27498c||_0x420d61[_0x2fc024(0x1f7)](_0x27498c+'/');return!![];});}export function findJourneysToDelete(_0x2a0c88,_0x54134b,_0x34c627,_0x3b0b1b,_0x5dcfd6){const _0x41e763=a155_0x30a951,_0x5a35c1=new Set();for(const {yamlConfig:_0x47d8e5,folderPath:_0x1765a}of _0x54134b){_0x5a35c1[_0x41e763(0x1f8)](_0x1765a+':'+_0x47d8e5[_0x41e763(0x209)]);}return _0x2a0c88[_0x41e763(0x201)](_0x5c0c52=>{const _0x3a9737=_0x41e763,_0x5c62a6=_0x5c0c52[_0x3a9737(0x27d)]?_0x34c627[_0x3a9737(0x1f4)](_0x5c0c52[_0x3a9737(0x27d)])||'':'',_0xa243a1=_0x5c62a6+':'+_0x5c0c52[_0x3a9737(0x297)];if(_0x5a35c1[_0x3a9737(0x239)](_0xa243a1))return![];if(_0x5dcfd6)return _0x5c62a6===_0x3b0b1b||_0x5c62a6['startsWith'](_0x3b0b1b+'/');return!![];});}export function buildSegmentLookupMap(_0x1aabfc,_0x57781a){const _0x16304f=a155_0x30a951,_0x3f1a1a=new Map();for(const _0x567ba9 of _0x1aabfc){const _0x205b50=_0x567ba9[_0x16304f(0x23c)]?_0x57781a[_0x16304f(0x1f4)](_0x567ba9['segmentFolderId']['toString']())||'':'',_0x2fe43d=_0x205b50+':'+_0x567ba9[_0x16304f(0x209)];_0x3f1a1a[_0x16304f(0x1c6)](_0x2fe43d,_0x567ba9);}return _0x3f1a1a;}export function buildSegmentNameToIdMap(_0xd3ed8b){const _0x245562=new Map();for(const _0x5e167e of _0xd3ed8b){_0x245562['set'](_0x5e167e['name'],_0x5e167e['id']);}return _0x245562;}export function buildJourneyBundleLookupMap(_0x2b378f,_0x3effc4){const _0x38ecc3=a155_0x30a951,_0x4254ff=new Map();for(const _0x557959 of _0x2b378f){const _0x4a8f2f=_0x557959['folderId']?_0x3effc4['get'](_0x557959['folderId'])||'':'',_0x2e4509=_0x4a8f2f+':'+_0x557959[_0x38ecc3(0x297)];!_0x4254ff['has'](_0x2e4509)&&_0x4254ff[_0x38ecc3(0x1c6)](_0x2e4509,[]),_0x4254ff[_0x38ecc3(0x1f4)](_0x2e4509)[_0x38ecc3(0x1f0)](_0x557959);}for(const _0x43138b of _0x4254ff[_0x38ecc3(0x28a)]()){_0x43138b[_0x38ecc3(0x1f5)]((_0x93d793,_0xbe97bd)=>(_0x93d793[_0x38ecc3(0x1e2)]||0x0)-(_0xbe97bd[_0x38ecc3(0x1e2)]||0x0));}return _0x4254ff;}export function collectFoldersToCreate(_0x271ea7,_0x38d553){const _0x3a8754=a155_0x30a951,_0x57afbb=new Set();for(const _0x742766 of _0x271ea7){if(!_0x742766)continue;if(_0x38d553['has'](_0x742766))continue;const _0x24f471=_0x742766[_0x3a8754(0x291)]('/');let _0x21d326='';for(const _0x5e742a of _0x24f471){_0x21d326=_0x21d326?_0x21d326+'/'+_0x5e742a:_0x5e742a,!_0x38d553['has'](_0x21d326)&&_0x57afbb[_0x3a8754(0x1f8)](_0x21d326);}}return _0x57afbb;}export function parseAndClassifyYamlFiles(_0x61982e,_0x23ccd4,_0x1c1e06){const _0x5d2371=a155_0x30a951,_0x55a1d0=[],_0x2053d4=[];for(const _0xa2e2c1 of _0x61982e){const _0x26dd2d=a155_0x5c2d81[_0x5d2371(0x268)](_0x23ccd4,a155_0x5c2d81[_0x5d2371(0x277)](_0xa2e2c1)),_0x2a5257=_0x26dd2d==='.'?'':_0x26dd2d['replace'](/\\/g,'/'),_0x46d4a4=readFileSync(_0xa2e2c1,_0x5d2371(0x242)),_0x14be99=a155_0x26d673['parse'](_0x46d4a4);if(isJourneyDef(_0x14be99)){const _0x1e10f9=a155_0x14fa23(_0x46d4a4);_0x2053d4['push']({'yamlConfig':_0x1e10f9,'folderPath':_0x2a5257,'sourcePath':_0xa2e2c1});}else{if(!_0x1c1e06?.[_0x5d2371(0x27b)]){const _0x13e29e=parseSegmentYamlFile(_0x46d4a4),_0x5a3f80=normalizeChildSegmentYaml(_0x13e29e);_0x55a1d0[_0x5d2371(0x1f0)]({'yamlConfig':_0x5a3f80,'folderPath':_0x2a5257,'sourcePath':_0xa2e2c1});}}}return{'segments':_0x55a1d0,'journeys':_0x2053d4};}export function validateParsedFiles(_0x28d123,_0x44f5a5){const _0x5776cc=a155_0x30a951,_0x10869f=[];for(const {yamlConfig:_0x73105e,sourcePath:_0x2338ce}of _0x28d123[_0x5776cc(0x22d)]){const _0x3dbd9d=readFileSync(_0x2338ce,_0x5776cc(0x242)),_0x594fc0=a155_0x26d673['parseDocument'](_0x3dbd9d),_0x14c895=validateSegmentDef(_0x73105e,{'source':_0x3dbd9d,'document':_0x594fc0},{'skipSchema':!![]});if(!_0x14c895[_0x5776cc(0x249)]){const _0x422e80=a155_0x5c2d81[_0x5776cc(0x268)](_0x44f5a5,_0x2338ce);_0x10869f[_0x5776cc(0x1f0)]({'filePath':_0x422e80,'source':_0x3dbd9d,'result':_0x14c895,'isJourney':![]});}}for(const {yamlConfig:_0x3a7dc4,sourcePath:_0x53f6c8}of _0x28d123[_0x5776cc(0x263)]){const _0x405784=readFileSync(_0x53f6c8,'utf-8'),_0x41d9b0=a155_0x26d673[_0x5776cc(0x23b)](_0x405784),_0x5de613=validateJourneyDef(_0x3a7dc4,{'source':_0x405784,'document':_0x41d9b0},{'skipSchema':!![]});if(!_0x5de613[_0x5776cc(0x249)]){const _0x535fd5=a155_0x5c2d81[_0x5776cc(0x268)](_0x44f5a5,_0x53f6c8);_0x10869f['push']({'filePath':_0x535fd5,'source':_0x405784,'result':_0x5de613,'isJourney':!![]});}}return _0x10869f;}export function formatValidationErrors(_0x32d7d1){const _0x16493d=a155_0x30a951,_0x41b6af=[];for(const {filePath:_0x4206a0,source:_0x2b3457,result:_0x55be1b,isJourney:_0x256e03}of _0x32d7d1){const _0x23d309=_0x256e03?_0x16493d(0x20c):_0x16493d(0x1ad);_0x41b6af['push']('\x0a'+_0x4206a0+'\x20('+_0x23d309+'):\x20'+_0x55be1b['errors'][_0x16493d(0x1f3)]+_0x16493d(0x1ba)),_0x41b6af[_0x16493d(0x1f0)](formatValidationResult(_0x55be1b,_0x2b3457,_0x4206a0));}return _0x41b6af[_0x16493d(0x1d8)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x480fda){const _0xce09ab=a155_0x30a951,_0x2fc49d=new Set(),_0xee31e1=new Map(),_0x168523=collectSegmentUsageCounts(_0x480fda);if(_0x480fda['segments'])for(const [_0x3c0d50,_0x1dadd6]of Object[_0xce09ab(0x1f6)](_0x480fda['segments'])){_0x2fc49d['add'](_0x3c0d50);if(_0x1dadd6[_0xce09ab(0x220)]){const _0x598a48=yamlRuleToApi(_0x1dadd6[_0xce09ab(0x220)]),_0x363d2c=apiRuleToYaml(_0x598a48);_0xee31e1[_0xce09ab(0x1c6)](_0x3c0d50,_0x363d2c);}}const _0x263a97=new Map();let _0x551675=0x0;for(const [_0x59ba40,_0x15b9e4]of _0xee31e1){const _0x5e3888=serializeExpandedRule(_0x15b9e4,_0xee31e1),_0x140385=_0x263a97[_0xce09ab(0x1f4)](_0x5e3888)||[];_0x140385[_0xce09ab(0x1f0)]({'name':_0x59ba40,'index':_0x551675}),_0x263a97['set'](_0x5e3888,_0x140385),_0x551675++;}const _0x122ca7=new Map();for(const [_0x15cf24,_0x5ded23]of _0x263a97){const _0x43bd98=_0x5ded23['slice']()['sort']((_0x206335,_0x35256a)=>{const _0x5d4267=_0xce09ab,_0x548191=_0x168523[_0x5d4267(0x1f4)](_0x206335[_0x5d4267(0x209)])||0x0,_0x500e98=_0x168523[_0x5d4267(0x1f4)](_0x35256a[_0x5d4267(0x209)])||0x0;if(_0x548191!==_0x500e98)return _0x500e98-_0x548191;return _0x206335[_0x5d4267(0x1e7)]-_0x35256a[_0x5d4267(0x1e7)];})[_0xce09ab(0x258)](_0x55dcd3=>_0x55dcd3['name']),_0x3e6f67=[];for(const _0x5e639d of _0x43bd98){const _0x362eaf=_0x168523[_0xce09ab(0x1f4)](_0x5e639d)||0x0,_0x226065=Math[_0xce09ab(0x1e6)](_0x362eaf,0x1);for(let _0x37d093=0x0;_0x37d093<_0x226065;_0x37d093++){_0x3e6f67[_0xce09ab(0x1f0)](_0x5e639d);}}_0x122ca7[_0xce09ab(0x1c6)](_0x15cf24,_0x3e6f67);}return{'existingLocalSegmentNames':_0x2fc49d,'localSegmentRules':_0xee31e1,'localExpandedRuleToNames':_0x122ca7};}export function createSegmentIdResolver(_0x1424fc,_0x328da8){return async _0x1d5515=>{const _0x1f57bf=a155_0x5a27,_0x29c039=_0x1424fc[_0x1f57bf(0x1f4)](_0x1d5515);if(!_0x29c039)throw new SDKError(ErrorCode[_0x1f57bf(0x25f)],_0x1f57bf(0x26a)+_0x1d5515+_0x1f57bf(0x259)+_0x328da8+'\x27)');return _0x29c039;};}export function extractRootFolderId(_0x2cdd54){const _0x512709=a155_0x30a951;return _0x2cdd54['relationships']?.[_0x512709(0x1e0)]?.[_0x512709(0x1c0)]?.['id']||_0x2cdd54['relationships']?.['parentFolder']?.[_0x512709(0x1c0)]?.['id'];}export function buildConnectionMaps(_0x2ea047){const _0x1a4b7c=a155_0x30a951,_0x2a4c29=new Map(),_0x25b62a=new Map(),_0x144f6d=new Map();for(const _0x185443 of _0x2ea047){_0x2a4c29[_0x1a4b7c(0x1c6)](_0x185443[_0x1a4b7c(0x209)],parseInt(_0x185443['id'],0xa)),_0x25b62a[_0x1a4b7c(0x1c6)](_0x185443['id'],_0x185443['name']),_0x144f6d[_0x1a4b7c(0x1c6)](_0x185443[_0x1a4b7c(0x209)],_0x185443[_0x1a4b7c(0x20e)]);}return{'nameToId':_0x2a4c29,'idToName':_0x25b62a,'nameToType':_0x144f6d};}export function calculatePushStats(_0x4163b1,_0x3483c1,_0x17d9d0,_0x249eb0,_0x3a83c3,_0x507d75,_0x19cdce){const _0x18a67d=a155_0x30a951,_0x55f89b=_0x4163b1[_0x18a67d(0x201)](_0x55cc9e=>_0x55cc9e[_0x18a67d(0x20b)]),_0xb4fa16=_0x4163b1[_0x18a67d(0x201)](_0x22e1c0=>!_0x22e1c0[_0x18a67d(0x20b)]&&_0x22e1c0[_0x18a67d(0x214)]),_0x44b4ec=_0x4163b1[_0x18a67d(0x201)](_0x438b11=>!_0x438b11[_0x18a67d(0x20b)]&&!_0x438b11[_0x18a67d(0x214)]),_0x326eec=_0x507d75?_0x249eb0:[],_0x265adb=_0x3483c1[_0x18a67d(0x201)](_0x402f33=>_0x402f33['isNew']),_0x2b1cb6=_0x3483c1[_0x18a67d(0x201)](_0xb47688=>!_0xb47688[_0x18a67d(0x20b)]&&_0xb47688[_0x18a67d(0x214)]),_0x3f150b=_0x3483c1[_0x18a67d(0x201)](_0x2b8340=>!_0x2b8340['isNew']&&!_0x2b8340[_0x18a67d(0x214)]),_0x53fc17=_0x507d75?_0x3a83c3:[],_0x17dd4c=_0x4163b1[_0x18a67d(0x290)](_0x5a94d8=>_0x5a94d8['activationActions']),_0x5b74e4=_0x17dd4c[_0x18a67d(0x201)](_0x3a7ce1=>_0x3a7ce1[_0x18a67d(0x20e)]==='create'),_0x12c56c=_0x17dd4c[_0x18a67d(0x201)](_0x514ec1=>_0x514ec1['type']==='update'),_0x178dd7=_0x17dd4c['filter'](_0x2b73c0=>_0x2b73c0[_0x18a67d(0x20e)]===_0x18a67d(0x27e)),_0x94fd69=Array[_0x18a67d(0x1b9)](_0x17d9d0)[_0x18a67d(0x1f5)](),_0x594db3=_0x19cdce?![]:_0x55f89b[_0x18a67d(0x1f3)]>0x0||_0xb4fa16[_0x18a67d(0x1f3)]>0x0||_0x326eec[_0x18a67d(0x1f3)]>0x0,_0x1c59c2=_0x265adb[_0x18a67d(0x1f3)]>0x0||_0x2b1cb6[_0x18a67d(0x1f3)]>0x0||_0x53fc17[_0x18a67d(0x1f3)]>0x0,_0x338627=_0x19cdce?![]:_0x17dd4c[_0x18a67d(0x1f3)]>0x0,_0x2f5365=_0x94fd69['length']>0x0;return{'segments':{'new':_0x55f89b,'changed':_0xb4fa16,'unchanged':_0x44b4ec,'toDelete':_0x326eec},'journeys':{'new':_0x265adb,'changed':_0x2b1cb6,'unchanged':_0x3f150b,'toDelete':_0x53fc17},'activations':{'all':_0x17dd4c,'toCreate':_0x5b74e4,'toUpdate':_0x12c56c,'toDelete':_0x178dd7},'folders':{'toCreate':_0x94fd69},'counts':{'segments':{'new':_0x55f89b[_0x18a67d(0x1f3)],'changed':_0xb4fa16[_0x18a67d(0x1f3)],'unchanged':_0x44b4ec[_0x18a67d(0x1f3)],'toDelete':_0x326eec[_0x18a67d(0x1f3)]},'journeys':{'new':_0x265adb[_0x18a67d(0x1f3)],'changed':_0x2b1cb6[_0x18a67d(0x1f3)],'unchanged':_0x3f150b[_0x18a67d(0x1f3)],'toDelete':_0x53fc17[_0x18a67d(0x1f3)]},'activations':{'create':_0x5b74e4['length'],'update':_0x12c56c[_0x18a67d(0x1f3)],'delete':_0x178dd7[_0x18a67d(0x1f3)]},'folders':_0x94fd69[_0x18a67d(0x1f3)]},'hasChanges':_0x594db3||_0x1c59c2||_0x338627||_0x2f5365};}export async function buildPushExecutionContext(_0x1912d2,_0x3ec2ae,_0x5f4cc7,_0x1406c9,_0x2a55c7,_0x15fb24){const _0x1992ac=a155_0x30a951,_0x57d5d7=extractRootFolderId(_0x5f4cc7),{pathToId:_0x50d80,idToPath:_0x4ad1ab}=buildFolderMaps(_0x2a55c7),_0x2c705f=buildSegmentNameToIdMap(_0x1406c9),_0x2226c1=new Map(),{batchAsync:_0x47dc6a}=await import('../../utils/async.js'),[_0x288fc9,_0x376b20]=await Promise[_0x1992ac(0x203)]([_0x1912d2[_0x1992ac(0x212)][_0x1992ac(0x229)](),_0x1912d2[_0x1992ac(0x200)]['list'](),((async()=>{const _0xdd2e54=_0x1992ac;!_0x15fb24&&_0x1406c9[_0xdd2e54(0x1f3)]>0x0&&await _0x47dc6a(_0x1406c9,async _0x3c491a=>{const _0x14382f=_0xdd2e54,_0x40b266=await _0x1912d2[_0x14382f(0x1ad)][_0x14382f(0x237)](_0x3ec2ae,_0x3c491a['id']);_0x2226c1['set'](_0x3c491a['id'],_0x40b266);});})())]),{emailToId:_0x505f27,idToEmail:_0x28253b}=_0x288fc9,_0x2806b7=buildConnectionMaps(_0x376b20);return{'rootFolderId':_0x57d5d7,'folderPathToId':_0x50d80,'folderIdToPath':_0x4ad1ab,'segmentNameToId':_0x2c705f,'activationsBySegmentId':_0x2226c1,'emailToIdMap':_0x505f27,'idToEmailMap':_0x28253b,'connectionNameToIdMap':_0x2806b7['nameToId'],'connectionIdToNameMap':_0x2806b7[_0x1992ac(0x1e1)],'connectionNameToTypeMap':_0x2806b7[_0x1992ac(0x1c7)]};}export function createPushYamlContextForBundle(_0x58c851,_0x101285,_0x4b5ede,_0x447b74,_0x4f56b4,_0x135b79,_0x1dee95,_0x7d8acc){const {existingLocalSegmentNames:_0x34634d,localExpandedRuleToNames:_0x379bf4}=_0x447b74,_0x40328d=new Set(),_0x1fac3c=new Map(),_0x30383b=new Map(),_0x310ef1=new Map(),_0x234bee=createJumpTargetCache(),_0x5f25f4=new Map(),_0x46e953=new Map(),_0x1c3eec=new Set();let _0xb49b60;const _0x584f5a=_0x8198cf=>{const _0x1eef90={'resolveSegment':async _0x3ad0fa=>{const _0x378f26=a155_0x5a27,_0x1ec674=_0x310ef1[_0x378f26(0x1f4)](_0x3ad0fa);if(_0x1ec674!==undefined)return{'name':_0x1ec674,'isJourneyLocal':!![]};try{const _0x2ac564=await fetchSegment(_0x58c851,_0x101285,_0x3ad0fa,_0x4b5ede);if(!_0x2ac564)throw new Error(_0x378f26(0x1cd));const _0x38fc3a=generateJourneyLocalName(_0x2ac564[_0x378f26(0x209)]),_0x2ec9bc=_0x2ac564[_0x378f26(0x265)]===SEGMENT_KIND_JOURNEY&&_0x38fc3a!==undefined;let _0x323653=_0x2ac564['name'],_0x1c7fe3;if(_0x2ec9bc&&_0x2ac564[_0x378f26(0x220)]){const _0x97b95b=apiRuleToYaml(_0x2ac564[_0x378f26(0x220)]);_0x46e953[_0x378f26(0x1c6)](_0x3ad0fa,_0x97b95b);const _0xcfd213=async _0x2de0f2=>{const _0x673db0=_0x378f26,_0x4d01f5=collectSegmentRefsFromRule(_0x2de0f2);for(const _0x231b23 of _0x4d01f5){if(!_0x46e953['has'](_0x231b23))try{const _0x12c66a=await fetchSegment(_0x58c851,_0x101285,_0x231b23,_0x4b5ede);if(_0x12c66a?.[_0x673db0(0x220)]){const _0x49f7a1=apiRuleToYaml(_0x12c66a[_0x673db0(0x220)]);_0x46e953[_0x673db0(0x1c6)](_0x231b23,_0x49f7a1),await _0xcfd213(_0x49f7a1);}}catch(_0x54a6f8){logger['debug'](_0x673db0(0x286)+_0x231b23+':\x20'+_0x54a6f8);}}};await _0xcfd213(_0x97b95b);const _0x4cb20f=serializeExpandedRule(_0x97b95b,_0x46e953),_0x53fef8=_0x379bf4[_0x378f26(0x1f4)](_0x4cb20f);if(_0x53fef8&&_0x53fef8['length']>0x0){const _0x54480e=_0x1fac3c[_0x378f26(0x1f4)](_0x4cb20f)||0x0,_0x1325e3=_0x53fef8[_0x54480e]||_0x53fef8[_0x53fef8[_0x378f26(0x1f3)]-0x1];_0x1fac3c[_0x378f26(0x1c6)](_0x4cb20f,_0x54480e+0x1),_0x323653=_0x1325e3,_0x40328d['add'](_0x323653),_0x310ef1['set'](_0x3ad0fa,_0x323653);const _0x334e68=await resolveRuleSegmentRefs(_0x97b95b,async _0xa2dfd7=>{const _0x1b6998=_0x378f26,_0x21fe08=_0x310ef1[_0x1b6998(0x1f4)](_0xa2dfd7);if(_0x21fe08)return _0x21fe08;const _0x3b25c0=await _0xb49b60[_0x1b6998(0x1eb)](_0xa2dfd7);return _0x3b25c0[_0x1b6998(0x209)];});_0x1c7fe3={'description':_0x2ac564[_0x378f26(0x1df)],'rule':_0x334e68};}else{const _0x2d6c6e=_0x5f25f4['get'](_0x4cb20f);if(_0x2d6c6e)_0x323653=_0x2d6c6e,_0x310ef1[_0x378f26(0x1c6)](_0x3ad0fa,_0x323653);else{if(_0x38fc3a){let _0x465a3b=_0x38fc3a,_0x5bff49=0x2;while(_0x40328d[_0x378f26(0x239)](_0x465a3b)||_0x34634d[_0x378f26(0x239)](_0x465a3b)){_0x465a3b=_0x38fc3a+'_'+_0x5bff49,_0x5bff49++;}_0x40328d[_0x378f26(0x1f8)](_0x465a3b),_0x323653=_0x465a3b;}_0x310ef1[_0x378f26(0x1c6)](_0x3ad0fa,_0x323653),_0x5f25f4[_0x378f26(0x1c6)](_0x4cb20f,_0x323653);const _0x1d02f8=await resolveRuleSegmentRefs(_0x97b95b,async _0x337b99=>{const _0x5b31bd=_0x378f26,_0x5715c8=_0x310ef1[_0x5b31bd(0x1f4)](_0x337b99);if(_0x5715c8)return _0x5715c8;const _0x3cbc8d=await _0xb49b60[_0x5b31bd(0x1eb)](_0x337b99);return _0x3cbc8d[_0x5b31bd(0x209)];});_0x1c7fe3={'description':_0x2ac564[_0x378f26(0x1df)],'rule':_0x1d02f8};}}}return{'name':_0x323653,'isJourneyLocal':_0x2ec9bc,'definition':_0x1c7fe3};}catch(_0x4e7e03){return logger[_0x378f26(0x29d)](_0x378f26(0x215)+_0x3ad0fa+':\x20'+_0x4e7e03),{'name':_0x3ad0fa,'isJourneyLocal':![]};}},'resolveActivation':async _0x1b0f15=>{const _0x116ffe=a155_0x5a27,_0x3e281d=_0x30383b[_0x116ffe(0x1f4)](_0x1b0f15);if(_0x3e281d!==undefined)return{'name':_0x3e281d,'isJourneyLocal':!![]};try{let _0x2e1e99=_0x1dee95?.[_0x116ffe(0x1f4)](_0x1b0f15);!_0x2e1e99&&(_0x2e1e99=await _0x58c851[_0x116ffe(0x20c)][_0x116ffe(0x25b)](_0x8198cf,_0x1b0f15));const _0x411438=_0x2e1e99[_0x116ffe(0x1de)]['activationParams'][_0x116ffe(0x209)]||_0x1b0f15,_0x25787b=sanitizeYamlKey(_0x411438)||_0x116ffe(0x2a2)+_0x1b0f15,_0x29ca0e=_0x25787b;_0x30383b[_0x116ffe(0x1c6)](_0x1b0f15,_0x29ca0e);const _0x1421f2=journeyActivationStepToYaml(_0x2e1e99,_0x4f56b4,_0x135b79);return{'name':_0x29ca0e,'isJourneyLocal':!![],'definition':_0x1421f2};}catch(_0x1ad89f){return logger['debug'](_0x116ffe(0x22f)+_0x1b0f15+':\x20'+_0x1ad89f),{'name':_0x1b0f15,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x17bd48,_0x5ccd78)=>resolveJumpTarget(_0x17bd48,_0x5ccd78,_0x234bee,async _0x142a10=>{const _0x2b0aa0=a155_0x5a27,_0x26a15f=_0x7d8acc?.[_0x2b0aa0(0x1f4)](_0x142a10);if(_0x26a15f)return _0x26a15f;return _0x58c851['journey'][_0x2b0aa0(0x1bc)](_0x142a10);})};return _0xb49b60=_0x1eef90,_0x1eef90;},_0x27d3b7=async _0x3a859b=>{const _0x2a3e38=a155_0x5a27,{collectSegmentIdsFromJourneyApi:_0x3b3c7d}=await import('./journey-yaml.js'),{batchAsync:_0x249fd1}=await import('../../utils/async.js'),_0x104dfb=new Set();for(const _0x43ce48 of _0x3a859b){let _0x609c86=_0x7d8acc?.[_0x2a3e38(0x1f4)](_0x43ce48);!_0x609c86&&(_0x609c86=await _0x58c851[_0x2a3e38(0x20c)][_0x2a3e38(0x1bc)](_0x43ce48));const _0x37e1c5=_0x3b3c7d(_0x609c86);for(const _0x479343 of _0x37e1c5){_0x104dfb[_0x2a3e38(0x1f8)](_0x479343);}}let _0xe470ec=Array[_0x2a3e38(0x1b9)](_0x104dfb);while(_0xe470ec[_0x2a3e38(0x1f3)]>0x0){const _0x378a84=_0xe470ec[_0x2a3e38(0x201)](_0x5c65f3=>!_0x1c3eec[_0x2a3e38(0x239)](_0x5c65f3));if(_0x378a84['length']===0x0)break;const _0xe68200=await _0x249fd1(_0x378a84,async _0x211a4c=>{const _0x2a6006=_0x2a3e38;_0x1c3eec[_0x2a6006(0x1f8)](_0x211a4c);const _0x14f78e=await fetchSegment(_0x58c851,_0x101285,_0x211a4c,_0x4b5ede);if(!_0x14f78e)return null;return{'segmentId':_0x211a4c,'segment':_0x14f78e};},0xa),_0x2cf4c3=new Set();for(const _0x1cbb23 of _0xe68200){if(!_0x1cbb23?.[_0x2a3e38(0x1ad)]?.[_0x2a3e38(0x220)])continue;const _0xa56bae=apiRuleToYaml(_0x1cbb23[_0x2a3e38(0x1ad)]['rule']);_0x46e953[_0x2a3e38(0x1c6)](_0x1cbb23['segmentId'],_0xa56bae);const _0x59033f=collectSegmentRefsFromRule(_0xa56bae);for(const _0x49fa89 of _0x59033f){!_0x1c3eec[_0x2a3e38(0x239)](_0x49fa89)&&_0x2cf4c3['add'](_0x49fa89);}}_0xe470ec=Array['from'](_0x2cf4c3);}};return{'createYamlContext':_0x584f5a,'prefetchJourneySegments':_0x27d3b7};}export async function executePushSegments(_0x392f19,_0x2fa742,_0x3d4a4b,_0x140cd3,_0x36dcc7){const _0x298424=a155_0x30a951,{segmentDefToCreateRequest:_0x341219,segmentDefToUpdateRequest:_0xb2113f}=await import('./child-segment-yaml.js'),_0x49fea9=_0x3d4a4b['folderPathToId'],_0x486266=0x5,_0x2a3af3=async _0x42571a=>{const _0xe20a3b=a155_0x5a27,_0x4790c4=_0x42571a[_0xe20a3b(0x287)]?_0x49fea9[_0xe20a3b(0x1f4)](_0x42571a[_0xe20a3b(0x287)]):undefined;let _0x25efbd;const _0x496c5a={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x26ebd5=_0x42571a[_0xe20a3b(0x224)];if(_0x42571a['yamlConfig']['rule']){const _0x327e38=createSegmentIdResolver(_0x3d4a4b[_0xe20a3b(0x246)],_0x42571a['yamlConfig']['name']),_0x33184a=await resolveRuleSegmentIds(_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x220)],_0x327e38);_0x26ebd5={..._0x42571a[_0xe20a3b(0x224)],'rule':_0x33184a};}try{if(_0x42571a[_0xe20a3b(0x20b)]){_0x36dcc7[_0xe20a3b(0x23a)]?.({'type':_0xe20a3b(0x241),'name':_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)]});const _0x5db0e1=_0x341219(_0x26ebd5,_0x4790c4),_0x56ff9c=await _0x36dcc7[_0xe20a3b(0x280)](_0xe20a3b(0x28d)+_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)]+'\x27...',()=>_0x392f19[_0xe20a3b(0x1ad)]['createSegment'](_0x140cd3[_0xe20a3b(0x222)],_0x5db0e1));_0x25efbd=_0x56ff9c[_0xe20a3b(0x1c0)]['id'],_0x3d4a4b['segmentNameToId']['set'](_0x42571a[_0xe20a3b(0x224)]['name'],_0x25efbd),_0x496c5a[_0xe20a3b(0x1ce)]={'name':_0x42571a['yamlConfig']['name'],'id':_0x25efbd},_0x36dcc7[_0xe20a3b(0x23a)]?.({'type':_0xe20a3b(0x24a),'name':_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)],'segmentId':_0x25efbd}),_0x36dcc7[_0xe20a3b(0x252)]?.(_0xe20a3b(0x21a)+_0x42571a[_0xe20a3b(0x224)]['name']+'\x27'),_0x496c5a['created']=0x1;}else{if(_0x42571a[_0xe20a3b(0x214)]){_0x36dcc7['onProgress']?.({'type':'segment_updating','name':_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)]});const _0x5c41cf=_0xb2113f(_0x26ebd5);_0x4790c4!==_0x42571a['existingSegment']?.[_0xe20a3b(0x23c)]&&(_0x5c41cf[_0xe20a3b(0x23c)]=_0x4790c4?parseInt(_0x4790c4,0xa):undefined),await _0x36dcc7[_0xe20a3b(0x280)](_0xe20a3b(0x261)+_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)]+_0xe20a3b(0x225),()=>_0x392f19[_0xe20a3b(0x1ad)]['updateSegmentById'](_0x140cd3[_0xe20a3b(0x222)],_0x42571a['existingSegment']['id'],_0x5c41cf)),_0x25efbd=_0x42571a[_0xe20a3b(0x26f)]['id'],_0x36dcc7[_0xe20a3b(0x23a)]?.({'type':'segment_updated','name':_0x42571a['yamlConfig']['name']}),_0x36dcc7[_0xe20a3b(0x252)]?.(_0xe20a3b(0x255)+_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)]+'\x27'),_0x496c5a[_0xe20a3b(0x28b)]=0x1;}else _0x25efbd=_0x42571a['existingSegment']['id'];}}catch(_0x9a8db7){const _0x5ef2a9=isHttp400Error(_0x9a8db7),_0x25ba25=_0x5ef2a9?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0xe20a3b(0x23d)],_0x558942=getErrorMessage(_0x9a8db7);throw new SDKError(_0x25ba25,'Failed\x20to\x20'+(_0x42571a['isNew']?_0xe20a3b(0x247):_0xe20a3b(0x26b))+'\x20segment\x20from\x20file:\x20'+_0x42571a[_0xe20a3b(0x232)]+_0xe20a3b(0x1fd)+_0x558942,_0x9a8db7);}try{const _0x4f245b=await syncActivationsForSegment(_0x392f19,_0x140cd3[_0xe20a3b(0x222)],_0x25efbd,_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)],_0x42571a[_0xe20a3b(0x1f2)],_0x36dcc7,_0x42571a[_0xe20a3b(0x232)]);_0x496c5a[_0xe20a3b(0x25c)]=_0x4f245b;}catch(_0x5cbdc9){if(_0x5cbdc9 instanceof SDKError)throw _0x5cbdc9;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xe20a3b(0x240)+_0x42571a['yamlConfig']['name']+_0xe20a3b(0x264)+_0x42571a[_0xe20a3b(0x232)]+'\x0a\x20\x20'+getErrorMessage(_0x5cbdc9),_0x5cbdc9);}return _0x496c5a;},_0x4a3bd6=await batchAsync(_0x2fa742,_0x2a3af3,_0x486266),_0x30f68c={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x55851e of _0x4a3bd6){_0x30f68c[_0x298424(0x251)]+=_0x55851e[_0x298424(0x251)],_0x30f68c[_0x298424(0x28b)]+=_0x55851e[_0x298424(0x28b)],_0x55851e['createdSegmentId']&&_0x30f68c['createdSegmentIds'][_0x298424(0x1c6)](_0x55851e[_0x298424(0x1ce)][_0x298424(0x209)],_0x55851e[_0x298424(0x1ce)]['id']),_0x30f68c[_0x298424(0x25c)][_0x298424(0x251)]+=_0x55851e['activations'][_0x298424(0x251)],_0x30f68c[_0x298424(0x25c)][_0x298424(0x28b)]+=_0x55851e[_0x298424(0x25c)][_0x298424(0x28b)],_0x30f68c[_0x298424(0x25c)]['deleted']+=_0x55851e[_0x298424(0x25c)][_0x298424(0x211)];}return _0x30f68c;}function a155_0x5a27(_0x39a59a,_0x2add34){_0x39a59a=_0x39a59a-0x1a7;const _0x3980d1=a155_0x3980();let _0x5a2743=_0x3980d1[_0x39a59a];return _0x5a2743;}async function syncActivationsForSegment(_0x5cb661,_0x371d5e,_0x4c51ea,_0x44cbc3,_0x10018c,_0x410917,_0x10dfd6){const _0x402f17=a155_0x30a951,_0x22a2ab={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x381e97 of _0x10018c){try{if(_0x381e97['type']===_0x402f17(0x247)&&_0x381e97[_0x402f17(0x271)])_0x410917[_0x402f17(0x23a)]?.({'type':'activation_creating','segmentName':_0x44cbc3,'activationName':_0x381e97['name']}),await _0x410917['withProgress'](_0x402f17(0x23e)+_0x381e97[_0x402f17(0x209)]+_0x402f17(0x225),()=>_0x5cb661[_0x402f17(0x1ad)]['createActivation'](_0x371d5e,_0x4c51ea,_0x381e97[_0x402f17(0x271)])),_0x410917[_0x402f17(0x23a)]?.({'type':_0x402f17(0x21f),'segmentName':_0x44cbc3,'activationName':_0x381e97[_0x402f17(0x209)]}),_0x410917['logSuccess']?.('Created\x20activation\x20\x27'+_0x381e97[_0x402f17(0x209)]+'\x27'),_0x22a2ab[_0x402f17(0x251)]++;else{if(_0x381e97[_0x402f17(0x20e)]===_0x402f17(0x26b)&&_0x381e97[_0x402f17(0x271)]&&_0x381e97[_0x402f17(0x279)])_0x410917[_0x402f17(0x23a)]?.({'type':_0x402f17(0x1b5),'segmentName':_0x44cbc3,'activationName':_0x381e97[_0x402f17(0x209)]}),await _0x410917[_0x402f17(0x280)](_0x402f17(0x1cf)+_0x381e97[_0x402f17(0x209)]+_0x402f17(0x225),()=>_0x5cb661[_0x402f17(0x1ad)][_0x402f17(0x1b7)](_0x371d5e,_0x4c51ea,_0x381e97[_0x402f17(0x279)]['id'],_0x381e97['validatedRequest'])),_0x410917[_0x402f17(0x23a)]?.({'type':_0x402f17(0x238),'segmentName':_0x44cbc3,'activationName':_0x381e97[_0x402f17(0x209)]}),_0x410917[_0x402f17(0x252)]?.(_0x402f17(0x216)+_0x381e97[_0x402f17(0x209)]+'\x27'),_0x22a2ab['updated']++;else _0x381e97[_0x402f17(0x20e)]==='delete'&&_0x381e97[_0x402f17(0x279)]&&(_0x410917[_0x402f17(0x23a)]?.({'type':'activation_deleting','segmentName':_0x44cbc3,'activationName':_0x381e97[_0x402f17(0x209)]}),await _0x410917[_0x402f17(0x280)](_0x402f17(0x248)+_0x381e97[_0x402f17(0x209)]+_0x402f17(0x225),()=>_0x5cb661[_0x402f17(0x1ad)][_0x402f17(0x26e)](_0x371d5e,_0x4c51ea,_0x381e97[_0x402f17(0x279)]['id'])),_0x410917[_0x402f17(0x23a)]?.({'type':'activation_deleted','segmentName':_0x44cbc3,'activationName':_0x381e97[_0x402f17(0x209)]}),_0x410917[_0x402f17(0x1c5)]?.('Deleted\x20activation\x20\x27'+_0x381e97[_0x402f17(0x209)]+'\x27'),_0x22a2ab['deleted']++);}}catch(_0x397d1f){const _0x475ca0=isHttp400Error(_0x397d1f),_0x1cdfeb=_0x475ca0?ErrorCode[_0x402f17(0x1e4)]:ErrorCode[_0x402f17(0x213)],_0x5ae28c=getErrorMessage(_0x397d1f);throw new SDKError(_0x1cdfeb,_0x402f17(0x223)+_0x381e97[_0x402f17(0x20e)]+_0x402f17(0x1e9)+_0x381e97[_0x402f17(0x209)]+_0x402f17(0x264)+_0x10dfd6+_0x402f17(0x1fd)+_0x5ae28c,_0x397d1f);}}return _0x22a2ab;}export async function executePushFolders(_0x4496be,_0x3880ff,_0x4d25ee,_0x429eb9,_0x43fe72){const _0x4f9d5f=a155_0x30a951,_0x20e16b=new Map(_0x4d25ee),_0x4c63f2=sortFoldersByDepth(_0x3880ff);for(const _0x2e9ce6 of _0x4c63f2){const _0x42ea2a=_0x2e9ce6['split']('/'),_0x4bb413=_0x42ea2a[_0x42ea2a[_0x4f9d5f(0x1f3)]-0x1],_0x5d0640=_0x42ea2a[_0x4f9d5f(0x244)](0x0,-0x1)[_0x4f9d5f(0x1d8)]('/'),_0x5522cf=_0x20e16b['get'](_0x5d0640);_0x43fe72[_0x4f9d5f(0x23a)]?.({'type':_0x4f9d5f(0x228),'folder':_0x2e9ce6});const _0x4dc66f={'name':_0x4bb413,'parentFolderId':_0x5522cf},_0x2370c5=await _0x43fe72[_0x4f9d5f(0x280)]('Creating\x20folder\x20\x27'+_0x2e9ce6+'\x27...',()=>_0x4496be['segment'][_0x4f9d5f(0x1d4)](_0x429eb9[_0x4f9d5f(0x222)],_0x4dc66f));_0x20e16b[_0x4f9d5f(0x1c6)](_0x2e9ce6,_0x2370c5['data']['id']),_0x43fe72[_0x4f9d5f(0x23a)]?.({'type':_0x4f9d5f(0x294),'folder':_0x2e9ce6,'folderId':_0x2370c5[_0x4f9d5f(0x1c0)]['id']}),_0x43fe72[_0x4f9d5f(0x1d0)]?.('Created\x20folder\x20\x27'+_0x2e9ce6+'\x27');}return _0x20e16b;}export async function executePushSegmentDeletions(_0x1c8c06,_0x2d1b2a,_0x336b63){const _0x85cfdf=a155_0x30a951;if(_0x2d1b2a[_0x85cfdf(0x1f3)]===0x0)return 0x0;const {batchAsync:_0x229dee}=await import(_0x85cfdf(0x1e8)),_0x55dd9e=0x5,_0x4af6e7=await _0x229dee(_0x2d1b2a,async _0x4b0a29=>{const _0x2c8d0c=_0x85cfdf;return _0x336b63['onProgress']?.({'type':'segment_deleting','name':_0x4b0a29[_0x2c8d0c(0x209)]}),await _0x1c8c06['segment']['deleteSegment'](_0x4b0a29['id']),_0x336b63['onProgress']?.({'type':_0x2c8d0c(0x274),'name':_0x4b0a29['name']}),_0x336b63[_0x2c8d0c(0x1c5)]?.(_0x2c8d0c(0x24e)+_0x4b0a29[_0x2c8d0c(0x209)]+'\x27'),0x1;},_0x55dd9e);return _0x4af6e7[_0x85cfdf(0x28e)]((_0x31b865,_0x1e2738)=>_0x31b865+_0x1e2738,0x0);}export async function executePushJourneys(_0x24ece2,_0x55c2f4,_0x47cee6,_0x5800fa,_0x53eaa6){const _0x4d1dbb=a155_0x30a951,{journeyDefToRequest:_0x48c34f}=await import(_0x4d1dbb(0x1ff)),{activationDefToCreateRequest:_0xec6691,yamlRuleToApi:_0x32e45f,validateSegmentRule:_0x282158}=await import(_0x4d1dbb(0x219)),_0xcf905a={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5709de=new Map(_0x47cee6['segmentNameToId']),_0x26e218=0x5;for(let _0x4c1268=0x0;_0x4c1268<_0x55c2f4[_0x4d1dbb(0x1f3)];_0x4c1268+=_0x26e218){const _0x435cdf=_0x55c2f4[_0x4d1dbb(0x244)](_0x4c1268,_0x4c1268+_0x26e218),_0x41ff75=await Promise[_0x4d1dbb(0x203)](_0x435cdf[_0x4d1dbb(0x258)](async _0x4084ee=>{const _0x48d778=_0x4d1dbb;if(!_0x4084ee[_0x48d778(0x20b)]&&!_0x4084ee['hasChanges'])return{'action':_0x48d778(0x1da),'name':_0x4084ee[_0x48d778(0x224)][_0x48d778(0x209)],'journeyId':_0x4084ee[_0x48d778(0x245)]?.['id']};const _0x2b22f9=_0x4084ee[_0x48d778(0x287)]?_0x47cee6['folderPathToId'][_0x48d778(0x1f4)](_0x4084ee[_0x48d778(0x287)]):undefined;_0x53eaa6[_0x48d778(0x23a)]?.({'type':_0x4084ee[_0x48d778(0x20b)]?'journey_creating':_0x48d778(0x289),'name':_0x4084ee['yamlConfig'][_0x48d778(0x209)]});try{const _0x7efbf0=await executeSingleJourneyPush(_0x24ece2,_0x4084ee,{..._0x47cee6,'segmentNameToId':_0x5709de},{'parentId':_0x5800fa['parentId'],'rootFolderId':_0x5800fa[_0x48d778(0x25d)],'folderId':_0x2b22f9,'verbose':_0x5800fa[_0x48d778(0x284)]},_0x53eaa6,{'journeyDefToRequest':_0x48c34f,'activationDefToCreateRequest':_0xec6691,'yamlRuleToApi':_0x32e45f,'validateSegmentRule':_0x282158});for(const [_0x5c5149,_0x3ca315]of _0x7efbf0[_0x48d778(0x1bd)]){_0x5709de['set'](_0x5c5149,_0x3ca315),_0xcf905a['embeddedSegmentNameToId']['set'](_0x5c5149,_0x3ca315);}if(_0x7efbf0['action']===_0x48d778(0x251))_0x53eaa6['onProgress']?.({'type':_0x48d778(0x27a),'name':_0x4084ee['yamlConfig'][_0x48d778(0x209)],'journeyId':_0x7efbf0[_0x48d778(0x202)]}),_0x53eaa6['logSuccess']?.(_0x48d778(0x298)+_0x4084ee[_0x48d778(0x224)][_0x48d778(0x209)]+'\x27'),_0xcf905a[_0x48d778(0x251)]++;else _0x7efbf0[_0x48d778(0x1f9)]==='updated'&&(_0x53eaa6[_0x48d778(0x23a)]?.({'type':_0x48d778(0x226),'name':_0x4084ee[_0x48d778(0x224)][_0x48d778(0x209)]}),_0x53eaa6['logSuccess']?.(_0x48d778(0x1fb)+_0x4084ee[_0x48d778(0x224)][_0x48d778(0x209)]+'\x27'),_0xcf905a[_0x48d778(0x28b)]++);return{'action':_0x7efbf0[_0x48d778(0x1f9)],'name':_0x4084ee[_0x48d778(0x224)][_0x48d778(0x209)],'journeyId':_0x7efbf0[_0x48d778(0x202)]};}catch(_0x35af52){const _0x3a3a0e=isHttp400Error(_0x35af52),_0x14dad8=_0x3a3a0e?ErrorCode[_0x48d778(0x1c4)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x477375=getErrorMessage(_0x35af52);throw new SDKError(_0x14dad8,_0x48d778(0x223)+(_0x4084ee['isNew']?_0x48d778(0x247):_0x48d778(0x26b))+'\x20journey\x20from\x20file:\x20'+_0x4084ee[_0x48d778(0x232)]+_0x48d778(0x1fd)+_0x477375,_0x35af52);}}));_0xcf905a[_0x4d1dbb(0x24f)][_0x4d1dbb(0x1f0)](..._0x41ff75);}return _0xcf905a;}async function matchExistingJourneySegments(_0x5b0dc9,_0x480294,_0x5a6bbe,_0xf40760,_0x3fa737){const _0x44ce30=a155_0x30a951;if(!_0x480294[_0x44ce30(0x245)]||!_0x480294[_0x44ce30(0x224)][_0x44ce30(0x22d)])return;const _0xcbb380=new Map(),_0x564295=new Set();for(const _0x5a0566 of Object[_0x44ce30(0x1e5)](_0x480294[_0x44ce30(0x224)]['segments'])){const _0xd5e7b3=generateDeterministicJourneySegmentName(_0x480294[_0x44ce30(0x224)][_0x44ce30(0x209)],_0x5a0566);_0xcbb380[_0x44ce30(0x1c6)](_0xd5e7b3,_0x5a0566),_0x564295[_0x44ce30(0x1f8)](_0x5a0566);}const _0x20dc84=[],_0x3100b9=collectSegmentIdsFromJourneyApi(_0x480294['existingJourney']);for(const _0x5709a0 of _0x3100b9){const _0x1cee9f=await fetchSegment(_0x5b0dc9,_0x5a6bbe,_0x5709a0,_0xf40760);if(!_0x1cee9f?.[_0x44ce30(0x209)])continue;const _0x4e8355=_0xcbb380[_0x44ce30(0x1f4)](_0x1cee9f[_0x44ce30(0x209)]);_0x4e8355?(_0x3fa737[_0x44ce30(0x1c6)](_0x4e8355,_0x5709a0),_0x564295[_0x44ce30(0x27e)](_0x4e8355)):_0x20dc84[_0x44ce30(0x1f0)]({'id':_0x5709a0,'seg':_0x1cee9f});}if(_0x564295[_0x44ce30(0x257)]>0x0&&_0x20dc84[_0x44ce30(0x1f3)]>0x0){const {localExpandedRuleToNames:_0xcd6be5}=buildLocalExpandedRuleMappings(_0x480294['yamlConfig']),_0x930b27=new Map();for(const {id:_0x4f48ca,seg:_0x4e51be}of _0x20dc84){if(_0x4e51be[_0x44ce30(0x220)]){const _0x4228da=apiRuleToYaml(_0x4e51be['rule']);_0x930b27[_0x44ce30(0x1c6)](_0x4f48ca,_0x4228da);}}for(const {id:_0x4f8a53,seg:_0x2e3eea}of _0x20dc84){if(!_0x2e3eea[_0x44ce30(0x220)])continue;const _0x1fb185=_0x930b27[_0x44ce30(0x1f4)](_0x4f8a53);if(!_0x1fb185)continue;const _0x4fc448=serializeExpandedRule(_0x1fb185,_0x930b27),_0x34c970=_0xcd6be5['get'](_0x4fc448);if(_0x34c970){const _0x39758c=_0x34c970['find'](_0x42ca7f=>_0x564295['has'](_0x42ca7f));_0x39758c&&(_0x3fa737['set'](_0x39758c,_0x4f8a53),_0x564295[_0x44ce30(0x27e)](_0x39758c),logger[_0x44ce30(0x29d)](_0x44ce30(0x1b0)+_0x2e3eea[_0x44ce30(0x209)]+'\x27\x20to\x20local\x20\x27'+_0x39758c+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x17b66a,_0x2a7ced,_0x6e9b4a,_0x359150,_0x1ee12c,_0x73f23c){const _0x5a3e35=a155_0x30a951,{journeyDefToRequest:_0x21fbc4,activationDefToCreateRequest:_0x208ac8,yamlRuleToApi:_0x666664,validateSegmentRule:_0x4c78aa}=_0x73f23c,_0x39ac5d=new Map(),_0x45220a=new Map();recoverSegmentIdsFromPushRecovery(_0x2a7ced,_0x39ac5d,_0x6e9b4a['segmentNameToId']);const _0x42153f=new Map(),_0x319777=new Map(),_0x4feb9e=new Map();let _0x4334a0;const _0xa3ff2c=async()=>{const _0x222637=a155_0x5a27;if(_0x4334a0)return;_0x4334a0=new Map();if(!_0x2a7ced[_0x222637(0x245)])return;const _0x2a9129=await _0x17b66a[_0x222637(0x20c)]['listActivations'](_0x2a7ced[_0x222637(0x245)]['id']);for(const _0x48f22d of _0x2a9129){const _0x4ab7b0=journeyActivationStepToYaml(_0x48f22d,_0x6e9b4a[_0x222637(0x1d2)],_0x6e9b4a[_0x222637(0x295)]),_0x3108b1=activationSignature(_0x4ab7b0);!_0x4334a0[_0x222637(0x239)](_0x3108b1)&&_0x4334a0['set'](_0x3108b1,_0x48f22d['id']),_0x4ab7b0[_0x222637(0x209)]&&_0x45220a[_0x222637(0x1c6)](_0x4ab7b0[_0x222637(0x209)],_0x48f22d['id']);}};await matchExistingJourneySegments(_0x17b66a,_0x2a7ced,_0x359150[_0x5a3e35(0x222)],_0x6e9b4a[_0x5a3e35(0x288)],_0x6e9b4a[_0x5a3e35(0x246)]);const _0x7d1484={'resolveSegmentId':async _0x5cbcf8=>{const _0x58cf31=_0x5a3e35,_0x1aa16c=_0x6e9b4a[_0x58cf31(0x246)][_0x58cf31(0x1f4)](_0x5cbcf8);if(!_0x1aa16c)throw new SDKError(ErrorCode[_0x58cf31(0x25f)],_0x58cf31(0x26a)+_0x5cbcf8+'\x20(referenced\x20in\x20journey\x20'+_0x2a7ced[_0x58cf31(0x224)]['name']+')');return _0x1aa16c;},'resolveEmbeddedSegmentId':async(_0x2cb54e,_0x18aeaa)=>{const _0x4b11d2=_0x5a3e35,_0x273f30=_0x6e9b4a[_0x4b11d2(0x246)]['get'](_0x2cb54e);if(_0x273f30)return _0x273f30;const _0x19da16=_0x6e9b4a[_0x4b11d2(0x288)][_0x4b11d2(0x227)](_0x5bad5d=>_0x5bad5d['name']===_0x2cb54e);if(_0x19da16)return _0x6e9b4a[_0x4b11d2(0x246)]['set'](_0x2cb54e,_0x19da16['id']),_0x19da16['id'];if(_0x2a7ced['isNew']){const {stageName:_0x3e06e4,criteriaName:_0x472ab3}=findSegmentCriteriaLocation(_0x2a7ced[_0x4b11d2(0x224)],_0x2cb54e);return _0x4c78aa(_0x2cb54e,_0x18aeaa[_0x4b11d2(0x220)]),_0x319777['set'](_0x2cb54e,{'definition':_0x18aeaa,'stageName':_0x3e06e4,'criteriaName':_0x472ab3}),createPendingSegmentId(_0x2cb54e);}const _0x290e79=_0x2a7ced['existingJourney']?.['id'];if(!_0x290e79)throw new SDKError(ErrorCode[_0x4b11d2(0x276)],_0x4b11d2(0x23f));const _0x3c0cf8=_0x42153f[_0x4b11d2(0x1f4)](_0x2cb54e);if(_0x3c0cf8)return _0x3c0cf8;const _0x1872a4=((async()=>{const _0x29f1d6=_0x4b11d2;_0x4c78aa(_0x2cb54e,_0x18aeaa[_0x29f1d6(0x220)]);const _0x4334dd=generateDeterministicJourneySegmentName(_0x2a7ced['yamlConfig']['name'],_0x2cb54e),_0x18d4fe=_0x6e9b4a['existingSegments'][_0x29f1d6(0x227)](_0x4e51ac=>_0x4e51ac[_0x29f1d6(0x209)]===_0x4334dd),_0x53e841=createSegmentIdResolver(_0x6e9b4a['segmentNameToId'],_0x2cb54e),_0x1a523d=await resolveRuleSegmentIds(_0x18aeaa[_0x29f1d6(0x220)],_0x53e841);let _0x4f0f30;return _0x18d4fe?(await _0x17b66a[_0x29f1d6(0x1ad)][_0x29f1d6(0x1c1)](_0x359150[_0x29f1d6(0x222)],_0x18d4fe['id'],{'description':_0x18aeaa[_0x29f1d6(0x1df)]||_0x29f1d6(0x29a)+_0x2cb54e,'rule':_0x666664(_0x1a523d),'countPopulation':!![]}),_0x4f0f30=_0x18d4fe['id'],saveSegmentToPushRecovery(_0x2a7ced['absolutePath'],_0x2a7ced['yamlConfig'][_0x29f1d6(0x209)],_0x2cb54e,{'segmentId':_0x4f0f30,'uniqueServerName':_0x4334dd,'createdAt':new Date()[_0x29f1d6(0x296)]()})):_0x4f0f30=await createOrRecoverEmbeddedSegment(_0x17b66a,_0x2a7ced,{'localName':_0x2cb54e,'uniqueSegmentName':_0x4334dd,'description':_0x18aeaa[_0x29f1d6(0x1df)]||_0x29f1d6(0x29a)+_0x2cb54e,'journeyId':_0x290e79,'resolvedRule':_0x1a523d,'parentId':_0x359150['parentId'],'folderId':_0x359150['rootFolderId']||''},_0x666664),_0x6e9b4a[_0x29f1d6(0x246)][_0x29f1d6(0x1c6)](_0x2cb54e,_0x4f0f30),_0x39ac5d[_0x29f1d6(0x1c6)](_0x2cb54e,_0x4f0f30),_0x4f0f30;})());_0x42153f[_0x4b11d2(0x1c6)](_0x2cb54e,_0x1872a4);try{return await _0x1872a4;}finally{_0x42153f['delete'](_0x2cb54e);}},'resolveActivationId':async _0x4c7e5d=>{const _0x4bf478=_0x5a3e35,_0x3e7b7a=_0x45220a[_0x4bf478(0x1f4)](_0x4c7e5d);if(_0x3e7b7a)return _0x3e7b7a;if(_0x2a7ced[_0x4bf478(0x245)]){await _0xa3ff2c();const _0x56ba68=_0x45220a[_0x4bf478(0x1f4)](_0x4c7e5d);if(_0x56ba68)return _0x56ba68;}throw new SDKError(ErrorCode[_0x4bf478(0x254)],_0x4bf478(0x234)+_0x4c7e5d+_0x4bf478(0x1dd)+_0x2a7ced['yamlConfig']['name']+').\x20'+_0x4bf478(0x1c2));},'resolveEmbeddedActivationId':async(_0x39f3e6,_0x529a0f)=>{const _0x29cecb=_0x5a3e35,_0xae7dd0=_0x45220a[_0x29cecb(0x1f4)](_0x39f3e6);if(_0xae7dd0)return _0xae7dd0;if(_0x2a7ced[_0x29cecb(0x20b)])return _0x4feb9e[_0x29cecb(0x1c6)](_0x39f3e6,_0x529a0f),createPendingActivationId(_0x39f3e6);if(_0x2a7ced['existingJourney']){await _0xa3ff2c();const _0x3b8164=_0x45220a[_0x29cecb(0x1f4)](_0x529a0f[_0x29cecb(0x209)]);if(_0x3b8164)return _0x45220a[_0x29cecb(0x1c6)](_0x39f3e6,_0x3b8164),_0x3b8164;const _0x381083=activationSignature(_0x529a0f),_0x11b54a=_0x4334a0?.[_0x29cecb(0x1f4)](_0x381083);if(_0x11b54a)return _0x45220a[_0x29cecb(0x1c6)](_0x39f3e6,_0x11b54a),_0x11b54a;const _0x1cc938=await _0x208ac8(_0x529a0f,_0x6e9b4a[_0x29cecb(0x28c)]),_0x56af74={..._0x1cc938,..._0x529a0f[_0x29cecb(0x2a1)]!==undefined&&{'runAfterJourneyRefresh':_0x529a0f[_0x29cecb(0x2a1)]}},_0x58695b=await _0x17b66a[_0x29cecb(0x20c)][_0x29cecb(0x283)](_0x2a7ced[_0x29cecb(0x245)]['id'],_0x56af74);return _0x45220a[_0x29cecb(0x1c6)](_0x39f3e6,_0x58695b['id']),_0x58695b['id'];}throw new SDKError(ErrorCode[_0x29cecb(0x276)],_0x29cecb(0x1b6));},'resolveJourneyId':async _0x408cd8=>{const _0xfb45=_0x5a3e35;try{return await _0x17b66a[_0xfb45(0x20c)][_0xfb45(0x27c)](_0x359150[_0xfb45(0x222)],_0x408cd8);}catch(_0x43fe4f){throw new SDKError(ErrorCode[_0xfb45(0x254)],'Journey\x20\x27'+_0x408cd8+_0xfb45(0x22e)+_0x2a7ced[_0xfb45(0x224)][_0xfb45(0x209)]+'\x27)',_0x43fe4f);}},'resolveStageId':async(_0x4bf76b,_0x519b26)=>{const _0x2217e4=_0x5a3e35,_0x3420fc=await _0x17b66a['journey'][_0x2217e4(0x1bc)](_0x4bf76b),_0x549143=_0x3420fc['attributes']['journeyStages'][_0x2217e4(0x227)](_0x332adb=>_0x332adb['name'][_0x2217e4(0x1f1)]()===_0x519b26[_0x2217e4(0x1f1)]());if(!_0x549143?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x2217e4(0x292)+_0x519b26+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x3420fc[_0x2217e4(0x1de)][_0x2217e4(0x297)]||_0x3420fc[_0x2217e4(0x1de)][_0x2217e4(0x209)])+'\x27');return _0x549143['id'];}},_0x5de21a=await _0x21fbc4(_0x2a7ced[_0x5a3e35(0x224)],_0x359150[_0x5a3e35(0x222)],_0x7d1484),_0x4065ba=_0x359150['folderId']||_0x359150['rootFolderId'];_0x4065ba&&(_0x5de21a['relationships']={'parentFolder':{'data':{'id':_0x4065ba,'type':_0x5a3e35(0x1e3)}}});if(_0x2a7ced[_0x5a3e35(0x20b)]){if(_0x319777[_0x5a3e35(0x257)]>0x0||_0x4feb9e[_0x5a3e35(0x257)]>0x0)return await executeThreeStepJourneyCreate(_0x17b66a,_0x2a7ced,_0x5de21a,{'pendingEmbeddedSegments':_0x319777,'pendingEmbeddedActivations':_0x4feb9e,'embeddedSegmentNameToId':_0x39ac5d,'journeyActivationNameToId':_0x45220a},{..._0x359150,'effectiveFolderId':_0x4065ba},_0x6e9b4a,_0x1ee12c,_0x73f23c);else{ensureJourneyDefaults(_0x5de21a['attributes']);const _0x49b7f7=await _0x17b66a['journey'][_0x5a3e35(0x247)](_0x5de21a);return deletePushRecovery(_0x2a7ced['absolutePath']),{'action':_0x5a3e35(0x251),'journeyId':_0x49b7f7['id'],'embeddedSegmentNameToId':_0x39ac5d};}}else{if(_0x2a7ced[_0x5a3e35(0x214)]&&_0x2a7ced['existingJourney']){_0x5de21a['id']=_0x2a7ced[_0x5a3e35(0x245)]['id'];const _0x4c767b=_0x5de21a[_0x5a3e35(0x1de)];_0x2a7ced['existingJourney'][_0x5a3e35(0x1de)]?.[_0x5a3e35(0x297)]&&(_0x4c767b[_0x5a3e35(0x297)]=_0x2a7ced['existingJourney'][_0x5a3e35(0x1de)]['journeyBundleName']);const _0xe378f1=_0x2a7ced['existingJourney'][_0x5a3e35(0x1de)]?.[_0x5a3e35(0x221)];return _0xe378f1&&_0x5de21a['attributes']['journeyStages']&&injectExistingStageIds(_0x5de21a[_0x5a3e35(0x1de)]['journeyStages'],_0xe378f1),ensureJourneyDefaults(_0x4c767b),await _0x17b66a[_0x5a3e35(0x20c)][_0x5a3e35(0x26b)](_0x2a7ced[_0x5a3e35(0x245)]['id'],_0x5de21a),deletePushRecovery(_0x2a7ced[_0x5a3e35(0x232)]),{'action':_0x5a3e35(0x28b),'journeyId':_0x2a7ced[_0x5a3e35(0x245)]['id'],'embeddedSegmentNameToId':_0x39ac5d};}}return deletePushRecovery(_0x2a7ced[_0x5a3e35(0x232)]),{'action':_0x5a3e35(0x1da),'journeyId':_0x2a7ced[_0x5a3e35(0x245)]?.['id'],'embeddedSegmentNameToId':_0x39ac5d};}function findSegmentCriteriaLocation(_0xefa6e4,_0x15e620){const _0x142859=a155_0x30a951,_0x11340d=_0xefa6e4[_0x142859(0x282)]||_0xefa6e4[_0x142859(0x263)]?.[0x0]?.[_0x142859(0x282)]||[];let _0x442a16=_0x142859(0x260),_0x4f9c35=_0x15e620;const _0x23bf00=_0xefa6e4[_0x142859(0x1fa)]||_0xefa6e4[_0x142859(0x263)]?.[0x0]?.[_0x142859(0x1fa)];if(_0x23bf00?.[_0x142859(0x1ad)]===_0x15e620)return{'stageName':'goal','criteriaName':_0x23bf00[_0x142859(0x209)]||_0x15e620};_0x233bf4:for(const _0x2563ad of _0x11340d){if(_0x2563ad[_0x142859(0x273)]?.[_0x142859(0x1ad)]===_0x15e620){_0x442a16=_0x2563ad['name'],_0x4f9c35=_0x2563ad[_0x142859(0x273)][_0x142859(0x209)]||_0x15e620;break;}if(_0x2563ad[_0x142859(0x243)])for(const _0x574ecf of _0x2563ad[_0x142859(0x243)]){if(_0x574ecf[_0x142859(0x20e)]==='decision_point'&&_0x574ecf['with']?.['branches'])for(const _0xe265e7 of _0x574ecf['with'][_0x142859(0x21e)]){if(_0xe265e7[_0x142859(0x1ad)]===_0x15e620){_0x442a16=_0x2563ad[_0x142859(0x209)],_0x4f9c35=_0xe265e7[_0x142859(0x209)]||_0x15e620;break _0x233bf4;}}}}return{'stageName':_0x442a16,'criteriaName':_0x4f9c35};}async function executeThreeStepJourneyCreate(_0x345a19,_0x2ec764,_0x3b785f,_0x1e3c10,_0x2c46fc,_0x364bf0,_0x381f8a,_0x5daca4){const _0x1235f9=a155_0x30a951,{activationDefToCreateRequest:_0x4233ab,yamlRuleToApi:_0x569f8a}=_0x5daca4,{pendingEmbeddedSegments:_0x237244,pendingEmbeddedActivations:_0x3c11ac,embeddedSegmentNameToId:_0x122c42}=_0x1e3c10,_0xe6f08a=JSON[_0x1235f9(0x1d3)](JSON[_0x1235f9(0x24d)](_0x3b785f));ensureJourneyDefaults(_0xe6f08a['attributes']),stripPendingIds(_0xe6f08a);const _0x21e024=await _0x345a19[_0x1235f9(0x20c)][_0x1235f9(0x247)](_0xe6f08a),_0x972f10=_0x21e024['id'],_0x4dda0d=new Map();for(const _0x460421 of _0x21e024['attributes'][_0x1235f9(0x221)]){_0x4dda0d[_0x1235f9(0x1c6)](_0x460421[_0x1235f9(0x209)][_0x1235f9(0x1f1)](),_0x460421['id']);}recoverSegmentIdsFromPushRecovery(_0x2ec764,_0x122c42,_0x364bf0[_0x1235f9(0x246)]);for(const [_0x1d83d7,{definition:_0x2a09f0}]of _0x237244){if(_0x122c42[_0x1235f9(0x239)](_0x1d83d7)){_0x381f8a[_0x1235f9(0x23a)]?.({'type':_0x1235f9(0x230),'journeyName':_0x2ec764[_0x1235f9(0x224)][_0x1235f9(0x209)],'segmentName':_0x1d83d7});continue;}const _0x8c250e=generateDeterministicJourneySegmentName(_0x2ec764[_0x1235f9(0x224)][_0x1235f9(0x209)],_0x1d83d7);_0x381f8a[_0x1235f9(0x23a)]?.({'type':_0x1235f9(0x1c8),'journeyName':_0x2ec764[_0x1235f9(0x224)]['name'],'segmentName':_0x1d83d7});const _0x51df5e=createSegmentIdResolver(_0x364bf0['segmentNameToId'],_0x1d83d7),_0x536d5c=await resolveRuleSegmentIds(_0x2a09f0['rule'],_0x51df5e),_0x496a5b=await createOrRecoverEmbeddedSegment(_0x345a19,_0x2ec764,{'localName':_0x1d83d7,'uniqueSegmentName':_0x8c250e,'description':_0x2a09f0[_0x1235f9(0x1df)]||_0x1235f9(0x29a)+_0x1d83d7,'journeyId':_0x972f10,'resolvedRule':_0x536d5c,'parentId':_0x2c46fc[_0x1235f9(0x222)],'folderId':_0x2c46fc[_0x1235f9(0x20a)]||''},_0x569f8a);_0x122c42[_0x1235f9(0x1c6)](_0x1d83d7,_0x496a5b),_0x364bf0[_0x1235f9(0x246)][_0x1235f9(0x1c6)](_0x1d83d7,_0x496a5b),_0x381f8a[_0x1235f9(0x23a)]?.({'type':_0x1235f9(0x230),'journeyName':_0x2ec764[_0x1235f9(0x224)][_0x1235f9(0x209)],'segmentName':_0x1d83d7});}const _0x34f06d=new Map();for(const [_0x5ddf7b,_0x379fd2]of _0x3c11ac){_0x381f8a[_0x1235f9(0x23a)]?.({'type':_0x1235f9(0x1be),'journeyName':_0x2ec764[_0x1235f9(0x224)][_0x1235f9(0x209)],'activationName':_0x5ddf7b});const _0x1b8a14=await _0x4233ab(_0x379fd2,_0x364bf0[_0x1235f9(0x28c)]),_0x572e2f={..._0x1b8a14,..._0x379fd2[_0x1235f9(0x2a1)]!==undefined&&{'runAfterJourneyRefresh':_0x379fd2['run_after_journey_refresh']}},_0x2929cd=await _0x345a19[_0x1235f9(0x20c)][_0x1235f9(0x283)](_0x972f10,_0x572e2f);_0x34f06d[_0x1235f9(0x1c6)](_0x5ddf7b,_0x2929cd['id']),_0x1e3c10[_0x1235f9(0x1d7)][_0x1235f9(0x1c6)](_0x5ddf7b,_0x2929cd['id']),_0x381f8a[_0x1235f9(0x23a)]?.({'type':'embedded_activation_created','journeyName':_0x2ec764[_0x1235f9(0x224)][_0x1235f9(0x209)],'activationName':_0x5ddf7b});}const _0x25a22d=JSON[_0x1235f9(0x1d3)](JSON[_0x1235f9(0x24d)](_0x3b785f));return _0x25a22d['id']=_0x972f10,ensureJourneyDefaults(_0x25a22d[_0x1235f9(0x1de)]),resolvePendingIdsInRequest(_0x25a22d,_0x3b785f,_0x4dda0d,_0x122c42,_0x34f06d,_0x381f8a),await _0x345a19[_0x1235f9(0x20c)][_0x1235f9(0x26b)](_0x972f10,_0x25a22d),deletePushRecovery(_0x2ec764[_0x1235f9(0x232)]),{'action':'created','journeyId':_0x972f10,'embeddedSegmentNameToId':_0x122c42};}export function stripWaitStepPendingIds(_0x48e2bb){const _0x1a206e=a155_0x30a951,_0x229283=_0x48e2bb[_0x1a206e(0x207)]&&isPendingSegmentId(_0x48e2bb['conditionSegmentId']),_0x113109=_0x48e2bb[_0x1a206e(0x262)]?.[_0x1a206e(0x21d)](_0x3ce1bc=>_0x3ce1bc[_0x1a206e(0x204)]&&isPendingSegmentId(_0x3ce1bc[_0x1a206e(0x204)]));(_0x229283||_0x113109)&&(_0x48e2bb[_0x1a206e(0x270)]=_0x1a206e(0x231),_0x48e2bb[_0x1a206e(0x1d1)]=0x1,_0x48e2bb[_0x1a206e(0x22a)]='day',delete _0x48e2bb['conditionSegmentId'],delete _0x48e2bb[_0x1a206e(0x278)],delete _0x48e2bb[_0x1a206e(0x25e)],delete _0x48e2bb[_0x1a206e(0x262)]);}export function resolveWaitStepPendingIds(_0x472e06,_0x250947,_0x7ae222,_0x139923){const _0x46e695=a155_0x30a951;if(_0x250947[_0x46e695(0x207)]&&isPendingSegmentId(_0x250947[_0x46e695(0x207)])){const _0x1b1d00=_0x7ae222(_0x250947[_0x46e695(0x207)],_0x46e695(0x293)+_0x139923+_0x46e695(0x22c));_0x1b1d00&&(_0x472e06[_0x46e695(0x270)]=_0x46e695(0x1aa),_0x472e06[_0x46e695(0x207)]=_0x1b1d00,delete _0x472e06[_0x46e695(0x1d1)],delete _0x472e06[_0x46e695(0x22a)],_0x250947[_0x46e695(0x278)]!==undefined&&(_0x472e06[_0x46e695(0x278)]=_0x250947[_0x46e695(0x278)]),_0x250947['conditionTimeoutUnit']&&(_0x472e06['conditionTimeoutUnit']=_0x250947[_0x46e695(0x25e)]));}if(_0x250947[_0x46e695(0x262)]){const _0x506c36=_0x250947[_0x46e695(0x262)]['some'](_0x3b01c7=>_0x3b01c7[_0x46e695(0x204)]&&isPendingSegmentId(_0x3b01c7[_0x46e695(0x204)]));if(_0x506c36){const _0x48c3ae=_0x250947['conditions'][_0x46e695(0x258)](_0x5498ca=>{const _0x252c88=_0x46e695;if(_0x5498ca[_0x252c88(0x204)]&&isPendingSegmentId(_0x5498ca[_0x252c88(0x204)])){const _0x4da096=_0x7ae222(_0x5498ca[_0x252c88(0x204)],_0x252c88(0x293)+_0x139923+_0x252c88(0x22c));return{..._0x5498ca,'segmentId':_0x4da096||_0x5498ca[_0x252c88(0x204)]};}return{..._0x5498ca};});_0x472e06[_0x46e695(0x270)]=_0x46e695(0x1aa),_0x472e06[_0x46e695(0x262)]=_0x48c3ae,delete _0x472e06['waitStep'],delete _0x472e06['waitStepUnit'],delete _0x472e06[_0x46e695(0x207)],delete _0x472e06['conditionTimeoutDuration'],delete _0x472e06['conditionTimeoutUnit'];}}}function stripPendingIds(_0x4aeb18){const _0x3324a5=a155_0x30a951;_0x4aeb18[_0x3324a5(0x1de)][_0x3324a5(0x1fa)]?.[_0x3324a5(0x204)]&&isPendingSegmentId(_0x4aeb18[_0x3324a5(0x1de)]['goal'][_0x3324a5(0x204)])&&delete _0x4aeb18[_0x3324a5(0x1de)][_0x3324a5(0x1fa)];for(const _0x2fd2d4 of _0x4aeb18['attributes'][_0x3324a5(0x221)]||[]){_0x2fd2d4[_0x3324a5(0x1b3)]?.[_0x3324a5(0x204)]&&isPendingSegmentId(_0x2fd2d4[_0x3324a5(0x1b3)][_0x3324a5(0x204)])&&delete _0x2fd2d4[_0x3324a5(0x1b3)];_0x2fd2d4[_0x3324a5(0x27f)]?.[_0x3324a5(0x204)]&&isPendingSegmentId(_0x2fd2d4[_0x3324a5(0x27f)][_0x3324a5(0x204)])&&delete _0x2fd2d4['milestone'];_0x2fd2d4[_0x3324a5(0x1ed)]&&(_0x2fd2d4[_0x3324a5(0x1ed)]=_0x2fd2d4[_0x3324a5(0x1ed)][_0x3324a5(0x201)](_0x1ee9e4=>!_0x1ee9e4[_0x3324a5(0x204)]||!isPendingSegmentId(_0x1ee9e4[_0x3324a5(0x204)])));if(_0x2fd2d4[_0x3324a5(0x243)])for(const _0x597901 of Object[_0x3324a5(0x1e5)](_0x2fd2d4['steps'])){const _0x463bbb=_0x2fd2d4[_0x3324a5(0x243)][_0x597901];_0x463bbb[_0x3324a5(0x20e)]===_0x3324a5(0x275)&&_0x463bbb[_0x3324a5(0x233)]&&isPendingActivationId(_0x463bbb[_0x3324a5(0x233)])&&(_0x463bbb[_0x3324a5(0x233)]='');if(_0x463bbb[_0x3324a5(0x20e)]===_0x3324a5(0x26c)&&_0x463bbb[_0x3324a5(0x21e)])for(const _0x5ce0f9 of _0x463bbb[_0x3324a5(0x21e)]){_0x5ce0f9[_0x3324a5(0x204)]&&isPendingSegmentId(_0x5ce0f9[_0x3324a5(0x204)])&&(_0x5ce0f9[_0x3324a5(0x204)]='');}_0x463bbb[_0x3324a5(0x20e)]===_0x3324a5(0x253)&&stripWaitStepPendingIds(_0x463bbb);}}}function resolvePendingIdsInRequest(_0x3fe06a,_0x1fdda0,_0xeeee79,_0x3bb306,_0x552c10,_0x3b668b){const _0x53586c=a155_0x30a951,_0x2f9344=(_0x21b2b0,_0x2848e5)=>{const _0x528ca6=a155_0x5a27;if(!isPendingSegmentId(_0x21b2b0))return _0x21b2b0;const _0x1b4e9e=extractPendingSegmentName(_0x21b2b0),_0x43bdd8=_0x3bb306[_0x528ca6(0x1f4)](_0x1b4e9e);return!_0x43bdd8&&_0x3b668b[_0x528ca6(0x250)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x1b4e9e+_0x528ca6(0x1fe)+_0x2848e5),_0x43bdd8;};if(_0x3fe06a[_0x53586c(0x1de)][_0x53586c(0x1fa)]?.[_0x53586c(0x204)]&&isPendingSegmentId(_0x3fe06a[_0x53586c(0x1de)]['goal']['segmentId'])){const _0x2dc5ec=_0x2f9344(_0x3fe06a[_0x53586c(0x1de)][_0x53586c(0x1fa)][_0x53586c(0x204)],'goal\x20criteria');_0x2dc5ec&&(_0x3fe06a['attributes'][_0x53586c(0x1fa)]['segmentId']=_0x2dc5ec);}for(const _0xee679c of _0x3fe06a[_0x53586c(0x1de)]['journeyStages']||[]){const _0x8505ce=_0xeeee79['get'](_0xee679c[_0x53586c(0x209)][_0x53586c(0x1f1)]());_0x8505ce&&(_0xee679c['id']=_0x8505ce);if(_0xee679c[_0x53586c(0x1b3)]?.[_0x53586c(0x204)]&&isPendingSegmentId(_0xee679c[_0x53586c(0x1b3)][_0x53586c(0x204)])){const _0x29c436=_0x2f9344(_0xee679c[_0x53586c(0x1b3)]['segmentId'],'stage\x20\x27'+_0xee679c[_0x53586c(0x209)]+_0x53586c(0x208));_0x29c436&&(_0xee679c[_0x53586c(0x1b3)][_0x53586c(0x204)]=_0x29c436);}if(_0xee679c[_0x53586c(0x1ed)])for(const _0x2e8946 of _0xee679c['exitCriterias']){if(_0x2e8946['segmentId']&&isPendingSegmentId(_0x2e8946['segmentId'])){const _0x56a73f=_0x2f9344(_0x2e8946[_0x53586c(0x204)],_0x53586c(0x293)+_0xee679c[_0x53586c(0x209)]+_0x53586c(0x2a3));_0x56a73f&&(_0x2e8946[_0x53586c(0x204)]=_0x56a73f);}}if(_0xee679c[_0x53586c(0x27f)]?.[_0x53586c(0x204)]&&isPendingSegmentId(_0xee679c[_0x53586c(0x27f)][_0x53586c(0x204)])){const _0x4c2fa2=_0x2f9344(_0xee679c[_0x53586c(0x27f)][_0x53586c(0x204)],'stage\x20\x27'+_0xee679c['name']+_0x53586c(0x256));_0x4c2fa2&&(_0xee679c[_0x53586c(0x27f)]['segmentId']=_0x4c2fa2);}if(_0xee679c[_0x53586c(0x243)]){const _0x867f41=_0x3b4edf=>_0x1fdda0[_0x53586c(0x1de)]['journeyStages']?.[_0x53586c(0x227)](_0x4fecf4=>_0x4fecf4[_0x53586c(0x209)][_0x53586c(0x1f1)]()===_0xee679c['name'][_0x53586c(0x1f1)]())?.[_0x53586c(0x243)]?.[_0x3b4edf];for(const _0x284b3e of Object['keys'](_0xee679c[_0x53586c(0x243)])){const _0x59cc03=_0xee679c[_0x53586c(0x243)][_0x284b3e],_0xca6a1e=_0x867f41(_0x284b3e);if(_0x59cc03[_0x53586c(0x20e)]===_0x53586c(0x275)&&_0x59cc03['journeyActivationStepId']&&(isPendingActivationId(_0x59cc03[_0x53586c(0x233)])||_0x59cc03[_0x53586c(0x233)]==='')){if(_0xca6a1e?.['journeyActivationStepId']&&isPendingActivationId(_0xca6a1e[_0x53586c(0x233)])){const _0x25ef0b=extractPendingActivationName(_0xca6a1e[_0x53586c(0x233)]),_0x222291=_0x552c10[_0x53586c(0x1f4)](_0x25ef0b);_0x222291&&(_0x59cc03['journeyActivationStepId']=_0x222291);}}if(_0x59cc03[_0x53586c(0x20e)]===_0x53586c(0x26c)&&_0x59cc03['branches']&&_0xca6a1e?.[_0x53586c(0x21e)])for(let _0x90e67f=0x0;_0x90e67f<_0x59cc03[_0x53586c(0x21e)][_0x53586c(0x1f3)];_0x90e67f++){const _0x2226b2=_0x59cc03[_0x53586c(0x21e)][_0x90e67f],_0x29bbf6=_0xca6a1e[_0x53586c(0x21e)][_0x90e67f];if(_0x29bbf6?.[_0x53586c(0x204)]&&isPendingSegmentId(_0x29bbf6[_0x53586c(0x204)])){const _0xdfe421=_0x2f9344(_0x29bbf6[_0x53586c(0x204)],_0x53586c(0x293)+_0xee679c['name']+_0x53586c(0x20d)+(_0x2226b2['name']||_0x90e67f)+'\x27');_0xdfe421&&(_0x2226b2[_0x53586c(0x204)]=_0xdfe421);}}_0x59cc03[_0x53586c(0x20e)]===_0x53586c(0x253)&&_0xca6a1e?.[_0x53586c(0x20e)]===_0x53586c(0x253)&&resolveWaitStepPendingIds(_0x59cc03,_0xca6a1e,_0x2f9344,_0xee679c['name']);}}}}
1
+ const a155_0x285d0a=a155_0x5fe8;(function(_0x24daac,_0x48b225){const _0x120252=a155_0x5fe8,_0x957f8c=_0x24daac();while(!![]){try{const _0x34bfb0=parseInt(_0x120252(0x1b2))/0x1+-parseInt(_0x120252(0x19e))/0x2+parseInt(_0x120252(0x1fc))/0x3*(-parseInt(_0x120252(0x1b6))/0x4)+-parseInt(_0x120252(0x162))/0x5*(-parseInt(_0x120252(0x1cb))/0x6)+parseInt(_0x120252(0x128))/0x7+-parseInt(_0x120252(0x161))/0x8+parseInt(_0x120252(0x18e))/0x9;if(_0x34bfb0===_0x48b225)break;else _0x957f8c['push'](_0x957f8c['shift']());}catch(_0x39fb96){_0x957f8c['push'](_0x957f8c['shift']());}}}(a155_0x512e,0x2992f));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a155_0x285d0a(0x1f7);export const PENDING_ACTIVATION_PREFIX=a155_0x285d0a(0x127);export function createPendingSegmentId(_0x5e8c88){return''+PENDING_SEGMENT_PREFIX+_0x5e8c88+'__';}export function isPendingSegmentId(_0x1e1679){const _0x47b763=a155_0x285d0a;return _0x1e1679[_0x47b763(0x151)](PENDING_SEGMENT_PREFIX)&&!_0x1e1679[_0x47b763(0x151)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x4c1ba5){return _0x4c1ba5['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x36a68c){return''+PENDING_ACTIVATION_PREFIX+_0x36a68c+'__';}export function isPendingActivationId(_0x5bd62b){return _0x5bd62b['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3c156b){const _0x459664=a155_0x285d0a;return _0x3c156b[_0x459664(0x197)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0xc1a03f,_0xbc7c87){const _0x7498f9=a155_0x285d0a,_0x31ce36=_0xc1a03f+'::'+(_0xbc7c87[_0x7498f9(0x13b)]()||'segment'),_0x9f566=createHash('sha1')[_0x7498f9(0x1a6)](_0x31ce36)[_0x7498f9(0x18f)]('hex')[_0x7498f9(0x1b5)](0x0,0xc);return'journey_entry_criteria_'+_0x9f566;}export function ensureJourneyDefaults(_0x3eb1b9){const _0x3e2f38=a155_0x285d0a;!_0x3eb1b9[_0x3e2f38(0x1a8)]&&(_0x3eb1b9['description']=''),!_0x3eb1b9[_0x3e2f38(0x205)]&&(_0x3eb1b9[_0x3e2f38(0x205)]=_0x3e2f38(0x146));}export function injectExistingStageIds(_0x4b3641,_0x23f498){const _0x2b21cc=a155_0x285d0a,_0x3a9b87=new Map(_0x23f498[_0x2b21cc(0x21f)](_0x511331=>[_0x511331[_0x2b21cc(0x208)],_0x511331['id']]));for(const _0x13035d of _0x4b3641){if(!_0x13035d['id']){const _0x50cf5b=_0x3a9b87['get'](_0x13035d[_0x2b21cc(0x208)]);_0x50cf5b&&(_0x13035d['id']=_0x50cf5b);}}}export function resolveTDFolderPath(_0xd98017,_0x17f7d0,_0xd2d058){if(!_0x17f7d0)return _0xd98017;if(_0xd98017===_0xd2d058||_0xd98017['startsWith'](_0xd2d058+'/'))return _0xd98017;return _0xd98017?_0xd2d058+'/'+_0xd98017:_0xd2d058;}export function addFoldersToCreate(_0x412a97,_0x2580d4,_0xf7d607){const _0x2ccc84=a155_0x285d0a;if(!_0x412a97)return;if(_0x2580d4[_0x2ccc84(0x1e3)](_0x412a97))return;const _0x34f3df=_0x412a97[_0x2ccc84(0x1c5)]('/');let _0x3ed2ca='';for(const _0x4d7982 of _0x34f3df){_0x3ed2ca=_0x3ed2ca?_0x3ed2ca+'/'+_0x4d7982:_0x4d7982,!_0x2580d4[_0x2ccc84(0x1e3)](_0x3ed2ca)&&_0xf7d607['add'](_0x3ed2ca);}}export function sortFoldersByDepth(_0x147181){const _0x40d279=a155_0x285d0a;return[..._0x147181][_0x40d279(0x167)]((_0x2abfa5,_0x3c8d39)=>{const _0xb83f28=_0x40d279,_0x9b1c7a=(_0x2abfa5[_0xb83f28(0x157)](/\//g)||[])['length'],_0x422832=(_0x3c8d39[_0xb83f28(0x157)](/\//g)||[])[_0xb83f28(0x13c)];return _0x9b1c7a-_0x422832;});}import*as a155_0x3c593c from'yaml';import{readFileSync}from'fs';import a155_0x45cde5 from'path';import{isJourneyDef,parseYamlString as a155_0x4f65d2,toYamlString as a155_0x2d82ca,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';function a155_0x512e(){const _0x38ba8a=['existingActivation','reduce','\x27...','toString','with','update','create','description','entry_criteria','segment_created','resolveSegment','parentFolder','some','segmentByFolderAndName','activationStepsById','Activation','Creating\x20segment\x20\x27','219100ETPbsQ','entryCriteria','exitCriterias','slice','59256xVLQOn','logDeleted','segment','localName','createdSegmentId','\x20activation\x20\x27','entries','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','buildUserMaps','INTERNAL','Created\x20activation\x20\x27','segmentNameToId','yamlActivation','rootFolderId','Updating\x20activation\x20\x27','split','conditionTimeoutDuration','journeyId','\x20(referenced\x20in\x20journey\x20','notification','segmentFolderId','24jpSYtt','embedded_activation_created','getLatestJourneyId','Activation\x20not\x20found:\x20','Updated\x20journey\x20\x27','getSegment','verbose','diff','stage\x20\x27','Failed\x20to\x20','conditions','updateActivation','\x27\x20entry\x20criteria','Matched\x20server\x20segment\x20\x27','Entry\x20criteria:\x20','hasChanges','goal\x20criteria','createSegment','existingSegments','stringify','all','message','uniqueServerName','delete','has','createActivation','activationsBySegmentId','existingSegment','Deleted\x20segment\x20\x27','toLowerCase','segmentId','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','activation_','segment_updated','max','Stage\x20\x27','updateSegmentById','activation_deleting','isNew','./child-segment-yaml.js','kind','.$1.push-recovery.json','Segment\x20not\x20found','):\x20','__pending_','journey_created','stages','Segment\x20not\x20found:\x20','SEGMENT_NOT_FOUND','45VbgoAD','validatedRequest','ACTIVATION_UPDATE_ERROR','steps','unchanged','logSuccess','embedded_segment_creating','journey','milestone','state','day','getJourney','name','journeyBundleId','relative','deleted','Journey\x20\x27','rule','Created\x20folder\x20\x27','conditionSegmentId','uniqueSegmentName','nameToType','createJourneySegment','attributes','effectiveFolderId','activation_updated','parentId','toISOString','set','null','flatMap','Failed\x20to\x20resolve\x20segment\x20','journeyActivationStepId','schedule','waitStepType','map','connectionIdToNameMap','waitStep','action','resolvedRule','Embedded\x20segment\x20\x27','Updated\x20segment\x20\x27','parseDocument','user','connector_config','createFolder','embedded_activation_creating','Fetching\x20','__pending_act_','398041vsPfAg','activationContext','\x27\x20by\x20rule\x20content','run_after_journey_refresh','journeyById','yamlConfig','filter','JOURNEY_SYNTAX_ERROR','Name\x20has\x20already\x20been\x20taken','values','folderPath','WaitStep','logWarning','object','embedded_segment_created','item','data','DecisionPoint','Creating\x20folder\x20\x27','trim','length','journeyName','connection','versionNumber','type','index',').\x20','folderPathToId','Failed\x20to\x20resolve\x20activation\x20','\x27\x20from\x20file:\x20','draft','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','deleteSegment','Condition','relationships','existingJourney','created','activation_created','embeddedSegmentNameToId','and\x20the\x20server\x20segment,\x20then\x20retry.','\x0a\x20\x20','startsWith','updated','join','progress','all_columns','activation_template_id','match','NOT_FOUND','activations','journeyStages','Creating\x20activation\x20\x27','\x27\x20milestone','getSegmentEntity\x20also\x20failed\x20for\x20','segment_creating','isArray','getActivation','1087960mhNmOf','400970fmGEry','Duration','journeyBundlesByFolderAndName','size','journeys','sort','segment_updating','absolutePath','idToEmailMap','segment_deleted','nameToId','valid','Created\x20journey\x20\x27','utf-8','../../utils/async.js','logInfo','journeyBundleName','createdSegmentIds','decision_point','keys','find','waitStepUnit','idToName','Created\x20segment\x20\x27','Failed\x20to\x20fetch\x20referenced\x20segment\x20','parse','listActivations','Deleting\x20activation\x20\x27','folder_creating','fetchJourney','columns','onProgress','journey_updated','get','from','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','\x27\x20wait\x20condition','conditionTimeoutUnit','getSegmentEntity','push','segments',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','\x27\x20to\x20local\x20\x27','withProgress','1243719sFgxyG','digest','results','activationParams','debug','Delete\x20the\x20push\x20recovery\x20file\x20(','add','Updating\x20segment\x20\x27','folder','replace','goal','folderId','JOURNEY_UPDATE_ERROR','branches','resolveJourneyId','journey_updating','412876EhZPSP','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x27\x20for\x20'];a155_0x512e=function(){return _0x38ba8a;};return a155_0x512e();}import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x1a78bc){const _0x4ec955=a155_0x285d0a;if(Array[_0x4ec955(0x15f)](_0x1a78bc))return'['+_0x1a78bc[_0x4ec955(0x21f)](_0x37e597=>stableStringify(_0x37e597))[_0x4ec955(0x153)](',')+']';if(_0x1a78bc&&typeof _0x1a78bc===_0x4ec955(0x135)){const _0xcee97b=_0x1a78bc,_0x37918b=Object[_0x4ec955(0x175)](_0xcee97b)[_0x4ec955(0x167)](),_0x4c5b16=_0x37918b['map'](_0x5bb869=>'\x22'+_0x5bb869+'\x22:'+stableStringify(_0xcee97b[_0x5bb869]));return'{'+_0x4c5b16[_0x4ec955(0x153)](',')+'}';}const _0x5e9cba=JSON['stringify'](_0x1a78bc);return _0x5e9cba===undefined?_0x4ec955(0x219):_0x5e9cba;}function a155_0x5fe8(_0x49e16e,_0x9d318b){_0x49e16e=_0x49e16e-0x126;const _0x512ea9=a155_0x512e();let _0x5fe880=_0x512ea9[_0x49e16e];return _0x5fe880;}function activationSignature(_0x4e2434){const _0x2f9ee1=a155_0x285d0a,_0x15db3c={'connection':_0x4e2434[_0x2f9ee1(0x13e)],..._0x4e2434['all_columns']!==undefined&&{'all_columns':_0x4e2434[_0x2f9ee1(0x155)]},..._0x4e2434[_0x2f9ee1(0x180)]!==undefined&&{'columns':_0x4e2434['columns']},..._0x4e2434['behavior']!==undefined&&{'behavior':_0x4e2434['behavior']},..._0x4e2434[_0x2f9ee1(0x21d)]!==undefined&&{'schedule':_0x4e2434['schedule']},..._0x4e2434[_0x2f9ee1(0x1c9)]!==undefined&&{'notification':_0x4e2434['notification']},..._0x4e2434[_0x2f9ee1(0x228)]!==undefined&&{'connector_config':_0x4e2434[_0x2f9ee1(0x228)]},..._0x4e2434[_0x2f9ee1(0x156)]!==undefined&&{'activation_template_id':_0x4e2434[_0x2f9ee1(0x156)]}};return stableStringify(_0x15db3c);}async function fetchSegment(_0x305b08,_0x3f1510,_0xd3adcb,_0x4ed367){const _0x59cf1a=a155_0x285d0a,_0x12b964=_0x4ed367?.[_0x59cf1a(0x176)](_0x657b51=>_0x657b51['id']===_0xd3adcb);if(_0x12b964)return _0x12b964;try{return await _0x305b08[_0x59cf1a(0x1b8)][_0x59cf1a(0x1d0)](_0x3f1510,_0xd3adcb);}catch(_0x1c5381){logger[_0x59cf1a(0x192)]('getSegment\x20failed\x20for\x20'+_0xd3adcb+_0x59cf1a(0x18b)+_0x1c5381);try{return await _0x305b08[_0x59cf1a(0x1b8)][_0x59cf1a(0x188)](_0xd3adcb);}catch(_0x2e2453){return logger['debug'](_0x59cf1a(0x15d)+_0xd3adcb+':\x20'+_0x2e2453),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3ab8b8,_0x513dbe,_0x106b9c){const _0x2ee82a=a155_0x285d0a,_0x157c1d=readPushRecovery(_0x3ab8b8[_0x2ee82a(0x169)]);if(_0x157c1d?.[_0x2ee82a(0x13d)]===_0x3ab8b8[_0x2ee82a(0x12d)][_0x2ee82a(0x208)])for(const [_0x11ef88,_0x260ff5]of Object[_0x2ee82a(0x1bc)](_0x157c1d[_0x2ee82a(0x18a)])){const _0x124701=generateDeterministicJourneySegmentName(_0x3ab8b8[_0x2ee82a(0x12d)]['name'],_0x11ef88);_0x260ff5[_0x2ee82a(0x1e1)]===_0x124701&&(_0x513dbe[_0x2ee82a(0x218)](_0x11ef88,_0x260ff5[_0x2ee82a(0x1e9)]),_0x106b9c[_0x2ee82a(0x218)](_0x11ef88,_0x260ff5[_0x2ee82a(0x1e9)]));}}async function createOrRecoverEmbeddedSegment(_0x1ed772,_0x50ec56,_0x4d8b0b,_0x58da92){const _0x598cd5=a155_0x285d0a;let _0x5a0f1c;try{_0x5a0f1c=await _0x1ed772[_0x598cd5(0x1b8)][_0x598cd5(0x212)]({'name':_0x4d8b0b[_0x598cd5(0x210)],'description':_0x4d8b0b[_0x598cd5(0x1a8)],'journeyId':_0x4d8b0b[_0x598cd5(0x1c7)],'rule':_0x58da92(_0x4d8b0b[_0x598cd5(0x223)],!![]),'countPopulation':!![],'parentFolderId':_0x4d8b0b[_0x598cd5(0x199)],'audienceId':_0x4d8b0b[_0x598cd5(0x216)]});}catch(_0x5a70cb){const _0x1a3565=_0x5a70cb instanceof Error&&_0x5a70cb[_0x598cd5(0x1e0)]['includes'](_0x598cd5(0x130));if(_0x1a3565){const _0x4ecb46=readPushRecovery(_0x50ec56['absolutePath']),_0x2b5ff4=_0x4ecb46?.[_0x598cd5(0x13d)]===_0x50ec56['yamlConfig'][_0x598cd5(0x208)]?_0x4ecb46[_0x598cd5(0x18a)][_0x4d8b0b[_0x598cd5(0x1b9)]]:undefined;if(_0x2b5ff4?.[_0x598cd5(0x1e1)]===_0x4d8b0b['uniqueSegmentName'])await _0x1ed772[_0x598cd5(0x1b8)]['updateSegmentById'](_0x4d8b0b[_0x598cd5(0x216)],_0x2b5ff4['segmentId'],{'description':_0x4d8b0b[_0x598cd5(0x1a8)],'rule':_0x58da92(_0x4d8b0b[_0x598cd5(0x223)],!![]),'countPopulation':!![]}),_0x5a0f1c=_0x2b5ff4['segmentId'];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x598cd5(0x224)+_0x4d8b0b[_0x598cd5(0x1b9)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x598cd5(0x193)+_0x50ec56[_0x598cd5(0x169)][_0x598cd5(0x197)](/([^/]+)$/,_0x598cd5(0x1f4))+')\x20')+_0x598cd5(0x14f),_0x5a70cb);}else throw _0x5a70cb;}return saveSegmentToPushRecovery(_0x50ec56[_0x598cd5(0x169)],_0x50ec56[_0x598cd5(0x12d)][_0x598cd5(0x208)],_0x4d8b0b['localName'],{'segmentId':_0x5a0f1c,'uniqueServerName':_0x4d8b0b['uniqueSegmentName'],'createdAt':new Date()[_0x598cd5(0x217)]()}),_0x5a0f1c;}export async function prepareSegmentFiles(_0x7251e4,_0x4ee893,_0x36930e,_0x1c059e,_0x410205){const _0x388a6d=a155_0x285d0a,{activationDefToCreateRequest:_0x2df816}=await import(_0x388a6d(0x1f2)),_0x3b4d7e=[],_0x3a6a34=new Set();for(const {yamlConfig:_0x5118e4,folderPath:_0x169e47,sourcePath:_0x29cc85}of _0x7251e4){const _0x111b30=resolveTDFolderPath(_0x169e47,_0x1c059e,_0x410205),_0x1a72a3=_0x111b30+':'+_0x5118e4[_0x388a6d(0x208)],_0x4fc182=_0x4ee893[_0x388a6d(0x1ae)][_0x388a6d(0x183)](_0x1a72a3),_0x1e6ce2=_0x4fc182?_0x4ee893[_0x388a6d(0x1e5)][_0x388a6d(0x183)](_0x4fc182['id'])||[]:[];addFoldersToCreate(_0x111b30,_0x4ee893[_0x388a6d(0x143)],_0x3a6a34);const _0x19f6d9=calculateActivationActions(_0x5118e4[_0x388a6d(0x159)]||[],_0x1e6ce2,_0x4ee893[_0x388a6d(0x16a)],_0x4ee893['connectionIdToNameMap']);for(const _0x4d3313 of _0x19f6d9){(_0x4d3313['type']===_0x388a6d(0x1a7)||_0x4d3313['type']===_0x388a6d(0x1a6))&&_0x4d3313[_0x388a6d(0x1c2)]&&(_0x4d3313[_0x388a6d(0x1fd)]=await _0x2df816(_0x4d3313['yamlActivation'],_0x36930e));}const _0xb7257a=calculateSegmentDiff(_0x5118e4,_0x4fc182,_0x1e6ce2,_0x4ee893[_0x388a6d(0x16a)],_0x4ee893['connectionIdToNameMap']);_0x3b4d7e[_0x388a6d(0x189)]({'relativePath':_0x5118e4[_0x388a6d(0x208)],'absolutePath':_0x29cc85,'yamlConfig':_0x5118e4,'folderPath':_0x111b30,'existingSegment':_0x4fc182,'existingActivations':_0x1e6ce2,'isNew':_0xb7257a['isNew'],'hasChanges':_0xb7257a[_0x388a6d(0x1da)],'diff':_0xb7257a[_0x388a6d(0x1d2)],'activationActions':_0x19f6d9});}return{'segmentFiles':_0x3b4d7e,'foldersToCreate':_0x3a6a34};}export async function prepareJourneyFiles(_0x4af5fe,_0x2f59a0,_0x48704a,_0x3ca9b3){const _0x25a80f=a155_0x285d0a,_0x2d62c9=[],_0x163f14=new Set();for(const {yamlConfig:_0x218eb1,folderPath:_0x43c1dd,sourcePath:_0x234913}of _0x4af5fe){const _0x56c7fd=resolveTDFolderPath(_0x43c1dd,_0x48704a,_0x3ca9b3),_0x5004fd=_0x56c7fd+':'+_0x218eb1[_0x25a80f(0x208)],_0x560da4=_0x2f59a0[_0x25a80f(0x164)][_0x25a80f(0x183)](_0x5004fd);let _0x1cd958,_0x4d7722;if(_0x560da4&&_0x560da4[_0x25a80f(0x13c)]>0x0){const _0x1e5650=buildLocalExpandedRuleMappings(_0x218eb1),{createYamlContext:_0x5ab646,prefetchJourneySegments:_0x47545e}=createPushYamlContextForBundle(_0x2f59a0['deps'],_0x2f59a0['parentId'],_0x2f59a0[_0x25a80f(0x1dd)],_0x1e5650,_0x2f59a0[_0x25a80f(0x16a)],_0x2f59a0['connectionIdToNameMap'],_0x2f59a0[_0x25a80f(0x1af)],_0x2f59a0[_0x25a80f(0x12c)]);await _0x47545e(_0x560da4['map'](_0x768a2b=>_0x768a2b['id']));const _0x1cb160=await _0x2f59a0['deps'][_0x25a80f(0x203)][_0x25a80f(0x1cd)](_0x560da4[0x0][_0x25a80f(0x209)]),_0xe829e6=hasMultipleVersions(_0x218eb1),_0x32c2d6=async _0x5b6711=>{const _0x336c75=_0x25a80f,_0x6db995=_0x2f59a0[_0x336c75(0x12c)]?.[_0x336c75(0x183)](_0x5b6711);if(_0x6db995)return _0x6db995;return _0x2f59a0[_0x336c75(0x17f)]({'journeyId':_0x5b6711,'journeyName':_0x218eb1[_0x336c75(0x208)],'isMultiVersion':_0x560da4[_0x336c75(0x13c)]>0x1});};if(_0xe829e6&&_0x560da4['length']>0x1){const _0xa2dde1=[];for(const _0x1860ed of _0x560da4){const _0x32717b=_0x1860ed[_0x25a80f(0x13f)]||0x1;_0x2f59a0[_0x25a80f(0x154)]?.['update'](_0x25a80f(0x126)+_0x218eb1['name']+'\x20v'+_0x32717b);const _0x8c407a=await _0x32c2d6(_0x1860ed['id']),_0x54b4b5=_0x5ab646(_0x1860ed['id']),_0xef09cf=await journeyResponseToDef(_0x8c407a,_0x54b4b5);_0xa2dde1[_0x25a80f(0x189)]({'item':_0x1860ed,'yaml':_0xef09cf});}const _0x4a9d42=buildLocalRuleToNameMappingFromJourney(_0x218eb1);_0x4d7722=buildMergedJourneyDef(_0xa2dde1,_0x4a9d42,_0x1cb160);const _0x29edd5=Math['max'](..._0xa2dde1[_0x25a80f(0x21f)](_0x3e3fa7=>_0x3e3fa7[_0x25a80f(0x137)][_0x25a80f(0x13f)]||0x0)),_0x2586df=_0x560da4[_0x25a80f(0x176)](_0xa5364d=>(_0xa5364d[_0x25a80f(0x13f)]||0x0)===_0x29edd5);_0x2586df&&(_0x2f59a0[_0x25a80f(0x154)]?.['update']('Fetching\x20'+_0x218eb1[_0x25a80f(0x208)]+'\x20v'+_0x29edd5),_0x1cd958=await _0x32c2d6(_0x2586df['id']));}else{const _0x2b5ccc=_0x560da4[_0x560da4[_0x25a80f(0x13c)]-0x1];_0x2f59a0[_0x25a80f(0x154)]?.['update'](_0x25a80f(0x126)+_0x218eb1[_0x25a80f(0x208)]),_0x1cd958=await _0x32c2d6(_0x2b5ccc['id']);const _0x3ef0cb=_0x5ab646(_0x2b5ccc['id']),_0x193665=await journeyResponseToDef(_0x1cd958,_0x3ef0cb),_0x38840b=buildLocalRuleToNameMappingFromJourney(_0x218eb1);_0x4d7722=buildMergedJourneyDef([{'item':_0x2b5ccc,'yaml':_0x193665}],_0x38840b,_0x1cb160);}}addFoldersToCreate(_0x56c7fd,_0x2f59a0[_0x25a80f(0x143)],_0x163f14);const _0x245df0=calculateJourneyDiff(_0x218eb1,_0x4d7722);_0x2d62c9[_0x25a80f(0x189)]({'relativePath':_0x218eb1[_0x25a80f(0x208)],'absolutePath':_0x234913,'yamlConfig':_0x218eb1,'folderPath':_0x56c7fd,'existingJourney':_0x1cd958,'isNew':_0x245df0['isNew'],'hasChanges':_0x245df0[_0x25a80f(0x1da)],'diff':_0x245df0['diff']});}return{'journeyFiles':_0x2d62c9,'foldersToCreate':_0x163f14};}export function calculateActivationActions(_0x14296c,_0x278f49,_0x3aa5ea,_0x2c10c5){const _0x17556d=a155_0x285d0a,_0x8b2348=[],_0x5f0cf6=new Map();for(const _0x6db725 of _0x278f49){_0x5f0cf6[_0x17556d(0x218)](_0x6db725[_0x17556d(0x208)],_0x6db725);}const _0x123be4=new Map();for(const _0x22c835 of _0x14296c){_0x123be4[_0x17556d(0x218)](_0x22c835[_0x17556d(0x208)],_0x22c835);}for(const _0x4adfb8 of _0x14296c){const _0x1e9ece=_0x5f0cf6[_0x17556d(0x183)](_0x4adfb8['name']);if(!_0x1e9ece)_0x8b2348[_0x17556d(0x189)]({'type':'create','name':_0x4adfb8['name'],'yamlActivation':_0x4adfb8});else{const _0x19cbe7=activationResponseToDef(_0x1e9ece,_0x3aa5ea,_0x2c10c5),_0x201037=a155_0x3c593c['stringify'](_0x19cbe7),_0x2e4025=a155_0x3c593c['stringify'](_0x4adfb8);_0x201037!==_0x2e4025&&_0x8b2348[_0x17556d(0x189)]({'type':_0x17556d(0x1a6),'name':_0x4adfb8[_0x17556d(0x208)],'yamlActivation':_0x4adfb8,'existingActivation':_0x1e9ece});}}for(const _0x77e233 of _0x278f49){!_0x123be4[_0x17556d(0x1e3)](_0x77e233['name'])&&_0x8b2348['push']({'type':'delete','name':_0x77e233['name'],'existingActivation':_0x77e233});}return _0x8b2348;}function calculateYamlDiff(_0x2c65a8,_0x5160a1){if(_0x5160a1){const _0x3c396a=generateDiff(_0x5160a1,_0x2c65a8),_0x5a78cb=hasChanges(_0x3c396a);return{'isNew':![],'hasChanges':_0x5a78cb,'diff':_0x5a78cb?formatDiffWithColors(_0x3c396a):undefined};}const _0x5bef00=generateDiff('',_0x2c65a8);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5bef00)};}export function calculateSegmentDiff(_0x1828d8,_0x307d99,_0x7babac,_0x44429e,_0x1c7956){const _0x35dac0=segmentToYamlString(_0x1828d8),_0x3ede36=_0x307d99?segmentToYamlString(segmentWithActivationsToYaml(_0x307d99,_0x7babac,undefined,_0x44429e,_0x1c7956)):undefined;return calculateYamlDiff(_0x35dac0,_0x3ede36);}export function calculateJourneyDiff(_0x18e133,_0x16553e){const _0x1a56ff=normalizeJourneyDef(_0x18e133,_0x18e133),_0x12a584=a155_0x2d82ca(_0x1a56ff),_0x145b8f=_0x16553e?a155_0x2d82ca(normalizeJourneyDef(_0x16553e,_0x18e133)):undefined;return calculateYamlDiff(_0x12a584,_0x145b8f);}export function findSegmentsToDelete(_0x386a91,_0x1983c9,_0x553e27,_0x4644a9,_0x18034b){const _0x181474=a155_0x285d0a,_0x21f5f6=new Set();for(const {yamlConfig:_0x48984f,folderPath:_0x242f1b}of _0x1983c9){_0x21f5f6['add'](_0x242f1b+':'+_0x48984f[_0x181474(0x208)]);}return _0x386a91[_0x181474(0x12e)](_0x4b6a1d=>{const _0x50487c=_0x181474,_0xa69a1d=_0x4b6a1d['segmentFolderId']?_0x553e27[_0x50487c(0x183)](_0x4b6a1d[_0x50487c(0x1ca)][_0x50487c(0x1a4)]())||'':'',_0x24bd9f=_0xa69a1d+':'+_0x4b6a1d['name'];if(_0x21f5f6['has'](_0x24bd9f))return![];if(_0x18034b)return _0xa69a1d===_0x4644a9||_0xa69a1d['startsWith'](_0x4644a9+'/');return!![];});}export function findJourneysToDelete(_0x540f83,_0x28f070,_0x19e766,_0x108786,_0x10506b){const _0xbb2982=a155_0x285d0a,_0x79d2e7=new Set();for(const {yamlConfig:_0x51d0b2,folderPath:_0x1aab21}of _0x28f070){_0x79d2e7[_0xbb2982(0x194)](_0x1aab21+':'+_0x51d0b2[_0xbb2982(0x208)]);}return _0x540f83[_0xbb2982(0x12e)](_0x4ab0d9=>{const _0x4e1a81=_0xbb2982,_0x4a300c=_0x4ab0d9['folderId']?_0x19e766[_0x4e1a81(0x183)](_0x4ab0d9[_0x4e1a81(0x199)])||'':'',_0x170aad=_0x4a300c+':'+_0x4ab0d9['journeyBundleName'];if(_0x79d2e7[_0x4e1a81(0x1e3)](_0x170aad))return![];if(_0x10506b)return _0x4a300c===_0x108786||_0x4a300c['startsWith'](_0x108786+'/');return!![];});}export function buildSegmentLookupMap(_0x53ca19,_0x5cac9b){const _0x38b353=a155_0x285d0a,_0x4ab320=new Map();for(const _0x5a19c0 of _0x53ca19){const _0x1141e4=_0x5a19c0[_0x38b353(0x1ca)]?_0x5cac9b['get'](_0x5a19c0['segmentFolderId']['toString']())||'':'',_0x3b9ac9=_0x1141e4+':'+_0x5a19c0[_0x38b353(0x208)];_0x4ab320['set'](_0x3b9ac9,_0x5a19c0);}return _0x4ab320;}export function buildSegmentNameToIdMap(_0x86e2d0){const _0x301565=a155_0x285d0a,_0xac7fb2=new Map();for(const _0x479d92 of _0x86e2d0){_0xac7fb2[_0x301565(0x218)](_0x479d92[_0x301565(0x208)],_0x479d92['id']);}return _0xac7fb2;}export function buildJourneyBundleLookupMap(_0x367c2c,_0x4f53ec){const _0x179498=a155_0x285d0a,_0x39ad9b=new Map();for(const _0x588022 of _0x367c2c){const _0x353293=_0x588022['folderId']?_0x4f53ec['get'](_0x588022[_0x179498(0x199)])||'':'',_0x3d7619=_0x353293+':'+_0x588022[_0x179498(0x172)];!_0x39ad9b[_0x179498(0x1e3)](_0x3d7619)&&_0x39ad9b[_0x179498(0x218)](_0x3d7619,[]),_0x39ad9b['get'](_0x3d7619)['push'](_0x588022);}for(const _0x3129f0 of _0x39ad9b[_0x179498(0x131)]()){_0x3129f0[_0x179498(0x167)]((_0x5e6684,_0x441438)=>(_0x5e6684['versionNumber']||0x0)-(_0x441438[_0x179498(0x13f)]||0x0));}return _0x39ad9b;}export function collectFoldersToCreate(_0x1bd9ed,_0xa4393c){const _0x5a1dee=a155_0x285d0a,_0x3ef696=new Set();for(const _0xc1a7b1 of _0x1bd9ed){if(!_0xc1a7b1)continue;if(_0xa4393c[_0x5a1dee(0x1e3)](_0xc1a7b1))continue;const _0x486602=_0xc1a7b1[_0x5a1dee(0x1c5)]('/');let _0x35e8d6='';for(const _0x3e9000 of _0x486602){_0x35e8d6=_0x35e8d6?_0x35e8d6+'/'+_0x3e9000:_0x3e9000,!_0xa4393c[_0x5a1dee(0x1e3)](_0x35e8d6)&&_0x3ef696[_0x5a1dee(0x194)](_0x35e8d6);}}return _0x3ef696;}export function parseAndClassifyYamlFiles(_0x23d485,_0x23541c,_0x251f32){const _0x147c31=a155_0x285d0a,_0x257950=[],_0x42cc94=[];for(const _0x4d35bd of _0x23d485){const _0x3cc35b=a155_0x45cde5[_0x147c31(0x20a)](_0x23541c,a155_0x45cde5['dirname'](_0x4d35bd)),_0x1e9581=_0x3cc35b==='.'?'':_0x3cc35b['replace'](/\\/g,'/'),_0x520822=readFileSync(_0x4d35bd,_0x147c31(0x16f)),_0xea9c2b=a155_0x3c593c[_0x147c31(0x17b)](_0x520822);if(isJourneyDef(_0xea9c2b)){const _0x2d1b7d=a155_0x4f65d2(_0x520822);_0x42cc94[_0x147c31(0x189)]({'yamlConfig':_0x2d1b7d,'folderPath':_0x1e9581,'sourcePath':_0x4d35bd});}else{if(!_0x251f32?.['skipSegments']){const _0x571648=parseSegmentYamlFile(_0x520822),_0x1f66d5=normalizeChildSegmentYaml(_0x571648);_0x257950[_0x147c31(0x189)]({'yamlConfig':_0x1f66d5,'folderPath':_0x1e9581,'sourcePath':_0x4d35bd});}}}return{'segments':_0x257950,'journeys':_0x42cc94};}export function validateParsedFiles(_0x4ed951,_0x9f0c6e){const _0x4c0c57=a155_0x285d0a,_0x25a6a9=[];for(const {yamlConfig:_0x15d972,sourcePath:_0x177cfc}of _0x4ed951[_0x4c0c57(0x18a)]){const _0x15184e=readFileSync(_0x177cfc,_0x4c0c57(0x16f)),_0x2c6ca0=a155_0x3c593c['parseDocument'](_0x15184e),_0x33b15f=validateSegmentDef(_0x15d972,{'source':_0x15184e,'document':_0x2c6ca0},{'skipSchema':!![]});if(!_0x33b15f[_0x4c0c57(0x16d)]){const _0x18d9db=a155_0x45cde5['relative'](_0x9f0c6e,_0x177cfc);_0x25a6a9[_0x4c0c57(0x189)]({'filePath':_0x18d9db,'source':_0x15184e,'result':_0x33b15f,'isJourney':![]});}}for(const {yamlConfig:_0x5c1948,sourcePath:_0x4ea84c}of _0x4ed951[_0x4c0c57(0x166)]){const _0x1fcaea=readFileSync(_0x4ea84c,_0x4c0c57(0x16f)),_0x1a4e44=a155_0x3c593c[_0x4c0c57(0x226)](_0x1fcaea),_0x4f5826=validateJourneyDef(_0x5c1948,{'source':_0x1fcaea,'document':_0x1a4e44},{'skipSchema':!![]});if(!_0x4f5826[_0x4c0c57(0x16d)]){const _0x3ef488=a155_0x45cde5['relative'](_0x9f0c6e,_0x4ea84c);_0x25a6a9[_0x4c0c57(0x189)]({'filePath':_0x3ef488,'source':_0x1fcaea,'result':_0x4f5826,'isJourney':!![]});}}return _0x25a6a9;}export function formatValidationErrors(_0x286161){const _0x1b26df=a155_0x285d0a,_0x2a81ec=[];for(const {filePath:_0x2405db,source:_0x343bdb,result:_0x593a3f,isJourney:_0x476546}of _0x286161){const _0x418aa2=_0x476546?_0x1b26df(0x203):_0x1b26df(0x1b8);_0x2a81ec[_0x1b26df(0x189)]('\x0a'+_0x2405db+'\x20('+_0x418aa2+_0x1b26df(0x1f6)+_0x593a3f['errors']['length']+'\x20error(s)'),_0x2a81ec['push'](formatValidationResult(_0x593a3f,_0x343bdb,_0x2405db));}return _0x2a81ec[_0x1b26df(0x153)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2704fd){const _0x421569=a155_0x285d0a,_0xdc2eb0=new Set(),_0x2568bf=new Map(),_0x3f6564=collectSegmentUsageCounts(_0x2704fd);if(_0x2704fd['segments'])for(const [_0xeaf0ea,_0x582d2b]of Object[_0x421569(0x1bc)](_0x2704fd[_0x421569(0x18a)])){_0xdc2eb0[_0x421569(0x194)](_0xeaf0ea);if(_0x582d2b[_0x421569(0x20d)]){const _0x5b311c=yamlRuleToApi(_0x582d2b['rule']),_0x3e8eae=apiRuleToYaml(_0x5b311c);_0x2568bf[_0x421569(0x218)](_0xeaf0ea,_0x3e8eae);}}const _0x2cf996=new Map();let _0x281b18=0x0;for(const [_0x308d0d,_0x2553fe]of _0x2568bf){const _0x419e6b=serializeExpandedRule(_0x2553fe,_0x2568bf),_0x3fb29e=_0x2cf996['get'](_0x419e6b)||[];_0x3fb29e[_0x421569(0x189)]({'name':_0x308d0d,'index':_0x281b18}),_0x2cf996[_0x421569(0x218)](_0x419e6b,_0x3fb29e),_0x281b18++;}const _0x29de76=new Map();for(const [_0x54639a,_0x275306]of _0x2cf996){const _0x539e5f=_0x275306[_0x421569(0x1b5)]()[_0x421569(0x167)]((_0x2d1f21,_0x381181)=>{const _0x55be23=_0x421569,_0x231717=_0x3f6564[_0x55be23(0x183)](_0x2d1f21[_0x55be23(0x208)])||0x0,_0x70e47c=_0x3f6564[_0x55be23(0x183)](_0x381181[_0x55be23(0x208)])||0x0;if(_0x231717!==_0x70e47c)return _0x70e47c-_0x231717;return _0x2d1f21[_0x55be23(0x141)]-_0x381181[_0x55be23(0x141)];})['map'](_0x51a722=>_0x51a722[_0x421569(0x208)]),_0x22868e=[];for(const _0xf8b3db of _0x539e5f){const _0x65429e=_0x3f6564[_0x421569(0x183)](_0xf8b3db)||0x0,_0x90842=Math[_0x421569(0x1ed)](_0x65429e,0x1);for(let _0x2fa81a=0x0;_0x2fa81a<_0x90842;_0x2fa81a++){_0x22868e[_0x421569(0x189)](_0xf8b3db);}}_0x29de76[_0x421569(0x218)](_0x54639a,_0x22868e);}return{'existingLocalSegmentNames':_0xdc2eb0,'localSegmentRules':_0x2568bf,'localExpandedRuleToNames':_0x29de76};}export function createSegmentIdResolver(_0x76b1f1,_0xd6d38e){return async _0x2e256c=>{const _0x48d4b7=a155_0x5fe8,_0x57fb0e=_0x76b1f1[_0x48d4b7(0x183)](_0x2e256c);if(!_0x57fb0e)throw new SDKError(ErrorCode[_0x48d4b7(0x1fb)],'Segment\x20not\x20found:\x20'+_0x2e256c+_0x48d4b7(0x185)+_0xd6d38e+'\x27)');return _0x57fb0e;};}export function extractRootFolderId(_0xa15988){const _0x3d0298=a155_0x285d0a;return _0xa15988[_0x3d0298(0x14a)]?.['parentSegmentFolder']?.['data']?.['id']||_0xa15988[_0x3d0298(0x14a)]?.[_0x3d0298(0x1ac)]?.[_0x3d0298(0x138)]?.['id'];}export function buildConnectionMaps(_0x45c925){const _0x4337ed=a155_0x285d0a,_0x62a769=new Map(),_0x40d30d=new Map(),_0xa76b4a=new Map();for(const _0x211785 of _0x45c925){_0x62a769['set'](_0x211785[_0x4337ed(0x208)],parseInt(_0x211785['id'],0xa)),_0x40d30d['set'](_0x211785['id'],_0x211785[_0x4337ed(0x208)]),_0xa76b4a['set'](_0x211785[_0x4337ed(0x208)],_0x211785[_0x4337ed(0x140)]);}return{'nameToId':_0x62a769,'idToName':_0x40d30d,'nameToType':_0xa76b4a};}export function calculatePushStats(_0x388409,_0x6b08ad,_0x1f5981,_0x6ca4c2,_0x16ea11,_0x6d28ba,_0x346ae7){const _0x5ea7ff=a155_0x285d0a,_0x3620b3=_0x388409[_0x5ea7ff(0x12e)](_0x5596d9=>_0x5596d9[_0x5ea7ff(0x1f1)]),_0x2bad75=_0x388409[_0x5ea7ff(0x12e)](_0x34a446=>!_0x34a446[_0x5ea7ff(0x1f1)]&&_0x34a446[_0x5ea7ff(0x1da)]),_0x4d5fef=_0x388409[_0x5ea7ff(0x12e)](_0x43a7e5=>!_0x43a7e5['isNew']&&!_0x43a7e5[_0x5ea7ff(0x1da)]),_0x3c8bf5=_0x6d28ba?_0x6ca4c2:[],_0x37ba8d=_0x6b08ad[_0x5ea7ff(0x12e)](_0x4c65f3=>_0x4c65f3[_0x5ea7ff(0x1f1)]),_0x1239de=_0x6b08ad[_0x5ea7ff(0x12e)](_0x388437=>!_0x388437[_0x5ea7ff(0x1f1)]&&_0x388437[_0x5ea7ff(0x1da)]),_0x538115=_0x6b08ad[_0x5ea7ff(0x12e)](_0x4cb49b=>!_0x4cb49b['isNew']&&!_0x4cb49b['hasChanges']),_0x5df96b=_0x6d28ba?_0x16ea11:[],_0x5cf5bf=_0x388409[_0x5ea7ff(0x21a)](_0x4d743b=>_0x4d743b['activationActions']),_0x30e097=_0x5cf5bf[_0x5ea7ff(0x12e)](_0x2a9b5e=>_0x2a9b5e['type']===_0x5ea7ff(0x1a7)),_0x2f072e=_0x5cf5bf[_0x5ea7ff(0x12e)](_0x38a7da=>_0x38a7da[_0x5ea7ff(0x140)]==='update'),_0xb5385=_0x5cf5bf[_0x5ea7ff(0x12e)](_0x4527e9=>_0x4527e9[_0x5ea7ff(0x140)]==='delete'),_0x5e8ecd=Array[_0x5ea7ff(0x184)](_0x1f5981)[_0x5ea7ff(0x167)](),_0x2c6b6e=_0x346ae7?![]:_0x3620b3['length']>0x0||_0x2bad75[_0x5ea7ff(0x13c)]>0x0||_0x3c8bf5[_0x5ea7ff(0x13c)]>0x0,_0x4c05d7=_0x37ba8d[_0x5ea7ff(0x13c)]>0x0||_0x1239de[_0x5ea7ff(0x13c)]>0x0||_0x5df96b[_0x5ea7ff(0x13c)]>0x0,_0x5a6af2=_0x346ae7?![]:_0x5cf5bf[_0x5ea7ff(0x13c)]>0x0,_0x27f56c=_0x5e8ecd[_0x5ea7ff(0x13c)]>0x0;return{'segments':{'new':_0x3620b3,'changed':_0x2bad75,'unchanged':_0x4d5fef,'toDelete':_0x3c8bf5},'journeys':{'new':_0x37ba8d,'changed':_0x1239de,'unchanged':_0x538115,'toDelete':_0x5df96b},'activations':{'all':_0x5cf5bf,'toCreate':_0x30e097,'toUpdate':_0x2f072e,'toDelete':_0xb5385},'folders':{'toCreate':_0x5e8ecd},'counts':{'segments':{'new':_0x3620b3[_0x5ea7ff(0x13c)],'changed':_0x2bad75[_0x5ea7ff(0x13c)],'unchanged':_0x4d5fef['length'],'toDelete':_0x3c8bf5[_0x5ea7ff(0x13c)]},'journeys':{'new':_0x37ba8d['length'],'changed':_0x1239de[_0x5ea7ff(0x13c)],'unchanged':_0x538115['length'],'toDelete':_0x5df96b[_0x5ea7ff(0x13c)]},'activations':{'create':_0x30e097[_0x5ea7ff(0x13c)],'update':_0x2f072e[_0x5ea7ff(0x13c)],'delete':_0xb5385[_0x5ea7ff(0x13c)]},'folders':_0x5e8ecd['length']},'hasChanges':_0x2c6b6e||_0x4c05d7||_0x5a6af2||_0x27f56c};}export async function buildPushExecutionContext(_0x3967a4,_0x3e8d3d,_0x2d7579,_0xb3d34c,_0x307bf3,_0x3d685d){const _0x43bc90=a155_0x285d0a,_0x4c96ee=extractRootFolderId(_0x2d7579),{pathToId:_0x26786a,idToPath:_0xa79817}=buildFolderMaps(_0x307bf3),_0x50c9a1=buildSegmentNameToIdMap(_0xb3d34c),_0x5d8caf=new Map(),{batchAsync:_0x540ac7}=await import('../../utils/async.js'),[_0x1f942b,_0x8f4c13]=await Promise[_0x43bc90(0x1df)]([_0x3967a4[_0x43bc90(0x227)][_0x43bc90(0x1be)](),_0x3967a4[_0x43bc90(0x13e)]['list'](),((async()=>{const _0x383396=_0x43bc90;!_0x3d685d&&_0xb3d34c[_0x383396(0x13c)]>0x0&&await _0x540ac7(_0xb3d34c,async _0x4e114a=>{const _0x4e3d73=_0x383396,_0x5b1ddc=await _0x3967a4[_0x4e3d73(0x1b8)][_0x4e3d73(0x17c)](_0x3e8d3d,_0x4e114a['id']);_0x5d8caf['set'](_0x4e114a['id'],_0x5b1ddc);});})())]),{emailToId:_0x7cd4a9,idToEmail:_0x2338ce}=_0x1f942b,_0x4fe79f=buildConnectionMaps(_0x8f4c13);return{'rootFolderId':_0x4c96ee,'folderPathToId':_0x26786a,'folderIdToPath':_0xa79817,'segmentNameToId':_0x50c9a1,'activationsBySegmentId':_0x5d8caf,'emailToIdMap':_0x7cd4a9,'idToEmailMap':_0x2338ce,'connectionNameToIdMap':_0x4fe79f[_0x43bc90(0x16c)],'connectionIdToNameMap':_0x4fe79f[_0x43bc90(0x178)],'connectionNameToTypeMap':_0x4fe79f[_0x43bc90(0x211)]};}export function createPushYamlContextForBundle(_0x446b1b,_0x4b0802,_0x3c89e3,_0x311820,_0x59876d,_0x30057d,_0x21d2d2,_0x2bc34d){const {existingLocalSegmentNames:_0x5bd048,localExpandedRuleToNames:_0x46cd7b}=_0x311820,_0x596776=new Set(),_0x3623d6=new Map(),_0x5717c5=new Map(),_0x263883=new Map(),_0x5cc1ec=createJumpTargetCache(),_0x15076a=new Map(),_0x9a8bc6=new Map(),_0x5c56bf=new Set();let _0x572768;const _0xdfd418=_0x4bf6ae=>{const _0x225452={'resolveSegment':async _0x387efe=>{const _0x225444=a155_0x5fe8,_0x569b8f=_0x263883[_0x225444(0x183)](_0x387efe);if(_0x569b8f!==undefined)return{'name':_0x569b8f,'isJourneyLocal':!![]};try{const _0x41f1af=await fetchSegment(_0x446b1b,_0x4b0802,_0x387efe,_0x3c89e3);if(!_0x41f1af)throw new Error(_0x225444(0x1f5));const _0x3bd5a0=generateJourneyLocalName(_0x41f1af[_0x225444(0x208)]),_0x565905=_0x41f1af[_0x225444(0x1f3)]===SEGMENT_KIND_JOURNEY&&_0x3bd5a0!==undefined;let _0x4bf4d3=_0x41f1af['name'],_0x12e09c;if(_0x565905&&_0x41f1af[_0x225444(0x20d)]){const _0x143306=apiRuleToYaml(_0x41f1af['rule']);_0x9a8bc6['set'](_0x387efe,_0x143306);const _0x2d52d5=async _0x13c120=>{const _0x58aa8c=_0x225444,_0x3ca384=collectSegmentRefsFromRule(_0x13c120);for(const _0x4d2e4c of _0x3ca384){if(!_0x9a8bc6[_0x58aa8c(0x1e3)](_0x4d2e4c))try{const _0x3e4030=await fetchSegment(_0x446b1b,_0x4b0802,_0x4d2e4c,_0x3c89e3);if(_0x3e4030?.[_0x58aa8c(0x20d)]){const _0x3da8ee=apiRuleToYaml(_0x3e4030['rule']);_0x9a8bc6[_0x58aa8c(0x218)](_0x4d2e4c,_0x3da8ee),await _0x2d52d5(_0x3da8ee);}}catch(_0x8493dd){logger[_0x58aa8c(0x192)](_0x58aa8c(0x17a)+_0x4d2e4c+':\x20'+_0x8493dd);}}};await _0x2d52d5(_0x143306);const _0x3bcc9a=serializeExpandedRule(_0x143306,_0x9a8bc6),_0x42ae2d=_0x46cd7b[_0x225444(0x183)](_0x3bcc9a);if(_0x42ae2d&&_0x42ae2d[_0x225444(0x13c)]>0x0){const _0x48b779=_0x3623d6[_0x225444(0x183)](_0x3bcc9a)||0x0,_0x1d4aff=_0x42ae2d[_0x48b779]||_0x42ae2d[_0x42ae2d['length']-0x1];_0x3623d6[_0x225444(0x218)](_0x3bcc9a,_0x48b779+0x1),_0x4bf4d3=_0x1d4aff,_0x596776[_0x225444(0x194)](_0x4bf4d3),_0x263883[_0x225444(0x218)](_0x387efe,_0x4bf4d3);const _0x23ed1a=await resolveRuleSegmentRefs(_0x143306,async _0x40bb42=>{const _0x4e44c8=_0x225444,_0x2e417e=_0x263883[_0x4e44c8(0x183)](_0x40bb42);if(_0x2e417e)return _0x2e417e;const _0x18767a=await _0x572768[_0x4e44c8(0x1ab)](_0x40bb42);return _0x18767a['name'];});_0x12e09c={'description':_0x41f1af[_0x225444(0x1a8)],'rule':_0x23ed1a};}else{const _0x1ed366=_0x15076a[_0x225444(0x183)](_0x3bcc9a);if(_0x1ed366)_0x4bf4d3=_0x1ed366,_0x263883[_0x225444(0x218)](_0x387efe,_0x4bf4d3);else{if(_0x3bd5a0){let _0x4fd9af=_0x3bd5a0,_0x279c2f=0x2;while(_0x596776[_0x225444(0x1e3)](_0x4fd9af)||_0x5bd048[_0x225444(0x1e3)](_0x4fd9af)){_0x4fd9af=_0x3bd5a0+'_'+_0x279c2f,_0x279c2f++;}_0x596776[_0x225444(0x194)](_0x4fd9af),_0x4bf4d3=_0x4fd9af;}_0x263883[_0x225444(0x218)](_0x387efe,_0x4bf4d3),_0x15076a[_0x225444(0x218)](_0x3bcc9a,_0x4bf4d3);const _0x1f4384=await resolveRuleSegmentRefs(_0x143306,async _0xd07b3b=>{const _0x18766e=_0x225444,_0x4a18af=_0x263883[_0x18766e(0x183)](_0xd07b3b);if(_0x4a18af)return _0x4a18af;const _0x3e9005=await _0x572768[_0x18766e(0x1ab)](_0xd07b3b);return _0x3e9005[_0x18766e(0x208)];});_0x12e09c={'description':_0x41f1af[_0x225444(0x1a8)],'rule':_0x1f4384};}}}return{'name':_0x4bf4d3,'isJourneyLocal':_0x565905,'definition':_0x12e09c};}catch(_0x349de6){return logger[_0x225444(0x192)](_0x225444(0x21b)+_0x387efe+':\x20'+_0x349de6),{'name':_0x387efe,'isJourneyLocal':![]};}},'resolveActivation':async _0x3a56cb=>{const _0x3b36e6=a155_0x5fe8,_0x24ad39=_0x5717c5['get'](_0x3a56cb);if(_0x24ad39!==undefined)return{'name':_0x24ad39,'isJourneyLocal':!![]};try{let _0x62ccc0=_0x21d2d2?.[_0x3b36e6(0x183)](_0x3a56cb);!_0x62ccc0&&(_0x62ccc0=await _0x446b1b[_0x3b36e6(0x203)][_0x3b36e6(0x160)](_0x4bf6ae,_0x3a56cb));const _0x50a5c5=_0x62ccc0[_0x3b36e6(0x213)][_0x3b36e6(0x191)][_0x3b36e6(0x208)]||_0x3a56cb,_0x284a42=sanitizeYamlKey(_0x50a5c5)||_0x3b36e6(0x1eb)+_0x3a56cb,_0x178b74=_0x284a42;_0x5717c5[_0x3b36e6(0x218)](_0x3a56cb,_0x178b74);const _0x46b255=journeyActivationStepToYaml(_0x62ccc0,_0x59876d,_0x30057d);return{'name':_0x178b74,'isJourneyLocal':!![],'definition':_0x46b255};}catch(_0xa11ddd){return logger[_0x3b36e6(0x192)](_0x3b36e6(0x144)+_0x3a56cb+':\x20'+_0xa11ddd),{'name':_0x3a56cb,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x534080,_0x4df3cc)=>resolveJumpTarget(_0x534080,_0x4df3cc,_0x5cc1ec,async _0x1747b4=>{const _0x414e7e=a155_0x5fe8,_0x3f8949=_0x2bc34d?.[_0x414e7e(0x183)](_0x1747b4);if(_0x3f8949)return _0x3f8949;return _0x446b1b['journey'][_0x414e7e(0x207)](_0x1747b4);})};return _0x572768=_0x225452,_0x225452;},_0x58fe83=async _0x36da95=>{const _0x276ff1=a155_0x5fe8,{collectSegmentIdsFromJourneyApi:_0x34fc73}=await import('./journey-yaml.js'),{batchAsync:_0x1a3407}=await import('../../utils/async.js'),_0x551411=new Set();for(const _0x4dcfaf of _0x36da95){let _0x5163ac=_0x2bc34d?.[_0x276ff1(0x183)](_0x4dcfaf);!_0x5163ac&&(_0x5163ac=await _0x446b1b['journey'][_0x276ff1(0x207)](_0x4dcfaf));const _0x4d4931=_0x34fc73(_0x5163ac);for(const _0x3ac158 of _0x4d4931){_0x551411[_0x276ff1(0x194)](_0x3ac158);}}let _0x51ea1b=Array[_0x276ff1(0x184)](_0x551411);while(_0x51ea1b[_0x276ff1(0x13c)]>0x0){const _0x30869e=_0x51ea1b['filter'](_0x300789=>!_0x5c56bf[_0x276ff1(0x1e3)](_0x300789));if(_0x30869e['length']===0x0)break;const _0x5d1956=await _0x1a3407(_0x30869e,async _0x52ef88=>{const _0x38d44b=_0x276ff1;_0x5c56bf[_0x38d44b(0x194)](_0x52ef88);const _0x40c5f2=await fetchSegment(_0x446b1b,_0x4b0802,_0x52ef88,_0x3c89e3);if(!_0x40c5f2)return null;return{'segmentId':_0x52ef88,'segment':_0x40c5f2};},0xa),_0x39b47f=new Set();for(const _0x4961ea of _0x5d1956){if(!_0x4961ea?.[_0x276ff1(0x1b8)]?.[_0x276ff1(0x20d)])continue;const _0x279112=apiRuleToYaml(_0x4961ea[_0x276ff1(0x1b8)]['rule']);_0x9a8bc6[_0x276ff1(0x218)](_0x4961ea[_0x276ff1(0x1e9)],_0x279112);const _0x472aa2=collectSegmentRefsFromRule(_0x279112);for(const _0x131eea of _0x472aa2){!_0x5c56bf[_0x276ff1(0x1e3)](_0x131eea)&&_0x39b47f[_0x276ff1(0x194)](_0x131eea);}}_0x51ea1b=Array[_0x276ff1(0x184)](_0x39b47f);}};return{'createYamlContext':_0xdfd418,'prefetchJourneySegments':_0x58fe83};}export async function executePushSegments(_0xaaf3ec,_0x264750,_0x550b9b,_0x481c90,_0x597c99){const _0x2e1096=a155_0x285d0a,{segmentDefToCreateRequest:_0x57be37,segmentDefToUpdateRequest:_0x356d43}=await import(_0x2e1096(0x1f2)),_0x5f3c5a=_0x550b9b['folderPathToId'],_0x30fd43=0x5,_0x4011f8=async _0x233c11=>{const _0x3f343e=_0x2e1096,_0x3b8335=_0x233c11[_0x3f343e(0x132)]?_0x5f3c5a['get'](_0x233c11[_0x3f343e(0x132)]):undefined;let _0x3a04e6;const _0x39a96b={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x29e46e=_0x233c11[_0x3f343e(0x12d)];if(_0x233c11[_0x3f343e(0x12d)][_0x3f343e(0x20d)]){const _0x5840b9=createSegmentIdResolver(_0x550b9b[_0x3f343e(0x1c1)],_0x233c11[_0x3f343e(0x12d)]['name']),_0x3ecfdd=await resolveRuleSegmentIds(_0x233c11['yamlConfig'][_0x3f343e(0x20d)],_0x5840b9);_0x29e46e={..._0x233c11[_0x3f343e(0x12d)],'rule':_0x3ecfdd};}try{if(_0x233c11[_0x3f343e(0x1f1)]){_0x597c99[_0x3f343e(0x181)]?.({'type':_0x3f343e(0x15e),'name':_0x233c11[_0x3f343e(0x12d)][_0x3f343e(0x208)]});const _0x4c77bb=_0x57be37(_0x29e46e,_0x3b8335),_0x15ba0e=await _0x597c99['withProgress'](_0x3f343e(0x1b1)+_0x233c11['yamlConfig']['name']+_0x3f343e(0x1a3),()=>_0xaaf3ec[_0x3f343e(0x1b8)][_0x3f343e(0x1dc)](_0x481c90['parentId'],_0x4c77bb));_0x3a04e6=_0x15ba0e[_0x3f343e(0x138)]['id'],_0x550b9b[_0x3f343e(0x1c1)][_0x3f343e(0x218)](_0x233c11[_0x3f343e(0x12d)]['name'],_0x3a04e6),_0x39a96b[_0x3f343e(0x1ba)]={'name':_0x233c11[_0x3f343e(0x12d)]['name'],'id':_0x3a04e6},_0x597c99[_0x3f343e(0x181)]?.({'type':_0x3f343e(0x1aa),'name':_0x233c11['yamlConfig'][_0x3f343e(0x208)],'segmentId':_0x3a04e6}),_0x597c99[_0x3f343e(0x201)]?.(_0x3f343e(0x179)+_0x233c11['yamlConfig']['name']+'\x27'),_0x39a96b[_0x3f343e(0x14c)]=0x1;}else{if(_0x233c11[_0x3f343e(0x1da)]){_0x597c99[_0x3f343e(0x181)]?.({'type':_0x3f343e(0x168),'name':_0x233c11[_0x3f343e(0x12d)][_0x3f343e(0x208)]});const _0x2e1e77=_0x356d43(_0x29e46e);_0x3b8335!==_0x233c11['existingSegment']?.[_0x3f343e(0x1ca)]&&(_0x2e1e77[_0x3f343e(0x1ca)]=_0x3b8335?parseInt(_0x3b8335,0xa):undefined),await _0x597c99[_0x3f343e(0x18d)](_0x3f343e(0x195)+_0x233c11['yamlConfig'][_0x3f343e(0x208)]+_0x3f343e(0x1a3),()=>_0xaaf3ec[_0x3f343e(0x1b8)][_0x3f343e(0x1ef)](_0x481c90['parentId'],_0x233c11[_0x3f343e(0x1e6)]['id'],_0x2e1e77)),_0x3a04e6=_0x233c11[_0x3f343e(0x1e6)]['id'],_0x597c99[_0x3f343e(0x181)]?.({'type':_0x3f343e(0x1ec),'name':_0x233c11[_0x3f343e(0x12d)][_0x3f343e(0x208)]}),_0x597c99[_0x3f343e(0x201)]?.(_0x3f343e(0x225)+_0x233c11[_0x3f343e(0x12d)][_0x3f343e(0x208)]+'\x27'),_0x39a96b['updated']=0x1;}else _0x3a04e6=_0x233c11[_0x3f343e(0x1e6)]['id'];}}catch(_0x291877){const _0x2d665b=isHttp400Error(_0x291877),_0x33f50b=_0x2d665b?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x492f85=getErrorMessage(_0x291877);throw new SDKError(_0x33f50b,_0x3f343e(0x1d4)+(_0x233c11[_0x3f343e(0x1f1)]?_0x3f343e(0x1a7):_0x3f343e(0x1a6))+'\x20segment\x20from\x20file:\x20'+_0x233c11[_0x3f343e(0x169)]+_0x3f343e(0x150)+_0x492f85,_0x291877);}try{const _0x5cf1a0=await syncActivationsForSegment(_0xaaf3ec,_0x481c90[_0x3f343e(0x216)],_0x3a04e6,_0x233c11[_0x3f343e(0x12d)][_0x3f343e(0x208)],_0x233c11['activationActions'],_0x597c99,_0x233c11['absolutePath']);_0x39a96b['activations']=_0x5cf1a0;}catch(_0x43f75a){if(_0x43f75a instanceof SDKError)throw _0x43f75a;throw new SDKError(ErrorCode[_0x3f343e(0x1fe)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x233c11[_0x3f343e(0x12d)]['name']+_0x3f343e(0x145)+_0x233c11[_0x3f343e(0x169)]+_0x3f343e(0x150)+getErrorMessage(_0x43f75a),_0x43f75a);}return _0x39a96b;},_0x3ac0ad=await batchAsync(_0x264750,_0x4011f8,_0x30fd43),_0x2f8295={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x37612f of _0x3ac0ad){_0x2f8295['created']+=_0x37612f[_0x2e1096(0x14c)],_0x2f8295['updated']+=_0x37612f[_0x2e1096(0x152)],_0x37612f[_0x2e1096(0x1ba)]&&_0x2f8295[_0x2e1096(0x173)][_0x2e1096(0x218)](_0x37612f[_0x2e1096(0x1ba)][_0x2e1096(0x208)],_0x37612f[_0x2e1096(0x1ba)]['id']),_0x2f8295[_0x2e1096(0x159)][_0x2e1096(0x14c)]+=_0x37612f[_0x2e1096(0x159)][_0x2e1096(0x14c)],_0x2f8295[_0x2e1096(0x159)]['updated']+=_0x37612f['activations']['updated'],_0x2f8295[_0x2e1096(0x159)]['deleted']+=_0x37612f['activations'][_0x2e1096(0x20b)];}return _0x2f8295;}async function syncActivationsForSegment(_0x2ded78,_0x42d5c9,_0x35766a,_0x26d4e8,_0x2f99cf,_0x1d2699,_0x2667c3){const _0x5d46f4=a155_0x285d0a,_0x165881={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x38fca7 of _0x2f99cf){try{if(_0x38fca7['type']===_0x5d46f4(0x1a7)&&_0x38fca7[_0x5d46f4(0x1fd)])_0x1d2699['onProgress']?.({'type':'activation_creating','segmentName':_0x26d4e8,'activationName':_0x38fca7[_0x5d46f4(0x208)]}),await _0x1d2699['withProgress'](_0x5d46f4(0x15b)+_0x38fca7['name']+_0x5d46f4(0x1a3),()=>_0x2ded78[_0x5d46f4(0x1b8)]['createActivation'](_0x42d5c9,_0x35766a,_0x38fca7[_0x5d46f4(0x1fd)])),_0x1d2699['onProgress']?.({'type':_0x5d46f4(0x14d),'segmentName':_0x26d4e8,'activationName':_0x38fca7[_0x5d46f4(0x208)]}),_0x1d2699[_0x5d46f4(0x201)]?.(_0x5d46f4(0x1c0)+_0x38fca7[_0x5d46f4(0x208)]+'\x27'),_0x165881[_0x5d46f4(0x14c)]++;else{if(_0x38fca7[_0x5d46f4(0x140)]===_0x5d46f4(0x1a6)&&_0x38fca7['validatedRequest']&&_0x38fca7['existingActivation'])_0x1d2699[_0x5d46f4(0x181)]?.({'type':'activation_updating','segmentName':_0x26d4e8,'activationName':_0x38fca7[_0x5d46f4(0x208)]}),await _0x1d2699[_0x5d46f4(0x18d)](_0x5d46f4(0x1c4)+_0x38fca7[_0x5d46f4(0x208)]+'\x27...',()=>_0x2ded78[_0x5d46f4(0x1b8)][_0x5d46f4(0x1d6)](_0x42d5c9,_0x35766a,_0x38fca7[_0x5d46f4(0x1a1)]['id'],_0x38fca7[_0x5d46f4(0x1fd)])),_0x1d2699['onProgress']?.({'type':_0x5d46f4(0x215),'segmentName':_0x26d4e8,'activationName':_0x38fca7['name']}),_0x1d2699[_0x5d46f4(0x201)]?.('Updated\x20activation\x20\x27'+_0x38fca7['name']+'\x27'),_0x165881[_0x5d46f4(0x152)]++;else _0x38fca7[_0x5d46f4(0x140)]===_0x5d46f4(0x1e2)&&_0x38fca7['existingActivation']&&(_0x1d2699[_0x5d46f4(0x181)]?.({'type':_0x5d46f4(0x1f0),'segmentName':_0x26d4e8,'activationName':_0x38fca7[_0x5d46f4(0x208)]}),await _0x1d2699[_0x5d46f4(0x18d)](_0x5d46f4(0x17d)+_0x38fca7[_0x5d46f4(0x208)]+_0x5d46f4(0x1a3),()=>_0x2ded78['segment']['deleteActivation'](_0x42d5c9,_0x35766a,_0x38fca7[_0x5d46f4(0x1a1)]['id'])),_0x1d2699[_0x5d46f4(0x181)]?.({'type':'activation_deleted','segmentName':_0x26d4e8,'activationName':_0x38fca7['name']}),_0x1d2699[_0x5d46f4(0x1b7)]?.('Deleted\x20activation\x20\x27'+_0x38fca7['name']+'\x27'),_0x165881[_0x5d46f4(0x20b)]++);}}catch(_0x4a52d5){const _0x3bf543=isHttp400Error(_0x4a52d5),_0x26490c=_0x3bf543?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x5d46f4(0x1fe)],_0x2dc546=getErrorMessage(_0x4a52d5);throw new SDKError(_0x26490c,_0x5d46f4(0x1d4)+_0x38fca7[_0x5d46f4(0x140)]+_0x5d46f4(0x1bb)+_0x38fca7[_0x5d46f4(0x208)]+'\x27\x20from\x20file:\x20'+_0x2667c3+_0x5d46f4(0x150)+_0x2dc546,_0x4a52d5);}}return _0x165881;}export async function executePushFolders(_0x111432,_0x30e923,_0x1fea96,_0x10d90e,_0x3befb3){const _0x161930=a155_0x285d0a,_0x41c2a9=new Map(_0x1fea96),_0x160f81=sortFoldersByDepth(_0x30e923);for(const _0x4d3354 of _0x160f81){const _0x46fb1f=_0x4d3354['split']('/'),_0x5ece1e=_0x46fb1f[_0x46fb1f[_0x161930(0x13c)]-0x1],_0x7027b3=_0x46fb1f['slice'](0x0,-0x1)[_0x161930(0x153)]('/'),_0x4b2b97=_0x41c2a9['get'](_0x7027b3);_0x3befb3[_0x161930(0x181)]?.({'type':_0x161930(0x17e),'folder':_0x4d3354});const _0x130304={'name':_0x5ece1e,'parentFolderId':_0x4b2b97},_0x2ca557=await _0x3befb3[_0x161930(0x18d)](_0x161930(0x13a)+_0x4d3354+_0x161930(0x1a3),()=>_0x111432[_0x161930(0x1b8)][_0x161930(0x229)](_0x10d90e['parentId'],_0x130304));_0x41c2a9[_0x161930(0x218)](_0x4d3354,_0x2ca557['data']['id']),_0x3befb3['onProgress']?.({'type':'folder_created','folder':_0x4d3354,'folderId':_0x2ca557[_0x161930(0x138)]['id']}),_0x3befb3[_0x161930(0x171)]?.(_0x161930(0x20e)+_0x4d3354+'\x27');}return _0x41c2a9;}export async function executePushSegmentDeletions(_0x9bf528,_0x5c8d2d,_0x590e42){const _0x33b115=a155_0x285d0a;if(_0x5c8d2d[_0x33b115(0x13c)]===0x0)return 0x0;const {batchAsync:_0x5abd5e}=await import(_0x33b115(0x170)),_0x239b7d=0x5,_0xa3abe6=await _0x5abd5e(_0x5c8d2d,async _0x59e41b=>{const _0x335820=_0x33b115;return _0x590e42[_0x335820(0x181)]?.({'type':'segment_deleting','name':_0x59e41b[_0x335820(0x208)]}),await _0x9bf528[_0x335820(0x1b8)][_0x335820(0x148)](_0x59e41b['id']),_0x590e42[_0x335820(0x181)]?.({'type':_0x335820(0x16b),'name':_0x59e41b[_0x335820(0x208)]}),_0x590e42[_0x335820(0x1b7)]?.(_0x335820(0x1e7)+_0x59e41b[_0x335820(0x208)]+'\x27'),0x1;},_0x239b7d);return _0xa3abe6[_0x33b115(0x1a2)]((_0x391d57,_0xdc708f)=>_0x391d57+_0xdc708f,0x0);}export async function executePushJourneys(_0x3f09ba,_0x3f3266,_0x2f4621,_0x5dd9ac,_0x487922){const _0x27ea0d=a155_0x285d0a,{journeyDefToRequest:_0x1c9925}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x384ce6,yamlRuleToApi:_0x424bf9,validateSegmentRule:_0x557f1c}=await import(_0x27ea0d(0x1f2)),_0x453dc1={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1b9a5e=new Map(_0x2f4621[_0x27ea0d(0x1c1)]),_0x8585e=0x5;for(let _0x1a0c90=0x0;_0x1a0c90<_0x3f3266[_0x27ea0d(0x13c)];_0x1a0c90+=_0x8585e){const _0x4caa1b=_0x3f3266['slice'](_0x1a0c90,_0x1a0c90+_0x8585e),_0x15b882=await Promise[_0x27ea0d(0x1df)](_0x4caa1b[_0x27ea0d(0x21f)](async _0x2b3728=>{const _0x517443=_0x27ea0d;if(!_0x2b3728[_0x517443(0x1f1)]&&!_0x2b3728[_0x517443(0x1da)])return{'action':_0x517443(0x200),'name':_0x2b3728[_0x517443(0x12d)][_0x517443(0x208)],'journeyId':_0x2b3728['existingJourney']?.['id']};const _0x239bea=_0x2b3728[_0x517443(0x132)]?_0x2f4621[_0x517443(0x143)]['get'](_0x2b3728[_0x517443(0x132)]):undefined;_0x487922['onProgress']?.({'type':_0x2b3728[_0x517443(0x1f1)]?'journey_creating':_0x517443(0x19d),'name':_0x2b3728[_0x517443(0x12d)]['name']});try{const _0x160273=await executeSingleJourneyPush(_0x3f09ba,_0x2b3728,{..._0x2f4621,'segmentNameToId':_0x1b9a5e},{'parentId':_0x5dd9ac[_0x517443(0x216)],'rootFolderId':_0x5dd9ac[_0x517443(0x1c3)],'folderId':_0x239bea,'verbose':_0x5dd9ac[_0x517443(0x1d1)]},_0x487922,{'journeyDefToRequest':_0x1c9925,'activationDefToCreateRequest':_0x384ce6,'yamlRuleToApi':_0x424bf9,'validateSegmentRule':_0x557f1c});for(const [_0xa5d9c5,_0x5f1e0d]of _0x160273[_0x517443(0x14e)]){_0x1b9a5e['set'](_0xa5d9c5,_0x5f1e0d),_0x453dc1[_0x517443(0x14e)][_0x517443(0x218)](_0xa5d9c5,_0x5f1e0d);}if(_0x160273[_0x517443(0x222)]==='created')_0x487922['onProgress']?.({'type':_0x517443(0x1f8),'name':_0x2b3728['yamlConfig']['name'],'journeyId':_0x160273[_0x517443(0x1c7)]}),_0x487922['logSuccess']?.(_0x517443(0x16e)+_0x2b3728[_0x517443(0x12d)][_0x517443(0x208)]+'\x27'),_0x453dc1[_0x517443(0x14c)]++;else _0x160273[_0x517443(0x222)]===_0x517443(0x152)&&(_0x487922['onProgress']?.({'type':_0x517443(0x182),'name':_0x2b3728[_0x517443(0x12d)][_0x517443(0x208)]}),_0x487922[_0x517443(0x201)]?.(_0x517443(0x1cf)+_0x2b3728['yamlConfig']['name']+'\x27'),_0x453dc1[_0x517443(0x152)]++);return{'action':_0x160273[_0x517443(0x222)],'name':_0x2b3728['yamlConfig']['name'],'journeyId':_0x160273[_0x517443(0x1c7)]};}catch(_0x4f8ebc){const _0x4bf425=isHttp400Error(_0x4f8ebc),_0x1d00a3=_0x4bf425?ErrorCode[_0x517443(0x12f)]:ErrorCode[_0x517443(0x19a)],_0x39b2db=getErrorMessage(_0x4f8ebc);throw new SDKError(_0x1d00a3,'Failed\x20to\x20'+(_0x2b3728[_0x517443(0x1f1)]?_0x517443(0x1a7):_0x517443(0x1a6))+'\x20journey\x20from\x20file:\x20'+_0x2b3728[_0x517443(0x169)]+_0x517443(0x150)+_0x39b2db,_0x4f8ebc);}}));_0x453dc1[_0x27ea0d(0x190)][_0x27ea0d(0x189)](..._0x15b882);}return _0x453dc1;}async function matchExistingJourneySegments(_0xc9dbc7,_0x2605bd,_0xfddc80,_0x557c08,_0x39e32e){const _0x3a4ec1=a155_0x285d0a;if(!_0x2605bd[_0x3a4ec1(0x14b)]||!_0x2605bd[_0x3a4ec1(0x12d)]['segments'])return;const _0x4a7129=new Map(),_0x10e2c7=new Set();for(const _0x515ecc of Object[_0x3a4ec1(0x175)](_0x2605bd['yamlConfig'][_0x3a4ec1(0x18a)])){const _0x41db88=generateDeterministicJourneySegmentName(_0x2605bd[_0x3a4ec1(0x12d)][_0x3a4ec1(0x208)],_0x515ecc);_0x4a7129[_0x3a4ec1(0x218)](_0x41db88,_0x515ecc),_0x10e2c7[_0x3a4ec1(0x194)](_0x515ecc);}const _0x409b92=[],_0x80ae9d=collectSegmentIdsFromJourneyApi(_0x2605bd[_0x3a4ec1(0x14b)]);for(const _0x28f5f2 of _0x80ae9d){const _0x5f10c5=await fetchSegment(_0xc9dbc7,_0xfddc80,_0x28f5f2,_0x557c08);if(!_0x5f10c5?.['name'])continue;const _0x12413d=_0x4a7129['get'](_0x5f10c5[_0x3a4ec1(0x208)]);_0x12413d?(_0x39e32e[_0x3a4ec1(0x218)](_0x12413d,_0x28f5f2),_0x10e2c7[_0x3a4ec1(0x1e2)](_0x12413d)):_0x409b92[_0x3a4ec1(0x189)]({'id':_0x28f5f2,'seg':_0x5f10c5});}if(_0x10e2c7[_0x3a4ec1(0x165)]>0x0&&_0x409b92['length']>0x0){const {localExpandedRuleToNames:_0x561bdc}=buildLocalExpandedRuleMappings(_0x2605bd[_0x3a4ec1(0x12d)]),_0x3665ad=new Map();for(const {id:_0x311f25,seg:_0x342985}of _0x409b92){if(_0x342985[_0x3a4ec1(0x20d)]){const _0x202962=apiRuleToYaml(_0x342985['rule']);_0x3665ad[_0x3a4ec1(0x218)](_0x311f25,_0x202962);}}for(const {id:_0x238d07,seg:_0x43dfd8}of _0x409b92){if(!_0x43dfd8[_0x3a4ec1(0x20d)])continue;const _0x1ebc5c=_0x3665ad['get'](_0x238d07);if(!_0x1ebc5c)continue;const _0x83f8e6=serializeExpandedRule(_0x1ebc5c,_0x3665ad),_0x836678=_0x561bdc[_0x3a4ec1(0x183)](_0x83f8e6);if(_0x836678){const _0x5bc64f=_0x836678['find'](_0x22f1fd=>_0x10e2c7[_0x3a4ec1(0x1e3)](_0x22f1fd));_0x5bc64f&&(_0x39e32e['set'](_0x5bc64f,_0x238d07),_0x10e2c7[_0x3a4ec1(0x1e2)](_0x5bc64f),logger[_0x3a4ec1(0x192)](_0x3a4ec1(0x1d8)+_0x43dfd8[_0x3a4ec1(0x208)]+_0x3a4ec1(0x18c)+_0x5bc64f+_0x3a4ec1(0x12a)));}}}}async function executeSingleJourneyPush(_0x2abe39,_0x3c04f1,_0xc4916b,_0x8ff234,_0x3e94ec,_0x448ae1){const _0x4e7c2e=a155_0x285d0a,{journeyDefToRequest:_0xbeed8b,activationDefToCreateRequest:_0x361f05,yamlRuleToApi:_0x5abfbf,validateSegmentRule:_0x8c00c4}=_0x448ae1,_0x3afa63=new Map(),_0x3c3efc=new Map();recoverSegmentIdsFromPushRecovery(_0x3c04f1,_0x3afa63,_0xc4916b['segmentNameToId']);const _0x1f6d27=new Map(),_0x23aeb9=new Map(),_0xaa6fc0=new Map();let _0x1828f5;const _0x5598e9=async()=>{const _0x43595e=a155_0x5fe8;if(_0x1828f5)return;_0x1828f5=new Map();if(!_0x3c04f1[_0x43595e(0x14b)])return;const _0x581a18=await _0x2abe39[_0x43595e(0x203)][_0x43595e(0x17c)](_0x3c04f1['existingJourney']['id']);for(const _0x2d2e12 of _0x581a18){const _0x484c18=journeyActivationStepToYaml(_0x2d2e12,_0xc4916b[_0x43595e(0x16a)],_0xc4916b[_0x43595e(0x220)]),_0x118720=activationSignature(_0x484c18);!_0x1828f5[_0x43595e(0x1e3)](_0x118720)&&_0x1828f5[_0x43595e(0x218)](_0x118720,_0x2d2e12['id']),_0x484c18[_0x43595e(0x208)]&&_0x3c3efc[_0x43595e(0x218)](_0x484c18[_0x43595e(0x208)],_0x2d2e12['id']);}};await matchExistingJourneySegments(_0x2abe39,_0x3c04f1,_0x8ff234[_0x4e7c2e(0x216)],_0xc4916b[_0x4e7c2e(0x1dd)],_0xc4916b[_0x4e7c2e(0x1c1)]);const _0x4769c5={'resolveSegmentId':async _0x30365c=>{const _0x14fbb4=_0x4e7c2e,_0x518fd2=_0xc4916b['segmentNameToId'][_0x14fbb4(0x183)](_0x30365c);if(!_0x518fd2)throw new SDKError(ErrorCode[_0x14fbb4(0x1fb)],_0x14fbb4(0x1fa)+_0x30365c+_0x14fbb4(0x1c8)+_0x3c04f1[_0x14fbb4(0x12d)][_0x14fbb4(0x208)]+')');return _0x518fd2;},'resolveEmbeddedSegmentId':async(_0x6bfa7a,_0x1d572b)=>{const _0xdc7785=_0x4e7c2e,_0x2324d0=_0xc4916b[_0xdc7785(0x1c1)][_0xdc7785(0x183)](_0x6bfa7a);if(_0x2324d0)return _0x2324d0;const _0x1618c9=_0xc4916b[_0xdc7785(0x1dd)]['find'](_0x38de5a=>_0x38de5a[_0xdc7785(0x208)]===_0x6bfa7a);if(_0x1618c9)return _0xc4916b[_0xdc7785(0x1c1)][_0xdc7785(0x218)](_0x6bfa7a,_0x1618c9['id']),_0x1618c9['id'];if(_0x3c04f1[_0xdc7785(0x1f1)]){const {stageName:_0x56cdf4,criteriaName:_0x1304c4}=findSegmentCriteriaLocation(_0x3c04f1[_0xdc7785(0x12d)],_0x6bfa7a);return _0x8c00c4(_0x6bfa7a,_0x1d572b['rule']),_0x23aeb9[_0xdc7785(0x218)](_0x6bfa7a,{'definition':_0x1d572b,'stageName':_0x56cdf4,'criteriaName':_0x1304c4}),createPendingSegmentId(_0x6bfa7a);}const _0x1c87dd=_0x3c04f1[_0xdc7785(0x14b)]?.['id'];if(!_0x1c87dd)throw new SDKError(ErrorCode[_0xdc7785(0x1bf)],_0xdc7785(0x19f));const _0x4c82ec=_0x1f6d27[_0xdc7785(0x183)](_0x6bfa7a);if(_0x4c82ec)return _0x4c82ec;const _0x423261=((async()=>{const _0x2df7d5=_0xdc7785;_0x8c00c4(_0x6bfa7a,_0x1d572b[_0x2df7d5(0x20d)]);const _0x263cfa=generateDeterministicJourneySegmentName(_0x3c04f1['yamlConfig'][_0x2df7d5(0x208)],_0x6bfa7a),_0x46e498=_0xc4916b[_0x2df7d5(0x1dd)][_0x2df7d5(0x176)](_0x1a1b17=>_0x1a1b17[_0x2df7d5(0x208)]===_0x263cfa),_0x2a2b9c=createSegmentIdResolver(_0xc4916b[_0x2df7d5(0x1c1)],_0x6bfa7a),_0x4c0f4c=await resolveRuleSegmentIds(_0x1d572b[_0x2df7d5(0x20d)],_0x2a2b9c);let _0x11b3a8;return _0x46e498?(await _0x2abe39[_0x2df7d5(0x1b8)][_0x2df7d5(0x1ef)](_0x8ff234['parentId'],_0x46e498['id'],{'description':_0x1d572b[_0x2df7d5(0x1a8)]||'Entry\x20criteria:\x20'+_0x6bfa7a,'rule':_0x5abfbf(_0x4c0f4c),'countPopulation':!![]}),_0x11b3a8=_0x46e498['id'],saveSegmentToPushRecovery(_0x3c04f1['absolutePath'],_0x3c04f1[_0x2df7d5(0x12d)]['name'],_0x6bfa7a,{'segmentId':_0x11b3a8,'uniqueServerName':_0x263cfa,'createdAt':new Date()[_0x2df7d5(0x217)]()})):_0x11b3a8=await createOrRecoverEmbeddedSegment(_0x2abe39,_0x3c04f1,{'localName':_0x6bfa7a,'uniqueSegmentName':_0x263cfa,'description':_0x1d572b[_0x2df7d5(0x1a8)]||_0x2df7d5(0x1d9)+_0x6bfa7a,'journeyId':_0x1c87dd,'resolvedRule':_0x4c0f4c,'parentId':_0x8ff234['parentId'],'folderId':_0x8ff234[_0x2df7d5(0x1c3)]||''},_0x5abfbf),_0xc4916b['segmentNameToId'][_0x2df7d5(0x218)](_0x6bfa7a,_0x11b3a8),_0x3afa63[_0x2df7d5(0x218)](_0x6bfa7a,_0x11b3a8),_0x11b3a8;})());_0x1f6d27[_0xdc7785(0x218)](_0x6bfa7a,_0x423261);try{return await _0x423261;}finally{_0x1f6d27['delete'](_0x6bfa7a);}},'resolveActivationId':async _0x487ab3=>{const _0xdf7265=_0x4e7c2e,_0x53eadb=_0x3c3efc[_0xdf7265(0x183)](_0x487ab3);if(_0x53eadb)return _0x53eadb;if(_0x3c04f1[_0xdf7265(0x14b)]){await _0x5598e9();const _0x1caf78=_0x3c3efc[_0xdf7265(0x183)](_0x487ab3);if(_0x1caf78)return _0x1caf78;}throw new SDKError(ErrorCode[_0xdf7265(0x158)],_0xdf7265(0x1ce)+_0x487ab3+_0xdf7265(0x1c8)+_0x3c04f1[_0xdf7265(0x12d)][_0xdf7265(0x208)]+_0xdf7265(0x142)+_0xdf7265(0x1bd));},'resolveEmbeddedActivationId':async(_0xcc899c,_0x4a350f)=>{const _0x323a8d=_0x4e7c2e,_0x5bc986=_0x3c3efc[_0x323a8d(0x183)](_0xcc899c);if(_0x5bc986)return _0x5bc986;if(_0x3c04f1[_0x323a8d(0x1f1)])return _0xaa6fc0['set'](_0xcc899c,_0x4a350f),createPendingActivationId(_0xcc899c);if(_0x3c04f1[_0x323a8d(0x14b)]){await _0x5598e9();const _0x25ec63=_0x3c3efc[_0x323a8d(0x183)](_0x4a350f[_0x323a8d(0x208)]);if(_0x25ec63)return _0x3c3efc[_0x323a8d(0x218)](_0xcc899c,_0x25ec63),_0x25ec63;const _0x593c64=activationSignature(_0x4a350f),_0x4b4a35=_0x1828f5?.[_0x323a8d(0x183)](_0x593c64);if(_0x4b4a35)return _0x3c3efc[_0x323a8d(0x218)](_0xcc899c,_0x4b4a35),_0x4b4a35;const _0x105204=await _0x361f05(_0x4a350f,_0xc4916b[_0x323a8d(0x129)]),_0x53150b={..._0x105204,..._0x4a350f[_0x323a8d(0x12b)]!==undefined&&{'runAfterJourneyRefresh':_0x4a350f[_0x323a8d(0x12b)]}},_0x431dd0=await _0x2abe39[_0x323a8d(0x203)]['createActivation'](_0x3c04f1[_0x323a8d(0x14b)]['id'],_0x53150b);return _0x3c3efc[_0x323a8d(0x218)](_0xcc899c,_0x431dd0['id']),_0x431dd0['id'];}throw new SDKError(ErrorCode[_0x323a8d(0x1bf)],_0x323a8d(0x1ea));},'resolveJourneyId':async _0x39c15a=>{const _0x3c4776=_0x4e7c2e;try{return await _0x2abe39['journey'][_0x3c4776(0x19c)](_0x8ff234[_0x3c4776(0x216)],_0x39c15a);}catch(_0x563d7b){throw new SDKError(ErrorCode[_0x3c4776(0x158)],_0x3c4776(0x20c)+_0x39c15a+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x3c04f1['yamlConfig']['name']+'\x27)',_0x563d7b);}},'resolveStageId':async(_0xa79312,_0x43007f)=>{const _0x4586c5=_0x4e7c2e,_0x1c08fc=await _0x2abe39[_0x4586c5(0x203)][_0x4586c5(0x207)](_0xa79312),_0x2a3654=_0x1c08fc[_0x4586c5(0x213)][_0x4586c5(0x15a)][_0x4586c5(0x176)](_0x3c8f92=>_0x3c8f92[_0x4586c5(0x208)][_0x4586c5(0x1e8)]()===_0x43007f[_0x4586c5(0x1e8)]());if(!_0x2a3654?.['id'])throw new SDKError(ErrorCode[_0x4586c5(0x158)],_0x4586c5(0x1ee)+_0x43007f+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x1c08fc[_0x4586c5(0x213)][_0x4586c5(0x172)]||_0x1c08fc[_0x4586c5(0x213)]['name'])+'\x27');return _0x2a3654['id'];}},_0x5039d4=await _0xbeed8b(_0x3c04f1[_0x4e7c2e(0x12d)],_0x8ff234['parentId'],_0x4769c5),_0x321a40=_0x8ff234[_0x4e7c2e(0x199)]||_0x8ff234[_0x4e7c2e(0x1c3)];_0x321a40&&(_0x5039d4[_0x4e7c2e(0x14a)]={'parentFolder':{'data':{'id':_0x321a40,'type':_0x4e7c2e(0x196)}}});if(_0x3c04f1['isNew']){if(_0x23aeb9[_0x4e7c2e(0x165)]>0x0||_0xaa6fc0['size']>0x0)return await executeThreeStepJourneyCreate(_0x2abe39,_0x3c04f1,_0x5039d4,{'pendingEmbeddedSegments':_0x23aeb9,'pendingEmbeddedActivations':_0xaa6fc0,'embeddedSegmentNameToId':_0x3afa63,'journeyActivationNameToId':_0x3c3efc},{..._0x8ff234,'effectiveFolderId':_0x321a40},_0xc4916b,_0x3e94ec,_0x448ae1);else{ensureJourneyDefaults(_0x5039d4[_0x4e7c2e(0x213)]);const _0xa13e79=await _0x2abe39['journey'][_0x4e7c2e(0x1a7)](_0x5039d4);return deletePushRecovery(_0x3c04f1[_0x4e7c2e(0x169)]),{'action':'created','journeyId':_0xa13e79['id'],'embeddedSegmentNameToId':_0x3afa63};}}else{if(_0x3c04f1[_0x4e7c2e(0x1da)]&&_0x3c04f1['existingJourney']){_0x5039d4['id']=_0x3c04f1[_0x4e7c2e(0x14b)]['id'];const _0x41e967=_0x5039d4[_0x4e7c2e(0x213)];_0x3c04f1['existingJourney'][_0x4e7c2e(0x213)]?.[_0x4e7c2e(0x172)]&&(_0x41e967[_0x4e7c2e(0x172)]=_0x3c04f1[_0x4e7c2e(0x14b)][_0x4e7c2e(0x213)]['journeyBundleName']);const _0x1342d2=_0x3c04f1['existingJourney'][_0x4e7c2e(0x213)]?.[_0x4e7c2e(0x15a)];return _0x1342d2&&_0x5039d4[_0x4e7c2e(0x213)][_0x4e7c2e(0x15a)]&&injectExistingStageIds(_0x5039d4[_0x4e7c2e(0x213)][_0x4e7c2e(0x15a)],_0x1342d2),ensureJourneyDefaults(_0x41e967),await _0x2abe39['journey'][_0x4e7c2e(0x1a6)](_0x3c04f1[_0x4e7c2e(0x14b)]['id'],_0x5039d4),deletePushRecovery(_0x3c04f1['absolutePath']),{'action':_0x4e7c2e(0x152),'journeyId':_0x3c04f1[_0x4e7c2e(0x14b)]['id'],'embeddedSegmentNameToId':_0x3afa63};}}return deletePushRecovery(_0x3c04f1['absolutePath']),{'action':_0x4e7c2e(0x200),'journeyId':_0x3c04f1[_0x4e7c2e(0x14b)]?.['id'],'embeddedSegmentNameToId':_0x3afa63};}function findSegmentCriteriaLocation(_0x38dd33,_0x27d7a7){const _0xbe6a56=a155_0x285d0a,_0x915e79=_0x38dd33['stages']||_0x38dd33[_0xbe6a56(0x166)]?.[0x0]?.[_0xbe6a56(0x1f9)]||[];let _0x1e14f0='entry',_0x47cac5=_0x27d7a7;const _0x1067d4=_0x38dd33[_0xbe6a56(0x198)]||_0x38dd33[_0xbe6a56(0x166)]?.[0x0]?.[_0xbe6a56(0x198)];if(_0x1067d4?.[_0xbe6a56(0x1b8)]===_0x27d7a7)return{'stageName':_0xbe6a56(0x198),'criteriaName':_0x1067d4['name']||_0x27d7a7};_0x31e475:for(const _0x556ddd of _0x915e79){if(_0x556ddd['entry_criteria']?.[_0xbe6a56(0x1b8)]===_0x27d7a7){_0x1e14f0=_0x556ddd[_0xbe6a56(0x208)],_0x47cac5=_0x556ddd[_0xbe6a56(0x1a9)]['name']||_0x27d7a7;break;}if(_0x556ddd[_0xbe6a56(0x1ff)])for(const _0x4059d6 of _0x556ddd[_0xbe6a56(0x1ff)]){if(_0x4059d6[_0xbe6a56(0x140)]===_0xbe6a56(0x174)&&_0x4059d6[_0xbe6a56(0x1a5)]?.[_0xbe6a56(0x19b)])for(const _0x423358 of _0x4059d6['with'][_0xbe6a56(0x19b)]){if(_0x423358[_0xbe6a56(0x1b8)]===_0x27d7a7){_0x1e14f0=_0x556ddd[_0xbe6a56(0x208)],_0x47cac5=_0x423358['name']||_0x27d7a7;break _0x31e475;}}}}return{'stageName':_0x1e14f0,'criteriaName':_0x47cac5};}async function executeThreeStepJourneyCreate(_0x38b966,_0x32fa11,_0x3a2b4e,_0x57634d,_0x52ac1b,_0x2a9a96,_0x2f9442,_0x1332bd){const _0x4136fa=a155_0x285d0a,{activationDefToCreateRequest:_0x391dac,yamlRuleToApi:_0xe50f93}=_0x1332bd,{pendingEmbeddedSegments:_0x123194,pendingEmbeddedActivations:_0x40c3b2,embeddedSegmentNameToId:_0x487171}=_0x57634d,_0x22b670=JSON[_0x4136fa(0x17b)](JSON[_0x4136fa(0x1de)](_0x3a2b4e));ensureJourneyDefaults(_0x22b670[_0x4136fa(0x213)]),stripPendingIds(_0x22b670);const _0x4f86f2=await _0x38b966['journey']['create'](_0x22b670),_0x2f5638=_0x4f86f2['id'],_0x3f15ec=new Map();for(const _0x4f67ea of _0x4f86f2[_0x4136fa(0x213)]['journeyStages']){_0x3f15ec[_0x4136fa(0x218)](_0x4f67ea[_0x4136fa(0x208)][_0x4136fa(0x1e8)](),_0x4f67ea['id']);}recoverSegmentIdsFromPushRecovery(_0x32fa11,_0x487171,_0x2a9a96['segmentNameToId']);for(const [_0x3ed83a,{definition:_0x4e30ca}]of _0x123194){if(_0x487171['has'](_0x3ed83a)){_0x2f9442[_0x4136fa(0x181)]?.({'type':_0x4136fa(0x136),'journeyName':_0x32fa11[_0x4136fa(0x12d)][_0x4136fa(0x208)],'segmentName':_0x3ed83a});continue;}const _0x55555d=generateDeterministicJourneySegmentName(_0x32fa11[_0x4136fa(0x12d)][_0x4136fa(0x208)],_0x3ed83a);_0x2f9442['onProgress']?.({'type':_0x4136fa(0x202),'journeyName':_0x32fa11[_0x4136fa(0x12d)]['name'],'segmentName':_0x3ed83a});const _0x36f7de=createSegmentIdResolver(_0x2a9a96[_0x4136fa(0x1c1)],_0x3ed83a),_0x23b294=await resolveRuleSegmentIds(_0x4e30ca[_0x4136fa(0x20d)],_0x36f7de),_0x99c479=await createOrRecoverEmbeddedSegment(_0x38b966,_0x32fa11,{'localName':_0x3ed83a,'uniqueSegmentName':_0x55555d,'description':_0x4e30ca['description']||'Entry\x20criteria:\x20'+_0x3ed83a,'journeyId':_0x2f5638,'resolvedRule':_0x23b294,'parentId':_0x52ac1b[_0x4136fa(0x216)],'folderId':_0x52ac1b[_0x4136fa(0x214)]||''},_0xe50f93);_0x487171[_0x4136fa(0x218)](_0x3ed83a,_0x99c479),_0x2a9a96['segmentNameToId']['set'](_0x3ed83a,_0x99c479),_0x2f9442[_0x4136fa(0x181)]?.({'type':_0x4136fa(0x136),'journeyName':_0x32fa11[_0x4136fa(0x12d)][_0x4136fa(0x208)],'segmentName':_0x3ed83a});}const _0x320663=new Map();for(const [_0x4e651d,_0x4a4d9]of _0x40c3b2){_0x2f9442[_0x4136fa(0x181)]?.({'type':_0x4136fa(0x22a),'journeyName':_0x32fa11['yamlConfig'][_0x4136fa(0x208)],'activationName':_0x4e651d});const _0x3a259e=await _0x391dac(_0x4a4d9,_0x2a9a96[_0x4136fa(0x129)]),_0x5f309a={..._0x3a259e,..._0x4a4d9[_0x4136fa(0x12b)]!==undefined&&{'runAfterJourneyRefresh':_0x4a4d9[_0x4136fa(0x12b)]}},_0x18b380=await _0x38b966[_0x4136fa(0x203)][_0x4136fa(0x1e4)](_0x2f5638,_0x5f309a);_0x320663[_0x4136fa(0x218)](_0x4e651d,_0x18b380['id']),_0x57634d['journeyActivationNameToId']['set'](_0x4e651d,_0x18b380['id']),_0x2f9442[_0x4136fa(0x181)]?.({'type':_0x4136fa(0x1cc),'journeyName':_0x32fa11['yamlConfig'][_0x4136fa(0x208)],'activationName':_0x4e651d});}const _0x55c885=JSON['parse'](JSON[_0x4136fa(0x1de)](_0x3a2b4e));return _0x55c885['id']=_0x2f5638,ensureJourneyDefaults(_0x55c885[_0x4136fa(0x213)]),resolvePendingIdsInRequest(_0x55c885,_0x3a2b4e,_0x3f15ec,_0x487171,_0x320663,_0x2f9442),await _0x38b966[_0x4136fa(0x203)][_0x4136fa(0x1a6)](_0x2f5638,_0x55c885),deletePushRecovery(_0x32fa11[_0x4136fa(0x169)]),{'action':'created','journeyId':_0x2f5638,'embeddedSegmentNameToId':_0x487171};}export function stripWaitStepPendingIds(_0xd46200){const _0x1a9548=a155_0x285d0a,_0x3a8dda=_0xd46200[_0x1a9548(0x20f)]&&isPendingSegmentId(_0xd46200[_0x1a9548(0x20f)]),_0x18a07e=_0xd46200[_0x1a9548(0x1d5)]?.[_0x1a9548(0x1ad)](_0x24a6b4=>_0x24a6b4[_0x1a9548(0x1e9)]&&isPendingSegmentId(_0x24a6b4[_0x1a9548(0x1e9)]));(_0x3a8dda||_0x18a07e)&&(_0xd46200[_0x1a9548(0x21e)]=_0x1a9548(0x163),_0xd46200[_0x1a9548(0x221)]=0x1,_0xd46200[_0x1a9548(0x177)]=_0x1a9548(0x206),delete _0xd46200['conditionSegmentId'],delete _0xd46200['conditionTimeoutDuration'],delete _0xd46200[_0x1a9548(0x187)],delete _0xd46200[_0x1a9548(0x1d5)]);}export function resolveWaitStepPendingIds(_0xfa617d,_0x487a3f,_0x50b3cc,_0x3496ef){const _0x5bd768=a155_0x285d0a;if(_0x487a3f[_0x5bd768(0x20f)]&&isPendingSegmentId(_0x487a3f[_0x5bd768(0x20f)])){const _0x5c2eff=_0x50b3cc(_0x487a3f[_0x5bd768(0x20f)],_0x5bd768(0x1d3)+_0x3496ef+_0x5bd768(0x186));_0x5c2eff&&(_0xfa617d['waitStepType']=_0x5bd768(0x149),_0xfa617d[_0x5bd768(0x20f)]=_0x5c2eff,delete _0xfa617d[_0x5bd768(0x221)],delete _0xfa617d[_0x5bd768(0x177)],_0x487a3f[_0x5bd768(0x1c6)]!==undefined&&(_0xfa617d[_0x5bd768(0x1c6)]=_0x487a3f[_0x5bd768(0x1c6)]),_0x487a3f['conditionTimeoutUnit']&&(_0xfa617d[_0x5bd768(0x187)]=_0x487a3f[_0x5bd768(0x187)]));}if(_0x487a3f['conditions']){const _0x202c22=_0x487a3f[_0x5bd768(0x1d5)]['some'](_0x469169=>_0x469169[_0x5bd768(0x1e9)]&&isPendingSegmentId(_0x469169[_0x5bd768(0x1e9)]));if(_0x202c22){const _0x374019=_0x487a3f[_0x5bd768(0x1d5)]['map'](_0x4c8768=>{const _0x5516da=_0x5bd768;if(_0x4c8768['segmentId']&&isPendingSegmentId(_0x4c8768[_0x5516da(0x1e9)])){const _0x4fa0e9=_0x50b3cc(_0x4c8768[_0x5516da(0x1e9)],_0x5516da(0x1d3)+_0x3496ef+_0x5516da(0x186));return{..._0x4c8768,'segmentId':_0x4fa0e9||_0x4c8768['segmentId']};}return{..._0x4c8768};});_0xfa617d[_0x5bd768(0x21e)]=_0x5bd768(0x149),_0xfa617d['conditions']=_0x374019,delete _0xfa617d['waitStep'],delete _0xfa617d[_0x5bd768(0x177)],delete _0xfa617d[_0x5bd768(0x20f)],delete _0xfa617d[_0x5bd768(0x1c6)],delete _0xfa617d['conditionTimeoutUnit'];}}}function stripPendingIds(_0x42c25d){const _0xeb14e0=a155_0x285d0a;_0x42c25d['attributes'][_0xeb14e0(0x198)]?.[_0xeb14e0(0x1e9)]&&isPendingSegmentId(_0x42c25d['attributes']['goal'][_0xeb14e0(0x1e9)])&&delete _0x42c25d[_0xeb14e0(0x213)][_0xeb14e0(0x198)];for(const _0x26603c of _0x42c25d[_0xeb14e0(0x213)][_0xeb14e0(0x15a)]||[]){_0x26603c[_0xeb14e0(0x1b3)]?.[_0xeb14e0(0x1e9)]&&isPendingSegmentId(_0x26603c[_0xeb14e0(0x1b3)]['segmentId'])&&delete _0x26603c[_0xeb14e0(0x1b3)];_0x26603c[_0xeb14e0(0x204)]?.[_0xeb14e0(0x1e9)]&&isPendingSegmentId(_0x26603c[_0xeb14e0(0x204)]['segmentId'])&&delete _0x26603c[_0xeb14e0(0x204)];_0x26603c[_0xeb14e0(0x1b4)]&&(_0x26603c['exitCriterias']=_0x26603c[_0xeb14e0(0x1b4)]['filter'](_0x50f118=>!_0x50f118[_0xeb14e0(0x1e9)]||!isPendingSegmentId(_0x50f118[_0xeb14e0(0x1e9)])));if(_0x26603c[_0xeb14e0(0x1ff)])for(const _0x1a0a63 of Object[_0xeb14e0(0x175)](_0x26603c[_0xeb14e0(0x1ff)])){const _0x180e30=_0x26603c[_0xeb14e0(0x1ff)][_0x1a0a63];_0x180e30[_0xeb14e0(0x140)]==='Activation'&&_0x180e30['journeyActivationStepId']&&isPendingActivationId(_0x180e30[_0xeb14e0(0x21c)])&&(_0x180e30[_0xeb14e0(0x21c)]='');if(_0x180e30[_0xeb14e0(0x140)]===_0xeb14e0(0x139)&&_0x180e30[_0xeb14e0(0x19b)])for(const _0x163d7a of _0x180e30[_0xeb14e0(0x19b)]){_0x163d7a['segmentId']&&isPendingSegmentId(_0x163d7a[_0xeb14e0(0x1e9)])&&(_0x163d7a[_0xeb14e0(0x1e9)]='');}_0x180e30['type']===_0xeb14e0(0x133)&&stripWaitStepPendingIds(_0x180e30);}}}function resolvePendingIdsInRequest(_0x4b0f08,_0x1defbe,_0x21cd1e,_0x501075,_0x59713d,_0x5b1982){const _0x481971=a155_0x285d0a,_0x4d8f01=(_0x4acf41,_0x2aa9b9)=>{const _0xbcde89=a155_0x5fe8;if(!isPendingSegmentId(_0x4acf41))return _0x4acf41;const _0x5eb974=extractPendingSegmentName(_0x4acf41),_0x3065de=_0x501075[_0xbcde89(0x183)](_0x5eb974);return!_0x3065de&&_0x5b1982[_0xbcde89(0x134)]?.(_0xbcde89(0x147)+_0x5eb974+_0xbcde89(0x1a0)+_0x2aa9b9),_0x3065de;};if(_0x4b0f08[_0x481971(0x213)][_0x481971(0x198)]?.[_0x481971(0x1e9)]&&isPendingSegmentId(_0x4b0f08['attributes']['goal'][_0x481971(0x1e9)])){const _0x4dbd6a=_0x4d8f01(_0x4b0f08['attributes']['goal'][_0x481971(0x1e9)],_0x481971(0x1db));_0x4dbd6a&&(_0x4b0f08[_0x481971(0x213)]['goal'][_0x481971(0x1e9)]=_0x4dbd6a);}for(const _0x4a52b0 of _0x4b0f08[_0x481971(0x213)][_0x481971(0x15a)]||[]){const _0x5ec808=_0x21cd1e[_0x481971(0x183)](_0x4a52b0[_0x481971(0x208)][_0x481971(0x1e8)]());_0x5ec808&&(_0x4a52b0['id']=_0x5ec808);if(_0x4a52b0[_0x481971(0x1b3)]?.['segmentId']&&isPendingSegmentId(_0x4a52b0[_0x481971(0x1b3)][_0x481971(0x1e9)])){const _0x550a5d=_0x4d8f01(_0x4a52b0['entryCriteria']['segmentId'],_0x481971(0x1d3)+_0x4a52b0[_0x481971(0x208)]+_0x481971(0x1d7));_0x550a5d&&(_0x4a52b0[_0x481971(0x1b3)][_0x481971(0x1e9)]=_0x550a5d);}if(_0x4a52b0['exitCriterias'])for(const _0x860a4f of _0x4a52b0[_0x481971(0x1b4)]){if(_0x860a4f['segmentId']&&isPendingSegmentId(_0x860a4f[_0x481971(0x1e9)])){const _0x548b2d=_0x4d8f01(_0x860a4f[_0x481971(0x1e9)],_0x481971(0x1d3)+_0x4a52b0['name']+'\x27\x20exit\x20criteria');_0x548b2d&&(_0x860a4f[_0x481971(0x1e9)]=_0x548b2d);}}if(_0x4a52b0[_0x481971(0x204)]?.['segmentId']&&isPendingSegmentId(_0x4a52b0[_0x481971(0x204)]['segmentId'])){const _0x24e263=_0x4d8f01(_0x4a52b0['milestone']['segmentId'],_0x481971(0x1d3)+_0x4a52b0[_0x481971(0x208)]+_0x481971(0x15c));_0x24e263&&(_0x4a52b0['milestone'][_0x481971(0x1e9)]=_0x24e263);}if(_0x4a52b0['steps']){const _0x330cc2=_0x148413=>_0x1defbe[_0x481971(0x213)]['journeyStages']?.[_0x481971(0x176)](_0x42581a=>_0x42581a['name'][_0x481971(0x1e8)]()===_0x4a52b0[_0x481971(0x208)][_0x481971(0x1e8)]())?.[_0x481971(0x1ff)]?.[_0x148413];for(const _0x4914b6 of Object[_0x481971(0x175)](_0x4a52b0['steps'])){const _0x39c1bf=_0x4a52b0['steps'][_0x4914b6],_0x26f988=_0x330cc2(_0x4914b6);if(_0x39c1bf['type']===_0x481971(0x1b0)&&_0x39c1bf[_0x481971(0x21c)]&&(isPendingActivationId(_0x39c1bf[_0x481971(0x21c)])||_0x39c1bf[_0x481971(0x21c)]==='')){if(_0x26f988?.[_0x481971(0x21c)]&&isPendingActivationId(_0x26f988[_0x481971(0x21c)])){const _0x1d9d5e=extractPendingActivationName(_0x26f988[_0x481971(0x21c)]),_0x2d10c0=_0x59713d[_0x481971(0x183)](_0x1d9d5e);_0x2d10c0&&(_0x39c1bf[_0x481971(0x21c)]=_0x2d10c0);}}if(_0x39c1bf[_0x481971(0x140)]===_0x481971(0x139)&&_0x39c1bf[_0x481971(0x19b)]&&_0x26f988?.['branches'])for(let _0x3ae14f=0x0;_0x3ae14f<_0x39c1bf['branches'][_0x481971(0x13c)];_0x3ae14f++){const _0x161d93=_0x39c1bf[_0x481971(0x19b)][_0x3ae14f],_0x1e9dc6=_0x26f988[_0x481971(0x19b)][_0x3ae14f];if(_0x1e9dc6?.[_0x481971(0x1e9)]&&isPendingSegmentId(_0x1e9dc6['segmentId'])){const _0x10144c=_0x4d8f01(_0x1e9dc6[_0x481971(0x1e9)],_0x481971(0x1d3)+_0x4a52b0[_0x481971(0x208)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x161d93[_0x481971(0x208)]||_0x3ae14f)+'\x27');_0x10144c&&(_0x161d93[_0x481971(0x1e9)]=_0x10144c);}}_0x39c1bf['type']===_0x481971(0x133)&&_0x26f988?.[_0x481971(0x140)]===_0x481971(0x133)&&resolveWaitStepPendingIds(_0x39c1bf,_0x26f988,_0x4d8f01,_0x4a52b0[_0x481971(0x208)]);}}}}
@@ -1 +1 @@
1
- (function(_0x53cc68,_0x129b56){const _0x32ec62=a156_0x4ace,_0x31424=_0x53cc68();while(!![]){try{const _0x1193f2=-parseInt(_0x32ec62(0x159))/0x1+parseInt(_0x32ec62(0x151))/0x2*(-parseInt(_0x32ec62(0x15d))/0x3)+-parseInt(_0x32ec62(0x153))/0x4+parseInt(_0x32ec62(0x15b))/0x5*(-parseInt(_0x32ec62(0x14f))/0x6)+-parseInt(_0x32ec62(0x154))/0x7+parseInt(_0x32ec62(0x15e))/0x8+-parseInt(_0x32ec62(0x158))/0x9*(-parseInt(_0x32ec62(0x152))/0xa);if(_0x1193f2===_0x129b56)break;else _0x31424['push'](_0x31424['shift']());}catch(_0x4c71c6){_0x31424['push'](_0x31424['shift']());}}}(a156_0x5957,0x6e5fe));function a156_0x4ace(_0x43c0ad,_0x31363d){_0x43c0ad=_0x43c0ad-0x14f;const _0x595759=a156_0x5957();let _0x4ace4b=_0x595759[_0x43c0ad];return _0x4ace4b;}export function buildFolderIdToPathMap(_0x50d0b8){const _0x40e859=a156_0x4ace,_0x1e54b2=new Map(),_0x639252=new Map();for(const _0x10ae90 of _0x50d0b8){_0x639252[_0x40e859(0x157)](_0x10ae90['id'],_0x10ae90);}const _0x30e088=new Set();for(const _0x305bd8 of _0x50d0b8){!_0x305bd8[_0x40e859(0x155)]&&_0x30e088[_0x40e859(0x15a)](_0x305bd8['id']);}function _0x4f56f8(_0x2175c2){const _0x1d4d92=_0x40e859;if(_0x1e54b2['has'](_0x2175c2['id']))return _0x1e54b2[_0x1d4d92(0x156)](_0x2175c2['id']);if(_0x30e088['has'](_0x2175c2['id']))return _0x1e54b2['set'](_0x2175c2['id'],''),'';if(_0x2175c2[_0x1d4d92(0x155)]){const _0x1dd2ca=_0x639252[_0x1d4d92(0x156)](_0x2175c2[_0x1d4d92(0x155)]);if(_0x1dd2ca){const _0x56b858=_0x4f56f8(_0x1dd2ca),_0x33ca8c=_0x56b858?_0x56b858+'/'+_0x2175c2[_0x1d4d92(0x15c)]:_0x2175c2[_0x1d4d92(0x15c)];return _0x1e54b2[_0x1d4d92(0x157)](_0x2175c2['id'],_0x33ca8c),_0x33ca8c;}}const _0x5a2732=_0x2175c2[_0x1d4d92(0x15c)];return _0x1e54b2['set'](_0x2175c2['id'],_0x5a2732),_0x5a2732;}for(const _0x3b5f45 of _0x50d0b8){_0x4f56f8(_0x3b5f45);}return _0x1e54b2;}function a156_0x5957(){const _0x1b9dc7=['371100WAXseh','4315710goGbUR','parentFolderId','get','set','14215923OXfzEv','861855NRwYTj','add','108665fXzVRK','name','1306119taqsCJ','1176960dBlDUf','234tcpEnA','has','2BIbOxU','20lmlqhM'];a156_0x5957=function(){return _0x1b9dc7;};return a156_0x5957();}export function buildFolderPathToIdMap(_0x5adf02){const _0x440dba=a156_0x4ace,_0x445e15=new Map(),_0x43ebeb=new Map();for(const _0x4b9d3c of _0x5adf02){_0x43ebeb[_0x440dba(0x157)](_0x4b9d3c['id'],_0x4b9d3c);}const _0x26fbeb=new Set();for(const _0x188c76 of _0x5adf02){!_0x188c76[_0x440dba(0x155)]&&_0x26fbeb['add'](_0x188c76['id']);}function _0x3c2849(_0x3cb6e9){const _0x65602f=_0x440dba;if(_0x26fbeb[_0x65602f(0x150)](_0x3cb6e9['id']))return'';if(_0x3cb6e9[_0x65602f(0x155)]){const _0x5a3d8a=_0x43ebeb[_0x65602f(0x156)](_0x3cb6e9[_0x65602f(0x155)]);if(_0x5a3d8a){const _0xc67159=_0x3c2849(_0x5a3d8a);return _0xc67159?_0xc67159+'/'+_0x3cb6e9[_0x65602f(0x15c)]:_0x3cb6e9['name'];}}return _0x3cb6e9[_0x65602f(0x15c)];}for(const _0x35307e of _0x5adf02){const _0x25967e=_0x3c2849(_0x35307e);_0x445e15[_0x440dba(0x157)](_0x25967e,_0x35307e['id']);}return _0x445e15;}export function buildFolderMaps(_0x322764){const _0x3261b5=a156_0x4ace,_0x5ed5f6=buildFolderIdToPathMap(_0x322764),_0x53fcc5=new Map();for(const [_0x32acb1,_0xb9e9fb]of _0x5ed5f6){_0x53fcc5[_0x3261b5(0x157)](_0xb9e9fb,_0x32acb1);}return{'idToPath':_0x5ed5f6,'pathToId':_0x53fcc5};}export function getFolderPath(_0xcd913f,_0x36b530){const _0x415c66=a156_0x4ace;if(!_0xcd913f)return'';return _0x36b530[_0x415c66(0x156)](_0xcd913f)??'';}
1
+ (function(_0x58a30f,_0x51b15f){const _0x3a5b51=a156_0x3d57,_0x46c392=_0x58a30f();while(!![]){try{const _0x5f2bc4=parseInt(_0x3a5b51(0x1ce))/0x1+parseInt(_0x3a5b51(0x1cd))/0x2+parseInt(_0x3a5b51(0x1d8))/0x3*(parseInt(_0x3a5b51(0x1d6))/0x4)+parseInt(_0x3a5b51(0x1c9))/0x5+-parseInt(_0x3a5b51(0x1ca))/0x6*(parseInt(_0x3a5b51(0x1d2))/0x7)+parseInt(_0x3a5b51(0x1d4))/0x8*(-parseInt(_0x3a5b51(0x1cc))/0x9)+-parseInt(_0x3a5b51(0x1d1))/0xa*(parseInt(_0x3a5b51(0x1cf))/0xb);if(_0x5f2bc4===_0x51b15f)break;else _0x46c392['push'](_0x46c392['shift']());}catch(_0x2d5df9){_0x46c392['push'](_0x46c392['shift']());}}}(a156_0x527e,0x56382));function a156_0x3d57(_0x5614e8,_0x1654d8){_0x5614e8=_0x5614e8-0x1c8;const _0x527e9d=a156_0x527e();let _0x3d57ef=_0x527e9d[_0x5614e8];return _0x3d57ef;}export function buildFolderIdToPathMap(_0x3d50ef){const _0x54507b=a156_0x3d57,_0x2b9ecd=new Map(),_0x5f01be=new Map();for(const _0x16be37 of _0x3d50ef){_0x5f01be[_0x54507b(0x1cb)](_0x16be37['id'],_0x16be37);}const _0x2009cb=new Set();for(const _0x4ba539 of _0x3d50ef){!_0x4ba539['parentFolderId']&&_0x2009cb['add'](_0x4ba539['id']);}function _0x390477(_0x12e5f0){const _0x3ffbf5=_0x54507b;if(_0x2b9ecd['has'](_0x12e5f0['id']))return _0x2b9ecd[_0x3ffbf5(0x1d3)](_0x12e5f0['id']);if(_0x2009cb[_0x3ffbf5(0x1d0)](_0x12e5f0['id']))return _0x2b9ecd[_0x3ffbf5(0x1cb)](_0x12e5f0['id'],''),'';if(_0x12e5f0['parentFolderId']){const _0x3dae76=_0x5f01be[_0x3ffbf5(0x1d3)](_0x12e5f0['parentFolderId']);if(_0x3dae76){const _0x42ceb5=_0x390477(_0x3dae76),_0x2a028a=_0x42ceb5?_0x42ceb5+'/'+_0x12e5f0[_0x3ffbf5(0x1d5)]:_0x12e5f0[_0x3ffbf5(0x1d5)];return _0x2b9ecd['set'](_0x12e5f0['id'],_0x2a028a),_0x2a028a;}}const _0x29d859=_0x12e5f0[_0x3ffbf5(0x1d5)];return _0x2b9ecd[_0x3ffbf5(0x1cb)](_0x12e5f0['id'],_0x29d859),_0x29d859;}for(const _0x5cae1b of _0x3d50ef){_0x390477(_0x5cae1b);}return _0x2b9ecd;}export function buildFolderPathToIdMap(_0x37b55c){const _0x480b8a=a156_0x3d57,_0x5b6307=new Map(),_0x2c747b=new Map();for(const _0x417b45 of _0x37b55c){_0x2c747b[_0x480b8a(0x1cb)](_0x417b45['id'],_0x417b45);}const _0x50e054=new Set();for(const _0x5e8057 of _0x37b55c){!_0x5e8057['parentFolderId']&&_0x50e054[_0x480b8a(0x1c8)](_0x5e8057['id']);}function _0x57de2b(_0x4c7f3c){const _0x423f9a=_0x480b8a;if(_0x50e054['has'](_0x4c7f3c['id']))return'';if(_0x4c7f3c[_0x423f9a(0x1d7)]){const _0xd654e7=_0x2c747b[_0x423f9a(0x1d3)](_0x4c7f3c[_0x423f9a(0x1d7)]);if(_0xd654e7){const _0xf2bf4b=_0x57de2b(_0xd654e7);return _0xf2bf4b?_0xf2bf4b+'/'+_0x4c7f3c['name']:_0x4c7f3c[_0x423f9a(0x1d5)];}}return _0x4c7f3c[_0x423f9a(0x1d5)];}for(const _0xea80b1 of _0x37b55c){const _0x52d5d3=_0x57de2b(_0xea80b1);_0x5b6307[_0x480b8a(0x1cb)](_0x52d5d3,_0xea80b1['id']);}return _0x5b6307;}export function buildFolderMaps(_0x2d0b77){const _0x1047ad=buildFolderIdToPathMap(_0x2d0b77),_0x47b7ed=new Map();for(const [_0x135683,_0x582a3e]of _0x1047ad){_0x47b7ed['set'](_0x582a3e,_0x135683);}return{'idToPath':_0x1047ad,'pathToId':_0x47b7ed};}function a156_0x527e(){const _0x1f1a27=['get','12656puDUSj','name','12YzscGM','parentFolderId','689499WRaBLr','add','2586400sfqcFZ','36bgmmRr','set','2286mfGyCr','434574ZTQUaP','701417NXvGId','11jXosLG','has','13030130wfnlGv','78736ZDTtih'];a156_0x527e=function(){return _0x1f1a27;};return a156_0x527e();}export function getFolderPath(_0x307144,_0x5d5e59){if(!_0x307144)return'';return _0x5d5e59['get'](_0x307144)??'';}
@@ -1 +1 @@
1
- (function(_0x450de2,_0x7ae52d){const _0x1540b9=a157_0x30bb,_0x1c1b8b=_0x450de2();while(!![]){try{const _0x5e26bd=-parseInt(_0x1540b9(0xa5))/0x1*(parseInt(_0x1540b9(0x81))/0x2)+parseInt(_0x1540b9(0x8b))/0x3+-parseInt(_0x1540b9(0x8e))/0x4+parseInt(_0x1540b9(0xa6))/0x5+parseInt(_0x1540b9(0x8d))/0x6*(-parseInt(_0x1540b9(0x80))/0x7)+parseInt(_0x1540b9(0xa0))/0x8*(-parseInt(_0x1540b9(0x90))/0x9)+parseInt(_0x1540b9(0x83))/0xa;if(_0x5e26bd===_0x7ae52d)break;else _0x1c1b8b['push'](_0x1c1b8b['shift']());}catch(_0x192da8){_0x1c1b8b['push'](_0x1c1b8b['shift']());}}}(a157_0x1c77,0x6595e));import a157_0x5a34de from'path';import{parse as a157_0x46dc91}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x56e29a){const _0x1937c5=a157_0x30bb;if(!_0x56e29a||_0x56e29a[_0x1937c5(0x9d)]()==='')throw new Error(_0x1937c5(0x84));const _0x16af86=_0x56e29a[_0x1937c5(0x9d)]();if(_0x16af86==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x56e29a};const _0x2906ae=_0x16af86[_0x1937c5(0xa2)]('/')?_0x16af86['substring'](0x1):_0x16af86,_0x30ddd7=_0x2906ae[_0x1937c5(0x7c)]('/')[_0x1937c5(0x96)](_0x3d73dc=>_0x3d73dc!=='');if(_0x30ddd7[_0x1937c5(0x95)]===0x0)throw new Error(_0x1937c5(0xa3));const _0x2d8643=_0x16af86[_0x1937c5(0xa2)]('/')||!isRelativePathSegment(_0x30ddd7[0x0]);for(const _0x569f17 of _0x30ddd7){validatePathSegment(_0x569f17);}return{'segments':_0x30ddd7,'isAbsolute':_0x2d8643,'raw':_0x56e29a};}function isRelativePathSegment(_0x5dd6b6){return _0x5dd6b6==='.'||_0x5dd6b6==='..';}function validatePathSegment(_0x5baae6){const _0x3098c0=a157_0x30bb;if(_0x5baae6==='')throw new Error(_0x3098c0(0x8c));if(_0x5baae6==='.'||_0x5baae6==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x5baae6))throw new Error(_0x3098c0(0x7d)+_0x5baae6);if(_0x5baae6!==_0x5baae6[_0x3098c0(0x9d)]()){}}export function validatePath(_0x2540a2){const _0x24e983=a157_0x30bb;if(_0x2540a2[_0x24e983(0x97)]['length']===0x0&&!_0x2540a2[_0x24e983(0x87)])throw new Error(_0x24e983(0xa1));if(_0x2540a2[_0x24e983(0x87)]){if(_0x2540a2[_0x24e983(0x97)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x4351ac=0x0;for(const _0x2599b7 of _0x2540a2[_0x24e983(0x97)]){if(_0x2599b7==='..'){if(_0x4351ac===0x0)throw new Error(_0x24e983(0x9e));_0x4351ac--;}else _0x2599b7!=='.'&&_0x4351ac++;}}}export function joinPaths(_0x95a221,_0x3b5e9f){const _0x367202=a157_0x30bb;if(!_0x95a221||_0x95a221==='/')return _0x3b5e9f;if(!_0x3b5e9f||_0x3b5e9f==='.')return _0x95a221;if(_0x3b5e9f[_0x367202(0xa2)]('/'))return _0x3b5e9f;const _0x4d49e5=parsePath(_0x95a221),_0x4763e2=parsePath(_0x3b5e9f),_0x24504e=[..._0x4d49e5[_0x367202(0x97)]];for(const _0x253e7f of _0x4763e2[_0x367202(0x97)]){if(_0x253e7f==='.')continue;else{if(_0x253e7f==='..'){if(_0x24504e[_0x367202(0x95)]===0x0)throw new Error(_0x367202(0x89));_0x24504e['pop']();}else _0x24504e['push'](_0x253e7f);}}const _0x2c63eb=_0x24504e['join']('/');return _0x4d49e5[_0x367202(0x93)]['startsWith']('/')?'/'+_0x2c63eb:_0x2c63eb;}export function normalizePath(_0x312fd1){const _0x384d3b=a157_0x30bb,_0x21f2bd=parsePath(_0x312fd1),_0x56009f=[];for(const _0x35fe38 of _0x21f2bd[_0x384d3b(0x97)]){if(_0x35fe38==='.')continue;else{if(_0x35fe38==='..'){if(_0x56009f[_0x384d3b(0x95)]===0x0){if(_0x21f2bd[_0x384d3b(0x87)])throw new Error(_0x384d3b(0x89));_0x56009f[_0x384d3b(0xa4)]('..');}else _0x56009f[_0x56009f[_0x384d3b(0x95)]-0x1]==='..'?_0x56009f[_0x384d3b(0xa4)]('..'):_0x56009f[_0x384d3b(0x9c)]();}else _0x56009f[_0x384d3b(0xa4)](_0x35fe38);}}if(_0x56009f[_0x384d3b(0x95)]===0x0)return _0x21f2bd['isAbsolute']?'/':'.';const _0x39f467=_0x56009f[_0x384d3b(0x86)]('/');return _0x21f2bd['raw']['startsWith']('/')?'/'+_0x39f467:_0x39f467;}export function getParentPath(_0x1e0147){const _0x20388b=a157_0x30bb,_0x846718=parsePath(_0x1e0147);if(_0x846718[_0x20388b(0x97)][_0x20388b(0x95)]<=0x1)return'/';const _0x284783=_0x846718[_0x20388b(0x97)]['slice'](0x0,-0x1)[_0x20388b(0x86)]('/');return _0x846718[_0x20388b(0x93)]['startsWith']('/')?'/'+_0x284783:_0x284783;}function a157_0x1c77(){const _0x57c1ed=['journey','No\x20tdx.json\x20found\x20for\x20file:\x20','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','split','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','readFile','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','217UHxgps','298FRimEx','type','17810430GYPKWI','Path\x20cannot\x20be\x20empty','parent_segment','join','isAbsolute','root','Cannot\x20navigate\x20above\x20root','exists','1274040HYCaiz','Path\x20segment\x20cannot\x20be\x20empty','100014JLsUfJ','2858476IrRrDu','.yaml','18clPRXK','.yml','slice','raw','dirname','length','filter','segments','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','resolve','parse','name','pop','trim','Path\x20attempts\x20to\x20navigate\x20above\x20root','endsWith','970544iZuqNb','Relative\x20path\x20cannot\x20be\x20empty','startsWith','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','push','2885vQImLs','571150MkqfgN','relative'];a157_0x1c77=function(){return _0x57c1ed;};return a157_0x1c77();}function a157_0x30bb(_0x290595,_0x4ab967){_0x290595=_0x290595-0x79;const _0x1c77b4=a157_0x1c77();let _0x30bba9=_0x1c77b4[_0x290595];return _0x30bba9;}export function getBaseName(_0x27b313){const _0x403176=a157_0x30bb,_0x345917=parsePath(_0x27b313);return _0x345917[_0x403176(0x97)][_0x345917[_0x403176(0x97)][_0x403176(0x95)]-0x1]||'';}export function isChildPath(_0x224f90,_0x2de1bd){const _0x343f5f=a157_0x30bb,_0x576922=parsePath(_0x224f90),_0x1a26dc=parsePath(_0x2de1bd);if(_0x576922[_0x343f5f(0x97)][_0x343f5f(0x95)]<=_0x1a26dc[_0x343f5f(0x97)]['length'])return![];for(let _0x57c6d1=0x0;_0x57c6d1<_0x1a26dc[_0x343f5f(0x97)][_0x343f5f(0x95)];_0x57c6d1++){if(_0x576922[_0x343f5f(0x97)][_0x57c6d1]!==_0x1a26dc[_0x343f5f(0x97)][_0x57c6d1])return![];}return!![];}export function splitPath(_0x34d174){const _0x3a1c50=a157_0x30bb,_0x548ebc=parsePath(_0x34d174);if(_0x548ebc[_0x3a1c50(0x97)][_0x3a1c50(0x95)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x548ebc[_0x3a1c50(0x97)][_0x3a1c50(0x95)]===0x1)return{'parent':_0x548ebc[_0x3a1c50(0x97)][0x0]};return{'parent':_0x548ebc['segments'][0x0],'child':_0x548ebc['segments'][_0x3a1c50(0x92)](0x1)[_0x3a1c50(0x86)]('/')};}export function isYamlFilePath(_0x3f118a){const _0x56145c=a157_0x30bb;return _0x3f118a[_0x56145c(0x9f)](_0x56145c(0x91))||_0x3f118a['endsWith'](_0x56145c(0x8f));}export async function resolveYamlFilePath(_0x17b624,_0x2d0a58=nodeFileSystem){const _0x41fff6=a157_0x30bb,_0x4ec227=a157_0x5a34de[_0x41fff6(0x99)](_0x17b624);if(!await _0x2d0a58[_0x41fff6(0x8a)](_0x4ec227))throw new Error('File\x20not\x20found:\x20'+_0x17b624);let _0x3d59be=a157_0x5a34de[_0x41fff6(0x94)](_0x4ec227),_0x978643=null,_0x4cd704=null;const _0x1e9756=a157_0x5a34de[_0x41fff6(0x9a)](_0x3d59be)[_0x41fff6(0x88)];while(_0x3d59be!==_0x1e9756){const _0x30eb73=a157_0x5a34de[_0x41fff6(0x86)](_0x3d59be,'tdx.json');if(await _0x2d0a58[_0x41fff6(0x8a)](_0x30eb73)){_0x978643=_0x30eb73,_0x4cd704=_0x3d59be;break;}_0x3d59be=a157_0x5a34de[_0x41fff6(0x94)](_0x3d59be);}if(!_0x978643||!_0x4cd704)throw new Error(_0x41fff6(0x7a)+_0x17b624+'\x0a'+_0x41fff6(0x7f));const _0x5c0341=await _0x2d0a58[_0x41fff6(0x7e)](_0x978643),_0x316250=JSON[_0x41fff6(0x9a)](_0x5c0341),_0x21d243=_0x316250[_0x41fff6(0x85)];if(!_0x21d243)throw new Error(_0x41fff6(0x7b));const _0x4c5cd3=await _0x2d0a58[_0x41fff6(0x7e)](_0x4ec227),_0x3deaa7=a157_0x46dc91(_0x4c5cd3),_0x2e573b=_0x3deaa7[_0x41fff6(0x9b)];if(!_0x2e573b)throw new Error(_0x41fff6(0x98)+_0x17b624);const _0xb95af9=_0x3deaa7[_0x41fff6(0x82)]===_0x41fff6(0x79)?'journey':'segment',_0x2d91f3=a157_0x5a34de[_0x41fff6(0xa7)](_0x4cd704,_0x4ec227),_0x128257=a157_0x5a34de['dirname'](_0x2d91f3),_0x3a6b84=_0x128257==='.'?'':_0x128257['replace'](/\\/g,'/'),_0x4fdd9b=_0x3a6b84?_0x21d243+'/'+_0x3a6b84+'/'+_0x2e573b:_0x21d243+'/'+_0x2e573b;return{'parentSegment':_0x21d243,'segmentName':_0x2e573b,'folderPath':_0x3a6b84,'fullPath':_0x4fdd9b,'resourceType':_0xb95af9,'content':_0x4c5cd3};}
1
+ (function(_0x23da72,_0xdbcf7){const _0x4615a1=a157_0x4392,_0x42b0fe=_0x23da72();while(!![]){try{const _0x21a9d2=-parseInt(_0x4615a1(0x117))/0x1+-parseInt(_0x4615a1(0xfc))/0x2*(parseInt(_0x4615a1(0x113))/0x3)+parseInt(_0x4615a1(0xf9))/0x4*(parseInt(_0x4615a1(0x119))/0x5)+parseInt(_0x4615a1(0xee))/0x6*(parseInt(_0x4615a1(0x11c))/0x7)+parseInt(_0x4615a1(0xf7))/0x8*(parseInt(_0x4615a1(0xf8))/0x9)+-parseInt(_0x4615a1(0x104))/0xa*(parseInt(_0x4615a1(0x114))/0xb)+parseInt(_0x4615a1(0xfb))/0xc;if(_0x21a9d2===_0xdbcf7)break;else _0x42b0fe['push'](_0x42b0fe['shift']());}catch(_0x1a3585){_0x42b0fe['push'](_0x42b0fe['shift']());}}}(a157_0x256f,0xb8db8));import a157_0x2fa0f8 from'path';function a157_0x256f(){const _0x21584e=['2055450dtWxvW','tdx.json','pop','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Path\x20cannot\x20be\x20empty','Path\x20segment\x20cannot\x20be\x20empty','readFile','length','.yml','push','exists','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','type','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','10794HLvJhl','55QCDOzz','substring','Relative\x20path\x20cannot\x20be\x20empty','1335343yqTyCs','journey','335zquEDT','startsWith','endsWith','20657aOipne','test','dirname','2886KMcQqG','raw','slice','relative','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','isAbsolute','Cannot\x20split\x20empty\x20path','parent_segment','trim','8njhrjP','7235172bizgMG','70744rAKutM','join','2069844ziXqgz','256jraohT','parse','name','segments','segment','.yaml','File\x20not\x20found:\x20','resolve'];a157_0x256f=function(){return _0x21584e;};return a157_0x256f();}import{parse as a157_0x55e13e}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x4d357c){const _0x74c50e=a157_0x4392;if(!_0x4d357c||_0x4d357c['trim']()==='')throw new Error(_0x74c50e(0x109));const _0x1fd046=_0x4d357c['trim']();if(_0x1fd046==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x4d357c};const _0x541bf0=_0x1fd046[_0x74c50e(0x11a)]('/')?_0x1fd046[_0x74c50e(0x115)](0x1):_0x1fd046,_0x505f4d=_0x541bf0['split']('/')['filter'](_0x15fdd0=>_0x15fdd0!=='');if(_0x505f4d[_0x74c50e(0x10c)]===0x0)throw new Error(_0x74c50e(0xf2));const _0x16430f=_0x1fd046['startsWith']('/')||!isRelativePathSegment(_0x505f4d[0x0]);for(const _0x577102 of _0x505f4d){validatePathSegment(_0x577102);}return{'segments':_0x505f4d,'isAbsolute':_0x16430f,'raw':_0x4d357c};}function isRelativePathSegment(_0x441325){return _0x441325==='.'||_0x441325==='..';}function validatePathSegment(_0xa63344){const _0x44a624=a157_0x4392;if(_0xa63344==='')throw new Error(_0x44a624(0x10a));if(_0xa63344==='.'||_0xa63344==='..')return;if(/[\x00-\x1F\x7F]/[_0x44a624(0x11d)](_0xa63344))throw new Error(_0x44a624(0x108)+_0xa63344);if(_0xa63344!==_0xa63344[_0x44a624(0xf6)]()){}}export function validatePath(_0x33e228){const _0x5dce1a=a157_0x4392;if(_0x33e228[_0x5dce1a(0xff)]['length']===0x0&&!_0x33e228[_0x5dce1a(0xf3)])throw new Error(_0x5dce1a(0x116));if(_0x33e228[_0x5dce1a(0xf3)]){if(_0x33e228[_0x5dce1a(0xff)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x43c265=0x0;for(const _0x109ade of _0x33e228[_0x5dce1a(0xff)]){if(_0x109ade==='..'){if(_0x43c265===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x43c265--;}else _0x109ade!=='.'&&_0x43c265++;}}}export function joinPaths(_0x6c1b04,_0x392f6a){const _0x195001=a157_0x4392;if(!_0x6c1b04||_0x6c1b04==='/')return _0x392f6a;if(!_0x392f6a||_0x392f6a==='.')return _0x6c1b04;if(_0x392f6a[_0x195001(0x11a)]('/'))return _0x392f6a;const _0x41417d=parsePath(_0x6c1b04),_0x1c8490=parsePath(_0x392f6a),_0x8d19b7=[..._0x41417d[_0x195001(0xff)]];for(const _0x4bd76d of _0x1c8490[_0x195001(0xff)]){if(_0x4bd76d==='.')continue;else{if(_0x4bd76d==='..'){if(_0x8d19b7[_0x195001(0x10c)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x8d19b7[_0x195001(0x106)]();}else _0x8d19b7['push'](_0x4bd76d);}}const _0x5570c0=_0x8d19b7['join']('/');return _0x41417d[_0x195001(0xef)][_0x195001(0x11a)]('/')?'/'+_0x5570c0:_0x5570c0;}export function normalizePath(_0x265a62){const _0x1fe55b=a157_0x4392,_0xdb21e0=parsePath(_0x265a62),_0x51f6ac=[];for(const _0x3e3c7f of _0xdb21e0[_0x1fe55b(0xff)]){if(_0x3e3c7f==='.')continue;else{if(_0x3e3c7f==='..'){if(_0x51f6ac[_0x1fe55b(0x10c)]===0x0){if(_0xdb21e0[_0x1fe55b(0xf3)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x51f6ac[_0x1fe55b(0x10e)]('..');}else _0x51f6ac[_0x51f6ac[_0x1fe55b(0x10c)]-0x1]==='..'?_0x51f6ac[_0x1fe55b(0x10e)]('..'):_0x51f6ac[_0x1fe55b(0x106)]();}else _0x51f6ac[_0x1fe55b(0x10e)](_0x3e3c7f);}}if(_0x51f6ac[_0x1fe55b(0x10c)]===0x0)return _0xdb21e0[_0x1fe55b(0xf3)]?'/':'.';const _0x1db077=_0x51f6ac['join']('/');return _0xdb21e0['raw']['startsWith']('/')?'/'+_0x1db077:_0x1db077;}export function getParentPath(_0x4c75cb){const _0x565509=a157_0x4392,_0x1c00b9=parsePath(_0x4c75cb);if(_0x1c00b9[_0x565509(0xff)][_0x565509(0x10c)]<=0x1)return'/';const _0xd781be=_0x1c00b9[_0x565509(0xff)][_0x565509(0xf0)](0x0,-0x1)[_0x565509(0xfa)]('/');return _0x1c00b9['raw']['startsWith']('/')?'/'+_0xd781be:_0xd781be;}export function getBaseName(_0x55b0c8){const _0x56e0cc=a157_0x4392,_0x71dfa5=parsePath(_0x55b0c8);return _0x71dfa5[_0x56e0cc(0xff)][_0x71dfa5[_0x56e0cc(0xff)][_0x56e0cc(0x10c)]-0x1]||'';}function a157_0x4392(_0x50745e,_0x1de31e){_0x50745e=_0x50745e-0xee;const _0x256fc3=a157_0x256f();let _0x4392c6=_0x256fc3[_0x50745e];return _0x4392c6;}export function isChildPath(_0x292314,_0xea340e){const _0x3eba2b=a157_0x4392,_0xb5fecd=parsePath(_0x292314),_0x188f91=parsePath(_0xea340e);if(_0xb5fecd['segments'][_0x3eba2b(0x10c)]<=_0x188f91['segments']['length'])return![];for(let _0x467015=0x0;_0x467015<_0x188f91[_0x3eba2b(0xff)]['length'];_0x467015++){if(_0xb5fecd[_0x3eba2b(0xff)][_0x467015]!==_0x188f91['segments'][_0x467015])return![];}return!![];}export function splitPath(_0x8ce8b5){const _0x4673c0=a157_0x4392,_0x16fe4e=parsePath(_0x8ce8b5);if(_0x16fe4e[_0x4673c0(0xff)][_0x4673c0(0x10c)]===0x0)throw new Error(_0x4673c0(0xf4));if(_0x16fe4e[_0x4673c0(0xff)][_0x4673c0(0x10c)]===0x1)return{'parent':_0x16fe4e[_0x4673c0(0xff)][0x0]};return{'parent':_0x16fe4e[_0x4673c0(0xff)][0x0],'child':_0x16fe4e[_0x4673c0(0xff)][_0x4673c0(0xf0)](0x1)[_0x4673c0(0xfa)]('/')};}export function isYamlFilePath(_0x344b41){const _0x2b2657=a157_0x4392;return _0x344b41[_0x2b2657(0x11b)](_0x2b2657(0x10d))||_0x344b41[_0x2b2657(0x11b)](_0x2b2657(0x101));}export async function resolveYamlFilePath(_0x50dd89,_0x395aea=nodeFileSystem){const _0x3db4f2=a157_0x4392,_0x462c14=a157_0x2fa0f8[_0x3db4f2(0x103)](_0x50dd89);if(!await _0x395aea[_0x3db4f2(0x10f)](_0x462c14))throw new Error(_0x3db4f2(0x102)+_0x50dd89);let _0x2c1cec=a157_0x2fa0f8[_0x3db4f2(0x11e)](_0x462c14),_0xe0729d=null,_0x1e6258=null;const _0x43b8a5=a157_0x2fa0f8[_0x3db4f2(0xfd)](_0x2c1cec)['root'];while(_0x2c1cec!==_0x43b8a5){const _0x2478c5=a157_0x2fa0f8['join'](_0x2c1cec,_0x3db4f2(0x105));if(await _0x395aea[_0x3db4f2(0x10f)](_0x2478c5)){_0xe0729d=_0x2478c5,_0x1e6258=_0x2c1cec;break;}_0x2c1cec=a157_0x2fa0f8[_0x3db4f2(0x11e)](_0x2c1cec);}if(!_0xe0729d||!_0x1e6258)throw new Error(_0x3db4f2(0x107)+_0x50dd89+'\x0a'+_0x3db4f2(0x110));const _0x5d7ede=await _0x395aea[_0x3db4f2(0x10b)](_0xe0729d),_0x293e65=JSON[_0x3db4f2(0xfd)](_0x5d7ede),_0x104721=_0x293e65[_0x3db4f2(0xf5)];if(!_0x104721)throw new Error(_0x3db4f2(0x112));const _0x1ed21e=await _0x395aea[_0x3db4f2(0x10b)](_0x462c14),_0x25ebfa=a157_0x55e13e(_0x1ed21e),_0x15c906=_0x25ebfa[_0x3db4f2(0xfe)];if(!_0x15c906)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x50dd89);const _0x5b0e0f=_0x25ebfa[_0x3db4f2(0x111)]===_0x3db4f2(0x118)?_0x3db4f2(0x118):_0x3db4f2(0x100),_0x4fef73=a157_0x2fa0f8[_0x3db4f2(0xf1)](_0x1e6258,_0x462c14),_0x119e60=a157_0x2fa0f8[_0x3db4f2(0x11e)](_0x4fef73),_0x4f7471=_0x119e60==='.'?'':_0x119e60['replace'](/\\/g,'/'),_0x109abe=_0x4f7471?_0x104721+'/'+_0x4f7471+'/'+_0x15c906:_0x104721+'/'+_0x15c906;return{'parentSegment':_0x104721,'segmentName':_0x15c906,'folderPath':_0x4f7471,'fullPath':_0x109abe,'resourceType':_0x5b0e0f,'content':_0x1ed21e};}
@@ -1 +1 @@
1
- function a158_0x2975(_0xd07025,_0x25ea84){_0xd07025=_0xd07025-0x169;const _0x48099b=a158_0x4809();let _0x29752f=_0x48099b[_0xd07025];return _0x29752f;}(function(_0x20a3bd,_0x55a740){const _0x536332=a158_0x2975,_0x3a8bfa=_0x20a3bd();while(!![]){try{const _0x1810d2=parseInt(_0x536332(0x16c))/0x1+parseInt(_0x536332(0x16b))/0x2+parseInt(_0x536332(0x170))/0x3*(-parseInt(_0x536332(0x176))/0x4)+parseInt(_0x536332(0x171))/0x5+-parseInt(_0x536332(0x16a))/0x6*(-parseInt(_0x536332(0x16e))/0x7)+-parseInt(_0x536332(0x16f))/0x8+-parseInt(_0x536332(0x16d))/0x9;if(_0x1810d2===_0x55a740)break;else _0x3a8bfa['push'](_0x3a8bfa['shift']());}catch(_0x1036be){_0x3a8bfa['push'](_0x3a8bfa['shift']());}}}(a158_0x4809,0xe58b2));export function parseSegmentRef(_0x2f7817){const _0x45a5e7=a158_0x2975,_0x467777=_0x2f7817[_0x45a5e7(0x169)]('/');if(_0x467777===-0x1)return{'parentId':_0x2f7817};if(_0x467777===0x0)throw new Error(_0x45a5e7(0x173)+_0x2f7817+_0x45a5e7(0x175));const _0x59b449=_0x2f7817[_0x45a5e7(0x174)](0x0,_0x467777),_0x46bb54=_0x2f7817[_0x45a5e7(0x174)](_0x467777+0x1);if(_0x46bb54==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2f7817+_0x45a5e7(0x172));return{'parentId':_0x59b449,'childId':_0x46bb54};}function a158_0x4809(){const _0x167241=['1217658KYMbAj','1571498GeVmVm','1272841VQmNIK','4681719fTCKqD','14hGaERI','3265896sYbLWz','2361QckvpR','2529810wuUBGS','.\x20Child\x20name\x20cannot\x20be\x20empty','Invalid\x20segment\x20reference\x20format:\x20','substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','5600UjSfOu','indexOf'];a158_0x4809=function(){return _0x167241;};return a158_0x4809();}
1
+ function a158_0x5c35(){const _0x54044d=['50060eZpejO','89748ifxRlh','substring','369TqCdjs','indexOf','303976DeTGmS','2503584BTpTpk','1865ZSpZqn','7QbCBOo','252738bIQBGi','673112xGOews','2396Xtfthe'];a158_0x5c35=function(){return _0x54044d;};return a158_0x5c35();}function a158_0x1b5f(_0x194b40,_0x5d9fc6){_0x194b40=_0x194b40-0x108;const _0x5c3597=a158_0x5c35();let _0x1b5fe8=_0x5c3597[_0x194b40];return _0x1b5fe8;}(function(_0x598ea1,_0x37d871){const _0x1db84a=a158_0x1b5f,_0x3784fd=_0x598ea1();while(!![]){try{const _0x2e712f=-parseInt(_0x1db84a(0x112))/0x1+parseInt(_0x1db84a(0x10a))/0x2+-parseInt(_0x1db84a(0x10e))/0x3+parseInt(_0x1db84a(0x10c))/0x4*(-parseInt(_0x1db84a(0x108))/0x5)+parseInt(_0x1db84a(0x113))/0x6+-parseInt(_0x1db84a(0x109))/0x7*(-parseInt(_0x1db84a(0x10b))/0x8)+parseInt(_0x1db84a(0x110))/0x9*(parseInt(_0x1db84a(0x10d))/0xa);if(_0x2e712f===_0x37d871)break;else _0x3784fd['push'](_0x3784fd['shift']());}catch(_0x1cc486){_0x3784fd['push'](_0x3784fd['shift']());}}}(a158_0x5c35,0x434f3));export function parseSegmentRef(_0x4e1b1f){const _0x4936bc=a158_0x1b5f,_0x3b3921=_0x4e1b1f[_0x4936bc(0x111)]('/');if(_0x3b3921===-0x1)return{'parentId':_0x4e1b1f};if(_0x3b3921===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x4e1b1f+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x496a9b=_0x4e1b1f[_0x4936bc(0x10f)](0x0,_0x3b3921),_0x1dea28=_0x4e1b1f[_0x4936bc(0x10f)](_0x3b3921+0x1);if(_0x1dea28==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x4e1b1f+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x496a9b,'childId':_0x1dea28};}
@@ -1 +1 @@
1
- (function(_0xa830b5,_0x172956){const _0x8cb099=a159_0x2e7c,_0x4ddd67=_0xa830b5();while(!![]){try{const _0x3831bf=-parseInt(_0x8cb099(0x1c9))/0x1*(parseInt(_0x8cb099(0x1e3))/0x2)+parseInt(_0x8cb099(0x1cf))/0x3*(parseInt(_0x8cb099(0x1d0))/0x4)+-parseInt(_0x8cb099(0x1e0))/0x5*(-parseInt(_0x8cb099(0x1fb))/0x6)+-parseInt(_0x8cb099(0x1ca))/0x7*(-parseInt(_0x8cb099(0x1c0))/0x8)+parseInt(_0x8cb099(0x1b8))/0x9+-parseInt(_0x8cb099(0x1cb))/0xa*(parseInt(_0x8cb099(0x1f2))/0xb)+-parseInt(_0x8cb099(0x1d3))/0xc*(parseInt(_0x8cb099(0x1fd))/0xd);if(_0x3831bf===_0x172956)break;else _0x4ddd67['push'](_0x4ddd67['shift']());}catch(_0x40780f){_0x4ddd67['push'](_0x4ddd67['shift']());}}}(a159_0x4215,0x8b192));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x4f280d,_0x555bec={},_0x3c6cbc={}){const _0x43030a=a159_0x2e7c;if(_0x3c6cbc['skipSchema'])return runSemanticChecks(_0x4f280d,_0x555bec);const _0x240553=SegmentDefSchema['safeParse'](_0x4f280d);if(_0x240553[_0x43030a(0x1d2)])return runSemanticChecks(_0x240553['data'],_0x555bec);return zodErrorsToValidationResult(_0x240553[_0x43030a(0x1ef)],_0x555bec);}export function validateRuleDef(_0x4e3dde,_0x4df985,_0x527436){const _0x2119db=a159_0x2e7c;if(!_0x4e3dde)return[];const _0x2cc676=RuleDefSchema[_0x2119db(0x1dd)](_0x4e3dde);if(_0x2cc676[_0x2119db(0x1d2)])return checkRule(_0x2cc676[_0x2119db(0x1f8)],_0x4df985,_0x527436);const _0x360a6c=flattenZodIssues(_0x2cc676[_0x2119db(0x1ef)][_0x2119db(0x1cc)]);return _0x360a6c[_0x2119db(0x1be)](_0x54ae53=>{const _0x352da5=_0x2119db,_0x443d2b=formatZodPath(_0x54ae53[_0x352da5(0x1e4)]),_0x34c161=_0x443d2b?_0x4df985+'.'+_0x443d2b:_0x4df985,_0x495f64=mapZodIssueToCode(_0x54ae53,_0x443d2b),_0x507506=getLocationFromPath(_0x527436[_0x352da5(0x200)],_0x527436['source'],pathToArray(_0x34c161));return{'level':_0x352da5(0x1ef),'path':_0x34c161,'code':_0x495f64,'message':_0x54ae53[_0x352da5(0x1e7)],..._0x507506&&{'location':_0x507506}};});}function zodErrorsToValidationResult(_0x3c8869,_0x7ab39d){const _0x3ecf11=a159_0x2e7c,_0x13b979=flattenZodIssues(_0x3c8869[_0x3ecf11(0x1cc)]),_0x16cc59=_0x13b979['map'](_0x15b7f1=>{const _0x4e1382=_0x3ecf11,_0x33daf8=formatZodPath(_0x15b7f1[_0x4e1382(0x1e4)]),_0x2244db=mapZodIssueToCode(_0x15b7f1,_0x33daf8),_0x27f161=getLocationFromPath(_0x7ab39d[_0x4e1382(0x200)],_0x7ab39d[_0x4e1382(0x203)],_0x15b7f1[_0x4e1382(0x1e4)][_0x4e1382(0x1be)](_0x2cb97c=>typeof _0x2cb97c==='symbol'?String(_0x2cb97c):_0x2cb97c));return{'level':_0x4e1382(0x1ef),'path':_0x33daf8,'code':_0x2244db,'message':_0x15b7f1['message'],..._0x27f161&&{'location':_0x27f161}};});return{'valid':![],'errors':_0x16cc59,'warnings':[]};}function a159_0x2e7c(_0x12e436,_0x5b19f0){_0x12e436=_0x12e436-0x1b6;const _0x4215be=a159_0x4215();let _0x2e7c24=_0x4215be[_0x12e436];return _0x2e7c24;}function mapZodIssueToCode(_0x218ea6,_0x48ad6a){const _0x27198d=a159_0x2e7c,_0x19957b=_0x218ea6['code']==='custom'?_0x218ea6[_0x27198d(0x1f9)]:undefined;if(_0x48ad6a===_0x27198d(0x1fc))return _0x27198d(0x1d7);if(_0x48ad6a===_0x27198d(0x1b6)||_0x48ad6a['endsWith'](_0x27198d(0x1fa))){if(_0x218ea6[_0x27198d(0x1d9)]===_0x27198d(0x1e6)){if(_0x48ad6a===_0x27198d(0x1b6)||_0x48ad6a['match'](/\.conditions\[\d+\]\.type$/))return _0x27198d(0x1d8);}}if(_0x48ad6a[_0x27198d(0x1cd)]('.operator.type'))return _0x27198d(0x1e2);if(_0x48ad6a['endsWith'](_0x27198d(0x1f0)))return _0x27198d(0x1c8);if(_0x19957b?.[_0x27198d(0x1c3)]===_0x27198d(0x1fe))return _0x27198d(0x1fe);if(_0x19957b?.[_0x27198d(0x1c3)]===_0x27198d(0x1c4))return _0x27198d(0x1c4);if(_0x48ad6a[_0x27198d(0x1cd)](_0x27198d(0x1c7))||_0x48ad6a===_0x27198d(0x1c6))return _0x27198d(0x1ce);if(_0x48ad6a[_0x27198d(0x1d1)](_0x27198d(0x1c5)))return _0x27198d(0x1bb);if(_0x48ad6a[_0x27198d(0x1cd)](_0x27198d(0x1df)))return _0x27198d(0x1ba);return _0x27198d(0x1d4);}function a159_0x4215(){const _0x40624b=['filter','6448050QagSZl','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','MISSING_SEGMENT_REFERENCE','INVALID_ARRAY_MATCHING','.source','NESTED_CONDITION_GROUP','map','length','329768ohGKit','Behavior','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','validationCode','MISSING_TIME_UNIT','arrayMatching','conditions','.conditions','MISSING_OPERATOR_VALUE','288731FjTkWS','14PNhECH','3325430MuOdJm','issues','endsWith','MISSING_CONDITIONS','1707MLXZOd','6608iQinQZ','includes','success','72ZrUJCU','SEGMENT_SCHEMA_ERROR','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','rule','MISSING_NAME','INVALID_RULE_TYPE','code','push','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','safeParse','BEHAVIOR_SOURCE_MISSING_FILTER','.segment','1098065KfVfEJ','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','INVALID_OPERATOR_TYPE','4SNwpAN','path','.attribute','invalid_value','message','warning','level','\x27\x20with\x20attribute\x20\x27','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','EMPTY_ATTRIBUTE','.conditions[','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','error','.operator.value','And','11uSCimG','Attribute\x20name\x20cannot\x20be\x20empty','Composite','EMPTY_CONDITIONS','Attribute\x20\x27','description','data','params','.type','30vXCgWK','name','2940587TLnAGA','MISSING_BETWEEN_BOUNDS','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','document','type','attribute','source','rule.type'];a159_0x4215=function(){return _0x40624b;};return a159_0x4215();}function runSemanticChecks(_0x21ca15,_0x51c256){const _0x4fa871=a159_0x2e7c,_0x2eb8a8=[];_0x21ca15['rule']&&_0x2eb8a8[_0x4fa871(0x1da)](...checkRule(_0x21ca15[_0x4fa871(0x1d6)],_0x4fa871(0x1d6),_0x51c256));const _0x3ec7da=_0x2eb8a8['filter'](_0xa78cd0=>_0xa78cd0[_0x4fa871(0x1e9)]===_0x4fa871(0x1ef)),_0x428404=_0x2eb8a8[_0x4fa871(0x1b7)](_0x5d574e=>_0x5d574e[_0x4fa871(0x1e9)]===_0x4fa871(0x1e8));return{'valid':_0x3ec7da['length']===0x0,'errors':_0x3ec7da,'warnings':_0x428404};}function checkRule(_0x4496a4,_0x33e28b,_0x2aff19){const _0x4a6177=a159_0x2e7c,_0xcc638=[];if(_0x4496a4[_0x4a6177(0x1c6)][_0x4a6177(0x1bf)]===0x0)return _0xcc638['push']({'level':'error','path':_0x33e28b+_0x4a6177(0x1c7),'code':_0x4a6177(0x1f5),'message':_0x4a6177(0x1eb),'location':getLocationFromPath(_0x2aff19[_0x4a6177(0x200)],_0x2aff19['source'],pathToArray(_0x33e28b+_0x4a6177(0x1c7)))}),_0xcc638;return _0xcc638[_0x4a6177(0x1da)](...checkConditions(_0x4496a4['conditions'],_0x33e28b,_0x2aff19)),_0xcc638;}function checkConditions(_0x2c694b,_0x5105e8,_0x217799){const _0x17b674=a159_0x2e7c,_0x191b99=[];for(let _0xf11ab6=0x0;_0xf11ab6<_0x2c694b[_0x17b674(0x1bf)];_0xf11ab6++){const _0x427d9f=_0x2c694b[_0xf11ab6],_0x233900=_0x5105e8+_0x17b674(0x1ed)+_0xf11ab6+']';_0x191b99[_0x17b674(0x1da)](...checkCondition(_0x427d9f,_0x233900,_0x217799));}return _0x191b99;}function checkCondition(_0x536216,_0x596e67,_0x1720ef){const _0x39aa64=a159_0x2e7c,_0x174b52=[];if(_0x536216[_0x39aa64(0x201)]===_0x39aa64(0x1f1)||_0x536216[_0x39aa64(0x201)]==='Or'||_0x536216[_0x39aa64(0x201)]===_0x39aa64(0x1f4)){if(_0x536216['conditions'][_0x39aa64(0x1bf)]===0x0)_0x174b52[_0x39aa64(0x1da)]({'level':_0x39aa64(0x1ef),'path':_0x596e67+_0x39aa64(0x1c7),'code':_0x39aa64(0x1f5),'message':_0x536216[_0x39aa64(0x201)]+_0x39aa64(0x1dc),'location':getLocationFromPath(_0x1720ef[_0x39aa64(0x200)],_0x1720ef[_0x39aa64(0x203)],pathToArray(_0x596e67+_0x39aa64(0x1c7)))});else{const _0x2fcf6c=_0x536216[_0x39aa64(0x1f7)]!==undefined,_0x378e62=_0x536216[_0x39aa64(0x201)]===_0x39aa64(0x1f4);!_0x2fcf6c&&!_0x378e62&&_0x174b52[_0x39aa64(0x1da)]({'level':_0x39aa64(0x1e8),'path':_0x596e67,'code':_0x39aa64(0x1bd),'message':_0x536216['type']+'\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20'+_0x39aa64(0x1e1)+_0x39aa64(0x1b9),'location':getLocationFromPath(_0x1720ef[_0x39aa64(0x200)],_0x1720ef[_0x39aa64(0x203)],pathToArray(_0x596e67))}),_0x174b52['push'](...checkConditions(_0x536216[_0x39aa64(0x1c6)],_0x596e67,_0x1720ef));}return _0x174b52;}if(_0x536216[_0x39aa64(0x201)]==='Value'||_0x536216[_0x39aa64(0x201)]===_0x39aa64(0x1c1)){const _0x3d672b=_0x536216,_0x15eaa4=_0x3d672b[_0x39aa64(0x203)],_0x554c0a=_0x3d672b['aggregation'],_0x41e39c=_0x15eaa4||_0x554c0a;(!_0x3d672b[_0x39aa64(0x202)]||_0x3d672b['attribute']==='')&&(!_0x41e39c&&_0x174b52['push']({'level':_0x39aa64(0x1ef),'path':_0x596e67+'.attribute','code':_0x39aa64(0x1ec),'message':_0x39aa64(0x1f3),'location':getLocationFromPath(_0x1720ef[_0x39aa64(0x200)],_0x1720ef[_0x39aa64(0x203)],pathToArray(_0x596e67+'.attribute'))}));_0x3d672b[_0x39aa64(0x1b7)]&&_0x174b52['push'](...checkRule(_0x3d672b[_0x39aa64(0x1b7)],_0x596e67+'.filter',_0x1720ef));if(_0x3d672b[_0x39aa64(0x203)]){const _0x5b6917=_0x3d672b[_0x39aa64(0x202)]&&_0x3d672b['attribute']!=='';_0x5b6917&&!_0x3d672b[_0x39aa64(0x1b7)]&&_0x174b52[_0x39aa64(0x1da)]({'level':'error','path':_0x596e67+_0x39aa64(0x1bc),'code':_0x39aa64(0x1de),'message':'Behavior\x20source\x20\x27'+_0x3d672b[_0x39aa64(0x203)]+_0x39aa64(0x1ea)+_0x3d672b[_0x39aa64(0x202)]+'\x27\x20'+_0x39aa64(0x1db)+_0x39aa64(0x1ee)+_0x39aa64(0x1ff),'location':getLocationFromPath(_0x1720ef['document'],_0x1720ef['source'],pathToArray(_0x596e67+_0x39aa64(0x1bc)))}),_0x5b6917&&_0x3d672b['filter']&&_0x174b52[_0x39aa64(0x1da)]({'level':_0x39aa64(0x1e8),'path':_0x596e67+_0x39aa64(0x1e5),'code':_0x39aa64(0x1c2),'message':_0x39aa64(0x1f6)+_0x3d672b[_0x39aa64(0x202)]+'\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20'+_0x39aa64(0x1d5),'location':getLocationFromPath(_0x1720ef[_0x39aa64(0x200)],_0x1720ef[_0x39aa64(0x203)],pathToArray(_0x596e67+_0x39aa64(0x1e5)))});}}return _0x174b52;}
1
+ function a159_0x567a(_0x403924,_0x3c4585){_0x403924=_0x403924-0x11b;const _0x56a934=a159_0x56a9();let _0x567a07=_0x56a934[_0x403924];return _0x567a07;}function a159_0x56a9(){const _0x53f0f7=['map','\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20','document','issues','Operator\x20\x27','.segment','NESTED_CONDITION_GROUP','.conditions','MISSING_SEGMENT_REFERENCE','Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','.type','filter','push','Attribute\x20name\x20cannot\x20be\x20empty','path','17958879libKDr','.operator.type','safeParse','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','.conditions[','Value','MISSING_BETWEEN_BOUNDS','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','1873578mKfIPv','not','.operator.value','code','includes','arrayMatching','BEHAVIOR_SOURCE_MISSING_FILTER','error','INVALID_RULE_TYPE','.source','type','name','MISSING_TIME_UNIT','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','endsWith','\x27\x20with\x20attribute\x20\x27','Behavior','SEGMENT_SCHEMA_ERROR','source','Composite','MISSING_OPERATOR_VALUE','operator','invalid_value','message','rule','data','4VbTXtl','validationCode','aggregation','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','symbol','65866vvqpRl','2532535OUjWgM','1875664MMKrGF','6NDWysU','params','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','skipSchema','TimeWithinPast','.attribute','1210136rhhLat','EMPTY_ATTRIBUTE','attribute','rule.type','description','success','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','length','conditions','.filter','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','INVALID_ARRAY_MATCHING','And','Behavior\x20source\x20\x27','TEMPORAL_NEGATION_UNSUPPORTED','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','warning','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','66404wbijEe','level','TimeWithinNext','custom','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.'];a159_0x56a9=function(){return _0x53f0f7;};return a159_0x56a9();}(function(_0x4875b8,_0x37df43){const _0xef94cd=a159_0x567a,_0x5c36c7=_0x4875b8();while(!![]){try{const _0x3fc760=-parseInt(_0xef94cd(0x144))/0x1+-parseInt(_0xef94cd(0x128))/0x2+-parseInt(_0xef94cd(0x160))/0x3+-parseInt(_0xef94cd(0x123))/0x4*(parseInt(_0xef94cd(0x129))/0x5)+parseInt(_0xef94cd(0x12b))/0x6*(-parseInt(_0xef94cd(0x12a))/0x7)+-parseInt(_0xef94cd(0x131))/0x8+parseInt(_0xef94cd(0x158))/0x9;if(_0x3fc760===_0x37df43)break;else _0x5c36c7['push'](_0x5c36c7['shift']());}catch(_0xf34117){_0x5c36c7['push'](_0x5c36c7['shift']());}}}(a159_0x56a9,0x546f2));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x4077ed,_0x437bf4={},_0x28abe3={}){const _0x4800e7=a159_0x567a;if(_0x28abe3[_0x4800e7(0x12e)])return runSemanticChecks(_0x4077ed,_0x437bf4);const _0x4cc5c5=SegmentDefSchema[_0x4800e7(0x15a)](_0x4077ed);if(_0x4cc5c5[_0x4800e7(0x136)])return runSemanticChecks(_0x4cc5c5[_0x4800e7(0x122)],_0x437bf4);return zodErrorsToValidationResult(_0x4cc5c5[_0x4800e7(0x167)],_0x437bf4);}export function validateRuleDef(_0x9c6d0,_0x5b4841,_0x8aedd5){const _0x4eccaa=a159_0x567a;if(!_0x9c6d0)return[];const _0x16875b=RuleDefSchema[_0x4eccaa(0x15a)](_0x9c6d0);if(_0x16875b['success'])return checkRule(_0x16875b[_0x4eccaa(0x122)],_0x5b4841,_0x8aedd5);const _0x95d4c=flattenZodIssues(_0x16875b['error'][_0x4eccaa(0x14c)]);return _0x95d4c[_0x4eccaa(0x149)](_0x515d08=>{const _0x59428c=_0x4eccaa,_0x493ff7=formatZodPath(_0x515d08[_0x59428c(0x157)]),_0x2d4473=_0x493ff7?_0x5b4841+'.'+_0x493ff7:_0x5b4841,_0x4cb646=mapZodIssueToCode(_0x515d08,_0x493ff7),_0x5425df=getLocationFromPath(_0x8aedd5[_0x59428c(0x14b)],_0x8aedd5['source'],pathToArray(_0x2d4473));return{'level':_0x59428c(0x167),'path':_0x2d4473,'code':_0x4cb646,'message':_0x515d08[_0x59428c(0x120)],..._0x5425df&&{'location':_0x5425df}};});}function zodErrorsToValidationResult(_0x185e9a,_0x52438c){const _0x53cc16=a159_0x567a,_0x20a554=flattenZodIssues(_0x185e9a['issues']),_0x231792=_0x20a554[_0x53cc16(0x149)](_0x42db80=>{const _0x2e0337=_0x53cc16,_0x183f60=formatZodPath(_0x42db80[_0x2e0337(0x157)]),_0x53a067=mapZodIssueToCode(_0x42db80,_0x183f60),_0x2c88ac=getLocationFromPath(_0x52438c[_0x2e0337(0x14b)],_0x52438c[_0x2e0337(0x11b)],_0x42db80[_0x2e0337(0x157)][_0x2e0337(0x149)](_0x5b6b24=>typeof _0x5b6b24===_0x2e0337(0x127)?String(_0x5b6b24):_0x5b6b24));return{'level':_0x2e0337(0x167),'path':_0x183f60,'code':_0x53a067,'message':_0x42db80[_0x2e0337(0x120)],..._0x2c88ac&&{'location':_0x2c88ac}};});return{'valid':![],'errors':_0x231792,'warnings':[]};}function mapZodIssueToCode(_0x1424e6,_0x45332d){const _0x364df2=a159_0x567a,_0x5c5e98=_0x1424e6['code']===_0x364df2(0x147)?_0x1424e6[_0x364df2(0x12c)]:undefined;if(_0x45332d===_0x364df2(0x16b))return'MISSING_NAME';if(_0x45332d===_0x364df2(0x134)||_0x45332d[_0x364df2(0x16e)](_0x364df2(0x153))){if(_0x1424e6[_0x364df2(0x163)]===_0x364df2(0x11f)){if(_0x45332d===_0x364df2(0x134)||_0x45332d['match'](/\.conditions\[\d+\]\.type$/))return _0x364df2(0x168);}}if(_0x45332d['endsWith'](_0x364df2(0x159)))return'INVALID_OPERATOR_TYPE';if(_0x45332d['endsWith'](_0x364df2(0x162)))return _0x364df2(0x11d);if(_0x5c5e98?.[_0x364df2(0x124)]===_0x364df2(0x15e))return'MISSING_BETWEEN_BOUNDS';if(_0x5c5e98?.[_0x364df2(0x124)]===_0x364df2(0x16c))return _0x364df2(0x16c);if(_0x45332d[_0x364df2(0x16e)](_0x364df2(0x150))||_0x45332d===_0x364df2(0x139))return'MISSING_CONDITIONS';if(_0x45332d[_0x364df2(0x164)](_0x364df2(0x165)))return _0x364df2(0x13d);if(_0x45332d[_0x364df2(0x16e)](_0x364df2(0x14e)))return _0x364df2(0x151);return _0x364df2(0x171);}function runSemanticChecks(_0x2a50ba,_0x11ce41){const _0x4aa0dd=a159_0x567a,_0x4e9c8e=[];_0x2a50ba['rule']&&_0x4e9c8e['push'](...checkRule(_0x2a50ba['rule'],_0x4aa0dd(0x121),_0x11ce41));const _0x433ce1=_0x4e9c8e[_0x4aa0dd(0x154)](_0x2d9bb2=>_0x2d9bb2['level']===_0x4aa0dd(0x167)),_0x279fd8=_0x4e9c8e[_0x4aa0dd(0x154)](_0x37bf45=>_0x37bf45[_0x4aa0dd(0x145)]==='warning');return{'valid':_0x433ce1['length']===0x0,'errors':_0x433ce1,'warnings':_0x279fd8};}function checkRule(_0x4e338f,_0x2bf550,_0x4158d0){const _0x23144d=a159_0x567a,_0x5488fa=[];if(_0x4e338f[_0x23144d(0x139)][_0x23144d(0x138)]===0x0)return _0x5488fa['push']({'level':_0x23144d(0x167),'path':_0x2bf550+_0x23144d(0x150),'code':'EMPTY_CONDITIONS','message':_0x23144d(0x15b),'location':getLocationFromPath(_0x4158d0['document'],_0x4158d0[_0x23144d(0x11b)],pathToArray(_0x2bf550+_0x23144d(0x150)))}),_0x5488fa;return _0x5488fa[_0x23144d(0x155)](...checkConditions(_0x4e338f[_0x23144d(0x139)],_0x2bf550,_0x4158d0)),_0x5488fa;}function checkConditions(_0x33ffc8,_0x21ddef,_0x26274e){const _0x5da8c5=a159_0x567a,_0xb3a90b=[];for(let _0x11e7ac=0x0;_0x11e7ac<_0x33ffc8[_0x5da8c5(0x138)];_0x11e7ac++){const _0x1819dc=_0x33ffc8[_0x11e7ac],_0x1e8e9f=_0x21ddef+_0x5da8c5(0x15c)+_0x11e7ac+']';_0xb3a90b[_0x5da8c5(0x155)](...checkCondition(_0x1819dc,_0x1e8e9f,_0x26274e));}return _0xb3a90b;}function checkCondition(_0xb5e879,_0x1659e0,_0x21108f){const _0xda4e5d=a159_0x567a,_0x3791e=[];if(_0xb5e879[_0xda4e5d(0x16a)]===_0xda4e5d(0x13e)||_0xb5e879[_0xda4e5d(0x16a)]==='Or'||_0xb5e879['type']===_0xda4e5d(0x11c)){if(_0xb5e879['conditions'][_0xda4e5d(0x138)]===0x0)_0x3791e['push']({'level':_0xda4e5d(0x167),'path':_0x1659e0+_0xda4e5d(0x150),'code':'EMPTY_CONDITIONS','message':_0xb5e879['type']+_0xda4e5d(0x13c),'location':getLocationFromPath(_0x21108f[_0xda4e5d(0x14b)],_0x21108f[_0xda4e5d(0x11b)],pathToArray(_0x1659e0+_0xda4e5d(0x150)))});else{const _0x12c132=_0xb5e879[_0xda4e5d(0x135)]!==undefined,_0x219525=_0xb5e879[_0xda4e5d(0x16a)]===_0xda4e5d(0x11c);!_0x12c132&&!_0x219525&&_0x3791e[_0xda4e5d(0x155)]({'level':_0xda4e5d(0x142),'path':_0x1659e0,'code':_0xda4e5d(0x14f),'message':_0xb5e879[_0xda4e5d(0x16a)]+_0xda4e5d(0x126)+_0xda4e5d(0x141)+'conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','location':getLocationFromPath(_0x21108f['document'],_0x21108f[_0xda4e5d(0x11b)],pathToArray(_0x1659e0))}),_0x3791e[_0xda4e5d(0x155)](...checkConditions(_0xb5e879[_0xda4e5d(0x139)],_0x1659e0,_0x21108f));}return _0x3791e;}if(_0xb5e879[_0xda4e5d(0x16a)]===_0xda4e5d(0x15d)||_0xb5e879[_0xda4e5d(0x16a)]===_0xda4e5d(0x170)){const _0x2e2a4b=_0xb5e879,_0x18ae87=_0x2e2a4b[_0xda4e5d(0x11b)],_0x3810d7=_0x2e2a4b[_0xda4e5d(0x125)],_0x1a3ae1=_0x18ae87||_0x3810d7,_0x3bcd35=_0x2e2a4b[_0xda4e5d(0x11e)]?.[_0xda4e5d(0x16a)];if((_0x3bcd35===_0xda4e5d(0x12f)||_0x3bcd35===_0xda4e5d(0x146))&&_0x2e2a4b[_0xda4e5d(0x11e)]?.[_0xda4e5d(0x161)]!==undefined){const _0x252fca=_0x2e2a4b[_0xda4e5d(0x11e)][_0xda4e5d(0x161)]===!![];_0x3791e[_0xda4e5d(0x155)]({'level':_0x252fca?'error':_0xda4e5d(0x142),'path':_0x1659e0+'.operator.not','code':_0xda4e5d(0x140),'message':_0x252fca?_0xda4e5d(0x14d)+_0x3bcd35+_0xda4e5d(0x143)+_0xda4e5d(0x16d)+_0xda4e5d(0x148):_0xda4e5d(0x14d)+_0x3bcd35+_0xda4e5d(0x14a)+_0xda4e5d(0x152),'location':getLocationFromPath(_0x21108f['document'],_0x21108f[_0xda4e5d(0x11b)],pathToArray(_0x1659e0+'.operator.not'))});}(!_0x2e2a4b[_0xda4e5d(0x133)]||_0x2e2a4b[_0xda4e5d(0x133)]==='')&&(!_0x1a3ae1&&_0x3791e['push']({'level':'error','path':_0x1659e0+_0xda4e5d(0x130),'code':_0xda4e5d(0x132),'message':_0xda4e5d(0x156),'location':getLocationFromPath(_0x21108f[_0xda4e5d(0x14b)],_0x21108f[_0xda4e5d(0x11b)],pathToArray(_0x1659e0+'.attribute'))}));_0x2e2a4b[_0xda4e5d(0x154)]&&_0x3791e[_0xda4e5d(0x155)](...checkRule(_0x2e2a4b['filter'],_0x1659e0+_0xda4e5d(0x13a),_0x21108f));if(_0x2e2a4b[_0xda4e5d(0x11b)]){const _0x2d5930=_0x2e2a4b[_0xda4e5d(0x133)]&&_0x2e2a4b[_0xda4e5d(0x133)]!=='';_0x2d5930&&!_0x2e2a4b[_0xda4e5d(0x154)]&&_0x3791e['push']({'level':'error','path':_0x1659e0+_0xda4e5d(0x169),'code':_0xda4e5d(0x166),'message':_0xda4e5d(0x13f)+_0x2e2a4b[_0xda4e5d(0x11b)]+_0xda4e5d(0x16f)+_0x2e2a4b[_0xda4e5d(0x133)]+'\x27\x20'+_0xda4e5d(0x137)+'the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20'+'Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','location':getLocationFromPath(_0x21108f[_0xda4e5d(0x14b)],_0x21108f[_0xda4e5d(0x11b)],pathToArray(_0x1659e0+_0xda4e5d(0x169)))}),_0x2d5930&&_0x2e2a4b[_0xda4e5d(0x154)]&&_0x3791e[_0xda4e5d(0x155)]({'level':_0xda4e5d(0x142),'path':_0x1659e0+_0xda4e5d(0x130),'code':_0xda4e5d(0x13b),'message':'Attribute\x20\x27'+_0x2e2a4b[_0xda4e5d(0x133)]+_0xda4e5d(0x12d)+_0xda4e5d(0x15f),'location':getLocationFromPath(_0x21108f['document'],_0x21108f[_0xda4e5d(0x11b)],pathToArray(_0x1659e0+_0xda4e5d(0x130)))});}}return _0x3791e;}