@treasuredata/tdx 2026.3.15 → 2026.3.17

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 (202) hide show
  1. package/README.md +9 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/auth-login-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/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/query/index.js +1 -1
  127. package/dist/sdk/query/sql-parser.js +1 -1
  128. package/dist/sdk/realtime.js +1 -1
  129. package/dist/sdk/schedule.js +1 -1
  130. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  131. package/dist/sdk/segment/fields-display.js +1 -1
  132. package/dist/sdk/segment/file-discovery.js +1 -1
  133. package/dist/sdk/segment/journey-utils.js +1 -1
  134. package/dist/sdk/segment/journey-validator.js +1 -1
  135. package/dist/sdk/segment/journey-yaml.js +1 -1
  136. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  137. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  138. package/dist/sdk/segment/pull-workflow.js +1 -1
  139. package/dist/sdk/segment/push-recovery.js +1 -1
  140. package/dist/sdk/segment/push-workflow.js +1 -1
  141. package/dist/sdk/segment/resolution-context.js +1 -1
  142. package/dist/sdk/segment/segment-path-parser.js +1 -1
  143. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  144. package/dist/sdk/segment/segment-validator.js +1 -1
  145. package/dist/sdk/segment/target-resolution.js +1 -1
  146. package/dist/sdk/segment/tdx-config.js +1 -1
  147. package/dist/sdk/segment/types/activation-schema.js +1 -1
  148. package/dist/sdk/segment/types/journey-def.js +1 -1
  149. package/dist/sdk/segment/types/journey-schema.js +1 -1
  150. package/dist/sdk/segment/types/segment-def.js +1 -1
  151. package/dist/sdk/segment/types/segment-schema.js +1 -1
  152. package/dist/sdk/segment/validate-files.js +1 -1
  153. package/dist/sdk/segment/yaml-validator.js +1 -1
  154. package/dist/sdk/segment.js +1 -1
  155. package/dist/sdk/types/index.js +1 -1
  156. package/dist/sdk/types/progress.js +1 -1
  157. package/dist/sdk/user.js +1 -1
  158. package/dist/sdk/util/format-detector.js +1 -1
  159. package/dist/sdk/util/formatters.js +1 -1
  160. package/dist/sdk/util/index.js +1 -1
  161. package/dist/sdk/util/paginate.js +1 -1
  162. package/dist/sdk/util/tree-formatter.js +1 -1
  163. package/dist/sdk/workflow/archive-validation.js +1 -1
  164. package/dist/sdk/workflow/clone-workflow.js +1 -1
  165. package/dist/sdk/workflow/index.js +1 -1
  166. package/dist/sdk/workflow/pull-workflow.js +1 -1
  167. package/dist/sdk/workflow/push-workflow.js +1 -1
  168. package/dist/sdk/workflow/tdx-config.js +1 -1
  169. package/dist/sdk/workflow/workflow-utils.js +1 -1
  170. package/dist/test-utils/command-runner.js +1 -1
  171. package/dist/test-utils/factories.js +1 -1
  172. package/dist/test-utils/fixtures.js +1 -1
  173. package/dist/test-utils/http-mock.js +1 -1
  174. package/dist/test-utils/index.js +1 -1
  175. package/dist/utils/async.js +1 -1
  176. package/dist/utils/colors.js +1 -1
  177. package/dist/utils/diff.js +1 -1
  178. package/dist/utils/file-permissions.js +1 -1
  179. package/dist/utils/file-reader.js +1 -1
  180. package/dist/utils/github-releases.js +1 -1
  181. package/dist/utils/global-cache.js +1 -1
  182. package/dist/utils/json-loader.js +1 -1
  183. package/dist/utils/local-cache.js +1 -1
  184. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  185. package/dist/utils/logger/formatters/index.js +1 -1
  186. package/dist/utils/logger/handlers/console-handler.js +1 -1
  187. package/dist/utils/logger/handlers/file-handler.js +1 -1
  188. package/dist/utils/logger/handlers/index.js +1 -1
  189. package/dist/utils/logger/handlers/null-handler.js +1 -1
  190. package/dist/utils/logger/index.js +1 -1
  191. package/dist/utils/logger/logger.js +1 -1
  192. package/dist/utils/logger/types.js +1 -1
  193. package/dist/utils/option-validation.js +1 -1
  194. package/dist/utils/process.js +1 -1
  195. package/dist/utils/prompt.js +1 -1
  196. package/dist/utils/spinner.js +1 -1
  197. package/dist/utils/sse-parser.js +1 -1
  198. package/dist/utils/string-utils.js +1 -1
  199. package/dist/utils/table-ref-parser.js +1 -1
  200. package/dist/utils/tdx-logger.js +1 -1
  201. package/dist/utils/version-check.js +1 -1
  202. package/package.json +3 -3
