9router 0.4.13 → 0.4.15

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 (421) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +4 -4
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/routes-manifest.json +3 -3
  5. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  6. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  8. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  10. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  12. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  14. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  16. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  18. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +5 -0
  20. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -0
  21. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -0
  22. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  23. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  25. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  27. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  29. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  31. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  33. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  35. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  37. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  39. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  41. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  42. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  43. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  44. package/app/.next/server/app/_global-error/page.js +3 -3
  45. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  46. package/app/.next/server/app/_global-error.html +1 -1
  47. package/app/.next/server/app/_global-error.rsc +1 -1
  48. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  49. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  50. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  51. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  52. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  53. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  54. package/app/.next/server/app/_not-found/page.js +2 -2
  55. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/_not-found.html +1 -1
  57. package/app/.next/server/app/_not-found.rsc +4 -4
  58. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  59. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  60. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  61. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  62. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  63. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  64. package/app/.next/server/app/api/auth/login/route.js +1 -1
  65. package/app/.next/server/app/api/auth/logout/route.js +1 -1
  66. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  67. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  68. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
  69. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
  70. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  71. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
  72. package/app/.next/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  73. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  74. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  75. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  76. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  77. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  78. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  79. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  80. package/app/.next/server/app/api/combos/[id]/route.js.nft.json +1 -1
  81. package/app/.next/server/app/api/combos/route.js +1 -1
  82. package/app/.next/server/app/api/health/route.js +1 -1
  83. package/app/.next/server/app/api/init/route.js +1 -1
  84. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  85. package/app/.next/server/app/api/keys/route.js +1 -1
  86. package/app/.next/server/app/api/locale/route.js +1 -1
  87. package/app/.next/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  88. package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  89. package/app/.next/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  90. package/app/.next/server/app/api/media-providers/tts/voices/route.js +1 -1
  91. package/app/.next/server/app/api/models/alias/route.js +1 -1
  92. package/app/.next/server/app/api/models/availability/route.js +1 -1
  93. package/app/.next/server/app/api/models/custom/route.js +1 -1
  94. package/app/.next/server/app/api/models/route.js +1 -1
  95. package/app/.next/server/app/api/models/test/route.js +1 -1
  96. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  97. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  98. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  99. package/app/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
  100. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
  101. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  102. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  103. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  104. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  105. package/app/.next/server/app/api/pricing/route.js +1 -1
  106. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  107. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  108. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  109. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  110. package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  111. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  112. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  113. package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
  114. package/app/.next/server/app/api/providers/client/route.js +1 -1
  115. package/app/.next/server/app/api/providers/kilo/free-models/route.js +1 -1
  116. package/app/.next/server/app/api/providers/route.js +1 -1
  117. package/app/.next/server/app/api/providers/suggested-models/route.js +1 -1
  118. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  119. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  120. package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
  121. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  122. package/app/.next/server/app/api/proxy-pools/route.js +1 -1
  123. package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  124. package/app/.next/server/app/api/settings/database/route.js +1 -1
  125. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  126. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  127. package/app/.next/server/app/api/settings/route.js +1 -1
  128. package/app/.next/server/app/api/settings/route.js.nft.json +1 -1
  129. package/app/.next/server/app/api/shutdown/route.js +1 -1
  130. package/app/.next/server/app/api/tags/route.js +1 -1
  131. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  132. package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
  133. package/app/.next/server/app/api/translator/load/route.js +1 -1
  134. package/app/.next/server/app/api/translator/save/route.js +1 -1
  135. package/app/.next/server/app/api/translator/send/route.js +1 -1
  136. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  137. package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
  138. package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
  139. package/app/.next/server/app/api/tunnel/status/route.js +1 -1
  140. package/app/.next/server/app/api/tunnel/tailscale-check/route.js +3 -3
  141. package/app/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  142. package/app/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  143. package/app/.next/server/app/api/tunnel/tailscale-install/route.js +2 -2
  144. package/app/.next/server/app/api/tunnel/tailscale-login/route.js +3 -3
  145. package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route.js +2 -2
  146. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  147. package/app/.next/server/app/api/usage/chart/route.js +1 -1
  148. package/app/.next/server/app/api/usage/history/route.js +1 -1
  149. package/app/.next/server/app/api/usage/providers/route.js +1 -1
  150. package/app/.next/server/app/api/usage/request-details/route.js +1 -1
  151. package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
  152. package/app/.next/server/app/api/usage/stats/route.js +1 -1
  153. package/app/.next/server/app/api/usage/stream/route.js +2 -2
  154. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  155. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  156. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
  157. package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  158. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  159. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  160. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  161. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  162. package/app/.next/server/app/api/v1/images/generations/route.js +2 -2
  163. package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  164. package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
  165. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  166. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  167. package/app/.next/server/app/api/v1/models/route.js +1 -1
  168. package/app/.next/server/app/api/v1/responses/compact/route.js +1 -1
  169. package/app/.next/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  170. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  171. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  172. package/app/.next/server/app/api/v1/route.js +1 -1
  173. package/app/.next/server/app/api/v1/search/route.js +1 -1
  174. package/app/.next/server/app/api/v1/search/route.js.nft.json +1 -1
  175. package/app/.next/server/app/api/v1/web/fetch/route.js +1 -1
  176. package/app/.next/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  177. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  178. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  179. package/app/.next/server/app/api/v1beta/models/route.js +1 -1
  180. package/app/.next/server/app/api/version/route.js +1 -1
  181. package/app/.next/server/app/api/version/update/route.js +1 -1
  182. package/app/.next/server/app/callback/page.js +2 -2
  183. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  184. package/app/.next/server/app/callback.html +1 -1
  185. package/app/.next/server/app/callback.rsc +4 -4
  186. package/app/.next/server/app/callback.segments/_full.segment.rsc +4 -4
  187. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  188. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
  189. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  190. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  191. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  192. package/app/.next/server/app/dashboard/basic-chat.html +1 -1
  193. package/app/.next/server/app/dashboard/basic-chat.rsc +6 -6
  194. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  195. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  196. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  197. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  198. package/app/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  199. package/app/.next/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  200. package/app/.next/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  201. package/app/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  202. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  203. package/app/.next/server/app/dashboard/cli-tools.rsc +6 -6
  204. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  205. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  206. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  207. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  208. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  209. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  210. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  211. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  212. package/app/.next/server/app/dashboard/combos.html +1 -1
  213. package/app/.next/server/app/dashboard/combos.rsc +6 -6
  214. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  215. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  216. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  217. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  218. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  219. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  220. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  221. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  222. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  223. package/app/.next/server/app/dashboard/endpoint.rsc +6 -6
  224. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  225. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  226. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  227. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  228. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  229. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  230. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  231. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  232. package/app/.next/server/app/dashboard/media-providers/web.html +1 -1
  233. package/app/.next/server/app/dashboard/media-providers/web.rsc +6 -6
  234. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  235. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  236. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  237. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  238. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  239. package/app/.next/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  240. package/app/.next/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  241. package/app/.next/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  242. package/app/.next/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  243. package/app/.next/server/app/dashboard/mitm.html +1 -1
  244. package/app/.next/server/app/dashboard/mitm.rsc +6 -6
  245. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  246. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  247. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  248. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  249. package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  250. package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  251. package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  252. package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  253. package/app/.next/server/app/dashboard/profile.html +1 -1
  254. package/app/.next/server/app/dashboard/profile.rsc +6 -6
  255. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  256. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  257. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  258. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  259. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  260. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  261. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  262. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  263. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  264. package/app/.next/server/app/dashboard/providers/new.rsc +6 -6
  265. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  266. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  267. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  268. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  269. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  270. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  271. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  272. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  273. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  274. package/app/.next/server/app/dashboard/providers.html +1 -1
  275. package/app/.next/server/app/dashboard/providers.rsc +6 -6
  276. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  277. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  278. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  279. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  280. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  281. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  282. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  283. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  284. package/app/.next/server/app/dashboard/proxy-pools.html +1 -1
  285. package/app/.next/server/app/dashboard/proxy-pools.rsc +6 -6
  286. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  287. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  288. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  289. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  290. package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  291. package/app/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  292. package/app/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  293. package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  294. package/app/.next/server/app/dashboard/quota.html +2 -2
  295. package/app/.next/server/app/dashboard/quota.rsc +7 -7
  296. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  297. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  298. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  299. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  300. package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  301. package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  302. package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  303. package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  304. package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
  305. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  306. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  307. package/app/.next/server/app/dashboard/settings/pricing.rsc +4 -4
  308. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  309. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  310. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  311. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  312. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  313. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  314. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  315. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  316. package/app/.next/server/app/dashboard/translator.html +1 -1
  317. package/app/.next/server/app/dashboard/translator.rsc +6 -6
  318. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  319. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  320. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  321. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  322. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  323. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  324. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  325. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  326. package/app/.next/server/app/dashboard/usage.html +1 -1
  327. package/app/.next/server/app/dashboard/usage.rsc +6 -6
  328. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  329. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  330. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  331. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  332. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  333. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  334. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  335. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  336. package/app/.next/server/app/dashboard.html +1 -1
  337. package/app/.next/server/app/dashboard.rsc +6 -6
  338. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  339. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  340. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  341. package/app/.next/server/app/dashboard.segments/_full.segment.rsc +6 -6
  342. package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
  343. package/app/.next/server/app/dashboard.segments/_index.segment.rsc +4 -4
  344. package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  345. package/app/.next/server/app/favicon.ico/route.js +1 -1
  346. package/app/.next/server/app/index.html +1 -1
  347. package/app/.next/server/app/index.rsc +4 -4
  348. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  349. package/app/.next/server/app/index.segments/_full.segment.rsc +4 -4
  350. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  351. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
  352. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  353. package/app/.next/server/app/landing/page.js +2 -2
  354. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  355. package/app/.next/server/app/landing.html +1 -1
  356. package/app/.next/server/app/landing.rsc +4 -4
  357. package/app/.next/server/app/landing.segments/_full.segment.rsc +4 -4
  358. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  359. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
  360. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  361. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  362. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  363. package/app/.next/server/app/login/page.js +2 -2
  364. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  365. package/app/.next/server/app/login.html +1 -1
  366. package/app/.next/server/app/login.rsc +5 -5
  367. package/app/.next/server/app/login.segments/_full.segment.rsc +5 -5
  368. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  369. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
  370. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  371. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  372. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  373. package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
  374. package/app/.next/server/app/page.js +2 -2
  375. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  376. package/app/.next/server/app-paths-manifest.json +4 -4
  377. package/app/.next/server/chunks/1578.js +1 -1
  378. package/app/.next/server/chunks/2049.js +1 -1
  379. package/app/.next/server/chunks/253.js +1 -1
  380. package/app/.next/server/chunks/2692.js +3 -3
  381. package/app/.next/server/chunks/450.js +1 -1
  382. package/app/.next/server/chunks/4627.js +1 -0
  383. package/app/.next/server/chunks/5053.js +2 -2
  384. package/app/.next/server/chunks/7171.js +1 -0
  385. package/app/.next/server/chunks/8035.js +1 -1
  386. package/app/.next/server/chunks/8146.js +1 -0
  387. package/app/.next/server/chunks/8202.js +1 -1
  388. package/app/.next/server/chunks/8513.js +3 -3
  389. package/app/.next/server/middleware-build-manifest.js +1 -1
  390. package/app/.next/server/middleware.js +4 -4
  391. package/app/.next/server/pages/404.html +1 -1
  392. package/app/.next/server/pages/500.html +1 -1
  393. package/app/.next/static/{7D6ZXM7R9e5iCcGAVJvY1 → WbUasp2U5OrWo2254eBov}/_buildManifest.js +1 -1
  394. package/app/.next/static/chunks/3116-f395a70438ef7808.js +23 -0
  395. package/app/.next/static/chunks/{4156-cb6c83e3583f0406.js → 4156-e75862e66f88fee7.js} +1 -1
  396. package/app/.next/static/chunks/{505-18fef307aacf3205.js → 505-8ccb72b77059a087.js} +1 -1
  397. package/app/.next/static/chunks/8035-5249f70deade9acb.js +3 -0
  398. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-5cb5ae93c4288788.js +1 -0
  399. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-d994f22741fa26ed.js +4 -0
  400. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-617c9cc320c9aced.js +1 -0
  401. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/{page-dc8502d8e3b95e92.js → page-862c58ef97db3add.js} +1 -1
  402. package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-2501132754f3396f.js +2 -0
  403. package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-af74897e85d9d248.js +1 -0
  404. package/app/.next/static/css/5bf76ca74a8fc253.css +1 -0
  405. package/app/package.json +1 -1
  406. package/package.json +1 -1
  407. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page.js +0 -5
  408. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page.js.nft.json +0 -1
  409. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page_client-reference-manifest.js +0 -1
  410. package/app/.next/server/chunks/1301.js +0 -1
  411. package/app/.next/server/chunks/5221.js +0 -1
  412. package/app/.next/server/chunks/6560.js +0 -1
  413. package/app/.next/static/chunks/3116-cec85bb5f212583f.js +0 -23
  414. package/app/.next/static/chunks/8035-51e868622e22263b.js +0 -3
  415. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-e95c413c30b592eb.js +0 -1
  416. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page-8b1737ee82d2cbfa.js +0 -4
  417. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-c32e5ceca2e291dd.js +0 -1
  418. package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-7447209d1946170b.js +0 -2
  419. package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-7d10d891e789f63e.js +0 -1
  420. package/app/.next/static/css/c5a3b7a7aed78240.css +0 -1
  421. /package/app/.next/static/{7D6ZXM7R9e5iCcGAVJvY1 → WbUasp2U5OrWo2254eBov}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (()=>{var a={};a.id=7520,a.ids=[7520],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},49684:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>K,patchFetch:()=>J,routeModule:()=>F,serverHooks:()=>I,workAsyncStorage:()=>G,workUnitAsyncStorage:()=>H});var d={};c.r(d),c.d(d,{GET:()=>E});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(79748),x=c(21820),y=c(33873),z=c(79646);let A=(0,c(28354).promisify)(z.execFile),B=["cursorAuth/accessToken","cursorAuth/token"],C=["storage.serviceMachineId","storage.machineId","telemetry.machineId"];async function D(a){let b=a=>{let b=a.trim();try{let a=JSON.parse(b);return"string"==typeof a?a:b}catch{return b}},c=async b=>{let{stdout:c}=await A("sqlite3",[a,b],{timeout:1e4});return c.trim()},d=null;for(let a of B)try{let e=await c(`SELECT value FROM itemTable WHERE key='${a}' LIMIT 1`);if(e){d=b(e);break}}catch{}let e=null;for(let a of C)try{let d=await c(`SELECT value FROM itemTable WHERE key='${a}' LIMIT 1`);if(d){e=b(d);break}}catch{}return{accessToken:d,machineId:e}}async function E(){try{let a=process.platform,b=function(a){let b=(0,x.homedir)();if("darwin"===a)return[(0,y.join)(b,"Library/Application Support/Cursor/User/globalStorage/state.vscdb"),(0,y.join)(b,"Library/Application Support/Cursor - Insiders/User/globalStorage/state.vscdb")];if("win32"===a){let a=process.env.APPDATA||(0,y.join)(b,"AppData","Roaming"),c=process.env.LOCALAPPDATA||(0,y.join)(b,"AppData","Local");return[(0,y.join)(a,"Cursor","User","globalStorage","state.vscdb"),(0,y.join)(a,"Cursor - Insiders","User","globalStorage","state.vscdb"),(0,y.join)(c,"Cursor","User","globalStorage","state.vscdb"),(0,y.join)(c,"Programs","Cursor","User","globalStorage","state.vscdb")]}return[(0,y.join)(b,".config/Cursor/User/globalStorage/state.vscdb"),(0,y.join)(b,".config/cursor/User/globalStorage/state.vscdb")]}(a),d=null;for(let a of b)try{await (0,w.access)(a,w.constants.R_OK),d=a;break}catch{}if(!d)return v.NextResponse.json({found:!1,error:`Cursor database not found. Checked locations:
1
+ (()=>{var a={};a.id=7520,a.ids=[7520],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8955:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>K,patchFetch:()=>J,routeModule:()=>F,serverHooks:()=>I,workAsyncStorage:()=>G,workUnitAsyncStorage:()=>H});var d={};c.r(d),c.d(d,{GET:()=>E});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(79748),x=c(21820),y=c(33873),z=c(79646);let A=(0,c(28354).promisify)(z.execFile),B=["cursorAuth/accessToken","cursorAuth/token"],C=["storage.serviceMachineId","storage.machineId","telemetry.machineId"];async function D(a){let b=a=>{let b=a.trim();try{let a=JSON.parse(b);return"string"==typeof a?a:b}catch{return b}},c=async b=>{let{stdout:c}=await A("sqlite3",[a,b],{timeout:1e4});return c.trim()},d=null;for(let a of B)try{let e=await c(`SELECT value FROM itemTable WHERE key='${a}' LIMIT 1`);if(e){d=b(e);break}}catch{}let e=null;for(let a of C)try{let d=await c(`SELECT value FROM itemTable WHERE key='${a}' LIMIT 1`);if(d){e=b(d);break}}catch{}return{accessToken:d,machineId:e}}async function E(){try{let a=process.platform,b=function(a){let b=(0,x.homedir)();if("darwin"===a)return[(0,y.join)(b,"Library/Application Support/Cursor/User/globalStorage/state.vscdb"),(0,y.join)(b,"Library/Application Support/Cursor - Insiders/User/globalStorage/state.vscdb")];if("win32"===a){let a=process.env.APPDATA||(0,y.join)(b,"AppData","Roaming"),c=process.env.LOCALAPPDATA||(0,y.join)(b,"AppData","Local");return[(0,y.join)(a,"Cursor","User","globalStorage","state.vscdb"),(0,y.join)(a,"Cursor - Insiders","User","globalStorage","state.vscdb"),(0,y.join)(c,"Cursor","User","globalStorage","state.vscdb"),(0,y.join)(c,"Programs","Cursor","User","globalStorage","state.vscdb")]}return[(0,y.join)(b,".config/Cursor/User/globalStorage/state.vscdb"),(0,y.join)(b,".config/cursor/User/globalStorage/state.vscdb")]}(a),d=null;for(let a of b)try{await (0,w.access)(a,w.constants.R_OK),d=a;break}catch{}if(!d)return v.NextResponse.json({found:!1,error:`Cursor database not found. Checked locations:
2
2
  ${b.join("\n")}
3
3
 
4
- Make sure Cursor IDE is installed and opened at least once.`});if("linux"===a){let a=!1;try{await A("which",["cursor"],{timeout:5e3}),a=!0}catch{try{let b=(0,y.join)((0,x.homedir)(),".local/share/applications/cursor.desktop");await (0,w.access)(b,w.constants.R_OK),a=!0}catch{}}if(!a)return v.NextResponse.json({found:!1,error:"Cursor config files found but Cursor IDE does not appear to be installed. Skipping auto-import."})}try{let a=function(a){let b=new(c(87550))(a,{readonly:!0,fileMustExist:!0}),d=a=>{let c=b.prepare("SELECT value FROM itemTable WHERE key=? LIMIT 1").get(a);return c?.value||null},e=a=>{if("string"!=typeof a)return a;try{let b=JSON.parse(a);return"string"==typeof b?b:a}catch{return a}},f=null;for(let a of B){let b=d(a);if(b){f=e(b);break}}let g=null;for(let a of C){let b=d(a);if(b){g=e(b);break}}return b.close(),{accessToken:f,machineId:g}}(d);if(a.accessToken&&a.machineId)return v.NextResponse.json({found:!0,accessToken:a.accessToken,machineId:a.machineId})}catch{}try{let a=await D(d);if(a.accessToken&&a.machineId)return v.NextResponse.json({found:!0,accessToken:a.accessToken,machineId:a.machineId})}catch{}return v.NextResponse.json({found:!1,windowsManual:!0,dbPath:d})}catch(a){return console.log("Cursor auto-import error:",a),v.NextResponse.json({found:!1,error:a.message},{status:500})}}let F=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/cursor/auto-import/route",pathname:"/api/oauth/cursor/auto-import",filename:"route",bundlePath:"app/api/oauth/cursor/auto-import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/cursor/auto-import/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:G,workUnitAsyncStorage:H,serverHooks:I}=F;function J(){return(0,g.patchFetch)({workAsyncStorage:G,workUnitAsyncStorage:H})}async function K(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),F.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/cursor/auto-import/route";"/index"===d&&(d="/");let e=await F.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[D]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||F.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===F.isDev||!I,M=I&&!L;G&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await F.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>F.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>F.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await F.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await F.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await F.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,6799],()=>b(b.s=49684));module.exports=c})();
4
+ Make sure Cursor IDE is installed and opened at least once.`});if("linux"===a){let a=!1;try{await A("which",["cursor"],{timeout:5e3}),a=!0}catch{try{let b=(0,y.join)((0,x.homedir)(),".local/share/applications/cursor.desktop");await (0,w.access)(b,w.constants.R_OK),a=!0}catch{}}if(!a)return v.NextResponse.json({found:!1,error:"Cursor config files found but Cursor IDE does not appear to be installed. Skipping auto-import."})}try{let a=function(a){let b=new(c(87550))(a,{readonly:!0,fileMustExist:!0}),d=a=>{let c=b.prepare("SELECT value FROM itemTable WHERE key=? LIMIT 1").get(a);return c?.value||null},e=a=>{if("string"!=typeof a)return a;try{let b=JSON.parse(a);return"string"==typeof b?b:a}catch{return a}},f=null;for(let a of B){let b=d(a);if(b){f=e(b);break}}let g=null;for(let a of C){let b=d(a);if(b){g=e(b);break}}return b.close(),{accessToken:f,machineId:g}}(d);if(a.accessToken&&a.machineId)return v.NextResponse.json({found:!0,accessToken:a.accessToken,machineId:a.machineId})}catch{}try{let a=await D(d);if(a.accessToken&&a.machineId)return v.NextResponse.json({found:!0,accessToken:a.accessToken,machineId:a.machineId})}catch{}return v.NextResponse.json({found:!1,windowsManual:!0,dbPath:d})}catch(a){return console.log("Cursor auto-import error:",a),v.NextResponse.json({found:!1,error:a.message},{status:500})}}let F=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/cursor/auto-import/route",pathname:"/api/oauth/cursor/auto-import",filename:"route",bundlePath:"app/api/oauth/cursor/auto-import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/cursor/auto-import/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:G,workUnitAsyncStorage:H,serverHooks:I}=F;function J(){return(0,g.patchFetch)({workAsyncStorage:G,workUnitAsyncStorage:H})}async function K(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),F.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/cursor/auto-import/route";"/index"===d&&(d="/");let e=await F.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[D]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||F.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===F.isDev||!I,M=I&&!L;G&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await F.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>F.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>F.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await F.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await F.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await F.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,6799],()=>b(b.s=8955));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=204,a.ids=[204],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},34278:(a,b,c)=>{"use strict";c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47978:(a,b,c)=>{"use strict";c.d(b,{DI:()=>e,Hp:()=>g,LT:()=>f,MZ:()=>o,Nl:()=>r,Nu:()=>k,OV:()=>d,Tx:()=>l,WN:()=>m,YT:()=>j,ZL:()=>i,f7:()=>q,hF:()=>h,lB:()=>p,t:()=>n}),c(21820);let d={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},e={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},f={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},g={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},h={apiBaseUrl:"https://api2.qoder.sh",deviceTokenUrl:"https://api2.qoder.sh/api/v1/deviceToken/poll",deviceRefreshUrl:"https://api2.qoder.sh/api/v1/deviceToken/refresh",refreshUrl:"https://api2.qoder.sh/api/v3/user/refresh_token",userInfoUrl:"https://api2.qoder.sh/api/v1/userinfo",statusUrl:"https://api2.qoder.sh/api/v3/user/status",loginUrl:"https://qoder.com/login"},i={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},j={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"})},k={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},l={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},m={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},n={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},o={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},p={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},q={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},r={baseUrl:"https://copilot.tencent.com",stateUrl:"https://copilot.tencent.com/v2/plugin/auth/state",tokenUrl:"https://copilot.tencent.com/v2/plugin/auth/token",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",platform:"CLI",pollInterval:5e3}},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},66125:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>G,patchFetch:()=>F,routeModule:()=>B,serverHooks:()=>E,workAsyncStorage:()=>C,workUnitAsyncStorage:()=>D});var d={};c.r(d),c.d(d,{GET:()=>A,POST:()=>z});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(47978);class x{constructor(){this.config=w.WN}generateChecksum(a){let b=Math.floor(Date.now()/1e3).toString(),c=165,d=[];for(let a=0;a<b.length;a++){let e=b.charCodeAt(a);d.push(e^c),c=c+e&255}let e=Buffer.from(d).toString("base64");return`${e},${a}`}buildHeaders(a,b,c=!1){let d=this.generateChecksum(b);return{Authorization:`Bearer ${a}`,"Content-Type":"application/connect+proto","Connect-Protocol-Version":"1","x-cursor-client-version":this.config.clientVersion,"x-cursor-client-type":this.config.clientType,"x-cursor-client-os":this.detectOS(),"x-cursor-client-arch":this.detectArch(),"x-cursor-client-device-type":"desktop","x-cursor-checksum":d,"x-ghost-mode":c?"true":"false"}}detectOS(){if("u">typeof process){let a=process.platform;if("win32"===a)return"windows";if("darwin"===a)return"macos"}return"linux"}detectArch(){if("u">typeof process){let a=process.arch;return"x64"===a?"x86_64":"arm64"===a?"aarch64":a}return"x86_64"}async validateImportToken(a,b){if(!a||"string"!=typeof a)throw Error("Access token is required");if(!b||"string"!=typeof b)throw Error("Machine ID is required");if(a.length<50)throw Error("Invalid token format. Token appears too short.");if(!/^[a-f0-9-]{32,}$/i.test(b.replace(/-/g,"")))throw Error("Invalid machine ID format. Expected UUID format.");return{accessToken:a,machineId:b,expiresIn:86400,authMethod:"imported"}}extractUserInfo(a){try{let b=a.split(".");if(3===b.length){let a=b[1];for(;a.length%4;)a+="=";let c=JSON.parse(Buffer.from(a.replace(/-/g,"+").replace(/_/g,"/"),"base64").toString());return{email:c.email||c.sub,userId:c.sub||c.user_id}}}catch{}return null}getTokenStorageInstructions(){return{title:"How to get your Cursor token",steps:["1. Open Cursor IDE and make sure you're logged in","2. Find the state.vscdb file:",` - Linux: ${this.config.tokenStoragePaths.linux}`,` - macOS: ${this.config.tokenStoragePaths.macos}`,` - Windows: ${this.config.tokenStoragePaths.windows}`,"3. Open the database with SQLite browser or CLI:"," sqlite3 state.vscdb \"SELECT value FROM itemTable WHERE key='cursorAuth/accessToken'\"","4. Also get the machine ID:"," sqlite3 state.vscdb \"SELECT value FROM itemTable WHERE key='storage.serviceMachineId'\"","5. Paste both values in the form below"],alternativeMethod:["Or use this one-liner to get both values:","sqlite3 state.vscdb \"SELECT key, value FROM itemTable WHERE key IN ('cursorAuth/accessToken', 'storage.serviceMachineId')\""]}}}var y=c(89442);async function z(a){try{let{accessToken:b,machineId:c}=await a.json();if(!b||"string"!=typeof b)return v.NextResponse.json({error:"Access token is required"},{status:400});if(!c||"string"!=typeof c)return v.NextResponse.json({error:"Machine ID is required"},{status:400});let d=new x,e=await d.validateImportToken(b.trim(),c.trim()),f=d.extractUserInfo(e.accessToken),g=await (0,y.iE)({provider:"cursor",authType:"oauth",accessToken:e.accessToken,refreshToken:null,expiresAt:new Date(Date.now()+1e3*e.expiresIn).toISOString(),email:f?.email||null,providerSpecificData:{machineId:e.machineId,authMethod:"imported",provider:"Imported",userId:f?.userId},testStatus:"active"});return v.NextResponse.json({success:!0,connection:{id:g.id,provider:g.provider,email:g.email}})}catch(a){return console.log("Cursor import token error:",a),v.NextResponse.json({error:a.message},{status:500})}}async function A(){let a=new x().getTokenStorageInstructions();return v.NextResponse.json({provider:"cursor",method:"import_token",instructions:a,requiredFields:[{name:"accessToken",label:"Access Token",description:"From cursorAuth/accessToken in state.vscdb",type:"textarea"},{name:"machineId",label:"Machine ID",description:"From storage.serviceMachineId in state.vscdb",type:"text"}]})}let B=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/cursor/import/route",pathname:"/api/oauth/cursor/import",filename:"route",bundlePath:"app/api/oauth/cursor/import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/cursor/import/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:C,workUnitAsyncStorage:D,serverHooks:E}=B;function F(){return(0,g.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:D})}async function G(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),B.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/cursor/import/route";"/index"===d&&(d="/");let e=await B.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||B.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===B.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await B.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>B.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>B.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await B.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),b}},k=await B.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await B.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73865:(a,b,c)=>{"use strict";c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},81115:a=>{"use strict";a.exports=require("constants")},81372:(a,b,c)=>{"use strict";c.d(b,{n:()=>i});var d=c(33873),e=c.n(d),f=c(21820),g=c.n(f);let h="9router",i=process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?e().join(process.env.APPDATA||e().join(g().homedir(),"AppData","Roaming"),h):e().join(g().homedir(),`.${h}`)},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89442:(a,b,c)=>{"use strict";c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(37770)},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770],()=>b(b.s=66125));module.exports=c})();
1
+ (()=>{var a={};a.id=204,a.ids=[204],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},34278:(a,b,c)=>{"use strict";c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47978:(a,b,c)=>{"use strict";c.d(b,{DI:()=>e,Hp:()=>g,LT:()=>f,MZ:()=>o,Nl:()=>r,Nu:()=>k,OV:()=>d,Tx:()=>l,WN:()=>m,YT:()=>j,ZL:()=>i,f7:()=>q,hF:()=>h,lB:()=>p,t:()=>n}),c(21820);let d={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},e={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},f={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},g={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},h={apiBaseUrl:"https://api2.qoder.sh",deviceTokenUrl:"https://api2.qoder.sh/api/v1/deviceToken/poll",deviceRefreshUrl:"https://api2.qoder.sh/api/v1/deviceToken/refresh",refreshUrl:"https://api2.qoder.sh/api/v3/user/refresh_token",userInfoUrl:"https://api2.qoder.sh/api/v1/userinfo",statusUrl:"https://api2.qoder.sh/api/v3/user/status",loginUrl:"https://qoder.com/login"},i={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},j={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"})},k={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},l={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},m={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},n={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},o={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},p={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},q={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},r={baseUrl:"https://copilot.tencent.com",stateUrl:"https://copilot.tencent.com/v2/plugin/auth/state",tokenUrl:"https://copilot.tencent.com/v2/plugin/auth/token",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",platform:"CLI",pollInterval:5e3}},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73865:(a,b,c)=>{"use strict";c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},81115:a=>{"use strict";a.exports=require("constants")},81372:(a,b,c)=>{"use strict";c.d(b,{n:()=>i});var d=c(33873),e=c.n(d),f=c(21820),g=c.n(f);let h="9router",i=process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?e().join(process.env.APPDATA||e().join(g().homedir(),"AppData","Roaming"),h):e().join(g().homedir(),`.${h}`)},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89442:(a,b,c)=>{"use strict";c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(37770)},92255:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>G,patchFetch:()=>F,routeModule:()=>B,serverHooks:()=>E,workAsyncStorage:()=>C,workUnitAsyncStorage:()=>D});var d={};c.r(d),c.d(d,{GET:()=>A,POST:()=>z});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(47978);class x{constructor(){this.config=w.WN}generateChecksum(a){let b=Math.floor(Date.now()/1e3).toString(),c=165,d=[];for(let a=0;a<b.length;a++){let e=b.charCodeAt(a);d.push(e^c),c=c+e&255}let e=Buffer.from(d).toString("base64");return`${e},${a}`}buildHeaders(a,b,c=!1){let d=this.generateChecksum(b);return{Authorization:`Bearer ${a}`,"Content-Type":"application/connect+proto","Connect-Protocol-Version":"1","x-cursor-client-version":this.config.clientVersion,"x-cursor-client-type":this.config.clientType,"x-cursor-client-os":this.detectOS(),"x-cursor-client-arch":this.detectArch(),"x-cursor-client-device-type":"desktop","x-cursor-checksum":d,"x-ghost-mode":c?"true":"false"}}detectOS(){if("u">typeof process){let a=process.platform;if("win32"===a)return"windows";if("darwin"===a)return"macos"}return"linux"}detectArch(){if("u">typeof process){let a=process.arch;return"x64"===a?"x86_64":"arm64"===a?"aarch64":a}return"x86_64"}async validateImportToken(a,b){if(!a||"string"!=typeof a)throw Error("Access token is required");if(!b||"string"!=typeof b)throw Error("Machine ID is required");if(a.length<50)throw Error("Invalid token format. Token appears too short.");if(!/^[a-f0-9-]{32,}$/i.test(b.replace(/-/g,"")))throw Error("Invalid machine ID format. Expected UUID format.");return{accessToken:a,machineId:b,expiresIn:86400,authMethod:"imported"}}extractUserInfo(a){try{let b=a.split(".");if(3===b.length){let a=b[1];for(;a.length%4;)a+="=";let c=JSON.parse(Buffer.from(a.replace(/-/g,"+").replace(/_/g,"/"),"base64").toString());return{email:c.email||c.sub,userId:c.sub||c.user_id}}}catch{}return null}getTokenStorageInstructions(){return{title:"How to get your Cursor token",steps:["1. Open Cursor IDE and make sure you're logged in","2. Find the state.vscdb file:",` - Linux: ${this.config.tokenStoragePaths.linux}`,` - macOS: ${this.config.tokenStoragePaths.macos}`,` - Windows: ${this.config.tokenStoragePaths.windows}`,"3. Open the database with SQLite browser or CLI:"," sqlite3 state.vscdb \"SELECT value FROM itemTable WHERE key='cursorAuth/accessToken'\"","4. Also get the machine ID:"," sqlite3 state.vscdb \"SELECT value FROM itemTable WHERE key='storage.serviceMachineId'\"","5. Paste both values in the form below"],alternativeMethod:["Or use this one-liner to get both values:","sqlite3 state.vscdb \"SELECT key, value FROM itemTable WHERE key IN ('cursorAuth/accessToken', 'storage.serviceMachineId')\""]}}}var y=c(89442);async function z(a){try{let{accessToken:b,machineId:c}=await a.json();if(!b||"string"!=typeof b)return v.NextResponse.json({error:"Access token is required"},{status:400});if(!c||"string"!=typeof c)return v.NextResponse.json({error:"Machine ID is required"},{status:400});let d=new x,e=await d.validateImportToken(b.trim(),c.trim()),f=d.extractUserInfo(e.accessToken),g=await (0,y.iE)({provider:"cursor",authType:"oauth",accessToken:e.accessToken,refreshToken:null,expiresAt:new Date(Date.now()+1e3*e.expiresIn).toISOString(),email:f?.email||null,providerSpecificData:{machineId:e.machineId,authMethod:"imported",provider:"Imported",userId:f?.userId},testStatus:"active"});return v.NextResponse.json({success:!0,connection:{id:g.id,provider:g.provider,email:g.email}})}catch(a){return console.log("Cursor import token error:",a),v.NextResponse.json({error:a.message},{status:500})}}async function A(){let a=new x().getTokenStorageInstructions();return v.NextResponse.json({provider:"cursor",method:"import_token",instructions:a,requiredFields:[{name:"accessToken",label:"Access Token",description:"From cursorAuth/accessToken in state.vscdb",type:"textarea"},{name:"machineId",label:"Machine ID",description:"From storage.serviceMachineId in state.vscdb",type:"text"}]})}let B=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/cursor/import/route",pathname:"/api/oauth/cursor/import",filename:"route",bundlePath:"app/api/oauth/cursor/import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/cursor/import/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:C,workUnitAsyncStorage:D,serverHooks:E}=B;function F(){return(0,g.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:D})}async function G(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),B.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/cursor/import/route";"/index"===d&&(d="/");let e=await B.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||B.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===B.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await B.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>B.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>B.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await B.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),b}},k=await B.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await B.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770],()=>b(b.s=92255));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=4993,a.ids=[4993],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},14222:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>D,patchFetch:()=>C,routeModule:()=>y,serverHooks:()=>B,workAsyncStorage:()=>z,workUnitAsyncStorage:()=>A});var d={};c.r(d),c.d(d,{POST:()=>x});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(89442);async function x(a){try{let b;try{b=await a.json()}catch{return v.NextResponse.json({error:"Invalid request body"},{status:400})}let{token:c,baseUrl:d}=b;if(!c?.trim())return v.NextResponse.json({error:"Personal Access Token is required"},{status:400});let e=(d?.trim()||"https://gitlab.com").replace(/\/$/,""),f=await fetch(`${e}/api/v4/user`,{headers:{"Private-Token":c.trim(),Accept:"application/json"}});if(!f.ok){let a=await f.text();return v.NextResponse.json({error:`GitLab token verification failed: ${a}`},{status:401})}let g=await f.json(),h=g.email||g.public_email||"";return await (0,w.iE)({provider:"gitlab",authType:"oauth",accessToken:c.trim(),refreshToken:null,expiresAt:null,email:h,displayName:g.name||g.username||h,testStatus:"active",providerSpecificData:{username:g.username||"",email:h,name:g.name||"",baseUrl:e,authKind:"personal_access_token"}}),v.NextResponse.json({success:!0})}catch(a){return console.error("GitLab PAT auth error:",a),v.NextResponse.json({error:a.message},{status:500})}}let y=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/gitlab/pat/route",pathname:"/api/oauth/gitlab/pat",filename:"route",bundlePath:"app/api/oauth/gitlab/pat/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/gitlab/pat/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:z,workUnitAsyncStorage:A,serverHooks:B}=y;function C(){return(0,g.patchFetch)({workAsyncStorage:z,workUnitAsyncStorage:A})}async function D(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),y.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/gitlab/pat/route";"/index"===d&&(d="/");let e=await y.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||y.isDev||z||(K="/index"===(K=E)?"/":K);let L=!0===y.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await y.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>y.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>y.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await y.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await y.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await y.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},34278:(a,b,c)=>{"use strict";c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73865:(a,b,c)=>{"use strict";c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},81115:a=>{"use strict";a.exports=require("constants")},81372:(a,b,c)=>{"use strict";c.d(b,{n:()=>i});var d=c(33873),e=c.n(d),f=c(21820),g=c.n(f);let h="9router",i=process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?e().join(process.env.APPDATA||e().join(g().homedir(),"AppData","Roaming"),h):e().join(g().homedir(),`.${h}`)},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89442:(a,b,c)=>{"use strict";c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(37770)},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770],()=>b(b.s=14222));module.exports=c})();
1
+ (()=>{var a={};a.id=4993,a.ids=[4993],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},16546:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>D,patchFetch:()=>C,routeModule:()=>y,serverHooks:()=>B,workAsyncStorage:()=>z,workUnitAsyncStorage:()=>A});var d={};c.r(d),c.d(d,{POST:()=>x});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(89442);async function x(a){try{let b;try{b=await a.json()}catch{return v.NextResponse.json({error:"Invalid request body"},{status:400})}let{token:c,baseUrl:d}=b;if(!c?.trim())return v.NextResponse.json({error:"Personal Access Token is required"},{status:400});let e=(d?.trim()||"https://gitlab.com").replace(/\/$/,""),f=await fetch(`${e}/api/v4/user`,{headers:{"Private-Token":c.trim(),Accept:"application/json"}});if(!f.ok){let a=await f.text();return v.NextResponse.json({error:`GitLab token verification failed: ${a}`},{status:401})}let g=await f.json(),h=g.email||g.public_email||"";return await (0,w.iE)({provider:"gitlab",authType:"oauth",accessToken:c.trim(),refreshToken:null,expiresAt:null,email:h,displayName:g.name||g.username||h,testStatus:"active",providerSpecificData:{username:g.username||"",email:h,name:g.name||"",baseUrl:e,authKind:"personal_access_token"}}),v.NextResponse.json({success:!0})}catch(a){return console.error("GitLab PAT auth error:",a),v.NextResponse.json({error:a.message},{status:500})}}let y=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/gitlab/pat/route",pathname:"/api/oauth/gitlab/pat",filename:"route",bundlePath:"app/api/oauth/gitlab/pat/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/gitlab/pat/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:z,workUnitAsyncStorage:A,serverHooks:B}=y;function C(){return(0,g.patchFetch)({workAsyncStorage:z,workUnitAsyncStorage:A})}async function D(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),y.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/gitlab/pat/route";"/index"===d&&(d="/");let e=await y.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||y.isDev||z||(K="/index"===(K=E)?"/":K);let L=!0===y.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await y.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>y.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>y.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await y.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await y.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await y.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},34278:(a,b,c)=>{"use strict";c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73865:(a,b,c)=>{"use strict";c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},81115:a=>{"use strict";a.exports=require("constants")},81372:(a,b,c)=>{"use strict";c.d(b,{n:()=>i});var d=c(33873),e=c.n(d),f=c(21820),g=c.n(f);let h="9router",i=process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?e().join(process.env.APPDATA||e().join(g().homedir(),"AppData","Roaming"),h):e().join(g().homedir(),`.${h}`)},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89442:(a,b,c)=>{"use strict";c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(37770)},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770],()=>b(b.s=16546));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=2284,a.ids=[2284],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},34278:(a,b,c)=>{"use strict";c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63574:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>D,patchFetch:()=>C,routeModule:()=>y,serverHooks:()=>B,workAsyncStorage:()=>z,workUnitAsyncStorage:()=>A});var d={};c.r(d),c.d(d,{POST:()=>x});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(89442);async function x(a){try{let{cookie:b}=await a.json();if(!b||"string"!=typeof b)return v.NextResponse.json({error:"Cookie is required"},{status:400});let c=b.trim();if(!c.includes("BXAuth="))return v.NextResponse.json({error:"Cookie must contain BXAuth field"},{status:400});let d=c;d.endsWith(";")||(d+=";");let e=await fetch("https://platform.iflow.cn/api/openapi/apikey",{method:"GET",headers:{Cookie:d,Accept:"application/json, text/plain, */*","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36","Accept-Language":"zh-CN,zh;q=0.9,en;q=0.8","Accept-Encoding":"gzip, deflate, br",Connection:"keep-alive","Sec-Fetch-Dest":"empty","Sec-Fetch-Mode":"cors","Sec-Fetch-Site":"same-origin"}});if(!e.ok){let a=await e.text();return v.NextResponse.json({error:`Failed to fetch API key info: ${a}`},{status:e.status})}let f=await e.json();if(!f.success)return v.NextResponse.json({error:`API key fetch failed: ${f.message}`},{status:400});let g=f.data;if(!g.name)return v.NextResponse.json({error:"Missing name in API key info"},{status:400});let h=await fetch("https://platform.iflow.cn/api/openapi/apikey",{method:"POST",headers:{Cookie:d,"Content-Type":"application/json",Accept:"application/json, text/plain, */*","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36","Accept-Language":"zh-CN,zh;q=0.9,en;q=0.8","Accept-Encoding":"gzip, deflate, br",Connection:"keep-alive",Origin:"https://platform.iflow.cn",Referer:"https://platform.iflow.cn/"},body:JSON.stringify({name:g.name})});if(!h.ok){let a=await h.text();return v.NextResponse.json({error:`Failed to refresh API key: ${a}`},{status:h.status})}let i=await h.json();if(!i.success)return v.NextResponse.json({error:`API key refresh failed: ${i.message}`},{status:400});let j=i.data;if(!j.apiKey)return v.NextResponse.json({error:"Missing API key in response"},{status:400});let k=d.match(/BXAuth=([^;]+)/),l=k?k[1]:"",m=l?`BXAuth=${l};`:"",n=await (0,w.iE)({provider:"iflow",authType:"cookie",name:j.name||g.name,email:j.name||g.name,apiKey:j.apiKey,providerSpecificData:{cookie:m,expireTime:j.expireTime},testStatus:"active",isActive:!0});return v.NextResponse.json({success:!0,connection:{id:n.id,provider:n.provider,email:n.email,apiKey:j.apiKey.substring(0,10)+"...",expireTime:j.expireTime}})}catch(a){return console.error("iFlow cookie auth error:",a),v.NextResponse.json({error:a.message},{status:500})}}let y=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/iflow/cookie/route",pathname:"/api/oauth/iflow/cookie",filename:"route",bundlePath:"app/api/oauth/iflow/cookie/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/iflow/cookie/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:z,workUnitAsyncStorage:A,serverHooks:B}=y;function C(){return(0,g.patchFetch)({workAsyncStorage:z,workUnitAsyncStorage:A})}async function D(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),y.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/iflow/cookie/route";"/index"===d&&(d="/");let e=await y.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||y.isDev||z||(K="/index"===(K=E)?"/":K);let L=!0===y.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await y.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>y.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>y.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await y.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await y.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await y.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},64749:()=>{},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73865:(a,b,c)=>{"use strict";c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},81115:a=>{"use strict";a.exports=require("constants")},81372:(a,b,c)=>{"use strict";c.d(b,{n:()=>i});var d=c(33873),e=c.n(d),f=c(21820),g=c.n(f);let h="9router",i=process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?e().join(process.env.APPDATA||e().join(g().homedir(),"AppData","Roaming"),h):e().join(g().homedir(),`.${h}`)},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89442:(a,b,c)=>{"use strict";c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(37770)},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770],()=>b(b.s=63574));module.exports=c})();
1
+ (()=>{var a={};a.id=2284,a.ids=[2284],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},9510:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>D,patchFetch:()=>C,routeModule:()=>y,serverHooks:()=>B,workAsyncStorage:()=>z,workUnitAsyncStorage:()=>A});var d={};c.r(d),c.d(d,{POST:()=>x});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(89442);async function x(a){try{let{cookie:b}=await a.json();if(!b||"string"!=typeof b)return v.NextResponse.json({error:"Cookie is required"},{status:400});let c=b.trim();if(!c.includes("BXAuth="))return v.NextResponse.json({error:"Cookie must contain BXAuth field"},{status:400});let d=c;d.endsWith(";")||(d+=";");let e=await fetch("https://platform.iflow.cn/api/openapi/apikey",{method:"GET",headers:{Cookie:d,Accept:"application/json, text/plain, */*","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36","Accept-Language":"zh-CN,zh;q=0.9,en;q=0.8","Accept-Encoding":"gzip, deflate, br",Connection:"keep-alive","Sec-Fetch-Dest":"empty","Sec-Fetch-Mode":"cors","Sec-Fetch-Site":"same-origin"}});if(!e.ok){let a=await e.text();return v.NextResponse.json({error:`Failed to fetch API key info: ${a}`},{status:e.status})}let f=await e.json();if(!f.success)return v.NextResponse.json({error:`API key fetch failed: ${f.message}`},{status:400});let g=f.data;if(!g.name)return v.NextResponse.json({error:"Missing name in API key info"},{status:400});let h=await fetch("https://platform.iflow.cn/api/openapi/apikey",{method:"POST",headers:{Cookie:d,"Content-Type":"application/json",Accept:"application/json, text/plain, */*","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36","Accept-Language":"zh-CN,zh;q=0.9,en;q=0.8","Accept-Encoding":"gzip, deflate, br",Connection:"keep-alive",Origin:"https://platform.iflow.cn",Referer:"https://platform.iflow.cn/"},body:JSON.stringify({name:g.name})});if(!h.ok){let a=await h.text();return v.NextResponse.json({error:`Failed to refresh API key: ${a}`},{status:h.status})}let i=await h.json();if(!i.success)return v.NextResponse.json({error:`API key refresh failed: ${i.message}`},{status:400});let j=i.data;if(!j.apiKey)return v.NextResponse.json({error:"Missing API key in response"},{status:400});let k=d.match(/BXAuth=([^;]+)/),l=k?k[1]:"",m=l?`BXAuth=${l};`:"",n=await (0,w.iE)({provider:"iflow",authType:"cookie",name:j.name||g.name,email:j.name||g.name,apiKey:j.apiKey,providerSpecificData:{cookie:m,expireTime:j.expireTime},testStatus:"active",isActive:!0});return v.NextResponse.json({success:!0,connection:{id:n.id,provider:n.provider,email:n.email,apiKey:j.apiKey.substring(0,10)+"...",expireTime:j.expireTime}})}catch(a){return console.error("iFlow cookie auth error:",a),v.NextResponse.json({error:a.message},{status:500})}}let y=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/iflow/cookie/route",pathname:"/api/oauth/iflow/cookie",filename:"route",bundlePath:"app/api/oauth/iflow/cookie/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/iflow/cookie/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:z,workUnitAsyncStorage:A,serverHooks:B}=y;function C(){return(0,g.patchFetch)({workAsyncStorage:z,workUnitAsyncStorage:A})}async function D(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),y.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/iflow/cookie/route";"/index"===d&&(d="/");let e=await y.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||y.isDev||z||(K="/index"===(K=E)?"/":K);let L=!0===y.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await y.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>y.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>y.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await y.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await y.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await y.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},34278:(a,b,c)=>{"use strict";c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73865:(a,b,c)=>{"use strict";c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},81115:a=>{"use strict";a.exports=require("constants")},81372:(a,b,c)=>{"use strict";c.d(b,{n:()=>i});var d=c(33873),e=c.n(d),f=c(21820),g=c.n(f);let h="9router",i=process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?e().join(process.env.APPDATA||e().join(g().homedir(),"AppData","Roaming"),h):e().join(g().homedir(),`.${h}`)},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89442:(a,b,c)=>{"use strict";c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(37770)},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770],()=>b(b.s=9510));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=5107,a.ids=[5107],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},99721:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>F,patchFetch:()=>E,routeModule:()=>A,serverHooks:()=>D,workAsyncStorage:()=>B,workUnitAsyncStorage:()=>C});var d={};c.r(d),c.d(d,{GET:()=>z});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(79748),x=c(21820),y=c(33873);async function z(){try{let a,b=(0,y.join)((0,x.homedir)(),".aws/sso/cache");try{a=await (0,w.readdir)(b)}catch(a){return v.NextResponse.json({found:!1,error:"AWS SSO cache not found. Please login to Kiro IDE first."})}let c=null,d=null,e="kiro-auth-token.json";if(a.includes(e))try{let a=await (0,w.readFile)((0,y.join)(b,e),"utf-8"),f=JSON.parse(a);f.refreshToken&&f.refreshToken.startsWith("aorAAAAAG")&&(c=f.refreshToken,d=e)}catch(a){}if(!c){for(let e of a)if(e.endsWith(".json"))try{let a=await (0,w.readFile)((0,y.join)(b,e),"utf-8"),f=JSON.parse(a);if(f.refreshToken&&f.refreshToken.startsWith("aorAAAAAG")){c=f.refreshToken,d=e;break}}catch(a){continue}}if(!c)return v.NextResponse.json({found:!1,error:"Kiro token not found in AWS SSO cache. Please login to Kiro IDE first."});return v.NextResponse.json({found:!0,refreshToken:c,source:d})}catch(a){return console.log("Kiro auto-import error:",a),v.NextResponse.json({found:!1,error:a.message},{status:500})}}let A=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/auto-import/route",pathname:"/api/oauth/kiro/auto-import",filename:"route",bundlePath:"app/api/oauth/kiro/auto-import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/kiro/auto-import/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:B,workUnitAsyncStorage:C,serverHooks:D}=A;function E(){return(0,g.patchFetch)({workAsyncStorage:B,workUnitAsyncStorage:C})}async function F(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),A.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/auto-import/route";"/index"===d&&(d="/");let e=await A.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||A.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===A.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await A.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>A.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>A.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await A.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await A.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await A.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,6799],()=>b(b.s=99721));module.exports=c})();
1
+ (()=>{var a={};a.id=5107,a.ids=[5107],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},59495:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>F,patchFetch:()=>E,routeModule:()=>A,serverHooks:()=>D,workAsyncStorage:()=>B,workUnitAsyncStorage:()=>C});var d={};c.r(d),c.d(d,{GET:()=>z});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(79748),x=c(21820),y=c(33873);async function z(){try{let a,b=(0,y.join)((0,x.homedir)(),".aws/sso/cache");try{a=await (0,w.readdir)(b)}catch(a){return v.NextResponse.json({found:!1,error:"AWS SSO cache not found. Please login to Kiro IDE first."})}let c=null,d=null,e="kiro-auth-token.json";if(a.includes(e))try{let a=await (0,w.readFile)((0,y.join)(b,e),"utf-8"),f=JSON.parse(a);f.refreshToken&&f.refreshToken.startsWith("aorAAAAAG")&&(c=f.refreshToken,d=e)}catch(a){}if(!c){for(let e of a)if(e.endsWith(".json"))try{let a=await (0,w.readFile)((0,y.join)(b,e),"utf-8"),f=JSON.parse(a);if(f.refreshToken&&f.refreshToken.startsWith("aorAAAAAG")){c=f.refreshToken,d=e;break}}catch(a){continue}}if(!c)return v.NextResponse.json({found:!1,error:"Kiro token not found in AWS SSO cache. Please login to Kiro IDE first."});return v.NextResponse.json({found:!0,refreshToken:c,source:d})}catch(a){return console.log("Kiro auto-import error:",a),v.NextResponse.json({found:!1,error:a.message},{status:500})}}let A=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/auto-import/route",pathname:"/api/oauth/kiro/auto-import",filename:"route",bundlePath:"app/api/oauth/kiro/auto-import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/kiro/auto-import/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:B,workUnitAsyncStorage:C,serverHooks:D}=A;function E(){return(0,g.patchFetch)({workAsyncStorage:B,workUnitAsyncStorage:C})}async function F(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),A.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/auto-import/route";"/index"===d&&(d="/");let e=await A.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||A.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===A.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await A.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>A.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>A.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await A.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await A.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await A.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,6799],()=>b(b.s=59495));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=7429,a.ids=[7429],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34278:(a,b,c)=>{c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},73865:(a,b,c)=>{c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},81115:a=>{a.exports=require("constants")},81372:(a,b,c)=>{c.d(b,{n:()=>i});var d=c(33873),e=c.n(d),f=c(21820),g=c.n(f);let h="9router",i=process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?e().join(process.env.APPDATA||e().join(g().homedir(),"AppData","Roaming"),h):e().join(g().homedir(),`.${h}`)},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89442:(a,b,c)=>{c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(37770)},91766:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{POST:()=>y});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(35445),x=c(89442);async function y(a){try{let{refreshToken:b}=await a.json();if(!b||"string"!=typeof b)return v.NextResponse.json({error:"Refresh token is required"},{status:400});let c=new w.v,d=await c.validateImportToken(b.trim()),e=c.extractEmailFromJWT(d.accessToken),f=await (0,x.iE)({provider:"kiro",authType:"oauth",accessToken:d.accessToken,refreshToken:d.refreshToken,expiresAt:new Date(Date.now()+1e3*d.expiresIn).toISOString(),email:e||null,providerSpecificData:{profileArn:d.profileArn,authMethod:"imported",provider:"Imported"},testStatus:"active"});return v.NextResponse.json({success:!0,connection:{id:f.id,provider:f.provider,email:f.email}})}catch(a){return console.log("Kiro import token error:",a),v.NextResponse.json({error:a.message},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/import/route",pathname:"/api/oauth/kiro/import",filename:"route",bundlePath:"app/api/oauth/kiro/import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/kiro/import/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/import/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770,2141],()=>b(b.s=91766));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=7429,a.ids=[7429],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34278:(a,b,c)=>{c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63757:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{POST:()=>y});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(35445),x=c(89442);async function y(a){try{let{refreshToken:b}=await a.json();if(!b||"string"!=typeof b)return v.NextResponse.json({error:"Refresh token is required"},{status:400});let c=new w.v,d=await c.validateImportToken(b.trim()),e=c.extractEmailFromJWT(d.accessToken),f=await (0,x.iE)({provider:"kiro",authType:"oauth",accessToken:d.accessToken,refreshToken:d.refreshToken,expiresAt:new Date(Date.now()+1e3*d.expiresIn).toISOString(),email:e||null,providerSpecificData:{profileArn:d.profileArn,authMethod:"imported",provider:"Imported"},testStatus:"active"});return v.NextResponse.json({success:!0,connection:{id:f.id,provider:f.provider,email:f.email}})}catch(a){return console.log("Kiro import token error:",a),v.NextResponse.json({error:a.message},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/import/route",pathname:"/api/oauth/kiro/import",filename:"route",bundlePath:"app/api/oauth/kiro/import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/kiro/import/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/import/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},73865:(a,b,c)=>{c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},81115:a=>{a.exports=require("constants")},81372:(a,b,c)=>{c.d(b,{n:()=>i});var d=c(33873),e=c.n(d),f=c(21820),g=c.n(f);let h="9router",i=process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?e().join(process.env.APPDATA||e().join(g().homedir(),"AppData","Roaming"),h):e().join(g().homedir(),`.${h}`)},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89442:(a,b,c)=>{c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(37770)},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770,2141],()=>b(b.s=63757));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=9069,a.ids=[9069],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},2371:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{GET:()=>y});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(9988),x=c(35445);async function y(a){try{let{searchParams:b}=new URL(a.url),c=b.get("provider");if(!c||!["google","github"].includes(c))return v.NextResponse.json({error:"Invalid provider. Use 'google' or 'github'"},{status:400});let{codeVerifier:d,codeChallenge:e,state:f}=(0,w.lz)(),g=new x.v().buildSocialLoginUrl(c,e,f);return v.NextResponse.json({authUrl:g,state:f,codeVerifier:d,codeChallenge:e,provider:c})}catch(a){return console.log("Kiro social authorize error:",a),v.NextResponse.json({error:a.message},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/social-authorize/route",pathname:"/api/oauth/kiro/social-authorize",filename:"route",bundlePath:"app/api/oauth/kiro/social-authorize/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/kiro/social-authorize/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/social-authorize/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},9988:(a,b,c)=>{c.d(b,{lz:()=>f});var d=c(55511),e=c.n(d);function f(){let a=e().randomBytes(32).toString("base64url"),b=e().createHash("sha256").update(a).digest("base64url");return{codeVerifier:a,codeChallenge:b,state:e().randomBytes(32).toString("base64url")}}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,6799,2141],()=>b(b.s=2371));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=9069,a.ids=[9069],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4823:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{GET:()=>y});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(9988),x=c(35445);async function y(a){try{let{searchParams:b}=new URL(a.url),c=b.get("provider");if(!c||!["google","github"].includes(c))return v.NextResponse.json({error:"Invalid provider. Use 'google' or 'github'"},{status:400});let{codeVerifier:d,codeChallenge:e,state:f}=(0,w.lz)(),g=new x.v().buildSocialLoginUrl(c,e,f);return v.NextResponse.json({authUrl:g,state:f,codeVerifier:d,codeChallenge:e,provider:c})}catch(a){return console.log("Kiro social authorize error:",a),v.NextResponse.json({error:a.message},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/social-authorize/route",pathname:"/api/oauth/kiro/social-authorize",filename:"route",bundlePath:"app/api/oauth/kiro/social-authorize/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/kiro/social-authorize/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/social-authorize/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},9988:(a,b,c)=>{c.d(b,{lz:()=>f});var d=c(55511),e=c.n(d);function f(){let a=e().randomBytes(32).toString("base64url"),b=e().createHash("sha256").update(a).digest("base64url");return{codeVerifier:a,codeChallenge:b,state:e().randomBytes(32).toString("base64url")}}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,6799,2141],()=>b(b.s=4823));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=1451,a.ids=[1451],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34278:(a,b,c)=>{c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},72006:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{POST:()=>y});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(35445),x=c(89442);async function y(a){try{let{code:b,codeVerifier:c,provider:d}=await a.json();if(!b||!c)return v.NextResponse.json({error:"Missing required fields"},{status:400});if(!d||!["google","github"].includes(d))return v.NextResponse.json({error:"Invalid provider"},{status:400});let e=new w.v,f=await e.exchangeSocialCode(b,c),g=e.extractEmailFromJWT(f.accessToken),h=await (0,x.iE)({provider:"kiro",authType:"oauth",accessToken:f.accessToken,refreshToken:f.refreshToken,expiresAt:new Date(Date.now()+1e3*f.expiresIn).toISOString(),email:g||null,providerSpecificData:{profileArn:f.profileArn,authMethod:d,provider:d.charAt(0).toUpperCase()+d.slice(1)},testStatus:"active"});return v.NextResponse.json({success:!0,connection:{id:h.id,provider:h.provider,email:h.email}})}catch(a){return console.log("Kiro social exchange error:",a),v.NextResponse.json({error:a.message},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/social-exchange/route",pathname:"/api/oauth/kiro/social-exchange",filename:"route",bundlePath:"app/api/oauth/kiro/social-exchange/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/kiro/social-exchange/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/social-exchange/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},73865:(a,b,c)=>{c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},81115:a=>{a.exports=require("constants")},81372:(a,b,c)=>{c.d(b,{n:()=>i});var d=c(33873),e=c.n(d),f=c(21820),g=c.n(f);let h="9router",i=process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?e().join(process.env.APPDATA||e().join(g().homedir(),"AppData","Roaming"),h):e().join(g().homedir(),`.${h}`)},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89442:(a,b,c)=>{c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(37770)},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770,2141],()=>b(b.s=72006));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=1451,a.ids=[1451],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34278:(a,b,c)=>{c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},73865:(a,b,c)=>{c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},81115:a=>{a.exports=require("constants")},81372:(a,b,c)=>{c.d(b,{n:()=>i});var d=c(33873),e=c.n(d),f=c(21820),g=c.n(f);let h="9router",i=process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?e().join(process.env.APPDATA||e().join(g().homedir(),"AppData","Roaming"),h):e().join(g().homedir(),`.${h}`)},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89442:(a,b,c)=>{c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(37770)},92265:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{POST:()=>y});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(35445),x=c(89442);async function y(a){try{let{code:b,codeVerifier:c,provider:d}=await a.json();if(!b||!c)return v.NextResponse.json({error:"Missing required fields"},{status:400});if(!d||!["google","github"].includes(d))return v.NextResponse.json({error:"Invalid provider"},{status:400});let e=new w.v,f=await e.exchangeSocialCode(b,c),g=e.extractEmailFromJWT(f.accessToken),h=await (0,x.iE)({provider:"kiro",authType:"oauth",accessToken:f.accessToken,refreshToken:f.refreshToken,expiresAt:new Date(Date.now()+1e3*f.expiresIn).toISOString(),email:g||null,providerSpecificData:{profileArn:f.profileArn,authMethod:d,provider:d.charAt(0).toUpperCase()+d.slice(1)},testStatus:"active"});return v.NextResponse.json({success:!0,connection:{id:h.id,provider:h.provider,email:h.email}})}catch(a){return console.log("Kiro social exchange error:",a),v.NextResponse.json({error:a.message},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/social-exchange/route",pathname:"/api/oauth/kiro/social-exchange",filename:"route",bundlePath:"app/api/oauth/kiro/social-exchange/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/kiro/social-exchange/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/social-exchange/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770,2141],()=>b(b.s=92265));module.exports=c})();