@kosha-ai/admin 0.0.1 → 0.0.3

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 (247) hide show
  1. package/.next/standalone/node_modules/.pnpm/{@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64 → @img+sharp-libvips-linux-x64@1.2.4/node_modules/@img/sharp-libvips-linux-x64}/README.md +2 -2
  2. package/.next/standalone/node_modules/.pnpm/{@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64 → @img+sharp-libvips-linux-x64@1.2.4/node_modules/@img/sharp-libvips-linux-x64}/lib/glib-2.0/include/glibconfig.h +9 -8
  3. package/.next/standalone/node_modules/.pnpm/{@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib → @img+sharp-libvips-linux-x64@1.2.4/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3} +0 -0
  4. package/.next/standalone/node_modules/.pnpm/{@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64 → @img+sharp-libvips-linux-x64@1.2.4/node_modules/@img/sharp-libvips-linux-x64}/package.json +11 -5
  5. package/.next/standalone/node_modules/.pnpm/@img+sharp-libvips-linuxmusl-x64@1.2.4/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +46 -0
  6. package/.next/standalone/node_modules/.pnpm/@img+sharp-libvips-linuxmusl-x64@1.2.4/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +221 -0
  7. package/.next/standalone/node_modules/.pnpm/@img+sharp-libvips-linuxmusl-x64@1.2.4/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +1 -0
  8. package/.next/standalone/node_modules/.pnpm/@img+sharp-libvips-linuxmusl-x64@1.2.4/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  9. package/.next/standalone/node_modules/.pnpm/@img+sharp-libvips-linuxmusl-x64@1.2.4/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +42 -0
  10. package/.next/standalone/node_modules/.pnpm/@img+sharp-libvips-linuxmusl-x64@1.2.4/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
  11. package/.next/standalone/node_modules/.pnpm/@img+sharp-linux-x64@0.34.5/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  12. package/.next/standalone/node_modules/.pnpm/{@img+sharp-darwin-arm64@0.34.5/node_modules/@img/sharp-darwin-arm64 → @img+sharp-linux-x64@0.34.5/node_modules/@img/sharp-linux-x64}/package.json +13 -7
  13. package/.next/standalone/node_modules/.pnpm/@img+sharp-linuxmusl-x64@0.34.5/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  14. package/.next/standalone/node_modules/.pnpm/@img+sharp-linuxmusl-x64@0.34.5/node_modules/@img/sharp-linuxmusl-x64/package.json +46 -0
  15. package/.next/standalone/packages/admin/.next/BUILD_ID +1 -1
  16. package/.next/standalone/packages/admin/.next/app-path-routes-manifest.json +1 -2
  17. package/.next/standalone/packages/admin/.next/build-manifest.json +2 -2
  18. package/.next/standalone/packages/admin/.next/prerender-manifest.json +3 -244
  19. package/.next/standalone/packages/admin/.next/required-server-files.json +4 -4
  20. package/.next/standalone/packages/admin/.next/routes-manifest.json +0 -6
  21. package/.next/standalone/packages/admin/.next/server/app/(app)/api-keys/page.js +4 -4
  22. package/.next/standalone/packages/admin/.next/server/app/(app)/api-keys/page.js.nft.json +1 -1
  23. package/.next/standalone/packages/admin/.next/server/app/(app)/api-keys/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/packages/admin/.next/server/app/(app)/configurations/[id]/page.js +4 -4
  25. package/.next/standalone/packages/admin/.next/server/app/(app)/configurations/[id]/page.js.nft.json +1 -1
  26. package/.next/standalone/packages/admin/.next/server/app/(app)/configurations/[id]/page_client-reference-manifest.js +1 -1
  27. package/.next/standalone/packages/admin/.next/server/app/(app)/configurations/new/page.js +4 -4
  28. package/.next/standalone/packages/admin/.next/server/app/(app)/configurations/new/page.js.nft.json +1 -1
  29. package/.next/standalone/packages/admin/.next/server/app/(app)/configurations/new/page_client-reference-manifest.js +1 -1
  30. package/.next/standalone/packages/admin/.next/server/app/(app)/configurations/page.js +4 -4
  31. package/.next/standalone/packages/admin/.next/server/app/(app)/configurations/page.js.nft.json +1 -1
  32. package/.next/standalone/packages/admin/.next/server/app/(app)/configurations/page_client-reference-manifest.js +1 -1
  33. package/.next/standalone/packages/admin/.next/server/app/(app)/connections/page.js +4 -4
  34. package/.next/standalone/packages/admin/.next/server/app/(app)/connections/page.js.nft.json +1 -1
  35. package/.next/standalone/packages/admin/.next/server/app/(app)/connections/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/packages/admin/.next/server/app/(app)/members/page.js +4 -4
  37. package/.next/standalone/packages/admin/.next/server/app/(app)/members/page.js.nft.json +1 -1
  38. package/.next/standalone/packages/admin/.next/server/app/(app)/members/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/packages/admin/.next/server/app/(app)/organizations/new/page.js +4 -4
  40. package/.next/standalone/packages/admin/.next/server/app/(app)/organizations/new/page.js.nft.json +1 -1
  41. package/.next/standalone/packages/admin/.next/server/app/(app)/organizations/new/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/packages/admin/.next/server/app/(app)/page.js +4 -4
  43. package/.next/standalone/packages/admin/.next/server/app/(app)/page.js.nft.json +1 -1
  44. package/.next/standalone/packages/admin/.next/server/app/(app)/page_client-reference-manifest.js +1 -1
  45. package/.next/standalone/packages/admin/.next/server/app/(auth)/sign-in/page.js +4 -4
  46. package/.next/standalone/packages/admin/.next/server/app/(auth)/sign-in/page.js.nft.json +1 -1
  47. package/.next/standalone/packages/admin/.next/server/app/(auth)/sign-in/page_client-reference-manifest.js +1 -1
  48. package/.next/standalone/packages/admin/.next/server/app/(auth)/sign-up/page.js +4 -4
  49. package/.next/standalone/packages/admin/.next/server/app/(auth)/sign-up/page.js.nft.json +1 -1
  50. package/.next/standalone/packages/admin/.next/server/app/(auth)/sign-up/page_client-reference-manifest.js +1 -1
  51. package/.next/standalone/packages/admin/.next/server/app/_global-error/page.js +4 -4
  52. package/.next/standalone/packages/admin/.next/server/app/_global-error/page.js.nft.json +1 -1
  53. package/.next/standalone/packages/admin/.next/server/app/_global-error.html +2 -2
  54. package/.next/standalone/packages/admin/.next/server/app/_global-error.rsc +1 -1
  55. package/.next/standalone/packages/admin/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  56. package/.next/standalone/packages/admin/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  57. package/.next/standalone/packages/admin/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  58. package/.next/standalone/packages/admin/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  59. package/.next/standalone/packages/admin/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  60. package/.next/standalone/packages/admin/.next/server/app/_not-found/page.js +4 -4
  61. package/.next/standalone/packages/admin/.next/server/app/_not-found/page.js.nft.json +1 -1
  62. package/.next/standalone/packages/admin/.next/server/app-paths-manifest.json +1 -2
  63. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__11166210._.js +1 -1
  64. package/.next/standalone/packages/admin/.next/server/chunks/ssr/{[root-of-the-server]__ccdb07c7._.js → [root-of-the-server]__5f669f99._.js} +2 -2
  65. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__8b75dcf7._.js +3 -0
  66. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__97f64d21._.js +3 -0
  67. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__d3eb1dc6._.js +3 -0
  68. package/.next/standalone/packages/admin/.next/server/chunks/ssr/{[root-of-the-server]__c36a1480._.js → [root-of-the-server]__d54c026e._.js} +2 -2
  69. package/.next/standalone/packages/admin/.next/server/chunks/ssr/{[root-of-the-server]__ce1de76b._.js → [root-of-the-server]__e3d7a7dd._.js} +2 -2
  70. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__f9c80dad._.js +3 -0
  71. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_00e58c1f._.js +3 -0
  72. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_01624a16._.js +3 -0
  73. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_26fc04e9._.js +3 -0
  74. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_324916ea._.js +3 -0
  75. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_659ccf57._.js +3 -0
  76. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_6ad7ab73._.js +3 -0
  77. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_8cbac8df._.js +3 -0
  78. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_a956440d._.js +3 -0
  79. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_b3a45dbf._.js +3 -0
  80. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_d1dc43cd._.js +3 -0
  81. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_e490ca20._.js +3 -0
  82. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_e8902de4._.js +3 -0
  83. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_efaca41d._.js +3 -0
  84. package/.next/standalone/packages/admin/.next/server/chunks/ssr/node_modules__pnpm_80bfad15._.js +4 -0
  85. package/.next/standalone/packages/admin/.next/server/chunks/ssr/packages_admin_src_1fda1e02._.js +1 -1
  86. package/.next/standalone/packages/admin/.next/server/chunks/ssr/packages_admin_src_244f1dad._.js +1 -1
  87. package/.next/standalone/packages/admin/.next/server/chunks/ssr/packages_admin_src_7cfc5dab._.js +1 -1
  88. package/.next/standalone/packages/admin/.next/server/chunks/ssr/packages_admin_src_bb30e04e._.js +1 -1
  89. package/.next/standalone/packages/admin/.next/server/chunks/ssr/packages_admin_src_e1b30b8a._.js +1 -1
  90. package/.next/standalone/packages/admin/.next/server/chunks/ssr/packages_admin_src_lib_auth-client_ts_fbb00e9f._.js +1 -1
  91. package/.next/standalone/packages/admin/.next/server/pages/500.html +2 -2
  92. package/.next/standalone/packages/admin/.next/server/pages-manifest.json +0 -1
  93. package/.next/standalone/packages/admin/.next/server/server-reference-manifest.js +1 -1
  94. package/.next/standalone/packages/admin/.next/server/server-reference-manifest.json +1 -1
  95. package/.next/standalone/packages/admin/.next/static/chunks/1a5d4752a2696f6c.js +1 -0
  96. package/.next/standalone/packages/admin/.next/static/chunks/{05562c1c69863587.js → 290c59828720e71c.js} +1 -1
  97. package/.next/standalone/packages/admin/.next/static/chunks/3c8f7af989a569d0.js +1 -0
  98. package/.next/standalone/packages/admin/.next/static/chunks/482f51aff20b9026.js +1 -0
  99. package/.next/standalone/packages/admin/.next/static/chunks/6825749f95531abe.js +1 -0
  100. package/.next/standalone/packages/admin/.next/static/chunks/861b7f9e82092b78.js +1 -0
  101. package/.next/standalone/packages/admin/.next/static/chunks/91d7088f77893a6e.js +1 -0
  102. package/.next/standalone/packages/admin/.next/static/chunks/e50cd1a38f05636f.js +1 -0
  103. package/.next/standalone/packages/admin/package.json +1 -1
  104. package/.next/standalone/packages/admin/server.js +1 -1
  105. package/package.json +3 -3
  106. package/.next/standalone/node_modules/.pnpm/@img+sharp-darwin-arm64@0.34.5/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  107. package/.next/standalone/node_modules/.pnpm/next@16.1.7_@babel+core@7.29.7_@playwright+test@1.63.0_babel-plugin-macros@3.1.0_react-_0fca183e596c5e044f89867ff58e66fb/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +0 -6
  108. package/.next/standalone/packages/admin/.next/server/app/_not-found.html +0 -1
  109. package/.next/standalone/packages/admin/.next/server/app/_not-found.meta +0 -16
  110. package/.next/standalone/packages/admin/.next/server/app/_not-found.rsc +0 -14
  111. package/.next/standalone/packages/admin/.next/server/app/_not-found.segments/_full.segment.rsc +0 -14
  112. package/.next/standalone/packages/admin/.next/server/app/_not-found.segments/_head.segment.rsc +0 -5
  113. package/.next/standalone/packages/admin/.next/server/app/_not-found.segments/_index.segment.rsc +0 -6
  114. package/.next/standalone/packages/admin/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +0 -5
  115. package/.next/standalone/packages/admin/.next/server/app/_not-found.segments/_not-found.segment.rsc +0 -4
  116. package/.next/standalone/packages/admin/.next/server/app/_not-found.segments/_tree.segment.rsc +0 -2
  117. package/.next/standalone/packages/admin/.next/server/app/api/hello/route/app-paths-manifest.json +0 -3
  118. package/.next/standalone/packages/admin/.next/server/app/api/hello/route/build-manifest.json +0 -11
  119. package/.next/standalone/packages/admin/.next/server/app/api/hello/route/server-reference-manifest.json +0 -4
  120. package/.next/standalone/packages/admin/.next/server/app/api/hello/route.js +0 -6
  121. package/.next/standalone/packages/admin/.next/server/app/api/hello/route.js.map +0 -5
  122. package/.next/standalone/packages/admin/.next/server/app/api/hello/route.js.nft.json +0 -1
  123. package/.next/standalone/packages/admin/.next/server/app/api/hello/route_client-reference-manifest.js +0 -2
  124. package/.next/standalone/packages/admin/.next/server/app/api-keys.html +0 -1
  125. package/.next/standalone/packages/admin/.next/server/app/api-keys.meta +0 -16
  126. package/.next/standalone/packages/admin/.next/server/app/api-keys.rsc +0 -23
  127. package/.next/standalone/packages/admin/.next/server/app/api-keys.segments/!KGFwcCk/api-keys/__PAGE__.segment.rsc +0 -9
  128. package/.next/standalone/packages/admin/.next/server/app/api-keys.segments/!KGFwcCk/api-keys.segment.rsc +0 -4
  129. package/.next/standalone/packages/admin/.next/server/app/api-keys.segments/!KGFwcCk.segment.rsc +0 -7
  130. package/.next/standalone/packages/admin/.next/server/app/api-keys.segments/_full.segment.rsc +0 -23
  131. package/.next/standalone/packages/admin/.next/server/app/api-keys.segments/_head.segment.rsc +0 -5
  132. package/.next/standalone/packages/admin/.next/server/app/api-keys.segments/_index.segment.rsc +0 -6
  133. package/.next/standalone/packages/admin/.next/server/app/api-keys.segments/_tree.segment.rsc +0 -4
  134. package/.next/standalone/packages/admin/.next/server/app/configurations/new.html +0 -1
  135. package/.next/standalone/packages/admin/.next/server/app/configurations/new.meta +0 -17
  136. package/.next/standalone/packages/admin/.next/server/app/configurations/new.rsc +0 -24
  137. package/.next/standalone/packages/admin/.next/server/app/configurations/new.segments/!KGFwcCk/configurations/new/__PAGE__.segment.rsc +0 -9
  138. package/.next/standalone/packages/admin/.next/server/app/configurations/new.segments/!KGFwcCk/configurations/new.segment.rsc +0 -4
  139. package/.next/standalone/packages/admin/.next/server/app/configurations/new.segments/!KGFwcCk/configurations.segment.rsc +0 -4
  140. package/.next/standalone/packages/admin/.next/server/app/configurations/new.segments/!KGFwcCk.segment.rsc +0 -7
  141. package/.next/standalone/packages/admin/.next/server/app/configurations/new.segments/_full.segment.rsc +0 -24
  142. package/.next/standalone/packages/admin/.next/server/app/configurations/new.segments/_head.segment.rsc +0 -5
  143. package/.next/standalone/packages/admin/.next/server/app/configurations/new.segments/_index.segment.rsc +0 -6
  144. package/.next/standalone/packages/admin/.next/server/app/configurations/new.segments/_tree.segment.rsc +0 -4
  145. package/.next/standalone/packages/admin/.next/server/app/configurations.html +0 -1
  146. package/.next/standalone/packages/admin/.next/server/app/configurations.meta +0 -16
  147. package/.next/standalone/packages/admin/.next/server/app/configurations.rsc +0 -23
  148. package/.next/standalone/packages/admin/.next/server/app/configurations.segments/!KGFwcCk/configurations/__PAGE__.segment.rsc +0 -9
  149. package/.next/standalone/packages/admin/.next/server/app/configurations.segments/!KGFwcCk/configurations.segment.rsc +0 -4
  150. package/.next/standalone/packages/admin/.next/server/app/configurations.segments/!KGFwcCk.segment.rsc +0 -7
  151. package/.next/standalone/packages/admin/.next/server/app/configurations.segments/_full.segment.rsc +0 -23
  152. package/.next/standalone/packages/admin/.next/server/app/configurations.segments/_head.segment.rsc +0 -5
  153. package/.next/standalone/packages/admin/.next/server/app/configurations.segments/_index.segment.rsc +0 -6
  154. package/.next/standalone/packages/admin/.next/server/app/configurations.segments/_tree.segment.rsc +0 -4
  155. package/.next/standalone/packages/admin/.next/server/app/connections.html +0 -1
  156. package/.next/standalone/packages/admin/.next/server/app/connections.meta +0 -16
  157. package/.next/standalone/packages/admin/.next/server/app/connections.rsc +0 -23
  158. package/.next/standalone/packages/admin/.next/server/app/connections.segments/!KGFwcCk/connections/__PAGE__.segment.rsc +0 -9
  159. package/.next/standalone/packages/admin/.next/server/app/connections.segments/!KGFwcCk/connections.segment.rsc +0 -4
  160. package/.next/standalone/packages/admin/.next/server/app/connections.segments/!KGFwcCk.segment.rsc +0 -7
  161. package/.next/standalone/packages/admin/.next/server/app/connections.segments/_full.segment.rsc +0 -23
  162. package/.next/standalone/packages/admin/.next/server/app/connections.segments/_head.segment.rsc +0 -5
  163. package/.next/standalone/packages/admin/.next/server/app/connections.segments/_index.segment.rsc +0 -6
  164. package/.next/standalone/packages/admin/.next/server/app/connections.segments/_tree.segment.rsc +0 -4
  165. package/.next/standalone/packages/admin/.next/server/app/index.html +0 -1
  166. package/.next/standalone/packages/admin/.next/server/app/index.meta +0 -15
  167. package/.next/standalone/packages/admin/.next/server/app/index.rsc +0 -20
  168. package/.next/standalone/packages/admin/.next/server/app/index.segments/!KGFwcCk/__PAGE__.segment.rsc +0 -6
  169. package/.next/standalone/packages/admin/.next/server/app/index.segments/!KGFwcCk.segment.rsc +0 -7
  170. package/.next/standalone/packages/admin/.next/server/app/index.segments/_full.segment.rsc +0 -20
  171. package/.next/standalone/packages/admin/.next/server/app/index.segments/_head.segment.rsc +0 -5
  172. package/.next/standalone/packages/admin/.next/server/app/index.segments/_index.segment.rsc +0 -6
  173. package/.next/standalone/packages/admin/.next/server/app/index.segments/_tree.segment.rsc +0 -4
  174. package/.next/standalone/packages/admin/.next/server/app/members.html +0 -1
  175. package/.next/standalone/packages/admin/.next/server/app/members.meta +0 -16
  176. package/.next/standalone/packages/admin/.next/server/app/members.rsc +0 -23
  177. package/.next/standalone/packages/admin/.next/server/app/members.segments/!KGFwcCk/members/__PAGE__.segment.rsc +0 -9
  178. package/.next/standalone/packages/admin/.next/server/app/members.segments/!KGFwcCk/members.segment.rsc +0 -4
  179. package/.next/standalone/packages/admin/.next/server/app/members.segments/!KGFwcCk.segment.rsc +0 -7
  180. package/.next/standalone/packages/admin/.next/server/app/members.segments/_full.segment.rsc +0 -23
  181. package/.next/standalone/packages/admin/.next/server/app/members.segments/_head.segment.rsc +0 -5
  182. package/.next/standalone/packages/admin/.next/server/app/members.segments/_index.segment.rsc +0 -6
  183. package/.next/standalone/packages/admin/.next/server/app/members.segments/_tree.segment.rsc +0 -4
  184. package/.next/standalone/packages/admin/.next/server/app/organizations/new.html +0 -1
  185. package/.next/standalone/packages/admin/.next/server/app/organizations/new.meta +0 -17
  186. package/.next/standalone/packages/admin/.next/server/app/organizations/new.rsc +0 -25
  187. package/.next/standalone/packages/admin/.next/server/app/organizations/new.segments/!KGFwcCk/organizations/new/__PAGE__.segment.rsc +0 -9
  188. package/.next/standalone/packages/admin/.next/server/app/organizations/new.segments/!KGFwcCk/organizations/new.segment.rsc +0 -4
  189. package/.next/standalone/packages/admin/.next/server/app/organizations/new.segments/!KGFwcCk/organizations.segment.rsc +0 -4
  190. package/.next/standalone/packages/admin/.next/server/app/organizations/new.segments/!KGFwcCk.segment.rsc +0 -7
  191. package/.next/standalone/packages/admin/.next/server/app/organizations/new.segments/_full.segment.rsc +0 -25
  192. package/.next/standalone/packages/admin/.next/server/app/organizations/new.segments/_head.segment.rsc +0 -5
  193. package/.next/standalone/packages/admin/.next/server/app/organizations/new.segments/_index.segment.rsc +0 -6
  194. package/.next/standalone/packages/admin/.next/server/app/organizations/new.segments/_tree.segment.rsc +0 -4
  195. package/.next/standalone/packages/admin/.next/server/app/sign-in.html +0 -1
  196. package/.next/standalone/packages/admin/.next/server/app/sign-in.meta +0 -16
  197. package/.next/standalone/packages/admin/.next/server/app/sign-in.rsc +0 -20
  198. package/.next/standalone/packages/admin/.next/server/app/sign-in.segments/!KGF1dGgp/sign-in/__PAGE__.segment.rsc +0 -9
  199. package/.next/standalone/packages/admin/.next/server/app/sign-in.segments/!KGF1dGgp/sign-in.segment.rsc +0 -4
  200. package/.next/standalone/packages/admin/.next/server/app/sign-in.segments/!KGF1dGgp.segment.rsc +0 -4
  201. package/.next/standalone/packages/admin/.next/server/app/sign-in.segments/_full.segment.rsc +0 -20
  202. package/.next/standalone/packages/admin/.next/server/app/sign-in.segments/_head.segment.rsc +0 -5
  203. package/.next/standalone/packages/admin/.next/server/app/sign-in.segments/_index.segment.rsc +0 -6
  204. package/.next/standalone/packages/admin/.next/server/app/sign-in.segments/_tree.segment.rsc +0 -4
  205. package/.next/standalone/packages/admin/.next/server/app/sign-up.html +0 -1
  206. package/.next/standalone/packages/admin/.next/server/app/sign-up.meta +0 -16
  207. package/.next/standalone/packages/admin/.next/server/app/sign-up.rsc +0 -20
  208. package/.next/standalone/packages/admin/.next/server/app/sign-up.segments/!KGF1dGgp/sign-up/__PAGE__.segment.rsc +0 -9
  209. package/.next/standalone/packages/admin/.next/server/app/sign-up.segments/!KGF1dGgp/sign-up.segment.rsc +0 -4
  210. package/.next/standalone/packages/admin/.next/server/app/sign-up.segments/!KGF1dGgp.segment.rsc +0 -4
  211. package/.next/standalone/packages/admin/.next/server/app/sign-up.segments/_full.segment.rsc +0 -20
  212. package/.next/standalone/packages/admin/.next/server/app/sign-up.segments/_head.segment.rsc +0 -5
  213. package/.next/standalone/packages/admin/.next/server/app/sign-up.segments/_index.segment.rsc +0 -6
  214. package/.next/standalone/packages/admin/.next/server/app/sign-up.segments/_tree.segment.rsc +0 -4
  215. package/.next/standalone/packages/admin/.next/server/chunks/[externals]_next_dist_5e1fe3b2._.js +0 -3
  216. package/.next/standalone/packages/admin/.next/server/chunks/[root-of-the-server]__70451e10._.js +0 -7
  217. package/.next/standalone/packages/admin/.next/server/chunks/[turbopack]_runtime.js +0 -795
  218. package/.next/standalone/packages/admin/.next/server/chunks/packages_admin__next-internal_server_app_api_hello_route_actions_9a509fb7.js +0 -3
  219. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__1f72f3b1._.js +0 -3
  220. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__2191ad57._.js +0 -3
  221. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__47e62327._.js +0 -3
  222. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__4a93d9d1._.js +0 -3
  223. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__5d60206f._.js +0 -3
  224. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__6b42b409._.js +0 -3
  225. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__75267bcd._.js +0 -3
  226. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__76594065._.js +0 -3
  227. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__9bd52f90._.js +0 -3
  228. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__a94ee49a._.js +0 -3
  229. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__d1003ba6._.js +0 -4
  230. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__d31232b2._.js +0 -3
  231. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__ed0f46ce._.js +0 -3
  232. package/.next/standalone/packages/admin/.next/server/chunks/ssr/[root-of-the-server]__ff75f51a._.js +0 -3
  233. package/.next/standalone/packages/admin/.next/server/chunks/ssr/_2919a71c._.js +0 -3
  234. package/.next/standalone/packages/admin/.next/server/chunks/ssr/ba641_next_dist_0c137288._.js +0 -3
  235. package/.next/standalone/packages/admin/.next/server/chunks/ssr/ba641_next_dist_49b743cf._.js +0 -3
  236. package/.next/standalone/packages/admin/.next/server/pages/404.html +0 -1
  237. package/.next/standalone/packages/admin/.next/static/chunks/38a333dacb29e2a2.js +0 -1
  238. package/.next/standalone/packages/admin/.next/static/chunks/859ac16f7cd0224c.js +0 -1
  239. package/.next/standalone/packages/admin/.next/static/chunks/994dbd798f095dea.js +0 -1
  240. package/.next/standalone/packages/admin/.next/static/chunks/9e418364102b3869.js +0 -1
  241. package/.next/standalone/packages/admin/.next/static/chunks/a21fd6ad840f2be7.js +0 -1
  242. package/.next/standalone/packages/admin/.next/static/chunks/f39ba98c556d4860.js +0 -1
  243. /package/.next/standalone/node_modules/.pnpm/{@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64 → @img+sharp-libvips-linux-x64@1.2.4/node_modules/@img/sharp-libvips-linux-x64}/lib/index.js +0 -0
  244. /package/.next/standalone/node_modules/.pnpm/{@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64 → @img+sharp-libvips-linux-x64@1.2.4/node_modules/@img/sharp-libvips-linux-x64}/versions.json +0 -0
  245. /package/.next/standalone/packages/admin/.next/static/{idmiGdsQuvfbwsuyrHuj- → KVs4zHw0AXvA9IxwqmjpW}/_buildManifest.js +0 -0
  246. /package/.next/standalone/packages/admin/.next/static/{idmiGdsQuvfbwsuyrHuj- → KVs4zHw0AXvA9IxwqmjpW}/_clientMiddlewareManifest.json +0 -0
  247. /package/.next/standalone/packages/admin/.next/static/{idmiGdsQuvfbwsuyrHuj- → KVs4zHw0AXvA9IxwqmjpW}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9860,e=>{"use strict";let t,r,n,o,i;var a,s,l=e.i(14663);let u=Object.create(null),c=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?u:globalThis),E=new Proxy(u,{get:(e,t)=>c()[t]??u[t],has:(e,t)=>t in c()||t in u,set:(e,t,r)=>(c(!0)[t]=r,!0),deleteProperty(e,t){if(!t)return!1;let r=c(!0);return delete r[t],!0},ownKeys:()=>Object.keys(c(!0))});function _(e,t){return void 0!==l.default&&l.default.env?l.default.env[e]??t:"u">typeof Deno?Deno.env.get(e)??t:"u">typeof Bun?Bun.env[e]??t:t}function d(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}E.NODE_ENV,Object.freeze({get BETTER_AUTH_SECRET(){return _("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return _("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return _("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return _("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return _("NODE_ENV","development")},get PACKAGE_VERSION(){return _("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return _("BETTER_AUTH_TELEMETRY_ENDPOINT","")}}),d({USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",INVALID_USER:"Invalid user",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",TOKEN_EXPIRED:"Token expired",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CHANGE_EMAIL_DISABLED:"Change email is disabled",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account.",CROSS_SITE_NAVIGATION_LOGIN_BLOCKED:"Cross-site navigation login blocked. This request appears to be a CSRF attack.",VERIFICATION_EMAIL_NOT_ENABLED:"Verification email isn't enabled",EMAIL_ALREADY_VERIFIED:"Email is already verified",EMAIL_MISMATCH:"Email mismatch",SESSION_NOT_FRESH:"Session is not fresh",LINKED_ACCOUNT_ALREADY_EXISTS:"Linked account already exists",INVALID_ORIGIN:"Invalid origin",INVALID_CALLBACK_URL:"Invalid callbackURL",INVALID_REDIRECT_URL:"Invalid redirectURL",INVALID_ERROR_CALLBACK_URL:"Invalid errorCallbackURL",INVALID_NEW_USER_CALLBACK_URL:"Invalid newUserCallbackURL",MISSING_OR_NULL_ORIGIN:"Missing or null Origin",CALLBACK_URL_REQUIRED:"callbackURL is required",FAILED_TO_CREATE_VERIFICATION:"Unable to create verification",FIELD_NOT_ALLOWED:"Field not allowed to be set",ASYNC_VALIDATION_NOT_SUPPORTED:"Async validation is not supported",VALIDATION_ERROR:"Validation Error",MISSING_FIELD:"Field is required",METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED:"POST method requires deferSessionRefresh to be enabled in session config",BODY_MUST_BE_AN_OBJECT:"Body must be an object",PASSWORD_ALREADY_SET:"User already has a password set"});let f={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};var T=class extends Error{status;body;headers;statusCode;constructor(e="INTERNAL_SERVER_ERROR",t,r={},n="number"==typeof e?e:f[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=r,this.statusCode=n,this.name="APIError",this.status=e,this.headers=r,this.statusCode=n,this.body=t}};Symbol.for("better-call:api-error-headers"),a=T,s=Error,Object.defineProperty((class e extends a{#e;constructor(...e){if(function(){let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return void 0===e?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,"writable")?e.writable:void 0!==e.set}()){const t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);const t=Error().stack;t&&(this.#e=function(e){let t=e.split("\n at ");return t.length<=1?e:(t.splice(1,1),t.join("\n at "))}(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}).prototype,"constructor",{get:()=>s,enumerable:!1,configurable:!0});var O=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function p(e){let t=e.length;for(;t>0&&47===e.charCodeAt(t-1);)t--;return t===e.length?e:e.slice(0,t)}function A(e,t="/api/auth"){try{let t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new O(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){if(t instanceof O)throw t;throw new O(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}if(function(e){try{return"/"!==(p(new URL(e).pathname)||"/")}catch{throw new O(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let r=p(e);return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${r}${t}`):r}let h={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},R=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,I={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},N=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,g=["javascript:","data:","vbscript:"],m={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&function(e){let t;try{t=new URL(e)}catch{return!0}return!g.includes(t.protocol)}(e.data.url)&&"u">typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},v=(e,t,r,n)=>(e.events=e.events||{},e.events[r+10]||(e.events[r+10]=n(t=>{e.events[r].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[r]=e.events[r]||[],e.events[r].push(t),()=>{let n=e.events[r],o=n.indexOf(t);~o&&(n.splice(o,1),n.length||(e.events[r+10](),delete e.events[r+10]))}),L=(e,t)=>v(e,r=>{let n=t(r);n&&e.events[6].push(n)},5,t=>{let r=e.listen;e.listen=(...n)=>(e.lc||e.active||(e.active=!0,t()),r(...n));let n=e.off;return e.events[6]=[],e.off=()=>{n(),setTimeout(()=>{if(e.active&&!e.lc){for(let t of(e.active=!1,e.events[6]))t();e.events[6]=[]}},1e3)},()=>{e.listen=r,e.off=n}});function S(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function b(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!b(e[r],t[r]))return!1;return!0}if(S(e)&&S(t)){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!(n in t)||!b(e[n],t[n]))return!1;return!0}return!1}function y(e,t){return v(e,({newValue:r,abort:n})=>{t(e.value,r)&&n()},2,t=>{let r=e.set,n=e.setKey;return e.setKey&&(e.setKey=(r,o)=>{let i;if(t({abort:()=>{i=!0},changed:r,newValue:{...e.value,[r]:o}}),!i)return n(r,o)}),e.set=e=>{let n;if(t({abort:()=>{n=!0},newValue:e}),!n)return r(e)},()=>{e.set=r,e.setKey=n}})}let U=Symbol.for("better-auth:broadcast-channel");var D=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if("u">typeof window)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Math.floor(Date.now()/1e3)}))}catch{}}setup(){if("u"<typeof window||void 0===window.addEventListener)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??"{}");t?.event==="session"&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function w(e="better-auth.message"){return globalThis[U]||(globalThis[U]=new D(e)),globalThis[U]}let P=Symbol.for("better-auth:focus-manager");var C=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if("u"<typeof window||"u"<typeof document||void 0===window.addEventListener)return()=>{};let e=()=>{"visible"===document.visibilityState&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function M(){return globalThis[P]||(globalThis[P]=new C),globalThis[P]}let Y=Symbol.for("better-auth:online-manager");var F=class{listeners=new Set;isOnline="u"<typeof navigator||navigator.onLine;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if("u"<typeof window||void 0===window.addEventListener)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function B(){return globalThis[Y]||(globalThis[Y]=new F),globalThis[Y]}let H=()=>Math.floor(Date.now()/1e3),V=[],j=0,G=globalThis.nanostoresGlobal||={epoch:0},z=e=>{let t=[],r={eq:Object.is,get:()=>(r.lc||r.listen(()=>{})(),r.value),init:e,lc:0,listen:e=>(r.lc=t.push(e),()=>{for(let t=j;t<V.length;)V[t]===e?V.splice(t,4):t+=4;let n=t.indexOf(e);~n&&(t.splice(n,1),--r.lc||r.off())}),notify(e,n){G.epoch++;let o=!V.length;for(let o of t)V.push(o,r,e,n);o&&(()=>{let e,t;for(;j<V.length;){t=j,j+=4;try{V[t](V[t+1].value,V[t+2],V[t+3])}catch(t){e=t}}if(V.length=j=0,e)throw e})()},off(){},set(e){let t=r.value;r.eq(t,e)||(r.value=e,r.notify(t))},subscribe(e){let t=r.listen(e);return e(r.value),t},value:e};return r};function k(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function W(e,t){return b(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function x(e){if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.iterator in e)&&(!(Symbol.toStringTag in e)||"[object Module]"===Object.prototype.toString.call(e))}function q(e){return(...t)=>t.reduce((t,r)=>(function e(t,r,n=".",o){if(!x(r))return e(t,{},n,o);let i={...r};for(let r of Object.keys(t)){if("__proto__"===r||"constructor"===r)continue;let a=t[r];null!=a&&(o&&o(i,r,a,n)||(Array.isArray(a)&&Array.isArray(i[r])?i[r]=[...a,...i[r]]:x(a)&&x(i[r])?i[r]=e(a,i[r],(n?`${n}.`:"")+r.toString(),o):i[r]=a))}return i})(t,r,"",e),{})}let $=q();q((e,t,r)=>{if(void 0!==e[t]&&"function"==typeof r)return e[t]=r(e[t]),!0}),q((e,t,r)=>{if(Array.isArray(e[t])&&"function"==typeof r)return e[t]=r(e[t]),!0});var K=Object.defineProperty,X=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,Q=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,et=(e,t,r)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,er=(e,t)=>{for(var r in t||(t={}))J.call(t,r)&&et(e,r,t[r]);if(Q)for(var r of Q(t))ee.call(t,r)&&et(e,r,t[r]);return e},en=(e,t)=>X(e,Z(t)),eo=class extends Error{constructor(e,t,r){super(t||e.toString(),{cause:r}),this.status=e,this.statusText=t,this.error=r,Error.captureStackTrace(this,this.constructor)}},ei=async(e,t)=>{var r,n,o,i,a,s;let l=t||{},u={onRequest:[null==t?void 0:t.onRequest],onResponse:[null==t?void 0:t.onResponse],onSuccess:[null==t?void 0:t.onSuccess],onError:[null==t?void 0:t.onError],onRetry:[null==t?void 0:t.onRetry]};if(!t||!(null==t?void 0:t.plugins))return{url:e,options:l,hooks:u};for(let c of(null==t?void 0:t.plugins)||[]){if(c.init){let n=await (null==(r=c.init)?void 0:r.call(c,e.toString(),t));l=n.options||l,e=n.url}u.onRequest.push(null==(n=c.hooks)?void 0:n.onRequest),u.onResponse.push(null==(o=c.hooks)?void 0:o.onResponse),u.onSuccess.push(null==(i=c.hooks)?void 0:i.onSuccess),u.onError.push(null==(a=c.hooks)?void 0:a.onError),u.onRetry.push(null==(s=c.hooks)?void 0:s.onRetry)}return{url:e,options:l,hooks:u}},ea=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},es=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}},el=async e=>{let t={},r=async e=>"function"==typeof e?await e():e;if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let n=await r(e.auth.token);if(!n)return t;t.authorization=`Bearer ${n}`}else if("Basic"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.username),r(e.auth.password)]);if(!n||!o)return t;t.authorization=`Basic ${btoa(`${n}:${o}`)}`}else if("Custom"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.prefix),r(e.auth.value)]);if(!o)return t;t.authorization=`${null!=n?n:""} ${o}`}}return t},eu=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function ec(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}function eE(e){try{return JSON.parse(e)}catch(t){return e}}function e_(e){return"function"==typeof e}function ed(...e){let t={};for(let r of e)if(r)if(r instanceof Headers)r.forEach((e,r)=>{t[r]=e});else for(let[e,n]of Array.isArray(r)?r:Object.entries(r))null!=n&&(t[e]=n);return t}async function ef(e){let t=new Headers(ed(null==e?void 0:e.headers,await el(e)));if(!t.has("content-type")){let r=ec(null==e?void 0:e.body)?"application/json":null;r&&t.set("content-type",r)}return t}var eT=class e extends Error{constructor(t,r){super(r||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function eO(e,t){let r=await e["~standard"].validate(t);if(r.issues)throw new eT(r.issues);return r.value}var ep=["get","post","put","patch","delete"],eA=async(e,t)=>{var r,n,o,i,a,s,l,u;let c,{hooks:E,url:_,options:d}=await ei(e,t),f=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("u">typeof globalThis&&e_(globalThis.fetch))return globalThis.fetch;if("u">typeof window&&e_(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(d),T=new AbortController,O=null!=(r=d.signal)?r:T.signal,p=function(e,t){let{baseURL:r,params:n,query:o}=t||{query:{},params:{},baseURL:""},i=e.startsWith("http")?e.split("/").slice(0,3).join("/"):r||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];ep.includes(t)&&(e=e.replace(`@${t}/`,"/"))}i.endsWith("/")||(i+="/");let[a,s]=e.replace(i,"").split("?"),l=new URLSearchParams(s);for(let[e,t]of Object.entries(o||{})){let r;if(null!=t){if("string"==typeof t)r=t;else if(Array.isArray(t)){for(let r of t)l.append(e,r);continue}else r=JSON.stringify(t);l.set(e,r)}}let u=new Map;if(n)if(Array.isArray(n))for(let[e,t]of a.split("/").filter(e=>e.startsWith(":")).entries()){let r=n[e];u.set(t,String(r))}else for(let[e,t]of Object.entries(n))u.set(`:${e}`,String(t));a=(a=a.split("/").map(e=>(function(e,t){let r,n=e;for(let[e,r]of t)n=n.replace(e,r);if("."===(r=n)||".."===r)throw TypeError("Path parameters cannot be reserved path segments");return encodeURIComponent(n)})(e,u)).join("/")).replace(/^\/+/,"");let c=l.toString();return(c=c.length>0?`?${c}`.replace(/\+/g,"%20"):"",i.startsWith("http"))?new URL(`${a}${c}`,i):`${i}${a}${c}`}(_,d),A=await ef(d),h=function(e,t){let r,{body:n}=e;return n?ec(n)&&"string"!=typeof n?"application/x-www-form-urlencoded"===((r=t.get("content-type"))?r.split(";")[0].trim().toLowerCase():null)?new URLSearchParams(n).toString():JSON.stringify(n):n:null}(d,A),R=function(e,t){var r;if(null==t?void 0:t.method)return t.method.toUpperCase();if(e.startsWith("@")){let n=null==(r=e.split("@")[1])?void 0:r.split("/")[0];return ep.includes(n)?n.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(_,d),I=en(er({},d),{url:p,headers:A,body:h,method:R,signal:O});for(let e of E.onRequest)if(e){let t=await e(I);"object"==typeof t&&null!==t&&Object.assign(I,t)}("pipeTo"in I&&"function"==typeof I.pipeTo||"function"==typeof(null==(n=null==t?void 0:t.body)?void 0:n.pipe))&&!("duplex"in I)&&(I.duplex="half");let{clearTimeout:N}=(!(null==d?void 0:d.signal)&&(null==d?void 0:d.timeout)&&(c=setTimeout(()=>null==T?void 0:T.abort(),null==d?void 0:d.timeout)),{abortTimeout:c,clearTimeout:()=>{c&&clearTimeout(c)}}),g=await f(I.url,I);N();let m={response:g,request:I};for(let e of E.onResponse)if(e){let r=await e(en(er({},m),{response:(null==(o=null==t?void 0:t.hookOptions)?void 0:o.cloneResponse)?g.clone():g}));r instanceof Response?g=r:"object"==typeof r&&null!==r&&(g=r.response)}if(g.ok){if("HEAD"===I.method)return{data:"",error:null};let e=function(e){let t=e.headers.get("content-type"),r=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";let n=t.split(";").shift()||"";return eu.test(n)?"json":r.has(n)||n.startsWith("text/")?"text":"blob"}(g),r={data:null,response:g,request:I};if("json"===e||"text"===e){let e=await g.text(),t=null!=(i=I.jsonParser)?i:eE;r.data=await t(e)}else r.data=await g[e]();for(let e of((null==I?void 0:I.output)&&I.output&&!I.disableValidation&&(r.data=await eO(I.output,r.data)),E.onSuccess))e&&await e(en(er({},r),{response:(null==(a=null==t?void 0:t.hookOptions)?void 0:a.cloneResponse)?g.clone():g}));return(null==t?void 0:t.throw)?r.data:{data:r.data,error:null}}let v=null!=(s=null==t?void 0:t.jsonParser)?s:eE,L=await g.text(),S=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(L),b=S?await v(L):null,y={response:g,responseText:L,request:I,error:en(er({},b),{status:g.status,statusText:g.statusText})};for(let e of E.onError)e&&await e(en(er({},y),{response:(null==(l=null==t?void 0:t.hookOptions)?void 0:l.cloneResponse)?g.clone():g}));if(null==t?void 0:t.retry){let r=function(e){if("number"==typeof e)return new ea({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new ea(e);case"exponential":return new es(e);default:throw Error("Invalid retry strategy")}}(t.retry),n=null!=(u=t.retryAttempt)?u:0;if(await r.shouldAttemptRetry(n,g)){for(let e of E.onRetry)e&&await e(m);let o=r.getDelay(n);return await new Promise(e=>setTimeout(e,o)),await eA(e,en(er({},t),{retryAttempt:n+1}))}}if(null==t?void 0:t.throw)throw new eo(g.status,g.statusText,S?b:L);return{data:null,error:en(er({},b),{status:g.status,statusText:g.statusText})}};let eh=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,eR=/['\u2019]/g;function eI(e){return(e.replace(eR,"").match(eh)??[]).map(e=>e.toLowerCase()).join("-")}function eN(e,t){let r=t.split(".").flatMap(e=>(function e(t){if(eg.test(t)){let[,r,n]=t.match(eg);return[...e(r),n]}return[t]})(e)),n=e;for(let e of r){if(null==n)return;n=n[e]}return n}let eg=/(.*)\[(\d+)\]/;var em=e.i(99975);function ev(e,t){return b(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}let eL=(e,t,r,n)=>{let o=z({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>i(e)});L(o,()=>y(o,ev));let i=async e=>new Promise(i=>{let a="function"==typeof n?n({data:o.get().data,error:o.get().error,isPending:o.get().isPending}):n;r(t,{...a,query:{...a?.query,...e?.query},async onSuccess(e){let t=o.get(),r=null!=t.data&&null!=e.data&&b(t.data,e.data)?t.data:e.data;o.set({data:r,error:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await a?.onSuccess?.(e)},async onError(e){let{request:t}=e,r="number"==typeof t.retry?t.retry:t.retry?.attempts,n=t.retryAttempt||0;if(r&&n<r)return;let i=401===e.error.status;o.set({error:e.error,data:i?null:o.get().data,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await a?.onError?.(e)},async onRequest(e){let t=o.get();o.set({isPending:null===t.data,data:t.data,error:null,isRefetching:!0,refetch:o.value.refetch}),await a?.onRequest?.(e)}}).catch(e=>{o.set({error:e,data:o.get().data,isPending:!1,isRefetching:!1,refetch:o.value.refetch})}).finally(()=>{i(void 0)})});e=Array.isArray(e)?e:[e];let a=!1,s=!1,l=!1,u=()=>{if(a){l=!0;return}a=!0,i().finally(()=>{a=!1;let e=l&&s;l=!1,e&&u()})};return L(o,()=>{let t;if("u"<typeof window)return;s=!0;let r=!1,n=e.map(e=>e.listen(()=>{r?i():(r=!0,clearTimeout(t),u())}));return t=setTimeout(()=>{r=!0,u()},0),()=>{for(let e of(s=!1,n))e();clearTimeout(t)}}),o};function eS(e){return"OR"===e?"OR":"AND"}function eb(e){return Array.isArray(e)}function ey(e,t){return"string"==typeof t&&e.includes(t)}let eU=e=>{var t;return{authorize(e,r="AND"){let n=!1;for(let[o,i]of Object.entries(e)){let e=t[o];if(!e){if("AND"===r)return{success:!1,error:`You are not allowed to access resource: ${o}`};continue}let a=function(e,{actions:t,connector:r}){return 0!==t.length&&("OR"===r?t.some(t=>ey(e,t)):t.every(t=>ey(e,t)))}(e,function(e){if(eb(e))return{actions:e,connector:"AND"};if(!e||"object"!=typeof e)throw new O("Invalid access control request");let{actions:t,connector:r}=e;return eb(t)?{actions:t,connector:eS(r)}:{actions:[],connector:eS(r)}}(i));if(a&&(n=!0),a&&"OR"===r)return{success:!0};if(!a&&"AND"===r)return{success:!1,error:`unauthorized to access resource "${o}"`}}return n?{success:!0}:{success:!1,error:"Not authorized"}},statements:t=e}},eD=eU({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),ew=eU({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),eP=eU({organization:[],member:[],invitation:[],team:[],ac:["read"]}),eC={admin:eD,owner:ew,member:eP},eM=d({YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_SLUG_ALREADY_TAKEN:"Organization slug already taken",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER:"You cannot leave the organization without an owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION:"Email verification required before accepting or rejecting invitation",EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION:"Email verification required to view or list invitations for the session email",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"You are not allowed to invite a user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached",USER_IS_NOT_A_MEMBER_OF_THE_TEAM:"User is not a member of the team",YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM:"You are not allowed to list the members of this team",YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM:"You do not have an active team",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER:"You are not allowed to create a new member",YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER:"You are not allowed to remove a team member",YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION:"You are not allowed to access this organization as an owner",YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION:"You are not a member of this organization",MISSING_AC_INSTANCE:"Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information",YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE:"You must be in an organization to create a role",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE:"You are not allowed to create a role",YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE:"You are not allowed to update a role",YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE:"You are not allowed to delete a role",YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE:"You are not allowed to read a role",YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE:"You are not allowed to list a role",YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE:"You are not allowed to get a role",TOO_MANY_ROLES:"This organization has too many roles",INVALID_RESOURCE:"The provided permission includes an invalid resource",ROLE_NAME_IS_ALREADY_TAKEN:"That role name is already taken",CANNOT_DELETE_A_PRE_DEFINED_ROLE:"Cannot delete a pre-defined role",ROLE_IS_ASSIGNED_TO_MEMBERS:"Cannot delete a role that is assigned to members. Please reassign the members to a different role first",INVALID_TEAM_ID:"Team id contains a reserved character"}),eY=Object.fromEntries(Object.entries({INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_REFERENCE_ID_FROM_API_KEY:"The reference id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only.",FAILED_TO_UPDATE_API_KEY:"Failed to update API key",NAME_REQUIRED:"API Key name is required.",ORGANIZATION_ID_REQUIRED:"Organization ID is required for organization-owned API keys.",USER_NOT_MEMBER_OF_ORGANIZATION:"You are not a member of the organization that owns this API key.",INSUFFICIENT_API_KEY_PERMISSIONS:"You do not have permission to perform this action on organization API keys.",NO_DEFAULT_API_KEY_CONFIGURATION_FOUND:"No default api-key configuration found.",ORGANIZATION_PLUGIN_REQUIRED:"Organization plugin is required for organization-owned API keys. Please install and configure the organization plugin."}).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}])),eF=function(e){var t;let{pluginPathMethods:r,pluginsActions:n,pluginsAtoms:o,hydrateSession:i,$fetch:a,$store:s,atomListeners:u}=((e,t)=>{var r;let n,o,i,a,s,u,c,_,d,f="credentials"in Request.prototype,T=function(e,t,r,n,o){if(e)return A(e,t);if(!1!==n){let e=E.BETTER_AUTH_URL||E.NEXT_PUBLIC_BETTER_AUTH_URL||E.PUBLIC_BETTER_AUTH_URL||E.NUXT_PUBLIC_BETTER_AUTH_URL||E.NUXT_PUBLIC_AUTH_URL||("/"!==E.BASE_URL?E.BASE_URL:void 0);if(e)return A(e,t)}r?.headers.get("x-forwarded-host"),r?.headers.get("x-forwarded-proto");if(r){let e=function(e){try{let t=new URL(e);return"null"===t.origin?null:t.origin}catch{return null}}(r.url);if(!e)throw new O("Could not get origin from request. Please provide a valid base URL.");return A(e,t)}if("u">typeof window&&window.location)return A(window.location.origin,t)}(e?.baseURL,e?.basePath,void 0,void 0)??(e=>{if(void 0!==l.default){if(l.default.env.NEXT_PUBLIC_AUTH_URL)return l.default.env.NEXT_PUBLIC_AUTH_URL;if("u"<typeof window){if(l.default.env.NEXTAUTH_URL)try{return l.default.env.NEXTAUTH_URL}catch{}if(l.default.env.VERCEL_URL)try{let t=l.default.env.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${t}${l.default.env.VERCEL_URL}`).origin}${e??"/api/auth"}`}catch{}}}})(e?.basePath)??"/api/auth",p=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],g={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:v,onError:S,onRequest:U,onResponse:D,...P}=e?.fetchOptions||{},C=(r={baseURL:T,...f?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,t={strict:!0}){return function(e,t={}){let{strict:r=!1,warnings:n=!1,reviver:o,parseDates:i=!0}=t;if("string"!=typeof e)return e;let a=e.trim(),s=a.toLowerCase();if(s.length<=9&&s in I)return I[s];if(!R.test(a)){if(r)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(h).some(([e,t])=>{let r=t.test(a);return r&&n&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),r})&&r)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(e,t)=>{if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){n&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(i&&"string"==typeof t){let e=function(e){let t=N.exec(e);if(!t)return null;let[,r,n,o,i,a,s,l,u,c,E]=t,_=new Date(Date.UTC(parseInt(r,10),parseInt(n,10)-1,parseInt(o,10),parseInt(i,10),parseInt(a,10),parseInt(s,10),l?parseInt(l.padEnd(3,"0"),10):0));if(u){let e=(60*parseInt(c,10)+parseInt(E,10))*("+"===u?-1:1);_.setUTCMinutes(_.getUTCMinutes()+e)}return _ instanceof Date&&!isNaN(_.getTime())?_:null}(t);if(e)return e}return o?o(e,t):t})}catch(t){if(r)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...P,plugins:[g,...P.plugins||[],...e?.disableDefaultFetchPlugins?[]:[m],...p]},async function(e,t){let n,o=en(er(er({},r),t),{headers:ed(null==r?void 0:r.headers,null==t?void 0:t.headers),plugins:[...(null==r?void 0:r.plugins)||[],(n=r||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var r,o,i,a;let s=(null==(o=null==(r=n.plugins)?void 0:r.find(t=>{var r;return null!=(r=t.schema)&&!!r.config&&(e.startsWith(t.schema.config.baseURL||"")||e.startsWith(t.schema.config.prefix||""))}))?void 0:o.schema)||n.schema;if(s){let r=e;(null==(i=s.config)?void 0:i.prefix)&&r.startsWith(s.config.prefix)&&(r=r.replace(s.config.prefix,""),s.config.baseURL&&(e=e.replace(s.config.prefix,s.config.baseURL))),(null==(a=s.config)?void 0:a.baseURL)&&r.startsWith(s.config.baseURL)&&(r=r.replace(s.config.baseURL,"")),r.startsWith("/")&&"@"===r.charAt(1)&&(r=r.substring(1));let n=s.schema[r];if(n){let r=null==t?void 0:t.headers;if(n.headers&&!(null==t?void 0:t.disableValidation)){let e={};if(null==t?void 0:t.headers){if(t.headers instanceof Headers)t.headers.forEach((t,r)=>{e[r.toLowerCase()]=t});else if("object"==typeof t.headers)for(let[r,n]of Object.entries(t.headers))null!=n&&(e[r.toLowerCase()]=n)}let o=await eO(n.headers,e),i={};for(let[e,t]of Object.entries(o))i[e.toLowerCase()]=t;r=i}let o=en(er({},t),{method:n.method,output:n.output,headers:r});return(null==t?void 0:t.disableValidation)||(o=en(er({},o),{body:n.input?await eO(n.input,null==t?void 0:t.body):null==t?void 0:t.body,params:n.params?await eO(n.params,null==t?void 0:t.params):null==t?void 0:t.params,query:n.query?await eO(n.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:o}}}return{url:e,options:t}}}),...(null==t?void 0:t.plugins)||[]]});if(null==r?void 0:r.catchAllError)try{return await eA(e,o)}catch(e){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:e}}}return await eA(e,o)}),{$sessionSignal:Y,session:F,broadcastSessionUpdate:V}=(o=z(!1),i=0,a=0,o.listen(()=>{a++,i=0}),y(u=z({data:null,error:null,isPending:!0,isRefetching:!1,refetch:s=e=>_(e)}),W),c=async(e,t)=>{let r=u.value;if(u.set({...r,isPending:null===r.data,isRefetching:!0,error:null,refetch:s}),e.aborted)return"aborted";try{var n;let r=await C("/get-session",{method:"GET",query:t?.query,signal:e});if(e.aborted)return"aborted";let{data:o,error:i}=k(r),a="fresh";if(o?.needsRefresh)try{let t=await C("/get-session",{method:"POST",signal:e});if(e.aborted)return"aborted";({data:o,error:i}=k(t))}catch{if(e.aborted)return"aborted";a="stale"}if(i){let e=u.value,t=i?.status===401;return u.set({data:t?null:e.data,error:i,isPending:!1,isRefetching:!1,refetch:s}),"failed"}let l=(n=o)&&(null!==n.session||null!==n.user)?n:null,c=u.value,E=null!=c.data&&null!=l&&b(c.data,l)?c.data:l;return u.set({data:E,error:null,isPending:!1,isRefetching:!1,refetch:s}),a}catch(r){if(e.aborted)return"aborted";let t=u.value;return u.set({data:t.data,error:r,isPending:!1,isRefetching:!1,refetch:s}),"failed"}},_=e=>{i=0,n?.cancel();let t=new AbortController,r={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?"aborted":c(t.signal,e)),revision:a};n=r;let o=e=>{if(n===r){let t,o;n=void 0,"fresh"===e&&r.revision===a&&(o=(t=u.value.data?.session?.expiresAt)instanceof Date?t.getTime():1/0,i=Math.min(Date.now()+1e3,o))}};return r.promise.then(o,()=>o("failed")),r.promise.then(()=>void 0)},d=()=>{},L(u,()=>{let t;"u"<typeof window||(t=setTimeout(()=>{n?.revision===a?n.promise.then(()=>void 0):Date.now()<i?Promise.resolve():_()},0));let r=function(e){let{fetchSession:t,shouldPollSession:r=()=>!0,sessionSignal:n,options:o={}}=e,i=o.sessionOptions?.refetchInterval??0,a=o.sessionOptions?.refetchOnWindowFocus??!0,s=o.sessionOptions?.refetchWhenOffline??!1,l={isInitialized:!1,lastSessionRequest:0},u=e=>{if(s||B().isOnline){if(e?.event==="storage")return void t();if(e?.event==="poll"){l.lastSessionRequest=H(),t();return}if(e?.event==="visibilitychange"){if(H()-l.lastSessionRequest<5)return;l.lastSessionRequest=H(),t();return}t()}};return{init:()=>{l.isInitialized||(l.isInitialized=!0,i&&i>0&&(l.pollInterval=setInterval(()=>{r()&&u({event:"poll"})},1e3*i)),l.unsubscribeBroadcast=w().subscribe(()=>{u({event:"storage"})}),a&&(l.unsubscribeFocus=M().subscribe(()=>{u({event:"visibilitychange"})})),l.unsubscribeOnline=B().subscribe(e=>{e&&u({event:"visibilitychange"})}),l.unsubscribeSignal=n.listen(()=>{t()}),l.cleanupBroadcastSetup=w().setup(),l.cleanupFocusSetup=M().setup(),l.cleanupOnlineSetup=B().setup())},cleanup:()=>{l.isInitialized&&(l.pollInterval&&(clearInterval(l.pollInterval),l.pollInterval=void 0),l.unsubscribeBroadcast&&(l.unsubscribeBroadcast(),l.unsubscribeBroadcast=void 0),l.unsubscribeFocus&&(l.unsubscribeFocus(),l.unsubscribeFocus=void 0),l.unsubscribeOnline&&(l.unsubscribeOnline(),l.unsubscribeOnline=void 0),l.unsubscribeSignal&&(l.unsubscribeSignal(),l.unsubscribeSignal=void 0),l.cleanupBroadcastSetup&&(l.cleanupBroadcastSetup(),l.cleanupBroadcastSetup=void 0),l.cleanupFocusSetup&&(l.cleanupFocusSetup(),l.cleanupFocusSetup=void 0),l.cleanupOnlineSetup&&(l.cleanupOnlineSetup(),l.cleanupOnlineSetup=void 0),l.isInitialized=!1,l.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:e=>{w().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}({fetchSession:_,shouldPollSession:()=>null!=u.value.data,sessionSignal:o,options:e});return r.init(),d=r.broadcastSessionUpdate,()=>{t&&clearTimeout(t),r.cleanup()}}),{session:u,$sessionSignal:o,broadcastSessionUpdate:e=>d(e)}),j=!1,G=e?.plugins||[],x={},q={$sessionSignal:Y,session:F},K={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},X=[{signal:"$sessionSignal",matcher:e=>"/sign-out"===e||"/update-user"===e||"/update-session"===e||"/sign-up/email"===e||"/sign-in/email"===e||"/delete-user"===e||"/verify-email"===e||"/revoke-sessions"===e||"/revoke-session"===e||"/revoke-other-sessions"===e||"/change-email"===e||"/change-password"===e,callback(e){"/sign-out"===e?V("signout"):("/update-user"===e||"/update-session"===e)&&V("updateUser")}}];for(let e of G)e.getAtoms&&Object.assign(q,e.getAtoms?.(C)),e.pathMethods&&Object.assign(K,e.pathMethods),e.atomListeners&&X.push(...e.atomListeners);let Z={notify:e=>{q[e].set(!q[e].get())},listen:(e,t)=>{q[e].subscribe(t)},atoms:q};for(let t of G)t.getActions&&(x=$(t.getActions?.(C,Z,e)??{},x));return{get baseURL(){return T},pluginsActions:x,pluginsAtoms:q,pluginPathMethods:K,atomListeners:X,hydrateSession:e=>{j||null===e||(j=!0,function(e,t){if("u"<typeof window)return;let r=e.get();null===r.data&&null!==t&&e.set({...r,data:t,error:null,isPending:!1})}(F,e))},$sessionSignal:Y,$fetch:C,$store:Z}})(e),c={};for(let[e,t]of Object.entries(o))c[function(e){return`use${e.charAt(0).toUpperCase()+e.slice(1)}`}(e)]=()=>(function(e,t={}){let r=(0,em.useRef)(e.get()),{keys:n,deps:o=[e,n]}=t,i=(0,em.useCallback)(t=>{let o=e=>{r.current!==e&&(r.current=e,t())};if(o(e.value),n?.length){let t;return t=new Set(n),e.listen((e,r,i)=>{(void 0===i?n.some(t=>void 0===r||e[t]!==r[t]||eN(e,t)!==eN(r,t)):t.has(i)||t.has(i.split(/\.|\[/)[0]))&&o(e,r,i)})}return e.listen(o)},o),a=()=>r.current;return(0,em.useSyncExternalStore)(i,a,a)})(t);return t={...n,...c,hydrateSession:i,$fetch:a,$store:s},function e(n=[]){return new Proxy(function(){},{get(r,o){var i;if("string"!=typeof o||"then"===o||"catch"===o||"finally"===o)return;let a=[...n,o],s=t;for(let e of a)if(s&&"object"==typeof s&&e in s)s=s[e];else{s=void 0;break}return"function"==typeof s?s:"object"==typeof(i=s)&&null!==i&&"get"in i&&"function"==typeof i.get&&"lc"in i&&"number"==typeof i.lc?s:e(a)},apply:async(e,t,i)=>{let s="/"+n.map(eI).join("/"),l=i[0]||{},c=i[1]||{},{query:E,fetchOptions:_,...d}=l,f={...c,..._},T=function(e,t,r){let n=t[e],{fetchOptions:o,query:i,...a}=r||{};return n||(o?.method?o.method:a&&Object.keys(a).length>0?"POST":"GET")}(s,r,l);return await a(s,{...f,body:"GET"===T?void 0:{...d,...f?.body||{}},query:E||f?.query,method:T,async onSuccess(e){if(await f?.onSuccess?.(e),!u||f.disableSignal)return;let t=u.filter(e=>e.matcher(s));if(!t.length)return;let r=new Set;for(let e of t){let t=o[e.signal];if(!t)return;if(r.has(e.signal))continue;r.add(e.signal);let n=t.get();setTimeout(()=>{t.set(!n)},10),e.callback?.(s)}}})}})}()}({baseURL:l.default.env.NEXT_PUBLIC_API_URL??"http://localhost:3333",plugins:[(t=z(!1),r=z(!1),n=z(!1),o=z(!1),i={admin:eD,member:eP,owner:ew,...void 0},{id:"organization",version:"1.7.3",$InferServerPlugin:{},getActions:(e,t,r)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:e=>{let t;return((e,t)=>{if(!e.permissions)return!1;let r=e.role.split(","),n=e.options.creatorRole||"owner",o=r.includes(n),i=e.allowCreatorAllPermissions||!1;if(o&&i)return!0;for(let n of r)if(t[n]?.authorize(e.permissions)?.success)return!0;return!1})(t={role:e.role,options:{ac:void 0,roles:i},permissions:e.permissions},t.options.roles||eC)}}}),getAtoms:e=>{let i=eL(t,"/organization/list",e,{method:"GET"});return{$listOrg:t,$activeOrgSignal:r,$activeMemberSignal:n,$activeMemberRoleSignal:o,activeOrganization:eL([r],"/organization/get-full-organization",e,()=>({method:"GET"})),listOrganizations:i,activeMember:eL([r,n],"/organization/get-active-member",e,{method:"GET"}),activeMemberRole:eL([r,o],"/organization/get-active-member-role",e,{method:"GET"})}},pathMethods:{"/organization/get-full-organization":"GET","/organization/list-user-teams":"GET"},atomListeners:[{matcher:e=>"/organization/create"===e||"/organization/delete"===e||"/organization/update"===e,signal:"$listOrg"},{matcher:e=>"/sign-out"===e||e.startsWith("/organization"),signal:"$activeOrgSignal"},{matcher:e=>e.startsWith("/organization/set-active")||"/organization/create"===e||"/organization/delete"===e||"/organization/remove-member"===e||"/organization/leave"===e||"/organization/accept-invitation"===e,signal:"$sessionSignal"},{matcher:e=>e.includes("/organization/update-member-role")||e.startsWith("/organization/set-active"),signal:"$activeMemberSignal"},{matcher:e=>e.includes("/organization/update-member-role")||e.startsWith("/organization/set-active"),signal:"$activeMemberRoleSignal"}],$ERROR_CODES:eM}),{id:"api-key",version:"1.7.3",$InferServerPlugin:{},pathMethods:{"/api-key/create":"POST","/api-key/delete":"POST","/api-key/delete-all-expired-api-keys":"POST"},$ERROR_CODES:eY}]}),{useSession:eB,signIn:eH,signUp:eV,signOut:ej,organization:eG,apiKey:ez}=eF;e.s(["authClient",0,eF],9860)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9860,e=>{"use strict";let t,r,n,o,i;var a,s,l=e.i(14663);let u=Object.create(null),c=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?u:globalThis),E=new Proxy(u,{get:(e,t)=>c()[t]??u[t],has:(e,t)=>t in c()||t in u,set:(e,t,r)=>(c(!0)[t]=r,!0),deleteProperty(e,t){if(!t)return!1;let r=c(!0);return delete r[t],!0},ownKeys:()=>Object.keys(c(!0))});function d(e,t){return void 0!==l.default&&l.default.env?l.default.env[e]??t:"u">typeof Deno?Deno.env.get(e)??t:"u">typeof Bun?Bun.env[e]??t:t}function _(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}E.NODE_ENV,Object.freeze({get BETTER_AUTH_SECRET(){return d("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return d("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return d("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return d("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return d("NODE_ENV","development")},get PACKAGE_VERSION(){return d("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return d("BETTER_AUTH_TELEMETRY_ENDPOINT","")}}),_({USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",INVALID_USER:"Invalid user",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",TOKEN_EXPIRED:"Token expired",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CHANGE_EMAIL_DISABLED:"Change email is disabled",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account.",CROSS_SITE_NAVIGATION_LOGIN_BLOCKED:"Cross-site navigation login blocked. This request appears to be a CSRF attack.",VERIFICATION_EMAIL_NOT_ENABLED:"Verification email isn't enabled",EMAIL_ALREADY_VERIFIED:"Email is already verified",EMAIL_MISMATCH:"Email mismatch",SESSION_NOT_FRESH:"Session is not fresh",LINKED_ACCOUNT_ALREADY_EXISTS:"Linked account already exists",INVALID_ORIGIN:"Invalid origin",INVALID_CALLBACK_URL:"Invalid callbackURL",INVALID_REDIRECT_URL:"Invalid redirectURL",INVALID_ERROR_CALLBACK_URL:"Invalid errorCallbackURL",INVALID_NEW_USER_CALLBACK_URL:"Invalid newUserCallbackURL",MISSING_OR_NULL_ORIGIN:"Missing or null Origin",CALLBACK_URL_REQUIRED:"callbackURL is required",FAILED_TO_CREATE_VERIFICATION:"Unable to create verification",FIELD_NOT_ALLOWED:"Field not allowed to be set",ASYNC_VALIDATION_NOT_SUPPORTED:"Async validation is not supported",VALIDATION_ERROR:"Validation Error",MISSING_FIELD:"Field is required",METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED:"POST method requires deferSessionRefresh to be enabled in session config",BODY_MUST_BE_AN_OBJECT:"Body must be an object",PASSWORD_ALREADY_SET:"User already has a password set"});let f={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};var T=class extends Error{status;body;headers;statusCode;constructor(e="INTERNAL_SERVER_ERROR",t,r={},n="number"==typeof e?e:f[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=r,this.statusCode=n,this.name="APIError",this.status=e,this.headers=r,this.statusCode=n,this.body=t}};Symbol.for("better-call:api-error-headers"),a=T,s=Error,Object.defineProperty((class e extends a{#e;constructor(...e){if(function(){let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return void 0===e?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,"writable")?e.writable:void 0!==e.set}()){const t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);const t=Error().stack;t&&(this.#e=function(e){let t=e.split("\n at ");return t.length<=1?e:(t.splice(1,1),t.join("\n at "))}(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}).prototype,"constructor",{get:()=>s,enumerable:!1,configurable:!0});var O=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function p(e){let t=e.length;for(;t>0&&47===e.charCodeAt(t-1);)t--;return t===e.length?e:e.slice(0,t)}function A(e,t="/api/auth"){try{let t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new O(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){if(t instanceof O)throw t;throw new O(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}if(function(e){try{return"/"!==(p(new URL(e).pathname)||"/")}catch{throw new O(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let r=p(e);return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${r}${t}`):r}let h={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},R=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,I={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},N=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,g=["javascript:","data:","vbscript:"],m={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&function(e){let t;try{t=new URL(e)}catch{return!0}return!g.includes(t.protocol)}(e.data.url)&&"u">typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},v=(e,t,r,n)=>(e.events=e.events||{},e.events[r+10]||(e.events[r+10]=n(t=>{e.events[r].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[r]=e.events[r]||[],e.events[r].push(t),()=>{let n=e.events[r],o=n.indexOf(t);~o&&(n.splice(o,1),n.length||(e.events[r+10](),delete e.events[r+10]))}),L=(e,t)=>v(e,r=>{let n=t(r);n&&e.events[6].push(n)},5,t=>{let r=e.listen;e.listen=(...n)=>(e.lc||e.active||(e.active=!0,t()),r(...n));let n=e.off;return e.events[6]=[],e.off=()=>{n(),setTimeout(()=>{if(e.active&&!e.lc){for(let t of(e.active=!1,e.events[6]))t();e.events[6]=[]}},1e3)},()=>{e.listen=r,e.off=n}});function S(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function b(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!b(e[r],t[r]))return!1;return!0}if(S(e)&&S(t)){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!(n in t)||!b(e[n],t[n]))return!1;return!0}return!1}function y(e,t){return v(e,({newValue:r,abort:n})=>{t(e.value,r)&&n()},2,t=>{let r=e.set,n=e.setKey;return e.setKey&&(e.setKey=(r,o)=>{let i;if(t({abort:()=>{i=!0},changed:r,newValue:{...e.value,[r]:o}}),!i)return n(r,o)}),e.set=e=>{let n;if(t({abort:()=>{n=!0},newValue:e}),!n)return r(e)},()=>{e.set=r,e.setKey=n}})}let D=Symbol.for("better-auth:broadcast-channel");var U=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if("u">typeof window)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Math.floor(Date.now()/1e3)}))}catch{}}setup(){if("u"<typeof window||void 0===window.addEventListener)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??"{}");t?.event==="session"&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function w(e="better-auth.message"){return globalThis[D]||(globalThis[D]=new U(e)),globalThis[D]}let P=Symbol.for("better-auth:focus-manager");var C=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if("u"<typeof window||"u"<typeof document||void 0===window.addEventListener)return()=>{};let e=()=>{"visible"===document.visibilityState&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function M(){return globalThis[P]||(globalThis[P]=new C),globalThis[P]}let Y=Symbol.for("better-auth:online-manager");var F=class{listeners=new Set;isOnline="u"<typeof navigator||navigator.onLine;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if("u"<typeof window||void 0===window.addEventListener)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function B(){return globalThis[Y]||(globalThis[Y]=new F),globalThis[Y]}let H=()=>Math.floor(Date.now()/1e3),V=[],j=0,G=globalThis.nanostoresGlobal||={epoch:0},z=e=>{let t=[],r={eq:Object.is,get:()=>(r.lc||r.listen(()=>{})(),r.value),init:e,lc:0,listen:e=>(r.lc=t.push(e),()=>{for(let t=j;t<V.length;)V[t]===e?V.splice(t,4):t+=4;let n=t.indexOf(e);~n&&(t.splice(n,1),--r.lc||r.off())}),notify(e,n){G.epoch++;let o=!V.length;for(let o of t)V.push(o,r,e,n);o&&(()=>{let e,t;for(;j<V.length;){t=j,j+=4;try{V[t](V[t+1].value,V[t+2],V[t+3])}catch(t){e=t}}if(V.length=j=0,e)throw e})()},off(){},set(e){let t=r.value;r.eq(t,e)||(r.value=e,r.notify(t))},subscribe(e){let t=r.listen(e);return e(r.value),t},value:e};return r};function k(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function W(e,t){return b(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function x(e){if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.iterator in e)&&(!(Symbol.toStringTag in e)||"[object Module]"===Object.prototype.toString.call(e))}function q(e){return(...t)=>t.reduce((t,r)=>(function e(t,r,n=".",o){if(!x(r))return e(t,{},n,o);let i={...r};for(let r of Object.keys(t)){if("__proto__"===r||"constructor"===r)continue;let a=t[r];null!=a&&(o&&o(i,r,a,n)||(Array.isArray(a)&&Array.isArray(i[r])?i[r]=[...a,...i[r]]:x(a)&&x(i[r])?i[r]=e(a,i[r],(n?`${n}.`:"")+r.toString(),o):i[r]=a))}return i})(t,r,"",e),{})}let $=q();q((e,t,r)=>{if(void 0!==e[t]&&"function"==typeof r)return e[t]=r(e[t]),!0}),q((e,t,r)=>{if(Array.isArray(e[t])&&"function"==typeof r)return e[t]=r(e[t]),!0});var K=Object.defineProperty,Z=Object.defineProperties,X=Object.getOwnPropertyDescriptors,Q=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,et=(e,t,r)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,er=(e,t)=>{for(var r in t||(t={}))J.call(t,r)&&et(e,r,t[r]);if(Q)for(var r of Q(t))ee.call(t,r)&&et(e,r,t[r]);return e},en=(e,t)=>Z(e,X(t)),eo=class extends Error{constructor(e,t,r){super(t||e.toString(),{cause:r}),this.status=e,this.statusText=t,this.error=r,Error.captureStackTrace(this,this.constructor)}},ei=async(e,t)=>{var r,n,o,i,a,s;let l=t||{},u={onRequest:[null==t?void 0:t.onRequest],onResponse:[null==t?void 0:t.onResponse],onSuccess:[null==t?void 0:t.onSuccess],onError:[null==t?void 0:t.onError],onRetry:[null==t?void 0:t.onRetry]};if(!t||!(null==t?void 0:t.plugins))return{url:e,options:l,hooks:u};for(let c of(null==t?void 0:t.plugins)||[]){if(c.init){let n=await (null==(r=c.init)?void 0:r.call(c,e.toString(),t));l=n.options||l,e=n.url}u.onRequest.push(null==(n=c.hooks)?void 0:n.onRequest),u.onResponse.push(null==(o=c.hooks)?void 0:o.onResponse),u.onSuccess.push(null==(i=c.hooks)?void 0:i.onSuccess),u.onError.push(null==(a=c.hooks)?void 0:a.onError),u.onRetry.push(null==(s=c.hooks)?void 0:s.onRetry)}return{url:e,options:l,hooks:u}},ea=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},es=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}},el=async e=>{let t={},r=async e=>"function"==typeof e?await e():e;if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let n=await r(e.auth.token);if(!n)return t;t.authorization=`Bearer ${n}`}else if("Basic"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.username),r(e.auth.password)]);if(!n||!o)return t;t.authorization=`Basic ${btoa(`${n}:${o}`)}`}else if("Custom"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.prefix),r(e.auth.value)]);if(!o)return t;t.authorization=`${null!=n?n:""} ${o}`}}return t},eu=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function ec(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}function eE(e){try{return JSON.parse(e)}catch(t){return e}}function ed(e){return"function"==typeof e}function e_(...e){let t={};for(let r of e)if(r)if(r instanceof Headers)r.forEach((e,r)=>{t[r]=e});else for(let[e,n]of Array.isArray(r)?r:Object.entries(r))null!=n&&(t[e]=n);return t}async function ef(e){let t=new Headers(e_(null==e?void 0:e.headers,await el(e)));if(!t.has("content-type")){let r=ec(null==e?void 0:e.body)?"application/json":null;r&&t.set("content-type",r)}return t}var eT=class e extends Error{constructor(t,r){super(r||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function eO(e,t){let r=await e["~standard"].validate(t);if(r.issues)throw new eT(r.issues);return r.value}var ep=["get","post","put","patch","delete"],eA=async(e,t)=>{var r,n,o,i,a,s,l,u;let c,{hooks:E,url:d,options:_}=await ei(e,t),f=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("u">typeof globalThis&&ed(globalThis.fetch))return globalThis.fetch;if("u">typeof window&&ed(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(_),T=new AbortController,O=null!=(r=_.signal)?r:T.signal,p=function(e,t){let{baseURL:r,params:n,query:o}=t||{query:{},params:{},baseURL:""},i=e.startsWith("http")?e.split("/").slice(0,3).join("/"):r||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];ep.includes(t)&&(e=e.replace(`@${t}/`,"/"))}i.endsWith("/")||(i+="/");let[a,s]=e.replace(i,"").split("?"),l=new URLSearchParams(s);for(let[e,t]of Object.entries(o||{})){let r;if(null!=t){if("string"==typeof t)r=t;else if(Array.isArray(t)){for(let r of t)l.append(e,r);continue}else r=JSON.stringify(t);l.set(e,r)}}let u=new Map;if(n)if(Array.isArray(n))for(let[e,t]of a.split("/").filter(e=>e.startsWith(":")).entries()){let r=n[e];u.set(t,String(r))}else for(let[e,t]of Object.entries(n))u.set(`:${e}`,String(t));a=(a=a.split("/").map(e=>(function(e,t){let r,n=e;for(let[e,r]of t)n=n.replace(e,r);if("."===(r=n)||".."===r)throw TypeError("Path parameters cannot be reserved path segments");return encodeURIComponent(n)})(e,u)).join("/")).replace(/^\/+/,"");let c=l.toString();return(c=c.length>0?`?${c}`.replace(/\+/g,"%20"):"",i.startsWith("http"))?new URL(`${a}${c}`,i):`${i}${a}${c}`}(d,_),A=await ef(_),h=function(e,t){let r,{body:n}=e;return n?ec(n)&&"string"!=typeof n?"application/x-www-form-urlencoded"===((r=t.get("content-type"))?r.split(";")[0].trim().toLowerCase():null)?new URLSearchParams(n).toString():JSON.stringify(n):n:null}(_,A),R=function(e,t){var r;if(null==t?void 0:t.method)return t.method.toUpperCase();if(e.startsWith("@")){let n=null==(r=e.split("@")[1])?void 0:r.split("/")[0];return ep.includes(n)?n.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(d,_),I=en(er({},_),{url:p,headers:A,body:h,method:R,signal:O});for(let e of E.onRequest)if(e){let t=await e(I);"object"==typeof t&&null!==t&&Object.assign(I,t)}("pipeTo"in I&&"function"==typeof I.pipeTo||"function"==typeof(null==(n=null==t?void 0:t.body)?void 0:n.pipe))&&!("duplex"in I)&&(I.duplex="half");let{clearTimeout:N}=(!(null==_?void 0:_.signal)&&(null==_?void 0:_.timeout)&&(c=setTimeout(()=>null==T?void 0:T.abort(),null==_?void 0:_.timeout)),{abortTimeout:c,clearTimeout:()=>{c&&clearTimeout(c)}}),g=await f(I.url,I);N();let m={response:g,request:I};for(let e of E.onResponse)if(e){let r=await e(en(er({},m),{response:(null==(o=null==t?void 0:t.hookOptions)?void 0:o.cloneResponse)?g.clone():g}));r instanceof Response?g=r:"object"==typeof r&&null!==r&&(g=r.response)}if(g.ok){if("HEAD"===I.method)return{data:"",error:null};let e=function(e){let t=e.headers.get("content-type"),r=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";let n=t.split(";").shift()||"";return eu.test(n)?"json":r.has(n)||n.startsWith("text/")?"text":"blob"}(g),r={data:null,response:g,request:I};if("json"===e||"text"===e){let e=await g.text(),t=null!=(i=I.jsonParser)?i:eE;r.data=await t(e)}else r.data=await g[e]();for(let e of((null==I?void 0:I.output)&&I.output&&!I.disableValidation&&(r.data=await eO(I.output,r.data)),E.onSuccess))e&&await e(en(er({},r),{response:(null==(a=null==t?void 0:t.hookOptions)?void 0:a.cloneResponse)?g.clone():g}));return(null==t?void 0:t.throw)?r.data:{data:r.data,error:null}}let v=null!=(s=null==t?void 0:t.jsonParser)?s:eE,L=await g.text(),S=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(L),b=S?await v(L):null,y={response:g,responseText:L,request:I,error:en(er({},b),{status:g.status,statusText:g.statusText})};for(let e of E.onError)e&&await e(en(er({},y),{response:(null==(l=null==t?void 0:t.hookOptions)?void 0:l.cloneResponse)?g.clone():g}));if(null==t?void 0:t.retry){let r=function(e){if("number"==typeof e)return new ea({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new ea(e);case"exponential":return new es(e);default:throw Error("Invalid retry strategy")}}(t.retry),n=null!=(u=t.retryAttempt)?u:0;if(await r.shouldAttemptRetry(n,g)){for(let e of E.onRetry)e&&await e(m);let o=r.getDelay(n);return await new Promise(e=>setTimeout(e,o)),await eA(e,en(er({},t),{retryAttempt:n+1}))}}if(null==t?void 0:t.throw)throw new eo(g.status,g.statusText,S?b:L);return{data:null,error:en(er({},b),{status:g.status,statusText:g.statusText})}};let eh=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,eR=/['\u2019]/g;function eI(e){return(e.replace(eR,"").match(eh)??[]).map(e=>e.toLowerCase()).join("-")}function eN(e,t){let r=t.split(".").flatMap(e=>(function e(t){if(eg.test(t)){let[,r,n]=t.match(eg);return[...e(r),n]}return[t]})(e)),n=e;for(let e of r){if(null==n)return;n=n[e]}return n}let eg=/(.*)\[(\d+)\]/;var em=e.i(99975);function ev(e,t){return b(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}let eL=(e,t,r,n)=>{let o=z({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>i(e)});L(o,()=>y(o,ev));let i=async e=>new Promise(i=>{let a="function"==typeof n?n({data:o.get().data,error:o.get().error,isPending:o.get().isPending}):n;r(t,{...a,query:{...a?.query,...e?.query},async onSuccess(e){let t=o.get(),r=null!=t.data&&null!=e.data&&b(t.data,e.data)?t.data:e.data;o.set({data:r,error:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await a?.onSuccess?.(e)},async onError(e){let{request:t}=e,r="number"==typeof t.retry?t.retry:t.retry?.attempts,n=t.retryAttempt||0;if(r&&n<r)return;let i=401===e.error.status;o.set({error:e.error,data:i?null:o.get().data,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await a?.onError?.(e)},async onRequest(e){let t=o.get();o.set({isPending:null===t.data,data:t.data,error:null,isRefetching:!0,refetch:o.value.refetch}),await a?.onRequest?.(e)}}).catch(e=>{o.set({error:e,data:o.get().data,isPending:!1,isRefetching:!1,refetch:o.value.refetch})}).finally(()=>{i(void 0)})});e=Array.isArray(e)?e:[e];let a=!1,s=!1,l=!1,u=()=>{if(a){l=!0;return}a=!0,i().finally(()=>{a=!1;let e=l&&s;l=!1,e&&u()})};return L(o,()=>{let t;if("u"<typeof window)return;s=!0;let r=!1,n=e.map(e=>e.listen(()=>{r?i():(r=!0,clearTimeout(t),u())}));return t=setTimeout(()=>{r=!0,u()},0),()=>{for(let e of(s=!1,n))e();clearTimeout(t)}}),o};function eS(e){return"OR"===e?"OR":"AND"}function eb(e){return Array.isArray(e)}function ey(e,t){return"string"==typeof t&&e.includes(t)}let eD=e=>{var t;return{authorize(e,r="AND"){let n=!1;for(let[o,i]of Object.entries(e)){let e=t[o];if(!e){if("AND"===r)return{success:!1,error:`You are not allowed to access resource: ${o}`};continue}let a=function(e,{actions:t,connector:r}){return 0!==t.length&&("OR"===r?t.some(t=>ey(e,t)):t.every(t=>ey(e,t)))}(e,function(e){if(eb(e))return{actions:e,connector:"AND"};if(!e||"object"!=typeof e)throw new O("Invalid access control request");let{actions:t,connector:r}=e;return eb(t)?{actions:t,connector:eS(r)}:{actions:[],connector:eS(r)}}(i));if(a&&(n=!0),a&&"OR"===r)return{success:!0};if(!a&&"AND"===r)return{success:!1,error:`unauthorized to access resource "${o}"`}}return n?{success:!0}:{success:!1,error:"Not authorized"}},statements:t=e}},eU=eD({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),ew=eD({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),eP=eD({organization:[],member:[],invitation:[],team:[],ac:["read"]}),eC={admin:eU,owner:ew,member:eP},eM=_({YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_SLUG_ALREADY_TAKEN:"Organization slug already taken",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER:"You cannot leave the organization without an owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION:"Email verification required before accepting or rejecting invitation",EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION:"Email verification required to view or list invitations for the session email",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"You are not allowed to invite a user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached",USER_IS_NOT_A_MEMBER_OF_THE_TEAM:"User is not a member of the team",YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM:"You are not allowed to list the members of this team",YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM:"You do not have an active team",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER:"You are not allowed to create a new member",YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER:"You are not allowed to remove a team member",YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION:"You are not allowed to access this organization as an owner",YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION:"You are not a member of this organization",MISSING_AC_INSTANCE:"Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information",YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE:"You must be in an organization to create a role",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE:"You are not allowed to create a role",YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE:"You are not allowed to update a role",YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE:"You are not allowed to delete a role",YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE:"You are not allowed to read a role",YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE:"You are not allowed to list a role",YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE:"You are not allowed to get a role",TOO_MANY_ROLES:"This organization has too many roles",INVALID_RESOURCE:"The provided permission includes an invalid resource",ROLE_NAME_IS_ALREADY_TAKEN:"That role name is already taken",CANNOT_DELETE_A_PRE_DEFINED_ROLE:"Cannot delete a pre-defined role",ROLE_IS_ASSIGNED_TO_MEMBERS:"Cannot delete a role that is assigned to members. Please reassign the members to a different role first",INVALID_TEAM_ID:"Team id contains a reserved character"}),eY=Object.fromEntries(Object.entries({INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_REFERENCE_ID_FROM_API_KEY:"The reference id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only.",FAILED_TO_UPDATE_API_KEY:"Failed to update API key",NAME_REQUIRED:"API Key name is required.",ORGANIZATION_ID_REQUIRED:"Organization ID is required for organization-owned API keys.",USER_NOT_MEMBER_OF_ORGANIZATION:"You are not a member of the organization that owns this API key.",INSUFFICIENT_API_KEY_PERMISSIONS:"You do not have permission to perform this action on organization API keys.",NO_DEFAULT_API_KEY_CONFIGURATION_FOUND:"No default api-key configuration found.",ORGANIZATION_PLUGIN_REQUIRED:"Organization plugin is required for organization-owned API keys. Please install and configure the organization plugin."}).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}])),eF=function(e){var t;let{pluginPathMethods:r,pluginsActions:n,pluginsAtoms:o,hydrateSession:i,$fetch:a,$store:s,atomListeners:u}=((e,t)=>{var r;let n,o,i,a,s,u,c,d,_,f="credentials"in Request.prototype,T=function(e,t,r,n,o){if(e)return A(e,t);if(!1!==n){let e=E.BETTER_AUTH_URL||E.NEXT_PUBLIC_BETTER_AUTH_URL||E.PUBLIC_BETTER_AUTH_URL||E.NUXT_PUBLIC_BETTER_AUTH_URL||E.NUXT_PUBLIC_AUTH_URL||("/"!==E.BASE_URL?E.BASE_URL:void 0);if(e)return A(e,t)}r?.headers.get("x-forwarded-host"),r?.headers.get("x-forwarded-proto");if(r){let e=function(e){try{let t=new URL(e);return"null"===t.origin?null:t.origin}catch{return null}}(r.url);if(!e)throw new O("Could not get origin from request. Please provide a valid base URL.");return A(e,t)}if("u">typeof window&&window.location)return A(window.location.origin,t)}(e?.baseURL,e?.basePath,void 0,void 0)??(e=>{if(void 0!==l.default){if(l.default.env.NEXT_PUBLIC_AUTH_URL)return l.default.env.NEXT_PUBLIC_AUTH_URL;if("u"<typeof window){if(l.default.env.NEXTAUTH_URL)try{return l.default.env.NEXTAUTH_URL}catch{}if(l.default.env.VERCEL_URL)try{let t=l.default.env.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${t}${l.default.env.VERCEL_URL}`).origin}${e??"/api/auth"}`}catch{}}}})(e?.basePath)??"/api/auth",p=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],g={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:v,onError:S,onRequest:D,onResponse:U,...P}=e?.fetchOptions||{},C=(r={baseURL:T,...f?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,t={strict:!0}){return function(e,t={}){let{strict:r=!1,warnings:n=!1,reviver:o,parseDates:i=!0}=t;if("string"!=typeof e)return e;let a=e.trim(),s=a.toLowerCase();if(s.length<=9&&s in I)return I[s];if(!R.test(a)){if(r)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(h).some(([e,t])=>{let r=t.test(a);return r&&n&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),r})&&r)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(e,t)=>{if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){n&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(i&&"string"==typeof t){let e=function(e){let t=N.exec(e);if(!t)return null;let[,r,n,o,i,a,s,l,u,c,E]=t,d=new Date(Date.UTC(parseInt(r,10),parseInt(n,10)-1,parseInt(o,10),parseInt(i,10),parseInt(a,10),parseInt(s,10),l?parseInt(l.padEnd(3,"0"),10):0));if(u){let e=(60*parseInt(c,10)+parseInt(E,10))*("+"===u?-1:1);d.setUTCMinutes(d.getUTCMinutes()+e)}return d instanceof Date&&!isNaN(d.getTime())?d:null}(t);if(e)return e}return o?o(e,t):t})}catch(t){if(r)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...P,plugins:[g,...P.plugins||[],...e?.disableDefaultFetchPlugins?[]:[m],...p]},async function(e,t){let n,o=en(er(er({},r),t),{headers:e_(null==r?void 0:r.headers,null==t?void 0:t.headers),plugins:[...(null==r?void 0:r.plugins)||[],(n=r||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var r,o,i,a;let s=(null==(o=null==(r=n.plugins)?void 0:r.find(t=>{var r;return null!=(r=t.schema)&&!!r.config&&(e.startsWith(t.schema.config.baseURL||"")||e.startsWith(t.schema.config.prefix||""))}))?void 0:o.schema)||n.schema;if(s){let r=e;(null==(i=s.config)?void 0:i.prefix)&&r.startsWith(s.config.prefix)&&(r=r.replace(s.config.prefix,""),s.config.baseURL&&(e=e.replace(s.config.prefix,s.config.baseURL))),(null==(a=s.config)?void 0:a.baseURL)&&r.startsWith(s.config.baseURL)&&(r=r.replace(s.config.baseURL,"")),r.startsWith("/")&&"@"===r.charAt(1)&&(r=r.substring(1));let n=s.schema[r];if(n){let r=null==t?void 0:t.headers;if(n.headers&&!(null==t?void 0:t.disableValidation)){let e={};if(null==t?void 0:t.headers){if(t.headers instanceof Headers)t.headers.forEach((t,r)=>{e[r.toLowerCase()]=t});else if("object"==typeof t.headers)for(let[r,n]of Object.entries(t.headers))null!=n&&(e[r.toLowerCase()]=n)}let o=await eO(n.headers,e),i={};for(let[e,t]of Object.entries(o))i[e.toLowerCase()]=t;r=i}let o=en(er({},t),{method:n.method,output:n.output,headers:r});return(null==t?void 0:t.disableValidation)||(o=en(er({},o),{body:n.input?await eO(n.input,null==t?void 0:t.body):null==t?void 0:t.body,params:n.params?await eO(n.params,null==t?void 0:t.params):null==t?void 0:t.params,query:n.query?await eO(n.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:o}}}return{url:e,options:t}}}),...(null==t?void 0:t.plugins)||[]]});if(null==r?void 0:r.catchAllError)try{return await eA(e,o)}catch(e){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:e}}}return await eA(e,o)}),{$sessionSignal:Y,session:F,broadcastSessionUpdate:V}=(o=z(!1),i=0,a=0,o.listen(()=>{a++,i=0}),y(u=z({data:null,error:null,isPending:!0,isRefetching:!1,refetch:s=e=>d(e)}),W),c=async(e,t)=>{let r=u.value;if(u.set({...r,isPending:null===r.data,isRefetching:!0,error:null,refetch:s}),e.aborted)return"aborted";try{var n;let r=await C("/get-session",{method:"GET",query:t?.query,signal:e});if(e.aborted)return"aborted";let{data:o,error:i}=k(r),a="fresh";if(o?.needsRefresh)try{let t=await C("/get-session",{method:"POST",signal:e});if(e.aborted)return"aborted";({data:o,error:i}=k(t))}catch{if(e.aborted)return"aborted";a="stale"}if(i){let e=u.value,t=i?.status===401;return u.set({data:t?null:e.data,error:i,isPending:!1,isRefetching:!1,refetch:s}),"failed"}let l=(n=o)&&(null!==n.session||null!==n.user)?n:null,c=u.value,E=null!=c.data&&null!=l&&b(c.data,l)?c.data:l;return u.set({data:E,error:null,isPending:!1,isRefetching:!1,refetch:s}),a}catch(r){if(e.aborted)return"aborted";let t=u.value;return u.set({data:t.data,error:r,isPending:!1,isRefetching:!1,refetch:s}),"failed"}},d=e=>{i=0,n?.cancel();let t=new AbortController,r={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?"aborted":c(t.signal,e)),revision:a};n=r;let o=e=>{if(n===r){let t,o;n=void 0,"fresh"===e&&r.revision===a&&(o=(t=u.value.data?.session?.expiresAt)instanceof Date?t.getTime():1/0,i=Math.min(Date.now()+1e3,o))}};return r.promise.then(o,()=>o("failed")),r.promise.then(()=>void 0)},_=()=>{},L(u,()=>{let t;"u"<typeof window||(t=setTimeout(()=>{n?.revision===a?n.promise.then(()=>void 0):Date.now()<i?Promise.resolve():d()},0));let r=function(e){let{fetchSession:t,shouldPollSession:r=()=>!0,sessionSignal:n,options:o={}}=e,i=o.sessionOptions?.refetchInterval??0,a=o.sessionOptions?.refetchOnWindowFocus??!0,s=o.sessionOptions?.refetchWhenOffline??!1,l={isInitialized:!1,lastSessionRequest:0},u=e=>{if(s||B().isOnline){if(e?.event==="storage")return void t();if(e?.event==="poll"){l.lastSessionRequest=H(),t();return}if(e?.event==="visibilitychange"){if(H()-l.lastSessionRequest<5)return;l.lastSessionRequest=H(),t();return}t()}};return{init:()=>{l.isInitialized||(l.isInitialized=!0,i&&i>0&&(l.pollInterval=setInterval(()=>{r()&&u({event:"poll"})},1e3*i)),l.unsubscribeBroadcast=w().subscribe(()=>{u({event:"storage"})}),a&&(l.unsubscribeFocus=M().subscribe(()=>{u({event:"visibilitychange"})})),l.unsubscribeOnline=B().subscribe(e=>{e&&u({event:"visibilitychange"})}),l.unsubscribeSignal=n.listen(()=>{t()}),l.cleanupBroadcastSetup=w().setup(),l.cleanupFocusSetup=M().setup(),l.cleanupOnlineSetup=B().setup())},cleanup:()=>{l.isInitialized&&(l.pollInterval&&(clearInterval(l.pollInterval),l.pollInterval=void 0),l.unsubscribeBroadcast&&(l.unsubscribeBroadcast(),l.unsubscribeBroadcast=void 0),l.unsubscribeFocus&&(l.unsubscribeFocus(),l.unsubscribeFocus=void 0),l.unsubscribeOnline&&(l.unsubscribeOnline(),l.unsubscribeOnline=void 0),l.unsubscribeSignal&&(l.unsubscribeSignal(),l.unsubscribeSignal=void 0),l.cleanupBroadcastSetup&&(l.cleanupBroadcastSetup(),l.cleanupBroadcastSetup=void 0),l.cleanupFocusSetup&&(l.cleanupFocusSetup(),l.cleanupFocusSetup=void 0),l.cleanupOnlineSetup&&(l.cleanupOnlineSetup(),l.cleanupOnlineSetup=void 0),l.isInitialized=!1,l.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:e=>{w().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}({fetchSession:d,shouldPollSession:()=>null!=u.value.data,sessionSignal:o,options:e});return r.init(),_=r.broadcastSessionUpdate,()=>{t&&clearTimeout(t),r.cleanup()}}),{session:u,$sessionSignal:o,broadcastSessionUpdate:e=>_(e)}),j=!1,G=e?.plugins||[],x={},q={$sessionSignal:Y,session:F},K={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},Z=[{signal:"$sessionSignal",matcher:e=>"/sign-out"===e||"/update-user"===e||"/update-session"===e||"/sign-up/email"===e||"/sign-in/email"===e||"/delete-user"===e||"/verify-email"===e||"/revoke-sessions"===e||"/revoke-session"===e||"/revoke-other-sessions"===e||"/change-email"===e||"/change-password"===e,callback(e){"/sign-out"===e?V("signout"):("/update-user"===e||"/update-session"===e)&&V("updateUser")}}];for(let e of G)e.getAtoms&&Object.assign(q,e.getAtoms?.(C)),e.pathMethods&&Object.assign(K,e.pathMethods),e.atomListeners&&Z.push(...e.atomListeners);let X={notify:e=>{q[e].set(!q[e].get())},listen:(e,t)=>{q[e].subscribe(t)},atoms:q};for(let t of G)t.getActions&&(x=$(t.getActions?.(C,X,e)??{},x));return{get baseURL(){return T},pluginsActions:x,pluginsAtoms:q,pluginPathMethods:K,atomListeners:Z,hydrateSession:e=>{j||null===e||(j=!0,function(e,t){if("u"<typeof window)return;let r=e.get();null===r.data&&null!==t&&e.set({...r,data:t,error:null,isPending:!1})}(F,e))},$sessionSignal:Y,$fetch:C,$store:X}})(e),c={};for(let[e,t]of Object.entries(o))c[function(e){return`use${e.charAt(0).toUpperCase()+e.slice(1)}`}(e)]=()=>(function(e,t={}){let r=(0,em.useRef)(e.get()),{keys:n,deps:o=[e,n]}=t,i=(0,em.useCallback)(t=>{let o=e=>{r.current!==e&&(r.current=e,t())};if(o(e.value),n?.length){let t;return t=new Set(n),e.listen((e,r,i)=>{(void 0===i?n.some(t=>void 0===r||e[t]!==r[t]||eN(e,t)!==eN(r,t)):t.has(i)||t.has(i.split(/\.|\[/)[0]))&&o(e,r,i)})}return e.listen(o)},o),a=()=>r.current;return(0,em.useSyncExternalStore)(i,a,a)})(t);return t={...n,...c,hydrateSession:i,$fetch:a,$store:s},function e(n=[]){return new Proxy(function(){},{get(r,o){var i;if("string"!=typeof o||"then"===o||"catch"===o||"finally"===o)return;let a=[...n,o],s=t;for(let e of a)if(s&&"object"==typeof s&&e in s)s=s[e];else{s=void 0;break}return"function"==typeof s?s:"object"==typeof(i=s)&&null!==i&&"get"in i&&"function"==typeof i.get&&"lc"in i&&"number"==typeof i.lc?s:e(a)},apply:async(e,t,i)=>{let s="/"+n.map(eI).join("/"),l=i[0]||{},c=i[1]||{},{query:E,fetchOptions:d,..._}=l,f={...c,...d},T=function(e,t,r){let n=t[e],{fetchOptions:o,query:i,...a}=r||{};return n||(o?.method?o.method:a&&Object.keys(a).length>0?"POST":"GET")}(s,r,l);return await a(s,{...f,body:"GET"===T?void 0:{..._,...f?.body||{}},query:E||f?.query,method:T,async onSuccess(e){if(await f?.onSuccess?.(e),!u||f.disableSignal)return;let t=u.filter(e=>e.matcher(s));if(!t.length)return;let r=new Set;for(let e of t){let t=o[e.signal];if(!t)return;if(r.has(e.signal))continue;r.add(e.signal);let n=t.get();setTimeout(()=>{t.set(!n)},10),e.callback?.(s)}}})}})}()}({baseURL:(0,e.i(76482).apiUrl)(),plugins:[(t=z(!1),r=z(!1),n=z(!1),o=z(!1),i={admin:eU,member:eP,owner:ew,...void 0},{id:"organization",version:"1.7.3",$InferServerPlugin:{},getActions:(e,t,r)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:e=>{let t;return((e,t)=>{if(!e.permissions)return!1;let r=e.role.split(","),n=e.options.creatorRole||"owner",o=r.includes(n),i=e.allowCreatorAllPermissions||!1;if(o&&i)return!0;for(let n of r)if(t[n]?.authorize(e.permissions)?.success)return!0;return!1})(t={role:e.role,options:{ac:void 0,roles:i},permissions:e.permissions},t.options.roles||eC)}}}),getAtoms:e=>{let i=eL(t,"/organization/list",e,{method:"GET"});return{$listOrg:t,$activeOrgSignal:r,$activeMemberSignal:n,$activeMemberRoleSignal:o,activeOrganization:eL([r],"/organization/get-full-organization",e,()=>({method:"GET"})),listOrganizations:i,activeMember:eL([r,n],"/organization/get-active-member",e,{method:"GET"}),activeMemberRole:eL([r,o],"/organization/get-active-member-role",e,{method:"GET"})}},pathMethods:{"/organization/get-full-organization":"GET","/organization/list-user-teams":"GET"},atomListeners:[{matcher:e=>"/organization/create"===e||"/organization/delete"===e||"/organization/update"===e,signal:"$listOrg"},{matcher:e=>"/sign-out"===e||e.startsWith("/organization"),signal:"$activeOrgSignal"},{matcher:e=>e.startsWith("/organization/set-active")||"/organization/create"===e||"/organization/delete"===e||"/organization/remove-member"===e||"/organization/leave"===e||"/organization/accept-invitation"===e,signal:"$sessionSignal"},{matcher:e=>e.includes("/organization/update-member-role")||e.startsWith("/organization/set-active"),signal:"$activeMemberSignal"},{matcher:e=>e.includes("/organization/update-member-role")||e.startsWith("/organization/set-active"),signal:"$activeMemberRoleSignal"}],$ERROR_CODES:eM}),{id:"api-key",version:"1.7.3",$InferServerPlugin:{},pathMethods:{"/api-key/create":"POST","/api-key/delete":"POST","/api-key/delete-all-expired-api-keys":"POST"},$ERROR_CODES:eY}]}),{useSession:eB,signIn:eH,signUp:eV,signOut:ej,organization:eG,apiKey:ez}=eF;e.s(["authClient",0,eF],9860)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36144,e=>{"use strict";var t=e.i(78234),a=e.i(33178);function n({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,a.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...n})}function s({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...n})}function r({className:e,...n}){return(0,t.jsx)("h3",{"data-slot":"card-title",className:(0,a.cn)("leading-none font-semibold",e),...n})}function o({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,a.cn)("text-muted-foreground text-sm",e),...n})}function l({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-6",e),...n})}e.s(["Card",()=>n,"CardContent",()=>l,"CardDescription",()=>o,"CardHeader",()=>s,"CardTitle",()=>r])},85858,e=>{"use strict";var t=e.i(78234),a=e.i(99975),n=e.i(81137),s=Object.defineProperty,r=a.forwardRef(s(function(e,a){return(0,t.jsx)(n.Primitive.label,{...e,ref:a,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0})),o=e.i(33178);function l({className:e,...a}){return(0,t.jsx)(r,{"data-slot":"label",className:(0,o.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}e.s(["Label",()=>l],85858)},55760,e=>{"use strict";var t=e.i(78234),a=e.i(33178);function n({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,t.jsx)("table",{"data-slot":"table",className:(0,a.cn)("w-full caption-bottom text-sm",e),...n})})}function s({className:e,...n}){return(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,a.cn)("[&_tr]:border-b",e),...n})}function r({className:e,...n}){return(0,t.jsx)("tbody",{"data-slot":"table-body",className:(0,a.cn)("[&_tr:last-child]:border-0",e),...n})}function o({className:e,...n}){return(0,t.jsx)("tr",{"data-slot":"table-row",className:(0,a.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...n})}function l({className:e,...n}){return(0,t.jsx)("th",{"data-slot":"table-head",className:(0,a.cn)("text-muted-foreground h-10 px-3 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}function i({className:e,...n}){return(0,t.jsx)("td",{"data-slot":"table-cell",className:(0,a.cn)("p-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}e.s(["Table",()=>n,"TableBody",()=>r,"TableCell",()=>i,"TableHead",()=>l,"TableHeader",()=>s,"TableRow",()=>o])},3161,78309,e=>{"use strict";var t=e.i(99975),a=e.i(76482);class n extends Error{status;constructor(e,t){super(e),this.status=t,this.name="ApiError"}}async function s(e,t){let s=await fetch(`${(0,a.apiUrl)()}/api${e}`,{...t,credentials:"include",headers:{"content-type":"application/json",...t?.headers}});if(!s.ok){let e=await s.json().catch(()=>null);throw new n(e?.message??`Request failed with status ${s.status}`,s.status)}if(204!==s.status)return s.json()}function r(){return s("/integrations")}function o(e){return s(`/integrations/${e}`)}function l(){return s("/configurations")}function i(e){return s(`/configurations/${e}`)}function c(e){return s("/configurations",{method:"POST",body:JSON.stringify(e)})}function d(e,t){return s(`/configurations/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function u(e){return s(`/configurations/${e}`,{method:"DELETE"})}function x(e){let t=e?.endUserExternalId?`?endUserExternalId=${encodeURIComponent(e.endUserExternalId)}`:"";return s(`/connections${t}`)}function f(e){return s(`/connections/${e}`,{method:"DELETE"})}function g(e){return s("/connect/sessions/test",{method:"POST",body:JSON.stringify({configurationId:e})})}function m(e,a=[]){let[s,r]=(0,t.useState)(null),[o,l]=(0,t.useState)(!0),[i,c]=(0,t.useState)(null),d=(0,t.useCallback)(()=>{l(!0),c(null),e().then(r).catch(e=>c(e instanceof n?e.message:"Something went wrong")).finally(()=>l(!1))},a);return(0,t.useEffect)(()=>{d()},[d]),{data:s,loading:o,error:i,reload:d}}e.s(["ApiError",()=>n,"createConfiguration",()=>c,"createTestConnectSession",()=>g,"deleteConfiguration",()=>u,"getConfiguration",()=>i,"getIntegration",()=>o,"listConfigurations",()=>l,"listConnections",()=>x,"listIntegrations",()=>r,"revokeConnection",()=>f,"updateConfiguration",()=>d],78309),e.s(["useApiResource",()=>m],3161)},87016,e=>{"use strict";var t=e.i(78234),a=e.i(99975),n=e.i(64503),s=e.i(76173),r=e.i(31261),o=e.i(43836),l=Object.defineProperty,i=(e,t)=>l(e,"name",{value:t,configurable:!0}),[c,d]=(0,n.createContextScope)("AlertDialog",[r.createDialogScope]),u=(0,r.createDialogScope)(),x=i(e=>{let{__scopeAlertDialog:a,...n}=e,s=u(a);return(0,t.jsx)(r.Root,{...s,...n,modal:!0})},"AlertDialog"),f=a.forwardRef(i(function(e,a){let{__scopeAlertDialog:n,...s}=e,o=u(n);return(0,t.jsx)(r.Trigger,{...o,...s,ref:a})},"AlertDialogTrigger")),g=i(e=>{let{__scopeAlertDialog:a,...n}=e,s=u(a);return(0,t.jsx)(r.Portal,{...s,...n})},"AlertDialogPortal"),m=a.forwardRef(i(function(e,a){let{__scopeAlertDialog:n,...s}=e,o=u(n);return(0,t.jsx)(r.Overlay,{...o,...s,ref:a})},"AlertDialogOverlay")),[h,p]=c("AlertDialogContent"),j=a.forwardRef(i(function(e,n){let{__scopeAlertDialog:l,children:i,...c}=e,d=u(l),x=a.useRef(null),f=(0,s.useComposedRefs)(n,x),g=a.useRef(null);return(0,t.jsx)(h,{scope:l,cancelRef:g,children:(0,t.jsx)(r.Content,{role:"alertdialog",...d,...c,ref:f,onOpenAutoFocus:(0,o.composeEventHandlers)(c.onOpenAutoFocus,e=>{e.preventDefault(),g.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:i})})},"AlertDialogContent")),b=a.forwardRef(i(function(e,a){let{__scopeAlertDialog:n,...s}=e,o=u(n);return(0,t.jsx)(r.Title,{...o,...s,ref:a})},"AlertDialogTitle")),y=a.forwardRef(i(function(e,a){let{__scopeAlertDialog:n,...s}=e,o=u(n);return(0,t.jsx)(r.Description,{...o,...s,ref:a})},"AlertDialogDescription")),C=a.forwardRef(i(function(e,a){let{__scopeAlertDialog:n,...s}=e,o=u(n);return(0,t.jsx)(r.Close,{...o,...s,ref:a})},"AlertDialogAction")),v=a.forwardRef(i(function(e,a){let{__scopeAlertDialog:n,...o}=e,{cancelRef:l}=p("AlertDialogCancel",n),i=u(n),c=(0,s.useComposedRefs)(a,l);return(0,t.jsx)(r.Close,{...i,...o,ref:c})},"AlertDialogCancel")),N=e.i(33178),w=e.i(81404);function k(e){return(0,t.jsx)(x,{"data-slot":"alert-dialog",...e})}function A(e){return(0,t.jsx)(f,{"data-slot":"alert-dialog-trigger",...e})}function D(e){return(0,t.jsx)(g,{"data-slot":"alert-dialog-portal",...e})}function T({className:e,...a}){return(0,t.jsx)(m,{"data-slot":"alert-dialog-overlay",className:(0,N.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...a})}function R({className:e,...a}){return(0,t.jsxs)(D,{children:[(0,t.jsx)(T,{}),(0,t.jsx)(j,{"data-slot":"alert-dialog-content",className:(0,N.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...a})]})}function P({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,N.cn)("flex flex-col gap-2 text-center sm:text-left",e),...a})}function S({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,N.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...a})}function z({className:e,...a}){return(0,t.jsx)(b,{"data-slot":"alert-dialog-title",className:(0,N.cn)("text-lg font-semibold",e),...a})}function I({className:e,...a}){return(0,t.jsx)(y,{"data-slot":"alert-dialog-description",className:(0,N.cn)("text-muted-foreground text-sm",e),...a})}function O({className:e,...a}){return(0,t.jsx)(C,{className:(0,N.cn)((0,w.buttonVariants)(),e),...a})}function E({className:e,...a}){return(0,t.jsx)(v,{className:(0,N.cn)((0,w.buttonVariants)({variant:"outline"}),e),...a})}e.s(["AlertDialog",()=>k,"AlertDialogAction",()=>O,"AlertDialogCancel",()=>E,"AlertDialogContent",()=>R,"AlertDialogDescription",()=>I,"AlertDialogFooter",()=>S,"AlertDialogHeader",()=>P,"AlertDialogTitle",()=>z,"AlertDialogTrigger",()=>A],87016)},91449,e=>{"use strict";var t=e.i(78234),a=e.i(99975),n=e.i(79081),s=e.i(48045);let r=(0,s.default)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),o=(0,s.default)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),l=(0,s.default)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var i=e.i(27940),c=e.i(33178);function d({value:e,mask:s=!1,className:d}){let[u,x]=(0,a.useState)(!1),[f,g]=(0,a.useState)(!s);async function m(){await navigator.clipboard.writeText(e),x(!0),i.toast.success("Copied to clipboard"),setTimeout(()=>x(!1),1500)}return(0,t.jsxs)("span",{className:(0,c.cn)("bg-muted/60 inline-flex max-w-full items-center gap-1 rounded-md border px-2 py-1 font-mono text-xs",d),children:[(0,t.jsx)("span",{className:"truncate",children:f?e:"•".repeat(Math.min(e.length,24))}),s&&(0,t.jsxs)("button",{type:"button",onClick:()=>g(e=>!e),className:"text-muted-foreground hover:text-foreground shrink-0",children:[f?(0,t.jsx)(l,{className:"size-3.5"}):(0,t.jsx)(o,{className:"size-3.5"}),(0,t.jsx)("span",{className:"sr-only",children:f?"Hide":"Reveal"})]}),(0,t.jsxs)("button",{type:"button",onClick:m,className:"text-muted-foreground hover:text-foreground shrink-0",children:[u?(0,t.jsx)(n.Check,{className:"size-3.5"}):(0,t.jsx)(r,{className:"size-3.5"}),(0,t.jsx)("span",{className:"sr-only",children:"Copy"})]})]})}e.s(["CodeChip",()=>d],91449)},89665,e=>{"use strict";var t=e.i(78234),a=e.i(99975),n=e.i(55390),s=e.i(69469),r=e.i(27940),o=e.i(9860),l=e.i(3161),i=e.i(87016),c=e.i(81404),d=e.i(36144),u=e.i(91449),x=e.i(31261),f=e.i(26167),g=e.i(33178);function m(e){return(0,t.jsx)(x.Root,{"data-slot":"dialog",...e})}function h(e){return(0,t.jsx)(x.Trigger,{"data-slot":"dialog-trigger",...e})}function p(e){return(0,t.jsx)(x.Portal,{"data-slot":"dialog-portal",...e})}function j({className:e,...a}){return(0,t.jsx)(x.Overlay,{"data-slot":"dialog-overlay",className:(0,g.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...a})}function b({className:e,children:a,showCloseButton:n=!0,...s}){return(0,t.jsxs)(p,{"data-slot":"dialog-portal",children:[(0,t.jsx)(j,{}),(0,t.jsxs)(x.Content,{"data-slot":"dialog-content",className:(0,g.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...s,children:[a,n&&(0,t.jsxs)(x.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,t.jsx)(f.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function y({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"dialog-header",className:(0,g.cn)("flex flex-col gap-2 text-center sm:text-left",e),...a})}function C({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"dialog-footer",className:(0,g.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...a})}function v({className:e,...a}){return(0,t.jsx)(x.Title,{"data-slot":"dialog-title",className:(0,g.cn)("text-lg leading-none font-semibold",e),...a})}function N({className:e,...a}){return(0,t.jsx)(x.Description,{"data-slot":"dialog-description",className:(0,g.cn)("text-muted-foreground text-sm",e),...a})}var w=e.i(43711),k=e.i(85858),A=e.i(77785),D=e.i(55760);function T(){let{data:e}=o.authClient.useActiveOrganization(),x=e?.id,{data:f,loading:g,error:p,reload:j}=(0,l.useApiResource)(async()=>{if(!x)return[];let{data:e,error:t}=await o.authClient.apiKey.list({query:{organizationId:x}});if(t)throw Error(t.message??"Could not load API keys");return e.apiKeys},[x]),[T,R]=(0,a.useState)(""),[P,S]=(0,a.useState)(!1),[z,I]=(0,a.useState)(null),[O,E]=(0,a.useState)(!1);async function H(){if(!x||!T.trim())return;S(!0);let{data:e,error:t}=await o.authClient.apiKey.create({name:T.trim(),organizationId:x});(S(!1),t)?r.toast.error(t.message??"Could not create API key"):(R(""),I(e.key),j())}async function $(e){let{error:t}=await o.authClient.apiKey.delete({keyId:e});t?r.toast.error(t.message??"Could not revoke API key"):(r.toast.success("API key revoked"),j())}return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"API keys"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Used by your backend to call Kosha's connect and proxy endpoints."})]}),(0,t.jsxs)(m,{open:O,onOpenChange:e=>{E(e),e||I(null)},children:[(0,t.jsx)(h,{asChild:!0,children:(0,t.jsxs)(c.Button,{children:[(0,t.jsx)(s.Plus,{}),"New API key"]})}),(0,t.jsx)(b,{children:z?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(y,{children:[(0,t.jsx)(v,{children:"API key created"}),(0,t.jsx)(N,{children:"Copy this key now — it won't be shown again."})]}),(0,t.jsx)(u.CodeChip,{value:z,className:"w-full"}),(0,t.jsx)(C,{children:(0,t.jsx)(c.Button,{onClick:()=>E(!1),children:"Done"})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(y,{children:[(0,t.jsx)(v,{children:"New API key"}),(0,t.jsx)(N,{children:'Name it after where it\'ll be used, e.g. "production backend".'})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(k.Label,{htmlFor:"api-key-name",children:"Name"}),(0,t.jsx)(w.Input,{id:"api-key-name",value:T,onChange:e=>R(e.target.value),placeholder:"Production backend"})]}),(0,t.jsx)(C,{children:(0,t.jsx)(c.Button,{onClick:H,disabled:P||!T.trim(),children:P?"Creating…":"Create"})})]})})]})]}),g&&(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(A.Skeleton,{className:"h-10 w-full"}),(0,t.jsx)(A.Skeleton,{className:"h-10 w-full"})]}),p&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:p}),!g&&!p&&f&&0===f.length&&(0,t.jsx)(d.Card,{children:(0,t.jsxs)(d.CardContent,{className:"flex flex-col items-center gap-3 py-12 text-center",children:[(0,t.jsx)(n.KeyRound,{className:"text-muted-foreground size-8"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"No API keys yet"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Create one so your backend can start connect sessions for your users."})]})]})}),!g&&!p&&f&&f.length>0&&(0,t.jsx)(d.Card,{className:"py-0",children:(0,t.jsxs)(D.Table,{children:[(0,t.jsx)(D.TableHeader,{children:(0,t.jsxs)(D.TableRow,{children:[(0,t.jsx)(D.TableHead,{children:"Name"}),(0,t.jsx)(D.TableHead,{children:"Key"}),(0,t.jsx)(D.TableHead,{children:"Created"}),(0,t.jsx)(D.TableHead,{className:"w-0"})]})}),(0,t.jsx)(D.TableBody,{children:f.map(e=>(0,t.jsxs)(D.TableRow,{children:[(0,t.jsx)(D.TableCell,{className:"font-medium",children:e.name??"Untitled"}),(0,t.jsxs)(D.TableCell,{className:"text-muted-foreground font-mono text-xs",children:[e.prefix,e.start,"…"]}),(0,t.jsx)(D.TableCell,{className:"text-muted-foreground text-sm",children:new Date(e.createdAt).toLocaleDateString()}),(0,t.jsx)(D.TableCell,{children:(0,t.jsxs)(i.AlertDialog,{children:[(0,t.jsx)(i.AlertDialogTrigger,{asChild:!0,children:(0,t.jsx)(c.Button,{variant:"ghost",size:"sm",className:"text-destructive",children:"Revoke"})}),(0,t.jsxs)(i.AlertDialogContent,{children:[(0,t.jsxs)(i.AlertDialogHeader,{children:[(0,t.jsx)(i.AlertDialogTitle,{children:"Revoke this API key?"}),(0,t.jsx)(i.AlertDialogDescription,{children:"Any backend using it will immediately lose access. This can't be undone."})]}),(0,t.jsxs)(i.AlertDialogFooter,{children:[(0,t.jsx)(i.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(i.AlertDialogAction,{onClick:()=>$(e.id),children:"Revoke"})]})]})]})})]},e.id))})]})})]})}e.s(["default",()=>T],89665)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36144,e=>{"use strict";var t=e.i(78234),n=e.i(33178);function r({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,n.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})}function s({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,n.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...r})}function o({className:e,...r}){return(0,t.jsx)("h3",{"data-slot":"card-title",className:(0,n.cn)("leading-none font-semibold",e),...r})}function i({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,n.cn)("text-muted-foreground text-sm",e),...r})}function a({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,n.cn)("px-6",e),...r})}e.s(["Card",()=>r,"CardContent",()=>a,"CardDescription",()=>i,"CardHeader",()=>s,"CardTitle",()=>o])},85858,e=>{"use strict";var t=e.i(78234),n=e.i(99975),r=e.i(81137),s=Object.defineProperty,o=n.forwardRef(s(function(e,n){return(0,t.jsx)(r.Primitive.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0})),i=e.i(33178);function a({className:e,...n}){return(0,t.jsx)(o,{"data-slot":"label",className:(0,i.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}e.s(["Label",()=>a],85858)},3161,78309,e=>{"use strict";var t=e.i(99975),n=e.i(76482);class r extends Error{status;constructor(e,t){super(e),this.status=t,this.name="ApiError"}}async function s(e,t){let s=await fetch(`${(0,n.apiUrl)()}/api${e}`,{...t,credentials:"include",headers:{"content-type":"application/json",...t?.headers}});if(!s.ok){let e=await s.json().catch(()=>null);throw new r(e?.message??`Request failed with status ${s.status}`,s.status)}if(204!==s.status)return s.json()}function o(){return s("/integrations")}function i(e){return s(`/integrations/${e}`)}function a(){return s("/configurations")}function l(e){return s(`/configurations/${e}`)}function c(e){return s("/configurations",{method:"POST",body:JSON.stringify(e)})}function d(e,t){return s(`/configurations/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function u(e){return s(`/configurations/${e}`,{method:"DELETE"})}function m(e){let t=e?.endUserExternalId?`?endUserExternalId=${encodeURIComponent(e.endUserExternalId)}`:"";return s(`/connections${t}`)}function f(e){return s(`/connections/${e}`,{method:"DELETE"})}function x(e){return s("/connect/sessions/test",{method:"POST",body:JSON.stringify({configurationId:e})})}function h(e,n=[]){let[s,o]=(0,t.useState)(null),[i,a]=(0,t.useState)(!0),[l,c]=(0,t.useState)(null),d=(0,t.useCallback)(()=>{a(!0),c(null),e().then(o).catch(e=>c(e instanceof r?e.message:"Something went wrong")).finally(()=>a(!1))},n);return(0,t.useEffect)(()=>{d()},[d]),{data:s,loading:i,error:l,reload:d}}e.s(["ApiError",()=>r,"createConfiguration",()=>c,"createTestConnectSession",()=>x,"deleteConfiguration",()=>u,"getConfiguration",()=>l,"getIntegration",()=>i,"listConfigurations",()=>a,"listConnections",()=>m,"listIntegrations",()=>o,"revokeConnection",()=>f,"updateConfiguration",()=>d],78309),e.s(["useApiResource",()=>h],3161)},50824,31403,e=>{"use strict";var t=e.i(78234),n=e.i(99975),r=e.i(76173),s=e.i(64503),o=e.i(43836),i=e.i(76440),a=e.i(72261),l=e.i(26747),c=e.i(81137),d=Object.defineProperty,u=(e,t)=>d(e,"name",{value:t,configurable:!0}),m="Checkbox",[f,x]=(0,s.createContextScope)(m),[h,p]=f(m);function g(e){let{__scopeCheckbox:r,checked:s,children:o,defaultChecked:a,disabled:l,form:c,name:d,onCheckedChange:u,required:f,value:x="on",internal_do_not_use_render:p}=e,[g,j]=(0,i.useControllableState)({prop:s,defaultProp:a??!1,onChange:u,caller:m}),[v,b]=n.useState(null),[y,w]=n.useState(null),N=n.useRef(!1),[S,E]=n.useReducer(e=>e+1,0),F=!v||!!c||!!v.closest("form"),I={checked:g,disabled:l,setChecked:j,control:v,setControl:b,name:d,form:c,value:x,hasConsumerStoppedPropagationRef:N,userInteractionCount:S,onUserInteraction:E,required:f,defaultChecked:!k(a)&&a,isFormControl:F,bubbleInput:y,setBubbleInput:w};return(0,t.jsx)(h,{scope:r,...I,children:C(p)?p(I):o})}u(g,"CheckboxProvider");var j=n.forwardRef(u(function({__scopeCheckbox:e,onKeyDown:s,onClick:i,...a},l){let{control:d,value:m,disabled:f,checked:x,required:h,setControl:g,setChecked:j,hasConsumerStoppedPropagationRef:v,onUserInteraction:b,isFormControl:y,bubbleInput:C}=p("CheckboxTrigger",e),N=(0,r.useComposedRefs)(l,g),S=n.useRef(x);return n.useEffect(()=>{let e=d?.form;if(e){let t=u(()=>j(S.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,j]),(0,t.jsx)(c.Primitive.button,{type:"button",role:"checkbox","aria-checked":k(x)?"mixed":x,"aria-required":h,"data-state":w(x),"data-disabled":f?"":void 0,disabled:f,value:m,...a,ref:N,onKeyDown:(0,o.composeEventHandlers)(s,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,o.composeEventHandlers)(i,e=>{b(),j(e=>!!k(e)||!e),C&&y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})},"CheckboxTrigger")),v=n.forwardRef(u(function(e,n){let{__scopeCheckbox:r,name:s,checked:o,defaultChecked:i,required:a,disabled:l,value:c,onCheckedChange:d,form:u,...m}=e;return(0,t.jsx)(g,{__scopeCheckbox:r,checked:o,defaultChecked:i,disabled:l,required:a,onCheckedChange:d,name:s,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j,{...m,ref:n,__scopeCheckbox:r}),e&&(0,t.jsx)(y,{__scopeCheckbox:r})]})})},"Checkbox")),b=n.forwardRef(u(function(e,n){let{__scopeCheckbox:r,forceMount:s,...o}=e,i=p("CheckboxIndicator",r);return(0,t.jsx)(l.Presence,{present:s||k(i.checked)||!0===i.checked,children:(0,t.jsx)(c.Primitive.span,{"data-state":w(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),y=n.forwardRef(u(function({__scopeCheckbox:e,onClick:s,...i},l){let{control:d,hasConsumerStoppedPropagationRef:u,userInteractionCount:m,checked:f,defaultChecked:x,required:h,disabled:g,name:j,value:v,form:b,bubbleInput:y,setBubbleInput:C}=p("CheckboxBubbleInput",e),w=(0,r.useComposedRefs)(l,C),N=(0,a.useSize)(d),S=n.useRef(!1),E=n.useRef(f),F=n.useRef(m);n.useEffect(()=>{if(!y)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=m!==F.current;F.current=m;let n=E.current!==f;E.current=f;let r=!(t&&u.current);if(n&&e){S.current=!t;let n=new Event("click",{bubbles:r});y.indeterminate=k(f),e.call(y,!k(f)&&f),y.dispatchEvent(n),S.current=!1}},[y,f,u,m]);let I=n.useRef(!k(f)&&f);return(0,t.jsx)(c.Primitive.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??I.current,required:h,disabled:g,name:j,value:v,form:b,...i,tabIndex:-1,ref:w,onClick:(0,o.composeEventHandlers)(s,e=>{S.current&&e.stopPropagation()}),style:{...i.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function C(e){return"function"==typeof e}function k(e){return"indeterminate"===e}function w(e){return k(e)?"indeterminate":e?"checked":"unchecked"}u(C,"isFunction"),u(k,"isIndeterminate"),u(w,"getState");var N=e.i(41796),S=e.i(33178);function E({className:e,...n}){return(0,t.jsx)(v,{"data-slot":"checkbox",className:(0,S.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:(0,t.jsx)(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,t.jsx)(N.CheckIcon,{className:"size-3.5"})})})}var F=e.i(43711),I=e.i(85858),R=e.i(10395);function D({fields:e,value:n,onChange:r}){return 0===e.length?null:(0,t.jsx)("div",{className:"flex flex-col gap-4",children:e.map(e=>{let s=`config-field-${e.key}`,o=n[e.key];return"boolean"===e.type?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(E,{id:s,checked:!0===o,onCheckedChange:t=>r(e.key,!0===t)}),(0,t.jsxs)(I.Label,{htmlFor:s,className:"font-normal",children:[e.label,e.required&&(0,t.jsx)("span",{className:"text-destructive",children:" *"})]})]},e.key):"select"===e.type?(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(I.Label,{htmlFor:s,children:[e.label,e.required&&(0,t.jsx)("span",{className:"text-destructive",children:" *"})]}),(0,t.jsxs)(R.Select,{value:"string"==typeof o?o:void 0,onValueChange:t=>r(e.key,t),children:[(0,t.jsx)(R.SelectTrigger,{id:s,className:"w-full",children:(0,t.jsx)(R.SelectValue,{placeholder:"Select…"})}),(0,t.jsx)(R.SelectContent,{children:(e.options??[]).map(e=>(0,t.jsx)(R.SelectItem,{value:e.value,children:e.label},e.value))})]}),e.help&&(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:e.help})]},e.key):(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(I.Label,{htmlFor:s,children:[e.label,e.required&&(0,t.jsx)("span",{className:"text-destructive",children:" *"})]}),(0,t.jsx)(F.Input,{id:s,type:"number"===e.type?"number":e.secret?"password":"text",value:"string"==typeof o||"number"==typeof o?o:"",onChange:t=>r(e.key,"number"===e.type?t.target.valueAsNumber:t.target.value)}),e.help&&(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:e.help})]},e.key)})})}e.s(["ConfigFieldsForm",()=>D],50824);var L=e.i(79081),P=e.i(6435),P=P,A=e.i(67022);function T({options:e,value:r,onChange:s,placeholder:o,className:i}){let[a,l]=(0,n.useState)(!1),[c,d]=(0,n.useState)(""),[u,m]=(0,n.useState)(0),f=(0,n.useRef)(null),x=(0,n.useRef)(null),h=e.filter(e=>e.toLowerCase().includes(c.toLowerCase()));function p(e){s(r.includes(e)?r.filter(t=>t!==e):[...r,e]),d("")}return(0,n.useEffect)(()=>{m(0)},[c,a]),(0,n.useEffect)(()=>{function e(e){f.current?.contains(e.target)||l(!1)}return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[]),(0,t.jsxs)("div",{ref:f,className:(0,S.cn)("relative",i),children:[(0,t.jsxs)("div",{className:"border-input focus-within:border-ring focus-within:ring-ring/50 flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border bg-transparent px-2 py-1.5 text-sm shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",onClick:()=>{l(!0),x.current?.focus()},children:[r.map(e=>(0,t.jsxs)(A.Badge,{variant:"secondary",className:"gap-1 font-mono",children:[e,(0,t.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),p(e)},className:"text-muted-foreground hover:text-foreground",children:[(0,t.jsx)(P.default,{className:"size-3"}),(0,t.jsxs)("span",{className:"sr-only",children:["Remove ",e]})]})]},e)),(0,t.jsx)("input",{ref:x,value:c,onChange:e=>d(e.target.value),onFocus:()=>l(!0),onKeyDown:function(e){if("Backspace"===e.key&&""===c&&r.length>0)return void s(r.slice(0,-1));if(!a&&("ArrowDown"===e.key||"Enter"===e.key))return void l(!0);if("ArrowDown"===e.key)e.preventDefault(),m(e=>Math.min(e+1,h.length-1));else if("ArrowUp"===e.key)e.preventDefault(),m(e=>Math.max(e-1,0));else if("Enter"===e.key){e.preventDefault();let t=h[u];t&&p(t)}else"Escape"===e.key&&l(!1)},placeholder:0===r.length?o:void 0,className:"text-foreground placeholder:text-muted-foreground min-w-24 flex-1 bg-transparent outline-none"})]}),a&&(0,t.jsxs)("div",{className:"bg-popover text-popover-foreground absolute z-50 mt-1 max-h-64 w-full overflow-auto rounded-md border p-1 shadow-md",children:[0===h.length&&(0,t.jsx)("p",{className:"text-muted-foreground px-2 py-1.5 text-sm",children:"No matches"}),h.map((e,n)=>{let s=r.includes(e);return(0,t.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),p(e)},onMouseEnter:()=>m(n),className:(0,S.cn)("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-left font-mono text-sm",n===u&&"bg-accent text-accent-foreground"),children:[e,s&&(0,t.jsx)(L.Check,{className:"size-4 shrink-0"})]},e)})]})]})}function z({scopesAvailable:e,value:n,onChange:r}){return 0===e.length?null:(0,t.jsx)(T,{options:e,value:n,onChange:r,placeholder:"Add scopes…"})}e.s(["ScopesPicker",()=>z],31403)},21894,e=>{"use strict";var t=e.i(78234),n=e.i(99975),r=e.i(59636),s=e.i(14315);let o=(0,e.i(48045).default)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);var i=e.i(68120),a=e.i(27940),l=e.i(32356),c=e.i(78309),d=e.i(3161),u=e.i(67022),m=e.i(81404),f=e.i(36144),x=e.i(50824),h=e.i(9018),p=e.i(43711),g=e.i(10395),j=e.i(31403),v=e.i(77785);let b=l.z.object({name:l.z.string().min(1,"Give this configuration a name"),environment:l.z.enum(["LIVE","SANDBOX"]),clientId:l.z.string().min(1,"Client ID is required"),clientSecret:l.z.string().min(1,"Client secret is required")});function y(){let e=(0,r.useRouter)(),{data:l,loading:y}=(0,d.useApiResource)(c.listIntegrations),[C,k]=(0,n.useState)(null),[w,N]=(0,n.useState)([]),[S,E]=(0,n.useState)({}),[F,I]=(0,n.useState)(!1),R=(0,i.useForm)({resolver:(0,s.zodResolver)(b),defaultValues:{name:"",environment:"LIVE",clientId:"",clientSecret:""}});async function D(t){if(C){I(!0);try{let n=await (0,c.createConfiguration)({provider:C.key,name:t.name,clientId:t.clientId,clientSecret:t.clientSecret,environment:t.environment,scopes:w,settings:S});a.toast.success(`Created "${n.name}"`),e.push(`/configurations/${n.id}`)}catch(e){R.setError("root",{message:e instanceof c.ApiError?e.message:"Could not create configuration"})}finally{I(!1)}}}return C?(0,t.jsxs)("div",{className:"flex max-w-2xl flex-col gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)(m.Button,{variant:"ghost",size:"sm",className:"-ml-2 mb-2",onClick:()=>k(null),children:[(0,t.jsx)(o,{}),"Choose a different provider"]}),(0,t.jsxs)("h1",{className:"text-xl font-semibold tracking-tight",children:["New ",C.name," configuration"]})]}),(0,t.jsx)(f.Card,{children:(0,t.jsx)(f.CardContent,{className:"pt-6",children:(0,t.jsx)(h.Form,{...R,children:(0,t.jsxs)("form",{onSubmit:R.handleSubmit(D),className:"flex flex-col gap-4",children:[(0,t.jsx)(h.FormField,{control:R.control,name:"name",render:({field:e})=>(0,t.jsxs)(h.FormItem,{children:[(0,t.jsx)(h.FormLabel,{children:"Name"}),(0,t.jsx)(h.FormControl,{children:(0,t.jsx)(p.Input,{placeholder:`${C.name} production`,...e})}),(0,t.jsx)(h.FormMessage,{})]})}),(0,t.jsx)(h.FormField,{control:R.control,name:"environment",render:({field:e})=>(0,t.jsxs)(h.FormItem,{children:[(0,t.jsx)(h.FormLabel,{children:"Environment"}),(0,t.jsxs)(g.Select,{value:e.value,onValueChange:e.onChange,children:[(0,t.jsx)(h.FormControl,{children:(0,t.jsx)(g.SelectTrigger,{className:"w-full",children:(0,t.jsx)(g.SelectValue,{})})}),(0,t.jsxs)(g.SelectContent,{children:[(0,t.jsx)(g.SelectItem,{value:"LIVE",children:"Live"}),(0,t.jsx)(g.SelectItem,{value:"SANDBOX",children:"Sandbox"})]})]}),(0,t.jsx)(h.FormMessage,{})]})}),(0,t.jsx)(h.FormField,{control:R.control,name:"clientId",render:({field:e})=>(0,t.jsxs)(h.FormItem,{children:[(0,t.jsx)(h.FormLabel,{children:"Client ID"}),(0,t.jsx)(h.FormControl,{children:(0,t.jsx)(p.Input,{className:"font-mono",...e})}),(0,t.jsx)(h.FormMessage,{})]})}),(0,t.jsx)(h.FormField,{control:R.control,name:"clientSecret",render:({field:e})=>(0,t.jsxs)(h.FormItem,{children:[(0,t.jsx)(h.FormLabel,{children:"Client secret"}),(0,t.jsx)(h.FormControl,{children:(0,t.jsx)(p.Input,{type:"password",className:"font-mono",...e})}),(0,t.jsx)(h.FormMessage,{})]})}),C.scopesAvailable.length>0&&(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(h.FormLabel,{children:"Scopes"}),(0,t.jsx)(j.ScopesPicker,{scopesAvailable:C.scopesAvailable,value:w,onChange:N})]}),(0,t.jsx)(x.ConfigFieldsForm,{fields:C.configFields,value:S,onChange:(e,t)=>E(n=>({...n,[e]:t}))}),R.formState.errors.root&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:R.formState.errors.root.message}),(0,t.jsx)("div",{className:"flex justify-end gap-2 pt-2",children:(0,t.jsx)(m.Button,{type:"submit",disabled:F,children:F?"Creating…":"Create configuration"})})]})})})})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"New configuration"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Pick the provider your users will connect to."})]}),y&&(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[(0,t.jsx)(v.Skeleton,{className:"h-24 w-full"}),(0,t.jsx)(v.Skeleton,{className:"h-24 w-full"}),(0,t.jsx)(v.Skeleton,{className:"h-24 w-full"})]}),!y&&(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:(l??[]).map(e=>(0,t.jsxs)(f.Card,{role:"button",tabIndex:0,onClick:()=>k(e),onKeyDown:t=>"Enter"===t.key&&k(e),className:"hover:border-primary/50 cursor-pointer transition-colors",children:[(0,t.jsx)(f.CardHeader,{children:(0,t.jsxs)(f.CardTitle,{className:"flex items-center justify-between text-base",children:[e.name,(0,t.jsx)(u.Badge,{variant:"outline",children:e.authType})]})}),(0,t.jsxs)(f.CardContent,{className:"text-muted-foreground text-sm",children:[e.scopesAvailable.length," scope",1===e.scopesAvailable.length?"":"s"," ","available"]})]},e.key))})]})}e.s(["default",()=>y],21894)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67022,e=>{"use strict";var t=e.i(78234),n=e.i(94832),a=e.i(94237),r=e.i(33178);let s=(0,a.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 gap-1 [&>svg]:size-3 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function o({className:e,variant:a,asChild:o=!1,...i}){let l=o?n.Slot:"span";return(0,t.jsx)(l,{"data-slot":"badge",className:(0,r.cn)(s({variant:a}),e),...i})}e.s(["Badge",()=>o])},55760,e=>{"use strict";var t=e.i(78234),n=e.i(33178);function a({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,t.jsx)("table",{"data-slot":"table",className:(0,n.cn)("w-full caption-bottom text-sm",e),...a})})}function r({className:e,...a}){return(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,n.cn)("[&_tr]:border-b",e),...a})}function s({className:e,...a}){return(0,t.jsx)("tbody",{"data-slot":"table-body",className:(0,n.cn)("[&_tr:last-child]:border-0",e),...a})}function o({className:e,...a}){return(0,t.jsx)("tr",{"data-slot":"table-row",className:(0,n.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...a})}function i({className:e,...a}){return(0,t.jsx)("th",{"data-slot":"table-head",className:(0,n.cn)("text-muted-foreground h-10 px-3 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a})}function l({className:e,...a}){return(0,t.jsx)("td",{"data-slot":"table-cell",className:(0,n.cn)("p-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a})}e.s(["Table",()=>a,"TableBody",()=>s,"TableCell",()=>l,"TableHead",()=>i,"TableHeader",()=>r,"TableRow",()=>o])},36144,e=>{"use strict";var t=e.i(78234),n=e.i(33178);function a({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,n.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})}function r({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,n.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})}function s({className:e,...a}){return(0,t.jsx)("h3",{"data-slot":"card-title",className:(0,n.cn)("leading-none font-semibold",e),...a})}function o({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,n.cn)("text-muted-foreground text-sm",e),...a})}function i({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,n.cn)("px-6",e),...a})}e.s(["Card",()=>a,"CardContent",()=>i,"CardDescription",()=>o,"CardHeader",()=>r,"CardTitle",()=>s])},3161,78309,e=>{"use strict";var t=e.i(99975),n=e.i(76482);class a extends Error{status;constructor(e,t){super(e),this.status=t,this.name="ApiError"}}async function r(e,t){let r=await fetch(`${(0,n.apiUrl)()}/api${e}`,{...t,credentials:"include",headers:{"content-type":"application/json",...t?.headers}});if(!r.ok){let e=await r.json().catch(()=>null);throw new a(e?.message??`Request failed with status ${r.status}`,r.status)}if(204!==r.status)return r.json()}function s(){return r("/integrations")}function o(e){return r(`/integrations/${e}`)}function i(){return r("/configurations")}function l(e){return r(`/configurations/${e}`)}function c(e){return r("/configurations",{method:"POST",body:JSON.stringify(e)})}function d(e,t){return r(`/configurations/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function u(e){return r(`/configurations/${e}`,{method:"DELETE"})}function f(e){let t=e?.endUserExternalId?`?endUserExternalId=${encodeURIComponent(e.endUserExternalId)}`:"";return r(`/connections${t}`)}function x(e){return r(`/connections/${e}`,{method:"DELETE"})}function g(e){return r("/connect/sessions/test",{method:"POST",body:JSON.stringify({configurationId:e})})}function h(e,n=[]){let[r,s]=(0,t.useState)(null),[o,i]=(0,t.useState)(!0),[l,c]=(0,t.useState)(null),d=(0,t.useCallback)(()=>{i(!0),c(null),e().then(s).catch(e=>c(e instanceof a?e.message:"Something went wrong")).finally(()=>i(!1))},n);return(0,t.useEffect)(()=>{d()},[d]),{data:r,loading:o,error:l,reload:d}}e.s(["ApiError",()=>a,"createConfiguration",()=>c,"createTestConnectSession",()=>g,"deleteConfiguration",()=>u,"getConfiguration",()=>l,"getIntegration",()=>o,"listConfigurations",()=>i,"listConnections",()=>f,"listIntegrations",()=>s,"revokeConnection",()=>x,"updateConfiguration",()=>d],78309),e.s(["useApiResource",()=>h],3161)},87016,e=>{"use strict";var t=e.i(78234),n=e.i(99975),a=e.i(64503),r=e.i(76173),s=e.i(31261),o=e.i(43836),i=Object.defineProperty,l=(e,t)=>i(e,"name",{value:t,configurable:!0}),[c,d]=(0,a.createContextScope)("AlertDialog",[s.createDialogScope]),u=(0,s.createDialogScope)(),f=l(e=>{let{__scopeAlertDialog:n,...a}=e,r=u(n);return(0,t.jsx)(s.Root,{...r,...a,modal:!0})},"AlertDialog"),x=n.forwardRef(l(function(e,n){let{__scopeAlertDialog:a,...r}=e,o=u(a);return(0,t.jsx)(s.Trigger,{...o,...r,ref:n})},"AlertDialogTrigger")),g=l(e=>{let{__scopeAlertDialog:n,...a}=e,r=u(n);return(0,t.jsx)(s.Portal,{...r,...a})},"AlertDialogPortal"),h=n.forwardRef(l(function(e,n){let{__scopeAlertDialog:a,...r}=e,o=u(a);return(0,t.jsx)(s.Overlay,{...o,...r,ref:n})},"AlertDialogOverlay")),[m,j]=c("AlertDialogContent"),p=n.forwardRef(l(function(e,a){let{__scopeAlertDialog:i,children:l,...c}=e,d=u(i),f=n.useRef(null),x=(0,r.useComposedRefs)(a,f),g=n.useRef(null);return(0,t.jsx)(m,{scope:i,cancelRef:g,children:(0,t.jsx)(s.Content,{role:"alertdialog",...d,...c,ref:x,onOpenAutoFocus:(0,o.composeEventHandlers)(c.onOpenAutoFocus,e=>{e.preventDefault(),g.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:l})})},"AlertDialogContent")),b=n.forwardRef(l(function(e,n){let{__scopeAlertDialog:a,...r}=e,o=u(a);return(0,t.jsx)(s.Title,{...o,...r,ref:n})},"AlertDialogTitle")),v=n.forwardRef(l(function(e,n){let{__scopeAlertDialog:a,...r}=e,o=u(a);return(0,t.jsx)(s.Description,{...o,...r,ref:n})},"AlertDialogDescription")),C=n.forwardRef(l(function(e,n){let{__scopeAlertDialog:a,...r}=e,o=u(a);return(0,t.jsx)(s.Close,{...o,...r,ref:n})},"AlertDialogAction")),D=n.forwardRef(l(function(e,n){let{__scopeAlertDialog:a,...o}=e,{cancelRef:i}=j("AlertDialogCancel",a),l=u(a),c=(0,r.useComposedRefs)(n,i);return(0,t.jsx)(s.Close,{...l,...o,ref:c})},"AlertDialogCancel")),w=e.i(33178),N=e.i(81404);function A(e){return(0,t.jsx)(f,{"data-slot":"alert-dialog",...e})}function y(e){return(0,t.jsx)(x,{"data-slot":"alert-dialog-trigger",...e})}function T(e){return(0,t.jsx)(g,{"data-slot":"alert-dialog-portal",...e})}function E({className:e,...n}){return(0,t.jsx)(h,{"data-slot":"alert-dialog-overlay",className:(0,w.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...n})}function R({className:e,...n}){return(0,t.jsxs)(T,{children:[(0,t.jsx)(E,{}),(0,t.jsx)(p,{"data-slot":"alert-dialog-content",className:(0,w.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...n})]})}function S({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,w.cn)("flex flex-col gap-2 text-center sm:text-left",e),...n})}function O({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,w.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...n})}function k({className:e,...n}){return(0,t.jsx)(b,{"data-slot":"alert-dialog-title",className:(0,w.cn)("text-lg font-semibold",e),...n})}function P({className:e,...n}){return(0,t.jsx)(v,{"data-slot":"alert-dialog-description",className:(0,w.cn)("text-muted-foreground text-sm",e),...n})}function H({className:e,...n}){return(0,t.jsx)(C,{className:(0,w.cn)((0,N.buttonVariants)(),e),...n})}function $({className:e,...n}){return(0,t.jsx)(D,{className:(0,w.cn)((0,N.buttonVariants)({variant:"outline"}),e),...n})}e.s(["AlertDialog",()=>A,"AlertDialogAction",()=>H,"AlertDialogCancel",()=>$,"AlertDialogContent",()=>R,"AlertDialogDescription",()=>P,"AlertDialogFooter",()=>O,"AlertDialogHeader",()=>S,"AlertDialogTitle",()=>k,"AlertDialogTrigger",()=>y],87016)},3497,e=>{"use strict";var t=e.i(78234),n=e.i(33178);let a={positive:"bg-primary",neutral:"bg-muted-foreground/50",negative:"bg-destructive"};function r({tone:e,label:r}){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,t.jsx)("span",{className:(0,n.cn)("size-1.5 shrink-0 rounded-full",a[e])}),r]})}let s={ACTIVE:"positive",PENDING:"neutral",ERROR:"negative",REVOKED:"negative",EXPIRED:"negative"};function o({status:e}){return(0,t.jsx)(r,{tone:s[e]??"neutral",label:e.charAt(0)+e.slice(1).toLowerCase()})}function i({isEnabled:e}){return(0,t.jsx)(r,{tone:e?"positive":"neutral",label:e?"Enabled":"Disabled"})}e.s(["ConfigurationStatusDot",()=>i,"ConnectionStatusDot",()=>o])},80246,e=>{"use strict";var t=e.i(78234),n=e.i(79150),a=e.i(83733),r=e.i(69469),s=e.i(27940),o=e.i(78309),i=e.i(3161),l=e.i(87016),c=e.i(67022),d=e.i(81404),u=e.i(36144),f=e.i(77785),x=e.i(55760),g=e.i(3497);function h(){let{data:e,loading:h,error:m,reload:j}=(0,i.useApiResource)(o.listConfigurations);async function p(e,t){try{await (0,o.deleteConfiguration)(e),s.toast.success(`Deleted "${t}"`),j()}catch(e){s.toast.error(e instanceof o.ApiError?e.message:"Could not delete configuration")}}return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Configurations"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"OAuth apps your organization has set up for each provider."})]}),(0,t.jsx)(d.Button,{asChild:!0,children:(0,t.jsxs)(n.default,{href:"/configurations/new",children:[(0,t.jsx)(r.Plus,{}),"New configuration"]})})]}),h&&(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(f.Skeleton,{className:"h-10 w-full"}),(0,t.jsx)(f.Skeleton,{className:"h-10 w-full"}),(0,t.jsx)(f.Skeleton,{className:"h-10 w-full"})]}),m&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:m}),!h&&!m&&e&&0===e.length&&(0,t.jsx)(u.Card,{children:(0,t.jsxs)(u.CardContent,{className:"flex flex-col items-center gap-3 py-12 text-center",children:[(0,t.jsx)(a.Cable,{className:"text-muted-foreground size-8"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"No configurations yet"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Create one to let your users connect a provider."})]}),(0,t.jsx)(d.Button,{asChild:!0,children:(0,t.jsxs)(n.default,{href:"/configurations/new",children:[(0,t.jsx)(r.Plus,{}),"New configuration"]})})]})}),!h&&!m&&e&&e.length>0&&(0,t.jsx)(u.Card,{className:"py-0",children:(0,t.jsxs)(x.Table,{children:[(0,t.jsx)(x.TableHeader,{children:(0,t.jsxs)(x.TableRow,{children:[(0,t.jsx)(x.TableHead,{children:"Name"}),(0,t.jsx)(x.TableHead,{children:"Provider"}),(0,t.jsx)(x.TableHead,{children:"Environment"}),(0,t.jsx)(x.TableHead,{children:"Status"}),(0,t.jsx)(x.TableHead,{className:"w-0"})]})}),(0,t.jsx)(x.TableBody,{children:e.map(e=>(0,t.jsxs)(x.TableRow,{children:[(0,t.jsx)(x.TableCell,{className:"font-medium",children:(0,t.jsx)(n.default,{href:`/configurations/${e.id}`,className:"hover:underline",children:e.name})}),(0,t.jsx)(x.TableCell,{children:e.provider.name}),(0,t.jsx)(x.TableCell,{children:(0,t.jsx)(c.Badge,{variant:"outline",children:e.environment})}),(0,t.jsx)(x.TableCell,{children:(0,t.jsx)(g.ConfigurationStatusDot,{isEnabled:e.isEnabled})}),(0,t.jsx)(x.TableCell,{children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[(0,t.jsx)(d.Button,{variant:"ghost",size:"sm",asChild:!0,children:(0,t.jsx)(n.default,{href:`/configurations/${e.id}`,children:"Edit"})}),(0,t.jsxs)(l.AlertDialog,{children:[(0,t.jsx)(l.AlertDialogTrigger,{asChild:!0,children:(0,t.jsx)(d.Button,{variant:"ghost",size:"sm",className:"text-destructive",children:"Delete"})}),(0,t.jsxs)(l.AlertDialogContent,{children:[(0,t.jsxs)(l.AlertDialogHeader,{children:[(0,t.jsxs)(l.AlertDialogTitle,{children:["Delete “",e.name,"”?"]}),(0,t.jsx)(l.AlertDialogDescription,{children:"Existing connections made through this configuration are unaffected, but no new ones can be created. This can't be undone."})]}),(0,t.jsxs)(l.AlertDialogFooter,{children:[(0,t.jsx)(l.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(l.AlertDialogAction,{onClick:()=>p(e.id,e.name),children:"Delete"})]})]})]})]})})]},e.id))})]})})]})}e.s(["default",()=>h])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36144,e=>{"use strict";var t=e.i(78234),n=e.i(33178);function r({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,n.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})}function a({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,n.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...r})}function s({className:e,...r}){return(0,t.jsx)("h3",{"data-slot":"card-title",className:(0,n.cn)("leading-none font-semibold",e),...r})}function o({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,n.cn)("text-muted-foreground text-sm",e),...r})}function i({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,n.cn)("px-6",e),...r})}e.s(["Card",()=>r,"CardContent",()=>i,"CardDescription",()=>o,"CardHeader",()=>a,"CardTitle",()=>s])},85858,e=>{"use strict";var t=e.i(78234),n=e.i(99975),r=e.i(81137),a=Object.defineProperty,s=n.forwardRef(a(function(e,n){return(0,t.jsx)(r.Primitive.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0})),o=e.i(33178);function i({className:e,...n}){return(0,t.jsx)(s,{"data-slot":"label",className:(0,o.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}e.s(["Label",()=>i],85858)},3161,78309,e=>{"use strict";var t=e.i(99975),n=e.i(76482);class r extends Error{status;constructor(e,t){super(e),this.status=t,this.name="ApiError"}}async function a(e,t){let a=await fetch(`${(0,n.apiUrl)()}/api${e}`,{...t,credentials:"include",headers:{"content-type":"application/json",...t?.headers}});if(!a.ok){let e=await a.json().catch(()=>null);throw new r(e?.message??`Request failed with status ${a.status}`,a.status)}if(204!==a.status)return a.json()}function s(){return a("/integrations")}function o(e){return a(`/integrations/${e}`)}function i(){return a("/configurations")}function l(e){return a(`/configurations/${e}`)}function c(e){return a("/configurations",{method:"POST",body:JSON.stringify(e)})}function d(e,t){return a(`/configurations/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function u(e){return a(`/configurations/${e}`,{method:"DELETE"})}function f(e){let t=e?.endUserExternalId?`?endUserExternalId=${encodeURIComponent(e.endUserExternalId)}`:"";return a(`/connections${t}`)}function m(e){return a(`/connections/${e}`,{method:"DELETE"})}function x(e){return a("/connect/sessions/test",{method:"POST",body:JSON.stringify({configurationId:e})})}function p(e,n=[]){let[a,s]=(0,t.useState)(null),[o,i]=(0,t.useState)(!0),[l,c]=(0,t.useState)(null),d=(0,t.useCallback)(()=>{i(!0),c(null),e().then(s).catch(e=>c(e instanceof r?e.message:"Something went wrong")).finally(()=>i(!1))},n);return(0,t.useEffect)(()=>{d()},[d]),{data:a,loading:o,error:l,reload:d}}e.s(["ApiError",()=>r,"createConfiguration",()=>c,"createTestConnectSession",()=>x,"deleteConfiguration",()=>u,"getConfiguration",()=>l,"getIntegration",()=>o,"listConfigurations",()=>i,"listConnections",()=>f,"listIntegrations",()=>s,"revokeConnection",()=>m,"updateConfiguration",()=>d],78309),e.s(["useApiResource",()=>p],3161)},87016,e=>{"use strict";var t=e.i(78234),n=e.i(99975),r=e.i(64503),a=e.i(76173),s=e.i(31261),o=e.i(43836),i=Object.defineProperty,l=(e,t)=>i(e,"name",{value:t,configurable:!0}),[c,d]=(0,r.createContextScope)("AlertDialog",[s.createDialogScope]),u=(0,s.createDialogScope)(),f=l(e=>{let{__scopeAlertDialog:n,...r}=e,a=u(n);return(0,t.jsx)(s.Root,{...a,...r,modal:!0})},"AlertDialog"),m=n.forwardRef(l(function(e,n){let{__scopeAlertDialog:r,...a}=e,o=u(r);return(0,t.jsx)(s.Trigger,{...o,...a,ref:n})},"AlertDialogTrigger")),x=l(e=>{let{__scopeAlertDialog:n,...r}=e,a=u(n);return(0,t.jsx)(s.Portal,{...a,...r})},"AlertDialogPortal"),p=n.forwardRef(l(function(e,n){let{__scopeAlertDialog:r,...a}=e,o=u(r);return(0,t.jsx)(s.Overlay,{...o,...a,ref:n})},"AlertDialogOverlay")),[h,g]=c("AlertDialogContent"),j=n.forwardRef(l(function(e,r){let{__scopeAlertDialog:i,children:l,...c}=e,d=u(i),f=n.useRef(null),m=(0,a.useComposedRefs)(r,f),x=n.useRef(null);return(0,t.jsx)(h,{scope:i,cancelRef:x,children:(0,t.jsx)(s.Content,{role:"alertdialog",...d,...c,ref:m,onOpenAutoFocus:(0,o.composeEventHandlers)(c.onOpenAutoFocus,e=>{e.preventDefault(),x.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:l})})},"AlertDialogContent")),b=n.forwardRef(l(function(e,n){let{__scopeAlertDialog:r,...a}=e,o=u(r);return(0,t.jsx)(s.Title,{...o,...a,ref:n})},"AlertDialogTitle")),v=n.forwardRef(l(function(e,n){let{__scopeAlertDialog:r,...a}=e,o=u(r);return(0,t.jsx)(s.Description,{...o,...a,ref:n})},"AlertDialogDescription")),y=n.forwardRef(l(function(e,n){let{__scopeAlertDialog:r,...a}=e,o=u(r);return(0,t.jsx)(s.Close,{...o,...a,ref:n})},"AlertDialogAction")),C=n.forwardRef(l(function(e,n){let{__scopeAlertDialog:r,...o}=e,{cancelRef:i}=g("AlertDialogCancel",r),l=u(r),c=(0,a.useComposedRefs)(n,i);return(0,t.jsx)(s.Close,{...l,...o,ref:c})},"AlertDialogCancel")),w=e.i(33178),k=e.i(81404);function N(e){return(0,t.jsx)(f,{"data-slot":"alert-dialog",...e})}function S(e){return(0,t.jsx)(m,{"data-slot":"alert-dialog-trigger",...e})}function D(e){return(0,t.jsx)(x,{"data-slot":"alert-dialog-portal",...e})}function E({className:e,...n}){return(0,t.jsx)(p,{"data-slot":"alert-dialog-overlay",className:(0,w.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...n})}function A({className:e,...n}){return(0,t.jsxs)(D,{children:[(0,t.jsx)(E,{}),(0,t.jsx)(j,{"data-slot":"alert-dialog-content",className:(0,w.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...n})]})}function R({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,w.cn)("flex flex-col gap-2 text-center sm:text-left",e),...n})}function F({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,w.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...n})}function I({className:e,...n}){return(0,t.jsx)(b,{"data-slot":"alert-dialog-title",className:(0,w.cn)("text-lg font-semibold",e),...n})}function P({className:e,...n}){return(0,t.jsx)(v,{"data-slot":"alert-dialog-description",className:(0,w.cn)("text-muted-foreground text-sm",e),...n})}function T({className:e,...n}){return(0,t.jsx)(y,{className:(0,w.cn)((0,k.buttonVariants)(),e),...n})}function L({className:e,...n}){return(0,t.jsx)(C,{className:(0,w.cn)((0,k.buttonVariants)({variant:"outline"}),e),...n})}e.s(["AlertDialog",()=>N,"AlertDialogAction",()=>T,"AlertDialogCancel",()=>L,"AlertDialogContent",()=>A,"AlertDialogDescription",()=>P,"AlertDialogFooter",()=>F,"AlertDialogHeader",()=>R,"AlertDialogTitle",()=>I,"AlertDialogTrigger",()=>S],87016)},91449,e=>{"use strict";var t=e.i(78234),n=e.i(99975),r=e.i(79081),a=e.i(48045);let s=(0,a.default)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),o=(0,a.default)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),i=(0,a.default)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var l=e.i(27940),c=e.i(33178);function d({value:e,mask:a=!1,className:d}){let[u,f]=(0,n.useState)(!1),[m,x]=(0,n.useState)(!a);async function p(){await navigator.clipboard.writeText(e),f(!0),l.toast.success("Copied to clipboard"),setTimeout(()=>f(!1),1500)}return(0,t.jsxs)("span",{className:(0,c.cn)("bg-muted/60 inline-flex max-w-full items-center gap-1 rounded-md border px-2 py-1 font-mono text-xs",d),children:[(0,t.jsx)("span",{className:"truncate",children:m?e:"•".repeat(Math.min(e.length,24))}),a&&(0,t.jsxs)("button",{type:"button",onClick:()=>x(e=>!e),className:"text-muted-foreground hover:text-foreground shrink-0",children:[m?(0,t.jsx)(i,{className:"size-3.5"}):(0,t.jsx)(o,{className:"size-3.5"}),(0,t.jsx)("span",{className:"sr-only",children:m?"Hide":"Reveal"})]}),(0,t.jsxs)("button",{type:"button",onClick:p,className:"text-muted-foreground hover:text-foreground shrink-0",children:[u?(0,t.jsx)(r.Check,{className:"size-3.5"}):(0,t.jsx)(s,{className:"size-3.5"}),(0,t.jsx)("span",{className:"sr-only",children:"Copy"})]})]})}e.s(["CodeChip",()=>d],91449)},50824,31403,e=>{"use strict";var t=e.i(78234),n=e.i(99975),r=e.i(76173),a=e.i(64503),s=e.i(43836),o=e.i(76440),i=e.i(72261),l=e.i(26747),c=e.i(81137),d=Object.defineProperty,u=(e,t)=>d(e,"name",{value:t,configurable:!0}),f="Checkbox",[m,x]=(0,a.createContextScope)(f),[p,h]=m(f);function g(e){let{__scopeCheckbox:r,checked:a,children:s,defaultChecked:i,disabled:l,form:c,name:d,onCheckedChange:u,required:m,value:x="on",internal_do_not_use_render:h}=e,[g,j]=(0,o.useControllableState)({prop:a,defaultProp:i??!1,onChange:u,caller:f}),[b,v]=n.useState(null),[y,k]=n.useState(null),N=n.useRef(!1),[S,D]=n.useReducer(e=>e+1,0),E=!b||!!c||!!b.closest("form"),A={checked:g,disabled:l,setChecked:j,control:b,setControl:v,name:d,form:c,value:x,hasConsumerStoppedPropagationRef:N,userInteractionCount:S,onUserInteraction:D,required:m,defaultChecked:!w(i)&&i,isFormControl:E,bubbleInput:y,setBubbleInput:k};return(0,t.jsx)(p,{scope:r,...A,children:C(h)?h(A):s})}u(g,"CheckboxProvider");var j=n.forwardRef(u(function({__scopeCheckbox:e,onKeyDown:a,onClick:o,...i},l){let{control:d,value:f,disabled:m,checked:x,required:p,setControl:g,setChecked:j,hasConsumerStoppedPropagationRef:b,onUserInteraction:v,isFormControl:y,bubbleInput:C}=h("CheckboxTrigger",e),N=(0,r.useComposedRefs)(l,g),S=n.useRef(x);return n.useEffect(()=>{let e=d?.form;if(e){let t=u(()=>j(S.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,j]),(0,t.jsx)(c.Primitive.button,{type:"button",role:"checkbox","aria-checked":w(x)?"mixed":x,"aria-required":p,"data-state":k(x),"data-disabled":m?"":void 0,disabled:m,value:f,...i,ref:N,onKeyDown:(0,s.composeEventHandlers)(a,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,s.composeEventHandlers)(o,e=>{v(),j(e=>!!w(e)||!e),C&&y&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})})},"CheckboxTrigger")),b=n.forwardRef(u(function(e,n){let{__scopeCheckbox:r,name:a,checked:s,defaultChecked:o,required:i,disabled:l,value:c,onCheckedChange:d,form:u,...f}=e;return(0,t.jsx)(g,{__scopeCheckbox:r,checked:s,defaultChecked:o,disabled:l,required:i,onCheckedChange:d,name:a,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j,{...f,ref:n,__scopeCheckbox:r}),e&&(0,t.jsx)(y,{__scopeCheckbox:r})]})})},"Checkbox")),v=n.forwardRef(u(function(e,n){let{__scopeCheckbox:r,forceMount:a,...s}=e,o=h("CheckboxIndicator",r);return(0,t.jsx)(l.Presence,{present:a||w(o.checked)||!0===o.checked,children:(0,t.jsx)(c.Primitive.span,{"data-state":k(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),y=n.forwardRef(u(function({__scopeCheckbox:e,onClick:a,...o},l){let{control:d,hasConsumerStoppedPropagationRef:u,userInteractionCount:f,checked:m,defaultChecked:x,required:p,disabled:g,name:j,value:b,form:v,bubbleInput:y,setBubbleInput:C}=h("CheckboxBubbleInput",e),k=(0,r.useComposedRefs)(l,C),N=(0,i.useSize)(d),S=n.useRef(!1),D=n.useRef(m),E=n.useRef(f);n.useEffect(()=>{if(!y)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=f!==E.current;E.current=f;let n=D.current!==m;D.current=m;let r=!(t&&u.current);if(n&&e){S.current=!t;let n=new Event("click",{bubbles:r});y.indeterminate=w(m),e.call(y,!w(m)&&m),y.dispatchEvent(n),S.current=!1}},[y,m,u,f]);let A=n.useRef(!w(m)&&m);return(0,t.jsx)(c.Primitive.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??A.current,required:p,disabled:g,name:j,value:b,form:v,...o,tabIndex:-1,ref:k,onClick:(0,s.composeEventHandlers)(a,e=>{S.current&&e.stopPropagation()}),style:{...o.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function C(e){return"function"==typeof e}function w(e){return"indeterminate"===e}function k(e){return w(e)?"indeterminate":e?"checked":"unchecked"}u(C,"isFunction"),u(w,"isIndeterminate"),u(k,"getState");var N=e.i(41796),S=e.i(33178);function D({className:e,...n}){return(0,t.jsx)(b,{"data-slot":"checkbox",className:(0,S.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:(0,t.jsx)(v,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,t.jsx)(N.CheckIcon,{className:"size-3.5"})})})}var E=e.i(43711),A=e.i(85858),R=e.i(10395);function F({fields:e,value:n,onChange:r}){return 0===e.length?null:(0,t.jsx)("div",{className:"flex flex-col gap-4",children:e.map(e=>{let a=`config-field-${e.key}`,s=n[e.key];return"boolean"===e.type?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(D,{id:a,checked:!0===s,onCheckedChange:t=>r(e.key,!0===t)}),(0,t.jsxs)(A.Label,{htmlFor:a,className:"font-normal",children:[e.label,e.required&&(0,t.jsx)("span",{className:"text-destructive",children:" *"})]})]},e.key):"select"===e.type?(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(A.Label,{htmlFor:a,children:[e.label,e.required&&(0,t.jsx)("span",{className:"text-destructive",children:" *"})]}),(0,t.jsxs)(R.Select,{value:"string"==typeof s?s:void 0,onValueChange:t=>r(e.key,t),children:[(0,t.jsx)(R.SelectTrigger,{id:a,className:"w-full",children:(0,t.jsx)(R.SelectValue,{placeholder:"Select…"})}),(0,t.jsx)(R.SelectContent,{children:(e.options??[]).map(e=>(0,t.jsx)(R.SelectItem,{value:e.value,children:e.label},e.value))})]}),e.help&&(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:e.help})]},e.key):(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(A.Label,{htmlFor:a,children:[e.label,e.required&&(0,t.jsx)("span",{className:"text-destructive",children:" *"})]}),(0,t.jsx)(E.Input,{id:a,type:"number"===e.type?"number":e.secret?"password":"text",value:"string"==typeof s||"number"==typeof s?s:"",onChange:t=>r(e.key,"number"===e.type?t.target.valueAsNumber:t.target.value)}),e.help&&(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:e.help})]},e.key)})})}e.s(["ConfigFieldsForm",()=>F],50824);var I=e.i(79081),P=e.i(6435),P=P,T=e.i(67022);function L({options:e,value:r,onChange:a,placeholder:s,className:o}){let[i,l]=(0,n.useState)(!1),[c,d]=(0,n.useState)(""),[u,f]=(0,n.useState)(0),m=(0,n.useRef)(null),x=(0,n.useRef)(null),p=e.filter(e=>e.toLowerCase().includes(c.toLowerCase()));function h(e){a(r.includes(e)?r.filter(t=>t!==e):[...r,e]),d("")}return(0,n.useEffect)(()=>{f(0)},[c,i]),(0,n.useEffect)(()=>{function e(e){m.current?.contains(e.target)||l(!1)}return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[]),(0,t.jsxs)("div",{ref:m,className:(0,S.cn)("relative",o),children:[(0,t.jsxs)("div",{className:"border-input focus-within:border-ring focus-within:ring-ring/50 flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border bg-transparent px-2 py-1.5 text-sm shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",onClick:()=>{l(!0),x.current?.focus()},children:[r.map(e=>(0,t.jsxs)(T.Badge,{variant:"secondary",className:"gap-1 font-mono",children:[e,(0,t.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),h(e)},className:"text-muted-foreground hover:text-foreground",children:[(0,t.jsx)(P.default,{className:"size-3"}),(0,t.jsxs)("span",{className:"sr-only",children:["Remove ",e]})]})]},e)),(0,t.jsx)("input",{ref:x,value:c,onChange:e=>d(e.target.value),onFocus:()=>l(!0),onKeyDown:function(e){if("Backspace"===e.key&&""===c&&r.length>0)return void a(r.slice(0,-1));if(!i&&("ArrowDown"===e.key||"Enter"===e.key))return void l(!0);if("ArrowDown"===e.key)e.preventDefault(),f(e=>Math.min(e+1,p.length-1));else if("ArrowUp"===e.key)e.preventDefault(),f(e=>Math.max(e-1,0));else if("Enter"===e.key){e.preventDefault();let t=p[u];t&&h(t)}else"Escape"===e.key&&l(!1)},placeholder:0===r.length?s:void 0,className:"text-foreground placeholder:text-muted-foreground min-w-24 flex-1 bg-transparent outline-none"})]}),i&&(0,t.jsxs)("div",{className:"bg-popover text-popover-foreground absolute z-50 mt-1 max-h-64 w-full overflow-auto rounded-md border p-1 shadow-md",children:[0===p.length&&(0,t.jsx)("p",{className:"text-muted-foreground px-2 py-1.5 text-sm",children:"No matches"}),p.map((e,n)=>{let a=r.includes(e);return(0,t.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),h(e)},onMouseEnter:()=>f(n),className:(0,S.cn)("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-left font-mono text-sm",n===u&&"bg-accent text-accent-foreground"),children:[e,a&&(0,t.jsx)(I.Check,{className:"size-4 shrink-0"})]},e)})]})]})}function z({scopesAvailable:e,value:n,onChange:r}){return 0===e.length?null:(0,t.jsx)(L,{options:e,value:n,onChange:r,placeholder:"Add scopes…"})}e.s(["ScopesPicker",()=>z],31403)},6698,e=>{"use strict";var t=e.i(78234),n=e.i(99975),r=e.i(59636),a=e.i(14315),s=e.i(68120),o=e.i(27940),i=e.i(32356),l=e.i(78309),c=e.i(3161),d=e.i(87016),u=e.i(67022),f=e.i(81404),m=e.i(36144),x=e.i(91449),p=e.i(50824),h=e.i(9018),g=e.i(43711),j=e.i(31403),b=e.i(42075),v=e.i(77785),y=e.i(43836),C=e.i(76173),w=e.i(64503),k=e.i(76440),N=e.i(72261),S=e.i(81137),D=Object.defineProperty,E=(e,t)=>D(e,"name",{value:t,configurable:!0}),A="Switch",[R,F]=(0,w.createContextScope)(A),[I,P]=R(A);function T(e){let{__scopeSwitch:r,checked:a,children:s,defaultChecked:o,disabled:i,form:l,name:c,onCheckedChange:d,required:u,value:f="on",internal_do_not_use_render:m}=e,[x,p]=(0,k.useControllableState)({prop:a,defaultProp:o??!1,onChange:d,caller:A}),[h,g]=n.useState(null),[j,b]=n.useState(null),v=n.useRef(!1),[y,C]=n.useReducer(e=>e+1,0),w=!h||!!l||!!h.closest("form"),N={checked:x,setChecked:p,disabled:i,control:h,setControl:g,name:c,form:l,value:f,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:C,required:u,defaultChecked:o,isFormControl:w,bubbleInput:j,setBubbleInput:b};return(0,t.jsx)(I,{scope:r,...N,children:H(m)?m(N):s})}E(T,"SwitchProvider");var L=n.forwardRef(E(function({__scopeSwitch:e,onClick:r,...a},s){let{control:o,form:i,value:l,disabled:c,checked:d,required:u,setControl:f,setChecked:m,hasConsumerStoppedPropagationRef:x,onUserInteraction:p,isFormControl:h,bubbleInput:g}=P("SwitchTrigger",e),j=(0,C.useComposedRefs)(s,f),b=n.useRef(d);return n.useEffect(()=>{let e=i?o?.ownerDocument.getElementById(i):o?.form;if(e instanceof HTMLFormElement){let t=E(()=>m(b.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,i,m]),(0,t.jsx)(S.Primitive.button,{type:"button",role:"switch","aria-checked":d,"aria-required":u,"data-state":B(d),"data-disabled":c?"":void 0,disabled:c,value:l,...a,ref:j,onClick:(0,y.composeEventHandlers)(r,e=>{p(),m(e=>!e),g&&h&&(x.current=e.isPropagationStopped(),x.current||e.stopPropagation())})})},"SwitchTrigger")),z=n.forwardRef(E(function(e,n){let{__scopeSwitch:r,name:a,checked:s,defaultChecked:o,required:i,disabled:l,value:c,onCheckedChange:d,form:u,...f}=e;return(0,t.jsx)(T,{__scopeSwitch:r,checked:s,defaultChecked:o,disabled:l,required:i,onCheckedChange:d,name:a,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L,{...f,ref:n,__scopeSwitch:r}),e&&(0,t.jsx)(M,{__scopeSwitch:r})]})})},"Switch")),O=n.forwardRef(E(function(e,n){let{__scopeSwitch:r,...a}=e,s=P("SwitchThumb",r);return(0,t.jsx)(S.Primitive.span,{"data-state":B(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:n})},"SwitchThumb")),M=n.forwardRef(E(function({__scopeSwitch:e,onClick:r,...a},s){let{control:o,hasConsumerStoppedPropagationRef:i,userInteractionCount:l,checked:c,defaultChecked:d,required:u,disabled:f,name:m,value:x,form:p,bubbleInput:h,setBubbleInput:g}=P("SwitchBubbleInput",e),j=(0,C.useComposedRefs)(s,g),b=(0,N.useSize)(o),v=n.useRef(!1),w=n.useRef(c),k=n.useRef(l);n.useEffect(()=>{if(!h)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=l!==k.current;k.current=l;let n=w.current!==c;w.current=c;let r=!(t&&i.current);if(n&&e){v.current=!t;let n=new Event("click",{bubbles:r});e.call(h,c),h.dispatchEvent(n),v.current=!1}},[h,c,i,l]);let D=n.useRef(c);return(0,t.jsx)(S.Primitive.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??D.current,required:u,disabled:f,name:m,value:x,form:p,...a,tabIndex:-1,ref:j,onClick:(0,y.composeEventHandlers)(r,e=>{v.current&&e.stopPropagation()}),style:{...a.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function H(e){return"function"==typeof e}function B(e){return e?"checked":"unchecked"}E(H,"isFunction"),E(B,"getState");var U=e.i(33178);function $({className:e,...n}){return(0,t.jsx)(z,{"data-slot":"switch",className:(0,U.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:(0,t.jsx)(O,{"data-slot":"switch-thumb",className:(0,U.cn)("bg-background pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}let _=i.z.object({name:i.z.string().min(1,"Give this configuration a name"),clientId:i.z.string().min(1,"Client ID is required"),clientSecret:i.z.string(),isEnabled:i.z.boolean()});function q(){let{id:e}=(0,r.useParams)(),i=(0,r.useRouter)(),{data:y,loading:C,error:w}=(0,c.useApiResource)(async()=>{let t=await (0,l.getConfiguration)(e),n=await (0,l.getIntegration)(t.provider.key);return{configuration:t,integration:n}},[e]),[k,N]=(0,n.useState)([]),[S,D]=(0,n.useState)({}),[E,A]=(0,n.useState)(!1),[R,F]=(0,n.useState)(!1),I=(0,s.useForm)({resolver:(0,a.zodResolver)(_),defaultValues:{name:"",clientId:"",clientSecret:"",isEnabled:!0}});async function P(t){A(!0);try{await (0,l.updateConfiguration)(e,{name:t.name,clientId:t.clientId,clientSecret:t.clientSecret||void 0,isEnabled:t.isEnabled,scopes:k,settings:S}),o.toast.success("Configuration saved"),i.refresh()}catch(e){I.setError("root",{message:e instanceof l.ApiError?e.message:"Could not save configuration"})}finally{A(!1)}}async function T(){F(!0);try{let t=await (0,l.createTestConnectSession)(e);window.open(t.connectUrl,"_blank","noopener,noreferrer")}catch(e){o.toast.error(e instanceof l.ApiError?e.message:"Could not start a test connection")}finally{F(!1)}}async function L(){try{await (0,l.deleteConfiguration)(e),o.toast.success("Configuration deleted"),i.push("/configurations")}catch(e){o.toast.error(e instanceof l.ApiError?e.message:"Could not delete configuration")}}if((0,n.useEffect)(()=>{y&&(I.reset({name:y.configuration.name,clientId:y.configuration.clientId??"",clientSecret:"",isEnabled:y.configuration.isEnabled}),N(y.configuration.scopes),D(y.configuration.metadata??{}))},[y]),C)return(0,t.jsxs)("div",{className:"flex max-w-2xl flex-col gap-4",children:[(0,t.jsx)(v.Skeleton,{className:"h-8 w-64"}),(0,t.jsx)(v.Skeleton,{className:"h-64 w-full"})]});if(w||!y)return(0,t.jsx)("p",{className:"text-destructive text-sm",children:w??"Configuration not found"});let{configuration:z,integration:O}=y;return(0,t.jsxs)("div",{className:"flex max-w-2xl flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:z.name}),(0,t.jsxs)("p",{className:"text-muted-foreground text-sm",children:[O.name," ·"," ",(0,t.jsx)(u.Badge,{variant:"outline",children:z.environment})]})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(f.Button,{variant:"outline",onClick:T,disabled:R,children:R?"Starting…":"Test connect"}),(0,t.jsxs)(d.AlertDialog,{children:[(0,t.jsx)(d.AlertDialogTrigger,{asChild:!0,children:(0,t.jsx)(f.Button,{variant:"outline",className:"text-destructive",children:"Delete"})}),(0,t.jsxs)(d.AlertDialogContent,{children:[(0,t.jsxs)(d.AlertDialogHeader,{children:[(0,t.jsxs)(d.AlertDialogTitle,{children:["Delete “",z.name,"”?"]}),(0,t.jsx)(d.AlertDialogDescription,{children:"Existing connections made through this configuration are unaffected, but no new ones can be created. This can't be undone."})]}),(0,t.jsxs)(d.AlertDialogFooter,{children:[(0,t.jsx)(d.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(d.AlertDialogAction,{onClick:L,children:"Delete"})]})]})]})]})]}),(0,t.jsxs)(m.Card,{children:[(0,t.jsx)(m.CardHeader,{children:(0,t.jsx)(m.CardTitle,{className:"text-base",children:"Redirect URI"})}),(0,t.jsxs)(m.CardContent,{children:[(0,t.jsxs)("p",{className:"text-muted-foreground mb-2 text-sm",children:["Give this to ",O.name," as the callback URL for this OAuth app."]}),(0,t.jsx)(x.CodeChip,{value:z.redirectUri??""})]})]}),(0,t.jsx)(m.Card,{children:(0,t.jsx)(m.CardContent,{className:"pt-6",children:(0,t.jsx)(h.Form,{...I,children:(0,t.jsxs)("form",{onSubmit:I.handleSubmit(P),className:"flex flex-col gap-4",children:[(0,t.jsx)(h.FormField,{control:I.control,name:"name",render:({field:e})=>(0,t.jsxs)(h.FormItem,{children:[(0,t.jsx)(h.FormLabel,{children:"Name"}),(0,t.jsx)(h.FormControl,{children:(0,t.jsx)(g.Input,{...e})}),(0,t.jsx)(h.FormMessage,{})]})}),(0,t.jsx)(h.FormField,{control:I.control,name:"isEnabled",render:({field:e})=>(0,t.jsxs)(h.FormItem,{className:"flex flex-row items-center justify-between rounded-lg border p-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(h.FormLabel,{children:"Enabled"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"Disabled configurations can't start new connect sessions."})]}),(0,t.jsx)(h.FormControl,{children:(0,t.jsx)($,{checked:e.value,onCheckedChange:e.onChange})})]})}),(0,t.jsx)(h.FormField,{control:I.control,name:"clientId",render:({field:e})=>(0,t.jsxs)(h.FormItem,{children:[(0,t.jsx)(h.FormLabel,{children:"Client ID"}),(0,t.jsx)(h.FormControl,{children:(0,t.jsx)(g.Input,{className:"font-mono",...e})}),(0,t.jsx)(h.FormMessage,{})]})}),(0,t.jsx)(h.FormField,{control:I.control,name:"clientSecret",render:({field:e})=>(0,t.jsxs)(h.FormItem,{children:[(0,t.jsx)(h.FormLabel,{children:"Client secret"}),(0,t.jsx)(h.FormControl,{children:(0,t.jsx)(g.Input,{type:"password",className:"font-mono",placeholder:"Leave blank to keep the current secret",...e})}),(0,t.jsx)(h.FormMessage,{})]})}),O.scopesAvailable.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.Separator,{}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(h.FormLabel,{children:"Scopes"}),(0,t.jsx)(j.ScopesPicker,{scopesAvailable:O.scopesAvailable,value:k,onChange:N})]})]}),O.configFields.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.Separator,{}),(0,t.jsx)(p.ConfigFieldsForm,{fields:O.configFields,value:S,onChange:(e,t)=>D(n=>({...n,[e]:t}))})]}),I.formState.errors.root&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:I.formState.errors.root.message}),(0,t.jsx)("div",{className:"flex justify-end pt-2",children:(0,t.jsx)(f.Button,{type:"submit",disabled:E,children:E?"Saving…":"Save changes"})})]})})})})]})}e.s(["default",()=>q],6698)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,48045,e=>{"use strict";var r=e.i(99975);let t=(...e)=>e.filter((e,r,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===r).join(" ").trim();var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let n=(0,r.forwardRef)(({color:e="currentColor",size:n=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:s="",children:a,iconNode:c,...d},u)=>(0,r.createElement)("svg",{ref:u,...o,width:n,height:n,stroke:e,strokeWidth:i?24*Number(l)/Number(n):l,className:t("lucide",s),...d},[...c.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(a)?a:[a]])),l=(e,o)=>{let l=(0,r.forwardRef)(({className:l,...i},s)=>(0,r.createElement)(n,{ref:s,iconNode:o,className:t(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,l),...i}));return l.displayName=`${e}`,l};e.s(["default",()=>l],48045)},76482,e=>{"use strict";var r=e.i(14663);function t(){if("u">typeof document){let e=document.documentElement.getAttribute("data-kosha-api-url");if(e)return e}return r.default.env.KOSHA_API_URL??"http://localhost:3333"}e.s(["apiUrl",()=>t])},7284,e=>{"use strict";function r(){for(var e,r,t=0,o="",n=arguments.length;t<n;t++)(e=arguments[t])&&(r=function e(r){var t,o,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var l=r.length;for(t=0;t<l;t++)r[t]&&(o=e(r[t]))&&(n&&(n+=" "),n+=o)}else for(o in r)r[o]&&(n&&(n+=" "),n+=o);return n}(e))&&(o&&(o+=" "),o+=r);return o}e.s(["clsx",()=>r])},33178,e=>{"use strict";var r=e.i(7284);let t=(e,r)=>{if(0===e.length)return r.classGroupId;let o=e[0],n=r.nextPart.get(o),l=n?t(e.slice(1),n):void 0;if(l)return l;if(0===r.validators.length)return;let i=e.join("-");return r.validators.find(({validator:e})=>e(i))?.classGroupId},o=/^\[(.+)\]$/,n=(e,r,t,o)=>{e.forEach(e=>{if("string"==typeof e){(""===e?r:l(r,e)).classGroupId=t;return}"function"==typeof e?i(e)?n(e(o),r,t,o):r.validators.push({validator:e,classGroupId:t}):Object.entries(e).forEach(([e,i])=>{n(i,l(r,e),t,o)})})},l=(e,r)=>{let t=e;return r.split("-").forEach(e=>{t.nextPart.has(e)||t.nextPart.set(e,{nextPart:new Map,validators:[]}),t=t.nextPart.get(e)}),t},i=e=>e.isThemeGetter,s=(e,r)=>r?e.map(([e,t])=>[e,t.map(e=>"string"==typeof e?r+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,t])=>[r+e,t])):e)]):e,a=e=>{if(e.length<=1)return e;let r=[],t=[];return e.forEach(e=>{"["===e[0]?(r.push(...t.sort(),e),t=[]):t.push(e)}),r.push(...t.sort()),r},c=/\s+/;function d(){let e,r,t=0,o="";for(;t<arguments.length;)(e=arguments[t++])&&(r=u(e))&&(o&&(o+=" "),o+=r);return o}let u=e=>{let r;if("string"==typeof e)return e;let t="";for(let o=0;o<e.length;o++)e[o]&&(r=u(e[o]))&&(t&&(t+=" "),t+=r);return t},p=e=>{let r=r=>r[e]||[];return r.isThemeGetter=!0,r},f=/^\[(?:([a-z-]+):)?(.+)\]$/i,b=/^\d+\/\d+$/,m=new Set(["px","full","screen"]),g=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,h=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,v=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,y=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,x=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,w=e=>z(e)||m.has(e)||b.test(e),k=e=>I(e,"length",G),z=e=>!!e&&!Number.isNaN(Number(e)),j=e=>I(e,"number",z),S=e=>!!e&&Number.isInteger(Number(e)),E=e=>e.endsWith("%")&&z(e.slice(0,-1)),C=e=>f.test(e),R=e=>g.test(e),P=new Set(["length","size","percentage"]),N=e=>I(e,P,V),O=e=>I(e,"position",V),$=new Set(["image","url"]),_=e=>I(e,$,B),A=e=>I(e,"",M),W=()=>!0,I=(e,r,t)=>{let o=f.exec(e);return!!o&&(o[1]?"string"==typeof r?o[1]===r:r.has(o[1]):t(o[2]))},G=e=>h.test(e)&&!v.test(e),V=()=>!1,M=e=>y.test(e),B=e=>x.test(e),D=function(e,...r){let l,i,u,p=function(a){let c;return i=(l={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let r=0,t=new Map,o=new Map,n=(n,l)=>{t.set(n,l),++r>e&&(r=0,o=t,t=new Map)};return{get(e){let r=t.get(e);return void 0!==r?r:void 0!==(r=o.get(e))?(n(e,r),r):void 0},set(e,r){t.has(e)?t.set(e,r):n(e,r)}}})((c=r.reduce((e,r)=>r(e),e())).cacheSize),parseClassName:(e=>{let{separator:r,experimentalParseClassName:t}=e,o=1===r.length,n=r[0],l=r.length,i=e=>{let t,i=[],s=0,a=0;for(let c=0;c<e.length;c++){let d=e[c];if(0===s){if(d===n&&(o||e.slice(c,c+l)===r)){i.push(e.slice(a,c)),a=c+l;continue}if("/"===d){t=c;continue}}"["===d?s++:"]"===d&&s--}let c=0===i.length?e:e.substring(a),d=c.startsWith("!"),u=d?c.substring(1):c;return{modifiers:i,hasImportantModifier:d,baseClassName:u,maybePostfixModifierPosition:t&&t>a?t-a:void 0}};return t?e=>t({className:e,parseClassName:i}):i})(c),...(e=>{let r=(e=>{let{theme:r,prefix:t}=e,o={nextPart:new Map,validators:[]};return s(Object.entries(e.classGroups),t).forEach(([e,t])=>{n(t,o,e,r)}),o})(e),{conflictingClassGroups:l,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:e=>{let n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),t(n,r)||(e=>{if(o.test(e)){let r=o.exec(e)[1],t=r?.substring(0,r.indexOf(":"));if(t)return"arbitrary.."+t}})(e)},getConflictingClassGroupIds:(e,r)=>{let t=l[e]||[];return r&&i[e]?[...t,...i[e]]:t}}})(c)}).cache.get,u=l.cache.set,p=f,f(a)};function f(e){let r=i(e);if(r)return r;let t=((e,r)=>{let{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:n}=r,l=[],i=e.trim().split(c),s="";for(let e=i.length-1;e>=0;e-=1){let r=i[e],{modifiers:c,hasImportantModifier:d,baseClassName:u,maybePostfixModifierPosition:p}=t(r),f=!!p,b=o(f?u.substring(0,p):u);if(!b){if(!f||!(b=o(u))){s=r+(s.length>0?" "+s:s);continue}f=!1}let m=a(c).join(":"),g=d?m+"!":m,h=g+b;if(l.includes(h))continue;l.push(h);let v=n(b,f);for(let e=0;e<v.length;++e){let r=v[e];l.push(g+r)}s=r+(s.length>0?" "+s:s)}return s})(e,l);return u(e,t),t}return function(){return p(d.apply(null,arguments))}}(()=>{let e=p("colors"),r=p("spacing"),t=p("blur"),o=p("brightness"),n=p("borderColor"),l=p("borderRadius"),i=p("borderSpacing"),s=p("borderWidth"),a=p("contrast"),c=p("grayscale"),d=p("hueRotate"),u=p("invert"),f=p("gap"),b=p("gradientColorStops"),m=p("gradientColorStopPositions"),g=p("inset"),h=p("margin"),v=p("opacity"),y=p("padding"),x=p("saturate"),P=p("scale"),$=p("sepia"),I=p("skew"),G=p("space"),V=p("translate"),M=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",C,r],L=()=>[C,r],T=()=>["",w,k],U=()=>["auto",z,C],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",C],J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>[z,C];return{cacheSize:500,separator:":",theme:{colors:[W],spacing:[w,k],blur:["none","",R,C],brightness:Q(),borderColor:[e],borderRadius:["none","","full",R,C],borderSpacing:L(),borderWidth:T(),contrast:Q(),grayscale:H(),hueRotate:Q(),invert:H(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[E,k],inset:D(),margin:D(),opacity:Q(),padding:L(),saturate:Q(),scale:Q(),sepia:H(),skew:Q(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",C]}],container:["container"],columns:[{columns:[R]}],"break-after":[{"break-after":J()}],"break-before":[{"break-before":J()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...F(),C]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",S,C]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",C]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",S,C]}],"grid-cols":[{"grid-cols":[W]}],"col-start-end":[{col:["auto",{span:["full",S,C]},C]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[W]}],"row-start-end":[{row:["auto",{span:[S,C]},C]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",C]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",C]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[G]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[G]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",C,r]}],"min-w":[{"min-w":[C,r,"min","max","fit"]}],"max-w":[{"max-w":[C,r,"none","full","min","max","fit","prose",{screen:[R]},R]}],h:[{h:[C,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[C,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[C,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[C,r,"auto","min","max","fit"]}],"font-size":[{text:["base",R,k]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",j]}],"font-family":[{font:[W]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",C]}],"line-clamp":[{"line-clamp":["none",z,j]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",w,C]}],"list-image":[{"list-image":["none",C]}],"list-style-type":[{list:["none","disc","decimal",C]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",w,k]}],"underline-offset":[{"underline-offset":["auto",w,C]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",C]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",C]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),O]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",N]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...K(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:K()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...K()]}],"outline-offset":[{"outline-offset":[w,C]}],"outline-w":[{outline:[w,k]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[w,k]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",R,A]}],"shadow-color":[{shadow:[W]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[o]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",R,C]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[x]}],sepia:[{sepia:[$]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[$]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",C]}],duration:[{duration:Q()}],ease:[{ease:["linear","in","out","in-out",C]}],delay:[{delay:Q()}],animate:[{animate:["none","spin","ping","pulse","bounce",C]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[S,C]}],"translate-x":[{"translate-x":[V]}],"translate-y":[{"translate-y":[V]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",C]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",C]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",C]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[w,k,j]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function L(...e){return D((0,r.clsx)(e))}e.s(["cn",()=>L],33178)},94832,e=>{"use strict";let r,t,o;var n=e.i(99975);function l(e,r){if("function"==typeof e)return e(r);null!=e&&(e.current=r)}var i=e.i(78234),s=((o=n.forwardRef((e,r)=>{let{children:t,...o}=e;if(n.isValidElement(t)){var i;let e,s,a=(i=t,(s=(e=Object.getOwnPropertyDescriptor(i.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?i.ref:(s=(e=Object.getOwnPropertyDescriptor(i,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?i.props.ref:i.props.ref||i.ref),c=function(e,r){let t={...r};for(let o in r){let n=e[o],l=r[o];/^on[A-Z]/.test(o)?n&&l?t[o]=(...e)=>{let r=l(...e);return n(...e),r}:n&&(t[o]=n):"style"===o?t[o]={...n,...l}:"className"===o&&(t[o]=[n,l].filter(Boolean).join(" "))}return{...e,...t}}(o,t.props);return t.type!==n.Fragment&&(c.ref=r?function(...e){return r=>{let t=!1,o=e.map(e=>{let o=l(e,r);return t||"function"!=typeof o||(t=!0),o});if(t)return()=>{for(let r=0;r<o.length;r++){let t=o[r];"function"==typeof t?t():l(e[r],null)}}}}(r,a):a),n.cloneElement(t,c)}return n.Children.count(t)>1?n.Children.only(null):null})).displayName="Slot.SlotClone",r=o,(t=n.forwardRef((e,t)=>{let{children:o,...l}=e,s=n.Children.toArray(o),a=s.find(c);if(a){let e=a.props.children,o=s.map(r=>r!==a?r:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,i.jsx)(r,{...l,ref:t,children:n.isValidElement(e)?n.cloneElement(e,void 0,o):null})}return(0,i.jsx)(r,{...l,ref:t,children:o})})).displayName="Slot.Slot",t),a=Symbol("radix.slottable");function c(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===a}e.s(["Slot",()=>s],94832)},94237,e=>{"use strict";var r=e.i(7284);let t=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,o=r.clsx;e.s(["cva",0,(e,r)=>n=>{var l;if((null==r?void 0:r.variants)==null)return o(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:i,defaultVariants:s}=r,a=Object.keys(i).map(e=>{let r=null==n?void 0:n[e],o=null==s?void 0:s[e];if(null===r)return null;let l=t(r)||t(o);return i[e][l]}),c=n&&Object.entries(n).reduce((e,r)=>{let[t,o]=r;return void 0===o||(e[t]=o),e},{});return o(e,a,null==r||null==(l=r.compoundVariants)?void 0:l.reduce((e,r)=>{let{class:t,className:o,...n}=r;return Object.entries(n).every(e=>{let[r,t]=e;return Array.isArray(t)?t.includes({...s,...c}[r]):({...s,...c})[r]===t})?[...e,t,o]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)}])},81404,e=>{"use strict";var r=e.i(78234),t=e.i(94832),o=e.i(94237),n=e.i(33178);let l=(0,o.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function i({className:e,variant:o,size:i,asChild:s=!1,...a}){let c=s?t.Slot:"button";return(0,r.jsx)(c,{"data-slot":"button",className:(0,n.cn)(l({variant:o,size:i,className:e})),...a})}e.s(["Button",()=>i,"buttonVariants",()=>l])},81137,76173,50700,e=>{"use strict";var r=e.i(99975),t=e.i(64069),o=Object.defineProperty,n=(e,r)=>o(e,"name",{value:r,configurable:!0});function l(e,r){if("function"==typeof e)return e(r);null!=e&&(e.current=r)}function i(...e){return r=>{let t=!1,o=e.map(e=>{let o=l(e,r);return t||"function"!=typeof o||(t=!0),o});if(t)return()=>{for(let r=0;r<o.length;r++){let t=o[r];"function"==typeof t?t():l(e[r],null)}}}}function s(...e){return r.useCallback(i(...e),e)}n(l,"setRef"),n(i,"composeRefs"),n(s,"useComposedRefs"),e.s(["useComposedRefs",()=>s],76173);var a=Object.defineProperty,c=(e,r)=>a(e,"name",{value:r,configurable:!0});function d(e){let t=r.forwardRef((t,o)=>{let{children:n,...l}=t,i=null,a=!1,c=[];v(n)&&"function"==typeof k&&(n=k(n._payload)),r.Children.forEach(n,e=>{if(g(e)){a=!0;let r="child"in e.props?e.props.child:e.props.children;v(r)&&"function"==typeof k&&(r=k(r._payload)),i=f(e,r),c.push(i?.props?.children)}else c.push(e)}),i?i=r.cloneElement(i,void 0,c):!a&&1===r.Children.count(n)&&r.isValidElement(n)&&(i=n);let d=i?m(i):void 0,u=s(o,d);if(!i){if(n||0===n)throw Error(a?w(e):x(e));return n}let p=b(l,i.props??{});return i.type!==r.Fragment&&(p.ref=o?u:d),r.cloneElement(i,p)});return t.displayName=`${e}.Slot`,t}c(d,"createSlot");var u=Symbol.for("radix.slottable");function p(e){let r=c(e=>"child"in e?e.children(e.child):e.children,"Slottable");return r.displayName=`${e}.Slottable`,r.__radixId=u,r}c(p,"createSlottable");var f=c((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function b(e,r){let t={...r};for(let o in r){let n=e[o],l=r[o];/^on[A-Z]/.test(o)?n&&l?t[o]=(...e)=>{let r=l(...e);return n(...e),r}:n&&(t[o]=n):"style"===o?t[o]={...n,...l}:"className"===o&&(t[o]=[n,l].filter(Boolean).join(" "))}return{...e,...t}}function m(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=r&&"isReactWarning"in r&&r.isReactWarning;return t?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}function g(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===u}c(b,"mergeProps"),c(m,"getElementRef"),c(g,"isSlottable");var h=Symbol.for("react.lazy");function v(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===h&&"_payload"in e&&y(e._payload)}function y(e){return"object"==typeof e&&null!==e&&"then"in e}c(v,"isLazyComponent"),c(y,"isPromiseLike");var x=c(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=c(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),k=r[" use ".trim().toString()];e.s(["createSlot",()=>d,"createSlottable",()=>p],50700);var z=e.i(78234),j=Object.defineProperty,S=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let o=d(`Primitive.${t}`),n=r.forwardRef((e,r)=>{let{asChild:n,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,z.jsx)(n?o:t,{...l,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function E(e,r){e&&t.flushSync(()=>e.dispatchEvent(r))}j(E,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),e.s(["Primitive",()=>S,"dispatchDiscreteCustomEvent",()=>E],81137)}]);