alchemylab-opencode 2.0.1 → 2.0.4

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 (232) hide show
  1. package/NODE_COMPAT.md +8 -1
  2. package/dist/20260127222353_familiar_lady_ursula-YYOFSQD5.js +18 -0
  3. package/dist/20260211171708_add_project_commands-3GKQTPBZ.js +18 -0
  4. package/dist/20260213144116_wakeful_the_professor-ROO7OAVL.js +18 -0
  5. package/dist/20260225215848_workspace-V2OZTNFF.js +18 -0
  6. package/dist/20260227213759_add_session_workspace_id-GVDWAXKM.js +18 -0
  7. package/dist/20260228203230_blue_harpoon-Z5QP2II5.js +18 -0
  8. package/dist/20260303231226_add_workspace_fields-QOVAFN7W.js +18 -0
  9. package/dist/20260309230000_move_org_to_state-RQURSDZD.js +18 -0
  10. package/dist/20260312043431_session_message_cursor-VBISKDXL.js +18 -0
  11. package/dist/20260323234822_events-PILJHLNA.js +18 -0
  12. package/dist/20260410174513_workspace-name-63YCZ5NS.js +18 -0
  13. package/dist/20260413175956_chief_energizer-NMAZYGDO.js +18 -0
  14. package/dist/20260423070820_add_icon_url_override-RAJCVNEP.js +18 -0
  15. package/dist/20260427172553_slow_nightmare-ULYYZLR4.js +18 -0
  16. package/dist/20260428004200_add_session_path-U4WO2TGE.js +18 -0
  17. package/dist/20260501142318_next_venus-6BCYATSC.js +18 -0
  18. package/dist/20260504145000_add_sync_owner-RGVHV6LN.js +18 -0
  19. package/dist/20260507164347_add_workspace_time-GE6UHNPM.js +18 -0
  20. package/dist/{20260510033149_session_usage-UGBVOXZB.js → 20260510033149_session_usage-7XHCFVKY.js} +5 -1
  21. package/dist/20260511000411_data_migration_state-2EGZKFLB.js +18 -0
  22. package/dist/20260511173437_session-metadata-K322YY33.js +18 -0
  23. package/dist/20260601010001_normalize_storage_paths-VZDTY366.js +18 -0
  24. package/dist/{20260225215848_workspace-ZMSOZSPA.js → 20260601202201_amazing_prowler-YT6PLK3L.js} +5 -1
  25. package/dist/{20260228203230_blue_harpoon-IW3Z4TQZ.js → 20260602002951_lowly_union_jack-6VLQTBVB.js} +5 -1
  26. package/dist/20260602182828_add_project_directories-TVSRD25A.js +18 -0
  27. package/dist/20260603001617_session_message_projection_indexes-PHKTF6HK.js +18 -0
  28. package/dist/{20260622170816_reset_v2_session_state-5JPHJTZG.js → 20260603040000_session_message_projection_order-7RTV2POG.js} +5 -1
  29. package/dist/20260603141458_session_input_inbox-RSBWABG7.js +18 -0
  30. package/dist/20260603160727_jittery_ezekiel_stane-DXBLLRVV.js +18 -0
  31. package/dist/20260604172448_event_sourced_session_input-H6Z3JEBD.js +18 -0
  32. package/dist/20260605003541_add_session_context_snapshot-6FDPM2TK.js +18 -0
  33. package/dist/20260605042240_add_context_epoch_agent-C2OF2UKR.js +18 -0
  34. package/dist/20260611035744_credential-YNZ47FSH.js +18 -0
  35. package/dist/20260611192811_lush_chimera-E357VI6P.js +18 -0
  36. package/dist/20260612174303_project_dir_strategy-VUGGK42O.js +18 -0
  37. package/dist/20260622142730_simplify_session_context_epoch-UYGXZ5BX.js +18 -0
  38. package/dist/20260622170816_reset_v2_session_state-EILLPCJQ.js +18 -0
  39. package/dist/20260622202450_simplify_session_input-Y65GDGBO.js +18 -0
  40. package/dist/NodeSdk-AGMQWBHH.js +18 -0
  41. package/dist/anthropic-45OFTLAW.js +18 -0
  42. package/dist/anthropic-FVULF7C3.js +18 -0
  43. package/dist/app-runtime-LDQWNGWP.js +18 -0
  44. package/dist/chunk-2JE3QYG6.js +18 -0
  45. package/dist/chunk-2MRHL4B2.js +18 -0
  46. package/dist/chunk-4GJE6OMN.js +190 -0
  47. package/dist/chunk-4MBUHJHY.js +22 -0
  48. package/dist/chunk-5BLZCAU6.js +55 -0
  49. package/dist/chunk-7XX6TY62.js +259 -0
  50. package/dist/chunk-ANF3QA3Z.js +48 -0
  51. package/dist/chunk-AZUMH3TO.js +18 -0
  52. package/dist/chunk-B74WSFN4.js +878 -0
  53. package/dist/chunk-BQ4IEPN3.js +19 -0
  54. package/dist/chunk-CYRZU5QM.js +33 -0
  55. package/dist/chunk-DADVNQTM.js +1490 -0
  56. package/dist/chunk-DO2UZ6NY.js +18 -0
  57. package/dist/chunk-DWEYXIQI.js +780 -0
  58. package/dist/chunk-EK6FQQHY.js +20 -0
  59. package/dist/chunk-ELPXQ32J.js +90 -0
  60. package/dist/chunk-FGLPSSRK.js +19 -0
  61. package/dist/chunk-FOHYZ7MJ.js +55 -0
  62. package/dist/chunk-FV7U6PVP.js +18 -0
  63. package/dist/chunk-FYYAOZPU.js +18 -0
  64. package/dist/chunk-G7PFO5HG.js +920 -0
  65. package/dist/chunk-GDWO6EXN.js +22 -0
  66. package/dist/chunk-GW3ZRKAI.js +20 -0
  67. package/dist/chunk-IYUSBBGY.js +35 -0
  68. package/dist/chunk-JPOFLMNH.js +18 -0
  69. package/dist/{chunk-VURLSDCB.js → chunk-K5LKDIVU.js} +4 -0
  70. package/dist/chunk-KS4WLVK5.js +19 -0
  71. package/dist/chunk-LIXP4TPL.js +18 -0
  72. package/dist/chunk-LSC4RT5V.js +36 -0
  73. package/dist/chunk-M5A6NFHQ.js +28 -0
  74. package/dist/chunk-M6E6KNLV.js +30 -0
  75. package/dist/chunk-MLFZXUGQ.js +18 -0
  76. package/dist/chunk-NDI67DRG.js +31 -0
  77. package/dist/chunk-NGT6LCW6.js +18 -0
  78. package/dist/chunk-OCWGUTZJ.js +36 -0
  79. package/dist/chunk-OGDRUXMJ.js +18 -0
  80. package/dist/chunk-OGJKLJC7.js +29 -0
  81. package/dist/chunk-OT2YNR56.js +19 -0
  82. package/dist/chunk-OUVSKG2H.js +19 -0
  83. package/dist/chunk-P5RLCJUV.js +18 -0
  84. package/dist/chunk-Q3WIUQXB.js +18 -0
  85. package/dist/{20260227213759_add_session_workspace_id-ROENWPKA.js → chunk-QCRIXKIC.js} +5 -1
  86. package/dist/chunk-QD24DLUD.js +18 -0
  87. package/dist/chunk-R2GWBJEP.js +18 -0
  88. package/dist/chunk-RPAXSOGH.js +18 -0
  89. package/dist/chunk-TK5R7QUN.js +18 -0
  90. package/dist/chunk-TNQWZFIZ.js +28 -0
  91. package/dist/chunk-UCLPBO4I.js +18 -0
  92. package/dist/chunk-UPEPL4I2.js +18 -0
  93. package/dist/chunk-V6FDDNGV.js +117 -0
  94. package/dist/chunk-V6HERYFV.js +18 -0
  95. package/dist/chunk-V7XKKJ7X.js +24 -0
  96. package/dist/chunk-VHDYUBBS.js +23 -0
  97. package/dist/chunk-VWLJXTZ5.js +18 -0
  98. package/dist/chunk-VXAPFOIL.js +22 -0
  99. package/dist/chunk-WKZYINC7.js +29 -0
  100. package/dist/chunk-WPMP2ZFE.js +40 -0
  101. package/dist/chunk-WRTNIOI3.js +18 -0
  102. package/dist/chunk-X5F46HR5.js +18 -0
  103. package/dist/chunk-XPS7TQZG.js +22 -0
  104. package/dist/chunk-YJPP6IQ3.js +23 -0
  105. package/dist/chunk-ZYQWFC55.js +22 -0
  106. package/dist/code-mode-YYOGD36U.js +502 -0
  107. package/dist/copilot-provider-QVMLQZZC.js +18 -0
  108. package/dist/dist-5NQOHNPL.js +18 -0
  109. package/dist/dist-7CT3XCNN.js +32 -0
  110. package/dist/dist-CL46WFZG.js +18 -0
  111. package/dist/{20260605042240_add_context_epoch_agent-W6IQYZXE.js → dist-CYBRID2F.js} +5 -1
  112. package/dist/dist-HXJTF22W.js +32 -0
  113. package/dist/dist-JFXI53ZF.js +22 -0
  114. package/dist/dist-KBYKWVT5.js +22 -0
  115. package/dist/dist-KM5HCPZX.js +35 -0
  116. package/dist/dist-KTNLTEHB.js +18 -0
  117. package/dist/dist-KZ5R5QM5.js +24 -0
  118. package/dist/dist-NLXUYBW7.js +32 -0
  119. package/dist/dist-O4DF72J2.js +22 -0
  120. package/dist/dist-PH4MEGVR.js +22 -0
  121. package/dist/{20260511000411_data_migration_state-FB4LBFSE.js → dist-QJPOJCLB.js} +5 -1
  122. package/dist/dist-QYH62TCJ.js +22 -0
  123. package/dist/{20260303231226_add_workspace_fields-OUVZMNAG.js → dist-RIC4WKHC.js} +5 -1
  124. package/dist/dist-T776XKTM.js +22 -0
  125. package/dist/dist-TCE5MKZQ.js +23 -0
  126. package/dist/dist-TH2Q44RX.js +50 -0
  127. package/dist/dist-VV5FV5RT.js +101 -0
  128. package/dist/dist-XAFENVUS.js +22 -0
  129. package/dist/dist-XPFB35TX.js +32 -0
  130. package/dist/dist-YUH4RKR5.js +28 -0
  131. package/dist/dist-es-43ZM44MP.js +18 -0
  132. package/dist/dist-es-6PLFRCS4.js +18 -0
  133. package/dist/dist-es-G5UIJOU7.js +26 -0
  134. package/dist/{20260428004200_add_session_path-LGW75WYA.js → dist-es-HYIIGUNX.js} +5 -1
  135. package/dist/dist-es-L2GU465G.js +18 -0
  136. package/dist/dist-es-LSR2QCFZ.js +18 -0
  137. package/dist/dist-es-RGEIM2BP.js +18 -0
  138. package/dist/dist-es-SITTNOGV.js +18 -0
  139. package/dist/dist-es-W5GYOX6F.js +18 -0
  140. package/dist/esm-NN5W7YCL.js +18 -0
  141. package/dist/esm-XWJSHYHG.js +18 -0
  142. package/dist/getMachineId-bsd-L5I5TZ5I.js +18 -0
  143. package/dist/getMachineId-darwin-YB7KG37W.js +19 -0
  144. package/dist/getMachineId-linux-EL47KXX7.js +18 -0
  145. package/dist/getMachineId-unsupported-QOWPEBPN.js +18 -0
  146. package/dist/getMachineId-win-HCRYRDFJ.js +18 -0
  147. package/dist/lib-ZP7Q6A3E.js +199 -0
  148. package/dist/loadCognitoIdentity-EWT55EI7.js +18 -0
  149. package/dist/loadSso-AGOUE6RL.js +18 -0
  150. package/dist/{20260213144116_wakeful_the_professor-ZVDD54AK.js → loadSts-RH5L3PIX.js} +5 -1
  151. package/dist/mantle-IJXDXT4M.js +25 -0
  152. package/dist/mime-types-46EO4HOZ.js +18 -0
  153. package/dist/multipart-parser-KZWMKXA4.js +19 -0
  154. package/dist/{20260211171708_add_project_commands-GDOHPDPF.js → open-7KXTRM37.js} +5 -1
  155. package/dist/openai-ZOJI6I5R.js +18 -0
  156. package/dist/p-map-CYL6ILJW.js +18 -0
  157. package/dist/photon-W56QZY4L.js +18 -0
  158. package/dist/{20260423070820_add_icon_url_override-X5SHFGTI.js → pkce-VT4ITJTB.js} +5 -1
  159. package/dist/{pty.node-Y3N2XKYG.js → pty.node-IWULXXG6.js} +5 -1
  160. package/dist/run.js +5 -1
  161. package/dist/serve.js +143 -1
  162. package/dist/server-LVIHYOCY.js +21 -0
  163. package/dist/session-6OPJNJMK.js +18 -0
  164. package/dist/signin-OCIW23YM.js +18 -0
  165. package/dist/src-3NCXEROI.js +18 -0
  166. package/dist/src-LXWGIUZH.js +18 -0
  167. package/dist/src-WDYKISPD.js +20 -0
  168. package/dist/src-YAAFIGTW.js +18 -0
  169. package/dist/sso-oidc-OMMKINFE.js +18 -0
  170. package/dist/sts-MWK22JIX.js +18 -0
  171. package/dist/token-QPO3OAGS.js +18 -0
  172. package/dist/token-util-YGPCEEPO.js +18 -0
  173. package/dist/unified-W3ZKZ4HG.js +18 -0
  174. package/dist/worktree-32M5MTFE.js +18 -0
  175. package/package.json +40 -40
  176. package/postinstall.cjs +4 -2
  177. package/dist/20260127222353_familiar_lady_ursula-KV747FJX.js +0 -14
  178. package/dist/20260309230000_move_org_to_state-NOXAPU5V.js +0 -14
  179. package/dist/20260312043431_session_message_cursor-DJ4T3T4R.js +0 -14
  180. package/dist/20260323234822_events-72GIKJ2A.js +0 -14
  181. package/dist/20260410174513_workspace-name-JXSWFBJN.js +0 -14
  182. package/dist/20260413175956_chief_energizer-4HEWZ6U3.js +0 -14
  183. package/dist/20260427172553_slow_nightmare-PS5T2AH2.js +0 -14
  184. package/dist/20260501142318_next_venus-J3TLVXZ6.js +0 -14
  185. package/dist/20260504145000_add_sync_owner-3R52GB4C.js +0 -14
  186. package/dist/20260507164347_add_workspace_time-JHDRCZAR.js +0 -14
  187. package/dist/20260511173437_session-metadata-T2XHGWHS.js +0 -14
  188. package/dist/20260601010001_normalize_storage_paths-5MAY5GT3.js +0 -14
  189. package/dist/20260601202201_amazing_prowler-PET224YG.js +0 -14
  190. package/dist/20260602002951_lowly_union_jack-PG6XDMGL.js +0 -14
  191. package/dist/20260602182828_add_project_directories-ZCH2ACGG.js +0 -14
  192. package/dist/20260603001617_session_message_projection_indexes-XVLJTUF2.js +0 -14
  193. package/dist/20260603040000_session_message_projection_order-XG6RACZQ.js +0 -14
  194. package/dist/20260603141458_session_input_inbox-K2VQ7V6E.js +0 -14
  195. package/dist/20260603160727_jittery_ezekiel_stane-WKJLRDO7.js +0 -14
  196. package/dist/20260604172448_event_sourced_session_input-NTXOECR7.js +0 -14
  197. package/dist/20260605003541_add_session_context_snapshot-DXMQEXMT.js +0 -14
  198. package/dist/20260611035744_credential-XTMSYTJD.js +0 -14
  199. package/dist/20260611192811_lush_chimera-XPLIQMJD.js +0 -14
  200. package/dist/20260612174303_project_dir_strategy-FR2NGQKK.js +0 -14
  201. package/dist/20260622142730_simplify_session_context_epoch-NTQZR3RE.js +0 -14
  202. package/dist/20260622202450_simplify_session_input-2EXF2HMV.js +0 -14
  203. package/dist/app-runtime-HQBOCDV5.js +0 -14
  204. package/dist/chunk-4FEBIOI5.js +0 -865
  205. package/dist/chunk-4K2RXRZL.js +0 -14
  206. package/dist/chunk-4RFMKEKM.js +0 -1455
  207. package/dist/chunk-BM2C7NHL.js +0 -41
  208. package/dist/chunk-MKEMZFJI.js +0 -393
  209. package/dist/chunk-OMDJ6ZZ2.js +0 -684
  210. package/dist/chunk-OWMG4NNF.js +0 -186
  211. package/dist/chunk-QRABYJKL.js +0 -14
  212. package/dist/chunk-RHIWAYN5.js +0 -14
  213. package/dist/chunk-Z5TLIUAI.js +0 -28
  214. package/dist/code-mode-7BQJUARW.js +0 -40
  215. package/dist/copilot-provider-TX4YFKJZ.js +0 -14
  216. package/dist/photon-VQS5F5BI.js +0 -14
  217. package/dist/server-BFUQR7MX.js +0 -17
  218. package/dist/session-6RNXZNG6.js +0 -14
  219. package/dist/worktree-QHQHX3SG.js +0 -14
  220. package/patches/@ai-sdk%2Famazon-bedrock@4.0.166.patch +0 -164
  221. package/patches/@ai-sdk%2Fanthropic@3.0.111.patch +0 -528
  222. package/patches/@ai-sdk%2Fgoogle@3.0.73.patch +0 -69
  223. package/patches/@ai-sdk%2Fgroq@3.0.31.patch +0 -79
  224. package/patches/@ai-sdk%2Fmistral@3.0.51.patch +0 -714
  225. package/patches/@ai-sdk%2Fopenai-compatible@2.0.41.patch +0 -39
  226. package/patches/@ai-sdk%2Fopenai@3.0.88.patch +0 -280
  227. package/patches/@ai-sdk%2Fxai@3.0.139.patch +0 -296
  228. package/patches/@modelcontextprotocol%2Fsdk@1.29.0.patch +0 -647
  229. package/patches/@npmcli%2Fagent@4.0.2.patch +0 -13
  230. package/patches/effect@4.0.0-beta.83.patch +0 -57
  231. package/patches/gcp-metadata@8.1.2.patch +0 -14
  232. package/patches/pacote@21.5.0.patch +0 -18
