@ai-development-environment/server 0.0.103 → 0.0.105

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 (677) hide show
  1. package/package.json +1 -1
  2. package/standalone/.next/BUILD_ID +1 -1
  3. package/standalone/.next/build-manifest.json +3 -3
  4. package/standalone/.next/prerender-manifest.json +3 -3
  5. package/standalone/.next/server/app/[locale]/(auth)/register/page.js +1 -1
  6. package/standalone/.next/server/app/[locale]/(auth)/register/page.js.nft.json +1 -1
  7. package/standalone/.next/server/app/[locale]/(auth)/register/page_client-reference-manifest.js +1 -1
  8. package/standalone/.next/server/app/[locale]/(auth)/sign-in/page.js +1 -1
  9. package/standalone/.next/server/app/[locale]/(auth)/sign-in/page.js.nft.json +1 -1
  10. package/standalone/.next/server/app/[locale]/(auth)/sign-in/page_client-reference-manifest.js +1 -1
  11. package/standalone/.next/server/app/[locale]/(dashboard)/actions/page.js +1 -1
  12. package/standalone/.next/server/app/[locale]/(dashboard)/actions/page.js.nft.json +1 -1
  13. package/standalone/.next/server/app/[locale]/(dashboard)/actions/page_client-reference-manifest.js +1 -1
  14. package/standalone/.next/server/app/[locale]/(dashboard)/actions-cache/page.js +1 -1
  15. package/standalone/.next/server/app/[locale]/(dashboard)/actions-cache/page.js.nft.json +1 -1
  16. package/standalone/.next/server/app/[locale]/(dashboard)/actions-cache/page_client-reference-manifest.js +1 -1
  17. package/standalone/.next/server/app/[locale]/(dashboard)/agents/[id]/page.js +1 -1
  18. package/standalone/.next/server/app/[locale]/(dashboard)/agents/[id]/page.js.nft.json +1 -1
  19. package/standalone/.next/server/app/[locale]/(dashboard)/agents/[id]/page_client-reference-manifest.js +1 -1
  20. package/standalone/.next/server/app/[locale]/(dashboard)/agents/page.js +1 -1
  21. package/standalone/.next/server/app/[locale]/(dashboard)/agents/page.js.nft.json +1 -1
  22. package/standalone/.next/server/app/[locale]/(dashboard)/agents/page_client-reference-manifest.js +1 -1
  23. package/standalone/.next/server/app/[locale]/(dashboard)/analytics-events/page.js +1 -1
  24. package/standalone/.next/server/app/[locale]/(dashboard)/analytics-events/page.js.nft.json +1 -1
  25. package/standalone/.next/server/app/[locale]/(dashboard)/analytics-events/page_client-reference-manifest.js +1 -1
  26. package/standalone/.next/server/app/[locale]/(dashboard)/api-keys/page.js +1 -1
  27. package/standalone/.next/server/app/[locale]/(dashboard)/api-keys/page.js.nft.json +1 -1
  28. package/standalone/.next/server/app/[locale]/(dashboard)/api-keys/page_client-reference-manifest.js +1 -1
  29. package/standalone/.next/server/app/[locale]/(dashboard)/apps/[appId]/page.js +1 -1
  30. package/standalone/.next/server/app/[locale]/(dashboard)/apps/[appId]/page.js.nft.json +1 -1
  31. package/standalone/.next/server/app/[locale]/(dashboard)/apps/[appId]/page_client-reference-manifest.js +1 -1
  32. package/standalone/.next/server/app/[locale]/(dashboard)/apps/page.js +1 -1
  33. package/standalone/.next/server/app/[locale]/(dashboard)/apps/page.js.nft.json +1 -1
  34. package/standalone/.next/server/app/[locale]/(dashboard)/apps/page_client-reference-manifest.js +1 -1
  35. package/standalone/.next/server/app/[locale]/(dashboard)/build-data/page.js +1 -1
  36. package/standalone/.next/server/app/[locale]/(dashboard)/build-data/page.js.nft.json +1 -1
  37. package/standalone/.next/server/app/[locale]/(dashboard)/build-data/page_client-reference-manifest.js +1 -1
  38. package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/coverage/page.js +1 -1
  39. package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/coverage/page.js.nft.json +1 -1
  40. package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/coverage/page_client-reference-manifest.js +1 -1
  41. package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/output/route.js +1 -1
  42. package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/output/route.js.nft.json +1 -1
  43. package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/page.js +1 -1
  44. package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/page.js.nft.json +1 -1
  45. package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/page_client-reference-manifest.js +1 -1
  46. package/standalone/.next/server/app/[locale]/(dashboard)/builds/page.js +1 -1
  47. package/standalone/.next/server/app/[locale]/(dashboard)/builds/page.js.nft.json +1 -1
  48. package/standalone/.next/server/app/[locale]/(dashboard)/builds/page_client-reference-manifest.js +1 -1
  49. package/standalone/.next/server/app/[locale]/(dashboard)/changes/page.js +1 -1
  50. package/standalone/.next/server/app/[locale]/(dashboard)/changes/page.js.nft.json +1 -1
  51. package/standalone/.next/server/app/[locale]/(dashboard)/changes/page_client-reference-manifest.js +1 -1
  52. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/[codebaseId]/page.js +1 -1
  53. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/[codebaseId]/page.js.nft.json +1 -1
  54. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/[codebaseId]/page_client-reference-manifest.js +1 -1
  55. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/page.js +1 -1
  56. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/page.js.nft.json +1 -1
  57. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/page_client-reference-manifest.js +1 -1
  58. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/repositories/[repositoryId]/page.js +1 -1
  59. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/repositories/[repositoryId]/page.js.nft.json +1 -1
  60. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/repositories/[repositoryId]/page_client-reference-manifest.js +1 -1
  61. package/standalone/.next/server/app/[locale]/(dashboard)/commands/[commandId]/edit/page.js +1 -1
  62. package/standalone/.next/server/app/[locale]/(dashboard)/commands/[commandId]/edit/page.js.nft.json +1 -1
  63. package/standalone/.next/server/app/[locale]/(dashboard)/commands/[commandId]/edit/page_client-reference-manifest.js +1 -1
  64. package/standalone/.next/server/app/[locale]/(dashboard)/commands/new/page.js +1 -1
  65. package/standalone/.next/server/app/[locale]/(dashboard)/commands/new/page.js.nft.json +1 -1
  66. package/standalone/.next/server/app/[locale]/(dashboard)/commands/new/page_client-reference-manifest.js +1 -1
  67. package/standalone/.next/server/app/[locale]/(dashboard)/commands/page.js +1 -1
  68. package/standalone/.next/server/app/[locale]/(dashboard)/commands/page.js.nft.json +1 -1
  69. package/standalone/.next/server/app/[locale]/(dashboard)/commands/page_client-reference-manifest.js +1 -1
  70. package/standalone/.next/server/app/[locale]/(dashboard)/commands/runs/[runId]/output/route.js +1 -1
  71. package/standalone/.next/server/app/[locale]/(dashboard)/commands/runs/[runId]/output/route.js.nft.json +1 -1
  72. package/standalone/.next/server/app/[locale]/(dashboard)/commands/runs/[runId]/page.js +1 -1
  73. package/standalone/.next/server/app/[locale]/(dashboard)/commands/runs/[runId]/page.js.nft.json +1 -1
  74. package/standalone/.next/server/app/[locale]/(dashboard)/commands/runs/[runId]/page_client-reference-manifest.js +1 -1
  75. package/standalone/.next/server/app/[locale]/(dashboard)/comments/page.js +1 -1
  76. package/standalone/.next/server/app/[locale]/(dashboard)/comments/page.js.nft.json +1 -1
  77. package/standalone/.next/server/app/[locale]/(dashboard)/comments/page_client-reference-manifest.js +1 -1
  78. package/standalone/.next/server/app/[locale]/(dashboard)/console-logs/page.js +1 -1
  79. package/standalone/.next/server/app/[locale]/(dashboard)/console-logs/page.js.nft.json +1 -1
  80. package/standalone/.next/server/app/[locale]/(dashboard)/console-logs/page_client-reference-manifest.js +1 -1
  81. package/standalone/.next/server/app/[locale]/(dashboard)/costs/page.js +1 -1
  82. package/standalone/.next/server/app/[locale]/(dashboard)/costs/page.js.nft.json +1 -1
  83. package/standalone/.next/server/app/[locale]/(dashboard)/costs/page_client-reference-manifest.js +1 -1
  84. package/standalone/.next/server/app/[locale]/(dashboard)/credentials/page.js +1 -1
  85. package/standalone/.next/server/app/[locale]/(dashboard)/credentials/page.js.nft.json +1 -1
  86. package/standalone/.next/server/app/[locale]/(dashboard)/credentials/page_client-reference-manifest.js +1 -1
  87. package/standalone/.next/server/app/[locale]/(dashboard)/devices/[id]/page.js +1 -1
  88. package/standalone/.next/server/app/[locale]/(dashboard)/devices/[id]/page.js.nft.json +1 -1
  89. package/standalone/.next/server/app/[locale]/(dashboard)/devices/[id]/page_client-reference-manifest.js +1 -1
  90. package/standalone/.next/server/app/[locale]/(dashboard)/devices/enroll/page.js +1 -1
  91. package/standalone/.next/server/app/[locale]/(dashboard)/devices/enroll/page.js.nft.json +1 -1
  92. package/standalone/.next/server/app/[locale]/(dashboard)/devices/enroll/page_client-reference-manifest.js +1 -1
  93. package/standalone/.next/server/app/[locale]/(dashboard)/devices/page.js +1 -1
  94. package/standalone/.next/server/app/[locale]/(dashboard)/devices/page.js.nft.json +1 -1
  95. package/standalone/.next/server/app/[locale]/(dashboard)/devices/page_client-reference-manifest.js +1 -1
  96. package/standalone/.next/server/app/[locale]/(dashboard)/drafts/page.js +1 -1
  97. package/standalone/.next/server/app/[locale]/(dashboard)/drafts/page.js.nft.json +1 -1
  98. package/standalone/.next/server/app/[locale]/(dashboard)/drafts/page_client-reference-manifest.js +1 -1
  99. package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/entries/[id]/page.js +1 -1
  100. package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/entries/[id]/page.js.nft.json +1 -1
  101. package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/entries/[id]/page_client-reference-manifest.js +1 -1
  102. package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/page.js +1 -1
  103. package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/page.js.nft.json +1 -1
  104. package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/page_client-reference-manifest.js +1 -1
  105. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/cache/page.js +1 -1
  106. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/cache/page.js.nft.json +1 -1
  107. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/cache/page_client-reference-manifest.js +1 -1
  108. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/comments/page.js +1 -1
  109. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/comments/page.js.nft.json +1 -1
  110. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/comments/page_client-reference-manifest.js +1 -1
  111. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/[projectId]/[iid]/page.js +1 -1
  112. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/[projectId]/[iid]/page.js.nft.json +1 -1
  113. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/[projectId]/[iid]/page_client-reference-manifest.js +1 -1
  114. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/page.js +1 -1
  115. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/page.js.nft.json +1 -1
  116. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/page_client-reference-manifest.js +1 -1
  117. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/pipelines/page.js +1 -1
  118. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/pipelines/page.js.nft.json +1 -1
  119. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/pipelines/page_client-reference-manifest.js +1 -1
  120. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/webhooks/page.js +1 -1
  121. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/webhooks/page.js.nft.json +1 -1
  122. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/webhooks/page_client-reference-manifest.js +1 -1
  123. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/[issueKey]/page.js +1 -1
  124. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/[issueKey]/page.js.nft.json +1 -1
  125. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
  126. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/page.js +1 -1
  127. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/page.js.nft.json +1 -1
  128. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/page_client-reference-manifest.js +1 -1
  129. package/standalone/.next/server/app/[locale]/(dashboard)/jira-cache/page.js +1 -1
  130. package/standalone/.next/server/app/[locale]/(dashboard)/jira-cache/page.js.nft.json +1 -1
  131. package/standalone/.next/server/app/[locale]/(dashboard)/jira-cache/page_client-reference-manifest.js +1 -1
  132. package/standalone/.next/server/app/[locale]/(dashboard)/jira-cache/tickets/[issueKey]/page.js +1 -1
  133. package/standalone/.next/server/app/[locale]/(dashboard)/jira-cache/tickets/[issueKey]/page.js.nft.json +1 -1
  134. package/standalone/.next/server/app/[locale]/(dashboard)/jira-cache/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
  135. package/standalone/.next/server/app/[locale]/(dashboard)/jira-webhooks/page.js +1 -1
  136. package/standalone/.next/server/app/[locale]/(dashboard)/jira-webhooks/page.js.nft.json +1 -1
  137. package/standalone/.next/server/app/[locale]/(dashboard)/jira-webhooks/page_client-reference-manifest.js +1 -1
  138. package/standalone/.next/server/app/[locale]/(dashboard)/jobs/[jobId]/page.js +1 -1
  139. package/standalone/.next/server/app/[locale]/(dashboard)/jobs/[jobId]/page.js.nft.json +1 -1
  140. package/standalone/.next/server/app/[locale]/(dashboard)/jobs/[jobId]/page_client-reference-manifest.js +1 -1
  141. package/standalone/.next/server/app/[locale]/(dashboard)/notifications/page.js +1 -1
  142. package/standalone/.next/server/app/[locale]/(dashboard)/notifications/page.js.nft.json +1 -1
  143. package/standalone/.next/server/app/[locale]/(dashboard)/notifications/page_client-reference-manifest.js +1 -1
  144. package/standalone/.next/server/app/[locale]/(dashboard)/page.js +1 -1
  145. package/standalone/.next/server/app/[locale]/(dashboard)/page.js.nft.json +1 -1
  146. package/standalone/.next/server/app/[locale]/(dashboard)/page_client-reference-manifest.js +1 -1
  147. package/standalone/.next/server/app/[locale]/(dashboard)/plans/[runId]/page.js +1 -1
  148. package/standalone/.next/server/app/[locale]/(dashboard)/plans/[runId]/page.js.nft.json +1 -1
  149. package/standalone/.next/server/app/[locale]/(dashboard)/plans/[runId]/page_client-reference-manifest.js +1 -1
  150. package/standalone/.next/server/app/[locale]/(dashboard)/plans/page.js +1 -1
  151. package/standalone/.next/server/app/[locale]/(dashboard)/plans/page.js.nft.json +1 -1
  152. package/standalone/.next/server/app/[locale]/(dashboard)/plans/page_client-reference-manifest.js +1 -1
  153. package/standalone/.next/server/app/[locale]/(dashboard)/polling/page.js +1 -1
  154. package/standalone/.next/server/app/[locale]/(dashboard)/polling/page.js.nft.json +1 -1
  155. package/standalone/.next/server/app/[locale]/(dashboard)/polling/page_client-reference-manifest.js +1 -1
  156. package/standalone/.next/server/app/[locale]/(dashboard)/prepare/page.js +1 -1
  157. package/standalone/.next/server/app/[locale]/(dashboard)/prepare/page.js.nft.json +1 -1
  158. package/standalone/.next/server/app/[locale]/(dashboard)/prepare/page_client-reference-manifest.js +1 -1
  159. package/standalone/.next/server/app/[locale]/(dashboard)/provisioning-profiles/[profileId]/page.js +1 -1
  160. package/standalone/.next/server/app/[locale]/(dashboard)/provisioning-profiles/[profileId]/page.js.nft.json +1 -1
  161. package/standalone/.next/server/app/[locale]/(dashboard)/provisioning-profiles/[profileId]/page_client-reference-manifest.js +1 -1
  162. package/standalone/.next/server/app/[locale]/(dashboard)/provisioning-profiles/page.js +1 -1
  163. package/standalone/.next/server/app/[locale]/(dashboard)/provisioning-profiles/page.js.nft.json +1 -1
  164. package/standalone/.next/server/app/[locale]/(dashboard)/provisioning-profiles/page_client-reference-manifest.js +1 -1
  165. package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/[owner]/[repository]/[number]/page.js +1 -1
  166. package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/[owner]/[repository]/[number]/page.js.nft.json +1 -1
  167. package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/[owner]/[repository]/[number]/page_client-reference-manifest.js +1 -1
  168. package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/page.js +1 -1
  169. package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/page.js.nft.json +1 -1
  170. package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/page_client-reference-manifest.js +1 -1
  171. package/standalone/.next/server/app/[locale]/(dashboard)/push-notifications/page.js +1 -1
  172. package/standalone/.next/server/app/[locale]/(dashboard)/push-notifications/page.js.nft.json +1 -1
  173. package/standalone/.next/server/app/[locale]/(dashboard)/push-notifications/page_client-reference-manifest.js +1 -1
  174. package/standalone/.next/server/app/[locale]/(dashboard)/runs/new/page.js +1 -1
  175. package/standalone/.next/server/app/[locale]/(dashboard)/runs/new/page.js.nft.json +1 -1
  176. package/standalone/.next/server/app/[locale]/(dashboard)/runs/new/page_client-reference-manifest.js +1 -1
  177. package/standalone/.next/server/app/[locale]/(dashboard)/sessions/[runId]/page.js +1 -1
  178. package/standalone/.next/server/app/[locale]/(dashboard)/sessions/[runId]/page.js.nft.json +1 -1
  179. package/standalone/.next/server/app/[locale]/(dashboard)/sessions/[runId]/page_client-reference-manifest.js +1 -1
  180. package/standalone/.next/server/app/[locale]/(dashboard)/sessions/page.js +1 -1
  181. package/standalone/.next/server/app/[locale]/(dashboard)/sessions/page.js.nft.json +1 -1
  182. package/standalone/.next/server/app/[locale]/(dashboard)/sessions/page_client-reference-manifest.js +1 -1
  183. package/standalone/.next/server/app/[locale]/(dashboard)/settings/page.js +1 -1
  184. package/standalone/.next/server/app/[locale]/(dashboard)/settings/page.js.nft.json +1 -1
  185. package/standalone/.next/server/app/[locale]/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  186. package/standalone/.next/server/app/[locale]/(dashboard)/skills/[skillId]/page.js +1 -1
  187. package/standalone/.next/server/app/[locale]/(dashboard)/skills/[skillId]/page.js.nft.json +1 -1
  188. package/standalone/.next/server/app/[locale]/(dashboard)/skills/[skillId]/page_client-reference-manifest.js +1 -1
  189. package/standalone/.next/server/app/[locale]/(dashboard)/skills/groups/[groupId]/page.js +1 -1
  190. package/standalone/.next/server/app/[locale]/(dashboard)/skills/groups/[groupId]/page.js.nft.json +1 -1
  191. package/standalone/.next/server/app/[locale]/(dashboard)/skills/groups/[groupId]/page_client-reference-manifest.js +1 -1
  192. package/standalone/.next/server/app/[locale]/(dashboard)/skills/groups/page.js +1 -1
  193. package/standalone/.next/server/app/[locale]/(dashboard)/skills/groups/page.js.nft.json +1 -1
  194. package/standalone/.next/server/app/[locale]/(dashboard)/skills/groups/page_client-reference-manifest.js +1 -1
  195. package/standalone/.next/server/app/[locale]/(dashboard)/skills/page.js +1 -1
  196. package/standalone/.next/server/app/[locale]/(dashboard)/skills/page.js.nft.json +1 -1
  197. package/standalone/.next/server/app/[locale]/(dashboard)/skills/page_client-reference-manifest.js +1 -1
  198. package/standalone/.next/server/app/[locale]/(dashboard)/skills/sync/[runId]/page.js +1 -1
  199. package/standalone/.next/server/app/[locale]/(dashboard)/skills/sync/[runId]/page.js.nft.json +1 -1
  200. package/standalone/.next/server/app/[locale]/(dashboard)/skills/sync/[runId]/page_client-reference-manifest.js +1 -1
  201. package/standalone/.next/server/app/[locale]/(dashboard)/sse/[endpointId]/mocks/page.js +1 -1
  202. package/standalone/.next/server/app/[locale]/(dashboard)/sse/[endpointId]/mocks/page.js.nft.json +1 -1
  203. package/standalone/.next/server/app/[locale]/(dashboard)/sse/[endpointId]/mocks/page_client-reference-manifest.js +1 -1
  204. package/standalone/.next/server/app/[locale]/(dashboard)/sse/[endpointId]/page.js +1 -1
  205. package/standalone/.next/server/app/[locale]/(dashboard)/sse/[endpointId]/page.js.nft.json +1 -1
  206. package/standalone/.next/server/app/[locale]/(dashboard)/sse/[endpointId]/page_client-reference-manifest.js +1 -1
  207. package/standalone/.next/server/app/[locale]/(dashboard)/sse/breakpoints/page.js +1 -1
  208. package/standalone/.next/server/app/[locale]/(dashboard)/sse/breakpoints/page.js.nft.json +1 -1
  209. package/standalone/.next/server/app/[locale]/(dashboard)/sse/breakpoints/page_client-reference-manifest.js +1 -1
  210. package/standalone/.next/server/app/[locale]/(dashboard)/sse/history/[requestId]/page.js +1 -1
  211. package/standalone/.next/server/app/[locale]/(dashboard)/sse/history/[requestId]/page.js.nft.json +1 -1
  212. package/standalone/.next/server/app/[locale]/(dashboard)/sse/history/[requestId]/page_client-reference-manifest.js +1 -1
  213. package/standalone/.next/server/app/[locale]/(dashboard)/sse/history/page.js +1 -1
  214. package/standalone/.next/server/app/[locale]/(dashboard)/sse/history/page.js.nft.json +1 -1
  215. package/standalone/.next/server/app/[locale]/(dashboard)/sse/history/page_client-reference-manifest.js +1 -1
  216. package/standalone/.next/server/app/[locale]/(dashboard)/sse/new/page.js +1 -1
  217. package/standalone/.next/server/app/[locale]/(dashboard)/sse/new/page.js.nft.json +1 -1
  218. package/standalone/.next/server/app/[locale]/(dashboard)/sse/new/page_client-reference-manifest.js +1 -1
  219. package/standalone/.next/server/app/[locale]/(dashboard)/sse/page.js +1 -1
  220. package/standalone/.next/server/app/[locale]/(dashboard)/sse/page.js.nft.json +1 -1
  221. package/standalone/.next/server/app/[locale]/(dashboard)/sse/page_client-reference-manifest.js +1 -1
  222. package/standalone/.next/server/app/[locale]/(dashboard)/sse/storage/page.js +1 -1
  223. package/standalone/.next/server/app/[locale]/(dashboard)/sse/storage/page.js.nft.json +1 -1
  224. package/standalone/.next/server/app/[locale]/(dashboard)/sse/storage/page_client-reference-manifest.js +1 -1
  225. package/standalone/.next/server/app/[locale]/(dashboard)/status/page.js +1 -1
  226. package/standalone/.next/server/app/[locale]/(dashboard)/status/page.js.nft.json +1 -1
  227. package/standalone/.next/server/app/[locale]/(dashboard)/status/page_client-reference-manifest.js +1 -1
  228. package/standalone/.next/server/app/[locale]/(dashboard)/tailscale/page.js +1 -1
  229. package/standalone/.next/server/app/[locale]/(dashboard)/tailscale/page.js.nft.json +1 -1
  230. package/standalone/.next/server/app/[locale]/(dashboard)/tailscale/page_client-reference-manifest.js +1 -1
  231. package/standalone/.next/server/app/[locale]/(dashboard)/tools/page.js +1 -1
  232. package/standalone/.next/server/app/[locale]/(dashboard)/tools/page.js.nft.json +1 -1
  233. package/standalone/.next/server/app/[locale]/(dashboard)/tools/page_client-reference-manifest.js +1 -1
  234. package/standalone/.next/server/app/[locale]/(dashboard)/unified-events/page.js +1 -1
  235. package/standalone/.next/server/app/[locale]/(dashboard)/unified-events/page.js.nft.json +1 -1
  236. package/standalone/.next/server/app/[locale]/(dashboard)/unified-events/page_client-reference-manifest.js +1 -1
  237. package/standalone/.next/server/app/[locale]/(dashboard)/usage/page.js +1 -1
  238. package/standalone/.next/server/app/[locale]/(dashboard)/usage/page.js.nft.json +1 -1
  239. package/standalone/.next/server/app/[locale]/(dashboard)/usage/page_client-reference-manifest.js +1 -1
  240. package/standalone/.next/server/app/[locale]/(dashboard)/users/page.js +1 -1
  241. package/standalone/.next/server/app/[locale]/(dashboard)/users/page.js.nft.json +1 -1
  242. package/standalone/.next/server/app/[locale]/(dashboard)/users/page_client-reference-manifest.js +1 -1
  243. package/standalone/.next/server/app/[locale]/(dashboard)/webhooks/page.js +1 -1
  244. package/standalone/.next/server/app/[locale]/(dashboard)/webhooks/page.js.nft.json +1 -1
  245. package/standalone/.next/server/app/[locale]/(dashboard)/webhooks/page_client-reference-manifest.js +1 -1
  246. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/edit/page.js +1 -1
  247. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/edit/page.js.nft.json +1 -1
  248. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/edit/page_client-reference-manifest.js +1 -1
  249. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/page.js +1 -1
  250. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/page.js.nft.json +1 -1
  251. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/page_client-reference-manifest.js +1 -1
  252. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/new/page.js +1 -1
  253. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/new/page.js.nft.json +1 -1
  254. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/new/page_client-reference-manifest.js +1 -1
  255. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/page.js +1 -1
  256. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/page.js.nft.json +1 -1
  257. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/page_client-reference-manifest.js +1 -1
  258. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/runs/[runId]/page.js +1 -1
  259. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/runs/[runId]/page.js.nft.json +1 -1
  260. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/runs/[runId]/page_client-reference-manifest.js +1 -1
  261. package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/[worktreeId]/page.js +1 -1
  262. package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/[worktreeId]/page.js.nft.json +1 -1
  263. package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/[worktreeId]/page_client-reference-manifest.js +1 -1
  264. package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/page.js +1 -1
  265. package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/page.js.nft.json +1 -1
  266. package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/page_client-reference-manifest.js +1 -1
  267. package/standalone/.next/server/app/_global-error.html +1 -1
  268. package/standalone/.next/server/app/_global-error.rsc +1 -1
  269. package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  270. package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  271. package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  272. package/standalone/.next/server/app/_not-found.html +1 -1
  273. package/standalone/.next/server/app/_not-found.rsc +1 -1
  274. package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  275. package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  276. package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  277. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/complete/route.js +1 -1
  278. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/complete/route.js.nft.json +1 -1
  279. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/download/route.js +1 -1
  280. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/download/route.js.nft.json +1 -1
  281. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/route.js +1 -1
  282. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/route.js.nft.json +1 -1
  283. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/upload/route.js +1 -1
  284. package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/upload/route.js.nft.json +1 -1
  285. package/standalone/.next/server/app/api/agent/run-attachments/[attachmentId]/route.js +1 -1
  286. package/standalone/.next/server/app/api/agent/run-attachments/[attachmentId]/route.js.nft.json +1 -1
  287. package/standalone/.next/server/app/api/auth/[...all]/route.js +1 -1
  288. package/standalone/.next/server/app/api/auth/[...all]/route.js.nft.json +1 -1
  289. package/standalone/.next/server/app/api/auth/config/route.js +1 -1
  290. package/standalone/.next/server/app/api/auth/config/route.js.nft.json +1 -1
  291. package/standalone/.next/server/app/api/auth/management/api-keys/[keyId]/route.js +1 -1
  292. package/standalone/.next/server/app/api/auth/management/api-keys/[keyId]/route.js.nft.json +1 -1
  293. package/standalone/.next/server/app/api/auth/management/api-keys/route.js +1 -1
  294. package/standalone/.next/server/app/api/auth/management/api-keys/route.js.nft.json +1 -1
  295. package/standalone/.next/server/app/api/auth/management/registration/route.js +1 -1
  296. package/standalone/.next/server/app/api/auth/management/registration/route.js.nft.json +1 -1
  297. package/standalone/.next/server/app/api/auth/management/sessions/[sessionId]/route.js +1 -1
  298. package/standalone/.next/server/app/api/auth/management/sessions/[sessionId]/route.js.nft.json +1 -1
  299. package/standalone/.next/server/app/api/auth/management/users/[userId]/route.js +1 -1
  300. package/standalone/.next/server/app/api/auth/management/users/[userId]/route.js.nft.json +1 -1
  301. package/standalone/.next/server/app/api/auth/management/users/route.js +1 -1
  302. package/standalone/.next/server/app/api/auth/management/users/route.js.nft.json +1 -1
  303. package/standalone/.next/server/app/api/auth/mobile/oauth/complete/route.js +1 -1
  304. package/standalone/.next/server/app/api/auth/mobile/oauth/complete/route.js.nft.json +1 -1
  305. package/standalone/.next/server/app/api/auth/mobile/oauth/start/route.js +1 -1
  306. package/standalone/.next/server/app/api/auth/mobile/oauth/start/route.js.nft.json +1 -1
  307. package/standalone/.next/server/app/api/auth/mobile/redeem/route.js +1 -1
  308. package/standalone/.next/server/app/api/auth/mobile/redeem/route.js.nft.json +1 -1
  309. package/standalone/.next/server/app/api/build-artifact-uploads/[uploadId]/route.js +1 -1
  310. package/standalone/.next/server/app/api/build-artifact-uploads/[uploadId]/route.js.nft.json +1 -1
  311. package/standalone/.next/server/app/api/codebases/by-path/route.js +1 -1
  312. package/standalone/.next/server/app/api/codebases/by-path/route.js.nft.json +1 -1
  313. package/standalone/.next/server/app/api/codebases/route.js +1 -1
  314. package/standalone/.next/server/app/api/codebases/route.js.nft.json +1 -1
  315. package/standalone/.next/server/app/api/graphql/route.js +1 -1
  316. package/standalone/.next/server/app/api/graphql/route.js.nft.json +1 -1
  317. package/standalone/.next/server/app/api/ios/apns-devices/route.js +1 -1
  318. package/standalone/.next/server/app/api/ios/apns-devices/route.js.nft.json +1 -1
  319. package/standalone/.next/server/app/api/ios/devices/export.tsv/route.js +1 -1
  320. package/standalone/.next/server/app/api/ios/devices/export.tsv/route.js.nft.json +1 -1
  321. package/standalone/.next/server/app/api/ios/enrollment/start/route.js +1 -1
  322. package/standalone/.next/server/app/api/ios/enrollment/start/route.js.nft.json +1 -1
  323. package/standalone/.next/server/app/api/ios/notification-devices/route.js +1 -1
  324. package/standalone/.next/server/app/api/ios/notification-devices/route.js.nft.json +1 -1
  325. package/standalone/.next/server/app/api/mcp/route.js +1 -1
  326. package/standalone/.next/server/app/api/mcp/route.js.nft.json +1 -1
  327. package/standalone/.next/server/app/api/public/builds/[buildId]/artifacts/[artifactId]/manifest.plist/route.js +1 -1
  328. package/standalone/.next/server/app/api/public/builds/[buildId]/artifacts/[artifactId]/manifest.plist/route.js.nft.json +1 -1
  329. package/standalone/.next/server/app/api/public/builds/[buildId]/artifacts/[artifactId]/route.js +1 -1
  330. package/standalone/.next/server/app/api/public/builds/[buildId]/artifacts/[artifactId]/route.js.nft.json +1 -1
  331. package/standalone/.next/server/app/api/public/github/webhook/route.js +1 -1
  332. package/standalone/.next/server/app/api/public/github/webhook/route.js.nft.json +1 -1
  333. package/standalone/.next/server/app/api/public/gitlab/webhook/route.js +1 -1
  334. package/standalone/.next/server/app/api/public/gitlab/webhook/route.js.nft.json +1 -1
  335. package/standalone/.next/server/app/api/public/ios/enrollment-profile/route.js +1 -1
  336. package/standalone/.next/server/app/api/public/ios/enrollment-profile/route.js.nft.json +1 -1
  337. package/standalone/.next/server/app/api/public/ios/profile-response/route.js +1 -1
  338. package/standalone/.next/server/app/api/public/ios/profile-response/route.js.nft.json +1 -1
  339. package/standalone/.next/server/app/api/public/jira/webhook/route.js +1 -1
  340. package/standalone/.next/server/app/api/public/jira/webhook/route.js.nft.json +1 -1
  341. package/standalone/.next/server/app/api/public/sse/[token]/route.js +1 -1
  342. package/standalone/.next/server/app/api/public/sse/[token]/route.js.nft.json +1 -1
  343. package/standalone/.next/server/app/api/run-attachments/[attachmentId]/route.js +1 -1
  344. package/standalone/.next/server/app/api/run-attachments/[attachmentId]/route.js.nft.json +1 -1
  345. package/standalone/.next/server/app/api/run-attachments/route.js +1 -1
  346. package/standalone/.next/server/app/api/run-attachments/route.js.nft.json +1 -1
  347. package/standalone/.next/server/app/api/sse/history/export/route.js +1 -1
  348. package/standalone/.next/server/app/api/sse/history/export/route.js.nft.json +1 -1
  349. package/standalone/.next/server/app/api/telemetry/analytics-events/route.js +1 -1
  350. package/standalone/.next/server/app/api/telemetry/analytics-events/route.js.nft.json +1 -1
  351. package/standalone/.next/server/app/api/telemetry/console-logs/route.js +1 -1
  352. package/standalone/.next/server/app/api/telemetry/console-logs/route.js.nft.json +1 -1
  353. package/standalone/.next/server/app/api/telemetry/export/route.js +1 -1
  354. package/standalone/.next/server/app/api/telemetry/export/route.js.nft.json +1 -1
  355. package/standalone/.next/server/app/api/tools/call/route.js +1 -1
  356. package/standalone/.next/server/app/api/tools/call/route.js.nft.json +1 -1
  357. package/standalone/.next/server/app/api/tools/catalog/route.js +1 -1
  358. package/standalone/.next/server/app/api/tools/catalog/route.js.nft.json +1 -1
  359. package/standalone/.next/server/app/api/worktrees/[worktreeId]/diff-image/route.js +1 -1
  360. package/standalone/.next/server/app/api/worktrees/[worktreeId]/diff-image/route.js.nft.json +1 -1
  361. package/standalone/.next/server/chunks/{[root-of-the-server]__0pftx4_._.js → [root-of-the-server]__0-1z315._.js} +2 -2
  362. package/standalone/.next/server/chunks/{[root-of-the-server]__008-2eh._.js → [root-of-the-server]__0-h6hod._.js} +2 -2
  363. package/standalone/.next/server/chunks/{[root-of-the-server]__06alvfk._.js → [root-of-the-server]__0-u03f1._.js} +1 -1
  364. package/standalone/.next/server/chunks/{[root-of-the-server]__0-uklj2._.js → [root-of-the-server]__008w201._.js} +1 -1
  365. package/standalone/.next/server/chunks/{[root-of-the-server]__0-5-ijj._.js → [root-of-the-server]__017u6vp._.js} +1 -1
  366. package/standalone/.next/server/chunks/{[root-of-the-server]__0-__aom._.js → [root-of-the-server]__026n72c._.js} +1 -1
  367. package/standalone/.next/server/chunks/{[root-of-the-server]__05b0yhe._.js → [root-of-the-server]__02gan7e._.js} +1 -1
  368. package/standalone/.next/server/chunks/{[root-of-the-server]__1u8650_._.js → [root-of-the-server]__031mdlw._.js} +2 -2
  369. package/standalone/.next/server/chunks/{[root-of-the-server]__0-jt09-._.js → [root-of-the-server]__03fzm17._.js} +1 -1
  370. package/standalone/.next/server/chunks/{[root-of-the-server]__0-nblo_._.js → [root-of-the-server]__03l9kl3._.js} +1 -1
  371. package/standalone/.next/server/chunks/{[root-of-the-server]__03nqlt_._.js → [root-of-the-server]__05drfty._.js} +1 -1
  372. package/standalone/.next/server/chunks/{[root-of-the-server]__05td-p5._.js → [root-of-the-server]__05l5pw9._.js} +1 -1
  373. package/standalone/.next/server/chunks/[root-of-the-server]__05lax__._.js +3 -0
  374. package/standalone/.next/server/chunks/{[root-of-the-server]__0-l7oai._.js → [root-of-the-server]__06p9h4h._.js} +1 -1
  375. package/standalone/.next/server/chunks/[root-of-the-server]__06ss11_._.js +3 -0
  376. package/standalone/.next/server/chunks/{[root-of-the-server]__016rrtq._.js → [root-of-the-server]__07_ap71._.js} +1 -1
  377. package/standalone/.next/server/chunks/[root-of-the-server]__07jo7cq._.js +3 -0
  378. package/standalone/.next/server/chunks/[root-of-the-server]__08bhgy2._.js +3 -0
  379. package/standalone/.next/server/chunks/{[root-of-the-server]__0418l7g._.js → [root-of-the-server]__091i6h5._.js} +1 -1
  380. package/standalone/.next/server/chunks/[root-of-the-server]__09_iley._.js +3 -0
  381. package/standalone/.next/server/chunks/[root-of-the-server]__09ip98g._.js +3 -0
  382. package/standalone/.next/server/chunks/{[root-of-the-server]__003a_z1._.js → [root-of-the-server]__09lxrbf._.js} +1 -1
  383. package/standalone/.next/server/chunks/{[root-of-the-server]__082iwcf._.js → [root-of-the-server]__09xml_-._.js} +1 -1
  384. package/standalone/.next/server/chunks/{[root-of-the-server]__04d42w9._.js → [root-of-the-server]__0a2-sb-._.js} +2 -2
  385. package/standalone/.next/server/chunks/{[root-of-the-server]__02aif-e._.js → [root-of-the-server]__0a3nt0c._.js} +1 -1
  386. package/standalone/.next/server/chunks/{[root-of-the-server]__1moxr-1._.js → [root-of-the-server]__0a4ns45._.js} +2 -2
  387. package/standalone/.next/server/chunks/{[root-of-the-server]__1adx_n3._.js → [root-of-the-server]__0a_bt4t._.js} +2 -2
  388. package/standalone/.next/server/chunks/{[root-of-the-server]__08fe1t5._.js → [root-of-the-server]__0abcqvc._.js} +1 -1
  389. package/standalone/.next/server/chunks/[root-of-the-server]__0ah_x0d._.js +3 -0
  390. package/standalone/.next/server/chunks/[root-of-the-server]__0c2l-2l._.js +3 -0
  391. package/standalone/.next/server/chunks/{[root-of-the-server]__0som2ah._.js → [root-of-the-server]__0ccuegb._.js} +2 -2
  392. package/standalone/.next/server/chunks/{[root-of-the-server]__01gh89w._.js → [root-of-the-server]__0cdvbhy._.js} +1 -1
  393. package/standalone/.next/server/chunks/{[root-of-the-server]__1m98kvc._.js → [root-of-the-server]__0ciq1bb._.js} +2 -2
  394. package/standalone/.next/server/chunks/{[root-of-the-server]__0bl1lat._.js → [root-of-the-server]__0cpnota._.js} +1 -1
  395. package/standalone/.next/server/chunks/[root-of-the-server]__0d4j-k8._.js +3 -0
  396. package/standalone/.next/server/chunks/[root-of-the-server]__0ds-nea._.js +3 -0
  397. package/standalone/.next/server/chunks/{[root-of-the-server]__19a3tcu._.js → [root-of-the-server]__0euccqa._.js} +1 -1
  398. package/standalone/.next/server/chunks/{[root-of-the-server]__0meqeo0._.js → [root-of-the-server]__0fi-6hj._.js} +1 -1
  399. package/standalone/.next/server/chunks/{[root-of-the-server]__0ynwgfc._.js → [root-of-the-server]__0gdquzc._.js} +2 -2
  400. package/standalone/.next/server/chunks/{[root-of-the-server]__03xyftj._.js → [root-of-the-server]__0gowrk2._.js} +1 -1
  401. package/standalone/.next/server/chunks/[root-of-the-server]__0gvjl5i._.js +3 -0
  402. package/standalone/.next/server/chunks/[root-of-the-server]__0gzp60j._.js +3 -0
  403. package/standalone/.next/server/chunks/[root-of-the-server]__0h5uq70._.js +3 -0
  404. package/standalone/.next/server/chunks/[root-of-the-server]__0i6co60._.js +1 -1
  405. package/standalone/.next/server/chunks/[root-of-the-server]__0ix1ahr._.js +3 -0
  406. package/standalone/.next/server/chunks/[root-of-the-server]__0jaiizx._.js +3 -0
  407. package/standalone/.next/server/chunks/[root-of-the-server]__0jbthmv._.js +3 -0
  408. package/standalone/.next/server/chunks/[root-of-the-server]__0kjbziu._.js +3 -0
  409. package/standalone/.next/server/chunks/[root-of-the-server]__0kpcc3r._.js +3 -0
  410. package/standalone/.next/server/chunks/[root-of-the-server]__0kwguoc._.js +3 -0
  411. package/standalone/.next/server/chunks/[root-of-the-server]__0l_rmbb._.js +3 -0
  412. package/standalone/.next/server/chunks/[root-of-the-server]__0m-8xhj._.js +3 -0
  413. package/standalone/.next/server/chunks/[root-of-the-server]__0mkq5nf._.js +3 -0
  414. package/standalone/.next/server/chunks/{[root-of-the-server]__1d2ytms._.js → [root-of-the-server]__0mlidx7._.js} +2 -2
  415. package/standalone/.next/server/chunks/{[root-of-the-server]__0esm0f-._.js → [root-of-the-server]__0mtdzeh._.js} +2 -2
  416. package/standalone/.next/server/chunks/{[root-of-the-server]__0km8fy0._.js → [root-of-the-server]__0n-sidi._.js} +2 -2
  417. package/standalone/.next/server/chunks/[root-of-the-server]__0n9a48o._.js +3 -0
  418. package/standalone/.next/server/chunks/[root-of-the-server]__0ndxzjb._.js +3 -0
  419. package/standalone/.next/server/chunks/[root-of-the-server]__0oxg83m._.js +3 -0
  420. package/standalone/.next/server/chunks/{[root-of-the-server]__1goyat3._.js → [root-of-the-server]__0pjv_oq._.js} +2 -2
  421. package/standalone/.next/server/chunks/[root-of-the-server]__0py42vf._.js +3 -0
  422. package/standalone/.next/server/chunks/[root-of-the-server]__0q2u5vf._.js +3 -0
  423. package/standalone/.next/server/chunks/[root-of-the-server]__0q6wif7._.js +3 -0
  424. package/standalone/.next/server/chunks/{[root-of-the-server]__10wri77._.js → [root-of-the-server]__0qb75r2._.js} +2 -2
  425. package/standalone/.next/server/chunks/[root-of-the-server]__0qp0un9._.js +3 -0
  426. package/standalone/.next/server/chunks/[root-of-the-server]__0sf6zxl._.js +3 -0
  427. package/standalone/.next/server/chunks/[root-of-the-server]__0t8gllb._.js +3 -0
  428. package/standalone/.next/server/chunks/[root-of-the-server]__0tpjilm._.js +3 -0
  429. package/standalone/.next/server/chunks/[root-of-the-server]__0umogw3._.js +3 -0
  430. package/standalone/.next/server/chunks/[root-of-the-server]__0uzqpro._.js +3 -0
  431. package/standalone/.next/server/chunks/[root-of-the-server]__0vvc984._.js +3 -0
  432. package/standalone/.next/server/chunks/[root-of-the-server]__0w3ozyh._.js +3 -0
  433. package/standalone/.next/server/chunks/{[root-of-the-server]__1hwt2p2._.js → [root-of-the-server]__0wljfol._.js} +2 -2
  434. package/standalone/.next/server/chunks/[root-of-the-server]__0x-posm._.js +3 -0
  435. package/standalone/.next/server/chunks/[root-of-the-server]__0x2gige._.js +3 -0
  436. package/standalone/.next/server/chunks/[root-of-the-server]__0xkrt2c._.js +3 -0
  437. package/standalone/.next/server/chunks/[root-of-the-server]__0xqlfuq._.js +3 -0
  438. package/standalone/.next/server/chunks/[root-of-the-server]__0yd7pt7._.js +3 -0
  439. package/standalone/.next/server/chunks/[root-of-the-server]__0z6i23o._.js +3 -0
  440. package/standalone/.next/server/chunks/[root-of-the-server]__0z7raqx._.js +3 -0
  441. package/standalone/.next/server/chunks/[root-of-the-server]__1-6mk9r._.js +3 -0
  442. package/standalone/.next/server/chunks/[root-of-the-server]__1-o7if-._.js +3 -0
  443. package/standalone/.next/server/chunks/[root-of-the-server]__1-t49h_._.js +3 -0
  444. package/standalone/.next/server/chunks/[root-of-the-server]__104z1gt._.js +3 -0
  445. package/standalone/.next/server/chunks/[root-of-the-server]__10cko7c._.js +3 -0
  446. package/standalone/.next/server/chunks/[root-of-the-server]__10z41pf._.js +3 -0
  447. package/standalone/.next/server/chunks/{[root-of-the-server]__0zhffo0._.js → [root-of-the-server]__117qim2._.js} +2 -2
  448. package/standalone/.next/server/chunks/[root-of-the-server]__11_pg0_._.js +3 -0
  449. package/standalone/.next/server/chunks/[root-of-the-server]__12-zogr._.js +3 -0
  450. package/standalone/.next/server/chunks/[root-of-the-server]__12s9_gv._.js +3 -0
  451. package/standalone/.next/server/chunks/[root-of-the-server]__139ypjb._.js +3 -0
  452. package/standalone/.next/server/chunks/[root-of-the-server]__13fuxw1._.js +3 -0
  453. package/standalone/.next/server/chunks/[root-of-the-server]__14jdhch._.js +3 -0
  454. package/standalone/.next/server/chunks/[root-of-the-server]__154rhq6._.js +3 -0
  455. package/standalone/.next/server/chunks/[root-of-the-server]__15f0kzr._.js +3 -0
  456. package/standalone/.next/server/chunks/[root-of-the-server]__16529yo._.js +3 -0
  457. package/standalone/.next/server/chunks/{[root-of-the-server]__1jmg8g6._.js → [root-of-the-server]__173ds9r._.js} +2 -2
  458. package/standalone/.next/server/chunks/[root-of-the-server]__177edxq._.js +3 -0
  459. package/standalone/.next/server/chunks/[root-of-the-server]__17d5k-p._.js +3 -0
  460. package/standalone/.next/server/chunks/[root-of-the-server]__18-5hbn._.js +3 -0
  461. package/standalone/.next/server/chunks/[root-of-the-server]__180d_8r._.js +3 -0
  462. package/standalone/.next/server/chunks/[root-of-the-server]__197242j._.js +3 -0
  463. package/standalone/.next/server/chunks/[root-of-the-server]__19c1-0o._.js +3 -0
  464. package/standalone/.next/server/chunks/{[root-of-the-server]__0ybzlg-._.js → [root-of-the-server]__1_3t6gq._.js} +2 -2
  465. package/standalone/.next/server/chunks/[root-of-the-server]__1_dqx4a._.js +3 -0
  466. package/standalone/.next/server/chunks/[root-of-the-server]__1a4tskl._.js +3 -0
  467. package/standalone/.next/server/chunks/[root-of-the-server]__1a75jia._.js +3 -0
  468. package/standalone/.next/server/chunks/[root-of-the-server]__1a9xwwe._.js +3 -0
  469. package/standalone/.next/server/chunks/[root-of-the-server]__1bb79ej._.js +3 -0
  470. package/standalone/.next/server/chunks/[root-of-the-server]__1cgyjel._.js +3 -0
  471. package/standalone/.next/server/chunks/[root-of-the-server]__1d5-kei._.js +3 -0
  472. package/standalone/.next/server/chunks/[root-of-the-server]__1d5f3go._.js +3 -0
  473. package/standalone/.next/server/chunks/[root-of-the-server]__1dmaupm._.js +3 -0
  474. package/standalone/.next/server/chunks/[root-of-the-server]__1dzpyeo._.js +3 -0
  475. package/standalone/.next/server/chunks/[root-of-the-server]__1e4h_8d._.js +3 -0
  476. package/standalone/.next/server/chunks/[root-of-the-server]__1e55xu8._.js +3 -0
  477. package/standalone/.next/server/chunks/[root-of-the-server]__1e7boqc._.js +3 -0
  478. package/standalone/.next/server/chunks/[root-of-the-server]__1ejanf7._.js +3 -0
  479. package/standalone/.next/server/chunks/[root-of-the-server]__1fj0u0h._.js +3 -0
  480. package/standalone/.next/server/chunks/{[root-of-the-server]__00bayt8._.js → [root-of-the-server]__1fj4i62._.js} +2 -2
  481. package/standalone/.next/server/chunks/[root-of-the-server]__1fz50a_._.js +3 -0
  482. package/standalone/.next/server/chunks/[root-of-the-server]__1i70gon._.js +3 -0
  483. package/standalone/.next/server/chunks/[root-of-the-server]__1i9dwgw._.js +3 -0
  484. package/standalone/.next/server/chunks/[root-of-the-server]__1j5wr_0._.js +3 -0
  485. package/standalone/.next/server/chunks/{[root-of-the-server]__0h5xzi0._.js → [root-of-the-server]__1j634q7._.js} +1 -1
  486. package/standalone/.next/server/chunks/[root-of-the-server]__1j_bo3h._.js +3 -0
  487. package/standalone/.next/server/chunks/[root-of-the-server]__1jcuws5._.js +3 -0
  488. package/standalone/.next/server/chunks/[root-of-the-server]__1jmechu._.js +3 -0
  489. package/standalone/.next/server/chunks/[root-of-the-server]__1jwm3ay._.js +3 -0
  490. package/standalone/.next/server/chunks/[root-of-the-server]__1k9ljk0._.js +3 -0
  491. package/standalone/.next/server/chunks/[root-of-the-server]__1kqw3ze._.js +3 -0
  492. package/standalone/.next/server/chunks/[root-of-the-server]__1lrrnrk._.js +3 -0
  493. package/standalone/.next/server/chunks/{[root-of-the-server]__14ufav8._.js → [root-of-the-server]__1mndrc5._.js} +2 -2
  494. package/standalone/.next/server/chunks/[root-of-the-server]__1nddo_-._.js +3 -0
  495. package/standalone/.next/server/chunks/[root-of-the-server]__1nvx4a7._.js +3 -0
  496. package/standalone/.next/server/chunks/[root-of-the-server]__1o74gxl._.js +3 -0
  497. package/standalone/.next/server/chunks/[root-of-the-server]__1oc76co._.js +3 -0
  498. package/standalone/.next/server/chunks/[root-of-the-server]__1odtl8q._.js +3 -0
  499. package/standalone/.next/server/chunks/[root-of-the-server]__1p0eko0._.js +3 -0
  500. package/standalone/.next/server/chunks/[root-of-the-server]__1p64w7c._.js +3 -0
  501. package/standalone/.next/server/chunks/[root-of-the-server]__1pdbrg4._.js +3 -0
  502. package/standalone/.next/server/chunks/[root-of-the-server]__1pguxgt._.js +3 -0
  503. package/standalone/.next/server/chunks/[root-of-the-server]__1pnlbrp._.js +3 -0
  504. package/standalone/.next/server/chunks/[root-of-the-server]__1q0w-ke._.js +3 -0
  505. package/standalone/.next/server/chunks/[root-of-the-server]__1qu9ubp._.js +3 -0
  506. package/standalone/.next/server/chunks/[root-of-the-server]__1rppuo1._.js +3 -0
  507. package/standalone/.next/server/chunks/{[root-of-the-server]__043sxkt._.js → [root-of-the-server]__1s-hz4e._.js} +3 -3
  508. package/standalone/.next/server/chunks/{[root-of-the-server]__17twz-k._.js → [root-of-the-server]__1spt-bt._.js} +2 -2
  509. package/standalone/.next/server/chunks/[root-of-the-server]__1st4e7h._.js +3 -0
  510. package/standalone/.next/server/chunks/[root-of-the-server]__1t_yij3._.js +3 -0
  511. package/standalone/.next/server/chunks/[root-of-the-server]__1upboky._.js +3 -0
  512. package/standalone/.next/server/chunks/[root-of-the-server]__1utlkew._.js +3 -0
  513. package/standalone/.next/server/chunks/[root-of-the-server]__1uvwps7._.js +3 -0
  514. package/standalone/.next/server/chunks/[root-of-the-server]__1uwx47q._.js +3 -0
  515. package/standalone/.next/server/chunks/[root-of-the-server]__1uzi6wy._.js +3 -0
  516. package/standalone/.next/server/chunks/[root-of-the-server]__1v3_h_8._.js +3 -0
  517. package/standalone/.next/server/chunks/[root-of-the-server]__1v_x3-z._.js +3 -0
  518. package/standalone/.next/server/chunks/[root-of-the-server]__1vu4utg._.js +3 -0
  519. package/standalone/.next/server/chunks/[root-of-the-server]__1vzhk1o._.js +3 -0
  520. package/standalone/.next/server/chunks/[root-of-the-server]__1wn46m4._.js +3 -0
  521. package/standalone/.next/server/chunks/[root-of-the-server]__1xb6a9r._.js +3 -0
  522. package/standalone/.next/server/chunks/[root-of-the-server]__1y6nfsc._.js +3 -0
  523. package/standalone/.next/server/chunks/[root-of-the-server]__1y9qp5e._.js +3 -0
  524. package/standalone/.next/server/chunks/[root-of-the-server]__1z-oj-a._.js +3 -0
  525. package/standalone/.next/server/chunks/[root-of-the-server]__1zc9ssi._.js +3 -0
  526. package/standalone/.next/server/chunks/{[root-of-the-server]__07qtgl8._.js → [root-of-the-server]__1zz6g62._.js} +2 -2
  527. package/standalone/.next/server/chunks/[root-of-the-server]__20glztx._.js +3 -0
  528. package/standalone/.next/server/chunks/[root-of-the-server]__20wae87._.js +3 -0
  529. package/standalone/.next/server/chunks/[root-of-the-server]__216fzje._.js +3 -0
  530. package/standalone/.next/server/chunks/_05hmt-3._.js +2 -2
  531. package/standalone/.next/server/chunks/_07hehic._.js +2 -2
  532. package/standalone/.next/server/chunks/_10r2rsn._.js +2 -2
  533. package/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1mb4-7-._.js → [root-of-the-server]__0ix-rxo._.js} +1 -1
  534. package/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0v8tcdf._.js → [root-of-the-server]__15yzrti._.js} +1 -1
  535. package/standalone/.next/server/chunks/ssr/{_0922cgb._.js → _01uthe5._.js} +29 -22
  536. package/standalone/.next/server/chunks/ssr/{_0wzxel4._.js → _04pqmk5._.js} +29 -22
  537. package/standalone/.next/server/chunks/ssr/{_16qls8q._.js → _0qn0zlz._.js} +29 -22
  538. package/standalone/.next/server/chunks/ssr/messages_de_json_[json]_cjs_1uig1ud._.js +1 -1
  539. package/standalone/.next/server/chunks/ssr/messages_en_json_[json]_cjs_206072-._.js +1 -1
  540. package/standalone/.next/server/chunks/ssr/messages_es_json_[json]_cjs_082yukd._.js +1 -1
  541. package/standalone/.next/server/chunks/ssr/messages_fr_json_[json]_cjs_0j6-w0i._.js +1 -1
  542. package/standalone/.next/server/chunks/ssr/src_services_auth_index_ts_05c0kh-._.js +1 -1
  543. package/standalone/.next/server/middleware-build-manifest.js +3 -3
  544. package/standalone/.next/server/pages/404.html +1 -1
  545. package/standalone/.next/server/pages/500.html +1 -1
  546. package/standalone/.next/server/server-reference-manifest.js +1 -1
  547. package/standalone/.next/server/server-reference-manifest.json +1 -1
  548. package/standalone/.next/static/chunks/178wtl_ig0bxa.js +153 -0
  549. package/standalone/.next/static/chunks/21wyivb86q7ph.css +1 -0
  550. package/standalone/.next/server/chunks/[root-of-the-server]__04p8581._.js +0 -3
  551. package/standalone/.next/server/chunks/[root-of-the-server]__05jd11-._.js +0 -3
  552. package/standalone/.next/server/chunks/[root-of-the-server]__062_bno._.js +0 -3
  553. package/standalone/.next/server/chunks/[root-of-the-server]__06r_-xl._.js +0 -3
  554. package/standalone/.next/server/chunks/[root-of-the-server]__06vwuo3._.js +0 -3
  555. package/standalone/.next/server/chunks/[root-of-the-server]__07xpqyi._.js +0 -3
  556. package/standalone/.next/server/chunks/[root-of-the-server]__08wxa83._.js +0 -3
  557. package/standalone/.next/server/chunks/[root-of-the-server]__08ztaf_._.js +0 -3
  558. package/standalone/.next/server/chunks/[root-of-the-server]__0a4j1ds._.js +0 -3
  559. package/standalone/.next/server/chunks/[root-of-the-server]__0b3iuip._.js +0 -3
  560. package/standalone/.next/server/chunks/[root-of-the-server]__0b97vxr._.js +0 -3
  561. package/standalone/.next/server/chunks/[root-of-the-server]__0cdtdje._.js +0 -3
  562. package/standalone/.next/server/chunks/[root-of-the-server]__0cf34kz._.js +0 -3
  563. package/standalone/.next/server/chunks/[root-of-the-server]__0cxkc3c._.js +0 -3
  564. package/standalone/.next/server/chunks/[root-of-the-server]__0cxxmh3._.js +0 -3
  565. package/standalone/.next/server/chunks/[root-of-the-server]__0dcm3nf._.js +0 -3
  566. package/standalone/.next/server/chunks/[root-of-the-server]__0dilfdy._.js +0 -3
  567. package/standalone/.next/server/chunks/[root-of-the-server]__0dk5jt9._.js +0 -3
  568. package/standalone/.next/server/chunks/[root-of-the-server]__0dqc0rm._.js +0 -3
  569. package/standalone/.next/server/chunks/[root-of-the-server]__0e2s52m._.js +0 -3
  570. package/standalone/.next/server/chunks/[root-of-the-server]__0ezjalw._.js +0 -3
  571. package/standalone/.next/server/chunks/[root-of-the-server]__0fgzust._.js +0 -3
  572. package/standalone/.next/server/chunks/[root-of-the-server]__0k2q1d1._.js +0 -3
  573. package/standalone/.next/server/chunks/[root-of-the-server]__0kq6eoe._.js +0 -3
  574. package/standalone/.next/server/chunks/[root-of-the-server]__0mf6_9x._.js +0 -3
  575. package/standalone/.next/server/chunks/[root-of-the-server]__0mhjccg._.js +0 -3
  576. package/standalone/.next/server/chunks/[root-of-the-server]__0nixrwu._.js +0 -3
  577. package/standalone/.next/server/chunks/[root-of-the-server]__0o0xm1k._.js +0 -3
  578. package/standalone/.next/server/chunks/[root-of-the-server]__0ogs635._.js +0 -3
  579. package/standalone/.next/server/chunks/[root-of-the-server]__0oxto54._.js +0 -3
  580. package/standalone/.next/server/chunks/[root-of-the-server]__0p0bsa8._.js +0 -3
  581. package/standalone/.next/server/chunks/[root-of-the-server]__0peyklm._.js +0 -3
  582. package/standalone/.next/server/chunks/[root-of-the-server]__0q9to62._.js +0 -3
  583. package/standalone/.next/server/chunks/[root-of-the-server]__0qrt0w5._.js +0 -3
  584. package/standalone/.next/server/chunks/[root-of-the-server]__0r8dwbh._.js +0 -3
  585. package/standalone/.next/server/chunks/[root-of-the-server]__0rwzt-k._.js +0 -3
  586. package/standalone/.next/server/chunks/[root-of-the-server]__0t9oinq._.js +0 -3
  587. package/standalone/.next/server/chunks/[root-of-the-server]__0ulnqrl._.js +0 -3
  588. package/standalone/.next/server/chunks/[root-of-the-server]__0vghu8d._.js +0 -3
  589. package/standalone/.next/server/chunks/[root-of-the-server]__0vqv2zr._.js +0 -3
  590. package/standalone/.next/server/chunks/[root-of-the-server]__0vv_6ul._.js +0 -3
  591. package/standalone/.next/server/chunks/[root-of-the-server]__0xnclqh._.js +0 -3
  592. package/standalone/.next/server/chunks/[root-of-the-server]__0xzk664._.js +0 -3
  593. package/standalone/.next/server/chunks/[root-of-the-server]__0y_6jzi._.js +0 -3
  594. package/standalone/.next/server/chunks/[root-of-the-server]__0yjjcha._.js +0 -3
  595. package/standalone/.next/server/chunks/[root-of-the-server]__0z59tfa._.js +0 -3
  596. package/standalone/.next/server/chunks/[root-of-the-server]__1-0j27x._.js +0 -3
  597. package/standalone/.next/server/chunks/[root-of-the-server]__1-3u-vv._.js +0 -3
  598. package/standalone/.next/server/chunks/[root-of-the-server]__1-ag6yt._.js +0 -3
  599. package/standalone/.next/server/chunks/[root-of-the-server]__10cu5d3._.js +0 -3
  600. package/standalone/.next/server/chunks/[root-of-the-server]__11335q6._.js +0 -3
  601. package/standalone/.next/server/chunks/[root-of-the-server]__116p1rw._.js +0 -3
  602. package/standalone/.next/server/chunks/[root-of-the-server]__11yhge_._.js +0 -3
  603. package/standalone/.next/server/chunks/[root-of-the-server]__15h6xh0._.js +0 -3
  604. package/standalone/.next/server/chunks/[root-of-the-server]__16fqyzc._.js +0 -3
  605. package/standalone/.next/server/chunks/[root-of-the-server]__16h141k._.js +0 -3
  606. package/standalone/.next/server/chunks/[root-of-the-server]__16mnn4k._.js +0 -3
  607. package/standalone/.next/server/chunks/[root-of-the-server]__16mpo3a._.js +0 -3
  608. package/standalone/.next/server/chunks/[root-of-the-server]__16pv_6h._.js +0 -3
  609. package/standalone/.next/server/chunks/[root-of-the-server]__16ukpx-._.js +0 -3
  610. package/standalone/.next/server/chunks/[root-of-the-server]__17ekdtz._.js +0 -3
  611. package/standalone/.next/server/chunks/[root-of-the-server]__17jb4he._.js +0 -3
  612. package/standalone/.next/server/chunks/[root-of-the-server]__1895ivc._.js +0 -3
  613. package/standalone/.next/server/chunks/[root-of-the-server]__18o0ikj._.js +0 -3
  614. package/standalone/.next/server/chunks/[root-of-the-server]__196z3of._.js +0 -3
  615. package/standalone/.next/server/chunks/[root-of-the-server]__198nwkl._.js +0 -3
  616. package/standalone/.next/server/chunks/[root-of-the-server]__19e6vuq._.js +0 -3
  617. package/standalone/.next/server/chunks/[root-of-the-server]__1__3q-v._.js +0 -3
  618. package/standalone/.next/server/chunks/[root-of-the-server]__1abc-59._.js +0 -3
  619. package/standalone/.next/server/chunks/[root-of-the-server]__1b5a49d._.js +0 -3
  620. package/standalone/.next/server/chunks/[root-of-the-server]__1c-p2s8._.js +0 -3
  621. package/standalone/.next/server/chunks/[root-of-the-server]__1c3qnaz._.js +0 -3
  622. package/standalone/.next/server/chunks/[root-of-the-server]__1c8iukt._.js +0 -3
  623. package/standalone/.next/server/chunks/[root-of-the-server]__1cix51m._.js +0 -3
  624. package/standalone/.next/server/chunks/[root-of-the-server]__1d-klok._.js +0 -3
  625. package/standalone/.next/server/chunks/[root-of-the-server]__1dbbl79._.js +0 -3
  626. package/standalone/.next/server/chunks/[root-of-the-server]__1dnwm-k._.js +0 -3
  627. package/standalone/.next/server/chunks/[root-of-the-server]__1dxwek3._.js +0 -3
  628. package/standalone/.next/server/chunks/[root-of-the-server]__1e50aaz._.js +0 -3
  629. package/standalone/.next/server/chunks/[root-of-the-server]__1frlfm3._.js +0 -3
  630. package/standalone/.next/server/chunks/[root-of-the-server]__1g5_4f9._.js +0 -3
  631. package/standalone/.next/server/chunks/[root-of-the-server]__1g86_ue._.js +0 -3
  632. package/standalone/.next/server/chunks/[root-of-the-server]__1geww_b._.js +0 -3
  633. package/standalone/.next/server/chunks/[root-of-the-server]__1glg2tz._.js +0 -3
  634. package/standalone/.next/server/chunks/[root-of-the-server]__1gw6v6o._.js +0 -3
  635. package/standalone/.next/server/chunks/[root-of-the-server]__1hdtvl0._.js +0 -3
  636. package/standalone/.next/server/chunks/[root-of-the-server]__1hfal7_._.js +0 -3
  637. package/standalone/.next/server/chunks/[root-of-the-server]__1inimim._.js +0 -3
  638. package/standalone/.next/server/chunks/[root-of-the-server]__1k1bf2v._.js +0 -3
  639. package/standalone/.next/server/chunks/[root-of-the-server]__1kuazva._.js +0 -3
  640. package/standalone/.next/server/chunks/[root-of-the-server]__1lfohni._.js +0 -3
  641. package/standalone/.next/server/chunks/[root-of-the-server]__1m-netn._.js +0 -3
  642. package/standalone/.next/server/chunks/[root-of-the-server]__1moiz3h._.js +0 -3
  643. package/standalone/.next/server/chunks/[root-of-the-server]__1n8ng5_._.js +0 -3
  644. package/standalone/.next/server/chunks/[root-of-the-server]__1no55fg._.js +0 -3
  645. package/standalone/.next/server/chunks/[root-of-the-server]__1o_sbot._.js +0 -3
  646. package/standalone/.next/server/chunks/[root-of-the-server]__1odu2n8._.js +0 -3
  647. package/standalone/.next/server/chunks/[root-of-the-server]__1p15dyu._.js +0 -3
  648. package/standalone/.next/server/chunks/[root-of-the-server]__1pdleyb._.js +0 -3
  649. package/standalone/.next/server/chunks/[root-of-the-server]__1ps_qb8._.js +0 -3
  650. package/standalone/.next/server/chunks/[root-of-the-server]__1q2v-1q._.js +0 -3
  651. package/standalone/.next/server/chunks/[root-of-the-server]__1q7-v7k._.js +0 -3
  652. package/standalone/.next/server/chunks/[root-of-the-server]__1qc5z3r._.js +0 -3
  653. package/standalone/.next/server/chunks/[root-of-the-server]__1qp97bd._.js +0 -3
  654. package/standalone/.next/server/chunks/[root-of-the-server]__1sfakwk._.js +0 -3
  655. package/standalone/.next/server/chunks/[root-of-the-server]__1swibaz._.js +0 -3
  656. package/standalone/.next/server/chunks/[root-of-the-server]__1szcyzk._.js +0 -3
  657. package/standalone/.next/server/chunks/[root-of-the-server]__1t7_imx._.js +0 -3
  658. package/standalone/.next/server/chunks/[root-of-the-server]__1u8jx07._.js +0 -3
  659. package/standalone/.next/server/chunks/[root-of-the-server]__1ucwigt._.js +0 -3
  660. package/standalone/.next/server/chunks/[root-of-the-server]__1udnxa1._.js +0 -3
  661. package/standalone/.next/server/chunks/[root-of-the-server]__1ugepal._.js +0 -3
  662. package/standalone/.next/server/chunks/[root-of-the-server]__1upx00h._.js +0 -3
  663. package/standalone/.next/server/chunks/[root-of-the-server]__1wo0s5w._.js +0 -3
  664. package/standalone/.next/server/chunks/[root-of-the-server]__1wznu0j._.js +0 -3
  665. package/standalone/.next/server/chunks/[root-of-the-server]__1xg-wjp._.js +0 -3
  666. package/standalone/.next/server/chunks/[root-of-the-server]__1xgjawn._.js +0 -3
  667. package/standalone/.next/server/chunks/[root-of-the-server]__1xo35gr._.js +0 -3
  668. package/standalone/.next/server/chunks/[root-of-the-server]__1xunj2b._.js +0 -3
  669. package/standalone/.next/server/chunks/[root-of-the-server]__1y_c0qs._.js +0 -3
  670. package/standalone/.next/server/chunks/[root-of-the-server]__1ypncrq._.js +0 -3
  671. package/standalone/.next/server/chunks/[root-of-the-server]__1yv-lzg._.js +0 -3
  672. package/standalone/.next/server/chunks/[root-of-the-server]__20_nqsg._.js +0 -3
  673. package/standalone/.next/static/chunks/08tqkboq7jldl.css +0 -1
  674. package/standalone/.next/static/chunks/2llenynsmogfu.js +0 -146
  675. /package/standalone/.next/static/{I0dfaEEIvfubol4R1MwUX → xkUaHnpvpggDLECvJ6z6y}/_buildManifest.js +0 -0
  676. /package/standalone/.next/static/{I0dfaEEIvfubol4R1MwUX → xkUaHnpvpggDLECvJ6z6y}/_clientMiddlewareManifest.js +0 -0
  677. /package/standalone/.next/static/{I0dfaEEIvfubol4R1MwUX → xkUaHnpvpggDLECvJ6z6y}/_ssgManifest.js +0 -0
