claude-code-best 2.4.4 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (614) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-Cj5bvJgD.js +1 -0
  2. package/dist/chunks/App-2tgSv9lb.js +1 -0
  3. package/dist/chunks/ApproveApiKey-DWa-XTLb.js +1 -0
  4. package/dist/chunks/ApproveApiKey-SIUwkD8j.js +1 -0
  5. package/dist/chunks/AssistantSessionChooser-DF9eeJZS.js +1 -0
  6. package/dist/chunks/BackgroundTasksDialog-DXJdube9.js +2 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-BOSW4Zdy.js +1 -0
  8. package/dist/chunks/ClaudeInChromeOnboarding-BW4XHmkw.js +1 -0
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-B8oAAHSI.js +1 -0
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-Bz0JyaOG.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-DYhmGSkx.js +1 -0
  12. package/dist/chunks/DesktopHandoff-CcsM_OAS.js +1 -0
  13. package/dist/chunks/DevChannelsDialog-DXRgY00D.js +1 -0
  14. package/dist/chunks/Dialog-DYFGqyDs.js +1 -0
  15. package/dist/chunks/DiffDialog-PvNZfZby.js +3 -0
  16. package/dist/chunks/Doctor--B1HUENo.js +1 -0
  17. package/dist/chunks/Doctor-CE_jL9jC.js +3 -0
  18. package/dist/chunks/ExitFlow-C4ybxKPn.js +2 -0
  19. package/dist/chunks/Feedback-B5rPGl_C.js +2 -0
  20. package/dist/chunks/Grove-C2YjB3zL.js +1 -0
  21. package/dist/chunks/Grove-CKVpREDU.js +11 -0
  22. package/dist/chunks/HybridTransport-Byjvz-DL.js +4 -0
  23. package/dist/chunks/ITermBackend-Co9XpeS4.js +1 -0
  24. package/dist/chunks/InProcessTransport-DB52dh4f.js +1 -0
  25. package/dist/chunks/InvalidConfigDialog-CNsqbNU3.js +1 -0
  26. package/dist/chunks/InvalidSettingsDialog-ClnZaN6b.js +1 -0
  27. package/dist/chunks/ListItem-OFARanN7.js +1 -0
  28. package/dist/chunks/MCPConnectionManager-CDsa79pu.js +1 -0
  29. package/dist/chunks/McpParsingWarnings-DZkzoeZf.js +1 -0
  30. package/dist/chunks/MessageSelector-CkeGQPNM.js +3 -0
  31. package/dist/chunks/Messages-PfbzLYOU.js +11 -0
  32. package/dist/chunks/Onboarding-BwoGQB4g.js +1 -0
  33. package/dist/chunks/OverageCreditUpsell-Q5g2YjQw.js +1 -0
  34. package/dist/chunks/PermissionDialog-5MlJf7ew.js +1 -0
  35. package/dist/chunks/PluginSettings-B2ASJ0Rx.js +17 -0
  36. package/dist/chunks/PressEnterToContinue-BdA9zDGs.js +1 -0
  37. package/dist/chunks/PromptInputFooterSuggestions-D4lMVCqj.js +1 -0
  38. package/dist/chunks/PromptInputHelpMenu-BvLtS6an.js +1 -0
  39. package/dist/chunks/QueryEngine-Av0G5fze.js +1 -0
  40. package/dist/chunks/REPL-DCwqua0C.js +1 -0
  41. package/dist/chunks/REPL-Dh8vzGmF.js +97 -0
  42. package/dist/chunks/RemoteCallout-BV_hoz98.js +1 -0
  43. package/dist/chunks/RemoteSessionManager-Cxoy1ud2.js +2 -0
  44. package/dist/chunks/ResumeConversation-B3WuB8rs.js +1 -0
  45. package/dist/chunks/SSETransport-pIm26VJq.js +4 -0
  46. package/dist/chunks/SearchBox-DfOmUoaI.js +1 -0
  47. package/dist/chunks/SearchExtraToolsTool-D70C-cmA.js +1 -0
  48. package/dist/chunks/SentryErrorBoundary-B6EWoJml.js +2 -0
  49. package/dist/chunks/SentryErrorBoundary-oJUBarGg.js +1 -0
  50. package/dist/chunks/Settings-CreAhCsb.js +2 -0
  51. package/dist/chunks/TeleportProgress-DPzGpyyM.js +1 -0
  52. package/dist/chunks/TeleportRepoMismatchDialog-DqWQX6j8.js +1 -0
  53. package/dist/chunks/TeleportResumeWrapper-DPSO0S49.js +1 -0
  54. package/dist/chunks/ThemePicker-DueihHcy.js +1 -0
  55. package/dist/chunks/TmuxBackend-BNaZNAeP.js +9 -0
  56. package/dist/chunks/TrustDialog-CIzAlGn9.js +1 -0
  57. package/dist/chunks/TungstenTool-C5IqKVr0.js +1 -0
  58. package/dist/chunks/TungstenTool-V-Bwqlx3.js +1 -0
  59. package/dist/chunks/ValidationErrorsList-1k1qbsRo.js +2 -0
  60. package/dist/chunks/WelcomeV2-CR6TtXXM.js +1 -0
  61. package/dist/chunks/WindowsTerminalBackend-C5SeTXqC.js +2 -0
  62. package/dist/chunks/add-dir-DAMizKzF.js +1 -0
  63. package/dist/chunks/agentDisplay-B9z7i8b_.js +1 -0
  64. package/dist/chunks/agents-D5u0p1UC.js +103 -0
  65. package/dist/chunks/agents-DCh_gEvJ.js +2 -0
  66. package/dist/chunks/ajv-B_OpU_Uh.js +8 -0
  67. package/dist/chunks/analytics-DqMQntaB.js +1 -0
  68. package/dist/chunks/ant-DRJq-cEg.js +1 -0
  69. package/dist/chunks/api-B6URs6nc.js +1 -0
  70. package/dist/chunks/api-Dz_3z1kl.js +1 -0
  71. package/dist/chunks/asciicast-aoKFhc7C.js +1 -0
  72. package/dist/chunks/asciicast-o5Zg4dJt.js +4 -0
  73. package/dist/chunks/assistant-BRGDWkKB.js +1 -0
  74. package/dist/chunks/assistant-tPxOUa-Z.js +1 -0
  75. package/dist/chunks/assistant-zVegFdAO.js +1 -0
  76. package/dist/chunks/attributionHooks-PygdohOh.js +1 -0
  77. package/dist/chunks/attributionTrailer-BpvhXgRP.js +1 -0
  78. package/dist/chunks/auth-CqURlg4d.js +1 -0
  79. package/dist/chunks/auth-D4isgfuK.js +1 -0
  80. package/dist/chunks/autoMode-DVt4K4I2.js +45 -0
  81. package/dist/chunks/autoModeDenials-Cp6VFdsm.js +1 -0
  82. package/dist/chunks/autonomy-BZzW8QJZ.js +1 -0
  83. package/dist/chunks/autonomy-Ffv0QIyl.js +19 -0
  84. package/dist/chunks/autonomyPanel-MwuzDvv_.js +1 -0
  85. package/dist/chunks/axios-DLnc2dVy.js +1 -0
  86. package/dist/chunks/axios-DhfaybwJ.js +12 -0
  87. package/dist/chunks/backgroundHousekeeping-CYnAG60-.js +17 -0
  88. package/dist/chunks/backgroundHousekeeping-DUmxC6h0.js +1 -0
  89. package/dist/chunks/banner-CVXH2xts.js +2 -0
  90. package/dist/chunks/base64-js-DIVSFswY.js +1 -0
  91. package/dist/chunks/bedrockClient-qi1-JCOK.js +15 -0
  92. package/dist/chunks/bg-DK0E4ZtW.js +9 -0
  93. package/dist/chunks/bg-Dbh5z3Y8.js +1 -0
  94. package/dist/chunks/branch-DXefFdDE.js +3 -0
  95. package/dist/chunks/break-cache-ByJ7U2Ts.js +8 -0
  96. package/dist/chunks/bridge-qr4GQW_c.js +2 -0
  97. package/dist/chunks/bridgeConfig-CJ-KznTS.js +1 -0
  98. package/dist/chunks/bridgeConfig-CNbOKpAg.js +1 -0
  99. package/dist/chunks/bridgeEnabled-5vsPrjuq.js +1 -0
  100. package/dist/chunks/bridgeEnabled-BUJTCUHY.js +1 -0
  101. package/dist/chunks/bridgeMain-BimZwc2P.js +68 -0
  102. package/dist/chunks/bridgeMain-DYL4fl6A.js +1 -0
  103. package/dist/chunks/bridgeMessaging-BiE0CTqq.js +1 -0
  104. package/dist/chunks/bridgePointer-FvAMj3re.js +1 -0
  105. package/dist/chunks/browser-fLRXxIsQ.js +1 -0
  106. package/dist/chunks/btw-FpimqEqk.js +1 -0
  107. package/dist/chunks/buddy-BA3Cr067.js +3 -0
  108. package/dist/chunks/bundledMode-kSQejuY4.js +1 -0
  109. package/dist/chunks/bypassPermissionsKillswitch-CSC9p8mO.js +1 -0
  110. package/dist/chunks/caches-BUBkfP2Q.js +3 -0
  111. package/dist/chunks/caches-CTfNpKhW.js +1 -0
  112. package/dist/chunks/capacityWake-BXlUpptF.js +1 -0
  113. package/dist/chunks/ccrClient-BOxUn9EJ.js +1 -0
  114. package/dist/chunks/ccshareResume-DWLjTF22.js +1 -0
  115. package/dist/chunks/changeDetector-Y9KV5LgG.js +1 -0
  116. package/dist/chunks/channelNotification-CC7Xb06W.js +1 -0
  117. package/dist/chunks/channelNotification-l3EXKDNB.js +1 -0
  118. package/dist/chunks/chokidar-BcI3rIKm.js +1 -0
  119. package/dist/chunks/chokidar-SzksMqYp.js +1 -0
  120. package/dist/chunks/chrome-BnKyWWQL.js +1 -0
  121. package/dist/chunks/chromeNativeHost-4U39yLtd.js +1 -0
  122. package/dist/chunks/chunk-DR8-3Aex.js +1 -0
  123. package/dist/chunks/classPrivateFieldSet2-EAQNhHs8.js +1 -0
  124. package/dist/chunks/claudeDesktop-D0S1eq1F.js +1 -0
  125. package/dist/chunks/cleanup-Bg_gFgcj.js +1 -0
  126. package/dist/chunks/clear-OUVFUt8Z.js +1 -0
  127. package/dist/chunks/cliLaunch-BQa48gsr.js +1 -0
  128. package/dist/chunks/client-B47ZvTMo.js +1 -0
  129. package/dist/chunks/client-CPn1wQyc.js +7 -0
  130. package/dist/chunks/client-_sjL0I7A.js +35 -0
  131. package/dist/chunks/color-D5MCzz9h.js +1 -0
  132. package/dist/chunks/color-convert-ULbeSgNC.js +1 -0
  133. package/dist/chunks/commands-FJGWgQsa.js +1 -0
  134. package/dist/chunks/commitAttribution-BFshsh2H.js +2 -0
  135. package/dist/chunks/commitAttribution-DSv9FggK.js +1 -0
  136. package/dist/chunks/common-B379wT22.js +1 -0
  137. package/dist/chunks/common-B_BC3eMY.js +1 -0
  138. package/dist/chunks/common-CMCv4N_v.js +1 -0
  139. package/dist/chunks/compact-DWNaf1wR.js +3 -0
  140. package/dist/chunks/companion-CyK_Dr1U.js +1 -0
  141. package/dist/chunks/completionCache-DHfUBBMH.js +1 -0
  142. package/dist/chunks/completionCache-DORrtxkS.js +4 -0
  143. package/dist/chunks/computerUseLock-BjoDJH2h.js +1 -0
  144. package/dist/chunks/config-BdCuh6eA.js +1 -0
  145. package/dist/chunks/config-DNz6Eitr.js +1 -0
  146. package/dist/chunks/connectHeadless-CwsFt-Mh.js +1 -0
  147. package/dist/chunks/constants-41VpZw2G.js +1 -0
  148. package/dist/chunks/context-BOjdTj0i.js +1 -0
  149. package/dist/chunks/context-noninteractive-Bd2HO-vU.js +1 -0
  150. package/dist/chunks/context-noninteractive-k2ibficU.js +54 -0
  151. package/dist/chunks/controlMessageCompat-BJhFiS7u.js +1 -0
  152. package/dist/chunks/conversation-BP0phkOY.js +1 -0
  153. package/dist/chunks/conversation-Ci8O_eZ-.js +1 -0
  154. package/dist/chunks/copy-B0VUJ2rH.js +7 -0
  155. package/dist/chunks/createSSHSession-DqmkCS_k.js +6 -0
  156. package/dist/chunks/createSession-B9MhWusY.js +1 -0
  157. package/dist/chunks/createSession-CJEsHz58.js +1 -0
  158. package/dist/chunks/cron-DiW7eIPP.js +1 -0
  159. package/dist/chunks/cronJitterConfig-BzPaa52I.js +6 -0
  160. package/dist/chunks/crossProjectResume-tWsqBUHc.js +40 -0
  161. package/dist/chunks/cwd--iizewsn.js +1 -0
  162. package/dist/chunks/cwd-BgpSJxd7.js +1 -0
  163. package/dist/chunks/daemon-VYRit6Aq.js +2 -0
  164. package/dist/chunks/dangerousBackend-BU_PHGR2.js +1 -0
  165. package/dist/chunks/datadog-Bd1s_VFj.js +1 -0
  166. package/dist/chunks/datadog-DJowkWhh.js +1 -0
  167. package/dist/chunks/debug-DM5ezCBS.js +1 -0
  168. package/dist/chunks/debug-UI3T040K.js +5 -0
  169. package/dist/chunks/debugUtils-BBMFODKH.js +1 -0
  170. package/dist/chunks/defineProperty-80gRi2ZW.js +1 -0
  171. package/dist/chunks/desktop-BDowrzvG.js +1 -0
  172. package/dist/chunks/detached-D300jlhj.js +5 -0
  173. package/dist/chunks/detect-libc-DNuQfUvI.js +1 -0
  174. package/dist/chunks/detectRepository-CBk3S2zv.js +1 -0
  175. package/dist/chunks/detectRepository-DCTvg4p0.js +1 -0
  176. package/dist/chunks/detection-CQsNad64.js +1 -0
  177. package/dist/chunks/detection-DJ-vTbBf.js +1 -0
  178. package/dist/chunks/diff-auU5sUOw.js +1 -0
  179. package/dist/chunks/directoryCompletion-DP_4B1GL.js +1 -0
  180. package/dist/chunks/dist-CanSxOZ1.js +5 -0
  181. package/dist/chunks/dist-Cg1a1Exw.js +29 -0
  182. package/dist/chunks/dist-Q7YNoZ0H.js +20 -0
  183. package/dist/chunks/dist-es-4z5T3Jzm.js +1 -0
  184. package/dist/chunks/dist-es-B2jg52tM2.js +1 -0
  185. package/dist/chunks/dist-es-B6OXHQ1S.js +1 -0
  186. package/dist/chunks/dist-es-B8NEy5hc.js +1 -0
  187. package/dist/chunks/dist-es-BVGppqE4.js +1 -0
  188. package/dist/chunks/dist-es-Bcw5GZko.js +1 -0
  189. package/dist/chunks/dist-es-BoIJpncb.js +9 -0
  190. package/dist/chunks/dist-es-Bu_Fshi1.js +1 -0
  191. package/dist/chunks/dist-es-C-1vn4OP2.js +1 -0
  192. package/dist/chunks/dist-es-C41b_0B5.js +1 -0
  193. package/dist/chunks/dist-es-CCZYybbG2.js +1 -0
  194. package/dist/chunks/dist-es-CLK1mey-.js +1 -0
  195. package/dist/chunks/dist-es-CQz2aNf72.js +1 -0
  196. package/dist/chunks/dist-es-CSfI8B8l.js +1 -0
  197. package/dist/chunks/dist-es-CUZBYppo.js +1 -0
  198. package/dist/chunks/dist-es-CZkzHpjF.js +1 -0
  199. package/dist/chunks/dist-es-Cbf0_D8d.js +5 -0
  200. package/dist/chunks/dist-es-ChHe-SVL.js +1 -0
  201. package/dist/chunks/dist-es-ClYOf0My.js +1 -0
  202. package/dist/chunks/dist-es-D-kJbj4A2.js +1 -0
  203. package/dist/chunks/dist-es-D1LN6CJd.js +1 -0
  204. package/dist/chunks/dist-es-DC1sC3ph.js +1 -0
  205. package/dist/chunks/dist-es-DGn8uOwQ2.js +1 -0
  206. package/dist/chunks/dist-es-DK5fTeKM2.js +1 -0
  207. package/dist/chunks/dist-es-DN7otr6F.js +1 -0
  208. package/dist/chunks/dist-es-DPM0mPK5.js +1 -0
  209. package/dist/chunks/dist-es-DqZAh3nG.js +1 -0
  210. package/dist/chunks/dist-es-DuAZyxJ02.js +5 -0
  211. package/dist/chunks/dist-es-HVQrM0oE.js +1 -0
  212. package/dist/chunks/dist-es-OVleIB54.js +1 -0
  213. package/dist/chunks/dist-es-UAs0rdXg.js +1 -0
  214. package/dist/chunks/dist-es-WvMMuHmx2.js +1 -0
  215. package/dist/chunks/dist-es-fjXft-jH.js +1 -0
  216. package/dist/chunks/dist-es-hdN_ShpZ.js +3 -0
  217. package/dist/chunks/dist-es-neiUvMJb.js +1 -0
  218. package/dist/chunks/dist-es-yMYpDtui2.js +1 -0
  219. package/dist/chunks/dist-es-zjcbuB72.js +1 -0
  220. package/dist/chunks/distRoot-CcxmnzqQ.js +1 -0
  221. package/dist/chunks/doctor-bKPp6AeL.js +1 -0
  222. package/dist/chunks/earlyInput-JGJo1zcC.js +1 -0
  223. package/dist/chunks/earlyInput-tRkbxFv2.js +2 -0
  224. package/dist/chunks/effort-BQj2QnnA.js +9 -0
  225. package/dist/chunks/entry-CUu6-QhT.js +14 -0
  226. package/dist/chunks/env-chR0gV31.js +1 -0
  227. package/dist/chunks/envLessBridgeConfig-CixkwbRF.js +1 -0
  228. package/dist/chunks/envLessBridgeConfig-Ju4W58xf.js +1 -0
  229. package/dist/chunks/envUtils-BWeoiL4Y.js +1 -0
  230. package/dist/chunks/escHotkey-Cyz0yyh1.js +259 -0
  231. package/dist/chunks/esm--xjzB1hI.js +1 -0
  232. package/dist/chunks/esm-B2HIF0XY.js +1 -0
  233. package/dist/chunks/esm-BGQPWnJy.js +1 -0
  234. package/dist/chunks/esm-C-1qL9Mn.js +1 -0
  235. package/dist/chunks/esm-C3jcs1DH.js +1 -0
  236. package/dist/chunks/esm-C97WL9nC.js +1 -0
  237. package/dist/chunks/esm-CIL-SKM8.js +1 -0
  238. package/dist/chunks/esm-CJlBxjtx.js +1 -0
  239. package/dist/chunks/esm-CsGLyWmS.js +56 -0
  240. package/dist/chunks/esm-DQHmDm-H.js +1 -0
  241. package/dist/chunks/esm-DcdOXSzi.js +1 -0
  242. package/dist/chunks/esm-DhNYgGTV.js +1 -0
  243. package/dist/chunks/esm-DxPW7qPs.js +1 -0
  244. package/dist/chunks/esm-FBUWr3vI.js +1 -0
  245. package/dist/chunks/esm-QgL6y---.js +10 -0
  246. package/dist/chunks/esm-v0kPjgVS.js +1 -0
  247. package/dist/chunks/esm-vIn-YV_h.js +1 -0
  248. package/dist/chunks/event-streams-BV7ngMXu.js +1 -0
  249. package/dist/chunks/eventLoopStallDetector-Dnh1fc31.js +1 -0
  250. package/dist/chunks/execAsync-BkA6ogic.js +1 -0
  251. package/dist/chunks/execFileNoThrow-CuQN1sz8.js +1 -0
  252. package/dist/chunks/execSyncWrapper-C2XQnFVo.js +1 -0
  253. package/dist/chunks/execa-CGue6Z3n.js +34 -0
  254. package/dist/chunks/executor-4EeD8GNm.js +1561 -0
  255. package/dist/chunks/executor-BHEuNh5F.js +1 -0
  256. package/dist/chunks/exit-DijkO8eo.js +1 -0
  257. package/dist/chunks/exit-_obETqBv.js +2 -0
  258. package/dist/chunks/export-DA-bBZkX.js +2 -0
  259. package/dist/chunks/exportRenderer-3y4tGdSB.js +1 -0
  260. package/dist/chunks/extra-usage-CS6VwKJt.js +1 -0
  261. package/dist/chunks/extra-usage-DGHEQOrY.js +1 -0
  262. package/dist/chunks/extra-usage-core-DOgT4u4i.js +1 -0
  263. package/dist/chunks/extra-usage-noninteractive-DYnfiRlV.js +1 -0
  264. package/dist/chunks/extraUsage-CfxgfpX_.js +1 -0
  265. package/dist/chunks/extractMemories-jvjCvtpC.js +1 -0
  266. package/dist/chunks/fast-Bbtx_Bs1.js +1 -0
  267. package/dist/chunks/fast-CzRUJBTK.js +1 -0
  268. package/dist/chunks/featureCheck-Cm0YNDXO.js +1 -0
  269. package/dist/chunks/featureCheck-p7OeCYzj.js +1 -0
  270. package/dist/chunks/feedback-FoXtdHAV.js +1 -0
  271. package/dist/chunks/figures-gfT9mM8P.js +1 -0
  272. package/dist/chunks/fileStateCache-C7-TxF8G.js +1 -0
  273. package/dist/chunks/files-DYvAZGxp.js +2 -0
  274. package/dist/chunks/firstPartyEventLogger-KIwaBY-E.js +1 -0
  275. package/dist/chunks/flushGate-C2Icy43G.js +1 -0
  276. package/dist/chunks/foundry-sdk-BFN5VDFQ.js +1 -0
  277. package/dist/chunks/fpsMetrics-DeezdcwV.js +1 -0
  278. package/dist/chunks/fuse-Ch_OAlm3.js +1 -0
  279. package/dist/chunks/gates-CbQLZHtm.js +1 -0
  280. package/dist/chunks/gates-DSI3vpwO.js +1 -0
  281. package/dist/chunks/gemini-BrNJGX4k.js +1 -0
  282. package/dist/chunks/generateRecap-B0fvSCjo.js +1 -0
  283. package/dist/chunks/generateSessionName-DvRYa39O.js +1 -0
  284. package/dist/chunks/genericProcessUtils-BGvcwuPt.js +23 -0
  285. package/dist/chunks/getMachineId-bsd-BMtYGBUL.js +1 -0
  286. package/dist/chunks/getMachineId-darwin-CiLdFH7z.js +2 -0
  287. package/dist/chunks/getMachineId-linux-Cr27rIeY.js +1 -0
  288. package/dist/chunks/getMachineId-unsupported-ceiBLwAN.js +1 -0
  289. package/dist/chunks/getMachineId-win-DFTmsQHq.js +1 -0
  290. package/dist/chunks/git-CN3qtTb_.js +6 -0
  291. package/dist/chunks/git-D23Mzu_K.js +1 -0
  292. package/dist/chunks/githubRepoPathMapping-Dut3d6nn.js +1 -0
  293. package/dist/chunks/graceful-fs-Cgc0rjGF.js +2 -0
  294. package/dist/chunks/grok-Ftoheab3.js +1 -0
  295. package/dist/chunks/growthbook-BynnuVTn.js +1 -0
  296. package/dist/chunks/hash-BRmOQc3c.js +1 -0
  297. package/dist/chunks/heapdump-hQ_w0LPC.js +5 -0
  298. package/dist/chunks/help-DQsHHv6r.js +1 -0
  299. package/dist/chunks/hooks-BLLL4iPv.js +1 -0
  300. package/dist/chunks/hooks-BhVDc8yb.js +79 -0
  301. package/dist/chunks/hostAdapter-D1eWmmhu.js +1 -0
  302. package/dist/chunks/hostGuard-zim_4F9V.js +1 -0
  303. package/dist/chunks/httpAuthSchemes-Wq4XWeLL.js +13 -0
  304. package/dist/chunks/ide-CPmMXLL-.js +2 -0
  305. package/dist/chunks/inboundAttachments-Bmf6vYsE.js +1 -0
  306. package/dist/chunks/inboundAttachments-D-p91z3w.js +1 -0
  307. package/dist/chunks/index.min-BJnb9GQI.js +1 -0
  308. package/dist/chunks/initReplBridge-BiHXpDEY.js +1 -0
  309. package/dist/chunks/insights-CTlTyvjj.js +822 -0
  310. package/dist/chunks/install-IPuD3Lq8.js +1 -0
  311. package/dist/chunks/install-github-app-Bmu_sA9e.js +147 -0
  312. package/dist/chunks/install-slack-app-Rfl81Jqo.js +1 -0
  313. package/dist/chunks/instinctParser-DHMa8xa0.js +1 -0
  314. package/dist/chunks/instrumentation-DWwmOmr0.js +12 -0
  315. package/dist/chunks/intl-Pse97ORk.js +1 -0
  316. package/dist/chunks/isObject-DaxDnPKm.js +1 -0
  317. package/dist/chunks/isSymbol-Dp3irZaY.js +1 -0
  318. package/dist/chunks/job-BXEt0izn.js +2 -0
  319. package/dist/chunks/json-bigint-OxRwRvup.js +8 -0
  320. package/dist/chunks/jsx-runtime-D-D469L8.js +1 -0
  321. package/dist/chunks/jws-2vqRyZtR.js +3 -0
  322. package/dist/chunks/jwtUtils-CpXwh_du.js +1 -0
  323. package/dist/chunks/keybindings-DRDgVvqz.js +2 -0
  324. package/dist/chunks/lang-D3ZHlfT6.js +1 -0
  325. package/dist/chunks/language-B_-BfBT4.js +1 -0
  326. package/dist/chunks/language-DcSjogBx.js +1 -0
  327. package/dist/chunks/launchAgentsPlatform-BPm_VMln.js +1 -0
  328. package/dist/chunks/launchAutofixPr-D2qac07g.js +2 -0
  329. package/dist/chunks/launchCommand-Du91jxMC.js +1 -0
  330. package/dist/chunks/launchLocalMemory-D_hBbXKE.js +3 -0
  331. package/dist/chunks/launchLocalVault-CPzNWvQ9.js +3 -0
  332. package/dist/chunks/launchMemoryStores-Djq2KhKb.js +1 -0
  333. package/dist/chunks/launchOnboarding-Bh6E7vdc.js +8 -0
  334. package/dist/chunks/launchSchedule-C988bQ-5.js +1 -0
  335. package/dist/chunks/launchSkillStore-DqrP6Gme.js +1 -0
  336. package/dist/chunks/launchTeleport-DFhybaq_.js +3 -0
  337. package/dist/chunks/launchVault-p_CSK4ZQ.js +1 -0
  338. package/dist/chunks/lazySchema-2sOku3cX.js +1 -0
  339. package/dist/chunks/lib-B4Q0Nrpb.js +14 -0
  340. package/dist/chunks/lib-Ca3QWJjN.js +2 -0
  341. package/dist/chunks/lib-inCisXen.js +8 -0
  342. package/dist/chunks/loadAgentsDir-Ci5mr0vm.js +4601 -0
  343. package/dist/chunks/loadAgentsDir-vB1QEZ7H.js +1 -0
  344. package/dist/chunks/loadPluginHooks-xYCEZ6t5.js +1 -0
  345. package/dist/chunks/loadSso-sDs471GC.js +1 -0
  346. package/dist/chunks/localSearch-DtVqtfvk.js +1 -0
  347. package/dist/chunks/localSearch-Vpn6W5aY.js +1 -0
  348. package/dist/chunks/lockfile-DBwdlC3K.js +1 -0
  349. package/dist/chunks/log-CzsijfHZ.js +1 -0
  350. package/dist/chunks/login-D-N78G6r.js +1 -0
  351. package/dist/chunks/login-D9IWjvza.js +1 -0
  352. package/dist/chunks/logoV2Utils-SAulcC5x.js +1 -0
  353. package/dist/chunks/logout-CFggVS-9.js +1 -0
  354. package/dist/chunks/magicDocs-BfoeYhin.js +57 -0
  355. package/dist/chunks/main-C6be1KFk.js +31 -0
  356. package/dist/chunks/main-DhMlhVj3.js +1108 -0
  357. package/dist/chunks/mappers-uIrAj-Wd.js +1 -0
  358. package/dist/chunks/mcp-CAYGNxCb.js +1 -0
  359. package/dist/chunks/mcp-COQap0SM.js +6 -0
  360. package/dist/chunks/mcp-DlM0OC6R.js +2 -0
  361. package/dist/chunks/mcpServer-1SnOWb8_.js +1 -0
  362. package/dist/chunks/mcpServer-DXvS3v4x.js +1 -0
  363. package/dist/chunks/memoize-DNnuA2aU.js +1 -0
  364. package/dist/chunks/memoize-DxwLawI2.js +1 -0
  365. package/dist/chunks/memory-XccPLQLt.js +1 -0
  366. package/dist/chunks/mobile-umu5P0cM.js +2 -0
  367. package/dist/chunks/modalContext-CmSKRyea.js +1 -0
  368. package/dist/chunks/model-CbiDGGJU.js +1 -0
  369. package/dist/chunks/model-DdbcxKub.js +1 -0
  370. package/dist/chunks/normalization-Cox8C0dP.js +1 -0
  371. package/dist/chunks/oauth-CdZEzMww.js +1 -0
  372. package/dist/chunks/oauth-CmensepG.js +1 -0
  373. package/dist/chunks/observationStore-tvkldXUo.js +4 -0
  374. package/dist/chunks/onChangeAppState-Dp0JIXd8.js +1 -0
  375. package/dist/chunks/open-CDditBQ-.js +1 -0
  376. package/dist/chunks/openai-6KcHd4Hw.js +10 -0
  377. package/dist/chunks/openaiShared-D5lOejS1.js +16 -0
  378. package/dist/chunks/output-style-XDb9-2Kk.js +1 -0
  379. package/dist/chunks/overageCreditGrant-DYiB4sr-.js +1 -0
  380. package/dist/chunks/p-map-9Ud1LOrJ.js +1 -0
  381. package/dist/chunks/p-map-D7WEmnBE.js +1 -0
  382. package/dist/chunks/package-BhL7chzt.js +1 -0
  383. package/dist/chunks/panel-ByW1omJn.js +1 -0
  384. package/dist/chunks/panel-Bz_8td5D.js +1 -0
  385. package/dist/chunks/parseConnectUrl-BS6i9JPo.js +1 -0
  386. package/dist/chunks/parser-CmngCwjB.js +1 -0
  387. package/dist/chunks/parser-SWIZo39J.js +1 -0
  388. package/dist/chunks/passes-Cbc6T_Tj.js +1 -0
  389. package/dist/chunks/path-C4kbwvSH.js +1 -0
  390. package/dist/chunks/paths-Q2255dD7.js +39 -0
  391. package/dist/chunks/permissions-BLzPHh_3.js +3 -0
  392. package/dist/chunks/permissions-DXLfdE7b.js +1 -0
  393. package/dist/chunks/permissions-Ps_D01ZB.js +1 -0
  394. package/dist/chunks/pipeTransport-D7NIp3aA.js +1 -0
  395. package/dist/chunks/plan-DloFVJK7.js +1 -0
  396. package/dist/chunks/platform-CuyedWpe.js +2 -0
  397. package/dist/chunks/plist-BO4ZqMZc.js +6 -0
  398. package/dist/chunks/plugin-XR9IBPMM.js +1 -0
  399. package/dist/chunks/pluginAutoupdate-Cr9hP0zG.js +1 -0
  400. package/dist/chunks/pluginBlocklist-CM9uP8CY.js +1 -0
  401. package/dist/chunks/pluginCliCommands-BQkrvES5.js +1 -0
  402. package/dist/chunks/pluginFlagging-CJ1--2Kw.js +1 -0
  403. package/dist/chunks/pluginOperations-B0rLuSvo.js +2 -0
  404. package/dist/chunks/pluginStartupCheck-Bjdc8zhz.js +1 -0
  405. package/dist/chunks/pluginStartupCheck-Cu2ezD51.js +1 -0
  406. package/dist/chunks/plugins-BgOP_8TX.js +4 -0
  407. package/dist/chunks/policyLimits-CKy_gTEt.js +1 -0
  408. package/dist/chunks/pollConfig-DhptuhFw.js +1 -0
  409. package/dist/chunks/poller-Ds0Y6Cir.js +1 -0
  410. package/dist/chunks/poor-DF0aqXDx.js +1 -0
  411. package/dist/chunks/poorMode-C5Frra4j.js +1 -0
  412. package/dist/chunks/poorMode-DJvjO2nW.js +1 -0
  413. package/dist/chunks/postCommitAttribution-Ehmwzzuq.js +1 -0
  414. package/dist/chunks/print-CPtR0KTa.js +39 -0
  415. package/dist/chunks/privacy-settings-e-7lc7Un.js +1 -0
  416. package/dist/chunks/process-CWupreF6.js +1 -0
  417. package/dist/chunks/process-DMKLUQIO.js +1 -0
  418. package/dist/chunks/processBashCommand-D5dC6Mya.js +1 -0
  419. package/dist/chunks/processSlashCommand-DHRUtZ-C.js +6 -0
  420. package/dist/chunks/projectContext-0fpRKUeH.js +1 -0
  421. package/dist/chunks/projectContext-eXMSfgdZ.js +1 -0
  422. package/dist/chunks/prompt-4tea6NJQ.js +54 -0
  423. package/dist/chunks/prompt-CQC-mh6u.js +1 -0
  424. package/dist/chunks/prompt-DEPUnJdB.js +222 -0
  425. package/dist/chunks/prompt-DawxLANl.js +1 -0
  426. package/dist/chunks/promptEditor-Ci-h04-5.js +4 -0
  427. package/dist/chunks/protocolHandler-DhqM32qE.js +13 -0
  428. package/dist/chunks/protocols-CAyQOlkr.js +7 -0
  429. package/dist/chunks/proxy-CfZp-wce.js +99 -0
  430. package/dist/chunks/rate-limit-options-B0l29Zx8.js +1 -0
  431. package/dist/chunks/rcDebugLog-BbPkkigY.js +11 -0
  432. package/dist/chunks/referral-ByevBJrE.js +1 -0
  433. package/dist/chunks/refresh-B_CwwIRX.js +1 -0
  434. package/dist/chunks/registerProtocol-DzhaQH02.js +36 -0
  435. package/dist/chunks/registry-DkHA4cRu.js +1 -0
  436. package/dist/chunks/release-notes-CZthYkei.js +4 -0
  437. package/dist/chunks/releaseNotes-CwKpIsyd.js +2 -0
  438. package/dist/chunks/reload-plugins-DxWfXvrN.js +1 -0
  439. package/dist/chunks/remote-env-BiRLWIrh.js +1 -0
  440. package/dist/chunks/remoteBridgeCore-nz1fPY1U.js +1 -0
  441. package/dist/chunks/remoteControlServer-FzLUxh2B.js +3 -0
  442. package/dist/chunks/rename-DmGuyncE.js +1 -0
  443. package/dist/chunks/renderOptions-BiyC2rj1.js +1 -0
  444. package/dist/chunks/resume-7GeU7RMS.js +2 -0
  445. package/dist/chunks/rewind-CXplHgh_.js +1 -0
  446. package/dist/chunks/rollback-DbSpxmJE.js +11 -0
  447. package/dist/chunks/runtimeObserver-Duod-ign.js +10 -0
  448. package/dist/chunks/runtimeObserver-OgM9ZYxZ.js +1 -0
  449. package/dist/chunks/sandbox-adapter-CxkhKgaa.js +1 -0
  450. package/dist/chunks/sandbox-toggle-Cc96R6Ox.js +1 -0
  451. package/dist/chunks/sanitization-CYp-9DbE.js +1 -0
  452. package/dist/chunks/satisfies-BaHgd_ie.js +1 -0
  453. package/dist/chunks/schemas-BGAvj1T4.js +40 -0
  454. package/dist/chunks/sdk-DEtgRZvI.js +1 -0
  455. package/dist/chunks/sdkHeapDumpMonitor--fevrC5z.js +1 -0
  456. package/dist/chunks/searchExtraTools-DQ6e601b.js +1 -0
  457. package/dist/chunks/semver-Cq33BYay.js +1 -0
  458. package/dist/chunks/semver-Tw0AFar5.js +1 -0
  459. package/dist/chunks/sentry-BUHYuYGj.js +13 -0
  460. package/dist/chunks/server-C5XZSlto.js +1 -0
  461. package/dist/chunks/server-DzOdtq8A.js +1 -0
  462. package/dist/chunks/serverBanner-WlSYP-f8.js +1 -0
  463. package/dist/chunks/serverLog-DtsUvDiY.js +1 -0
  464. package/dist/chunks/session-DgLqm7ZI.js +2 -0
  465. package/dist/chunks/sessionDataUploader-Ctjo1bgR.js +1 -0
  466. package/dist/chunks/sessionDiscovery-DgNea6qa.js +1 -0
  467. package/dist/chunks/sessionFileAccessHooks-7Svz-7S-.js +1 -0
  468. package/dist/chunks/sessionManager-Dw72ZUTg.js +1 -0
  469. package/dist/chunks/sessionMemory-DIrR3zvb.js +1 -0
  470. package/dist/chunks/sessionMemory-_dmj8lcH.js +1 -0
  471. package/dist/chunks/sessionMemoryUtils-BdQtSkRx.js +1 -0
  472. package/dist/chunks/sessionObserver-CuWMVPlT.js +20 -0
  473. package/dist/chunks/sessionObserver-_adufOGQ.js +1 -0
  474. package/dist/chunks/sessionStorage-W7okgAlQ.js +1 -0
  475. package/dist/chunks/sessionStoragePortable-BI9q2WcJ.js +3 -0
  476. package/dist/chunks/sessionTitle-DzkMzHer.js +14 -0
  477. package/dist/chunks/sessionTracing-DTjmc0EF.js +11 -0
  478. package/dist/chunks/settingsSync-CfYDkakY.js +1 -0
  479. package/dist/chunks/setup-BKUG46jQ.js +9 -0
  480. package/dist/chunks/setup-CmLngvpJ.js +1 -0
  481. package/dist/chunks/setup-TqJ7-Nxh.js +2 -0
  482. package/dist/chunks/shadowedRuleDetection-DesT0yKM.js +1 -0
  483. package/dist/chunks/shellQuote-DgjT8KBA.js +1 -0
  484. package/dist/chunks/sideQuestion-BAq0YyKY.js +20 -0
  485. package/dist/chunks/signin-QEeYpJZw.js +1 -0
  486. package/dist/chunks/sink-B3uP8Cf8.js +1 -0
  487. package/dist/chunks/sink-CaWMZBw_.js +1 -0
  488. package/dist/chunks/sinks-COcy5GnB.js +2 -0
  489. package/dist/chunks/sinks-oFfsKySL.js +1 -0
  490. package/dist/chunks/skill-learning-DOIMPtWE.js +5 -0
  491. package/dist/chunks/skillChangeDetector-CA_Tdx8N.js +1 -0
  492. package/dist/chunks/skillGapStore-CWuw1dYh.js +1 -0
  493. package/dist/chunks/skillGapStore-DpEoKhn-.js +5 -0
  494. package/dist/chunks/skillGenerator-9y3Q4YoO.js +8 -0
  495. package/dist/chunks/skillLearning-BhM09bQD.js +1 -0
  496. package/dist/chunks/skillLearning-_o2D06yM.js +1 -0
  497. package/dist/chunks/skillPanel-Dt24mZTZ.js +28 -0
  498. package/dist/chunks/skillSearchPanel-gaXN64Fu.js +21 -0
  499. package/dist/chunks/skills-Dx3dMHYk.js +1 -0
  500. package/dist/chunks/slashCommandParsing-Cari0pNg.js +1 -0
  501. package/dist/chunks/sleep-8Eb9j_Ly.js +1 -0
  502. package/dist/chunks/sprites-5OAB-Ui2.js +1 -0
  503. package/dist/chunks/src-BIPP3_mo.js +26 -0
  504. package/dist/chunks/src-BJz1KAd_.js +6 -0
  505. package/dist/chunks/src-BRAdBA8A.js +1 -0
  506. package/dist/chunks/src-BRC_BuUP.js +1 -0
  507. package/dist/chunks/src-BaB-bpCj.js +5 -0
  508. package/dist/chunks/src-BlLavFUS.js +7 -0
  509. package/dist/chunks/src-C5yhFG0C.js +19 -0
  510. package/dist/chunks/src-CI_jaaBj.js +2 -0
  511. package/dist/chunks/src-CRsA-Z4y.js +1 -0
  512. package/dist/chunks/src-CYLfL70h.js +1 -0
  513. package/dist/chunks/src-DJXCzwyJ.js +1 -0
  514. package/dist/chunks/src-DJXKJavk.js +1 -0
  515. package/dist/chunks/src-Di342QoJ.js +53 -0
  516. package/dist/chunks/src-DsMd9Q9e.js +2 -0
  517. package/dist/chunks/src-DzH9IdOo.js +1 -0
  518. package/dist/chunks/src-hdbPEvzO.js +9 -0
  519. package/dist/chunks/src-poaoYkuc.js +1 -0
  520. package/dist/chunks/src-x7u_sB6m.js +1 -0
  521. package/dist/chunks/sso-oidc-BX1MlBX0.js +1 -0
  522. package/dist/chunks/startupProfiler-DnXZaX4A.js +3 -0
  523. package/dist/chunks/startupProfiler-SOE--nM9.js +1 -0
  524. package/dist/chunks/state-B2GIOsTB.js +1 -0
  525. package/dist/chunks/state-Ce1HlR-H.js +1 -0
  526. package/dist/chunks/state-sIHsFpDu.js +1 -0
  527. package/dist/chunks/staticRender-Br64h1E1.js +1 -0
  528. package/dist/chunks/stats-TUExo9iU.js +1 -0
  529. package/dist/chunks/status-Dghaz1my.js +1 -0
  530. package/dist/chunks/statusNoticeHelpers-DVZSSXeK.js +1 -0
  531. package/dist/chunks/stdio-BEEzuxaZ.js +1 -0
  532. package/dist/chunks/stdio-D4cT86R0.js +3 -0
  533. package/dist/chunks/stickers-2K05wjSp.js +1 -0
  534. package/dist/chunks/store-DhI7Lcan.js +1 -0
  535. package/dist/chunks/sts-BDFJ-6QE.js +1 -0
  536. package/dist/chunks/subprocessEnv-CggQWZCx.js +1 -0
  537. package/dist/chunks/subprocessEnv-DV6q6o6w.js +1 -0
  538. package/dist/chunks/supports-color-lkzOMQ6u.js +1 -0
  539. package/dist/chunks/systemPromptSections-BcN_XBTx.js +1 -0
  540. package/dist/chunks/systemPromptSections-DB93ZNWP.js +1 -0
  541. package/dist/chunks/systemTheme-dDbitcxB.js +1 -0
  542. package/dist/chunks/tag-ZcVkzFjz.js +11 -0
  543. package/dist/chunks/tasks-DbB33ekt.js +1 -0
  544. package/dist/chunks/teamHelpers-BmN9nKz-.js +1 -0
  545. package/dist/chunks/teamHelpers-yeTNtZbb.js +1 -0
  546. package/dist/chunks/teammate-DMYOtLTK.js +1 -0
  547. package/dist/chunks/teammateModeSnapshot-CPjJJDL1.js +1 -0
  548. package/dist/chunks/teammateModeSnapshot-CsNIJTKi.js +1 -0
  549. package/dist/chunks/teleport-JHgpwZIh.js +1 -0
  550. package/dist/chunks/templateJobs-Db630FZD.js +12 -0
  551. package/dist/chunks/terminalSetup-DJqWE8fc.js +33 -0
  552. package/dist/chunks/terminalSetup-ygKHrVKR.js +1 -0
  553. package/dist/chunks/theme-MmfFhdTD.js +1 -0
  554. package/dist/chunks/thinkback-CrNirB0V.js +1 -0
  555. package/dist/chunks/thinkback-Quc7KPmi.js +1 -0
  556. package/dist/chunks/thinkback-play-CQ1s7oqg.js +1 -0
  557. package/dist/chunks/tmux-CvbhsfwG.js +1 -0
  558. package/dist/chunks/toolEventObserver-BqMplcIk.js +1 -0
  559. package/dist/chunks/toolEventObserver-DBq2XBYY.js +1 -0
  560. package/dist/chunks/toolPool-BkCtTKXz.js +1 -0
  561. package/dist/chunks/toolPool-C7bOwJfR.js +1 -0
  562. package/dist/chunks/trustedDevice-C9Zevohz.js +1 -0
  563. package/dist/chunks/trustedDevice-DEuQUTbz.js +1 -0
  564. package/dist/chunks/tui-BVc2q4Xv.js +6 -0
  565. package/dist/chunks/turndown.es-Bv06VjMb.js +69 -0
  566. package/dist/chunks/types-CQ1wrnQ0.js +1 -0
  567. package/dist/chunks/types-Csi32ZXh.js +17 -0
  568. package/dist/chunks/types-RJTEOuIt.js +3 -0
  569. package/dist/chunks/udsClient-BvG_Jip0.js +1 -0
  570. package/dist/chunks/ultrareviewCommand-DrlfRrXq.js +3 -0
  571. package/dist/chunks/undercover-CBeHiWUd.js +1 -0
  572. package/dist/chunks/undercover-DKn95mh9.js +31 -0
  573. package/dist/chunks/up-D-U4wUCe.js +12 -0
  574. package/dist/chunks/updateCCB-CJ7dCUan.js +11 -0
  575. package/dist/chunks/upgrade-Degqbu8S.js +1 -0
  576. package/dist/chunks/upgrade-ucJ-lnlY.js +1 -0
  577. package/dist/chunks/upload-pTZQCPLt.js +1 -0
  578. package/dist/chunks/upstreamproxy-DcLeL2XX.js +11 -0
  579. package/dist/chunks/usage-D96a7Cke.js +1 -0
  580. package/dist/chunks/usage-DVQMUMcC.js +1 -0
  581. package/dist/chunks/useKeybinding-FsOnjW6T.js +1 -0
  582. package/dist/chunks/useMainLoopModel-B7ch2o9K.js +1 -0
  583. package/dist/chunks/useManagePlugins-BfGzHMvO.js +1 -0
  584. package/dist/chunks/useMergedTools-TemEvCrX.js +1 -0
  585. package/dist/chunks/useSearchInput-B-V4kIa-.js +1 -0
  586. package/dist/chunks/useSettingsErrors-B2JGz1s8.js +1 -0
  587. package/dist/chunks/useVoice-BuwYDm2U.js +1 -0
  588. package/dist/chunks/util-CeIKZmj9.js +1 -0
  589. package/dist/chunks/utils-CwhszpkT.js +1 -0
  590. package/dist/chunks/v4-f1i_CNUT.js +1 -0
  591. package/dist/chunks/validatePlugin-BlVho93x.js +1 -0
  592. package/dist/chunks/vertex-sdk-CSGw3fvU.js +9 -0
  593. package/dist/chunks/vim-DUZQCWUP.js +1 -0
  594. package/dist/chunks/voice-BkRIHZiM.js +2 -0
  595. package/dist/chunks/voice-DXiiy8HX.js +8 -0
  596. package/dist/chunks/voiceModeEnabled-CPQUE3PU.js +1 -0
  597. package/dist/chunks/voiceModeEnabled-DB8GCzAF.js +1 -0
  598. package/dist/chunks/voiceStreamSTT-DgoDscHn.js +1 -0
  599. package/dist/chunks/voiceStreamSTT-Dr_wH1Kh.js +1 -0
  600. package/dist/chunks/which-DqSAIvp2.js +1 -0
  601. package/dist/chunks/windowsPaths-C9CigqoF.js +1 -0
  602. package/dist/chunks/windowsPaths-swxCp7bX.js +2 -0
  603. package/dist/chunks/workSecret-mS2OrpxF.js +1 -0
  604. package/dist/chunks/workerRegistry-CT7_kjvY.js +1 -0
  605. package/dist/chunks/worktree-DU3xtwKW.js +1 -0
  606. package/dist/chunks/worktreeModeEnabled-Db6b_Iy_.js +1 -0
  607. package/dist/chunks/worktreeModeEnabled-THQb19xR.js +1 -0
  608. package/dist/chunks/wrapper-BSK0MCQH.js +1 -0
  609. package/dist/chunks/wrapper-D5qL1aQL.js +6 -0
  610. package/dist/chunks/xdg-CBxMmQux.js +1 -0
  611. package/dist/chunks/xml-DD_ldd3X.js +1 -0
  612. package/dist/chunks/zod-DT6hytkp.js +1 -0
  613. package/dist/cli.js +1 -10934
  614. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ import{a as e,i as t,n,r,t as i}from"./chunk-DR8-3Aex.js";import{n as a,t as o}from"./defineProperty-80gRi2ZW.js";import{_ as s,b as c,g as l,h as u,l as d,m as f,p,u as m,v as h,x as g,y as _}from"./esm-vIn-YV_h.js";import{n as v,t as y}from"./esm-CJlBxjtx.js";import{c as b,s as x}from"./esm-DcdOXSzi.js";var S=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.VERSION=void 0,e.VERSION=`0.215.0`})),C=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=e.DEFAULT_MAX_SEND_MESSAGE_LENGTH=e.Propagate=e.LogVerbosity=e.Status=void 0;var t;(function(e){e[e.OK=0]=`OK`,e[e.CANCELLED=1]=`CANCELLED`,e[e.UNKNOWN=2]=`UNKNOWN`,e[e.INVALID_ARGUMENT=3]=`INVALID_ARGUMENT`,e[e.DEADLINE_EXCEEDED=4]=`DEADLINE_EXCEEDED`,e[e.NOT_FOUND=5]=`NOT_FOUND`,e[e.ALREADY_EXISTS=6]=`ALREADY_EXISTS`,e[e.PERMISSION_DENIED=7]=`PERMISSION_DENIED`,e[e.RESOURCE_EXHAUSTED=8]=`RESOURCE_EXHAUSTED`,e[e.FAILED_PRECONDITION=9]=`FAILED_PRECONDITION`,e[e.ABORTED=10]=`ABORTED`,e[e.OUT_OF_RANGE=11]=`OUT_OF_RANGE`,e[e.UNIMPLEMENTED=12]=`UNIMPLEMENTED`,e[e.INTERNAL=13]=`INTERNAL`,e[e.UNAVAILABLE=14]=`UNAVAILABLE`,e[e.DATA_LOSS=15]=`DATA_LOSS`,e[e.UNAUTHENTICATED=16]=`UNAUTHENTICATED`})(t||(e.Status=t={}));var n;(function(e){e[e.DEBUG=0]=`DEBUG`,e[e.INFO=1]=`INFO`,e[e.ERROR=2]=`ERROR`,e[e.NONE=3]=`NONE`})(n||(e.LogVerbosity=n={}));var r;(function(e){e[e.DEADLINE=1]=`DEADLINE`,e[e.CENSUS_STATS_CONTEXT=2]=`CENSUS_STATS_CONTEXT`,e[e.CENSUS_TRACING_CONTEXT=4]=`CENSUS_TRACING_CONTEXT`,e[e.CANCELLATION=8]=`CANCELLATION`,e[e.DEFAULTS=65535]=`DEFAULTS`})(r||(e.Propagate=r={})),e.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1,e.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024})),w=r({author:()=>N,contributors:()=>I,default:()=>ne,dependencies:()=>te,description:()=>D,devDependencies:()=>F,engines:()=>j,files:()=>R,homepage:()=>O,keywords:()=>M,license:()=>P,main:()=>A,name:()=>T,repository:()=>k,scripts:()=>L,types:()=>ee,version:()=>E}),T,E,D,O,k,A,j,M,N,ee,P,F,I,L,te,R,ne,z=n((()=>{T=`@grpc/grpc-js`,E=`1.14.3`,D=`gRPC Library for Node - pure JS implementation`,O=`https://grpc.io/`,k=`https://github.com/grpc/grpc-node/tree/master/packages/grpc-js`,A=`build/src/index.js`,j={node:`>=12.10.0`},M=[],N={name:`Google Inc.`},ee=`build/src/index.d.ts`,P=`Apache-2.0`,F={"@grpc/proto-loader":`file:../proto-loader`,"@types/gulp":`^4.0.17`,"@types/gulp-mocha":`0.0.37`,"@types/lodash":`^4.14.202`,"@types/mocha":`^10.0.6`,"@types/ncp":`^2.0.8`,"@types/node":`>=20.11.20`,"@types/pify":`^5.0.4`,"@types/semver":`^7.5.8`,"@typescript-eslint/eslint-plugin":`^7.1.0`,"@typescript-eslint/parser":`^7.1.0`,"@typescript-eslint/typescript-estree":`^7.1.0`,"clang-format":`^1.8.0`,eslint:`^8.42.0`,"eslint-config-prettier":`^8.8.0`,"eslint-plugin-node":`^11.1.0`,"eslint-plugin-prettier":`^4.2.1`,execa:`^2.0.3`,gulp:`^4.0.2`,"gulp-mocha":`^6.0.0`,lodash:`^4.17.21`,madge:`^5.0.1`,"mocha-jenkins-reporter":`^0.4.1`,ncp:`^2.0.0`,pify:`^4.0.1`,prettier:`^2.8.8`,rimraf:`^3.0.2`,semver:`^7.6.0`,"ts-node":`^10.9.2`,typescript:`^5.3.3`},I=[{name:`Google Inc.`}],L={build:`npm run compile`,clean:`rimraf ./build`,compile:`tsc -p .`,format:`clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts`,lint:`eslint src/*.ts test/*.ts`,prepare:`npm run copy-protos && npm run generate-types && npm run generate-test-types && npm run compile`,test:`gulp test`,check:`npm run lint`,fix:`eslint --fix src/*.ts test/*.ts`,pretest:`npm run generate-types && npm run generate-test-types && npm run compile`,posttest:`npm run check && madge -c ./build/src`,"generate-types":`proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs proto/ proto/xds/ proto/protoc-gen-validate/ -O src/generated/ --grpcLib ../index channelz.proto xds/service/orca/v3/orca.proto`,"generate-test-types":`proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto echo_service.proto`,"copy-protos":`node ./copy-protos`},te={"@grpc/proto-loader":`^0.8.0`,"@js-sdsl/ordered-map":`^4.4.2`},R=[`src/**/*.ts`,`build/src/**/*.{js,d.ts,js.map}`,`proto/**/*.proto`,`proto/**/LICENSE`,`LICENSE`,`deps/envoy-api/envoy/api/v2/**/*.proto`,`deps/envoy-api/envoy/config/**/*.proto`,`deps/envoy-api/envoy/service/**/*.proto`,`deps/envoy-api/envoy/type/**/*.proto`,`deps/udpa/udpa/**/*.proto`,`deps/googleapis/google/api/*.proto`,`deps/googleapis/google/rpc/*.proto`,`deps/protoc-gen-validate/validate/**/*.proto`],ne={name:T,version:E,description:D,homepage:O,repository:k,main:A,engines:j,keywords:M,author:N,types:ee,license:P,devDependencies:F,contributors:I,scripts:L,dependencies:te,files:R}})),B=i((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.log=n.setLoggerVerbosity=n.setLogger=n.getLogger=void 0,n.trace=f,n.isTracerEnabled=p;var r=C(),i=t(`process`),a=(z(),e(w).default).version,o={error:(e,...t)=>{console.error(`E `+e,...t)},info:(e,...t)=>{console.error(`I `+e,...t)},debug:(e,...t)=>{console.error(`D `+e,...t)}},s=r.LogVerbosity.ERROR;switch((process.env.GRPC_NODE_VERBOSITY??process.env.GRPC_VERBOSITY??``).toUpperCase()){case`DEBUG`:s=r.LogVerbosity.DEBUG;break;case`INFO`:s=r.LogVerbosity.INFO;break;case`ERROR`:s=r.LogVerbosity.ERROR;break;case`NONE`:s=r.LogVerbosity.NONE;break;default:}n.getLogger=()=>o,n.setLogger=e=>{o=e},n.setLoggerVerbosity=e=>{s=e},n.log=(e,...t)=>{let n;if(e>=s){switch(e){case r.LogVerbosity.DEBUG:n=o.debug;break;case r.LogVerbosity.INFO:n=o.info;break;case r.LogVerbosity.ERROR:n=o.error;break}n||(n=o.error),n&&n.bind(o)(...t)}};var c=process.env.GRPC_NODE_TRACE??process.env.GRPC_TRACE??``,l=new Set,u=new Set;for(let e of c.split(`,`))e.startsWith(`-`)?u.add(e.substring(1)):l.add(e);var d=l.has(`all`);function f(e,t,r){p(t)&&(0,n.log)(e,new Date().toISOString()+` | v`+a+` `+i.pid+` | `+t+` | `+r)}function p(e){return!u.has(e)&&(d||l.has(e))}})),re=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getErrorMessage=t,e.getErrorCode=n;function t(e){return e instanceof Error?e.message:String(e)}function n(e){return typeof e==`object`&&e&&`code`in e&&typeof e.code==`number`?e.code:null}})),V=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Metadata=void 0;var t=B(),n=C(),r=re(),i=/^[:0-9a-z_.-]+$/,a=/^[ -~]*$/;function o(e){return i.test(e)}function s(e){return a.test(e)}function c(e){return e.endsWith(`-bin`)}function l(e){return!e.startsWith(`grpc-`)}function u(e){return e.toLowerCase()}function d(e,t){if(!o(e))throw Error(`Metadata key "`+e+`" contains illegal characters`);if(t!=null)if(c(e)){if(!Buffer.isBuffer(t))throw Error(`keys that end with '-bin' must have Buffer values`)}else{if(Buffer.isBuffer(t))throw Error(`keys that don't end with '-bin' must have String values`);if(!s(t))throw Error(`Metadata string value "`+t+`" contains illegal characters`)}}e.Metadata=class e{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,t){e=u(e),d(e,t),this.internalRepr.set(e,[t])}add(e,t){e=u(e),d(e,t);let n=this.internalRepr.get(e);n===void 0?this.internalRepr.set(e,[t]):n.push(t)}remove(e){e=u(e),this.internalRepr.delete(e)}get(e){return e=u(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,n]of this.internalRepr)if(n.length>0){let r=n[0];e[t]=Buffer.isBuffer(r)?Buffer.from(r):r}return e}clone(){let t=new e(this.options),n=t.internalRepr;for(let[e,t]of this.internalRepr){let r=t.map(e=>Buffer.isBuffer(e)?Buffer.from(e):e);n.set(e,r)}return t}merge(e){for(let[t,n]of e.internalRepr){let e=(this.internalRepr.get(t)||[]).concat(n);this.internalRepr.set(t,e)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,n]of this.internalRepr)t.startsWith(`:`)||(e[t]=n.map(f));return e}toJSON(){let e={};for(let[t,n]of this.internalRepr)e[t]=n;return e}setOpaque(e,t){this.opaqueData.set(e,t)}getOpaque(e){return this.opaqueData.get(e)}static fromHttp2Headers(i){let a=new e;for(let e of Object.keys(i)){if(e.charAt(0)===`:`)continue;let o=i[e];try{c(e)?Array.isArray(o)?o.forEach(t=>{a.add(e,Buffer.from(t,`base64`))}):o!==void 0&&(l(e)?o.split(`,`).forEach(t=>{a.add(e,Buffer.from(t.trim(),`base64`))}):a.add(e,Buffer.from(o,`base64`))):Array.isArray(o)?o.forEach(t=>{a.add(e,t)}):o!==void 0&&a.add(e,o)}catch(i){let a=`Failed to add metadata entry ${e}: ${o}. ${(0,r.getErrorMessage)(i)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,t.log)(n.LogVerbosity.ERROR,a)}}return a}};var f=e=>Buffer.isBuffer(e)?e.toString(`base64`):e})),ie=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CallCredentials=void 0;var t=V();function n(e){return`getRequestHeaders`in e&&typeof e.getRequestHeaders==`function`}var r=class e{static createFromMetadataGenerator(e){return new a(e)}static createFromGoogleCredential(r){return e.createFromMetadataGenerator((e,i)=>{let a;a=n(r)?r.getRequestHeaders(e.service_url):new Promise((t,n)=>{r.getRequestMetadata(e.service_url,(e,r)=>{if(e){n(e);return}if(!r){n(Error(`Headers not set by metadata plugin`));return}t(r)})}),a.then(e=>{let n=new t.Metadata;for(let t of Object.keys(e))n.add(t,e[t]);i(null,n)},e=>{i(e)})})}static createEmpty(){return new o}};e.CallCredentials=r;var i=class e extends r{constructor(e){super(),this.creds=e}async generateMetadata(e){let n=new t.Metadata,r=await Promise.all(this.creds.map(t=>t.generateMetadata(e)));for(let e of r)n.merge(e);return n}compose(t){return new e(this.creds.concat([t]))}_equals(t){return this===t?!0:t instanceof e?this.creds.every((e,n)=>e._equals(t.creds[n])):!1}},a=class e extends r{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,n)=>{this.metadataGenerator(e,(e,r)=>{r===void 0?n(e):t(r)})})}compose(e){return new i([this,e])}_equals(t){return this===t?!0:t instanceof e?this.metadataGenerator===t.metadataGenerator:!1}},o=class e extends r{generateMetadata(e){return Promise.resolve(new t.Metadata)}compose(e){return e}_equals(t){return t instanceof e}}})),ae=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CIPHER_SUITES=void 0,e.getDefaultRootsData=a;var n=t(`fs`);e.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var r=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,i=null;function a(){return r?(i===null&&(i=n.readFileSync(r)),i):null}})),H=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.parseUri=n,e.splitHostPort=i,e.combineHostPort=a,e.uriToString=o;var t=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function n(e){let n=t.exec(e);return n===null?null:{scheme:n[1],authority:n[2],path:n[3]}}var r=/^\d+$/;function i(e){if(e.startsWith(`[`)){let t=e.indexOf(`]`);if(t===-1)return null;let n=e.substring(1,t);if(n.indexOf(`:`)===-1)return null;if(e.length>t+1)if(e[t+1]===`:`){let i=e.substring(t+2);return r.test(i)?{host:n,port:+i}:null}else return null;else return{host:n}}else{let t=e.split(`:`);return t.length===2?r.test(t[1])?{host:t[0],port:+t[1]}:null:{host:e}}}function a(e){return e.port===void 0?e.host:e.host.includes(`:`)?`[${e.host}]:${e.port}`:`${e.host}:${e.port}`}function o(e){let t=``;return e.scheme!==void 0&&(t+=e.scheme+`:`),e.authority!==void 0&&(t+=`//`+e.authority+`/`),t+=e.path,t}})),U=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0,e.registerResolver=i,e.registerDefaultScheme=a,e.createResolver=o,e.getDefaultAuthority=s,e.mapUriDefaultScheme=c;var t=H();e.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=`grpc.internal.config_selector`;var n={},r=null;function i(e,t){n[e]=t}function a(e){r=e}function o(e,r,i){if(e.scheme!==void 0&&e.scheme in n)return new n[e.scheme](e,r,i);throw Error(`No resolver could be created for target ${(0,t.uriToString)(e)}`)}function s(e){if(e.scheme!==void 0&&e.scheme in n)return n[e.scheme].getDefaultAuthority(e);throw Error(`Invalid target ${(0,t.uriToString)(e)}`)}function c(e){return e.scheme===void 0||!(e.scheme in n)?r===null?null:{scheme:r,authority:void 0,path:(0,t.uriToString)(e)}:e}})),oe=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ChannelCredentials=void 0,e.createCertificateProviderChannelCredentials=g;var n=t(`tls`),r=ie(),i=ae(),a=H(),o=U(),s=B(),c=C();function l(e,t){if(e&&!(e instanceof Buffer))throw TypeError(`${t}, if provided, must be a Buffer.`)}var u=class{compose(e){return new _(this,e)}static createSsl(e,t,r,a){if(l(e,`Root certificate`),l(t,`Private key`),l(r,`Certificate chain`),t&&!r)throw Error(`Private key must be given with accompanying certificate chain`);if(!t&&r)throw Error(`Certificate chain must be given with accompanying private key`);return new m((0,n.createSecureContext)({ca:e??(0,i.getDefaultRootsData)()??void 0,key:t??void 0,cert:r??void 0,ciphers:i.CIPHER_SUITES}),a??{})}static createFromSecureContext(e,t){return new m(e,t??{})}static createInsecure(){return new d}};e.ChannelCredentials=u;var d=class e extends u{constructor(){super()}compose(e){throw Error(`Cannot compose insecure credentials`)}_isSecure(){return!1}_equals(t){return t instanceof e}_createSecureConnector(e,t,n){return{connect(e){return Promise.resolve({socket:e,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>n??r.CallCredentials.createEmpty(),destroy(){}}}};function f(e,t,r,i){let s={secureContext:e},c=r;if(`grpc.http_connect_target`in i){let e=(0,a.parseUri)(i[`grpc.http_connect_target`]);e&&(c=e)}let l=(0,o.getDefaultAuthority)(c),u=(0,a.splitHostPort)(l)?.host??l;if(s.host=u,t.checkServerIdentity&&(s.checkServerIdentity=t.checkServerIdentity),t.rejectUnauthorized!==void 0&&(s.rejectUnauthorized=t.rejectUnauthorized),s.ALPNProtocols=[`h2`],i[`grpc.ssl_target_name_override`]){let e=i[`grpc.ssl_target_name_override`],t=s.checkServerIdentity??n.checkServerIdentity;s.checkServerIdentity=(n,r)=>t(e,r),s.servername=e}else s.servername=u;return i[`grpc-node.tls_enable_trace`]&&(s.enableTrace=!0),s}var p=class{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(e){let t=Object.assign({socket:e},this.connectionOptions);return new Promise((e,r)=>{let i=(0,n.connect)(t,()=>{if((this.connectionOptions.rejectUnauthorized??!0)&&!i.authorized){r(i.authorizationError);return}e({socket:i,secure:!0})});i.on(`error`,e=>{r(e)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},m=class e extends u{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(t){return this===t?!0:t instanceof e?this.secureContext===t.secureContext&&this.verifyOptions.checkServerIdentity===t.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,t,n){return new p(f(this.secureContext,this.verifyOptions,e,t),n??r.CallCredentials.createEmpty())}},h=class e extends u{constructor(e,t,n){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=n,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(t){return this===t?!0:t instanceof e?this.caCertificateProvider===t.caCertificateProvider&&this.identityCertificateProvider===t.identityCertificateProvider&&this.verifyOptions?.checkServerIdentity===t.verifyOptions?.checkServerIdentity:!1}ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)==null||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;--this.refcount,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)==null||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(t,n,i){return this.ref(),new e.SecureConnectorImpl(this,t,n,i??r.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){if(!this.latestCaUpdate||this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,n.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:this.latestIdentityUpdate?.privateKey,cert:this.latestIdentityUpdate?.certificate,ciphers:i.CIPHER_SUITES})}catch(e){return(0,s.log)(c.LogVerbosity.ERROR,`Failed to createSecureContext with error `+e.message),null}}};h.SecureConnectorImpl=class{constructor(e,t,n,r){this.parent=e,this.channelTarget=t,this.options=n,this.callCredentials=r}connect(e){return new Promise((t,r)=>{let i=this.parent.getLatestSecureContext();if(!i){r(Error(`Failed to load credentials`));return}e.closed&&r(Error(`Socket closed while loading credentials`));let a=f(i,this.parent.verifyOptions,this.channelTarget,this.options),o=Object.assign({socket:e},a),s=()=>{r(Error(`Socket closed`))},c=e=>{r(e)},l=(0,n.connect)(o,()=>{if(l.removeListener(`close`,s),l.removeListener(`error`,c),(this.parent.verifyOptions.rejectUnauthorized??!0)&&!l.authorized){r(l.authorizationError);return}t({socket:l,secure:!0})});l.once(`close`,s),l.once(`error`,c)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function g(e,t,n){return new h(e,t,n??{})}var _=class e extends u{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw Error(`Cannot compose insecure credentials`)}compose(t){let n=this.callCredentials.compose(t);return new e(this.channelCredentials,n)}_isSecure(){return!0}_equals(t){return this===t?!0:t instanceof e?this.channelCredentials._equals(t.channelCredentials)&&this.callCredentials._equals(t.callCredentials):!1}_createSecureConnector(e,t,n){let i=this.callCredentials.compose(n??r.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,t,i)}}})),se=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createChildChannelControlHelper=r,e.registerLoadBalancerType=o,e.registerDefaultLoadBalancerType=s,e.createLoadBalancer=c,e.isLoadBalancerNameRegistered=l,e.parseLoadBalancingConfig=u,e.getDefaultConfig=d,e.selectLbConfigFromList=f;var t=B(),n=C();function r(e,t){return{createSubchannel:t.createSubchannel?.bind(t)??e.createSubchannel.bind(e),updateState:t.updateState?.bind(t)??e.updateState.bind(e),requestReresolution:t.requestReresolution?.bind(t)??e.requestReresolution.bind(e),addChannelzChild:t.addChannelzChild?.bind(t)??e.addChannelzChild.bind(e),removeChannelzChild:t.removeChannelzChild?.bind(t)??e.removeChannelzChild.bind(e)}}var i={},a=null;function o(e,t,n){i[e]={LoadBalancer:t,LoadBalancingConfig:n}}function s(e){a=e}function c(e,t){let n=e.getLoadBalancerName();return n in i?new i[n].LoadBalancer(t):null}function l(e){return e in i}function u(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Provided load balancing config has multiple conflicting entries`);let n=t[0];if(n in i)try{return i[n].LoadBalancingConfig.createFromJson(e[n])}catch(e){throw Error(`${n}: ${e.message}`)}else throw Error(`Unrecognized load balancing config name ${n}`)}function d(){if(!a)throw Error(`No default load balancer type registered`);return new i[a].LoadBalancingConfig}function f(e,r=!1){for(let r of e)try{return u(r)}catch(e){(0,t.log)(n.LogVerbosity.DEBUG,`Config parsing failed with error`,e.message);continue}return r&&a?new i[a].LoadBalancingConfig:null}})),ce=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateRetryThrottling=u,e.validateServiceConfig=f,e.extractAndSelectServiceConfig=h;var n=t(`os`),r=C(),i=/^\d+(\.\d{1,9})?s$/,a=`node`;function o(e){if(`service`in e&&e.service!==``){if(typeof e.service!=`string`)throw Error(`Invalid method config name: invalid service: expected type string, got ${typeof e.service}`);if(`method`in e&&e.method!==``){if(typeof e.method!=`string`)throw Error(`Invalid method config name: invalid method: expected type string, got ${typeof e.service}`);return{service:e.service,method:e.method}}else return{service:e.service}}else{if(`method`in e&&e.method!==void 0)throw Error(`Invalid method config name: method set with empty or unset service`);return{}}}function s(e){if(!(`maxAttempts`in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw Error(`Invalid method config retry policy: maxAttempts must be an integer at least 2`);if(!(`initialBackoff`in e)||typeof e.initialBackoff!=`string`||!i.test(e.initialBackoff))throw Error(`Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s`);if(!(`maxBackoff`in e)||typeof e.maxBackoff!=`string`||!i.test(e.maxBackoff))throw Error(`Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s`);if(!(`backoffMultiplier`in e)||typeof e.backoffMultiplier!=`number`||e.backoffMultiplier<=0)throw Error(`Invalid method config retry policy: backoffMultiplier must be a number greater than 0`);if(!(`retryableStatusCodes`in e&&Array.isArray(e.retryableStatusCodes)))throw Error(`Invalid method config retry policy: retryableStatusCodes is required`);if(e.retryableStatusCodes.length===0)throw Error(`Invalid method config retry policy: retryableStatusCodes must be non-empty`);for(let t of e.retryableStatusCodes)if(typeof t==`number`){if(!Object.values(r.Status).includes(t))throw Error(`Invalid method config retry policy: retryableStatusCodes value not in status code range`)}else if(typeof t==`string`){if(!Object.values(r.Status).includes(t.toUpperCase()))throw Error(`Invalid method config retry policy: retryableStatusCodes value not a status code name`)}else throw Error(`Invalid method config retry policy: retryableStatusCodes value must be a string or number`);return{maxAttempts:e.maxAttempts,initialBackoff:e.initialBackoff,maxBackoff:e.maxBackoff,backoffMultiplier:e.backoffMultiplier,retryableStatusCodes:e.retryableStatusCodes}}function c(e){if(!(`maxAttempts`in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw Error(`Invalid method config hedging policy: maxAttempts must be an integer at least 2`);if(`hedgingDelay`in e&&(typeof e.hedgingDelay!=`string`||!i.test(e.hedgingDelay)))throw Error(`Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s`);if(`nonFatalStatusCodes`in e&&Array.isArray(e.nonFatalStatusCodes))for(let t of e.nonFatalStatusCodes)if(typeof t==`number`){if(!Object.values(r.Status).includes(t))throw Error(`Invalid method config hedging policy: nonFatalStatusCodes value not in status code range`)}else if(typeof t==`string`){if(!Object.values(r.Status).includes(t.toUpperCase()))throw Error(`Invalid method config hedging policy: nonFatalStatusCodes value not a status code name`)}else throw Error(`Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number`);let t={maxAttempts:e.maxAttempts};return e.hedgingDelay&&(t.hedgingDelay=e.hedgingDelay),e.nonFatalStatusCodes&&(t.nonFatalStatusCodes=e.nonFatalStatusCodes),t}function l(e){let t={name:[]};if(!(`name`in e)||!Array.isArray(e.name))throw Error(`Invalid method config: invalid name array`);for(let n of e.name)t.name.push(o(n));if(`waitForReady`in e){if(typeof e.waitForReady!=`boolean`)throw Error(`Invalid method config: invalid waitForReady`);t.waitForReady=e.waitForReady}if(`timeout`in e)if(typeof e.timeout==`object`){if(!(`seconds`in e.timeout)||typeof e.timeout.seconds!=`number`)throw Error(`Invalid method config: invalid timeout.seconds`);if(!(`nanos`in e.timeout)||typeof e.timeout.nanos!=`number`)throw Error(`Invalid method config: invalid timeout.nanos`);t.timeout=e.timeout}else if(typeof e.timeout==`string`&&i.test(e.timeout)){let n=e.timeout.substring(0,e.timeout.length-1).split(`.`);t.timeout={seconds:n[0]|0,nanos:(n[1]??0)|0}}else throw Error(`Invalid method config: invalid timeout`);if(`maxRequestBytes`in e){if(typeof e.maxRequestBytes!=`number`)throw Error(`Invalid method config: invalid maxRequestBytes`);t.maxRequestBytes=e.maxRequestBytes}if(`maxResponseBytes`in e){if(typeof e.maxResponseBytes!=`number`)throw Error(`Invalid method config: invalid maxRequestBytes`);t.maxResponseBytes=e.maxResponseBytes}if(`retryPolicy`in e){if(`hedgingPolicy`in e)throw Error(`Invalid method config: retryPolicy and hedgingPolicy cannot both be specified`);t.retryPolicy=s(e.retryPolicy)}else `hedgingPolicy`in e&&(t.hedgingPolicy=c(e.hedgingPolicy));return t}function u(e){if(!(`maxTokens`in e)||typeof e.maxTokens!=`number`||e.maxTokens<=0||e.maxTokens>1e3)throw Error(`Invalid retryThrottling: maxTokens must be a number in (0, 1000]`);if(!(`tokenRatio`in e)||typeof e.tokenRatio!=`number`||e.tokenRatio<=0)throw Error(`Invalid retryThrottling: tokenRatio must be a number greater than 0`);return{maxTokens:+e.maxTokens.toFixed(3),tokenRatio:+e.tokenRatio.toFixed(3)}}function d(e){if(!(typeof e==`object`&&e))throw Error(`Invalid loadBalancingConfig: unexpected type ${typeof e}`);let t=Object.keys(e);if(t.length>1)throw Error(`Invalid loadBalancingConfig: unexpected multiple keys ${t}`);if(t.length===0)throw Error(`Invalid loadBalancingConfig: load balancing policy name required`);return{[t[0]]:e[t[0]]}}function f(e){let t={loadBalancingConfig:[],methodConfig:[]};if(`loadBalancingPolicy`in e)if(typeof e.loadBalancingPolicy==`string`)t.loadBalancingPolicy=e.loadBalancingPolicy;else throw Error(`Invalid service config: invalid loadBalancingPolicy`);if(`loadBalancingConfig`in e)if(Array.isArray(e.loadBalancingConfig))for(let n of e.loadBalancingConfig)t.loadBalancingConfig.push(d(n));else throw Error(`Invalid service config: invalid loadBalancingConfig`);if(`methodConfig`in e&&Array.isArray(e.methodConfig))for(let n of e.methodConfig)t.methodConfig.push(l(n));`retryThrottling`in e&&(t.retryThrottling=u(e.retryThrottling));let n=[];for(let e of t.methodConfig)for(let t of e.name){for(let e of n)if(t.service===e.service&&t.method===e.method)throw Error(`Invalid service config: duplicate name ${t.service}/${t.method}`);n.push(t)}return t}function p(e){if(!(`serviceConfig`in e))throw Error(`Invalid service config choice: missing service config`);let t={serviceConfig:f(e.serviceConfig)};if(`clientLanguage`in e)if(Array.isArray(e.clientLanguage)){t.clientLanguage=[];for(let n of e.clientLanguage)if(typeof n==`string`)t.clientLanguage.push(n);else throw Error(`Invalid service config choice: invalid clientLanguage`)}else throw Error(`Invalid service config choice: invalid clientLanguage`);if(`clientHostname`in e)if(Array.isArray(e.clientHostname)){t.clientHostname=[];for(let n of e.clientHostname)if(typeof n==`string`)t.clientHostname.push(n);else throw Error(`Invalid service config choice: invalid clientHostname`)}else throw Error(`Invalid service config choice: invalid clientHostname`);if(`percentage`in e)if(typeof e.percentage==`number`&&0<=e.percentage&&e.percentage<=100)t.percentage=e.percentage;else throw Error(`Invalid service config choice: invalid percentage`);let n=[`clientLanguage`,`percentage`,`clientHostname`,`serviceConfig`];for(let t in e)if(!n.includes(t))throw Error(`Invalid service config choice: unexpected field ${t}`);return t}function m(e,t){if(!Array.isArray(e))throw Error(`Invalid service config list`);for(let r of e){let e=p(r);if(!(typeof e.percentage==`number`&&t>e.percentage)){if(Array.isArray(e.clientHostname)){let t=!1;for(let r of e.clientHostname)r===n.hostname()&&(t=!0);if(!t)continue}if(Array.isArray(e.clientLanguage)){let t=!1;for(let n of e.clientLanguage)n===a&&(t=!0);if(!t)continue}return e.serviceConfig}}throw Error(`No matching service config found`)}function h(e,t){for(let n of e)if(n.length>0&&n[0].startsWith(`grpc_config=`)){let e=n.join(``).substring(12);return m(JSON.parse(e),t)}return null}})),W=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ConnectivityState=void 0;var t;(function(e){e[e.IDLE=0]=`IDLE`,e[e.CONNECTING=1]=`CONNECTING`,e[e.READY=2]=`READY`,e[e.TRANSIENT_FAILURE=3]=`TRANSIENT_FAILURE`,e[e.SHUTDOWN=4]=`SHUTDOWN`})(t||(e.ConnectivityState=t={}))})),G=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.QueuePicker=e.UnavailablePicker=e.PickResultType=void 0;var t=V(),n=C(),r;(function(e){e[e.COMPLETE=0]=`COMPLETE`,e[e.QUEUE=1]=`QUEUE`,e[e.TRANSIENT_FAILURE=2]=`TRANSIENT_FAILURE`,e[e.DROP=3]=`DROP`})(r||(e.PickResultType=r={})),e.UnavailablePicker=class{constructor(e){this.status=Object.assign({code:n.Status.UNAVAILABLE,details:`No connection established`,metadata:new t.Metadata},e)}pick(e){return{pickResultType:r.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}},e.QueuePicker=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:r.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}}})),K=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BackoffTimeout=void 0;var t=C(),n=B(),r=`backoff`,i=1e3,a=1.6,o=12e4,s=.2;function c(e,t){return Math.random()*(t-e)+e}var l=class e{constructor(t,n){this.callback=t,this.initialDelay=i,this.multiplier=a,this.maxDelay=o,this.jitter=s,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=e.getNextId(),n&&(n.initialDelay&&(this.initialDelay=n.initialDelay),n.multiplier&&(this.multiplier=n.multiplier),n.jitter&&(this.jitter=n.jitter),n.maxDelay&&(this.maxDelay=n.maxDelay)),this.trace(`constructed initialDelay=`+this.initialDelay+` multiplier=`+this.multiplier+` jitter=`+this.jitter+` maxDelay=`+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(e){n.trace(t.LogVerbosity.DEBUG,r,`{`+this.id+`} `+e)}runTimer(e){var t,n;this.trace(`runTimer(delay=`+e+`)`),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace(`timer fired`),this.running=!1,this.callback()},e),this.hasRef||(n=(t=this.timerId).unref)==null||n.call(t)}runOnce(){this.trace(`runOnce()`),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+c(-t,t)}stop(){this.trace(`stop()`),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace(`reset() running=`+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,(t=(e=this.timerId).ref)==null||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)==null||t.call(e)}getEndTime(){return this.endTime}};e.BackoffTimeout=l,l.nextId=0})),le=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ChildLoadBalancerHandler=void 0;var t=se(),n=W(),r=`child_load_balancer_helper`;e.ChildLoadBalancerHandler=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(e){this.parent=e,this.child=null}createSubchannel(e,t){return this.parent.channelControlHelper.createSubchannel(e,t)}updateState(e,t,r){var i;if(this.calledByPendingChild()){if(e===n.ConnectivityState.CONNECTING)return;(i=this.parent.currentChild)==null||i.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(e,t,r)}requestReresolution(){let e=this.parent.pendingChild??this.parent.currentChild;this.child===e&&this.parent.channelControlHelper.requestReresolution()}setChild(e){this.child=e}addChannelzChild(e){this.parent.channelControlHelper.addChannelzChild(e)}removeChannelzChild(e){this.parent.channelControlHelper.removeChannelzChild(e)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,n,r,i){let a;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,n)){let e=new this.ChildPolicyHelper(this),r=(0,t.createLoadBalancer)(n,e);e.setChild(r),this.currentChild===null?(this.currentChild=r,a=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=r,a=this.pendingChild)}else a=this.pendingChild===null?this.currentChild:this.pendingChild;return this.latestConfig=n,a.updateAddressList(e,n,r,i)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return r}}})),ue=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ResolvingLoadBalancer=void 0;var t=se(),n=ce(),r=W(),i=U(),a=G(),o=K(),s=C(),c=V(),l=B(),u=C(),d=H(),f=le(),p=`resolving_load_balancer`;function m(e){l.trace(u.LogVerbosity.DEBUG,p,e)}var h=[`SERVICE_AND_METHOD`,`SERVICE`,`EMPTY`];function g(e,t,n,r){for(let i of n.name)switch(r){case`EMPTY`:if(!i.service&&!i.method)return!0;break;case`SERVICE`:if(i.service===e&&!i.method)return!0;break;case`SERVICE_AND_METHOD`:if(i.service===e&&i.method===t)return!0}return!1}function _(e,t,n,r){for(let i of n)if(g(e,t,i,r))return i;return null}function v(e){return{invoke(t,n){let r=t.split(`/`).filter(e=>e.length>0),i=r[0]??``,a=r[1]??``;if(e&&e.methodConfig)for(let t of h){let n=_(i,a,e.methodConfig,t);if(n)return{methodConfig:n,pickInformation:{},status:s.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:s.Status.OK,dynamicFilterFactories:[]}},unref(){}}}e.ResolvingLoadBalancer=class{constructor(e,t,s,c,l){this.target=e,this.channelControlHelper=t,this.channelOptions=s,this.onSuccessfulResolution=c,this.onFailedResolution=l,this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new a.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,s[`grpc.service_config`]?this.defaultServiceConfig=(0,n.validateServiceConfig)(JSON.parse(s[`grpc.service_config`])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(r.ConnectivityState.IDLE,new a.QueuePicker(this),null),this.childLoadBalancer=new f.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:()=>{this.backoffTimeout.isRunning()?(m(`requestReresolution delayed by backoff timer until `+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(e,t,n)=>{this.latestChildState=e,this.latestChildPicker=t,this.latestChildErrorMessage=n,this.updateState(e,t,n)},addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)}),this.innerResolver=(0,i.createResolver)(e,this.handleResolverResult.bind(this),s);let u={initialDelay:s[`grpc.initial_reconnect_backoff_ms`],maxDelay:s[`grpc.max_reconnect_backoff_ms`]};this.backoffTimeout=new o.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},u),this.backoffTimeout.unref()}handleResolverResult(e,n,r,a){this.backoffTimeout.stop(),this.backoffTimeout.reset();let o=!0,l=null;if(r===null?l=this.defaultServiceConfig:r.ok?l=r.value:this.previousServiceConfig===null?(o=!1,this.handleResolutionFailure(r.error)):l=this.previousServiceConfig,l!==null){let r=l?.loadBalancingConfig??[],i=(0,t.selectLbConfigFromList)(r,!0);i===null?(o=!1,this.handleResolutionFailure({code:s.Status.UNAVAILABLE,details:`All load balancer options in service config are not compatible`,metadata:new c.Metadata})):o=this.childLoadBalancer.updateAddressList(e,i,Object.assign(Object.assign({},this.channelOptions),n),a)}return o&&this.onSuccessfulResolution(l,n[i.CHANNEL_ARGS_CONFIG_SELECTOR_KEY]??v(l)),o}updateResolution(){this.innerResolver.updateResolution(),this.currentState===r.ConnectivityState.IDLE&&this.updateState(r.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,n){m((0,d.uriToString)(this.target)+` `+r.ConnectivityState[this.currentState]+` -> `+r.ConnectivityState[e]),e===r.ConnectivityState.IDLE&&(t=new a.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,n)}handleResolutionFailure(e){this.latestChildState===r.ConnectivityState.IDLE&&(this.updateState(r.ConnectivityState.TRANSIENT_FAILURE,new a.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===r.ConnectivityState.IDLE||this.currentState===r.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw Error(`updateAddressList not supported on ResolvingLoadBalancer`)}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new a.QueuePicker(this),this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return`resolving_load_balancer`}}})),de=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.recognizedOptions=void 0,e.channelOptionsEqual=t,e.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0,"grpc.server_call_metric_recording":!0};function t(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1)if(n[i]!==r[i]||e[n[i]]!==t[r[i]])return!1;return!0}})),q=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EndpointMap=void 0,e.isTcpSubchannelAddress=r,e.subchannelAddressEqual=i,e.subchannelAddressToString=a,e.stringToSubchannelAddress=s,e.endpointEqual=c,e.endpointToString=l,e.endpointHasAddress=u;var n=t(`net`);function r(e){return`port`in e}function i(e,t){return!e&&!t?!0:!e||!t?!1:r(e)?r(t)&&e.host===t.host&&e.port===t.port:!r(t)&&e.path===t.path}function a(e){return r(e)?(0,n.isIPv6)(e.host)?`[`+e.host+`]:`+e.port:e.host+`:`+e.port:e.path}var o=443;function s(e,t){return(0,n.isIP)(e)?{host:e,port:t??o}:{path:e}}function c(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(let n=0;n<e.addresses.length;n++)if(!i(e.addresses[n],t.addresses[n]))return!1;return!0}function l(e){return`[`+e.addresses.map(a).join(`, `)+`]`}function u(e,t){for(let n of e.addresses)if(i(n,t))return!0;return!1}function d(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(let n of e.addresses){let e=!1;for(let r of t.addresses)if(i(n,r)){e=!0;break}if(!e)return!1}return!0}e.EndpointMap=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(u(t.key,e))return t.value}deleteMissing(e){let t=[];for(let n of this.map){let r=!1;for(let t of e)d(t,n.key)&&(r=!0);r||(t.push(n.value),this.map.delete(n))}return t}get(e){for(let t of this.map)if(d(e,t.key))return t.value}set(e,t){for(let n of this.map)if(d(e,n.key)){n.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(d(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(d(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}}})),fe=r({OrderedMap:()=>ye});function J(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);me(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function pe(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function Y(){throw RangeError(`Iterator access denied!`)}var me,he,ge,_e,ve,X,Z,ye,be=n((()=>{me=function(e,t){return me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},me(e,t)},he=function(){function e(e,t,n){n===void 0&&(n=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=n}return e.prototype.v=function(){var e=this,t=e.h.h===e;if(t&&e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var n=e.h;n.t===e;)e=n,n=e.h;e=n}return e},e.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var t=e.h;t.i===e;)e=t,t=e.h;return e.i===t?e:t}},e.prototype.T=function(){var e=this.h,t=this.i,n=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=n,n&&(n.h=this),t},e.prototype.I=function(){var e=this.h,t=this.t,n=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=n,n&&(n.h=this),t},e}(),ge=function(e){J(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.O=1,t}return t.prototype.T=function(){var t=e.prototype.T.call(this);return this.M(),t.M(),t},t.prototype.I=function(){var t=e.prototype.I.call(this);return this.M(),t.M(),t},t.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},t}(he),_e=function(){function e(e){e===void 0&&(e=0),this.iteratorType=e}return e.prototype.equals=function(e){return this.C===e.C},e}(),ve=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(function(){function e(){this._=0}return Object.defineProperty(e.prototype,`length`,{get:function(){return this._},enumerable:!1,configurable:!0}),e.prototype.size=function(){return this._},e.prototype.empty=function(){return this._===0},e}()),X=function(e){J(t,e);function t(t,n){t===void 0&&(t=function(e,t){return e<t?-1:+(e>t)}),n===void 0&&(n=!1);var r=e.call(this)||this;return r.N=void 0,r.g=t,r.enableIndex=n,r.S=n?ge:he,r.A=new r.S,r}return t.prototype.m=function(e,t){for(var n=this.A;e;){var r=this.g(e.u,t);if(r<0)e=e.i;else if(r>0)n=e,e=e.t;else return e}return n},t.prototype.B=function(e,t){for(var n=this.A;e;)this.g(e.u,t)<=0?e=e.i:(n=e,e=e.t);return n},t.prototype.j=function(e,t){for(var n=this.A;e;){var r=this.g(e.u,t);if(r<0)n=e,e=e.i;else if(r>0)e=e.t;else return e}return n},t.prototype.k=function(e,t){for(var n=this.A;e;)this.g(e.u,t)<0?(n=e,e=e.i):e=e.t;return n},t.prototype.R=function(e){for(;;){var t=e.h;if(t===this.A)return;if(e.l===1){e.l=0;return}if(e===t.t){var n=t.i;if(n.l===1)n.l=0,t.l=1,t===this.N?this.N=t.T():t.T();else if(n.i&&n.i.l===1){n.l=t.l,t.l=0,n.i.l=0,t===this.N?this.N=t.T():t.T();return}else n.t&&n.t.l===1?(n.l=1,n.t.l=0,n.I()):(n.l=1,e=t)}else{var n=t.t;if(n.l===1)n.l=0,t.l=1,t===this.N?this.N=t.I():t.I();else if(n.t&&n.t.l===1){n.l=t.l,t.l=0,n.t.l=0,t===this.N?this.N=t.I():t.I();return}else n.i&&n.i.l===1?(n.l=1,n.i.l=0,n.T()):(n.l=1,e=t)}}},t.prototype.G=function(e){if(this._===1){this.clear();return}for(var t=e;t.t||t.i;){if(t.i)for(t=t.i;t.t;)t=t.t;else t=t.t;var n=e.u;e.u=t.u,t.u=n;var r=e.o;e.o=t.o,t.o=r,e=t}this.A.t===t?this.A.t=t.h:this.A.i===t&&(this.A.i=t.h),this.R(t);var i=t.h;if(t===i.t?i.t=void 0:i.i=void 0,--this._,this.N.l=0,this.enableIndex)for(;i!==this.A;)--i.O,i=i.h},t.prototype.P=function(e){for(var t=typeof e==`number`?e:void 0,n=typeof e==`function`?e:void 0,r=e===void 0?[]:void 0,i=0,a=this.N,o=[];o.length||a;)if(a)o.push(a),a=a.t;else{if(a=o.pop(),i===t)return a;r&&r.push(a),n&&n(a,i,this),i+=1,a=a.i}return r},t.prototype.q=function(e){for(;;){var t=e.h;if(t.l===0)return;var n=t.h;if(t===n.t){var r=n.i;if(r&&r.l===1){if(r.l=t.l=0,n===this.N)return;n.l=1,e=n;continue}else if(e===t.i){if(e.l=0,e.t&&(e.t.h=t),e.i&&(e.i.h=n),t.i=e.t,n.t=e.i,e.t=t,e.i=n,n===this.N)this.N=e,this.A.h=e;else{var i=n.h;i.t===n?i.t=e:i.i=e}e.h=n.h,t.h=e,n.h=e,n.l=1}else{t.l=0,n===this.N?this.N=n.I():n.I(),n.l=1;return}}else{var r=n.t;if(r&&r.l===1){if(r.l=t.l=0,n===this.N)return;n.l=1,e=n;continue}else if(e===t.t){if(e.l=0,e.t&&(e.t.h=n),e.i&&(e.i.h=t),n.i=e.t,t.t=e.i,e.t=n,e.i=t,n===this.N)this.N=e,this.A.h=e;else{var i=n.h;i.t===n?i.t=e:i.i=e}e.h=n.h,t.h=e,n.h=e,n.l=1}else{t.l=0,n===this.N?this.N=n.T():n.T(),n.l=1;return}}this.enableIndex&&(t.M(),n.M(),e.M());return}},t.prototype.D=function(e,t,n){if(this.N===void 0)return this._+=1,this.N=new this.S(e,t,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var r,i=this.A.t,a=this.g(i.u,e);if(a===0)return i.o=t,this._;if(a>0)i.t=new this.S(e,t),i.t.h=i,r=i.t,this.A.t=r;else{var o=this.A.i,s=this.g(o.u,e);if(s===0)return o.o=t,this._;if(s<0)o.i=new this.S(e,t),o.i.h=o,r=o.i,this.A.i=r;else{if(n!==void 0){var c=n.C;if(c!==this.A){var l=this.g(c.u,e);if(l===0)return c.o=t,this._;if(l>0){var u=c.v(),d=this.g(u.u,e);if(d===0)return u.o=t,this._;d<0&&(r=new this.S(e,t),u.i===void 0?(u.i=r,r.h=u):(c.t=r,r.h=c))}}}if(r===void 0)for(r=this.N;;){var f=this.g(r.u,e);if(f>0){if(r.t===void 0){r.t=new this.S(e,t),r.t.h=r,r=r.t;break}r=r.t}else if(f<0){if(r.i===void 0){r.i=new this.S(e,t),r.i.h=r,r=r.i;break}r=r.i}else return r.o=t,this._}}}if(this.enableIndex)for(var p=r.h;p!==this.A;)p.O+=1,p=p.h;return this.q(r),this._+=1,this._},t.prototype.F=function(e,t){for(;e;){var n=this.g(e.u,t);if(n<0)e=e.i;else if(n>0)e=e.t;else return e}return e||this.A},t.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},t.prototype.updateKeyByIterator=function(e,t){var n=e.C;if(n===this.A&&Y(),this._===1)return n.u=t,!0;var r=n.p().u;if(n===this.A.t)return this.g(r,t)>0?(n.u=t,!0):!1;var i=n.v().u;return n===this.A.i?this.g(i,t)<0?(n.u=t,!0):!1:this.g(i,t)>=0||this.g(r,t)<=0?!1:(n.u=t,!0)},t.prototype.eraseElementByPos=function(e){if(e<0||e>this._-1)throw RangeError();var t=this.P(e);return this.G(t),this._},t.prototype.eraseElementByKey=function(e){if(this._===0)return!1;var t=this.F(this.N,e);return t===this.A?!1:(this.G(t),!0)},t.prototype.eraseElementByIterator=function(e){var t=e.C;t===this.A&&Y();var n=t.i===void 0;return e.iteratorType===0?n&&e.next():(!n||t.t===void 0)&&e.next(),this.G(t),e},t.prototype.getHeight=function(){if(this._===0)return 0;function e(t){return t?Math.max(e(t.t),e(t.i))+1:0}return e(this.N)},t}(ve),Z=function(e){J(t,e);function t(t,n,r,i){var a=e.call(this,t,n,i)||this;return a.container=r,a}return Object.defineProperty(t.prototype,`pointer`,{get:function(){this.C===this.A&&Y();var e=this;return new Proxy([],{get:function(t,n){return n===`0`?e.C.u:n===`1`?e.C.o:(t[0]=e.C.u,t[1]=e.C.o,t[n])},set:function(t,n,r){if(n!==`1`)throw TypeError(`prop must be 1`);return e.C.o=r,!0}})},enumerable:!1,configurable:!0}),t.prototype.copy=function(){return new t(this.C,this.A,this.container,this.iteratorType)},t}(function(e){J(t,e);function t(t,n,r){var i=e.call(this,r)||this;return i.C=t,i.A=n,i.iteratorType===0?(i.pre=function(){return this.C===this.A.t&&Y(),this.C=this.C.v(),this},i.next=function(){return this.C===this.A&&Y(),this.C=this.C.p(),this}):(i.pre=function(){return this.C===this.A.i&&Y(),this.C=this.C.p(),this},i.next=function(){return this.C===this.A&&Y(),this.C=this.C.v(),this}),i}return Object.defineProperty(t.prototype,`index`,{get:function(){var e=this.C,t=this.A.h;if(e===this.A)return t?t.O-1:0;var n=0;for(e.t&&(n+=e.t.O);e!==t;){var r=e.h;e===r.i&&(n+=1,r.t&&(n+=r.t.O)),e=r}return n},enumerable:!1,configurable:!0}),t.prototype.isAccessible=function(){return this.C!==this.A},t}(_e)),ye=function(e){J(t,e);function t(t,n,r){t===void 0&&(t=[]);var i=e.call(this,n,r)||this,a=i;return t.forEach((function(e){a.setElement(e[0],e[1])})),i}return t.prototype.begin=function(){return new Z(this.A.t||this.A,this.A,this)},t.prototype.end=function(){return new Z(this.A,this.A,this)},t.prototype.rBegin=function(){return new Z(this.A.i||this.A,this.A,this,1)},t.prototype.rEnd=function(){return new Z(this.A,this.A,this,1)},t.prototype.front=function(){if(this._!==0){var e=this.A.t;return[e.u,e.o]}},t.prototype.back=function(){if(this._!==0){var e=this.A.i;return[e.u,e.o]}},t.prototype.lowerBound=function(e){return new Z(this.m(this.N,e),this.A,this)},t.prototype.upperBound=function(e){return new Z(this.B(this.N,e),this.A,this)},t.prototype.reverseLowerBound=function(e){return new Z(this.j(this.N,e),this.A,this)},t.prototype.reverseUpperBound=function(e){return new Z(this.k(this.N,e),this.A,this)},t.prototype.forEach=function(e){this.P((function(t,n,r){e([t.u,t.o],n,r)}))},t.prototype.setElement=function(e,t,n){return this.D(e,t,n)},t.prototype.getElementByPos=function(e){if(e<0||e>this._-1)throw RangeError();var t=this.P(e);return[t.u,t.o]},t.prototype.find=function(e){return new Z(this.F(this.N,e),this.A,this)},t.prototype.getElementByKey=function(e){return this.F(this.N,e).o},t.prototype.union=function(e){var t=this;return e.forEach((function(e){t.setElement(e[0],e[1])})),this._},t.prototype[Symbol.iterator]=function(){var e,t,n,r;return pe(this,(function(i){switch(i.label){case 0:e=this._,t=this.P(),n=0,i.label=1;case 1:return n<e?(r=t[n],[4,[r.u,r.o]]):[3,4];case 2:i.sent(),i.label=3;case 3:return++n,[3,1];case 4:return[2]}}))},t}(X)})),xe=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.registerAdminService=n,e.addAdminServicesToServer=r;var t=[];function n(e,n){t.push({getServiceDefinition:e,getHandlers:n})}function r(e){for(let{getServiceDefinition:n,getHandlers:r}of t)e.addService(n(),r())}})),Se=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ClientDuplexStreamImpl=e.ClientWritableStreamImpl=e.ClientReadableStreamImpl=e.ClientUnaryCallImpl=void 0,e.callErrorFromStatus=a;var n=t(`events`),r=t(`stream`),i=C();function a(e,t){let n=`${e.code} ${i.Status[e.code]}: ${e.details}`,r=`${Error(n).stack}\nfor call at\n${t}`;return Object.assign(Error(n),e,{stack:r})}e.ClientUnaryCallImpl=class extends n.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)==null||e.cancelWithStatus(i.Status.CANCELLED,`Cancelled on client`)}getPeer(){return this.call?.getPeer()??`unknown`}getAuthContext(){return this.call?.getAuthContext()??null}},e.ClientReadableStreamImpl=class extends r.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)==null||e.cancelWithStatus(i.Status.CANCELLED,`Cancelled on client`)}getPeer(){return this.call?.getPeer()??`unknown`}getAuthContext(){return this.call?.getAuthContext()??null}_read(e){var t;(t=this.call)==null||t.startRead()}},e.ClientWritableStreamImpl=class extends r.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)==null||e.cancelWithStatus(i.Status.CANCELLED,`Cancelled on client`)}getPeer(){return this.call?.getPeer()??`unknown`}getAuthContext(){return this.call?.getAuthContext()??null}_write(e,t,n){var r;let i={callback:n},a=Number(t);Number.isNaN(a)||(i.flags=a),(r=this.call)==null||r.sendMessageWithContext(i,e)}_final(e){var t;(t=this.call)==null||t.halfClose(),e()}},e.ClientDuplexStreamImpl=class extends r.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;(e=this.call)==null||e.cancelWithStatus(i.Status.CANCELLED,`Cancelled on client`)}getPeer(){return this.call?.getPeer()??`unknown`}getAuthContext(){return this.call?.getAuthContext()??null}_read(e){var t;(t=this.call)==null||t.startRead()}_write(e,t,n){var r;let i={callback:n},a=Number(t);Number.isNaN(a)||(i.flags=a),(r=this.call)==null||r.sendMessageWithContext(i,e)}_final(e){var t;(t=this.call)==null||t.halfClose(),e()}}})),Ce=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InterceptingListenerImpl=void 0,e.statusOrFromValue=n,e.statusOrFromError=r,e.isInterceptingListener=i;var t=V();function n(e){return{ok:!0,value:e}}function r(e){return{ok:!1,error:Object.assign(Object.assign({},e),{metadata:e.metadata??new t.Metadata})}}function i(e){return e.onReceiveMetadata!==void 0&&e.onReceiveMetadata.length===1}e.InterceptingListenerImpl=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,e=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(e),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,e=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=e,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(e),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,e=>{this.processingMetadata||this.processingMessage?this.pendingStatus=e:this.nextListener.onReceiveStatus(e)})}}})),we=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InterceptingCall=e.RequesterBuilder=e.ListenerBuilder=e.InterceptorConfigurationError=void 0,e.getInterceptingCall=p;var t=V(),n=Ce(),r=C(),i=re(),a=class e extends Error{constructor(t){super(t),this.name=`InterceptorConfigurationError`,Error.captureStackTrace(this,e)}};e.InterceptorConfigurationError=a,e.ListenerBuilder=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}},e.RequesterBuilder=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};var o={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveStatus:(e,t)=>{t(e)}},s={start:(e,t,n)=>{n(e,t)},sendMessage:(e,t)=>{t(e)},halfClose:e=>{e()},cancel:e=>{e()}};e.InterceptingCall=class{constructor(e,t){this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,t?this.requester={start:t.start??s.start,sendMessage:t.sendMessage??s.sendMessage,halfClose:t.halfClose??s.halfClose,cancel:t.cancel??s.cancel}:this.requester=s}cancelWithStatus(e,t){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,t){let r={onReceiveMetadata:(t?.onReceiveMetadata)?.bind(t)??(e=>{}),onReceiveMessage:(t?.onReceiveMessage)?.bind(t)??(e=>{}),onReceiveStatus:(t?.onReceiveStatus)?.bind(t)??(e=>{})};this.processingMetadata=!0,this.requester.start(e,r,(e,t)=>{this.processingMetadata=!1;let i;if((0,n.isInterceptingListener)(t))i=t;else{let e={onReceiveMetadata:t.onReceiveMetadata??o.onReceiveMetadata,onReceiveMessage:t.onReceiveMessage??o.onReceiveMessage,onReceiveStatus:t.onReceiveStatus??o.onReceiveStatus};i=new n.InterceptingListenerImpl(e,r)}this.nextCall.start(e,i),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,n),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}getAuthContext(){return this.nextCall.getAuthContext()}};function c(e,t,n){let r=n.deadline??1/0,i=n.host,a=n.parent??null,o=n.propagate_flags,s=n.credentials,c=e.createCall(t,r,i,a,o);return s&&c.setCredentials(s),c}var l=class{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let n;try{n=this.methodDefinition.requestSerialize(t)}catch(e){this.call.cancelWithStatus(r.Status.INTERNAL,`Request message serialization failure: ${(0,i.getErrorMessage)(e)}`);return}this.call.sendMessageWithContext(e,n)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,n){let a=null;this.call.start(e,{onReceiveMetadata:e=>{var t;(t=n?.onReceiveMetadata)==null||t.call(n,e)},onReceiveMessage:e=>{var o;let s;try{s=this.methodDefinition.responseDeserialize(e)}catch(e){a={code:r.Status.INTERNAL,details:`Response message parsing error: ${(0,i.getErrorMessage)(e)}`,metadata:new t.Metadata},this.call.cancelWithStatus(a.code,a.details);return}(o=n?.onReceiveMessage)==null||o.call(n,s)},onReceiveStatus:e=>{var t,r;a?(t=n?.onReceiveStatus)==null||t.call(n,a):(r=n?.onReceiveStatus)==null||r.call(n,e)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}},u=class extends l{constructor(e,t){super(e,t)}start(e,t){let n=!1,r={onReceiveMetadata:(t?.onReceiveMetadata)?.bind(t)??(e=>{}),onReceiveMessage:e=>{var r;n=!0,(r=t?.onReceiveMessage)==null||r.call(t,e)},onReceiveStatus:e=>{var r,i;n||(r=t?.onReceiveMessage)==null||r.call(t,null),(i=t?.onReceiveStatus)==null||i.call(t,e)}};super.start(e,r),this.call.startRead()}},d=class extends l{};function f(e,t,n){let r=c(e,n.path,t);return n.responseStream?new d(r,n):new u(r,n)}function p(e,t,n,r){if(e.clientInterceptors.length>0&&e.clientInterceptorProviders.length>0)throw new a(`Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.`);if(e.callInterceptors.length>0&&e.callInterceptorProviders.length>0)throw new a(`Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.`);let i=[];i=e.callInterceptors.length>0||e.callInterceptorProviders.length>0?[].concat(e.callInterceptors,e.callInterceptorProviders.map(e=>e(t))).filter(e=>e):[].concat(e.clientInterceptors,e.clientInterceptorProviders.map(e=>e(t))).filter(e=>e);let o=Object.assign({},n,{method_definition:t});return i.reduceRight((e,t)=>n=>t(n,e),e=>f(r,e,t))(o)}})),Te=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Client=void 0;var t=Se(),n=Zt(),r=W(),i=C(),a=V(),o=we(),s=Symbol(),c=Symbol(),l=Symbol(),u=Symbol();function d(e){return typeof e==`function`}function f(e){return e.stack?.split(`
2
+ `).slice(1).join(`
3
+ `)||`no stack trace available`}e.Client=class{constructor(e,t,r={}){if(r=Object.assign({},r),this[c]=r.interceptors??[],delete r.interceptors,this[l]=r.interceptor_providers??[],delete r.interceptor_providers,this[c].length>0&&this[l].length>0)throw Error(`Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.`);if(this[u]=r.callInvocationTransformer,delete r.callInvocationTransformer,r.channelOverride)this[s]=r.channelOverride;else if(r.channelFactoryOverride){let n=r.channelFactoryOverride;delete r.channelFactoryOverride,this[s]=n(e,t,r)}else this[s]=new n.ChannelImplementation(e,t,r)}close(){this[s].close()}getChannel(){return this[s]}waitForReady(e,t){let n=i=>{if(i){t(Error(`Failed to connect before the deadline`));return}let a;try{a=this[s].getConnectivityState(!0)}catch{t(Error(`The channel has been closed`));return}if(a===r.ConnectivityState.READY)t();else try{this[s].watchConnectivityState(a,e,n)}catch{t(Error(`The channel has been closed`))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,t,n){if(d(e))return{metadata:new a.Metadata,options:{},callback:e};if(d(t))return e instanceof a.Metadata?{metadata:e,options:{},callback:t}:{metadata:new a.Metadata,options:e,callback:t};if(!(e instanceof a.Metadata&&t instanceof Object&&d(n)))throw Error(`Incorrect arguments passed`);return{metadata:e,options:t,callback:n}}makeUnaryRequest(e,n,r,a,d,p,m){let h=this.checkOptionalUnaryResponseArguments(d,p,m),g={path:e,requestStream:!1,responseStream:!1,requestSerialize:n,responseDeserialize:r},_={argument:a,metadata:h.metadata,call:new t.ClientUnaryCallImpl,channel:this[s],methodDefinition:g,callOptions:h.options,callback:h.callback};this[u]&&(_=this[u](_));let v=_.call,y={clientInterceptors:this[c],clientInterceptorProviders:this[l],callInterceptors:_.callOptions.interceptors??[],callInterceptorProviders:_.callOptions.interceptor_providers??[]},b=(0,o.getInterceptingCall)(y,_.methodDefinition,_.callOptions,_.channel);v.call=b;let x=null,S=!1,C=Error();return b.start(_.metadata,{onReceiveMetadata:e=>{v.emit(`metadata`,e)},onReceiveMessage(e){x!==null&&b.cancelWithStatus(i.Status.UNIMPLEMENTED,`Too many responses received`),x=e},onReceiveStatus(e){if(!S){if(S=!0,e.code===i.Status.OK)if(x===null){let n=f(C);_.callback((0,t.callErrorFromStatus)({code:i.Status.UNIMPLEMENTED,details:`No message received`,metadata:e.metadata},n))}else _.callback(null,x);else{let n=f(C);_.callback((0,t.callErrorFromStatus)(e,n))}C=null,v.emit(`status`,e)}}}),b.sendMessage(a),b.halfClose(),v}makeClientStreamRequest(e,n,r,a,d,p){let m=this.checkOptionalUnaryResponseArguments(a,d,p),h={path:e,requestStream:!0,responseStream:!1,requestSerialize:n,responseDeserialize:r},g={metadata:m.metadata,call:new t.ClientWritableStreamImpl(n),channel:this[s],methodDefinition:h,callOptions:m.options,callback:m.callback};this[u]&&(g=this[u](g));let _=g.call,v={clientInterceptors:this[c],clientInterceptorProviders:this[l],callInterceptors:g.callOptions.interceptors??[],callInterceptorProviders:g.callOptions.interceptor_providers??[]},y=(0,o.getInterceptingCall)(v,g.methodDefinition,g.callOptions,g.channel);_.call=y;let b=null,x=!1,S=Error();return y.start(g.metadata,{onReceiveMetadata:e=>{_.emit(`metadata`,e)},onReceiveMessage(e){b!==null&&y.cancelWithStatus(i.Status.UNIMPLEMENTED,`Too many responses received`),b=e,y.startRead()},onReceiveStatus(e){if(!x){if(x=!0,e.code===i.Status.OK)if(b===null){let n=f(S);g.callback((0,t.callErrorFromStatus)({code:i.Status.UNIMPLEMENTED,details:`No message received`,metadata:e.metadata},n))}else g.callback(null,b);else{let n=f(S);g.callback((0,t.callErrorFromStatus)(e,n))}S=null,_.emit(`status`,e)}}}),_}checkMetadataAndOptions(e,t){let n,r;return e instanceof a.Metadata?(n=e,r=t||{}):(r=e||{},n=new a.Metadata),{metadata:n,options:r}}makeServerStreamRequest(e,n,r,a,d,p){let m=this.checkMetadataAndOptions(d,p),h={path:e,requestStream:!1,responseStream:!0,requestSerialize:n,responseDeserialize:r},g={argument:a,metadata:m.metadata,call:new t.ClientReadableStreamImpl(r),channel:this[s],methodDefinition:h,callOptions:m.options};this[u]&&(g=this[u](g));let _=g.call,v={clientInterceptors:this[c],clientInterceptorProviders:this[l],callInterceptors:g.callOptions.interceptors??[],callInterceptorProviders:g.callOptions.interceptor_providers??[]},y=(0,o.getInterceptingCall)(v,g.methodDefinition,g.callOptions,g.channel);_.call=y;let b=!1,x=Error();return y.start(g.metadata,{onReceiveMetadata(e){_.emit(`metadata`,e)},onReceiveMessage(e){_.push(e)},onReceiveStatus(e){if(!b){if(b=!0,_.push(null),e.code!==i.Status.OK){let n=f(x);_.emit(`error`,(0,t.callErrorFromStatus)(e,n))}x=null,_.emit(`status`,e)}}}),y.sendMessage(a),y.halfClose(),_}makeBidiStreamRequest(e,n,r,a,d){let p=this.checkMetadataAndOptions(a,d),m={path:e,requestStream:!0,responseStream:!0,requestSerialize:n,responseDeserialize:r},h={metadata:p.metadata,call:new t.ClientDuplexStreamImpl(n,r),channel:this[s],methodDefinition:m,callOptions:p.options};this[u]&&(h=this[u](h));let g=h.call,_={clientInterceptors:this[c],clientInterceptorProviders:this[l],callInterceptors:h.callOptions.interceptors??[],callInterceptorProviders:h.callOptions.interceptor_providers??[]},v=(0,o.getInterceptingCall)(_,h.methodDefinition,h.callOptions,h.channel);g.call=v;let y=!1,b=Error();return v.start(h.metadata,{onReceiveMetadata(e){g.emit(`metadata`,e)},onReceiveMessage(e){g.push(e)},onReceiveStatus(e){if(!y){if(y=!0,g.push(null),e.code!==i.Status.OK){let n=f(b);g.emit(`error`,(0,t.callErrorFromStatus)(e,n))}b=null,g.emit(`status`,e)}}}),g}}})),Ee=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.makeClientConstructor=i,e.loadPackageDefinition=s;var t=Te(),n={unary:t.Client.prototype.makeUnaryRequest,server_stream:t.Client.prototype.makeServerStreamRequest,client_stream:t.Client.prototype.makeClientStreamRequest,bidi:t.Client.prototype.makeBidiStreamRequest};function r(e){return[`__proto__`,`prototype`,`constructor`].includes(e)}function i(e,i,o){o||(o={});class s extends t.Client{}return Object.keys(e).forEach(t=>{if(r(t))return;let i=e[t],o;if(typeof t==`string`&&t.charAt(0)===`$`)throw Error(`Method names cannot start with $`);o=i.requestStream?i.responseStream?`bidi`:`client_stream`:i.responseStream?`server_stream`:`unary`;let c=i.requestSerialize,l=i.responseDeserialize,u=a(n[o],i.path,c,l);s.prototype[t]=u,Object.assign(s.prototype[t],i),i.originalName&&!r(i.originalName)&&(s.prototype[i.originalName]=s.prototype[t])}),s.service=e,s.serviceName=i,s}function a(e,t,n,r){return function(...i){return e.call(this,t,n,r,...i)}}function o(e){return`format`in e}function s(e){let t={};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let a=e[n],s=n.split(`.`);if(s.some(e=>r(e)))continue;let c=s[s.length-1],l=t;for(let e of s.slice(0,-1))l[e]||(l[e]={}),l=l[e];o(a)?l[c]=a:l[c]=i(a,c,{})}return t}})),De=i(((e,t)=>{var n=1/0,r=`[object Symbol]`,i=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=`\\ud800-\\udfff`,s=`\\u0300-\\u036f\\ufe20-\\ufe23`,c=`\\u20d0-\\u20f0`,l=`\\u2700-\\u27bf`,u=`a-z\\xdf-\\xf6\\xf8-\\xff`,d=`\\xac\\xb1\\xd7\\xf7`,f=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,p=`\\u2000-\\u206f`,m=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,h=`A-Z\\xc0-\\xd6\\xd8-\\xde`,g=`\\ufe0e\\ufe0f`,_=d+f+p+m,v=`['’]`,y=`[`+o+`]`,b=`[`+_+`]`,x=`[`+s+c+`]`,S=`\\d+`,C=`[`+l+`]`,w=`[`+u+`]`,T=`[^`+o+_+S+l+u+h+`]`,E=`\\ud83c[\\udffb-\\udfff]`,D=`(?:`+x+`|`+E+`)`,O=`[^`+o+`]`,k=`(?:\\ud83c[\\udde6-\\uddff]){2}`,A=`[\\ud800-\\udbff][\\udc00-\\udfff]`,j=`[`+h+`]`,M=`\\u200d`,N=`(?:`+w+`|`+T+`)`,ee=`(?:`+j+`|`+T+`)`,P=`(?:`+v+`(?:d|ll|m|re|s|t|ve))?`,F=`(?:`+v+`(?:D|LL|M|RE|S|T|VE))?`,I=D+`?`,L=`[`+g+`]?`,te=`(?:`+M+`(?:`+[O,k,A].join(`|`)+`)`+L+I+`)*`,R=L+I+te,ne=`(?:`+[C,k,A].join(`|`)+`)`+R,z=`(?:`+[O+x+`?`,x,k,A,y].join(`|`)+`)`,B=RegExp(v,`g`),re=RegExp(x,`g`),V=RegExp(E+`(?=`+E+`)|`+z+R,`g`),ie=RegExp([j+`?`+w+`+`+P+`(?=`+[b,j,`$`].join(`|`)+`)`,ee+`+`+F+`(?=`+[b,j+N,`$`].join(`|`)+`)`,j+`?`+N+`+`+P,j+`+`+F,S,ne].join(`|`),`g`),ae=RegExp(`[`+M+o+s+c+g+`]`),H=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,U={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`ss`},oe=typeof global==`object`&&global&&global.Object===Object&&global,se=typeof self==`object`&&self&&self.Object===Object&&self,ce=oe||se||Function(`return this`)();function W(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function G(e){return e.split(``)}function K(e){return e.match(i)||[]}function le(e){return function(t){return e?.[t]}}var ue=le(U);function de(e){return ae.test(e)}function q(e){return H.test(e)}function fe(e){return de(e)?J(e):G(e)}function J(e){return e.match(V)||[]}function pe(e){return e.match(ie)||[]}var Y=Object.prototype.toString,me=ce.Symbol,he=me?me.prototype:void 0,ge=he?he.toString:void 0;function _e(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function ve(e){if(typeof e==`string`)return e;if(xe(e))return ge?ge.call(e):``;var t=e+``;return t==`0`&&1/e==-n?`-0`:t}function X(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:_e(e,t,n)}function Z(e){return function(t){t=Se(t);var n=de(t)?fe(t):void 0,r=n?n[0]:t.charAt(0),i=n?X(n,1).join(``):t.slice(1);return r[e]()+i}}function ye(e){return function(t){return W(De(Te(t).replace(B,``)),e,``)}}function be(e){return!!e&&typeof e==`object`}function xe(e){return typeof e==`symbol`||be(e)&&Y.call(e)==r}function Se(e){return e==null?``:ve(e)}var Ce=ye(function(e,t,n){return t=t.toLowerCase(),e+(n?we(t):t)});function we(e){return Ee(Se(e).toLowerCase())}function Te(e){return e=Se(e),e&&e.replace(a,ue).replace(re,``)}var Ee=Z(`toUpperCase`);function De(e,t,n){return e=Se(e),t=n?void 0:t,t===void 0?q(e)?pe(e):K(e):e.match(t)||[]}t.exports=Ce})),Oe=i(((e,t)=>{t.exports=r;var n=ke();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return i;var t=e<0;t&&(e=-e);var n=e>>>0,a=(e-n)/4294967296>>>0;return t&&(a=~a>>>0,n=~n>>>0,++n>4294967295&&(n=0,++a>4294967295&&(a=0))),new r(n,a)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?i:new r((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),ke=i((e=>{var t=e;t.asPromise=_(),t.base64=h(),t.EventEmitter=s(),t.float=l(),t.inquire=u(),t.utf8=f(),t.pool=p(),t.LongBits=Oe(),t.isNode=!!(typeof global<`u`&&global&&global.process&&global.process.versions&&global.process.versions.node),t.global=t.isNode&&global||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.inquire(`buffer`).Buffer;return e.prototype.utf8Write?e:null}catch{return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire(`long`),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)};function n(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)(e[r[i]]===void 0||!n)&&(e[r[i]]=t[r[i]]);return e}t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function r(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,`message`,{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,`stack`,{value:Error().stack||``}),r&&n(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+`: `+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.newError=r,t.ProtocolError=r(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),Ae=i(((e,t)=>{t.exports=u;var n=ke(),r,i=n.LongBits,a=n.base64,o=n.utf8;function s(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new s(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=d(),u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new s(e,t,n),this.len+=t,this};function f(e,t,n){t[n]=e&255}function p(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function m(e,t){this.len=e,this.next=void 0,this.val=t}m.prototype=Object.create(s.prototype),m.prototype.fn=p,u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new m((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return e<0?this._push(h,10,i.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function h(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo>>>=7;t[n++]=e.lo}u.prototype.uint64=function(e){var t=i.from(e);return this._push(h,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(h,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,+!!e)};function g(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var _=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=u.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(_,t,e)},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},u._configure=function(e){r=e,u.create=d(),r._configure()}})),je=i(((e,t)=>{t.exports=i;var n=Ae();(i.prototype=Object.create(n.prototype)).constructor=i;var r=ke();function i(){n.call(this)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this};function a(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},i._configure()})),Me=i(((e,t)=>{t.exports=s;var n=ke(),r,i=n.LongBits,a=n.utf8;function o(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new s(e);throw Error(`illegal buffer`)},l=function(){return n.Buffer?function(e){return(s.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return e}})(),s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function u(){var e=new i(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}s.prototype.bool=function(){return this.uint32()!==0};function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)|0};function f(){if(this.pos+8>this.len)throw o(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw o(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,r);if(t===r){var i=n.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,r)},s.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},s.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},s._configure=function(e){r=e,s.create=l(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(s.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}})),Ne=i(((e,t)=>{t.exports=i;var n=Me();(i.prototype=Object.create(n.prototype)).constructor=i;var r=ke();function i(e){n.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(`utf-8`,this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()})),Pe=i(((e,t)=>{t.exports=r;var n=ke();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError(`request must be specified`);var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(!s.rpcImpl){setTimeout(function(){o(Error(`already ended`))},0);return}try{return s.rpcImpl(t,r[s.requestDelimited?`encodeDelimited`:`encode`](a).finish(),function(e,n){if(e)return s.emit(`error`,e,t),o(e);if(n===null){s.end(!0);return}if(!(n instanceof i))try{n=i[s.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return s.emit(`error`,e,t),o(e)}return s.emit(`data`,n,t),o(null,n)})}catch(e){s.emit(`error`,e,t),setTimeout(function(){o(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),Fe=i((e=>{var t=e;t.Service=Pe()})),Ie=i(((e,t)=>{t.exports={}})),Le=i((e=>{var t=e;t.build=`minimal`,t.Writer=Ae(),t.BufferWriter=je(),t.Reader=Me(),t.BufferReader=Ne(),t.util=ke(),t.rpc=Fe(),t.roots=Ie(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),Re=i(((e,t)=>{t.exports=n;function n(e,t){typeof e==`string`&&(t=e,e=void 0);var r=[];function i(e){if(typeof e!=`string`){var t=a();if(n.verbose&&console.log(`codegen: `+t),t=`return `+t,e){for(var o=Object.keys(e),s=Array(o.length+1),c=Array(o.length),l=0;l<o.length;)s[l]=o[l],c[l]=e[o[l++]];return s[l]=t,Function.apply(null,s).apply(null,c)}return Function(t)()}for(var u=Array(arguments.length-1),d=0;d<u.length;)u[d]=arguments[++d];if(d=0,e=e.replace(/%([%dfijs])/g,function(e,t){var n=u[d++];switch(t){case`d`:case`f`:return String(Number(n));case`i`:return String(Math.floor(n));case`j`:return JSON.stringify(n);case`s`:return String(n)}return`%`}),d!==u.length)throw Error(`parameter count mismatch`);return r.push(e),i}function a(n){return`function `+(n||t||``)+`(`+(e&&e.join(`,`)||``)+`){
4
+ `+r.join(`
5
+ `)+`
6
+ }`}return i.toString=a,i}n.verbose=!1})),ze=i(((e,t)=>{t.exports=i;var n=_(),r=u()(`fs`);function i(e,t,a){return typeof t==`function`?(a=t,t={}):t||(t={}),a?!t.xhr&&r&&r.readFile?r.readFile(e,function(n,r){return n&&typeof XMLHttpRequest<`u`?i.xhr(e,t,a):n?a(n):a(null,t.binary?r:r.toString(`utf8`))}):i.xhr(e,t,a):n(i,this,e,t)}i.xhr=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(r.readyState===4){if(r.status!==0&&r.status!==200)return n(Error(`status `+r.status));if(t.binary){var e=r.response;if(!e){e=[];for(var i=0;i<r.responseText.length;++i)e.push(r.responseText.charCodeAt(i)&255)}return n(null,typeof Uint8Array<`u`?new Uint8Array(e):e)}return n(null,r.responseText)}},t.binary&&(`overrideMimeType`in r&&r.overrideMimeType(`text/plain; charset=x-user-defined`),r.responseType=`arraybuffer`),r.open(`GET`,e),r.send()}})),Be=i((e=>{var t=e,n=t.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},r=t.normalize=function(e){e=e.replace(/\\/g,`/`).replace(/\/{2,}/g,`/`);var t=e.split(`/`),r=n(e),i=``;r&&(i=t.shift()+`/`);for(var a=0;a<t.length;)t[a]===`..`?a>0&&t[a-1]!==`..`?t.splice(--a,2):r?t.splice(a,1):++a:t[a]===`.`?t.splice(a,1):++a;return i+t.join(`/`)};t.resolve=function(e,t,i){return i||(t=r(t)),n(t)?t:(i||(e=r(e)),(e=e.replace(/(?:\/|^)[^/]+$/,``)).length?r(e+`/`+t):t)}})),Ve=i(((e,t)=>{t.exports=u;var n=tt();((u.prototype=Object.create(n.prototype)).constructor=u).className=`Namespace`;var r=$e(),i=Q(),a=et(),o,s,c;u.fromJSON=function(e,t){return new u(e,t.options).addJSON(t.nested)};function l(e,t){if(e&&e.length){for(var n={},r=0;r<e.length;++r)n[e[r].name]=e[r].toJSON(t);return n}}u.arrayToJSON=l,u.isReservedId=function(e,t){if(e){for(var n=0;n<e.length;++n)if(typeof e[n]!=`string`&&e[n][0]<=t&&e[n][1]>t)return!0}return!1},u.isReservedName=function(e,t){if(e){for(var n=0;n<e.length;++n)if(e[n]===t)return!0}return!1};function u(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function d(e){e._nestedArray=null,e._lookupCache={};for(var t=e;t=t.parent;)t._lookupCache={};return e}Object.defineProperty(u.prototype,`nestedArray`,{get:function(){return this._nestedArray||(this._nestedArray=i.toArray(this.nested))}}),u.prototype.toJSON=function(e){return i.toObject([`options`,this.options,`nested`,l(this.nestedArray,e)])},u.prototype.addJSON=function(e){var t=this;if(e)for(var n=Object.keys(e),i=0,a;i<n.length;++i)a=e[n[i]],t.add((a.fields===void 0?a.values===void 0?a.methods===void 0?a.id===void 0?u.fromJSON:r.fromJSON:s.fromJSON:c.fromJSON:o.fromJSON)(n[i],a));return this},u.prototype.get=function(e){return this.nested&&this.nested[e]||null},u.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof c)return this.nested[e].values;throw Error(`no such enum: `+e)},u.prototype.add=function(e){if(!(e instanceof r&&e.extend!==void 0||e instanceof o||e instanceof a||e instanceof c||e instanceof s||e instanceof u))throw TypeError(`object must be a valid nested object`);if(!this.nested)this.nested={};else{var t=this.get(e.name);if(t)if(t instanceof u&&e instanceof u&&!(t instanceof o||t instanceof s)){for(var n=t.nestedArray,i=0;i<n.length;++i)e.add(n[i]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}else throw Error(`duplicate name '`+e.name+`' in `+this)}this.nested[e.name]=e,this instanceof o||this instanceof s||this instanceof c||this instanceof r||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var l=this;l=l.parent;)l._needsRecursiveFeatureResolution=!0,l._needsRecursiveResolve=!0;return e.onAdd(this),d(this)},u.prototype.remove=function(e){if(!(e instanceof n))throw TypeError(`object must be a ReflectionObject`);if(e.parent!==this)throw Error(e+` is not a member of `+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),d(this)},u.prototype.define=function(e,t){if(i.isString(e))e=e.split(`.`);else if(!Array.isArray(e))throw TypeError(`illegal path`);if(e&&e.length&&e[0]===``)throw Error(`path must be relative`);for(var n=this;e.length>0;){var r=e.shift();if(n.nested&&n.nested[r]){if(n=n.nested[r],!(n instanceof u))throw Error(`path conflicts with non-namespace objects`)}else n.add(n=new u(r))}return t&&n.addJSON(t),n},u.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof u?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this},u.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,n.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this},u.prototype.lookup=function(e,t,n){if(typeof t==`boolean`?(n=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),i.isString(e)&&e.length){if(e===`.`)return this.root;e=e.split(`.`)}else if(!e.length)return this;var r=e.join(`.`);if(e[0]===``)return this.root.lookup(e.slice(1),t);var a=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects[`.`+r];if(a&&(!t||t.indexOf(a.constructor)>-1)||(a=this._lookupImpl(e,r),a&&(!t||t.indexOf(a.constructor)>-1)))return a;if(n)return null;for(var o=this;o.parent;){if(a=o.parent._lookupImpl(e,r),a&&(!t||t.indexOf(a.constructor)>-1))return a;o=o.parent}return null},u.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var n=this.get(e[0]),r=null;if(n)e.length===1?r=n:n instanceof u&&(e=e.slice(1),r=n._lookupImpl(e,e.join(`.`)));else for(var i=0;i<this.nestedArray.length;++i)this._nestedArray[i]instanceof u&&(n=this._nestedArray[i]._lookupImpl(e,t))&&(r=n);return this._lookupCache[t]=r,r},u.prototype.lookupType=function(e){var t=this.lookup(e,[o]);if(!t)throw Error(`no such type: `+e);return t},u.prototype.lookupEnum=function(e){var t=this.lookup(e,[c]);if(!t)throw Error(`no such Enum '`+e+`' in `+this);return t},u.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[o,c]);if(!t)throw Error(`no such Type or Enum '`+e+`' in `+this);return t},u.prototype.lookupService=function(e){var t=this.lookup(e,[s]);if(!t)throw Error(`no such Service '`+e+`' in `+this);return t},u._configure=function(e,t,n){o=e,s=t,c=n}})),He=i(((e,t)=>{t.exports=a;var n=$e();((a.prototype=Object.create(n.prototype)).constructor=a).className=`MapField`;var r=Qe(),i=Q();function a(e,t,r,a,o,s){if(n.call(this,e,t,a,void 0,void 0,o,s),!i.isString(r))throw TypeError(`keyType must be a string`);this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return i.toObject([`keyType`,this.keyType,`type`,this.type,`id`,this.id,`extend`,this.extend,`options`,this.options,`comment`,t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(r.mapKey[this.keyType]===void 0)throw Error(`invalid key type: `+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,n){return typeof n==`function`?n=i.decorateType(n).name:n&&typeof n==`object`&&(n=i.decorateEnum(n).name),function(r,o){i.decorateType(r.constructor).add(new a(o,e,t,n))}}})),Ue=i(((e,t)=>{t.exports=i;var n=tt();((i.prototype=Object.create(n.prototype)).constructor=i).className=`Method`;var r=Q();function i(e,t,i,a,o,s,c,l,u){if(r.isObject(o)?(c=o,o=s=void 0):r.isObject(s)&&(c=s,s=void 0),!(t===void 0||r.isString(t)))throw TypeError(`type must be a string`);if(!r.isString(i))throw TypeError(`requestType must be a string`);if(!r.isString(a))throw TypeError(`responseType must be a string`);n.call(this,e,c),this.type=t||`rpc`,this.requestType=i,this.requestStream=o?!0:void 0,this.responseType=a,this.responseStream=s?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=l,this.parsedOptions=u}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},i.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return r.toObject([`type`,this.type!==`rpc`&&this.type||void 0,`requestType`,this.requestType,`requestStream`,this.requestStream,`responseType`,this.responseType,`responseStream`,this.responseStream,`options`,this.options,`comment`,t?this.comment:void 0,`parsedOptions`,this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}})),We=i(((e,t)=>{t.exports=o;var n=Ve();((o.prototype=Object.create(n.prototype)).constructor=o).className=`Service`;var r=Ue(),i=Q(),a=Fe();function o(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}o.fromJSON=function(e,t){var n=new o(e,t.options);if(t.methods)for(var i=Object.keys(t.methods),a=0;a<i.length;++a)n.add(r.fromJSON(i[a],t.methods[i[a]]));return t.nested&&n.addJSON(t.nested),t.edition&&(n._edition=t.edition),n.comment=t.comment,n._defaultEdition=`proto3`,n},o.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=e?!!e.keepComments:!1;return i.toObject([`edition`,this._editionToJSON(),`options`,t&&t.options||void 0,`methods`,n.arrayToJSON(this.methodsArray,e)||{},`nested`,t&&t.nested||void 0,`comment`,r?this.comment:void 0])},Object.defineProperty(o.prototype,`methodsArray`,{get:function(){return this._methodsArray||(this._methodsArray=i.toArray(this.methods))}});function s(e){return e._methodsArray=null,e}o.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},o.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;n.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return this},o.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,n.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this},o.prototype.add=function(e){if(this.get(e.name))throw Error(`duplicate name '`+e.name+`' in `+this);return e instanceof r?(this.methods[e.name]=e,e.parent=this,s(this)):n.prototype.add.call(this,e)},o.prototype.remove=function(e){if(e instanceof r){if(this.methods[e.name]!==e)throw Error(e+` is not a member of `+this);return delete this.methods[e.name],e.parent=null,s(this)}return n.prototype.remove.call(this,e)},o.prototype.create=function(e,t,n){for(var r=new a.Service(e,t,n),o=0,s;o<this.methodsArray.length;++o){var c=i.lcFirst((s=this._methodsArray[o]).resolve().name).replace(/[^$\w_]/g,``);r[c]=i.codegen([`r`,`c`],i.isReserved(c)?c+`_`:c)(`return this.rpcCall(m,q,s,r,c)`)({m:s,q:s.resolvedRequestType.ctor,s:s.resolvedResponseType.ctor})}return r}})),Ge=i(((e,t)=>{t.exports=r;var n=ke();function r(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n){var r=t[n];r!==`__proto__`&&(this[r]=e[r])}}r.create=function(e){return this.$type.create(e)},r.encode=function(e,t){return this.$type.encode(e,t)},r.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},r.decode=function(e){return this.$type.decode(e)},r.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},r.verify=function(e){return this.$type.verify(e)},r.fromObject=function(e){return this.$type.fromObject(e)},r.toObject=function(e,t){return this.$type.toObject(e,t)},r.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}})),Ke=i(((e,t)=>{t.exports=o;var n=$(),r=Qe(),i=Q();function a(e){return`missing required '`+e.name+`'`}function o(e){for(var t=i.codegen([`r`,`l`,`e`],e.name+`$decode`)(`if(!(r instanceof Reader))`)(`r=Reader.create(r)`)(`var c=l===undefined?r.len:r.pos+l,m=new this.ctor`+(e.fieldsArray.filter(function(e){return e.map}).length?`,k,value`:``))(`while(r.pos<c){`)(`var t=r.uint32()`)(`if(t===e)`)(`break`)(`switch(t>>>3){`),o=0;o<e.fieldsArray.length;++o){var s=e._fieldsArray[o].resolve(),c=s.resolvedType instanceof n?`int32`:s.type,l=`m`+i.safeProp(s.name);t(`case %i: {`,s.id),s.map?(t(`if(%s===util.emptyObject)`,l)(`%s={}`,l)(`var c2 = r.uint32()+r.pos`),r.defaults[s.keyType]===void 0?t(`k=null`):t(`k=%j`,r.defaults[s.keyType]),r.defaults[c]===void 0?t(`value=null`):t(`value=%j`,r.defaults[c]),t(`while(r.pos<c2){`)(`var tag2=r.uint32()`)(`switch(tag2>>>3){`)(`case 1: k=r.%s(); break`,s.keyType)(`case 2:`),r.basic[c]===void 0?t(`value=types[%i].decode(r,r.uint32())`,o):t(`value=r.%s()`,c),t(`break`)(`default:`)(`r.skipType(tag2&7)`)(`break`)(`}`)(`}`),r.long[s.keyType]===void 0?t(`%s[k]=value`,l):t(`%s[typeof k==="object"?util.longToHash(k):k]=value`,l)):s.repeated?(t(`if(!(%s&&%s.length))`,l,l)(`%s=[]`,l),r.packed[c]!==void 0&&t(`if((t&7)===2){`)(`var c2=r.uint32()+r.pos`)(`while(r.pos<c2)`)(`%s.push(r.%s())`,l,c)(`}else`),r.basic[c]===void 0?t(s.delimited?`%s.push(types[%i].decode(r,undefined,((t&~7)|4)))`:`%s.push(types[%i].decode(r,r.uint32()))`,l,o):t(`%s.push(r.%s())`,l,c)):r.basic[c]===void 0?t(s.delimited?`%s=types[%i].decode(r,undefined,((t&~7)|4))`:`%s=types[%i].decode(r,r.uint32())`,l,o):t(`%s=r.%s()`,l,c),t(`break`)(`}`)}for(t(`default:`)(`r.skipType(t&7)`)(`break`)(`}`)(`}`),o=0;o<e._fieldsArray.length;++o){var u=e._fieldsArray[o];u.required&&t(`if(!m.hasOwnProperty(%j))`,u.name)(`throw util.ProtocolError(%j,{instance:m})`,a(u))}return t(`return m`)}})),qe=i(((e,t)=>{t.exports=s;var n=$(),r=Q();function i(e,t){return e.name+`: `+t+(e.repeated&&t!==`array`?`[]`:e.map&&t!==`object`?`{k:`+e.keyType+`}`:``)+` expected`}function a(e,t,r,a){if(t.resolvedType)if(t.resolvedType instanceof n){e(`switch(%s){`,a)(`default:`)(`return%j`,i(t,`enum value`));for(var o=Object.keys(t.resolvedType.values),s=0;s<o.length;++s)e(`case %i:`,t.resolvedType.values[o[s]]);e(`break`)(`}`)}else e(`{`)(`var e=types[%i].verify(%s);`,r,a)(`if(e)`)(`return%j+e`,t.name+`.`)(`}`);else switch(t.type){case`int32`:case`uint32`:case`sint32`:case`fixed32`:case`sfixed32`:e(`if(!util.isInteger(%s))`,a)(`return%j`,i(t,`integer`));break;case`int64`:case`uint64`:case`sint64`:case`fixed64`:case`sfixed64`:e(`if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))`,a,a,a,a)(`return%j`,i(t,`integer|Long`));break;case`float`:case`double`:e(`if(typeof %s!=="number")`,a)(`return%j`,i(t,`number`));break;case`bool`:e(`if(typeof %s!=="boolean")`,a)(`return%j`,i(t,`boolean`));break;case`string`:e(`if(!util.isString(%s))`,a)(`return%j`,i(t,`string`));break;case`bytes`:e(`if(!(%s&&typeof %s.length==="number"||util.isString(%s)))`,a,a,a)(`return%j`,i(t,`buffer`));break}return e}function o(e,t,n){switch(t.keyType){case`int32`:case`uint32`:case`sint32`:case`fixed32`:case`sfixed32`:e(`if(!util.key32Re.test(%s))`,n)(`return%j`,i(t,`integer key`));break;case`int64`:case`uint64`:case`sint64`:case`fixed64`:case`sfixed64`:e(`if(!util.key64Re.test(%s))`,n)(`return%j`,i(t,`integer|Long key`));break;case`bool`:e(`if(!util.key2Re.test(%s))`,n)(`return%j`,i(t,`boolean key`));break}return e}function s(e){var t=r.codegen([`m`],e.name+`$verify`)(`if(typeof m!=="object"||m===null)`)(`return%j`,`object expected`),n=e.oneofsArray,s={};n.length&&t(`var p={}`);for(var c=0;c<e.fieldsArray.length;++c){var l=e._fieldsArray[c].resolve(),u=`m`+r.safeProp(l.name);if(l.optional&&t(`if(%s!=null&&m.hasOwnProperty(%j)){`,u,l.name),l.map)t(`if(!util.isObject(%s))`,u)(`return%j`,i(l,`object`))(`var k=Object.keys(%s)`,u)(`for(var i=0;i<k.length;++i){`),o(t,l,`k[i]`),a(t,l,c,u+`[k[i]]`)(`}`);else if(l.repeated)t(`if(!Array.isArray(%s))`,u)(`return%j`,i(l,`array`))(`for(var i=0;i<%s.length;++i){`,u),a(t,l,c,u+`[i]`)(`}`);else{if(l.partOf){var d=r.safeProp(l.partOf.name);s[l.partOf.name]===1&&t(`if(p%s===1)`,d)(`return%j`,l.partOf.name+`: multiple values`),s[l.partOf.name]=1,t(`p%s=1`,d)}a(t,l,c,u)}l.optional&&t(`}`)}return t(`return null`)}})),Je=i((e=>{var t=e,n=$(),r=Q();function i(e,t,r,i){var a=!1;if(t.resolvedType)if(t.resolvedType instanceof n){e(`switch(d%s){`,i);for(var o=t.resolvedType.values,s=Object.keys(o),c=0;c<s.length;++c)o[s[c]]===t.typeDefault&&!a&&(e(`default:`)(`if(typeof(d%s)==="number"){m%s=d%s;break}`,i,i,i),t.repeated||e(`break`),a=!0),e(`case%j:`,s[c])(`case %i:`,o[s[c]])(`m%s=%j`,i,o[s[c]])(`break`);e(`}`)}else e(`if(typeof d%s!=="object")`,i)(`throw TypeError(%j)`,t.fullName+`: object expected`)(`m%s=types[%i].fromObject(d%s)`,i,r,i);else{var l=!1;switch(t.type){case`double`:case`float`:e(`m%s=Number(d%s)`,i,i);break;case`uint32`:case`fixed32`:e(`m%s=d%s>>>0`,i,i);break;case`int32`:case`sint32`:case`sfixed32`:e(`m%s=d%s|0`,i,i);break;case`uint64`:l=!0;case`int64`:case`sint64`:case`fixed64`:case`sfixed64`:e(`if(util.Long)`)(`(m%s=util.Long.fromValue(d%s)).unsigned=%j`,i,i,l)(`else if(typeof d%s==="string")`,i)(`m%s=parseInt(d%s,10)`,i,i)(`else if(typeof d%s==="number")`,i)(`m%s=d%s`,i,i)(`else if(typeof d%s==="object")`,i)(`m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)`,i,i,i,l?`true`:``);break;case`bytes`:e(`if(typeof d%s==="string")`,i)(`util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)`,i,i,i)(`else if(d%s.length >= 0)`,i)(`m%s=d%s`,i,i);break;case`string`:e(`m%s=String(d%s)`,i,i);break;case`bool`:e(`m%s=Boolean(d%s)`,i,i);break}}return e}t.fromObject=function(e){var t=e.fieldsArray,a=r.codegen([`d`],e.name+`$fromObject`)(`if(d instanceof this.ctor)`)(`return d`);if(!t.length)return a(`return new this.ctor`);a(`var m=new this.ctor`);for(var o=0;o<t.length;++o){var s=t[o].resolve(),c=r.safeProp(s.name);s.map?(a(`if(d%s){`,c)(`if(typeof d%s!=="object")`,c)(`throw TypeError(%j)`,s.fullName+`: object expected`)(`m%s={}`,c)(`for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){`,c),i(a,s,o,c+`[ks[i]]`)(`}`)(`}`)):s.repeated?(a(`if(d%s){`,c)(`if(!Array.isArray(d%s))`,c)(`throw TypeError(%j)`,s.fullName+`: array expected`)(`m%s=[]`,c)(`for(var i=0;i<d%s.length;++i){`,c),i(a,s,o,c+`[i]`)(`}`)(`}`)):(s.resolvedType instanceof n||a(`if(d%s!=null){`,c),i(a,s,o,c),s.resolvedType instanceof n||a(`}`))}return a(`return m`)};function a(e,t,r,i){if(t.resolvedType)t.resolvedType instanceof n?e(`d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s`,i,r,i,i,r,i,i):e(`d%s=types[%i].toObject(m%s,o)`,i,r,i);else{var a=!1;switch(t.type){case`double`:case`float`:e(`d%s=o.json&&!isFinite(m%s)?String(m%s):m%s`,i,i,i,i);break;case`uint64`:a=!0;case`int64`:case`sint64`:case`fixed64`:case`sfixed64`:e(`if(typeof m%s==="number")`,i)(`d%s=o.longs===String?String(m%s):m%s`,i,i,i)(`else`)(`d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s`,i,i,i,i,a?`true`:``,i);break;case`bytes`:e(`d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s`,i,i,i,i,i);break;default:e(`d%s=m%s`,i,i);break}}return e}t.toObject=function(e){var t=e.fieldsArray.slice().sort(r.compareFieldsById);if(!t.length)return r.codegen()(`return {}`);for(var i=r.codegen([`m`,`o`],e.name+`$toObject`)(`if(!o)`)(`o={}`)(`var d={}`),o=[],s=[],c=[],l=0;l<t.length;++l)t[l].partOf||(t[l].resolve().repeated?o:t[l].map?s:c).push(t[l]);if(o.length){for(i(`if(o.arrays||o.defaults){`),l=0;l<o.length;++l)i(`d%s=[]`,r.safeProp(o[l].name));i(`}`)}if(s.length){for(i(`if(o.objects||o.defaults){`),l=0;l<s.length;++l)i(`d%s={}`,r.safeProp(s[l].name));i(`}`)}if(c.length){for(i(`if(o.defaults){`),l=0;l<c.length;++l){var u=c[l],d=r.safeProp(u.name);if(u.resolvedType instanceof n)i(`d%s=o.enums===String?%j:%j`,d,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)i(`if(util.Long){`)(`var n=new util.Long(%i,%i,%j)`,u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)(`d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n`,d)(`}else`)(`d%s=o.longs===String?%j:%i`,d,u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var f=`[`+Array.prototype.slice.call(u.typeDefault).join(`,`)+`]`;i(`if(o.bytes===String)d%s=%j`,d,String.fromCharCode.apply(String,u.typeDefault))(`else{`)(`d%s=%s`,d,f)(`if(o.bytes!==Array)d%s=util.newBuffer(d%s)`,d,d)(`}`)}else i(`d%s=%j`,d,u.typeDefault)}i(`}`)}var p=!1;for(l=0;l<t.length;++l){var u=t[l],m=e._fieldsArray.indexOf(u),d=r.safeProp(u.name);u.map?(p||(p=!0,i(`var ks2`)),i(`if(m%s&&(ks2=Object.keys(m%s)).length){`,d,d)(`d%s={}`,d)(`for(var j=0;j<ks2.length;++j){`),a(i,u,m,d+`[ks2[j]]`)(`}`)):u.repeated?(i(`if(m%s&&m%s.length){`,d,d)(`d%s=[]`,d)(`for(var j=0;j<m%s.length;++j){`,d),a(i,u,m,d+`[j]`)(`}`)):(i(`if(m%s!=null&&m.hasOwnProperty(%j)){`,d,u.name),a(i,u,m,d),u.partOf&&i(`if(o.oneofs)`)(`d%s=%j`,r.safeProp(u.partOf.name),u.name)),i(`}`)}return i(`return d`)}})),Ye=i((e=>{var t=e,n=Ge();t[`.google.protobuf.Any`]={fromObject:function(e){if(e&&e[`@type`]){var t=e[`@type`].substring(e[`@type`].lastIndexOf(`/`)+1),n=this.lookup(t);if(n){var r=e[`@type`].charAt(0)===`.`?e[`@type`].slice(1):e[`@type`];return r.indexOf(`/`)===-1&&(r=`/`+r),this.create({type_url:r,value:n.encode(n.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r=`type.googleapis.com/`,i=``,a=``;if(t&&t.json&&e.type_url&&e.value){a=e.type_url.substring(e.type_url.lastIndexOf(`/`)+1),i=e.type_url.substring(0,e.type_url.lastIndexOf(`/`)+1);var o=this.lookup(a);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof n){var s=e.$type.toObject(e,t),c=e.$type.fullName[0]===`.`?e.$type.fullName.slice(1):e.$type.fullName;return i===``&&(i=r),a=i+c,s[`@type`]=a,s}return this.toObject(e,t)}}})),Xe=i(((e,t)=>{t.exports=_;var n=Ve();((_.prototype=Object.create(n.prototype)).constructor=_).className=`Type`;var r=$(),i=et(),a=$e(),o=He(),s=We(),c=Ge(),l=Me(),u=Ae(),d=Q(),f=nt(),p=Ke(),m=qe(),h=Je(),g=Ye();function _(e,t){e=e.replace(/\W/g,``),n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(_.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var n=this.fields[e[t]],r=n.id;if(this._fieldsById[r])throw Error(`duplicate id `+r+` in `+this);this._fieldsById[r]=n}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=d.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=d.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=_.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof c||((e.prototype=new c).constructor=e,d.merge(e.prototype,t)),e.$type=e.prototype.$type=this,d.merge(e,c,!0),this._ctor=e;for(var n=0;n<this.fieldsArray.length;++n)this._fieldsArray[n].resolve();var r={};for(n=0;n<this.oneofsArray.length;++n)r[this._oneofsArray[n].resolve().name]={get:d.oneOfGetter(this._oneofsArray[n].oneof),set:d.oneOfSetter(this._oneofsArray[n].oneof)};n&&Object.defineProperties(e.prototype,r)}}}),_.generateConstructor=function(e){for(var t=d.codegen([`p`],e.name),n=0,r;n<e.fieldsArray.length;++n)(r=e._fieldsArray[n]).map?t(`this%s={}`,d.safeProp(r.name)):r.repeated&&t(`this%s=[]`,d.safeProp(r.name));return t(`if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)`)(`this[ks[i]]=p[ks[i]]`)};function v(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}_.fromJSON=function(e,t){var c=new _(e,t.options);c.extensions=t.extensions,c.reserved=t.reserved;for(var l=Object.keys(t.fields),u=0;u<l.length;++u)c.add((t.fields[l[u]].keyType===void 0?a.fromJSON:o.fromJSON)(l[u],t.fields[l[u]]));if(t.oneofs)for(l=Object.keys(t.oneofs),u=0;u<l.length;++u)c.add(i.fromJSON(l[u],t.oneofs[l[u]]));if(t.nested)for(l=Object.keys(t.nested),u=0;u<l.length;++u){var d=t.nested[l[u]];c.add((d.id===void 0?d.fields===void 0?d.values===void 0?d.methods===void 0?n.fromJSON:s.fromJSON:r.fromJSON:_.fromJSON:a.fromJSON)(l[u],d))}return t.extensions&&t.extensions.length&&(c.extensions=t.extensions),t.reserved&&t.reserved.length&&(c.reserved=t.reserved),t.group&&(c.group=!0),t.comment&&(c.comment=t.comment),t.edition&&(c._edition=t.edition),c._defaultEdition=`proto3`,c},_.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=e?!!e.keepComments:!1;return d.toObject([`edition`,this._editionToJSON(),`options`,t&&t.options||void 0,`oneofs`,n.arrayToJSON(this.oneofsArray,e),`fields`,n.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}),e)||{},`extensions`,this.extensions&&this.extensions.length?this.extensions:void 0,`reserved`,this.reserved&&this.reserved.length?this.reserved:void 0,`group`,this.group||void 0,`nested`,t&&t.nested||void 0,`comment`,r?this.comment:void 0])},_.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;n.prototype.resolveAll.call(this);var e=this.oneofsArray;for(r=0;r<e.length;)e[r++].resolve();for(var t=this.fieldsArray,r=0;r<t.length;)t[r++].resolve();return this},_.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,n.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(t=>{t._resolveFeatures(e)}),this.fieldsArray.forEach(t=>{t._resolveFeatures(e)}),this):this},_.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},_.prototype.add=function(e){if(this.get(e.name))throw Error(`duplicate name '`+e.name+`' in `+this);if(e instanceof a&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error(`duplicate id `+e.id+` in `+this);if(this.isReservedId(e.id))throw Error(`id `+e.id+` is reserved in `+this);if(this.isReservedName(e.name))throw Error(`name '`+e.name+`' is reserved in `+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),v(this)}return e instanceof i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),v(this)):n.prototype.add.call(this,e)},_.prototype.remove=function(e){if(e instanceof a&&e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+` is not a member of `+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),v(this)}if(e instanceof i){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+` is not a member of `+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),v(this)}return n.prototype.remove.call(this,e)},_.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},_.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},_.prototype.create=function(e){return new this.ctor(e)},_.prototype.setup=function(){for(var e=this.fullName,t=[],n=0;n<this.fieldsArray.length;++n)t.push(this._fieldsArray[n].resolve().resolvedType);this.encode=f(this)({Writer:u,types:t,util:d}),this.decode=p(this)({Reader:l,types:t,util:d}),this.verify=m(this)({types:t,util:d}),this.fromObject=h.fromObject(this)({types:t,util:d}),this.toObject=h.toObject(this)({types:t,util:d});var r=g[e];if(r){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=r.fromObject.bind(i),i.toObject=this.toObject,this.toObject=r.toObject.bind(i)}return this},_.prototype.encode=function(e,t){return this.setup().encode(e,t)},_.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},_.prototype.decode=function(e,t){return this.setup().decode(e,t)},_.prototype.decodeDelimited=function(e){return e instanceof l||(e=l.create(e)),this.decode(e,e.uint32())},_.prototype.verify=function(e){return this.setup().verify(e)},_.prototype.fromObject=function(e){return this.setup().fromObject(e)},_.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},_.d=function(e){return function(t){d.decorateType(t,e)}}})),Ze=i(((e,t)=>{t.exports=u;var n=Ve();((u.prototype=Object.create(n.prototype)).constructor=u).className=`Root`;var r=$e(),i=$(),a=et(),o=Q(),s,c,l;function u(e){n.call(this,``,e),this.deferred=[],this.files=[],this._edition=`proto2`,this._fullyQualifiedObjects={}}u.fromJSON=function(e,t){return t||(t=new u),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()},u.prototype.resolvePath=o.path.resolve,u.prototype.fetch=o.fetch;function d(){}u.prototype.load=function e(t,n,r){typeof n==`function`&&(r=n,n=void 0);var i=this;if(!r)return o.asPromise(e,i,t,n);var a=r===d;function s(e,t){if(r){if(a)throw e;t&&t.resolveAll();var n=r;r=null,n(e,t)}}function u(e){var t=e.lastIndexOf(`google/protobuf/`);if(t>-1){var n=e.substring(t);if(n in l)return n}return null}function f(e,t){try{if(o.isString(t)&&t.charAt(0)===`{`&&(t=JSON.parse(t)),!o.isString(t))i.setOptions(t.options).addJSON(t.nested);else{c.filename=e;var r=c(t,i,n),l,d=0;if(r.imports)for(;d<r.imports.length;++d)(l=u(r.imports[d])||i.resolvePath(e,r.imports[d]))&&p(l);if(r.weakImports)for(d=0;d<r.weakImports.length;++d)(l=u(r.weakImports[d])||i.resolvePath(e,r.weakImports[d]))&&p(l,!0)}}catch(e){s(e)}!a&&!m&&s(null,i)}function p(e,t){if(e=u(e)||e,!(i.files.indexOf(e)>-1)){if(i.files.push(e),e in l){a?f(e,l[e]):(++m,setTimeout(function(){--m,f(e,l[e])}));return}if(a){var n;try{n=o.fs.readFileSync(e).toString(`utf8`)}catch(e){t||s(e);return}f(e,n)}else ++m,i.fetch(e,function(n,a){if(--m,r){if(n){t?m||s(null,i):s(n);return}f(e,a)}})}}var m=0;o.isString(t)&&(t=[t]);for(var h=0,g;h<t.length;++h)(g=i.resolvePath(``,t[h]))&&p(g);return a?(i.resolveAll(),i):(m||s(null,i),i)},u.prototype.loadSync=function(e,t){if(!o.isNode)throw Error(`not supported`);return this.load(e,t,d)},u.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error(`unresolvable extensions: `+this.deferred.map(function(e){return`'extend `+e.extend+`' in `+e.parent.fullName}).join(`, `));return n.prototype.resolveAll.call(this)};var f=/^[A-Z]/;function p(e,t){var n=t.parent.lookup(t.extend);if(n){var i=new r(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.get(i.name)?!0:(i.declaringField=t,t.extensionField=i,n.add(i),!0)}return!1}u.prototype._handleAdd=function(e){if(e instanceof r)e.extend!==void 0&&!e.extensionField&&(p(this,e)||this.deferred.push(e));else if(e instanceof i)f.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof a)){if(e instanceof s)for(var t=0;t<this.deferred.length;)p(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);f.test(e.name)&&(e.parent[e.name]=e)}(e instanceof s||e instanceof i||e instanceof r)&&(this._fullyQualifiedObjects[e.fullName]=e)},u.prototype._handleRemove=function(e){if(e instanceof r){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof i)f.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var a=0;a<e.nestedArray.length;++a)this._handleRemove(e._nestedArray[a]);f.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]},u._configure=function(e,t,n){s=e,c=t,l=n}})),Q=i(((e,t)=>{var n=t.exports=ke(),r=Ie(),i,a;n.codegen=Re(),n.fetch=ze(),n.path=Be(),n.fs=n.inquire(`fs`),n.toArray=function(e){if(e){for(var t=Object.keys(e),n=Array(t.length),r=0;r<t.length;)n[r]=e[t[r++]];return n}return[]},n.toObject=function(e){for(var t={},n=0;n<e.length;){var r=e[n++],i=e[n++];i!==void 0&&(t[r]=i)}return t};var o=/\\/g,s=/"/g;n.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},n.safeProp=function(e){return!/^[$\w_]+$/.test(e)||n.isReserved(e)?`["`+e.replace(o,`\\\\`).replace(s,`\\"`)+`"]`:`.`+e},n.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var c=/_([a-z])/g;n.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(c,function(e,t){return t.toUpperCase()})},n.compareFieldsById=function(e,t){return e.id-t.id},n.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(n.decorateRoot.remove(e.$type),e.$type.name=t,n.decorateRoot.add(e.$type)),e.$type;i||(i=Xe());var r=new i(t||e.name);return n.decorateRoot.add(r),r.ctor=e,Object.defineProperty(e,`$type`,{value:r,enumerable:!1}),Object.defineProperty(e.prototype,`$type`,{value:r,enumerable:!1}),r};var l=0;n.decorateEnum=function(e){if(e.$type)return e.$type;a||(a=$());var t=new a(`Enum`+ l++,e);return n.decorateRoot.add(t),Object.defineProperty(e,`$type`,{value:t,enumerable:!1}),t},n.setProperty=function(e,t,n,r){function i(e,t,n){var a=t.shift();if(a===`__proto__`||a===`prototype`)return e;if(t.length>0)e[a]=i(e[a]||{},t,n);else{var o=e[a];if(o&&r)return e;o&&(n=[].concat(o,n)),e[a]=n}return e}if(typeof e!=`object`)throw TypeError(`dst must be an object`);if(!t)throw TypeError(`path must be specified`);return t=t.split(`.`),i(e,t,n)},Object.defineProperty(n,`decorateRoot`,{get:function(){return r.decorated||(r.decorated=new(Ze()))}})})),Qe=i((e=>{var t=e,n=Q(),r=[`double`,`float`,`int32`,`uint32`,`sint32`,`fixed32`,`sfixed32`,`int64`,`uint64`,`sint64`,`fixed64`,`sfixed64`,`bool`,`string`,`bytes`];function i(e,t){var n=0,i={};for(t|=0;n<e.length;)i[r[n+t]]=e[n++];return i}t.basic=i([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),t.defaults=i([0,0,0,0,0,0,0,0,0,0,0,0,!1,``,n.emptyArray,null]),t.long=i([0,0,0,1,1],7),t.mapKey=i([0,0,0,5,5,0,0,0,1,1,0,2],2),t.packed=i([1,5,0,0,0,5,5,0,0,0,1,1,0])})),$e=i(((e,t)=>{t.exports=c;var n=tt();((c.prototype=Object.create(n.prototype)).constructor=c).className=`Field`;var r=$(),i=Qe(),a=Q(),o,s=/^required|optional|repeated$/;c.fromJSON=function(e,t){var n=new c(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(n._edition=t.edition),n._defaultEdition=`proto3`,n};function c(e,t,r,o,c,l,u){if(a.isObject(o)?(u=c,l=o,o=c=void 0):a.isObject(c)&&(u=l,l=c,c=void 0),n.call(this,e,l),!a.isInteger(t)||t<0)throw TypeError(`id must be a non-negative integer`);if(!a.isString(r))throw TypeError(`type must be a string`);if(o!==void 0&&!s.test(o=o.toString().toLowerCase()))throw TypeError(`rule must be a string rule`);if(c!==void 0&&!a.isString(c))throw TypeError(`extend must be a string`);o===`proto3_optional`&&(o=`optional`),this.rule=o&&o!==`optional`?o:void 0,this.type=r,this.id=t,this.extend=c||void 0,this.repeated=o===`repeated`,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=a.Long?i.long[r]!==void 0:!1,this.bytes=r===`bytes`,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=u}Object.defineProperty(c.prototype,`required`,{get:function(){return this._features.field_presence===`LEGACY_REQUIRED`}}),Object.defineProperty(c.prototype,`optional`,{get:function(){return!this.required}}),Object.defineProperty(c.prototype,`delimited`,{get:function(){return this.resolvedType instanceof o&&this._features.message_encoding===`DELIMITED`}}),Object.defineProperty(c.prototype,`packed`,{get:function(){return this._features.repeated_field_encoding===`PACKED`}}),Object.defineProperty(c.prototype,`hasPresence`,{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!==`IMPLICIT`}}),c.prototype.setOption=function(e,t,r){return n.prototype.setOption.call(this,e,t,r)},c.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return a.toObject([`edition`,this._editionToJSON(),`rule`,this.rule!==`optional`&&this.rule||void 0,`type`,this.type,`id`,this.id,`extend`,this.extend,`options`,this.options,`comment`,t?this.comment:void 0])},c.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=i.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof o?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof r&&typeof this.typeDefault==`string`&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof r)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,this.type.charAt(0)===`u`),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault==`string`){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof o&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},c.prototype._inferLegacyProtoFeatures=function(e){if(e!==`proto2`&&e!==`proto3`)return{};var t={};if(this.rule===`required`&&(t.field_presence=`LEGACY_REQUIRED`),this.parent&&i.defaults[this.type]===void 0){var n=this.parent.get(this.type.split(`.`).pop());n&&n instanceof o&&n.group&&(t.message_encoding=`DELIMITED`)}return this.getOption(`packed`)===!0?t.repeated_field_encoding=`PACKED`:this.getOption(`packed`)===!1&&(t.repeated_field_encoding=`EXPANDED`),t},c.prototype._resolveFeatures=function(e){return n.prototype._resolveFeatures.call(this,this._edition||e)},c.d=function(e,t,n,r){return typeof t==`function`?t=a.decorateType(t).name:t&&typeof t==`object`&&(t=a.decorateEnum(t).name),function(i,o){a.decorateType(i.constructor).add(new c(o,e,t,n,{default:r}))}},c._configure=function(e){o=e}})),et=i(((e,t)=>{t.exports=a;var n=tt();((a.prototype=Object.create(n.prototype)).constructor=a).className=`OneOf`;var r=$e(),i=Q();function a(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),!(t===void 0||Array.isArray(t)))throw TypeError(`fieldNames must be an Array`);this.oneof=t||[],this.fieldsArray=[],this.comment=i}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return i.toObject([`options`,this.options,`oneof`,this.oneof,`comment`,t?this.comment:void 0])};function o(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.prototype.add=function(e){if(!(e instanceof r))throw TypeError(`field must be a Field`);return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,o(this),this},a.prototype.remove=function(e){if(!(e instanceof r))throw TypeError(`field must be a Field`);var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+` is not a member of `+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t>-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=this,r=0;r<this.oneof.length;++r){var i=e.get(this.oneof[r]);i&&!i.partOf&&(i.partOf=t,t.fieldsArray.push(i))}o(this)},a.prototype.onRemove=function(e){for(var t=0,r;t<this.fieldsArray.length;++t)(r=this.fieldsArray[t]).parent&&r.parent.remove(r);n.prototype.onRemove.call(this,e)},Object.defineProperty(a.prototype,`isProto3Optional`,{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var e=this.fieldsArray[0];return e.options!=null&&e.options.proto3_optional===!0}}),a.d=function(){for(var e=Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){i.decorateType(t.constructor).add(new a(n,e)),Object.defineProperty(t,n,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}})),tt=i(((e,t)=>{t.exports=c,c.className=`ReflectionObject`;var n=et(),r=Q(),i,a={enum_type:`OPEN`,field_presence:`EXPLICIT`,json_format:`ALLOW`,message_encoding:`LENGTH_PREFIXED`,repeated_field_encoding:`PACKED`,utf8_validation:`VERIFY`},o={enum_type:`CLOSED`,field_presence:`EXPLICIT`,json_format:`LEGACY_BEST_EFFORT`,message_encoding:`LENGTH_PREFIXED`,repeated_field_encoding:`EXPANDED`,utf8_validation:`NONE`},s={enum_type:`OPEN`,field_presence:`IMPLICIT`,json_format:`ALLOW`,message_encoding:`LENGTH_PREFIXED`,repeated_field_encoding:`PACKED`,utf8_validation:`VERIFY`};function c(e,t){if(!r.isString(e))throw TypeError(`name must be a string`);if(t&&!r.isObject(t))throw TypeError(`options must be an object`);this.options=t,this.parsedOptions=null,this.name=e,this._edition=null,this._defaultEdition=`proto2`,this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(c.prototype,{root:{get:function(){for(var e=this;e.parent!==null;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(`.`)}}}),c.prototype.toJSON=function(){throw Error()},c.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof i&&t._handleAdd(this)},c.prototype.onRemove=function(e){var t=e.root;t instanceof i&&t._handleRemove(this),this.parent=null,this.resolved=!1},c.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},c.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)},c.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var t={};if(!e)throw Error(`Unknown edition for `+this.fullName);var r=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(e));if(this._edition){if(e===`proto2`)t=Object.assign({},o);else if(e===`proto3`)t=Object.assign({},s);else if(e===`2023`)t=Object.assign({},a);else throw Error(`Unknown edition: `+e);this._features=Object.assign(t,r||{}),this._featuresResolved=!0;return}if(this.partOf instanceof n){var i=Object.assign({},this.partOf._features);this._features=Object.assign(i,r||{})}else if(!this.declaringField)if(this.parent){var c=Object.assign({},this.parent._features);this._features=Object.assign(c,r||{})}else throw Error(`Unable to find a parent for `+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}},c.prototype._inferLegacyProtoFeatures=function(){return{}},c.prototype.getOption=function(e){if(this.options)return this.options[e]},c.prototype.setOption=function(e,t,n){return this.options||(this.options={}),/^features\./.test(e)?r.setProperty(this.options,e,t,n):(!n||this.options[e]===void 0)&&(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this},c.prototype.setParsedOption=function(e,t,n){this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(n){var a=i.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)});if(a){var o=a[e];r.setProperty(o,n,t)}else a={},a[e]=r.setProperty({},n,t),i.push(a)}else{var s={};s[e]=t,i.push(s)}return this},c.prototype.setOptions=function(e,t){if(e)for(var n=Object.keys(e),r=0;r<n.length;++r)this.setOption(n[r],e[n[r]],t);return this},c.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+` `+t:e},c.prototype._editionToJSON=function(){if(!(!this._edition||this._edition===`proto3`))return this._edition},c._configure=function(e){i=e}})),$=i(((e,t)=>{t.exports=a;var n=tt();((a.prototype=Object.create(n.prototype)).constructor=a).className=`Enum`;var r=Ve(),i=Q();function a(e,t,r,i,a,o){if(n.call(this,e,r),t&&typeof t!=`object`)throw TypeError(`values must be an object`);if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=a||{},this.valuesOptions=o,this._valuesFeatures={},this.reserved=void 0,t)for(var s=Object.keys(t),c=0;c<s.length;++c)typeof t[s[c]]==`number`&&(this.valuesById[this.values[s[c]]=t[s[c]]]=s[c])}a.prototype._resolveFeatures=function(e){return e=this._edition||e,n.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(e=>{var t=Object.assign({},this._features);this._valuesFeatures[e]=Object.assign(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features)}),this},a.fromJSON=function(e,t){var n=new a(e,t.values,t.options,t.comment,t.comments);return n.reserved=t.reserved,t.edition&&(n._edition=t.edition),n._defaultEdition=`proto3`,n},a.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return i.toObject([`edition`,this._editionToJSON(),`options`,this.options,`valuesOptions`,this.valuesOptions,`values`,this.values,`reserved`,this.reserved&&this.reserved.length?this.reserved:void 0,`comment`,t?this.comment:void 0,`comments`,t?this.comments:void 0])},a.prototype.add=function(e,t,n,r){if(!i.isString(e))throw TypeError(`name must be a string`);if(!i.isInteger(t))throw TypeError(`id must be an integer`);if(this.values[e]!==void 0)throw Error(`duplicate name '`+e+`' in `+this);if(this.isReservedId(t))throw Error(`id `+t+` is reserved in `+this);if(this.isReservedName(e))throw Error(`name '`+e+`' is reserved in `+this);if(this.valuesById[t]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error(`duplicate id `+t+` in `+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return r&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=r||null),this.comments[e]=n||null,this},a.prototype.remove=function(e){if(!i.isString(e))throw TypeError(`name must be a string`);var t=this.values[e];if(t==null)throw Error(`name '`+e+`' does not exist in `+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},a.prototype.isReservedId=function(e){return r.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return r.isReservedName(this.reserved,e)}})),nt=i(((e,t)=>{t.exports=o;var n=$(),r=Qe(),i=Q();function a(e,t,n,r){return t.delimited?e(`types[%i].encode(%s,w.uint32(%i)).uint32(%i)`,n,r,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e(`types[%i].encode(%s,w.uint32(%i).fork()).ldelim()`,n,r,(t.id<<3|2)>>>0)}function o(e){for(var t=i.codegen([`m`,`w`],e.name+`$encode`)(`if(!w)`)(`w=Writer.create()`),o,s,c=e.fieldsArray.slice().sort(i.compareFieldsById),o=0;o<c.length;++o){var l=c[o].resolve(),u=e._fieldsArray.indexOf(l),d=l.resolvedType instanceof n?`int32`:l.type,f=r.basic[d];s=`m`+i.safeProp(l.name),l.map?(t(`if(%s!=null&&Object.hasOwnProperty.call(m,%j)){`,s,l.name)(`for(var ks=Object.keys(%s),i=0;i<ks.length;++i){`,s)(`w.uint32(%i).fork().uint32(%i).%s(ks[i])`,(l.id<<3|2)>>>0,8|r.mapKey[l.keyType],l.keyType),f===void 0?t(`types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()`,u,s):t(`.uint32(%i).%s(%s[ks[i]]).ldelim()`,16|f,d,s),t(`}`)(`}`)):l.repeated?(t(`if(%s!=null&&%s.length){`,s,s),l.packed&&r.packed[d]!==void 0?t(`w.uint32(%i).fork()`,(l.id<<3|2)>>>0)(`for(var i=0;i<%s.length;++i)`,s)(`w.%s(%s[i])`,d,s)(`w.ldelim()`):(t(`for(var i=0;i<%s.length;++i)`,s),f===void 0?a(t,l,u,s+`[i]`):t(`w.uint32(%i).%s(%s[i])`,(l.id<<3|f)>>>0,d,s)),t(`}`)):(l.optional&&t(`if(%s!=null&&Object.hasOwnProperty.call(m,%j))`,s,l.name),f===void 0?a(t,l,u,s):t(`w.uint32(%i).%s(%s)`,(l.id<<3|f)>>>0,d,s))}return t(`return w`)}})),rt=i(((e,t)=>{var n=t.exports=Le();n.build=`light`;function r(e,t,r){return typeof t==`function`?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)}n.load=r;function i(e,t){return t||(t=new n.Root),t.loadSync(e)}n.loadSync=i,n.encoder=nt(),n.decoder=Ke(),n.verifier=qe(),n.converter=Je(),n.ReflectionObject=tt(),n.Namespace=Ve(),n.Root=Ze(),n.Enum=$(),n.Type=Xe(),n.Field=$e(),n.OneOf=et(),n.MapField=He(),n.Service=We(),n.Method=Ue(),n.Message=Ge(),n.wrappers=Ye(),n.types=Qe(),n.util=Q(),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)})),it=i(((e,t)=>{t.exports=f;var n=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,i=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,a=/^ *[*/]+ */,o=/^\s*\*?\/*/,s=/\n/g,c=/\s/,l=/\\(.?)/g,u={0:`\0`,r:`\r`,n:`
7
+ `,t:` `};function d(e){return e.replace(l,function(e,t){switch(t){case`\\`:case``:return t;default:return u[t]||``}})}f.unescape=d;function f(e,t){e=e.toString();var l=0,u=e.length,f=1,p=0,m={},h=[],g=null;function _(e){return Error(`illegal `+e+` (line `+f+`)`)}function v(){var t=g===`'`?i:r;t.lastIndex=l-1;var n=t.exec(e);if(!n)throw _(`string`);return l=t.lastIndex,w(g),g=null,d(n[1])}function y(t){return e.charAt(t)}function b(n,r,i){var c={type:e.charAt(n++),lineEmpty:!1,leading:i},l=n-(t?2:3),u;do if(--l<0||(u=e.charAt(l))===`
8
+ `){c.lineEmpty=!0;break}while(u===` `||u===` `);for(var d=e.substring(n,r).split(s),h=0;h<d.length;++h)d[h]=d[h].replace(t?o:a,``).trim();c.text=d.join(`
9
+ `).trim(),m[f]=c,p=f}function x(t){var n=S(t),r=e.substring(t,n);return/^\s*\/\//.test(r)}function S(e){for(var t=e;t<u&&y(t)!==`
10
+ `;)t++;return t}function C(){if(h.length>0)return h.shift();if(g)return v();var r,i,a,o,s,d=l===0;do{if(l===u)return null;for(r=!1;c.test(a=y(l));)if(a===`
11
+ `&&(d=!0,++f),++l===u)return null;if(y(l)===`/`){if(++l===u)throw _(`comment`);if(y(l)===`/`)if(t){if(o=l,s=!1,x(l-1)){s=!0;do if(l=S(l),l===u||(l++,!d))break;while(x(l))}else l=Math.min(u,S(l)+1);s&&(b(o,l,d),d=!0),f++,r=!0}else{for(s=y(o=l+1)===`/`;y(++l)!==`
12
+ `;)if(l===u)return null;++l,s&&(b(o,l-1,d),d=!0),++f,r=!0}else if((a=y(l))===`*`){o=l+1,s=t||y(o)===`*`;do{if(a===`
13
+ `&&++f,++l===u)throw _(`comment`);i=a,a=y(l)}while(i!==`*`||a!==`/`);++l,s&&(b(o,l-2,d),d=!0),r=!0}else return`/`}}while(r);var p=l;if(n.lastIndex=0,!n.test(y(p++)))for(;p<u&&!n.test(y(p));)++p;var m=e.substring(l,l=p);return(m===`"`||m===`'`)&&(g=m),m}function w(e){h.push(e)}function T(){if(!h.length){var e=C();if(e===null)return null;w(e)}return h[0]}function E(e,t){var n=T();if(n===e)return C(),!0;if(!t)throw _(`token '`+n+`', '`+e+`' expected`);return!1}function D(e){var n=null,r;return e===void 0?(r=m[f-1],delete m[f-1],r&&(t||r.type===`*`||r.lineEmpty)&&(n=r.leading?r.text:null)):(p<e&&T(),r=m[e],delete m[e],r&&!r.lineEmpty&&(t||r.type===`/`)&&(n=r.leading?null:r.text)),n}return Object.defineProperty({next:C,peek:T,push:w,skip:E,cmnt:D},`line`,{get:function(){return f}})}})),at=i(((e,t)=>{t.exports=C,C.filename=null,C.defaults={keepCase:!1};var n=it(),r=Ze(),i=Xe(),a=$e(),o=He(),s=et(),c=$(),l=We(),u=Ue(),d=tt(),f=Qe(),p=Q(),m=/^[1-9][0-9]*$/,h=/^-?[1-9][0-9]*$/,g=/^0[x][0-9a-fA-F]+$/,_=/^-?0[x][0-9a-fA-F]+$/,v=/^0[0-7]+$/,y=/^-?0[0-7]+$/,b=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,x=/^[a-zA-Z_][a-zA-Z_0-9]*$/,S=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function C(e,t,w){t instanceof r||(w=t,t=new r),w||(w=C.defaults);var T=w.preferTrailingComment||!1,E=n(e,w.alternateCommentMode||!1),D=E.next,O=E.push,k=E.peek,A=E.skip,j=E.cmnt,M=!0,N,ee,P,F=`proto2`,I=t,L=[],te={},R=w.keepCase?function(e){return e}:p.camelCase;function ne(){L.forEach(e=>{e._edition=F,Object.keys(te).forEach(t=>{e.getOption(t)===void 0&&e.setOption(t,te[t],!0)})})}function z(e,t,n){var r=C.filename;return n||(C.filename=null),Error(`illegal `+(t||`token`)+` '`+e+`' (`+(r?r+`, `:``)+`line `+E.line+`)`)}function B(){var e=[],t;do{if((t=D())!==`"`&&t!==`'`)throw z(t);e.push(D()),A(t),t=k()}while(t===`"`||t===`'`);return e.join(``)}function re(e){var t=D();switch(t){case`'`:case`"`:return O(t),B();case`true`:case`TRUE`:return!0;case`false`:case`FALSE`:return!1}try{return ie(t,!0)}catch{if(e&&S.test(t))return t;throw z(t,`value`)}}function V(e,t){var n,r;do if(t&&((n=k())===`"`||n===`'`)){var i=B();if(e.push(i),F>=2023)throw z(i,`id`)}else try{e.push([r=ae(D()),A(`to`,!0)?ae(D()):r])}catch(r){if(t&&S.test(n)&&F>=2023)e.push(n);else throw r}while(A(`,`,!0));var a={options:void 0};a.setOption=function(e,t){this.options===void 0&&(this.options={}),this.options[e]=t},W(a,function(e){if(e===`option`)J(a,e),A(`;`);else throw z(e)},function(){he(a)})}function ie(e,t){var n=1;switch(e.charAt(0)===`-`&&(n=-1,e=e.substring(1)),e){case`inf`:case`INF`:case`Inf`:return n*(1/0);case`nan`:case`NAN`:case`Nan`:case`NaN`:return NaN;case`0`:return 0}if(m.test(e))return n*parseInt(e,10);if(g.test(e))return n*parseInt(e,16);if(v.test(e))return n*parseInt(e,8);if(b.test(e))return n*parseFloat(e);throw z(e,`number`,t)}function ae(e,t){switch(e){case`max`:case`MAX`:case`Max`:return 536870911;case`0`:return 0}if(!t&&e.charAt(0)===`-`)throw z(e,`id`);if(h.test(e))return parseInt(e,10);if(_.test(e))return parseInt(e,16);if(y.test(e))return parseInt(e,8);throw z(e,`id`)}function H(){if(N!==void 0)throw z(`package`);if(N=D(),!S.test(N))throw z(N,`name`);I=I.define(N),A(`;`)}function U(){var e=k(),t;switch(e){case`weak`:t=P||(P=[]),D();break;case`public`:D();default:t=ee||(ee=[]);break}e=B(),A(`;`),t.push(e)}function oe(){if(A(`=`),F=B(),F<2023)throw z(F,`syntax`);A(`;`)}function se(){if(A(`=`),F=B(),![`2023`].includes(F))throw z(F,`edition`);A(`;`)}function ce(e,t){switch(t){case`option`:return J(e,t),A(`;`),!0;case`message`:return G(e,t),!0;case`enum`:return q(e,t),!0;case`service`:return ge(e,t),!0;case`extend`:return ve(e,t),!0}return!1}function W(e,t,n){var r=E.line;if(e&&(typeof e.comment!=`string`&&(e.comment=j()),e.filename=C.filename),A(`{`,!0)){for(var i;(i=D())!==`}`;)t(i);A(`;`,!0)}else n&&n(),A(`;`),e&&(typeof e.comment!=`string`||T)&&(e.comment=j(r)||e.comment)}function G(e,t){if(!x.test(t=D()))throw z(t,`type name`);var n=new i(t);W(n,function(e){if(!ce(n,e))switch(e){case`map`:ue(n,e);break;case`required`:if(F!==`proto2`)throw z(e);case`repeated`:K(n,e);break;case`optional`:if(F===`proto3`)K(n,`proto3_optional`);else if(F!==`proto2`)throw z(e);else K(n,`optional`);break;case`oneof`:de(n,e);break;case`extensions`:V(n.extensions||(n.extensions=[]));break;case`reserved`:V(n.reserved||(n.reserved=[]),!0);break;default:if(F===`proto2`||!S.test(e))throw z(e);O(e),K(n,`optional`);break}}),e.add(n),e===I&&L.push(n)}function K(e,t,n){var r=D();if(r===`group`){le(e,t);return}for(;r.endsWith(`.`)||k().startsWith(`.`);)r+=D();if(!S.test(r))throw z(r,`type`);var i=D();if(!x.test(i))throw z(i,`name`);i=R(i),A(`=`);var o=new a(i,ae(D()),r,t,n);if(W(o,function(e){if(e===`option`)J(o,e),A(`;`);else throw z(e)},function(){he(o)}),t===`proto3_optional`){var c=new s(`_`+i);o.setOption(`proto3_optional`,!0),c.add(o),e.add(c)}else e.add(o);e===I&&L.push(o)}function le(e,t){if(F>=2023)throw z(`group`);var n=D();if(!x.test(n))throw z(n,`name`);var r=p.lcFirst(n);n===r&&(n=p.ucFirst(n)),A(`=`);var o=ae(D()),s=new i(n);s.group=!0;var c=new a(r,o,n,t);c.filename=C.filename,W(s,function(e){switch(e){case`option`:J(s,e),A(`;`);break;case`required`:case`repeated`:K(s,e);break;case`optional`:F===`proto3`?K(s,`proto3_optional`):K(s,`optional`);break;case`message`:G(s,e);break;case`enum`:q(s,e);break;case`reserved`:V(s.reserved||(s.reserved=[]),!0);break;default:throw z(e)}}),e.add(s).add(c)}function ue(e){A(`<`);var t=D();if(f.mapKey[t]===void 0)throw z(t,`type`);A(`,`);var n=D();if(!S.test(n))throw z(n,`type`);A(`>`);var r=D();if(!x.test(r))throw z(r,`name`);A(`=`);var i=new o(R(r),ae(D()),t,n);W(i,function(e){if(e===`option`)J(i,e),A(`;`);else throw z(e)},function(){he(i)}),e.add(i)}function de(e,t){if(!x.test(t=D()))throw z(t,`name`);var n=new s(R(t));W(n,function(e){e===`option`?(J(n,e),A(`;`)):(O(e),K(n,`optional`))}),e.add(n)}function q(e,t){if(!x.test(t=D()))throw z(t,`name`);var n=new c(t);W(n,function(e){switch(e){case`option`:J(n,e),A(`;`);break;case`reserved`:V(n.reserved||(n.reserved=[]),!0),n.reserved===void 0&&(n.reserved=[]);break;default:fe(n,e)}}),e.add(n),e===I&&L.push(n)}function fe(e,t){if(!x.test(t))throw z(t,`name`);A(`=`);var n=ae(D(),!0),r={options:void 0};r.getOption=function(e){return this.options[e]},r.setOption=function(e,t){d.prototype.setOption.call(r,e,t)},r.setParsedOption=function(){},W(r,function(e){if(e===`option`)J(r,e),A(`;`);else throw z(e)},function(){he(r)}),e.add(t,n,r.comment,r.parsedOptions||r.options)}function J(e,t){var n,r,i=!0;for(t===`option`&&(t=D());t!==`=`;){if(t===`(`){var a=D();A(`)`),t=`(`+a+`)`}if(i){if(i=!1,t.includes(`.`)&&!t.includes(`(`)){var o=t.split(`.`);n=o[0]+`.`,t=o[1];continue}n=t}else r=r?r+=t:t;t=D()}var s=pe(e,r?n.concat(r):n);r=r&&r[0]===`.`?r.slice(1):r,n=n&&n[n.length-1]===`.`?n.slice(0,-1):n,me(e,n,s,r)}function pe(e,t){if(A(`{`,!0)){for(var n={};!A(`}`,!0);){if(!x.test(X=D()))throw z(X,`name`);if(X===null)throw z(X,`end of input`);var r,i=X;if(A(`:`,!0),k()===`{`)r=pe(e,t+`.`+X);else if(k()===`[`){r=[];var a;if(A(`[`,!0)){do a=re(!0),r.push(a);while(A(`,`,!0));A(`]`),a!==void 0&&Y(e,t+`.`+X,a)}}else r=re(!0),Y(e,t+`.`+X,r);var o=n[i];o&&(r=[].concat(o,r)),n[i]=r,A(`,`,!0),A(`;`,!0)}return n}var s=re(!0);return Y(e,t,s),s}function Y(e,t,n){if(I===e&&/^features\./.test(t)){te[t]=n;return}e.setOption&&e.setOption(t,n)}function me(e,t,n,r){e.setParsedOption&&e.setParsedOption(t,n,r)}function he(e){if(A(`[`,!0)){do J(e,`option`);while(A(`,`,!0));A(`]`)}return e}function ge(e,t){if(!x.test(t=D()))throw z(t,`service name`);var n=new l(t);W(n,function(e){if(!ce(n,e))if(e===`rpc`)_e(n,e);else throw z(e)}),e.add(n),e===I&&L.push(n)}function _e(e,t){var n=j(),r=t;if(!x.test(t=D()))throw z(t,`name`);var i=t,a,o,s,c;if(A(`(`),A(`stream`,!0)&&(o=!0),!S.test(t=D())||(a=t,A(`)`),A(`returns`),A(`(`),A(`stream`,!0)&&(c=!0),!S.test(t=D())))throw z(t);s=t,A(`)`);var l=new u(i,r,a,s,o,c);l.comment=n,W(l,function(e){if(e===`option`)J(l,e),A(`;`);else throw z(e)}),e.add(l)}function ve(e,t){if(!S.test(t=D()))throw z(t,`reference`);var n=t;W(null,function(t){switch(t){case`required`:case`repeated`:K(e,t,n);break;case`optional`:F===`proto3`?K(e,`proto3_optional`,n):K(e,`optional`,n);break;default:if(F===`proto2`||!S.test(t))throw z(t);O(t),K(e,`optional`,n);break}})}for(var X;(X=D())!==null;)switch(X){case`package`:if(!M)throw z(X);H();break;case`import`:if(!M)throw z(X);U();break;case`syntax`:if(!M)throw z(X);oe();break;case`edition`:if(!M)throw z(X);se();break;case`option`:J(I,X),A(`;`,!0);break;default:if(ce(I,X)){M=!1;continue}throw z(X)}return ne(),C.filename=null,{package:N,imports:ee,weakImports:P,root:t}}})),ot=i(((e,t)=>{t.exports=r;var n=/\/|\./;function r(e,t){n.test(e)||(e=`google/protobuf/`+e+`.proto`,t={nested:{google:{nested:{protobuf:{nested:t}}}}}),r[e]=t}r(`any`,{Any:{fields:{type_url:{type:`string`,id:1},value:{type:`bytes`,id:2}}}});var i;r(`duration`,{Duration:i={fields:{seconds:{type:`int64`,id:1},nanos:{type:`int32`,id:2}}}}),r(`timestamp`,{Timestamp:i}),r(`empty`,{Empty:{fields:{}}}),r(`struct`,{Struct:{fields:{fields:{keyType:`string`,type:`Value`,id:1}}},Value:{oneofs:{kind:{oneof:[`nullValue`,`numberValue`,`stringValue`,`boolValue`,`structValue`,`listValue`]}},fields:{nullValue:{type:`NullValue`,id:1},numberValue:{type:`double`,id:2},stringValue:{type:`string`,id:3},boolValue:{type:`bool`,id:4},structValue:{type:`Struct`,id:5},listValue:{type:`ListValue`,id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:`repeated`,type:`Value`,id:1}}}}),r(`wrappers`,{DoubleValue:{fields:{value:{type:`double`,id:1}}},FloatValue:{fields:{value:{type:`float`,id:1}}},Int64Value:{fields:{value:{type:`int64`,id:1}}},UInt64Value:{fields:{value:{type:`uint64`,id:1}}},Int32Value:{fields:{value:{type:`int32`,id:1}}},UInt32Value:{fields:{value:{type:`uint32`,id:1}}},BoolValue:{fields:{value:{type:`bool`,id:1}}},StringValue:{fields:{value:{type:`string`,id:1}}},BytesValue:{fields:{value:{type:`bytes`,id:1}}}}),r(`field_mask`,{FieldMask:{fields:{paths:{rule:`repeated`,type:`string`,id:1}}}}),r.get=function(e){return r[e]||null}})),st=i(((e,t)=>{var n=t.exports=rt();n.build=`full`,n.tokenize=it(),n.parse=at(),n.common=ot(),n.Root._configure(n.Type,n.parse,n.common)})),ct=i(((e,t)=>{t.exports=st()})),lt=r({default:()=>dt,nested:()=>ut}),ut,dt,ft=n((()=>{ut=JSON.parse(`{"google":{"nested":{"protobuf":{"options":{"go_package":"google.golang.org/protobuf/types/descriptorpb","java_package":"com.google.protobuf","java_outer_classname":"DescriptorProtos","csharp_namespace":"Google.Protobuf.Reflection","objc_class_prefix":"GPB","cc_enable_arenas":true,"optimize_for":"SPEED"},"nested":{"FileDescriptorSet":{"edition":"proto2","fields":{"file":{"rule":"repeated","type":"FileDescriptorProto","id":1}},"extensions":[[536000000,536000000]]},"Edition":{"edition":"proto2","values":{"EDITION_UNKNOWN":0,"EDITION_LEGACY":900,"EDITION_PROTO2":998,"EDITION_PROTO3":999,"EDITION_2023":1000,"EDITION_2024":1001,"EDITION_1_TEST_ONLY":1,"EDITION_2_TEST_ONLY":2,"EDITION_99997_TEST_ONLY":99997,"EDITION_99998_TEST_ONLY":99998,"EDITION_99999_TEST_ONLY":99999,"EDITION_MAX":2147483647}},"FileDescriptorProto":{"edition":"proto2","fields":{"name":{"type":"string","id":1},"package":{"type":"string","id":2},"dependency":{"rule":"repeated","type":"string","id":3},"publicDependency":{"rule":"repeated","type":"int32","id":10},"weakDependency":{"rule":"repeated","type":"int32","id":11},"optionDependency":{"rule":"repeated","type":"string","id":15},"messageType":{"rule":"repeated","type":"DescriptorProto","id":4},"enumType":{"rule":"repeated","type":"EnumDescriptorProto","id":5},"service":{"rule":"repeated","type":"ServiceDescriptorProto","id":6},"extension":{"rule":"repeated","type":"FieldDescriptorProto","id":7},"options":{"type":"FileOptions","id":8},"sourceCodeInfo":{"type":"SourceCodeInfo","id":9},"syntax":{"type":"string","id":12},"edition":{"type":"Edition","id":14}}},"DescriptorProto":{"edition":"proto2","fields":{"name":{"type":"string","id":1},"field":{"rule":"repeated","type":"FieldDescriptorProto","id":2},"extension":{"rule":"repeated","type":"FieldDescriptorProto","id":6},"nestedType":{"rule":"repeated","type":"DescriptorProto","id":3},"enumType":{"rule":"repeated","type":"EnumDescriptorProto","id":4},"extensionRange":{"rule":"repeated","type":"ExtensionRange","id":5},"oneofDecl":{"rule":"repeated","type":"OneofDescriptorProto","id":8},"options":{"type":"MessageOptions","id":7},"reservedRange":{"rule":"repeated","type":"ReservedRange","id":9},"reservedName":{"rule":"repeated","type":"string","id":10},"visibility":{"type":"SymbolVisibility","id":11}},"nested":{"ExtensionRange":{"fields":{"start":{"type":"int32","id":1},"end":{"type":"int32","id":2},"options":{"type":"ExtensionRangeOptions","id":3}}},"ReservedRange":{"fields":{"start":{"type":"int32","id":1},"end":{"type":"int32","id":2}}}}},"ExtensionRangeOptions":{"edition":"proto2","fields":{"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999},"declaration":{"rule":"repeated","type":"Declaration","id":2,"options":{"retention":"RETENTION_SOURCE"}},"features":{"type":"FeatureSet","id":50},"verification":{"type":"VerificationState","id":3,"options":{"default":"UNVERIFIED","retention":"RETENTION_SOURCE"}}},"extensions":[[1000,536870911]],"nested":{"Declaration":{"fields":{"number":{"type":"int32","id":1},"fullName":{"type":"string","id":2},"type":{"type":"string","id":3},"reserved":{"type":"bool","id":5},"repeated":{"type":"bool","id":6}},"reserved":[[4,4]]},"VerificationState":{"values":{"DECLARATION":0,"UNVERIFIED":1}}}},"FieldDescriptorProto":{"edition":"proto2","fields":{"name":{"type":"string","id":1},"number":{"type":"int32","id":3},"label":{"type":"Label","id":4},"type":{"type":"Type","id":5},"typeName":{"type":"string","id":6},"extendee":{"type":"string","id":2},"defaultValue":{"type":"string","id":7},"oneofIndex":{"type":"int32","id":9},"jsonName":{"type":"string","id":10},"options":{"type":"FieldOptions","id":8},"proto3Optional":{"type":"bool","id":17}},"nested":{"Type":{"values":{"TYPE_DOUBLE":1,"TYPE_FLOAT":2,"TYPE_INT64":3,"TYPE_UINT64":4,"TYPE_INT32":5,"TYPE_FIXED64":6,"TYPE_FIXED32":7,"TYPE_BOOL":8,"TYPE_STRING":9,"TYPE_GROUP":10,"TYPE_MESSAGE":11,"TYPE_BYTES":12,"TYPE_UINT32":13,"TYPE_ENUM":14,"TYPE_SFIXED32":15,"TYPE_SFIXED64":16,"TYPE_SINT32":17,"TYPE_SINT64":18}},"Label":{"values":{"LABEL_OPTIONAL":1,"LABEL_REPEATED":3,"LABEL_REQUIRED":2}}}},"OneofDescriptorProto":{"edition":"proto2","fields":{"name":{"type":"string","id":1},"options":{"type":"OneofOptions","id":2}}},"EnumDescriptorProto":{"edition":"proto2","fields":{"name":{"type":"string","id":1},"value":{"rule":"repeated","type":"EnumValueDescriptorProto","id":2},"options":{"type":"EnumOptions","id":3},"reservedRange":{"rule":"repeated","type":"EnumReservedRange","id":4},"reservedName":{"rule":"repeated","type":"string","id":5},"visibility":{"type":"SymbolVisibility","id":6}},"nested":{"EnumReservedRange":{"fields":{"start":{"type":"int32","id":1},"end":{"type":"int32","id":2}}}}},"EnumValueDescriptorProto":{"edition":"proto2","fields":{"name":{"type":"string","id":1},"number":{"type":"int32","id":2},"options":{"type":"EnumValueOptions","id":3}}},"ServiceDescriptorProto":{"edition":"proto2","fields":{"name":{"type":"string","id":1},"method":{"rule":"repeated","type":"MethodDescriptorProto","id":2},"options":{"type":"ServiceOptions","id":3}}},"MethodDescriptorProto":{"edition":"proto2","fields":{"name":{"type":"string","id":1},"inputType":{"type":"string","id":2},"outputType":{"type":"string","id":3},"options":{"type":"MethodOptions","id":4},"clientStreaming":{"type":"bool","id":5},"serverStreaming":{"type":"bool","id":6}}},"FileOptions":{"edition":"proto2","fields":{"javaPackage":{"type":"string","id":1},"javaOuterClassname":{"type":"string","id":8},"javaMultipleFiles":{"type":"bool","id":10},"javaGenerateEqualsAndHash":{"type":"bool","id":20,"options":{"deprecated":true}},"javaStringCheckUtf8":{"type":"bool","id":27},"optimizeFor":{"type":"OptimizeMode","id":9,"options":{"default":"SPEED"}},"goPackage":{"type":"string","id":11},"ccGenericServices":{"type":"bool","id":16},"javaGenericServices":{"type":"bool","id":17},"pyGenericServices":{"type":"bool","id":18},"deprecated":{"type":"bool","id":23},"ccEnableArenas":{"type":"bool","id":31,"options":{"default":true}},"objcClassPrefix":{"type":"string","id":36},"csharpNamespace":{"type":"string","id":37},"swiftPrefix":{"type":"string","id":39},"phpClassPrefix":{"type":"string","id":40},"phpNamespace":{"type":"string","id":41},"phpMetadataNamespace":{"type":"string","id":44},"rubyPackage":{"type":"string","id":45},"features":{"type":"FeatureSet","id":50},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"reserved":[[42,42],[38,38],"php_generic_services"],"nested":{"OptimizeMode":{"values":{"SPEED":1,"CODE_SIZE":2,"LITE_RUNTIME":3}}}},"MessageOptions":{"edition":"proto2","fields":{"messageSetWireFormat":{"type":"bool","id":1},"noStandardDescriptorAccessor":{"type":"bool","id":2},"deprecated":{"type":"bool","id":3},"mapEntry":{"type":"bool","id":7},"deprecatedLegacyJsonFieldConflicts":{"type":"bool","id":11,"options":{"deprecated":true}},"features":{"type":"FeatureSet","id":12},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"reserved":[[4,4],[5,5],[6,6],[8,8],[9,9]]},"FieldOptions":{"edition":"proto2","fields":{"ctype":{"type":"CType","id":1,"options":{"default":"STRING"}},"packed":{"type":"bool","id":2},"jstype":{"type":"JSType","id":6,"options":{"default":"JS_NORMAL"}},"lazy":{"type":"bool","id":5},"unverifiedLazy":{"type":"bool","id":15},"deprecated":{"type":"bool","id":3},"weak":{"type":"bool","id":10,"options":{"deprecated":true}},"debugRedact":{"type":"bool","id":16},"retention":{"type":"OptionRetention","id":17},"targets":{"rule":"repeated","type":"OptionTargetType","id":19},"editionDefaults":{"rule":"repeated","type":"EditionDefault","id":20},"features":{"type":"FeatureSet","id":21},"featureSupport":{"type":"FeatureSupport","id":22},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"reserved":[[4,4],[18,18]],"nested":{"CType":{"values":{"STRING":0,"CORD":1,"STRING_PIECE":2}},"JSType":{"values":{"JS_NORMAL":0,"JS_STRING":1,"JS_NUMBER":2}},"OptionRetention":{"values":{"RETENTION_UNKNOWN":0,"RETENTION_RUNTIME":1,"RETENTION_SOURCE":2}},"OptionTargetType":{"values":{"TARGET_TYPE_UNKNOWN":0,"TARGET_TYPE_FILE":1,"TARGET_TYPE_EXTENSION_RANGE":2,"TARGET_TYPE_MESSAGE":3,"TARGET_TYPE_FIELD":4,"TARGET_TYPE_ONEOF":5,"TARGET_TYPE_ENUM":6,"TARGET_TYPE_ENUM_ENTRY":7,"TARGET_TYPE_SERVICE":8,"TARGET_TYPE_METHOD":9}},"EditionDefault":{"fields":{"edition":{"type":"Edition","id":3},"value":{"type":"string","id":2}}},"FeatureSupport":{"fields":{"editionIntroduced":{"type":"Edition","id":1},"editionDeprecated":{"type":"Edition","id":2},"deprecationWarning":{"type":"string","id":3},"editionRemoved":{"type":"Edition","id":4}}}}},"OneofOptions":{"edition":"proto2","fields":{"features":{"type":"FeatureSet","id":1},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]]},"EnumOptions":{"edition":"proto2","fields":{"allowAlias":{"type":"bool","id":2},"deprecated":{"type":"bool","id":3},"deprecatedLegacyJsonFieldConflicts":{"type":"bool","id":6,"options":{"deprecated":true}},"features":{"type":"FeatureSet","id":7},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"reserved":[[5,5]]},"EnumValueOptions":{"edition":"proto2","fields":{"deprecated":{"type":"bool","id":1},"features":{"type":"FeatureSet","id":2},"debugRedact":{"type":"bool","id":3},"featureSupport":{"type":"FieldOptions.FeatureSupport","id":4},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]]},"ServiceOptions":{"edition":"proto2","fields":{"features":{"type":"FeatureSet","id":34},"deprecated":{"type":"bool","id":33},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]]},"MethodOptions":{"edition":"proto2","fields":{"deprecated":{"type":"bool","id":33},"idempotencyLevel":{"type":"IdempotencyLevel","id":34,"options":{"default":"IDEMPOTENCY_UNKNOWN"}},"features":{"type":"FeatureSet","id":35},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"nested":{"IdempotencyLevel":{"values":{"IDEMPOTENCY_UNKNOWN":0,"NO_SIDE_EFFECTS":1,"IDEMPOTENT":2}}}},"UninterpretedOption":{"edition":"proto2","fields":{"name":{"rule":"repeated","type":"NamePart","id":2},"identifierValue":{"type":"string","id":3},"positiveIntValue":{"type":"uint64","id":4},"negativeIntValue":{"type":"int64","id":5},"doubleValue":{"type":"double","id":6},"stringValue":{"type":"bytes","id":7},"aggregateValue":{"type":"string","id":8}},"nested":{"NamePart":{"fields":{"namePart":{"rule":"required","type":"string","id":1},"isExtension":{"rule":"required","type":"bool","id":2}}}}},"FeatureSet":{"edition":"proto2","fields":{"fieldPresence":{"type":"FieldPresence","id":1,"options":{"retention":"RETENTION_RUNTIME","targets":"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},"enumType":{"type":"EnumType","id":2,"options":{"retention":"RETENTION_RUNTIME","targets":"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},"repeatedFieldEncoding":{"type":"RepeatedFieldEncoding","id":3,"options":{"retention":"RETENTION_RUNTIME","targets":"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},"utf8Validation":{"type":"Utf8Validation","id":4,"options":{"retention":"RETENTION_RUNTIME","targets":"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},"messageEncoding":{"type":"MessageEncoding","id":5,"options":{"retention":"RETENTION_RUNTIME","targets":"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},"jsonFormat":{"type":"JsonFormat","id":6,"options":{"retention":"RETENTION_RUNTIME","targets":"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},"enforceNamingStyle":{"type":"EnforceNamingStyle","id":7,"options":{"retention":"RETENTION_SOURCE","targets":"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},"defaultSymbolVisibility":{"type":"VisibilityFeature.DefaultSymbolVisibility","id":8,"options":{"retention":"RETENTION_SOURCE","targets":"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},"extensions":[[1000,9994],[9995,9999],[10000,10000]],"reserved":[[999,999]],"nested":{"FieldPresence":{"values":{"FIELD_PRESENCE_UNKNOWN":0,"EXPLICIT":1,"IMPLICIT":2,"LEGACY_REQUIRED":3}},"EnumType":{"values":{"ENUM_TYPE_UNKNOWN":0,"OPEN":1,"CLOSED":2}},"RepeatedFieldEncoding":{"values":{"REPEATED_FIELD_ENCODING_UNKNOWN":0,"PACKED":1,"EXPANDED":2}},"Utf8Validation":{"values":{"UTF8_VALIDATION_UNKNOWN":0,"VERIFY":2,"NONE":3}},"MessageEncoding":{"values":{"MESSAGE_ENCODING_UNKNOWN":0,"LENGTH_PREFIXED":1,"DELIMITED":2}},"JsonFormat":{"values":{"JSON_FORMAT_UNKNOWN":0,"ALLOW":1,"LEGACY_BEST_EFFORT":2}},"EnforceNamingStyle":{"values":{"ENFORCE_NAMING_STYLE_UNKNOWN":0,"STYLE2024":1,"STYLE_LEGACY":2}},"VisibilityFeature":{"fields":{},"reserved":[[1,536870911]],"nested":{"DefaultSymbolVisibility":{"values":{"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN":0,"EXPORT_ALL":1,"EXPORT_TOP_LEVEL":2,"LOCAL_ALL":3,"STRICT":4}}}}}},"FeatureSetDefaults":{"edition":"proto2","fields":{"defaults":{"rule":"repeated","type":"FeatureSetEditionDefault","id":1},"minimumEdition":{"type":"Edition","id":4},"maximumEdition":{"type":"Edition","id":5}},"nested":{"FeatureSetEditionDefault":{"fields":{"edition":{"type":"Edition","id":3},"overridableFeatures":{"type":"FeatureSet","id":4},"fixedFeatures":{"type":"FeatureSet","id":5}},"reserved":[[1,1],[2,2],"features"]}}},"SourceCodeInfo":{"edition":"proto2","fields":{"location":{"rule":"repeated","type":"Location","id":1}},"extensions":[[536000000,536000000]],"nested":{"Location":{"fields":{"path":{"rule":"repeated","type":"int32","id":1,"options":{"packed":true}},"span":{"rule":"repeated","type":"int32","id":2,"options":{"packed":true}},"leadingComments":{"type":"string","id":3},"trailingComments":{"type":"string","id":4},"leadingDetachedComments":{"rule":"repeated","type":"string","id":6}}}}},"GeneratedCodeInfo":{"edition":"proto2","fields":{"annotation":{"rule":"repeated","type":"Annotation","id":1}},"nested":{"Annotation":{"fields":{"path":{"rule":"repeated","type":"int32","id":1,"options":{"packed":true}},"sourceFile":{"type":"string","id":2},"begin":{"type":"int32","id":3},"end":{"type":"int32","id":4},"semantic":{"type":"Semantic","id":5}},"nested":{"Semantic":{"values":{"NONE":0,"SET":1,"ALIAS":2}}}}}},"SymbolVisibility":{"edition":"proto2","values":{"VISIBILITY_UNSET":0,"VISIBILITY_LOCAL":1,"VISIBILITY_EXPORT":2}}}}}}}`),dt={nested:ut}})),pt=i(((t,n)=>{var r=ct();n.exports=t=r.descriptor=r.Root.fromJSON((ft(),e(lt).default)).lookup(`.google.protobuf`);var i=r.Namespace,a=r.Root,o=r.Enum,s=r.Type,c=r.Field,l=r.MapField,u=r.OneOf,d=r.Service,f=r.Method;a.fromDescriptor=function(e){typeof e.length==`number`&&(e=t.FileDescriptorSet.decode(e));var n=new a;if(e.file)for(var r,i,l=0,u;l<e.file.length;++l){i=n,(r=e.file[l]).package&&r.package.length&&(i=n.define(r.package));var f=k(r);if(r.name&&r.name.length&&n.files.push(i.filename=r.name),r.messageType)for(u=0;u<r.messageType.length;++u)i.add(s.fromDescriptor(r.messageType[u],f));if(r.enumType)for(u=0;u<r.enumType.length;++u)i.add(o.fromDescriptor(r.enumType[u],f));if(r.extension)for(u=0;u<r.extension.length;++u)i.add(c.fromDescriptor(r.extension[u],f));if(r.service)for(u=0;u<r.service.length;++u)i.add(d.fromDescriptor(r.service[u],f));var p=w(r.options,t.FileOptions);if(p){var m=Object.keys(p);for(u=0;u<m.length;++u)i.setOption(m[u],p[m[u]])}}return n.resolveAll()},a.prototype.toDescriptor=function(e){var n=t.FileDescriptorSet.create();return p(this,n.file,e),n};function p(e,n,r){var l=t.FileDescriptorProto.create({name:e.filename||(e.fullName.substring(1).replace(/\./g,`_`)||`root`)+`.proto`});A(r,l),e instanceof a||(l.package=e.fullName.substring(1));for(var u=0,f;u<e.nestedArray.length;++u)(f=e._nestedArray[u])instanceof s?l.messageType.push(f.toDescriptor(r)):f instanceof o?l.enumType.push(f.toDescriptor()):f instanceof c?l.extension.push(f.toDescriptor(r)):f instanceof d?l.service.push(f.toDescriptor()):f instanceof i&&p(f,n,r);l.options=E(e.options,t.FileOptions),l.messageType.length+l.enumType.length+l.extension.length+l.service.length&&n.push(l)}var m=0;s.fromDescriptor=function(e,n,r){typeof e.length==`number`&&(e=t.DescriptorProto.decode(e));var i=new s(e.name.length?e.name:`Type`+ m++,w(e.options,t.MessageOptions)),a;if(r||(i._edition=n),e.oneofDecl)for(a=0;a<e.oneofDecl.length;++a)i.add(u.fromDescriptor(e.oneofDecl[a]));if(e.field)for(a=0;a<e.field.length;++a){var l=c.fromDescriptor(e.field[a],n,!0);i.add(l),e.field[a].hasOwnProperty(`oneofIndex`)&&i.oneofsArray[e.field[a].oneofIndex].add(l)}if(e.extension)for(a=0;a<e.extension.length;++a)i.add(c.fromDescriptor(e.extension[a],n,!0));if(e.nestedType)for(a=0;a<e.nestedType.length;++a)i.add(s.fromDescriptor(e.nestedType[a],n,!0)),e.nestedType[a].options&&e.nestedType[a].options.mapEntry&&i.setOption(`map_entry`,!0);if(e.enumType)for(a=0;a<e.enumType.length;++a)i.add(o.fromDescriptor(e.enumType[a],n,!0));if(e.extensionRange&&e.extensionRange.length)for(i.extensions=[],a=0;a<e.extensionRange.length;++a)i.extensions.push([e.extensionRange[a].start,e.extensionRange[a].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(i.reserved=[],e.reservedRange)for(a=0;a<e.reservedRange.length;++a)i.reserved.push([e.reservedRange[a].start,e.reservedRange[a].end]);if(e.reservedName)for(a=0;a<e.reservedName.length;++a)i.reserved.push(e.reservedName[a])}return i},s.prototype.toDescriptor=function(e){var n=t.DescriptorProto.create({name:this.name}),r;for(r=0;r<this.fieldsArray.length;++r){var i;if(n.field.push(i=this._fieldsArray[r].toDescriptor(e)),this._fieldsArray[r]instanceof l){var a=S(this._fieldsArray[r].keyType,this._fieldsArray[r].resolvedKeyType,!1),u=S(this._fieldsArray[r].type,this._fieldsArray[r].resolvedType,!1),d=u===11||u===14?this._fieldsArray[r].resolvedType&&D(this.parent,this._fieldsArray[r].resolvedType)||this._fieldsArray[r].type:void 0;n.nestedType.push(t.DescriptorProto.create({name:i.typeName,field:[t.FieldDescriptorProto.create({name:`key`,number:1,label:1,type:a}),t.FieldDescriptorProto.create({name:`value`,number:2,label:1,type:u,typeName:d})],options:t.MessageOptions.create({mapEntry:!0})}))}}for(r=0;r<this.oneofsArray.length;++r)n.oneofDecl.push(this._oneofsArray[r].toDescriptor());for(r=0;r<this.nestedArray.length;++r)this._nestedArray[r]instanceof c?n.field.push(this._nestedArray[r].toDescriptor(e)):this._nestedArray[r]instanceof s?n.nestedType.push(this._nestedArray[r].toDescriptor(e)):this._nestedArray[r]instanceof o&&n.enumType.push(this._nestedArray[r].toDescriptor());if(this.extensions)for(r=0;r<this.extensions.length;++r)n.extensionRange.push(t.DescriptorProto.ExtensionRange.create({start:this.extensions[r][0],end:this.extensions[r][1]}));if(this.reserved)for(r=0;r<this.reserved.length;++r)typeof this.reserved[r]==`string`?n.reservedName.push(this.reserved[r]):n.reservedRange.push(t.DescriptorProto.ReservedRange.create({start:this.reserved[r][0],end:this.reserved[r][1]}));return n.options=E(this.options,t.MessageOptions),n};var h=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;c.fromDescriptor=function(e,n,r){if(typeof e.length==`number`&&(e=t.DescriptorProto.decode(e)),typeof e.number!=`number`)throw Error(`missing field id`);var i=e.typeName&&e.typeName.length?e.typeName:b(e.type),a;switch(e.label){case 1:a=void 0;break;case 2:a=`required`;break;case 3:a=`repeated`;break;default:throw Error(`illegal label: `+e.label)}var o=e.extendee;e.extendee!==void 0&&(o=o.length?o:void 0);var s=new c(e.name.length?e.name:`field`+e.number,e.number,i,a,o);if(r||(s._edition=n),s.options=w(e.options,t.FieldOptions),e.proto3_optional&&(s.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var l=e.defaultValue;switch(l){case`true`:case`TRUE`:l=!0;break;case`false`:case`FALSE`:l=!1;break;default:h.exec(l)&&(l=parseInt(l));break}s.setOption(`default`,l)}return x(e.type)&&(n===`proto3`?e.options&&!e.options.packed&&s.setOption(`packed`,!1):(!n||n===`proto2`)&&e.options&&e.options.packed&&s.setOption(`packed`,!0)),s},c.prototype.toDescriptor=function(e){var n=t.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)n.type=11,n.typeName=r.util.ucFirst(this.name),n.label=3;else{switch(n.type=S(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:n.typeName=this.resolvedType?D(this.parent,this.resolvedType):this.type;break}this.rule===`repeated`?n.label=3:this.required&&e===`proto2`?n.label=2:n.label=1}if(n.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&(n.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error(`missing oneof`);return this.options&&(n.options=E(this.options,t.FieldOptions),this.options.default!=null&&(n.defaultValue=String(this.options.default)),this.options.proto3_optional&&(n.proto3_optional=!0)),e===`proto3`?this.packed||((n.options||(n.options=t.FieldOptions.create())).packed=!1):(!e||e===`proto2`)&&this.packed&&((n.options||(n.options=t.FieldOptions.create())).packed=!0),n};var g=0;o.fromDescriptor=function(e,n,r){typeof e.length==`number`&&(e=t.EnumDescriptorProto.decode(e));var i={};if(e.value)for(var a=0;a<e.value.length;++a){var s=e.value[a].name,c=e.value[a].number||0;i[s&&s.length?s:`NAME`+c]=c}var l=new o(e.name&&e.name.length?e.name:`Enum`+ g++,i,w(e.options,t.EnumOptions));return r||(l._edition=n),l},o.prototype.toDescriptor=function(){for(var e=[],n=0,r=Object.keys(this.values);n<r.length;++n)e.push(t.EnumValueDescriptorProto.create({name:r[n],number:this.values[r[n]]}));return t.EnumDescriptorProto.create({name:this.name,value:e,options:E(this.options,t.EnumOptions)})};var _=0;u.fromDescriptor=function(e){return typeof e.length==`number`&&(e=t.OneofDescriptorProto.decode(e)),new u(e.name&&e.name.length?e.name:`oneof`+ _++)},u.prototype.toDescriptor=function(){return t.OneofDescriptorProto.create({name:this.name})};var v=0;d.fromDescriptor=function(e,n,r){typeof e.length==`number`&&(e=t.ServiceDescriptorProto.decode(e));var i=new d(e.name&&e.name.length?e.name:`Service`+ v++,w(e.options,t.ServiceOptions));if(r||(i._edition=n),e.method)for(var a=0;a<e.method.length;++a)i.add(f.fromDescriptor(e.method[a]));return i},d.prototype.toDescriptor=function(){for(var e=[],n=0;n<this.methodsArray.length;++n)e.push(this._methodsArray[n].toDescriptor());return t.ServiceDescriptorProto.create({name:this.name,method:e,options:E(this.options,t.ServiceOptions)})};var y=0;f.fromDescriptor=function(e){return typeof e.length==`number`&&(e=t.MethodDescriptorProto.decode(e)),new f(e.name&&e.name.length?e.name:`Method`+ y++,`rpc`,e.inputType,e.outputType,!!e.clientStreaming,!!e.serverStreaming,w(e.options,t.MethodOptions))},f.prototype.toDescriptor=function(){return t.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:E(this.options,t.MethodOptions)})};function b(e){switch(e){case 1:return`double`;case 2:return`float`;case 3:return`int64`;case 4:return`uint64`;case 5:return`int32`;case 6:return`fixed64`;case 7:return`fixed32`;case 8:return`bool`;case 9:return`string`;case 12:return`bytes`;case 13:return`uint32`;case 15:return`sfixed32`;case 16:return`sfixed64`;case 17:return`sint32`;case 18:return`sint64`}throw Error(`illegal type: `+e)}function x(e){switch(e){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}function S(e,t,n){switch(e){case`double`:return 1;case`float`:return 2;case`int64`:return 3;case`uint64`:return 4;case`int32`:return 5;case`fixed64`:return 6;case`fixed32`:return 7;case`bool`:return 8;case`string`:return 9;case`bytes`:return 12;case`uint32`:return 13;case`sfixed32`:return 15;case`sfixed64`:return 16;case`sint32`:return 17;case`sint64`:return 18}if(t instanceof o)return 14;if(t instanceof s)return n?10:11;throw Error(`illegal type: `+e)}function C(e,t){for(var n={},r=0,i,a;r<t.fieldsArray.length;++r)if((a=(i=t._fieldsArray[r]).name)!==`uninterpretedOption`&&Object.prototype.hasOwnProperty.call(e,a)){var c=O(a);i.resolvedType instanceof s?n[c]=C(e[a],i.resolvedType):i.resolvedType instanceof o?n[c]=i.resolvedType.valuesById[e[a]]:n[c]=e[a]}return n}function w(e,t){if(e)return C(t.toObject(e),t)}function T(e,t){for(var n={},i=Object.keys(e),a=0;a<i.length;++a){var o=i[a],c=r.util.camelCase(o);if(Object.prototype.hasOwnProperty.call(t.fields,c)){var l=t.fields[c];l.resolvedType instanceof s?n[c]=T(e[o],l.resolvedType):n[c]=e[o],l.repeated&&!Array.isArray(n[c])&&(n[c]=[n[c]])}}return n}function E(e,t){if(e)return t.fromObject(T(e,t))}function D(e,t){var n=e.fullName.split(`.`),r=t.fullName.split(`.`),o=0,s=0,c=r.length-1;if(!(e instanceof a)&&t instanceof i)for(;o<n.length&&s<c&&n[o]===r[s];){var l=t.lookup(n[o++],!0);if(l!==null&&l!==t)break;++s}else for(;o<n.length&&s<c&&n[o]===r[s];++o,++s);return r.slice(s).join(`.`)}function O(e){return e.substring(0,1)+e.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return`_`+t.toLowerCase()})}function k(e){if(e.syntax===`editions`)switch(e.edition){case t.Edition.EDITION_2023:return`2023`;default:throw Error(`Unsupported edition `+e.edition)}return e.syntax===`proto3`?`proto3`:`proto2`}function A(e,n){if(e)if(e===`proto2`||e===`proto3`)n.syntax=e;else switch(n.syntax=`editions`,e){case`2023`:n.edition=t.Edition.EDITION_2023;break;default:throw Error(`Unsupported edition `+e)}}})),mt=r({default:()=>gt,nested:()=>ht}),ht,gt,_t=n((()=>{ht={google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:`string`,id:1},methods:{rule:`repeated`,type:`Method`,id:2},options:{rule:`repeated`,type:`Option`,id:3},version:{type:`string`,id:4},sourceContext:{type:`SourceContext`,id:5},mixins:{rule:`repeated`,type:`Mixin`,id:6},syntax:{type:`Syntax`,id:7}}},Method:{fields:{name:{type:`string`,id:1},requestTypeUrl:{type:`string`,id:2},requestStreaming:{type:`bool`,id:3},responseTypeUrl:{type:`string`,id:4},responseStreaming:{type:`bool`,id:5},options:{rule:`repeated`,type:`Option`,id:6},syntax:{type:`Syntax`,id:7}}},Mixin:{fields:{name:{type:`string`,id:1},root:{type:`string`,id:2}}},SourceContext:{fields:{fileName:{type:`string`,id:1}}},Option:{fields:{name:{type:`string`,id:1},value:{type:`Any`,id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}},gt={nested:ht}})),vt=r({default:()=>bt,nested:()=>yt}),yt,bt,xt=n((()=>{yt={google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:`string`,id:1}}}}}}}},bt={nested:yt}})),St=r({default:()=>wt,nested:()=>Ct}),Ct,wt,Tt=n((()=>{Ct={google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:`string`,id:1},fields:{rule:`repeated`,type:`Field`,id:2},oneofs:{rule:`repeated`,type:`string`,id:3},options:{rule:`repeated`,type:`Option`,id:4},sourceContext:{type:`SourceContext`,id:5},syntax:{type:`Syntax`,id:6}}},Field:{fields:{kind:{type:`Kind`,id:1},cardinality:{type:`Cardinality`,id:2},number:{type:`int32`,id:3},name:{type:`string`,id:4},typeUrl:{type:`string`,id:6},oneofIndex:{type:`int32`,id:7},packed:{type:`bool`,id:8},options:{rule:`repeated`,type:`Option`,id:9},jsonName:{type:`string`,id:10},defaultValue:{type:`string`,id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:`string`,id:1},enumvalue:{rule:`repeated`,type:`EnumValue`,id:2},options:{rule:`repeated`,type:`Option`,id:3},sourceContext:{type:`SourceContext`,id:4},syntax:{type:`Syntax`,id:5}}},EnumValue:{fields:{name:{type:`string`,id:1},number:{type:`int32`,id:2},options:{rule:`repeated`,type:`Option`,id:3}}},Option:{fields:{name:{type:`string`,id:1},value:{type:`Any`,id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:`string`,id:1},value:{type:`bytes`,id:2}}},SourceContext:{fields:{fileName:{type:`string`,id:1}}}}}}}},wt={nested:Ct}})),Et=i((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.addCommonProtos=n.loadProtosWithOptionsSync=n.loadProtosWithOptions=void 0;var r=t(`fs`),i=t(`path`),a=ct();function o(e,t){let n=e.resolvePath;e.resolvePath=(e,a)=>{if(i.isAbsolute(a))return a;for(let e of t){let t=i.join(e,a);try{return r.accessSync(t,r.constants.R_OK),t}catch{continue}}return process.emitWarning(`${a} not found in any of the include paths ${t}`),n(e,a)}}async function s(e,t){let n=new a.Root;if(t=t||{},t.includeDirs){if(!Array.isArray(t.includeDirs))return Promise.reject(Error(`The includeDirs option must be an array`));o(n,t.includeDirs)}let r=await n.load(e,t);return r.resolveAll(),r}n.loadProtosWithOptions=s;function c(e,t){let n=new a.Root;if(t=t||{},t.includeDirs){if(!Array.isArray(t.includeDirs))throw Error(`The includeDirs option must be an array`);o(n,t.includeDirs)}let r=n.loadSync(e,t);return r.resolveAll(),r}n.loadProtosWithOptionsSync=c;function l(){let t=(_t(),e(mt).default),n=(ft(),e(lt).default),r=(xt(),e(vt).default),i=(Tt(),e(St).default);a.common(`api`,t.nested.google.nested.protobuf.nested),a.common(`descriptor`,n.nested.google.nested.protobuf.nested),a.common(`source_context`,r.nested.google.nested.protobuf.nested),a.common(`type`,i.nested.google.nested.protobuf.nested)}n.addCommonProtos=l})),Dt=i(((e,t)=>{(function(n,r){function i(e){return e.default||e}typeof define==`function`&&define.amd?define([],function(){var e={};return r(e),i(e)}):typeof e==`object`?(r(e),typeof t==`object`&&(t.exports=i(e))):(function(){var e={};r(e),n.Long=i(e)})()})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:e,function(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function n(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}n.prototype.__isLong__,Object.defineProperty(n.prototype,`__isLong__`,{value:!0});function r(e){return(e&&e.__isLong__)===!0}function i(e){var t=Math.clz32(e&-e);return e?31-t:t}n.isLong=r;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}n.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return T}else{if(e<=-_)return E;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}n.fromNumber=c;function l(e,t,r){return new n(e,t,r)}n.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?b:y;if(n=n||10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}n.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}n.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);n.ZERO=y;var b=s(0,!0);n.UZERO=b;var x=s(1);n.ONE=x;var S=s(1,!0);n.UONE=S;var C=s(-1);n.NEG_ONE=C;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var T=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=T;var E=l(0,-2147483648,!1);n.MIN_VALUE=E;var D=n.prototype;D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},D.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(E)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},D.isSafeInteger=function(){var e=this.high>>21;return e?this.unsigned?!1:e===-1&&!(this.low===0&&this.high===-2097152):!0},D.isZero=function(){return this.high===0&&this.low===0},D.eqz=D.isZero,D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||this.high>=0},D.isOdd=function(){return(this.low&1)==1},D.isEven=function(){return(this.low&1)==0},D.equals=function(e){return r(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.ne=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.le=D.lessThanOrEqual,D.greaterThan=function(e){return this.comp(e)>0},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return this.comp(e)>=0},D.gte=D.greaterThanOrEqual,D.ge=D.greaterThanOrEqual,D.compare=function(e){if(r(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(x)},D.neg=D.negate,D.add=function(e){r(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=i+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},D.subtract=function(e){return r(e)||(e=f(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return this;if(r(e)||(e=f(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?b:y;if(this.eq(E))return e.isOdd()?E:y;if(e.eq(E))return this.isOdd()?E:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=i*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=n*p+i*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(r(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(t)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var n,i,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(E))return e.eq(x)||e.eq(C)?E:e.eq(E)?x:(n=this.shr(1).div(e).shl(1),n.eq(y)?e.isNegative()?x:C:(i=this.sub(e.mul(n)),a=n.add(i.div(e)),a));if(e.eq(E))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(n),p=d.mul(e);p.isNegative()||p.gt(i);)n-=s,d=c(n,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),i=i.sub(p)}return a},D.div=D.divide,D.modulo=function(e){return r(e)||(e=f(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.rem=D.modulo,D.not=function(){return l(~this.low,~this.high,this.unsigned)},D.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},D.clz=D.countLeadingZeros,D.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},D.ctz=D.countTrailingZeros,D.and=function(e){return r(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return r(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return r(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):l(e===32?this.high:this.high>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.shr_u=D.shiftRightUnsigned,D.rotateLeft=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,l(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},D.rotl=D.rotateLeft,D.rotateRight=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,l(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},D.rotr=D.rotateRight,D.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},D.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},D.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},D.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(n.fromBigInt=function(e,t){return l(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},n.fromValue=function(e,t){return typeof e==`bigint`?n.fromBigInt(e,t):f(e,t)},D.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e}),e.default=n})})),Ot=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.loadFileDescriptorSetFromObject=e.loadFileDescriptorSetFromBuffer=e.fromJSON=e.loadSync=e.load=e.IdempotencyLevel=e.isAnyExtension=e.Long=void 0;var t=De(),n=ct(),r=pt(),i=Et();e.Long=Dt();function a(e){return`@type`in e&&typeof e[`@type`]==`string`}e.isAnyExtension=a;var o;(function(e){e.IDEMPOTENCY_UNKNOWN=`IDEMPOTENCY_UNKNOWN`,e.NO_SIDE_EFFECTS=`NO_SIDE_EFFECTS`,e.IDEMPOTENT=`IDEMPOTENT`})(o=e.IdempotencyLevel||(e.IdempotencyLevel={}));var s={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function c(e,t){return e===``?t:e+`.`+t}function l(e){return e instanceof n.Service||e instanceof n.Type||e instanceof n.Enum}function u(e){return e instanceof n.Namespace||e instanceof n.Root}function d(e,t){let n=c(t,e.name);return l(e)?[[n,e]]:u(e)&&e.nested!==void 0?Object.keys(e.nested).map(t=>d(e.nested[t],n)).reduce((e,t)=>e.concat(t),[]):[]}function f(e,t){return function(n){return e.toObject(e.decode(n),t)}}function p(e){return function(t){if(Array.isArray(t))throw Error(`Failed to serialize message: expected object with ${e.name} structure, got array instead`);let n=e.fromObject(t);return e.encode(n).finish()}}function m(e){return(e||[]).reduce((e,t)=>{for(let[n,r]of Object.entries(t))switch(n){case`uninterpreted_option`:e.uninterpreted_option.push(t.uninterpreted_option);break;default:e[n]=r}return e},{deprecated:!1,idempotency_level:o.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function h(e,n,r,i){let a=e.resolvedRequestType,o=e.resolvedResponseType;return{path:`/`+n+`/`+e.name,requestStream:!!e.requestStream,responseStream:!!e.responseStream,requestSerialize:p(a),requestDeserialize:f(a,r),responseSerialize:p(o),responseDeserialize:f(o,r),originalName:t(e.name),requestType:_(a,r,i),responseType:_(o,r,i),options:m(e.parsedOptions)}}function g(e,t,n,r){let i={};for(let a of e.methodsArray)i[a.name]=h(a,t,n,r);return i}function _(e,t,n){let r=e.toDescriptor(`proto3`);return{format:`Protocol Buffer 3 DescriptorProto`,type:r.$type.toObject(r,s),fileDescriptorProtos:n,serialize:p(e),deserialize:f(e,t)}}function v(e,t){let n=e.toDescriptor(`proto3`);return{format:`Protocol Buffer 3 EnumDescriptorProto`,type:n.$type.toObject(n,s),fileDescriptorProtos:t}}function y(e,t,r,i){if(e instanceof n.Service)return g(e,t,r,i);if(e instanceof n.Type)return _(e,r,i);if(e instanceof n.Enum)return v(e,i);throw Error(`Type mismatch in reflection object handling`)}function b(e,t){let n={};e.resolveAll();let i=e.toDescriptor(`proto3`).file.map(e=>Buffer.from(r.FileDescriptorProto.encode(e).finish()));for(let[r,a]of d(e,``))n[r]=y(a,r,t,i);return n}function x(e,t){t=t||{};let r=n.Root.fromDescriptor(e);return r.resolveAll(),b(r,t)}function S(e,t){return(0,i.loadProtosWithOptions)(e,t).then(e=>b(e,t))}e.load=S;function C(e,t){return b((0,i.loadProtosWithOptionsSync)(e,t),t)}e.loadSync=C;function w(e,t){t=t||{};let r=n.Root.fromJSON(e);return r.resolveAll(),b(r,t)}e.fromJSON=w;function T(e,t){return x(r.FileDescriptorSet.decode(e),t)}e.loadFileDescriptorSetFromBuffer=T;function E(e,t){return x(r.FileDescriptorSet.fromObject(e),t)}e.loadFileDescriptorSetFromObject=E,(0,i.addCommonProtos)()})),kt=i((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.registerChannelzSocket=n.registerChannelzServer=n.registerChannelzSubchannel=n.registerChannelzChannel=n.ChannelzCallTrackerStub=n.ChannelzCallTracker=n.ChannelzChildrenTrackerStub=n.ChannelzChildrenTracker=n.ChannelzTrace=n.ChannelzTraceStub=void 0,n.unregisterChannelzRef=b,n.getChannelzHandlers=te,n.getChannelzServiceDefinition=ne,n.setup=z;var r=t(`net`),i=(be(),e(fe)),a=W(),o=C(),s=q(),c=xe(),l=Ee();function u(e){return{channel_id:e.id,name:e.name}}function d(e){return{subchannel_id:e.id,name:e.name}}function f(e){return{server_id:e.id}}function p(e){return{socket_id:e.id,name:e.name}}var m=32,h=100;n.ChannelzTraceStub=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:O(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}},n.ChannelzTrace=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,t,n){let r=new Date;this.events.push({description:t,severity:e,timestamp:r,childChannel:n?.kind===`channel`?n:void 0,childSubchannel:n?.kind===`subchannel`?n:void 0}),this.events.length>=m*2&&(this.events=this.events.slice(m)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:O(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:O(e.timestamp),channel_ref:e.childChannel?u(e.childChannel):null,subchannel_ref:e.childSubchannel?d(e.childSubchannel):null}))}}};var g=class{constructor(){this.channelChildren=new i.OrderedMap,this.subchannelChildren=new i.OrderedMap,this.socketChildren=new i.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let t=this.trackerMap[e.kind],n=t.find(e.id);n.equals(t.end())?t.setElement(e.id,{ref:e,count:1},n):n.pointer[1].count+=1}unrefChild(e){let t=this.trackerMap[e.kind],n=t.getElementByKey(e.id);n!==void 0&&(--n.count,n.count===0&&t.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};n.ChannelzChildrenTracker=g,n.ChannelzChildrenTrackerStub=class extends g{refChild(){}unrefChild(){}};var _=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};n.ChannelzCallTracker=_,n.ChannelzCallTrackerStub=class extends _{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};var v={channel:new i.OrderedMap,subchannel:new i.OrderedMap,server:new i.OrderedMap,socket:new i.OrderedMap},y=e=>{let t=1;function n(){return t++}let r=v[e];return(t,i,a)=>{let o=n(),s={id:o,name:t,kind:e};return a&&r.setElement(o,{ref:s,getInfo:i}),s}};n.registerChannelzChannel=y(`channel`),n.registerChannelzSubchannel=y(`subchannel`),n.registerChannelzServer=y(`server`),n.registerChannelzSocket=y(`socket`);function b(e){v[e.kind].eraseElementByKey(e.id)}function x(e){let t=Number.parseInt(e,16);return[t/256|0,t%256]}function S(e){if(e===``)return[];let t=e.split(`:`).map(e=>x(e));return[].concat(...t)}function w(e){return(0,r.isIPv6)(e)&&e.toLowerCase().startsWith(`::ffff:`)&&(0,r.isIPv4)(e.substring(7))}function T(e){return Buffer.from(Uint8Array.from(e.split(`.`).map(e=>Number.parseInt(e))))}function E(e){if((0,r.isIPv4)(e))return T(e);if(w(e))return T(e.substring(7));if((0,r.isIPv6)(e)){let t,n,r=e.indexOf(`::`);r===-1?(t=e,n=``):(t=e.substring(0,r),n=e.substring(r+2));let i=Buffer.from(S(t)),a=Buffer.from(S(n)),o=Buffer.alloc(16-i.length-a.length,0);return Buffer.concat([i,o,a])}else return null}function D(e){switch(e){case a.ConnectivityState.CONNECTING:return{state:`CONNECTING`};case a.ConnectivityState.IDLE:return{state:`IDLE`};case a.ConnectivityState.READY:return{state:`READY`};case a.ConnectivityState.SHUTDOWN:return{state:`SHUTDOWN`};case a.ConnectivityState.TRANSIENT_FAILURE:return{state:`TRANSIENT_FAILURE`};default:return{state:`UNKNOWN`}}}function O(e){if(!e)return null;let t=e.getTime();return{seconds:t/1e3|0,nanos:t%1e3*1e6}}function k(e){let t=e.getInfo(),n=[],r=[];return t.children.channels.forEach(e=>{n.push(u(e[1].ref))}),t.children.subchannels.forEach(e=>{r.push(d(e[1].ref))}),{ref:u(e.ref),data:{target:t.target,state:D(t.state),calls_started:t.callTracker.callsStarted,calls_succeeded:t.callTracker.callsSucceeded,calls_failed:t.callTracker.callsFailed,last_call_started_timestamp:O(t.callTracker.lastCallStartedTimestamp),trace:t.trace.getTraceMessage()},channel_ref:n,subchannel_ref:r}}function A(e,t){let n=parseInt(e.request.channel_id,10),r=v.channel.getElementByKey(n);if(r===void 0){t({code:o.Status.NOT_FOUND,details:`No channel data found for id `+n});return}t(null,{channel:k(r)})}function j(e,t){let n=parseInt(e.request.max_results,10)||h,r=[],i=parseInt(e.request.start_channel_id,10),a=v.channel,o;for(o=a.lowerBound(i);!o.equals(a.end())&&r.length<n;o=o.next())r.push(k(o.pointer[1]));t(null,{channel:r,end:o.equals(a.end())})}function M(e){let t=e.getInfo(),n=[];return t.listenerChildren.sockets.forEach(e=>{n.push(p(e[1].ref))}),{ref:f(e.ref),data:{calls_started:t.callTracker.callsStarted,calls_succeeded:t.callTracker.callsSucceeded,calls_failed:t.callTracker.callsFailed,last_call_started_timestamp:O(t.callTracker.lastCallStartedTimestamp),trace:t.trace.getTraceMessage()},listen_socket:n}}function N(e,t){let n=parseInt(e.request.server_id,10),r=v.server.getElementByKey(n);if(r===void 0){t({code:o.Status.NOT_FOUND,details:`No server data found for id `+n});return}t(null,{server:M(r)})}function ee(e,t){let n=parseInt(e.request.max_results,10)||h,r=parseInt(e.request.start_server_id,10),i=v.server,a=[],o;for(o=i.lowerBound(r);!o.equals(i.end())&&a.length<n;o=o.next())a.push(M(o.pointer[1]));t(null,{server:a,end:o.equals(i.end())})}function P(e,t){let n=parseInt(e.request.subchannel_id,10),r=v.subchannel.getElementByKey(n);if(r===void 0){t({code:o.Status.NOT_FOUND,details:`No subchannel data found for id `+n});return}let i=r.getInfo(),a=[];i.children.sockets.forEach(e=>{a.push(p(e[1].ref))}),t(null,{subchannel:{ref:d(r.ref),data:{target:i.target,state:D(i.state),calls_started:i.callTracker.callsStarted,calls_succeeded:i.callTracker.callsSucceeded,calls_failed:i.callTracker.callsFailed,last_call_started_timestamp:O(i.callTracker.lastCallStartedTimestamp),trace:i.trace.getTraceMessage()},socket_ref:a}})}function F(e){return(0,s.isTcpSubchannelAddress)(e)?{address:`tcpip_address`,tcpip_address:{ip_address:E(e.host)??void 0,port:e.port}}:{address:`uds_address`,uds_address:{filename:e.path}}}function I(e,t){let n=parseInt(e.request.socket_id,10),r=v.socket.getElementByKey(n);if(r===void 0){t({code:o.Status.NOT_FOUND,details:`No socket data found for id `+n});return}let i=r.getInfo(),a=i.security?{model:`tls`,tls:{cipher_suite:i.security.cipherSuiteStandardName?`standard_name`:`other_name`,standard_name:i.security.cipherSuiteStandardName??void 0,other_name:i.security.cipherSuiteOtherName??void 0,local_certificate:i.security.localCertificate??void 0,remote_certificate:i.security.remoteCertificate??void 0}}:null;t(null,{socket:{ref:p(r.ref),local:i.localAddress?F(i.localAddress):null,remote:i.remoteAddress?F(i.remoteAddress):null,remote_name:i.remoteName??void 0,security:a,data:{keep_alives_sent:i.keepAlivesSent,streams_started:i.streamsStarted,streams_succeeded:i.streamsSucceeded,streams_failed:i.streamsFailed,last_local_stream_created_timestamp:O(i.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:O(i.lastRemoteStreamCreatedTimestamp),messages_received:i.messagesReceived,messages_sent:i.messagesSent,last_message_received_timestamp:O(i.lastMessageReceivedTimestamp),last_message_sent_timestamp:O(i.lastMessageSentTimestamp),local_flow_control_window:i.localFlowControlWindow?{value:i.localFlowControlWindow}:null,remote_flow_control_window:i.remoteFlowControlWindow?{value:i.remoteFlowControlWindow}:null}}})}function L(e,t){let n=parseInt(e.request.server_id,10),r=v.server.getElementByKey(n);if(r===void 0){t({code:o.Status.NOT_FOUND,details:`No server data found for id `+n});return}let i=parseInt(e.request.start_socket_id,10),a=parseInt(e.request.max_results,10)||h,s=r.getInfo().sessionChildren.sockets,c=[],l;for(l=s.lowerBound(i);!l.equals(s.end())&&c.length<a;l=l.next())c.push(p(l.pointer[1].ref));t(null,{socket_ref:c,end:l.equals(s.end())})}function te(){return{GetChannel:A,GetTopChannels:j,GetServer:N,GetServers:ee,GetSubchannel:P,GetSocket:I,GetServerSockets:L}}var R=null;function ne(){if(R)return R;let e=Ot().loadSync,t=e(`channelz.proto`,{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return R=(0,l.loadPackageDefinition)(t).grpc.channelz.v1.Channelz.service,R}function z(){(0,c.registerAdminService)(ne,te)}})),At=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getNextCallNumber=n;var t=0;function n(){return t++}})),jt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CompressionAlgorithms=void 0;var t;(function(e){e[e.identity=0]=`identity`,e[e.deflate=1]=`deflate`,e[e.gzip=2]=`gzip`})(t||(e.CompressionAlgorithms=t={}))})),Mt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BaseFilter=void 0,e.BaseFilter=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}}})),Nt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CompressionFilterFactory=e.CompressionFilter=void 0;var n=t(`zlib`),r=jt(),i=C(),a=Mt(),o=B(),s=e=>typeof e==`number`&&typeof r.CompressionAlgorithms[e]==`string`,c=class{async writeMessage(e,t){let n=e;t&&(n=await this.compressMessage(n));let r=Buffer.allocUnsafe(n.length+5);return r.writeUInt8(+!!t,0),r.writeUInt32BE(n.length,1),n.copy(r,5),r}async readMessage(e){let t=e.readUInt8(0)===1,n=e.slice(5);return t&&(n=await this.decompressMessage(n)),n}},l=class extends c{async compressMessage(e){return e}async writeMessage(e,t){let n=Buffer.allocUnsafe(e.length+5);return n.writeUInt8(0,0),n.writeUInt32BE(e.length,1),e.copy(n,5),n}decompressMessage(e){return Promise.reject(Error(`Received compressed message but "grpc-encoding" header was identity`))}},u=class extends c{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,r)=>{n.deflate(e,(e,n)=>{e?r(e):t(n)})})}decompressMessage(e){return new Promise((t,r)=>{let a=0,o=[],s=n.createInflate();s.on(`data`,e=>{o.push(e),a+=e.byteLength,this.maxRecvMessageLength!==-1&&a>this.maxRecvMessageLength&&(s.destroy(),r({code:i.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on(`end`,()=>{t(Buffer.concat(o))}),s.write(e),s.end()})}},d=class extends c{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,r)=>{n.gzip(e,(e,n)=>{e?r(e):t(n)})})}decompressMessage(e){return new Promise((t,r)=>{let a=0,o=[],s=n.createGunzip();s.on(`data`,e=>{o.push(e),a+=e.byteLength,this.maxRecvMessageLength!==-1&&a>this.maxRecvMessageLength&&(s.destroy(),r({code:i.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on(`end`,()=>{t(Buffer.concat(o))}),s.write(e),s.end()})}},f=class extends c{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(Error(`Compression method not supported: ${this.compressionName}`))}};function p(e,t){switch(e){case`identity`:return new l;case`deflate`:return new u(t);case`gzip`:return new d(t);default:return new f(e)}}var m=class extends a.BaseFilter{constructor(e,t){super(),this.sharedFilterConfig=t,this.sendCompression=new l,this.receiveCompression=new l,this.currentCompressionAlgorithm=`identity`;let n=e[`grpc.default_compression_algorithm`];if(this.maxReceiveMessageLength=e[`grpc.max_receive_message_length`]??i.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=e[`grpc.max_send_message_length`]??i.DEFAULT_MAX_SEND_MESSAGE_LENGTH,n!==void 0)if(s(n)){let e=r.CompressionAlgorithms[n],i=t.serverSupportedEncodingHeader?.split(`,`);(!i||i.includes(e))&&(this.currentCompressionAlgorithm=e,this.sendCompression=p(this.currentCompressionAlgorithm,-1))}else o.log(i.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${n}`)}async sendMetadata(e){let t=await e;return t.set(`grpc-accept-encoding`,`identity,deflate,gzip`),t.set(`accept-encoding`,`identity`),this.currentCompressionAlgorithm===`identity`?t.remove(`grpc-encoding`):t.set(`grpc-encoding`,this.currentCompressionAlgorithm),t}receiveMetadata(e){let t=e.get(`grpc-encoding`);if(t.length>0){let e=t[0];typeof e==`string`&&(this.receiveCompression=p(e,this.maxReceiveMessageLength))}e.remove(`grpc-encoding`);let n=e.get(`grpc-accept-encoding`)[0];return n&&(this.sharedFilterConfig.serverSupportedEncodingHeader=n,n.split(`,`).includes(this.currentCompressionAlgorithm)||(this.sendCompression=new l,this.currentCompressionAlgorithm=`identity`)),e.remove(`grpc-accept-encoding`),e}async sendMessage(e){let t=await e;if(this.maxSendMessageLength!==-1&&t.message.length>this.maxSendMessageLength)throw{code:i.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let n;return n=this.sendCompression instanceof l?!1:((t.flags??0)&2)==0,{message:await this.sendCompression.writeMessage(t.message,n),flags:t.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};e.CompressionFilter=m,e.CompressionFilterFactory=class{constructor(e,t){this.options=t,this.sharedFilterConfig={}}createFilter(){return new m(this.options,this.sharedFilterConfig)}}})),Pt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.restrictControlPlaneStatusCode=r;var t=C(),n=[t.Status.OK,t.Status.INVALID_ARGUMENT,t.Status.NOT_FOUND,t.Status.ALREADY_EXISTS,t.Status.FAILED_PRECONDITION,t.Status.ABORTED,t.Status.OUT_OF_RANGE,t.Status.DATA_LOSS];function r(e,r){return n.includes(e)?{code:t.Status.INTERNAL,details:`Invalid status from control plane: ${e} ${t.Status[e]} ${r}`}:{code:e,details:r}}})),Ft=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.minDeadline=t,e.getDeadlineTimeoutString=r,e.getRelativeTimeout=a,e.deadlineToString=o,e.formatDateDifference=s;function t(...e){let t=1/0;for(let n of e){let e=n instanceof Date?n.getTime():n;e<t&&(t=e)}return t}var n=[[`m`,1],[`S`,1e3],[`M`,60*1e3],[`H`,3600*1e3]];function r(e){let t=new Date().getTime();e instanceof Date&&(e=e.getTime());let r=Math.max(e-t,0);for(let[e,t]of n){let n=r/t;if(n<1e8)return String(Math.ceil(n))+e}throw Error(`Deadline is too far in the future`)}var i=2147483647;function a(e){let t=(e instanceof Date?e.getTime():e)-new Date().getTime();return t<0?0:t>i?1/0:t}function o(e){if(e instanceof Date)return e.toISOString();{let t=new Date(e);return Number.isNaN(t.getTime())?``+e:t.toISOString()}}function s(e,t){return((t.getTime()-e.getTime())/1e3).toFixed(3)+`s`}})),It=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FilterStackFactory=e.FilterStack=void 0;var t=class{constructor(e){this.filters=e}sendMetadata(e){let t=e;for(let e=0;e<this.filters.length;e++)t=this.filters[e].sendMetadata(t);return t}receiveMetadata(e){let t=e;for(let e=this.filters.length-1;e>=0;e--)t=this.filters[e].receiveMetadata(t);return t}sendMessage(e){let t=e;for(let e=0;e<this.filters.length;e++)t=this.filters[e].sendMessage(t);return t}receiveMessage(e){let t=e;for(let e=this.filters.length-1;e>=0;e--)t=this.filters[e].receiveMessage(t);return t}receiveTrailers(e){let t=e;for(let e=this.filters.length-1;e>=0;e--)t=this.filters[e].receiveTrailers(t);return t}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};e.FilterStack=t,e.FilterStackFactory=class e{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new e([...this.factories])}createFilter(){return new t(this.factories.map(e=>e.createFilter()))}}})),Lt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SingleSubchannelChannel=void 0;var t=At(),n=kt(),r=Nt(),i=W(),a=C(),o=Pt(),s=Ft(),c=It(),l=V(),u=U(),d=H(),f=class{constructor(e,t,n,r,i){this.subchannel=e,this.method=t,this.options=r,this.callNumber=i,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;let o=this.method.split(`/`),c=``;o.length>=2&&(c=o[1]),this.serviceUrl=`https://${(0,d.splitHostPort)(this.options.host)?.host??`localhost`}/${c}`;let l=(0,s.getRelativeTimeout)(r.deadline);l!==1/0&&(l<=0?this.cancelWithStatus(a.Status.DEADLINE_EXCEEDED,`Deadline exceeded`):setTimeout(()=>{this.cancelWithStatus(a.Status.DEADLINE_EXCEEDED,`Deadline exceeded`)},l)),this.filterStack=n.createFilter()}cancelWithStatus(e,t){this.childCall?this.childCall.cancelWithStatus(e,t):this.pendingStatus={code:e,details:t,metadata:new l.Metadata}}getPeer(){return this.childCall?.getPeer()??this.subchannel.getAddress()}async start(e,t){if(this.pendingStatus){t.onReceiveStatus(this.pendingStatus);return}if(this.subchannel.getConnectivityState()!==i.ConnectivityState.READY){t.onReceiveStatus({code:a.Status.UNAVAILABLE,details:`Subchannel not ready`,metadata:new l.Metadata});return}let n=await this.filterStack.sendMetadata(Promise.resolve(e)),r;try{r=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(e){let n=e,{code:r,details:i}=(0,o.restrictControlPlaneStatusCode)(typeof n.code==`number`?n.code:a.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${n.message}`);t.onReceiveStatus({code:r,details:i,metadata:new l.Metadata});return}r.merge(n),this.childCall=this.subchannel.createCall(r,this.options.host,this.method,{onReceiveMetadata:async e=>{t.onReceiveMetadata(await this.filterStack.receiveMetadata(e))},onReceiveMessage:async e=>{this.readFilterPending=!0;let n=await this.filterStack.receiveMessage(e);this.readFilterPending=!1,t.onReceiveMessage(n),this.pendingStatus&&t.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async e=>{let n=await this.filterStack.receiveTrailers(e);this.readFilterPending?this.pendingStatus=n:t.onReceiveStatus(n)}}),this.readPending&&this.childCall.startRead(),this.pendingMessage&&this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.halfClosePending&&!this.writeFilterPending&&this.childCall.halfClose()}async sendMessageWithContext(e,t){this.writeFilterPending=!0;let n=await this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags}));this.writeFilterPending=!1,this.childCall?(this.childCall.sendMessageWithContext(e,n.message),this.halfClosePending&&this.childCall.halfClose()):this.pendingMessage={context:e,message:n.message}}startRead(){this.childCall?this.childCall.startRead():this.readPending=!0}halfClose(){this.childCall&&!this.writeFilterPending?this.childCall.halfClose():this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(e){throw Error(`Method not implemented.`)}getAuthContext(){return this.childCall?this.childCall.getAuthContext():null}};e.SingleSubchannelChannel=class{constructor(e,t,i){this.subchannel=e,this.target=t,this.channelzEnabled=!1,this.channelzTrace=new n.ChannelzTrace,this.callTracker=new n.ChannelzCallTracker,this.childrenTracker=new n.ChannelzChildrenTracker,this.channelzEnabled=i[`grpc.enable_channelz`]!==0,this.channelzRef=(0,n.registerChannelzChannel)((0,d.uriToString)(t),()=>({target:`${(0,d.uriToString)(t)} (${e.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled&&this.childrenTracker.refChild(e.getChannelzRef()),this.filterStackFactory=new c.FilterStackFactory([new r.CompressionFilterFactory(this,i)])}close(){this.channelzEnabled&&this.childrenTracker.unrefChild(this.subchannel.getChannelzRef()),(0,n.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,d.uriToString)(this.target)}getConnectivityState(e){throw Error(`Method not implemented.`)}watchConnectivityState(e,t,n){throw Error(`Method not implemented.`)}getChannelzRef(){return this.channelzRef}createCall(e,n){let r={deadline:n,host:(0,u.getDefaultAuthority)(this.target),flags:a.Propagate.DEFAULTS,parentCall:null};return new f(this.subchannel,e,this.filterStackFactory,r,(0,t.getNextCallNumber)())}}})),Rt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Subchannel=void 0;var t=W(),n=K(),r=B(),i=C(),a=H(),o=q(),s=kt(),c=Lt(),l=`subchannel`,u=2147483647;e.Subchannel=class{constructor(e,r,i,a,c){this.channelTarget=e,this.subchannelAddress=r,this.options=i,this.connector=c,this.connectivityState=t.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0,this.dataProducers=new Map,this.subchannelChannel=null;let l={initialDelay:i[`grpc.initial_reconnect_backoff_ms`],maxDelay:i[`grpc.max_reconnect_backoff_ms`]};this.backoffTimeout=new n.BackoffTimeout(()=>{this.handleBackoffTimer()},l),this.backoffTimeout.unref(),this.subchannelAddressString=(0,o.subchannelAddressToString)(r),this.keepaliveTime=i[`grpc.keepalive_time_ms`]??-1,i[`grpc.enable_channelz`]===0?(this.channelzEnabled=!1,this.channelzTrace=new s.ChannelzTraceStub,this.callTracker=new s.ChannelzCallTrackerStub,this.childrenTracker=new s.ChannelzChildrenTrackerStub,this.streamTracker=new s.ChannelzCallTrackerStub):(this.channelzTrace=new s.ChannelzTrace,this.callTracker=new s.ChannelzCallTracker,this.childrenTracker=new s.ChannelzChildrenTracker,this.streamTracker=new s.ChannelzCallTracker),this.channelzRef=(0,s.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace(`CT_INFO`,`Subchannel created`),this.trace(`Subchannel constructed with options `+JSON.stringify(i,void 0,2)),this.secureConnector=a._createSecureConnector(e,i)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){r.trace(i.LogVerbosity.DEBUG,l,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}refTrace(e){r.trace(i.LogVerbosity.DEBUG,`subchannel_refcount`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([t.ConnectivityState.TRANSIENT_FAILURE],t.ConnectivityState.CONNECTING):this.transitionToState([t.ConnectivityState.TRANSIENT_FAILURE],t.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e[`grpc.keepalive_time_ms`]){let t=Math.min(this.keepaliveTime,u);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":t})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(e=>{this.transitionToState([t.ConnectivityState.CONNECTING],t.ConnectivityState.READY)?(this.transport=e,this.channelzEnabled&&this.childrenTracker.refChild(e.getChannelzRef()),e.addDisconnectListener(e=>{this.transitionToState([t.ConnectivityState.READY],t.ConnectivityState.IDLE),e&&this.keepaliveTime>0&&(this.keepaliveTime*=2,r.log(i.LogVerbosity.ERROR,`Connection to ${(0,a.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):e.shutdown()},e=>{this.transitionToState([t.ConnectivityState.CONNECTING],t.ConnectivityState.TRANSIENT_FAILURE,`${e}`)})}transitionToState(e,n,r){var i,a;if(e.indexOf(this.connectivityState)===-1)return!1;r?this.trace(t.ConnectivityState[this.connectivityState]+` -> `+t.ConnectivityState[n]+` with error "`+r+`"`):this.trace(t.ConnectivityState[this.connectivityState]+` -> `+t.ConnectivityState[n]),this.channelzEnabled&&this.channelzTrace.addTrace(`CT_INFO`,`Connectivity state change to `+t.ConnectivityState[n]);let o=this.connectivityState;switch(this.connectivityState=n,n){case t.ConnectivityState.READY:this.stopBackoff();break;case t.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case t.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(i=this.transport)==null||i.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case t.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(a=this.transport)==null||a.shutdown(),this.transport=null;break;default:throw Error(`Invalid state: unknown ConnectivityState ${n}`)}for(let e of this.stateListeners)e(this,o,n,this.keepaliveTime,r);return!0}ref(){this.refTrace(`refcount `+this.refcount+` -> `+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace(`refcount `+this.refcount+` -> `+(this.refcount-1)),--this.refcount,this.refcount===0&&(this.channelzTrace.addTrace(`CT_INFO`,`Shutting down`),(0,s.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([t.ConnectivityState.CONNECTING,t.ConnectivityState.READY],t.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,t,n,r){if(!this.transport)throw Error(`Cannot create call, subchannel not READY`);let a;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),a={onCallEnd:e=>{e.code===i.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):a={},this.transport.createCall(e,t,n,r,a)}startConnecting(){process.nextTick(()=>{this.transitionToState([t.ConnectivityState.IDLE],t.ConnectivityState.CONNECTING)||this.connectivityState===t.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([t.ConnectivityState.TRANSIENT_FAILURE],t.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){return this.subchannelChannel||(this.subchannelChannel=new c.SingleSubchannelChannel(this,this.channelTarget,this.options)),this.subchannelChannel}addDataWatcher(e){throw Error(`Not implemented`)}getOrCreateDataProducer(e,t){let n=this.dataProducers.get(e);if(n)return n;let r=t(this);return this.dataProducers.set(e,r),r}removeDataProducer(e){this.dataProducers.delete(e)}}})),zt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0,e.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=(process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER??`false`)===`true`})),Bt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_PORT=void 0,e.setup=v;var n=U(),r=t(`dns`),i=ce(),a=C(),o=Ce(),s=V(),c=B(),l=C(),u=H(),d=t(`net`),f=K(),p=zt(),m=`dns_resolver`;function h(e){c.trace(l.LogVerbosity.DEBUG,m,e)}e.DEFAULT_PORT=443;var g=3e4,_=class{constructor(t,n,i){this.target=t,this.listener=n,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new r.promises.Resolver,h(`Resolver constructed for target `+(0,u.uriToString)(t)),t.authority&&this.alternativeResolver.setServers([t.authority]);let o=(0,u.splitHostPort)(t.path);o===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,d.isIPv4)(o.host)||(0,d.isIPv6)(o.host)?(this.ipResult=[{addresses:[{host:o.host,port:o.port??e.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=o.host,this.port=o.port??e.DEFAULT_PORT),this.percentage=Math.random()*100,i[`grpc.service_config_disable_resolution`]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:a.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,u.uriToString)(this.target)}`,metadata:new s.Metadata};let c={initialDelay:i[`grpc.initial_reconnect_backoff_ms`],maxDelay:i[`grpc.max_reconnect_backoff_ms`]};this.backoff=new f.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},c),this.backoff.unref(),this.minTimeBetweenResolutionsMs=i[`grpc.dns_min_time_between_resolutions_ms`]??g,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(h(`Returning IP address for target `+(0,u.uriToString)(this.target)),setImmediate(()=>{this.listener((0,o.statusOrFromValue)(this.ipResult),{},null,``)}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)h(`Failed to parse DNS address `+(0,u.uriToString)(this.target)),setImmediate(()=>{this.listener((0,o.statusOrFromError)({code:a.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,u.uriToString)(this.target)}`}),{},null,``)}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;h(`Looking up DNS hostname `+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(e=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,o.statusOrFromValue)(e.map(e=>({addresses:[e]})));let t=`[`+e.map(e=>e.host+`:`+e.port).join(`,`)+`]`;h(`Resolved addresses for target `+(0,u.uriToString)(this.target)+`: `+t);let n=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,``);this.handleHealthStatus(n)},e=>{this.pendingLookupPromise!==null&&(h(`Resolution error for target `+(0,u.uriToString)(this.target)+`: `+e.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,o.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,``))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(e=>{if(this.pendingTxtPromise===null)return;this.pendingTxtPromise=null;let t;try{t=(0,i.extractAndSelectServiceConfig)(e,this.percentage),t?this.latestServiceConfigResult=(0,o.statusOrFromValue)(t):this.latestServiceConfigResult=null}catch(e){this.latestServiceConfigResult=(0,o.statusOrFromError)({code:a.Status.UNAVAILABLE,details:`Parsing service config failed with error ${e.message}`})}this.latestLookupResult!==null&&this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,``)},e=>{}))}}handleHealthStatus(e){e?(this.backoff.stop(),this.backoff.reset()):this.continueResolving=!0}async lookup(e){if(p.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){h(`Using alternative DNS resolver.`);let t=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(t.every(e=>e.status===`rejected`))throw Error(t[0].reason);return t.reduce((e,t)=>t.status===`fulfilled`?[...e,...t.value]:e,[]).map(e=>({host:e,port:+this.port}))}return(await r.promises.lookup(e,{all:!0})).map(e=>({host:e.address,port:+this.port}))}async resolveTxt(e){return p.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(h(`Using alternative DNS resolver.`),this.alternativeResolver.resolveTxt(e)):r.promises.resolveTxt(e)}startNextResolutionTimer(){var e,t;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(t=(e=this.nextResolutionTimer).unref)==null||t.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?h(`resolution update delayed by "min time between resolutions" rate limit`):h(`resolution update delayed by backoff timer until `+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function v(){(0,n.registerResolver)(`dns`,_),(0,n.registerDefaultScheme)(`dns`)}})),Vt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.parseCIDR=h,e.mapProxyName=y,e.getProxiedConnection=b;var n=B(),r=C(),i=t(`net`),a=t(`http`),o=B(),s=q(),c=H(),l=t(`url`),u=Bt(),d=`proxy`;function f(e){o.trace(r.LogVerbosity.DEBUG,d,e)}function p(){let e=``,t=``;if(process.env.grpc_proxy)t=`grpc_proxy`,e=process.env.grpc_proxy;else if(process.env.https_proxy)t=`https_proxy`,e=process.env.https_proxy;else if(process.env.http_proxy)t=`http_proxy`,e=process.env.http_proxy;else return{};let i;try{i=new l.URL(e)}catch{return(0,n.log)(r.LogVerbosity.ERROR,`cannot parse value of "${t}" env var`),{}}if(i.protocol!==`http:`)return(0,n.log)(r.LogVerbosity.ERROR,`"${i.protocol}" scheme not supported in proxy URI`),{};let a=null;i.username&&(i.password?((0,n.log)(r.LogVerbosity.INFO,`userinfo found in proxy URI`),a=decodeURIComponent(`${i.username}:${i.password}`)):a=i.username);let o=i.hostname,s=i.port;s===``&&(s=`80`);let c={address:`${o}:${s}`};return a&&(c.creds=a),f(`Proxy server `+c.address+` set by environment variable `+t),c}function m(){let e=process.env.no_grpc_proxy,t=`no_grpc_proxy`;return e||(e=process.env.no_proxy,t=`no_proxy`),e?(f(`No proxy server list set by environment variable `+t),e.split(`,`)):[]}function h(e){let t=e.split(`/`);if(t.length!==2)return null;let n=parseInt(t[1],10);return!(0,i.isIPv4)(t[0])||Number.isNaN(n)||n<0||n>32?null:{ip:g(t[0]),prefixLength:n}}function g(e){return e.split(`.`).reduce((e,t)=>(e<<8)+parseInt(t,10),0)}function _(e,t){let n=e.ip,r=-1<<32-e.prefixLength;return(g(t)&r)===(n&r)}function v(e){for(let t of m()){let n=h(t);if((0,i.isIPv4)(e)&&n&&_(n,e)||e.endsWith(t))return!0}return!1}function y(e,t){let n={target:e,extraOptions:{}};if((t[`grpc.enable_http_proxy`]??1)===0||e.scheme===`unix`)return n;let r=p();if(!r.address)return n;let i=(0,c.splitHostPort)(e.path);if(!i)return n;let a=i.host;if(v(a))return f(`Not using proxy for target in no_proxy list: `+(0,c.uriToString)(e)),n;let o={"grpc.http_connect_target":(0,c.uriToString)(e)};return r.creds&&(o[`grpc.http_connect_creds`]=r.creds),{target:{scheme:`dns`,path:r.address},extraOptions:o}}function b(e,t){if(!(`grpc.http_connect_target`in t))return Promise.resolve(null);let i=t[`grpc.http_connect_target`],o=(0,c.parseUri)(i);if(o===null)return Promise.resolve(null);let l=(0,c.splitHostPort)(o.path);if(l===null)return Promise.resolve(null);let d=`${l.host}:${l.port??u.DEFAULT_PORT}`,p={method:`CONNECT`,path:d},m={Host:d};(0,s.isTcpSubchannelAddress)(e)?(p.host=e.host,p.port=e.port):p.socketPath=e.path,`grpc.http_connect_creds`in t&&(m[`Proxy-Authorization`]=`Basic `+Buffer.from(t[`grpc.http_connect_creds`]).toString(`base64`)),p.headers=m;let h=(0,s.subchannelAddressToString)(e);return f(`Using proxy `+h+` to connect to `+p.path),new Promise((e,t)=>{let i=a.request(p);i.once(`connect`,(a,o,s)=>{i.removeAllListeners(),o.removeAllListeners(),a.statusCode===200?(f(`Successfully connected to `+p.path+` through proxy `+h),s.length>0&&o.unshift(s),f(`Successfully established a plaintext connection to `+p.path+` through proxy `+h),e(o)):((0,n.log)(r.LogVerbosity.ERROR,`Failed to connect to `+p.path+` through proxy `+h+` with status `+a.statusCode),t())}),i.once(`error`,e=>{i.removeAllListeners(),(0,n.log)(r.LogVerbosity.ERROR,`Failed to connect to proxy `+h+` with error `+e.message),t()}),i.end()})}})),Ht=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.StreamDecoder=void 0;var t;(function(e){e[e.NO_DATA=0]=`NO_DATA`,e[e.READING_SIZE=1]=`READING_SIZE`,e[e.READING_MESSAGE=2]=`READING_MESSAGE`})(t||(t={})),e.StreamDecoder=class{constructor(e){this.maxReadMessageLength=e,this.readState=t.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let n=0,r,i=[];for(;n<e.length;)switch(this.readState){case t.NO_DATA:this.readCompressFlag=e.slice(n,n+1),n+=1,this.readState=t.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case t.READING_SIZE:if(r=Math.min(e.length-n,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,n,n+r),this.readSizeRemaining-=r,n+=r,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=t.READING_MESSAGE;else{let e=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=t.NO_DATA,i.push(e)}}break;case t.READING_MESSAGE:if(r=Math.min(e.length-n,this.readMessageRemaining),this.readPartialMessage.push(e.slice(n,n+r)),this.readMessageRemaining-=r,n+=r,this.readMessageRemaining===0){let e=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),n=Buffer.concat(e,this.readMessageSize+5);this.readState=t.NO_DATA,i.push(n)}break;default:throw Error(`Unexpected read state`)}return i}}})),Ut=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Http2SubchannelCall=void 0;var n=t(`http2`),r=t(`os`),i=C(),a=V(),o=Ht(),s=B(),c=C(),l=`subchannel_call`;function u(e){for(let[t,n]of Object.entries(r.constants.errno))if(n===e)return t;return`Unknown system error `+e}function d(e){let t=`Received HTTP status code ${e}`,n;switch(e){case 400:n=i.Status.INTERNAL;break;case 401:n=i.Status.UNAUTHENTICATED;break;case 403:n=i.Status.PERMISSION_DENIED;break;case 404:n=i.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:n=i.Status.UNAVAILABLE;break;default:n=i.Status.UNKNOWN}return{code:n,details:t,metadata:new a.Metadata}}e.Http2SubchannelCall=class{constructor(e,t,r,s,c){this.http2Stream=e,this.callEventTracker=t,this.listener=r,this.transport=s,this.callId=c,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let l=s.getOptions()[`grpc.max_receive_message_length`]??i.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new o.StreamDecoder(l),e.on(`response`,(e,t)=>{let r=``;for(let t of Object.keys(e))r+=` `+t+`: `+e[t]+`
14
+ `;if(this.trace(`Received server headers:
15
+ `+r),this.httpStatusCode=e[`:status`],t&n.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(e);else{let t;try{t=a.Metadata.fromHttp2Headers(e)}catch(e){this.endCall({code:i.Status.UNKNOWN,details:e.message,metadata:new a.Metadata});return}this.listener.onReceiveMetadata(t)}}),e.on(`trailers`,e=>{this.handleTrailers(e)}),e.on(`data`,e=>{if(this.statusOutput)return;this.trace(`receive HTTP/2 data frame of length `+e.length);let t;try{t=this.decoder.write(e)}catch(e){if(this.httpStatusCode!==void 0&&this.httpStatusCode!==200){let e=d(this.httpStatusCode);this.cancelWithStatus(e.code,e.details)}else this.cancelWithStatus(i.Status.RESOURCE_EXHAUSTED,e.message);return}for(let e of t)this.trace(`parsed message of length `+e.length),this.callEventTracker.addMessageReceived(),this.tryPush(e)}),e.on(`end`,()=>{this.readsClosed=!0,this.maybeOutputStatus()}),e.on(`close`,()=>{this.serverEndedCall=!0,process.nextTick(()=>{if(this.trace(`HTTP/2 stream closed with code `+e.rstCode),this.finalStatus?.code===i.Status.OK)return;let t,r=``;switch(e.rstCode){case n.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let e=d(this.httpStatusCode);t=e.code,r=e.details}else t=i.Status.INTERNAL,r=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case n.constants.NGHTTP2_REFUSED_STREAM:t=i.Status.UNAVAILABLE,r=`Stream refused by server`;break;case n.constants.NGHTTP2_CANCEL:this.connectionDropped?(t=i.Status.UNAVAILABLE,r=`Connection dropped`):(t=i.Status.CANCELLED,r=`Call cancelled`);break;case n.constants.NGHTTP2_ENHANCE_YOUR_CALM:t=i.Status.RESOURCE_EXHAUSTED,r=`Bandwidth exhausted or memory limit exceeded`;break;case n.constants.NGHTTP2_INADEQUATE_SECURITY:t=i.Status.PERMISSION_DENIED,r=`Protocol not secure enough`;break;case n.constants.NGHTTP2_INTERNAL_ERROR:t=i.Status.INTERNAL,this.internalError===null?r=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code===`ECONNRESET`||this.internalError.code===`ETIMEDOUT`?(t=i.Status.UNAVAILABLE,r=this.internalError.message):r=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:t=i.Status.INTERNAL,r=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:t,details:r,metadata:new a.Metadata,rstCode:e.rstCode})})}),e.on(`error`,e=>{e.code!==`ERR_HTTP2_STREAM_ERROR`&&(this.trace(`Node error event: message=`+e.message+` code=`+e.code+` errno=`+u(e.errno)+` syscall=`+e.syscall),this.internalError=e),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=>{this.endCall({code:i.Status.UNAVAILABLE,details:`Connection dropped`,metadata:new a.Metadata})})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace(`ended with status: code=`+this.finalStatus.code+` details="`+this.finalStatus.details+`"`),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=>{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){s.trace(c.LogVerbosity.DEBUG,l,`[`+this.callId+`] `+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===i.Status.OK)&&(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&&(this.finalStatus.code!==i.Status.OK||this.readsClosed&&this.unpushedReadMessages.length===0&&!this.isReadFilterPending&&!this.isPushPending)&&this.outputStatus()}push(e){this.trace(`pushing to reader message of length `+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=>{this.isPushPending=!1,!this.statusOutput&&(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace(`unpushedReadMessages.push message of length `+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let t=``;for(let n of Object.keys(e))t+=` `+n+`: `+e[n]+`
16
+ `;this.trace(`Received server trailers:
17
+ `+t);let n;try{n=a.Metadata.fromHttp2Headers(e)}catch{n=new a.Metadata}let r=n.getMap(),o;if(typeof r[`grpc-status`]==`string`){let e=Number(r[`grpc-status`]);this.trace(`received status code `+e+` from server`),n.remove(`grpc-status`);let t=``;if(typeof r[`grpc-message`]==`string`){try{t=decodeURI(r[`grpc-message`])}catch{t=r[`grpc-message`]}n.remove(`grpc-message`),this.trace(`received status details string "`+t+`" from server`)}o={code:e,details:t,metadata:n}}else this.httpStatusCode?(o=d(this.httpStatusCode),o.metadata=n):o={code:i.Status.UNKNOWN,details:`No status information received`,metadata:n};this.endCall(o)}destroyHttp2Stream(){if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let e;e=this.finalStatus?.code===i.Status.OK?n.constants.NGHTTP2_NO_ERROR:n.constants.NGHTTP2_CANCEL,this.trace(`close http2 stream with code `+e),this.http2Stream.close(e)}}cancelWithStatus(e,t){this.trace(`cancelWithStatus code: `+e+` details: "`+t+`"`),this.endCall({code:e,details:t,metadata:new a.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}getAuthContext(){return this.transport.getAuthContext()}startRead(){if(this.finalStatus!==null&&this.finalStatus.code!==i.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,t){this.trace(`write() called with message of length `+t.length);let n=t=>{process.nextTick(()=>{var n;let r=i.Status.UNAVAILABLE;t?.code===`ERR_STREAM_WRITE_AFTER_END`&&(r=i.Status.INTERNAL),t&&this.cancelWithStatus(r,`Write error: ${t.message}`),(n=e.callback)==null||n.call(e)})};this.trace(`sending data chunk of length `+t.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(t,n)}catch(e){this.endCall({code:i.Status.UNAVAILABLE,details:`Write failed with error ${e.message}`,metadata:new a.Metadata})}}halfClose(){this.trace(`end() called`),this.trace(`calling end() on HTTP/2 stream`),this.http2Stream.end()}}})),Wt=i((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.Http2SubchannelConnector=void 0;var r=t(`http2`),i=t(`tls`),a=kt(),o=C(),s=Vt(),c=B(),l=U(),u=q(),d=H(),f=t(`net`),p=Ut(),m=At(),h=`transport`,g=`transport_flowctrl`,_=(z(),e(w).default).version,{HTTP2_HEADER_AUTHORITY:v,HTTP2_HEADER_CONTENT_TYPE:y,HTTP2_HEADER_METHOD:b,HTTP2_HEADER_PATH:x,HTTP2_HEADER_TE:S,HTTP2_HEADER_USER_AGENT:T}=r.constants,E=2e4,D=Buffer.from(`too_many_pings`,`ascii`),O=class{constructor(e,t,n,o){this.session=e,this.options=n,this.remoteName=o,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,u.subchannelAddressToString)(t),n[`grpc.enable_channelz`]===0?(this.channelzEnabled=!1,this.streamTracker=new a.ChannelzCallTrackerStub):this.streamTracker=new a.ChannelzCallTracker,this.channelzRef=(0,a.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[n[`grpc.primary_user_agent`],`grpc-node-js/${_}`,n[`grpc.secondary_user_agent`]].filter(e=>e).join(` `),`grpc.keepalive_time_ms`in n?this.keepaliveTimeMs=n[`grpc.keepalive_time_ms`]:this.keepaliveTimeMs=-1,`grpc.keepalive_timeout_ms`in n?this.keepaliveTimeoutMs=n[`grpc.keepalive_timeout_ms`]:this.keepaliveTimeoutMs=E,`grpc.keepalive_permit_without_calls`in n?this.keepaliveWithoutCalls=n[`grpc.keepalive_permit_without_calls`]===1:this.keepaliveWithoutCalls=!1,e.once(`close`,()=>{this.trace(`session closed`),this.handleDisconnect()}),e.once(`goaway`,(e,t,n)=>{let i=!1;e===r.constants.NGHTTP2_ENHANCE_YOUR_CALM&&n&&n.equals(D)&&(i=!0),this.trace(`connection closed by GOAWAY with code `+e+` and data `+n?.toString()),this.reportDisconnectToOwner(i)}),e.once(`error`,e=>{this.trace(`connection closed with error `+e.message),this.handleDisconnect()}),e.socket.once(`close`,e=>{this.trace(`connection closed. hadError=`+e),this.handleDisconnect()}),c.isTracerEnabled(h)&&(e.on(`remoteSettings`,t=>{this.trace(`new settings received`+(this.session===e?``:` on the old connection`)+`: `+JSON.stringify(t))}),e.on(`localSettings`,t=>{this.trace(`local settings acknowledged by remote`+(this.session===e?``:` on the old connection`)+`: `+JSON.stringify(t))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer(),e.socket instanceof i.TLSSocket?this.authContext={transportSecurityType:`ssl`,sslPeerCertificate:e.socket.getPeerCertificate()}:this.authContext={}}getChannelzInfo(){let e=this.session.socket,t=e.remoteAddress?(0,u.stringToSubchannelAddress)(e.remoteAddress,e.remotePort):null,n=e.localAddress?(0,u.stringToSubchannelAddress)(e.localAddress,e.localPort):null,r;if(this.session.encrypted){let t=e,n=t.getCipher(),i=t.getCertificate(),a=t.getPeerCertificate();r={cipherSuiteStandardName:n.standardName??null,cipherSuiteOtherName:n.standardName?null:n.name,localCertificate:i&&`raw`in i?i.raw:null,remoteCertificate:a&&`raw`in a?a.raw:null}}else r=null;return{remoteAddress:t,localAddress:n,security:r,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:this.session.state.localWindowSize??null,remoteFlowControlWindow:this.session.state.remoteWindowSize??null}}trace(e){c.trace(o.LogVerbosity.DEBUG,h,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}keepaliveTrace(e){c.trace(o.LogVerbosity.DEBUG,`keepalive`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}flowControlTrace(e){c.trace(o.LogVerbosity.DEBUG,g,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}internalsTrace(e){c.trace(o.LogVerbosity.DEBUG,`transport_internals`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(t=>t(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let e of this.activeCalls)e.onDisconnect();setImmediate(()=>{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var e,t;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error(`keepaliveTimeout is not null`);return}this.channelzEnabled&&(this.keepalivesSent+=1),this.keepaliveTrace(`Sending ping with timeout `+this.keepaliveTimeoutMs+`ms`),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.keepaliveTrace(`Ping timeout passed without response`),this.handleDisconnect()},this.keepaliveTimeoutMs),(t=(e=this.keepaliveTimer).unref)==null||t.call(e);let n=``;try{this.session.ping((e,t,n)=>{this.clearKeepaliveTimeout(),e?(this.keepaliveTrace(`Ping failed with error `+e.message),this.handleDisconnect()):(this.keepaliveTrace(`Received ping response`),this.maybeStartKeepalivePingTimer())})||(n=`Ping returned false`)}catch(e){n=(e instanceof Error?e.message:``)||`Unknown error`}n&&(this.keepaliveTrace(`Ping send failed: `+n),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,t;this.canSendPing()&&(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace(`Starting keepalive timer for `+this.keepaliveTimeMs+`ms`),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(t=(e=this.keepaliveTimer).unref)==null||t.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&&(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&&this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,t,n,r,i){let a=e.toHttp2Headers();a[v]=t,a[T]=this.userAgent,a[y]=`application/grpc`,a[b]=`POST`,a[x]=n,a[S]=`trailers`;let o;try{o=this.session.request(a)}catch(e){throw this.handleDisconnect(),e}this.flowControlTrace(`local window size: `+this.session.state.localWindowSize+` remote window size: `+this.session.state.remoteWindowSize),this.internalsTrace(`session.closed=`+this.session.closed+` session.destroyed=`+this.session.destroyed+` session.socket.destroyed=`+this.session.socket.destroyed);let s,c;return this.channelzEnabled?(this.streamTracker.addCallStarted(),s={addMessageSent:()=>{var e;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(e=i.addMessageSent)==null||e.call(i)},addMessageReceived:()=>{var e;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(e=i.addMessageReceived)==null||e.call(i)},onCallEnd:e=>{var t;(t=i.onCallEnd)==null||t.call(i,e),this.removeActiveCall(c)},onStreamEnd:e=>{var t;e?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(t=i.onStreamEnd)==null||t.call(i,e)}}):s={addMessageSent:()=>{var e;(e=i.addMessageSent)==null||e.call(i)},addMessageReceived:()=>{var e;(e=i.addMessageReceived)==null||e.call(i)},onCallEnd:e=>{var t;(t=i.onCallEnd)==null||t.call(i,e),this.removeActiveCall(c)},onStreamEnd:e=>{var t;(t=i.onStreamEnd)==null||t.call(i,e)}},c=new p.Http2SubchannelCall(o,s,r,this,(0,m.getNextCallNumber)()),this.addActiveCall(c),c}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}getAuthContext(){return this.authContext}shutdown(){this.session.close(),(0,a.unregisterChannelzRef)(this.channelzRef)}};n.Http2SubchannelConnector=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){c.trace(o.LogVerbosity.DEBUG,h,(0,d.uriToString)(this.channelTarget)+` `+e)}createSession(e,t,n){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject(`Connection closed before starting HTTP/2 handshake`):new Promise((i,a)=>{let o=null,s=this.channelTarget;if(`grpc.http_connect_target`in n){let e=(0,d.parseUri)(n[`grpc.http_connect_target`]);e&&(s=e,o=(0,d.uriToString)(e))}let c=e.secure?`https`:`http`,u=(0,l.getDefaultAuthority)(s),f=()=>{var e;(e=this.session)==null||e.destroy(),this.session=null,setImmediate(()=>{y||(y=!0,a(`${v.trim()} (${new Date().toISOString()})`))})},p=e=>{var t;(t=this.session)==null||t.destroy(),v=e.message,this.trace(`connection failed with error `+v),y||(y=!0,a(`${v} (${new Date().toISOString()})`))},m={createConnection:(t,n)=>e.socket,settings:{initialWindowSize:n[`grpc-node.flow_control_window`]??r.getDefaultSettings?.call(r)?.initialWindowSize??65535},maxSendHeaderBlockLength:2**53-1,maxSessionMemory:n[`grpc-node.max_session_memory`]??2**53-1},h=r.connect(`${c}://${u}`,m),g=r.getDefaultSettings?.call(r)?.initialWindowSize??65535,_=n[`grpc-node.flow_control_window`];this.session=h;let v=`Failed to connect`,y=!1;h.unref(),h.once(`remoteSettings`,()=>{if(_&&_>g)try{h.setLocalWindowSize(_)}catch{let e=_-(h.state.localWindowSize??g);e>0&&h.incrementWindowSize(e)}h.removeAllListeners(),e.socket.removeListener(`close`,f),e.socket.removeListener(`error`,p),i(new O(h,t,n,o)),this.session=null}),h.once(`close`,f),h.once(`error`,p),e.socket.once(`close`,f),e.socket.once(`error`,p)})}tcpConnect(e,t){return(0,s.getProxiedConnection)(e,t).then(t=>t||new Promise((t,n)=>{let r=()=>{n(Error(`Socket closed`))},i=e=>{n(e)},a=f.connect(e,()=>{a.removeListener(`close`,r),a.removeListener(`error`,i),t(a)});a.once(`close`,r),a.once(`error`,i)}))}async connect(e,t,n){if(this.isShutdown)return Promise.reject();let r=null,i=null,a=(0,u.subchannelAddressToString)(e);try{return this.trace(a+` Waiting for secureConnector to be ready`),await t.waitForReady(),this.trace(a+` secureConnector is ready`),r=await this.tcpConnect(e,n),r.setNoDelay(),this.trace(a+` Established TCP connection`),i=await t.connect(r),this.trace(a+` Established secure connection`),this.createSession(i,e,n)}catch(e){throw r?.destroy(),i?.socket.destroy(),e}}shutdown(){var e;this.isShutdown=!0,(e=this.session)==null||e.close(),this.session=null}}})),Gt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SubchannelPool=void 0,e.getSubchannelPool=l;var t=de(),n=Rt(),r=q(),i=H(),a=Wt(),o=1e4,s=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let t in this.pool){let n=this.pool[t].filter(e=>!e.subchannel.unrefIfOneRef());n.length>0&&(e=!1),this.pool[t]=n}e&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,t;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},o),(t=(e=this.cleanupTimer).unref)==null||t.call(e))}getOrCreateSubchannel(e,o,s,c){this.ensureCleanupTask();let l=(0,i.uriToString)(e);if(l in this.pool){let e=this.pool[l];for(let n of e)if((0,r.subchannelAddressEqual)(o,n.subchannelAddress)&&(0,t.channelOptionsEqual)(s,n.channelArguments)&&c._equals(n.channelCredentials))return n.subchannel}let u=new n.Subchannel(e,o,s,c,new a.Http2SubchannelConnector(e));return l in this.pool||(this.pool[l]=[]),this.pool[l].push({subchannelAddress:o,channelArguments:s,channelCredentials:c,subchannel:u}),u.ref(),u}};e.SubchannelPool=s;var c=new s;function l(e){return e?c:new s}})),Kt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LoadBalancingCall=void 0;var n=W(),r=C(),i=Ft(),a=V(),o=G(),s=H(),c=B(),l=Pt(),u=t(`http2`),d=`load_balancing_call`;e.LoadBalancingCall=class{constructor(e,t,n,r,i,a,o){this.channel=e,this.callConfig=t,this.methodName=n,this.host=r,this.credentials=i,this.deadline=a,this.callNumber=o,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;let c=this.methodName.split(`/`),l=``;c.length>=2&&(l=c[1]),this.serviceUrl=`https://${(0,s.splitHostPort)(this.host)?.host??`localhost`}/${l}`,this.startTime=new Date}getDeadlineInfo(){let e=[];return this.childStartTime?(this.childStartTime>this.startTime&&(this.metadata?.getOptions().waitForReady&&e.push(`wait_for_ready`),e.push(`LB pick: ${(0,i.formatDateDifference)(this.startTime,this.childStartTime)}`)),e.push(...this.child.getDeadlineInfo()),e):(this.metadata?.getOptions().waitForReady&&e.push(`wait_for_ready`),e.push(`Waiting for LB pick`),e)}trace(e){c.trace(r.LogVerbosity.DEBUG,d,`[`+this.callNumber+`] `+e)}outputStatus(e,t){var n,r;if(!this.ended){this.ended=!0,this.trace(`ended with status: code=`+e.code+` details="`+e.details+`" start time=`+this.startTime.toISOString());let i=Object.assign(Object.assign({},e),{progress:t});(n=this.listener)==null||n.onReceiveStatus(i),(r=this.onCallEnded)==null||r.call(this,i.code,i.details,i.metadata)}}doPick(){if(this.ended)return;if(!this.metadata)throw Error(`doPick called before start`);this.trace(`Pick called`);let e=this.metadata.clone(),t=this.channel.doPick(e,this.callConfig.pickInformation),s=t.subchannel?`(`+t.subchannel.getChannelzRef().id+`) `+t.subchannel.getAddress():``+t.subchannel;switch(this.trace(`Pick result: `+o.PickResultType[t.pickResultType]+` subchannel: `+s+` status: `+t.status?.code+` `+t.status?.details),t.pickResultType){case o.PickResultType.COMPLETE:this.credentials.compose(t.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(o=>{var c;if(this.ended){this.trace(`Credentials metadata generation finished after call ended`);return}if(e.merge(o),e.get(`authorization`).length>1&&this.outputStatus({code:r.Status.INTERNAL,details:`"authorization" metadata cannot have multiple values`,metadata:new a.Metadata},`PROCESSED`),t.subchannel.getConnectivityState()!==n.ConnectivityState.READY){this.trace(`Picked subchannel `+s+` has state `+n.ConnectivityState[t.subchannel.getConnectivityState()]+` after getting credentials metadata. Retrying pick`),this.doPick();return}this.deadline!==1/0&&e.set(`grpc-timeout`,(0,i.getDeadlineTimeoutString)(this.deadline));try{this.child=t.subchannel.getRealSubchannel().createCall(e,this.host,this.methodName,{onReceiveMetadata:e=>{this.trace(`Received metadata`),this.listener.onReceiveMetadata(e)},onReceiveMessage:e=>{this.trace(`Received message`),this.listener.onReceiveMessage(e)},onReceiveStatus:e=>{this.trace(`Received status`),e.rstCode===u.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(e,`REFUSED`):this.outputStatus(e,`PROCESSED`)}}),this.childStartTime=new Date}catch(e){this.trace(`Failed to start call on picked subchannel `+s+` with error `+e.message),this.outputStatus({code:r.Status.INTERNAL,details:`Failed to start HTTP/2 stream with error `+e.message,metadata:new a.Metadata},`NOT_STARTED`);return}(c=t.onCallStarted)==null||c.call(t),this.onCallEnded=t.onCallEnded,this.trace(`Created child call [`+this.child.getCallNumber()+`]`),this.readPending&&this.child.startRead(),this.pendingMessage&&this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&&this.child.halfClose()},e=>{let{code:t,details:n}=(0,l.restrictControlPlaneStatusCode)(typeof e.code==`number`?e.code:r.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${e.message}`);this.outputStatus({code:t,details:n,metadata:new a.Metadata},`PROCESSED`)});break;case o.PickResultType.DROP:let{code:c,details:d}=(0,l.restrictControlPlaneStatusCode)(t.status.code,t.status.details);setImmediate(()=>{this.outputStatus({code:c,details:d,metadata:t.status.metadata},`DROP`)});break;case o.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:e,details:n}=(0,l.restrictControlPlaneStatusCode)(t.status.code,t.status.details);setImmediate(()=>{this.outputStatus({code:e,details:n,metadata:t.status.metadata},`PROCESSED`)})}break;case o.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,t){var n;this.trace(`cancelWithStatus code: `+e+` details: "`+t+`"`),(n=this.child)==null||n.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new a.Metadata},`PROCESSED`)}getPeer(){return this.child?.getPeer()??this.channel.getTarget()}start(e,t){this.trace(`start called`),this.listener=t,this.metadata=e,this.doPick()}sendMessageWithContext(e,t){this.trace(`write() called with message of length `+t.length),this.child?this.child.sendMessageWithContext(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace(`startRead called`),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace(`halfClose called`),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw Error(`Method not implemented.`)}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}}})),qt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ResolvingCall=void 0;var t=ie(),n=C(),r=Ft(),i=V(),a=B(),o=Pt(),s=`resolving_call`;e.ResolvingCall=class{constructor(e,i,a,o,s){this.channel=e,this.method=i,this.filterStackFactory=o,this.callNumber=s,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=>{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=t.CallCredentials.createEmpty(),this.deadline=a.deadline,this.host=a.host,a.parentCall&&(a.flags&n.Propagate.CANCELLATION&&a.parentCall.on(`cancelled`,()=>{this.cancelWithStatus(n.Status.CANCELLED,`Cancelled by parent call`)}),a.flags&n.Propagate.DEADLINE&&(this.trace(`Propagating deadline from parent: `+a.parentCall.getDeadline()),this.deadline=(0,r.minDeadline)(this.deadline,a.parentCall.getDeadline()))),this.trace(`Created`),this.runDeadlineTimer()}trace(e){a.trace(n.LogVerbosity.DEBUG,s,`[`+this.callNumber+`] `+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace(`Deadline: `+(0,r.deadlineToString)(this.deadline));let e=(0,r.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace(`Deadline will be reached in `+e+`ms`);let t=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(n.Status.DEADLINE_EXCEEDED,`Deadline exceeded`);return}let e=[],t=new Date;e.push(`Deadline exceeded after ${(0,r.formatDateDifference)(this.deadlineStartTime,t)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&e.push(`name resolution: ${(0,r.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&e.push(`metadata filters: ${(0,r.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):e.push(`waiting for metadata filters`)):e.push(`waiting for name resolution`),this.child&&e.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(n.Status.DEADLINE_EXCEEDED,e.join(`,`))};e<=0?process.nextTick(t):this.deadlineTimer=setTimeout(t,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let t=this.filterStack.receiveTrailers(e);this.trace(`ended with status: code=`+t.code+` details="`+t.details+`"`),this.statusWatchers.forEach(e=>e(t)),process.nextTick(()=>{var e;(e=this.listener)==null||e.onReceiveStatus(t)})}}sendMessageOnChild(e,t){if(!this.child)throw Error(`sendMessageonChild called with child not populated`);let n=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags})).then(t=>{this.writeFilterPending=!1,n.sendMessageWithContext(e,t.message),this.pendingHalfClose&&n.halfClose()},e=>{this.cancelWithStatus(e.code,e.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw Error(`getConfig called before start`);let e=this.channel.getConfig(this.method,this.metadata);if(e.type===`NONE`){this.channel.queueCallForConfig(this);return}else if(e.type===`ERROR`){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let t=e.config;if(t.status!==n.Status.OK){let{code:e,details:n}=(0,o.restrictControlPlaneStatusCode)(t.status,`Failed to route call to method `+this.method);this.outputStatus({code:e,details:n,metadata:new i.Metadata});return}if(t.methodConfig.timeout){let e=new Date;e.setSeconds(e.getSeconds()+t.methodConfig.timeout.seconds),e.setMilliseconds(e.getMilliseconds()+t.methodConfig.timeout.nanos/1e6),this.deadline=(0,r.minDeadline)(this.deadline,e),this.runDeadlineTimer()}this.filterStackFactory.push(t.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(e=>{this.child=this.channel.createRetryingCall(t,this.method,this.host,this.credentials,this.deadline),this.trace(`Created child [`+this.child.getCallNumber()+`]`),this.childStartTime=new Date,this.child.start(e,{onReceiveMetadata:e=>{this.trace(`Received metadata`),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(e))},onReceiveMessage:e=>{this.trace(`Received message`),this.readFilterPending=!0,this.filterStack.receiveMessage(e).then(e=>{this.trace(`Finished filtering received message`),this.readFilterPending=!1,this.listener.onReceiveMessage(e),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},e=>{this.cancelWithStatus(e.code,e.details)})},onReceiveStatus:e=>{this.trace(`Received status`),this.readFilterPending?this.pendingChildStatus=e:this.outputStatus(e)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},e=>{this.outputStatus(e)})}reportResolverError(e){this.metadata?.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,t){var n;this.trace(`cancelWithStatus code: `+e+` details: "`+t+`"`),(n=this.child)==null||n.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new i.Metadata})}getPeer(){return this.child?.getPeer()??this.channel.getTarget()}start(e,t){this.trace(`start called`),this.metadata=e.clone(),this.listener=t,this.getConfig()}sendMessageWithContext(e,t){this.trace(`write() called with message of length `+t.length),this.child?this.sendMessageOnChild(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace(`startRead called`),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace(`halfClose called`),this.child&&!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}}})),Jt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RetryingCall=e.MessageBufferTracker=e.RetryThrottler=void 0;var t=C(),n=Ft(),r=V(),i=B(),a=`retrying_call`;e.RetryThrottler=class{constructor(e,t,n){this.maxTokens=e,this.tokenRatio=t,n?this.tokens=n.tokens*(e/n.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens>this.maxTokens/2}},e.MessageBufferTracker=class{constructor(e,t){this.totalLimit=e,this.limitPerCall=t,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,t){let n=this.allocatedPerCall.get(t)??0;return this.limitPerCall-n<e||this.totalLimit-this.totalAllocated<e?!1:(this.allocatedPerCall.set(t,n+e),this.totalAllocated+=e,!0)}free(e,t){if(this.totalAllocated<e)throw Error(`Invalid buffer allocation state: call ${t} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let n=this.allocatedPerCall.get(t)??0;if(n<e)throw Error(`Invalid buffer allocation state: call ${t} freed ${e} > allocated for call ${n}`);this.allocatedPerCall.set(t,n-e)}freeAll(e){let t=this.allocatedPerCall.get(e)??0;if(this.totalAllocated<t)throw Error(`Invalid buffer allocation state: call ${e} allocated ${t} > total allocated ${this.totalAllocated}`);this.totalAllocated-=t,this.allocatedPerCall.delete(e)}};var o=`grpc-previous-rpc-attempts`,s=5;e.RetryingCall=class{constructor(e,t,n,r,i,a,o,c,l){this.channel=e,this.callConfig=t,this.methodName=n,this.host=r,this.credentials=i,this.deadline=a,this.callNumber=o,this.bufferTracker=c,this.retryThrottler=l,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;let u=e.getOptions()[`grpc-node.retry_max_attempts_limit`]??s;if(e.getOptions()[`grpc.enable_retries`]===0)this.state=`NO_RETRY`,this.maxAttempts=1;else if(t.methodConfig.retryPolicy){this.state=`RETRY`;let e=t.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(e.initialBackoff.substring(0,e.initialBackoff.length-1)),this.maxAttempts=Math.min(e.maxAttempts,u)}else t.methodConfig.hedgingPolicy?(this.state=`HEDGING`,this.maxAttempts=Math.min(t.methodConfig.hedgingPolicy.maxAttempts,u)):(this.state=`TRANSPARENT_ONLY`,this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],t=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&e.push(`previous attempts: ${this.underlyingCalls.length-1}`),t.startTime>this.startTime&&e.push(`time to current attempt start: ${(0,n.formatDateDifference)(this.startTime,t.startTime)}`),e.push(...t.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){i.trace(t.LogVerbosity.DEBUG,a,`[`+this.callNumber+`] `+e)}reportStatus(e){this.trace(`ended with status: code=`+e.code+` details="`+e.details+`" start time=`+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset+=this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var t;(t=this.listener)==null||t.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,t){this.trace(`cancelWithStatus code: `+e+` details: "`+t+`"`),this.reportStatus({code:e,details:t,metadata:new r.Metadata});for(let{call:n}of this.underlyingCalls)n.cancelWithStatus(e,t)}getPeer(){return this.committedCallIndex===null?`unknown`:this.underlyingCalls[this.committedCallIndex].call.getPeer()}getBufferEntry(e){return this.writeBuffer[e-this.writeBufferOffset]??{entryType:`FREED`,allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!==`COMMITTED`)return;let e;e=this.underlyingCalls[this.committedCallIndex].state===`COMPLETED`?this.getNextBufferIndex():this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let t=this.writeBufferOffset;t<e;t++){let e=this.getBufferEntry(t);e.allocated&&this.bufferTracker.free(e.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var n,r;if(this.state!==`COMMITTED`){this.trace(`Committing call [`+this.underlyingCalls[e].call.getCallNumber()+`] at index `+e),this.state=`COMMITTED`,(r=(n=this.callConfig).onCommitted)==null||r.call(n),this.committedCallIndex=e;for(let n=0;n<this.underlyingCalls.length;n++)n!==e&&this.underlyingCalls[n].state!==`COMPLETED`&&(this.underlyingCalls[n].state=`COMPLETED`,this.underlyingCalls[n].call.cancelWithStatus(t.Status.CANCELLED,`Discarded in favor of other hedged attempt`));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state===`COMMITTED`)return;let e=-1,t=-1;for(let[n,r]of this.underlyingCalls.entries())r.state===`ACTIVE`&&r.nextMessageToSend>e&&(e=r.nextMessageToSend,t=n);t===-1?this.state=`TRANSPARENT_ONLY`:this.commitCall(t)}isStatusCodeInList(e,n){return e.some(e=>e===n||e.toString().toLowerCase()===t.Status[n]?.toLowerCase())}getNextRetryJitter(){return Math.random()*.3999999999999999+.8}getNextRetryBackoffMs(){let e=this.callConfig?.methodConfig.retryPolicy;if(!e)return 0;let t=this.getNextRetryJitter()*this.nextRetryBackoffSec*1e3,n=Number(e.maxBackoff.substring(0,e.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*e.backoffMultiplier,n),t}maybeRetryCall(e,t){if(this.state!==`RETRY`){t(!1);return}if(this.attempts>=this.maxAttempts){t(!1);return}let n;if(e===null)n=this.getNextRetryBackoffMs();else if(e<0){this.state=`TRANSPARENT_ONLY`,t(!1);return}else n=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{if(this.state!==`RETRY`){t(!1);return}this.retryThrottler?.canRetryCall()??!0?(t(!0),this.attempts+=1,this.startNewAttempt()):(this.trace(`Retry attempt denied by throttling policy`),t(!1))},n)}countActiveCalls(){let e=0;for(let t of this.underlyingCalls)t?.state===`ACTIVE`&&(e+=1);return e}handleProcessedStatus(e,t,n){var r,i;switch(this.state){case`COMMITTED`:case`NO_RETRY`:case`TRANSPARENT_ONLY`:this.commitCall(t),this.reportStatus(e);break;case`HEDGING`:if(this.isStatusCodeInList(this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes??[],e.code)){(r=this.retryThrottler)==null||r.addCallFailed();let i;if(n===null)i=0;else if(n<0){this.state=`TRANSPARENT_ONLY`,this.commitCall(t),this.reportStatus(e);return}else i=n;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(t),this.reportStatus(e))},i)}else this.commitCall(t),this.reportStatus(e);break;case`RETRY`:this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((i=this.retryThrottler)==null||i.addCallFailed(),this.maybeRetryCall(n,n=>{n||(this.commitCall(t),this.reportStatus(e))})):(this.commitCall(t),this.reportStatus(e));break}}getPushback(e){let t=e.get(`grpc-retry-pushback-ms`);if(t.length===0)return null;try{return parseInt(t[0])}catch{return-1}}handleChildStatus(e,n){var r;if(this.underlyingCalls[n].state===`COMPLETED`)return;if(this.trace(`state=`+this.state+` handling status with progress `+e.progress+` from child [`+this.underlyingCalls[n].call.getCallNumber()+`] in state `+this.underlyingCalls[n].state),this.underlyingCalls[n].state=`COMPLETED`,e.code===t.Status.OK){(r=this.retryThrottler)==null||r.addCallSucceeded(),this.commitCall(n),this.reportStatus(e);return}if(this.state===`NO_RETRY`){this.commitCall(n),this.reportStatus(e);return}if(this.state===`COMMITTED`){this.reportStatus(e);return}let i=this.getPushback(e.metadata);switch(e.progress){case`NOT_STARTED`:this.startNewAttempt();break;case`REFUSED`:this.transparentRetryUsed?this.handleProcessedStatus(e,n,i):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case`DROP`:this.commitCall(n),this.reportStatus(e);break;case`PROCESSED`:this.handleProcessedStatus(e,n,i);break}}maybeStartHedgingAttempt(){this.state===`HEDGING`&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,t;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!==`HEDGING`||!this.callConfig.methodConfig.hedgingPolicy)return;let n=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let r=n.hedgingDelay??`0s`,i=Number(r.substring(0,r.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},i*1e3),(t=(e=this.hedgingTimer).unref)==null||t.call(e)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace(`Created child call [`+e.getCallNumber()+`] for attempt `+this.attempts);let t=this.underlyingCalls.length;this.underlyingCalls.push({state:`ACTIVE`,call:e,nextMessageToSend:0,startTime:new Date});let n=this.attempts-1,r=this.initialMetadata.clone();n>0&&r.set(o,`${n}`);let i=!1;e.start(r,{onReceiveMetadata:r=>{this.trace(`Received metadata from child [`+e.getCallNumber()+`]`),this.commitCall(t),i=!0,n>0&&r.set(o,`${n}`),this.underlyingCalls[t].state===`ACTIVE`&&this.listener.onReceiveMetadata(r)},onReceiveMessage:n=>{this.trace(`Received message from child [`+e.getCallNumber()+`]`),this.commitCall(t),this.underlyingCalls[t].state===`ACTIVE`&&this.listener.onReceiveMessage(n)},onReceiveStatus:r=>{this.trace(`Received status from child [`+e.getCallNumber()+`]`),!i&&n>0&&r.metadata.set(o,`${n}`),this.handleChildStatus(r,t)}}),this.sendNextChildMessage(t),this.readStarted&&e.startRead()}start(e,t){this.trace(`start called`),this.listener=t,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e,t){var n,r;(r=(n=this.getBufferEntry(t)).callback)==null||r.call(n),this.clearSentMessages();let i=this.underlyingCalls[e];i.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let t=this.underlyingCalls[e];if(t.state===`COMPLETED`)return;let n=t.nextMessageToSend;if(this.getBufferEntry(n)){let r=this.getBufferEntry(n);switch(r.entryType){case`MESSAGE`:t.call.sendMessageWithContext({callback:t=>{this.handleChildWriteCompleted(e,n)}},r.message.message),this.getBufferEntry(n+1).entryType===`HALF_CLOSE`&&(this.trace(`Sending halfClose immediately after message to child [`+t.call.getCallNumber()+`] - optimizing for unary/final message`),t.nextMessageToSend+=1,t.call.halfClose());break;case`HALF_CLOSE`:t.nextMessageToSend+=1,t.call.halfClose();break;case`FREED`:break}}}sendMessageWithContext(e,t){this.trace(`write() called with message of length `+t.length);let n={message:t,flags:e.flags},r=this.getNextBufferIndex(),i={entryType:`MESSAGE`,message:n,allocated:this.bufferTracker.allocate(t.length,this.callNumber)};if(this.writeBuffer.push(i),i.allocated){process.nextTick(()=>{var t;(t=e.callback)==null||t.call(e)});for(let[e,n]of this.underlyingCalls.entries())n.state===`ACTIVE`&&n.nextMessageToSend===r&&n.call.sendMessageWithContext({callback:t=>{this.handleChildWriteCompleted(e,r)}},t)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let n=this.underlyingCalls[this.committedCallIndex];i.callback=e.callback,n.state===`ACTIVE`&&n.nextMessageToSend===r&&n.call.sendMessageWithContext({callback:e=>{this.handleChildWriteCompleted(this.committedCallIndex,r)}},t)}}startRead(){this.trace(`startRead called`),this.readStarted=!0;for(let e of this.underlyingCalls)e?.state===`ACTIVE`&&e.call.startRead()}halfClose(){this.trace(`halfClose called`);let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:`HALF_CLOSE`,allocated:!1});for(let t of this.underlyingCalls)t?.state===`ACTIVE`&&(t.nextMessageToSend===e||t.nextMessageToSend===e-1)&&(this.trace(`Sending halfClose immediately to child [`+t.call.getCallNumber()+`] - all messages already sent`),t.nextMessageToSend+=1,t.call.halfClose())}setCredentials(e){throw Error(`Method not implemented.`)}getMethod(){return this.methodName}getHost(){return this.host}getAuthContext(){return this.committedCallIndex===null?null:this.underlyingCalls[this.committedCallIndex].call.getAuthContext()}}})),Yt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BaseSubchannelWrapper=void 0,e.BaseSubchannelWrapper=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,this.refcount=0,this.dataWatchers=new Set,e.addHealthStateWatcher(e=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref(),this.refcount+=1}unref(){this.child.unref(),--this.refcount,this.refcount===0&&this.destroy()}destroy(){for(let e of this.dataWatchers)e.destroy()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}addDataWatcher(e){e.setSubchannel(this.getRealSubchannel()),this.dataWatchers.add(e)}setHealthy(e){e!==this.healthy&&(this.healthy=e,this.child.isHealthy()&&this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}getChannel(){return this.child.getChannel()}}})),Xt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InternalChannel=e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var t=oe(),n=ue(),r=Gt(),i=G(),a=V(),o=C(),s=It(),c=Nt(),l=U(),u=B(),d=Vt(),f=H(),p=W(),m=kt(),h=Kt(),g=Ft(),_=qt(),v=At(),y=Pt(),b=Jt(),x=Yt(),S=2147483647,w=1e3,T=1800*1e3,E=new Map,D=1<<24,O=1<<20,k=class extends x.BaseSubchannelWrapper{constructor(e,t){super(e),this.channel=t,this.refCount=0,this.subchannelStateListener=(e,n,r,i)=>{t.throttleKeepalive(i)}}ref(){this.refCount===0&&(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),--this.refCount,this.refCount<=0&&(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},A=class{pick(e){return{pickResultType:i.PickResultType.DROP,status:{code:o.Status.UNAVAILABLE,details:`Channel closed before call started`,metadata:new a.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=`grpc.internal.no_subchannel`;var j=class{constructor(e){this.target=e,this.trace=new m.ChannelzTrace,this.callTracker=new m.ChannelzCallTracker,this.childrenTracker=new m.ChannelzChildrenTracker,this.state=p.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}};e.InternalChannel=class{constructor(a,h,g){if(this.credentials=h,this.options=g,this.connectivityState=p.ConnectivityState.IDLE,this.currentPicker=new i.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.callRefTimer=null,this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.randomChannelId=Math.floor(Math.random()*(2**53-1)),typeof a!=`string`)throw TypeError(`Channel target must be a string`);if(!(h instanceof t.ChannelCredentials))throw TypeError(`Channel credentials must be a ChannelCredentials object`);if(g&&typeof g!=`object`)throw TypeError(`Channel options must be an object`);this.channelzInfoTracker=new j(a);let _=(0,f.parseUri)(a);if(_===null)throw Error(`Could not parse target name "${a}"`);let v=(0,l.mapUriDefaultScheme)(_);if(v===null)throw Error(`Could not find a default scheme for target name "${a}"`);this.options[`grpc.enable_channelz`]===0&&(this.channelzEnabled=!1),this.channelzRef=(0,m.registerChannelzChannel)(a,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_INFO`,`Channel created`),this.options[`grpc.default_authority`]?this.defaultAuthority=this.options[`grpc.default_authority`]:this.defaultAuthority=(0,l.getDefaultAuthority)(v);let x=(0,d.mapProxyName)(v,g);this.target=x.target,this.options=Object.assign({},this.options,x.extraOptions),this.subchannelPool=(0,r.getSubchannelPool)((this.options[`grpc.use_local_subchannel_pool`]??0)===0),this.retryBufferTracker=new b.MessageBufferTracker(this.options[`grpc.retry_buffer_size`]??D,this.options[`grpc.per_rpc_retry_buffer_size`]??O),this.keepaliveTime=this.options[`grpc.keepalive_time_ms`]??-1,this.idleTimeoutMs=Math.max(this.options[`grpc.client_idle_timeout_ms`]??T,w),this.resolvingLoadBalancer=new n.ResolvingLoadBalancer(this.target,{createSubchannel:(t,n)=>{let r={};for(let[t,i]of Object.entries(n))t.startsWith(e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(r[t]=i);let i=this.subchannelPool.getOrCreateSubchannel(this.target,t,r,this.credentials);return i.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_INFO`,`Created subchannel or used existing subchannel`,i.getChannelzRef()),new k(i,this)},updateState:(e,t)=>{this.currentPicker=t;let n=this.pickQueue.slice();this.pickQueue=[],n.length>0&&this.callRefTimerUnref();for(let e of n)e.doPick();this.updateState(e)},requestReresolution:()=>{throw Error(`Resolving load balancer should never call requestReresolution`)},addChannelzChild:e=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.refChild(e)},removeChannelzChild:e=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.unrefChild(e)}},this.options,(e,t)=>{var n;e.retryThrottling?E.set(this.getTarget(),new b.RetryThrottler(e.retryThrottling.maxTokens,e.retryThrottling.tokenRatio,E.get(this.getTarget()))):E.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_INFO`,`Address resolution succeeded`),(n=this.configSelector)==null||n.unref(),this.configSelector=t,this.currentResolutionError=null,process.nextTick(()=>{let e=this.configSelectionQueue;this.configSelectionQueue=[],e.length>0&&this.callRefTimerUnref();for(let t of e)t.getConfig()})},e=>{this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_WARNING`,`Address resolution failed with code `+e.code+` and details "`+e.details+`"`),this.configSelectionQueue.length>0&&this.trace(`Name resolution failed with calls queued for config selection`),this.configSelector===null&&(this.currentResolutionError=Object.assign(Object.assign({},(0,y.restrictControlPlaneStatusCode)(e.code,e.details)),{metadata:e.metadata}));let t=this.configSelectionQueue;this.configSelectionQueue=[],t.length>0&&this.callRefTimerUnref();for(let n of t)n.reportResolverError(e)}),this.filterStackFactory=new s.FilterStackFactory([new c.CompressionFilterFactory(this,this.options)]),this.trace(`Channel constructed with options `+JSON.stringify(g,void 0,2));let S=Error();(0,u.isTracerEnabled)(`channel_stacktrace`)&&(0,u.trace)(o.LogVerbosity.DEBUG,`channel_stacktrace`,`(`+this.channelzRef.id+`) Channel constructed
18
+ `+S.stack?.substring(S.stack.indexOf(`
19
+ `)+1)),this.lastActivityTimestamp=new Date}trace(e,t){(0,u.trace)(t??o.LogVerbosity.DEBUG,`channel`,`(`+this.channelzRef.id+`) `+(0,f.uriToString)(this.target)+` `+e)}callRefTimerRef(){var e,t,n;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},S)),(e=this.callRefTimer).hasRef?.call(e)||(this.trace(`callRefTimer.ref | configSelectionQueue.length=`+this.configSelectionQueue.length+` pickQueue.length=`+this.pickQueue.length),(n=(t=this.callRefTimer).ref)==null||n.call(t))}callRefTimerUnref(){var e,t;(!this.callRefTimer?.hasRef||this.callRefTimer.hasRef())&&(this.trace(`callRefTimer.unref | configSelectionQueue.length=`+this.configSelectionQueue.length+` pickQueue.length=`+this.pickQueue.length),(t=(e=this.callRefTimer)?.unref)==null||t.call(e))}removeConnectivityStateWatcher(e){let t=this.connectivityStateWatchers.findIndex(t=>t===e);t>=0&&this.connectivityStateWatchers.splice(t,1)}updateState(e){(0,u.trace)(o.LogVerbosity.DEBUG,`connectivity_state`,`(`+this.channelzRef.id+`) `+(0,f.uriToString)(this.target)+` `+p.ConnectivityState[this.connectivityState]+` -> `+p.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_INFO`,`Connectivity state change to `+p.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let t=this.connectivityStateWatchers.slice();for(let n of t)e!==n.currentState&&(n.timer&&clearTimeout(n.timer),this.removeConnectivityStateWatcher(n),n.callback());e!==p.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let t of this.wrappedSubchannels)t.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,t){return this.currentPicker.pick({metadata:e,extraPickInfo:t})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,t){return this.connectivityState!==p.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:`SUCCESS`,config:this.configSelector.invoke(e,t,this.randomChannelId)}:this.currentResolutionError?{type:`ERROR`,error:this.currentResolutionError}:{type:`NONE`}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(p.ConnectivityState.IDLE),this.currentPicker=new i.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&&(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var t,n;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let e=new Date().valueOf()-this.lastActivityTimestamp.valueOf();e>=this.idleTimeoutMs?(this.trace(`Idle timer triggered after `+this.idleTimeoutMs+`ms of inactivity`),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-e)},e),(n=(t=this.idleTimer).unref)==null||n.call(t)}maybeStartIdleTimer(){this.connectivityState!==p.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===o.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),--this.callCount,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,t,n,r,i){let a=(0,v.getNextCallNumber)();return this.trace(`createLoadBalancingCall [`+a+`] method="`+t+`"`),new h.LoadBalancingCall(this,e,t,n,r,i,a)}createRetryingCall(e,t,n,r,i){let a=(0,v.getNextCallNumber)();return this.trace(`createRetryingCall [`+a+`] method="`+t+`"`),new b.RetryingCall(this,e,t,n,r,i,a,this.retryBufferTracker,E.get(this.getTarget()))}createResolvingCall(e,t,n,r,i){let a=(0,v.getNextCallNumber)();this.trace(`createResolvingCall [`+a+`] method="`+e+`", deadline=`+(0,g.deadlineToString)(t));let s={deadline:t,flags:i??o.Propagate.DEFAULTS,host:n??this.defaultAuthority,parentCall:r},c=new _.ResolvingCall(this,e,s,this.filterStackFactory.clone(),a);return this.onCallStart(),c.addStatusWatcher(e=>{this.onCallEnd(e)}),c}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(p.ConnectivityState.SHUTDOWN),this.currentPicker=new A;for(let e of this.configSelectionQueue)e.cancelWithStatus(o.Status.UNAVAILABLE,`Channel closed before call started`);this.configSelectionQueue=[];for(let e of this.pickQueue)e.cancelWithStatus(o.Status.UNAVAILABLE,`Channel closed before call started`);this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,m.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)==null||e.unref(),this.configSelector=null}getTarget(){return(0,f.uriToString)(this.target)}getConnectivityState(e){let t=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),t}watchConnectivityState(e,t,n){if(this.connectivityState===p.ConnectivityState.SHUTDOWN)throw Error(`Channel has been shut down`);let r=null;if(t!==1/0){let e=t instanceof Date?t:new Date(t),a=new Date;if(t===-1/0||e<=a){process.nextTick(n,Error(`Deadline passed without connectivity state change`));return}r=setTimeout(()=>{this.removeConnectivityStateWatcher(i),n(Error(`Deadline passed without connectivity state change`))},e.getTime()-a.getTime())}let i={currentState:e,callback:n,timer:r};this.connectivityStateWatchers.push(i)}getChannelzRef(){return this.channelzRef}createCall(e,t,n,r,i){if(typeof e!=`string`)throw TypeError(`Channel#createCall: method must be a string`);if(!(typeof t==`number`||t instanceof Date))throw TypeError(`Channel#createCall: deadline must be a number or Date`);if(this.connectivityState===p.ConnectivityState.SHUTDOWN)throw Error(`Channel has been shut down`);return this.createResolvingCall(e,t,n,r,i)}getOptions(){return this.options}}})),Zt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ChannelImplementation=void 0;var t=oe(),n=Xt();e.ChannelImplementation=class{constructor(e,r,i){if(typeof e!=`string`)throw TypeError(`Channel target must be a string`);if(!(r instanceof t.ChannelCredentials))throw TypeError(`Channel credentials must be a ChannelCredentials object`);if(i&&typeof i!=`object`)throw TypeError(`Channel options must be an object`);this.internalChannel=new n.InternalChannel(e,r,i)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,t,n){this.internalChannel.watchConnectivityState(e,t,n)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,t,n,r,i){if(typeof e!=`string`)throw TypeError(`Channel#createCall: method must be a string`);if(!(typeof t==`number`||t instanceof Date))throw TypeError(`Channel#createCall: deadline must be a number or Date`);return this.internalChannel.createCall(e,t,n,r,i)}}})),Qt=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ServerDuplexStreamImpl=e.ServerWritableStreamImpl=e.ServerReadableStreamImpl=e.ServerUnaryCallImpl=void 0,e.serverErrorToStatus=o;var n=t(`events`),r=t(`stream`),i=C(),a=V();function o(e,t){let n={code:i.Status.UNKNOWN,details:`message`in e?e.message:`Unknown Error`,metadata:t??e.metadata??null};return`code`in e&&typeof e.code==`number`&&Number.isInteger(e.code)&&(n.code=e.code,`details`in e&&typeof e.details==`string`&&(n.details=e.details)),n}e.ServerUnaryCallImpl=class extends n.EventEmitter{constructor(e,t,n,r){super(),this.path=e,this.call=t,this.metadata=n,this.request=r,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}},e.ServerReadableStreamImpl=class extends r.Readable{constructor(e,t,n){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=n,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}},e.ServerWritableStreamImpl=class extends r.Writable{constructor(e,t,n,r){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=n,this.request=r,this.pendingStatus={code:i.Status.OK,details:`OK`},this.cancelled=!1,this.trailingMetadata=new a.Metadata,this.on(`error`,e=>{this.pendingStatus=o(e),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_write(e,t,n){this.call.sendMessage(e,n)}_final(e){e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:this.pendingStatus.metadata??this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}},e.ServerDuplexStreamImpl=class extends r.Duplex{constructor(e,t,n){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=n,this.pendingStatus={code:i.Status.OK,details:`OK`},this.cancelled=!1,this.trailingMetadata=new a.Metadata,this.on(`error`,e=>{this.pendingStatus=o(e),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_read(e){this.call.startRead()}_write(e,t,n){this.call.sendMessage(e,n)}_final(e){e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:this.pendingStatus.metadata??this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}}})),$t=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ServerCredentials=void 0,e.createCertificateProviderServerCredentials=o,e.createServerCredentialsWithInterceptors=c;var t=ae(),n=class{constructor(e,t){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=t??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let e of this.watchers)e(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new r}static createSsl(e,n,r=!1){if(e!==null&&!Buffer.isBuffer(e))throw TypeError(`rootCerts must be null or a Buffer`);if(!Array.isArray(n))throw TypeError(`keyCertPairs must be an array`);if(typeof r!=`boolean`)throw TypeError(`checkClientCertificate must be a boolean`);let a=[],o=[];for(let e=0;e<n.length;e++){let t=n[e];if(typeof t!=`object`||!t)throw TypeError(`keyCertPair[${e}] must be an object`);if(!Buffer.isBuffer(t.private_key))throw TypeError(`keyCertPair[${e}].private_key must be a Buffer`);if(!Buffer.isBuffer(t.cert_chain))throw TypeError(`keyCertPair[${e}].cert_chain must be a Buffer`);a.push(t.cert_chain),o.push(t.private_key)}return new i({requestCert:r,ciphers:t.CIPHER_SUITES},{ca:e??(0,t.getDefaultRootsData)()??void 0,cert:a,key:o})}};e.ServerCredentials=n;var r=class e extends n{constructor(){super(null)}_getSettings(){return null}_equals(t){return t instanceof e}},i=class e extends n{constructor(e,t){super(e,t),this.options=Object.assign(Object.assign({},e),t)}_equals(t){if(this===t)return!0;if(!(t instanceof e))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(t.options.ca)){if(!this.options.ca.equals(t.options.ca))return!1}else if(this.options.ca!==t.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(t.options.cert)){if(this.options.cert.length!==t.options.cert.length)return!1;for(let e=0;e<this.options.cert.length;e++){let n=this.options.cert[e],r=t.options.cert[e];if(Buffer.isBuffer(n)&&Buffer.isBuffer(r)){if(!n.equals(r))return!1}else if(n!==r)return!1}}else if(this.options.cert!==t.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(t.options.key)){if(this.options.key.length!==t.options.key.length)return!1;for(let e=0;e<this.options.key.length;e++){let n=this.options.key[e],r=t.options.key[e];if(Buffer.isBuffer(n)&&Buffer.isBuffer(r)){if(!n.equals(r))return!1}else if(n!==r)return!1}}else if(this.options.key!==t.options.key)return!1;return this.options.requestCert===t.options.requestCert}},a=class e extends n{constructor(e,n,r){super({requestCert:n!==null,rejectUnauthorized:r,ciphers:t.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=n,this.requireClientCertificate=r,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var t;this.getWatcherCount()===0&&((t=this.caCertificateProvider)==null||t.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var t;super._removeWatcher(e),this.getWatcherCount()===0&&((t=this.caCertificateProvider)==null||t.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(t){return this===t?!0:t instanceof e?this.caCertificateProvider===t.caCertificateProvider&&this.identityCertificateProvider===t.identityCertificateProvider&&this.requireClientCertificate===t.requireClientCertificate:!1}calculateSecureContextOptions(){return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:this.latestCaUpdate?.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function o(e,t,n){return new a(e,t,n)}var s=class e extends n{constructor(e,t){super({}),this.childCredentials=e,this.interceptors=t}_isSecure(){return this.childCredentials._isSecure()}_equals(t){if(!(t instanceof e)||!this.childCredentials._equals(t.childCredentials)||this.interceptors.length!==t.interceptors.length)return!1;for(let e=0;e<this.interceptors.length;e++)if(this.interceptors[e]!==t.interceptors[e])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function c(e,t){return new s(e,t)}})),en=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.durationMessageToDuration=t,e.msToDuration=n,e.durationToMs=r,e.isDuration=i,e.isDurationMessage=a,e.parseDuration=s,e.durationToString=c;function t(e){return{seconds:Number.parseInt(e.seconds),nanos:e.nanos}}function n(e){return{seconds:e/1e3|0,nanos:e%1e3*1e6|0}}function r(e){return e.seconds*1e3+e.nanos/1e6|0}function i(e){return typeof e.seconds==`number`&&typeof e.nanos==`number`}function a(e){return typeof e.seconds==`string`&&typeof e.nanos==`number`}var o=/^(\d+)(?:\.(\d+))?s$/;function s(e){let t=e.match(o);return t?{seconds:Number.parseInt(t[1],10),nanos:t[2]?Number.parseInt(t[2].padEnd(9,`0`),10):0}:null}function c(e){if(e.nanos===0)return`${e.seconds}s`;let t;return t=e.nanos%1e6==0?1e6:e.nanos%1e3==0?1e3:1,`${e.seconds}.${e.nanos/t}s`}})),tn=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.OrcaOobMetricsSubchannelWrapper=e.GRPC_METRICS_HEADER=e.ServerMetricRecorder=e.PerRequestMetricRecorder=void 0,e.createOrcaClient=u,e.createMetricsReader=f;var t=Ee(),n=en(),r=oe(),i=Yt(),a=C(),o=K(),s=W();function c(){let e=Ot().loadSync,n=e(`xds/service/orca/v3/orca.proto`,{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto/xds`,`${__dirname}/../../proto/protoc-gen-validate`]});return(0,t.loadPackageDefinition)(n)}e.PerRequestMetricRecorder=class{constructor(){this.message={}}recordRequestCostMetric(e,t){this.message.request_cost||(this.message.request_cost={}),this.message.request_cost[e]=t}recordUtilizationMetric(e,t){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=t}recordNamedMetric(e,t){this.message.named_metrics||(this.message.named_metrics={}),this.message.named_metrics[e]=t}recordCPUUtilizationMetric(e){this.message.cpu_utilization=e}recordMemoryUtilizationMetric(e){this.message.mem_utilization=e}recordApplicationUtilizationMetric(e){this.message.application_utilization=e}recordQpsMetric(e){this.message.rps_fractional=e}recordEpsMetric(e){this.message.eps=e}serialize(){return c().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}};var l=3e4;e.ServerMetricRecorder=class{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:e=>{let t=e.request.report_interval?(0,n.durationToMs)((0,n.durationMessageToDuration)(e.request.report_interval)):l,r=setInterval(()=>{e.write(this.message)},t);e.on(`cancelled`,()=>{clearInterval(r)})}}}putUtilizationMetric(e,t){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=t}setAllUtilizationMetrics(e){this.message.utilization=Object.assign({},e)}deleteUtilizationMetric(e){var t;(t=this.message.utilization)==null||delete t[e]}setCpuUtilizationMetric(e){this.message.cpu_utilization=e}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(e){this.message.application_utilization=e}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(e){this.message.rps_fractional=e}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(e){this.message.eps=e}deleteEpsMetric(){delete this.message.eps}addToServer(e){let t=c().xds.service.orca.v3.OpenRcaService.service;e.addService(t,this.serviceImplementation)}};function u(e){let t=c().xds.service.orca.v3.OpenRcaService;return new t(`unused`,r.ChannelCredentials.createInsecure(),{channelOverride:e})}e.GRPC_METRICS_HEADER=`endpoint-load-metrics-bin`;var d=`grpc_orca_load_report`;function f(t,n){return(r,i,a)=>{let o=a.getOpaque(d);if(o)t(o);else{let n=a.get(e.GRPC_METRICS_HEADER);n.length>0&&(o=c().xds.data.orca.v3.OrcaLoadReport.deserialize(n[0]),t(o),a.setOpaque(d,o))}n&&n(r,i,a)}}var p=`orca_oob_metrics`,m=class{constructor(e,t){this.metricsListener=e,this.intervalMs=t,this.dataProducer=null}setSubchannel(e){let t=e.getOrCreateDataProducer(p,g);this.dataProducer=t,t.addDataWatcher(this)}destroy(){var e;(e=this.dataProducer)==null||e.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(e){this.metricsListener(e)}},h=class{constructor(e){this.subchannel=e,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new o.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription(),this.client=u(e.getChannel()),e.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(e){this.dataWatchers.add(e),this.updateMetricsSubscription()}removeDataWatcher(e){var t;this.dataWatchers.delete(e),this.dataWatchers.size===0?(this.subchannel.removeDataProducer(p),(t=this.metricsCall)==null||t.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener)):this.updateMetricsSubscription()}updateMetricsSubscription(){var e;if(this.dataWatchers.size===0||!this.orcaSupported||this.subchannel.getConnectivityState()!==s.ConnectivityState.READY)return;let t=Math.min(...Array.from(this.dataWatchers).map(e=>e.getInterval()));if(!this.metricsCall||t!==this.currentInterval){(e=this.metricsCall)==null||e.cancel(),this.currentInterval=t;let r=this.client.streamCoreMetrics({report_interval:(0,n.msToDuration)(t)});this.metricsCall=r,r.on(`data`,e=>{this.dataWatchers.forEach(t=>{t.onMetricsUpdate(e)})}),r.on(`error`,e=>{if(this.metricsCall=null,e.code===a.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}e.code!==a.Status.CANCELLED&&this.backoffTimer.runOnce()})}}};e.OrcaOobMetricsSubchannelWrapper=class extends i.BaseSubchannelWrapper{constructor(e,t,n){super(e),this.addDataWatcher(new m(t,n))}getWrappedSubchannel(){return this.child}};function g(e){return new h(e)}})),nn=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BaseServerInterceptingCall=e.ServerInterceptingCall=e.ResponderBuilder=e.ServerListenerBuilder=void 0,e.isInterceptingServerListener=p,e.getServerInterceptingCall=k;var n=V(),r=C(),i=t(`http2`),a=re(),o=t(`zlib`),s=Ht(),c=B(),l=t(`tls`),u=tn(),d=`server_call`;function f(e){c.trace(r.LogVerbosity.DEBUG,d,e)}e.ServerListenerBuilder=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};function p(e){return e.onReceiveMetadata!==void 0&&e.onReceiveMetadata.length===1}var m=class{constructor(e,t){this.listener=e,this.nextListener=t,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&&(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,e=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(e),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,e=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=e,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(e),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}};e.ResponderBuilder=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};var h={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveHalfClose:e=>{e()},onCancel:()=>{}},g={start:e=>{e()},sendMetadata:(e,t)=>{t(e)},sendMessage:(e,t)=>{t(e)},sendStatus:(e,t)=>{t(e)}};e.ServerInterceptingCall=class{constructor(e,t){this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:t?.start??g.start,sendMetadata:t?.sendMetadata??g.sendMetadata,sendMessage:t?.sendMessage??g.sendMessage,sendStatus:t?.sendStatus??g.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&&(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(t=>{let n=new m({onReceiveMetadata:t?.onReceiveMetadata??h.onReceiveMetadata,onReceiveMessage:t?.onReceiveMessage??h.onReceiveMessage,onReceiveHalfClose:t?.onReceiveHalfClose??h.onReceiveHalfClose,onCancel:t?.onCancel??h.onCancel},e);this.nextCall.start(n)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,e=>{this.processingMetadata=!1,this.nextCall.sendMetadata(e),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,t){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new n.Metadata),this.responder.sendMessage(e,e=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=e,this.pendingMessageCallback=t):this.nextCall.sendMessage(e,t)})}sendStatus(e){this.responder.sendStatus(e,e=>{this.processingMetadata||this.processingMessage?this.pendingStatus=e:this.nextCall.sendStatus(e)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}getAuthContext(){return this.nextCall.getAuthContext()}getConnectionInfo(){return this.nextCall.getConnectionInfo()}getMetricsRecorder(){return this.nextCall.getMetricsRecorder()}};var _=`grpc-accept-encoding`,v=`grpc-encoding`,y=`grpc-message`,b=`grpc-status`,x=`grpc-timeout`,S=/(\d{1,8})\s*([HMSmun])/,w={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},T={[_]:`identity,deflate,gzip`,[v]:`identity`},E={[i.constants.HTTP2_HEADER_STATUS]:i.constants.HTTP_STATUS_OK,[i.constants.HTTP2_HEADER_CONTENT_TYPE]:`application/grpc+proto`},D={waitForTrailers:!0},O=class{constructor(e,t,a,o,l){this.stream=e,this.callEventTracker=a,this.handler=o,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=r.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=r.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding=`identity`,this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.metricsRecorder=new u.PerRequestMetricRecorder,this.stream.once(`error`,e=>{}),this.stream.once(`close`,()=>{f(`Request to method `+this.handler?.path+` stream closed with rstCode `+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:r.Status.CANCELLED,details:`Stream closed before sending status`,metadata:null})),this.notifyOnCancel()}),this.stream.on(`data`,e=>{this.handleDataFrame(e)}),this.stream.pause(),this.stream.on(`end`,()=>{this.handleEndEvent()}),`grpc.max_send_message_length`in l&&(this.maxSendMessageSize=l[`grpc.max_send_message_length`]),`grpc.max_receive_message_length`in l&&(this.maxReceiveMessageSize=l[`grpc.max_receive_message_length`]),this.host=t[`:authority`]??t.host,this.decoder=new s.StreamDecoder(this.maxReceiveMessageSize);let p=n.Metadata.fromHttp2Headers(t);c.isTracerEnabled(d)&&f(`Request to `+this.handler.path+` received headers `+JSON.stringify(p.toJSON()));let m=p.get(x);m.length>0&&this.handleTimeoutHeader(m[0]);let h=p.get(v);h.length>0&&(this.incomingEncoding=h[0]),p.remove(x),p.remove(v),p.remove(_),p.remove(i.constants.HTTP2_HEADER_ACCEPT_ENCODING),p.remove(i.constants.HTTP2_HEADER_TE),p.remove(i.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=p;let g=e.session?.socket;this.connectionInfo={localAddress:g?.localAddress,localPort:g?.localPort,remoteAddress:g?.remoteAddress,remotePort:g?.remotePort},this.shouldSendMetrics=!!l[`grpc.server_call_metric_recording`]}handleTimeoutHeader(e){let t=e.toString().match(S);if(t===null){let t={code:r.Status.INTERNAL,details:`Invalid ${x} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(t)});return}let n=+t[1]*w[t[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+n),this.deadlineTimer=setTimeout(()=>{let e={code:r.Status.DEADLINE_EXCEEDED,details:`Deadline exceeded`,metadata:null};this.sendStatus(e)},n)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;(e=this.listener)==null||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new n.Metadata)}serializeMessage(e){let t=this.handler.serialize(e),n=t.byteLength,r=Buffer.allocUnsafe(n+5);return r.writeUInt8(0,0),r.writeUInt32BE(n,1),t.copy(r,5),r}decompressMessage(e,t){let n=e.subarray(5);if(t===`identity`)return n;if(t===`deflate`||t===`gzip`){let e;return e=t===`deflate`?o.createInflate():o.createGunzip(),new Promise((t,i)=>{let a=0,o=[];e.on(`data`,t=>{o.push(t),a+=t.byteLength,this.maxReceiveMessageSize!==-1&&a>this.maxReceiveMessageSize&&(e.destroy(),i({code:r.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),e.on(`end`,()=>{t(Buffer.concat(o))}),e.write(n),e.end()})}else return Promise.reject({code:r.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${t}"`})}async decompressAndMaybePush(e){if(e.type!==`COMPRESSED`)throw Error(`Invalid queue entry type: ${e.type}`);let t=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:`identity`,n;try{n=await this.decompressMessage(e.compressedMessage,t)}catch(e){this.sendStatus(e);return}try{e.parsedMessage=this.handler.deserialize(n)}catch(e){this.sendStatus({code:r.Status.INTERNAL,details:`Error deserializing request: ${e.message}`});return}e.type=`READABLE`,this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!==`COMPRESSED`){this.isReadPending=!1;let e=this.readQueue.shift();e.type===`READABLE`?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var t;if(this.checkCancelled())return;f(`Request to `+this.handler.path+` received data frame of size `+e.length);let n;try{n=this.decoder.write(e)}catch(e){this.sendStatus({code:r.Status.RESOURCE_EXHAUSTED,details:e.message});return}for(let e of n){this.stream.pause();let n={type:`COMPRESSED`,compressedMessage:e,parsedMessage:null};this.readQueue.push(n),this.decompressAndMaybePush(n),(t=this.callEventTracker)==null||t.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:`HALF_CLOSE`,compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){f(`Request to `+this.handler.path+` start called`),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let t=e?e.toHttp2Headers():null,n=Object.assign(Object.assign(Object.assign({},E),T),t);this.stream.respond(n,D)}sendMessage(e,t){if(this.checkCancelled())return;let n;try{n=this.serializeMessage(e)}catch(e){this.sendStatus({code:r.Status.INTERNAL,details:`Error serializing response: ${(0,a.getErrorMessage)(e)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&n.length-5>this.maxSendMessageSize){this.sendStatus({code:r.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${n.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),f(`Request to `+this.handler.path+` sent data frame of size `+n.length),this.stream.write(n,e=>{var n;if(e){this.sendStatus({code:r.Status.INTERNAL,details:`Error writing message: ${(0,a.getErrorMessage)(e)}`,metadata:null});return}(n=this.callEventTracker)==null||n.addMessageSent(),t()})}sendStatus(e){if(this.checkCancelled())return;f(`Request to method `+this.handler?.path+` ended with status code: `+r.Status[e.code]+` details: `+e.details);let t=e.metadata?.clone()??new n.Metadata;if(this.shouldSendMetrics&&t.set(u.GRPC_METRICS_HEADER,this.metricsRecorder.serialize()),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once(`wantTrailers`,()=>{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let n=Object.assign({[b]:e.code,[y]:encodeURI(e.details)},t.toHttp2Headers());this.stream.sendTrailers(n),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let n=Object.assign(Object.assign({[b]:e.code,[y]:encodeURI(e.details)},E),t.toHttp2Headers());this.stream.respond(n,{endStream:!0}),this.notifyOnCancel()}}startRead(){f(`Request to `+this.handler.path+` startRead called`),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){let e=this.stream.session?.socket;return e?.remoteAddress?e.remotePort?`${e.remoteAddress}:${e.remotePort}`:e.remoteAddress:`unknown`}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){if(this.stream.session?.socket instanceof l.TLSSocket){let e=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:`ssl`,sslPeerCertificate:e.raw?e:void 0}}else return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}};e.BaseServerInterceptingCall=O;function k(e,t,n,r,i,a){let o={path:i.path,requestStream:i.type===`clientStream`||i.type===`bidi`,responseStream:i.type===`serverStream`||i.type===`bidi`,requestDeserialize:i.deserialize,responseSerialize:i.serialize},s=new O(t,n,r,i,a);return e.reduce((e,t)=>t(o,e),s)}})),rn=i((e=>{var n=e&&e.__runInitializers||function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},r=e&&e.__esDecorate||function(e,t,n,r,i,a){function o(e){if(e!==void 0&&typeof e!=`function`)throw TypeError(`Function expected`);return e}for(var s=r.kind,c=s===`getter`?`get`:s===`setter`?`set`:`value`,l=!t&&e?r.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d,f=!1,p=n.length-1;p>=0;p--){var m={};for(var h in r)m[h]=h===`access`?{}:r[h];for(var h in r.access)m.access[h]=r.access[h];m.addInitializer=function(e){if(f)throw TypeError(`Cannot add initializers after decoration has completed`);a.push(o(e||null))};var g=(0,n[p])(s===`accessor`?{get:u.get,set:u.set}:u[c],m);if(s===`accessor`){if(g===void 0)continue;if(typeof g!=`object`||!g)throw TypeError(`Object expected`);(d=o(g.get))&&(u.get=d),(d=o(g.set))&&(u.set=d),(d=o(g.init))&&i.unshift(d)}else (d=o(g))&&(s===`field`?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,r.name,u),f=!0};Object.defineProperty(e,`__esModule`,{value:!0}),e.Server=void 0;var i=t(`http2`),a=t(`util`),o=C(),s=Qt(),c=$t(),l=U(),u=B(),d=q(),f=H(),p=kt(),m=nn(),h=2147483647,g=2147483647,_=2e4,v=2147483647,{HTTP2_HEADER_PATH:y}=i.constants,b=`server`,x=Buffer.from(`max_age`);function S(e){u.trace(o.LogVerbosity.DEBUG,`server_call`,e)}function w(){}function T(e){return function(t,n){return a.deprecate(t,e)}}function E(e){return{code:o.Status.UNIMPLEMENTED,details:`The server does not implement the method ${e}`}}function D(e,t){let n=E(t);switch(e){case`unary`:return(e,t)=>{t(n,null)};case`clientStream`:return(e,t)=>{t(n,null)};case`serverStream`:return e=>{e.emit(`error`,n)};case`bidi`:return e=>{e.emit(`error`,n)};default:throw Error(`Invalid handlerType ${e}`)}}e.Server=(()=>{var e;let t=[],a;return e=class{constructor(e){this.boundPorts=(n(this,t),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString=`null`,this.channelzEnabled=!0,this.options=e??{},this.options[`grpc.enable_channelz`]===0?(this.channelzEnabled=!1,this.channelzTrace=new p.ChannelzTraceStub,this.callTracker=new p.ChannelzCallTrackerStub,this.listenerChildrenTracker=new p.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new p.ChannelzChildrenTrackerStub):(this.channelzTrace=new p.ChannelzTrace,this.callTracker=new p.ChannelzCallTracker,this.listenerChildrenTracker=new p.ChannelzChildrenTracker,this.sessionChildrenTracker=new p.ChannelzChildrenTracker),this.channelzRef=(0,p.registerChannelzServer)(`server`,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace(`CT_INFO`,`Server created`),this.maxConnectionAgeMs=this.options[`grpc.max_connection_age_ms`]??h,this.maxConnectionAgeGraceMs=this.options[`grpc.max_connection_age_grace_ms`]??h,this.keepaliveTimeMs=this.options[`grpc.keepalive_time_ms`]??g,this.keepaliveTimeoutMs=this.options[`grpc.keepalive_timeout_ms`]??_,this.sessionIdleTimeout=this.options[`grpc.max_connection_idle_ms`]??v,this.commonServerOptions={maxSendHeaderBlockLength:2**53-1},`grpc-node.max_session_memory`in this.options?this.commonServerOptions.maxSessionMemory=this.options[`grpc-node.max_session_memory`]:this.commonServerOptions.maxSessionMemory=2**53-1,`grpc.max_concurrent_streams`in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options[`grpc.max_concurrent_streams`]}),this.interceptors=this.options.interceptors??[],this.trace(`Server constructed`)}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(e){let t=this.sessions.get(e),n=e.socket,r=n.remoteAddress?(0,d.stringToSubchannelAddress)(n.remoteAddress,n.remotePort):null,i=n.localAddress?(0,d.stringToSubchannelAddress)(n.localAddress,n.localPort):null,a;if(e.encrypted){let e=n,t=e.getCipher(),r=e.getCertificate(),i=e.getPeerCertificate();a={cipherSuiteStandardName:t.standardName??null,cipherSuiteOtherName:t.standardName?null:t.name,localCertificate:r&&`raw`in r?r.raw:null,remoteCertificate:i&&`raw`in i?i.raw:null}}else a=null;return{remoteAddress:r,localAddress:i,security:a,remoteName:null,streamsStarted:t.streamTracker.callsStarted,streamsSucceeded:t.streamTracker.callsSucceeded,streamsFailed:t.streamTracker.callsFailed,messagesSent:t.messagesSent,messagesReceived:t.messagesReceived,keepAlivesSent:t.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:t.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:t.lastMessageSentTimestamp,lastMessageReceivedTimestamp:t.lastMessageReceivedTimestamp,localFlowControlWindow:e.state.localWindowSize??null,remoteFlowControlWindow:e.state.remoteWindowSize??null}}trace(e){u.trace(o.LogVerbosity.DEBUG,b,`(`+this.channelzRef.id+`) `+e)}keepaliveTrace(e){u.trace(o.LogVerbosity.DEBUG,`keepalive`,`(`+this.channelzRef.id+`) `+e)}addProtoService(){throw Error(`Not implemented. Use addService() instead`)}addService(e,t){if(typeof e!=`object`||!e||typeof t!=`object`||!t)throw Error(`addService() requires two objects as arguments`);let n=Object.keys(e);if(n.length===0)throw Error(`Cannot add an empty service to a server`);n.forEach(n=>{let r=e[n],i;i=r.requestStream?r.responseStream?`bidi`:`clientStream`:r.responseStream?`serverStream`:`unary`;let a=t[n],o;if(a===void 0&&typeof r.originalName==`string`&&(a=t[r.originalName]),o=a===void 0?D(i,n):a.bind(t),this.register(r.path,o,r.responseSerialize,r.requestDeserialize,i)===!1)throw Error(`Method handler for ${r.path} already provided.`)})}removeService(e){if(typeof e!=`object`||!e)throw Error(`removeService() requires object as argument`);Object.keys(e).forEach(t=>{let n=e[t];this.unregister(n.path)})}bind(e,t){throw Error(`Not implemented. Use bindAsync() instead`)}experimentalRegisterListenerToChannelz(e){return(0,p.registerChannelzSocket)((0,d.subchannelAddressToString)(e),()=>({localAddress:e,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(e){(0,p.unregisterChannelzRef)(e)}createHttp2Server(e){let t;if(e._isSecure()){let n=e._getConstructorOptions(),r=e._getSecureContextOptions(),a=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),n),r),{enableTrace:this.options[`grpc-node.tls_enable_trace`]===1}),s=r!==null;this.trace(`Initial credentials valid: `+s),t=i.createSecureServer(a),t.prependListener(`connection`,e=>{s||(this.trace(`Dropped connection from `+JSON.stringify(e.address())+` due to unloaded credentials`),e.destroy())}),t.on(`secureConnection`,e=>{e.on(`error`,e=>{this.trace(`An incoming TLS connection closed with error: `+e.message)})});let c=e=>{if(e){let n=t;try{n.setSecureContext(e)}catch(t){u.log(o.LogVerbosity.ERROR,`Failed to set secure context with error `+t.message),e=null}}s=e!==null,this.trace(`Post-update credentials valid: `+s)};e._addWatcher(c),t.on(`close`,()=>{e._removeWatcher(c)})}else t=i.createServer(this.commonServerOptions);return t.setTimeout(0,w),this._setupHandlers(t,e._getInterceptors()),t}bindOneAddress(e,t){this.trace(`Attempting to bind `+(0,d.subchannelAddressToString)(e));let n=this.createHttp2Server(t.credentials);return new Promise((r,i)=>{let a=t=>{this.trace(`Failed to bind `+(0,d.subchannelAddressToString)(e)+` with error `+t.message),r({port:`port`in e?e.port:1,error:t.message})};n.once(`error`,a),n.listen(e,()=>{let e=n.address(),i;i=typeof e==`string`?{path:e}:{host:e.address,port:e.port};let o=this.experimentalRegisterListenerToChannelz(i);this.listenerChildrenTracker.refChild(o),this.http2Servers.set(n,{channelzRef:o,sessions:new Set,ownsChannelzRef:!0}),t.listeningServers.add(n),this.trace(`Successfully bound `+(0,d.subchannelAddressToString)(i)),r({port:`port`in i?i.port:1}),n.removeListener(`error`,a)})})}async bindManyPorts(e,t){if(e.length===0)return{count:0,port:0,errors:[]};if((0,d.isTcpSubchannelAddress)(e[0])&&e[0].port===0){let n=await this.bindOneAddress(e[0],t);if(n.error){let r=await this.bindManyPorts(e.slice(1),t);return Object.assign(Object.assign({},r),{errors:[n.error,...r.errors]})}else{let r=e.slice(1).map(e=>(0,d.isTcpSubchannelAddress)(e)?{host:e.host,port:n.port}:e),i=[n,...await Promise.all(r.map(e=>this.bindOneAddress(e,t)))];return{count:i.filter(e=>e.error===void 0).length,port:n.port,errors:i.filter(e=>e.error).map(e=>e.error)}}}else{let n=await Promise.all(e.map(e=>this.bindOneAddress(e,t)));return{count:n.filter(e=>e.error===void 0).length,port:n[0].port,errors:n.filter(e=>e.error).map(e=>e.error)}}}async bindAddressList(e,t){let n=await this.bindManyPorts(e,t);if(n.count>0)return n.count<e.length&&u.log(o.LogVerbosity.INFO,`WARNING Only ${n.count} addresses added out of total ${e.length} resolved`),n.port;{let t=`No address added out of total ${e.length} resolved`;throw u.log(o.LogVerbosity.ERROR,t),Error(`${t} errors: [${n.errors.join(`,`)}]`)}}resolvePort(e){return new Promise((t,n)=>{let r=!1;(0,l.createResolver)(e,(i,a,o,s)=>{if(r)return!0;if(r=!0,!i.ok)return n(Error(i.error.details)),!0;let c=[].concat(...i.value.map(e=>e.addresses));return c.length===0?(n(Error(`No addresses resolved for port ${e}`)),!0):(t(c),!0)},this.options).updateResolution()})}async bindPort(e,t){let n=await this.resolvePort(e);if(t.cancelled)throw this.completeUnbind(t),Error(`bindAsync operation cancelled by unbind call`);let r=await this.bindAddressList(n,t);if(t.cancelled)throw this.completeUnbind(t),Error(`bindAsync operation cancelled by unbind call`);return r}normalizePort(e){let t=(0,f.parseUri)(e);if(t===null)throw Error(`Could not parse port "${e}"`);let n=(0,l.mapUriDefaultScheme)(t);if(n===null)throw Error(`Could not get a default scheme for port "${e}"`);return n}bindAsync(e,t,n){if(this.shutdown)throw Error(`bindAsync called after shutdown`);if(typeof e!=`string`)throw TypeError(`port must be a string`);if(t===null||!(t instanceof c.ServerCredentials))throw TypeError(`creds must be a ServerCredentials object`);if(typeof n!=`function`)throw TypeError(`callback must be a function`);this.trace(`bindAsync port=`+e);let r=this.normalizePort(e),i=(e,t)=>{process.nextTick(()=>n(e,t))},a=this.boundPorts.get((0,f.uriToString)(r));if(a){if(!t._equals(a.credentials)){i(Error(`${e} already bound with incompatible credentials`),0);return}a.cancelled=!1,a.completionPromise?a.completionPromise.then(e=>n(null,e),e=>n(e,0)):i(null,a.portNumber);return}a={mapKey:(0,f.uriToString)(r),originalUri:r,completionPromise:null,cancelled:!1,portNumber:0,credentials:t,listeningServers:new Set};let o=(0,f.splitHostPort)(r.path),s=this.bindPort(r,a);a.completionPromise=s,o?.port===0?s.then(e=>{let t={scheme:r.scheme,authority:r.authority,path:(0,f.combineHostPort)({host:o.host,port:e})};a.mapKey=(0,f.uriToString)(t),a.completionPromise=null,a.portNumber=e,this.boundPorts.set(a.mapKey,a),n(null,e)},e=>{n(e,0)}):(this.boundPorts.set(a.mapKey,a),s.then(e=>{a.completionPromise=null,a.portNumber=e,n(null,e)},e=>{n(e,0)}))}registerInjectorToChannelz(){return(0,p.registerChannelzSocket)(`injector`,()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(e,t,n=!1){if(e===null||!(e instanceof c.ServerCredentials))throw TypeError(`creds must be a ServerCredentials object`);this.channelzEnabled&&this.listenerChildrenTracker.refChild(t);let r=this.createHttp2Server(e),a=new Set;return this.http2Servers.set(r,{channelzRef:t,sessions:a,ownsChannelzRef:n}),{injectConnection:e=>{r.emit(`connection`,e)},drain:e=>{var t,n;for(let e of a)this.closeSession(e);(n=(t=setTimeout(()=>{for(let e of a)e.destroy(i.constants.NGHTTP2_CANCEL)},e)).unref)==null||n.call(t)},destroy:()=>{this.closeServer(r);for(let e of a)this.closeSession(e)}}}createConnectionInjector(e){if(e===null||!(e instanceof c.ServerCredentials))throw TypeError(`creds must be a ServerCredentials object`);let t=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(e,t,!0)}closeServer(e,t){this.trace(`Closing server with address `+JSON.stringify(e.address()));let n=this.http2Servers.get(e);e.close(()=>{n&&n.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(n.channelzRef),(0,p.unregisterChannelzRef)(n.channelzRef)),this.http2Servers.delete(e),t?.()})}closeSession(e,t){this.trace(`Closing session initiated by `+e.socket?.remoteAddress);let n=this.sessions.get(e),r=()=>{n&&(this.sessionChildrenTracker.unrefChild(n.ref),(0,p.unregisterChannelzRef)(n.ref)),t?.()};e.closed?queueMicrotask(r):e.close(r)}completeUnbind(e){for(let t of e.listeningServers){let n=this.http2Servers.get(t);if(this.closeServer(t,()=>{e.listeningServers.delete(t)}),n)for(let e of n.sessions)this.closeSession(e)}this.boundPorts.delete(e.mapKey)}unbind(e){this.trace(`unbind port=`+e);let t=this.normalizePort(e);if((0,f.splitHostPort)(t.path)?.port===0)throw Error(`Cannot unbind port 0`);let n=this.boundPorts.get((0,f.uriToString)(t));n&&(this.trace(`unbinding `+n.mapKey+` originally bound as `+(0,f.uriToString)(n.originalUri)),n.completionPromise?n.cancelled=!0:this.completeUnbind(n))}drain(e,t){var n,r;this.trace(`drain port=`+e+` graceTimeMs=`+t);let a=this.normalizePort(e);if((0,f.splitHostPort)(a.path)?.port===0)throw Error(`Cannot drain port 0`);let o=this.boundPorts.get((0,f.uriToString)(a));if(!o)return;let s=new Set;for(let e of o.listeningServers){let t=this.http2Servers.get(e);if(t)for(let e of t.sessions)s.add(e),this.closeSession(e,()=>{s.delete(e)})}(r=(n=setTimeout(()=>{for(let e of s)e.destroy(i.constants.NGHTTP2_CANCEL)},t)).unref)==null||r.call(n)}forceShutdown(){for(let e of this.boundPorts.values())e.cancelled=!0;this.boundPorts.clear();for(let e of this.http2Servers.keys())this.closeServer(e);this.sessions.forEach((e,t)=>{this.closeSession(t),t.destroy(i.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,p.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(e,t,n,r,i){return this.handlers.has(e)?!1:(this.handlers.set(e,{func:t,serialize:n,deserialize:r,type:i,path:e}),!0)}unregister(e){return this.handlers.delete(e)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(e=>!e.listening))throw Error(`server must be bound in order to start`);if(this.started===!0)throw Error(`server is already started`);this.started=!0}tryShutdown(e){let t=t=>{(0,p.unregisterChannelzRef)(this.channelzRef),e(t)},n=0;function r(){n--,n===0&&t()}this.shutdown=!0;for(let[e,t]of this.http2Servers.entries()){n++;let i=t.channelzRef.name;this.trace(`Waiting for server `+i+` to close`),this.closeServer(e,()=>{this.trace(`Server `+i+` finished closing`),r()});for(let e of t.sessions.keys()){n++;let t=e.socket?.remoteAddress;this.trace(`Waiting for session `+t+` to close`),this.closeSession(e,()=>{this.trace(`Session `+t+` finished closing`),r()})}}n===0&&t()}addHttp2Port(){throw Error(`Not yet implemented`)}getChannelzRef(){return this.channelzRef}_verifyContentType(e,t){let n=t[i.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof n!=`string`||!n.startsWith(`application/grpc`)?(e.respond({[i.constants.HTTP2_HEADER_STATUS]:i.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(e){S(`Received call to method `+e+` at address `+this.serverAddressString);let t=this.handlers.get(e);return t===void 0?(S(`No handler registered for method `+e+`. Sending UNIMPLEMENTED status.`),null):t}_respondWithError(e,t,n=null){let r=Object.assign({"grpc-status":e.code??o.Status.INTERNAL,"grpc-message":e.details,[i.constants.HTTP2_HEADER_STATUS]:i.constants.HTTP_STATUS_OK,[i.constants.HTTP2_HEADER_CONTENT_TYPE]:`application/grpc+proto`},e.metadata?.toHttp2Headers());t.respond(r,{endStream:!0}),this.callTracker.addCallFailed(),n?.streamTracker.addCallFailed()}_channelzHandler(e,t,n){this.onStreamOpened(t);let r=this.sessions.get(t.session);if(this.callTracker.addCallStarted(),r?.streamTracker.addCallStarted(),!this._verifyContentType(t,n)){this.callTracker.addCallFailed(),r?.streamTracker.addCallFailed();return}let i=n[y],a=this._retrieveHandler(i);if(!a){this._respondWithError(E(i),t,r);return}let s={addMessageSent:()=>{r&&(r.messagesSent+=1,r.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{r&&(r.messagesReceived+=1,r.lastMessageReceivedTimestamp=new Date)},onCallEnd:e=>{e.code===o.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:e=>{r&&(e?r.streamTracker.addCallSucceeded():r.streamTracker.addCallFailed())}},c=(0,m.getServerInterceptingCall)([...e,...this.interceptors],t,n,s,a,this.options);this._runHandlerForCall(c,a)||(this.callTracker.addCallFailed(),r?.streamTracker.addCallFailed(),c.sendStatus({code:o.Status.INTERNAL,details:`Unknown handler type: ${a.type}`}))}_streamHandler(e,t,n){if(this.onStreamOpened(t),this._verifyContentType(t,n)!==!0)return;let r=n[y],i=this._retrieveHandler(r);if(!i){this._respondWithError(E(r),t,null);return}let a=(0,m.getServerInterceptingCall)([...e,...this.interceptors],t,n,null,i,this.options);this._runHandlerForCall(a,i)||a.sendStatus({code:o.Status.INTERNAL,details:`Unknown handler type: ${i.type}`})}_runHandlerForCall(e,t){let{type:n}=t;if(n===`unary`)O(e,t);else if(n===`clientStream`)k(e,t);else if(n===`serverStream`)A(e,t);else if(n===`bidi`)j(e,t);else return!1;return!0}_setupHandlers(e,t){if(e===null)return;let n=e.address(),r=`null`;n&&(r=typeof n==`string`?n:n.address+`:`+n.port),this.serverAddressString=r;let i=this.channelzEnabled?this._channelzHandler:this._streamHandler,a=this.channelzEnabled?this._channelzSessionHandler(e):this._sessionHandler(e);e.on(`stream`,i.bind(this,t)),e.on(`session`,a)}_sessionHandler(e){return t=>{var n,r;(n=this.http2Servers.get(e))==null||n.sessions.add(t);let a=null,o=null,s=null,c=!1,l=this.enableIdleTimeout(t);if(this.maxConnectionAgeMs!==h){let e=this.maxConnectionAgeMs/10,n=Math.random()*e*2-e;a=setTimeout(()=>{var e;c=!0,this.trace(`Connection dropped by max connection age: `+t.socket?.remoteAddress);try{t.goaway(i.constants.NGHTTP2_NO_ERROR,2147483647,x)}catch{t.destroy();return}t.close(),this.maxConnectionAgeGraceMs!==h&&(o=setTimeout(()=>{t.destroy()},this.maxConnectionAgeGraceMs),(e=o.unref)==null||e.call(o))},this.maxConnectionAgeMs+n),(r=a.unref)==null||r.call(a)}let u=()=>{s&&(clearTimeout(s),s=null)},d=()=>!t.destroyed&&this.keepaliveTimeMs<g&&this.keepaliveTimeMs>0,f,p=()=>{var e;d()&&(this.keepaliveTrace(`Starting keepalive timer for `+this.keepaliveTimeMs+`ms`),s=setTimeout(()=>{u(),f()},this.keepaliveTimeMs),(e=s.unref)==null||e.call(s))};f=()=>{var e;if(!d())return;this.keepaliveTrace(`Sending ping with timeout `+this.keepaliveTimeoutMs+`ms`);let n=``;try{t.ping((e,n,r)=>{u(),e?(this.keepaliveTrace(`Ping failed with error: `+e.message),c=!0,t.destroy()):(this.keepaliveTrace(`Received ping response`),p())})||(n=`Ping returned false`)}catch(e){n=(e instanceof Error?e.message:``)||`Unknown error`}if(n){this.keepaliveTrace(`Ping send failed: `+n),this.trace(`Connection dropped due to ping send error: `+n),c=!0,t.destroy();return}s=setTimeout(()=>{u(),this.keepaliveTrace(`Ping timeout passed without response`),this.trace(`Connection dropped by keepalive timeout`),c=!0,t.destroy()},this.keepaliveTimeoutMs),(e=s.unref)==null||e.call(s)},p(),t.on(`close`,()=>{var n;c||this.trace(`Connection dropped by client ${t.socket?.remoteAddress}`),a&&clearTimeout(a),o&&clearTimeout(o),u(),l!==null&&(clearTimeout(l.timeout),this.sessionIdleTimeouts.delete(t)),(n=this.http2Servers.get(e))==null||n.sessions.delete(t)})}}_channelzSessionHandler(e){return t=>{var n,r;let a=(0,p.registerChannelzSocket)(t.socket?.remoteAddress??`unknown`,this.getChannelzSessionInfo.bind(this,t),this.channelzEnabled),o={ref:a,streamTracker:new p.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(n=this.http2Servers.get(e))==null||n.sessions.add(t),this.sessions.set(t,o);let s=`${t.socket.remoteAddress}:${t.socket.remotePort}`;this.channelzTrace.addTrace(`CT_INFO`,`Connection established by client `+s),this.trace(`Connection established by client `+s),this.sessionChildrenTracker.refChild(a);let c=null,l=null,u=null,d=!1,f=this.enableIdleTimeout(t);if(this.maxConnectionAgeMs!==h){let e=this.maxConnectionAgeMs/10,n=Math.random()*e*2-e;c=setTimeout(()=>{var e;d=!0,this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped by max connection age from `+s);try{t.goaway(i.constants.NGHTTP2_NO_ERROR,2147483647,x)}catch{t.destroy();return}t.close(),this.maxConnectionAgeGraceMs!==h&&(l=setTimeout(()=>{t.destroy()},this.maxConnectionAgeGraceMs),(e=l.unref)==null||e.call(l))},this.maxConnectionAgeMs+n),(r=c.unref)==null||r.call(c)}let m=()=>{u&&(clearTimeout(u),u=null)},_=()=>!t.destroyed&&this.keepaliveTimeMs<g&&this.keepaliveTimeMs>0,v,y=()=>{var e;_()&&(this.keepaliveTrace(`Starting keepalive timer for `+this.keepaliveTimeMs+`ms`),u=setTimeout(()=>{m(),v()},this.keepaliveTimeMs),(e=u.unref)==null||e.call(u))};v=()=>{var e;if(!_())return;this.keepaliveTrace(`Sending ping with timeout `+this.keepaliveTimeoutMs+`ms`);let n=``;try{t.ping((e,n,r)=>{m(),e?(this.keepaliveTrace(`Ping failed with error: `+e.message),this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped due to error of a ping frame `+e.message+` return in `+n),d=!0,t.destroy()):(this.keepaliveTrace(`Received ping response`),y())})||(n=`Ping returned false`)}catch(e){n=(e instanceof Error?e.message:``)||`Unknown error`}if(n){this.keepaliveTrace(`Ping send failed: `+n),this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped due to ping send error: `+n),d=!0,t.destroy();return}o.keepAlivesSent+=1,u=setTimeout(()=>{m(),this.keepaliveTrace(`Ping timeout passed without response`),this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped by keepalive timeout from `+s),d=!0,t.destroy()},this.keepaliveTimeoutMs),(e=u.unref)==null||e.call(u)},y(),t.on(`close`,()=>{var n;d||this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped by client `+s),this.sessionChildrenTracker.unrefChild(a),(0,p.unregisterChannelzRef)(a),c&&clearTimeout(c),l&&clearTimeout(l),m(),f!==null&&(clearTimeout(f.timeout),this.sessionIdleTimeouts.delete(t)),(n=this.http2Servers.get(e))==null||n.sessions.delete(t),this.sessions.delete(t)})}}enableIdleTimeout(e){var t,n;if(this.sessionIdleTimeout>=v)return null;let r={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,e),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,e)};(n=(t=r.timeout).unref)==null||n.call(t),this.sessionIdleTimeouts.set(e,r);let{socket:i}=e;return this.trace(`Enable idle timeout for `+i.remoteAddress+`:`+i.remotePort),r}onIdleTimeout(e,t){let{socket:n}=t,r=e.sessionIdleTimeouts.get(t);r!==void 0&&r.activeStreams===0&&(Date.now()-r.lastIdle>=e.sessionIdleTimeout?(e.trace(`Session idle timeout triggered for `+n?.remoteAddress+`:`+n?.remotePort+` last idle at `+r.lastIdle),e.closeSession(t)):r.timeout.refresh())}onStreamOpened(e){let t=e.session,n=this.sessionIdleTimeouts.get(t);n&&(n.activeStreams+=1,e.once(`close`,n.onClose))}onStreamClose(e){let t=this.sessionIdleTimeouts.get(e);t&&(--t.activeStreams,t.activeStreams===0&&(t.lastIdle=Date.now(),t.timeout.refresh(),this.trace(`Session onStreamClose`+e.socket?.remoteAddress+`:`+e.socket?.remotePort+` at `+t.lastIdle)))}},(()=>{let n=typeof Symbol==`function`&&Symbol.metadata?Object.create(null):void 0;a=[T(`Calling start() is no longer necessary. It can be safely omitted.`)],r(e,null,a,{kind:`method`,name:`start`,static:!1,private:!1,access:{has:e=>`start`in e,get:e=>e.start},metadata:n},null,t),n&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})})(),e})();async function O(e,t){let n;function r(t,n,r,i){if(t){e.sendStatus((0,s.serverErrorToStatus)(t,r));return}e.sendMessage(n,()=>{e.sendStatus({code:o.Status.OK,details:`OK`,metadata:r??null})})}let i,a=null;e.start({onReceiveMetadata(t){i=t,e.startRead()},onReceiveMessage(n){if(a){e.sendStatus({code:o.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${t.path}`,metadata:null});return}a=n,e.startRead()},onReceiveHalfClose(){if(!a){e.sendStatus({code:o.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${t.path}`,metadata:null});return}n=new s.ServerWritableStreamImpl(t.path,e,i,a);try{t.func(n,r)}catch(t){e.sendStatus({code:o.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onCancel(){n&&(n.cancelled=!0,n.emit(`cancelled`,`cancelled`))}})}function k(e,t){let n;function r(t,n,r,i){if(t){e.sendStatus((0,s.serverErrorToStatus)(t,r));return}e.sendMessage(n,()=>{e.sendStatus({code:o.Status.OK,details:`OK`,metadata:r??null})})}e.start({onReceiveMetadata(i){n=new s.ServerDuplexStreamImpl(t.path,e,i);try{t.func(n,r)}catch(t){e.sendStatus({code:o.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onReceiveMessage(e){n.push(e)},onReceiveHalfClose(){n.push(null)},onCancel(){n&&(n.cancelled=!0,n.emit(`cancelled`,`cancelled`),n.destroy())}})}function A(e,t){let n,r,i=null;e.start({onReceiveMetadata(t){r=t,e.startRead()},onReceiveMessage(n){if(i){e.sendStatus({code:o.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${t.path}`,metadata:null});return}i=n,e.startRead()},onReceiveHalfClose(){if(!i){e.sendStatus({code:o.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${t.path}`,metadata:null});return}n=new s.ServerWritableStreamImpl(t.path,e,r,i);try{t.func(n)}catch(t){e.sendStatus({code:o.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onCancel(){n&&(n.cancelled=!0,n.emit(`cancelled`,`cancelled`),n.destroy())}})}function j(e,t){let n;e.start({onReceiveMetadata(r){n=new s.ServerDuplexStreamImpl(t.path,e,r);try{t.func(n)}catch(t){e.sendStatus({code:o.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onReceiveMessage(e){n.push(e)},onReceiveHalfClose(){n.push(null)},onCancel(){n&&(n.cancelled=!0,n.emit(`cancelled`,`cancelled`),n.destroy())}})}})),an=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.StatusBuilder=void 0,e.StatusBuilder=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}}})),on=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LeafLoadBalancer=e.PickFirstLoadBalancer=e.PickFirstLoadBalancingConfig=void 0,e.shuffled=_,e.setup=S;var n=se(),r=W(),i=G(),a=q(),o=B(),s=C(),c=q(),l=t(`net`),u=Ce(),d=`pick_first`;function f(e){o.trace(s.LogVerbosity.DEBUG,d,e)}var p=`pick_first`,m=250,h=class e{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return p}toJsonObject(){return{[p]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(t){if(`shuffleAddressList`in t&&typeof t.shuffleAddressList!=`boolean`)throw Error(`pick_first config field shuffleAddressList must be a boolean if provided`);return new e(t.shuffleAddressList===!0)}};e.PickFirstLoadBalancingConfig=h;var g=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:i.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function _(e){let t=e.slice();for(let e=t.length-1;e>1;e--){let n=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[n],t[n]=r}return t}function v(e){if(e.length===0)return[];let t=[],n=[],r=[],i=(0,c.isTcpSubchannelAddress)(e[0])&&(0,l.isIPv6)(e[0].host);for(let t of e)(0,c.isTcpSubchannelAddress)(t)&&(0,l.isIPv6)(t.host)?n.push(t):r.push(t);let a=i?n:r,o=i?r:n;for(let e=0;e<Math.max(a.length,o.length);e++)e<a.length&&t.push(a[e]),e<o.length&&t.push(o[e]);return t}var y=`grpc-node.internal.pick-first.report_health_status`,b=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=r.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(e,t,n,r,i)=>{this.onSubchannelStateUpdate(e,t,n,i)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.latestResolutionNote=``,this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let e=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(r.ConnectivityState.TRANSIENT_FAILURE,new i.UnavailablePicker({details:e}),e)}else this.updateState(r.ConnectivityState.READY,new g(this.currentPick),null);else if(this.latestAddressList?.length===0){let e=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(r.ConnectivityState.TRANSIENT_FAILURE,new i.UnavailablePicker({details:e}),e)}else if(this.children.length===0)this.updateState(r.ConnectivityState.IDLE,new i.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let e=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(r.ConnectivityState.TRANSIENT_FAILURE,new i.UnavailablePicker({details:e}),e)}else this.updateState(r.ConnectivityState.CONNECTING,new i.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,t,n,i){if(this.currentPick?.realSubchannelEquals(e)){n!==r.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[t,a]of this.children.entries())if(e.realSubchannelEquals(a.subchannel)){n===r.ConnectivityState.READY&&this.pickSubchannel(a.subchannel),n===r.ConnectivityState.TRANSIENT_FAILURE&&(a.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),t===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(t+1)),a.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[t,n]of this.children.entries())if(t>=e){let e=n.subchannel.getConnectivityState();if(e===r.ConnectivityState.IDLE||e===r.ConnectivityState.CONNECTING){this.startConnecting(t);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var t,n;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===r.ConnectivityState.IDLE&&(f(`Start connecting to subchannel with address `+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var t;(t=this.children[e])==null||t.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},m),(n=(t=this.connectionDelayTimeout).unref)==null||n.call(t)}pickSubchannel(e){f(`Pick subchannel with address `+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,t,n){f(r.ConnectivityState[this.currentState]+` -> `+r.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,t,n)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,t){f(`connectToAddressList([`+e.map(e=>(0,a.subchannelAddressToString)(e))+`])`);let n=e.map(e=>({subchannel:this.channelControlHelper.createSubchannel(e,t),hasReportedTransientFailure:!1}));for(let{subchannel:e}of n)if(e.getConnectivityState()===r.ConnectivityState.READY){this.pickSubchannel(e);return}for(let{subchannel:e}of n)e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef());this.resetSubchannelList(),this.children=n;for(let{subchannel:e}of this.children)e.addConnectivityStateListener(this.subchannelStateListener);for(let e of this.children)e.subchannel.getConnectivityState()===r.ConnectivityState.TRANSIENT_FAILURE&&(e.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,t,n,o){if(!(t instanceof h))return!1;if(!e.ok)return this.children.length===0&&this.currentPick===null&&this.channelControlHelper.updateState(r.ConnectivityState.TRANSIENT_FAILURE,new i.UnavailablePicker(e.error),e.error.details),!0;let s=e.value;this.reportHealthStatus=n[y],t.getShuffleAddressList()&&(s=_(s));let c=[].concat(...s.map(e=>e.addresses));f(`updateAddressList([`+c.map(e=>(0,a.subchannelAddressToString)(e))+`])`);let l=v(c);return this.latestAddressList=l,this.latestOptions=n,this.connectToAddressList(l,n),this.latestResolutionNote=o,c.length>0?!0:(this.lastError=`No addresses resolved`,!1)}exitIdle(){this.currentState===r.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return p}};e.PickFirstLoadBalancer=b;var x=new h(!1);e.LeafLoadBalancer=class{constructor(e,t,a,o){this.endpoint=e,this.options=a,this.resolutionNote=o,this.latestState=r.ConnectivityState.IDLE,this.pickFirstBalancer=new b((0,n.createChildChannelControlHelper)(t,{updateState:(e,n,r)=>{this.latestState=e,this.latestPicker=n,t.updateState(e,n,r)}})),this.latestPicker=new i.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,u.statusOrFromValue)([this.endpoint]),x,Object.assign(Object.assign({},this.options),{[y]:!0}),this.resolutionNote)}updateEndpoint(e,t){this.options=t,this.endpoint=e,this.latestState!==r.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};function S(){(0,n.registerLoadBalancerType)(p,b,h),(0,n.registerDefaultLoadBalancerType)(p)}})),sn=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FileWatcherCertificateProvider=void 0;var n=t(`fs`),r=B(),i=C(),a=t(`util`),o=`certificate_provider`;function s(e){r.trace(i.LogVerbosity.DEBUG,o,e)}var c=(0,a.promisify)(n.readFile);e.FileWatcherCertificateProvider=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw Error(`certificateFile and privateKeyFile must be set or unset together`);if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw Error(`At least one of certificateFile and caCertificateFile must be set`);s(`File watcher constructed with config `+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?c(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?c(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?c(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,t,n])=>{if(this.refreshTimer){s(`File watcher read certificates certificate `+e.status+`, privateKey `+t.status+`, CA certificate `+n.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status===`fulfilled`&&t.status===`fulfilled`?this.latestIdentityUpdate={certificate:e.value,privateKey:t.value}:this.latestIdentityUpdate=null,n.status===`fulfilled`?this.latestCaUpdate={caCertificate:n.value}:this.latestCaUpdate=null;for(let e of this.identityListeners)e(this.latestIdentityUpdate);for(let e of this.caListeners)e(this.latestCaUpdate)}}),s(`File watcher initiated certificate update`))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),s(`File watcher started watching`)}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}}})),cn=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=e.createCertificateProviderChannelCredentials=e.FileWatcherCertificateProvider=e.createCertificateProviderServerCredentials=e.createServerCredentialsWithInterceptors=e.BaseSubchannelWrapper=e.registerAdminService=e.FilterStackFactory=e.BaseFilter=e.statusOrFromError=e.statusOrFromValue=e.PickResultType=e.QueuePicker=e.UnavailablePicker=e.ChildLoadBalancerHandler=e.EndpointMap=e.endpointHasAddress=e.endpointToString=e.subchannelAddressToString=e.LeafLoadBalancer=e.isLoadBalancerNameRegistered=e.parseLoadBalancingConfig=e.selectLbConfigFromList=e.registerLoadBalancerType=e.createChildChannelControlHelper=e.BackoffTimeout=e.parseDuration=e.durationToMs=e.splitHostPort=e.uriToString=e.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=e.createResolver=e.registerResolver=e.log=e.trace=void 0;var t=B();Object.defineProperty(e,`trace`,{enumerable:!0,get:function(){return t.trace}}),Object.defineProperty(e,`log`,{enumerable:!0,get:function(){return t.log}});var n=U();Object.defineProperty(e,`registerResolver`,{enumerable:!0,get:function(){return n.registerResolver}}),Object.defineProperty(e,`createResolver`,{enumerable:!0,get:function(){return n.createResolver}}),Object.defineProperty(e,`CHANNEL_ARGS_CONFIG_SELECTOR_KEY`,{enumerable:!0,get:function(){return n.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var r=H();Object.defineProperty(e,`uriToString`,{enumerable:!0,get:function(){return r.uriToString}}),Object.defineProperty(e,`splitHostPort`,{enumerable:!0,get:function(){return r.splitHostPort}});var i=en();Object.defineProperty(e,`durationToMs`,{enumerable:!0,get:function(){return i.durationToMs}}),Object.defineProperty(e,`parseDuration`,{enumerable:!0,get:function(){return i.parseDuration}});var a=K();Object.defineProperty(e,`BackoffTimeout`,{enumerable:!0,get:function(){return a.BackoffTimeout}});var o=se();Object.defineProperty(e,`createChildChannelControlHelper`,{enumerable:!0,get:function(){return o.createChildChannelControlHelper}}),Object.defineProperty(e,`registerLoadBalancerType`,{enumerable:!0,get:function(){return o.registerLoadBalancerType}}),Object.defineProperty(e,`selectLbConfigFromList`,{enumerable:!0,get:function(){return o.selectLbConfigFromList}}),Object.defineProperty(e,`parseLoadBalancingConfig`,{enumerable:!0,get:function(){return o.parseLoadBalancingConfig}}),Object.defineProperty(e,`isLoadBalancerNameRegistered`,{enumerable:!0,get:function(){return o.isLoadBalancerNameRegistered}});var s=on();Object.defineProperty(e,`LeafLoadBalancer`,{enumerable:!0,get:function(){return s.LeafLoadBalancer}});var c=q();Object.defineProperty(e,`subchannelAddressToString`,{enumerable:!0,get:function(){return c.subchannelAddressToString}}),Object.defineProperty(e,`endpointToString`,{enumerable:!0,get:function(){return c.endpointToString}}),Object.defineProperty(e,`endpointHasAddress`,{enumerable:!0,get:function(){return c.endpointHasAddress}}),Object.defineProperty(e,`EndpointMap`,{enumerable:!0,get:function(){return c.EndpointMap}});var l=le();Object.defineProperty(e,`ChildLoadBalancerHandler`,{enumerable:!0,get:function(){return l.ChildLoadBalancerHandler}});var u=G();Object.defineProperty(e,`UnavailablePicker`,{enumerable:!0,get:function(){return u.UnavailablePicker}}),Object.defineProperty(e,`QueuePicker`,{enumerable:!0,get:function(){return u.QueuePicker}}),Object.defineProperty(e,`PickResultType`,{enumerable:!0,get:function(){return u.PickResultType}});var d=Ce();Object.defineProperty(e,`statusOrFromValue`,{enumerable:!0,get:function(){return d.statusOrFromValue}}),Object.defineProperty(e,`statusOrFromError`,{enumerable:!0,get:function(){return d.statusOrFromError}});var f=Mt();Object.defineProperty(e,`BaseFilter`,{enumerable:!0,get:function(){return f.BaseFilter}});var p=It();Object.defineProperty(e,`FilterStackFactory`,{enumerable:!0,get:function(){return p.FilterStackFactory}});var m=xe();Object.defineProperty(e,`registerAdminService`,{enumerable:!0,get:function(){return m.registerAdminService}});var h=Yt();Object.defineProperty(e,`BaseSubchannelWrapper`,{enumerable:!0,get:function(){return h.BaseSubchannelWrapper}});var g=$t();Object.defineProperty(e,`createServerCredentialsWithInterceptors`,{enumerable:!0,get:function(){return g.createServerCredentialsWithInterceptors}}),Object.defineProperty(e,`createCertificateProviderServerCredentials`,{enumerable:!0,get:function(){return g.createCertificateProviderServerCredentials}});var _=sn();Object.defineProperty(e,`FileWatcherCertificateProvider`,{enumerable:!0,get:function(){return _.FileWatcherCertificateProvider}});var v=oe();Object.defineProperty(e,`createCertificateProviderChannelCredentials`,{enumerable:!0,get:function(){return v.createCertificateProviderChannelCredentials}});var y=Xt();Object.defineProperty(e,`SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX`,{enumerable:!0,get:function(){return y.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})})),ln=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.setup=i;var t=U(),n=Ce(),r=class{constructor(e,t,n){this.listener=t,this.hasReturnedResult=!1,this.endpoints=[];let r;r=e.authority===``?`/`+e.path:e.path,this.endpoints=[{addresses:[{path:r}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener,(0,n.statusOrFromValue)(this.endpoints),{},null,``))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return`localhost`}};function i(){(0,t.registerResolver)(`unix`,r)}})),un=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.setup=g;var n=t(`net`),r=Ce(),i=C(),a=V(),o=U(),s=q(),c=H(),l=B(),u=`ip_resolver`;function d(e){l.trace(i.LogVerbosity.DEBUG,u,e)}var f=`ipv4`,p=`ipv6`,m=443,h=class{constructor(e,t,r){this.listener=t,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,d(`Resolver constructed for target `+(0,c.uriToString)(e));let o=[];if(!(e.scheme===f||e.scheme===p)){this.error={code:i.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new a.Metadata};return}let l=e.path.split(`,`);for(let t of l){let r=(0,c.splitHostPort)(t);if(r===null){this.error={code:i.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${t}`,metadata:new a.Metadata};return}if(e.scheme===f&&!(0,n.isIPv4)(r.host)||e.scheme===p&&!(0,n.isIPv6)(r.host)){this.error={code:i.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${t}`,metadata:new a.Metadata};return}o.push({host:r.host,port:r.port??m})}this.endpoints=o.map(e=>({addresses:[e]})),d(`Parsed `+e.scheme+` address list `+o.map(s.subchannelAddressToString))}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener((0,r.statusOrFromError)(this.error),{},null,``):this.listener((0,r.statusOrFromValue)(this.endpoints),{},null,``)}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(`,`)[0]}};function g(){(0,o.registerResolver)(f,h),(0,o.registerResolver)(p,h)}})),dn=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RoundRobinLoadBalancer=void 0,e.setup=h;var t=se(),n=W(),r=G(),i=B(),a=C(),o=q(),s=on(),c=`round_robin`;function l(e){i.trace(a.LogVerbosity.DEBUG,c,e)}var u=`round_robin`,d=class e{getLoadBalancerName(){return u}constructor(){}toJsonObject(){return{[u]:{}}}static createFromJson(t){return new e}},f=class{constructor(e,t=0){this.children=e,this.nextIndex=t}pick(e){let t=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,t.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}};function p(e,t){return[...e.slice(t),...e.slice(0,t)]}var m=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=n.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,t.createChildChannelControlHelper)(e,{updateState:(e,t,r)=>{this.currentState===n.ConnectivityState.READY&&e!==n.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),r&&(this.lastError=r),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(t=>t.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(n.ConnectivityState.READY)>0){let e=this.children.filter(e=>e.getConnectivityState()===n.ConnectivityState.READY),t=0;if(this.currentReadyPicker!==null){let n=this.currentReadyPicker.peekNextEndpoint();t=e.findIndex(e=>(0,o.endpointEqual)(e.getEndpoint(),n)),t<0&&(t=0)}this.updateState(n.ConnectivityState.READY,new f(e.map(e=>({endpoint:e.getEndpoint(),picker:e.getPicker()})),t),null)}else if(this.countChildrenWithState(n.ConnectivityState.CONNECTING)>0)this.updateState(n.ConnectivityState.CONNECTING,new r.QueuePicker(this),null);else if(this.countChildrenWithState(n.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else this.updateState(n.ConnectivityState.IDLE,new r.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===n.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,t,r){l(n.ConnectivityState[this.currentState]+` -> `+n.ConnectivityState[e]),e===n.ConnectivityState.READY?this.currentReadyPicker=t:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,t,r)}resetSubchannelList(){for(let e of this.children)e.destroy();this.children=[]}updateAddressList(e,t,i,a){if(!(t instanceof d))return!1;if(!e.ok)return this.children.length===0&&this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker(e.error),e.error.details),!0;let c=Math.random()*e.value.length|0,u=p(e.value,c);if(this.resetSubchannelList(),u.length===0){let e=`No addresses resolved. Resolution note: ${a}`;this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}l(`Connect to endpoint list `+u.map(o.endpointToString)),this.updatesPaused=!0,this.children=u.map(e=>new s.LeafLoadBalancer(e,this.childChannelControlHelper,i,a));for(let e of this.children)e.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return u}};e.RoundRobinLoadBalancer=m;function h(){(0,t.registerLoadBalancerType)(u,m,d)}})),fn=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.OutlierDetectionLoadBalancer=e.OutlierDetectionLoadBalancingConfig=void 0,e.setup=D;var t=W(),n=C(),r=en(),i=cn(),a=se(),o=le(),s=G(),c=q(),l=Yt(),u=B(),d=`outlier_detection`;function f(e){u.trace(n.LogVerbosity.DEBUG,d,e)}var p=`outlier_detection`,m=(process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION??`true`)===`true`,h={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},g={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function _(e,t,n,r){if(t in e&&e[t]!==void 0&&typeof e[t]!==n){let i=r?`${r}.${t}`:t;throw Error(`outlier detection config ${i} parse error: expected ${n}, got ${typeof e[t]}`)}}function v(e,t,n){let i=n?`${n}.${t}`:t;if(t in e&&e[t]!==void 0){if(!(0,r.isDuration)(e[t]))throw Error(`outlier detection config ${i} parse error: expected Duration, got ${typeof e[t]}`);if(!(e[t].seconds>=0&&e[t].seconds<=315576e6&&e[t].nanos>=0&&e[t].nanos<=999999999))throw Error(`outlier detection config ${i} parse error: values out of range for non-negative Duaration`)}}function y(e,t,n){let r=n?`${n}.${t}`:t;if(_(e,t,`number`,n),t in e&&e[t]!==void 0&&!(e[t]>=0&&e[t]<=100))throw Error(`outlier detection config ${r} parse error: value out of range for percentage (0-100)`)}var b=class e{constructor(e,t,n,r,i,a,o){if(this.childPolicy=o,o.getLoadBalancerName()===`pick_first`)throw Error(`outlier_detection LB policy cannot have a pick_first child policy`);this.intervalMs=e??1e4,this.baseEjectionTimeMs=t??3e4,this.maxEjectionTimeMs=n??3e5,this.maxEjectionPercent=r??10,this.successRateEjection=i?Object.assign(Object.assign({},h),i):null,this.failurePercentageEjection=a?Object.assign(Object.assign({},g),a):null}getLoadBalancerName(){return p}toJsonObject(){return{outlier_detection:{interval:(0,r.msToDuration)(this.intervalMs),base_ejection_time:(0,r.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,r.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:this.successRateEjection??void 0,failure_percentage_ejection:this.failurePercentageEjection??void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(t){if(v(t,`interval`),v(t,`base_ejection_time`),v(t,`max_ejection_time`),y(t,`max_ejection_percent`),`success_rate_ejection`in t&&t.success_rate_ejection!==void 0){if(typeof t.success_rate_ejection!=`object`)throw Error(`outlier detection config success_rate_ejection must be an object`);_(t.success_rate_ejection,`stdev_factor`,`number`,`success_rate_ejection`),y(t.success_rate_ejection,`enforcement_percentage`,`success_rate_ejection`),_(t.success_rate_ejection,`minimum_hosts`,`number`,`success_rate_ejection`),_(t.success_rate_ejection,`request_volume`,`number`,`success_rate_ejection`)}if(`failure_percentage_ejection`in t&&t.failure_percentage_ejection!==void 0){if(typeof t.failure_percentage_ejection!=`object`)throw Error(`outlier detection config failure_percentage_ejection must be an object`);y(t.failure_percentage_ejection,`threshold`,`failure_percentage_ejection`),y(t.failure_percentage_ejection,`enforcement_percentage`,`failure_percentage_ejection`),_(t.failure_percentage_ejection,`minimum_hosts`,`number`,`failure_percentage_ejection`),_(t.failure_percentage_ejection,`request_volume`,`number`,`failure_percentage_ejection`)}if(!(`child_policy`in t)||!Array.isArray(t.child_policy))throw Error(`outlier detection config child_policy must be an array`);let n=(0,a.selectLbConfigFromList)(t.child_policy);if(!n)throw Error(`outlier detection config child_policy: no valid recognized policy found`);return new e(t.interval?(0,r.durationToMs)(t.interval):null,t.base_ejection_time?(0,r.durationToMs)(t.base_ejection_time):null,t.max_ejection_time?(0,r.durationToMs)(t.max_ejection_time):null,t.max_ejection_percent??null,t.success_rate_ejection,t.failure_percentage_ejection,n)}};e.OutlierDetectionLoadBalancingConfig=b;var x=class extends l.BaseSubchannelWrapper{constructor(e,t){super(e),this.mapEntry=t,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),--this.refCount,this.refCount<=0&&this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function S(){return{success:0,failure:0}}var w=class{constructor(){this.activeBucket=S(),this.inactiveBucket=S()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=S()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},T=class{constructor(e,t){this.wrappedPicker=e,this.countCalls=t}pick(e){let t=this.wrappedPicker.pick(e);if(t.pickResultType===s.PickResultType.COMPLETE){let e=t.subchannel,r=e.getMapEntry();if(r){let i=t.onCallEnded;return this.countCalls&&(i=(e,i,a)=>{var o;e===n.Status.OK?r.counter.addSuccess():r.counter.addFailure(),(o=t.onCallEnded)==null||o.call(t,e,i,a)}),Object.assign(Object.assign({},t),{subchannel:e.getWrappedSubchannel(),onCallEnded:i})}else return Object.assign(Object.assign({},t),{subchannel:e.getWrappedSubchannel()})}else return t}},E=class{constructor(e){this.entryMap=new c.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new o.ChildLoadBalancerHandler((0,i.createChildChannelControlHelper)(e,{createSubchannel:(t,n)=>{let r=e.createSubchannel(t,n),i=this.entryMap.getForSubchannelAddress(t),a=new x(r,i);return i?.currentEjectionTimestamp!==null&&a.eject(),i?.subchannelWrappers.push(a),a},updateState:(n,r,i)=>{n===t.ConnectivityState.READY?e.updateState(n,new T(r,this.isCountingEnabled()),i):e.updateState(n,r,i)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let t of this.entryMap.values())t.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getSuccessRateEjectionConfig();if(!t)return;f(`Running success rate check`);let n=t.request_volume,r=0,i=[];for(let[e,t]of this.entryMap.entries()){let a=t.counter.getLastSuccesses(),o=t.counter.getLastFailures();f(`Stats for `+(0,c.endpointToString)(e)+`: successes=`+a+` failures=`+o+` targetRequestVolume=`+n),a+o>=n&&(r+=1,i.push(a/(a+o)))}if(f(`Found `+r+` success rate candidates; currentEjectionPercent=`+this.getCurrentEjectionPercent()+` successRates=[`+i+`]`),r<t.minimum_hosts)return;let a=i.reduce((e,t)=>e+t)/i.length,o=0;for(let e of i){let t=e-a;o+=t*t}let s=o/i.length,l=Math.sqrt(s),u=a-l*(t.stdev_factor/1e3);f(`stdev=`+l+` ejectionThreshold=`+u);for(let[r,i]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let a=i.counter.getLastSuccesses(),o=i.counter.getLastFailures();if(a+o<n)continue;let s=a/(a+o);if(f(`Checking candidate `+r+` successRate=`+s),s<u){let n=Math.random()*100;f(`Candidate `+r+` randomNumber=`+n+` enforcement_percentage=`+t.enforcement_percentage),n<t.enforcement_percentage&&(f(`Ejecting candidate `+r),this.eject(i,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getFailurePercentageEjectionConfig();if(!t)return;f(`Running failure percentage check. threshold=`+t.threshold+` request volume threshold=`+t.request_volume);let n=0;for(let e of this.entryMap.values())e.counter.getLastSuccesses()+e.counter.getLastFailures()>=t.request_volume&&(n+=1);if(!(n<t.minimum_hosts))for(let[n,r]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let i=r.counter.getLastSuccesses(),a=r.counter.getLastFailures();if(f(`Candidate successes=`+i+` failures=`+a),!(i+a<t.request_volume)&&a*100/(a+i)>t.threshold){let i=Math.random()*100;f(`Candidate `+n+` randomNumber=`+i+` enforcement_percentage=`+t.enforcement_percentage),i<t.enforcement_percentage&&(f(`Ejecting candidate `+n),this.eject(r,e))}}}eject(e,t){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let t of e.subchannelWrappers)t.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let t of e.subchannelWrappers)t.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var t,n;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(n=(t=this.ejectionTimer).unref)==null||n.call(t)}runChecks(){let e=new Date;if(f(`Ejection timer running`),this.switchAllBuckets(),this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[e,t]of this.entryMap.entries())if(t.currentEjectionTimestamp===null)t.ejectionTimeMultiplier>0&&--t.ejectionTimeMultiplier;else{let n=this.latestConfig.getBaseEjectionTimeMs(),r=this.latestConfig.getMaxEjectionTimeMs(),i=new Date(t.currentEjectionTimestamp.getTime());i.setMilliseconds(i.getMilliseconds()+Math.min(n*t.ejectionTimeMultiplier,Math.max(n,r))),i<new Date&&(f(`Unejecting `+e),this.uneject(t))}}}updateAddressList(e,t,n,r){if(!(t instanceof b))return!1;if(f(`Received update with config: `+JSON.stringify(t.toJsonObject(),void 0,2)),e.ok){for(let t of e.value)this.entryMap.has(t)||(f(`Adding map entry for `+(0,c.endpointToString)(t)),this.entryMap.set(t,{counter:new w,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e.value)}let i=t.getChildPolicy();if(this.childBalancer.updateAddressList(e,i,n,r),t.getSuccessRateEjectionConfig()||t.getFailurePercentageEjectionConfig())if(this.timerStartTime){f(`Previous timer existed. Replacing timer`),clearTimeout(this.ejectionTimer);let e=t.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(e)}else f(`Starting new timer`),this.timerStartTime=new Date,this.startTimer(t.getIntervalMs()),this.switchAllBuckets();else{f(`Counting disabled. Cancelling timer.`),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let e of this.entryMap.values())this.uneject(e),e.ejectionTimeMultiplier=0}return this.latestConfig=t,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return p}};e.OutlierDetectionLoadBalancer=E;function D(){m&&(0,i.registerLoadBalancerType)(p,E,b)}})),pn=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PriorityQueue=void 0;var t=0,n=e=>Math.floor(e/2),r=e=>e*2+1,i=e=>e*2+2;e.PriorityQueue=class{constructor(e=(e,t)=>e>t){this.comparator=e,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[t]}push(...e){return e.forEach(e=>{this.heap.push(e),this.siftUp()}),this.size()}pop(){let e=this.peek(),n=this.size()-1;return n>t&&this.swap(t,n),this.heap.pop(),this.siftDown(),e}replace(e){let n=this.peek();return this.heap[t]=e,this.siftDown(),n}greater(e,t){return this.comparator(this.heap[e],this.heap[t])}swap(e,t){[this.heap[e],this.heap[t]]=[this.heap[t],this.heap[e]]}siftUp(){let e=this.size()-1;for(;e>t&&this.greater(e,n(e));)this.swap(e,n(e)),e=n(e)}siftDown(){let e=t;for(;r(e)<this.size()&&this.greater(r(e),e)||i(e)<this.size()&&this.greater(i(e),e);){let t=i(e)<this.size()&&this.greater(i(e),r(e))?i(e):r(e);this.swap(e,t),e=t}}}})),mn=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WeightedRoundRobinLoadBalancingConfig=void 0,e.setup=T;var t=W(),n=C(),r=en(),i=se(),a=on(),o=B(),s=tn(),c=G(),l=pn(),u=q(),d=`weighted_round_robin`;function f(e){o.trace(n.LogVerbosity.DEBUG,d,e)}var p=`weighted_round_robin`,m=1e4,h=1e4,g=3*6e4,_=1e3,v=1;function y(e,t,n){if(t in e&&e[t]!==void 0&&typeof e[t]!==n)throw Error(`weighted round robin config ${t} parse error: expected ${n}, got ${typeof e[t]}`)}function b(e,t){if(t in e&&e[t]!==void 0&&e[t]!==null){let n;if((0,r.isDuration)(e[t]))n=e[t];else if((0,r.isDurationMessage)(e[t]))n=(0,r.durationMessageToDuration)(e[t]);else if(typeof e[t]==`string`){let i=(0,r.parseDuration)(e[t]);if(!i)throw Error(`weighted round robin config ${t}: failed to parse duration string ${e[t]}`);n=i}else throw Error(`weighted round robin config ${t}: expected duration, got ${typeof e[t]}`);return(0,r.durationToMs)(n)}return null}var x=class e{constructor(e,t,n,r,i,a){this.enableOobLoadReport=e??!1,this.oobLoadReportingPeriodMs=t??m,this.blackoutPeriodMs=n??h,this.weightExpirationPeriodMs=r??g,this.weightUpdatePeriodMs=Math.max(i??_,100),this.errorUtilizationPenalty=a??v}getLoadBalancerName(){return p}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,r.durationToString)((0,r.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,r.durationToString)((0,r.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,r.durationToString)((0,r.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,r.durationToString)((0,r.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(t){if(y(t,`enable_oob_load_report`,`boolean`),y(t,`error_utilization_penalty`,`number`),t.error_utilization_penalty<0)throw Error(`weighted round robin config error_utilization_penalty < 0`);return new e(t.enable_oob_load_report,b(t,`oob_load_reporting_period`),b(t,`blackout_period`),b(t,`weight_expiration_period`),b(t,`weight_update_period`),t.error_utilization_penalty)}getEnableOobLoadReport(){return this.enableOobLoadReport}getOobLoadReportingPeriodMs(){return this.oobLoadReportingPeriodMs}getBlackoutPeriodMs(){return this.blackoutPeriodMs}getWeightExpirationPeriodMs(){return this.weightExpirationPeriodMs}getWeightUpdatePeriodMs(){return this.weightUpdatePeriodMs}getErrorUtilizationPenalty(){return this.errorUtilizationPenalty}};e.WeightedRoundRobinLoadBalancingConfig=x;var S=class{constructor(e,t){this.metricsHandler=t,this.queue=new l.PriorityQueue((e,t)=>e.deadline<t.deadline);let n=e.filter(e=>e.weight>0),r;if(n.length<2)r=1;else{let e=0;for(let{weight:t}of n)e+=t;r=e/n.length}for(let t of e){let e=t.weight>0?1/t.weight:r;this.queue.push({endpointName:t.endpointName,picker:t.picker,period:e,deadline:Math.random()*e})}}pick(e){let t=this.queue.pop();this.queue.push(Object.assign(Object.assign({},t),{deadline:t.deadline+t.period}));let n=t.picker.pick(e);if(n.pickResultType===c.PickResultType.COMPLETE){if(this.metricsHandler)return Object.assign(Object.assign({},n),{onCallEnded:(0,s.createMetricsReader)(e=>this.metricsHandler(e,t.endpointName),n.onCallEnded)});{let e=n.subchannel;return Object.assign(Object.assign({},n),{subchannel:e.getWrappedSubchannel()})}}else return n}},w=class{constructor(e){this.channelControlHelper=e,this.latestConfig=null,this.children=new Map,this.currentState=t.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(e){let t=0;for(let n of this.children.values())n.child.getConnectivityState()===e&&(t+=1);return t}updateWeight(e,t){let n=t.rps_fractional,r=t.application_utilization;r>0&&n>0&&(r+=t.eps/n*(this.latestConfig?.getErrorUtilizationPenalty()??0));let i=r===0?0:n/r;if(i===0)return;let a=new Date;e.nonEmptySince===null&&(e.nonEmptySince=a),e.lastUpdated=a,e.weight=i}getWeight(e){if(!this.latestConfig)return 0;let t=new Date().getTime();if(t-e.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return e.nonEmptySince=null,0;let n=this.latestConfig.getBlackoutPeriodMs();return n>0&&(e.nonEmptySince===null||t-e.nonEmptySince.getTime()<n)?0:e.weight}calculateAndUpdateState(){if(!(this.updatesPaused||!this.latestConfig)){if(this.countChildrenWithState(t.ConnectivityState.READY)>0){let e=[];for(let[n,r]of this.children)r.child.getConnectivityState()===t.ConnectivityState.READY&&e.push({endpointName:n,picker:r.child.getPicker(),weight:this.getWeight(r)});f(`Created picker with weights: `+e.map(e=>e.endpointName+`:`+e.weight).join(`,`));let n;n=this.latestConfig.getEnableOobLoadReport()?null:(e,t)=>{let n=this.children.get(t);n&&this.updateWeight(n,e)},this.updateState(t.ConnectivityState.READY,new S(e,n),null)}else if(this.countChildrenWithState(t.ConnectivityState.CONNECTING)>0)this.updateState(t.ConnectivityState.CONNECTING,new c.QueuePicker(this),null);else if(this.countChildrenWithState(t.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new c.UnavailablePicker({details:e}),e)}else this.updateState(t.ConnectivityState.IDLE,new c.QueuePicker(this),null);for(let{child:e}of this.children.values())e.getConnectivityState()===t.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,n,r){f(t.ConnectivityState[this.currentState]+` -> `+t.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,n,r)}updateAddressList(e,n,r,o){var l;if(!(n instanceof x))return!1;if(!e.ok)return this.children.size===0&&this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new c.UnavailablePicker(e.error),e.error.details),!0;if(e.value.length===0){let e=`No addresses resolved. Resolution note: ${o}`;return this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new c.UnavailablePicker({details:e}),e),!1}f(`Connect to endpoint list `+e.value.map(u.endpointToString));let d=new Date,p=new Set;this.updatesPaused=!0,this.latestConfig=n;for(let c of e.value){let e=(0,u.endpointToString)(c);p.add(e);let l=this.children.get(e);l||(l={child:new a.LeafLoadBalancer(c,(0,i.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(e,n,r)=>{this.currentState===t.ConnectivityState.READY&&e!==t.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),e===t.ConnectivityState.READY&&(l.nonEmptySince=null),r&&(this.lastError=r),this.calculateAndUpdateState()},createSubchannel:(e,t)=>{let n=this.channelControlHelper.createSubchannel(e,t);return l?.oobMetricsListener?new s.OrcaOobMetricsSubchannelWrapper(n,l.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs()):n}}),r,o),lastUpdated:d,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(e,l)),n.getEnableOobLoadReport()?l.oobMetricsListener=e=>{this.updateWeight(l,e)}:l.oobMetricsListener=null}for(let[e,t]of this.children)p.has(e)?t.child.startConnecting():(t.child.destroy(),this.children.delete(e));return this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer),this.weightUpdateTimer=(l=setInterval(()=>{this.currentState===t.ConnectivityState.READY&&this.calculateAndUpdateState()},n.getWeightUpdatePeriodMs())).unref?.call(l),!0}exitIdle(){}resetBackoff(){}destroy(){for(let e of this.children.values())e.child.destroy();this.children.clear(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer)}getTypeName(){return p}};function T(){(0,i.registerLoadBalancerType)(p,w,x)}})),hn=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.experimental=e.ServerMetricRecorder=e.ServerInterceptingCall=e.ResponderBuilder=e.ServerListenerBuilder=e.addAdminServicesToServer=e.getChannelzHandlers=e.getChannelzServiceDefinition=e.InterceptorConfigurationError=e.InterceptingCall=e.RequesterBuilder=e.ListenerBuilder=e.StatusBuilder=e.getClientChannel=e.ServerCredentials=e.Server=e.setLogVerbosity=e.setLogger=e.load=e.loadObject=e.CallCredentials=e.ChannelCredentials=e.waitForClientReady=e.closeClient=e.Channel=e.makeGenericClientConstructor=e.makeClientConstructor=e.loadPackageDefinition=e.Client=e.compressionAlgorithms=e.propagate=e.connectivityState=e.status=e.logVerbosity=e.Metadata=e.credentials=void 0;var t=ie();Object.defineProperty(e,`CallCredentials`,{enumerable:!0,get:function(){return t.CallCredentials}});var n=Zt();Object.defineProperty(e,`Channel`,{enumerable:!0,get:function(){return n.ChannelImplementation}});var r=jt();Object.defineProperty(e,`compressionAlgorithms`,{enumerable:!0,get:function(){return r.CompressionAlgorithms}});var i=W();Object.defineProperty(e,`connectivityState`,{enumerable:!0,get:function(){return i.ConnectivityState}});var a=oe();Object.defineProperty(e,`ChannelCredentials`,{enumerable:!0,get:function(){return a.ChannelCredentials}});var o=Te();Object.defineProperty(e,`Client`,{enumerable:!0,get:function(){return o.Client}});var s=C();Object.defineProperty(e,`logVerbosity`,{enumerable:!0,get:function(){return s.LogVerbosity}}),Object.defineProperty(e,`status`,{enumerable:!0,get:function(){return s.Status}}),Object.defineProperty(e,`propagate`,{enumerable:!0,get:function(){return s.Propagate}});var c=B(),l=Ee();Object.defineProperty(e,`loadPackageDefinition`,{enumerable:!0,get:function(){return l.loadPackageDefinition}}),Object.defineProperty(e,`makeClientConstructor`,{enumerable:!0,get:function(){return l.makeClientConstructor}}),Object.defineProperty(e,`makeGenericClientConstructor`,{enumerable:!0,get:function(){return l.makeClientConstructor}});var u=V();Object.defineProperty(e,`Metadata`,{enumerable:!0,get:function(){return u.Metadata}});var d=rn();Object.defineProperty(e,`Server`,{enumerable:!0,get:function(){return d.Server}});var f=$t();Object.defineProperty(e,`ServerCredentials`,{enumerable:!0,get:function(){return f.ServerCredentials}});var p=an();Object.defineProperty(e,`StatusBuilder`,{enumerable:!0,get:function(){return p.StatusBuilder}}),e.credentials={combineChannelCredentials:(e,...t)=>t.reduce((e,t)=>e.compose(t),e),combineCallCredentials:(e,...t)=>t.reduce((e,t)=>e.compose(t),e),createInsecure:a.ChannelCredentials.createInsecure,createSsl:a.ChannelCredentials.createSsl,createFromSecureContext:a.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:t.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:t.CallCredentials.createFromGoogleCredential,createEmpty:t.CallCredentials.createEmpty},e.closeClient=e=>e.close(),e.waitForClientReady=(e,t,n)=>e.waitForReady(t,n),e.loadObject=(e,t)=>{throw Error(`Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead`)},e.load=(e,t,n)=>{throw Error(`Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead`)},e.setLogger=e=>{c.setLogger(e)},e.setLogVerbosity=e=>{c.setLoggerVerbosity(e)},e.getClientChannel=e=>o.Client.prototype.getChannel.call(e);var m=we();Object.defineProperty(e,`ListenerBuilder`,{enumerable:!0,get:function(){return m.ListenerBuilder}}),Object.defineProperty(e,`RequesterBuilder`,{enumerable:!0,get:function(){return m.RequesterBuilder}}),Object.defineProperty(e,`InterceptingCall`,{enumerable:!0,get:function(){return m.InterceptingCall}}),Object.defineProperty(e,`InterceptorConfigurationError`,{enumerable:!0,get:function(){return m.InterceptorConfigurationError}});var h=kt();Object.defineProperty(e,`getChannelzServiceDefinition`,{enumerable:!0,get:function(){return h.getChannelzServiceDefinition}}),Object.defineProperty(e,`getChannelzHandlers`,{enumerable:!0,get:function(){return h.getChannelzHandlers}});var g=xe();Object.defineProperty(e,`addAdminServicesToServer`,{enumerable:!0,get:function(){return g.addAdminServicesToServer}});var _=nn();Object.defineProperty(e,`ServerListenerBuilder`,{enumerable:!0,get:function(){return _.ServerListenerBuilder}}),Object.defineProperty(e,`ResponderBuilder`,{enumerable:!0,get:function(){return _.ResponderBuilder}}),Object.defineProperty(e,`ServerInterceptingCall`,{enumerable:!0,get:function(){return _.ServerInterceptingCall}});var v=tn();Object.defineProperty(e,`ServerMetricRecorder`,{enumerable:!0,get:function(){return v.ServerMetricRecorder}}),e.experimental=cn();var y=Bt(),b=ln(),x=un(),S=on(),w=dn(),T=fn(),E=mn(),D=kt();y.setup(),b.setup(),x.setup(),S.setup(),w.setup(),T.setup(),E.setup(),D.setup()})),gn=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createServiceClientConstructor=void 0;var t=hn();function n(e,n){let r={export:{path:e,requestStream:!1,responseStream:!1,requestSerialize:e=>e,requestDeserialize:e=>e,responseSerialize:e=>e,responseDeserialize:e=>e}};return t.makeGenericClientConstructor(r,n)}e.createServiceClientConstructor=n})),_n=i((e=>{a(),Object.defineProperty(e,`__esModule`,{value:!0}),e.createOtlpGrpcExporterTransport=e.GrpcExporterTransport=e.createEmptyMetadata=e.createSslCredentials=e.createInsecureCredentials=void 0;var t=`OTel-OTLP-Exporter-JavaScript/${S().VERSION}`;function n(e){return e?`${e} ${t}`:t}var r=0,i=2;function s(e){return e===`gzip`?i:r}function c(){let{credentials:e}=hn();return e.createInsecure()}e.createInsecureCredentials=c;function l(e,t,n){let{credentials:r}=hn();return r.createSsl(e,t,n)}e.createSslCredentials=l;function u(){let{Metadata:e}=hn();return new e}e.createEmptyMetadata=u;var d=class{constructor(e){o(this,`_client`,void 0),o(this,`_metadata`,void 0),o(this,`_parameters`,void 0),this._parameters=e}shutdown(){this._client?.close()}send(e,t){let r=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:e}=gn();try{this._metadata=this._parameters.metadata()}catch(e){return Promise.resolve({status:`failure`,error:e})}let t=e(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new t(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":s(this._parameters.compression),"grpc.primary_user_agent":n(this._parameters.userAgent)})}catch(e){return Promise.resolve({status:`failure`,error:e})}}return new Promise(e=>{let n=Date.now()+t;if(this._metadata==null)return e({error:Error(`metadata was null`),status:`failure`});this._client.export(r,this._metadata,{deadline:n},(t,n)=>{e(t?{status:`failure`,error:t}:{data:n,status:`success`})})})}};e.GrpcExporterTransport=d;function f(e){return new d(e)}e.createOtlpGrpcExporterTransport=f})),vn=i((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getOtlpGrpcDefaultConfiguration=n.mergeOtlpGrpcConfigurationWithDefaults=n.validateAndNormalizeUrl=void 0;var r=(g(),e(c)),i=_n(),a=t(`url`),o=(v(),e(y));function s(e){e=e.trim(),e.match(/^([\w]{1,8}):\/\//)||(e=`https://${e}`);let t=new a.URL(e);return t.protocol===`unix:`?e:(t.pathname&&t.pathname!==`/`&&o.diag.warn(`URL path should not be set when using grpc, the path part of the URL will be ignored.`),t.protocol!==``&&!t.protocol?.match(/^(http)s?:$/)&&o.diag.warn(`URL protocol should be http(s)://. Using http://.`),t.host)}n.validateAndNormalizeUrl=s;function l(e,t){for(let[n,r]of Object.entries(t.getMap()))e.get(n).length<1&&e.set(n,r)}function u(e,t,n){let a=e.url??t.url??n.url;return{...(0,r.mergeOtlpSharedConfigurationWithDefaults)(e,t,n),metadata:()=>{let r=n.metadata();return l(r,e.metadata?.().clone()??(0,i.createEmptyMetadata)()),l(r,t.metadata?.()??(0,i.createEmptyMetadata)()),r},url:s(a),credentials:e.credentials??t.credentials?.(a)??n.credentials(a),userAgent:e.userAgent}}n.mergeOtlpGrpcConfigurationWithDefaults=u;function d(){return{...(0,r.getSharedConfigurationDefaults)(),metadata:()=>(0,i.createEmptyMetadata)(),url:`http://localhost:4317`,credentials:e=>e.startsWith(`http://`)?()=>(0,i.createInsecureCredentials)():()=>(0,i.createSslCredentials)()}}n.getOtlpGrpcDefaultConfiguration=d})),yn=i((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getOtlpGrpcConfigurationFromEnv=void 0;var r=(b(),e(x)),i=_n(),a=(m(),e(d)),o=t(`fs`),s=t(`path`),c=(v(),e(y));function l(e,t){if(e!=null&&e!==``)return e;if(t!=null&&t!==``)return t}function u(e){let t=process.env[`OTEL_EXPORTER_OTLP_${e}_HEADERS`]?.trim(),n=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),a=(0,r.parseKeyPairsIntoRecord)(t),o=(0,r.parseKeyPairsIntoRecord)(n);if(Object.keys(a).length===0&&Object.keys(o).length===0)return;let s=Object.assign({},o,a),c=(0,i.createEmptyMetadata)();for(let[e,t]of Object.entries(s))c.set(e,t);return c}function f(e){let t=u(e);if(t!=null)return()=>t}function p(e){let t=process.env[`OTEL_EXPORTER_OTLP_${e}_ENDPOINT`]?.trim(),n=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return l(t,n)}function h(e){let t=process.env[`OTEL_EXPORTER_OTLP_${e}_INSECURE`]?.toLowerCase().trim(),n=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return l(t,n)===`true`}function g(e,t,n){let r=process.env[e]?.trim(),i=process.env[t]?.trim(),a=l(r,i);if(a!=null)try{return o.readFileSync(s.resolve(process.cwd(),a))}catch{c.diag.warn(n);return}else return}function _(e){return g(`OTEL_EXPORTER_OTLP_${e}_CLIENT_CERTIFICATE`,`OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE`,`Failed to read client certificate chain file`)}function S(e){return g(`OTEL_EXPORTER_OTLP_${e}_CLIENT_KEY`,`OTEL_EXPORTER_OTLP_CLIENT_KEY`,`Failed to read client certificate private key file`)}function C(e){return g(`OTEL_EXPORTER_OTLP_${e}_CERTIFICATE`,`OTEL_EXPORTER_OTLP_CERTIFICATE`,`Failed to read root certificate file`)}function w(e){let t=S(e),n=_(e),r=C(e);return r!=null&&!(t!=null&&n!=null)?(c.diag.warn(`Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate`),(0,i.createSslCredentials)(C(e))):(0,i.createSslCredentials)(r,t,n)}function T(e){return h(e)?(0,i.createInsecureCredentials)():w(e)}function E(e){return{...(0,a.getSharedConfigurationFromEnvironment)(e),metadata:f(e),url:p(e),credentials:t=>t.startsWith(`http://`)?()=>(0,i.createInsecureCredentials)():t.startsWith(`https://`)?()=>w(e):()=>T(e)}}n.getOtlpGrpcConfigurationFromEnv=E})),bn=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.convertLegacyOtlpGrpcOptions=void 0;var t=vn(),n=_n(),r=yn();function i(e,i){let a=e.credentials;return(0,t.mergeOtlpGrpcConfigurationWithDefaults)({url:e.url,metadata:()=>e.metadata??(0,n.createEmptyMetadata)(),compression:e.compression,timeoutMillis:e.timeoutMillis,concurrencyLimit:e.concurrencyLimit,credentials:a==null?void 0:()=>a,userAgent:e.userAgent},(0,r.getOtlpGrpcConfigurationFromEnv)(i),(0,t.getOtlpGrpcDefaultConfiguration)())}e.convertLegacyOtlpGrpcOptions=i})),xn=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.createOtlpGrpcExportDelegate=void 0;var n=(g(),e(c)),r=_n();function i(e,t,i,a){return(0,n.createOtlpNetworkExportDelegate)(e,t,(0,r.createOtlpGrpcExporterTransport)({address:e.url,compression:e.compression,credentials:e.credentials,metadata:e.metadata,userAgent:e.userAgent,grpcName:i,grpcPath:a}))}t.createOtlpGrpcExportDelegate=i})),Sn=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createOtlpGrpcExportDelegate=e.convertLegacyOtlpGrpcOptions=void 0;var t=bn();Object.defineProperty(e,`convertLegacyOtlpGrpcOptions`,{enumerable:!0,get:function(){return t.convertLegacyOtlpGrpcOptions}});var n=xn();Object.defineProperty(e,`createOtlpGrpcExportDelegate`,{enumerable:!0,get:function(){return n.createOtlpGrpcExportDelegate}})}));export{Sn as t};