@@ -0,0 +1,18 @@
1
+ // Built by esbuild from opencode-server source
2
+ if (typeof globalThis.Bun === 'undefined') {
3
+ globalThis.Bun = {
4
+ version: '0.0.0-node-compat',
5
+ stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
6
+ which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
7
+ };
8
+ }
9
+ if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
10
+ if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
11
+ import { createRequire as __alchemyCreateRequire } from 'node:module';
12
+ const require = __alchemyCreateRequire(import.meta.url);
13
+ import { fileURLToPath as __alchemyFileURLToPath } from 'node:url';
14
+ import { dirname as __alchemyDirname } from 'node:path';
15
+ const __alchemy_filename = __alchemyFileURLToPath(import.meta.url);
16
+ const __alchemy_dirname = __alchemyDirname(__alchemy_filename);
17
+
18
+ import{c as f}from"./chunk-OCWGUTZJ.js";import{f as _}from"./chunk-CYRZU5QM.js";import{a as t,g as c}from"./chunk-2MRHL4B2.js";var p=c(_());var B=c(_());var g=c(f()),u=c(_());var I=c(f()),m=c(_());var R=t((e,o,r)=>{let n={EcsContainer:t(async i=>{let{fromHttp:a}=await import("./dist-es-L2GU465G.js"),{fromContainerMetadata:s}=await import("./dist-es-RGEIM2BP.js");return r?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>(0,m.chain)(a(i??{}),s(i))().then(y)},"EcsContainer"),Ec2InstanceMetadata:t(async i=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");let{fromInstanceMetadata:a}=await import("./dist-es-RGEIM2BP.js");return async()=>a(i)().then(y)},"Ec2InstanceMetadata"),Environment:t(async i=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");let{fromEnv:a}=await import("./dist-es-43ZM44MP.js");return async()=>a(i)().then(y)},"Environment")};if(e in n)return n[e];throw new m.CredentialsProviderError(`Unsupported credential source in profile ${o}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:r})},"resolveCredentialSource"),y=t(e=>(0,I.setCredentialFeature)(e,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p"),"setNamedProvider");var L=t((e,{profile:o="default",logger:r}={})=>!!e&&typeof e=="object"&&typeof e.role_arn=="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(q(e,{profile:o,logger:r})||H(e,{profile:o,logger:r})),"isAssumeRoleProfile"),q=t((e,{profile:o,logger:r})=>{let n=typeof e.source_profile=="string"&&typeof e.credential_source>"u";return n&&r?.debug?.(` ${o} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`),n},"isAssumeRoleWithSourceProfile"),H=t((e,{profile:o,logger:r})=>{let n=typeof e.credential_source=="string"&&typeof e.source_profile>"u";return n&&r?.debug?.(` ${o} isCredentialSourceProfile credential_source=${e.credential_source}`),n},"isCredentialSourceProfile"),O=t(async(e,o,r,n,i={},a)=>{r.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");let s=o[e],{source_profile:l,region:K}=s;if(!r.roleAssumer){let{getDefaultRoleAssumer:d}=await import("./sts-MWK22JIX.js");r.roleAssumer=d({...r.clientConfig,credentialProviderLogger:r.logger,parentClientConfig:{...n,...r?.parentClientConfig,region:K??r?.parentClientConfig?.region??n?.region}},r.clientPlugins)}if(l&&l in i)throw new u.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${(0,u.getProfileName)(r)}. Profiles visited: `+Object.keys(i).join(", "),{logger:r.logger});r.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${l?`source_profile=[${l}]`:`profile=[${e}]`}`);let v=l?a(l,o,r,n,{...i,[l]:!0},A(o[l]??{})):(await R(s.credential_source,e,r.logger)(r))();if(A(s))return v.then(d=>(0,g.setCredentialFeature)(d,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));{let d={RoleArn:s.role_arn,RoleSessionName:s.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:s.external_id,DurationSeconds:parseInt(s.duration_seconds||"3600",10)},{mfa_serial:C}=s;if(C){if(!r.mfaCodeProvider)throw new u.CredentialsProviderError(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:r.logger,tryNextLink:!1});d.SerialNumber=C,d.TokenCode=await r.mfaCodeProvider(C)}let G=await v;return r.roleAssumer(G,d).then(U=>(0,g.setCredentialFeature)(U,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},"resolveAssumeRoleCredentials"),A=t(e=>!e.role_arn&&!!e.credential_source,"isCredentialSourceWithoutRoleArn");var b=c(f());var x=t(e=>!!(e&&e.login_session),"isLoginProfile"),k=t(async(e,o,r)=>{let{fromLoginCredentials:n}=await import("./dist-es-6PLFRCS4.js"),i=await n({...o,profile:e})({callerClientConfig:r});return(0,b.setCredentialFeature)(i,"CREDENTIALS_PROFILE_LOGIN","AC")},"resolveLoginCredentials");var F=c(f());var h=t(e=>!!e&&typeof e=="object"&&typeof e.credential_process=="string","isProcessProfile"),D=t(async(e,o)=>{let{fromProcess:r}=await import("./dist-es-SITTNOGV.js"),n=await r({...e,profile:o})();return(0,F.setCredentialFeature)(n,"CREDENTIALS_PROFILE_PROCESS","v")},"resolveProcessCredentials");var w=c(f());var T=t(async(e,o,r={},n)=>{let{fromSSO:i}=await import("./dist-es-LSR2QCFZ.js");return i({profile:e,logger:r.logger,parentClientConfig:r.parentClientConfig,clientConfig:r.clientConfig})({callerClientConfig:n}).then(a=>o.sso_session?(0,w.setCredentialFeature)(a,"CREDENTIALS_PROFILE_SSO","r"):(0,w.setCredentialFeature)(a,"CREDENTIALS_PROFILE_SSO_LEGACY","t"))},"resolveSsoCredentials"),$=t(e=>e&&(typeof e.sso_start_url=="string"||typeof e.sso_account_id=="string"||typeof e.sso_session=="string"||typeof e.sso_region=="string"||typeof e.sso_role_name=="string"),"isSsoProfile");var W=c(f());var E=t(e=>!!e&&typeof e=="object"&&typeof e.aws_access_key_id=="string"&&typeof e.aws_secret_access_key=="string"&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1&&["undefined","string"].indexOf(typeof e.aws_account_id)>-1,"isStaticCredsProfile"),P=t(async(e,o)=>{o?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");let r={accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}};return(0,W.setCredentialFeature)(r,"CREDENTIALS_PROFILE","n")},"resolveStaticCredentials");var N=c(f());var j=t(e=>!!e&&typeof e=="object"&&typeof e.web_identity_token_file=="string"&&typeof e.role_arn=="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1,"isWebIdentityProfile"),M=t(async(e,o,r)=>{let{fromTokenFile:n}=await import("./dist-es-W5GYOX6F.js"),i=await n({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:o.roleAssumerWithWebIdentity,logger:o.logger,parentClientConfig:o.parentClientConfig})({callerClientConfig:r});return(0,N.setCredentialFeature)(i,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q")},"resolveWebIdentityCredentials");var S=t(async(e,o,r,n,i={},a=!1)=>{let s=o[e];if(Object.keys(i).length>0&&E(s))return P(s,r);if(a||L(s,{profile:e,logger:r.logger}))return O(e,o,r,n,i,S);if(E(s))return P(s,r);if(j(s))return M(s,r,n);if(h(s))return D(r,e);if($(s))return await T(e,s,r,n);if(x(s))return k(e,r,n);throw new B.CredentialsProviderError(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:r.logger})},"resolveProfileData");var V=t((e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");let r=await(0,p.parseKnownFiles)(e);return S((0,p.getProfileName)({profile:e.profile??o?.profile}),r,e,o)},"fromIni");export{V as a};
@@ -0,0 +1,36 @@
1
+ // Built by esbuild from opencode-server source
2
+ if (typeof globalThis.Bun === 'undefined') {
3
+ globalThis.Bun = {
4
+ version: '0.0.0-node-compat',
5
+ stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
6
+ which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
7
+ };
8
+ }
9
+ if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
10
+ if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
11
+ import { createRequire as __alchemyCreateRequire } from 'node:module';
12
+ const require = __alchemyCreateRequire(import.meta.url);
13
+ import { fileURLToPath as __alchemyFileURLToPath } from 'node:url';
14
+ import { dirname as __alchemyDirname } from 'node:path';
15
+ const __alchemy_filename = __alchemyFileURLToPath(import.meta.url);
16
+ const __alchemy_dirname = __alchemyDirname(__alchemy_filename);
17
+
18
+ import{a as or,b as ar,c as Oe,e as cr,f as Pe,g as ke,h as dr,j as q}from"./chunk-CYRZU5QM.js";import{a as o,b as J,c as M,d as U,e as nr,h as Me}from"./chunk-2MRHL4B2.js";var rt=U(m=>{var{Readable:ur}=J("node:stream"),{NoOpLogger:lr,normalizeProvider:Ie}=cr(),{HttpResponse:De,HttpRequest:G}=q(),{parseRfc7231DateTime:pr,v4:Ne}=dr(),{hasOwn:hr}=Oe(),xe=o(t=>t?.body instanceof ur||typeof ReadableStream<"u"&&t?.body instanceof ReadableStream,"isStreamingPayload"),fr=["AccessDeniedException","AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],gr=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],mr=["TimeoutError","RequestTimeout","RequestTimeoutException"],br=[500,502,503,504],wr=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],yr=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],ie=o(t=>t?.$retryable!==void 0,"isRetryableByTrait"),Ce=o(t=>fr.includes(t.name),"isClockSkewError"),Fe=o(t=>t.$metadata?.clockSkewCorrected,"isClockSkewCorrectedError"),Be=o(t=>{let e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return t&&t instanceof TypeError?e.has(t.message):!1},"isBrowserNetworkError"),C=o(t=>t.$metadata?.httpStatusCode===429||gr.includes(t.name)||t.$retryable?.throttling==!0,"isThrottlingError"),F=o((t,e=0)=>t?.name!=="AbortError"&&(ie(t)||Fe(t)||t.name==="InvalidSignatureException"&&t.message?.includes("Signature expired")||mr.includes(t.name)||wr.includes(t?.code||"")||yr.includes(t?.code||"")||br.includes(t.$metadata?.httpStatusCode||0)||Be(t)||Ue(t)||t.cause!==void 0&&e<=10&&F(t.cause,e+1)),"isTransientError"),Le=o(t=>{if(t.$metadata?.httpStatusCode!==void 0){let e=t.$metadata.httpStatusCode;return 500<=e&&e<=599&&!F(t)}return!1},"isServerError");function Ue(t){return t.code==="ERR_HTTP2_STREAM_ERROR"&&t.message.includes("NGHTTP2_REFUSED_STREAM")}o(Ue,"isNodeJsHttp2TransientError");var qe=100,z=20*1e3,He=500,W=500,Ge=5,We=10,ne=1,Y="amz-sdk-invocation-id",j="amz-sdk-request";function $e(t,e){if(De.isInstance(t))for(let r in t.headers){if(!hr(t.headers,r))continue;let s=r.toLowerCase();if(s==="retry-after"){let n=t.headers[r],a=NaN;if(n.endsWith("GMT"))try{a=(pr(n).getTime()-Date.now())/1e3}catch(c){e?.trace?.("Failed to parse retry-after header"),e?.trace?.(c)}else n.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?a=Number(n.match(/ GMT, ([\d.]+)$/)?.[1]):n.match(/^((\d+)|(\d+\.\d+))$/)?a=Number(n):Date.parse(n)>=Date.now()&&(a=(Date.parse(n)-Date.now())/1e3);return isNaN(a)?void 0:new Date(Date.now()+a*1e3)}else if(s==="x-amz-retry-after"){let n=t.headers[r],a=Number(n);if(isNaN(a)){e?.trace?.(`Failed to parse x-amz-retry-after=${n}`);return}return new Date(Date.now()+a)}}}o($e,"parseRetryAfterHeader");function Ar(t,e){return $e(t,e)}o(Ar,"getRetryAfterHint");var Ve=o(t=>t instanceof Error?t:t instanceof Object?Object.assign(new Error,t):typeof t=="string"?new Error(t):new Error(`AWS SDK error wrapper for ${t}`),"asSdkError");function ze(t){return e=>(r,s)=>async n=>{let a=await e.retryStrategy(),c=await e.maxAttempts();if(Er(a)){a=a;let d=await a.acquireInitialRetryToken((s.partition_id??"")+(s.__retryLongPoll?":longpoll":"")),u=new Error,l=0,p=0,{request:b}=n,w=G.isInstance(b);for(w&&(b.headers[Y]=Ne());;)try{w&&(b.headers[j]=`attempt=${l+1}; max=${c}`);let{response:A,output:R}=await r(n);return a.recordSuccess(d),R.$metadata.attempts=l+1,R.$metadata.totalRetryDelay=p,{response:A,output:R}}catch(A){let R=Rr(A,e.logger);if(u=Ve(A),w&&t(b))throw(s.logger instanceof lr?console:s.logger)?.warn("An error was encountered in a non-retryable streaming request."),u;try{d=await a.refreshRetryTokenForRetry(d,R)}catch{throw u.$metadata||(u.$metadata={}),u.$metadata.attempts=l+1,u.$metadata.totalRetryDelay=p,u}l=d.getRetryCount();let D=d.getRetryDelay();p+=(d?.$retryLog?.acquisitionDelay??0)+D,D>0&&await Sr(D)}}else return a=a,a?.mode&&(s.userAgent=[...s.userAgent||[],["cfg/retry-mode",a.mode]]),a.retry(r,n)}}o(ze,"bindRetryMiddleware");var Sr=o(t=>new Promise(e=>setTimeout(e,t)),"cooldown"),Er=o(t=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u","isRetryStrategyV2"),Rr=o((t,e)=>{let r={error:t,errorType:Tr(t)},s=$e(t.$response,e);return s&&(r.retryAfterHint=s),r},"getRetryErrorInfo"),Tr=o(t=>C(t)?"THROTTLING":F(t)?"TRANSIENT":Le(t)?"SERVER_ERROR":"CLIENT_ERROR","getRetryErrorType"),Ye={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function _r(t){let e=ze(t);return r=>({applyToStack:o(s=>{s.add(e(r),Ye)},"applyToStack")})}o(_r,"bindGetRetryPlugin");var N=class t{static{o(this,"DefaultRateLimiter")}static setTimeoutFn=o((e,r)=>setTimeout(e,r),"setTimeoutFn");beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let r;this.updateMeasuredRate();let s=e;if(s?.errorType==="THROTTLING"||C(s?.error??e)){let c=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=c,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(c),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());let a=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(a)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){for(this.refillTokenBucket();e>this.availableTokens;){let r=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(s=>t.setTimeoutFn(s,r)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){let e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}let r=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+r),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let e=this.getCurrentTimeInSeconds(),r=Math.floor(e*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){let s=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(s*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(e){return parseFloat(e.toFixed(8))}},E=class t{static{o(this,"Retry")}static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return t.v2026?50:100}static throttlingDelay(){return t.v2026?1e3:500}static cost(){return t.v2026?14:5}static throttlingCost(){return t.v2026?5:10}static modifiedCostType(){return t.v2026?"THROTTLING":"TRANSIENT"}},Z=class{static{o(this,"DefaultRetryBackoffStrategy")}x=E.delay();computeNextBackoffDelay(e){let n=Math.random()*Math.min(this.x*2**e,z);return Math.floor(n)}setDelayBase(e){this.x=e}},$=class{static{o(this,"DefaultRetryToken")}delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(e,r,s,n){this.delay=e,this.count=r,this.cost=s,this.longPoll=n}getRetryCount(){return this.count}getRetryDelay(){return Math.min(z,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}},v;(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(v||(v={}));var P=3,je=v.STANDARD,H={incompatible:1,attempts:2,capacity:3},x=class{static{o(this,"StandardRetryStrategy")}mode=v.STANDARD;retryBackoffStrategy;capacity=W;maxAttemptsProvider;baseDelay;constructor(e){typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>P,this.baseDelay??=E.delay(),this.retryBackoffStrategy??=new Z}async acquireInitialRetryToken(e){return new $(E.delay(),0,void 0,E.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,r){let s=await this.getMaxAttempts(),n=this.retryCode(e,r,s),a=n===0,c=e.isLongPoll?.();if(a||c){let d=r.errorType;this.retryBackoffStrategy.setDelayBase(d==="THROTTLING"?E.throttlingDelay():this.baseDelay);let u=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),l=u;if(r.retryAfterHint instanceof Date&&(l=Math.max(u,Math.min(r.retryAfterHint.getTime()-Date.now(),u+5e3))),a){let p=this.getCapacityCost(d);this.capacity-=p;let b=new $(0,e.getRetryCount()+1,p,e.isLongPoll?.()??!1);return await new Promise(w=>setTimeout(w,l)),b.$retryLog.acquisitionDelay=l,b}else{let p=E.v2026&&n===H.capacity&&c?l:0;p>0&&await new Promise(b=>setTimeout(b,p))}}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(W,this.capacity+(e.getRetryCost()??ne))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${P}`),P}}retryCode(e,r,s){let n=e.getRetryCount()+1,a=this.isRetryableError(r.errorType)?0:H.incompatible,c=n<s?0:H.attempts,d=this.capacity>=this.getCapacityCost(r.errorType)?0:H.capacity;return a||c||d}getCapacityCost(e){return e===E.modifiedCostType()?E.throttlingCost():E.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}},Ke=class{static{o(this,"AdaptiveRetryStrategy")}mode=v.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,r){let{rateLimiter:s}=r??{};this.rateLimiter=s??new N,this.standardRetryStrategy=r?new x({maxAttempts:typeof e=="number"?e:3,...r}):new x(e)}async acquireInitialRetryToken(e){let r=await this.standardRetryStrategy.acquireInitialRetryToken(e);return await this.rateLimiter.getSendToken(),r}async refreshRetryTokenForRetry(e,r){this.rateLimiter.updateClientSendingRate(r);let s=await this.standardRetryStrategy.refreshRetryTokenForRetry(e,r);return await this.rateLimiter.getSendToken(),s}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}},ee=class extends x{static{o(this,"ConfiguredRetryStrategy")}computeNextBackoffDelay;constructor(e,r=E.delay()){super(typeof e=="function"?e:async()=>e),typeof r=="number"?this.computeNextBackoffDelay=()=>r:this.computeNextBackoffDelay=r,this.retryBackoffStrategy.computeNextBackoffDelay=s=>{let n=s+1;return this.computeNextBackoffDelay(n)}}},vr=o((t,e)=>{let r=t,s=ne,n=Ge,a=We,c=t,d=o(b=>b.name==="TimeoutError"?a:n,"getCapacityAmount"),u=o(b=>d(b)<=c,"hasRetryTokens");return Object.freeze({hasRetryTokens:u,retrieveRetryTokens:o(b=>{if(!u(b))throw new Error("No retry token available");let w=d(b);return c-=w,w},"retrieveRetryTokens"),releaseRetryTokens:o(b=>{c+=b??s,c=Math.min(c,r)},"releaseRetryTokens")})},"getDefaultRetryQuota"),Xe=o((t,e)=>Math.floor(Math.min(z,Math.random()*2**e*t)),"defaultDelayDecider"),Qe=o(t=>t?ie(t)||Ce(t)||C(t)||F(t):!1,"defaultRetryDecider"),V=class{static{o(this,"StandardRetryStrategy")}maxAttemptsProvider;retryDecider;delayDecider;retryQuota;mode=v.STANDARD;constructor(e,r){this.maxAttemptsProvider=e,this.retryDecider=r?.retryDecider??Qe,this.delayDecider=r?.delayDecider??Xe,this.retryQuota=r?.retryQuota??vr(W)}shouldRetry(e,r,s){return r<s&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)}async getMaxAttempts(){let e;try{e=await this.maxAttemptsProvider()}catch{e=P}return e}async retry(e,r,s){let n,a=0,c=0,d=await this.getMaxAttempts(),{request:u}=r;for(G.isInstance(u)&&(u.headers[Y]=Ne());;)try{G.isInstance(u)&&(u.headers[j]=`attempt=${a+1}; max=${d}`),s?.beforeRequest&&await s.beforeRequest();let{response:l,output:p}=await e(r);return s?.afterRequest&&s.afterRequest(l),this.retryQuota.releaseRetryTokens(n),p.$metadata.attempts=a+1,p.$metadata.totalRetryDelay=c,{response:l,output:p}}catch(l){let p=Ve(l);if(a++,this.shouldRetry(p,a,d)){n=this.retryQuota.retrieveRetryTokens(p);let b=this.delayDecider(C(p)?He:qe,a),w=Mr(p.$response),A=Math.max(w||0,b);c+=A,await new Promise(R=>setTimeout(R,A));continue}throw p.$metadata||(p.$metadata={}),p.$metadata.attempts=a,p.$metadata.totalRetryDelay=c,p}}},Mr=o(t=>{if(!De.isInstance(t))return;let e=Object.keys(t.headers).find(a=>a.toLowerCase()==="retry-after");if(!e)return;let r=t.headers[e],s=Number(r);if(!Number.isNaN(s))return Math.min(s*1e3,2e4);let n=new Date(r);return Math.min(n.getTime()-Date.now(),2e4)},"getDelayFromRetryAfterHeader"),te=class extends V{static{o(this,"AdaptiveRetryStrategy")}rateLimiter;constructor(e,r){let{rateLimiter:s,...n}=r??{};super(e,n),this.rateLimiter=s??new N,this.mode=v.ADAPTIVE}async retry(e,r){return super.retry(e,r,{beforeRequest:o(async()=>this.rateLimiter.getSendToken(),"beforeRequest"),afterRequest:o(s=>{this.rateLimiter.updateClientSendingRate(s)},"afterRequest")})}},re="AWS_MAX_ATTEMPTS",se="max_attempts",Or={environmentVariableSelector:o(t=>{let e=t[re];if(!e)return;let r=parseInt(e);if(Number.isNaN(r))throw new Error(`Environment variable ${re} mast be a number, got "${e}"`);return r},"environmentVariableSelector"),configFileSelector:o(t=>{let e=t[se];if(!e)return;let r=parseInt(e);if(Number.isNaN(r))throw new Error(`Shared config file entry ${se} mast be a number, got "${e}"`);return r},"configFileSelector"),default:P},Pr=o((t,e)=>{let{retryStrategy:r,retryMode:s}=t,{defaultMaxAttempts:n=P,defaultBaseDelay:a=E.delay()}=e??{},c=Ie(t.maxAttempts??n),d=r?Promise.resolve(r):void 0,u=o(async()=>{let l=await c();return await Ie(s)()===v.ADAPTIVE?new Ke(c,{maxAttempts:l,baseDelay:a}):new x({maxAttempts:l,baseDelay:a})},"getDefault");return Object.assign(t,{maxAttempts:c,retryStrategy:o(()=>d??=u(),"retryStrategy")})},"resolveRetryConfig"),Je="AWS_RETRY_MODE",Ze="retry_mode",kr={environmentVariableSelector:o(t=>t[Je],"environmentVariableSelector"),configFileSelector:o(t=>t[Ze],"configFileSelector"),default:je},et=o(()=>t=>async e=>{let{request:r}=e;return G.isInstance(r)&&(delete r.headers[Y],delete r.headers[j]),t(e)},"omitRetryHeadersMiddleware"),tt={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},Ir=o(t=>({applyToStack:o(e=>{e.addRelativeTo(et(),tt)},"applyToStack")}),"getOmitRetryHeadersPlugin"),Dr=ze(xe),Nr=_r(xe);m.AdaptiveRetryStrategy=Ke;m.CONFIG_MAX_ATTEMPTS=se;m.CONFIG_RETRY_MODE=Ze;m.ConfiguredRetryStrategy=ee;m.DEFAULT_MAX_ATTEMPTS=P;m.DEFAULT_RETRY_DELAY_BASE=qe;m.DEFAULT_RETRY_MODE=je;m.DefaultRateLimiter=N;m.DeprecatedAdaptiveRetryStrategy=te;m.DeprecatedStandardRetryStrategy=V;m.ENV_MAX_ATTEMPTS=re;m.ENV_RETRY_MODE=Je;m.INITIAL_RETRY_TOKENS=W;m.INVOCATION_ID_HEADER=Y;m.MAXIMUM_RETRY_DELAY=z;m.NODE_MAX_ATTEMPT_CONFIG_OPTIONS=Or;m.NODE_RETRY_MODE_CONFIG_OPTIONS=kr;m.NO_RETRY_INCREMENT=ne;m.REQUEST_HEADER=j;m.RETRY_COST=Ge;m.RETRY_MODES=v;m.Retry=E;m.StandardRetryStrategy=x;m.THROTTLING_RETRY_DELAY_BASE=He;m.TIMEOUT_RETRY_COST=We;m.defaultDelayDecider=Xe;m.defaultRetryDecider=Qe;m.getOmitRetryHeadersPlugin=Ir;m.getRetryAfterHint=Ar;m.getRetryPlugin=Nr;m.isBrowserNetworkError=Be;m.isClockSkewCorrectedError=Fe;m.isClockSkewError=Ce;m.isNodeJsHttp2TransientError=Ue;m.isRetryableByTrait=ie;m.isServerError=Le;m.isThrottlingError=C;m.isTransientError=F;m.omitRetryHeadersMiddleware=et;m.omitRetryHeadersMiddlewareOptions=tt;m.resolveRetryConfig=Pr;m.retryMiddleware=Dr;m.retryMiddlewareOptions=Ye});var lt=U(y=>{var{getSmithyContext:ue,hasOwn:xr}=Oe();y.getSmithyContext=ue;var{HttpRequest:le}=q(),{requestBuilder:Cr}=q();y.requestBuilder=Cr;var{HttpApiKeyAuthLocation:st}=(ar(),Me(or)),Fr=o((t,e)=>{if(!e||e.length===0)return t;let r=[];for(let s of e)for(let n of t)n.schemeId.split("#")[1]===s&&r.push(n);for(let s of t)r.find(({schemeId:n})=>n===s.schemeId)||r.push(s);return r},"resolveAuthOptions");function Br(t){let e=new Map;for(let r of t)e.set(r.schemeId,r);return e}o(Br,"convertHttpAuthSchemesToMap");var pe=o((t,e)=>(r,s)=>async n=>{let a=t.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(t,s,n.input)),c=t.authSchemePreference?await t.authSchemePreference():[],d=Fr(a,c),u=Br(t.httpAuthSchemes),l=ue(s),p=[];for(let b of d){let w=u.get(b.schemeId);if(!w){p.push(`HttpAuthScheme \`${b.schemeId}\` was not enabled for this service.`);continue}let A=w.identityProvider(await e.identityProviderConfigProvider(t));if(!A){p.push(`HttpAuthScheme \`${b.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:R={},signingProperties:D={}}=b.propertiesExtractor?.(t,s)||{};b.identityProperties=Object.assign(b.identityProperties||{},R),b.signingProperties=Object.assign(b.signingProperties||{},D),l.selectedHttpAuthScheme={httpAuthOption:b,identity:await A(b.identityProperties),signer:w.signer};break}if(!l.selectedHttpAuthScheme)throw new Error(p.join(`
19
+ `));return r(n)},"httpAuthSchemeMiddleware"),it={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},Lr=o((t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r})=>({applyToStack:o(s=>{s.addRelativeTo(pe(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r}),it)},"applyToStack")}),"getHttpAuthSchemeEndpointRuleSetPlugin"),nt={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},Ur=o((t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r})=>({applyToStack:o(s=>{s.addRelativeTo(pe(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r}),nt)},"applyToStack")}),"getHttpAuthSchemePlugin"),qr=o(t=>e=>{throw e},"defaultErrorHandler"),Hr=o((t,e)=>{},"defaultSuccessHandler"),ot=o(t=>(e,r)=>async s=>{if(!le.isInstance(s.request))return e(s);let a=ue(r).selectedHttpAuthScheme;if(!a)throw new Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:c={}},identity:d,signer:u}=a,l=await e({...s,request:await u.sign(s.request,d,c)}).catch((u.errorHandler||qr)(c));return(u.successHandler||Hr)(l.response,c),l},"httpSigningMiddleware"),at={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},Gr=o(t=>({applyToStack:o(e=>{e.addRelativeTo(ot(),at)},"applyToStack")}),"getHttpSigningPlugin"),Wr=o(t=>{if(typeof t=="function")return t;let e=Promise.resolve(t);return()=>e},"normalizeProvider"),$r=o(async(t,e,r,s=a=>a,...n)=>{let a=new t(r);return a=s(a)??a,await e.send(a,...n)},"makePagedClientRequest");function Vr(t,e,r,s,n){return o(async function*(c,d,...u){let l=d,p=c.startingToken??l[r],b=!0,w;for(;b;){if(l[r]=p,n&&(l[n]=l[n]??c.pageSize),c.client instanceof t)w=await $r(e,c.client,d,c.withCommand,...u);else throw new Error(`Invalid client, expected instance of ${t.name}`);yield w;let A=p;p=zr(w,s),b=!!(p&&(!c.stopOnSameToken||p!==A))}return void 0},"paginateOperation")}o(Vr,"createPaginator");var zr=o((t,e)=>{let r=t,s=e.split(".");for(let n of s){if(!r||typeof r!="object")return;r=r[n]}return r},"get");function Yr(t,e,r){t.__smithy_context?t.__smithy_context.features||(t.__smithy_context.features={}):t.__smithy_context={features:{}},t.__smithy_context.features[e]=r}o(Yr,"setFeature");var oe=class{static{o(this,"DefaultIdentityProviderConfig")}authSchemes=new Map;constructor(e){for(let r in e){if(!xr(e,r))continue;let s=e[r];s!==void 0&&this.authSchemes.set(r,s)}}getIdentityProvider(e){return this.authSchemes.get(e)}},ae=class{static{o(this,"HttpApiKeyAuthSigner")}async sign(e,r,s){if(!s)throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!s.name)throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!s.in)throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!r.apiKey)throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");let n=le.clone(e);if(s.in===st.QUERY)n.query[s.name]=r.apiKey;else if(s.in===st.HEADER)n.headers[s.name]=s.scheme?`${s.scheme} ${r.apiKey}`:r.apiKey;else throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+s.in+"`");return n}},ce=class{static{o(this,"HttpBearerAuthSigner")}async sign(e,r,s){let n=le.clone(e);if(!r.token)throw new Error("request could not be signed with `token` since the `token` is not defined");return n.headers.Authorization=`Bearer ${r.token}`,n}},de=class{static{o(this,"NoAuthSigner")}async sign(e,r,s){return e}},ct=o(t=>o(function(r){return ut(r)&&r.expiration.getTime()-Date.now()<t},"isIdentityExpired"),"createIsIdentityExpiredFunction"),dt=3e5,jr=ct(dt),ut=o(t=>t.expiration!==void 0,"doesIdentityRequireRefresh"),Kr=o((t,e,r)=>{if(t===void 0)return;let s=typeof t!="function"?async()=>Promise.resolve(t):t,n,a,c,d=!1,u=o(async l=>{a||(a=s(l));try{n=await a,c=!0,d=!1}finally{a=void 0}return n},"coalesceProvider");return e===void 0?async l=>((!c||l?.forceRefresh)&&(n=await u(l)),n):async l=>((!c||l?.forceRefresh)&&(n=await u(l)),d?n:r(n)?(e(n)&&await u(l),n):(d=!0,n))},"memoizeIdentityProvider");y.DefaultIdentityProviderConfig=oe;y.EXPIRATION_MS=dt;y.HttpApiKeyAuthSigner=ae;y.HttpBearerAuthSigner=ce;y.NoAuthSigner=de;y.createIsIdentityExpiredFunction=ct;y.createPaginator=Vr;y.doesIdentityRequireRefresh=ut;y.getHttpAuthSchemeEndpointRuleSetPlugin=Lr;y.getHttpAuthSchemePlugin=Ur;y.getHttpSigningPlugin=Gr;y.httpAuthSchemeEndpointRuleSetMiddlewareOptions=it;y.httpAuthSchemeMiddleware=pe;y.httpAuthSchemeMiddlewareOptions=nt;y.httpSigningMiddleware=ot;y.httpSigningMiddlewareOptions=at;y.isIdentityExpired=jr;y.memoizeIdentityProvider=Kr;y.normalizeProvider=Wr;y.setFeature=Yr});var pt=U(L=>{"use strict";var O={REQUEST_ID:Symbol.for("_AWS_LAMBDA_REQUEST_ID"),X_RAY_TRACE_ID:Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),TENANT_ID:Symbol.for("_AWS_LAMBDA_TENANT_ID"),TRACEPARENT:Symbol.for("_AWS_LAMBDA_TRACEPARENT"),TRACESTATE:Symbol.for("_AWS_LAMBDA_TRACESTATE"),BAGGAGE:Symbol.for("_AWS_LAMBDA_BAGGAGE")},he=["true","1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??"");he||(globalThis.awslambda=globalThis.awslambda||{});var B=class{static{o(this,"InvokeStoreBase")}static PROTECTED_KEYS=O;isProtectedKey(e){return Object.values(O).includes(e)}getRequestId(){return this.get(O.REQUEST_ID)??"-"}getXRayTraceId(){return this.get(O.X_RAY_TRACE_ID)}getTenantId(){return this.get(O.TENANT_ID)}getTraceparent(){return this.get(O.TRACEPARENT)}getTracestate(){return this.get(O.TRACESTATE)}getBaggage(){return this.get(O.BAGGAGE)}},fe=class extends B{static{o(this,"InvokeStoreSingle")}currentContext;getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(e){return this.currentContext?.[e]}set(e,r){if(this.isProtectedKey(e))throw new Error(`Cannot modify protected Lambda context field: ${String(e)}`);this.currentContext=this.currentContext||{},this.currentContext[e]=r}run(e,r){return this.currentContext=e,r()}},ge=class t extends B{static{o(this,"InvokeStoreMulti")}als;static async create(){let e=new t,r=await import("node:async_hooks");return e.als=new r.AsyncLocalStorage,e}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(e){return this.als.getStore()?.[e]}set(e,r){if(this.isProtectedKey(e))throw new Error(`Cannot modify protected Lambda context field: ${String(e)}`);let s=this.als.getStore();if(!s)throw new Error("No context available");s[e]=r}run(e,r){return this.als.run(e,r)}};L.InvokeStore=void 0;(function(t){let e=null;async function r(s){return e||(e=(async()=>{let a=s===!0||"AWS_LAMBDA_MAX_CONCURRENCY"in process.env?await ge.create():new fe;return!he&&globalThis.awslambda?.InvokeStore?globalThis.awslambda.InvokeStore:(!he&&globalThis.awslambda&&(globalThis.awslambda.InvokeStore=a),a)})()),e}o(r,"getInstanceAsync"),t.getInstanceAsync=r,t._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE==="1"?{reset:o(()=>{e=null,globalThis.awslambda?.InvokeStore&&delete globalThis.awslambda.InvokeStore,globalThis.awslambda={InvokeStore:void 0}},"reset")}:void 0})(L.InvokeStore||(L.InvokeStore={}));L.InvokeStoreBase=B});var ht,K,h,S,T,k=M(()=>{ht={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",Brave:"brave",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",DuckDuckGo:"duckduckgo",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Linespider:"linespider",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SlackBot:"slackbot",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},K={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",brave:"Brave",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",duckduckgo:"DuckDuckGo",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",linespider:"Linespider",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",slackbot:"SlackBot",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},h={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},S={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},T={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"}});var i,I=M(()=>{k();i=class t{static{o(this,"Utils")}static getFirstMatch(e,r){let s=r.match(e);return s&&s.length>0&&s[1]||""}static getSecondMatch(e,r){let s=r.match(e);return s&&s.length>1&&s[2]||""}static matchAndReturnConst(e,r,s){if(e.test(r))return s}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){let r=e.split(".").splice(0,2).map(a=>parseInt(a,10)||0);r.push(0);let s=r[0],n=r[1];if(s===10)switch(n){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(s){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}}static getAndroidVersionName(e){let r=e.split(".").splice(0,2).map(s=>parseInt(s,10)||0);if(r.push(0),!(r[0]===1&&r[1]<5)){if(r[0]===1&&r[1]<6)return"Cupcake";if(r[0]===1&&r[1]>=6)return"Donut";if(r[0]===2&&r[1]<2)return"Eclair";if(r[0]===2&&r[1]===2)return"Froyo";if(r[0]===2&&r[1]>2)return"Gingerbread";if(r[0]===3)return"Honeycomb";if(r[0]===4&&r[1]<1)return"Ice Cream Sandwich";if(r[0]===4&&r[1]<4)return"Jelly Bean";if(r[0]===4&&r[1]>=4)return"KitKat";if(r[0]===5)return"Lollipop";if(r[0]===6)return"Marshmallow";if(r[0]===7)return"Nougat";if(r[0]===8)return"Oreo";if(r[0]===9)return"Pie"}}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,r,s=!1){let n=t.getVersionPrecision(e),a=t.getVersionPrecision(r),c=Math.max(n,a),d=0,u=t.map([e,r],l=>{let p=c-t.getVersionPrecision(l),b=l+new Array(p+1).join(".0");return t.map(b.split("."),w=>new Array(20-w.length).join("0")+w).reverse()});for(s&&(d=c-Math.min(n,a)),c-=1;c>=d;){if(u[0][c]>u[1][c])return 1;if(u[0][c]===u[1][c]){if(c===d)return 0;c-=1}else if(u[0][c]<u[1][c])return-1}}static map(e,r){let s=[],n;if(Array.prototype.map)return Array.prototype.map.call(e,r);for(n=0;n<e.length;n+=1)s.push(r(e[n]));return s}static find(e,r){let s,n;if(Array.prototype.find)return Array.prototype.find.call(e,r);for(s=0,n=e.length;s<n;s+=1){let a=e[s];if(r(a,s))return a}}static assign(e,...r){let s=e,n,a;if(Object.assign)return Object.assign(e,...r);for(n=0,a=r.length;n<a;n+=1){let c=r[n];typeof c=="object"&&c!==null&&Object.keys(c).forEach(u=>{s[u]=c[u]})}return e}static getBrowserAlias(e){return ht[e]}static getBrowserTypeByAlias(e){return K[e]||""}}});var g,Xr,ft,gt=M(()=>{I();g=/version\/(\d+(\.?_?\d+)+)/i,Xr=[{test:[/gptbot/i],describe(t){let e={name:"GPTBot"},r=i.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/chatgpt-user/i],describe(t){let e={name:"ChatGPT-User"},r=i.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/oai-searchbot/i],describe(t){let e={name:"OAI-SearchBot"},r=i.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe(t){let e={name:"ClaudeBot"},r=i.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/omgilibot/i,/webzio-extended/i],describe(t){let e={name:"Omgilibot"},r=i.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/diffbot/i],describe(t){let e={name:"Diffbot"},r=i.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/perplexitybot/i],describe(t){let e={name:"PerplexityBot"},r=i.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/perplexity-user/i],describe(t){let e={name:"Perplexity-User"},r=i.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/youbot/i],describe(t){let e={name:"YouBot"},r=i.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/meta-webindexer/i],describe(t){let e={name:"Meta-WebIndexer"},r=i.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/meta-externalads/i],describe(t){let e={name:"Meta-ExternalAds"},r=i.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/meta-externalagent/i],describe(t){let e={name:"Meta-ExternalAgent"},r=i.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/meta-externalfetcher/i],describe(t){let e={name:"Meta-ExternalFetcher"},r=i.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/googlebot/i],describe(t){let e={name:"Googlebot"},r=i.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/linespider/i],describe(t){let e={name:"Linespider"},r=i.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/amazonbot/i],describe(t){let e={name:"AmazonBot"},r=i.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/bingbot/i],describe(t){let e={name:"BingCrawler"},r=i.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/baiduspider/i],describe(t){let e={name:"BaiduSpider"},r=i.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/duckduckbot/i],describe(t){let e={name:"DuckDuckBot"},r=i.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/ia_archiver/i],describe(t){let e={name:"InternetArchiveCrawler"},r=i.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe(){return{name:"FacebookExternalHit"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe(t){let e={name:"SlackBot"},r=i.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/yahoo!?[\s/]*slurp/i],describe(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe(){return{name:"PingdomBot"}}},{test:[/opera/i],describe(t){let e={name:"Opera"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/opr\/|opios/i],describe(t){let e={name:"Opera"},r=i.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/SamsungBrowser/i],describe(t){let e={name:"Samsung Internet for Android"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/Whale/i],describe(t){let e={name:"NAVER Whale Browser"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/PaleMoon/i],describe(t){let e={name:"Pale Moon"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/MZBrowser/i],describe(t){let e={name:"MZ Browser"},r=i.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/focus/i],describe(t){let e={name:"Focus"},r=i.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/swing/i],describe(t){let e={name:"Swing"},r=i.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/coast/i],describe(t){let e={name:"Opera Coast"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(t){let e={name:"Opera Touch"},r=i.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/yabrowser/i],describe(t){let e={name:"Yandex Browser"},r=i.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/ucbrowser/i],describe(t){let e={name:"UC Browser"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/Maxthon|mxios/i],describe(t){let e={name:"Maxthon"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/epiphany/i],describe(t){let e={name:"Epiphany"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/puffin/i],describe(t){let e={name:"Puffin"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/sleipnir/i],describe(t){let e={name:"Sleipnir"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/k-meleon/i],describe(t){let e={name:"K-Meleon"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/micromessenger/i],describe(t){let e={name:"WeChat"},r=i.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/qqbrowser/i],describe(t){let e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},r=i.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/msie|trident/i],describe(t){let e={name:"Internet Explorer"},r=i.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/\sedg\//i],describe(t){let e={name:"Microsoft Edge"},r=i.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/edg([ea]|ios)/i],describe(t){let e={name:"Microsoft Edge"},r=i.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/vivaldi/i],describe(t){let e={name:"Vivaldi"},r=i.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/seamonkey/i],describe(t){let e={name:"SeaMonkey"},r=i.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/sailfish/i],describe(t){let e={name:"Sailfish"},r=i.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return r&&(e.version=r),e}},{test:[/silk/i],describe(t){let e={name:"Amazon Silk"},r=i.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/phantom/i],describe(t){let e={name:"PhantomJS"},r=i.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/slimerjs/i],describe(t){let e={name:"SlimerJS"},r=i.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){let e={name:"BlackBerry"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/(web|hpw)[o0]s/i],describe(t){let e={name:"WebOS Browser"},r=i.getFirstMatch(g,t)||i.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/bada/i],describe(t){let e={name:"Bada"},r=i.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/tizen/i],describe(t){let e={name:"Tizen"},r=i.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/qupzilla/i],describe(t){let e={name:"QupZilla"},r=i.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/librewolf/i],describe(t){let e={name:"LibreWolf"},r=i.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/firefox|iceweasel|fxios/i],describe(t){let e={name:"Firefox"},r=i.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/electron/i],describe(t){let e={name:"Electron"},r=i.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe(t){let e={name:"Sogou Browser"},r=i.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,t),s=i.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t),n=i.getFirstMatch(/se ([\d.]+)x/i,t),a=r||s||n;return a&&(e.version=a),e}},{test:[/MiuiBrowser/i],describe(t){let e={name:"Miui"},r=i.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test(t){return t.hasBrand("DuckDuckGo")?!0:t.test(/\sDdg\/[\d.]+$/i)},describe(t,e){let r={name:"DuckDuckGo"};if(e){let n=e.getBrandVersion("DuckDuckGo");if(n)return r.version=n,r}let s=i.getFirstMatch(/\sDdg\/([\d.]+)$/i,t);return s&&(r.version=s),r}},{test(t){return t.hasBrand("Brave")},describe(t,e){let r={name:"Brave"};if(e){let s=e.getBrandVersion("Brave");if(s)return r.version=s,r}return r}},{test:[/chromium/i],describe(t){let e={name:"Chromium"},r=i.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/chrome|crios|crmo/i],describe(t){let e={name:"Chrome"},r=i.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/GSA/i],describe(t){let e={name:"Google Search"},r=i.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test(t){let e=!t.test(/like android/i),r=t.test(/android/i);return e&&r},describe(t){let e={name:"Android Browser"},r=i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/playstation 4/i],describe(t){let e={name:"PlayStation 4"},r=i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/safari|applewebkit/i],describe(t){let e={name:"Safari"},r=i.getFirstMatch(g,t);return r&&(e.version=r),e}},{test:[/.*/i],describe(t){let e=/^(.*)\/(.*) /,r=/^(.*)\/(.*)[ \t]\((.*)/,n=t.search("\\(")!==-1?r:e;return{name:i.getFirstMatch(n,t),version:i.getSecondMatch(n,t)}}}],ft=Xr});var mt,bt=M(()=>{I();k();mt=[{test:[/Roku\/DVP/],describe(t){let e=i.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:S.Roku,version:e}}},{test:[/windows phone/i],describe(t){let e=i.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:S.WindowsPhone,version:e}}},{test:[/windows /i],describe(t){let e=i.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),r=i.getWindowsVersionName(e);return{name:S.Windows,version:e,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(t){let e={name:S.iOS},r=i.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return r&&(e.version=r),e}},{test:[/macintosh/i],describe(t){let e=i.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),r=i.getMacOSVersionName(e),s={name:S.MacOS,version:e};return r&&(s.versionName=r),s}},{test:[/(ipod|iphone|ipad)/i],describe(t){let e=i.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:S.iOS,version:e}}},{test:[/OpenHarmony/i],describe(t){let e=i.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,t);return{name:S.HarmonyOS,version:e}}},{test(t){let e=!t.test(/like android/i),r=t.test(/android/i);return e&&r},describe(t){let e=i.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),r=i.getAndroidVersionName(e),s={name:S.Android,version:e};return r&&(s.versionName=r),s}},{test:[/(web|hpw)[o0]s/i],describe(t){let e=i.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),r={name:S.WebOS};return e&&e.length&&(r.version=e),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){let e=i.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||i.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||i.getFirstMatch(/\bbb(\d+)/i,t);return{name:S.BlackBerry,version:e}}},{test:[/bada/i],describe(t){let e=i.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:S.Bada,version:e}}},{test:[/tizen/i],describe(t){let e=i.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:S.Tizen,version:e}}},{test:[/linux/i],describe(){return{name:S.Linux}}},{test:[/CrOS/],describe(){return{name:S.ChromeOS}}},{test:[/PlayStation 4/],describe(t){let e=i.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:S.PlayStation4,version:e}}}]});var wt,yt=M(()=>{I();k();wt=[{test:[/googlebot/i],describe(){return{type:h.bot,vendor:"Google"}}},{test:[/linespider/i],describe(){return{type:h.bot,vendor:"Line"}}},{test:[/amazonbot/i],describe(){return{type:h.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe(){return{type:h.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe(){return{type:h.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe(){return{type:h.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe(){return{type:h.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe(){return{type:h.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe(){return{type:h.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe(){return{type:h.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe(){return{type:h.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe(){return{type:h.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe(){return{type:h.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe(){return{type:h.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe(){return{type:h.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe(){return{type:h.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe(){return{type:h.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe(){return{type:h.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe(){return{type:h.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe(){return{type:h.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe(){return{type:h.bot,vendor:"Meta"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe(){return{type:h.bot,vendor:"Slack"}}},{test:[/yahoo/i],describe(){return{type:h.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe(){return{type:h.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe(){return{type:h.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe(t){let e=i.getFirstMatch(/(can-l01)/i,t)&&"Nova",r={type:h.mobile,vendor:"Huawei"};return e&&(r.model=e),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:h.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:h.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:h.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:h.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:h.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:h.tablet}}},{test(t){let e=t.test(/ipod|iphone/i),r=t.test(/like (ipod|iphone)/i);return e&&!r},describe(t){let e=i.getFirstMatch(/(ipod|iphone)/i,t);return{type:h.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:h.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe(t){let e=i.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,t),r={type:h.mobile,vendor:"Nokia"};return e&&(r.model=e),r}},{test:[/[^-]mobi/i],describe(){return{type:h.mobile}}},{test(t){return t.getBrowserName(!0)==="blackberry"},describe(){return{type:h.mobile,vendor:"BlackBerry"}}},{test(t){return t.getBrowserName(!0)==="bada"},describe(){return{type:h.mobile}}},{test(t){return t.getBrowserName()==="windows phone"},describe(){return{type:h.mobile,vendor:"Microsoft"}}},{test(t){let e=Number(String(t.getOSVersion()).split(".")[0]);return t.getOSName(!0)==="android"&&e>=3},describe(){return{type:h.tablet}}},{test(t){return t.getOSName(!0)==="android"},describe(){return{type:h.mobile}}},{test:[/smart-?tv|smarttv/i],describe(){return{type:h.tv}}},{test:[/netcast/i],describe(){return{type:h.tv}}},{test(t){return t.getOSName(!0)==="macos"},describe(){return{type:h.desktop,vendor:"Apple"}}},{test(t){return t.getOSName(!0)==="windows"},describe(){return{type:h.desktop}}},{test(t){return t.getOSName(!0)==="linux"},describe(){return{type:h.desktop}}},{test(t){return t.getOSName(!0)==="playstation 4"},describe(){return{type:h.tv}}},{test(t){return t.getOSName(!0)==="roku"},describe(){return{type:h.tv}}}]});var At,St=M(()=>{I();k();At=[{test(t){return t.getBrowserName(!0)==="microsoft edge"},describe(t){if(/\sedg\//i.test(t))return{name:T.Blink};let r=i.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:T.EdgeHTML,version:r}}},{test:[/trident/i],describe(t){let e={name:T.Trident},r=i.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test(t){return t.test(/presto/i)},describe(t){let e={name:T.Presto},r=i.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test(t){let e=t.test(/gecko/i),r=t.test(/like gecko/i);return e&&!r},describe(t){let e={name:T.Gecko},r=i.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:T.Blink}}},{test:[/(apple)?webkit/i],describe(t){let e={name:T.WebKit},r=i.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return r&&(e.version=r),e}}]});var me,be,Et=M(()=>{gt();bt();yt();St();I();me=class{static{o(this,"Parser")}constructor(e,r=!1,s=null){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e;let n=!1;typeof r=="boolean"?(n=r,this._hints=s):r!=null&&typeof r=="object"?this._hints=r:this._hints=null,this.parsedResult={},n!==!0&&this.parse()}getHints(){return this._hints}hasBrand(e){if(!this._hints||!Array.isArray(this._hints.brands))return!1;let r=e.toLowerCase();return this._hints.brands.some(s=>s.brand&&s.brand.toLowerCase()===r)}getBrandVersion(e){if(!this._hints||!Array.isArray(this._hints.brands))return;let r=e.toLowerCase(),s=this._hints.brands.find(n=>n.brand&&n.brand.toLowerCase()===r);return s?s.version:void 0}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};let e=i.find(ft,r=>{if(typeof r.test=="function")return r.test(this);if(Array.isArray(r.test))return r.test.some(s=>this.test(s));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA(),this)),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};let e=i.find(mt,r=>{if(typeof r.test=="function")return r.test(this);if(Array.isArray(r.test))return r.test.some(s=>this.test(s));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){let{name:r}=this.getOS();return e?String(r).toLowerCase()||"":r||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){let{type:r}=this.getPlatform();return e?String(r).toLowerCase()||"":r||""}parsePlatform(){this.parsedResult.platform={};let e=i.find(wt,r=>{if(typeof r.test=="function")return r.test(this);if(Array.isArray(r.test))return r.test.some(s=>this.test(s));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};let e=i.find(At,r=>{if(typeof r.test=="function")return r.test(this);if(Array.isArray(r.test))return r.test.some(s=>this.test(s));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return i.assign({},this.parsedResult)}satisfies(e){let r={},s=0,n={},a=0;if(Object.keys(e).forEach(d=>{let u=e[d];typeof u=="string"?(n[d]=u,a+=1):typeof u=="object"&&(r[d]=u,s+=1)}),s>0){let d=Object.keys(r),u=i.find(d,p=>this.isOS(p));if(u){let p=this.satisfies(r[u]);if(p!==void 0)return p}let l=i.find(d,p=>this.isPlatform(p));if(l){let p=this.satisfies(r[l]);if(p!==void 0)return p}}if(a>0){let d=Object.keys(n),u=i.find(d,l=>this.isBrowser(l,!0));if(u!==void 0)return this.compareVersion(n[u])}}isBrowser(e,r=!1){let s=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),a=i.getBrowserTypeByAlias(n);return r&&a&&(n=a.toLowerCase()),n===s}compareVersion(e){let r=[0],s=e,n=!1,a=this.getBrowserVersion();if(typeof a=="string")return e[0]===">"||e[0]==="<"?(s=e.substr(1),e[1]==="="?(n=!0,s=e.substr(2)):r=[],e[0]===">"?r.push(1):r.push(-1)):e[0]==="="?s=e.substr(1):e[0]==="~"&&(n=!0,s=e.substr(1)),r.indexOf(i.compareVersions(a,s,n))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,r=!1){return this.isBrowser(e,r)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(r=>this.is(r))}},be=me});var Rt={};nr(Rt,{default:()=>Qr});var we,Qr,Tt=M(()=>{Et();k();we=class{static{o(this,"Bowser")}static getParser(e,r=!1,s=null){if(typeof e!="string")throw new Error("UserAgent should be a string");return new be(e,r,s)}static parse(e,r=null){return new be(e,r).getResult()}static get BROWSER_MAP(){return K}static get ENGINE_MAP(){return T}static get OS_MAP(){return S}static get PLATFORMS_MAP(){return h}},Qr=we});var zs=U(f=>{var{Retry:Jr,RETRY_MODES:_t}=rt(),{HttpRequest:Te,parseUrl:Zr}=q(),{InvokeStore:vt}=pt(),{normalizeProvider:es}=lt(),{platform:ts,release:rs}=J("node:os"),{versions:ye,env:Mt}=J("node:process"),{isValidHostLabel:ss,isIpAddress:Dt,customEndpointFunctions:is}=ke(),{EndpointError:ns,resolveEndpoint:os}=ke();f.EndpointError=ns;f.isIpAddress=Dt;f.resolveEndpoint=os;var{loadConfig:as,NODE_REGION_CONFIG_OPTIONS:Nt,NODE_REGION_CONFIG_FILE_OPTIONS:xt}=Pe(),{REGION_ENV_NAME:cs,REGION_INI_NAME:ds,resolveRegionConfig:us}=Pe();f.NODE_REGION_CONFIG_FILE_OPTIONS=xt;f.NODE_REGION_CONFIG_OPTIONS=Nt;f.REGION_ENV_NAME=cs;f.REGION_INI_NAME=ds;f.resolveRegionConfig=us;var Q={warningEmitted:!1},ls=o(t=>{if(t&&!Q.warningEmitted){if(process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED==="true"){Q.warningEmitted=!0;return}let e=parseInt(t.substring(1,t.indexOf("."))),r=22;e<r&&(Q.warningEmitted=!0,process.emitWarning(`NodeVersionSupportWarning: The AWS SDK for JavaScript (v3)
20
+ versions published after the first week of January 2027
21
+ will require node >=${r}. You are running node ${t}.
22
+
23
+ To continue receiving updates to AWS services, bug fixes,
24
+ and security updates please upgrade to node >=${r}.
25
+
26
+ More information can be found at: https://a.co/c895JFp`))}},"emitWarningIfUnsupportedVersion"),ps=o(()=>(t,e)=>async r=>(e.__retryLongPoll=!0,t(r)),"longPollMiddleware"),hs={name:"longPollMiddleware",tags:["RETRY"],step:"initialize",override:!0},fs=o(t=>({applyToStack:o(e=>{e.add(ps(),hs)},"applyToStack")}),"getLongPollPlugin");function gs(t,e,r){return t.$source||(t.$source={}),t.$source[e]=r,t}o(gs,"setCredentialFeature");Jr.v2026||=typeof process=="object"&&process.env?.AWS_NEW_RETRIES_2026==="true";function _(t,e,r){t.__aws_sdk_context?t.__aws_sdk_context.features||(t.__aws_sdk_context.features={}):t.__aws_sdk_context={features:{}},t.__aws_sdk_context.features[e]=r}o(_,"setFeature");function ms(t,e,r){return t.$source||(t.$source={}),t.$source[e]=r,t}o(ms,"setTokenFeature");function bs(t){return t}o(bs,"resolveHostHeaderConfig");var Ct=o(t=>e=>async r=>{if(!Te.isInstance(r.request))return e(r);let{request:s}=r,{handlerProtocol:n=""}=t.requestHandler.metadata||{};if(n.indexOf("h2")>=0&&!s.headers[":authority"])delete s.headers.host,s.headers[":authority"]=s.hostname+(s.port?":"+s.port:"");else if(!s.headers.host){let a=s.hostname;s.port!=null&&(a+=`:${s.port}`),s.headers.host=a}return e(r)},"hostHeaderMiddleware"),Ft={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},ws=o(t=>({applyToStack:o(e=>{e.add(Ct(t),Ft)},"applyToStack")}),"getHostHeaderPlugin"),Bt=o(()=>(t,e)=>async r=>{try{let s=await t(r),{clientName:n,commandName:a,logger:c,dynamoDbDocumentClientOptions:d={}}=e,{overrideInputFilterSensitiveLog:u,overrideOutputFilterSensitiveLog:l}=d,p=u??e.inputFilterSensitiveLog,b=l??e.outputFilterSensitiveLog,{$metadata:w,...A}=s.output;return c?.info?.({clientName:n,commandName:a,input:p(r.input),output:b(A),metadata:w}),s}catch(s){let{clientName:n,commandName:a,logger:c,dynamoDbDocumentClientOptions:d={}}=e,{overrideInputFilterSensitiveLog:u}=d,l=u??e.inputFilterSensitiveLog;throw c?.error?.({clientName:n,commandName:a,input:l(r.input),error:s,metadata:s.$metadata}),s}},"loggerMiddleware"),Lt={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},ys=o(t=>({applyToStack:o(e=>{e.add(Bt(),Lt)},"applyToStack")}),"getLoggerPlugin"),Ut={step:"build",tags:["RECURSION_DETECTION","TRACE_CONTEXT_PROPAGATION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},As="AWS_LAMBDA_FUNCTION_NAME",Ss="_X_AMZN_TRACE_ID",Ae="X-Amzn-Trace-Id",Re="traceparent",qt="tracestate",Ht="baggage",Gt=o(()=>t=>async e=>{let{request:r}=e;if(!Te.isInstance(r))return t(e);let s;{let n=Object.keys(r.headers??{}).find(a=>a.toLowerCase()===Ae.toLowerCase())??Ae;if(!r.headers.hasOwnProperty(n)){let a=process.env[As],c=process.env[Ss];s??=await vt.getInstanceAsync();let u=s?.getXRayTraceId()??c,l=o(p=>typeof p=="string"&&p.length>0,"nonEmptyString");l(a)&&l(u)&&(r.headers[Ae]=u)}}if(Es(r.headers),!r.headers[Re]){let a=(s??=await vt.getInstanceAsync())?.getTraceparent?.();if(a){r.headers[Re]=a;let c=s?.getTracestate?.();c&&(r.headers[qt]=c);let d=s?.getBaggage?.();d&&(r.headers[Ht]=d)}}return t(e)},"recursionDetectionMiddleware");function Es(t){for(let e of Object.keys(t)){let r=e.toLowerCase();e!==r&&(r===Re||r===qt||r===Ht)&&(t[r]=t[e],delete t[e])}}o(Es,"sanitizeTraceHeaders");var Rs=o(t=>({applyToStack:o(e=>{e.add(Gt(),Ut)},"applyToStack")}),"getRecursionDetectionPlugin"),_e=void 0;function Ts(t){return t===void 0?!0:typeof t=="string"&&t.length<=50}o(Ts,"isValidUserAgentAppId");function _s(t){let e=es(t.userAgentAppId??_e),{customUserAgent:r}=t;return Object.assign(t,{customUserAgent:typeof r=="string"?[[r]]:r,userAgentAppId:o(async()=>{let s=await e();if(!Ts(s)){let n=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?console:t.logger;typeof s!="string"?n?.warn("userAgentAppId must be a string or undefined."):s.length>50&&n?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return s},"userAgentAppId")})}o(_s,"resolveUserAgentConfig");var Wt={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],version:"1.1"},$t=Wt,Vt="",zt=o(t=>{let{partitions:e}=$t;for(let s of e){let{regions:n,outputs:a}=s;for(let[c,d]of Object.entries(n))if(c===t)return{...a,...d}}for(let s of e){let{regionRegex:n,outputs:a}=s;if(new RegExp(n).test(t))return{...a}}let r=e.find(s=>s.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},"partition"),Yt=o((t,e="")=>{$t=t,Vt=e},"setPartitionInfo"),vs=o(()=>{Yt(Wt,"")},"useDefaultPartitionInfo"),jt=o(()=>Vt,"getUserAgentPrefix"),Ms=/\d{12}\.ddb/;async function Os(t,e,r){if(r.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&_(t,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){let a=await e.retryStrategy();if(typeof a.mode=="string")switch(a.mode){case _t.ADAPTIVE:_(t,"RETRY_MODE_ADAPTIVE","F");break;case _t.STANDARD:_(t,"RETRY_MODE_STANDARD","E");break}}if(typeof e.accountIdEndpointMode=="function"){let a=t.endpointV2;switch(String(a?.url?.hostname).match(Ms)&&_(t,"ACCOUNT_ID_ENDPOINT","O"),await e.accountIdEndpointMode?.()){case"disabled":_(t,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":_(t,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":_(t,"ACCOUNT_ID_MODE_REQUIRED","R");break}}let n=t.__smithy_context?.selectedHttpAuthScheme?.identity;if(n?.$source){let a=n;a.accountId&&_(t,"RESOLVED_ACCOUNT_ID","T");for(let[c,d]of Object.entries(a.$source??{}))_(t,c,d)}}o(Os,"checkFeatures");var Ot="user-agent",Se="x-amz-user-agent",Pt=" ",Ee="/",Ps=/[^!$%&'*+\-.^_`|~\w]/g,ks=/[^!$%&'*+\-.^_`|~\w#]/g,kt="-",Is=1024;function Ds(t){let e="";for(let r in t){let s=t[r];if(e.length+s.length+1<=Is){e.length?e+=","+s:e+=s;continue}break}return e}o(Ds,"encodeFeatures");var Kt=o(t=>(e,r)=>async s=>{let{request:n}=s;if(!Te.isInstance(n))return e(s);let{headers:a}=n,c=r?.userAgent?.map(X)||[],d=(await t.defaultUserAgentProvider()).map(X);await Os(r,t,s);let u=r;d.push(`m/${Ds(Object.assign({},r.__smithy_context?.features,u.__aws_sdk_context?.features))}`);let l=t?.customUserAgent?.map(X)||[],p=await t.userAgentAppId();p&&d.push(X(["app",`${p}`]));let b=jt(),w=(b?[b]:[]).concat([...d,...c,...l]).join(Pt),A=[...d.filter(R=>R.startsWith("aws-sdk-")),...l].join(Pt);return t.runtime!=="browser"?(A&&(a[Se]=a[Se]?`${a[Ot]} ${A}`:A),a[Ot]=w):a[Se]=w,e({...s,request:n})},"userAgentMiddleware"),X=o(t=>{let e=t[0].split(Ee).map(c=>c.replace(Ps,kt)).join(Ee),r=t[1]?.replace(ks,kt),s=e.indexOf(Ee),n=e.substring(0,s),a=e.substring(s+1);return n==="api"&&(a=a.toLowerCase()),[n,a,r].filter(c=>c&&c.length>0).reduce((c,d,u)=>{switch(u){case 0:return d;case 1:return`${c}/${d}`;default:return`${c}#${d}`}},"")},"escapeUserAgent"),Xt={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Ns=o(t=>({applyToStack:o(e=>{e.add(Kt(t),Xt)},"applyToStack")}),"getUserAgentPlugin"),xs=o(()=>{let t=["deno","bun","llrt"];for(let e of t)if(ye[e])return[`md/${e}`,ye[e]];return["md/nodejs",ye.node]},"getRuntimeUserAgentPair"),Qt={isCrtAvailable:!1},Cs=o(()=>Qt.isCrtAvailable?["md/crt-avail"]:null,"isCrtAvailable"),Jt=o(({serviceId:t,clientVersion:e})=>{let r=xs();return async s=>{let n=[["aws-sdk-js",e],["ua","2.1"],[`os/${ts()}`,rs()],["lang/js"],r],a=Cs();a&&n.push(a),t&&n.push([`api/${t}`,e]),Mt.AWS_EXECUTION_ENV&&n.push([`exec-env/${Mt.AWS_EXECUTION_ENV}`]);let c=await s?.userAgentAppId?.();return c?[...n,[`app/${c}`]]:[...n]}},"createDefaultUserAgentProvider"),Fs=Jt,Zt="AWS_SDK_UA_APP_ID",er="sdk_ua_app_id",Bs="sdk-ua-app-id",Ls={environmentVariableSelector:o(t=>t[Zt],"environmentVariableSelector"),configFileSelector:o(t=>t[er]??t[Bs],"configFileSelector"),default:_e},Us=o(({serviceId:t,clientVersion:e})=>async r=>{let s=(Tt(),Me(Rt)),n=s.parse??s.default.parse??(()=>""),a=typeof window<"u"&&window?.navigator?.userAgent?n(window.navigator.userAgent):void 0,c=[["aws-sdk-js",e],["ua","2.1"],[`os/${a?.os?.name||"other"}`,a?.os?.version],["lang/js"],["md/browser",`${a?.browser?.name??"unknown"}_${a?.browser?.version??"unknown"}`]];t&&c.push([`api/${t}`,e]);let d=await r?.userAgentAppId?.();return d&&c.push([`app/${d}`]),c},"createUserAgentStringParsingProvider"),qs={os(t){if(/iPhone|iPad|iPod/.test(t))return"iOS";if(/Macintosh|Mac OS X/.test(t))return"macOS";if(/Windows NT/.test(t))return"Windows";if(/Android/.test(t))return"Android";if(/Linux/.test(t))return"Linux"},browser(t){if(/EdgiOS|EdgA|Edg\//.test(t))return"Microsoft Edge";if(/Firefox\//.test(t))return"Firefox";if(/Chrome\//.test(t))return"Chrome";if(/Safari\//.test(t))return"Safari"}},ve=o((t,e=!1)=>{if(e){for(let r of t.split("."))if(!ve(r))return!1;return!0}return!(!ss(t)||t.length<3||t.length>63||t!==t.toLowerCase()||Dt(t))},"isVirtualHostableS3Bucket"),It=":",Hs="/",tr=o(t=>{let e=t.split(It);if(e.length<6)return null;let[r,s,n,a,c,...d]=e;if(r!=="arn"||s===""||n===""||d.join(It)==="")return null;let u=d.map(l=>l.split(Hs)).flat();return{partition:s,service:n,region:a,accountId:c,resourceId:u}},"parseArn"),rr={isVirtualHostableS3Bucket:ve,parseArn:tr,partition:zt};is.aws=rr;var Gs=o(t=>{if(typeof t.endpointProvider!="function")throw new Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client.");let{endpoint:e}=t;return e===void 0&&(t.endpoint=async()=>sr(t.endpointProvider({Region:typeof t.region=="function"?await t.region():t.region,UseDualStack:typeof t.useDualstackEndpoint=="function"?await t.useDualstackEndpoint():t.useDualstackEndpoint,UseFIPS:typeof t.useFipsEndpoint=="function"?await t.useFipsEndpoint():t.useFipsEndpoint,Endpoint:void 0},{logger:t.logger}))),t},"resolveDefaultAwsRegionalEndpointsConfig"),sr=o(t=>Zr(t.url),"toEndpointV1");function Ws(t={}){return as({...Nt,async default(){return ir.silence||console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."),"us-east-1"}},{...xt,...t})}o(Ws,"stsRegionDefaultResolver");var ir={silence:!1},$s=o(t=>({setRegion(e){t.region=e},region(){return t.region}}),"getAwsRegionExtensionConfiguration"),Vs=o(t=>({region:t.region()}),"resolveAwsRegionExtensionConfiguration");f.DEFAULT_UA_APP_ID=_e;f.NODE_APP_ID_CONFIG_OPTIONS=Ls;f.UA_APP_ID_ENV_NAME=Zt;f.UA_APP_ID_INI_NAME=er;f.awsEndpointFunctions=rr;f.createDefaultUserAgentProvider=Jt;f.createUserAgentStringParsingProvider=Us;f.crtAvailability=Qt;f.defaultUserAgent=Fs;f.emitWarningIfUnsupportedVersion=ls;f.fallback=qs;f.getAwsRegionExtensionConfiguration=$s;f.getHostHeaderPlugin=ws;f.getLoggerPlugin=ys;f.getLongPollPlugin=fs;f.getRecursionDetectionPlugin=Rs;f.getUserAgentMiddlewareOptions=Xt;f.getUserAgentPlugin=Ns;f.getUserAgentPrefix=jt;f.hostHeaderMiddleware=Ct;f.hostHeaderMiddlewareOptions=Ft;f.isVirtualHostableS3Bucket=ve;f.loggerMiddleware=Bt;f.loggerMiddlewareOptions=Lt;f.parseArn=tr;f.partition=zt;f.recursionDetectionMiddleware=Gt;f.recursionDetectionMiddlewareOptions=Ut;f.resolveAwsRegionExtensionConfiguration=Vs;f.resolveDefaultAwsRegionalEndpointsConfig=Gs;f.resolveHostHeaderConfig=bs;f.resolveUserAgentConfig=_s;f.setCredentialFeature=gs;f.setFeature=_;f.setPartitionInfo=Yt;f.setTokenFeature=ms;f.state=Q;f.stsRegionDefaultResolver=Ws;f.stsRegionWarning=ir;f.toEndpointV1=sr;f.useDefaultPartitionInfo=vs;f.userAgentMiddleware=Kt});export{rt as a,lt as b,zs as c};
27
+ /*! Bundled license information:
28
+
29
+ bowser/src/bowser.js:
30
+ (*!
31
+ * Bowser - a browser detector
32
+ * https://github.com/bowser-js/bowser
33
+ * MIT License | (c) Dustin Diaz 2012-2015
34
+ * MIT License | (c) Denis Demchenko 2015-2019
35
+ *)
36
+ */
@@ -0,0 +1,18 @@
1
+ // Built by esbuild from opencode-server source
2
+ if (typeof globalThis.Bun === 'undefined') {
3
+ globalThis.Bun = {
4
+ version: '0.0.0-node-compat',
5
+ stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
6
+ which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
7
+ };
8
+ }
9
+ if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
10
+ if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
11
+ import { createRequire as __alchemyCreateRequire } from 'node:module';
12
+ const require = __alchemyCreateRequire(import.meta.url);
13
+ import { fileURLToPath as __alchemyFileURLToPath } from 'node:url';
14
+ import { dirname as __alchemyDirname } from 'node:path';
15
+ const __alchemy_filename = __alchemyFileURLToPath(import.meta.url);
16
+ const __alchemy_dirname = __alchemyDirname(__alchemy_filename);
17
+
18
+ import{c as m}from"./chunk-OCWGUTZJ.js";import{f}from"./chunk-CYRZU5QM.js";import{a as t,g as a}from"./chunk-2MRHL4B2.js";var d=a(f());var n=a(f());import{exec as x}from"node:child_process";import{promisify as E}from"node:util";var u=a(m());var w=t((r,e,o)=>{if(e.Version!==1)throw Error(`Profile ${r} credential_process did not return Version 1.`);if(e.AccessKeyId===void 0||e.SecretAccessKey===void 0)throw Error(`Profile ${r} credential_process returned invalid credentials.`);if(e.Expiration){let l=new Date;if(new Date(e.Expiration)<l)throw Error(`Profile ${r} credential_process returned expired credentials.`)}let s=e.AccountId;!s&&o?.[r]?.aws_account_id&&(s=o[r].aws_account_id);let c={accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,...e.SessionToken&&{sessionToken:e.SessionToken},...e.Expiration&&{expiration:new Date(e.Expiration)},...e.CredentialScope&&{credentialScope:e.CredentialScope},...s&&{accountId:s}};return(0,u.setCredentialFeature)(c,"CREDENTIALS_PROCESS","w"),c},"getValidatedProcessCredentials");var P=t(async(r,e,o)=>{let s=e[r];if(e[r]){let c=s.credential_process;if(c!==void 0){let l=E(n.externalDataInterceptor?.getTokenRecord?.().exec??x);try{let{stdout:i}=await l(c),p;try{p=JSON.parse(i.trim())}catch{throw Error(`Profile ${r} credential_process returned invalid JSON.`)}return w(r,p,e)}catch(i){throw new n.CredentialsProviderError(i.message,{logger:o})}}else throw new n.CredentialsProviderError(`Profile ${r} did not contain credential_process.`,{logger:o})}else throw new n.CredentialsProviderError(`Profile ${r} could not be found in shared credentials file.`,{logger:o})},"resolveProcessCredentials");var S=t((r={})=>async({callerClientConfig:e}={})=>{r.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");let o=await(0,d.parseKnownFiles)(r);return P((0,d.getProfileName)({profile:r.profile??e?.profile}),o,r.logger)},"fromProcess");export{S as a};
@@ -0,0 +1,29 @@
1
+ // Built by esbuild from opencode-server source
2
+ if (typeof globalThis.Bun === 'undefined') {
3
+ globalThis.Bun = {
4
+ version: '0.0.0-node-compat',
5
+ stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
6
+ which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
7
+ };
8
+ }
9
+ if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
10
+ if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
11
+ import { createRequire as __alchemyCreateRequire } from 'node:module';
12
+ const require = __alchemyCreateRequire(import.meta.url);
13
+ import { fileURLToPath as __alchemyFileURLToPath } from 'node:url';
14
+ import { dirname as __alchemyDirname } from 'node:path';
15
+ const __alchemy_filename = __alchemyFileURLToPath(import.meta.url);
16
+ const __alchemy_dirname = __alchemyDirname(__alchemy_filename);
17
+
18
+ import{a as o,b as m,d as S}from"./chunk-2MRHL4B2.js";var X=S((ot,V)=>{var N=1e3,q=N*60,B=q*60,I=B*24,ge=I*7,be=I*365.25;V.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0)return me(e);if(t==="number"&&isFinite(e))return r.long?_e(e):ve(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function me(e){if(e=String(e),!(e.length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var t=parseFloat(r[1]),n=(r[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*be;case"weeks":case"week":case"w":return t*ge;case"days":case"day":case"d":return t*I;case"hours":case"hour":case"hrs":case"hr":case"h":return t*B;case"minutes":case"minute":case"mins":case"min":case"m":return t*q;case"seconds":case"second":case"secs":case"sec":case"s":return t*N;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}o(me,"parse");function ve(e){var r=Math.abs(e);return r>=I?Math.round(e/I)+"d":r>=B?Math.round(e/B)+"h":r>=q?Math.round(e/q)+"m":r>=N?Math.round(e/N)+"s":e+"ms"}o(ve,"fmtShort");function _e(e){var r=Math.abs(e);return r>=I?L(e,r,I,"day"):r>=B?L(e,r,B,"hour"):r>=q?L(e,r,q,"minute"):r>=N?L(e,r,N,"second"):e+" ms"}o(_e,"fmtLong");function L(e,r,t,n){var s=r>=t*1.5;return Math.round(e/t)+" "+n+(s?"s":"")}o(L,"plural")});var J=S((ct,Y)=>{function we(e){t.debug=t,t.default=t,t.coerce=P,t.disable=y,t.enable=s,t.enabled=g,t.humanize=X(),t.destroy=j,Object.keys(e).forEach(i=>{t[i]=e[i]}),t.names=[],t.skips=[],t.formatters={};function r(i){let c=0;for(let u=0;u<i.length;u++)c=(c<<5)-c+i.charCodeAt(u),c|=0;return t.colors[Math.abs(c)%t.colors.length]}o(r,"selectColor"),t.selectColor=r;function t(i){let c,u=null,f,_;function d(...p){if(!d.enabled)return;let O=d,w=Number(new Date),E=w-(c||w);O.diff=E,O.prev=c,O.curr=w,c=w,p[0]=t.coerce(p[0]),typeof p[0]!="string"&&p.unshift("%O");let x=0;p[0]=p[0].replace(/%([a-zA-Z%])/g,(A,M)=>{if(A==="%%")return"%";x++;let Q=t.formatters[M];if(typeof Q=="function"){let ye=p[x];A=Q.call(O,ye),p.splice(x,1),x--}return A}),t.formatArgs.call(O,p),(O.log||t.log).apply(O,p)}return o(d,"debug"),d.namespace=i,d.useColors=t.useColors(),d.color=t.selectColor(i),d.extend=n,d.destroy=t.destroy,Object.defineProperty(d,"enabled",{enumerable:!0,configurable:!1,get:o(()=>u!==null?u:(f!==t.namespaces&&(f=t.namespaces,_=t.enabled(i)),_),"get"),set:o(p=>{u=p},"set")}),typeof t.init=="function"&&t.init(d),d}o(t,"createDebug");function n(i,c){let u=t(this.namespace+(typeof c>"u"?":":c)+i);return u.log=this.log,u}o(n,"extend");function s(i){t.save(i),t.namespaces=i,t.names=[],t.skips=[];let c=(typeof i=="string"?i:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let u of c)u[0]==="-"?t.skips.push(u.slice(1)):t.names.push(u)}o(s,"enable");function a(i,c){let u=0,f=0,_=-1,d=0;for(;u<i.length;)if(f<c.length&&(c[f]===i[u]||c[f]==="*"))c[f]==="*"?(_=f,d=u,f++):(u++,f++);else if(_!==-1)f=_+1,d++,u=d;else return!1;for(;f<c.length&&c[f]==="*";)f++;return f===c.length}o(a,"matchesTemplate");function y(){let i=[...t.names,...t.skips.map(c=>"-"+c)].join(",");return t.enable(""),i}o(y,"disable");function g(i){for(let c of t.skips)if(a(i,c))return!1;for(let c of t.names)if(a(i,c))return!0;return!1}o(g,"enabled");function P(i){return i instanceof Error?i.stack||i.message:i}o(P,"coerce");function j(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o(j,"destroy"),t.enable(t.load()),t}o(we,"setup");Y.exports=we});var ee=S((h,T)=>{h.formatArgs=Oe;h.save=Se;h.load=Pe;h.useColors=Fe;h.storage=xe();h.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();h.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Fe(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o(Fe,"useColors");function Oe(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+T.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let t=0,n=0;e[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(n=t))}),e.splice(n,0,r)}o(Oe,"formatArgs");h.log=console.debug||console.log||(()=>{});function Se(e){try{e?h.storage.setItem("debug",e):h.storage.removeItem("debug")}catch{}}o(Se,"save");function Pe(){let e;try{e=h.storage.getItem("debug")||h.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}o(Pe,"load");function xe(){try{return localStorage}catch{}}o(xe,"localstorage");T.exports=J()(h);var{formatters:je}=T.exports;je.j=function(e){try{return JSON.stringify(e)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}});var re=S((l,R)=>{var Ee=m("tty"),H=m("util");l.init=De;l.log=Ne;l.formatArgs=Ie;l.save=qe;l.load=Be;l.useColors=Ae;l.destroy=H.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");l.colors=[6,2,3,4,5,1];try{let e=m("supports-color");e&&(e.stderr||e).level>=2&&(l.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}l.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,r)=>{let t=r.substring(6).toLowerCase().replace(/_([a-z])/g,(s,a)=>a.toUpperCase()),n=process.env[r];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[t]=n,e},{});function Ae(){return"colors"in l.inspectOpts?!!l.inspectOpts.colors:Ee.isatty(process.stderr.fd)}o(Ae,"useColors");function Ie(e){let{namespace:r,useColors:t}=this;if(t){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),a=` ${s};1m${r} \x1B[0m`;e[0]=a+e[0].split(`
19
+ `).join(`
20
+ `+a),e.push(s+"m+"+R.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Me()+r+" "+e[0]}o(Ie,"formatArgs");function Me(){return l.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(Me,"getDate");function Ne(...e){return process.stderr.write(H.formatWithOptions(l.inspectOpts,...e)+`
21
+ `)}o(Ne,"log");function qe(e){e?process.env.DEBUG=e:delete process.env.DEBUG}o(qe,"save");function Be(){return process.env.DEBUG}o(Be,"load");function De(e){e.inspectOpts={};let r=Object.keys(l.inspectOpts);for(let t=0;t<r.length;t++)e.inspectOpts[r[t]]=l.inspectOpts[r[t]]}o(De,"init");R.exports=J()(l);var{formatters:te}=R.exports;te.o=function(e){return this.inspectOpts.colors=this.useColors,H.inspect(e,this.inspectOpts).split(`
22
+ `).map(r=>r.trim()).join(" ")};te.O=function(e){return this.inspectOpts.colors=this.useColors,H.inspect(e,this.inspectOpts)}});var Z=S((lt,W)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?W.exports=ee():W.exports=re()});var oe=S(C=>{"use strict";var ke=C&&C.__createBinding||(Object.create?(function(e,r,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(r,t);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return r[t]},"get")}),Object.defineProperty(e,n,s)}):(function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]})),$e=C&&C.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),ne=C&&C.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&ke(r,e,t);return $e(r,e),r};Object.defineProperty(C,"__esModule",{value:!0});C.req=C.json=C.toBuffer=void 0;var Le=ne(m("http")),Te=ne(m("https"));async function se(e){let r=0,t=[];for await(let n of e)r+=n.length,t.push(n);return Buffer.concat(t,r)}o(se,"toBuffer");C.toBuffer=se;async function He(e){let t=(await se(e)).toString("utf8");try{return JSON.parse(t)}catch(n){let s=n;throw s.message+=` (input: ${t})`,s}}o(He,"json");C.json=He;function Re(e,r={}){let n=((typeof e=="string"?e:e.href).startsWith("https:")?Te:Le).request(e,r),s=new Promise((a,y)=>{n.once("response",a).once("error",y).end()});return n.then=s.then.bind(s),n}o(Re,"req");C.req=Re});var ae=S(b=>{"use strict";var ce=b&&b.__createBinding||(Object.create?(function(e,r,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(r,t);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return r[t]},"get")}),Object.defineProperty(e,n,s)}):(function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]})),Ue=b&&b.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),ue=b&&b.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&ce(r,e,t);return Ue(r,e),r},ze=b&&b.__exportStar||function(e,r){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t)&&ce(r,e,t)};Object.defineProperty(b,"__esModule",{value:!0});b.Agent=void 0;var Ge=ue(m("net")),ie=ue(m("http")),Je=m("https");ze(oe(),b);var F=Symbol("AgentBaseInternalState"),K=class extends ie.Agent{static{o(this,"Agent")}constructor(r){super(r),this[F]={}}isSecureEndpoint(r){if(r){if(typeof r.secureEndpoint=="boolean")return r.secureEndpoint;if(typeof r.protocol=="string")return r.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
23
+ `).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(r){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[r]||(this.sockets[r]=[]);let t=new Ge.Socket({writable:!1});return this.sockets[r].push(t),this.totalSocketCount++,t}decrementSockets(r,t){if(!this.sockets[r]||t===null)return;let n=this.sockets[r],s=n.indexOf(t);s!==-1&&(n.splice(s,1),this.totalSocketCount--,n.length===0&&delete this.sockets[r])}getName(r){return this.isSecureEndpoint(r)?Je.Agent.prototype.getName.call(this,r):super.getName(r)}createSocket(r,t,n){let s={...t,secureEndpoint:this.isSecureEndpoint(t)},a=this.getName(s),y=this.incrementSockets(a);Promise.resolve().then(()=>this.connect(r,s)).then(g=>{if(this.decrementSockets(a,y),g instanceof ie.Agent)try{return g.addRequest(r,s)}catch(P){return n(P)}this[F].currentSocket=g,super.createSocket(r,t,n)},g=>{this.decrementSockets(a,y),n(g)})}createConnection(){let r=this[F].currentSocket;if(this[F].currentSocket=void 0,!r)throw new Error("No socket was returned in the `connect()` function");return r}get defaultPort(){return this[F].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(r){this[F]&&(this[F].defaultPort=r)}get protocol(){return this[F].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(r){this[F]&&(this[F].protocol=r)}};b.Agent=K});var fe=S(D=>{"use strict";var We=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(D,"__esModule",{value:!0});D.parseProxyResponse=void 0;var Ze=We(Z()),U=(0,Ze.default)("https-proxy-agent:parse-proxy-response");function Ke(e){return new Promise((r,t)=>{let n=0,s=[];function a(){let i=e.read();i?j(i):e.once("readable",a)}o(a,"read");function y(){e.removeListener("end",g),e.removeListener("error",P),e.removeListener("readable",a)}o(y,"cleanup");function g(){y(),U("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}o(g,"onend");function P(i){y(),U("onerror %o",i),t(i)}o(P,"onerror");function j(i){s.push(i),n+=i.length;let c=Buffer.concat(s,n),u=c.indexOf(`\r
24
+ \r
25
+ `);if(u===-1){U("have not received end of HTTP headers yet..."),a();return}let f=c.slice(0,u).toString("ascii").split(`\r
26
+ `),_=f.shift();if(!_)return e.destroy(),t(new Error("No header received from proxy CONNECT response"));let d=_.split(" "),p=+d[1],O=d.slice(2).join(" "),w={};for(let E of f){if(!E)continue;let x=E.indexOf(":");if(x===-1)return e.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${E}"`));let $=E.slice(0,x).toLowerCase(),A=E.slice(x+1).trimStart(),M=w[$];typeof M=="string"?w[$]=[M,A]:Array.isArray(M)?M.push(A):w[$]=A}U("got proxy server response: %o %o",_,w),y(),r({connect:{statusCode:p,statusText:O,headers:w},buffered:c})}o(j,"ondata"),e.on("error",P),e.on("end",g),a()})}o(Ke,"parseProxyResponse");D.parseProxyResponse=Ke});var st=S(v=>{"use strict";var Qe=v&&v.__createBinding||(Object.create?(function(e,r,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(r,t);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return r[t]},"get")}),Object.defineProperty(e,n,s)}):(function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]})),Ve=v&&v.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),he=v&&v.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&Qe(r,e,t);return Ve(r,e),r},Ce=v&&v.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(v,"__esModule",{value:!0});v.HttpsProxyAgent=void 0;var z=he(m("net")),le=he(m("tls")),Xe=Ce(m("assert")),Ye=Ce(Z()),et=ae(),tt=m("url"),rt=fe(),k=(0,Ye.default)("https-proxy-agent"),de=o(e=>e.servername===void 0&&e.host&&!z.isIP(e.host)?{...e,servername:e.host}:e,"setServernameFromNonIpHost"),G=class extends et.Agent{static{o(this,"HttpsProxyAgent")}constructor(r,t){super(t),this.options={path:void 0},this.proxy=typeof r=="string"?new tt.URL(r):r,this.proxyHeaders=t?.headers??{},k("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?pe(t,"headers"):null,host:n,port:s}}async connect(r,t){let{proxy:n}=this;if(!t.host)throw new TypeError('No "host" provided');let s;n.protocol==="https:"?(k("Creating `tls.Socket`: %o",this.connectOpts),s=le.connect(de(this.connectOpts))):(k("Creating `net.Socket`: %o",this.connectOpts),s=z.connect(this.connectOpts));let a=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},y=z.isIPv6(t.host)?`[${t.host}]`:t.host,g=`CONNECT ${y}:${t.port} HTTP/1.1\r
27
+ `;if(n.username||n.password){let u=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;a["Proxy-Authorization"]=`Basic ${Buffer.from(u).toString("base64")}`}a.Host=`${y}:${t.port}`,a["Proxy-Connection"]||(a["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let u of Object.keys(a))g+=`${u}: ${a[u]}\r
28
+ `;let P=(0,rt.parseProxyResponse)(s);s.write(`${g}\r
29
+ `);let{connect:j,buffered:i}=await P;if(r.emit("proxyConnect",j),this.emit("proxyConnect",j,r),j.statusCode===200)return r.once("socket",nt),t.secureEndpoint?(k("Upgrading socket connection to TLS"),le.connect({...pe(de(t),"host","path","port"),socket:s})):s;s.destroy();let c=new z.Socket({writable:!1});return c.readable=!0,r.once("socket",u=>{k("Replaying proxy buffer for failed request"),(0,Xe.default)(u.listenerCount("data")>0),u.push(i),u.push(null)}),c}};G.protocols=["http","https"];v.HttpsProxyAgent=G;function nt(e){e.resume()}o(nt,"resume");function pe(e,...r){let t={},n;for(n in e)r.includes(n)||(t[n]=e[n]);return t}o(pe,"omit")});export{Z as a,ae as b,st as c};
@@ -0,0 +1,19 @@
1
+ // Built by esbuild from opencode-server source
2
+ if (typeof globalThis.Bun === 'undefined') {
3
+ globalThis.Bun = {
4
+ version: '0.0.0-node-compat',
5
+ stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
6
+ which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
7
+ };
8
+ }
9
+ if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
10
+ if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
11
+ import { createRequire as __alchemyCreateRequire } from 'node:module';
12
+ const require = __alchemyCreateRequire(import.meta.url);
13
+ import { fileURLToPath as __alchemyFileURLToPath } from 'node:url';
14
+ import { dirname as __alchemyDirname } from 'node:path';
15
+ const __alchemy_filename = __alchemyFileURLToPath(import.meta.url);
16
+ const __alchemy_dirname = __alchemyDirname(__alchemy_filename);
17
+
18
+ import{c as Q}from"./chunk-OCWGUTZJ.js";import{f as T}from"./chunk-CYRZU5QM.js";import{a as o,g as w}from"./chunk-2MRHL4B2.js";var g=w(T());var R=o(e=>e&&(typeof e.sso_start_url=="string"||typeof e.sso_account_id=="string"||typeof e.sso_session=="string"||typeof e.sso_region=="string"||typeof e.sso_role_name=="string"),"isSsoProfile");var F=w(Q());var f=w(T());var x="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var j=o(async(e,s={},t)=>{let{SSOOIDCClient:n}=await import("./sso-oidc-OMMKINFE.js"),i=o(p=>s.clientConfig?.[p]??s.parentClientConfig?.[p]??t?.[p],"coalesce");return new n(Object.assign({},s.clientConfig??{},{region:e??s.clientConfig?.region,logger:i("logger"),userAgentAppId:i("userAgentAppId")}))},"getSsoOidcClient");var q=o(async(e,s,t={},n)=>{let{CreateTokenCommand:i}=await import("./sso-oidc-OMMKINFE.js");return(await j(s,t,n)).send(new i({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))},"getNewSsoOidcToken");var W=w(T());var v=o(e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new W.TokenProviderError(`Token is expired. ${x}`,!1)},"validateTokenExpiry");var X=w(T());var h=o((e,s,t=!1)=>{if(typeof s>"u")throw new X.TokenProviderError(`Value not present for '${e}' in SSO Token${t?". Cannot refresh":""}. ${x}`,!1)},"validateTokenKey");var z=w(T());import{promises as Z}from"node:fs";var{writeFile:ee}=Z,J=o((e,s)=>{let t=(0,z.getSSOTokenFilepath)(e),n=JSON.stringify(s,null,2);return ee(t,n)},"writeSSOTokenToFile");var V=new Map,P=o((e={})=>async({callerClientConfig:s}={})=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");let t=await(0,f.parseKnownFiles)(e),n=(0,f.getProfileName)({profile:e.profile??s?.profile}),i=t[n];if(i){if(!i.sso_session)throw new f.TokenProviderError(`Profile '${n}' is missing required property 'sso_session'.`)}else throw new f.TokenProviderError(`Profile '${n}' could not be found in shared credentials file.`,!1);let a=i.sso_session,S=(await(0,f.loadSsoSessionData)(e))[a];if(!S)throw new f.TokenProviderError(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let l of["sso_start_url","sso_region"])if(!S[l])throw new f.TokenProviderError(`Sso session '${a}' is missing required property '${l}'.`,!1);let d=S.sso_start_url,A=S.sso_region,r;try{r=await(0,f.getSSOTokenFromFile)(a)}catch{throw new f.TokenProviderError(`The SSO session token associated with profile=${n} was not found or is invalid. ${x}`,!1)}h("accessToken",r.accessToken),h("expiresAt",r.expiresAt);let{accessToken:C,expiresAt:O}=r,c={token:C,expiration:new Date(O)};if(c.expiration.getTime()-Date.now()>3e5)return c;let m=V.get(a)??0;if(Date.now()-m<30*1e3)return v(c),c;h("clientId",r.clientId,!0),h("clientSecret",r.clientSecret,!0),h("refreshToken",r.refreshToken,!0);try{V.set(a,Date.now());let l=await q(r,A,e,s);h("accessToken",l.accessToken),h("expiresIn",l.expiresIn);let y=new Date(Date.now()+l.expiresIn*1e3);try{await J(a,{...r,accessToken:l.accessToken,expiresAt:y.toISOString(),refreshToken:l.refreshToken})}catch{}return{token:l.accessToken,expiration:y}}catch{return v(c),c}},"fromSso");var u=w(T());var E=!1,D=o(async({ssoStartUrl:e,ssoSession:s,ssoAccountId:t,ssoRegion:n,ssoRoleName:i,ssoClient:a,clientConfig:p,parentClientConfig:S,callerClientConfig:d,profile:A,filepath:r,configFilepath:C,ignoreCache:O,logger:c})=>{let m,l="To refresh this SSO session run aws sso login with the corresponding profile.";if(s)try{let k=await P({profile:A,filepath:r,configFilepath:C,ignoreCache:O,clientConfig:p,parentClientConfig:S,logger:c})({callerClientConfig:d});m={accessToken:k.token,expiresAt:new Date(k.expiration).toISOString()}}catch(k){throw new u.CredentialsProviderError(k.message,{tryNextLink:E,logger:c})}else try{m=await(0,u.getSSOTokenFromFile)(e)}catch{throw new u.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${l}`,{tryNextLink:E,logger:c})}if(new Date(m.expiresAt).getTime()-Date.now()<=0)throw new u.CredentialsProviderError(`The SSO session associated with this profile has expired. ${l}`,{tryNextLink:E,logger:c});let{accessToken:y}=m,{SSOClient:_,GetRoleCredentialsCommand:I}=await import("./loadSso-AGOUE6RL.js"),B=a||new _(Object.assign({},p??{},{logger:p?.logger??d?.logger??S?.logger,region:p?.region??n,userAgentAppId:p?.userAgentAppId??d?.userAgentAppId??S?.userAgentAppId})),L;try{L=await B.send(new I({accountId:t,roleName:i,accessToken:y}))}catch(k){throw new u.CredentialsProviderError(k,{tryNextLink:E,logger:c})}let{roleCredentials:{accessKeyId:M,secretAccessKey:b,sessionToken:G,expiration:K,credentialScope:H,accountId:U}={}}=L;if(!M||!b||!G||!K)throw new u.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:E,logger:c});let N={accessKeyId:M,secretAccessKey:b,sessionToken:G,expiration:new Date(K),...H&&{credentialScope:H},...U&&{accountId:U}};return s?(0,F.setCredentialFeature)(N,"CREDENTIALS_SSO","s"):(0,F.setCredentialFeature)(N,"CREDENTIALS_SSO_LEGACY","u"),N},"resolveSSOCredentials");var Y=w(T());var $=o((e,s)=>{let{sso_start_url:t,sso_account_id:n,sso_region:i,sso_role_name:a}=e;if(!t||!n||!i||!a)throw new Y.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}
19
+ Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:s});return e},"validateSsoProfile");var se=o((e={})=>async({callerClientConfig:s}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:t,ssoAccountId:n,ssoRegion:i,ssoRoleName:a,ssoSession:p}=e,{ssoClient:S}=e,d=(0,g.getProfileName)({profile:e.profile??s?.profile});if(!t&&!n&&!i&&!a&&!p){let r=(await(0,g.parseKnownFiles)(e))[d];if(!r)throw new g.CredentialsProviderError(`Profile ${d} was not found.`,{logger:e.logger});if(!R(r))throw new g.CredentialsProviderError(`Profile ${d} is not configured with SSO credentials.`,{logger:e.logger});if(r?.sso_session){let _=(await(0,g.loadSsoSessionData)(e))[r.sso_session],I=` configurations in profile ${d} and sso-session ${r.sso_session}`;if(i&&i!==_.sso_region)throw new g.CredentialsProviderError("Conflicting SSO region"+I,{tryNextLink:!1,logger:e.logger});if(t&&t!==_.sso_start_url)throw new g.CredentialsProviderError("Conflicting SSO start_url"+I,{tryNextLink:!1,logger:e.logger});r.sso_region=_.sso_region,r.sso_start_url=_.sso_start_url}let{sso_start_url:C,sso_account_id:O,sso_region:c,sso_role_name:m,sso_session:l}=$(r,e.logger);return D({ssoStartUrl:C,ssoSession:l,ssoAccountId:O,ssoRegion:c,ssoRoleName:m,ssoClient:S,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:d,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}else{if(!t||!n||!i||!a)throw new g.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});return D({ssoStartUrl:t,ssoSession:p,ssoAccountId:n,ssoRegion:i,ssoRoleName:a,ssoClient:S,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:d,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}},"fromSSO");export{R as a,$ as b,se as c};
@@ -0,0 +1,19 @@
1
+ // Built by esbuild from opencode-server source
2
+ if (typeof globalThis.Bun === 'undefined') {
3
+ globalThis.Bun = {
4
+ version: '0.0.0-node-compat',
5
+ stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
6
+ which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
7
+ };
8
+ }
9
+ if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
10
+ if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
11
+ import { createRequire as __alchemyCreateRequire } from 'node:module';
12
+ const require = __alchemyCreateRequire(import.meta.url);
13
+ import { fileURLToPath as __alchemyFileURLToPath } from 'node:url';
14
+ import { dirname as __alchemyDirname } from 'node:path';
15
+ const __alchemy_filename = __alchemyFileURLToPath(import.meta.url);
16
+ const __alchemy_dirname = __alchemyDirname(__alchemy_filename);
17
+
18
+ import{a as w,b as x,c as h}from"./chunk-P5RLCJUV.js";import{a as t,d as a}from"./chunk-2MRHL4B2.js";var s=a((U,g)=>{"use strict";var _=Object.defineProperty,m=Object.getOwnPropertyDescriptor,E=Object.getOwnPropertyNames,j=Object.prototype.hasOwnProperty,V=t((r,e)=>{for(var n in e)_(r,n,{get:e[n],enumerable:!0})},"__export"),C=t((r,e,n,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of E(e))!j.call(r,o)&&o!==n&&_(r,o,{get:t(()=>e[o],"get"),enumerable:!(c=m(e,o))||c.enumerable});return r},"__copyProps"),S=t(r=>C(_({},"__esModule",{value:!0}),r),"__toCommonJS"),O={};V(O,{SYMBOL_FOR_REQ_CONTEXT:t(()=>u,"SYMBOL_FOR_REQ_CONTEXT"),getContext:t(()=>M,"getContext")});g.exports=S(O);var u=Symbol.for("@vercel/request-context");function M(){return globalThis[u]?.get?.()??{}}t(M,"getContext")});var f=a((Z,y)=>{"use strict";var p=Object.defineProperty,N=Object.getOwnPropertyDescriptor,R=Object.getOwnPropertyNames,D=Object.prototype.hasOwnProperty,q=t((r,e)=>{for(var n in e)p(r,n,{get:e[n],enumerable:!0})},"__export"),A=t((r,e,n,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of R(e))!D.call(r,o)&&o!==n&&p(r,o,{get:t(()=>e[o],"get"),enumerable:!(c=N(e,o))||c.enumerable});return r},"__copyProps"),F=t(r=>A(p({},"__esModule",{value:!0}),r),"__toCommonJS"),v={};q(v,{getVercelOidcToken:t(()=>J,"getVercelOidcToken"),getVercelOidcTokenSync:t(()=>i,"getVercelOidcTokenSync")});y.exports=F(v);var B=s(),L=w();async function J(r){let e="",n;try{e=i()}catch(c){n=c}try{let[{getTokenPayload:c,isExpired:o},{refreshToken:P}]=await Promise.all([await import("./token-util-YGPCEEPO.js"),await import("./token-QPO3OAGS.js")]);(!e||o(c(e),r?.expirationBufferMs))&&(await P(r),e=i())}catch(c){let o=n instanceof Error?n.message:"";throw c instanceof Error&&(o=`${o}
19
+ ${c.message}`),o?new L.VercelOidcTokenError(o):c}return e}t(J,"getVercelOidcToken");function i(){let r=(0,B.getContext)().headers?.["x-vercel-oidc-token"]??process.env.VERCEL_OIDC_TOKEN;if(!r)throw new Error("The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?");return r}t(i,"getVercelOidcTokenSync")});var H=a((re,d)=>{"use strict";var l=Object.defineProperty,Q=Object.getOwnPropertyDescriptor,X=Object.getOwnPropertyNames,Y=Object.prototype.hasOwnProperty,I=t((r,e)=>{for(var n in e)l(r,n,{get:e[n],enumerable:!0})},"__export"),$=t((r,e,n,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of X(e))!Y.call(r,o)&&o!==n&&l(r,o,{get:t(()=>e[o],"get"),enumerable:!(c=Q(e,o))||c.enumerable});return r},"__copyProps"),K=t(r=>$(l({},"__esModule",{value:!0}),r),"__toCommonJS"),b={};I(b,{AccessTokenMissingError:t(()=>T.AccessTokenMissingError,"AccessTokenMissingError"),RefreshAccessTokenFailedError:t(()=>T.RefreshAccessTokenFailedError,"RefreshAccessTokenFailedError"),getContext:t(()=>z.getContext,"getContext"),getVercelOidcToken:t(()=>k.getVercelOidcToken,"getVercelOidcToken"),getVercelOidcTokenSync:t(()=>k.getVercelOidcTokenSync,"getVercelOidcTokenSync"),getVercelToken:t(()=>G.getVercelToken,"getVercelToken")});d.exports=K(b);var k=f(),z=s(),T=x(),G=h()});export{H as a};
@@ -0,0 +1,18 @@
1
+ // Built by esbuild from opencode-server source
2
+ if (typeof globalThis.Bun === 'undefined') {
3
+ globalThis.Bun = {
4
+ version: '0.0.0-node-compat',
5
+ stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
6
+ which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
7
+ };
8
+ }
9
+ if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
10
+ if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
11
+ import { createRequire as __alchemyCreateRequire } from 'node:module';
12
+ const require = __alchemyCreateRequire(import.meta.url);
13
+ import { fileURLToPath as __alchemyFileURLToPath } from 'node:url';
14
+ import { dirname as __alchemyDirname } from 'node:path';
15
+ const __alchemy_filename = __alchemyFileURLToPath(import.meta.url);
16
+ const __alchemy_dirname = __alchemyDirname(__alchemy_filename);
17
+
18
+ import{a as o,b as i,d as u}from"./chunk-2MRHL4B2.js";var P=u((pr,C)=>{"use strict";var O=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,se=Object.getOwnPropertyNames,ie=Object.prototype.hasOwnProperty,ae=o((e,r)=>{for(var t in r)O(e,t,{get:r[t],enumerable:!0})},"__export"),ce=o((e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of se(r))!ie.call(e,n)&&n!==t&&O(e,n,{get:o(()=>r[n],"get"),enumerable:!(s=ne(r,n))||s.enumerable});return e},"__copyProps"),ue=o(e=>ce(O({},"__esModule",{value:!0}),e),"__toCommonJS"),V={};ae(V,{VercelOidcTokenError:o(()=>g,"VercelOidcTokenError")});C.exports=ue(V);var g=class extends Error{static{o(this,"VercelOidcTokenError")}constructor(r,t){super(r),this.name="VercelOidcTokenError",this.cause=t}toString(){return this.cause?`${this.name}: ${this.message}: ${this.cause}`:`${this.name}: ${this.message}`}}});var N=u((fr,M)=>{"use strict";var pe=Object.create,v=Object.defineProperty,le=Object.getOwnPropertyDescriptor,fe=Object.getOwnPropertyNames,_e=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty,he=o((e,r)=>{for(var t in r)v(e,t,{get:r[t],enumerable:!0})},"__export"),R=o((e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of fe(r))!de.call(e,n)&&n!==t&&v(e,n,{get:o(()=>r[n],"get"),enumerable:!(s=le(r,n))||s.enumerable});return e},"__copyProps"),j=o((e,r,t)=>(t=e!=null?pe(_e(e)):{},R(r||!e||!e.__esModule?v(t,"default",{value:e,enumerable:!0}):t,e)),"__toESM"),ve=o(e=>R(v({},"__esModule",{value:!0}),e),"__toCommonJS"),I={};he(I,{findRootDir:o(()=>we,"findRootDir"),getUserDataDir:o(()=>ge,"getUserDataDir")});M.exports=ve(I);var _=j(i("path")),ke=j(i("fs")),b=j(i("os")),ye=P();function we(){try{let e=process.cwd();for(;e!==_.default.dirname(e);){let r=_.default.join(e,".vercel");if(ke.default.existsSync(r))return e;e=_.default.dirname(e)}}catch{throw new ye.VercelOidcTokenError("Token refresh only supported in node server environments")}return null}o(we,"findRootDir");function ge(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(b.default.platform()){case"darwin":return _.default.join(b.default.homedir(),"Library/Application Support");case"linux":return _.default.join(b.default.homedir(),".local/share");case"win32":return process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:null;default:return null}}o(ge,"getUserDataDir")});var B=u((dr,L)=>{"use strict";var Oe=Object.create,k=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,be=Object.getOwnPropertyNames,je=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty,Ee=o((e,r)=>{for(var t in r)k(e,t,{get:r[t],enumerable:!0})},"__export"),q=o((e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of be(r))!Te.call(e,n)&&n!==t&&k(e,n,{get:o(()=>r[n],"get"),enumerable:!(s=Pe(r,n))||s.enumerable});return e},"__copyProps"),$=o((e,r,t)=>(t=e!=null?Oe(je(e)):{},q(r||!e||!e.__esModule?k(t,"default",{value:e,enumerable:!0}):t,e)),"__toESM"),me=o(e=>q(k({},"__esModule",{value:!0}),e),"__toCommonJS"),F={};Ee(F,{isValidAccessToken:o(()=>Se,"isValidAccessToken"),readAuthConfig:o(()=>xe,"readAuthConfig"),writeAuthConfig:o(()=>Ae,"writeAuthConfig")});L.exports=me(F);var d=$(i("fs")),U=$(i("path")),De=H();function J(){let e=(0,De.getVercelDataDir)();if(!e)throw new Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);return U.join(e,"auth.json")}o(J,"getAuthConfigPath");function xe(){try{let e=J();if(!d.existsSync(e))return null;let r=d.readFileSync(e,"utf8");return r?JSON.parse(r):null}catch{return null}}o(xe,"readAuthConfig");function Ae(e){let r=J(),t=U.dirname(r);d.existsSync(t)||d.mkdirSync(t,{mode:504,recursive:!0}),d.writeFileSync(r,JSON.stringify(e,null,2),{mode:384})}o(Ae,"writeAuthConfig");function Se(e,r=0){if(!e.token)return!1;if(typeof e.expiresAt!="number")return!0;let t=Math.floor(Date.now()/1e3),s=r/1e3;return e.expiresAt>=t+s}o(Se,"isValidAccessToken")});var Y=u((vr,X)=>{"use strict";var m=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,Ce=Object.getOwnPropertyNames,Re=Object.prototype.hasOwnProperty,Ie=o((e,r)=>{for(var t in r)m(e,t,{get:r[t],enumerable:!0})},"__export"),Me=o((e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Ce(r))!Re.call(e,n)&&n!==t&&m(e,n,{get:o(()=>r[n],"get"),enumerable:!(s=Ve(r,n))||s.enumerable});return e},"__copyProps"),Ne=o(e=>Me(m({},"__esModule",{value:!0}),e),"__toCommonJS"),z={};Ie(z,{processTokenResponse:o(()=>Je,"processTokenResponse"),refreshTokenRequest:o(()=>Ue,"refreshTokenRequest")});X.exports=Ne(z);var T=i("os"),qe="https://vercel.com",$e="cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",G=`@vercel/oidc node-${process.version} ${(0,T.platform)()} (${(0,T.arch)()}) ${(0,T.hostname)()}`,E=null;async function Fe(){if(E)return E;let e=`${qe}/.well-known/openid-configuration`,r=await fetch(e,{headers:{"user-agent":G}});if(!r.ok)throw new Error("Failed to discover OAuth endpoints");let t=await r.json();if(!t||typeof t.token_endpoint!="string")throw new Error("Invalid OAuth discovery response");let s=t.token_endpoint;return E=s,s}o(Fe,"getTokenEndpoint");async function Ue(e){let r=await Fe();return await fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":G},body:new URLSearchParams({client_id:$e,grant_type:"refresh_token",...e})})}o(Ue,"refreshTokenRequest");async function Je(e){let r=await e.json();if(!e.ok){let t=typeof r=="object"&&r&&"error"in r?String(r.error):"Token refresh failed";return[new Error(t)]}return typeof r!="object"||r===null?[new Error("Invalid token response")]:typeof r.access_token!="string"?[new Error("Missing access_token in response")]:r.token_type!=="Bearer"?[new Error("Invalid token_type in response")]:typeof r.expires_in!="number"?[new Error("Missing expires_in in response")]:[null,r]}o(Je,"processTokenResponse")});var K=u((yr,Z)=>{"use strict";var A=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,Be=Object.getOwnPropertyNames,He=Object.prototype.hasOwnProperty,ze=o((e,r)=>{for(var t in r)A(e,t,{get:r[t],enumerable:!0})},"__export"),Ge=o((e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Be(r))!He.call(e,n)&&n!==t&&A(e,n,{get:o(()=>r[n],"get"),enumerable:!(s=Le(r,n))||s.enumerable});return e},"__copyProps"),Xe=o(e=>Ge(A({},"__esModule",{value:!0}),e),"__toCommonJS"),Q={};ze(Q,{AccessTokenMissingError:o(()=>D,"AccessTokenMissingError"),RefreshAccessTokenFailedError:o(()=>x,"RefreshAccessTokenFailedError")});Z.exports=Xe(Q);var D=class extends Error{static{o(this,"AccessTokenMissingError")}constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login)."),this.name="AccessTokenMissingError"}},x=class extends Error{static{o(this,"RefreshAccessTokenFailedError")}constructor(r){super("Failed to refresh authentication token.",{cause:r}),this.name="RefreshAccessTokenFailedError"}}});var H=u((gr,oe)=>{"use strict";var Ye=Object.create,y=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,Ze=Object.getOwnPropertyNames,Ke=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty,er=o((e,r)=>{for(var t in r)y(e,t,{get:r[t],enumerable:!0})},"__export"),ee=o((e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Ze(r))!We.call(e,n)&&n!==t&&y(e,n,{get:o(()=>r[n],"get"),enumerable:!(s=Qe(r,n))||s.enumerable});return e},"__copyProps"),re=o((e,r,t)=>(t=e!=null?Ye(Ke(e)):{},ee(r||!e||!e.__esModule?y(t,"default",{value:e,enumerable:!0}):t,e)),"__toESM"),rr=o(e=>ee(y({},"__esModule",{value:!0}),e),"__toCommonJS"),te={};er(te,{assertVercelOidcTokenResponse:o(()=>S,"assertVercelOidcTokenResponse"),findProjectInfo:o(()=>sr,"findProjectInfo"),getTokenPayload:o(()=>cr,"getTokenPayload"),getVercelDataDir:o(()=>tr,"getVercelDataDir"),getVercelOidcToken:o(()=>nr,"getVercelOidcToken"),getVercelToken:o(()=>or,"getVercelToken"),isExpired:o(()=>ur,"isExpired"),loadToken:o(()=>ar,"loadToken"),saveToken:o(()=>ir,"saveToken")});oe.exports=rr(te);var h=re(i("path")),a=re(i("fs")),f=P(),w=N(),p=B(),W=Y(),l=K();function tr(){let e="com.vercel.cli",r=(0,w.getUserDataDir)();return r?h.join(r,e):null}o(tr,"getVercelDataDir");async function or(e){let r=(0,p.readAuthConfig)();if(!r?.token)throw new l.AccessTokenMissingError;if((0,p.isValidAccessToken)(r,e?.expirationBufferMs))return r.token;if(!r.refreshToken)throw(0,p.writeAuthConfig)({}),new l.RefreshAccessTokenFailedError("No refresh token available");try{let t=await(0,W.refreshTokenRequest)({refresh_token:r.refreshToken}),[s,n]=await(0,W.processTokenResponse)(t);if(s||!n)throw(0,p.writeAuthConfig)({}),new l.RefreshAccessTokenFailedError(s);let c={token:n.access_token,expiresAt:Math.floor(Date.now()/1e3)+n.expires_in};return n.refresh_token&&(c.refreshToken=n.refresh_token),(0,p.writeAuthConfig)(c),c.token}catch(t){throw(0,p.writeAuthConfig)({}),t instanceof l.AccessTokenMissingError||t instanceof l.RefreshAccessTokenFailedError?t:new l.RefreshAccessTokenFailedError(t)}}o(or,"getVercelToken");async function nr(e,r,t){let s=`https://api.vercel.com/v1/projects/${r}/token?source=vercel-oidc-refresh${t?`&teamId=${t}`:""}`,n=await fetch(s,{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token: ${n.statusText}`);let c=await n.json();return S(c),c}o(nr,"getVercelOidcToken");function S(e){if(!e||typeof e!="object")throw new TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again");if(!("token"in e)||typeof e.token!="string")throw new TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again")}o(S,"assertVercelOidcTokenResponse");function sr(){let e=(0,w.findRootDir)();if(!e)throw new f.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");let r=h.join(e,".vercel","project.json");if(!a.existsSync(r))throw new f.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");let t=JSON.parse(a.readFileSync(r,"utf8"));if(typeof t.projectId!="string"&&typeof t.orgId!="string")throw new TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");return{projectId:t.projectId,teamId:t.orgId}}o(sr,"findProjectInfo");function ir(e,r){let t=(0,w.getUserDataDir)();if(!t)throw new f.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let s=h.join(t,"com.vercel.token",`${r}.json`),n=JSON.stringify(e);a.mkdirSync(h.dirname(s),{mode:504,recursive:!0}),a.writeFileSync(s,n),a.chmodSync(s,432)}o(ir,"saveToken");function ar(e){let r=(0,w.getUserDataDir)();if(!r)throw new f.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let t=h.join(r,"com.vercel.token",`${e}.json`);if(!a.existsSync(t))return null;let s=JSON.parse(a.readFileSync(t,"utf8"));return S(s),s}o(ar,"loadToken");function cr(e){let r=e.split(".");if(r.length!==3)throw new f.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again");let t=r[1].replace(/-/g,"+").replace(/_/g,"/"),s=t.padEnd(t.length+(4-t.length%4)%4,"=");return JSON.parse(Buffer.from(s,"base64").toString("utf8"))}o(cr,"getTokenPayload");function ur(e,r=0){return e.exp*1e3<Date.now()+r}o(ur,"isExpired")});export{P as a,K as b,H as c};