@@ -462,10 +462,10 @@ To resolve this, you can:
462
462
  1. Use only one of the conflicting plugins
463
463
  2. Configure the plugins to use different paths (if supported)
464
464
  3. Ensure plugins use different HTTP methods for the same path
465
- `)}}(t={...t,secret:i,baseURL:u?t.baseURL:p?new URL(p).origin:"",basePath:t.basePath||"/api/auth",plugins:l.concat(c)},d);let A=t.advanced?.ipAddress?.trustedProxies;if(A&&A.length>0){let e=A.filter(e=>null===I(e));e.length>0&&d.warn(`Ignoring invalid \`advanced.ipAddress.trustedProxies\` entries: ${e.join(", ")}. Each entry must be an IP address or CIDR range.`)}let E=(0,ti.getCookies)(t),b=(0,eO.getAuthTables)(t),_=(await Promise.all(Object.entries(t.socialProviders||{}).map(async([e,t])=>{let r="function"==typeof t?await t():t;if(null==r||!1===r.enabled)return null;r.clientId||d.warn(`Social provider ${e} is missing clientId or clientSecret`);let i=o_[e](r);return i.disableImplicitSignUp=r.disableImplicitSignUp,i}))).filter(e=>null!==e),R=({model:e,size:r})=>{if("function"==typeof t.advanced?.generateId)return t.advanced.generateId({model:e,size:r});let i=t?.advanced?.database?.generateId;return"function"==typeof i?i({model:e,size:r}):"uuid"===i?crypto.randomUUID():"serial"!==i&&!1!==i&&(0,D.generateId)(r)},{publish:T}=await nP(t,{adapter:e.id,database:"function"==typeof t.database?"adapter":r(t.database)}),S=new Set(t.plugins.map(e=>e.id)),v=await tD(t),U=await tC(t),O={appName:t.appName||"Better Auth",baseURL:p||"",version:(0,nd.getBetterAuthVersion)(),socialProviders:_,options:t,oauthConfig:{storeStateStrategy:t.account?.storeStateStrategy||(s?"database":"cookie"),skipStateCookieCheck:!!t.account?.skipStateCookieCheck},tables:b,trustedOrigins:v,trustedProviders:U,isTrustedOrigin(e,t){return this.trustedOrigins.some(r=>e3(e,r,t))},sessionConfig:{updateAge:t.session?.updateAge!==void 0?t.session.updateAge:86400,expiresIn:t.session?.expiresIn||604800,freshAge:t.session?.freshAge===void 0?86400:t.session.freshAge,cookieRefreshCache:(n=t.session?.cookieCache?.refreshCache,a=t.session?.cookieCache?.maxAge||300,s&&n?(d.warn("[better-auth] `session.cookieCache.refreshCache` is enabled while `database` or `secondaryStorage` is configured. `refreshCache` is meant for stateless (DB-less) setups. Disabling `refreshCache` — remove it from your config to silence this warning."),!1):!1!==n&&void 0!==n&&(!0===n?{enabled:!0,updateAge:Math.floor(.2*a)}:{enabled:!0,updateAge:void 0!==n.updateAge?n.updateAge:Math.floor(.2*a)}))},secret:i,secretConfig:o,rateLimit:{...t.rateLimit,enabled:t.rateLimit?.enabled??f.isProduction,window:t.rateLimit?.window||10,max:t.rateLimit?.max||100,storage:t.rateLimit?.storage||(t.secondaryStorage?"secondary-storage":"memory")},authCookies:E,logger:d,generateId:R,session:null,secondaryStorage:t.secondaryStorage,password:{hash:t.emailAndPassword?.password?.hash||te,verify:t.emailAndPassword?.password?.verify||tr,config:{minPasswordLength:t.emailAndPassword?.minPasswordLength||8,maxPasswordLength:t.emailAndPassword?.maxPasswordLength||128},checkPassword:tj},setNewSession(e){this.newSession=e},newSession:null,adapter:e,internalAdapter:tb(e,{options:t,logger:d,hooks:t.databaseHooks?[{source:"user",hooks:t.databaseHooks}]:[],generateId:R}),createAuthCookie:(0,ti.createCookieGetter)(t),async runMigrations(){throw new k.BetterAuthError("runMigrations will be set by the specific init implementation")},publishTelemetry:T,skipCSRFCheck:!!t.advanced?.disableCSRFCheck,skipOriginCheck:t.advanced?.disableOriginCheck!==void 0?t.advanced.disableOriginCheck:!!(0,f.isTest)(),runInBackground:t.advanced?.backgroundTasks?.handler??(e=>{e.catch(()=>{})}),async runInBackgroundOrAwait(e){try{t.advanced?.backgroundTasks?.handler?e instanceof Promise&&t.advanced.backgroundTasks.handler(e.catch(e=>{d.error("Failed to run background task:",e)})):await e}catch(e){d.error("Failed to run background task:",e)}},getPlugin:e=>t.plugins.find(t=>t.id===e)??null,hasPlugin:e=>S.has(e)},x=tx(O);return(0,e4.isPromise)(x)&&await x,O}let nL=async e=>{let t=await eP(e),r=await nN(t,e,e=>(0,eL.getKyselyDatabaseType)(e)||"unknown");return r.runMigrations=async function(){if(!e.database||"updateMany"in e.database)throw new k.BetterAuthError("Database is not provided or it's an adapter. Migrations are only supported with a database instance.");let{runMigrations:t}=await eZ(e);await t()},r};e.s(["betterAuth",0,e=>((e,t)=>{let r=t(e),{api:i}=nc(r,e),o=e.plugins?.reduce((e,t)=>t.$ERROR_CODES?{...e,...t.$ERROR_CODES}:e,{}),n=async t=>{let i,o=await r,n=o.options.basePath||"/api/auth";if((0,eX.isDynamicBaseURLConfig)(e.baseURL))i=await tN(o,t,tP(o.options));else{i=Object.create(Object.getPrototypeOf(o),Object.getOwnPropertyDescriptors(o));let e=o.options;if(!o.options.baseURL){let r=(0,eX.getBaseURL)(void 0,n,t,void 0,o.options.advanced?.trustedProxyHeaders);if(!r)throw new k.BetterAuthError("Could not get base URL from request. Please provide a valid base URL.");i.baseURL=r,i.options={...o.options,baseURL:(0,eX.getOrigin)(r)||void 0},e=i.options}i.trustedOrigins=await tD(e,t),i.trustedProviders=await tC(e,t)}let{handler:a}=((e,t)=>{let{api:r,middlewares:i}=nc(e,t),o=new URL(e.baseURL).pathname;return(0,nl.createRouter)(r,{routerContext:e,openapi:{disabled:!0},basePath:o,routerMiddleware:[{path:"/**",middleware:tW},...i],allowedMediaTypes:["application/json"],skipTrailingSlashes:t.advanced?.skipTrailingSlashes??!1,async onRequest(t){let r=e.options.disabledPaths||[],i=tV(t.url,o);if(r.includes(i))return new Response("Not Found",{status:404});let n=t,a=await t2(n,e);if(a)return a;for(let t of e.options.plugins||[])if(t.onRequest){let r=await (0,tg.withSpan)(`onRequest ${t.id}`,{[th]:"onRequest",[tm]:`plugin:${t.id}`},()=>t.onRequest(n,e));if(r&&"response"in r)return r.response;r&&"request"in r&&(n=r.request)}return n},async onResponse(t,r){for(let r of e.options.plugins||[])if(r.onResponse){let i=await (0,tg.withSpan)(`onResponse ${r.id}`,{[th]:"onResponse",[tm]:`plugin:${r.id}`,[tp.ATTR_HTTP_RESPONSE_STATUS_CODE]:t.status},()=>r.onResponse(t,e));if(i)return i.response}return t},onError(r){if((0,t$.isAPIError)(r)&&"FOUND"===r.status)return;if(t.onAPIError?.throw)throw r;if(t.onAPIError?.onError)return void t.onAPIError.onError(r,e);let i=t.logger?.level,o="error"===i||"warn"===i||"debug"===i?ex.logger:void 0;if(t.logger?.disabled!==!0){if(r&&"object"==typeof r&&"message"in r&&"string"==typeof r.message&&(r.message.includes("no column")||r.message.includes("column")||r.message.includes("relation")||r.message.includes("table")||r.message.includes("does not exist")))return void e.logger?.error(r.message);(0,t$.isAPIError)(r)?("INTERNAL_SERVER_ERROR"===r.status&&e.logger.error(r.status,r),o?.error(r.message)):e.logger?.error(r&&"object"==typeof r&&"name"in r?r.name:"",r)}}})})(i,e);return(0,td.runWithAdapter)(i.adapter,()=>a(t))};return{handler:n,fetch:n,api:i,options:e,$context:r,$ERROR_CODES:{...o,...tq.BASE_ERROR_CODES}}})(e,nL)],204721)},749599,e=>{"use strict";let t;var r=e.i(46754),i=e.i(682868),o=e.i(272003),n=e.i(890659);let a=()=>t??=e.A(6878).catch(e=>{throw t=void 0,e});e.s(["nextCookies",0,()=>{let e=!1;return{id:"next-cookies",version:o.PACKAGE_VERSION,hooks:{before:[{matcher:e=>"/get-session"===e.path,handler:(0,n.createAuthMiddleware)(async t=>{let r;if(e||(!function(e,t){let r=e.options.plugins||[];if(0===r.length)return;let i=r.findIndex(e=>e.id===t);-1===i||r.slice(i+1).some(e=>e.hooks&&Array.isArray(e.hooks.after)&&e.hooks.after.length>0)&&e.logger.warn(`[better-auth] Cookie integration plugin "${t}" should be placed last in the plugins array. Plugins with \`hooks.after\` running after it may set cookies that are not forwarded to the framework cookie store. Move your cookie integration plugin to the end of the \`plugins\` array to avoid missing \`Set-Cookie\` headers.`)}(t.context,"next-cookies"),e=!0),"_flag"in t&&"router"===t._flag)return;try{let{headers:e}=await a();r=await e()}catch{return}let o="1"===r.get("RSC"),n=!!r.get("next-action");o&&!n&&await (0,i.setShouldSkipSessionRefresh)(!0)})}],after:[{matcher:e=>!0,handler:(0,n.createAuthMiddleware)(async e=>{let t=e.context.responseHeaders;if((!("_flag"in e)||"router"!==e._flag)&&t instanceof Headers){let e,i=t?.get("set-cookie");if(!i)return;let o=(0,r.parseSetCookieHeader)(i);try{let{cookies:t}=await a();e=await t()}catch(e){if(e instanceof Error&&(e.message.startsWith("`cookies` was called outside a request scope.")||e.message.includes("Cannot find module")))return;throw e}o.forEach((t,i)=>{if(i)try{e.set(i,t.value,(0,r.toCookieOptions)(t))}catch{}});return}})}]}}},"toNextJsHandler",0,function(e){let t=async t=>"handler"in e?e.handler(t):e(t);return{GET:t,POST:t,PATCH:t,PUT:t,DELETE:t}}],749599)},303361,e=>{"use strict";let t=new Set(["localhost","127.0.0.1","::1","[::1]"]);function r(e){let r,i=e.trim();if(!i)throw Error("APP_ORIGINS contains an empty entry.");if(/[\s/\\]/.test(i.replace(/^https?:\/\//,"")))throw Error(`APP_ORIGINS entry "${i}" must be a bare host or an origin, with no path.`);if(i.includes("@"))throw Error(`APP_ORIGINS entry "${i}" must not contain credentials.`);let o=/^(https?):\/\/(.+)$/.exec(i),n=o?"https"===o[1]?"https:":"http:":null,a=o?o[2]:i,s=/^(\[[^\]]+\]|[^:]+)(?::(\d+))?$/.exec(a);if(!s)throw Error(`APP_ORIGINS entry "${i}" is not a valid host.`);let l=s[1].toLowerCase(),c=s[2]??null;if(!l||"."===l)throw Error(`APP_ORIGINS entry "${i}" is not a valid host.`);let d=l.includes("*");return d&&function(e,t){let r=e.split(".");if(r.slice(1).some(e=>e.includes("*")))throw Error(`APP_ORIGINS entry "${t}" may only use a wildcard in its leftmost label.`);if("*"!==r[0])throw Error(`APP_ORIGINS entry "${t}" must use "*" as a whole label, for example "*.example.com".`);if(r.length<3)throw Error(`APP_ORIGINS entry "${t}" is too broad; a wildcard needs at least two literal labels after it.`)}(l,i),{hostname:l,host:c?`${l}:${c}`:l,port:c,protocol:n,wildcard:d,loopback:(r=l.toLowerCase().replace(/^\[|\]$/g,""),!!(t.has(r)||"::1"===r||r.endsWith(".localhost"))||/^127\./.test(r))}}function i(e,t){return e.protocol?e.protocol:e.loopback?"http:":t?"https:":"http:"}let o=!1;function n(e){let t=e.trim().toLowerCase();return!(!t||/[\s/\\@]/.test(t))&&/^(\[[^\]]+\]|[^:]+)(?::\d+)?$/.test(t)}function a(e,t){let r=e.trim().toLowerCase();if(!r)return!1;let i=/^(\[[^\]]+\]|[^:]+)(?::(\d+))?$/.exec(r);if(!i)return!1;let o=i[1],n=i[2]??null;return(!t.port||t.port===n)&&function(e,t){let r=e.trim().toLowerCase();if(!r)return!1;if(!t.wildcard)return t.hostname===r;let i=t.hostname.slice(1);return r.endsWith(i)&&r.length>i.length}(o,t)}function s(e,t){let r=t=>{let r=e.headers.get(t)?.split(",")[0]?.trim();return r&&!/[\s/\\@]/.test(r)?r:null},i=t?r("x-forwarded-host"):null,o=t?r("x-forwarded-proto"):null,a=i??r("host");if(a&&n(a)){let t="https"===o||"http"===o?o:new URL(e.url).protocol.replace(":","");return`${t}://${a.toLowerCase()}`}try{return new URL(e.url).origin}catch{return null}}e.s(["betterAuthBaseURL",0,function(e){if("inferred"!==e.mode)return"single"===e.mode?e.canonical:{allowedHosts:e.patterns.flatMap(e=>e.port?[e.host]:[e.host,`${e.host}:*`]),protocol:e.allHttps?"https":"auto",fallback:e.canonical}},"isSameOriginRequest",0,function(e,t){let r=e.headers.get("sec-fetch-site");if(r)return"same-origin"===r||"none"===r;let i=e.headers.get("origin");if(!i)return!0;let o=s(e,t);return!!o&&i.trim().toLowerCase()===o},"isTrustedOrigin",0,function(e,t){let r=t.trim();if(!r)return!1;let i=r;if(/^https?:\/\//i.test(r))try{i=new URL(r).host}catch{return!1}return"inferred"===e.mode?n(i):e.patterns.some(e=>a(i,e))},"originFromRequest",0,s,"resolveAppOrigins",0,function(e=process.env){let t,n="phase-production-build"===e.NEXT_PHASE,s="production"===e.NODE_ENV&&!n,l=e.APP_ORIGINS?.trim(),c=function(e){let t,r=e.PUBLIC_BASE_URL?.trim();if(!r)return null;try{t=new URL(r)}catch{throw Error("PUBLIC_BASE_URL must be an absolute http or https URL.")}if("http:"!==t.protocol&&"https:"!==t.protocol)throw Error("PUBLIC_BASE_URL must use http or https.");return t}(e),d=l?l.split(",").map(e=>e.trim()).filter(Boolean).map(r):[];if(s&&0===d.length&&!c)return o||(o=!0,console.warn("[origins] Neither APP_ORIGINS nor PUBLIC_BASE_URL is set. Each request's own Host header will be trusted, so absolute URLs this server generates — OAuth callbacks, iOS enrollment and install links, the GitHub webhook URL — follow whatever host the caller asked for. Set APP_ORIGINS to the hostname(s) this server is reached at to pin them.")),{patterns:[],canonical:null,mode:"inferred",allHttps:!1};let u=s?d:function(e){let t=new Map;for(let r of e){let e=t.get(r.host);e?"http:"===r.protocol&&t.set(r.host,{...e,protocol:"http:"}):t.set(r.host,r)}return[...t.values()]}([...(t=e.PORT?.trim()||"3000",["localhost","127.0.0.1","[::1]"].map(e=>r(`http://${e}:${t}`))),...d]);if(0===u.length&&c&&(u=[r(c.origin)]),s){let e=u.filter(e=>e.wildcard);if(e.length>0)throw Error(`APP_ORIGINS may not use wildcards in production (${e.map(e=>e.hostname).join(", ")}). A wildcard trusts every host under it for CSRF and for post-login redirects; list exact hosts instead.`)}c&&!u.some(e=>a(c.host,e))&&(u=[...u,r(c.origin)]);let p=u.find(e=>!e.wildcard);if(!p&&!c)throw Error("APP_ORIGINS must include at least one exact origin; a wildcard alone gives this server no address to put in the links it generates.");return{patterns:u,canonical:c?.origin??`${i(p,s)}//${p.host}`,mode:1!==u.length||u[0].wildcard?"multi":"single",allHttps:u.every(e=>e.loopback||"https:"===i(e,s))}}])},576257,169040,464661,354470,e=>{"use strict";var t=e.i(363004),r=e.i(931129),i=e.i(204721),o=e.i(749599),n=e.i(756023),a=e.i(272003),s=e.i(483319);let l=(0,s.createAccessControl)({user:["create","list","set-role","ban","impersonate","impersonate-admins","delete","set-password","set-email","get","update"],session:["list","revoke","delete"]}),c={admin:l.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","set-email","get","update"],session:["list","revoke","delete"]}),user:l.newRole({user:[],session:[]})};var d=e.i(672823);let u=(0,d.defineErrorCodes)({FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application",YOU_ARE_NOT_ALLOWED_TO_GET_USER:"You are not allowed to get user",NO_DATA_TO_UPDATE:"No data to update",YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS:"You are not allowed to update users",YOU_CANNOT_REMOVE_YOURSELF:"You cannot remove yourself",YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE:"You are not allowed to set a non-existent role value",YOU_CANNOT_IMPERSONATE_ADMINS:"You cannot impersonate admins",INVALID_ROLE_TYPE:"Invalid role type",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL:"You are not allowed to update users email",PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER:"Password cannot be updated through update-user. Use the set-user-password endpoint instead"});var p=e.i(786198);let f=async e=>{let t=e.context.returned;return t?t instanceof Response?200!==t.status?null:await t.clone().json():(0,p.isAPIError)(t)?null:t:null};var h=e.i(542158),m=e.i(370728),g=e.i(112996);let w=e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions)return!1;let t=(e.role||e.options?.defaultRole||"user").split(","),r=e.options?.roles||c;for(let i of t)if(r[i]?.authorize(e.permissions)?.success)return!0;return!1};var y=e.i(676386),A=e.i(71616),E=e.i(910228),b=e.i(776757),I=e.i(890659),_=e.i(907855),R=e.i(754257);let T=(0,I.createAuthMiddleware)(async e=>{let t=await (0,g.getAuthoritativeSessionFromCtx)(e);if(!t)throw A.APIError.fromStatus("UNAUTHORIZED");return{session:t}});function S(e){return Array.isArray(e)?e.join(","):e}let k=_.object({userId:R.coerce.string().meta({description:"The user id"}),role:_.union([_.string().meta({description:"The role to set. `admin` or `user` by default"}),_.array(_.string().meta({description:"The roles to set. `admin` or `user` by default"}))]).meta({description:"The role to set, this can be a string or an array of strings. Eg: `admin` or `[admin, user]`"})}),v=_.object({id:_.string().meta({description:"The id of the User"})}),U=_.object({email:_.string().meta({description:"The email of the user"}),password:_.string().optional().meta({description:"The password of the user. If not provided, the user will be created without a credential account (useful for magic link or social login only users)."}),name:_.string().meta({description:"The name of the user"}),role:_.union([_.string().meta({description:"The role of the user"}),_.array(_.string().meta({description:"The roles of user"}))]).optional().meta({description:'A string or array of strings representing the roles to apply to the new user. Eg: "user"'}),data:_.record(_.string(),_.any()).optional().meta({description:"Extra fields for the user. Including custom additional fields."})}),O=_.object({userId:R.coerce.string().meta({description:"The user id"}),data:_.record(_.any(),_.any()).meta({description:"The user data to update"})}),x=_.object({searchValue:_.string().optional().meta({description:'The value to search for. Eg: "some name"'}),searchField:_.enum(["email","name"]).meta({description:'The field to search in, defaults to email. Can be `email` or `name`. Eg: "name"'}).optional(),searchOperator:_.enum(["contains","starts_with","ends_with"]).meta({description:'The operator to use for the search. Can be `contains`, `starts_with` or `ends_with`. Eg: "contains"'}).optional(),limit:_.string().meta({description:"The number of users to return"}).or(_.number()).optional(),offset:_.string().meta({description:"The offset to start from"}).or(_.number()).optional(),sortBy:_.string().meta({description:"The field to sort by"}).optional(),sortDirection:_.enum(["asc","desc"]).meta({description:"The direction to sort by"}).optional(),filterField:_.string().meta({description:"The field to filter by"}).optional(),filterValue:_.string().meta({description:"The value to filter by"}).or(_.number()).or(_.boolean()).or(_.array(_.string())).or(_.array(_.number())).optional(),filterOperator:_.enum(b.whereOperators).meta({description:"The operator to use for the filter"}).optional()}),D=_.object({userId:R.coerce.string().meta({description:"The user id"})}),P=_.object({userId:R.coerce.string().meta({description:"The user id"})}),N=_.object({userId:R.coerce.string().meta({description:"The user id"}),banReason:_.string().meta({description:"The reason for the ban"}).optional(),banExpiresIn:_.number().meta({description:"The number of seconds until the ban expires"}).optional()}),L=_.object({userId:R.coerce.string().meta({description:"The user id"})}),C=_.object({sessionToken:_.string().meta({description:"The session token"})}),q=_.object({userId:R.coerce.string().meta({description:"The user id"})}),B=_.object({userId:R.coerce.string().meta({description:"The user id"})}),j=_.object({newPassword:_.string().nonempty("newPassword cannot be empty").meta({description:"The new password"}),userId:R.coerce.string().nonempty("userId cannot be empty").meta({description:"The user id"})}),$=_.object({userId:R.coerce.string().optional().meta({description:'The user id. Eg: "user-id"'}),role:_.string().optional().meta({description:'The role to check permission for. Eg: "admin"'})}).and(_.xor([_.object({permission:_.record(_.string(),_.array(_.string()))}),_.object({permissions:_.record(_.string(),_.array(_.string()))})])),V={user:{fields:{role:{type:"string",required:!1,input:!1},banned:{type:"boolean",defaultValue:!1,required:!1,input:!1},banReason:{type:"string",required:!1,input:!1},banExpires:{type:"date",required:!1,input:!1}}},session:{fields:{impersonatedBy:{type:"string",required:!1,input:!1}}}};var M=e.i(46754);e.i(418069);var F=e.i(444336),H=e.i(35972);function K(e){try{return decodeURIComponent(e)}catch{return e}}let z=(0,d.defineErrorCodes)({INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration",TOKEN_URL_NOT_FOUND:"Invalid OAuth configuration. Token URL not found."});var W=e.i(533078),Y=e.i(878175);e.i(339507);var G=e.i(945e3),Q=e.i(729522),J=e.i(661372),Z=e.i(374091),X=e.i(100762),ee=e.i(550064);async function et(e,t){let r=await (0,W.betterFetch)(e,{method:"GET",headers:t});if(r.error||!r.data)return null;if(r.data.issuer)try{new URL(r.data.issuer)}catch{return null}return r.data}async function er(e,t){if(e.idToken)try{let t=(0,Y.decodeJwt)(e.idToken);if(t?.sub&&t?.email)return{id:t.sub,emailVerified:t.email_verified,image:t.picture,...t}}catch{}if(!t)return null;let r=await (0,W.betterFetch)(t,{method:"GET",headers:{Authorization:`Bearer ${e.accessToken}`}});return r.error||!r.data?null:{...r.data,email:r.data.email,emailVerified:r.data.email_verified??!1,image:r.data.picture,name:r.data.name}}var ei=e.i(51144),eo=e.i(530501),en=e.i(282318);let ea=async e=>{let t=await (0,en.createHash)("SHA-256").digest(new TextEncoder().encode(e));return eo.base64Url.encode(new Uint8Array(t),{padding:!1})},es=_.object({token:_.string().meta({description:'The token to verify. Eg: "some-token"'})});var el=e.i(303361),ec=e.i(243783),ed=e.i(187126);function eu(e,t){return e[t]?.trim()||void 0}function ep(e,t){let r=eu(e,t);if(!r)throw Error(`${t} is required for AUTH_MODE.`);return r}function ef(e=process.env){let t=function(e){let t=eu(e,"AUTH_MODE")??"password";if("password"!==t&&"oidc"!==t&&"both"!==t)throw Error('AUTH_MODE must be "password", "oidc", or "both".');return t}(e),r=(0,el.resolveAppOrigins)(e);return{secret:(0,ed.getAppSecrets)(e).authSecret,origins:r,baseURL:r.canonical,trustProxyHeaders:function(e){let t=eu(e,"TRUST_PROXY_HEADERS")?.toLowerCase();if(!t||"false"===t||"0"===t)return!1;if("true"===t||"1"===t)return!0;throw Error("TRUST_PROXY_HEADERS must be true, false, 1, or 0.")}(e),mode:t,provider:function(e,t){if("password"===t)return null;let r=eu(e,"AUTH_OAUTH_DISCOVERY_URL"),i=eu(e,"AUTH_OAUTH_AUTHORIZATION_URL"),o=eu(e,"AUTH_OAUTH_TOKEN_URL"),n=eu(e,"AUTH_OAUTH_USER_INFO_URL"),a=eu(e,"AUTH_OAUTH_ISSUER"),s=!!(i||o||n),l=i&&o&&n;if(r&&s)throw Error("OIDC configuration must use either discovery or explicit endpoints, not both.");if(!r&&!l)throw Error("OIDC authentication requires AUTH_OAUTH_DISCOVERY_URL or all of AUTH_OAUTH_AUTHORIZATION_URL, AUTH_OAUTH_TOKEN_URL, and AUTH_OAUTH_USER_INFO_URL.");if(s&&!l)throw Error("Explicit OAuth configuration must include authorization, token, and user-info URLs.");if(l&&!a)throw Error("AUTH_OAUTH_ISSUER is required with explicit OAuth endpoints.");let c=ep(e,"AUTH_OAUTH_SCOPES").split(",").map(e=>e.trim()).filter(Boolean);if(0===c.length)throw Error("AUTH_OAUTH_SCOPES must contain at least one scope.");return{providerId:ep(e,"AUTH_OAUTH_PROVIDER_ID"),displayName:ep(e,"AUTH_OAUTH_PROVIDER_NAME"),clientId:ep(e,"AUTH_OAUTH_CLIENT_ID"),clientSecret:ep(e,"AUTH_OAUTH_CLIENT_SECRET"),scopes:c,requireIssuerValidation:function(e){let t=eu(e,"AUTH_OAUTH_REQUIRE_ISSUER_VALIDATION")?.toLowerCase();if(!t||"false"===t||"0"===t)return!1;if("true"===t||"1"===t)return!0;throw Error("AUTH_OAUTH_REQUIRE_ISSUER_VALIDATION must be true, false, 1, or 0.")}(e),discoveryUrl:r,issuer:a,authorizationUrl:i,tokenUrl:o,userInfoUrl:n}}(e,t)}}function eh(e){return"password"===e||"both"===e}function em(e){return"oidc"===e||"both"===e}e.s(["getAuthRuntimeConfig",0,ef,"oauthAuthenticationEnabled",0,em,"passwordAuthenticationEnabled",0,eh],169040);var eg=e.i(812057);let ew=RegExp(String.raw`((?:"?(?:authorization|password|accessToken|refreshToken|idToken|sessionToken|clientSecret|secret|privateKey)"?)\s*:\s*)(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^,\n}\]]+)`,"gi");function ey(e){return e.replace(ew,'$1"[REDACTED]"')}function eA(e,t,...r){let i=[`${new Date().toISOString()} ${e.toUpperCase()} [Better Auth]: ${t}`,...r.map(e=>"string"==typeof e?e:(0,eg.inspect)(e,{depth:6,breakLength:120}))].map(ey);"error"===e?console.error(...i):"warn"===e?console.warn(...i):console.log(...i)}var eE=e.i(666680);let eb="default";async function eI(){let e=await (0,ec.getPrismaClient)();return await e.authSettings.findUnique({where:{id:eb}})??await e.authSettings.upsert({where:{id:eb},create:{id:eb},update:{}})}async function e_(){let e=await (0,ec.getPrismaClient)(),[t,r]=await Promise.all([eI(),e.user.count()]);return t.bootstrapCompleted||0!==r?!t.bootstrapCompleted&&r>0?(await e.authSettings.update({where:{id:eb},data:{bootstrapCompleted:!0,registrationEnabled:!1,bootstrapClaimId:null,bootstrapClaimedAt:null}}),{enabled:!1,setupRequired:!1}):{enabled:t.registrationEnabled,setupRequired:!1}:{enabled:!0,setupRequired:!0}}async function eR(e){let t=await (0,ec.getPrismaClient)();if(0===await t.user.count())throw new A.APIError("BAD_REQUEST",{message:"Create the initial account before changing registration."});await t.authSettings.upsert({where:{id:eb},create:{id:eb,bootstrapCompleted:!0,registrationEnabled:e},update:{registrationEnabled:e}})}async function eT(e,t){if(e===t)throw new A.APIError("BAD_REQUEST",{message:"You cannot delete the account you are currently using."});let r=await (0,ec.getPrismaClient)();if(1!==await r.$executeRaw`
465
+ `)}}(t={...t,secret:i,baseURL:u?t.baseURL:p?new URL(p).origin:"",basePath:t.basePath||"/api/auth",plugins:l.concat(c)},d);let A=t.advanced?.ipAddress?.trustedProxies;if(A&&A.length>0){let e=A.filter(e=>null===I(e));e.length>0&&d.warn(`Ignoring invalid \`advanced.ipAddress.trustedProxies\` entries: ${e.join(", ")}. Each entry must be an IP address or CIDR range.`)}let E=(0,ti.getCookies)(t),b=(0,eO.getAuthTables)(t),_=(await Promise.all(Object.entries(t.socialProviders||{}).map(async([e,t])=>{let r="function"==typeof t?await t():t;if(null==r||!1===r.enabled)return null;r.clientId||d.warn(`Social provider ${e} is missing clientId or clientSecret`);let i=o_[e](r);return i.disableImplicitSignUp=r.disableImplicitSignUp,i}))).filter(e=>null!==e),R=({model:e,size:r})=>{if("function"==typeof t.advanced?.generateId)return t.advanced.generateId({model:e,size:r});let i=t?.advanced?.database?.generateId;return"function"==typeof i?i({model:e,size:r}):"uuid"===i?crypto.randomUUID():"serial"!==i&&!1!==i&&(0,D.generateId)(r)},{publish:T}=await nP(t,{adapter:e.id,database:"function"==typeof t.database?"adapter":r(t.database)}),S=new Set(t.plugins.map(e=>e.id)),v=await tD(t),U=await tC(t),O={appName:t.appName||"Better Auth",baseURL:p||"",version:(0,nd.getBetterAuthVersion)(),socialProviders:_,options:t,oauthConfig:{storeStateStrategy:t.account?.storeStateStrategy||(s?"database":"cookie"),skipStateCookieCheck:!!t.account?.skipStateCookieCheck},tables:b,trustedOrigins:v,trustedProviders:U,isTrustedOrigin(e,t){return this.trustedOrigins.some(r=>e3(e,r,t))},sessionConfig:{updateAge:t.session?.updateAge!==void 0?t.session.updateAge:86400,expiresIn:t.session?.expiresIn||604800,freshAge:t.session?.freshAge===void 0?86400:t.session.freshAge,cookieRefreshCache:(n=t.session?.cookieCache?.refreshCache,a=t.session?.cookieCache?.maxAge||300,s&&n?(d.warn("[better-auth] `session.cookieCache.refreshCache` is enabled while `database` or `secondaryStorage` is configured. `refreshCache` is meant for stateless (DB-less) setups. Disabling `refreshCache` — remove it from your config to silence this warning."),!1):!1!==n&&void 0!==n&&(!0===n?{enabled:!0,updateAge:Math.floor(.2*a)}:{enabled:!0,updateAge:void 0!==n.updateAge?n.updateAge:Math.floor(.2*a)}))},secret:i,secretConfig:o,rateLimit:{...t.rateLimit,enabled:t.rateLimit?.enabled??f.isProduction,window:t.rateLimit?.window||10,max:t.rateLimit?.max||100,storage:t.rateLimit?.storage||(t.secondaryStorage?"secondary-storage":"memory")},authCookies:E,logger:d,generateId:R,session:null,secondaryStorage:t.secondaryStorage,password:{hash:t.emailAndPassword?.password?.hash||te,verify:t.emailAndPassword?.password?.verify||tr,config:{minPasswordLength:t.emailAndPassword?.minPasswordLength||8,maxPasswordLength:t.emailAndPassword?.maxPasswordLength||128},checkPassword:tj},setNewSession(e){this.newSession=e},newSession:null,adapter:e,internalAdapter:tb(e,{options:t,logger:d,hooks:t.databaseHooks?[{source:"user",hooks:t.databaseHooks}]:[],generateId:R}),createAuthCookie:(0,ti.createCookieGetter)(t),async runMigrations(){throw new k.BetterAuthError("runMigrations will be set by the specific init implementation")},publishTelemetry:T,skipCSRFCheck:!!t.advanced?.disableCSRFCheck,skipOriginCheck:t.advanced?.disableOriginCheck!==void 0?t.advanced.disableOriginCheck:!!(0,f.isTest)(),runInBackground:t.advanced?.backgroundTasks?.handler??(e=>{e.catch(()=>{})}),async runInBackgroundOrAwait(e){try{t.advanced?.backgroundTasks?.handler?e instanceof Promise&&t.advanced.backgroundTasks.handler(e.catch(e=>{d.error("Failed to run background task:",e)})):await e}catch(e){d.error("Failed to run background task:",e)}},getPlugin:e=>t.plugins.find(t=>t.id===e)??null,hasPlugin:e=>S.has(e)},x=tx(O);return(0,e4.isPromise)(x)&&await x,O}let nL=async e=>{let t=await eP(e),r=await nN(t,e,e=>(0,eL.getKyselyDatabaseType)(e)||"unknown");return r.runMigrations=async function(){if(!e.database||"updateMany"in e.database)throw new k.BetterAuthError("Database is not provided or it's an adapter. Migrations are only supported with a database instance.");let{runMigrations:t}=await eZ(e);await t()},r};e.s(["betterAuth",0,e=>((e,t)=>{let r=t(e),{api:i}=nc(r,e),o=e.plugins?.reduce((e,t)=>t.$ERROR_CODES?{...e,...t.$ERROR_CODES}:e,{}),n=async t=>{let i,o=await r,n=o.options.basePath||"/api/auth";if((0,eX.isDynamicBaseURLConfig)(e.baseURL))i=await tN(o,t,tP(o.options));else{i=Object.create(Object.getPrototypeOf(o),Object.getOwnPropertyDescriptors(o));let e=o.options;if(!o.options.baseURL){let r=(0,eX.getBaseURL)(void 0,n,t,void 0,o.options.advanced?.trustedProxyHeaders);if(!r)throw new k.BetterAuthError("Could not get base URL from request. Please provide a valid base URL.");i.baseURL=r,i.options={...o.options,baseURL:(0,eX.getOrigin)(r)||void 0},e=i.options}i.trustedOrigins=await tD(e,t),i.trustedProviders=await tC(e,t)}let{handler:a}=((e,t)=>{let{api:r,middlewares:i}=nc(e,t),o=new URL(e.baseURL).pathname;return(0,nl.createRouter)(r,{routerContext:e,openapi:{disabled:!0},basePath:o,routerMiddleware:[{path:"/**",middleware:tW},...i],allowedMediaTypes:["application/json"],skipTrailingSlashes:t.advanced?.skipTrailingSlashes??!1,async onRequest(t){let r=e.options.disabledPaths||[],i=tV(t.url,o);if(r.includes(i))return new Response("Not Found",{status:404});let n=t,a=await t2(n,e);if(a)return a;for(let t of e.options.plugins||[])if(t.onRequest){let r=await (0,tg.withSpan)(`onRequest ${t.id}`,{[th]:"onRequest",[tm]:`plugin:${t.id}`},()=>t.onRequest(n,e));if(r&&"response"in r)return r.response;r&&"request"in r&&(n=r.request)}return n},async onResponse(t,r){for(let r of e.options.plugins||[])if(r.onResponse){let i=await (0,tg.withSpan)(`onResponse ${r.id}`,{[th]:"onResponse",[tm]:`plugin:${r.id}`,[tp.ATTR_HTTP_RESPONSE_STATUS_CODE]:t.status},()=>r.onResponse(t,e));if(i)return i.response}return t},onError(r){if((0,t$.isAPIError)(r)&&"FOUND"===r.status)return;if(t.onAPIError?.throw)throw r;if(t.onAPIError?.onError)return void t.onAPIError.onError(r,e);let i=t.logger?.level,o="error"===i||"warn"===i||"debug"===i?ex.logger:void 0;if(t.logger?.disabled!==!0){if(r&&"object"==typeof r&&"message"in r&&"string"==typeof r.message&&(r.message.includes("no column")||r.message.includes("column")||r.message.includes("relation")||r.message.includes("table")||r.message.includes("does not exist")))return void e.logger?.error(r.message);(0,t$.isAPIError)(r)?("INTERNAL_SERVER_ERROR"===r.status&&e.logger.error(r.status,r),o?.error(r.message)):e.logger?.error(r&&"object"==typeof r&&"name"in r?r.name:"",r)}}})})(i,e);return(0,td.runWithAdapter)(i.adapter,()=>a(t))};return{handler:n,fetch:n,api:i,options:e,$context:r,$ERROR_CODES:{...o,...tq.BASE_ERROR_CODES}}})(e,nL)],204721)},749599,e=>{"use strict";let t;var r=e.i(46754),i=e.i(682868),o=e.i(272003),n=e.i(890659);let a=()=>t??=e.A(6878).catch(e=>{throw t=void 0,e});e.s(["nextCookies",0,()=>{let e=!1;return{id:"next-cookies",version:o.PACKAGE_VERSION,hooks:{before:[{matcher:e=>"/get-session"===e.path,handler:(0,n.createAuthMiddleware)(async t=>{let r;if(e||(!function(e,t){let r=e.options.plugins||[];if(0===r.length)return;let i=r.findIndex(e=>e.id===t);-1===i||r.slice(i+1).some(e=>e.hooks&&Array.isArray(e.hooks.after)&&e.hooks.after.length>0)&&e.logger.warn(`[better-auth] Cookie integration plugin "${t}" should be placed last in the plugins array. Plugins with \`hooks.after\` running after it may set cookies that are not forwarded to the framework cookie store. Move your cookie integration plugin to the end of the \`plugins\` array to avoid missing \`Set-Cookie\` headers.`)}(t.context,"next-cookies"),e=!0),"_flag"in t&&"router"===t._flag)return;try{let{headers:e}=await a();r=await e()}catch{return}let o="1"===r.get("RSC"),n=!!r.get("next-action");o&&!n&&await (0,i.setShouldSkipSessionRefresh)(!0)})}],after:[{matcher:e=>!0,handler:(0,n.createAuthMiddleware)(async e=>{let t=e.context.responseHeaders;if((!("_flag"in e)||"router"!==e._flag)&&t instanceof Headers){let e,i=t?.get("set-cookie");if(!i)return;let o=(0,r.parseSetCookieHeader)(i);try{let{cookies:t}=await a();e=await t()}catch(e){if(e instanceof Error&&(e.message.startsWith("`cookies` was called outside a request scope.")||e.message.includes("Cannot find module")))return;throw e}o.forEach((t,i)=>{if(i)try{e.set(i,t.value,(0,r.toCookieOptions)(t))}catch{}});return}})}]}}},"toNextJsHandler",0,function(e){let t=async t=>"handler"in e?e.handler(t):e(t);return{GET:t,POST:t,PATCH:t,PUT:t,DELETE:t}}],749599)},303361,e=>{"use strict";let t=new Set(["localhost","127.0.0.1","::1","[::1]"]);function r(e){let r,i=e.trim();if(!i)throw Error("APP_ORIGINS contains an empty entry.");if(/[\s/\\]/.test(i.replace(/^https?:\/\//,"")))throw Error(`APP_ORIGINS entry "${i}" must be a bare host or an origin, with no path.`);if(i.includes("@"))throw Error(`APP_ORIGINS entry "${i}" must not contain credentials.`);let o=/^(https?):\/\/(.+)$/.exec(i),n=o?"https"===o[1]?"https:":"http:":null,a=o?o[2]:i,s=/^(\[[^\]]+\]|[^:]+)(?::(\d+))?$/.exec(a);if(!s)throw Error(`APP_ORIGINS entry "${i}" is not a valid host.`);let l=s[1].toLowerCase(),c=s[2]??null;if(!l||"."===l)throw Error(`APP_ORIGINS entry "${i}" is not a valid host.`);let d=l.includes("*");return d&&function(e,t){let r=e.split(".");if(r.slice(1).some(e=>e.includes("*")))throw Error(`APP_ORIGINS entry "${t}" may only use a wildcard in its leftmost label.`);if("*"!==r[0])throw Error(`APP_ORIGINS entry "${t}" must use "*" as a whole label, for example "*.example.com".`);if(r.length<3)throw Error(`APP_ORIGINS entry "${t}" is too broad; a wildcard needs at least two literal labels after it.`)}(l,i),{hostname:l,host:c?`${l}:${c}`:l,port:c,protocol:n,wildcard:d,loopback:(r=l.toLowerCase().replace(/^\[|\]$/g,""),!!(t.has(r)||"::1"===r||r.endsWith(".localhost"))||/^127\./.test(r))}}function i(e,t){return e.protocol?e.protocol:e.loopback?"http:":t?"https:":"http:"}let o=!1;function n(e){let t=e.trim().toLowerCase();return!(!t||/[\s/\\@]/.test(t))&&/^(\[[^\]]+\]|[^:]+)(?::\d+)?$/.test(t)}function a(e,t){let r=e.trim().toLowerCase();if(!r)return!1;let i=/^(\[[^\]]+\]|[^:]+)(?::(\d+))?$/.exec(r);if(!i)return!1;let o=i[1],n=i[2]??null;return(!t.port||t.port===n)&&function(e,t){let r=e.trim().toLowerCase();if(!r)return!1;if(!t.wildcard)return t.hostname===r;let i=t.hostname.slice(1);return r.endsWith(i)&&r.length>i.length}(o,t)}function s(e,t){let r=t=>{let r=e.headers.get(t)?.split(",")[0]?.trim();return r&&!/[\s/\\@]/.test(r)?r:null},i=t?r("x-forwarded-host"):null,o=t?r("x-forwarded-proto"):null,a=i??r("host");if(a&&n(a)){let t="https"===o||"http"===o?o:new URL(e.url).protocol.replace(":","");return`${t}://${a.toLowerCase()}`}try{return new URL(e.url).origin}catch{return null}}e.s(["betterAuthBaseURL",0,function(e){if("inferred"!==e.mode)return"single"===e.mode?e.canonical:{allowedHosts:e.patterns.flatMap(e=>e.port?[e.host]:[e.host,`${e.host}:*`]),protocol:e.allHttps?"https":"auto",fallback:e.canonical}},"isSameOriginRequest",0,function(e,t){let r=e.headers.get("sec-fetch-site");if(r)return"same-origin"===r||"none"===r;let i=e.headers.get("origin");if(!i)return!0;let o=s(e,t);return!!o&&i.trim().toLowerCase()===o},"isTrustedOrigin",0,function(e,t){let r=t.trim();if(!r)return!1;let i=r;if(/^https?:\/\//i.test(r))try{i=new URL(r).host}catch{return!1}return"inferred"===e.mode?n(i):e.patterns.some(e=>a(i,e))},"originFromRequest",0,s,"resolveAppOrigins",0,function(e=process.env){let t,n="phase-production-build"===e.NEXT_PHASE,s="production"===e.NODE_ENV&&!n,l=e.APP_ORIGINS?.trim(),c=function(e){let t,r=e.PUBLIC_BASE_URL?.trim();if(!r)return null;try{t=new URL(r)}catch{throw Error("PUBLIC_BASE_URL must be an absolute http or https URL.")}if("http:"!==t.protocol&&"https:"!==t.protocol)throw Error("PUBLIC_BASE_URL must use http or https.");return t}(e),d=l?l.split(",").map(e=>e.trim()).filter(Boolean).map(r):[];if(s&&0===d.length&&!c)return o||(o=!0,console.warn("[origins] Neither APP_ORIGINS nor PUBLIC_BASE_URL is set. Each request's own Host header will be trusted, so absolute URLs this server generates — OAuth callbacks, iOS enrollment and install links, the GitHub webhook URL — follow whatever host the caller asked for. Set APP_ORIGINS to the hostname(s) this server is reached at to pin them.")),{patterns:[],canonical:null,mode:"inferred",allHttps:!1};let u=s?d:function(e){let t=new Map;for(let r of e){let e=t.get(r.host);e?"http:"===r.protocol&&t.set(r.host,{...e,protocol:"http:"}):t.set(r.host,r)}return[...t.values()]}([...(t=e.PORT?.trim()||"3000",["localhost","127.0.0.1","[::1]"].map(e=>r(`http://${e}:${t}`))),...d]);if(0===u.length&&c&&(u=[r(c.origin)]),s){let e=u.filter(e=>e.wildcard);if(e.length>0)throw Error(`APP_ORIGINS may not use wildcards in production (${e.map(e=>e.hostname).join(", ")}). A wildcard trusts every host under it for CSRF and for post-login redirects; list exact hosts instead.`)}c&&!u.some(e=>a(c.host,e))&&(u=[...u,r(c.origin)]);let p=u.find(e=>!e.wildcard);if(!p&&!c)throw Error("APP_ORIGINS must include at least one exact origin; a wildcard alone gives this server no address to put in the links it generates.");return{patterns:u,canonical:c?.origin??`${i(p,s)}//${p.host}`,mode:1!==u.length||u[0].wildcard?"multi":"single",allHttps:u.every(e=>e.loopback||"https:"===i(e,s))}}])},576257,169040,464661,354470,e=>{"use strict";var t=e.i(363004),r=e.i(931129),i=e.i(204721),o=e.i(749599),n=e.i(756023),a=e.i(272003),s=e.i(483319);let l=(0,s.createAccessControl)({user:["create","list","set-role","ban","impersonate","impersonate-admins","delete","set-password","set-email","get","update"],session:["list","revoke","delete"]}),c={admin:l.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","set-email","get","update"],session:["list","revoke","delete"]}),user:l.newRole({user:[],session:[]})};var d=e.i(672823);let u=(0,d.defineErrorCodes)({FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application",YOU_ARE_NOT_ALLOWED_TO_GET_USER:"You are not allowed to get user",NO_DATA_TO_UPDATE:"No data to update",YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS:"You are not allowed to update users",YOU_CANNOT_REMOVE_YOURSELF:"You cannot remove yourself",YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE:"You are not allowed to set a non-existent role value",YOU_CANNOT_IMPERSONATE_ADMINS:"You cannot impersonate admins",INVALID_ROLE_TYPE:"Invalid role type",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL:"You are not allowed to update users email",PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER:"Password cannot be updated through update-user. Use the set-user-password endpoint instead"});var p=e.i(786198);let f=async e=>{let t=e.context.returned;return t?t instanceof Response?200!==t.status?null:await t.clone().json():(0,p.isAPIError)(t)?null:t:null};var h=e.i(542158),m=e.i(370728),g=e.i(112996);let w=e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions)return!1;let t=(e.role||e.options?.defaultRole||"user").split(","),r=e.options?.roles||c;for(let i of t)if(r[i]?.authorize(e.permissions)?.success)return!0;return!1};var y=e.i(676386),A=e.i(71616),E=e.i(910228),b=e.i(776757),I=e.i(890659),_=e.i(907855),R=e.i(754257);let T=(0,I.createAuthMiddleware)(async e=>{let t=await (0,g.getAuthoritativeSessionFromCtx)(e);if(!t)throw A.APIError.fromStatus("UNAUTHORIZED");return{session:t}});function S(e){return Array.isArray(e)?e.join(","):e}let k=_.object({userId:R.coerce.string().meta({description:"The user id"}),role:_.union([_.string().meta({description:"The role to set. `admin` or `user` by default"}),_.array(_.string().meta({description:"The roles to set. `admin` or `user` by default"}))]).meta({description:"The role to set, this can be a string or an array of strings. Eg: `admin` or `[admin, user]`"})}),v=_.object({id:_.string().meta({description:"The id of the User"})}),U=_.object({email:_.string().meta({description:"The email of the user"}),password:_.string().optional().meta({description:"The password of the user. If not provided, the user will be created without a credential account (useful for magic link or social login only users)."}),name:_.string().meta({description:"The name of the user"}),role:_.union([_.string().meta({description:"The role of the user"}),_.array(_.string().meta({description:"The roles of user"}))]).optional().meta({description:'A string or array of strings representing the roles to apply to the new user. Eg: "user"'}),data:_.record(_.string(),_.any()).optional().meta({description:"Extra fields for the user. Including custom additional fields."})}),O=_.object({userId:R.coerce.string().meta({description:"The user id"}),data:_.record(_.any(),_.any()).meta({description:"The user data to update"})}),x=_.object({searchValue:_.string().optional().meta({description:'The value to search for. Eg: "some name"'}),searchField:_.enum(["email","name"]).meta({description:'The field to search in, defaults to email. Can be `email` or `name`. Eg: "name"'}).optional(),searchOperator:_.enum(["contains","starts_with","ends_with"]).meta({description:'The operator to use for the search. Can be `contains`, `starts_with` or `ends_with`. Eg: "contains"'}).optional(),limit:_.string().meta({description:"The number of users to return"}).or(_.number()).optional(),offset:_.string().meta({description:"The offset to start from"}).or(_.number()).optional(),sortBy:_.string().meta({description:"The field to sort by"}).optional(),sortDirection:_.enum(["asc","desc"]).meta({description:"The direction to sort by"}).optional(),filterField:_.string().meta({description:"The field to filter by"}).optional(),filterValue:_.string().meta({description:"The value to filter by"}).or(_.number()).or(_.boolean()).or(_.array(_.string())).or(_.array(_.number())).optional(),filterOperator:_.enum(b.whereOperators).meta({description:"The operator to use for the filter"}).optional()}),D=_.object({userId:R.coerce.string().meta({description:"The user id"})}),P=_.object({userId:R.coerce.string().meta({description:"The user id"})}),N=_.object({userId:R.coerce.string().meta({description:"The user id"}),banReason:_.string().meta({description:"The reason for the ban"}).optional(),banExpiresIn:_.number().meta({description:"The number of seconds until the ban expires"}).optional()}),L=_.object({userId:R.coerce.string().meta({description:"The user id"})}),C=_.object({sessionToken:_.string().meta({description:"The session token"})}),q=_.object({userId:R.coerce.string().meta({description:"The user id"})}),B=_.object({userId:R.coerce.string().meta({description:"The user id"})}),j=_.object({newPassword:_.string().nonempty("newPassword cannot be empty").meta({description:"The new password"}),userId:R.coerce.string().nonempty("userId cannot be empty").meta({description:"The user id"})}),$=_.object({userId:R.coerce.string().optional().meta({description:'The user id. Eg: "user-id"'}),role:_.string().optional().meta({description:'The role to check permission for. Eg: "admin"'})}).and(_.xor([_.object({permission:_.record(_.string(),_.array(_.string()))}),_.object({permissions:_.record(_.string(),_.array(_.string()))})])),V={user:{fields:{role:{type:"string",required:!1,input:!1},banned:{type:"boolean",defaultValue:!1,required:!1,input:!1},banReason:{type:"string",required:!1,input:!1},banExpires:{type:"date",required:!1,input:!1}}},session:{fields:{impersonatedBy:{type:"string",required:!1,input:!1}}}};var M=e.i(46754);e.i(418069);var F=e.i(444336),H=e.i(35972);function K(e){try{return decodeURIComponent(e)}catch{return e}}let z=(0,d.defineErrorCodes)({INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration",TOKEN_URL_NOT_FOUND:"Invalid OAuth configuration. Token URL not found."});var W=e.i(533078),Y=e.i(878175);e.i(339507);var G=e.i(945e3),Q=e.i(729522),J=e.i(661372),Z=e.i(374091),X=e.i(100762),ee=e.i(550064);async function et(e,t){let r=await (0,W.betterFetch)(e,{method:"GET",headers:t});if(r.error||!r.data)return null;if(r.data.issuer)try{new URL(r.data.issuer)}catch{return null}return r.data}async function er(e,t){if(e.idToken)try{let t=(0,Y.decodeJwt)(e.idToken);if(t?.sub&&t?.email)return{id:t.sub,emailVerified:t.email_verified,image:t.picture,...t}}catch{}if(!t)return null;let r=await (0,W.betterFetch)(t,{method:"GET",headers:{Authorization:`Bearer ${e.accessToken}`}});return r.error||!r.data?null:{...r.data,email:r.data.email,emailVerified:r.data.email_verified??!1,image:r.data.picture,name:r.data.name}}var ei=e.i(51144),eo=e.i(530501),en=e.i(282318);let ea=async e=>{let t=await (0,en.createHash)("SHA-256").digest(new TextEncoder().encode(e));return eo.base64Url.encode(new Uint8Array(t),{padding:!1})},es=_.object({token:_.string().meta({description:'The token to verify. Eg: "some-token"'})});var el=e.i(303361),ec=e.i(243783),ed=e.i(187126);function eu(e,t){return e[t]?.trim()||void 0}function ep(e,t){let r=eu(e,t);if(!r)throw Error(`${t} is required for AUTH_MODE.`);return r}function ef(e=process.env){let t=function(e){let t=eu(e,"AUTH_MODE")??"password";if("password"!==t&&"oidc"!==t&&"both"!==t)throw Error('AUTH_MODE must be "password", "oidc", or "both".');return t}(e),r=(0,el.resolveAppOrigins)(e);return{secret:(0,ed.getAppSecrets)(e).authSecret,origins:r,baseURL:r.canonical,trustProxyHeaders:function(e){let t=eu(e,"TRUST_PROXY_HEADERS")?.toLowerCase();if(!t||"false"===t||"0"===t)return!1;if("true"===t||"1"===t)return!0;throw Error("TRUST_PROXY_HEADERS must be true, false, 1, or 0.")}(e),mode:t,provider:function(e,t){if("password"===t)return null;let r=eu(e,"AUTH_OAUTH_DISCOVERY_URL"),i=eu(e,"AUTH_OAUTH_AUTHORIZATION_URL"),o=eu(e,"AUTH_OAUTH_TOKEN_URL"),n=eu(e,"AUTH_OAUTH_USER_INFO_URL"),a=eu(e,"AUTH_OAUTH_ISSUER"),s=!!(i||o||n),l=i&&o&&n;if(r&&s)throw Error("OIDC configuration must use either discovery or explicit endpoints, not both.");if(!r&&!l)throw Error("OIDC authentication requires AUTH_OAUTH_DISCOVERY_URL or all of AUTH_OAUTH_AUTHORIZATION_URL, AUTH_OAUTH_TOKEN_URL, and AUTH_OAUTH_USER_INFO_URL.");if(s&&!l)throw Error("Explicit OAuth configuration must include authorization, token, and user-info URLs.");if(l&&!a)throw Error("AUTH_OAUTH_ISSUER is required with explicit OAuth endpoints.");let c=ep(e,"AUTH_OAUTH_SCOPES").split(",").map(e=>e.trim()).filter(Boolean);if(0===c.length)throw Error("AUTH_OAUTH_SCOPES must contain at least one scope.");return{providerId:ep(e,"AUTH_OAUTH_PROVIDER_ID"),displayName:ep(e,"AUTH_OAUTH_PROVIDER_NAME"),clientId:ep(e,"AUTH_OAUTH_CLIENT_ID"),clientSecret:ep(e,"AUTH_OAUTH_CLIENT_SECRET"),scopes:c,requireIssuerValidation:function(e){let t=eu(e,"AUTH_OAUTH_REQUIRE_ISSUER_VALIDATION")?.toLowerCase();if(!t||"false"===t||"0"===t)return!1;if("true"===t||"1"===t)return!0;throw Error("AUTH_OAUTH_REQUIRE_ISSUER_VALIDATION must be true, false, 1, or 0.")}(e),discoveryUrl:r,issuer:a,authorizationUrl:i,tokenUrl:o,userInfoUrl:n}}(e,t)}}function eh(e){return"password"===e||"both"===e}function em(e){return"oidc"===e||"both"===e}e.s(["getAuthRuntimeConfig",0,ef,"oauthAuthenticationEnabled",0,em,"passwordAuthenticationEnabled",0,eh],169040);var eg=e.i(812057);let ew=RegExp(String.raw`((?:"?(?:authorization|password|accessToken|refreshToken|idToken|sessionToken|clientSecret|secret|privateKey)"?)\s*:\s*)(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^,\n}\]]+)`,"gi");function ey(e){return e.replace(ew,'$1"[REDACTED]"')}function eA(e,t,...r){let i=[`${new Date().toISOString()} ${e.toUpperCase()} [Better Auth]: ${t}`,...r.map(e=>"string"==typeof e?e:(0,eg.inspect)(e,{depth:6,breakLength:120}))].map(ey);"error"===e?console.error(...i):"warn"===e?console.warn(...i):console.log(...i)}function eE(e){return"string"==typeof e&&e.length>0?e:void 0}async function eb(e,t){try{return await fetch(e,{headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${t}`,"User-Agent":"AI-Development-Environment"}})}catch{return null}}async function eI(e,t){let r,i=await eb(e,t);if(!i?.ok)return null;let o=await i.json(),n=eE(o.email),a=await eb(((r=new URL(e)).pathname=`${r.pathname.replace(/\/$/,"")}/emails`,r.toString()),t),s=a?.ok?await a.json():[],l=Array.isArray(s)?s:[],c=l.find(e=>!0===e.primary)??l[0],d=n??eE(c?.email),u=l.find(e=>eE(e.email)===d);return{...o,email:d,emailVerified:u?.verified===!0,image:eE(o.avatar_url),name:eE(o.name)??eE(o.login)??""}}var e_=e.i(666680);let eR="default";async function eT(){let e=await (0,ec.getPrismaClient)();return await e.authSettings.findUnique({where:{id:eR}})??await e.authSettings.upsert({where:{id:eR},create:{id:eR},update:{}})}async function eS(){let e=await (0,ec.getPrismaClient)(),[t,r]=await Promise.all([eT(),e.user.count()]);return t.bootstrapCompleted||0!==r?!t.bootstrapCompleted&&r>0?(await e.authSettings.update({where:{id:eR},data:{bootstrapCompleted:!0,registrationEnabled:!1,bootstrapClaimId:null,bootstrapClaimedAt:null}}),{enabled:!1,setupRequired:!1}):{enabled:t.registrationEnabled,setupRequired:!1}:{enabled:!0,setupRequired:!0}}async function ek(e){let t=await (0,ec.getPrismaClient)();if(0===await t.user.count())throw new A.APIError("BAD_REQUEST",{message:"Create the initial account before changing registration."});await t.authSettings.upsert({where:{id:eR},create:{id:eR,bootstrapCompleted:!0,registrationEnabled:e},update:{registrationEnabled:e}})}async function ev(e,t){if(e===t)throw new A.APIError("BAD_REQUEST",{message:"You cannot delete the account you are currently using."});let r=await (0,ec.getPrismaClient)();if(1!==await r.$executeRaw`
466
466
  DELETE FROM "user"
467
467
  WHERE "id" = ${e}
468
468
  AND (SELECT COUNT(*) FROM "user") > 1
469
- `){if(!await r.user.findUnique({where:{id:e},select:{id:!0}}))throw new A.APIError("NOT_FOUND",{message:"User not found."});throw new A.APIError("BAD_REQUEST",{message:"The final account cannot be deleted."})}}async function eS({allowWhenRegistrationClosed:e=!1}={}){let t=await (0,ec.getPrismaClient)(),r=await eI();if(r.bootstrapCompleted){if(!r.registrationEnabled&&!e)throw new A.APIError("FORBIDDEN",{message:"Account registration is disabled."});return}if(await t.user.count()>0){if(await t.authSettings.update({where:{id:eb},data:{bootstrapCompleted:!0,registrationEnabled:!1,bootstrapClaimId:null,bootstrapClaimedAt:null}}),e)return;throw new A.APIError("FORBIDDEN",{message:"Account registration is disabled."})}let i=new Date(Date.now()-18e4),o=(0,eE.randomUUID)();if(1!==(await t.authSettings.updateMany({where:{id:eb,bootstrapCompleted:!1,OR:[{bootstrapClaimedAt:null},{bootstrapClaimedAt:{lt:i}}]},data:{bootstrapClaimId:o,bootstrapClaimedAt:new Date}})).count)throw new A.APIError("CONFLICT",{message:"The initial account is already being created. Try again shortly."})}async function ek(){let e=await (0,ec.getPrismaClient)();await e.authSettings.updateMany({where:{id:eb,bootstrapCompleted:!1},data:{bootstrapCompleted:!0,registrationEnabled:!1,bootstrapClaimId:null,bootstrapClaimedAt:null}})}let ev={user:{create:{before:async(e,t)=>(await eS({allowWhenRegistrationClosed:t?.path?.includes("/admin/create-user")??!1}),{data:{...e,role:"user",banned:!1,banReason:null,banExpires:null}}),after:async()=>{await ek()}},update:{before:async e=>({data:{...e,role:"user",banned:!1,banReason:null,banExpires:null}})},delete:{before:async()=>{throw new A.APIError("BAD_REQUEST",{message:"Accounts must be deleted through the management API."})}}}};e.s(["authDatabaseHooks",0,ev,"deleteManagedUser",0,eT,"getRegistrationStatus",0,e_,"setRegistrationEnabled",0,eR],464661);let eU={user:["create","list","set-password","set-email","get","update"],session:["list","revoke","delete"]},eO=(0,s.createAccessControl)(eU),ex=eO.newRole(eU),eD=null;function eP(){return eD||(eD=(0,ec.getPrismaClient)().then(e=>(function(e,s=ef()){let l=em(s.mode)&&s.provider?(e=>{let t=new Set,r=new Set;for(let i of e.config){let e=i.providerId;t.has(e)&&r.add(e),t.add(e)}return r.size>0&&console.warn(`Duplicate provider IDs found: ${Array.from(r).join(", ")}`),{id:"generic-oauth",version:a.PACKAGE_VERSION,init:async t=>{let r=[];for(let i of e.config){let e,o,n=i.authorizationUrl,a=i.tokenUrl,s=i.userInfoUrl,l=i.endSessionEndpoint,c=!1;if(i.discoveryUrl){let r=await et(i.discoveryUrl,i.discoveryHeaders).catch(e=>(t.logger.error(`Discovery fetch failed for "${i.providerId}": ${e}`),null));if(r){if(!r.issuer&&!i.accountIssuer)throw Error(`Provider "${i.providerId}": discovery did not return an issuer. Configure accountIssuer explicitly to establish a stable account namespace.`);n??=r.authorization_endpoint,a??=r.token_endpoint,s??=r.userinfo_endpoint,l??=r.end_session_endpoint,e=r.issuer;let t=r.id_token_signing_alg_values_supported;if(c=Array.isArray(t)&&t.length>0,r.jwks_uri&&r.issuer){let e;try{e=new URL(r.jwks_uri,i.discoveryUrl)}catch{throw Error(`Provider "${i.providerId}": invalid jwks_uri "${r.jwks_uri}" in discovery document.`)}o={jwks:(0,ee.createRemoteJWKSet)(e),issuer:r.issuer,audience:i.clientId,algorithms:c?t:void 0}}}else if(i.accountIssuer)n&&a||t.logger.error(`Provider "${i.providerId}": discovery returned no data and no explicit endpoints configured. OAuth sign-in will fail for this provider.`);else throw Error(`Provider "${i.providerId}": discovery returned no valid data. Provider initialization stopped to keep its account issuer stable.`)}if(i.requireIdTokenVerification&&!o)throw Error(`Provider "${i.providerId}": requires verified ID tokens, but discovery did not provide a usable issuer and jwks_uri.`);let d=i.tokenEndpointAuth;if(i.clientSecret&&(d?.method==="private_key_jwt"||d?.method==="none"))throw Error(`Provider "${i.providerId}": tokenEndpointAuth.method "${d?.method}" cannot be combined with clientSecret`);if(!i.clientSecret&&(d?.method==="client_secret_basic"||d?.method==="client_secret_post"))throw Error(`Provider "${i.providerId}": tokenEndpointAuth.method "${d?.method}" requires clientSecret`);if(!i.clientSecret&&!d&&"basic"===i.authentication)throw Error(`Provider "${i.providerId}": authentication "basic" requires clientSecret`);let u=i.accountSubject,p=i.accountIssuer,f={id:i.providerId,name:i.name??i.providerId,issuer:e,accountSubject:({tokens:e,profile:t})=>u?u({tokens:e,profile:t}):c?t.sub??"":t.id??"",accountIssuer:"function"==typeof p?({tokens:e,profile:t})=>p({tokens:e,profile:t}):p??e,idToken:o,requiresIdTokenNonce:void 0!==o&&!0!==i.disableIdTokenNonceBinding,allowIdpInitiated:i.allowIdpInitiated,async createEndSessionURL(e){let r;if(i.disableProviderLogout||!l)return null;try{r=new URL(l)}catch{return null}e.idToken&&r.searchParams.set("id_token_hint",e.idToken);let o=e.postLogoutRedirectURI??i.postLogoutRedirectURI,n=o?new URL(o,t.baseURL).toString():void 0;return n?(r.searchParams.set("post_logout_redirect_uri",n),r.searchParams.set("client_id",i.clientId),e.state&&r.searchParams.set("state",e.state)):e.idToken||r.searchParams.set("client_id",i.clientId),r},createAuthorizationURL(e){if(!n)throw A.APIError.from("BAD_REQUEST",z.INVALID_OAUTH_CONFIGURATION);return(0,Q.createAuthorizationURL)({id:i.providerId,options:{clientId:i.clientId,clientSecret:i.clientSecret,redirectURI:i.redirectURI},authorizationEndpoint:n,state:e.state,codeVerifier:i.pkce??!0?e.codeVerifier:void 0,scopes:(()=>{let t=[...e.scopes??[],...i.scopes??[]];return c&&!t.includes("openid")&&t.unshift("openid"),t})(),redirectURI:e.redirectURI,prompt:i.prompt,accessType:i.accessType,responseType:i.responseType,responseMode:i.responseMode,nonce:e.idTokenNonce,additionalParams:{...i.authorizationUrlParams??{},...e.additionalParams??{}},loginHint:e.loginHint})},async validateAuthorizationCode(e){if(i.getToken)return(0,G.applyDefaultAccessTokenExpiry)(await i.getToken(e),i.accessTokenExpiresIn);if(!a)throw A.APIError.from("BAD_REQUEST",z.TOKEN_URL_NOT_FOUND);return(0,G.applyDefaultAccessTokenExpiry)(await (0,Z.validateAuthorizationCode)({headers:i.authorizationHeaders,code:e.code,codeVerifier:i.pkce??!0?e.codeVerifier:void 0,redirectURI:e.redirectURI,options:{clientId:i.clientId,clientSecret:i.clientSecret,redirectURI:i.redirectURI},tokenEndpoint:a,authentication:i.authentication,tokenEndpointAuth:d,additionalParams:i.tokenUrlParams}),i.accessTokenExpiresIn)},async getUserInfo(e){let{expectedIdTokenNonce:r,...o}=e;if(o.idToken&&f.idToken&&!await (0,X.verifyProviderIdToken)(f,o.idToken,r))return t.logger.error(`Provider "${i.providerId}": id_token failed verification against the discovery JWKS or expected nonce`),null;let n=i.getUserInfo?await i.getUserInfo(o):await er(o,s);if(!n)return null;let a=i.mapProfileToUser?await i.mapProfileToUser(n):{},l={email:n.email,emailVerified:n.emailVerified,image:n.image,name:n.name,...a};return{user:{...l,image:l.image??void 0},data:n}},async refreshAccessToken(e,t){if(!a)throw A.APIError.from("BAD_REQUEST",z.TOKEN_URL_NOT_FOUND);let r="function"==typeof i.refreshTokenParams?await i.refreshTokenParams(t):i.refreshTokenParams;return(0,G.applyDefaultAccessTokenExpiry)(await (0,J.refreshAccessToken)({refreshToken:e,options:{clientId:i.clientId,clientSecret:i.clientSecret},authentication:i.authentication,tokenEndpointAuth:d,tokenEndpoint:a,extraParams:r}),i.accessTokenExpiresIn)},disableImplicitSignUp:i.disableImplicitSignUp,disableSignUp:i.disableSignUp,options:{disableSignUp:i.disableSignUp,overrideUserInfoOnSignIn:i.overrideUserInfo,requireEmailVerification:i.requireEmailVerification}};r.push(f)}let i=new Set(t.socialProviders.map(e=>e.id));for(let e of r)i.has(e.id)&&t.logger.warn(`Generic OAuth provider "${e.id}" shadows a built-in social provider with the same ID`);return{context:{socialProviders:r.concat(t.socialProviders)}}},options:e,$ERROR_CODES:z}})({config:[{providerId:s.provider.providerId,clientId:s.provider.clientId,clientSecret:s.provider.clientSecret,scopes:s.provider.scopes,discoveryUrl:s.provider.discoveryUrl,accountIssuer:`local:oauth:${s.provider.providerId}`,authorizationUrl:s.provider.authorizationUrl,tokenUrl:s.provider.tokenUrl,userInfoUrl:s.provider.userInfoUrl,pkce:!0,requireIdTokenVerification:s.provider.requireIssuerValidation,disableImplicitSignUp:!1}]}):null;return(0,i.betterAuth)({appName:"AI Development Environment",baseURL:(0,el.betterAuthBaseURL)(s.origins),trustedOrigins:e=>{if(!e)return[];let t=(0,el.originFromRequest)(e,s.trustProxyHeaders);return t&&(0,el.isTrustedOrigin)(s.origins,t)?[t]:[]},secret:s.secret,logger:{log:eA},advanced:{trustedProxyHeaders:s.trustProxyHeaders},database:(0,r.prismaAdapter)(e,{provider:"sqlite"}),emailAndPassword:{enabled:eh(s.mode),requireEmailVerification:!1},account:{accountLinking:{enabled:!0,disableImplicitLinking:!0,allowDifferentEmails:!1}},databaseHooks:ev,plugins:[function(){let e=(e=>{let t={...e||{},defaultRole:e?.defaultRole??"user",adminRoles:e?.adminRoles??["admin"],bannedUserMessage:e?.bannedUserMessage??"You have been banned from this application. Please contact support if you believe this is an error."};if(e?.adminRoles){let t=(Array.isArray(e.adminRoles)?e.adminRoles:[...e.adminRoles.split(",")]).filter(t=>!Object.keys(e?.roles||c).map(e=>e.toLowerCase()).includes(t.toLowerCase()));if(t.length>0)throw new A.BetterAuthError(`Invalid admin roles: ${t.join(", ")}. Admin roles must be defined in the 'roles' configuration.`)}return{id:"admin",version:a.PACKAGE_VERSION,init:()=>({options:{databaseHooks:{user:{create:{before:async t=>({data:{role:e?.defaultRole??"user",...t}})}},session:{create:{async before(e,r){if(!r)return;let i=await r.context.internalAdapter.findUserById(e.userId);if(i?.banned){if(i.banExpires&&new Date(i.banExpires).getTime()<Date.now())return void await r.context.internalAdapter.updateUser(e.userId,{banned:!1,banReason:null,banExpires:null});throw A.APIError.from("FORBIDDEN",{message:t.bannedUserMessage,code:"BANNED_USER"})}}}}}}}),hooks:{after:[{matcher:e=>"/list-sessions"===e.path,handler:(0,I.createAuthMiddleware)(async e=>{let t=await f(e);if(!t)return;let r=t.filter(e=>!e.impersonatedBy);return e.json(r)})}]},endpoints:{setRole:(0,I.createAuthEndpoint)("/admin/set-role",{method:"POST",body:k,requireHeaders:!0,use:[T],metadata:{openapi:{operationId:"setUserRole",summary:"Set the role of a user",description:"Set the role of a user",responses:{200:{description:"User role updated",content:{"application/json":{schema:{type:"object",properties:{user:{$ref:"#/components/schemas/User"}}}}}}}},$Infer:{body:{}}}},async e=>{if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["set-role"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE);let r=t.roles;if(r){for(let t of Array.isArray(e.body.role)?e.body.role:[e.body.role])if(!r[t])throw A.APIError.from("BAD_REQUEST",u.YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE)}if(!await e.context.internalAdapter.findUserById(e.body.userId))throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);let i=await e.context.internalAdapter.updateUser(e.body.userId,{role:S(e.body.role)});return e.json({user:(0,n.parseUserOutput)(e.context.options,i)})}),getUser:(0,I.createAuthEndpoint)("/admin/get-user",{method:"GET",query:v,use:[T],metadata:{openapi:{operationId:"getUser",summary:"Get an existing user",description:"Get an existing user",responses:{200:{description:"User",content:{"application/json":{schema:{type:"object",properties:{user:{$ref:"#/components/schemas/User"}}}}}}}}}},async e=>{let{id:r}=e.query;if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["get"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_GET_USER);let i=await e.context.internalAdapter.findUserById(r);if(!i)throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);return(0,n.parseUserOutput)(e.context.options,i)}),createUser:(0,I.createAuthEndpoint)("/admin/create-user",{method:"POST",body:U,metadata:{openapi:{operationId:"createUser",summary:"Create a new user",description:"Create a new user",responses:{200:{description:"User created",content:{"application/json":{schema:{type:"object",properties:{user:{$ref:"#/components/schemas/User"}}}}}}}},$Infer:{body:{}}}},async e=>{let r=await (0,g.getAuthoritativeSessionFromCtx)(e);if(!r&&(e.request||e.headers))throw e.error("UNAUTHORIZED");if(r&&!w({userId:r.user.id,role:r.user.role,options:t,permissions:{user:["create"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS);let{role:i,...o}=e.body.data??{},a=e.body.role??i;if(void 0!==a){if(r&&!w({userId:r.user.id,role:r.user.role,options:t,permissions:{user:["set-role"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE);for(let e of Array.isArray(a)?a:[a]){if("string"!=typeof e)throw A.APIError.from("BAD_REQUEST",u.INVALID_ROLE_TYPE);if(t.roles&&!t.roles[e])throw A.APIError.from("BAD_REQUEST",u.YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE)}}if(r&&["banned","banReason","banExpires"].some(e=>Object.prototype.hasOwnProperty.call(o,e))&&!w({userId:r.user.id,role:r.user.role,options:t,permissions:{user:["ban"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_BAN_USERS);let s=e.body.email.toLowerCase();if(!_.email().safeParse(s).success)throw A.APIError.from("BAD_REQUEST",E.BASE_ERROR_CODES.INVALID_EMAIL);if(await e.context.internalAdapter.findUserByEmail(s))throw A.APIError.from("BAD_REQUEST",u.USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL);let l=await e.context.internalAdapter.createUser({...o,email:s,name:e.body.name,role:void 0!==a?S(a):t?.defaultRole??"user"},{method:"admin"});if(!l)throw A.APIError.from("INTERNAL_SERVER_ERROR",u.FAILED_TO_CREATE_USER);if(e.body.password){let t=await e.context.password.hash(e.body.password);await e.context.internalAdapter.linkAccount({providerId:"credential",issuer:(0,y.createLocalAccountIssuer)("credential"),accountId:l.id,password:t,userId:l.id})}return e.json({user:(0,n.parseUserOutput)(e.context.options,l)})}),adminUpdateUser:(0,I.createAuthEndpoint)("/admin/update-user",{method:"POST",body:O,use:[T],metadata:{openapi:{operationId:"adminUpdateUser",summary:"Update a user",description:"Update a user's details",responses:{200:{description:"User updated",content:{"application/json":{schema:{type:"object",properties:{user:{$ref:"#/components/schemas/User"}}}}}}}}}},async e=>{if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["update"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS);if(0===Object.keys(e.body.data).length)throw A.APIError.from("BAD_REQUEST",u.NO_DATA_TO_UPDATE);let r=e.body.data,i=e=>Object.prototype.hasOwnProperty.call(r,e);if(i("password"))throw A.APIError.from("BAD_REQUEST",u.PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER);if(Object.prototype.hasOwnProperty.call(e.body.data,"role")){if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["set-role"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE);let r=e.body.data.role,i=Array.isArray(r)?r:[r];for(let e of i){if("string"!=typeof e)throw A.APIError.from("BAD_REQUEST",u.INVALID_ROLE_TYPE);if(t.roles&&!t.roles[e])throw A.APIError.from("BAD_REQUEST",u.YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE)}e.body.data.role=S(i)}if(["banned","banReason","banExpires"].some(i)){if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["ban"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_BAN_USERS);if(!0===r.banned&&e.body.userId===e.context.session.user.id)throw A.APIError.from("BAD_REQUEST",u.YOU_CANNOT_BAN_YOURSELF)}if(i("email")||i("emailVerified")){if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["set-email"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL);if(i("email")){let t=String(r.email).toLowerCase();if(!_.email().safeParse(t).success)throw A.APIError.from("BAD_REQUEST",E.BASE_ERROR_CODES.INVALID_EMAIL);let i=await e.context.internalAdapter.findUserByEmail(t);if(i&&i.user.id!==e.body.userId)throw A.APIError.from("BAD_REQUEST",u.USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL);r.email=t}}if(!await e.context.internalAdapter.findUserById(e.body.userId))throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);let o=await e.context.internalAdapter.updateUser(e.body.userId,e.body.data);return!0===r.banned&&await e.context.internalAdapter.deleteUserSessions(e.body.userId),e.json((0,n.parseUserOutput)(e.context.options,o))}),listUsers:(0,I.createAuthEndpoint)("/admin/list-users",{method:"GET",use:[T],query:x,metadata:{openapi:{operationId:"listUsers",summary:"List users",description:"List users",responses:{200:{description:"List of users",content:{"application/json":{schema:{type:"object",properties:{users:{type:"array",items:{$ref:"#/components/schemas/User"}},total:{type:"number"},limit:{type:"number"},offset:{type:"number"}},required:["users","total"]}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{user:["list"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_LIST_USERS);let i=[];e.query?.searchValue&&i.push({field:e.query.searchField||"email",operator:e.query.searchOperator||"contains",value:e.query.searchValue}),e.query?.filterValue!==void 0&&i.push({field:e.query.filterField||"email",operator:e.query.filterOperator||"eq",value:e.query.filterValue});try{let t=await e.context.internalAdapter.listUsers(Number(e.query?.limit)||void 0,Number(e.query?.offset)||void 0,e.query?.sortBy?{field:e.query.sortBy,direction:e.query.sortDirection||"asc"}:void 0,i.length?i:void 0),r=await e.context.internalAdapter.countTotalUsers(i.length?i:void 0);return e.json({users:t.map(t=>(0,n.parseUserOutput)(e.context.options,t)),total:r,limit:Number(e.query?.limit)||void 0,offset:Number(e.query?.offset)||void 0})}catch{return e.json({users:[],total:0})}}),listUserSessions:(0,I.createAuthEndpoint)("/admin/list-user-sessions",{method:"POST",use:[T],body:D,metadata:{openapi:{operationId:"adminListUserSessions",summary:"List user sessions",description:"List user sessions",responses:{200:{description:"List of user sessions",content:{"application/json":{schema:{type:"object",properties:{sessions:{type:"array",items:{$ref:"#/components/schemas/Session"}}}}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{session:["list"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS);let i=await e.context.internalAdapter.listSessions(e.body.userId);return e.json({sessions:i.map(t=>(0,n.parseSessionOutput)(e.context.options,t))})}),unbanUser:(0,I.createAuthEndpoint)("/admin/unban-user",{method:"POST",body:P,use:[T],metadata:{openapi:{operationId:"unbanUser",summary:"Unban a user",description:"Unban a user",responses:{200:{description:"User unbanned",content:{"application/json":{schema:{type:"object",properties:{user:{$ref:"#/components/schemas/User"}}}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{user:["ban"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_BAN_USERS);if(!await e.context.internalAdapter.findUserById(e.body.userId))throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);let i=await e.context.internalAdapter.updateUser(e.body.userId,{banned:!1,banExpires:null,banReason:null,updatedAt:new Date});return e.json({user:(0,n.parseUserOutput)(e.context.options,i)})}),banUser:(0,I.createAuthEndpoint)("/admin/ban-user",{method:"POST",body:N,use:[T],metadata:{openapi:{operationId:"banUser",summary:"Ban a user",description:"Ban a user",responses:{200:{description:"User banned",content:{"application/json":{schema:{type:"object",properties:{user:{$ref:"#/components/schemas/User"}}}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{user:["ban"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_BAN_USERS);if(!await e.context.internalAdapter.findUserById(e.body.userId))throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);if(e.body.userId===e.context.session.user.id)throw A.APIError.from("BAD_REQUEST",u.YOU_CANNOT_BAN_YOURSELF);let i=await e.context.internalAdapter.updateUser(e.body.userId,{banned:!0,banReason:e.body.banReason||t?.defaultBanReason||"No reason",banExpires:e.body.banExpiresIn?(0,h.getDate)(e.body.banExpiresIn,"sec"):t?.defaultBanExpiresIn?(0,h.getDate)(t.defaultBanExpiresIn,"sec"):null,updatedAt:new Date});return await e.context.internalAdapter.deleteUserSessions(e.body.userId),e.json({user:(0,n.parseUserOutput)(e.context.options,i)})}),impersonateUser:(0,I.createAuthEndpoint)("/admin/impersonate-user",{method:"POST",body:L,use:[T],metadata:{openapi:{operationId:"impersonateUser",summary:"Impersonate a user",description:"Impersonate a user",responses:{200:{description:"Impersonation session created",content:{"application/json":{schema:{type:"object",properties:{session:{$ref:"#/components/schemas/Session"},user:{$ref:"#/components/schemas/User"}}}}}}}}}},async e=>{if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["impersonate"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS);let r=await e.context.internalAdapter.findUserById(e.body.userId);if(!r)throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);let i=(Array.isArray(t.adminRoles)?t.adminRoles:t.adminRoles?.split(",")||[]).map(e=>e.trim());if(((r.role||t.defaultRole||"user").split(",").some(e=>i.includes(e))||t.adminUserIds?.includes(r.id))&&!(!0===t.allowImpersonatingAdmins||w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["impersonate-admins"]}})))throw A.APIError.from("FORBIDDEN",u.YOU_CANNOT_IMPERSONATE_ADMINS);let o=await e.context.internalAdapter.createSession(r.id,!0,{impersonatedBy:e.context.session.user.id,expiresAt:t?.impersonationSessionDuration?(0,h.getDate)(t.impersonationSessionDuration,"sec"):(0,h.getDate)(3600,"sec")},!0);if(!o)throw A.APIError.from("INTERNAL_SERVER_ERROR",u.FAILED_TO_CREATE_USER);let a=e.context.authCookies;(0,m.deleteSessionCookie)(e);let s=await e.getSignedCookie(e.context.authCookies.dontRememberToken.name,e.context.secret),l=e.context.createAuthCookie("admin_session");return await e.setSignedCookie(l.name,`${e.context.session.session.token}:${s||""}`,e.context.secret,a.sessionToken.attributes),await (0,m.setSessionCookie)(e,{session:o,user:r},!0),e.json({session:o,user:(0,n.parseUserOutput)(e.context.options,r)})}),stopImpersonating:(0,I.createAuthEndpoint)("/admin/stop-impersonating",{method:"POST",requireHeaders:!0},async e=>{let t=await (0,g.getSessionFromCtx)(e);if(!t)throw A.APIError.fromStatus("UNAUTHORIZED");if(!t.session.impersonatedBy)throw A.APIError.fromStatus("BAD_REQUEST",{message:"You are not impersonating anyone"});let r=await e.context.internalAdapter.findUserById(t.session.impersonatedBy);if(!r)throw A.APIError.fromStatus("INTERNAL_SERVER_ERROR",{message:"Failed to find user"});let i=e.context.createAuthCookie("admin_session"),o=await e.getSignedCookie(i.name,e.context.secret);if(!o)throw A.APIError.fromStatus("INTERNAL_SERVER_ERROR",{message:"Failed to find admin session"});let[a,s]=o?.split(":"),l=await e.context.internalAdapter.findSession(a);if(!l||l.session.userId!==r.id)throw A.APIError.fromStatus("INTERNAL_SERVER_ERROR",{message:"Failed to find admin session"});return await e.context.internalAdapter.deleteSession(t.session.token),await (0,m.setSessionCookie)(e,l,!!s),(0,m.expireCookie)(e,i),e.json({session:(0,n.parseSessionOutput)(e.context.options,l.session),user:(0,n.parseUserOutput)(e.context.options,l.user)})}),revokeUserSession:(0,I.createAuthEndpoint)("/admin/revoke-user-session",{method:"POST",body:C,use:[T],metadata:{openapi:{operationId:"revokeUserSession",summary:"Revoke a user session",description:"Revoke a user session",responses:{200:{description:"Session revoked",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean"}}}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{session:["revoke"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS);return await e.context.internalAdapter.deleteSession(e.body.sessionToken),e.json({success:!0})}),revokeUserSessions:(0,I.createAuthEndpoint)("/admin/revoke-user-sessions",{method:"POST",body:q,use:[T],metadata:{openapi:{operationId:"revokeUserSessions",summary:"Revoke all user sessions",description:"Revoke all user sessions",responses:{200:{description:"Sessions revoked",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean"}}}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{session:["revoke"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS);return await e.context.internalAdapter.deleteUserSessions(e.body.userId),e.json({success:!0})}),removeUser:(0,I.createAuthEndpoint)("/admin/remove-user",{method:"POST",body:B,use:[T],metadata:{openapi:{operationId:"removeUser",summary:"Remove a user",description:"Delete a user and all their sessions and accounts. Cannot be undone.",responses:{200:{description:"User removed",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean"}}}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{user:["delete"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS);if(e.body.userId===e.context.session.user.id)throw A.APIError.from("BAD_REQUEST",u.YOU_CANNOT_REMOVE_YOURSELF);if(!await e.context.internalAdapter.findUserById(e.body.userId))throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);return await e.context.internalAdapter.deleteUserSessions(e.body.userId),await e.context.internalAdapter.deleteUser(e.body.userId),e.json({success:!0})}),setUserPassword:(0,I.createAuthEndpoint)("/admin/set-user-password",{method:"POST",body:j,use:[T],metadata:{openapi:{operationId:"setUserPassword",summary:"Set a user's password",description:"Set a user's password",responses:{200:{description:"Password set",content:{"application/json":{schema:{type:"object",properties:{status:{type:"boolean"}}}}}}}}}},async e=>{if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["set-password"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD);let{newPassword:r,userId:i}=e.body,o=e.context.password.config.minPasswordLength;if(r.length<o)throw e.context.logger.warn("Password is too short"),A.APIError.from("BAD_REQUEST",E.BASE_ERROR_CODES.PASSWORD_TOO_SHORT);let n=e.context.password.config.maxPasswordLength;if(r.length>n)throw e.context.logger.warn("Password is too long"),A.APIError.from("BAD_REQUEST",E.BASE_ERROR_CODES.PASSWORD_TOO_LONG);let a=await e.context.internalAdapter.findUserById(i);if(!a)throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);let s=await e.context.password.hash(r);return await e.context.internalAdapter.findCredentialAccount(i)?await e.context.internalAdapter.updatePassword(i,s):await e.context.internalAdapter.createAccount({userId:i,providerId:"credential",issuer:(0,y.createLocalAccountIssuer)("credential"),accountId:a.id,password:s}),e.json({status:!0})}),userHasPermission:(0,I.createAuthEndpoint)("/admin/has-permission",{method:"POST",body:$,metadata:{openapi:{description:"Check if the user has permission",requestBody:{content:{"application/json":{schema:{type:"object",properties:{permissions:{type:"object",description:"The permission to check"}},required:["permissions"]}}}},responses:{200:{description:"Success",content:{"application/json":{schema:{type:"object",properties:{error:{type:"string"},success:{type:"boolean"}},required:["success"]}}}}}},$Infer:{body:{}}}},async e=>{if(!e.body?.permissions)throw new A.APIError("BAD_REQUEST",{message:"invalid permission check. no permission(s) were passed."});let r=await (0,g.getAuthoritativeSessionFromCtx)(e);if(!r&&(e.request||e.headers))throw new A.APIError("UNAUTHORIZED");if(!r&&!e.body.userId&&!e.body.role)throw new A.APIError("BAD_REQUEST",{message:"user id or role is required"});let i=r?.user||(e.body.role?{id:e.body.userId||"",role:e.body.role}:null)||(e.body.userId?await e.context.internalAdapter.findUserById(e.body.userId):null);if(!i)throw new A.APIError("BAD_REQUEST",{message:"user not found"});let o=w({userId:i.id,role:i.role,options:t,permissions:e.body.permissions});return e.json({error:null,success:o})})},$ERROR_CODES:u,schema:(0,n.mergeSchema)(V,t.schema),options:e}})({ac:eO,roles:{user:ex},defaultRole:"user",adminRoles:["user"]}),{setRole:t,banUser:r,unbanUser:i,impersonateUser:o,stopImpersonating:s,removeUser:l,...d}=e.endpoints;return{...e,endpoints:d}}(),(0,t.apiKey)({schema:{apikey:{modelName:"ApiKey"}},defaultPrefix:"aide_",requireName:!0,startingCharactersConfig:{shouldStore:!0,charactersLength:12},keyExpiration:{defaultExpiresIn:null,disableCustomExpiresTime:!1,minExpiresIn:1,maxExpiresIn:3650},rateLimit:{enabled:!1},enableSessionForAPIKeys:!1}),{id:"bearer",version:a.PACKAGE_VERSION,hooks:{before:[{matcher:e=>!!(e.request?.headers.get("authorization")||e.headers?.get("authorization")),handler:(0,I.createAuthMiddleware)(async e=>{let t,r=e.request?.headers.get("authorization")||e.headers?.get("Authorization");if(!r||"bearer "!==r.slice(0,7).toLowerCase())return;let i=r.slice(7).trim();if(!i)return;t=i.includes(".")?i.includes("%")?K(i):i:K((await (0,F.serializeSignedCookie)("",i,e.context.secret)).replace("=",""));try{if(!await (0,H.createHMAC)("SHA-256","base64urlnopad").verify(e.context.secret,t.split(".")[0],t.split(".")[1]))return}catch{return}let o=e.request?.headers||e.headers,n=new Headers({...Object.fromEntries(o?.entries())});return(0,M.setRequestCookie)(n,e.context.authCookies.sessionToken.name,t),{context:{headers:n}}})}],after:[{matcher:e=>!0,handler:(0,I.createAuthMiddleware)(async e=>{let t=e.context.responseHeaders?.get("set-cookie");if(!t)return;let r=(0,M.parseSetCookieHeader)(t),i=e.context.authCookies.sessionToken.name,o=r.get(i);if(!o||!o.value||0===o["max-age"])return;let n=o.value,a=new Set((e.context.responseHeaders?.get("access-control-expose-headers")||"").split(",").map(e=>e.trim()).filter(Boolean));a.add("set-auth-token"),e.setHeader("set-auth-token",n),e.setHeader("Access-Control-Expose-Headers",Array.from(a).join(", "))})}]},options:void 0},(e=>{let t={storeToken:"plain",...e};async function r(e,r){return"hashed"===t.storeToken?await ea(r):"object"==typeof t.storeToken&&"type"in t.storeToken&&"custom-hasher"===t.storeToken.type?await t.storeToken.hash(r):r}async function i(e,i){let o=t?.generateToken?await t.generateToken(i,e):(0,ei.generateRandomString)(32),n=new Date(Date.now()+(t?.expiresIn??3)*6e4),a=await r(e,o);return await e.context.internalAdapter.createVerificationValue({value:i.session.token,identifier:`one-time-token:${a}`,expiresAt:n}),o}return{id:"one-time-token",version:a.PACKAGE_VERSION,endpoints:{generateOneTimeToken:(0,I.createAuthEndpoint)("/one-time-token/generate",{method:"GET",use:[g.sessionMiddleware]},async e=>{if(t?.disableClientRequest&&e.request)throw e.error("BAD_REQUEST",{message:"Client requests are disabled"});let r=e.context.session,o=await i(e,r);return e.json({token:o})}),verifyOneTimeToken:(0,I.createAuthEndpoint)("/one-time-token/verify",{method:"POST",body:es},async e=>{let{token:i}=e.body,o=await r(e,i),n=await e.context.internalAdapter.consumeVerificationValue(`one-time-token:${o}`);if(!n)throw e.error("BAD_REQUEST",{message:"Invalid token"});let a=await e.context.internalAdapter.findSession(n.value);if(!a)throw e.error("BAD_REQUEST",{message:"Session not found"});if(t?.disableSetSessionCookie||await (0,m.setSessionCookie)(e,a),a.session.expiresAt<new Date)throw e.error("BAD_REQUEST",{message:"Session expired"});return e.json(a)})},hooks:{after:[{matcher:()=>!0,handler:(0,I.createAuthMiddleware)(async e=>{if(e.context.newSession){if(!t?.setOttHeaderOnNewSession)return;let r=new Set((e.context.responseHeaders?.get("access-control-expose-headers")||"").split(",").map(e=>e.trim()).filter(Boolean));r.add("set-ott");let o=await i(e,e.context.newSession);e.setHeader("set-ott",o),e.setHeader("Access-Control-Expose-Headers",Array.from(r).join(", "))}})}]},options:e}})({disableClientRequest:!0,expiresIn:1,storeToken:"hashed"}),...l?[l]:[],(0,o.nextCookies)()]})})(e))),eD}e.s(["getAuth",0,eP],576257);class eN extends Error{status;constructor(e,t=401){super(e),this.status=t,this.name="PrincipalResolutionError"}}function eL(e){return/(?:^|;\s*)(?:__Secure-)?better-auth\.session_token=/.test(e.get("cookie")??"")}async function eC(e,t){let r=e.get("x-api-key")?.trim()||null,i=function(e){let t=e.get("authorization");if(!t)return null;if(!t.startsWith("Bearer "))throw new eN("Authorization must use the Bearer scheme.");let r=t.slice(7).trim();if(!r)throw new eN("The bearer credential is empty.");return r}(e),o=eL(e);if(Number(!!r)+Number(!!i)+Number(o)>1)throw new eN("Provide exactly one application credential.",400);if(r){let e=await eP(),t=await e.api.verifyApiKey({body:{key:r}});if(!t.valid||!t.key)throw new eN("The API key is invalid or inactive.");return{kind:"apiKey",apiKeyId:t.key.id,userId:t.key.referenceId,name:t.key.name??null}}if(i?.startsWith("agent_")){if(!t)throw new eN("Agent credentials are not accepted by this endpoint.");let e=await t.authenticate(i);if(!e)throw new eN("The agent credential is invalid.");return{kind:"agent",agentId:e}}if(i||o){let t=await eP(),r=await t.api.getSession({headers:e});if(!r?.session||!r.user)throw new eN("The session is invalid or expired.");return{kind:"user",userId:r.user.id,email:r.user.email,sessionId:r.session.id}}return{kind:"anonymous"}}async function eq(e){let t=await eC(e);if("user"!==t.kind)throw new eN("A user session is required.");return t}e.s(["PrincipalResolutionError",0,eN,"principalErrorResponse",0,function(e){return Response.json({error:{code:"AUTHENTICATION_REQUIRED",message:e.message}},{status:e.status,headers:{"www-authenticate":"Bearer"}})},"requireUserPrincipal",0,eq,"resolveRequestPrincipal",0,eC,"usesAmbientCredential",0,function(e){return eL(e)&&!e.get("x-api-key")?.trim()&&!e.get("authorization")?.trim()}],354470)},406315,e=>{"use strict";var t=e.i(303361),r=e.i(169040),i=e.i(354470);function o(e){return!(0,i.usesAmbientCredential)(e.headers)||(0,t.isSameOriginRequest)(e,(0,r.getAuthRuntimeConfig)().trustProxyHeaders)?null:Response.json({error:{code:"CROSS_ORIGIN_REQUEST",message:"A session-authenticated request must come from this site. Use an API key for cross-origin access."}},{status:403})}async function n(e){let t=o(e);if(t)return t;try{return await (0,i.requireUserPrincipal)(e.headers),null}catch(e){if(e instanceof i.PrincipalResolutionError)return(0,i.principalErrorResponse)(e);throw e}}e.s(["crossOriginError",0,o,"requireUserRequest",0,n])},406478,e=>{"use strict";e.i(576257),e.i(169040),e.i(406315),e.i(354470),e.i(464661),e.s([])}];
469
+ `){if(!await r.user.findUnique({where:{id:e},select:{id:!0}}))throw new A.APIError("NOT_FOUND",{message:"User not found."});throw new A.APIError("BAD_REQUEST",{message:"The final account cannot be deleted."})}}async function eU({allowWhenRegistrationClosed:e=!1}={}){let t=await (0,ec.getPrismaClient)(),r=await eT();if(r.bootstrapCompleted){if(!r.registrationEnabled&&!e)throw new A.APIError("FORBIDDEN",{message:"Account registration is disabled."});return}if(await t.user.count()>0){if(await t.authSettings.update({where:{id:eR},data:{bootstrapCompleted:!0,registrationEnabled:!1,bootstrapClaimId:null,bootstrapClaimedAt:null}}),e)return;throw new A.APIError("FORBIDDEN",{message:"Account registration is disabled."})}let i=new Date(Date.now()-18e4),o=(0,e_.randomUUID)();if(1!==(await t.authSettings.updateMany({where:{id:eR,bootstrapCompleted:!1,OR:[{bootstrapClaimedAt:null},{bootstrapClaimedAt:{lt:i}}]},data:{bootstrapClaimId:o,bootstrapClaimedAt:new Date}})).count)throw new A.APIError("CONFLICT",{message:"The initial account is already being created. Try again shortly."})}async function eO(){let e=await (0,ec.getPrismaClient)();await e.authSettings.updateMany({where:{id:eR,bootstrapCompleted:!1},data:{bootstrapCompleted:!0,registrationEnabled:!1,bootstrapClaimId:null,bootstrapClaimedAt:null}})}let ex={user:{create:{before:async(e,t)=>(await eU({allowWhenRegistrationClosed:t?.path?.includes("/admin/create-user")??!1}),{data:{...e,role:"user",banned:!1,banReason:null,banExpires:null}}),after:async()=>{await eO()}},update:{before:async e=>({data:{...e,role:"user",banned:!1,banReason:null,banExpires:null}})},delete:{before:async()=>{throw new A.APIError("BAD_REQUEST",{message:"Accounts must be deleted through the management API."})}}}};e.s(["authDatabaseHooks",0,ex,"deleteManagedUser",0,ev,"getRegistrationStatus",0,eS,"setRegistrationEnabled",0,ek],464661);let eD={user:["create","list","set-password","set-email","get","update"],session:["list","revoke","delete"]},eP=(0,s.createAccessControl)(eD),eN=eP.newRole(eD),eL=null;function eC(){return eL||(eL=(0,ec.getPrismaClient)().then(e=>(function(e,s=ef()){let l=s.provider,d=l?.providerId.toLowerCase()==="github"?l.userInfoUrl:void 0,p=em(s.mode)&&l?(e=>{let t=new Set,r=new Set;for(let i of e.config){let e=i.providerId;t.has(e)&&r.add(e),t.add(e)}return r.size>0&&console.warn(`Duplicate provider IDs found: ${Array.from(r).join(", ")}`),{id:"generic-oauth",version:a.PACKAGE_VERSION,init:async t=>{let r=[];for(let i of e.config){let e,o,n=i.authorizationUrl,a=i.tokenUrl,s=i.userInfoUrl,l=i.endSessionEndpoint,c=!1;if(i.discoveryUrl){let r=await et(i.discoveryUrl,i.discoveryHeaders).catch(e=>(t.logger.error(`Discovery fetch failed for "${i.providerId}": ${e}`),null));if(r){if(!r.issuer&&!i.accountIssuer)throw Error(`Provider "${i.providerId}": discovery did not return an issuer. Configure accountIssuer explicitly to establish a stable account namespace.`);n??=r.authorization_endpoint,a??=r.token_endpoint,s??=r.userinfo_endpoint,l??=r.end_session_endpoint,e=r.issuer;let t=r.id_token_signing_alg_values_supported;if(c=Array.isArray(t)&&t.length>0,r.jwks_uri&&r.issuer){let e;try{e=new URL(r.jwks_uri,i.discoveryUrl)}catch{throw Error(`Provider "${i.providerId}": invalid jwks_uri "${r.jwks_uri}" in discovery document.`)}o={jwks:(0,ee.createRemoteJWKSet)(e),issuer:r.issuer,audience:i.clientId,algorithms:c?t:void 0}}}else if(i.accountIssuer)n&&a||t.logger.error(`Provider "${i.providerId}": discovery returned no data and no explicit endpoints configured. OAuth sign-in will fail for this provider.`);else throw Error(`Provider "${i.providerId}": discovery returned no valid data. Provider initialization stopped to keep its account issuer stable.`)}if(i.requireIdTokenVerification&&!o)throw Error(`Provider "${i.providerId}": requires verified ID tokens, but discovery did not provide a usable issuer and jwks_uri.`);let d=i.tokenEndpointAuth;if(i.clientSecret&&(d?.method==="private_key_jwt"||d?.method==="none"))throw Error(`Provider "${i.providerId}": tokenEndpointAuth.method "${d?.method}" cannot be combined with clientSecret`);if(!i.clientSecret&&(d?.method==="client_secret_basic"||d?.method==="client_secret_post"))throw Error(`Provider "${i.providerId}": tokenEndpointAuth.method "${d?.method}" requires clientSecret`);if(!i.clientSecret&&!d&&"basic"===i.authentication)throw Error(`Provider "${i.providerId}": authentication "basic" requires clientSecret`);let u=i.accountSubject,p=i.accountIssuer,f={id:i.providerId,name:i.name??i.providerId,issuer:e,accountSubject:({tokens:e,profile:t})=>u?u({tokens:e,profile:t}):c?t.sub??"":t.id??"",accountIssuer:"function"==typeof p?({tokens:e,profile:t})=>p({tokens:e,profile:t}):p??e,idToken:o,requiresIdTokenNonce:void 0!==o&&!0!==i.disableIdTokenNonceBinding,allowIdpInitiated:i.allowIdpInitiated,async createEndSessionURL(e){let r;if(i.disableProviderLogout||!l)return null;try{r=new URL(l)}catch{return null}e.idToken&&r.searchParams.set("id_token_hint",e.idToken);let o=e.postLogoutRedirectURI??i.postLogoutRedirectURI,n=o?new URL(o,t.baseURL).toString():void 0;return n?(r.searchParams.set("post_logout_redirect_uri",n),r.searchParams.set("client_id",i.clientId),e.state&&r.searchParams.set("state",e.state)):e.idToken||r.searchParams.set("client_id",i.clientId),r},createAuthorizationURL(e){if(!n)throw A.APIError.from("BAD_REQUEST",z.INVALID_OAUTH_CONFIGURATION);return(0,Q.createAuthorizationURL)({id:i.providerId,options:{clientId:i.clientId,clientSecret:i.clientSecret,redirectURI:i.redirectURI},authorizationEndpoint:n,state:e.state,codeVerifier:i.pkce??!0?e.codeVerifier:void 0,scopes:(()=>{let t=[...e.scopes??[],...i.scopes??[]];return c&&!t.includes("openid")&&t.unshift("openid"),t})(),redirectURI:e.redirectURI,prompt:i.prompt,accessType:i.accessType,responseType:i.responseType,responseMode:i.responseMode,nonce:e.idTokenNonce,additionalParams:{...i.authorizationUrlParams??{},...e.additionalParams??{}},loginHint:e.loginHint})},async validateAuthorizationCode(e){if(i.getToken)return(0,G.applyDefaultAccessTokenExpiry)(await i.getToken(e),i.accessTokenExpiresIn);if(!a)throw A.APIError.from("BAD_REQUEST",z.TOKEN_URL_NOT_FOUND);return(0,G.applyDefaultAccessTokenExpiry)(await (0,Z.validateAuthorizationCode)({headers:i.authorizationHeaders,code:e.code,codeVerifier:i.pkce??!0?e.codeVerifier:void 0,redirectURI:e.redirectURI,options:{clientId:i.clientId,clientSecret:i.clientSecret,redirectURI:i.redirectURI},tokenEndpoint:a,authentication:i.authentication,tokenEndpointAuth:d,additionalParams:i.tokenUrlParams}),i.accessTokenExpiresIn)},async getUserInfo(e){let{expectedIdTokenNonce:r,...o}=e;if(o.idToken&&f.idToken&&!await (0,X.verifyProviderIdToken)(f,o.idToken,r))return t.logger.error(`Provider "${i.providerId}": id_token failed verification against the discovery JWKS or expected nonce`),null;let n=i.getUserInfo?await i.getUserInfo(o):await er(o,s);if(!n)return null;let a=i.mapProfileToUser?await i.mapProfileToUser(n):{},l={email:n.email,emailVerified:n.emailVerified,image:n.image,name:n.name,...a};return{user:{...l,image:l.image??void 0},data:n}},async refreshAccessToken(e,t){if(!a)throw A.APIError.from("BAD_REQUEST",z.TOKEN_URL_NOT_FOUND);let r="function"==typeof i.refreshTokenParams?await i.refreshTokenParams(t):i.refreshTokenParams;return(0,G.applyDefaultAccessTokenExpiry)(await (0,J.refreshAccessToken)({refreshToken:e,options:{clientId:i.clientId,clientSecret:i.clientSecret},authentication:i.authentication,tokenEndpointAuth:d,tokenEndpoint:a,extraParams:r}),i.accessTokenExpiresIn)},disableImplicitSignUp:i.disableImplicitSignUp,disableSignUp:i.disableSignUp,options:{disableSignUp:i.disableSignUp,overrideUserInfoOnSignIn:i.overrideUserInfo,requireEmailVerification:i.requireEmailVerification}};r.push(f)}let i=new Set(t.socialProviders.map(e=>e.id));for(let e of r)i.has(e.id)&&t.logger.warn(`Generic OAuth provider "${e.id}" shadows a built-in social provider with the same ID`);return{context:{socialProviders:r.concat(t.socialProviders)}}},options:e,$ERROR_CODES:z}})({config:[{providerId:l.providerId,clientId:l.clientId,clientSecret:l.clientSecret,scopes:l.scopes,discoveryUrl:l.discoveryUrl,accountIssuer:`local:oauth:${l.providerId}`,authorizationUrl:l.authorizationUrl,tokenUrl:l.tokenUrl,userInfoUrl:l.userInfoUrl,getUserInfo:d?async e=>e.accessToken?eI(d,e.accessToken):null:void 0,pkce:!0,requireIdTokenVerification:l.requireIssuerValidation,disableImplicitSignUp:!1}]}):null;return(0,i.betterAuth)({appName:"AI Development Environment",baseURL:(0,el.betterAuthBaseURL)(s.origins),trustedOrigins:e=>{if(!e)return[];let t=(0,el.originFromRequest)(e,s.trustProxyHeaders);return t&&(0,el.isTrustedOrigin)(s.origins,t)?[t]:[]},secret:s.secret,logger:{log:eA},advanced:{trustedProxyHeaders:s.trustProxyHeaders},database:(0,r.prismaAdapter)(e,{provider:"sqlite"}),emailAndPassword:{enabled:eh(s.mode),requireEmailVerification:!1},account:{accountLinking:{enabled:!0,disableImplicitLinking:!0,allowDifferentEmails:!1}},databaseHooks:ex,plugins:[function(){let e=(e=>{let t={...e||{},defaultRole:e?.defaultRole??"user",adminRoles:e?.adminRoles??["admin"],bannedUserMessage:e?.bannedUserMessage??"You have been banned from this application. Please contact support if you believe this is an error."};if(e?.adminRoles){let t=(Array.isArray(e.adminRoles)?e.adminRoles:[...e.adminRoles.split(",")]).filter(t=>!Object.keys(e?.roles||c).map(e=>e.toLowerCase()).includes(t.toLowerCase()));if(t.length>0)throw new A.BetterAuthError(`Invalid admin roles: ${t.join(", ")}. Admin roles must be defined in the 'roles' configuration.`)}return{id:"admin",version:a.PACKAGE_VERSION,init:()=>({options:{databaseHooks:{user:{create:{before:async t=>({data:{role:e?.defaultRole??"user",...t}})}},session:{create:{async before(e,r){if(!r)return;let i=await r.context.internalAdapter.findUserById(e.userId);if(i?.banned){if(i.banExpires&&new Date(i.banExpires).getTime()<Date.now())return void await r.context.internalAdapter.updateUser(e.userId,{banned:!1,banReason:null,banExpires:null});throw A.APIError.from("FORBIDDEN",{message:t.bannedUserMessage,code:"BANNED_USER"})}}}}}}}),hooks:{after:[{matcher:e=>"/list-sessions"===e.path,handler:(0,I.createAuthMiddleware)(async e=>{let t=await f(e);if(!t)return;let r=t.filter(e=>!e.impersonatedBy);return e.json(r)})}]},endpoints:{setRole:(0,I.createAuthEndpoint)("/admin/set-role",{method:"POST",body:k,requireHeaders:!0,use:[T],metadata:{openapi:{operationId:"setUserRole",summary:"Set the role of a user",description:"Set the role of a user",responses:{200:{description:"User role updated",content:{"application/json":{schema:{type:"object",properties:{user:{$ref:"#/components/schemas/User"}}}}}}}},$Infer:{body:{}}}},async e=>{if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["set-role"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE);let r=t.roles;if(r){for(let t of Array.isArray(e.body.role)?e.body.role:[e.body.role])if(!r[t])throw A.APIError.from("BAD_REQUEST",u.YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE)}if(!await e.context.internalAdapter.findUserById(e.body.userId))throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);let i=await e.context.internalAdapter.updateUser(e.body.userId,{role:S(e.body.role)});return e.json({user:(0,n.parseUserOutput)(e.context.options,i)})}),getUser:(0,I.createAuthEndpoint)("/admin/get-user",{method:"GET",query:v,use:[T],metadata:{openapi:{operationId:"getUser",summary:"Get an existing user",description:"Get an existing user",responses:{200:{description:"User",content:{"application/json":{schema:{type:"object",properties:{user:{$ref:"#/components/schemas/User"}}}}}}}}}},async e=>{let{id:r}=e.query;if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["get"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_GET_USER);let i=await e.context.internalAdapter.findUserById(r);if(!i)throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);return(0,n.parseUserOutput)(e.context.options,i)}),createUser:(0,I.createAuthEndpoint)("/admin/create-user",{method:"POST",body:U,metadata:{openapi:{operationId:"createUser",summary:"Create a new user",description:"Create a new user",responses:{200:{description:"User created",content:{"application/json":{schema:{type:"object",properties:{user:{$ref:"#/components/schemas/User"}}}}}}}},$Infer:{body:{}}}},async e=>{let r=await (0,g.getAuthoritativeSessionFromCtx)(e);if(!r&&(e.request||e.headers))throw e.error("UNAUTHORIZED");if(r&&!w({userId:r.user.id,role:r.user.role,options:t,permissions:{user:["create"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS);let{role:i,...o}=e.body.data??{},a=e.body.role??i;if(void 0!==a){if(r&&!w({userId:r.user.id,role:r.user.role,options:t,permissions:{user:["set-role"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE);for(let e of Array.isArray(a)?a:[a]){if("string"!=typeof e)throw A.APIError.from("BAD_REQUEST",u.INVALID_ROLE_TYPE);if(t.roles&&!t.roles[e])throw A.APIError.from("BAD_REQUEST",u.YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE)}}if(r&&["banned","banReason","banExpires"].some(e=>Object.prototype.hasOwnProperty.call(o,e))&&!w({userId:r.user.id,role:r.user.role,options:t,permissions:{user:["ban"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_BAN_USERS);let s=e.body.email.toLowerCase();if(!_.email().safeParse(s).success)throw A.APIError.from("BAD_REQUEST",E.BASE_ERROR_CODES.INVALID_EMAIL);if(await e.context.internalAdapter.findUserByEmail(s))throw A.APIError.from("BAD_REQUEST",u.USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL);let l=await e.context.internalAdapter.createUser({...o,email:s,name:e.body.name,role:void 0!==a?S(a):t?.defaultRole??"user"},{method:"admin"});if(!l)throw A.APIError.from("INTERNAL_SERVER_ERROR",u.FAILED_TO_CREATE_USER);if(e.body.password){let t=await e.context.password.hash(e.body.password);await e.context.internalAdapter.linkAccount({providerId:"credential",issuer:(0,y.createLocalAccountIssuer)("credential"),accountId:l.id,password:t,userId:l.id})}return e.json({user:(0,n.parseUserOutput)(e.context.options,l)})}),adminUpdateUser:(0,I.createAuthEndpoint)("/admin/update-user",{method:"POST",body:O,use:[T],metadata:{openapi:{operationId:"adminUpdateUser",summary:"Update a user",description:"Update a user's details",responses:{200:{description:"User updated",content:{"application/json":{schema:{type:"object",properties:{user:{$ref:"#/components/schemas/User"}}}}}}}}}},async e=>{if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["update"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS);if(0===Object.keys(e.body.data).length)throw A.APIError.from("BAD_REQUEST",u.NO_DATA_TO_UPDATE);let r=e.body.data,i=e=>Object.prototype.hasOwnProperty.call(r,e);if(i("password"))throw A.APIError.from("BAD_REQUEST",u.PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER);if(Object.prototype.hasOwnProperty.call(e.body.data,"role")){if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["set-role"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE);let r=e.body.data.role,i=Array.isArray(r)?r:[r];for(let e of i){if("string"!=typeof e)throw A.APIError.from("BAD_REQUEST",u.INVALID_ROLE_TYPE);if(t.roles&&!t.roles[e])throw A.APIError.from("BAD_REQUEST",u.YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE)}e.body.data.role=S(i)}if(["banned","banReason","banExpires"].some(i)){if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["ban"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_BAN_USERS);if(!0===r.banned&&e.body.userId===e.context.session.user.id)throw A.APIError.from("BAD_REQUEST",u.YOU_CANNOT_BAN_YOURSELF)}if(i("email")||i("emailVerified")){if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["set-email"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL);if(i("email")){let t=String(r.email).toLowerCase();if(!_.email().safeParse(t).success)throw A.APIError.from("BAD_REQUEST",E.BASE_ERROR_CODES.INVALID_EMAIL);let i=await e.context.internalAdapter.findUserByEmail(t);if(i&&i.user.id!==e.body.userId)throw A.APIError.from("BAD_REQUEST",u.USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL);r.email=t}}if(!await e.context.internalAdapter.findUserById(e.body.userId))throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);let o=await e.context.internalAdapter.updateUser(e.body.userId,e.body.data);return!0===r.banned&&await e.context.internalAdapter.deleteUserSessions(e.body.userId),e.json((0,n.parseUserOutput)(e.context.options,o))}),listUsers:(0,I.createAuthEndpoint)("/admin/list-users",{method:"GET",use:[T],query:x,metadata:{openapi:{operationId:"listUsers",summary:"List users",description:"List users",responses:{200:{description:"List of users",content:{"application/json":{schema:{type:"object",properties:{users:{type:"array",items:{$ref:"#/components/schemas/User"}},total:{type:"number"},limit:{type:"number"},offset:{type:"number"}},required:["users","total"]}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{user:["list"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_LIST_USERS);let i=[];e.query?.searchValue&&i.push({field:e.query.searchField||"email",operator:e.query.searchOperator||"contains",value:e.query.searchValue}),e.query?.filterValue!==void 0&&i.push({field:e.query.filterField||"email",operator:e.query.filterOperator||"eq",value:e.query.filterValue});try{let t=await e.context.internalAdapter.listUsers(Number(e.query?.limit)||void 0,Number(e.query?.offset)||void 0,e.query?.sortBy?{field:e.query.sortBy,direction:e.query.sortDirection||"asc"}:void 0,i.length?i:void 0),r=await e.context.internalAdapter.countTotalUsers(i.length?i:void 0);return e.json({users:t.map(t=>(0,n.parseUserOutput)(e.context.options,t)),total:r,limit:Number(e.query?.limit)||void 0,offset:Number(e.query?.offset)||void 0})}catch{return e.json({users:[],total:0})}}),listUserSessions:(0,I.createAuthEndpoint)("/admin/list-user-sessions",{method:"POST",use:[T],body:D,metadata:{openapi:{operationId:"adminListUserSessions",summary:"List user sessions",description:"List user sessions",responses:{200:{description:"List of user sessions",content:{"application/json":{schema:{type:"object",properties:{sessions:{type:"array",items:{$ref:"#/components/schemas/Session"}}}}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{session:["list"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS);let i=await e.context.internalAdapter.listSessions(e.body.userId);return e.json({sessions:i.map(t=>(0,n.parseSessionOutput)(e.context.options,t))})}),unbanUser:(0,I.createAuthEndpoint)("/admin/unban-user",{method:"POST",body:P,use:[T],metadata:{openapi:{operationId:"unbanUser",summary:"Unban a user",description:"Unban a user",responses:{200:{description:"User unbanned",content:{"application/json":{schema:{type:"object",properties:{user:{$ref:"#/components/schemas/User"}}}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{user:["ban"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_BAN_USERS);if(!await e.context.internalAdapter.findUserById(e.body.userId))throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);let i=await e.context.internalAdapter.updateUser(e.body.userId,{banned:!1,banExpires:null,banReason:null,updatedAt:new Date});return e.json({user:(0,n.parseUserOutput)(e.context.options,i)})}),banUser:(0,I.createAuthEndpoint)("/admin/ban-user",{method:"POST",body:N,use:[T],metadata:{openapi:{operationId:"banUser",summary:"Ban a user",description:"Ban a user",responses:{200:{description:"User banned",content:{"application/json":{schema:{type:"object",properties:{user:{$ref:"#/components/schemas/User"}}}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{user:["ban"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_BAN_USERS);if(!await e.context.internalAdapter.findUserById(e.body.userId))throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);if(e.body.userId===e.context.session.user.id)throw A.APIError.from("BAD_REQUEST",u.YOU_CANNOT_BAN_YOURSELF);let i=await e.context.internalAdapter.updateUser(e.body.userId,{banned:!0,banReason:e.body.banReason||t?.defaultBanReason||"No reason",banExpires:e.body.banExpiresIn?(0,h.getDate)(e.body.banExpiresIn,"sec"):t?.defaultBanExpiresIn?(0,h.getDate)(t.defaultBanExpiresIn,"sec"):null,updatedAt:new Date});return await e.context.internalAdapter.deleteUserSessions(e.body.userId),e.json({user:(0,n.parseUserOutput)(e.context.options,i)})}),impersonateUser:(0,I.createAuthEndpoint)("/admin/impersonate-user",{method:"POST",body:L,use:[T],metadata:{openapi:{operationId:"impersonateUser",summary:"Impersonate a user",description:"Impersonate a user",responses:{200:{description:"Impersonation session created",content:{"application/json":{schema:{type:"object",properties:{session:{$ref:"#/components/schemas/Session"},user:{$ref:"#/components/schemas/User"}}}}}}}}}},async e=>{if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["impersonate"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS);let r=await e.context.internalAdapter.findUserById(e.body.userId);if(!r)throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);let i=(Array.isArray(t.adminRoles)?t.adminRoles:t.adminRoles?.split(",")||[]).map(e=>e.trim());if(((r.role||t.defaultRole||"user").split(",").some(e=>i.includes(e))||t.adminUserIds?.includes(r.id))&&!(!0===t.allowImpersonatingAdmins||w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["impersonate-admins"]}})))throw A.APIError.from("FORBIDDEN",u.YOU_CANNOT_IMPERSONATE_ADMINS);let o=await e.context.internalAdapter.createSession(r.id,!0,{impersonatedBy:e.context.session.user.id,expiresAt:t?.impersonationSessionDuration?(0,h.getDate)(t.impersonationSessionDuration,"sec"):(0,h.getDate)(3600,"sec")},!0);if(!o)throw A.APIError.from("INTERNAL_SERVER_ERROR",u.FAILED_TO_CREATE_USER);let a=e.context.authCookies;(0,m.deleteSessionCookie)(e);let s=await e.getSignedCookie(e.context.authCookies.dontRememberToken.name,e.context.secret),l=e.context.createAuthCookie("admin_session");return await e.setSignedCookie(l.name,`${e.context.session.session.token}:${s||""}`,e.context.secret,a.sessionToken.attributes),await (0,m.setSessionCookie)(e,{session:o,user:r},!0),e.json({session:o,user:(0,n.parseUserOutput)(e.context.options,r)})}),stopImpersonating:(0,I.createAuthEndpoint)("/admin/stop-impersonating",{method:"POST",requireHeaders:!0},async e=>{let t=await (0,g.getSessionFromCtx)(e);if(!t)throw A.APIError.fromStatus("UNAUTHORIZED");if(!t.session.impersonatedBy)throw A.APIError.fromStatus("BAD_REQUEST",{message:"You are not impersonating anyone"});let r=await e.context.internalAdapter.findUserById(t.session.impersonatedBy);if(!r)throw A.APIError.fromStatus("INTERNAL_SERVER_ERROR",{message:"Failed to find user"});let i=e.context.createAuthCookie("admin_session"),o=await e.getSignedCookie(i.name,e.context.secret);if(!o)throw A.APIError.fromStatus("INTERNAL_SERVER_ERROR",{message:"Failed to find admin session"});let[a,s]=o?.split(":"),l=await e.context.internalAdapter.findSession(a);if(!l||l.session.userId!==r.id)throw A.APIError.fromStatus("INTERNAL_SERVER_ERROR",{message:"Failed to find admin session"});return await e.context.internalAdapter.deleteSession(t.session.token),await (0,m.setSessionCookie)(e,l,!!s),(0,m.expireCookie)(e,i),e.json({session:(0,n.parseSessionOutput)(e.context.options,l.session),user:(0,n.parseUserOutput)(e.context.options,l.user)})}),revokeUserSession:(0,I.createAuthEndpoint)("/admin/revoke-user-session",{method:"POST",body:C,use:[T],metadata:{openapi:{operationId:"revokeUserSession",summary:"Revoke a user session",description:"Revoke a user session",responses:{200:{description:"Session revoked",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean"}}}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{session:["revoke"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS);return await e.context.internalAdapter.deleteSession(e.body.sessionToken),e.json({success:!0})}),revokeUserSessions:(0,I.createAuthEndpoint)("/admin/revoke-user-sessions",{method:"POST",body:q,use:[T],metadata:{openapi:{operationId:"revokeUserSessions",summary:"Revoke all user sessions",description:"Revoke all user sessions",responses:{200:{description:"Sessions revoked",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean"}}}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{session:["revoke"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS);return await e.context.internalAdapter.deleteUserSessions(e.body.userId),e.json({success:!0})}),removeUser:(0,I.createAuthEndpoint)("/admin/remove-user",{method:"POST",body:B,use:[T],metadata:{openapi:{operationId:"removeUser",summary:"Remove a user",description:"Delete a user and all their sessions and accounts. Cannot be undone.",responses:{200:{description:"User removed",content:{"application/json":{schema:{type:"object",properties:{success:{type:"boolean"}}}}}}}}}},async e=>{let r=e.context.session;if(!w({userId:e.context.session.user.id,role:r.user.role,options:t,permissions:{user:["delete"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS);if(e.body.userId===e.context.session.user.id)throw A.APIError.from("BAD_REQUEST",u.YOU_CANNOT_REMOVE_YOURSELF);if(!await e.context.internalAdapter.findUserById(e.body.userId))throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);return await e.context.internalAdapter.deleteUserSessions(e.body.userId),await e.context.internalAdapter.deleteUser(e.body.userId),e.json({success:!0})}),setUserPassword:(0,I.createAuthEndpoint)("/admin/set-user-password",{method:"POST",body:j,use:[T],metadata:{openapi:{operationId:"setUserPassword",summary:"Set a user's password",description:"Set a user's password",responses:{200:{description:"Password set",content:{"application/json":{schema:{type:"object",properties:{status:{type:"boolean"}}}}}}}}}},async e=>{if(!w({userId:e.context.session.user.id,role:e.context.session.user.role,options:t,permissions:{user:["set-password"]}}))throw A.APIError.from("FORBIDDEN",u.YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD);let{newPassword:r,userId:i}=e.body,o=e.context.password.config.minPasswordLength;if(r.length<o)throw e.context.logger.warn("Password is too short"),A.APIError.from("BAD_REQUEST",E.BASE_ERROR_CODES.PASSWORD_TOO_SHORT);let n=e.context.password.config.maxPasswordLength;if(r.length>n)throw e.context.logger.warn("Password is too long"),A.APIError.from("BAD_REQUEST",E.BASE_ERROR_CODES.PASSWORD_TOO_LONG);let a=await e.context.internalAdapter.findUserById(i);if(!a)throw A.APIError.from("NOT_FOUND",E.BASE_ERROR_CODES.USER_NOT_FOUND);let s=await e.context.password.hash(r);return await e.context.internalAdapter.findCredentialAccount(i)?await e.context.internalAdapter.updatePassword(i,s):await e.context.internalAdapter.createAccount({userId:i,providerId:"credential",issuer:(0,y.createLocalAccountIssuer)("credential"),accountId:a.id,password:s}),e.json({status:!0})}),userHasPermission:(0,I.createAuthEndpoint)("/admin/has-permission",{method:"POST",body:$,metadata:{openapi:{description:"Check if the user has permission",requestBody:{content:{"application/json":{schema:{type:"object",properties:{permissions:{type:"object",description:"The permission to check"}},required:["permissions"]}}}},responses:{200:{description:"Success",content:{"application/json":{schema:{type:"object",properties:{error:{type:"string"},success:{type:"boolean"}},required:["success"]}}}}}},$Infer:{body:{}}}},async e=>{if(!e.body?.permissions)throw new A.APIError("BAD_REQUEST",{message:"invalid permission check. no permission(s) were passed."});let r=await (0,g.getAuthoritativeSessionFromCtx)(e);if(!r&&(e.request||e.headers))throw new A.APIError("UNAUTHORIZED");if(!r&&!e.body.userId&&!e.body.role)throw new A.APIError("BAD_REQUEST",{message:"user id or role is required"});let i=r?.user||(e.body.role?{id:e.body.userId||"",role:e.body.role}:null)||(e.body.userId?await e.context.internalAdapter.findUserById(e.body.userId):null);if(!i)throw new A.APIError("BAD_REQUEST",{message:"user not found"});let o=w({userId:i.id,role:i.role,options:t,permissions:e.body.permissions});return e.json({error:null,success:o})})},$ERROR_CODES:u,schema:(0,n.mergeSchema)(V,t.schema),options:e}})({ac:eP,roles:{user:eN},defaultRole:"user",adminRoles:["user"]}),{setRole:t,banUser:r,unbanUser:i,impersonateUser:o,stopImpersonating:s,removeUser:l,...d}=e.endpoints;return{...e,endpoints:d}}(),(0,t.apiKey)({schema:{apikey:{modelName:"ApiKey"}},defaultPrefix:"aide_",requireName:!0,startingCharactersConfig:{shouldStore:!0,charactersLength:12},keyExpiration:{defaultExpiresIn:null,disableCustomExpiresTime:!1,minExpiresIn:1,maxExpiresIn:3650},rateLimit:{enabled:!1},enableSessionForAPIKeys:!1}),{id:"bearer",version:a.PACKAGE_VERSION,hooks:{before:[{matcher:e=>!!(e.request?.headers.get("authorization")||e.headers?.get("authorization")),handler:(0,I.createAuthMiddleware)(async e=>{let t,r=e.request?.headers.get("authorization")||e.headers?.get("Authorization");if(!r||"bearer "!==r.slice(0,7).toLowerCase())return;let i=r.slice(7).trim();if(!i)return;t=i.includes(".")?i.includes("%")?K(i):i:K((await (0,F.serializeSignedCookie)("",i,e.context.secret)).replace("=",""));try{if(!await (0,H.createHMAC)("SHA-256","base64urlnopad").verify(e.context.secret,t.split(".")[0],t.split(".")[1]))return}catch{return}let o=e.request?.headers||e.headers,n=new Headers({...Object.fromEntries(o?.entries())});return(0,M.setRequestCookie)(n,e.context.authCookies.sessionToken.name,t),{context:{headers:n}}})}],after:[{matcher:e=>!0,handler:(0,I.createAuthMiddleware)(async e=>{let t=e.context.responseHeaders?.get("set-cookie");if(!t)return;let r=(0,M.parseSetCookieHeader)(t),i=e.context.authCookies.sessionToken.name,o=r.get(i);if(!o||!o.value||0===o["max-age"])return;let n=o.value,a=new Set((e.context.responseHeaders?.get("access-control-expose-headers")||"").split(",").map(e=>e.trim()).filter(Boolean));a.add("set-auth-token"),e.setHeader("set-auth-token",n),e.setHeader("Access-Control-Expose-Headers",Array.from(a).join(", "))})}]},options:void 0},(e=>{let t={storeToken:"plain",...e};async function r(e,r){return"hashed"===t.storeToken?await ea(r):"object"==typeof t.storeToken&&"type"in t.storeToken&&"custom-hasher"===t.storeToken.type?await t.storeToken.hash(r):r}async function i(e,i){let o=t?.generateToken?await t.generateToken(i,e):(0,ei.generateRandomString)(32),n=new Date(Date.now()+(t?.expiresIn??3)*6e4),a=await r(e,o);return await e.context.internalAdapter.createVerificationValue({value:i.session.token,identifier:`one-time-token:${a}`,expiresAt:n}),o}return{id:"one-time-token",version:a.PACKAGE_VERSION,endpoints:{generateOneTimeToken:(0,I.createAuthEndpoint)("/one-time-token/generate",{method:"GET",use:[g.sessionMiddleware]},async e=>{if(t?.disableClientRequest&&e.request)throw e.error("BAD_REQUEST",{message:"Client requests are disabled"});let r=e.context.session,o=await i(e,r);return e.json({token:o})}),verifyOneTimeToken:(0,I.createAuthEndpoint)("/one-time-token/verify",{method:"POST",body:es},async e=>{let{token:i}=e.body,o=await r(e,i),n=await e.context.internalAdapter.consumeVerificationValue(`one-time-token:${o}`);if(!n)throw e.error("BAD_REQUEST",{message:"Invalid token"});let a=await e.context.internalAdapter.findSession(n.value);if(!a)throw e.error("BAD_REQUEST",{message:"Session not found"});if(t?.disableSetSessionCookie||await (0,m.setSessionCookie)(e,a),a.session.expiresAt<new Date)throw e.error("BAD_REQUEST",{message:"Session expired"});return e.json(a)})},hooks:{after:[{matcher:()=>!0,handler:(0,I.createAuthMiddleware)(async e=>{if(e.context.newSession){if(!t?.setOttHeaderOnNewSession)return;let r=new Set((e.context.responseHeaders?.get("access-control-expose-headers")||"").split(",").map(e=>e.trim()).filter(Boolean));r.add("set-ott");let o=await i(e,e.context.newSession);e.setHeader("set-ott",o),e.setHeader("Access-Control-Expose-Headers",Array.from(r).join(", "))}})}]},options:e}})({disableClientRequest:!0,expiresIn:1,storeToken:"hashed"}),...p?[p]:[],(0,o.nextCookies)()]})})(e))),eL}e.s(["getAuth",0,eC],576257);class eq extends Error{status;constructor(e,t=401){super(e),this.status=t,this.name="PrincipalResolutionError"}}function eB(e){return/(?:^|;\s*)(?:__Secure-)?better-auth\.session_token=/.test(e.get("cookie")??"")}async function ej(e,t){let r=e.get("x-api-key")?.trim()||null,i=function(e){let t=e.get("authorization");if(!t)return null;if(!t.startsWith("Bearer "))throw new eq("Authorization must use the Bearer scheme.");let r=t.slice(7).trim();if(!r)throw new eq("The bearer credential is empty.");return r}(e),o=eB(e);if(Number(!!r)+Number(!!i)+Number(o)>1)throw new eq("Provide exactly one application credential.",400);if(r){let e=await eC(),t=await e.api.verifyApiKey({body:{key:r}});if(!t.valid||!t.key)throw new eq("The API key is invalid or inactive.");return{kind:"apiKey",apiKeyId:t.key.id,userId:t.key.referenceId,name:t.key.name??null}}if(i?.startsWith("agent_")){if(!t)throw new eq("Agent credentials are not accepted by this endpoint.");let e=await t.authenticate(i);if(!e)throw new eq("The agent credential is invalid.");return{kind:"agent",agentId:e}}if(i||o){let t=await eC(),r=await t.api.getSession({headers:e});if(!r?.session||!r.user)throw new eq("The session is invalid or expired.");return{kind:"user",userId:r.user.id,email:r.user.email,sessionId:r.session.id}}return{kind:"anonymous"}}async function e$(e){let t=await ej(e);if("user"!==t.kind)throw new eq("A user session is required.");return t}e.s(["PrincipalResolutionError",0,eq,"principalErrorResponse",0,function(e){return Response.json({error:{code:"AUTHENTICATION_REQUIRED",message:e.message}},{status:e.status,headers:{"www-authenticate":"Bearer"}})},"requireUserPrincipal",0,e$,"resolveRequestPrincipal",0,ej,"usesAmbientCredential",0,function(e){return eB(e)&&!e.get("x-api-key")?.trim()&&!e.get("authorization")?.trim()}],354470)},406315,e=>{"use strict";var t=e.i(303361),r=e.i(169040),i=e.i(354470);function o(e){return!(0,i.usesAmbientCredential)(e.headers)||(0,t.isSameOriginRequest)(e,(0,r.getAuthRuntimeConfig)().trustProxyHeaders)?null:Response.json({error:{code:"CROSS_ORIGIN_REQUEST",message:"A session-authenticated request must come from this site. Use an API key for cross-origin access."}},{status:403})}async function n(e){let t=o(e);if(t)return t;try{return await (0,i.requireUserPrincipal)(e.headers),null}catch(e){if(e instanceof i.PrincipalResolutionError)return(0,i.principalErrorResponse)(e);throw e}}e.s(["crossOriginError",0,o,"requireUserRequest",0,n])},406478,e=>{"use strict";e.i(576257),e.i(169040),e.i(406315),e.i(354470),e.i(464661),e.s([])}];
470
470
 
471
471
  //# sourceMappingURL=_07hehic._.js.map