@@ -1 +1 @@
1
- const a88_0x42d0d0=a88_0x465e;(function(_0x233423,_0x334577){const _0x3aff32=a88_0x465e,_0x36389d=_0x233423();while(!![]){try{const _0x1943d9=-parseInt(_0x3aff32(0xc2))/0x1*(parseInt(_0x3aff32(0x103))/0x2)+-parseInt(_0x3aff32(0x8c))/0x3*(-parseInt(_0x3aff32(0xf5))/0x4)+parseInt(_0x3aff32(0xe0))/0x5+-parseInt(_0x3aff32(0xb7))/0x6*(-parseInt(_0x3aff32(0xe6))/0x7)+-parseInt(_0x3aff32(0xdc))/0x8*(-parseInt(_0x3aff32(0x83))/0x9)+parseInt(_0x3aff32(0x105))/0xa*(-parseInt(_0x3aff32(0x89))/0xb)+-parseInt(_0x3aff32(0x96))/0xc;if(_0x1943d9===_0x334577)break;else _0x36389d['push'](_0x36389d['shift']());}catch(_0x4023b0){_0x36389d['push'](_0x36389d['shift']());}}}(a88_0x5880,0x2bad9));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class CDPApiClient{['httpClient'];[a88_0x42d0d0(0xba)];constructor(_0x536455){const _0x3736b6=a88_0x42d0d0,_0x5d02e5=getEndpoint(_0x536455[_0x3736b6(0xc8)],'cdp');this['authHeaders']=toHeaderRecord(getAuthHeaders(_0x536455[_0x3736b6(0xc8)],_0x536455['apiKey'],_0x536455[_0x3736b6(0x104)])),this[_0x3736b6(0xa6)]=new HTTPClient(_0x5d02e5,{...this[_0x3736b6(0xba)],'Accept':'application/vnd.treasuredata.v1+json','Content-Type':_0x3736b6(0x7a)},{'proxy':_0x536455[_0x3736b6(0xdf)]});}async[a88_0x42d0d0(0x9e)](){const _0xb4336e=a88_0x42d0d0,_0x2b5816=_0xb4336e(0x87),_0x570337=await this['httpClient'][_0xb4336e(0xff)]('GET',_0x2b5816);return Array[_0xb4336e(0x9d)](_0x570337)?_0x570337:_0x570337[_0xb4336e(0xd2)];}async[a88_0x42d0d0(0xee)](_0xb50e5e){const _0x4064d3=a88_0x42d0d0,_0xb1382=_0x4064d3(0xec)+_0xb50e5e,_0x549357=await this[_0x4064d3(0xa6)][_0x4064d3(0xff)](_0x4064d3(0xda),_0xb1382);return _0x4064d3(0xd2)in _0x549357?_0x549357[_0x4064d3(0xd2)]:_0x549357;}async[a88_0x42d0d0(0xb2)](_0x20289d){const _0x38c5b9=a88_0x42d0d0,_0x43d228=_0x38c5b9(0x95)+_0x20289d+_0x38c5b9(0x7e),_0x5cf6dd=await this[_0x38c5b9(0xa6)][_0x38c5b9(0xff)]('GET',_0x43d228);return Array[_0x38c5b9(0x9d)](_0x5cf6dd)?_0x5cf6dd:_0x5cf6dd[_0x38c5b9(0xd2)];}async[a88_0x42d0d0(0x100)](_0x3dab65,_0x395b3f){const _0x57284f=a88_0x42d0d0,_0x34b858='/audiences/'+_0x3dab65+_0x57284f(0xbe)+_0x395b3f,_0x12076e=await this[_0x57284f(0xa6)][_0x57284f(0xff)]('GET',_0x34b858);return'data'in _0x12076e?_0x12076e['data']:_0x12076e;}async[a88_0x42d0d0(0x7c)](_0x2f5a96){const _0x54bb6d=a88_0x42d0d0,_0x2def91='/entities/segments/'+_0x2f5a96,_0x5cca2a=await this[_0x54bb6d(0xa6)][_0x54bb6d(0xff)](_0x54bb6d(0xda),_0x2def91);if(_0x54bb6d(0xd2)in _0x5cca2a){const _0x5ccae7=_0x5cca2a[_0x54bb6d(0xd2)];if(_0x54bb6d(0xe2)in _0x5ccae7&&_0x5ccae7['attributes']&&typeof _0x5ccae7['attributes']==='object'){const _0x560dd7=_0x5ccae7[_0x54bb6d(0xe2)];return{'id':_0x5ccae7['id'],'name':_0x560dd7[_0x54bb6d(0xc3)],..._0x560dd7};}return _0x5ccae7;}return _0x5cca2a;}async[a88_0x42d0d0(0xbb)](_0x3b702b){const _0x5911ba=a88_0x42d0d0,_0x1bb2c8='/audiences/'+_0x3b702b+'/folders',_0x3b4d52=await this[_0x5911ba(0xa6)][_0x5911ba(0xff)](_0x5911ba(0xda),_0x1bb2c8);return Array[_0x5911ba(0x9d)](_0x3b4d52)?_0x3b4d52:_0x3b4d52[_0x5911ba(0xd2)];}async['getSegmentFolder'](_0x46d853){const _0x4e0b51=a88_0x42d0d0,_0x23ae38=_0x4e0b51(0x86)+_0x46d853,_0x19e3d3=await this['httpClient'][_0x4e0b51(0xff)](_0x4e0b51(0xda),_0x23ae38);return'data'in _0x19e3d3?_0x19e3d3[_0x4e0b51(0xd2)]:_0x19e3d3;}async[a88_0x42d0d0(0xca)](_0x3b6eea,_0x32d12f=0x20,_0x572410=![]){const _0x4e5dea=a88_0x42d0d0,_0x26fa43=_0x4e5dea(0xcc)+_0x3b6eea+_0x4e5dea(0xd1)+_0x32d12f+'&with_rule='+_0x572410;return await this[_0x4e5dea(0xa6)][_0x4e5dea(0xff)](_0x4e5dea(0xda),_0x26fa43);}async[a88_0x42d0d0(0xc5)](_0x6f78a9,_0x4a0ed2){const _0x3a6f21=a88_0x42d0d0,_0x3faa4c=_0x3a6f21(0x95)+_0x6f78a9+'/segments/'+_0x4a0ed2+_0x3a6f21(0xb6),_0xc8fbb4=await this[_0x3a6f21(0xa6)]['request']('GET',_0x3faa4c);return Array[_0x3a6f21(0x9d)](_0xc8fbb4)?_0xc8fbb4:_0xc8fbb4[_0x3a6f21(0xd2)];}async[a88_0x42d0d0(0x10b)](_0x3f1732,_0x1698d8,_0x366875){const _0xb5397=a88_0x42d0d0,_0x59b4bd='/audiences/'+_0x3f1732+_0xb5397(0xbe)+_0x1698d8+_0xb5397(0xfa)+_0x366875,_0x4cdb99=await this[_0xb5397(0xa6)][_0xb5397(0xff)]('GET',_0x59b4bd);return _0xb5397(0xd2)in _0x4cdb99?_0x4cdb99[_0xb5397(0xd2)]:_0x4cdb99;}async[a88_0x42d0d0(0xaa)](_0x2b99fc,_0x334516,_0x4ceb48){const _0x3582d5=a88_0x42d0d0,_0xcd53='/audiences/'+_0x2b99fc+'/segments/'+_0x334516+_0x3582d5(0xb6),_0x9dc228=await this[_0x3582d5(0xa6)][_0x3582d5(0xff)](_0x3582d5(0x7f),_0xcd53,{'body':_0x4ceb48});return _0x9dc228;}async[a88_0x42d0d0(0xb1)](_0x3cc070,_0x1f5f4e,_0x43025b,_0x49d502){const _0x3b4956=a88_0x42d0d0,_0xc5eea4=_0x3b4956(0x95)+_0x3cc070+_0x3b4956(0xbe)+_0x1f5f4e+_0x3b4956(0xfa)+_0x43025b,_0x37a59f=await this['httpClient'][_0x3b4956(0xff)](_0x3b4956(0xf0),_0xc5eea4,{'body':_0x49d502});return _0x37a59f;}async['deleteActivation'](_0x512370,_0x557283,_0x5214a2){const _0x5ae72e=a88_0x42d0d0,_0x5809ac=_0x5ae72e(0x95)+_0x512370+_0x5ae72e(0xbe)+_0x557283+'/syndications/'+_0x5214a2;await this[_0x5ae72e(0xa6)][_0x5ae72e(0xff)](_0x5ae72e(0x78),_0x5809ac);}async[a88_0x42d0d0(0xfc)](_0xf11ddb){const _0xb5cf00=a88_0x42d0d0;return this[_0xb5cf00(0x8e)](_0xf11ddb);}async[a88_0x42d0d0(0xf2)](_0x32936a,_0x76b7b3){const _0x42d045=a88_0x42d0d0;return this[_0x42d045(0x8e)](_0x32936a,_0x76b7b3);}async['getSegmentSQL'](_0x4a12f0,_0x362da5){const _0x2d6ae9=a88_0x42d0d0,_0x36773=await this['getSegment'](_0x4a12f0,_0x362da5),_0x766e4f=_0x2d6ae9(0x8a)in _0x36773&&_0x36773[_0x2d6ae9(0x8a)]?_0x36773['rule']:undefined;return this[_0x2d6ae9(0x8e)](_0x4a12f0,_0x766e4f);}async[a88_0x42d0d0(0x8e)](_0x3c0dad,_0x56de38){const _0x45621f=a88_0x42d0d0,_0x155934='/audiences/'+_0x3c0dad+_0x45621f(0xb8),_0xbe9b26={'format':'sql'};_0x56de38&&(_0xbe9b26[_0x45621f(0x8a)]=_0x56de38);const _0x3eb46e=await this[_0x45621f(0xa6)][_0x45621f(0xff)](_0x45621f(0x7f),_0x155934,{'body':_0xbe9b26});return _0x3eb46e[_0x45621f(0xeb)]||_0x3eb46e[_0x45621f(0xbd)]||'';}async[a88_0x42d0d0(0xfe)](_0x3feb1c){const _0x49214d=a88_0x42d0d0,_0x584768=_0x49214d(0xf4),_0x49cf35=await this[_0x49214d(0xa6)]['request'](_0x49214d(0x7f),_0x584768,{'body':_0x3feb1c,'headers':{'Content-Type':_0x49214d(0xea)}});return _0x49cf35;}async[a88_0x42d0d0(0x80)](_0x541e02,_0x5ee488){const _0x3c5663=a88_0x42d0d0,_0x50b1ea='/audiences/'+_0x541e02,_0x30d4f9=await this[_0x3c5663(0xa6)][_0x3c5663(0xff)](_0x3c5663(0xf0),_0x50b1ea,{'body':_0x5ee488,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x30d4f9;}async['getParentSegmentFull'](_0x77d9bc){const _0x52035c=a88_0x42d0d0,_0x7651ec=_0x52035c(0x95)+_0x77d9bc,_0x543651=await this[_0x52035c(0xa6)][_0x52035c(0xff)](_0x52035c(0xda),_0x7651ec,{'headers':{'Accept':'application/vnd.treasuredata.v1+json'}});return _0x543651;}async[a88_0x42d0d0(0x99)](_0x14cfef){const _0x42df32=a88_0x42d0d0,_0xc9532='/audiences/'+_0x14cfef+_0x42df32(0xd7),_0x59d795=await this[_0x42df32(0xa6)][_0x42df32(0xff)](_0x42df32(0xda),_0xc9532);return _0x59d795;}async[a88_0x42d0d0(0xac)](_0x5ccee6,_0x1f1ca3){const _0xb5a6a9=a88_0x42d0d0;let _0x3f3b08=_0xb5a6a9(0x95)+_0x5ccee6+_0xb5a6a9(0xe3);_0x1f1ca3!==undefined&&(_0x3f3b08+=_0xb5a6a9(0xa8)+_0x1f1ca3);const _0x122e75=await this[_0xb5a6a9(0xa6)][_0xb5a6a9(0xff)](_0xb5a6a9(0xda),_0x3f3b08);return _0x122e75;}async[a88_0x42d0d0(0x79)](_0x20403b,_0x2887ff){const _0x2a1436=a88_0x42d0d0,_0x221f31=_0x2a1436(0x95)+_0x20403b+_0x2a1436(0x7e),_0x370718=await this[_0x2a1436(0xa6)][_0x2a1436(0xff)](_0x2a1436(0x7f),_0x221f31,{'body':_0x2887ff});return _0x370718;}async['createJourneySegment'](_0x508128){const _0x4cb0e9=a88_0x42d0d0,_0x576afb='/entities/segments',_0x1cf50e={'type':_0x4cb0e9(0xe8),'attributes':{'name':_0x508128[_0x4cb0e9(0xc3)],'description':_0x508128[_0x4cb0e9(0xcf)]||'','journeyId':_0x508128['journeyId'],'rule':_0x508128[_0x4cb0e9(0x8a)],'countPopulation':_0x508128[_0x4cb0e9(0x82)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x508128[_0x4cb0e9(0xf3)],'type':'folder-segment'}}}},_0x59ab2a=await this[_0x4cb0e9(0xa6)]['request'](_0x4cb0e9(0x7f),_0x576afb,{'body':_0x1cf50e,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x59ab2a[_0x4cb0e9(0xd2)]['id'];}async[a88_0x42d0d0(0xfd)](_0x1645c6,_0x3c6076,_0x4d4bb5){const _0x268f4f=a88_0x42d0d0,_0x25f3d3=_0x268f4f(0x95)+_0x1645c6+_0x268f4f(0xbe)+_0x3c6076,_0x26e1ec=await this['httpClient'][_0x268f4f(0xff)](_0x268f4f(0xf0),_0x25f3d3,{'body':_0x4d4bb5});return _0x26e1ec;}async['deleteSegment'](_0x335867){const _0x37207c=a88_0x42d0d0,_0x235820=_0x37207c(0x108)+_0x335867;await this[_0x37207c(0xa6)][_0x37207c(0xff)]('DELETE',_0x235820);}async[a88_0x42d0d0(0xb4)](_0x39d074,_0x39a476){const _0x535fb6=a88_0x42d0d0,_0x74a18d='/audiences/'+_0x39d074+_0x535fb6(0xfb),_0x2c2a3=await this['httpClient'][_0x535fb6(0xff)](_0x535fb6(0x7f),_0x74a18d,{'body':_0x39a476});if(_0x535fb6(0xd2)in _0x2c2a3&&_0x2c2a3[_0x535fb6(0xd2)]){const _0x41b270=_0x2c2a3[_0x535fb6(0xd2)];return{'id':_0x41b270['id'],'name':_0x41b270['name'],'description':_0x41b270['description'],'audienceId':_0x41b270['audienceId']||String(_0x39d074),'parentFolderId':_0x41b270['parentFolderId'],'createdAt':_0x41b270[_0x535fb6(0xf9)],'updatedAt':_0x41b270[_0x535fb6(0xe9)]};}return _0x2c2a3;}async[a88_0x42d0d0(0xb9)](_0x508e0d){const _0x109d0a=a88_0x42d0d0,_0x16d209=_0x109d0a(0x95)+_0x508e0d+_0x109d0a(0xf6),_0x542e0a=await this[_0x109d0a(0xa6)][_0x109d0a(0xff)](_0x109d0a(0x7f),_0x16d209);return _0x542e0a;}async[a88_0x42d0d0(0xd4)](_0x31003f){const _0x1e34c8=a88_0x42d0d0,_0x5c682a=_0x1e34c8(0xb0)+_0x31003f,_0x55242a=await this[_0x1e34c8(0xa6)][_0x1e34c8(0xff)](_0x1e34c8(0xda),_0x5c682a);return _0x55242a[_0x1e34c8(0xd2)][_0x1e34c8(0x98)](_0x19aa11=>({'id':_0x19aa11['id'],'name':_0x19aa11[_0x1e34c8(0xe2)][_0x1e34c8(0xc3)],'journeyBundleName':_0x19aa11['attributes'][_0x1e34c8(0xdd)],'journeyBundleId':_0x19aa11[_0x1e34c8(0xe2)]['journeyBundleId'],'versionNumber':_0x19aa11[_0x1e34c8(0xe2)][_0x1e34c8(0x7b)],'description':_0x19aa11[_0x1e34c8(0xe2)][_0x1e34c8(0xcf)],'state':_0x19aa11['attributes']['state'],'paused':_0x19aa11[_0x1e34c8(0xe2)]['paused'],'audienceId':_0x19aa11[_0x1e34c8(0xe2)][_0x1e34c8(0x106)],'folderId':_0x19aa11[_0x1e34c8(0xef)]?.[_0x1e34c8(0xb5)]?.[_0x1e34c8(0xd2)]?.['id'],'createdAt':_0x19aa11[_0x1e34c8(0xe2)][_0x1e34c8(0xf9)],'updatedAt':_0x19aa11[_0x1e34c8(0xe2)][_0x1e34c8(0xe9)]}));}async[a88_0x42d0d0(0x88)](_0x386c22){const _0x44443d=a88_0x42d0d0,_0x23fb94='/entities/journeys?folder_id='+_0x386c22,_0x15ac2d=await this[_0x44443d(0xa6)][_0x44443d(0xff)]('GET',_0x23fb94),_0x484c39=new Map();if(_0x15ac2d[_0x44443d(0x9a)])for(const _0xd30159 of _0x15ac2d[_0x44443d(0x9a)]){_0xd30159[_0x44443d(0x8f)]===_0x44443d(0xad)&&_0x484c39[_0x44443d(0x10a)](_0xd30159['id'],_0xd30159);}return{'journeys':_0x15ac2d[_0x44443d(0xd2)],'activationStepsById':_0x484c39};}async[a88_0x42d0d0(0xa0)](_0x7289ed){const _0x2fdab5=a88_0x42d0d0,_0x2009bc=_0x2fdab5(0x92)+_0x7289ed,_0x175049=await this['httpClient'][_0x2fdab5(0xff)]('GET',_0x2009bc);return _0x2fdab5(0xd2)in _0x175049?_0x175049[_0x2fdab5(0xd2)]:_0x175049;}async[a88_0x42d0d0(0x84)](_0xf5618f){const _0x58bc25=a88_0x42d0d0,_0x37bc1b=_0x58bc25(0xbf)+_0xf5618f,_0x1cdea8=await this['httpClient'][_0x58bc25(0xff)](_0x58bc25(0xda),_0x37bc1b);return parseJourneyBundleResponse(_0x1cdea8);}async[a88_0x42d0d0(0xf7)](_0x74e786){const _0x459b0c=a88_0x42d0d0,_0x5222a8=_0x459b0c(0xbf)+_0x74e786+_0x459b0c(0xed);await this['httpClient']['request']('GET',_0x5222a8);}async[a88_0x42d0d0(0xa7)](_0x51f16d,_0x388dac){const _0x53104c=a88_0x42d0d0,_0xe2d30e=_0x53104c(0xbf)+_0x51f16d+'/journeys',_0x1fc32e=await this['httpClient'][_0x53104c(0xff)]('POST',_0xe2d30e,{'body':_0x388dac});return _0x53104c(0xd2)in _0x1fc32e?_0x1fc32e['data']:_0x1fc32e;}async[a88_0x42d0d0(0xcd)](_0x468718){const _0x19e49f=a88_0x42d0d0,_0x127e3f='/entities/journeys',_0x2a9bf2=await this[_0x19e49f(0xa6)][_0x19e49f(0xff)]('POST',_0x127e3f,{'body':_0x468718,'headers':{'Content-Type':_0x19e49f(0xea)}});return _0x19e49f(0xd2)in _0x2a9bf2?_0x2a9bf2['data']:_0x2a9bf2;}async[a88_0x42d0d0(0x93)](_0x3f8f1a,_0x318601){const _0x3c9dda=a88_0x42d0d0,_0x3deb46=_0x3c9dda(0x92)+_0x3f8f1a,_0x4dc54e=await this[_0x3c9dda(0xa6)][_0x3c9dda(0xff)](_0x3c9dda(0x91),_0x3deb46,{'body':_0x318601,'headers':{'Content-Type':_0x3c9dda(0xea)}});return _0x3c9dda(0xd2)in _0x4dc54e?_0x4dc54e[_0x3c9dda(0xd2)]:_0x4dc54e;}async[a88_0x42d0d0(0x90)](_0x2b7452,_0x57cc5f){const _0x55eb8e=a88_0x42d0d0,_0x485834=_0x55eb8e(0x92)+_0x2b7452+_0x55eb8e(0xa4),_0x4de598=await this['httpClient'][_0x55eb8e(0xff)](_0x55eb8e(0x7f),_0x485834,{'body':_0x57cc5f,'headers':{'Content-Type':_0x55eb8e(0xea)}});return _0x55eb8e(0xd2)in _0x4de598?_0x4de598[_0x55eb8e(0xd2)]:_0x4de598;}async[a88_0x42d0d0(0xa9)](_0x1134c7,_0x110239){const _0xe8cc5a=a88_0x42d0d0,_0x474024=buildJourneyEndpoint(_0x1134c7,_0xe8cc5a(0x97),_0x110239),_0x1be415=await this[_0xe8cc5a(0xa6)][_0xe8cc5a(0xff)](_0xe8cc5a(0xda),_0x474024);return parseJourneyStatisticsResponse(_0x1be415);}async[a88_0x42d0d0(0xd8)](_0x1f8d5a,_0x3a7466){const _0x563f94=a88_0x42d0d0,_0x28ca51=buildJourneyEndpoint(_0x1f8d5a,'conversion_sankey_charts',_0x3a7466),_0x4bd746=await this['httpClient'][_0x563f94(0xff)](_0x563f94(0xda),_0x28ca51);return parseConversionSankeyResponse(_0x4bd746);}async[a88_0x42d0d0(0xa1)](_0x2c08c4,_0x522416){const _0x4b0b1d=a88_0x42d0d0,_0x88d154=buildJourneyEndpoint(_0x2c08c4,_0x4b0b1d(0xa5),_0x522416),_0x24c04d=await this[_0x4b0b1d(0xa6)][_0x4b0b1d(0xff)](_0x4b0b1d(0xda),_0x88d154);return parseActivationSankeyResponse(_0x24c04d);}async[a88_0x42d0d0(0xf1)](_0x483799){const _0x2f29a9=a88_0x42d0d0,_0x21e914=_0x2f29a9(0x92)+_0x483799+_0x2f29a9(0xe4),_0x5b4d0f=await this[_0x2f29a9(0xa6)][_0x2f29a9(0xff)](_0x2f29a9(0x91),_0x21e914);return _0x2f29a9(0xd2)in _0x5b4d0f?_0x5b4d0f['data']:_0x5b4d0f;}async['resumeJourney'](_0x19158e){const _0x21eba9=a88_0x42d0d0,_0x1b9940=_0x21eba9(0x92)+_0x19158e+_0x21eba9(0x109),_0x578777=await this[_0x21eba9(0xa6)]['request'](_0x21eba9(0x91),_0x1b9940);return'data'in _0x578777?_0x578777[_0x21eba9(0xd2)]:_0x578777;}async[a88_0x42d0d0(0xe7)](_0x310287,_0x1dba04){const _0x5685b6=a88_0x42d0d0,_0x5d6439='/entities/journeys/'+_0x310287+'/activations/'+_0x1dba04,_0x349ff3=await this[_0x5685b6(0xa6)]['request'](_0x5685b6(0xda),_0x5d6439);return _0x5685b6(0xd2)in _0x349ff3?_0x349ff3['data']:_0x349ff3;}async[a88_0x42d0d0(0xf8)](_0xc07b3e){const _0x313c37=a88_0x42d0d0,_0xec32f=_0x313c37(0x92)+_0xc07b3e+_0x313c37(0xab),_0x47674b=await this[_0x313c37(0xa6)][_0x313c37(0xff)]('GET',_0xec32f);return _0x313c37(0xd2)in _0x47674b?_0x47674b['data']:_0x47674b;}async[a88_0x42d0d0(0x81)](_0x57596a,_0x3b9b05){const _0x5ff49=a88_0x42d0d0,_0x480c8f=_0x5ff49(0x92)+_0x57596a+_0x5ff49(0xab),_0x43d9e4={'name':_0x3b9b05[_0x5ff49(0xc3)],'scheduleType':_0x3b9b05[_0x5ff49(0xdb)]||_0x5ff49(0xd6),'connectionId':String(_0x3b9b05['connectionId']),'columns':_0x3b9b05[_0x5ff49(0xc4)]??[],'notifyOn':_0x3b9b05[_0x5ff49(0x94)]??[],..._0x3b9b05['description']!==undefined&&{'description':_0x3b9b05['description']},..._0x3b9b05[_0x5ff49(0xa3)]!==undefined&&{'allColumns':_0x3b9b05['allColumns']},..._0x3b9b05[_0x5ff49(0xce)]!==undefined&&{'timezone':_0x3b9b05[_0x5ff49(0xce)]},..._0x3b9b05[_0x5ff49(0xc6)]!==undefined&&{'connectorConfig':_0x3b9b05[_0x5ff49(0xc6)]},..._0x3b9b05[_0x5ff49(0xde)]!==undefined&&{'emailRecipients':_0x3b9b05[_0x5ff49(0xde)]},..._0x3b9b05['activationTemplateId']!==undefined&&{'activationTemplateId':_0x3b9b05['activationTemplateId']},..._0x3b9b05[_0x5ff49(0xc0)]!==undefined&&{'syndicationBehavior':_0x3b9b05[_0x5ff49(0xc0)]}},_0xd322ba=await this[_0x5ff49(0xa6)]['request']('POST',_0x480c8f,{'body':{'type':_0x5ff49(0xad),'attributes':{'runAfterJourneyRefresh':_0x3b9b05[_0x5ff49(0x10c)]??![],'activationParams':_0x43d9e4}},'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x5ff49(0xd2)in _0xd322ba?_0xd322ba[_0x5ff49(0xd2)]:_0xd322ba;}}export function buildJourneyEndpoint(_0x54d4aa,_0x4dc155,_0x745215){const _0x352a38=a88_0x42d0d0,_0x59c0de='/entities/journeys/'+_0x54d4aa+'/'+_0x4dc155,_0x1bf55c=new URLSearchParams();if(_0x745215?.['from'])_0x1bf55c[_0x352a38(0x10a)](_0x352a38(0x8d),_0x745215['from']);if(_0x745215?.['to'])_0x1bf55c[_0x352a38(0x10a)]('to',_0x745215['to']);if(_0x745215?.[_0x352a38(0x9f)]!=null)_0x1bf55c[_0x352a38(0x10a)]('limit',String(_0x745215[_0x352a38(0x9f)]));const _0x575d68=_0x1bf55c[_0x352a38(0x7d)]();return _0x575d68?_0x59c0de+'?'+_0x575d68:_0x59c0de;}function a88_0x465e(_0xd3f07d,_0x6546de){_0xd3f07d=_0xd3f07d-0x78;const _0x588050=a88_0x5880();let _0x465eed=_0x588050[_0xd3f07d];return _0x465eed;}export function parseJourneyStatisticsResponse(_0x2ba88d){const _0x1efb12=a88_0x42d0d0;if(!('data'in _0x2ba88d))return _0x2ba88d;const _0xd6b0c=_0x2ba88d[_0x1efb12(0xd2)];if(!(_0x1efb12(0xe2)in _0xd6b0c)||!_0xd6b0c[_0x1efb12(0xe2)]||typeof _0xd6b0c[_0x1efb12(0xe2)]!==_0x1efb12(0xe5))return _0xd6b0c;const _0x14a714=_0xd6b0c['attributes'],_0x4ac8ad={'journeyId':_0x14a714[_0x1efb12(0xd0)],'size':_0x14a714[_0x1efb12(0x85)],'goalSize':_0x14a714[_0x1efb12(0xd9)],'enteredSize':_0x14a714[_0x1efb12(0xbc)],'completionRate':_0x14a714['completionRate'],'exitOrJumpSize':_0x14a714['exitOrJumpSize'],'exitOrJumpRate':_0x14a714[_0x1efb12(0x107)],'stages':(_0x14a714[_0x1efb12(0xcb)]??[])[_0x1efb12(0x98)](_0x23f70a=>{const _0x1456e6=_0x1efb12,_0x2f07fb={'id':_0x23f70a['id'],'enteredSize':_0x23f70a[_0x1456e6(0xbc)],'milestoneSize':_0x23f70a[_0x1456e6(0xe1)],'completeMilestoneRate':_0x23f70a['completeMilestoneRate'],'exitOrJumpSize':_0x23f70a[_0x1456e6(0xc9)],'exitOrJumpRate':_0x23f70a['exitOrJumpRate'],'size':_0x23f70a[_0x1456e6(0x85)]};if(_0x23f70a[_0x1456e6(0x8b)])_0x2f07fb['history']=_0x23f70a[_0x1456e6(0x8b)];if(_0x23f70a['stepSizes'])_0x2f07fb[_0x1456e6(0x9b)]=_0x23f70a['stepSizes'];if(_0x23f70a[_0x1456e6(0xd3)])_0x2f07fb[_0x1456e6(0xd3)]=_0x23f70a[_0x1456e6(0xd3)];if(_0x23f70a['exitSizes'])_0x2f07fb[_0x1456e6(0xb3)]=_0x23f70a[_0x1456e6(0xb3)];return _0x2f07fb;})};return Array[_0x1efb12(0x9d)](_0x14a714[_0x1efb12(0x8b)])&&(_0x4ac8ad[_0x1efb12(0x8b)]=_0x14a714[_0x1efb12(0x8b)]),_0x4ac8ad;}function extractSankeyChart(_0x4561e3){const _0x23e68e=a88_0x42d0d0,_0x43f9ec=Array['isArray'](_0x4561e3[_0x23e68e(0xd2)])?_0x4561e3[_0x23e68e(0xd2)]:[],_0x4a9086=_0x4561e3['metaData']&&typeof _0x4561e3['metaData']==='object'?_0x4561e3[_0x23e68e(0xc7)]:{},_0x5c10a3=Array[_0x23e68e(0x9d)](_0x4a9086[_0x23e68e(0xae)])?_0x4a9086['links']:[];return{'nodes':_0x43f9ec,'links':_0x5c10a3};}function a88_0x5880(){const _0x1041db=['getActivation','runAfterJourneyRefresh','DELETE','createSegment','application/json','versionNumber','getSegmentEntity','toString','/segments','POST','updateParentSegment','createJourneyActivation','countPopulation','4149dkqBtb','getJourneyBundle','size','/entities/folders/','/entities/parent_segments','listJourneysWithDetails','51854yNWSbt','rule','history','42fwOXrm','from','requestSegmentSQL','type','updateJourneyDetail','PATCH','/entities/journeys/','updateJourney','notifyOn','/audiences/','4117572rKVpoA','statistics','map','getAudienceAttributes','included','stepSizes','filter','isArray','listParentSegments','limit','getJourney','getActivationSankeyChart','latestJourneyId','allColumns','/detail','activation_sankey_charts','httpClient','createJourneyVersion','?realtime=','getJourneyStatistics','createActivation','/activations','getAudienceBehaviors','journeyActivationStep','links','lastVersionNumber','/entities/journeys?folder_id=','updateActivation','listSegments','exitSizes','createSegmentFolder','parentFolder','/syndications','1824690lmJBPD','/segments/query','runParentSegment','authHeaders','listSegmentFolders','enteredSize','query','/segments/','/entities/journey_bundles/','syndicationBehavior','chart','2394fdgaDz','name','columns','listActivations','connectorConfig','metaData','site','exitOrJumpSize','listEntitiesByFolder','journeyStageStatistics','/entities/by-folder/','createJourney','timezone','description','journeyId','?depth=','data','stepInfluxes','listJourneys','length','none','/attributes','getConversionSankeyChart','goalSize','GET','scheduleType','3088nXyQUV','journeyBundleName','emailRecipients','proxy','532215LtUGza','milestoneSize','attributes','/behaviors','/pause','object','7EMWSRP','getJourneyActivation','segment-journey','updatedAt','application/vnd.treasuredata.v1+json','sql','/entities/parent_segments/','/journeys_appendable','getParentSegment','relationships','PUT','pauseJourney','getSegmentSQLFromRule','parentFolderId','/audiences','68724eaSVSX','/run','checkJourneyAppendable','listJourneyActivations','createdAt','/syndications/','/folders','getParentSegmentSQL','updateSegment','createParentSegment','request','getSegment','journeyStageId','journeys','32RLHMqR','accessToken','570WlMsVd','audienceId','exitOrJumpRate','/entities/segments/','/resume','set'];a88_0x5880=function(){return _0x1041db;};return a88_0x5880();}function extractJsonApiAttributes(_0x183575){const _0x1eab9d=a88_0x42d0d0;if(!_0x183575||typeof _0x183575!==_0x1eab9d(0xe5))return[];const _0x4fe037=_0x183575;if(!Array[_0x1eab9d(0x9d)](_0x4fe037[_0x1eab9d(0xd2)]))return[];return _0x4fe037[_0x1eab9d(0xd2)][_0x1eab9d(0x9c)](_0x1cfff9=>!!_0x1cfff9&&typeof _0x1cfff9==='object')['map'](_0x1530c6=>_0x1530c6['attributes'])['filter'](_0x5115e9=>!!_0x5115e9&&typeof _0x5115e9==='object');}export function parseConversionSankeyResponse(_0xd8ecc0){const _0x2c3d21=a88_0x42d0d0,_0xcf4081={'nodes':[],'links':[]},_0x5d3844=extractJsonApiAttributes(_0xd8ecc0);if(_0x5d3844[_0x2c3d21(0xd5)]===0x0)return _0xcf4081;const _0x1eb5fb=_0x5d3844[0x0],_0x1d3f2d=_0x1eb5fb[_0x2c3d21(0xc1)];if(_0x1d3f2d&&typeof _0x1d3f2d==='object'){const {nodes:_0x158c77,links:_0x2249c8}=extractSankeyChart(_0x1d3f2d);return{'nodes':_0x158c77,'links':_0x2249c8,...typeof _0x1eb5fb[_0x2c3d21(0xe9)]==='string'?{'updatedAt':_0x1eb5fb[_0x2c3d21(0xe9)]}:{}};}return _0xcf4081;}export function parseActivationSankeyResponse(_0x5445f7){const _0x232168=a88_0x42d0d0,_0x22a11d=extractJsonApiAttributes(_0x5445f7);if(_0x22a11d[_0x232168(0xd5)]>0x0)return _0x22a11d[_0x232168(0x98)](_0x3c8463=>{const _0x16c6ff=_0x232168,_0x2ede8a=_0x3c8463['chart'],{nodes:_0x368652,links:_0x2c2f9b}=_0x2ede8a&&typeof _0x2ede8a===_0x16c6ff(0xe5)?extractSankeyChart(_0x2ede8a):{'nodes':[],'links':[]};return{'journeyStageId':typeof _0x3c8463['journeyStageId']==='string'?_0x3c8463[_0x16c6ff(0x101)]:'','nodes':_0x368652,'links':_0x2c2f9b,...typeof _0x3c8463[_0x16c6ff(0xe9)]==='string'?{'updatedAt':_0x3c8463[_0x16c6ff(0xe9)]}:{}};});if(Array[_0x232168(0x9d)](_0x5445f7))return _0x5445f7;return[];}export function parseJourneyBundleResponse(_0x4d153c){const _0x5b4c76=a88_0x42d0d0;if(!_0x4d153c||typeof _0x4d153c!==_0x5b4c76(0xe5))throw new Error('Invalid\x20journey\x20bundle\x20response');const _0x28068d=_0x4d153c,_0x2a52df=_0x28068d[_0x5b4c76(0xd2)],_0x2874f4=_0x2a52df?.[_0x5b4c76(0xe2)]??_0x28068d,_0x266588=Array[_0x5b4c76(0x9d)](_0x2874f4[_0x5b4c76(0x102)])?_0x2874f4[_0x5b4c76(0x102)]:[],_0x2fa62a=_0x266588[_0x5b4c76(0x98)](_0x299dba=>{const _0x3a4aae=_0x5b4c76;if(!_0x299dba||typeof _0x299dba!==_0x3a4aae(0xe5))return _0x299dba;const _0x1d1044=_0x299dba;if(_0x1d1044[_0x3a4aae(0xd2)]&&typeof _0x1d1044[_0x3a4aae(0xd2)]===_0x3a4aae(0xe5))return _0x1d1044['data'];return _0x1d1044;});return{'name':_0x2874f4['name'],'description':_0x2874f4[_0x5b4c76(0xcf)]??null,'latestJourneyId':_0x2874f4[_0x5b4c76(0xa2)],'lastVersionNumber':_0x2874f4[_0x5b4c76(0xaf)],'journeys':_0x2fa62a};}
1
+ const a88_0x3f7fc1=a88_0x2bb4;function a88_0x45f0(){const _0x314db8=['/segments','updateJourney','limit','POST','createdAt','/journeys_appendable','/segments/query','versionNumber','application/vnd.treasuredata.v1+json','size','httpClient','listActivations','lastVersionNumber','/pause','request','updateActivation','enteredSize','getParentSegment','createSegment','emailRecipients','13143159YweqZT','journeys','links','activation_sankey_charts','exitOrJumpSize','39LiezBl','GET','/entities/journeys','resumeJourney','goalSize','/folders','checkJourneyAppendable','accessToken','5065260nnUNOm','authHeaders','getSegmentSQL','updateParentSegment','listJourneyActivations','/syndications','&with_rule=','apiKey','getJourneyActivation','runAfterJourneyRefresh','listEntitiesByFolder','listParentSegments','/audiences','rule','/entities/parent_segments/','PATCH','createJourney','updateSegment','/entities/journeys/','runParentSegment','description','isArray','DELETE','notifyOn','listJourneys','map','getJourneyBundle','segment-journey','getConversionSankeyChart','included','name','/entities/folders/','journeyId','updatedAt','stepSizes','/syndications/','string','createSegmentFolder','journeyActivationStep','filter','metaData','/detail','getParentSegmentFull','updateJourneyDetail','PUT','completionRate','203948KlYwkM','/attributes','createJourneyActivation','statistics','4904NCjcVz','allColumns','attributes','connectorConfig','sql','getAudienceAttributes','completeMilestoneRate','state','/entities/parent_segments','type','/activations','157552Zoqznf','chart','activationTemplateId','data','from','getSegmentFolder','getAudienceBehaviors','requestSegmentSQL','object','audienceId','cdp','listJourneysWithDetails','getActivation','journeyStageId','/audiences/','timezone','journeyBundleName','/segments/','/activations/','pauseJourney','latestJourneyId','length','site','scheduleType','journeyStageStatistics','parentFolderId','getSegment','history','exitSizes','application/json','columns','?depth=','/entities/journeys?folder_id=','/entities/journey_bundles/','conversion_sankey_charts','290436MKISsD','/journeys','getActivationSankeyChart','getParentSegmentSQL','set','countPopulation','5051835kCViht','?realtime=','createParentSegment','relationships','getJourney','7476wUslQM'];a88_0x45f0=function(){return _0x314db8;};return a88_0x45f0();}(function(_0x599f70,_0x27ce05){const _0x429e97=a88_0x2bb4,_0x52dd70=_0x599f70();while(!![]){try{const _0x18710b=-parseInt(_0x429e97(0x1e1))/0x1+parseInt(_0x429e97(0x1d2))/0x2+-parseInt(_0x429e97(0x19c))/0x3*(-parseInt(_0x429e97(0x177))/0x4)+parseInt(_0x429e97(0x17d))/0x5+parseInt(_0x429e97(0x1a4))/0x6+-parseInt(_0x429e97(0x182))/0x7*(parseInt(_0x429e97(0x1d6))/0x8)+-parseInt(_0x429e97(0x197))/0x9;if(_0x18710b===_0x27ce05)break;else _0x52dd70['push'](_0x52dd70['shift']());}catch(_0x47437d){_0x52dd70['push'](_0x52dd70['shift']());}}}(a88_0x45f0,0x994a9));import{HTTPClient}from'./http-client.js';function a88_0x2bb4(_0x12edd0,_0x4e91ea){_0x12edd0=_0x12edd0-0x173;const _0x45f0a6=a88_0x45f0();let _0x2bb42d=_0x45f0a6[_0x12edd0];return _0x2bb42d;}import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class CDPApiClient{['httpClient'];[a88_0x3f7fc1(0x1a5)];constructor(_0x7b3d28){const _0x286a56=a88_0x3f7fc1,_0x24effc=getEndpoint(_0x7b3d28[_0x286a56(0x1f7)],_0x286a56(0x1eb));this[_0x286a56(0x1a5)]=toHeaderRecord(getAuthHeaders(_0x7b3d28[_0x286a56(0x1f7)],_0x7b3d28[_0x286a56(0x1ab)],_0x7b3d28[_0x286a56(0x1a3)])),this['httpClient']=new HTTPClient(_0x24effc,{...this['authHeaders'],'Accept':_0x286a56(0x18b),'Content-Type':_0x286a56(0x1fe)},{'proxy':_0x7b3d28['proxy']});}async[a88_0x3f7fc1(0x1af)](){const _0x2d4a14=a88_0x3f7fc1,_0x316220=_0x2d4a14(0x1de),_0x51deb9=await this['httpClient'][_0x2d4a14(0x191)]('GET',_0x316220);return Array[_0x2d4a14(0x1b9)](_0x51deb9)?_0x51deb9:_0x51deb9[_0x2d4a14(0x1e4)];}async[a88_0x3f7fc1(0x194)](_0x57dff8){const _0x2ad786=a88_0x3f7fc1,_0xddf2c6=_0x2ad786(0x1b2)+_0x57dff8,_0x53967e=await this[_0x2ad786(0x18d)]['request'](_0x2ad786(0x19d),_0xddf2c6);return'data'in _0x53967e?_0x53967e['data']:_0x53967e;}async['listSegments'](_0x4f59b2){const _0x289968=a88_0x3f7fc1,_0xec6c58=_0x289968(0x1ef)+_0x4f59b2+_0x289968(0x183),_0x55991b=await this[_0x289968(0x18d)]['request'](_0x289968(0x19d),_0xec6c58);return Array[_0x289968(0x1b9)](_0x55991b)?_0x55991b:_0x55991b['data'];}async[a88_0x3f7fc1(0x1fb)](_0x46a7d4,_0x47275d){const _0xf6a773=a88_0x3f7fc1,_0x122d88=_0xf6a773(0x1ef)+_0x46a7d4+_0xf6a773(0x1f2)+_0x47275d,_0x4b96bf=await this['httpClient'][_0xf6a773(0x191)](_0xf6a773(0x19d),_0x122d88);return'data'in _0x4b96bf?_0x4b96bf[_0xf6a773(0x1e4)]:_0x4b96bf;}async['getSegmentEntity'](_0x39ec94){const _0x286dde=a88_0x3f7fc1,_0x36c1a7='/entities/segments/'+_0x39ec94,_0x2e3bea=await this[_0x286dde(0x18d)]['request'](_0x286dde(0x19d),_0x36c1a7);if(_0x286dde(0x1e4)in _0x2e3bea){const _0x26e02d=_0x2e3bea[_0x286dde(0x1e4)];if(_0x286dde(0x1d8)in _0x26e02d&&_0x26e02d[_0x286dde(0x1d8)]&&typeof _0x26e02d[_0x286dde(0x1d8)]===_0x286dde(0x1e9)){const _0x57efc6=_0x26e02d[_0x286dde(0x1d8)];return{'id':_0x26e02d['id'],'name':_0x57efc6['name'],..._0x57efc6};}return _0x26e02d;}return _0x2e3bea;}async['listSegmentFolders'](_0x1fd5ef){const _0x26c066=a88_0x3f7fc1,_0x2f8826=_0x26c066(0x1ef)+_0x1fd5ef+_0x26c066(0x1a1),_0x1a6b7b=await this[_0x26c066(0x18d)][_0x26c066(0x191)]('GET',_0x2f8826);return Array['isArray'](_0x1a6b7b)?_0x1a6b7b:_0x1a6b7b['data'];}async[a88_0x3f7fc1(0x1e6)](_0x4d73d9){const _0x340c99=a88_0x3f7fc1,_0x577da8=_0x340c99(0x1c3)+_0x4d73d9,_0x455844=await this['httpClient'][_0x340c99(0x191)]('GET',_0x577da8);return'data'in _0x455844?_0x455844['data']:_0x455844;}async[a88_0x3f7fc1(0x1ae)](_0x1dc088,_0x137e7d=0x20,_0x46864a=![]){const _0x202936=a88_0x3f7fc1,_0x43f1da='/entities/by-folder/'+_0x1dc088+_0x202936(0x173)+_0x137e7d+_0x202936(0x1aa)+_0x46864a;return await this[_0x202936(0x18d)]['request'](_0x202936(0x19d),_0x43f1da);}async[a88_0x3f7fc1(0x18e)](_0x53e7d1,_0xfb58db){const _0x442ab9=a88_0x3f7fc1,_0x43a6e7=_0x442ab9(0x1ef)+_0x53e7d1+_0x442ab9(0x1f2)+_0xfb58db+'/syndications',_0x4cd111=await this[_0x442ab9(0x18d)][_0x442ab9(0x191)](_0x442ab9(0x19d),_0x43a6e7);return Array[_0x442ab9(0x1b9)](_0x4cd111)?_0x4cd111:_0x4cd111[_0x442ab9(0x1e4)];}async[a88_0x3f7fc1(0x1ed)](_0x2bded9,_0x42c577,_0xfaac4){const _0x19c0c8=a88_0x3f7fc1,_0x16f419=_0x19c0c8(0x1ef)+_0x2bded9+'/segments/'+_0x42c577+_0x19c0c8(0x1c7)+_0xfaac4,_0x128a0a=await this[_0x19c0c8(0x18d)][_0x19c0c8(0x191)](_0x19c0c8(0x19d),_0x16f419);return'data'in _0x128a0a?_0x128a0a['data']:_0x128a0a;}async['createActivation'](_0x2b6242,_0x4e6c55,_0xe47400){const _0x283d5e=a88_0x3f7fc1,_0x5483ea=_0x283d5e(0x1ef)+_0x2b6242+_0x283d5e(0x1f2)+_0x4e6c55+_0x283d5e(0x1a9),_0x5a7b04=await this[_0x283d5e(0x18d)][_0x283d5e(0x191)](_0x283d5e(0x186),_0x5483ea,{'body':_0xe47400});return _0x5a7b04;}async[a88_0x3f7fc1(0x192)](_0x3492c1,_0x3e9e1b,_0x5e79e8,_0x110b19){const _0x3e8631=a88_0x3f7fc1,_0x29e2c2=_0x3e8631(0x1ef)+_0x3492c1+_0x3e8631(0x1f2)+_0x3e9e1b+_0x3e8631(0x1c7)+_0x5e79e8,_0x1c31fe=await this[_0x3e8631(0x18d)][_0x3e8631(0x191)](_0x3e8631(0x1d0),_0x29e2c2,{'body':_0x110b19});return _0x1c31fe;}async['deleteActivation'](_0x7cc93c,_0x5383cb,_0x10db1d){const _0x2d8347=a88_0x3f7fc1,_0x4c4638=_0x2d8347(0x1ef)+_0x7cc93c+_0x2d8347(0x1f2)+_0x5383cb+_0x2d8347(0x1c7)+_0x10db1d;await this[_0x2d8347(0x18d)][_0x2d8347(0x191)](_0x2d8347(0x1ba),_0x4c4638);}async[a88_0x3f7fc1(0x17a)](_0x34517a){return this['requestSegmentSQL'](_0x34517a);}async['getSegmentSQLFromRule'](_0x2ac3f1,_0x50dabe){const _0x3a6d88=a88_0x3f7fc1;return this[_0x3a6d88(0x1e8)](_0x2ac3f1,_0x50dabe);}async[a88_0x3f7fc1(0x1a6)](_0x5e8f7a,_0xd29a0c){const _0x4caf05=a88_0x3f7fc1,_0xaad43b=await this[_0x4caf05(0x1fb)](_0x5e8f7a,_0xd29a0c),_0x3e8012=_0x4caf05(0x1b1)in _0xaad43b&&_0xaad43b[_0x4caf05(0x1b1)]?_0xaad43b[_0x4caf05(0x1b1)]:undefined;return this[_0x4caf05(0x1e8)](_0x5e8f7a,_0x3e8012);}async[a88_0x3f7fc1(0x1e8)](_0xc440b0,_0x14eea3){const _0x34e8df=a88_0x3f7fc1,_0x388f74=_0x34e8df(0x1ef)+_0xc440b0+_0x34e8df(0x189),_0x4fbcd7={'format':_0x34e8df(0x1da)};_0x14eea3&&(_0x4fbcd7[_0x34e8df(0x1b1)]=_0x14eea3);const _0x3dc8a6=await this[_0x34e8df(0x18d)][_0x34e8df(0x191)](_0x34e8df(0x186),_0x388f74,{'body':_0x4fbcd7});return _0x3dc8a6[_0x34e8df(0x1da)]||_0x3dc8a6['query']||'';}async[a88_0x3f7fc1(0x17f)](_0x4cb5a4){const _0x3b2169=a88_0x3f7fc1,_0x25de7f=_0x3b2169(0x1b0),_0x1eab9c=await this[_0x3b2169(0x18d)][_0x3b2169(0x191)]('POST',_0x25de7f,{'body':_0x4cb5a4,'headers':{'Content-Type':_0x3b2169(0x18b)}});return _0x1eab9c;}async[a88_0x3f7fc1(0x1a7)](_0x349002,_0x37e689){const _0x1e5584=a88_0x3f7fc1,_0x541333=_0x1e5584(0x1ef)+_0x349002,_0x4c177a=await this[_0x1e5584(0x18d)][_0x1e5584(0x191)](_0x1e5584(0x1d0),_0x541333,{'body':_0x37e689,'headers':{'Content-Type':_0x1e5584(0x18b)}});return _0x4c177a;}async[a88_0x3f7fc1(0x1ce)](_0x2c1da9){const _0x558744=a88_0x3f7fc1,_0x35f27c=_0x558744(0x1ef)+_0x2c1da9,_0x226f6c=await this['httpClient']['request'](_0x558744(0x19d),_0x35f27c,{'headers':{'Accept':_0x558744(0x18b)}});return _0x226f6c;}async[a88_0x3f7fc1(0x1db)](_0x5ee7eb){const _0xfa1471=a88_0x3f7fc1,_0x3a342d='/audiences/'+_0x5ee7eb+_0xfa1471(0x1d3),_0x22e600=await this[_0xfa1471(0x18d)][_0xfa1471(0x191)](_0xfa1471(0x19d),_0x3a342d);return _0x22e600;}async[a88_0x3f7fc1(0x1e7)](_0x1a8801,_0x2542bf){const _0x463c3b=a88_0x3f7fc1;let _0x3699b7=_0x463c3b(0x1ef)+_0x1a8801+'/behaviors';_0x2542bf!==undefined&&(_0x3699b7+=_0x463c3b(0x17e)+_0x2542bf);const _0x1e26f7=await this[_0x463c3b(0x18d)][_0x463c3b(0x191)](_0x463c3b(0x19d),_0x3699b7);return _0x1e26f7;}async[a88_0x3f7fc1(0x195)](_0x3fa9d9,_0x8ab097){const _0x510222=a88_0x3f7fc1,_0x1e05fb='/audiences/'+_0x3fa9d9+_0x510222(0x183),_0x54e1c4=await this[_0x510222(0x18d)][_0x510222(0x191)](_0x510222(0x186),_0x1e05fb,{'body':_0x8ab097});return _0x54e1c4;}async['createJourneySegment'](_0x324594){const _0x4736f6=a88_0x3f7fc1,_0x46c323='/entities/segments',_0x5cb8e3={'type':_0x4736f6(0x1bf),'attributes':{'name':_0x324594['name'],'description':_0x324594[_0x4736f6(0x1b8)]||'','journeyId':_0x324594[_0x4736f6(0x1c4)],'rule':_0x324594[_0x4736f6(0x1b1)],'countPopulation':_0x324594[_0x4736f6(0x17c)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x324594[_0x4736f6(0x1fa)],'type':'folder-segment'}}}},_0x1aba01=await this[_0x4736f6(0x18d)][_0x4736f6(0x191)]('POST',_0x46c323,{'body':_0x5cb8e3,'headers':{'Content-Type':_0x4736f6(0x18b)}});return _0x1aba01[_0x4736f6(0x1e4)]['id'];}async[a88_0x3f7fc1(0x1b5)](_0x11c035,_0x40893e,_0x104657){const _0x6ae804=a88_0x3f7fc1,_0xaf6090=_0x6ae804(0x1ef)+_0x11c035+_0x6ae804(0x1f2)+_0x40893e,_0x2db912=await this[_0x6ae804(0x18d)][_0x6ae804(0x191)](_0x6ae804(0x1d0),_0xaf6090,{'body':_0x104657});return _0x2db912;}async['deleteSegment'](_0x46f2be){const _0x40ef72=a88_0x3f7fc1,_0x322e32='/entities/segments/'+_0x46f2be;await this[_0x40ef72(0x18d)][_0x40ef72(0x191)](_0x40ef72(0x1ba),_0x322e32);}async[a88_0x3f7fc1(0x1c9)](_0x14d83b,_0x58adc9){const _0x18e763=a88_0x3f7fc1,_0xe77e49=_0x18e763(0x1ef)+_0x14d83b+'/folders',_0x43bce0=await this['httpClient']['request'](_0x18e763(0x186),_0xe77e49,{'body':_0x58adc9});if(_0x18e763(0x1e4)in _0x43bce0&&_0x43bce0[_0x18e763(0x1e4)]){const _0x45f3d1=_0x43bce0['data'];return{'id':_0x45f3d1['id'],'name':_0x45f3d1[_0x18e763(0x1c2)],'description':_0x45f3d1[_0x18e763(0x1b8)],'audienceId':_0x45f3d1[_0x18e763(0x1ea)]||String(_0x14d83b),'parentFolderId':_0x45f3d1['parentFolderId'],'createdAt':_0x45f3d1[_0x18e763(0x187)],'updatedAt':_0x45f3d1[_0x18e763(0x1c5)]};}return _0x43bce0;}async[a88_0x3f7fc1(0x1b7)](_0x455df2){const _0x28a379=a88_0x3f7fc1,_0x26bd25='/audiences/'+_0x455df2+'/run',_0x3057a7=await this[_0x28a379(0x18d)][_0x28a379(0x191)]('POST',_0x26bd25);return _0x3057a7;}async[a88_0x3f7fc1(0x1bc)](_0x10b48d){const _0x5378b8=a88_0x3f7fc1,_0x1b0b10=_0x5378b8(0x174)+_0x10b48d,_0x51bb14=await this[_0x5378b8(0x18d)][_0x5378b8(0x191)](_0x5378b8(0x19d),_0x1b0b10);return _0x51bb14[_0x5378b8(0x1e4)][_0x5378b8(0x1bd)](_0x354446=>({'id':_0x354446['id'],'name':_0x354446[_0x5378b8(0x1d8)][_0x5378b8(0x1c2)],'journeyBundleName':_0x354446[_0x5378b8(0x1d8)][_0x5378b8(0x1f1)],'journeyBundleId':_0x354446['attributes']['journeyBundleId'],'versionNumber':_0x354446[_0x5378b8(0x1d8)][_0x5378b8(0x18a)],'description':_0x354446[_0x5378b8(0x1d8)]['description'],'state':_0x354446[_0x5378b8(0x1d8)][_0x5378b8(0x1dd)],'paused':_0x354446['attributes']['paused'],'audienceId':_0x354446[_0x5378b8(0x1d8)][_0x5378b8(0x1ea)],'folderId':_0x354446[_0x5378b8(0x180)]?.['parentFolder']?.[_0x5378b8(0x1e4)]?.['id'],'createdAt':_0x354446['attributes']['createdAt'],'updatedAt':_0x354446[_0x5378b8(0x1d8)]['updatedAt']}));}async[a88_0x3f7fc1(0x1ec)](_0x417f39){const _0x2063dd=a88_0x3f7fc1,_0x40d769=_0x2063dd(0x174)+_0x417f39,_0x1a322d=await this[_0x2063dd(0x18d)][_0x2063dd(0x191)](_0x2063dd(0x19d),_0x40d769),_0xee82ea=new Map();if(_0x1a322d['included'])for(const _0xcdb56 of _0x1a322d[_0x2063dd(0x1c1)]){_0xcdb56[_0x2063dd(0x1df)]==='journeyActivationStep'&&_0xee82ea[_0x2063dd(0x17b)](_0xcdb56['id'],_0xcdb56);}return{'journeys':_0x1a322d[_0x2063dd(0x1e4)],'activationStepsById':_0xee82ea};}async[a88_0x3f7fc1(0x181)](_0x55c46f){const _0x499e58=a88_0x3f7fc1,_0x136929='/entities/journeys/'+_0x55c46f,_0x1490c8=await this[_0x499e58(0x18d)]['request'](_0x499e58(0x19d),_0x136929);return _0x499e58(0x1e4)in _0x1490c8?_0x1490c8[_0x499e58(0x1e4)]:_0x1490c8;}async[a88_0x3f7fc1(0x1be)](_0x5d5f82){const _0x175207=a88_0x3f7fc1,_0x5c1761='/entities/journey_bundles/'+_0x5d5f82,_0x423fd9=await this[_0x175207(0x18d)]['request'](_0x175207(0x19d),_0x5c1761);return parseJourneyBundleResponse(_0x423fd9);}async[a88_0x3f7fc1(0x1a2)](_0x1d7e51){const _0x1ec069=a88_0x3f7fc1,_0x4e49d3='/entities/journey_bundles/'+_0x1d7e51+_0x1ec069(0x188);await this[_0x1ec069(0x18d)]['request'](_0x1ec069(0x19d),_0x4e49d3);}async['createJourneyVersion'](_0x4b9362,_0xc68d78){const _0x463f62=a88_0x3f7fc1,_0x11d4b5=_0x463f62(0x175)+_0x4b9362+_0x463f62(0x178),_0x2980a3=await this[_0x463f62(0x18d)][_0x463f62(0x191)](_0x463f62(0x186),_0x11d4b5,{'body':_0xc68d78});return _0x463f62(0x1e4)in _0x2980a3?_0x2980a3['data']:_0x2980a3;}async[a88_0x3f7fc1(0x1b4)](_0x3f6f68){const _0x5a36a6=a88_0x3f7fc1,_0x49a092=_0x5a36a6(0x19e),_0x4fd626=await this[_0x5a36a6(0x18d)][_0x5a36a6(0x191)](_0x5a36a6(0x186),_0x49a092,{'body':_0x3f6f68,'headers':{'Content-Type':_0x5a36a6(0x18b)}});return _0x5a36a6(0x1e4)in _0x4fd626?_0x4fd626[_0x5a36a6(0x1e4)]:_0x4fd626;}async[a88_0x3f7fc1(0x184)](_0x760c31,_0x71d010){const _0x3fcab3=a88_0x3f7fc1,_0x355203=_0x3fcab3(0x1b6)+_0x760c31,_0x49ac09=await this[_0x3fcab3(0x18d)]['request'](_0x3fcab3(0x1b3),_0x355203,{'body':_0x71d010,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x3fcab3(0x1e4)in _0x49ac09?_0x49ac09['data']:_0x49ac09;}async[a88_0x3f7fc1(0x1cf)](_0x5c451a,_0x2ccbf4){const _0x16209e=a88_0x3f7fc1,_0x247e3d=_0x16209e(0x1b6)+_0x5c451a+_0x16209e(0x1cd),_0x1d730a=await this[_0x16209e(0x18d)][_0x16209e(0x191)]('POST',_0x247e3d,{'body':_0x2ccbf4,'headers':{'Content-Type':_0x16209e(0x18b)}});return'data'in _0x1d730a?_0x1d730a[_0x16209e(0x1e4)]:_0x1d730a;}async['getJourneyStatistics'](_0x1a38ea,_0x30d8f5){const _0x1ef6dc=a88_0x3f7fc1,_0x451d78=buildJourneyEndpoint(_0x1a38ea,_0x1ef6dc(0x1d5),_0x30d8f5),_0x4e0aed=await this[_0x1ef6dc(0x18d)][_0x1ef6dc(0x191)]('GET',_0x451d78);return parseJourneyStatisticsResponse(_0x4e0aed);}async[a88_0x3f7fc1(0x1c0)](_0x12b29c,_0x73d13f){const _0x2f90f1=a88_0x3f7fc1,_0x338a86=buildJourneyEndpoint(_0x12b29c,_0x2f90f1(0x176),_0x73d13f),_0xc7e49b=await this[_0x2f90f1(0x18d)]['request'](_0x2f90f1(0x19d),_0x338a86);return parseConversionSankeyResponse(_0xc7e49b);}async[a88_0x3f7fc1(0x179)](_0x3ba72d,_0x12450f){const _0x29e8c1=a88_0x3f7fc1,_0x70b4bc=buildJourneyEndpoint(_0x3ba72d,_0x29e8c1(0x19a),_0x12450f),_0x1936f4=await this[_0x29e8c1(0x18d)]['request']('GET',_0x70b4bc);return parseActivationSankeyResponse(_0x1936f4);}async[a88_0x3f7fc1(0x1f4)](_0x5d5c2a){const _0x4f79ce=a88_0x3f7fc1,_0x1aab05='/entities/journeys/'+_0x5d5c2a+_0x4f79ce(0x190),_0x5bafcc=await this['httpClient'][_0x4f79ce(0x191)](_0x4f79ce(0x1b3),_0x1aab05);return _0x4f79ce(0x1e4)in _0x5bafcc?_0x5bafcc[_0x4f79ce(0x1e4)]:_0x5bafcc;}async[a88_0x3f7fc1(0x19f)](_0x494e51){const _0x47310c=a88_0x3f7fc1,_0x1f5523='/entities/journeys/'+_0x494e51+'/resume',_0x570293=await this['httpClient'][_0x47310c(0x191)](_0x47310c(0x1b3),_0x1f5523);return _0x47310c(0x1e4)in _0x570293?_0x570293[_0x47310c(0x1e4)]:_0x570293;}async[a88_0x3f7fc1(0x1ac)](_0x4a8f61,_0x3029c5){const _0x425fc0=a88_0x3f7fc1,_0x110e71='/entities/journeys/'+_0x4a8f61+_0x425fc0(0x1f3)+_0x3029c5,_0x4640fd=await this[_0x425fc0(0x18d)]['request'](_0x425fc0(0x19d),_0x110e71);return _0x425fc0(0x1e4)in _0x4640fd?_0x4640fd[_0x425fc0(0x1e4)]:_0x4640fd;}async[a88_0x3f7fc1(0x1a8)](_0xd641ab){const _0x423be5=a88_0x3f7fc1,_0x14f147='/entities/journeys/'+_0xd641ab+_0x423be5(0x1e0),_0x4bf5ea=await this[_0x423be5(0x18d)][_0x423be5(0x191)]('GET',_0x14f147);return'data'in _0x4bf5ea?_0x4bf5ea['data']:_0x4bf5ea;}async[a88_0x3f7fc1(0x1d4)](_0x237687,_0x49069b){const _0x3fa3f0=a88_0x3f7fc1,_0x37c45d=_0x3fa3f0(0x1b6)+_0x237687+_0x3fa3f0(0x1e0),_0x25a00d={'name':_0x49069b[_0x3fa3f0(0x1c2)],'scheduleType':_0x49069b[_0x3fa3f0(0x1f8)]||'none','connectionId':String(_0x49069b['connectionId']),'columns':_0x49069b[_0x3fa3f0(0x1ff)]??[],'notifyOn':_0x49069b[_0x3fa3f0(0x1bb)]??[],..._0x49069b[_0x3fa3f0(0x1b8)]!==undefined&&{'description':_0x49069b['description']},..._0x49069b[_0x3fa3f0(0x1d7)]!==undefined&&{'allColumns':_0x49069b[_0x3fa3f0(0x1d7)]},..._0x49069b[_0x3fa3f0(0x1f0)]!==undefined&&{'timezone':_0x49069b[_0x3fa3f0(0x1f0)]},..._0x49069b[_0x3fa3f0(0x1d9)]!==undefined&&{'connectorConfig':_0x49069b[_0x3fa3f0(0x1d9)]},..._0x49069b[_0x3fa3f0(0x196)]!==undefined&&{'emailRecipients':_0x49069b[_0x3fa3f0(0x196)]},..._0x49069b['activationTemplateId']!==undefined&&{'activationTemplateId':_0x49069b[_0x3fa3f0(0x1e3)]},..._0x49069b['syndicationBehavior']!==undefined&&{'syndicationBehavior':_0x49069b['syndicationBehavior']}},_0x476e3b=await this[_0x3fa3f0(0x18d)][_0x3fa3f0(0x191)](_0x3fa3f0(0x186),_0x37c45d,{'body':{'type':_0x3fa3f0(0x1ca),'attributes':{'runAfterJourneyRefresh':_0x49069b[_0x3fa3f0(0x1ad)]??![],'activationParams':_0x25a00d}},'headers':{'Content-Type':_0x3fa3f0(0x18b)}});return _0x3fa3f0(0x1e4)in _0x476e3b?_0x476e3b[_0x3fa3f0(0x1e4)]:_0x476e3b;}}export function buildJourneyEndpoint(_0x28b94c,_0x33ef53,_0x38b628){const _0x25310c=a88_0x3f7fc1,_0x2cb6e9=_0x25310c(0x1b6)+_0x28b94c+'/'+_0x33ef53,_0x10473f=new URLSearchParams();if(_0x38b628?.['from'])_0x10473f['set'](_0x25310c(0x1e5),_0x38b628[_0x25310c(0x1e5)]);if(_0x38b628?.['to'])_0x10473f[_0x25310c(0x17b)]('to',_0x38b628['to']);if(_0x38b628?.['limit']!=null)_0x10473f[_0x25310c(0x17b)](_0x25310c(0x185),String(_0x38b628[_0x25310c(0x185)]));const _0x4807fc=_0x10473f['toString']();return _0x4807fc?_0x2cb6e9+'?'+_0x4807fc:_0x2cb6e9;}export function parseJourneyStatisticsResponse(_0x44da8a){const _0xde856=a88_0x3f7fc1;if(!(_0xde856(0x1e4)in _0x44da8a))return _0x44da8a;const _0x226fde=_0x44da8a[_0xde856(0x1e4)];if(!(_0xde856(0x1d8)in _0x226fde)||!_0x226fde[_0xde856(0x1d8)]||typeof _0x226fde['attributes']!==_0xde856(0x1e9))return _0x226fde;const _0x5dbb61=_0x226fde['attributes'],_0x14dbf3={'journeyId':_0x5dbb61[_0xde856(0x1c4)],'size':_0x5dbb61['size'],'goalSize':_0x5dbb61[_0xde856(0x1a0)],'enteredSize':_0x5dbb61[_0xde856(0x193)],'completionRate':_0x5dbb61[_0xde856(0x1d1)],'exitOrJumpSize':_0x5dbb61[_0xde856(0x19b)],'exitOrJumpRate':_0x5dbb61['exitOrJumpRate'],'stages':(_0x5dbb61[_0xde856(0x1f9)]??[])['map'](_0x555f4e=>{const _0x355cef=_0xde856,_0x13cca7={'id':_0x555f4e['id'],'enteredSize':_0x555f4e[_0x355cef(0x193)],'milestoneSize':_0x555f4e['milestoneSize'],'completeMilestoneRate':_0x555f4e[_0x355cef(0x1dc)],'exitOrJumpSize':_0x555f4e['exitOrJumpSize'],'exitOrJumpRate':_0x555f4e['exitOrJumpRate'],'size':_0x555f4e[_0x355cef(0x18c)]};if(_0x555f4e[_0x355cef(0x1fc)])_0x13cca7[_0x355cef(0x1fc)]=_0x555f4e[_0x355cef(0x1fc)];if(_0x555f4e['stepSizes'])_0x13cca7[_0x355cef(0x1c6)]=_0x555f4e[_0x355cef(0x1c6)];if(_0x555f4e['stepInfluxes'])_0x13cca7['stepInfluxes']=_0x555f4e['stepInfluxes'];if(_0x555f4e[_0x355cef(0x1fd)])_0x13cca7[_0x355cef(0x1fd)]=_0x555f4e[_0x355cef(0x1fd)];return _0x13cca7;})};return Array[_0xde856(0x1b9)](_0x5dbb61[_0xde856(0x1fc)])&&(_0x14dbf3[_0xde856(0x1fc)]=_0x5dbb61[_0xde856(0x1fc)]),_0x14dbf3;}function extractSankeyChart(_0x5c4b15){const _0x4688da=a88_0x3f7fc1,_0x1832b4=Array[_0x4688da(0x1b9)](_0x5c4b15['data'])?_0x5c4b15[_0x4688da(0x1e4)]:[],_0x2128ce=_0x5c4b15[_0x4688da(0x1cc)]&&typeof _0x5c4b15[_0x4688da(0x1cc)]===_0x4688da(0x1e9)?_0x5c4b15[_0x4688da(0x1cc)]:{},_0xc82086=Array[_0x4688da(0x1b9)](_0x2128ce[_0x4688da(0x199)])?_0x2128ce['links']:[];return{'nodes':_0x1832b4,'links':_0xc82086};}function extractJsonApiAttributes(_0x33007e){const _0x29713b=a88_0x3f7fc1;if(!_0x33007e||typeof _0x33007e!==_0x29713b(0x1e9))return[];const _0x22da30=_0x33007e;if(!Array['isArray'](_0x22da30['data']))return[];return _0x22da30[_0x29713b(0x1e4)]['filter'](_0x45c814=>!!_0x45c814&&typeof _0x45c814===_0x29713b(0x1e9))[_0x29713b(0x1bd)](_0x2c47ab=>_0x2c47ab[_0x29713b(0x1d8)])[_0x29713b(0x1cb)](_0x1a3e75=>!!_0x1a3e75&&typeof _0x1a3e75===_0x29713b(0x1e9));}export function parseConversionSankeyResponse(_0x272357){const _0x118861=a88_0x3f7fc1,_0x374a74={'nodes':[],'links':[]},_0x8c4dbc=extractJsonApiAttributes(_0x272357);if(_0x8c4dbc[_0x118861(0x1f6)]===0x0)return _0x374a74;const _0x4ec391=_0x8c4dbc[0x0],_0x7e244b=_0x4ec391[_0x118861(0x1e2)];if(_0x7e244b&&typeof _0x7e244b===_0x118861(0x1e9)){const {nodes:_0xf9b6ee,links:_0x38c29e}=extractSankeyChart(_0x7e244b);return{'nodes':_0xf9b6ee,'links':_0x38c29e,...typeof _0x4ec391['updatedAt']==='string'?{'updatedAt':_0x4ec391[_0x118861(0x1c5)]}:{}};}return _0x374a74;}export function parseActivationSankeyResponse(_0x3e407c){const _0x59692e=a88_0x3f7fc1,_0x17c410=extractJsonApiAttributes(_0x3e407c);if(_0x17c410[_0x59692e(0x1f6)]>0x0)return _0x17c410['map'](_0x57f28e=>{const _0x434ed0=_0x59692e,_0x1ba497=_0x57f28e[_0x434ed0(0x1e2)],{nodes:_0x291e18,links:_0x1597b3}=_0x1ba497&&typeof _0x1ba497==='object'?extractSankeyChart(_0x1ba497):{'nodes':[],'links':[]};return{'journeyStageId':typeof _0x57f28e[_0x434ed0(0x1ee)]===_0x434ed0(0x1c8)?_0x57f28e[_0x434ed0(0x1ee)]:'','nodes':_0x291e18,'links':_0x1597b3,...typeof _0x57f28e[_0x434ed0(0x1c5)]==='string'?{'updatedAt':_0x57f28e['updatedAt']}:{}};});if(Array[_0x59692e(0x1b9)](_0x3e407c))return _0x3e407c;return[];}export function parseJourneyBundleResponse(_0x4d8705){const _0x2c388c=a88_0x3f7fc1;if(!_0x4d8705||typeof _0x4d8705!=='object')throw new Error('Invalid\x20journey\x20bundle\x20response');const _0x4134aa=_0x4d8705,_0x4f40ba=_0x4134aa[_0x2c388c(0x1e4)],_0x2f7c23=_0x4f40ba?.[_0x2c388c(0x1d8)]??_0x4134aa,_0xbaeabd=Array['isArray'](_0x2f7c23[_0x2c388c(0x198)])?_0x2f7c23[_0x2c388c(0x198)]:[],_0x38f099=_0xbaeabd[_0x2c388c(0x1bd)](_0x49523f=>{const _0x334c31=_0x2c388c;if(!_0x49523f||typeof _0x49523f!==_0x334c31(0x1e9))return _0x49523f;const _0x5a78fb=_0x49523f;if(_0x5a78fb[_0x334c31(0x1e4)]&&typeof _0x5a78fb[_0x334c31(0x1e4)]===_0x334c31(0x1e9))return _0x5a78fb[_0x334c31(0x1e4)];return _0x5a78fb;});return{'name':_0x2f7c23[_0x2c388c(0x1c2)],'description':_0x2f7c23[_0x2c388c(0x1b8)]??null,'latestJourneyId':_0x2f7c23[_0x2c388c(0x1f5)],'lastVersionNumber':_0x2f7c23[_0x2c388c(0x18f)],'journeys':_0x38f099};}
@@ -1 +1 @@
1
- const a89_0x2873a0=a89_0x45fa;(function(_0x4c4c6b,_0x5f39fe){const _0x1a46c8=a89_0x45fa,_0x2dd639=_0x4c4c6b();while(!![]){try{const _0x1a94fb=parseInt(_0x1a46c8(0x1f7))/0x1*(-parseInt(_0x1a46c8(0x1fb))/0x2)+parseInt(_0x1a46c8(0x1f8))/0x3+parseInt(_0x1a46c8(0x200))/0x4*(parseInt(_0x1a46c8(0x1ef))/0x5)+parseInt(_0x1a46c8(0x205))/0x6*(parseInt(_0x1a46c8(0x1f5))/0x7)+-parseInt(_0x1a46c8(0x1f9))/0x8+-parseInt(_0x1a46c8(0x1ee))/0x9+parseInt(_0x1a46c8(0x1f1))/0xa;if(_0x1a94fb===_0x5f39fe)break;else _0x2dd639['push'](_0x2dd639['shift']());}catch(_0x4d94fe){_0x2dd639['push'](_0x2dd639['shift']());}}}(a89_0x3d50,0x676a2));import{HTTPClient}from'./http-client.js';import{getDeliveryEndpoint}from'./endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';function a89_0x45fa(_0x989a1c,_0x1b8c0e){_0x989a1c=_0x989a1c-0x1ec;const _0x3d500c=a89_0x3d50();let _0x45fa88=_0x3d500c[_0x989a1c];return _0x45fa88;}function a89_0x3d50(){const _0x1a3c90=['request','append','apiKey','5743071iJHcPO','1781835ecZnsD','offset','3008750oVzXbZ','workspaceId','/api/email_senders','proxy','7NoFdmt','listEmailSenders','1nopYfU','2323539ZAPGmb','3468008irtgDg','filter[workspaceId]','1542014AKYPZR','GET','toString','site','page[offset]','4fxjvwb','httpClient','/api/email_senders?','limit','accessToken','5006748VIUcmQ'];a89_0x3d50=function(){return _0x1a3c90;};return a89_0x3d50();}export class DeliveryApiClient{['httpClient'];constructor(_0x24d77a){const _0x23d16b=a89_0x45fa,_0x31488c=getDeliveryEndpoint(_0x24d77a[_0x23d16b(0x1fe)]),_0x543fd9=toHeaderRecord(getAuthHeaders(_0x24d77a[_0x23d16b(0x1fe)],_0x24d77a[_0x23d16b(0x1ed)],_0x24d77a[_0x23d16b(0x204)]));this[_0x23d16b(0x201)]=new HTTPClient(_0x31488c,_0x543fd9,{'proxy':_0x24d77a[_0x23d16b(0x1f4)]});}async[a89_0x2873a0(0x1f6)](_0xf7d566={}){const _0x40ded5=a89_0x2873a0,_0x4d592a=new URLSearchParams();_0xf7d566['workspaceId']&&_0x4d592a[_0x40ded5(0x1ec)](_0x40ded5(0x1fa),_0xf7d566[_0x40ded5(0x1f2)]);_0xf7d566[_0x40ded5(0x203)]!==undefined&&_0x4d592a['append']('page[limit]',_0xf7d566[_0x40ded5(0x203)][_0x40ded5(0x1fd)]());_0xf7d566[_0x40ded5(0x1f0)]!==undefined&&_0x4d592a[_0x40ded5(0x1ec)](_0x40ded5(0x1ff),_0xf7d566['offset'][_0x40ded5(0x1fd)]());const _0x54da35=_0x4d592a[_0x40ded5(0x1fd)](),_0x3abe5d=_0x54da35?_0x40ded5(0x202)+_0x54da35:_0x40ded5(0x1f3);return await this[_0x40ded5(0x201)][_0x40ded5(0x206)](_0x40ded5(0x1fc),_0x3abe5d,{'headers':{'Accept':'application/vnd.api+json'}});}}
1
+ const a89_0x422738=a89_0x33fe;(function(_0x52ca5f,_0x225d21){const _0x582922=a89_0x33fe,_0x1b3527=_0x52ca5f();while(!![]){try{const _0x5d0506=parseInt(_0x582922(0x168))/0x1+parseInt(_0x582922(0x17c))/0x2*(parseInt(_0x582922(0x172))/0x3)+-parseInt(_0x582922(0x17b))/0x4+-parseInt(_0x582922(0x16e))/0x5*(parseInt(_0x582922(0x16b))/0x6)+parseInt(_0x582922(0x176))/0x7+-parseInt(_0x582922(0x16d))/0x8+-parseInt(_0x582922(0x179))/0x9;if(_0x5d0506===_0x225d21)break;else _0x1b3527['push'](_0x1b3527['shift']());}catch(_0x2fa7ce){_0x1b3527['push'](_0x1b3527['shift']());}}}(a89_0x4b67,0xbe3d2));import{HTTPClient}from'./http-client.js';function a89_0x4b67(){const _0x3d450e=['proxy','toString','site','9218692KcYhRV','append','workspaceId','17080209dlrJgX','limit','1198192zoWrWg','59862ALdRGY','application/vnd.api+json','httpClient','881682WhQmkl','request','page[limit]','4344cedzna','/api/email_senders?','1143784ldAYXZ','1495erwwNK','apiKey','/api/email_senders','offset','114YUsYov'];a89_0x4b67=function(){return _0x3d450e;};return a89_0x4b67();}function a89_0x33fe(_0x320df7,_0xdff24d){_0x320df7=_0x320df7-0x166;const _0x4b67fe=a89_0x4b67();let _0x33fe71=_0x4b67fe[_0x320df7];return _0x33fe71;}import{getDeliveryEndpoint}from'./endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class DeliveryApiClient{[a89_0x422738(0x167)];constructor(_0x4677ad){const _0x1a25e1=a89_0x422738,_0x48a1ec=getDeliveryEndpoint(_0x4677ad['site']),_0x105bd1=toHeaderRecord(getAuthHeaders(_0x4677ad[_0x1a25e1(0x175)],_0x4677ad[_0x1a25e1(0x16f)],_0x4677ad['accessToken']));this[_0x1a25e1(0x167)]=new HTTPClient(_0x48a1ec,_0x105bd1,{'proxy':_0x4677ad[_0x1a25e1(0x173)]});}async['listEmailSenders'](_0x5ace07={}){const _0x579cd3=a89_0x422738,_0x1816d6=new URLSearchParams();_0x5ace07[_0x579cd3(0x178)]&&_0x1816d6[_0x579cd3(0x177)]('filter[workspaceId]',_0x5ace07[_0x579cd3(0x178)]);_0x5ace07[_0x579cd3(0x17a)]!==undefined&&_0x1816d6[_0x579cd3(0x177)](_0x579cd3(0x16a),_0x5ace07[_0x579cd3(0x17a)]['toString']());_0x5ace07[_0x579cd3(0x171)]!==undefined&&_0x1816d6[_0x579cd3(0x177)]('page[offset]',_0x5ace07[_0x579cd3(0x171)][_0x579cd3(0x174)]());const _0x129c27=_0x1816d6[_0x579cd3(0x174)](),_0x314526=_0x129c27?_0x579cd3(0x16c)+_0x129c27:_0x579cd3(0x170);return await this[_0x579cd3(0x167)][_0x579cd3(0x169)]('GET',_0x314526,{'headers':{'Accept':_0x579cd3(0x166)}});}}
@@ -1 +1 @@
1
- const a90_0x59f6c2=a90_0x3104;function a90_0x3104(_0x51b290,_0x382e8c){_0x51b290=_0x51b290-0x1e9;const _0x103767=a90_0x1037();let _0x3104ca=_0x103767[_0x51b290];return _0x3104ca;}(function(_0x3a9d93,_0x3e1b90){const _0x5e458e=a90_0x3104,_0x206386=_0x3a9d93();while(!![]){try{const _0x4c3ae8=parseInt(_0x5e458e(0x23b))/0x1*(parseInt(_0x5e458e(0x246))/0x2)+parseInt(_0x5e458e(0x1f6))/0x3*(-parseInt(_0x5e458e(0x1ee))/0x4)+-parseInt(_0x5e458e(0x20b))/0x5*(parseInt(_0x5e458e(0x215))/0x6)+-parseInt(_0x5e458e(0x21b))/0x7*(parseInt(_0x5e458e(0x252))/0x8)+-parseInt(_0x5e458e(0x21a))/0x9*(-parseInt(_0x5e458e(0x22e))/0xa)+-parseInt(_0x5e458e(0x23a))/0xb*(parseInt(_0x5e458e(0x23d))/0xc)+parseInt(_0x5e458e(0x23c))/0xd*(parseInt(_0x5e458e(0x218))/0xe);if(_0x4c3ae8===_0x3e1b90)break;else _0x206386['push'](_0x206386['shift']());}catch(_0x64aa41){_0x206386['push'](_0x206386['shift']());}}}(a90_0x1037,0xf22b7));export const TD_ENDPOINTS={'us01':a90_0x59f6c2(0x222),'ap01':a90_0x59f6c2(0x213),'eu01':'https://api.eu01.treasuredata.com','ap02':a90_0x59f6c2(0x24c),'ap03':a90_0x59f6c2(0x206),'dev-us01':'https://api-development.treasuredata.com','dev-eu01':a90_0x59f6c2(0x235),'stg-us01':a90_0x59f6c2(0x1fa),'stg-ap01':a90_0x59f6c2(0x24a),'stg-ap03':'https://api-staging.ap03.treasuredata.com'};export const CDP_ENDPOINTS={'us01':a90_0x59f6c2(0x233),'ap01':a90_0x59f6c2(0x226),'eu01':a90_0x59f6c2(0x22d),'ap02':a90_0x59f6c2(0x24b),'ap03':a90_0x59f6c2(0x1f9),'dev-us01':a90_0x59f6c2(0x1ff),'dev-eu01':a90_0x59f6c2(0x249),'stg-us01':a90_0x59f6c2(0x208),'stg-ap01':a90_0x59f6c2(0x1f8),'stg-ap03':a90_0x59f6c2(0x24d)};export const WORKFLOW_ENDPOINTS={'us01':a90_0x59f6c2(0x1ec),'ap01':a90_0x59f6c2(0x1f2),'eu01':a90_0x59f6c2(0x238),'ap02':'https://api-workflow.ap02.treasuredata.com','ap03':'https://api-workflow.ap03.treasuredata.com','dev-us01':a90_0x59f6c2(0x237),'dev-eu01':'https://api-development-workflow.eu01.treasuredata.com','stg-us01':a90_0x59f6c2(0x244),'stg-ap01':a90_0x59f6c2(0x1fc),'stg-ap03':'https://api-staging-workflow.ap03.treasuredata.com'};export const TRINO_ENDPOINTS={'us01':a90_0x59f6c2(0x1f5),'ap01':a90_0x59f6c2(0x251),'eu01':a90_0x59f6c2(0x1ea),'ap02':a90_0x59f6c2(0x1eb),'ap03':'https://api-presto.ap03.treasuredata.com','dev-us01':'https://api-development-presto.treasuredata.com','dev-eu01':a90_0x59f6c2(0x212),'stg-us01':'https://api-staging-presto.treasuredata.com','stg-ap01':a90_0x59f6c2(0x20a),'stg-ap03':'https://api-staging-presto.ap03.treasuredata.com'};export const LLM_ENDPOINTS={'us01':'https://llm-api.treasuredata.com','ap01':a90_0x59f6c2(0x241),'eu01':a90_0x59f6c2(0x242),'ap02':a90_0x59f6c2(0x22a),'ap03':a90_0x59f6c2(0x204),'dev-us01':a90_0x59f6c2(0x214),'dev-eu01':a90_0x59f6c2(0x225),'stg-us01':'https://llm-api-staging.us01.treasuredata.com','stg-ap01':a90_0x59f6c2(0x245),'stg-ap03':a90_0x59f6c2(0x224)};export const LLM_PROXY_ENDPOINTS={'us01':'https://llm-proxy.us01.treasuredata.com','ap01':a90_0x59f6c2(0x216),'eu01':'https://llm-proxy.eu01.treasuredata.com','ap02':a90_0x59f6c2(0x210),'ap03':a90_0x59f6c2(0x22c),'dev-us01':a90_0x59f6c2(0x23e),'dev-eu01':a90_0x59f6c2(0x1fb),'stg-us01':a90_0x59f6c2(0x205),'stg-ap01':a90_0x59f6c2(0x1f3),'stg-ap03':a90_0x59f6c2(0x243)};export const ENGAGE_ENDPOINTS={'us01':a90_0x59f6c2(0x250),'ap01':a90_0x59f6c2(0x20d),'eu01':a90_0x59f6c2(0x1ed),'ap02':a90_0x59f6c2(0x20f),'ap03':a90_0x59f6c2(0x21e),'dev-us01':'https://engage-api-development.us01.treasuredata.com','dev-eu01':a90_0x59f6c2(0x20e),'stg-us01':a90_0x59f6c2(0x20c),'stg-ap01':'https://engage-api-staging.treasuredata.co.jp','stg-ap03':'https://engage-api-staging.ap03.treasuredata.com'};export const DELIVERY_ENDPOINTS={'us01':a90_0x59f6c2(0x229),'ap01':a90_0x59f6c2(0x1fe),'eu01':'https://delivery-api.eu01.treasuredata.com','ap02':'https://delivery-api.ap02.treasuredata.com','ap03':a90_0x59f6c2(0x207),'dev-us01':'https://delivery-api-development.us01.treasuredata.com','dev-eu01':a90_0x59f6c2(0x23f),'stg-us01':a90_0x59f6c2(0x220),'stg-ap01':a90_0x59f6c2(0x1f0),'stg-ap03':a90_0x59f6c2(0x221)};export function getDeliveryEndpoint(_0x47706){const _0x372f54=a90_0x59f6c2,_0x1198f9=DELIVERY_ENDPOINTS[_0x47706];if(!_0x1198f9)throw new Error(_0x372f54(0x24f)+_0x47706);return _0x1198f9;}export const CONSOLE_ENDPOINTS={'us01':a90_0x59f6c2(0x21d),'ap01':'https://console.treasuredata.co.jp','eu01':a90_0x59f6c2(0x223),'ap02':a90_0x59f6c2(0x21f),'ap03':a90_0x59f6c2(0x228),'dev-us01':a90_0x59f6c2(0x203),'dev-eu01':a90_0x59f6c2(0x248),'stg-us01':'https://console-staging.us01.treasuredata.com','stg-ap01':a90_0x59f6c2(0x232),'stg-ap03':'https://console-staging.ap03.treasuredata.com'};export const CONSOLE_NEXT_ENDPOINTS={'us01':'https://console-next.us01.treasuredata.com','ap01':a90_0x59f6c2(0x230),'eu01':'https://console-next.eu01.treasuredata.com','ap02':a90_0x59f6c2(0x1ef),'ap03':a90_0x59f6c2(0x227),'dev-us01':a90_0x59f6c2(0x1f7),'dev-eu01':a90_0x59f6c2(0x22f),'stg-us01':a90_0x59f6c2(0x219),'stg-ap01':a90_0x59f6c2(0x22b),'stg-ap03':a90_0x59f6c2(0x209)};export function getConsoleUrl(_0x416b60,_0x35d3a0){const _0x589d23=a90_0x59f6c2,_0x24dedf=CONSOLE_ENDPOINTS[_0x416b60]||_0x589d23(0x239)+_0x416b60+_0x589d23(0x240);return _0x35d3a0?''+_0x24dedf+_0x35d3a0:_0x24dedf;}export function getConsoleNextUrl(_0x3266b2,_0x1526e6){const _0x51bfc6=a90_0x59f6c2,_0x84607d=CONSOLE_NEXT_ENDPOINTS[_0x3266b2]||_0x51bfc6(0x202)+_0x3266b2+_0x51bfc6(0x240);return _0x1526e6?''+_0x84607d+_0x1526e6:_0x84607d;}export function getLLMProjectUrl(_0x5ba422,_0x57b0a3){const _0x30a9d2=a90_0x59f6c2;return getConsoleNextUrl(_0x5ba422,_0x30a9d2(0x21c)+_0x57b0a3+_0x30a9d2(0x24e));}export function getLLMAgentChatUrl(_0x50bf82,_0x19f495,_0x3592d1){const _0x139ef5=a90_0x59f6c2;return getConsoleNextUrl(_0x50bf82,'/app/af/'+_0x19f495+_0x139ef5(0x247)+_0x3592d1+_0x139ef5(0x201));}export function getLLMConversationUrl(_0x1bea8f,_0x4490eb,_0x43b464,_0x39add6){const _0x5d3e0b=a90_0x59f6c2;return getConsoleNextUrl(_0x1bea8f,_0x5d3e0b(0x21c)+_0x4490eb+_0x5d3e0b(0x247)+_0x43b464+'/tc/'+_0x39add6);}export function getWorkflowUrl(_0xc8a5c3,_0x4cc10b){const _0x1ec9fa=a90_0x59f6c2;return getConsoleUrl(_0xc8a5c3,_0x1ec9fa(0x236)+_0x4cc10b+_0x1ec9fa(0x1f1));}export function getWorkflowSessionUrl(_0x314d6d,_0x16eb1f,_0x30f9a8){const _0x2c7a50=a90_0x59f6c2;return getConsoleUrl(_0x314d6d,'/app/workflows/'+_0x16eb1f+_0x2c7a50(0x231)+_0x30f9a8);}function a90_0x1037(){const _0x17e265=['https://console-development.eu01.treasuredata.com','https://api-development-cdp.eu01.treasuredata.com','https://api-staging.treasuredata.co.jp','https://api-cdp.ap02.treasuredata.com','https://api.ap02.treasuredata.com','https://api-staging-cdp.ap03.treasuredata.com','/ag','No\x20Delivery\x20API\x20endpoint\x20for\x20site:\x20','https://engage-api.treasuredata.com','https://api-presto.treasuredata.co.jp','440bgqrTz','/ooc/','https://api-presto.eu01.treasuredata.com','https://api-presto.ap02.treasuredata.com','https://api-workflow.treasuredata.com','https://engage-api.eu01.treasuredata.com','4808344qhcYJr','https://console-next.ap02.treasuredata.com','https://delivery-api-staging.treasuredata.co.jp','/info','https://api-workflow.treasuredata.co.jp','https://llm-proxy-staging.treasuredata.co.jp','/attempt/','https://api-presto.treasuredata.com','3XThiCU','https://console-development-next.us01.treasuredata.com','https://api-staging-cdp.treasuredata.co.jp','https://api-cdp.ap03.treasuredata.com','https://api-staging.treasuredata.com','https://llm-proxy-development.eu01.treasuredata.com','https://api-staging-workflow.treasuredata.co.jp','No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20','https://delivery-api.treasuredata.co.jp','https://api-development-cdp.us01.treasuredata.com','No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27','/tc','https://console-next.','https://console-development.us01.treasuredata.com','https://llm-api.ap03.treasuredata.com','https://llm-proxy-staging.us01.treasuredata.com','https://api.ap03.treasuredata.com','https://delivery-api.ap03.treasuredata.com','https://api-staging-cdp.us01.treasuredata.com','https://console-staging-next.ap03.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','5qyshHu','https://engage-api-staging.us01.treasuredata.com','https://engage-api.treasuredata.co.jp','https://engage-api-development.eu01.treasuredata.com','https://engage-api.ap02.treasuredata.com','https://llm-proxy.ap02.treasuredata.com','/ce','https://api-development-presto.eu01.treasuredata.com','https://api.treasuredata.co.jp','https://llm-api-development.us01.treasuredata.com','10568178UpRSuR','https://llm-proxy.treasuredata.co.jp','/app/jobs/','2832158eZxpCY','https://console-staging-next.us01.treasuredata.com','9506088EsABLI','92918XrNNnv','/app/af/','https://console.us01.treasuredata.com','https://engage-api.ap03.treasuredata.com','https://console.ap02.treasuredata.com','https://delivery-api-staging.us01.treasuredata.com','https://delivery-api-staging.ap03.treasuredata.com','https://api.treasuredata.com','https://console.eu01.treasuredata.com','https://llm-api-staging.ap03.treasuredata.com','https://llm-api-development.eu01.treasuredata.com','https://api-cdp.treasuredata.co.jp','https://console-next.ap03.treasuredata.com','https://console.ap03.treasuredata.com','https://delivery-api.us01.treasuredata.com','https://llm-api.ap02.treasuredata.com','https://console-staging-next.treasuredata.co.jp','https://llm-proxy.ap03.treasuredata.com','https://api-cdp.eu01.treasuredata.com','10sonoib','https://console-development-next.eu01.treasuredata.com','https://console-next.treasuredata.co.jp','/sessions/','https://console-staging.treasuredata.co.jp','https://api-cdp.treasuredata.com','/app/es/','https://api-development.eu01.treasuredata.com','/app/workflows/','https://api-development-workflow.us01.treasuredata.com','https://api-workflow.eu01.treasuredata.com','https://console.','19514pHocbf','2Tpnnhq','234HBxARz','8508SYxQoI','https://llm-proxy-development.us01.treasuredata.com','https://delivery-api-development.eu01.treasuredata.com','.treasuredata.com','https://llm-api.treasuredata.co.jp','https://llm-api.eu01.treasuredata.com','https://llm-proxy-staging.ap03.treasuredata.com','https://api-staging-workflow.us01.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','1245634bCUvSn','/ag/'];a90_0x1037=function(){return _0x17e265;};return a90_0x1037();}export function getWorkflowAttemptUrl(_0x1f0b57,_0x4641ab,_0x2be5df,_0x4f94be){const _0x1738b9=a90_0x59f6c2;return getConsoleUrl(_0x1f0b57,_0x1738b9(0x236)+_0x4641ab+_0x1738b9(0x231)+_0x2be5df+_0x1738b9(0x1f4)+_0x4f94be);}export function getCampaignUrl(_0x57277e,_0x11a5da,_0x354b26){const _0x58afd6=a90_0x59f6c2;return getConsoleNextUrl(_0x57277e,_0x58afd6(0x234)+_0x11a5da+_0x58afd6(0x1e9)+_0x354b26);}export function getTemplateUrl(_0x38da75,_0x16eca7,_0x90c4df){const _0x438341=a90_0x59f6c2;return getConsoleNextUrl(_0x38da75,_0x438341(0x234)+_0x16eca7+'/em/'+_0x90c4df+_0x438341(0x211));}export function getJobUrl(_0x36fd47,_0x34eb4a){const _0x4cd05b=a90_0x59f6c2;return getConsoleNextUrl(_0x36fd47,_0x4cd05b(0x217)+_0x34eb4a+'/result');}export function getWorkspaceUrl(_0x400861,_0x44e615){const _0x24478b=a90_0x59f6c2;return getConsoleNextUrl(_0x400861,_0x24478b(0x234)+_0x44e615);}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS,'llm-proxy':LLM_PROXY_ENDPOINTS};export function getLLMProxyEndpoint(_0x183225){const _0xfe5f81=a90_0x59f6c2,_0x5e342e=LLM_PROXY_ENDPOINTS[_0x183225];if(!_0x5e342e)throw new Error(_0xfe5f81(0x1fd)+_0x183225);return _0x5e342e;}export function getEndpoint(_0xb5ac98,_0x493359='td'){const _0x35bf10=a90_0x59f6c2,_0x5e05af=API_ENDPOINTS[_0x493359]?.[_0xb5ac98];if(!_0x5e05af)throw new Error(_0x35bf10(0x200)+_0x493359+'\x27\x20and\x20site\x20\x27'+_0xb5ac98+'\x27');return _0x5e05af;}
1
+ const a90_0x406e62=a90_0x8473;(function(_0x47f6a6,_0x42ebcb){const _0x5754a0=a90_0x8473,_0x5067a1=_0x47f6a6();while(!![]){try{const _0x41c042=parseInt(_0x5754a0(0xef))/0x1+-parseInt(_0x5754a0(0x116))/0x2*(-parseInt(_0x5754a0(0x12b))/0x3)+-parseInt(_0x5754a0(0xfb))/0x4*(-parseInt(_0x5754a0(0x110))/0x5)+-parseInt(_0x5754a0(0x118))/0x6*(parseInt(_0x5754a0(0x107))/0x7)+parseInt(_0x5754a0(0xec))/0x8*(parseInt(_0x5754a0(0x122))/0x9)+parseInt(_0x5754a0(0x11c))/0xa*(-parseInt(_0x5754a0(0xee))/0xb)+-parseInt(_0x5754a0(0x11f))/0xc;if(_0x41c042===_0x42ebcb)break;else _0x5067a1['push'](_0x5067a1['shift']());}catch(_0x1de7ca){_0x5067a1['push'](_0x5067a1['shift']());}}}(a90_0x2ea3,0x1d63b));function a90_0x8473(_0x10b7e0,_0x451733){_0x10b7e0=_0x10b7e0-0xc8;const _0x2ea367=a90_0x2ea3();let _0x847336=_0x2ea367[_0x10b7e0];return _0x847336;}export const TD_ENDPOINTS={'us01':'https://api.treasuredata.com','ap01':a90_0x406e62(0xce),'eu01':a90_0x406e62(0xd2),'ap02':a90_0x406e62(0xe8),'ap03':a90_0x406e62(0xf9),'dev-us01':'https://api-development.treasuredata.com','dev-eu01':a90_0x406e62(0x12c),'stg-us01':a90_0x406e62(0x11e),'stg-ap01':a90_0x406e62(0x104),'stg-ap03':a90_0x406e62(0xda)};export const CDP_ENDPOINTS={'us01':a90_0x406e62(0x11a),'ap01':a90_0x406e62(0xed),'eu01':a90_0x406e62(0xd5),'ap02':'https://api-cdp.ap02.treasuredata.com','ap03':a90_0x406e62(0x120),'dev-us01':'https://api-development-cdp.us01.treasuredata.com','dev-eu01':a90_0x406e62(0x10e),'stg-us01':'https://api-staging-cdp.us01.treasuredata.com','stg-ap01':a90_0x406e62(0xdb),'stg-ap03':'https://api-staging-cdp.ap03.treasuredata.com'};export const WORKFLOW_ENDPOINTS={'us01':a90_0x406e62(0xca),'ap01':a90_0x406e62(0x11d),'eu01':a90_0x406e62(0xfc),'ap02':a90_0x406e62(0x109),'ap03':a90_0x406e62(0xfe),'dev-us01':a90_0x406e62(0xf5),'dev-eu01':'https://api-development-workflow.eu01.treasuredata.com','stg-us01':a90_0x406e62(0xea),'stg-ap01':'https://api-staging-workflow.treasuredata.co.jp','stg-ap03':a90_0x406e62(0xcc)};export const TRINO_ENDPOINTS={'us01':a90_0x406e62(0x10b),'ap01':a90_0x406e62(0x10a),'eu01':a90_0x406e62(0xf8),'ap02':a90_0x406e62(0xe3),'ap03':a90_0x406e62(0xe7),'dev-us01':a90_0x406e62(0xde),'dev-eu01':'https://api-development-presto.eu01.treasuredata.com','stg-us01':a90_0x406e62(0xd8),'stg-ap01':a90_0x406e62(0xd3),'stg-ap03':a90_0x406e62(0x124)};export const LLM_ENDPOINTS={'us01':a90_0x406e62(0x117),'ap01':'https://llm-api.treasuredata.co.jp','eu01':a90_0x406e62(0xf3),'ap02':'https://llm-api.ap02.treasuredata.com','ap03':a90_0x406e62(0x114),'dev-us01':a90_0x406e62(0xd7),'dev-eu01':a90_0x406e62(0x10f),'stg-us01':a90_0x406e62(0xc9),'stg-ap01':a90_0x406e62(0xf6),'stg-ap03':a90_0x406e62(0x108)};export const LLM_PROXY_ENDPOINTS={'us01':'https://llm-proxy.us01.treasuredata.com','ap01':a90_0x406e62(0x111),'eu01':a90_0x406e62(0xdf),'ap02':a90_0x406e62(0x12a),'ap03':a90_0x406e62(0x128),'dev-us01':a90_0x406e62(0xcf),'dev-eu01':a90_0x406e62(0xe1),'stg-us01':'https://llm-proxy-staging.us01.treasuredata.com','stg-ap01':'https://llm-proxy-staging.treasuredata.co.jp','stg-ap03':a90_0x406e62(0x125)};export const ENGAGE_ENDPOINTS={'us01':a90_0x406e62(0xeb),'ap01':a90_0x406e62(0xe2),'eu01':'https://engage-api.eu01.treasuredata.com','ap02':a90_0x406e62(0x100),'ap03':a90_0x406e62(0xd1),'dev-us01':a90_0x406e62(0x112),'dev-eu01':a90_0x406e62(0xcb),'stg-us01':a90_0x406e62(0xfa),'stg-ap01':a90_0x406e62(0xff),'stg-ap03':a90_0x406e62(0x12e)};export const DELIVERY_ENDPOINTS={'us01':a90_0x406e62(0x126),'ap01':'https://delivery-api.treasuredata.co.jp','eu01':a90_0x406e62(0x105),'ap02':'https://delivery-api.ap02.treasuredata.com','ap03':a90_0x406e62(0xe4),'dev-us01':a90_0x406e62(0x106),'dev-eu01':a90_0x406e62(0xcd),'stg-us01':'https://delivery-api-staging.us01.treasuredata.com','stg-ap01':a90_0x406e62(0xfd),'stg-ap03':a90_0x406e62(0x12f)};export function getDeliveryEndpoint(_0x581627){const _0x993c1c=a90_0x406e62,_0x22a5a2=DELIVERY_ENDPOINTS[_0x581627];if(!_0x22a5a2)throw new Error(_0x993c1c(0xe9)+_0x581627);return _0x22a5a2;}export const CONSOLE_ENDPOINTS={'us01':a90_0x406e62(0xf4),'ap01':'https://console.treasuredata.co.jp','eu01':a90_0x406e62(0xd6),'ap02':a90_0x406e62(0x12d),'ap03':a90_0x406e62(0xf1),'dev-us01':a90_0x406e62(0xf2),'dev-eu01':a90_0x406e62(0xd4),'stg-us01':a90_0x406e62(0x119),'stg-ap01':'https://console-staging.treasuredata.co.jp','stg-ap03':a90_0x406e62(0x121)};export const CONSOLE_NEXT_ENDPOINTS={'us01':a90_0x406e62(0x103),'ap01':a90_0x406e62(0xd9),'eu01':a90_0x406e62(0x101),'ap02':a90_0x406e62(0x102),'ap03':a90_0x406e62(0xc8),'dev-us01':'https://console-development-next.us01.treasuredata.com','dev-eu01':'https://console-development-next.eu01.treasuredata.com','stg-us01':a90_0x406e62(0x127),'stg-ap01':a90_0x406e62(0x115),'stg-ap03':'https://console-staging-next.ap03.treasuredata.com'};export function getConsoleUrl(_0x24b630,_0x2468b4){const _0xfa2eaa=a90_0x406e62,_0x460f83=CONSOLE_ENDPOINTS[_0x24b630]||_0xfa2eaa(0xdc)+_0x24b630+_0xfa2eaa(0x11b);return _0x2468b4?''+_0x460f83+_0x2468b4:_0x460f83;}export function getConsoleNextUrl(_0x531abf,_0x17de30){const _0x37d2ed=a90_0x406e62,_0x5e70ca=CONSOLE_NEXT_ENDPOINTS[_0x531abf]||_0x37d2ed(0xf7)+_0x531abf+_0x37d2ed(0x11b);return _0x17de30?''+_0x5e70ca+_0x17de30:_0x5e70ca;}export function getLLMProjectUrl(_0x543945,_0x488cfe){const _0x5087f9=a90_0x406e62;return getConsoleNextUrl(_0x543945,_0x5087f9(0xd0)+_0x488cfe+_0x5087f9(0x113));}export function getLLMAgentChatUrl(_0x46b2cc,_0x4b03d1,_0x5a71e0){const _0x17f5d3=a90_0x406e62;return getConsoleNextUrl(_0x46b2cc,'/app/af/'+_0x4b03d1+_0x17f5d3(0xe0)+_0x5a71e0+'/tc');}export function getLLMConversationUrl(_0x18afe9,_0x444cf2,_0x3f9e34,_0x1e9806){const _0x29c8a3=a90_0x406e62;return getConsoleNextUrl(_0x18afe9,_0x29c8a3(0xd0)+_0x444cf2+_0x29c8a3(0xe0)+_0x3f9e34+'/tc/'+_0x1e9806);}export function getWorkflowUrl(_0x3ae096,_0x43c5f2){return getConsoleUrl(_0x3ae096,'/app/workflows/'+_0x43c5f2+'/info');}export function getWorkflowSessionUrl(_0x4d359f,_0x4563c3,_0x379aef){const _0x109dbb=a90_0x406e62;return getConsoleUrl(_0x4d359f,_0x109dbb(0x123)+_0x4563c3+_0x109dbb(0xf0)+_0x379aef);}export function getWorkflowAttemptUrl(_0x349a59,_0x1c3db4,_0x4f960c,_0x2553f7){const _0x21bc83=a90_0x406e62;return getConsoleUrl(_0x349a59,_0x21bc83(0x123)+_0x1c3db4+_0x21bc83(0xf0)+_0x4f960c+_0x21bc83(0x10c)+_0x2553f7);}function a90_0x2ea3(){const _0x3dafd6=['https://delivery-api-development.us01.treasuredata.com','40404aUvQGf','https://llm-api-staging.ap03.treasuredata.com','https://api-workflow.ap02.treasuredata.com','https://api-presto.treasuredata.co.jp','https://api-presto.treasuredata.com','/attempt/','/app/es/','https://api-development-cdp.eu01.treasuredata.com','https://llm-api-development.eu01.treasuredata.com','1142965KWQfBy','https://llm-proxy.treasuredata.co.jp','https://engage-api-development.us01.treasuredata.com','/ag','https://llm-api.ap03.treasuredata.com','https://console-staging-next.treasuredata.co.jp','95024XNbJpH','https://llm-api.treasuredata.com','150hYOdff','https://console-staging.us01.treasuredata.com','https://api-cdp.treasuredata.com','.treasuredata.com','77340rMNAuY','https://api-workflow.treasuredata.co.jp','https://api-staging.treasuredata.com','4729776jDlTUF','https://api-cdp.ap03.treasuredata.com','https://console-staging.ap03.treasuredata.com','13734GVdjmY','/app/workflows/','https://api-staging-presto.ap03.treasuredata.com','https://llm-proxy-staging.ap03.treasuredata.com','https://delivery-api.us01.treasuredata.com','https://console-staging-next.us01.treasuredata.com','https://llm-proxy.ap03.treasuredata.com','/app/jobs/','https://llm-proxy.ap02.treasuredata.com','12lBUBrc','https://api-development.eu01.treasuredata.com','https://console.ap02.treasuredata.com','https://engage-api-staging.ap03.treasuredata.com','https://delivery-api-staging.ap03.treasuredata.com','https://console-next.ap03.treasuredata.com','https://llm-api-staging.us01.treasuredata.com','https://api-workflow.treasuredata.com','https://engage-api-development.eu01.treasuredata.com','https://api-staging-workflow.ap03.treasuredata.com','https://delivery-api-development.eu01.treasuredata.com','https://api.treasuredata.co.jp','https://llm-proxy-development.us01.treasuredata.com','/app/af/','https://engage-api.ap03.treasuredata.com','https://api.eu01.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://console-development.eu01.treasuredata.com','https://api-cdp.eu01.treasuredata.com','https://console.eu01.treasuredata.com','https://llm-api-development.us01.treasuredata.com','https://api-staging-presto.treasuredata.com','https://console-next.treasuredata.co.jp','https://api-staging.ap03.treasuredata.com','https://api-staging-cdp.treasuredata.co.jp','https://console.','No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20','https://api-development-presto.treasuredata.com','https://llm-proxy.eu01.treasuredata.com','/ag/','https://llm-proxy-development.eu01.treasuredata.com','https://engage-api.treasuredata.co.jp','https://api-presto.ap02.treasuredata.com','https://delivery-api.ap03.treasuredata.com','/result','/em/','https://api-presto.ap03.treasuredata.com','https://api.ap02.treasuredata.com','No\x20Delivery\x20API\x20endpoint\x20for\x20site:\x20','https://api-staging-workflow.us01.treasuredata.com','https://engage-api.treasuredata.com','608hGBdOp','https://api-cdp.treasuredata.co.jp','55WaztbZ','162880KWuzpM','/sessions/','https://console.ap03.treasuredata.com','https://console-development.us01.treasuredata.com','https://llm-api.eu01.treasuredata.com','https://console.us01.treasuredata.com','https://api-development-workflow.us01.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','https://console-next.','https://api-presto.eu01.treasuredata.com','https://api.ap03.treasuredata.com','https://engage-api-staging.us01.treasuredata.com','4fDWmbo','https://api-workflow.eu01.treasuredata.com','https://delivery-api-staging.treasuredata.co.jp','https://api-workflow.ap03.treasuredata.com','https://engage-api-staging.treasuredata.co.jp','https://engage-api.ap02.treasuredata.com','https://console-next.eu01.treasuredata.com','https://console-next.ap02.treasuredata.com','https://console-next.us01.treasuredata.com','https://api-staging.treasuredata.co.jp','https://delivery-api.eu01.treasuredata.com'];a90_0x2ea3=function(){return _0x3dafd6;};return a90_0x2ea3();}export function getCampaignUrl(_0x2e4c34,_0x13b9d9,_0x13bd7a){const _0x2f91da=a90_0x406e62;return getConsoleNextUrl(_0x2e4c34,_0x2f91da(0x10d)+_0x13b9d9+'/ooc/'+_0x13bd7a);}export function getTemplateUrl(_0xfcac6e,_0x4ce3fa,_0x530d1c){const _0x18677e=a90_0x406e62;return getConsoleNextUrl(_0xfcac6e,_0x18677e(0x10d)+_0x4ce3fa+_0x18677e(0xe6)+_0x530d1c+'/ce');}export function getJobUrl(_0x71f50a,_0x521a29){const _0x3913b9=a90_0x406e62;return getConsoleNextUrl(_0x71f50a,_0x3913b9(0x129)+_0x521a29+_0x3913b9(0xe5));}export function getWorkspaceUrl(_0x442865,_0x179aaa){const _0x1ded12=a90_0x406e62;return getConsoleNextUrl(_0x442865,_0x1ded12(0x10d)+_0x179aaa);}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS,'llm-proxy':LLM_PROXY_ENDPOINTS};export function getLLMProxyEndpoint(_0xf3ccc7){const _0x4ca25f=a90_0x406e62,_0x35fb3e=LLM_PROXY_ENDPOINTS[_0xf3ccc7];if(!_0x35fb3e)throw new Error(_0x4ca25f(0xdd)+_0xf3ccc7);return _0x35fb3e;}export function getEndpoint(_0x5be269,_0x3a320e='td'){const _0x35b9c3=API_ENDPOINTS[_0x3a320e]?.[_0x5be269];if(!_0x35b9c3)throw new Error('No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'+_0x3a320e+'\x27\x20and\x20site\x20\x27'+_0x5be269+'\x27');return _0x35b9c3;}
@@ -1 +1 @@
1
- const a91_0x3cccd1=a91_0x59b0;(function(_0xd5ad04,_0x10fd18){const _0x3e5b5d=a91_0x59b0,_0x436310=_0xd5ad04();while(!![]){try{const _0x1334d9=-parseInt(_0x3e5b5d(0x220))/0x1*(-parseInt(_0x3e5b5d(0x1ff))/0x2)+parseInt(_0x3e5b5d(0x1f6))/0x3+-parseInt(_0x3e5b5d(0x20d))/0x4*(-parseInt(_0x3e5b5d(0x218))/0x5)+parseInt(_0x3e5b5d(0x1e1))/0x6+-parseInt(_0x3e5b5d(0x201))/0x7+parseInt(_0x3e5b5d(0x1fd))/0x8*(-parseInt(_0x3e5b5d(0x1e9))/0x9)+-parseInt(_0x3e5b5d(0x20f))/0xa;if(_0x1334d9===_0x10fd18)break;else _0x436310['push'](_0x436310['shift']());}catch(_0x26f763){_0x436310['push'](_0x436310['shift']());}}}(a91_0x2ba7,0x8ccfe));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';function a91_0x59b0(_0xf939cd,_0x14db95){_0xf939cd=_0xf939cd-0x1cf;const _0x2ba7b7=a91_0x2ba7();let _0x59b0a4=_0x2ba7b7[_0xf939cd];return _0x59b0a4;}function a91_0x2ba7(){const _0x51b2e=['updateCampaign','accessToken','name','duplicateCampaign','/api/campaigns/','updateTemplate','listWorkspaces','505752PAzAvf','workspaceId','application/vnd.api+json','createWorkspace','/api/workspaces/','/api/campaigns','/api/workspaces?','site','58131vPePjO','getWorkspace','page[limit]','/resume','deleteWorkspace','finish','stringify','apiKey','status','getTemplate','append','httpClient','/pause','2768346zJJfhu','/api/email_templates','/api/email_templates/','/duplicate','createTemplate','deleteCampaign','page[offset]','400NPEmoT','offset','993802jFbxfX','sort','2509066vGWyiB','updateAlwaysOnCampaign','resumeCampaign','POST','listTemplates','updateWorkspace','/api/campaigns?','emailTemplates','filter[name]','proxy','limit','/always_on_campaigns','307592QJgciZ','always_on_campaigns','12454950EIMbUk','GET','/always_on_campaigns/','campaignType','workspaces','request','PATCH','launchAlwaysOnCampaign','ownerName','65XexoTd','application/json','filter[owner_user.name]','/launch','filter[workspaceId]','DELETE','launch','launchCampaign','1qSAVPf','deleteTemplate','performAlwaysOnCampaignAction','campaigns','resume','/api/workspaces','toString','createAlwaysOnCampaign','resumeAlwaysOnCampaign','pauseAlwaysOnCampaign','filter[campaignType]','include','listCampaigns'];a91_0x2ba7=function(){return _0x51b2e;};return a91_0x2ba7();}export class EngageApiClient{['httpClient'];constructor(_0x4238e2){const _0x491a69=a91_0x59b0,_0x30cf7e=getEndpoint(_0x4238e2['site'],'engage'),_0x56df18=toHeaderRecord(getAuthHeaders(_0x4238e2[_0x491a69(0x1e8)],_0x4238e2[_0x491a69(0x1f0)],_0x4238e2[_0x491a69(0x1db)]));this[_0x491a69(0x1f4)]=new HTTPClient(_0x30cf7e,_0x56df18,{'proxy':_0x4238e2[_0x491a69(0x20a)]});}async[a91_0x3cccd1(0x1d9)](_0x55be03={}){const _0x3308c8=a91_0x3cccd1,_0x5e3cb8=new URLSearchParams();_0x55be03[_0x3308c8(0x212)]&&_0x5e3cb8[_0x3308c8(0x1f3)](_0x3308c8(0x1d7),_0x55be03[_0x3308c8(0x212)]);_0x55be03[_0x3308c8(0x1f1)]&&_0x5e3cb8['append']('filter[status]',_0x55be03[_0x3308c8(0x1f1)]);_0x55be03[_0x3308c8(0x1e2)]&&_0x5e3cb8[_0x3308c8(0x1f3)]('filter[workspaceId]',_0x55be03[_0x3308c8(0x1e2)]);_0x55be03[_0x3308c8(0x20b)]!==undefined&&_0x5e3cb8[_0x3308c8(0x1f3)](_0x3308c8(0x1eb),_0x55be03[_0x3308c8(0x20b)][_0x3308c8(0x1d3)]());_0x55be03['offset']!==undefined&&_0x5e3cb8[_0x3308c8(0x1f3)](_0x3308c8(0x1fc),_0x55be03[_0x3308c8(0x1fe)][_0x3308c8(0x1d3)]());_0x55be03[_0x3308c8(0x200)]&&_0x5e3cb8['append'](_0x3308c8(0x200),_0x55be03['sort']);_0x55be03[_0x3308c8(0x1d8)]&&_0x5e3cb8['append'](_0x3308c8(0x1d8),_0x55be03[_0x3308c8(0x1d8)]);const _0x1669e4=_0x5e3cb8['toString'](),_0x401bc0=_0x1669e4?_0x3308c8(0x207)+_0x1669e4:_0x3308c8(0x1e6);return await this[_0x3308c8(0x1f4)][_0x3308c8(0x214)](_0x3308c8(0x210),_0x401bc0,{'headers':{'Accept':'application/vnd.api+json'}});}async['getCampaign'](_0x5331f4){const _0xbb7138=a91_0x3cccd1;return await this[_0xbb7138(0x1f4)]['request'](_0xbb7138(0x210),_0xbb7138(0x1de)+encodeURIComponent(_0x5331f4),{'headers':{'Accept':_0xbb7138(0x1e3)}});}async['createCampaign'](_0x4714fb){const _0x287365=a91_0x3cccd1,_0x2a536c={'data':{'type':_0x287365(0x1d0),'attributes':_0x4714fb}};return await this[_0x287365(0x1f4)][_0x287365(0x214)](_0x287365(0x204),_0x287365(0x1e6),{'headers':{'Content-Type':_0x287365(0x1e3),'Accept':_0x287365(0x1e3)},'body':JSON[_0x287365(0x1ef)](_0x2a536c)});}async[a91_0x3cccd1(0x1da)](_0x594f4d,_0x18c4b0){const _0x171747=a91_0x3cccd1,_0x4f7f2b={'data':{'type':_0x171747(0x1d0),'id':_0x594f4d,'attributes':_0x18c4b0}};return await this[_0x171747(0x1f4)][_0x171747(0x214)](_0x171747(0x215),_0x171747(0x1de)+encodeURIComponent(_0x594f4d),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x171747(0x1e3)},'body':JSON['stringify'](_0x4f7f2b)});}async[a91_0x3cccd1(0x1fb)](_0x59a05e){const _0x1c706=a91_0x3cccd1;await this[_0x1c706(0x1f4)]['request'](_0x1c706(0x21d),_0x1c706(0x1de)+encodeURIComponent(_0x59a05e),{'headers':{'Accept':_0x1c706(0x1e3)}});}async[a91_0x3cccd1(0x21f)](_0x433643){const _0xf0a420=a91_0x3cccd1;await this[_0xf0a420(0x1f4)]['request'](_0xf0a420(0x204),_0xf0a420(0x1de)+encodeURIComponent(_0x433643)+_0xf0a420(0x21b),{'headers':{'Content-Type':'application/json','Accept':_0xf0a420(0x219)},'body':JSON[_0xf0a420(0x1ef)]({})});}async['pauseCampaign'](_0x2f3348){const _0x5bdedb=a91_0x3cccd1;await this[_0x5bdedb(0x1f4)][_0x5bdedb(0x214)]('POST',_0x5bdedb(0x1de)+encodeURIComponent(_0x2f3348)+_0x5bdedb(0x1f5),{'headers':{'Content-Type':_0x5bdedb(0x219),'Accept':_0x5bdedb(0x219)},'body':JSON[_0x5bdedb(0x1ef)]({})});}async[a91_0x3cccd1(0x203)](_0x4e44ad){const _0x3ede14=a91_0x3cccd1;await this[_0x3ede14(0x1f4)][_0x3ede14(0x214)]('POST',_0x3ede14(0x1de)+encodeURIComponent(_0x4e44ad)+_0x3ede14(0x1ec),{'headers':{'Content-Type':_0x3ede14(0x219),'Accept':'application/json'},'body':JSON[_0x3ede14(0x1ef)]({})});}async[a91_0x3cccd1(0x1dd)](_0x31ef2b){const _0x5a9318=a91_0x3cccd1;return await this[_0x5a9318(0x1f4)][_0x5a9318(0x214)](_0x5a9318(0x204),_0x5a9318(0x1de)+encodeURIComponent(_0x31ef2b)+_0x5a9318(0x1f9),{'headers':{'Content-Type':_0x5a9318(0x219),'Accept':'application/vnd.api+json'},'body':JSON[_0x5a9318(0x1ef)]({})});}async[a91_0x3cccd1(0x205)](_0x48e304={}){const _0x57ff01=a91_0x3cccd1,_0x22d7be=new URLSearchParams();_0x48e304[_0x57ff01(0x1e2)]&&_0x22d7be[_0x57ff01(0x1f3)](_0x57ff01(0x21c),_0x48e304[_0x57ff01(0x1e2)]);_0x48e304[_0x57ff01(0x20b)]!==undefined&&_0x22d7be['append']('page[limit]',_0x48e304[_0x57ff01(0x20b)][_0x57ff01(0x1d3)]());_0x48e304[_0x57ff01(0x1fe)]!==undefined&&_0x22d7be['append'](_0x57ff01(0x1fc),_0x48e304[_0x57ff01(0x1fe)][_0x57ff01(0x1d3)]());_0x48e304[_0x57ff01(0x200)]&&_0x22d7be[_0x57ff01(0x1f3)](_0x57ff01(0x200),_0x48e304[_0x57ff01(0x200)]);const _0x53d138=_0x22d7be[_0x57ff01(0x1d3)](),_0x207181=_0x53d138?'/api/email_templates?'+_0x53d138:'/api/email_templates';return await this[_0x57ff01(0x1f4)][_0x57ff01(0x214)](_0x57ff01(0x210),_0x207181,{'headers':{'Accept':_0x57ff01(0x1e3)}});}async[a91_0x3cccd1(0x1f2)](_0x294254){const _0x2d42b=a91_0x3cccd1;return await this[_0x2d42b(0x1f4)][_0x2d42b(0x214)]('GET',_0x2d42b(0x1f8)+encodeURIComponent(_0x294254),{'headers':{'Accept':_0x2d42b(0x1e3)}});}async[a91_0x3cccd1(0x1fa)](_0xd88f13){const _0x45c345=a91_0x3cccd1,_0x10f8ee={'data':{'type':_0x45c345(0x208),'attributes':_0xd88f13}};return await this[_0x45c345(0x1f4)]['request'](_0x45c345(0x204),_0x45c345(0x1f7),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':JSON[_0x45c345(0x1ef)](_0x10f8ee)});}async[a91_0x3cccd1(0x1df)](_0x324981,_0x16a90c){const _0x4bfe5d=a91_0x3cccd1,_0x418cdd={'data':{'type':'emailTemplates','id':_0x324981,'attributes':_0x16a90c}};return await this[_0x4bfe5d(0x1f4)]['request']('PATCH',_0x4bfe5d(0x1f8)+encodeURIComponent(_0x324981),{'headers':{'Content-Type':_0x4bfe5d(0x1e3),'Accept':_0x4bfe5d(0x1e3)},'body':JSON['stringify'](_0x418cdd)});}async[a91_0x3cccd1(0x221)](_0x48f546){const _0x540cb6=a91_0x3cccd1;await this['httpClient'][_0x540cb6(0x214)](_0x540cb6(0x21d),_0x540cb6(0x1f8)+encodeURIComponent(_0x48f546),{'headers':{'Accept':_0x540cb6(0x1e3)}});}async[a91_0x3cccd1(0x1e0)](_0x139000={}){const _0xaa058=a91_0x3cccd1,_0xfbd7af=new URLSearchParams();_0x139000[_0xaa058(0x1dc)]&&_0xfbd7af[_0xaa058(0x1f3)](_0xaa058(0x209),_0x139000[_0xaa058(0x1dc)]);_0x139000['ownerName']&&_0xfbd7af['append'](_0xaa058(0x21a),_0x139000[_0xaa058(0x217)]);_0x139000['limit']!==undefined&&_0xfbd7af[_0xaa058(0x1f3)](_0xaa058(0x1eb),_0x139000[_0xaa058(0x20b)][_0xaa058(0x1d3)]());_0x139000[_0xaa058(0x1fe)]!==undefined&&_0xfbd7af[_0xaa058(0x1f3)]('page[offset]',_0x139000['offset'][_0xaa058(0x1d3)]());_0x139000[_0xaa058(0x200)]&&_0xfbd7af[_0xaa058(0x1f3)](_0xaa058(0x200),_0x139000[_0xaa058(0x200)]);const _0x1b595=_0xfbd7af[_0xaa058(0x1d3)](),_0x1b94dc=_0x1b595?_0xaa058(0x1e7)+_0x1b595:_0xaa058(0x1d2);return await this[_0xaa058(0x1f4)][_0xaa058(0x214)](_0xaa058(0x210),_0x1b94dc,{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x3cccd1(0x1ea)](_0xee6a32){const _0x11d68b=a91_0x3cccd1;return await this['httpClient']['request'](_0x11d68b(0x210),_0x11d68b(0x1e5)+encodeURIComponent(_0xee6a32),{'headers':{'Accept':_0x11d68b(0x1e3)}});}async[a91_0x3cccd1(0x1e4)](_0x2ffa76){const _0x2aac7c=a91_0x3cccd1,_0x1920d2={'data':{'type':_0x2aac7c(0x213),'attributes':_0x2ffa76}};return await this[_0x2aac7c(0x1f4)][_0x2aac7c(0x214)]('POST',_0x2aac7c(0x1d2),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x2aac7c(0x1e3)},'body':JSON[_0x2aac7c(0x1ef)](_0x1920d2)});}async[a91_0x3cccd1(0x206)](_0x17df2f,_0x1e7e05){const _0x54bde5=a91_0x3cccd1,_0x12d694={'data':{'type':_0x54bde5(0x213),'id':_0x17df2f,'attributes':_0x1e7e05}};return await this[_0x54bde5(0x1f4)][_0x54bde5(0x214)](_0x54bde5(0x215),_0x54bde5(0x1e5)+encodeURIComponent(_0x17df2f),{'headers':{'Content-Type':_0x54bde5(0x1e3),'Accept':_0x54bde5(0x1e3)},'body':JSON[_0x54bde5(0x1ef)](_0x12d694)});}async[a91_0x3cccd1(0x1ed)](_0x35aba5){const _0x1ef950=a91_0x3cccd1;await this[_0x1ef950(0x1f4)]['request'](_0x1ef950(0x21d),_0x1ef950(0x1e5)+encodeURIComponent(_0x35aba5),{'headers':{'Accept':_0x1ef950(0x1e3)}});}async['listAlwaysOnCampaigns'](_0x107d74,_0x4f5782={}){const _0x268a49=a91_0x3cccd1,_0x4a0b9e=new URLSearchParams();_0x4f5782['campaignType']&&_0x4a0b9e[_0x268a49(0x1f3)](_0x268a49(0x1d7),_0x4f5782[_0x268a49(0x212)]);_0x4f5782['status']&&_0x4a0b9e[_0x268a49(0x1f3)]('filter[status]',_0x4f5782[_0x268a49(0x1f1)]);_0x4f5782[_0x268a49(0x20b)]!==undefined&&_0x4a0b9e['append'](_0x268a49(0x1eb),_0x4f5782[_0x268a49(0x20b)][_0x268a49(0x1d3)]());_0x4f5782[_0x268a49(0x1fe)]!==undefined&&_0x4a0b9e[_0x268a49(0x1f3)](_0x268a49(0x1fc),_0x4f5782[_0x268a49(0x1fe)][_0x268a49(0x1d3)]());_0x4f5782[_0x268a49(0x200)]&&_0x4a0b9e[_0x268a49(0x1f3)]('sort',_0x4f5782['sort']);const _0x1c1c69=_0x4a0b9e['toString'](),_0x248374=_0x268a49(0x1e5)+encodeURIComponent(_0x107d74)+_0x268a49(0x20c)+(_0x1c1c69?'?'+_0x1c1c69:'');return await this['httpClient'][_0x268a49(0x214)](_0x268a49(0x210),_0x248374,{'headers':{'Accept':_0x268a49(0x1e3)}});}async['getAlwaysOnCampaign'](_0x136179,_0x2b44a6){const _0x1d4003=a91_0x3cccd1;return await this[_0x1d4003(0x1f4)]['request'](_0x1d4003(0x210),_0x1d4003(0x1e5)+encodeURIComponent(_0x136179)+_0x1d4003(0x211)+encodeURIComponent(_0x2b44a6),{'headers':{'Accept':_0x1d4003(0x1e3)}});}async[a91_0x3cccd1(0x1d4)](_0x89c3ec,_0x1fcaab){const _0x10f8ac=a91_0x3cccd1,_0x1125d3={'data':{'type':'always_on_campaigns','attributes':_0x1fcaab}};return await this[_0x10f8ac(0x1f4)]['request'](_0x10f8ac(0x204),'/api/workspaces/'+encodeURIComponent(_0x89c3ec)+_0x10f8ac(0x20c),{'headers':{'Content-Type':_0x10f8ac(0x1e3),'Accept':'application/vnd.api+json'},'body':JSON[_0x10f8ac(0x1ef)](_0x1125d3)});}async[a91_0x3cccd1(0x202)](_0x244e7f,_0x51b222,_0x102c22){const _0x37e4e3=a91_0x3cccd1,_0x1e8c68={'data':{'type':_0x37e4e3(0x20e),'id':_0x51b222,'attributes':_0x102c22}};return await this[_0x37e4e3(0x1f4)][_0x37e4e3(0x214)](_0x37e4e3(0x215),_0x37e4e3(0x1e5)+encodeURIComponent(_0x244e7f)+_0x37e4e3(0x211)+encodeURIComponent(_0x51b222),{'headers':{'Content-Type':_0x37e4e3(0x1e3),'Accept':_0x37e4e3(0x1e3)},'body':JSON[_0x37e4e3(0x1ef)](_0x1e8c68)});}async['deleteAlwaysOnCampaign'](_0x336c36,_0x5e2f6e){const _0x28311a=a91_0x3cccd1;await this[_0x28311a(0x1f4)]['request'](_0x28311a(0x21d),_0x28311a(0x1e5)+encodeURIComponent(_0x336c36)+_0x28311a(0x211)+encodeURIComponent(_0x5e2f6e),{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x3cccd1(0x1cf)](_0x4e2fc4,_0x159c2e,_0x10d173){const _0x4bbede=a91_0x3cccd1;await this[_0x4bbede(0x1f4)][_0x4bbede(0x214)](_0x4bbede(0x204),_0x4bbede(0x1e5)+encodeURIComponent(_0x4e2fc4)+'/always_on_campaigns/'+encodeURIComponent(_0x159c2e)+'/'+_0x10d173,{'headers':{'Content-Type':_0x4bbede(0x219),'Accept':_0x4bbede(0x219)},'body':JSON['stringify']({})});}async[a91_0x3cccd1(0x216)](_0x4688b2,_0x564d4f){const _0x3037de=a91_0x3cccd1;await this['performAlwaysOnCampaignAction'](_0x4688b2,_0x564d4f,_0x3037de(0x21e));}async[a91_0x3cccd1(0x1d6)](_0x1b0da9,_0x4af83d){const _0x55e15c=a91_0x3cccd1;await this[_0x55e15c(0x1cf)](_0x1b0da9,_0x4af83d,'pause');}async[a91_0x3cccd1(0x1d5)](_0x1125dc,_0x3b3402){const _0x3a1867=a91_0x3cccd1;await this['performAlwaysOnCampaignAction'](_0x1125dc,_0x3b3402,_0x3a1867(0x1d1));}async['finishAlwaysOnCampaign'](_0x3a2a8d,_0x51ff23){const _0x5095d8=a91_0x3cccd1;await this[_0x5095d8(0x1cf)](_0x3a2a8d,_0x51ff23,_0x5095d8(0x1ee));}async['duplicateAlwaysOnCampaign'](_0x220fd3,_0x563bb1,_0x285d32){const _0xd89cd9=a91_0x3cccd1,_0x2fe6bd=_0x285d32?{'data':{'attributes':{'name':_0x285d32}}}:{};return await this[_0xd89cd9(0x1f4)][_0xd89cd9(0x214)](_0xd89cd9(0x204),_0xd89cd9(0x1e5)+encodeURIComponent(_0x220fd3)+_0xd89cd9(0x211)+encodeURIComponent(_0x563bb1)+_0xd89cd9(0x1f9),{'headers':{'Content-Type':'application/json','Accept':_0xd89cd9(0x1e3)},'body':JSON[_0xd89cd9(0x1ef)](_0x2fe6bd)});}}
1
+ function a91_0x3032(){const _0x4c1838=['engage','listCampaigns','48dOuzur','site','pauseAlwaysOnCampaign','2786FWGbml','listWorkspaces','/api/email_templates/','updateTemplate','page[offset]','launch','append','performAlwaysOnCampaignAction','updateCampaign','page[limit]','createWorkspace','11TqaWPh','/api/workspaces?','817420ATuXAo','/always_on_campaigns','/api/campaigns/','createAlwaysOnCampaign','GET','PATCH','launchAlwaysOnCampaign','workspaces','/duplicate','sort','filter[workspaceId]','offset','deleteTemplate','filter[name]','stringify','emailTemplates','246708GsnPkI','always_on_campaigns','deleteWorkspace','/api/campaigns?','finishAlwaysOnCampaign','httpClient','listAlwaysOnCampaigns','resume','pauseCampaign','toString','deleteCampaign','getCampaign','include','/pause','request','application/json','getWorkspace','1214231WGQjgX','proxy','/api/email_templates','pause','19414610puddAm','/api/campaigns','status','2000130wgqlKc','/always_on_campaigns/','filter[status]','updateAlwaysOnCampaign','limit','/resume','642xvBRlp','duplicateAlwaysOnCampaign','launchCampaign','deleteAlwaysOnCampaign','POST','duplicateCampaign','/api/workspaces/','name','campaigns','15JeYcHR','filter[owner_user.name]','createCampaign','application/vnd.api+json','DELETE','filter[campaignType]','updateWorkspace','getTemplate','/api/workspaces','ownerName','workspaceId','1600101dUxPXg','campaignType','/api/email_templates?'];a91_0x3032=function(){return _0x4c1838;};return a91_0x3032();}const a91_0x2f0639=a91_0x25cc;(function(_0x4fa8b8,_0x5f3023){const _0x4b6523=a91_0x25cc,_0x4419dc=_0x4fa8b8();while(!![]){try{const _0x14153d=parseInt(_0x4b6523(0x10b))/0x1+-parseInt(_0x4b6523(0xfa))/0x2+-parseInt(_0x4b6523(0xbb))/0x3+parseInt(_0x4b6523(0xea))/0x4*(-parseInt(_0x4b6523(0xca))/0x5)+-parseInt(_0x4b6523(0xc1))/0x6*(parseInt(_0x4b6523(0xdd))/0x7)+parseInt(_0x4b6523(0xda))/0x8*(-parseInt(_0x4b6523(0xd5))/0x9)+parseInt(_0x4b6523(0xb8))/0xa*(parseInt(_0x4b6523(0xe8))/0xb);if(_0x14153d===_0x5f3023)break;else _0x4419dc['push'](_0x4419dc['shift']());}catch(_0x59d978){_0x4419dc['push'](_0x4419dc['shift']());}}}(a91_0x3032,0x9d0ab));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';function a91_0x25cc(_0x360918,_0x22a1bc){_0x360918=_0x360918-0xb5;const _0x30326b=a91_0x3032();let _0x25cca9=_0x30326b[_0x360918];return _0x25cca9;}import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class EngageApiClient{[a91_0x2f0639(0xff)];constructor(_0x3d1acc){const _0x48e78f=a91_0x2f0639,_0x587fa5=getEndpoint(_0x3d1acc[_0x48e78f(0xdb)],_0x48e78f(0xd8)),_0x39fc22=toHeaderRecord(getAuthHeaders(_0x3d1acc[_0x48e78f(0xdb)],_0x3d1acc['apiKey'],_0x3d1acc['accessToken']));this[_0x48e78f(0xff)]=new HTTPClient(_0x587fa5,_0x39fc22,{'proxy':_0x3d1acc[_0x48e78f(0xb5)]});}async[a91_0x2f0639(0xd9)](_0x399bf3={}){const _0x21c3cd=a91_0x2f0639,_0x3475ef=new URLSearchParams();_0x399bf3['campaignType']&&_0x3475ef[_0x21c3cd(0xe3)](_0x21c3cd(0xcf),_0x399bf3[_0x21c3cd(0xd6)]);_0x399bf3[_0x21c3cd(0xba)]&&_0x3475ef[_0x21c3cd(0xe3)](_0x21c3cd(0xbd),_0x399bf3[_0x21c3cd(0xba)]);_0x399bf3[_0x21c3cd(0xd4)]&&_0x3475ef[_0x21c3cd(0xe3)](_0x21c3cd(0xf4),_0x399bf3[_0x21c3cd(0xd4)]);_0x399bf3[_0x21c3cd(0xbf)]!==undefined&&_0x3475ef[_0x21c3cd(0xe3)]('page[limit]',_0x399bf3['limit']['toString']());_0x399bf3[_0x21c3cd(0xf5)]!==undefined&&_0x3475ef['append']('page[offset]',_0x399bf3[_0x21c3cd(0xf5)][_0x21c3cd(0x103)]());_0x399bf3[_0x21c3cd(0xf3)]&&_0x3475ef[_0x21c3cd(0xe3)](_0x21c3cd(0xf3),_0x399bf3[_0x21c3cd(0xf3)]);_0x399bf3[_0x21c3cd(0x106)]&&_0x3475ef[_0x21c3cd(0xe3)](_0x21c3cd(0x106),_0x399bf3[_0x21c3cd(0x106)]);const _0xef2901=_0x3475ef[_0x21c3cd(0x103)](),_0x319dc0=_0xef2901?_0x21c3cd(0xfd)+_0xef2901:_0x21c3cd(0xb9);return await this['httpClient'][_0x21c3cd(0x108)](_0x21c3cd(0xee),_0x319dc0,{'headers':{'Accept':_0x21c3cd(0xcd)}});}async[a91_0x2f0639(0x105)](_0x362d1e){const _0x30f03f=a91_0x2f0639;return await this[_0x30f03f(0xff)][_0x30f03f(0x108)](_0x30f03f(0xee),'/api/campaigns/'+encodeURIComponent(_0x362d1e),{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x2f0639(0xcc)](_0x552b43){const _0x18a813=a91_0x2f0639,_0x16258={'data':{'type':_0x18a813(0xc9),'attributes':_0x552b43}};return await this[_0x18a813(0xff)][_0x18a813(0x108)](_0x18a813(0xc5),_0x18a813(0xb9),{'headers':{'Content-Type':_0x18a813(0xcd),'Accept':_0x18a813(0xcd)},'body':JSON[_0x18a813(0xf8)](_0x16258)});}async[a91_0x2f0639(0xe5)](_0x20f5e0,_0x4611ea){const _0x4bd0a0=a91_0x2f0639,_0xf210eb={'data':{'type':_0x4bd0a0(0xc9),'id':_0x20f5e0,'attributes':_0x4611ea}};return await this[_0x4bd0a0(0xff)][_0x4bd0a0(0x108)]('PATCH',_0x4bd0a0(0xec)+encodeURIComponent(_0x20f5e0),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':JSON[_0x4bd0a0(0xf8)](_0xf210eb)});}async[a91_0x2f0639(0x104)](_0x52519c){const _0x38f60c=a91_0x2f0639;await this[_0x38f60c(0xff)][_0x38f60c(0x108)]('DELETE',_0x38f60c(0xec)+encodeURIComponent(_0x52519c),{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x2f0639(0xc3)](_0x82a6e6){const _0x69be3c=a91_0x2f0639;await this[_0x69be3c(0xff)][_0x69be3c(0x108)](_0x69be3c(0xc5),_0x69be3c(0xec)+encodeURIComponent(_0x82a6e6)+'/launch',{'headers':{'Content-Type':_0x69be3c(0x109),'Accept':_0x69be3c(0x109)},'body':JSON[_0x69be3c(0xf8)]({})});}async[a91_0x2f0639(0x102)](_0x4d1824){const _0x15087c=a91_0x2f0639;await this[_0x15087c(0xff)][_0x15087c(0x108)]('POST',_0x15087c(0xec)+encodeURIComponent(_0x4d1824)+_0x15087c(0x107),{'headers':{'Content-Type':_0x15087c(0x109),'Accept':_0x15087c(0x109)},'body':JSON[_0x15087c(0xf8)]({})});}async['resumeCampaign'](_0x5afe10){const _0x849642=a91_0x2f0639;await this['httpClient'][_0x849642(0x108)](_0x849642(0xc5),_0x849642(0xec)+encodeURIComponent(_0x5afe10)+_0x849642(0xc0),{'headers':{'Content-Type':_0x849642(0x109),'Accept':'application/json'},'body':JSON['stringify']({})});}async[a91_0x2f0639(0xc6)](_0x3a7bd4){const _0xc77c40=a91_0x2f0639;return await this['httpClient']['request'](_0xc77c40(0xc5),_0xc77c40(0xec)+encodeURIComponent(_0x3a7bd4)+_0xc77c40(0xf2),{'headers':{'Content-Type':_0xc77c40(0x109),'Accept':_0xc77c40(0xcd)},'body':JSON['stringify']({})});}async['listTemplates'](_0x534828={}){const _0x4335d2=a91_0x2f0639,_0x65b7ba=new URLSearchParams();_0x534828[_0x4335d2(0xd4)]&&_0x65b7ba[_0x4335d2(0xe3)](_0x4335d2(0xf4),_0x534828[_0x4335d2(0xd4)]);_0x534828['limit']!==undefined&&_0x65b7ba[_0x4335d2(0xe3)](_0x4335d2(0xe6),_0x534828[_0x4335d2(0xbf)]['toString']());_0x534828[_0x4335d2(0xf5)]!==undefined&&_0x65b7ba[_0x4335d2(0xe3)]('page[offset]',_0x534828[_0x4335d2(0xf5)][_0x4335d2(0x103)]());_0x534828['sort']&&_0x65b7ba['append'](_0x4335d2(0xf3),_0x534828[_0x4335d2(0xf3)]);const _0x4548df=_0x65b7ba['toString'](),_0x5a7de8=_0x4548df?_0x4335d2(0xd7)+_0x4548df:_0x4335d2(0xb6);return await this[_0x4335d2(0xff)][_0x4335d2(0x108)](_0x4335d2(0xee),_0x5a7de8,{'headers':{'Accept':_0x4335d2(0xcd)}});}async[a91_0x2f0639(0xd1)](_0x49fdd6){const _0x22e1e0=a91_0x2f0639;return await this[_0x22e1e0(0xff)][_0x22e1e0(0x108)]('GET','/api/email_templates/'+encodeURIComponent(_0x49fdd6),{'headers':{'Accept':_0x22e1e0(0xcd)}});}async['createTemplate'](_0x26a424){const _0x418b45=a91_0x2f0639,_0x4f1a69={'data':{'type':_0x418b45(0xf9),'attributes':_0x26a424}};return await this['httpClient'][_0x418b45(0x108)](_0x418b45(0xc5),_0x418b45(0xb6),{'headers':{'Content-Type':_0x418b45(0xcd),'Accept':_0x418b45(0xcd)},'body':JSON[_0x418b45(0xf8)](_0x4f1a69)});}async[a91_0x2f0639(0xe0)](_0xdd952a,_0x5f5db2){const _0x29e750=a91_0x2f0639,_0x3bd462={'data':{'type':_0x29e750(0xf9),'id':_0xdd952a,'attributes':_0x5f5db2}};return await this[_0x29e750(0xff)][_0x29e750(0x108)](_0x29e750(0xef),_0x29e750(0xdf)+encodeURIComponent(_0xdd952a),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x29e750(0xcd)},'body':JSON['stringify'](_0x3bd462)});}async[a91_0x2f0639(0xf6)](_0x136d9c){const _0x545771=a91_0x2f0639;await this[_0x545771(0xff)][_0x545771(0x108)](_0x545771(0xce),_0x545771(0xdf)+encodeURIComponent(_0x136d9c),{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x2f0639(0xde)](_0x13140a={}){const _0x5080ed=a91_0x2f0639,_0x37d68f=new URLSearchParams();_0x13140a['name']&&_0x37d68f[_0x5080ed(0xe3)](_0x5080ed(0xf7),_0x13140a[_0x5080ed(0xc8)]);_0x13140a[_0x5080ed(0xd3)]&&_0x37d68f['append'](_0x5080ed(0xcb),_0x13140a[_0x5080ed(0xd3)]);_0x13140a['limit']!==undefined&&_0x37d68f[_0x5080ed(0xe3)](_0x5080ed(0xe6),_0x13140a[_0x5080ed(0xbf)][_0x5080ed(0x103)]());_0x13140a[_0x5080ed(0xf5)]!==undefined&&_0x37d68f['append'](_0x5080ed(0xe1),_0x13140a['offset'][_0x5080ed(0x103)]());_0x13140a[_0x5080ed(0xf3)]&&_0x37d68f[_0x5080ed(0xe3)](_0x5080ed(0xf3),_0x13140a[_0x5080ed(0xf3)]);const _0x1d4d21=_0x37d68f[_0x5080ed(0x103)](),_0x285d88=_0x1d4d21?_0x5080ed(0xe9)+_0x1d4d21:_0x5080ed(0xd2);return await this[_0x5080ed(0xff)][_0x5080ed(0x108)](_0x5080ed(0xee),_0x285d88,{'headers':{'Accept':_0x5080ed(0xcd)}});}async[a91_0x2f0639(0x10a)](_0x1720a7){const _0x1ede3d=a91_0x2f0639;return await this[_0x1ede3d(0xff)][_0x1ede3d(0x108)]('GET',_0x1ede3d(0xc7)+encodeURIComponent(_0x1720a7),{'headers':{'Accept':_0x1ede3d(0xcd)}});}async[a91_0x2f0639(0xe7)](_0x203017){const _0x599c7c=a91_0x2f0639,_0x20fc92={'data':{'type':_0x599c7c(0xf1),'attributes':_0x203017}};return await this['httpClient']['request']('POST',_0x599c7c(0xd2),{'headers':{'Content-Type':_0x599c7c(0xcd),'Accept':_0x599c7c(0xcd)},'body':JSON[_0x599c7c(0xf8)](_0x20fc92)});}async[a91_0x2f0639(0xd0)](_0x38d81d,_0x57144f){const _0x585a48=a91_0x2f0639,_0x493bb1={'data':{'type':_0x585a48(0xf1),'id':_0x38d81d,'attributes':_0x57144f}};return await this[_0x585a48(0xff)]['request'](_0x585a48(0xef),'/api/workspaces/'+encodeURIComponent(_0x38d81d),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x585a48(0xcd)},'body':JSON['stringify'](_0x493bb1)});}async[a91_0x2f0639(0xfc)](_0x16038c){const _0xf558c2=a91_0x2f0639;await this['httpClient'][_0xf558c2(0x108)]('DELETE',_0xf558c2(0xc7)+encodeURIComponent(_0x16038c),{'headers':{'Accept':_0xf558c2(0xcd)}});}async[a91_0x2f0639(0x100)](_0x51e856,_0x4f26bb={}){const _0xf833e9=a91_0x2f0639,_0x1582fc=new URLSearchParams();_0x4f26bb['campaignType']&&_0x1582fc[_0xf833e9(0xe3)](_0xf833e9(0xcf),_0x4f26bb['campaignType']);_0x4f26bb[_0xf833e9(0xba)]&&_0x1582fc[_0xf833e9(0xe3)](_0xf833e9(0xbd),_0x4f26bb[_0xf833e9(0xba)]);_0x4f26bb[_0xf833e9(0xbf)]!==undefined&&_0x1582fc['append'](_0xf833e9(0xe6),_0x4f26bb[_0xf833e9(0xbf)][_0xf833e9(0x103)]());_0x4f26bb[_0xf833e9(0xf5)]!==undefined&&_0x1582fc[_0xf833e9(0xe3)](_0xf833e9(0xe1),_0x4f26bb[_0xf833e9(0xf5)][_0xf833e9(0x103)]());_0x4f26bb[_0xf833e9(0xf3)]&&_0x1582fc[_0xf833e9(0xe3)]('sort',_0x4f26bb['sort']);const _0x45e528=_0x1582fc['toString'](),_0x4cbc32=_0xf833e9(0xc7)+encodeURIComponent(_0x51e856)+_0xf833e9(0xeb)+(_0x45e528?'?'+_0x45e528:'');return await this[_0xf833e9(0xff)][_0xf833e9(0x108)](_0xf833e9(0xee),_0x4cbc32,{'headers':{'Accept':_0xf833e9(0xcd)}});}async['getAlwaysOnCampaign'](_0x39ccbd,_0x867a60){const _0x341c1e=a91_0x2f0639;return await this[_0x341c1e(0xff)][_0x341c1e(0x108)](_0x341c1e(0xee),_0x341c1e(0xc7)+encodeURIComponent(_0x39ccbd)+_0x341c1e(0xbc)+encodeURIComponent(_0x867a60),{'headers':{'Accept':_0x341c1e(0xcd)}});}async[a91_0x2f0639(0xed)](_0x2f8901,_0xf5daa2){const _0x3b2caa=a91_0x2f0639,_0x20fb1b={'data':{'type':_0x3b2caa(0xfb),'attributes':_0xf5daa2}};return await this[_0x3b2caa(0xff)][_0x3b2caa(0x108)](_0x3b2caa(0xc5),_0x3b2caa(0xc7)+encodeURIComponent(_0x2f8901)+_0x3b2caa(0xeb),{'headers':{'Content-Type':_0x3b2caa(0xcd),'Accept':_0x3b2caa(0xcd)},'body':JSON[_0x3b2caa(0xf8)](_0x20fb1b)});}async[a91_0x2f0639(0xbe)](_0x2bc4ff,_0x2a890b,_0x270488){const _0x4cd4aa=a91_0x2f0639,_0x49ffc9={'data':{'type':_0x4cd4aa(0xfb),'id':_0x2a890b,'attributes':_0x270488}};return await this['httpClient'][_0x4cd4aa(0x108)]('PATCH','/api/workspaces/'+encodeURIComponent(_0x2bc4ff)+_0x4cd4aa(0xbc)+encodeURIComponent(_0x2a890b),{'headers':{'Content-Type':_0x4cd4aa(0xcd),'Accept':_0x4cd4aa(0xcd)},'body':JSON['stringify'](_0x49ffc9)});}async[a91_0x2f0639(0xc4)](_0x49565a,_0x19b1b1){const _0x1b4639=a91_0x2f0639;await this[_0x1b4639(0xff)][_0x1b4639(0x108)](_0x1b4639(0xce),_0x1b4639(0xc7)+encodeURIComponent(_0x49565a)+_0x1b4639(0xbc)+encodeURIComponent(_0x19b1b1),{'headers':{'Accept':'application/vnd.api+json'}});}async['performAlwaysOnCampaignAction'](_0x455ead,_0x398411,_0x3beaa8){const _0x344498=a91_0x2f0639;await this[_0x344498(0xff)]['request'](_0x344498(0xc5),'/api/workspaces/'+encodeURIComponent(_0x455ead)+_0x344498(0xbc)+encodeURIComponent(_0x398411)+'/'+_0x3beaa8,{'headers':{'Content-Type':_0x344498(0x109),'Accept':_0x344498(0x109)},'body':JSON[_0x344498(0xf8)]({})});}async[a91_0x2f0639(0xf0)](_0xb56247,_0x241fb5){const _0xf0e1f9=a91_0x2f0639;await this[_0xf0e1f9(0xe4)](_0xb56247,_0x241fb5,_0xf0e1f9(0xe2));}async[a91_0x2f0639(0xdc)](_0x53e6cd,_0x3cb707){const _0x54728c=a91_0x2f0639;await this[_0x54728c(0xe4)](_0x53e6cd,_0x3cb707,_0x54728c(0xb7));}async['resumeAlwaysOnCampaign'](_0x1edf87,_0x237f3b){const _0x53c5eb=a91_0x2f0639;await this[_0x53c5eb(0xe4)](_0x1edf87,_0x237f3b,_0x53c5eb(0x101));}async[a91_0x2f0639(0xfe)](_0x26f658,_0x3a9b6b){const _0x563319=a91_0x2f0639;await this[_0x563319(0xe4)](_0x26f658,_0x3a9b6b,'finish');}async[a91_0x2f0639(0xc2)](_0x1e3911,_0x2c227b,_0x59f828){const _0x3a95c8=a91_0x2f0639,_0x470083=_0x59f828?{'data':{'attributes':{'name':_0x59f828}}}:{};return await this[_0x3a95c8(0xff)][_0x3a95c8(0x108)](_0x3a95c8(0xc5),_0x3a95c8(0xc7)+encodeURIComponent(_0x1e3911)+_0x3a95c8(0xbc)+encodeURIComponent(_0x2c227b)+_0x3a95c8(0xf2),{'headers':{'Content-Type':_0x3a95c8(0x109),'Accept':_0x3a95c8(0xcd)},'body':JSON[_0x3a95c8(0xf8)](_0x470083)});}}
@@ -1 +1 @@
1
- const a92_0x1c8fff=a92_0x1713;(function(_0x503d84,_0x3621e4){const _0x5a0da3=a92_0x1713,_0x4c5239=_0x503d84();while(!![]){try{const _0x2ec089=-parseInt(_0x5a0da3(0x253))/0x1*(parseInt(_0x5a0da3(0x252))/0x2)+parseInt(_0x5a0da3(0x256))/0x3*(parseInt(_0x5a0da3(0x20b))/0x4)+-parseInt(_0x5a0da3(0x20a))/0x5*(parseInt(_0x5a0da3(0x215))/0x6)+parseInt(_0x5a0da3(0x1f7))/0x7*(-parseInt(_0x5a0da3(0x249))/0x8)+parseInt(_0x5a0da3(0x24a))/0x9+-parseInt(_0x5a0da3(0x232))/0xa+parseInt(_0x5a0da3(0x246))/0xb;if(_0x2ec089===_0x3621e4)break;else _0x4c5239['push'](_0x4c5239['shift']());}catch(_0x205633){_0x4c5239['push'](_0x4c5239['shift']());}}}(a92_0x420a,0x219bc));import{ErrorCode,SDKError}from'../errors.js';import{Logger}from'../../utils/logger/index.js';import a92_0x11519a from'json-bigint';function getErrorChain(_0x5bce5e,_0x25c094=0x5){const _0x57e8a5=a92_0x1713,_0x18b909=[_0x5bce5e];let _0x4ae898=_0x5bce5e;for(let _0x513f9d=0x0;_0x513f9d<_0x25c094&&_0x4ae898;_0x513f9d++){const _0x51350a=_0x4ae898[_0x57e8a5(0x250)];if(_0x51350a instanceof Error)_0x18b909['push'](_0x51350a),_0x4ae898=_0x51350a;else break;}return _0x18b909;}function extractRootCause(_0x3d3d6e){const _0x227e7f=a92_0x1713,_0x15530f=getErrorChain(_0x3d3d6e,0x4),_0x18782c=_0x15530f[_0x15530f[_0x227e7f(0x228)]-0x1],_0x9f070=_0x18782c[_0x227e7f(0x250)];if(_0x9f070&&!(_0x9f070 instanceof Error))return String(_0x9f070);return _0x18782c[_0x227e7f(0x229)]||_0x227e7f(0x1f6);}const DEFAULT_RETRY_CONFIG={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1f40};function isRetryableStatus(_0x31f992){return _0x31f992>=0x1f4||_0x31f992===0x1ad;}function a92_0x420a(){const _0x193b84=['detail','Unknown\x20error','77TJBBov','RATE_LIMITED','round','Error\x20response\x20body:\x20','password','\x20failed:\x20','An\x20error\x20occurred','Using\x20proxy:\x20','PERMISSION_DENIED','Request\x20cancelled\x20by\x20user','random','retrying\x20in\x20','signal','Retry-After','statusText','then','toLowerCase','status_code','aborted','1280TsTzxl','4SBUriV','NOT_FOUND','object','abort','Error','request','Response\x20[','undici','PROXY_CONNECTION_FAILURE','debug','924NTsvpf','logger','requestSSE','retryConfig','status','pow','baseUrl','maskProxyCredentials','parse','code','trace','tunnel','tdx.client.http','extractErrorMessage','Failed\x20to\x20connect\x20through\x20proxy\x20','proxy','addEventListener','handleErrorResponse','string','length','message',']\x20Request\x20failed\x20with\x20','defaultHeaders',']\x20Request\x20failed\x20with\x20HTTP\x20','safeParseJSON','name','info','maxRetries','parseProblemDetails','199890cecqjt','****','[binary\x20data]','headers',']\x20Request\x20to\x20','problemDetails','dispatcher','severity','INTERNAL','min','combineSignals','proxyReady','text','HTTP\x20','HTTPClientError','type','error','from','instance','proxyUrl','709390dwzzlW','isProxyConnectionError','toString','84704GSnnPq','2338398SsegiK','title','UNAUTHENTICATED','stringify','includes','[Retry\x20','cause','forEach','66gIOhjX','1150EAXTof','Content-Type','ms...','81537OAotBe','about:blank','AbortError','warn','body','json','Request\x20failed\x20after\x20retries'];a92_0x420a=function(){return _0x193b84;};return a92_0x420a();}function isNonRetryable429(_0x23d5ac){const _0x5d9d72=a92_0x1713;return _0x23d5ac[_0x5d9d72(0x24e)]('already\x20running');}function getRetryDelay(_0x1dcd76,_0xcbf7fd){const _0xf3d8f5=a92_0x1713,_0x3436e0=Math[_0xf3d8f5(0x23b)](_0xcbf7fd['baseDelay']*Math[_0xf3d8f5(0x21a)](0x2,_0x1dcd76),_0xcbf7fd['maxDelay']);return Math[_0xf3d8f5(0x201)]()*_0x3436e0;}function statusCodeToErrorCode(_0x5bdd77){const _0x286b0d=a92_0x1713;if(_0x5bdd77===0x191)return ErrorCode[_0x286b0d(0x24c)];else{if(_0x5bdd77===0x193)return ErrorCode[_0x286b0d(0x1ff)];else{if(_0x5bdd77===0x194)return ErrorCode[_0x286b0d(0x20c)];else{if(_0x5bdd77===0x1ad)return ErrorCode[_0x286b0d(0x1f8)];else return _0x5bdd77>=0x1f4?ErrorCode['UNAVAILABLE']:ErrorCode['INVALID_ARGUMENT'];}}}}export class HTTPClientError extends Error{[a92_0x1c8fff(0x219)];[a92_0x1c8fff(0x237)];[a92_0x1c8fff(0x21e)];constructor(_0x489ad9,_0x2c08e9,_0x1ed0cd){const _0x4bf81d=a92_0x1c8fff,_0x5f3cc2=statusCodeToErrorCode(_0x2c08e9);super('['+_0x5f3cc2+']\x20'+_0x489ad9),this[_0x4bf81d(0x219)]=_0x2c08e9,this[_0x4bf81d(0x237)]=_0x1ed0cd,this[_0x4bf81d(0x22e)]=_0x4bf81d(0x240),this[_0x4bf81d(0x21e)]=_0x5f3cc2;}}function a92_0x1713(_0x4483af,_0x3be633){_0x4483af=_0x4483af-0x1f3;const _0x420ae8=a92_0x420a();let _0x17130f=_0x420ae8[_0x4483af];return _0x17130f;}export class HTTPClient{[a92_0x1c8fff(0x218)];[a92_0x1c8fff(0x21b)];[a92_0x1c8fff(0x22b)];['logger']=Logger['of'](a92_0x1c8fff(0x221));[a92_0x1c8fff(0x238)];['proxyReady'];[a92_0x1c8fff(0x245)];constructor(_0x5b6ed8,_0x199688,_0xdeec21){const _0x536213=a92_0x1c8fff;this['baseUrl']=_0x5b6ed8,this[_0x536213(0x22b)]=_0x199688,this['retryConfig']={...DEFAULT_RETRY_CONFIG,..._0xdeec21?.[_0x536213(0x218)]},_0xdeec21?.[_0x536213(0x224)]&&(this[_0x536213(0x245)]=_0xdeec21[_0x536213(0x224)],this[_0x536213(0x23d)]=import(_0x536213(0x212))[_0x536213(0x206)](({ProxyAgent:_0x10bb49})=>{const _0x12a418=_0x536213;this['dispatcher']=new _0x10bb49(_0xdeec21[_0x12a418(0x224)]);}),this[_0x536213(0x216)]['info'](_0x536213(0x1fe)+this['maskProxyCredentials'](_0xdeec21[_0x536213(0x224)])));}[a92_0x1c8fff(0x21c)](_0xeea841){const _0x5c2847=a92_0x1c8fff;try{const _0x51abb7=new URL(_0xeea841);return _0x51abb7['username']&&(_0x51abb7['username']='****'),_0x51abb7[_0x5c2847(0x1fb)]&&(_0x51abb7['password']=_0x5c2847(0x233)),_0x51abb7[_0x5c2847(0x248)]();}catch{return _0xeea841;}}[a92_0x1c8fff(0x247)](_0x1cdbb5){const _0x1885f9=a92_0x1c8fff,_0x3c7c47=getErrorChain(_0x1cdbb5);for(const _0xb76288 of _0x3c7c47){const _0x2b51a3=_0xb76288[_0x1885f9(0x229)][_0x1885f9(0x207)](),_0x314bff=_0xb76288[_0x1885f9(0x22e)][_0x1885f9(0x207)]();if(_0x2b51a3['includes'](_0x1885f9(0x224))||_0x314bff['includes'](_0x1885f9(0x224))||_0x2b51a3[_0x1885f9(0x24e)](_0x1885f9(0x220))||_0x2b51a3[_0x1885f9(0x24e)]('407'))return!![];if(_0x1885f9(0x21e)in _0xb76288&&typeof _0xb76288[_0x1885f9(0x21e)]===_0x1885f9(0x227)){if(_0xb76288[_0x1885f9(0x21e)][_0x1885f9(0x24e)]('PROXY'))return!![];}}return![];}async[a92_0x1c8fff(0x210)](_0x36e5f1,_0x3dbc72,_0x4e0b82={}){const _0x1f3618=a92_0x1c8fff,{headers:headers={},body:_0x1fc4ee,timeout:timeout=0x7530,retries:retries=this['retryConfig'][_0x1f3618(0x230)],signal:_0x38b44a,includeHeaders:includeHeaders=![],responseType:responseType=_0x1f3618(0x1f3)}=_0x4e0b82,_0x49a629=''+this['baseUrl']+_0x3dbc72;this[_0x1f3618(0x216)][_0x1f3618(0x22f)]('Request:\x20'+_0x36e5f1+'\x20'+_0x49a629);const _0x13bce6={...this[_0x1f3618(0x22b)],...headers};if(_0x1fc4ee&&!_0x13bce6[_0x1f3618(0x254)]){if(_0x1fc4ee instanceof Buffer){}else _0x13bce6['Content-Type']='application/json';}let _0x48bfe4;_0x1fc4ee&&(_0x1fc4ee instanceof Buffer?_0x48bfe4=_0x1fc4ee:_0x48bfe4=typeof _0x1fc4ee==='string'?_0x1fc4ee:JSON[_0x1f3618(0x24d)](_0x1fc4ee));_0x48bfe4&&this[_0x1f3618(0x216)][_0x1f3618(0x214)]('request\x20body:\x20'+(typeof _0x48bfe4==='string'?_0x48bfe4:_0x1f3618(0x234)));let _0x2826f0=null;for(let _0x52ef2f=0x0;_0x52ef2f<=retries;_0x52ef2f++){try{const _0x20a18a=new AbortController(),_0x515331=setTimeout(()=>_0x20a18a[_0x1f3618(0x20e)](),timeout);if(_0x38b44a){if(_0x38b44a[_0x1f3618(0x209)])throw new Error(_0x1f3618(0x200));_0x38b44a[_0x1f3618(0x225)](_0x1f3618(0x20e),()=>_0x20a18a['abort'](),{'once':!![]});}this[_0x1f3618(0x23d)]&&await this['proxyReady'];const _0x354882={'method':_0x36e5f1,'headers':_0x13bce6,'body':_0x48bfe4,'signal':_0x20a18a['signal']};this['dispatcher']&&(_0x354882['dispatcher']=this['dispatcher']);const _0x2eea99=await fetch(_0x49a629,_0x354882);clearTimeout(_0x515331);if(_0x52ef2f<retries&&isRetryableStatus(_0x2eea99[_0x1f3618(0x219)])){if(_0x2eea99[_0x1f3618(0x219)]===0x1ad){const _0x58c985=await _0x2eea99[_0x1f3618(0x23e)]();if(isNonRetryable429(_0x58c985)){const _0x4b731e=this['extractErrorMessage'](_0x58c985)||_0x2eea99[_0x1f3618(0x205)];throw new HTTPClientError(_0x4b731e,_0x2eea99[_0x1f3618(0x219)]);}}const _0x1351de=_0x2eea99['headers']['get'](_0x1f3618(0x204)),_0x2aba1a=_0x1351de?parseInt(_0x1351de,0xa)*0x3e8:getRetryDelay(_0x52ef2f,this['retryConfig']);console[_0x1f3618(0x259)](_0x1f3618(0x24f)+(_0x52ef2f+0x1)+'/'+retries+_0x1f3618(0x22a)+_0x2eea99[_0x1f3618(0x219)]+',\x20'+(_0x1f3618(0x202)+Math[_0x1f3618(0x1f9)](_0x2aba1a)+_0x1f3618(0x255))),await this['sleep'](_0x2aba1a);continue;}!_0x2eea99['ok']&&await this[_0x1f3618(0x226)](_0x2eea99);let _0x262be3;if(responseType==='arraybuffer'){const _0x7f9217=await _0x2eea99['arrayBuffer']();_0x262be3=Buffer[_0x1f3618(0x243)](_0x7f9217);}else responseType===_0x1f3618(0x23e)?_0x262be3=await _0x2eea99['text']():_0x262be3=await this[_0x1f3618(0x22d)](_0x2eea99);this[_0x1f3618(0x216)]['debug'](_0x1f3618(0x211)+_0x2eea99[_0x1f3618(0x219)]+']:\x20'+_0x36e5f1+'\x20'+_0x3dbc72),this[_0x1f3618(0x216)][_0x1f3618(0x21f)](JSON[_0x1f3618(0x24d)](_0x262be3,null,0x2));if(includeHeaders){const _0x2e81c3={};return _0x2eea99[_0x1f3618(0x235)][_0x1f3618(0x251)]((_0x26d7b5,_0x311dd4)=>{_0x2e81c3[_0x311dd4]=_0x26d7b5;}),{'data':_0x262be3,'status':_0x2eea99[_0x1f3618(0x219)],'headers':_0x2e81c3};}return _0x262be3;}catch(_0xb18e15){_0x2826f0=_0xb18e15 instanceof Error?_0xb18e15:new Error(String(_0xb18e15));if(_0xb18e15 instanceof HTTPClientError){if(!isRetryableStatus(_0xb18e15[_0x1f3618(0x219)])||_0xb18e15['status']===0x1ad&&isNonRetryable429(_0xb18e15[_0x1f3618(0x229)]))throw _0xb18e15;}if(_0x52ef2f>=retries){if(!(_0x2826f0 instanceof HTTPClientError)){const _0x5267e7=extractRootCause(_0x2826f0);if(this[_0x1f3618(0x245)]&&this['isProxyConnectionError'](_0x2826f0))throw new SDKError(ErrorCode[_0x1f3618(0x213)],_0x1f3618(0x223)+this['maskProxyCredentials'](this[_0x1f3618(0x245)])+':\x20'+_0x5267e7,_0x2826f0);throw new SDKError(ErrorCode['HTTP_REQUEST_FAILURE'],'Request\x20to\x20'+_0x49a629+_0x1f3618(0x1fc)+_0x5267e7,_0x2826f0);}throw _0x2826f0;}const _0x52e311=getRetryDelay(_0x52ef2f,this['retryConfig']);let _0x42b1e7;_0x2826f0 instanceof HTTPClientError?_0x42b1e7='[Retry\x20'+(_0x52ef2f+0x1)+'/'+retries+_0x1f3618(0x22c)+_0x2826f0[_0x1f3618(0x219)]+':\x20'+_0x2826f0[_0x1f3618(0x229)]+',\x20'+(_0x1f3618(0x202)+Math[_0x1f3618(0x1f9)](_0x52e311)+_0x1f3618(0x255)):_0x42b1e7=_0x1f3618(0x24f)+(_0x52ef2f+0x1)+'/'+retries+_0x1f3618(0x236)+_0x49a629+_0x1f3618(0x1fc)+_0x2826f0[_0x1f3618(0x229)]+',\x20'+(_0x1f3618(0x202)+Math[_0x1f3618(0x1f9)](_0x52e311)+_0x1f3618(0x255)),console[_0x1f3618(0x259)](_0x42b1e7),await this['sleep'](_0x52e311);}}throw _0x2826f0||new SDKError(ErrorCode[_0x1f3618(0x23a)],_0x1f3618(0x1f4));}async[a92_0x1c8fff(0x22d)](_0x42fcf4){const _0x338617=a92_0x1c8fff,_0x44714f=await _0x42fcf4['text']();if(!_0x44714f)return null;try{const _0x22ef0a=a92_0x11519a({'storeAsString':!![]});return _0x22ef0a[_0x338617(0x21d)](_0x44714f);}catch{return{'body':_0x44714f};}}['parseProblemDetails'](_0x2945f9,_0xc47c80){const _0x8ca868=a92_0x1c8fff;if(!_0x2945f9||typeof _0x2945f9!==_0x8ca868(0x20d))return undefined;let _0x16a3e2=_0x2945f9;_0x16a3e2['errors']&&typeof _0x16a3e2['errors']==='object'&&(_0x16a3e2=_0x16a3e2['errors']);if(_0x16a3e2[_0x8ca868(0x241)]||_0x16a3e2[_0x8ca868(0x24b)]||_0x16a3e2[_0x8ca868(0x1f5)])return{'type':_0x16a3e2[_0x8ca868(0x241)]||_0x8ca868(0x257),'title':_0x16a3e2['title']||_0x8ca868(0x20f),'status':_0x16a3e2[_0x8ca868(0x219)]||_0xc47c80,'detail':_0x16a3e2[_0x8ca868(0x1f5)]||_0x8ca868(0x1fd),'instance':_0x16a3e2[_0x8ca868(0x244)]||'',..._0x16a3e2};const _0x421c3c=_0x16a3e2[_0x8ca868(0x229)]||_0x16a3e2['error']||_0x16a3e2['text'];if(typeof _0x421c3c==='string')return{'type':_0x8ca868(0x257),'title':_0x16a3e2[_0x8ca868(0x239)]||_0x8ca868(0x20f),'status':_0x16a3e2[_0x8ca868(0x208)]||_0xc47c80,'detail':_0x421c3c,'instance':'',..._0x16a3e2};return undefined;}async['handleErrorResponse'](_0x555f38){const _0x40fde1=a92_0x1c8fff,_0x4bddcc=await this[_0x40fde1(0x22d)](_0x555f38),_0x38c99e=this[_0x40fde1(0x231)](_0x4bddcc,_0x555f38['status']);_0x4bddcc&&this[_0x40fde1(0x216)][_0x40fde1(0x214)](_0x40fde1(0x1fa)+JSON[_0x40fde1(0x24d)](_0x4bddcc));let _0x4c821a;if(_0x38c99e?.[_0x40fde1(0x1f5)])_0x4c821a=_0x38c99e['detail'];else _0x4bddcc?_0x4c821a='HTTP\x20'+_0x555f38[_0x40fde1(0x219)]+':\x20'+_0x555f38[_0x40fde1(0x205)]+'\x0a\x20\x20Details:\x20'+JSON['stringify'](_0x4bddcc):_0x4c821a=_0x40fde1(0x23f)+_0x555f38[_0x40fde1(0x219)]+':\x20'+_0x555f38['statusText'];throw new HTTPClientError(_0x4c821a,_0x555f38[_0x40fde1(0x219)],_0x38c99e);}['sleep'](_0x2702fa){return new Promise(_0x1bd193=>setTimeout(_0x1bd193,_0x2702fa));}[a92_0x1c8fff(0x222)](_0xa30fa5){const _0x2ee8e3=a92_0x1c8fff;try{const _0x2e953a=JSON[_0x2ee8e3(0x21d)](_0xa30fa5);return _0x2e953a[_0x2ee8e3(0x1f5)]||_0x2e953a['message']||_0x2e953a[_0x2ee8e3(0x242)]||null;}catch{return _0xa30fa5[_0x2ee8e3(0x228)]<0x1f4?_0xa30fa5:null;}}async[a92_0x1c8fff(0x217)](_0x3b2cee,_0x164b3d,_0x3119f6={}){const _0x5ef879=a92_0x1c8fff,{headers:headers={},body:_0x3206e4,timeout:timeout=0x7530,signal:_0x299612}=_0x3119f6,_0x481cc9=''+this[_0x5ef879(0x21b)]+_0x164b3d,_0x556df7={...this['defaultHeaders'],...headers},_0x404840=new AbortController(),_0xeca35d=setTimeout(()=>_0x404840[_0x5ef879(0x20e)](),timeout),_0x177784=_0x299612?[_0x404840[_0x5ef879(0x203)],_0x299612]:[_0x404840[_0x5ef879(0x203)]],_0x45f50e=this['combineSignals'](_0x177784);try{this[_0x5ef879(0x23d)]&&await this[_0x5ef879(0x23d)];const _0x1f6b25={'method':_0x3b2cee,'headers':_0x556df7,'signal':_0x45f50e};this[_0x5ef879(0x238)]&&(_0x1f6b25[_0x5ef879(0x238)]=this[_0x5ef879(0x238)]);if(_0x3206e4){if(typeof _0x3206e4===_0x5ef879(0x227))_0x1f6b25[_0x5ef879(0x25a)]=_0x3206e4;else _0x3206e4 instanceof Buffer?_0x1f6b25[_0x5ef879(0x25a)]=_0x3206e4:_0x1f6b25['body']=JSON['stringify'](_0x3206e4);}const _0x434e4e=await fetch(_0x481cc9,_0x1f6b25);return clearTimeout(_0xeca35d),!_0x434e4e['ok']&&await this[_0x5ef879(0x226)](_0x434e4e),_0x434e4e;}catch(_0x322d1a){clearTimeout(_0xeca35d);if(_0x322d1a instanceof HTTPClientError)throw _0x322d1a;if(_0x322d1a[_0x5ef879(0x22e)]===_0x5ef879(0x258))throw new Error('Request\x20cancelled\x20by\x20user');if(this[_0x5ef879(0x245)]&&_0x322d1a instanceof Error&&this[_0x5ef879(0x247)](_0x322d1a))throw new SDKError(ErrorCode[_0x5ef879(0x213)],'Failed\x20to\x20connect\x20through\x20proxy\x20'+this[_0x5ef879(0x21c)](this[_0x5ef879(0x245)])+':\x20'+_0x322d1a[_0x5ef879(0x229)],_0x322d1a);throw _0x322d1a;}}[a92_0x1c8fff(0x23c)](_0x4bbfc2){const _0x2778f6=a92_0x1c8fff,_0x479680=new AbortController();for(const _0x1b1523 of _0x4bbfc2){if(_0x1b1523[_0x2778f6(0x209)])return _0x479680['abort'](),_0x479680['signal'];_0x1b1523[_0x2778f6(0x225)](_0x2778f6(0x20e),()=>_0x479680[_0x2778f6(0x20e)](),{'once':!![]});}return _0x479680[_0x2778f6(0x203)];}}
1
+ const a92_0x57f17e=a92_0x4984;(function(_0x2720bc,_0x540375){const _0x45eaca=a92_0x4984,_0x5707e9=_0x2720bc();while(!![]){try{const _0x930f9=-parseInt(_0x45eaca(0x1cd))/0x1*(parseInt(_0x45eaca(0x1ba))/0x2)+-parseInt(_0x45eaca(0x1d9))/0x3*(-parseInt(_0x45eaca(0x19e))/0x4)+-parseInt(_0x45eaca(0x197))/0x5+-parseInt(_0x45eaca(0x1b5))/0x6*(parseInt(_0x45eaca(0x1b1))/0x7)+-parseInt(_0x45eaca(0x1f2))/0x8+-parseInt(_0x45eaca(0x1a4))/0x9*(-parseInt(_0x45eaca(0x1b7))/0xa)+parseInt(_0x45eaca(0x1ab))/0xb;if(_0x930f9===_0x540375)break;else _0x5707e9['push'](_0x5707e9['shift']());}catch(_0x130121){_0x5707e9['push'](_0x5707e9['shift']());}}}(a92_0x507e,0xb70e0));import{ErrorCode,SDKError}from'../errors.js';import{Logger}from'../../utils/logger/index.js';import a92_0x42acb6 from'json-bigint';function getErrorChain(_0x11af9f,_0x1d9992=0x5){const _0x40f6b7=a92_0x4984,_0x3c5881=[_0x11af9f];let _0x486173=_0x11af9f;for(let _0x24b64c=0x0;_0x24b64c<_0x1d9992&&_0x486173;_0x24b64c++){const _0x4a5711=_0x486173[_0x40f6b7(0x1f6)];if(_0x4a5711 instanceof Error)_0x3c5881[_0x40f6b7(0x196)](_0x4a5711),_0x486173=_0x4a5711;else break;}return _0x3c5881;}function extractRootCause(_0x5caf83){const _0x3cb173=a92_0x4984,_0x135512=getErrorChain(_0x5caf83,0x4),_0x2c7844=_0x135512[_0x135512['length']-0x1],_0x362cba=_0x2c7844['cause'];if(_0x362cba&&!(_0x362cba instanceof Error))return String(_0x362cba);return _0x2c7844[_0x3cb173(0x1ad)]||_0x3cb173(0x1d5);}const DEFAULT_RETRY_CONFIG={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1f40};function isRetryableStatus(_0x2fc54d){return _0x2fc54d>=0x1f4||_0x2fc54d===0x1ad;}function isNonRetryable429(_0x37c159){const _0x558f91=a92_0x4984;return _0x37c159[_0x558f91(0x1e4)](_0x558f91(0x1a7));}function a92_0x4984(_0x393550,_0x17790e){_0x393550=_0x393550-0x18b;const _0x507ec8=a92_0x507e();let _0x49843d=_0x507ec8[_0x393550];return _0x49843d;}function getRetryDelay(_0xfd8dd0,_0x3ddf23){const _0x88e32d=a92_0x4984,_0x5caff9=Math[_0x88e32d(0x1bd)](_0x3ddf23[_0x88e32d(0x19b)]*Math['pow'](0x2,_0xfd8dd0),_0x3ddf23['maxDelay']);return Math[_0x88e32d(0x1e5)]()*_0x5caff9;}function statusCodeToErrorCode(_0x53e971){const _0x5b1c3e=a92_0x4984;if(_0x53e971===0x191)return ErrorCode[_0x5b1c3e(0x1f0)];else{if(_0x53e971===0x193)return ErrorCode[_0x5b1c3e(0x1a5)];else{if(_0x53e971===0x194)return ErrorCode['NOT_FOUND'];else{if(_0x53e971===0x1ad)return ErrorCode[_0x5b1c3e(0x1b2)];else return _0x53e971>=0x1f4?ErrorCode[_0x5b1c3e(0x19f)]:ErrorCode['INVALID_ARGUMENT'];}}}}export class HTTPClientError extends Error{[a92_0x57f17e(0x191)];['problemDetails'];['code'];constructor(_0x2c8dcc,_0x4ce848,_0x68e478){const _0x236d92=a92_0x57f17e,_0x288d67=statusCodeToErrorCode(_0x4ce848);super('['+_0x288d67+']\x20'+_0x2c8dcc),this['status']=_0x4ce848,this[_0x236d92(0x1c7)]=_0x68e478,this['name']=_0x236d92(0x1ca),this[_0x236d92(0x1c2)]=_0x288d67;}}function a92_0x507e(){const _0x2f3d20=['round','password','severity','HTTP_REQUEST_FAILURE','toString','[Retry\x20','forEach','baseUrl','ms...','Failed\x20to\x20connect\x20through\x20proxy\x20','includes','random','dispatcher','AbortError','Request\x20to\x20','trace','tdx.client.http','Request:\x20','handleErrorResponse','safeParseJSON','tunnel','json','UNAUTHENTICATED','Error','5869768blCmWg','\x0a\x20\x20Details:\x20','request','combineSignals','cause','stringify','extractErrorMessage','name','INTERNAL','retrying\x20in\x20','Using\x20proxy:\x20','status','errors','type','debug','407','push','7230455gYdQNp','proxy','Retry-After',']\x20Request\x20failed\x20with\x20HTTP\x20','baseDelay','string','HTTP\x20','17788hsEQVd','UNAVAILABLE','[binary\x20data]','PROXY_CONNECTION_FAILURE','detail','isProxyConnectionError','63AvomXe','PERMISSION_DENIED',']:\x20','already\x20running','warn','application/json','statusText','26270750KmaIbq','error','message','get','from','signal','90153zOcusv','RATE_LIMITED','logger','parseProblemDetails','576ZDgHnW','PROXY','1470460LfwsJW','maskProxyCredentials','object','895654xhYFUt','****','proxyReady','min','instance','abort','text','Content-Type','code','defaultHeaders','toLowerCase','undici','sleep','problemDetails','retryConfig','Request\x20cancelled\x20by\x20user','HTTPClientError','body','username','1PwbNpQ','Response\x20[','parse','status_code','addEventListener','proxyUrl',']\x20Request\x20to\x20','aborted','Unknown\x20error','Error\x20response\x20body:\x20','info','\x20failed:\x20','807yaDxZk'];a92_0x507e=function(){return _0x2f3d20;};return a92_0x507e();}export class HTTPClient{['retryConfig'];['baseUrl'];['defaultHeaders'];[a92_0x57f17e(0x1b3)]=Logger['of'](a92_0x57f17e(0x1ea));[a92_0x57f17e(0x1e6)];[a92_0x57f17e(0x1bc)];[a92_0x57f17e(0x1d2)];constructor(_0xa9fac5,_0x57e581,_0x336342){const _0x4aaccb=a92_0x57f17e;this['baseUrl']=_0xa9fac5,this[_0x4aaccb(0x1c3)]=_0x57e581,this['retryConfig']={...DEFAULT_RETRY_CONFIG,..._0x336342?.['retryConfig']},_0x336342?.[_0x4aaccb(0x198)]&&(this[_0x4aaccb(0x1d2)]=_0x336342['proxy'],this['proxyReady']=import(_0x4aaccb(0x1c5))['then'](({ProxyAgent:_0x203fc1})=>{const _0x14db37=_0x4aaccb;this[_0x14db37(0x1e6)]=new _0x203fc1(_0x336342[_0x14db37(0x198)]);}),this[_0x4aaccb(0x1b3)]['info'](_0x4aaccb(0x190)+this[_0x4aaccb(0x1b8)](_0x336342[_0x4aaccb(0x198)])));}[a92_0x57f17e(0x1b8)](_0x59d846){const _0x213c39=a92_0x57f17e;try{const _0x230872=new URL(_0x59d846);return _0x230872[_0x213c39(0x1cc)]&&(_0x230872[_0x213c39(0x1cc)]='****'),_0x230872['password']&&(_0x230872[_0x213c39(0x1db)]=_0x213c39(0x1bb)),_0x230872[_0x213c39(0x1de)]();}catch{return _0x59d846;}}[a92_0x57f17e(0x1a3)](_0x37ce89){const _0x247d6b=a92_0x57f17e,_0x9026d2=getErrorChain(_0x37ce89);for(const _0x14e7dc of _0x9026d2){const _0x2beaa6=_0x14e7dc[_0x247d6b(0x1ad)]['toLowerCase'](),_0x144c11=_0x14e7dc[_0x247d6b(0x18d)][_0x247d6b(0x1c4)]();if(_0x2beaa6[_0x247d6b(0x1e4)](_0x247d6b(0x198))||_0x144c11['includes'](_0x247d6b(0x198))||_0x2beaa6[_0x247d6b(0x1e4)](_0x247d6b(0x1ee))||_0x2beaa6[_0x247d6b(0x1e4)](_0x247d6b(0x195)))return!![];if(_0x247d6b(0x1c2)in _0x14e7dc&&typeof _0x14e7dc[_0x247d6b(0x1c2)]===_0x247d6b(0x19c)){if(_0x14e7dc[_0x247d6b(0x1c2)][_0x247d6b(0x1e4)](_0x247d6b(0x1b6)))return!![];}}return![];}async[a92_0x57f17e(0x1f4)](_0x454d06,_0x361e70,_0x238e88={}){const _0x1c5a75=a92_0x57f17e,{headers:headers={},body:_0x3b7578,timeout:timeout=0x7530,retries:retries=this[_0x1c5a75(0x1c8)]['maxRetries'],signal:_0x1fb1c5,includeHeaders:includeHeaders=![],responseType:responseType=_0x1c5a75(0x1ef)}=_0x238e88,_0x34747e=''+this[_0x1c5a75(0x1e1)]+_0x361e70;this[_0x1c5a75(0x1b3)][_0x1c5a75(0x1d7)](_0x1c5a75(0x1eb)+_0x454d06+'\x20'+_0x34747e);const _0x196ecb={...this[_0x1c5a75(0x1c3)],...headers};if(_0x3b7578&&!_0x196ecb[_0x1c5a75(0x1c1)]){if(_0x3b7578 instanceof Buffer){}else _0x196ecb[_0x1c5a75(0x1c1)]=_0x1c5a75(0x1a9);}let _0x2fb5c9;_0x3b7578&&(_0x3b7578 instanceof Buffer?_0x2fb5c9=_0x3b7578:_0x2fb5c9=typeof _0x3b7578===_0x1c5a75(0x19c)?_0x3b7578:JSON[_0x1c5a75(0x18b)](_0x3b7578));_0x2fb5c9&&this['logger'][_0x1c5a75(0x194)]('request\x20body:\x20'+(typeof _0x2fb5c9===_0x1c5a75(0x19c)?_0x2fb5c9:_0x1c5a75(0x1a0)));let _0x4073b9=null;for(let _0x731661=0x0;_0x731661<=retries;_0x731661++){try{const _0x1a140c=new AbortController(),_0x5119aa=setTimeout(()=>_0x1a140c[_0x1c5a75(0x1bf)](),timeout);if(_0x1fb1c5){if(_0x1fb1c5[_0x1c5a75(0x1d4)])throw new Error(_0x1c5a75(0x1c9));_0x1fb1c5[_0x1c5a75(0x1d1)](_0x1c5a75(0x1bf),()=>_0x1a140c['abort'](),{'once':!![]});}this[_0x1c5a75(0x1bc)]&&await this[_0x1c5a75(0x1bc)];const _0x27377a={'method':_0x454d06,'headers':_0x196ecb,'body':_0x2fb5c9,'signal':_0x1a140c[_0x1c5a75(0x1b0)]};this[_0x1c5a75(0x1e6)]&&(_0x27377a[_0x1c5a75(0x1e6)]=this[_0x1c5a75(0x1e6)]);const _0x4f6310=await fetch(_0x34747e,_0x27377a);clearTimeout(_0x5119aa);if(_0x731661<retries&&isRetryableStatus(_0x4f6310['status'])){if(_0x4f6310[_0x1c5a75(0x191)]===0x1ad){const _0x27edcc=await _0x4f6310['text']();if(isNonRetryable429(_0x27edcc)){const _0xd64c6a=this['extractErrorMessage'](_0x27edcc)||_0x4f6310[_0x1c5a75(0x1aa)];throw new HTTPClientError(_0xd64c6a,_0x4f6310['status']);}}const _0x2de372=_0x4f6310['headers'][_0x1c5a75(0x1ae)](_0x1c5a75(0x199)),_0x500532=_0x2de372?parseInt(_0x2de372,0xa)*0x3e8:getRetryDelay(_0x731661,this[_0x1c5a75(0x1c8)]);console[_0x1c5a75(0x1a8)](_0x1c5a75(0x1df)+(_0x731661+0x1)+'/'+retries+']\x20Request\x20failed\x20with\x20'+_0x4f6310[_0x1c5a75(0x191)]+',\x20'+(_0x1c5a75(0x18f)+Math['round'](_0x500532)+'ms...')),await this[_0x1c5a75(0x1c6)](_0x500532);continue;}!_0x4f6310['ok']&&await this['handleErrorResponse'](_0x4f6310);let _0x33ece1;if(responseType==='arraybuffer'){const _0x2cd6d9=await _0x4f6310['arrayBuffer']();_0x33ece1=Buffer[_0x1c5a75(0x1af)](_0x2cd6d9);}else responseType==='text'?_0x33ece1=await _0x4f6310[_0x1c5a75(0x1c0)]():_0x33ece1=await this[_0x1c5a75(0x1ed)](_0x4f6310);this[_0x1c5a75(0x1b3)][_0x1c5a75(0x194)](_0x1c5a75(0x1ce)+_0x4f6310['status']+_0x1c5a75(0x1a6)+_0x454d06+'\x20'+_0x361e70),this['logger'][_0x1c5a75(0x1e9)](JSON[_0x1c5a75(0x18b)](_0x33ece1,null,0x2));if(includeHeaders){const _0x4a27e4={};return _0x4f6310['headers'][_0x1c5a75(0x1e0)]((_0x5a89,_0x1f14a5)=>{_0x4a27e4[_0x1f14a5]=_0x5a89;}),{'data':_0x33ece1,'status':_0x4f6310[_0x1c5a75(0x191)],'headers':_0x4a27e4};}return _0x33ece1;}catch(_0x328e78){_0x4073b9=_0x328e78 instanceof Error?_0x328e78:new Error(String(_0x328e78));if(_0x328e78 instanceof HTTPClientError){if(!isRetryableStatus(_0x328e78[_0x1c5a75(0x191)])||_0x328e78[_0x1c5a75(0x191)]===0x1ad&&isNonRetryable429(_0x328e78[_0x1c5a75(0x1ad)]))throw _0x328e78;}if(_0x731661>=retries){if(!(_0x4073b9 instanceof HTTPClientError)){const _0x4d5186=extractRootCause(_0x4073b9);if(this[_0x1c5a75(0x1d2)]&&this[_0x1c5a75(0x1a3)](_0x4073b9))throw new SDKError(ErrorCode[_0x1c5a75(0x1a1)],_0x1c5a75(0x1e3)+this[_0x1c5a75(0x1b8)](this[_0x1c5a75(0x1d2)])+':\x20'+_0x4d5186,_0x4073b9);throw new SDKError(ErrorCode[_0x1c5a75(0x1dd)],_0x1c5a75(0x1e8)+_0x34747e+_0x1c5a75(0x1d8)+_0x4d5186,_0x4073b9);}throw _0x4073b9;}const _0x5c6fdb=getRetryDelay(_0x731661,this[_0x1c5a75(0x1c8)]);let _0x561d26;_0x4073b9 instanceof HTTPClientError?_0x561d26=_0x1c5a75(0x1df)+(_0x731661+0x1)+'/'+retries+_0x1c5a75(0x19a)+_0x4073b9[_0x1c5a75(0x191)]+':\x20'+_0x4073b9['message']+',\x20'+(_0x1c5a75(0x18f)+Math[_0x1c5a75(0x1da)](_0x5c6fdb)+_0x1c5a75(0x1e2)):_0x561d26=_0x1c5a75(0x1df)+(_0x731661+0x1)+'/'+retries+_0x1c5a75(0x1d3)+_0x34747e+_0x1c5a75(0x1d8)+_0x4073b9[_0x1c5a75(0x1ad)]+',\x20'+('retrying\x20in\x20'+Math[_0x1c5a75(0x1da)](_0x5c6fdb)+'ms...'),console['warn'](_0x561d26),await this['sleep'](_0x5c6fdb);}}throw _0x4073b9||new SDKError(ErrorCode[_0x1c5a75(0x18e)],'Request\x20failed\x20after\x20retries');}async[a92_0x57f17e(0x1ed)](_0xf18c91){const _0x19a250=a92_0x57f17e,_0x23af79=await _0xf18c91[_0x19a250(0x1c0)]();if(!_0x23af79)return null;try{const _0x31d826=a92_0x42acb6({'storeAsString':!![]});return _0x31d826[_0x19a250(0x1cf)](_0x23af79);}catch{return{'body':_0x23af79};}}[a92_0x57f17e(0x1b4)](_0xc13a13,_0x1876be){const _0x76cf1e=a92_0x57f17e;if(!_0xc13a13||typeof _0xc13a13!==_0x76cf1e(0x1b9))return undefined;let _0x919525=_0xc13a13;_0x919525['errors']&&typeof _0x919525[_0x76cf1e(0x192)]===_0x76cf1e(0x1b9)&&(_0x919525=_0x919525[_0x76cf1e(0x192)]);if(_0x919525[_0x76cf1e(0x193)]||_0x919525['title']||_0x919525['detail'])return{'type':_0x919525[_0x76cf1e(0x193)]||'about:blank','title':_0x919525['title']||'Error','status':_0x919525[_0x76cf1e(0x191)]||_0x1876be,'detail':_0x919525[_0x76cf1e(0x1a2)]||'An\x20error\x20occurred','instance':_0x919525[_0x76cf1e(0x1be)]||'',..._0x919525};const _0x12170b=_0x919525[_0x76cf1e(0x1ad)]||_0x919525[_0x76cf1e(0x1ac)]||_0x919525[_0x76cf1e(0x1c0)];if(typeof _0x12170b===_0x76cf1e(0x19c))return{'type':'about:blank','title':_0x919525[_0x76cf1e(0x1dc)]||_0x76cf1e(0x1f1),'status':_0x919525[_0x76cf1e(0x1d0)]||_0x1876be,'detail':_0x12170b,'instance':'',..._0x919525};return undefined;}async['handleErrorResponse'](_0x1ac545){const _0x40e1cb=a92_0x57f17e,_0x17527d=await this[_0x40e1cb(0x1ed)](_0x1ac545),_0x5da9b5=this[_0x40e1cb(0x1b4)](_0x17527d,_0x1ac545[_0x40e1cb(0x191)]);_0x17527d&&this['logger'][_0x40e1cb(0x194)](_0x40e1cb(0x1d6)+JSON[_0x40e1cb(0x18b)](_0x17527d));let _0x16b94d;if(_0x5da9b5?.['detail'])_0x16b94d=_0x5da9b5[_0x40e1cb(0x1a2)];else _0x17527d?_0x16b94d='HTTP\x20'+_0x1ac545[_0x40e1cb(0x191)]+':\x20'+_0x1ac545['statusText']+_0x40e1cb(0x1f3)+JSON['stringify'](_0x17527d):_0x16b94d=_0x40e1cb(0x19d)+_0x1ac545['status']+':\x20'+_0x1ac545[_0x40e1cb(0x1aa)];throw new HTTPClientError(_0x16b94d,_0x1ac545[_0x40e1cb(0x191)],_0x5da9b5);}[a92_0x57f17e(0x1c6)](_0x290bd5){return new Promise(_0x1933fe=>setTimeout(_0x1933fe,_0x290bd5));}[a92_0x57f17e(0x18c)](_0x4e842e){const _0x420804=a92_0x57f17e;try{const _0x5766da=JSON[_0x420804(0x1cf)](_0x4e842e);return _0x5766da['detail']||_0x5766da[_0x420804(0x1ad)]||_0x5766da[_0x420804(0x1ac)]||null;}catch{return _0x4e842e['length']<0x1f4?_0x4e842e:null;}}async['requestSSE'](_0x862264,_0x50b6b6,_0x256726={}){const _0x52a6ba=a92_0x57f17e,{headers:headers={},body:_0x2b2bff,timeout:timeout=0x7530,signal:_0x2b3ab5}=_0x256726,_0x1ad4eb=''+this['baseUrl']+_0x50b6b6,_0x4eb19e={...this['defaultHeaders'],...headers},_0x2bd52c=new AbortController(),_0x53e354=setTimeout(()=>_0x2bd52c[_0x52a6ba(0x1bf)](),timeout),_0x2a7eea=_0x2b3ab5?[_0x2bd52c[_0x52a6ba(0x1b0)],_0x2b3ab5]:[_0x2bd52c[_0x52a6ba(0x1b0)]],_0x9a276b=this[_0x52a6ba(0x1f5)](_0x2a7eea);try{this['proxyReady']&&await this[_0x52a6ba(0x1bc)];const _0x4ceceb={'method':_0x862264,'headers':_0x4eb19e,'signal':_0x9a276b};this[_0x52a6ba(0x1e6)]&&(_0x4ceceb[_0x52a6ba(0x1e6)]=this[_0x52a6ba(0x1e6)]);if(_0x2b2bff){if(typeof _0x2b2bff===_0x52a6ba(0x19c))_0x4ceceb[_0x52a6ba(0x1cb)]=_0x2b2bff;else _0x2b2bff instanceof Buffer?_0x4ceceb[_0x52a6ba(0x1cb)]=_0x2b2bff:_0x4ceceb[_0x52a6ba(0x1cb)]=JSON[_0x52a6ba(0x18b)](_0x2b2bff);}const _0xd1102c=await fetch(_0x1ad4eb,_0x4ceceb);return clearTimeout(_0x53e354),!_0xd1102c['ok']&&await this[_0x52a6ba(0x1ec)](_0xd1102c),_0xd1102c;}catch(_0x358b0f){clearTimeout(_0x53e354);if(_0x358b0f instanceof HTTPClientError)throw _0x358b0f;if(_0x358b0f[_0x52a6ba(0x18d)]===_0x52a6ba(0x1e7))throw new Error(_0x52a6ba(0x1c9));if(this[_0x52a6ba(0x1d2)]&&_0x358b0f instanceof Error&&this[_0x52a6ba(0x1a3)](_0x358b0f))throw new SDKError(ErrorCode[_0x52a6ba(0x1a1)],_0x52a6ba(0x1e3)+this[_0x52a6ba(0x1b8)](this[_0x52a6ba(0x1d2)])+':\x20'+_0x358b0f[_0x52a6ba(0x1ad)],_0x358b0f);throw _0x358b0f;}}[a92_0x57f17e(0x1f5)](_0x26a2cf){const _0xeea4ff=a92_0x57f17e,_0x1421dd=new AbortController();for(const _0x321cdf of _0x26a2cf){if(_0x321cdf[_0xeea4ff(0x1d4)])return _0x1421dd['abort'](),_0x1421dd[_0xeea4ff(0x1b0)];_0x321cdf[_0xeea4ff(0x1d1)]('abort',()=>_0x1421dd[_0xeea4ff(0x1bf)](),{'once':!![]});}return _0x1421dd[_0xeea4ff(0x1b0)];}}
@@ -1 +1 @@
1
- function a93_0x6184(){const _0x333cde=['textKnowledgeBases','/api/agents?page[limit]=50','outputs','/api/projects/','gpt-4o','projectId','listChats','/api/integrations','/api/chats?','/api/tool_targets?filter[targetType]=ExperimentalKnowledgeBase&filter[project_id]=','/api/experimental_artifacts?filter[projectId]=','/api/chats/','baseUrl','listImageGenerators','imageGenerators','deleteProject','/api/integrations/','&page[limit]=1','/api/experimental_artifacts','\x20attempts:\x20API\x20returned\x20empty\x20chat\x20ID',',\x20message\x20length:\x20','prompt','maxToolIterations','San\x20Francisco','paginateAll','/api/prompts','push','updatePrompt','listWebSearchTools','data','California','-last_conversation_at','Failed\x20to\x20continue\x20chat\x20(chatId:\x20','getProject','updateIntegration','Continuing\x20chat\x20','pathname','ms...','application/vnd.api+json','/api/projects?page[limit]=','/api/users/current_settings','requestSSE','/api/text_knowledge_bases','259230dGhfah','agents','PATCH','deleteIntegration','userLocation','/api/tool_targets?filter[targetType]=TextKnowledgeBase&filter[project_id]=','4582830etgqNO','apiKey','DELETE','getTextKnowledgeBase','createAgent','text/event-stream','temperature','1694728QKpbCY','site','name','search','experimentalArtifacts','3414258nAKWsf','httpClient','listAgentsFull','Please\x20provide\x20a\x20non-empty\x20message\x20to\x20continue\x20the\x20chat.','append','createExperimentalKnowledgeBase','12323lRupzA','toString','/history','warn','listProjects','authHeaders','/api/tool_targets?filter[targetType]=ParentSegmentKnowledgeBase&filter[project_id]=','/api/tool_targets?filter[targetType]=ImageGenerator&filter[project_id]=','LLM_STREAM_ERROR','prompts','listToolTargets','&filter[project_id]=','getChatLog','integrations','/api/tool_targets?filter[targetType]=WebSearchTool&filter[project_id]=','\x20characters','medium','updateExperimentalKnowledgeBase','updateKnowledgeBase','You\x20are\x20a\x20helpful\x20search\x20assistant.',']\x20Streaming\x20SSE\x20stream\x20for\x20chatId:\x20','LLM_EMPTY_MESSAGE','length','debug','parentSegmentKnowledgeBases','chats','page[limit]','25iMTgnB','startsWith','reasoningEffort','listKnowledgeBases','listExperimentalKnowledgeBases','/api/knowledge_bases','systemPrompt','application/json','map','/api/experimental_knowledge_bases','listTextKnowledgeBases','POST','getChatInfo','/api/integrations?filter[projectId]=','2432944UPxTZz','updateExperimentalArtifact','/langfuse','/api/agents/','createPrompt','accessToken','continueChat','createImageGenerator','createExperimentalArtifact','America/Los_Angeles','proxy','imageModelType','starterMessage','http','llm','Message\x20cannot\x20be\x20empty\x20or\x20whitespace\x20only','createWebSearchTool','Failed\x20to\x20create\x20chat\x20after\x20','LLM_CHAT_CREATION_FAILURE','/api/experimental_knowledge_bases/','listAgents','projects','/api/text_knowledge_bases/','\x20with\x20message\x20size:\x20','10vpcBkg','getChatHistory','GET','/api/knowledge_bases/','startChat','828796QfmEVo','getAgent','logger','getUserSettings','description','webSearchTools','/api/image_generators','&page[limit]=50','/api/tool_targets?filter[targetType]=','links','createKnowledgeBase','createAgentResponse','3KxiKhy','deleteAgent','experimentalKnowledgeBases','updateTextKnowledgeBase','request','createTextKnowledgeBase','updateAgentResponse','/api/agents','/api/projects'];a93_0x6184=function(){return _0x333cde;};return a93_0x6184();}const a93_0xa791d7=a93_0x1d92;(function(_0x16881e,_0x40e35f){const _0x243f7a=a93_0x1d92,_0x579b30=_0x16881e();while(!![]){try{const _0x45dd82=-parseInt(_0x243f7a(0x118))/0x1*(parseInt(_0x243f7a(0x159))/0x2)+parseInt(_0x243f7a(0x16a))/0x3*(parseInt(_0x243f7a(0x15e))/0x4)+parseInt(_0x243f7a(0x133))/0x5*(-parseInt(_0x243f7a(0x100))/0x6)+-parseInt(_0x243f7a(0x10d))/0x7+-parseInt(_0x243f7a(0x141))/0x8+parseInt(_0x243f7a(0x112))/0x9+parseInt(_0x243f7a(0x106))/0xa;if(_0x45dd82===_0x40e35f)break;else _0x579b30['push'](_0x579b30['shift']());}catch(_0x3583d8){_0x579b30['push'](_0x579b30['shift']());}}}(a93_0x6184,0x35f36));function a93_0x1d92(_0x205afe,_0x25132c){_0x205afe=_0x205afe-0xf5;const _0x61844b=a93_0x6184();let _0x1d9208=_0x61844b[_0x205afe];return _0x1d9208;}import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';import{parseSSEStream}from'../../utils/sse-parser.js';import{ErrorCode,SDKError}from'../errors.js';import{Logger}from'../../utils/logger/index.js';export class LLMApiClient{['httpClient'];[a93_0xa791d7(0x17f)];[a93_0xa791d7(0x11d)];['logger']=Logger['of']('tdx.client.llm');constructor(_0x1b6706){const _0x315e82=a93_0xa791d7;this[_0x315e82(0x17f)]=getEndpoint(_0x1b6706[_0x315e82(0x10e)],_0x315e82(0x14f)),this[_0x315e82(0x11d)]=toHeaderRecord(getAuthHeaders(_0x1b6706[_0x315e82(0x10e)],_0x1b6706[_0x315e82(0x107)],_0x1b6706[_0x315e82(0x146)])),this['httpClient']=new HTTPClient(this[_0x315e82(0x17f)],this[_0x315e82(0x11d)],{'proxy':_0x1b6706[_0x315e82(0x14b)]});}async['paginateAll'](_0x14d8e6){const _0x43f456=a93_0xa791d7,_0x3a867b=[];let _0x28dc4e=_0x14d8e6;while(_0x28dc4e){const _0x34bc3b=await this['httpClient']['request']('GET',_0x28dc4e);_0x34bc3b[_0x43f456(0x190)]&&_0x3a867b[_0x43f456(0x18d)](..._0x34bc3b[_0x43f456(0x190)]);_0x28dc4e=_0x34bc3b[_0x43f456(0x167)]?.['next'];if(_0x28dc4e&&_0x28dc4e[_0x43f456(0x134)](_0x43f456(0x14e))){const _0x1662c0=new URL(_0x28dc4e);_0x28dc4e=_0x1662c0[_0x43f456(0xf9)]+_0x1662c0[_0x43f456(0x110)];}}return _0x3a867b;}async[a93_0xa791d7(0x161)](){const _0xea69af=a93_0xa791d7;return await this['httpClient'][_0xea69af(0x16e)]('GET',_0xea69af(0xfd));}async['createProject'](_0x2b4f18){const _0x118336=a93_0xa791d7,_0x2b6661={'data':{'type':_0x118336(0x156),'attributes':{'name':_0x2b4f18[_0x118336(0x10f)],..._0x2b4f18[_0x118336(0x162)]&&{'description':_0x2b4f18[_0x118336(0x162)]}}}},_0x2d3567=await this['httpClient'][_0x118336(0x16e)](_0x118336(0x13e),_0x118336(0x172),{'headers':{'Content-Type':_0x118336(0xfb),'Accept':_0x118336(0xfb)},'body':_0x2b6661});return _0x2d3567[_0x118336(0x190)];}async[a93_0xa791d7(0x182)](_0x243053){const _0xdf67cb=a93_0xa791d7,_0x55b8c5=_0xdf67cb(0x176)+encodeURIComponent(_0x243053);await this['httpClient'][_0xdf67cb(0x16e)](_0xdf67cb(0x108),_0x55b8c5);}async[a93_0xa791d7(0x11c)](_0x4c77b9=0x32){const _0x2e78a5=a93_0xa791d7;return this['paginateAll'](_0x2e78a5(0xfc)+_0x4c77b9);}async[a93_0xa791d7(0x155)](_0x3a9644){const _0x154871=a93_0xa791d7;let _0x3775f5=_0x154871(0x174);return _0x3a9644&&(_0x3775f5+='&filter[project_id]='+encodeURIComponent(_0x3a9644)),this[_0x154871(0x18b)](_0x3775f5);}async[a93_0xa791d7(0x15f)](_0x1e7bcb){const _0x1e9b41=a93_0xa791d7,_0x49e32d=_0x1e9b41(0x144)+encodeURIComponent(_0x1e7bcb),_0xe047d3=await this['httpClient']['request'](_0x1e9b41(0x15b),_0x49e32d);return _0xe047d3[_0x1e9b41(0x190)];}async[a93_0xa791d7(0x10a)](_0x349444){const _0x3b1767=a93_0xa791d7,_0x2bdb25={'name':_0x349444[_0x3b1767(0x10f)],'projectId':_0x349444[_0x3b1767(0x178)],'modelType':_0x349444['modelType'],'maxToolIterations':_0x349444[_0x3b1767(0x189)]??0x4,'temperature':_0x349444[_0x3b1767(0x10c)]??0.7};_0x349444[_0x3b1767(0x139)]!==undefined&&(_0x2bdb25[_0x3b1767(0x139)]=_0x349444[_0x3b1767(0x139)]);_0x349444[_0x3b1767(0x14d)]&&(_0x2bdb25['starterMessage']=_0x349444['starterMessage']);_0x349444[_0x3b1767(0x135)]&&(_0x2bdb25['reasoningEffort']=_0x349444['reasoningEffort']);_0x349444['outputs']&&_0x349444[_0x3b1767(0x175)][_0x3b1767(0x12e)]>0x0&&(_0x2bdb25[_0x3b1767(0x175)]=_0x349444[_0x3b1767(0x175)]);const _0x136ece={'data':{'type':_0x3b1767(0x101),'attributes':_0x2bdb25}},_0x2351bb=await this[_0x3b1767(0x113)][_0x3b1767(0x16e)]('POST',_0x3b1767(0x171),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x3b1767(0xfb)},'body':_0x136ece});return _0x2351bb[_0x3b1767(0x190)];}async['updateAgent'](_0x1079a0,_0x2d9937){const _0x14ff23=a93_0xa791d7,_0x1f8656={'data':{'type':_0x14ff23(0x101),'id':_0x1079a0,'attributes':{..._0x2d9937[_0x14ff23(0x10f)]&&{'name':_0x2d9937['name']},..._0x2d9937['description']&&{'description':_0x2d9937[_0x14ff23(0x162)]},..._0x2d9937['prompt']&&{'prompt':_0x2d9937[_0x14ff23(0x188)]},..._0x2d9937[_0x14ff23(0x14d)]&&{'starter_message':_0x2d9937[_0x14ff23(0x14d)]},..._0x2d9937[_0x14ff23(0x135)]&&{'reasoningEffort':_0x2d9937[_0x14ff23(0x135)]}}}},_0x43f226=_0x14ff23(0x144)+encodeURIComponent(_0x1079a0),_0x37073e=await this[_0x14ff23(0x113)][_0x14ff23(0x16e)](_0x14ff23(0x102),_0x43f226,{'headers':{'Content-Type':_0x14ff23(0xfb)},'body':_0x1f8656});return _0x37073e[_0x14ff23(0x190)];}async[a93_0xa791d7(0x16b)](_0x50d859){const _0x1c6dfc=a93_0xa791d7,_0x159f43=_0x1c6dfc(0x144)+encodeURIComponent(_0x50d859);await this['httpClient'][_0x1c6dfc(0x16e)]('DELETE',_0x159f43);}async[a93_0xa791d7(0x179)](_0x5dbf72=0x32){const _0x5421c0=a93_0xa791d7,_0x1d708c=new URLSearchParams();_0x1d708c['append'](_0x5421c0(0x132),String(_0x5dbf72)),_0x1d708c[_0x5421c0(0x116)]('sort',_0x5421c0(0x192));const _0x5efc9e=_0x5421c0(0x17b)+_0x1d708c[_0x5421c0(0x119)](),_0x5969ff=await this[_0x5421c0(0x113)][_0x5421c0(0x16e)](_0x5421c0(0x15b),_0x5efc9e);return _0x5969ff['data']||[];}async[a93_0xa791d7(0x13f)](_0xea196a){const _0x51686a=a93_0xa791d7,_0x2cdc6e=_0x51686a(0x17e)+encodeURIComponent(_0xea196a),_0x23ef25=await this['httpClient']['request'](_0x51686a(0x15b),_0x2cdc6e);return _0x23ef25[_0x51686a(0x190)];}async[a93_0xa791d7(0x15a)](_0x4dd3b5){const _0x5c69bf=a93_0xa791d7,_0x23af25='/api/chats/'+encodeURIComponent(_0x4dd3b5)+_0x5c69bf(0x11a);return await this[_0x5c69bf(0x113)]['request']('GET',_0x23af25);}async[a93_0xa791d7(0x124)](_0x2ea260){const _0x48a270=a93_0xa791d7,_0x5e4735=_0x48a270(0x17e)+encodeURIComponent(_0x2ea260)+_0x48a270(0x143);return await this[_0x48a270(0x113)][_0x48a270(0x16e)](_0x48a270(0x15b),_0x5e4735);}async[a93_0xa791d7(0x15d)](_0xce7954){const _0x2efbb0=a93_0xa791d7,_0x1b2051={'data':{'type':_0x2efbb0(0x131),'attributes':{'agentId':_0xce7954['agentId']}}},_0x2092e3=0x3,_0x525fd9=[0x3e8,0x7d0,0xfa0];for(let _0x18149c=0x0;_0x18149c<=_0x2092e3;_0x18149c++){const _0x4d4539=await this[_0x2efbb0(0x113)][_0x2efbb0(0x16e)]('POST','/api/chats',{'headers':{'Content-Type':_0x2efbb0(0xfb),'Accept':_0x2efbb0(0xfb)},'body':_0x1b2051});if(_0x4d4539[_0x2efbb0(0x190)]&&_0x4d4539[_0x2efbb0(0x190)]['id'])return _0x4d4539[_0x2efbb0(0x190)];if(_0x18149c>=_0x2092e3)throw new SDKError(ErrorCode[_0x2efbb0(0x153)],_0x2efbb0(0x152)+(_0x2092e3+0x1)+_0x2efbb0(0x186));const _0x54c746=_0x525fd9[_0x18149c];console[_0x2efbb0(0x11b)]('[Retry\x20'+(_0x18149c+0x1)+'/'+_0x2092e3+']\x20Chat\x20creation\x20returned\x20empty\x20ID,\x20retrying\x20in\x20'+_0x54c746+_0x2efbb0(0xfa)),await new Promise(_0x12c3f=>setTimeout(_0x12c3f,_0x54c746));}throw new SDKError(ErrorCode[_0x2efbb0(0x153)],'Failed\x20to\x20create\x20chat:\x20unexpected\x20error');}async*[a93_0xa791d7(0x147)](_0x457fa5,_0x1a2b6d,_0x54a64e){const _0x1aee33=a93_0xa791d7,_0x3301ff=_0x1a2b6d['trim']();if(!_0x3301ff)throw new SDKError(ErrorCode[_0x1aee33(0x12d)],_0x1aee33(0x150),undefined,{'helpText':_0x1aee33(0x115)});this[_0x1aee33(0x160)][_0x1aee33(0x12f)](_0x1aee33(0xf8)+_0x457fa5+_0x1aee33(0x158)+_0x1a2b6d[_0x1aee33(0x12e)]+_0x1aee33(0x127));const _0x139e6b=_0x1aee33(0x17e)+encodeURIComponent(_0x457fa5)+'/continue',_0xdce746={'input':_0x1a2b6d};try{const _0x2c41ec=await this[_0x1aee33(0x113)][_0x1aee33(0xfe)](_0x1aee33(0x13e),_0x139e6b,{'headers':{'Content-Type':_0x1aee33(0x13a),'Accept':_0x1aee33(0x10b)},'body':_0xdce746,'signal':_0x54a64e});this['logger'][_0x1aee33(0x12f)]('['+_0x2c41ec['status']+_0x1aee33(0x12c)+_0x457fa5),yield*parseSSEStream(_0x2c41ec,this[_0x1aee33(0x160)]);}catch(_0x3daf53){throw new SDKError(ErrorCode[_0x1aee33(0x120)],_0x1aee33(0xf5)+_0x457fa5+_0x1aee33(0x187)+_0x1a2b6d[_0x1aee33(0x12e)]+')',_0x3daf53);}}async[a93_0xa791d7(0xf6)](_0x5b183e){const _0x39bc45=a93_0xa791d7,_0x343d69=_0x39bc45(0x176)+encodeURIComponent(_0x5b183e),_0x34f9c3=await this[_0x39bc45(0x113)]['request']('GET',_0x343d69);return _0x34f9c3[_0x39bc45(0x190)];}async[a93_0xa791d7(0x136)](_0x1d15c7){const _0x3f8c3d=a93_0xa791d7;return this[_0x3f8c3d(0x18b)]('/api/knowledge_bases?filter[projectId]='+encodeURIComponent(_0x1d15c7)+_0x3f8c3d(0x165));}async[a93_0xa791d7(0x168)](_0x1fb7a3){const _0x5f333a=a93_0xa791d7,_0x257d14={'data':{'type':'knowledge_bases','attributes':_0x1fb7a3}},_0x1bbeab=await this[_0x5f333a(0x113)]['request'](_0x5f333a(0x13e),_0x5f333a(0x138),{'headers':{'Content-Type':_0x5f333a(0xfb),'Accept':'application/vnd.api+json'},'body':_0x257d14});return _0x1bbeab[_0x5f333a(0x190)];}async[a93_0xa791d7(0x122)](_0x2b160d,_0x38dd26){const _0x5e2ad7=a93_0xa791d7;return this[_0x5e2ad7(0x18b)](_0x5e2ad7(0x166)+encodeURIComponent(_0x2b160d)+_0x5e2ad7(0x123)+encodeURIComponent(_0x38dd26)+_0x5e2ad7(0x165));}async[a93_0xa791d7(0x13d)](_0x25ae16){const _0x3d1e69=a93_0xa791d7,_0x39a7f9=await this[_0x3d1e69(0x18b)](_0x3d1e69(0x105)+encodeURIComponent(_0x25ae16)+_0x3d1e69(0x165));return _0x39a7f9[_0x3d1e69(0x13b)](_0x1385c2=>({..._0x1385c2,'type':'textKnowledgeBases'}));}async[a93_0xa791d7(0x109)](_0x498521){const _0x49c243=a93_0xa791d7,_0x114152=await this[_0x49c243(0x113)][_0x49c243(0x16e)](_0x49c243(0x15b),'/api/text_knowledge_bases/'+encodeURIComponent(_0x498521),{'headers':{'Accept':'application/vnd.api+json'}});return _0x114152[_0x49c243(0x190)];}async[a93_0xa791d7(0x16f)](_0x46d4a1){const _0x46a767=a93_0xa791d7,_0x5eca5d={'data':{'type':_0x46a767(0x173),'attributes':_0x46d4a1}},_0x19648a=await this[_0x46a767(0x113)][_0x46a767(0x16e)](_0x46a767(0x13e),_0x46a767(0xff),{'headers':{'Content-Type':_0x46a767(0xfb),'Accept':_0x46a767(0xfb)},'body':_0x5eca5d});return _0x19648a[_0x46a767(0x190)];}async[a93_0xa791d7(0x16d)](_0x467403,_0x4ead84){const _0x59d755=a93_0xa791d7,_0x3968fd={'data':{'type':_0x59d755(0x173),'id':_0x467403,'attributes':_0x4ead84}},_0x18f020=await this[_0x59d755(0x113)][_0x59d755(0x16e)](_0x59d755(0x102),_0x59d755(0x157)+encodeURIComponent(_0x467403),{'headers':{'Content-Type':_0x59d755(0xfb),'Accept':_0x59d755(0xfb)},'body':_0x3968fd});return _0x18f020['data'];}async[a93_0xa791d7(0x148)](_0x1127aa){const _0x509798=a93_0xa791d7,_0x4ebf7e={'data':{'type':_0x509798(0x181),'attributes':{..._0x1127aa,'imageModelType':_0x1127aa[_0x509798(0x14c)]||'nova-canvas','imageReturnMode':_0x1127aa['imageReturnMode']||'ID'}}},_0x1f60a1=await this[_0x509798(0x113)][_0x509798(0x16e)](_0x509798(0x13e),_0x509798(0x164),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x509798(0xfb)},'body':_0x4ebf7e});return _0x1f60a1[_0x509798(0x190)];}async[a93_0xa791d7(0x151)](_0x32dafe){const _0x4a3093=a93_0xa791d7,_0x19a634={'data':{'type':'webSearchTools','attributes':{'projectId':_0x32dafe[_0x4a3093(0x178)],'name':_0x32dafe[_0x4a3093(0x10f)],'modelType':_0x32dafe['modelType']||_0x4a3093(0x177),'searchContextSize':_0x32dafe['searchContextSize']||_0x4a3093(0x128),'userLocation':_0x32dafe[_0x4a3093(0x104)]||{'type':'approximate','country':'US','city':_0x4a3093(0x18a),'region':_0x4a3093(0x191),'timezone':_0x4a3093(0x14a)},'systemPrompt':_0x32dafe[_0x4a3093(0x139)]||_0x4a3093(0x12b),'filters':_0x32dafe['filters']||{'allowed_domains':[]}}}},_0x1b8ce4=await this[_0x4a3093(0x113)][_0x4a3093(0x16e)](_0x4a3093(0x13e),'/api/web_search_tools',{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x19a634});return _0x1b8ce4['data'];}async[a93_0xa791d7(0x180)](_0x5c43f0){const _0x10f094=a93_0xa791d7,_0x978fa4=await this[_0x10f094(0x18b)](_0x10f094(0x11f)+encodeURIComponent(_0x5c43f0)+_0x10f094(0x165));return _0x978fa4[_0x10f094(0x13b)](_0x3584db=>({..._0x3584db,'type':'imageGenerators'}));}async[a93_0xa791d7(0x18f)](_0x56e5ac){const _0xdedcb1=a93_0xa791d7,_0x1ed633=await this[_0xdedcb1(0x18b)](_0xdedcb1(0x126)+encodeURIComponent(_0x56e5ac)+_0xdedcb1(0x165));return _0x1ed633[_0xdedcb1(0x13b)](_0x2ac5e8=>({..._0x2ac5e8,'type':_0xdedcb1(0x163)}));}async['getParentSegmentKnowledgeBase'](_0x15dfb4){const _0x1f286a=a93_0xa791d7,_0x27dddc=await this[_0x1f286a(0x18b)](_0x1f286a(0x11e)+encodeURIComponent(_0x15dfb4)+_0x1f286a(0x184));if(_0x27dddc[_0x1f286a(0x12e)]===0x0)return undefined;return{..._0x27dddc[0x0],'type':_0x1f286a(0x130)};}async['listPrompts'](_0x29b23f){const _0x506ecd=a93_0xa791d7;return this[_0x506ecd(0x18b)]('/api/prompts?filter[projectId]='+encodeURIComponent(_0x29b23f)+_0x506ecd(0x165));}async[a93_0xa791d7(0x145)](_0x408871){const _0x2d451e=a93_0xa791d7,{jsonSchemaHint:_0x82b616,..._0x5c7537}=_0x408871,_0x5516ff={'data':{'type':_0x2d451e(0x121),'attributes':_0x5c7537}},_0x9ed7eb=await this[_0x2d451e(0x113)][_0x2d451e(0x16e)](_0x2d451e(0x13e),_0x2d451e(0x18c),{'headers':{'Content-Type':_0x2d451e(0xfb),'Accept':'application/vnd.api+json'},'body':_0x5516ff});return _0x9ed7eb[_0x2d451e(0x190)];}async['listIntegrations'](_0x5c4313){const _0x1200bb=a93_0xa791d7;return this[_0x1200bb(0x18b)](_0x1200bb(0x140)+encodeURIComponent(_0x5c4313)+'&page[limit]=50');}async['createIntegration'](_0x4078b4){const _0x404c24=a93_0xa791d7,_0x855055={'data':{'type':_0x404c24(0x125),'attributes':_0x4078b4}},_0x1dd373=await this[_0x404c24(0x113)][_0x404c24(0x16e)](_0x404c24(0x13e),_0x404c24(0x17a),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x404c24(0xfb)},'body':_0x855055});return _0x1dd373[_0x404c24(0x190)];}async[a93_0xa791d7(0x137)](_0xb900b6){const _0x152273=a93_0xa791d7,_0x25485d=await this[_0x152273(0x18b)](_0x152273(0x17c)+encodeURIComponent(_0xb900b6)+_0x152273(0x165));return _0x25485d['map'](_0x3b683f=>({..._0x3b683f,'type':'experimentalKnowledgeBases'}));}async['getExperimentalKnowledgeBase'](_0x36d101){const _0x2b4a60=a93_0xa791d7,_0x169d4d=await this[_0x2b4a60(0x113)][_0x2b4a60(0x16e)](_0x2b4a60(0x15b),_0x2b4a60(0x154)+encodeURIComponent(_0x36d101),{'headers':{'Accept':_0x2b4a60(0xfb)}});return _0x169d4d[_0x2b4a60(0x190)];}async[a93_0xa791d7(0x117)](_0x3fe487){const _0x43dc9b=a93_0xa791d7,_0x9f5d5={'data':{'type':'experimentalKnowledgeBases','attributes':_0x3fe487}},_0x416c61=await this['httpClient'][_0x43dc9b(0x16e)]('POST',_0x43dc9b(0x13c),{'headers':{'Content-Type':_0x43dc9b(0xfb),'Accept':_0x43dc9b(0xfb)},'body':_0x9f5d5});return _0x416c61[_0x43dc9b(0x190)];}async[a93_0xa791d7(0x129)](_0x56ebf7,_0x1433cf){const _0x514894=a93_0xa791d7,_0x4f44c9={'data':{'type':_0x514894(0x16c),'id':_0x56ebf7,'attributes':_0x1433cf}},_0x23dafe=await this[_0x514894(0x113)][_0x514894(0x16e)](_0x514894(0x102),_0x514894(0x154)+encodeURIComponent(_0x56ebf7),{'headers':{'Content-Type':_0x514894(0xfb),'Accept':_0x514894(0xfb)},'body':_0x4f44c9});return _0x23dafe['data'];}async['listExperimentalArtifacts'](_0x5e8e85){const _0x340281=a93_0xa791d7;return this['paginateAll'](_0x340281(0x17d)+encodeURIComponent(_0x5e8e85)+_0x340281(0x165));}async['getExperimentalArtifact'](_0x58235c){const _0x48ac36=a93_0xa791d7,_0x45b31f=await this[_0x48ac36(0x113)][_0x48ac36(0x16e)](_0x48ac36(0x15b),'/api/experimental_artifacts/'+encodeURIComponent(_0x58235c),{'headers':{'Accept':_0x48ac36(0xfb)}});return _0x45b31f[_0x48ac36(0x190)];}async[a93_0xa791d7(0x149)](_0xfc47c){const _0xc186b6=a93_0xa791d7,_0x2c2eea={'data':{'type':_0xc186b6(0x111),'attributes':_0xfc47c}},_0x45a1b0=await this['httpClient'][_0xc186b6(0x16e)](_0xc186b6(0x13e),_0xc186b6(0x185),{'headers':{'Content-Type':_0xc186b6(0xfb),'Accept':_0xc186b6(0xfb)},'body':_0x2c2eea});return _0x45a1b0[_0xc186b6(0x190)];}async[a93_0xa791d7(0x142)](_0x5d25fa,_0x31b12c){const _0x191ac1=a93_0xa791d7,_0x176671={'data':{'type':'experimentalArtifacts','id':_0x5d25fa,'attributes':_0x31b12c}},_0xd291a9=await this[_0x191ac1(0x113)][_0x191ac1(0x16e)](_0x191ac1(0x102),'/api/experimental_artifacts/'+encodeURIComponent(_0x5d25fa),{'headers':{'Content-Type':_0x191ac1(0xfb),'Accept':_0x191ac1(0xfb)},'body':_0x176671});return _0xd291a9[_0x191ac1(0x190)];}async[a93_0xa791d7(0x114)](_0x24bf51){const _0x5b0f57=a93_0xa791d7,_0x500c0a=await this['listAgents'](_0x24bf51),_0x103f69=[];for(const _0x5a6c8c of _0x500c0a){const _0x3323a4=_0x5b0f57(0x144)+encodeURIComponent(_0x5a6c8c['id']),_0x1d6486=await this[_0x5b0f57(0x113)]['request'](_0x5b0f57(0x15b),_0x3323a4);_0x103f69[_0x5b0f57(0x18d)](_0x1d6486[_0x5b0f57(0x190)]);}return _0x103f69;}async[a93_0xa791d7(0x169)](_0x202762){const _0x16a145=a93_0xa791d7,_0x2c4b4c={'data':{'type':'agents','attributes':_0x202762}},_0x20773c=await this[_0x16a145(0x113)][_0x16a145(0x16e)](_0x16a145(0x13e),_0x16a145(0x171),{'headers':{'Content-Type':_0x16a145(0xfb),'Accept':_0x16a145(0xfb)},'body':_0x2c4b4c});return _0x20773c[_0x16a145(0x190)];}async[a93_0xa791d7(0x170)](_0xc40346,_0x3a352c){const _0x1e0381=a93_0xa791d7,_0x2b6c35={'data':{'type':_0x1e0381(0x101),'id':_0xc40346,'attributes':_0x3a352c}},_0x144562=_0x1e0381(0x144)+encodeURIComponent(_0xc40346),_0x5de4d8=await this[_0x1e0381(0x113)]['request'](_0x1e0381(0x102),_0x144562,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x1e0381(0xfb)},'body':_0x2b6c35});return _0x5de4d8[_0x1e0381(0x190)];}async[a93_0xa791d7(0x12a)](_0x57c837,_0x132c77){const _0x15b48c=a93_0xa791d7,_0x5a2ad3={'data':{'type':'knowledge_bases','id':_0x57c837,'attributes':_0x132c77}},_0x3d80d1=_0x15b48c(0x15c)+encodeURIComponent(_0x57c837),_0x2071b3=await this[_0x15b48c(0x113)][_0x15b48c(0x16e)](_0x15b48c(0x102),_0x3d80d1,{'headers':{'Content-Type':_0x15b48c(0xfb),'Accept':_0x15b48c(0xfb)},'body':_0x5a2ad3});return _0x2071b3[_0x15b48c(0x190)];}async[a93_0xa791d7(0x18e)](_0x2f966b,_0x2d8e51){const _0x3d7952=a93_0xa791d7,{jsonSchemaHint:_0x4bf8f3,..._0x582eab}=_0x2d8e51,_0x2f314e={'data':{'type':_0x3d7952(0x121),'id':_0x2f966b,'attributes':_0x582eab}},_0x27da2b='/api/prompts/'+encodeURIComponent(_0x2f966b),_0x1e132e=await this[_0x3d7952(0x113)][_0x3d7952(0x16e)](_0x3d7952(0x102),_0x27da2b,{'headers':{'Content-Type':_0x3d7952(0xfb),'Accept':_0x3d7952(0xfb)},'body':_0x2f314e});return _0x1e132e[_0x3d7952(0x190)];}async[a93_0xa791d7(0xf7)](_0x2ca406,_0x217022){const _0x13f692=a93_0xa791d7,_0x553f3b={'data':{'type':_0x13f692(0x125),'id':_0x2ca406,'attributes':_0x217022}},_0x3955f4=_0x13f692(0x183)+encodeURIComponent(_0x2ca406),_0x42a279=await this['httpClient'][_0x13f692(0x16e)](_0x13f692(0x102),_0x3955f4,{'headers':{'Content-Type':_0x13f692(0xfb),'Accept':'application/vnd.api+json'},'body':_0x553f3b});return _0x42a279['data'];}async[a93_0xa791d7(0x103)](_0x199388){const _0x3c58a3=a93_0xa791d7,_0x498083=_0x3c58a3(0x183)+encodeURIComponent(_0x199388);await this['httpClient']['request']('DELETE',_0x498083);}}
1
+ const a93_0x24aafd=a93_0x2627;(function(_0x37ed8a,_0x5c862b){const _0x2fe1ce=a93_0x2627,_0x6d35d9=_0x37ed8a();while(!![]){try{const _0x15a7d7=parseInt(_0x2fe1ce(0x1e2))/0x1+parseInt(_0x2fe1ce(0x1d2))/0x2+parseInt(_0x2fe1ce(0x1e6))/0x3*(parseInt(_0x2fe1ce(0x1ee))/0x4)+parseInt(_0x2fe1ce(0x1f6))/0x5*(parseInt(_0x2fe1ce(0x1b2))/0x6)+-parseInt(_0x2fe1ce(0x203))/0x7*(-parseInt(_0x2fe1ce(0x1fc))/0x8)+parseInt(_0x2fe1ce(0x1a4))/0x9+-parseInt(_0x2fe1ce(0x1a7))/0xa;if(_0x15a7d7===_0x5c862b)break;else _0x6d35d9['push'](_0x6d35d9['shift']());}catch(_0x373afe){_0x6d35d9['push'](_0x6d35d9['shift']());}}}(a93_0x40c9,0xa4fa0));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';import{parseSSEStream}from'../../utils/sse-parser.js';function a93_0x40c9(){const _0x57dc04=['imageGenerators','outputs','deleteAgent','listPrompts','7wnTLfl','application/vnd.api+json','site','prompt','/api/integrations?filter[projectId]=','listIntegrations','experimentalArtifacts','\x20characters','/api/agents/','debug','application/json','/api/knowledge_bases','page[limit]','createTextKnowledgeBase','knowledge_bases','&page[limit]=1','updateIntegration','updateKnowledgeBase','length','/api/knowledge_bases?filter[projectId]=','textKnowledgeBases','You\x20are\x20a\x20helpful\x20search\x20assistant.','listAgentsFull','createImageGenerator','updateAgent','&page[limit]=50',']\x20Chat\x20creation\x20returned\x20empty\x20ID,\x20retrying\x20in\x20','request','starterMessage','logger','name','getParentSegmentKnowledgeBase','createKnowledgeBase','getAgent','updatePrompt','startChat','getChatLog','listImageGenerators','/api/text_knowledge_bases/','updateExperimentalArtifact','listProjects','createIntegration','POST','toString','continueChat','/api/chats?',',\x20message\x20length:\x20','startsWith','/api/image_generators','map','8129898IJexMA','ms...','/api/agents','28073630NRZkXJ','maxToolIterations','data','getChatInfo','listKnowledgeBases','/api/tool_targets?filter[targetType]=WebSearchTool&filter[project_id]=','GET','description','createAgentResponse','authHeaders','/api/integrations','1502790CJYNIU','gpt-4o','systemPrompt','listToolTargets','listTextKnowledgeBases','getTextKnowledgeBase','/api/agents?page[limit]=50','DELETE','links','/api/tool_targets?filter[targetType]=TextKnowledgeBase&filter[project_id]=','modelType','projects','baseUrl','LLM_EMPTY_MESSAGE','Failed\x20to\x20continue\x20chat\x20(chatId:\x20','userLocation','PATCH','/api/projects/','/api/knowledge_bases/','httpClient','paginateAll','/api/prompts?filter[projectId]=','getExperimentalKnowledgeBase','pathname','imageModelType','text/event-stream','approximate','agents','/api/prompts/','updateExperimentalKnowledgeBase','searchContextSize','\x20with\x20message\x20size:\x20','1357390hvUeui','createExperimentalKnowledgeBase','search','listAgents','Failed\x20to\x20create\x20chat:\x20unexpected\x20error','webSearchTools','createAgent','append','createExperimentalArtifact','experimentalKnowledgeBases','/api/experimental_artifacts/','LLM_CHAT_CREATION_FAILURE','reasoningEffort','&filter[project_id]=','deleteIntegration','LLM_STREAM_ERROR','1013085WxHLEl','\x20attempts:\x20API\x20returned\x20empty\x20chat\x20ID','/api/experimental_knowledge_bases','/api/chats/','1470006HdmxBU','temperature','/api/experimental_knowledge_bases/','getExperimentalArtifact','/api/chats','imageReturnMode','/api/text_knowledge_bases','listWebSearchTools','4uorPXD','getProject','status','llm','California','/api/prompts','push','/langfuse','5AHxnir','listChats','projectId','Message\x20cannot\x20be\x20empty\x20or\x20whitespace\x20only','nova-canvas','createProject','1180304QdxeWT','listExperimentalKnowledgeBases','apiKey'];a93_0x40c9=function(){return _0x57dc04;};return a93_0x40c9();}import{ErrorCode,SDKError}from'../errors.js';import{Logger}from'../../utils/logger/index.js';function a93_0x2627(_0x464ae1,_0xe68d67){_0x464ae1=_0x464ae1-0x193;const _0x40c930=a93_0x40c9();let _0x26272b=_0x40c930[_0x464ae1];return _0x26272b;}export class LLMApiClient{[a93_0x24aafd(0x1c5)];['baseUrl'];['authHeaders'];[a93_0x24aafd(0x220)]=Logger['of']('tdx.client.llm');constructor(_0xe39a60){const _0x15abd2=a93_0x24aafd;this['baseUrl']=getEndpoint(_0xe39a60[_0x15abd2(0x205)],_0x15abd2(0x1f1)),this['authHeaders']=toHeaderRecord(getAuthHeaders(_0xe39a60[_0x15abd2(0x205)],_0xe39a60[_0x15abd2(0x1fe)],_0xe39a60['accessToken'])),this[_0x15abd2(0x1c5)]=new HTTPClient(this[_0x15abd2(0x1be)],this[_0x15abd2(0x1b0)],{'proxy':_0xe39a60['proxy']});}async[a93_0x24aafd(0x1c6)](_0x132af4){const _0x23890c=a93_0x24aafd,_0x2dd7e2=[];let _0x614c68=_0x132af4;while(_0x614c68){const _0x32f8d9=await this[_0x23890c(0x1c5)][_0x23890c(0x21e)](_0x23890c(0x1ad),_0x614c68);_0x32f8d9['data']&&_0x2dd7e2['push'](..._0x32f8d9[_0x23890c(0x1a9)]);_0x614c68=_0x32f8d9[_0x23890c(0x1ba)]?.['next'];if(_0x614c68&&_0x614c68[_0x23890c(0x1a1)]('http')){const _0x5e8e46=new URL(_0x614c68);_0x614c68=_0x5e8e46[_0x23890c(0x1c9)]+_0x5e8e46[_0x23890c(0x1d4)];}}return _0x2dd7e2;}async['getUserSettings'](){const _0x2533cd=a93_0x24aafd;return await this[_0x2533cd(0x1c5)][_0x2533cd(0x21e)](_0x2533cd(0x1ad),'/api/users/current_settings');}async[a93_0x24aafd(0x1fb)](_0x36016d){const _0x508546=a93_0x24aafd,_0x3a23f5={'data':{'type':_0x508546(0x1bd),'attributes':{'name':_0x36016d[_0x508546(0x221)],..._0x36016d[_0x508546(0x1ae)]&&{'description':_0x36016d[_0x508546(0x1ae)]}}}},_0x571f79=await this['httpClient']['request'](_0x508546(0x19c),'/api/projects',{'headers':{'Content-Type':_0x508546(0x204),'Accept':'application/vnd.api+json'},'body':_0x3a23f5});return _0x571f79['data'];}async['deleteProject'](_0x4d97ee){const _0x2a6e89=a93_0x24aafd,_0x22f707=_0x2a6e89(0x1c3)+encodeURIComponent(_0x4d97ee);await this[_0x2a6e89(0x1c5)][_0x2a6e89(0x21e)](_0x2a6e89(0x1b9),_0x22f707);}async[a93_0x24aafd(0x19a)](_0x46604d=0x32){const _0x29adbf=a93_0x24aafd;return this[_0x29adbf(0x1c6)]('/api/projects?page[limit]='+_0x46604d);}async['listAgents'](_0x52bb89){const _0x1641ef=a93_0x24aafd;let _0x4814c5=_0x1641ef(0x1b8);return _0x52bb89&&(_0x4814c5+=_0x1641ef(0x1df)+encodeURIComponent(_0x52bb89)),this[_0x1641ef(0x1c6)](_0x4814c5);}async[a93_0x24aafd(0x193)](_0x449adb){const _0x588d52=a93_0x24aafd,_0x1b3d6c=_0x588d52(0x20b)+encodeURIComponent(_0x449adb),_0x1ba2aa=await this['httpClient']['request'](_0x588d52(0x1ad),_0x1b3d6c);return _0x1ba2aa[_0x588d52(0x1a9)];}async[a93_0x24aafd(0x1d8)](_0x39ba6e){const _0x2d8cbc=a93_0x24aafd,_0x40f7a7={'name':_0x39ba6e['name'],'projectId':_0x39ba6e[_0x2d8cbc(0x1f8)],'modelType':_0x39ba6e['modelType'],'maxToolIterations':_0x39ba6e[_0x2d8cbc(0x1a8)]??0x4,'temperature':_0x39ba6e[_0x2d8cbc(0x1e7)]??0.7};_0x39ba6e['systemPrompt']!==undefined&&(_0x40f7a7[_0x2d8cbc(0x1b4)]=_0x39ba6e['systemPrompt']);_0x39ba6e[_0x2d8cbc(0x21f)]&&(_0x40f7a7[_0x2d8cbc(0x21f)]=_0x39ba6e[_0x2d8cbc(0x21f)]);_0x39ba6e['reasoningEffort']&&(_0x40f7a7[_0x2d8cbc(0x1de)]=_0x39ba6e[_0x2d8cbc(0x1de)]);_0x39ba6e[_0x2d8cbc(0x200)]&&_0x39ba6e['outputs']['length']>0x0&&(_0x40f7a7[_0x2d8cbc(0x200)]=_0x39ba6e[_0x2d8cbc(0x200)]);const _0x1e0126={'data':{'type':'agents','attributes':_0x40f7a7}},_0x44446f=await this[_0x2d8cbc(0x1c5)]['request']('POST',_0x2d8cbc(0x1a6),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x1e0126});return _0x44446f[_0x2d8cbc(0x1a9)];}async[a93_0x24aafd(0x21b)](_0xb5d5cf,_0x5b73ac){const _0x2fc4c4=a93_0x24aafd,_0x5a1733={'data':{'type':'agents','id':_0xb5d5cf,'attributes':{..._0x5b73ac[_0x2fc4c4(0x221)]&&{'name':_0x5b73ac[_0x2fc4c4(0x221)]},..._0x5b73ac[_0x2fc4c4(0x1ae)]&&{'description':_0x5b73ac[_0x2fc4c4(0x1ae)]},..._0x5b73ac[_0x2fc4c4(0x206)]&&{'prompt':_0x5b73ac[_0x2fc4c4(0x206)]},..._0x5b73ac[_0x2fc4c4(0x21f)]&&{'starter_message':_0x5b73ac[_0x2fc4c4(0x21f)]},..._0x5b73ac[_0x2fc4c4(0x1de)]&&{'reasoningEffort':_0x5b73ac[_0x2fc4c4(0x1de)]}}}},_0x3e3ec8=_0x2fc4c4(0x20b)+encodeURIComponent(_0xb5d5cf),_0x335f66=await this['httpClient'][_0x2fc4c4(0x21e)](_0x2fc4c4(0x1c2),_0x3e3ec8,{'headers':{'Content-Type':_0x2fc4c4(0x204)},'body':_0x5a1733});return _0x335f66['data'];}async[a93_0x24aafd(0x201)](_0x59a4f9){const _0x3adaf1=a93_0x24aafd,_0x2dcc4c=_0x3adaf1(0x20b)+encodeURIComponent(_0x59a4f9);await this[_0x3adaf1(0x1c5)][_0x3adaf1(0x21e)](_0x3adaf1(0x1b9),_0x2dcc4c);}async[a93_0x24aafd(0x1f7)](_0x111d5d=0x32){const _0x464017=a93_0x24aafd,_0x5bccab=new URLSearchParams();_0x5bccab[_0x464017(0x1d9)](_0x464017(0x20f),String(_0x111d5d)),_0x5bccab['append']('sort','-last_conversation_at');const _0x335531=_0x464017(0x19f)+_0x5bccab[_0x464017(0x19d)](),_0x4d74b8=await this['httpClient'][_0x464017(0x21e)]('GET',_0x335531);return _0x4d74b8[_0x464017(0x1a9)]||[];}async[a93_0x24aafd(0x1aa)](_0x4781a6){const _0x2e22f5=a93_0x24aafd,_0x415a21='/api/chats/'+encodeURIComponent(_0x4781a6),_0x5b4ef6=await this[_0x2e22f5(0x1c5)][_0x2e22f5(0x21e)](_0x2e22f5(0x1ad),_0x415a21);return _0x5b4ef6['data'];}async['getChatHistory'](_0x2657f2){const _0x1aca25=a93_0x24aafd,_0x273c16='/api/chats/'+encodeURIComponent(_0x2657f2)+'/history';return await this[_0x1aca25(0x1c5)][_0x1aca25(0x21e)]('GET',_0x273c16);}async[a93_0x24aafd(0x196)](_0x494e4f){const _0x1b65df=a93_0x24aafd,_0x96d580='/api/chats/'+encodeURIComponent(_0x494e4f)+_0x1b65df(0x1f5);return await this['httpClient']['request'](_0x1b65df(0x1ad),_0x96d580);}async[a93_0x24aafd(0x195)](_0x40676d){const _0x1807ad=a93_0x24aafd,_0xca04a4={'data':{'type':'chats','attributes':{'agentId':_0x40676d['agentId']}}},_0x3d47fb=0x3,_0x3319af=[0x3e8,0x7d0,0xfa0];for(let _0x99d65f=0x0;_0x99d65f<=_0x3d47fb;_0x99d65f++){const _0x3db6e7=await this[_0x1807ad(0x1c5)]['request'](_0x1807ad(0x19c),_0x1807ad(0x1ea),{'headers':{'Content-Type':_0x1807ad(0x204),'Accept':'application/vnd.api+json'},'body':_0xca04a4});if(_0x3db6e7[_0x1807ad(0x1a9)]&&_0x3db6e7[_0x1807ad(0x1a9)]['id'])return _0x3db6e7[_0x1807ad(0x1a9)];if(_0x99d65f>=_0x3d47fb)throw new SDKError(ErrorCode[_0x1807ad(0x1dd)],'Failed\x20to\x20create\x20chat\x20after\x20'+(_0x3d47fb+0x1)+_0x1807ad(0x1e3));const _0xea90ec=_0x3319af[_0x99d65f];console['warn']('[Retry\x20'+(_0x99d65f+0x1)+'/'+_0x3d47fb+_0x1807ad(0x21d)+_0xea90ec+_0x1807ad(0x1a5)),await new Promise(_0x3278fb=>setTimeout(_0x3278fb,_0xea90ec));}throw new SDKError(ErrorCode[_0x1807ad(0x1dd)],_0x1807ad(0x1d6));}async*[a93_0x24aafd(0x19e)](_0x424e8a,_0x460d04,_0x1e9627){const _0x2cc19c=a93_0x24aafd,_0x6ca6d6=_0x460d04['trim']();if(!_0x6ca6d6)throw new SDKError(ErrorCode[_0x2cc19c(0x1bf)],_0x2cc19c(0x1f9),undefined,{'helpText':'Please\x20provide\x20a\x20non-empty\x20message\x20to\x20continue\x20the\x20chat.'});this[_0x2cc19c(0x220)][_0x2cc19c(0x20c)]('Continuing\x20chat\x20'+_0x424e8a+_0x2cc19c(0x1d1)+_0x460d04[_0x2cc19c(0x215)]+_0x2cc19c(0x20a));const _0x234073=_0x2cc19c(0x1e5)+encodeURIComponent(_0x424e8a)+'/continue',_0x575e7b={'input':_0x460d04};try{const _0x524b41=await this[_0x2cc19c(0x1c5)]['requestSSE'](_0x2cc19c(0x19c),_0x234073,{'headers':{'Content-Type':_0x2cc19c(0x20d),'Accept':_0x2cc19c(0x1cb)},'body':_0x575e7b,'signal':_0x1e9627});this[_0x2cc19c(0x220)][_0x2cc19c(0x20c)]('['+_0x524b41[_0x2cc19c(0x1f0)]+']\x20Streaming\x20SSE\x20stream\x20for\x20chatId:\x20'+_0x424e8a),yield*parseSSEStream(_0x524b41,this[_0x2cc19c(0x220)]);}catch(_0x28319d){throw new SDKError(ErrorCode[_0x2cc19c(0x1e1)],_0x2cc19c(0x1c0)+_0x424e8a+_0x2cc19c(0x1a0)+_0x460d04[_0x2cc19c(0x215)]+')',_0x28319d);}}async[a93_0x24aafd(0x1ef)](_0x1bc532){const _0x3edc82=a93_0x24aafd,_0x594145=_0x3edc82(0x1c3)+encodeURIComponent(_0x1bc532),_0x310cbd=await this[_0x3edc82(0x1c5)][_0x3edc82(0x21e)]('GET',_0x594145);return _0x310cbd[_0x3edc82(0x1a9)];}async[a93_0x24aafd(0x1ab)](_0x9d45ce){const _0x14e501=a93_0x24aafd;return this['paginateAll'](_0x14e501(0x216)+encodeURIComponent(_0x9d45ce)+'&page[limit]=50');}async[a93_0x24aafd(0x223)](_0x36fecf){const _0x43dc5d=a93_0x24aafd,_0x2af8d7={'data':{'type':_0x43dc5d(0x211),'attributes':_0x36fecf}},_0x1f1f7a=await this[_0x43dc5d(0x1c5)][_0x43dc5d(0x21e)](_0x43dc5d(0x19c),_0x43dc5d(0x20e),{'headers':{'Content-Type':_0x43dc5d(0x204),'Accept':_0x43dc5d(0x204)},'body':_0x2af8d7});return _0x1f1f7a['data'];}async[a93_0x24aafd(0x1b5)](_0x316ab0,_0x2ef78b){const _0x335cd5=a93_0x24aafd;return this[_0x335cd5(0x1c6)]('/api/tool_targets?filter[targetType]='+encodeURIComponent(_0x316ab0)+_0x335cd5(0x1df)+encodeURIComponent(_0x2ef78b)+_0x335cd5(0x21c));}async[a93_0x24aafd(0x1b6)](_0x32a68d){const _0x33dd57=a93_0x24aafd,_0x56f100=await this[_0x33dd57(0x1c6)](_0x33dd57(0x1bb)+encodeURIComponent(_0x32a68d)+_0x33dd57(0x21c));return _0x56f100[_0x33dd57(0x1a3)](_0x4ee560=>({..._0x4ee560,'type':_0x33dd57(0x217)}));}async[a93_0x24aafd(0x1b7)](_0x56eee9){const _0x180ff0=a93_0x24aafd,_0x29d2a7=await this[_0x180ff0(0x1c5)]['request'](_0x180ff0(0x1ad),'/api/text_knowledge_bases/'+encodeURIComponent(_0x56eee9),{'headers':{'Accept':_0x180ff0(0x204)}});return _0x29d2a7[_0x180ff0(0x1a9)];}async[a93_0x24aafd(0x210)](_0xc0820b){const _0x48ae37=a93_0x24aafd,_0x2972a2={'data':{'type':'textKnowledgeBases','attributes':_0xc0820b}},_0x49901b=await this['httpClient'][_0x48ae37(0x21e)](_0x48ae37(0x19c),_0x48ae37(0x1ec),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x2972a2});return _0x49901b['data'];}async['updateTextKnowledgeBase'](_0x2bece0,_0xc8338e){const _0x2a0c3c=a93_0x24aafd,_0x46754f={'data':{'type':_0x2a0c3c(0x217),'id':_0x2bece0,'attributes':_0xc8338e}},_0x3884d0=await this['httpClient']['request'](_0x2a0c3c(0x1c2),_0x2a0c3c(0x198)+encodeURIComponent(_0x2bece0),{'headers':{'Content-Type':_0x2a0c3c(0x204),'Accept':'application/vnd.api+json'},'body':_0x46754f});return _0x3884d0[_0x2a0c3c(0x1a9)];}async[a93_0x24aafd(0x21a)](_0x369f36){const _0x95d72e=a93_0x24aafd,_0x2012a4={'data':{'type':_0x95d72e(0x1ff),'attributes':{..._0x369f36,'imageModelType':_0x369f36[_0x95d72e(0x1ca)]||_0x95d72e(0x1fa),'imageReturnMode':_0x369f36[_0x95d72e(0x1eb)]||'ID'}}},_0x37bc40=await this[_0x95d72e(0x1c5)][_0x95d72e(0x21e)]('POST',_0x95d72e(0x1a2),{'headers':{'Content-Type':_0x95d72e(0x204),'Accept':_0x95d72e(0x204)},'body':_0x2012a4});return _0x37bc40[_0x95d72e(0x1a9)];}async['createWebSearchTool'](_0x142e79){const _0x419f4f=a93_0x24aafd,_0x1f592c={'data':{'type':_0x419f4f(0x1d7),'attributes':{'projectId':_0x142e79[_0x419f4f(0x1f8)],'name':_0x142e79[_0x419f4f(0x221)],'modelType':_0x142e79[_0x419f4f(0x1bc)]||_0x419f4f(0x1b3),'searchContextSize':_0x142e79[_0x419f4f(0x1d0)]||'medium','userLocation':_0x142e79[_0x419f4f(0x1c1)]||{'type':_0x419f4f(0x1cc),'country':'US','city':'San\x20Francisco','region':_0x419f4f(0x1f2),'timezone':'America/Los_Angeles'},'systemPrompt':_0x142e79[_0x419f4f(0x1b4)]||_0x419f4f(0x218),'filters':_0x142e79['filters']||{'allowed_domains':[]}}}},_0x5c79e5=await this[_0x419f4f(0x1c5)][_0x419f4f(0x21e)](_0x419f4f(0x19c),'/api/web_search_tools',{'headers':{'Content-Type':_0x419f4f(0x204),'Accept':_0x419f4f(0x204)},'body':_0x1f592c});return _0x5c79e5['data'];}async[a93_0x24aafd(0x197)](_0x1ea2a4){const _0x83871b=a93_0x24aafd,_0x16907d=await this[_0x83871b(0x1c6)]('/api/tool_targets?filter[targetType]=ImageGenerator&filter[project_id]='+encodeURIComponent(_0x1ea2a4)+_0x83871b(0x21c));return _0x16907d[_0x83871b(0x1a3)](_0x26fea9=>({..._0x26fea9,'type':_0x83871b(0x1ff)}));}async[a93_0x24aafd(0x1ed)](_0x3dc199){const _0x331b22=a93_0x24aafd,_0x2a06f4=await this[_0x331b22(0x1c6)](_0x331b22(0x1ac)+encodeURIComponent(_0x3dc199)+_0x331b22(0x21c));return _0x2a06f4[_0x331b22(0x1a3)](_0x20010d=>({..._0x20010d,'type':_0x331b22(0x1d7)}));}async[a93_0x24aafd(0x222)](_0x17aa9f){const _0x1965d5=a93_0x24aafd,_0x354bde=await this['paginateAll']('/api/tool_targets?filter[targetType]=ParentSegmentKnowledgeBase&filter[project_id]='+encodeURIComponent(_0x17aa9f)+_0x1965d5(0x212));if(_0x354bde[_0x1965d5(0x215)]===0x0)return undefined;return{..._0x354bde[0x0],'type':'parentSegmentKnowledgeBases'};}async[a93_0x24aafd(0x202)](_0x9e23f8){const _0x2c3482=a93_0x24aafd;return this['paginateAll'](_0x2c3482(0x1c7)+encodeURIComponent(_0x9e23f8)+'&page[limit]=50');}async['createPrompt'](_0x1d86da){const _0x1636b7=a93_0x24aafd,{jsonSchemaHint:_0x46db27,..._0x4b4487}=_0x1d86da,_0x382fa4={'data':{'type':'prompts','attributes':_0x4b4487}},_0x9cfb49=await this[_0x1636b7(0x1c5)][_0x1636b7(0x21e)](_0x1636b7(0x19c),_0x1636b7(0x1f3),{'headers':{'Content-Type':_0x1636b7(0x204),'Accept':'application/vnd.api+json'},'body':_0x382fa4});return _0x9cfb49[_0x1636b7(0x1a9)];}async[a93_0x24aafd(0x208)](_0x49a12f){const _0x2b9922=a93_0x24aafd;return this[_0x2b9922(0x1c6)](_0x2b9922(0x207)+encodeURIComponent(_0x49a12f)+_0x2b9922(0x21c));}async[a93_0x24aafd(0x19b)](_0x8f6204){const _0x14a033=a93_0x24aafd,_0x59e947={'data':{'type':'integrations','attributes':_0x8f6204}},_0x3d0105=await this[_0x14a033(0x1c5)]['request'](_0x14a033(0x19c),_0x14a033(0x1b1),{'headers':{'Content-Type':_0x14a033(0x204),'Accept':'application/vnd.api+json'},'body':_0x59e947});return _0x3d0105[_0x14a033(0x1a9)];}async[a93_0x24aafd(0x1fd)](_0x751a4b){const _0x6880f2=a93_0x24aafd,_0x44d919=await this['paginateAll']('/api/tool_targets?filter[targetType]=ExperimentalKnowledgeBase&filter[project_id]='+encodeURIComponent(_0x751a4b)+'&page[limit]=50');return _0x44d919['map'](_0x2c7386=>({..._0x2c7386,'type':_0x6880f2(0x1db)}));}async[a93_0x24aafd(0x1c8)](_0x2415f0){const _0x546616=a93_0x24aafd,_0x5bc552=await this['httpClient']['request']('GET',_0x546616(0x1e8)+encodeURIComponent(_0x2415f0),{'headers':{'Accept':'application/vnd.api+json'}});return _0x5bc552['data'];}async[a93_0x24aafd(0x1d3)](_0x43ba0f){const _0x531ae0=a93_0x24aafd,_0x37842c={'data':{'type':_0x531ae0(0x1db),'attributes':_0x43ba0f}},_0x567925=await this[_0x531ae0(0x1c5)][_0x531ae0(0x21e)](_0x531ae0(0x19c),_0x531ae0(0x1e4),{'headers':{'Content-Type':_0x531ae0(0x204),'Accept':_0x531ae0(0x204)},'body':_0x37842c});return _0x567925[_0x531ae0(0x1a9)];}async[a93_0x24aafd(0x1cf)](_0x508eea,_0x4c60c1){const _0xd5811e=a93_0x24aafd,_0x446e48={'data':{'type':_0xd5811e(0x1db),'id':_0x508eea,'attributes':_0x4c60c1}},_0x2a8b5a=await this[_0xd5811e(0x1c5)][_0xd5811e(0x21e)](_0xd5811e(0x1c2),_0xd5811e(0x1e8)+encodeURIComponent(_0x508eea),{'headers':{'Content-Type':_0xd5811e(0x204),'Accept':_0xd5811e(0x204)},'body':_0x446e48});return _0x2a8b5a[_0xd5811e(0x1a9)];}async['listExperimentalArtifacts'](_0x4199db){const _0x16fe0b=a93_0x24aafd;return this['paginateAll']('/api/experimental_artifacts?filter[projectId]='+encodeURIComponent(_0x4199db)+_0x16fe0b(0x21c));}async[a93_0x24aafd(0x1e9)](_0x5c20f7){const _0xc582ad=a93_0x24aafd,_0x388122=await this[_0xc582ad(0x1c5)][_0xc582ad(0x21e)](_0xc582ad(0x1ad),'/api/experimental_artifacts/'+encodeURIComponent(_0x5c20f7),{'headers':{'Accept':_0xc582ad(0x204)}});return _0x388122[_0xc582ad(0x1a9)];}async[a93_0x24aafd(0x1da)](_0x299060){const _0x4a0127=a93_0x24aafd,_0x2326ab={'data':{'type':_0x4a0127(0x209),'attributes':_0x299060}},_0x4727ad=await this[_0x4a0127(0x1c5)][_0x4a0127(0x21e)](_0x4a0127(0x19c),'/api/experimental_artifacts',{'headers':{'Content-Type':_0x4a0127(0x204),'Accept':_0x4a0127(0x204)},'body':_0x2326ab});return _0x4727ad[_0x4a0127(0x1a9)];}async[a93_0x24aafd(0x199)](_0xc8c7b9,_0x1fbf3c){const _0x123743=a93_0x24aafd,_0x454e07={'data':{'type':'experimentalArtifacts','id':_0xc8c7b9,'attributes':_0x1fbf3c}},_0x1fa8ae=await this[_0x123743(0x1c5)][_0x123743(0x21e)](_0x123743(0x1c2),_0x123743(0x1dc)+encodeURIComponent(_0xc8c7b9),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x123743(0x204)},'body':_0x454e07});return _0x1fa8ae[_0x123743(0x1a9)];}async[a93_0x24aafd(0x219)](_0x2b574c){const _0x4dfd46=a93_0x24aafd,_0x3591f6=await this[_0x4dfd46(0x1d5)](_0x2b574c),_0x395419=[];for(const _0x36bfed of _0x3591f6){const _0x4fd5b1=_0x4dfd46(0x20b)+encodeURIComponent(_0x36bfed['id']),_0x489b3b=await this[_0x4dfd46(0x1c5)][_0x4dfd46(0x21e)](_0x4dfd46(0x1ad),_0x4fd5b1);_0x395419[_0x4dfd46(0x1f4)](_0x489b3b[_0x4dfd46(0x1a9)]);}return _0x395419;}async[a93_0x24aafd(0x1af)](_0x440c68){const _0x37b04b=a93_0x24aafd,_0x11f868={'data':{'type':_0x37b04b(0x1cd),'attributes':_0x440c68}},_0x3221cc=await this[_0x37b04b(0x1c5)][_0x37b04b(0x21e)](_0x37b04b(0x19c),_0x37b04b(0x1a6),{'headers':{'Content-Type':_0x37b04b(0x204),'Accept':_0x37b04b(0x204)},'body':_0x11f868});return _0x3221cc['data'];}async['updateAgentResponse'](_0x511cbc,_0x46ea26){const _0x1577b5=a93_0x24aafd,_0x369f16={'data':{'type':_0x1577b5(0x1cd),'id':_0x511cbc,'attributes':_0x46ea26}},_0x188bae=_0x1577b5(0x20b)+encodeURIComponent(_0x511cbc),_0x49ce6d=await this['httpClient'][_0x1577b5(0x21e)](_0x1577b5(0x1c2),_0x188bae,{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x369f16});return _0x49ce6d['data'];}async[a93_0x24aafd(0x214)](_0x4e18a0,_0x334582){const _0x16d3f9=a93_0x24aafd,_0x3e615a={'data':{'type':_0x16d3f9(0x211),'id':_0x4e18a0,'attributes':_0x334582}},_0x422c3e=_0x16d3f9(0x1c4)+encodeURIComponent(_0x4e18a0),_0x192394=await this[_0x16d3f9(0x1c5)][_0x16d3f9(0x21e)]('PATCH',_0x422c3e,{'headers':{'Content-Type':_0x16d3f9(0x204),'Accept':'application/vnd.api+json'},'body':_0x3e615a});return _0x192394[_0x16d3f9(0x1a9)];}async[a93_0x24aafd(0x194)](_0x2a10d3,_0x51a5e4){const _0x34b96d=a93_0x24aafd,{jsonSchemaHint:_0x20d05e,..._0x778e1c}=_0x51a5e4,_0x1a0445={'data':{'type':'prompts','id':_0x2a10d3,'attributes':_0x778e1c}},_0x4e71f3=_0x34b96d(0x1ce)+encodeURIComponent(_0x2a10d3),_0x59ae2f=await this[_0x34b96d(0x1c5)]['request'](_0x34b96d(0x1c2),_0x4e71f3,{'headers':{'Content-Type':_0x34b96d(0x204),'Accept':'application/vnd.api+json'},'body':_0x1a0445});return _0x59ae2f[_0x34b96d(0x1a9)];}async[a93_0x24aafd(0x213)](_0x4d44a0,_0x189558){const _0x878fb=a93_0x24aafd,_0x511bdf={'data':{'type':'integrations','id':_0x4d44a0,'attributes':_0x189558}},_0x3a7f2c='/api/integrations/'+encodeURIComponent(_0x4d44a0),_0x3971c8=await this['httpClient']['request'](_0x878fb(0x1c2),_0x3a7f2c,{'headers':{'Content-Type':_0x878fb(0x204),'Accept':_0x878fb(0x204)},'body':_0x511bdf});return _0x3971c8[_0x878fb(0x1a9)];}async[a93_0x24aafd(0x1e0)](_0x362c87){const _0x2390ab=a93_0x24aafd,_0x11e093='/api/integrations/'+encodeURIComponent(_0x362c87);await this[_0x2390ab(0x1c5)][_0x2390ab(0x21e)](_0x2390ab(0x1b9),_0x11e093);}}
@@ -1 +1 @@
1
- function a94_0x47be(){const _0x446f37=['10326519fpVogm','90ZKAwxH','484170ZAJEIl','2604368ZeNxEr','33yvQNkK','3287758LcNcKl','3538970eUZEJk','refresh_token','761828YiETIq','5eszHaE','/oauth/token','134071KoJOyW','1flqTnN'];a94_0x47be=function(){return _0x446f37;};return a94_0x47be();}(function(_0xcf5d96,_0x457b83){const _0x31c5d4=a94_0x52ba,_0x3431df=_0xcf5d96();while(!![]){try{const _0x2e0ec8=-parseInt(_0x31c5d4(0xa5))/0x1*(parseInt(_0x31c5d4(0x9e))/0x2)+-parseInt(_0x31c5d4(0xa8))/0x3+-parseInt(_0x31c5d4(0xa1))/0x4*(parseInt(_0x31c5d4(0xa2))/0x5)+-parseInt(_0x31c5d4(0xa7))/0x6*(-parseInt(_0x31c5d4(0xa4))/0x7)+parseInt(_0x31c5d4(0xa9))/0x8+parseInt(_0x31c5d4(0xa6))/0x9+parseInt(_0x31c5d4(0x9f))/0xa*(parseInt(_0x31c5d4(0x9d))/0xb);if(_0x2e0ec8===_0x457b83)break;else _0x3431df['push'](_0x3431df['shift']());}catch(_0x242760){_0x3431df['push'](_0x3431df['shift']());}}}(a94_0x47be,0xc9b55));function a94_0x52ba(_0x112745,_0xe835f5){_0x112745=_0x112745-0x9d;const _0x47befd=a94_0x47be();let _0x52ba5a=_0x47befd[_0x112745];return _0x52ba5a;}import{getOAuthClientId,postTokenRequest}from'../../core/oauth.js';export async function refreshAccessToken(_0x1a1b42,_0x4eeb7c){const _0x497ea8=a94_0x52ba,_0x1e782d=_0x1a1b42+_0x497ea8(0xa3);return postTokenRequest(_0x1e782d,{'grant_type':_0x497ea8(0xa0),'client_id':getOAuthClientId(),'refresh_token':_0x4eeb7c});}
1
+ (function(_0x15fbbe,_0x3ad7d3){const _0x1ae3f4=a94_0xa374,_0x34a2ca=_0x15fbbe();while(!![]){try{const _0x55da73=-parseInt(_0x1ae3f4(0xe2))/0x1+-parseInt(_0x1ae3f4(0xe5))/0x2+-parseInt(_0x1ae3f4(0xe9))/0x3+-parseInt(_0x1ae3f4(0xe7))/0x4+parseInt(_0x1ae3f4(0xe6))/0x5+-parseInt(_0x1ae3f4(0xea))/0x6+parseInt(_0x1ae3f4(0xe3))/0x7;if(_0x55da73===_0x3ad7d3)break;else _0x34a2ca['push'](_0x34a2ca['shift']());}catch(_0x4424f8){_0x34a2ca['push'](_0x34a2ca['shift']());}}}(a94_0x3e88,0x3d60d));import{getOAuthClientId,postTokenRequest}from'../../core/oauth.js';export async function refreshAccessToken(_0x4d88a6,_0x5fe37c){const _0x2921a5=a94_0xa374,_0x45ed42=_0x4d88a6+_0x2921a5(0xe4);return postTokenRequest(_0x45ed42,{'grant_type':_0x2921a5(0xe8),'client_id':getOAuthClientId(),'refresh_token':_0x5fe37c});}function a94_0xa374(_0x5a46fe,_0x235cc4){_0x5a46fe=_0x5a46fe-0xe2;const _0x3e8883=a94_0x3e88();let _0xa374fd=_0x3e8883[_0x5a46fe];return _0xa374fd;}function a94_0x3e88(){const _0x2cac59=['2300445Rqbhfr','762660hzAdqs','refresh_token','899307axVkEy','750144IvHYze','825BvwZSo','3667412NkpCpq','/oauth/token','232634wPAdUB'];a94_0x3e88=function(){return _0x2cac59;};return a94_0x3e88();}
@@ -1 +1 @@
1
- const a95_0x380ff3=a95_0x5c2b;(function(_0x53770f,_0xeda116){const _0x3474e3=a95_0x5c2b,_0x31a49c=_0x53770f();while(!![]){try{const _0x399b71=-parseInt(_0x3474e3(0xf6))/0x1*(parseInt(_0x3474e3(0xe2))/0x2)+parseInt(_0x3474e3(0xf7))/0x3+parseInt(_0x3474e3(0xec))/0x4+parseInt(_0x3474e3(0xe4))/0x5+parseInt(_0x3474e3(0xe8))/0x6+parseInt(_0x3474e3(0xe9))/0x7+-parseInt(_0x3474e3(0xf8))/0x8*(parseInt(_0x3474e3(0xe6))/0x9);if(_0x399b71===_0xeda116)break;else _0x31a49c['push'](_0x31a49c['shift']());}catch(_0x2edf80){_0x31a49c['push'](_0x31a49c['shift']());}}}(a95_0x3018,0xd540a));export class RateLimiter{[a95_0x380ff3(0xf3)];[a95_0x380ff3(0xee)];[a95_0x380ff3(0xeb)];[a95_0x380ff3(0xed)];constructor(_0x3da497){const _0x3c2d4e=a95_0x380ff3;this[_0x3c2d4e(0xeb)]=_0x3da497['maxRequests'],this['tokens']=_0x3da497[_0x3c2d4e(0xef)],this[_0x3c2d4e(0xee)]=Date[_0x3c2d4e(0xf0)](),this[_0x3c2d4e(0xed)]=_0x3da497[_0x3c2d4e(0xef)]/_0x3da497[_0x3c2d4e(0xe5)];}async['acquire'](){const _0xb8900a=a95_0x380ff3;while(!![]){this[_0xb8900a(0xe3)]();if(this['tokens']>=0x1){this[_0xb8900a(0xf3)]-=0x1;return;}const _0x2942c3=Math[_0xb8900a(0xf1)](0x1,Math[_0xb8900a(0xf2)](0x1/this['refillRate']));await this[_0xb8900a(0xf5)](_0x2942c3);}}[a95_0x380ff3(0xf4)](){const _0x565053=a95_0x380ff3;this[_0x565053(0xe3)]();if(this['tokens']>=0x1)return this[_0x565053(0xf3)]-=0x1,!![];return![];}['refill'](){const _0x336efb=a95_0x380ff3,_0x1e94dc=Date[_0x336efb(0xf0)](),_0x598a5b=_0x1e94dc-this[_0x336efb(0xee)];if(_0x598a5b>0x0){const _0x57a63f=_0x598a5b*this[_0x336efb(0xed)];this[_0x336efb(0xf3)]=Math['min'](this[_0x336efb(0xeb)],this['tokens']+_0x57a63f),this[_0x336efb(0xee)]=_0x1e94dc;}}[a95_0x380ff3(0xea)](){const _0x4ca153=a95_0x380ff3;return this['refill'](),Math['floor'](this[_0x4ca153(0xf3)]);}[a95_0x380ff3(0xe7)](){const _0x23cdf9=a95_0x380ff3;this[_0x23cdf9(0xf3)]=this[_0x23cdf9(0xeb)],this[_0x23cdf9(0xee)]=Date['now']();}[a95_0x380ff3(0xf5)](_0x338346){return new Promise(_0x3d8fc7=>setTimeout(_0x3d8fc7,_0x338346));}}function a95_0x5c2b(_0x5c7b5d,_0x167037){_0x5c7b5d=_0x5c7b5d-0xe2;const _0x3018d6=a95_0x3018();let _0x5c2b39=_0x3018d6[_0x5c7b5d];return _0x5c2b39;}export const defaultRateLimiter=new RateLimiter({'maxRequests':0x64,'windowMs':0xea60});function a95_0x3018(){const _0x5f45a2=['maxTokens','5231848BLaisP','refillRate','lastRefill','maxRequests','now','max','ceil','tokens','tryAcquire','sleep','1ffcEFk','1896474dPYHgI','14688VqMYjF','802732xgjtnP','refill','3812790cHlyty','windowMs','18774fqOSTI','reset','9538404BFdmcf','5686324XHfFCD','getAvailableTokens'];a95_0x3018=function(){return _0x5f45a2;};return a95_0x3018();}
1
+ const a95_0x234121=a95_0x5cf6;function a95_0x5cf6(_0x10eb8d,_0x2710e1){_0x10eb8d=_0x10eb8d-0xcd;const _0xfd53c4=a95_0xfd53();let _0x5cf6d5=_0xfd53c4[_0x10eb8d];return _0x5cf6d5;}(function(_0x4584bf,_0x42869d){const _0x562f22=a95_0x5cf6,_0x557172=_0x4584bf();while(!![]){try{const _0xf02049=parseInt(_0x562f22(0xd6))/0x1+-parseInt(_0x562f22(0xd4))/0x2*(parseInt(_0x562f22(0xe2))/0x3)+-parseInt(_0x562f22(0xd9))/0x4+-parseInt(_0x562f22(0xdf))/0x5+-parseInt(_0x562f22(0xda))/0x6*(-parseInt(_0x562f22(0xe5))/0x7)+parseInt(_0x562f22(0xe0))/0x8*(parseInt(_0x562f22(0xdd))/0x9)+-parseInt(_0x562f22(0xdb))/0xa*(parseInt(_0x562f22(0xd8))/0xb);if(_0xf02049===_0x42869d)break;else _0x557172['push'](_0x557172['shift']());}catch(_0x438513){_0x557172['push'](_0x557172['shift']());}}}(a95_0xfd53,0x4949a));function a95_0xfd53(){const _0xf87d0a=['42naPWgE','312880ityWeI','maxTokens','459kODqtu','windowMs','1471275GmNKiB','93592SkiZNG','max','11268MILPwN','tokens','getAvailableTokens','525553BCuhcY','now','acquire','refillRate','refill','tryAcquire','sleep','ceil','maxRequests','262fQHiCF','lastRefill','260450tjozwu','min','22MprmUH','934396XXuHuW'];a95_0xfd53=function(){return _0xf87d0a;};return a95_0xfd53();}export class RateLimiter{[a95_0x234121(0xe3)];[a95_0x234121(0xd5)];[a95_0x234121(0xdc)];[a95_0x234121(0xce)];constructor(_0x3ffa65){const _0x5f5511=a95_0x234121;this[_0x5f5511(0xdc)]=_0x3ffa65[_0x5f5511(0xd3)],this[_0x5f5511(0xe3)]=_0x3ffa65['maxRequests'],this[_0x5f5511(0xd5)]=Date[_0x5f5511(0xe6)](),this[_0x5f5511(0xce)]=_0x3ffa65[_0x5f5511(0xd3)]/_0x3ffa65[_0x5f5511(0xde)];}async[a95_0x234121(0xcd)](){const _0x3f2f94=a95_0x234121;while(!![]){this[_0x3f2f94(0xcf)]();if(this[_0x3f2f94(0xe3)]>=0x1){this['tokens']-=0x1;return;}const _0x2eab1e=Math[_0x3f2f94(0xe1)](0x1,Math[_0x3f2f94(0xd2)](0x1/this[_0x3f2f94(0xce)]));await this[_0x3f2f94(0xd1)](_0x2eab1e);}}[a95_0x234121(0xd0)](){const _0x12a93a=a95_0x234121;this[_0x12a93a(0xcf)]();if(this[_0x12a93a(0xe3)]>=0x1)return this[_0x12a93a(0xe3)]-=0x1,!![];return![];}[a95_0x234121(0xcf)](){const _0x15b7fb=a95_0x234121,_0x37730d=Date['now'](),_0x3e1fa3=_0x37730d-this['lastRefill'];if(_0x3e1fa3>0x0){const _0xd0d280=_0x3e1fa3*this[_0x15b7fb(0xce)];this[_0x15b7fb(0xe3)]=Math[_0x15b7fb(0xd7)](this[_0x15b7fb(0xdc)],this['tokens']+_0xd0d280),this[_0x15b7fb(0xd5)]=_0x37730d;}}[a95_0x234121(0xe4)](){const _0x4f243d=a95_0x234121;return this['refill'](),Math['floor'](this[_0x4f243d(0xe3)]);}['reset'](){const _0x26ef98=a95_0x234121;this[_0x26ef98(0xe3)]=this[_0x26ef98(0xdc)],this[_0x26ef98(0xd5)]=Date[_0x26ef98(0xe6)]();}[a95_0x234121(0xd1)](_0x30a1c5){return new Promise(_0x334fe9=>setTimeout(_0x334fe9,_0x30a1c5));}}export const defaultRateLimiter=new RateLimiter({'maxRequests':0x64,'windowMs':0xea60});