promptarc 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/README.md +33 -25
  2. package/dist/bin.js +886 -4
  3. package/dist/share-direct.js +360 -0
  4. package/dist/web/.next/BUILD_ID +1 -1
  5. package/dist/web/.next/app-build-manifest.json +318 -226
  6. package/dist/web/.next/app-path-routes-manifest.json +24 -13
  7. package/dist/web/.next/build-manifest.json +14 -14
  8. package/dist/web/.next/prerender-manifest.json +89 -1
  9. package/dist/web/.next/routes-manifest.json +36 -0
  10. package/dist/web/.next/server/app/_not-found/page.js +1 -1
  11. package/dist/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/dist/web/.next/server/app/api/admin/backfill-ai/route.js +8 -0
  13. package/dist/web/.next/server/app/api/admin/backfill-ai/route.js.nft.json +1 -0
  14. package/dist/web/.next/server/app/api/admin/backfill-ai/route_client-reference-manifest.js +1 -0
  15. package/dist/web/.next/server/app/api/admin/backfill-search/route.js +1 -1
  16. package/dist/web/.next/server/app/api/admin/backfill-search/route.js.nft.json +1 -1
  17. package/dist/web/.next/server/app/api/admin/backfill-search/route_client-reference-manifest.js +1 -1
  18. package/dist/web/.next/server/app/api/ai/context/route.js +31 -0
  19. package/dist/web/.next/server/app/api/ai/context/route.js.nft.json +1 -0
  20. package/dist/web/.next/server/app/api/ai/context/route_client-reference-manifest.js +1 -0
  21. package/dist/web/.next/server/app/api/ai/pr-summary/route.js +28 -0
  22. package/dist/web/.next/server/app/api/ai/pr-summary/route.js.nft.json +1 -0
  23. package/dist/web/.next/server/app/api/ai/pr-summary/route_client-reference-manifest.js +1 -0
  24. package/dist/web/.next/server/app/api/ai/pr-summary-local/route.js +28 -0
  25. package/dist/web/.next/server/app/api/ai/pr-summary-local/route.js.nft.json +1 -0
  26. package/dist/web/.next/server/app/api/ai/pr-summary-local/route_client-reference-manifest.js +1 -0
  27. package/dist/web/.next/server/app/api/ai/process/route.js +8 -0
  28. package/dist/web/.next/server/app/api/ai/process/route.js.nft.json +1 -0
  29. package/dist/web/.next/server/app/api/ai/process/route_client-reference-manifest.js +1 -0
  30. package/dist/web/.next/server/app/api/cli/download/route.js +1 -1
  31. package/dist/web/.next/server/app/api/cli/download/route.js.nft.json +1 -1
  32. package/dist/web/.next/server/app/api/cli/download/route_client-reference-manifest.js +1 -1
  33. package/dist/web/.next/server/app/api/cli/feedback/route_client-reference-manifest.js +1 -1
  34. package/dist/web/.next/server/app/api/cli/init/route_client-reference-manifest.js +1 -1
  35. package/dist/web/.next/server/app/api/cli/my-shares/route.js +1 -1
  36. package/dist/web/.next/server/app/api/cli/my-shares/route_client-reference-manifest.js +1 -1
  37. package/dist/web/.next/server/app/api/cli/poll/route_client-reference-manifest.js +1 -1
  38. package/dist/web/.next/server/app/api/cli/project-settings/route_client-reference-manifest.js +1 -1
  39. package/dist/web/.next/server/app/api/cli/share-mutate/route_client-reference-manifest.js +1 -1
  40. package/dist/web/.next/server/app/api/cli/sync-list/route_client-reference-manifest.js +1 -1
  41. package/dist/web/.next/server/app/api/local/project-sessions/route.js +1 -1
  42. package/dist/web/.next/server/app/api/local/project-sessions/route.js.nft.json +1 -1
  43. package/dist/web/.next/server/app/api/local/project-sessions/route_client-reference-manifest.js +1 -1
  44. package/dist/web/.next/server/app/api/local/watch/route.js +2 -2
  45. package/dist/web/.next/server/app/api/local/watch/route.js.nft.json +1 -1
  46. package/dist/web/.next/server/app/api/local/watch/route_client-reference-manifest.js +1 -1
  47. package/dist/web/.next/server/app/api/search/route.js +1 -1
  48. package/dist/web/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  49. package/dist/web/.next/server/app/api/search-index/route.js +1 -1
  50. package/dist/web/.next/server/app/api/search-index/route.js.nft.json +1 -1
  51. package/dist/web/.next/server/app/api/search-index/route_client-reference-manifest.js +1 -1
  52. package/dist/web/.next/server/app/api/share/download/[slug]/route.js +1 -1
  53. package/dist/web/.next/server/app/api/share/download/[slug]/route.js.nft.json +1 -1
  54. package/dist/web/.next/server/app/api/share/download/[slug]/route_client-reference-manifest.js +1 -1
  55. package/dist/web/.next/server/app/api/share/route.js +1 -1
  56. package/dist/web/.next/server/app/api/share/route.js.nft.json +1 -1
  57. package/dist/web/.next/server/app/api/share/route_client-reference-manifest.js +1 -1
  58. package/dist/web/.next/server/app/api/upload/route.js +2 -2
  59. package/dist/web/.next/server/app/api/upload/route.js.nft.json +1 -1
  60. package/dist/web/.next/server/app/api/upload/route_client-reference-manifest.js +1 -1
  61. package/dist/web/.next/server/app/auth/callback/route_client-reference-manifest.js +1 -1
  62. package/dist/web/.next/server/app/auth/signout/route_client-reference-manifest.js +1 -1
  63. package/dist/web/.next/server/app/blog/ai-coding-agents-2026/page.js +2 -0
  64. package/dist/web/.next/server/app/blog/ai-coding-agents-2026/page.js.nft.json +1 -0
  65. package/dist/web/.next/server/app/blog/ai-coding-agents-2026/page_client-reference-manifest.js +1 -0
  66. package/dist/web/.next/server/app/blog/page.js +2 -0
  67. package/dist/web/.next/server/app/blog/page.js.nft.json +1 -0
  68. package/dist/web/.next/server/app/blog/page_client-reference-manifest.js +1 -0
  69. package/dist/web/.next/server/app/cli/login/page.js +1 -1
  70. package/dist/web/.next/server/app/cli/login/page_client-reference-manifest.js +1 -1
  71. package/dist/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
  72. package/dist/web/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
  73. package/dist/web/.next/server/app/my-projects/[projectKey]/page_client-reference-manifest.js +1 -1
  74. package/dist/web/.next/server/app/my-projects/page_client-reference-manifest.js +1 -1
  75. package/dist/web/.next/server/app/my-shares/page.js +1 -1
  76. package/dist/web/.next/server/app/my-shares/page_client-reference-manifest.js +1 -1
  77. package/dist/web/.next/server/app/opengraph-image/route.js +1 -71
  78. package/dist/web/.next/server/app/opengraph-image/route.js.nft.json +1 -0
  79. package/dist/web/.next/server/app/opengraph-image/route_client-reference-manifest.js +1 -1
  80. package/dist/web/.next/server/app/opengraph-image.body +0 -0
  81. package/dist/web/.next/server/app/opengraph-image.meta +1 -0
  82. package/dist/web/.next/server/app/page.js +2 -2
  83. package/dist/web/.next/server/app/page.js.nft.json +1 -1
  84. package/dist/web/.next/server/app/page_client-reference-manifest.js +1 -1
  85. package/dist/web/.next/server/app/privacy/page.js +2 -0
  86. package/dist/web/.next/server/app/privacy/page.js.nft.json +1 -0
  87. package/dist/web/.next/server/app/privacy/page_client-reference-manifest.js +1 -0
  88. package/dist/web/.next/server/app/projects/[id]/page.js +1 -1
  89. package/dist/web/.next/server/app/projects/[id]/page.js.nft.json +1 -1
  90. package/dist/web/.next/server/app/projects/[id]/page_client-reference-manifest.js +1 -1
  91. package/dist/web/.next/server/app/r/[slug]/opengraph-image/route.js +1 -1
  92. package/dist/web/.next/server/app/r/[slug]/opengraph-image/route_client-reference-manifest.js +1 -1
  93. package/dist/web/.next/server/app/r/[slug]/page.js +2 -2
  94. package/dist/web/.next/server/app/r/[slug]/page.js.nft.json +1 -1
  95. package/dist/web/.next/server/app/r/[slug]/page_client-reference-manifest.js +1 -1
  96. package/dist/web/.next/server/app/robots.txt/route.js +16 -0
  97. package/dist/web/.next/server/app/robots.txt/route.js.nft.json +1 -0
  98. package/dist/web/.next/server/app/robots.txt/route_client-reference-manifest.js +1 -0
  99. package/dist/web/.next/server/app/robots.txt.body +9 -0
  100. package/dist/web/.next/server/app/robots.txt.meta +1 -0
  101. package/dist/web/.next/server/app/search/page_client-reference-manifest.js +1 -1
  102. package/dist/web/.next/server/app/sessions/[projectId]/[sessionId]/page.js +1 -1
  103. package/dist/web/.next/server/app/sessions/[projectId]/[sessionId]/page.js.nft.json +1 -1
  104. package/dist/web/.next/server/app/sessions/[projectId]/[sessionId]/page_client-reference-manifest.js +1 -1
  105. package/dist/web/.next/server/app/sign-in/page.js +1 -1
  106. package/dist/web/.next/server/app/sign-in/page_client-reference-manifest.js +1 -1
  107. package/dist/web/.next/server/app/sitemap.xml/route.js +16 -0
  108. package/dist/web/.next/server/app/sitemap.xml/route.js.nft.json +1 -0
  109. package/dist/web/.next/server/app/sitemap.xml/route_client-reference-manifest.js +1 -0
  110. package/dist/web/.next/server/app/sitemap.xml.body +51 -0
  111. package/dist/web/.next/server/app/sitemap.xml.meta +1 -0
  112. package/dist/web/.next/server/app/terms/page.js +2 -0
  113. package/dist/web/.next/server/app/terms/page.js.nft.json +1 -0
  114. package/dist/web/.next/server/app/terms/page_client-reference-manifest.js +1 -0
  115. package/dist/web/.next/server/app-paths-manifest.json +24 -13
  116. package/dist/web/.next/server/chunks/1017.js +2 -0
  117. package/dist/web/.next/server/chunks/1134.js +8 -0
  118. package/dist/web/.next/server/chunks/1825.js +1 -1
  119. package/dist/web/.next/server/chunks/8334.js +1 -1
  120. package/dist/web/.next/server/functions-config-manifest.json +17 -2
  121. package/dist/web/.next/server/middleware-build-manifest.js +1 -1
  122. package/dist/web/.next/server/middleware-manifest.json +1 -43
  123. package/dist/web/.next/server/pages/500.html +1 -1
  124. package/dist/web/.next/server/server-reference-manifest.js +1 -1
  125. package/dist/web/.next/server/server-reference-manifest.json +1 -1
  126. package/dist/web/.next/static/LF69v3WA6LbEAkvRHNqfG/_buildManifest.js +1 -0
  127. package/dist/web/.next/static/chunks/1029-12dc6d00537d43fd.js +1 -0
  128. package/dist/web/.next/static/chunks/4695-b52fc3d81451c3c3.js +1 -0
  129. package/dist/web/.next/static/chunks/552926ff-c5d04ae0c2d9f826.js +1 -0
  130. package/dist/web/.next/static/chunks/7200-4560b15b9cad37b3.js +1 -0
  131. package/dist/web/.next/static/chunks/app/_not-found/page-0f1123e35eb8f046.js +1 -0
  132. package/dist/web/.next/static/chunks/app/api/admin/backfill-ai/route-0f1123e35eb8f046.js +1 -0
  133. package/dist/web/.next/static/chunks/app/api/admin/backfill-search/route-0f1123e35eb8f046.js +1 -0
  134. package/dist/web/.next/static/chunks/app/api/ai/context/route-0f1123e35eb8f046.js +1 -0
  135. package/dist/web/.next/static/chunks/app/api/ai/pr-summary/route-0f1123e35eb8f046.js +1 -0
  136. package/dist/web/.next/static/chunks/app/api/ai/pr-summary-local/route-0f1123e35eb8f046.js +1 -0
  137. package/dist/web/.next/static/chunks/app/api/ai/process/route-0f1123e35eb8f046.js +1 -0
  138. package/dist/web/.next/static/chunks/app/api/cli/download/route-0f1123e35eb8f046.js +1 -0
  139. package/dist/web/.next/static/chunks/app/api/cli/feedback/route-0f1123e35eb8f046.js +1 -0
  140. package/dist/web/.next/static/chunks/app/api/cli/init/route-0f1123e35eb8f046.js +1 -0
  141. package/dist/web/.next/static/chunks/app/api/cli/my-shares/route-0f1123e35eb8f046.js +1 -0
  142. package/dist/web/.next/static/chunks/app/api/cli/poll/route-0f1123e35eb8f046.js +1 -0
  143. package/dist/web/.next/static/chunks/app/api/cli/project-settings/route-0f1123e35eb8f046.js +1 -0
  144. package/dist/web/.next/static/chunks/app/api/cli/share-mutate/route-0f1123e35eb8f046.js +1 -0
  145. package/dist/web/.next/static/chunks/app/api/cli/sync-list/route-0f1123e35eb8f046.js +1 -0
  146. package/dist/web/.next/static/chunks/app/api/local/project-sessions/route-0f1123e35eb8f046.js +1 -0
  147. package/dist/web/.next/static/chunks/app/api/local/watch/route-0f1123e35eb8f046.js +1 -0
  148. package/dist/web/.next/static/chunks/app/api/search/route-0f1123e35eb8f046.js +1 -0
  149. package/dist/web/.next/static/chunks/app/api/search-index/route-0f1123e35eb8f046.js +1 -0
  150. package/dist/web/.next/static/chunks/app/api/share/download/[slug]/route-0f1123e35eb8f046.js +1 -0
  151. package/dist/web/.next/static/chunks/app/api/share/route-0f1123e35eb8f046.js +1 -0
  152. package/dist/web/.next/static/chunks/app/api/upload/route-0f1123e35eb8f046.js +1 -0
  153. package/dist/web/.next/static/chunks/app/auth/callback/route-0f1123e35eb8f046.js +1 -0
  154. package/dist/web/.next/static/chunks/app/auth/signout/route-0f1123e35eb8f046.js +1 -0
  155. package/dist/web/.next/static/chunks/app/blog/ai-coding-agents-2026/page-0f1123e35eb8f046.js +1 -0
  156. package/dist/web/.next/static/chunks/app/blog/layout-9b51270472318488.js +1 -0
  157. package/dist/web/.next/static/chunks/app/blog/page-8400ea4ac5a7eb44.js +1 -0
  158. package/dist/web/.next/static/chunks/app/cli/login/page-26287cfd64c0fb49.js +1 -0
  159. package/dist/web/.next/static/chunks/app/digest/page-8400ea4ac5a7eb44.js +1 -0
  160. package/dist/web/.next/static/chunks/app/feedback/page-55ef0005807f1cef.js +1 -0
  161. package/dist/web/.next/static/chunks/app/layout-aa56caf2bf5af86f.js +1 -0
  162. package/dist/web/.next/static/chunks/app/my-projects/[projectKey]/page-7c5f2badf689d2e8.js +1 -0
  163. package/dist/web/.next/static/chunks/app/my-projects/page-c0390151fd6332a0.js +1 -0
  164. package/dist/web/.next/static/chunks/app/my-shares/{page-697d61e07a7546b2.js → page-49c0112973401c14.js} +1 -1
  165. package/dist/web/.next/static/chunks/app/not-found-8400ea4ac5a7eb44.js +1 -0
  166. package/dist/web/.next/static/chunks/app/opengraph-image/route-0f1123e35eb8f046.js +1 -0
  167. package/dist/web/.next/static/chunks/app/page-95394e3c6370084f.js +1 -0
  168. package/dist/web/.next/static/chunks/app/privacy/page-9b51270472318488.js +1 -0
  169. package/dist/web/.next/static/chunks/app/projects/[id]/page-7dd46a825d03a7d9.js +1 -0
  170. package/dist/web/.next/static/chunks/app/r/[slug]/opengraph-image/route-0f1123e35eb8f046.js +1 -0
  171. package/dist/web/.next/static/chunks/app/r/[slug]/page-6a0983805e048ac3.js +1 -0
  172. package/dist/web/.next/static/chunks/app/robots.txt/route-0f1123e35eb8f046.js +1 -0
  173. package/dist/web/.next/static/chunks/app/search/page-c29f37dc2462b676.js +1 -0
  174. package/dist/web/.next/static/chunks/app/sessions/[projectId]/[sessionId]/page-87b4505dd32edb9d.js +1 -0
  175. package/dist/web/.next/static/chunks/app/sign-in/page-fea3971ff9237b72.js +1 -0
  176. package/dist/web/.next/static/chunks/app/sitemap.xml/route-0f1123e35eb8f046.js +1 -0
  177. package/dist/web/.next/static/chunks/app/terms/page-9b51270472318488.js +1 -0
  178. package/dist/web/.next/static/chunks/d99d8e6a-55da88efbe15e3e1.js +1 -0
  179. package/dist/web/.next/static/chunks/framework-c1efa271b5a96d9d.js +1 -0
  180. package/dist/web/.next/static/chunks/main-app-70de904c7caade50.js +1 -0
  181. package/dist/web/.next/static/chunks/main-d211cddc79aac1cb.js +1 -0
  182. package/dist/web/.next/static/chunks/pages/{_app-42b849402a54b9e6.js → _app-701b0752a0d4c3a9.js} +1 -1
  183. package/dist/web/.next/static/chunks/pages/_error-327385abc873a736.js +1 -0
  184. package/dist/web/.next/static/chunks/{webpack-3a8b65d12c8eb987.js → webpack-3a446128dfa39f85.js} +1 -1
  185. package/dist/web/.next/static/css/c76bb7513858c50c.css +3 -0
  186. package/dist/web/package.json +1 -0
  187. package/dist/web/public/apple-touch-icon.png +0 -0
  188. package/dist/web/public/favicon-16.png +0 -0
  189. package/dist/web/public/favicon-32.png +0 -0
  190. package/dist/web/public/icon-192.png +0 -0
  191. package/dist/web/public/icon-512.png +0 -0
  192. package/dist/web/public/logo.png +0 -0
  193. package/package.json +1 -1
  194. package/dist/web/.next/server/app/opengraph-image/route.js.map +0 -1
  195. package/dist/web/.next/server/chunks/6019.js +0 -2
  196. package/dist/web/.next/server/edge-chunks/asset_noto-sans-v27-latin-regular.5dda3fca77107598.ttf +0 -0
  197. package/dist/web/.next/server/edge-chunks/wasm_77d9faebf7af9e421806970ce10a58e9d83116d7.wasm +0 -0
  198. package/dist/web/.next/server/edge-chunks/wasm_ef4866ecae192fd87727067cf2c0c0cf9fb8b020.wasm +0 -0
  199. package/dist/web/.next/server/edge-runtime-webpack.js +0 -2
  200. package/dist/web/.next/server/interception-route-rewrite-manifest.js +0 -1
  201. package/dist/web/.next/static/ZxFskpyUoxefJOzSxSb6s/_buildManifest.js +0 -1
  202. package/dist/web/.next/static/chunks/200-619918ea0fdbd6ff.js +0 -1
  203. package/dist/web/.next/static/chunks/29-7904810aeffd75a0.js +0 -1
  204. package/dist/web/.next/static/chunks/552926ff-e8a371ec0133d0dc.js +0 -1
  205. package/dist/web/.next/static/chunks/695-00bca043953d4170.js +0 -1
  206. package/dist/web/.next/static/chunks/app/_not-found/page-bd7ebde8ab75cb95.js +0 -1
  207. package/dist/web/.next/static/chunks/app/api/admin/backfill-search/route-bd7ebde8ab75cb95.js +0 -1
  208. package/dist/web/.next/static/chunks/app/api/cli/download/route-bd7ebde8ab75cb95.js +0 -1
  209. package/dist/web/.next/static/chunks/app/api/cli/feedback/route-bd7ebde8ab75cb95.js +0 -1
  210. package/dist/web/.next/static/chunks/app/api/cli/init/route-bd7ebde8ab75cb95.js +0 -1
  211. package/dist/web/.next/static/chunks/app/api/cli/my-shares/route-bd7ebde8ab75cb95.js +0 -1
  212. package/dist/web/.next/static/chunks/app/api/cli/poll/route-bd7ebde8ab75cb95.js +0 -1
  213. package/dist/web/.next/static/chunks/app/api/cli/project-settings/route-bd7ebde8ab75cb95.js +0 -1
  214. package/dist/web/.next/static/chunks/app/api/cli/share-mutate/route-bd7ebde8ab75cb95.js +0 -1
  215. package/dist/web/.next/static/chunks/app/api/cli/sync-list/route-bd7ebde8ab75cb95.js +0 -1
  216. package/dist/web/.next/static/chunks/app/api/local/project-sessions/route-bd7ebde8ab75cb95.js +0 -1
  217. package/dist/web/.next/static/chunks/app/api/local/watch/route-bd7ebde8ab75cb95.js +0 -1
  218. package/dist/web/.next/static/chunks/app/api/search/route-bd7ebde8ab75cb95.js +0 -1
  219. package/dist/web/.next/static/chunks/app/api/search-index/route-bd7ebde8ab75cb95.js +0 -1
  220. package/dist/web/.next/static/chunks/app/api/share/download/[slug]/route-bd7ebde8ab75cb95.js +0 -1
  221. package/dist/web/.next/static/chunks/app/api/share/route-bd7ebde8ab75cb95.js +0 -1
  222. package/dist/web/.next/static/chunks/app/api/upload/route-bd7ebde8ab75cb95.js +0 -1
  223. package/dist/web/.next/static/chunks/app/auth/callback/route-bd7ebde8ab75cb95.js +0 -1
  224. package/dist/web/.next/static/chunks/app/auth/signout/route-bd7ebde8ab75cb95.js +0 -1
  225. package/dist/web/.next/static/chunks/app/cli/login/page-647fd605d0fe2472.js +0 -1
  226. package/dist/web/.next/static/chunks/app/digest/page-41ec674edc998616.js +0 -1
  227. package/dist/web/.next/static/chunks/app/feedback/page-60f4d489fd598c9c.js +0 -1
  228. package/dist/web/.next/static/chunks/app/layout-f5666b9135264807.js +0 -1
  229. package/dist/web/.next/static/chunks/app/my-projects/[projectKey]/page-3a816489e5e8534b.js +0 -1
  230. package/dist/web/.next/static/chunks/app/my-projects/page-c88eba56cb5d0b8d.js +0 -1
  231. package/dist/web/.next/static/chunks/app/not-found-41ec674edc998616.js +0 -1
  232. package/dist/web/.next/static/chunks/app/opengraph-image/route-bd7ebde8ab75cb95.js +0 -1
  233. package/dist/web/.next/static/chunks/app/page-e6e80157848514e3.js +0 -1
  234. package/dist/web/.next/static/chunks/app/projects/[id]/page-faec0dc5b09bd35f.js +0 -1
  235. package/dist/web/.next/static/chunks/app/r/[slug]/opengraph-image/route-bd7ebde8ab75cb95.js +0 -1
  236. package/dist/web/.next/static/chunks/app/r/[slug]/page-65707eb198f673a1.js +0 -1
  237. package/dist/web/.next/static/chunks/app/search/page-fc0b629efa815c64.js +0 -1
  238. package/dist/web/.next/static/chunks/app/sessions/[projectId]/[sessionId]/page-5e70eaa0a429d94a.js +0 -1
  239. package/dist/web/.next/static/chunks/app/sign-in/page-792d0d79889186cf.js +0 -1
  240. package/dist/web/.next/static/chunks/d99d8e6a-80443bd3c9d31f50.js +0 -1
  241. package/dist/web/.next/static/chunks/framework-39000e34f38d10f6.js +0 -1
  242. package/dist/web/.next/static/chunks/main-app-21e9441fa7ac15ef.js +0 -1
  243. package/dist/web/.next/static/chunks/main-f824d48fd7ff2e3b.js +0 -1
  244. package/dist/web/.next/static/chunks/pages/_error-412ff705bc5b0636.js +0 -1
  245. package/dist/web/.next/static/css/3c4744a7426424ee.css +0 -3
  246. /package/dist/web/.next/static/{ZxFskpyUoxefJOzSxSb6s → LF69v3WA6LbEAkvRHNqfG}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2994],{6485:(e,t,s)=>{s.d(t,{A:()=>p});var r=s(1556),i=s(6129),a=s(4495),n=s(4824),o=s(5509),l=s(1583),u=s(6084),h=s(519),c=s(4464),d=s(6120),_=s(6345),w=s(7236);(0,h.V)();let g={url:i.nf,storageKey:i.AQ,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:i.Rn,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function f(e,t,s){return await s()}let y={};class b{get jwks(){var e,t;return null!=(t=null==(e=y[this.storageKey])?void 0:e.jwks)?t:{keys:[]}}set jwks(e){y[this.storageKey]=Object.assign(Object.assign({},y[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return null!=(t=null==(e=y[this.storageKey])?void 0:e.cachedAt)?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){y[this.storageKey]=Object.assign(Object.assign({},y[this.storageKey]),{cachedAt:e})}constructor(e){var t,s,i;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let a=Object.assign(Object.assign({},g),e);if(this.storageKey=a.storageKey,this.instanceID=null!=(t=b.nextInstanceID[this.storageKey])?t:0,b.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,"function"==typeof a.debug&&(this.logger=a.debug),this.instanceID>0&&(0,o.Bd)()){let e=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=a.persistSession,this.autoRefreshToken=a.autoRefreshToken,this.admin=new r.A({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=(0,o.lA)(a.fetch),this.lock=a.lock||f,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,this.lockAcquireTimeout=a.lockAcquireTimeout,a.lock?this.lock=a.lock:this.persistSession&&(0,o.Bd)()&&(null==(s=null==globalThis?void 0:globalThis.navigator)?void 0:s.locks)?this.lock=u.JS:this.lock=f,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new w.H1(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(a.storage?this.storage=a.storage:(0,o.LJ)()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=(0,l.r)(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=(0,l.r)(this.memoryStorage)),(0,o.Bd)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",e)}null==(i=this.broadcastChannel)||i.addEventListener("message",async e=>{this._debug("received broadcast notification from other tab or client",e);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(e){this._debug("#broadcastChannel","error",e)}})}a.skipAutoInitialize||this.initialize().catch(e=>{this._debug("#initialize()","error",e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${c.r}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))()),await this.initializePromise}async _initialize(){var e;try{let t={},s="none";if((0,o.Bd)()&&(t=(0,o.XR)(window.location.href),this._isImplicitGrantCallback(t)?s="implicit":await this._isPKCECallback(t)&&(s="pkce")),(0,o.Bd)()&&this.detectSessionInUrl&&"none"!==s){let{data:r,error:i}=await this._getSessionFromURL(t,s);if(i){(this._debug("#_initialize()","error detecting session from URL",i),(0,a.MJ)(i))&&(null==(e=i.details)||e.code);return{error:i}}let{session:n,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",n,"redirect type",o),await this._saveSession(n),setTimeout(async()=>{"recovery"===o?await this._notifyAllSubscribers("PASSWORD_RECOVERY",n):await this._notifyAllSubscribers("SIGNED_IN",n)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){if((0,a.HY)(e))return this._returnResult({error:e});return this._returnResult({error:new a.HU("Unexpected error during initialization",e)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,s,r;try{let{data:i,error:a}=await (0,n.vE)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:null!=(s=null==(t=null==e?void 0:e.options)?void 0:t.data)?s:{},gotrue_meta_security:{captcha_token:null==(r=null==e?void 0:e.options)?void 0:r.captchaToken}},xform:n.R_});if(a||!i)return this._returnResult({data:{user:null,session:null},error:a});let o=i.session,l=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",o)),this._returnResult({data:{user:l,session:o},error:null})}catch(e){if((0,a.HY)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){var t,s,r;try{let i;if("email"in e){let{email:s,password:r,options:a}=e,l=null,u=null;"pkce"===this.flowType&&([l,u]=await (0,o.dS)(this.storage,this.storageKey)),i=await (0,n.vE)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==a?void 0:a.emailRedirectTo,body:{email:s,password:r,data:null!=(t=null==a?void 0:a.data)?t:{},gotrue_meta_security:{captcha_token:null==a?void 0:a.captchaToken},code_challenge:l,code_challenge_method:u},xform:n.R_})}else if("phone"in e){let{phone:t,password:a,options:o}=e;i=await (0,n.vE)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:a,data:null!=(s=null==o?void 0:o.data)?s:{},channel:null!=(r=null==o?void 0:o.channel)?r:"sms",gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken}},xform:n.R_})}else throw new a.U_("You must provide either an email or phone number and a password");let{data:l,error:u}=i;if(u||!l)return await (0,o.Gb)(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:u});let h=l.session,c=l.user;return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",h)),this._returnResult({data:{user:c,session:h},error:null})}catch(e){if(await (0,o.Gb)(this.storage,`${this.storageKey}-code-verifier`),(0,a.HY)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if("email"in e){let{email:s,password:r,options:i}=e;t=await (0,n.vE)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:n.GC})}else if("phone"in e){let{phone:s,password:r,options:i}=e;t=await (0,n.vE)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:n.GC})}else throw new a.U_("You must provide either an email or phone number and a password");let{data:s,error:r}=t;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!s||!s.session||!s.user){let e=new a.Ox;return this._returnResult({data:{user:null,session:null},error:e})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:r})}catch(e){if((0,a.HY)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){var t,s,r,i;return await this._handleProviderSignIn(e.provider,{redirectTo:null==(t=e.options)?void 0:t.redirectTo,scopes:null==(s=e.options)?void 0:s.scopes,queryParams:null==(r=e.options)?void 0:r.queryParams,skipBrowserRedirect:null==(i=e.options)?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,s,r,i,l,u,h,c,d,w,g;let f,y;if("message"in e)f=e.message,y=e.signature;else{let a,{chain:n,wallet:w,statement:g,options:b}=e;if((0,o.Bd)())if("object"==typeof w)a=w;else{let e=window;if("ethereum"in e&&"object"==typeof e.ethereum&&"request"in e.ethereum&&"function"==typeof e.ethereum.request)a=e.ethereum;else throw Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if("object"!=typeof w||!(null==b?void 0:b.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");a=w}let p=new URL(null!=(t=null==b?void 0:b.url)?t:window.location.href),v=await a.request({method:"eth_requestAccounts"}).then(e=>e).catch(()=>{throw Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!v||0===v.length)throw Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");let k=(0,_.bv)(v[0]),m=null==(s=null==b?void 0:b.signInWithEthereum)?void 0:s.chainId;if(!m){let e=await a.request({method:"eth_chainId"});m=(0,_.aD)(e)}let S={domain:p.host,address:k,statement:g,uri:p.href,version:"1",chainId:m,nonce:null==(r=null==b?void 0:b.signInWithEthereum)?void 0:r.nonce,issuedAt:null!=(l=null==(i=null==b?void 0:b.signInWithEthereum)?void 0:i.issuedAt)?l:new Date,expirationTime:null==(u=null==b?void 0:b.signInWithEthereum)?void 0:u.expirationTime,notBefore:null==(h=null==b?void 0:b.signInWithEthereum)?void 0:h.notBefore,requestId:null==(c=null==b?void 0:b.signInWithEthereum)?void 0:c.requestId,resources:null==(d=null==b?void 0:b.signInWithEthereum)?void 0:d.resources};f=(0,_.ob)(S),y=await a.request({method:"personal_sign",params:[(0,_.nj)(f),k]})}try{let{data:t,error:s}=await (0,n.vE)(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:y},(null==(w=e.options)?void 0:w.captchaToken)?{gotrue_meta_security:{captcha_token:null==(g=e.options)?void 0:g.captchaToken}}:null),xform:n.R_});if(s)throw s;if(!t||!t.session||!t.user){let e=new a.Ox;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:s})}catch(e){if((0,a.HY)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){var t,s,r,i,l,u,h,c,_,w,g,f;let y,b;if("message"in e)y=e.message,b=e.signature;else{let a,{chain:n,wallet:d,statement:g,options:f}=e;if((0,o.Bd)())if("object"==typeof d)a=d;else{let e=window;if("solana"in e&&"object"==typeof e.solana&&("signIn"in e.solana&&"function"==typeof e.solana.signIn||"signMessage"in e.solana&&"function"==typeof e.solana.signMessage))a=e.solana;else throw Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if("object"!=typeof d||!(null==f?void 0:f.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");a=d}let p=new URL(null!=(t=null==f?void 0:f.url)?t:window.location.href);if("signIn"in a&&a.signIn){let e,t=await a.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},null==f?void 0:f.signInWithSolana),{version:"1",domain:p.host,uri:p.href}),g?{statement:g}:null));if(Array.isArray(t)&&t[0]&&"object"==typeof t[0])e=t[0];else if(t&&"object"==typeof t&&"signedMessage"in t&&"signature"in t)e=t;else throw Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in e&&"signature"in e&&("string"==typeof e.signedMessage||e.signedMessage instanceof Uint8Array)&&e.signature instanceof Uint8Array)y="string"==typeof e.signedMessage?e.signedMessage:new TextDecoder().decode(e.signedMessage),b=e.signature;else throw Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in a)||"function"!=typeof a.signMessage||!("publicKey"in a)||"object"!=typeof a||!a.publicKey||!("toBase58"in a.publicKey)||"function"!=typeof a.publicKey.toBase58)throw Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");y=[`${p.host} wants you to sign in with your Solana account:`,a.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${p.href}`,`Issued At: ${null!=(r=null==(s=null==f?void 0:f.signInWithSolana)?void 0:s.issuedAt)?r:new Date().toISOString()}`,...(null==(i=null==f?void 0:f.signInWithSolana)?void 0:i.notBefore)?[`Not Before: ${f.signInWithSolana.notBefore}`]:[],...(null==(l=null==f?void 0:f.signInWithSolana)?void 0:l.expirationTime)?[`Expiration Time: ${f.signInWithSolana.expirationTime}`]:[],...(null==(u=null==f?void 0:f.signInWithSolana)?void 0:u.chainId)?[`Chain ID: ${f.signInWithSolana.chainId}`]:[],...(null==(h=null==f?void 0:f.signInWithSolana)?void 0:h.nonce)?[`Nonce: ${f.signInWithSolana.nonce}`]:[],...(null==(c=null==f?void 0:f.signInWithSolana)?void 0:c.requestId)?[`Request ID: ${f.signInWithSolana.requestId}`]:[],...(null==(w=null==(_=null==f?void 0:f.signInWithSolana)?void 0:_.resources)?void 0:w.length)?["Resources",...f.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join("\n");let e=await a.signMessage(new TextEncoder().encode(y),"utf8");if(!e||!(e instanceof Uint8Array))throw Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");b=e}}try{let{data:t,error:s}=await (0,n.vE)(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:y,signature:(0,d.no)(b)},(null==(g=e.options)?void 0:g.captchaToken)?{gotrue_meta_security:{captcha_token:null==(f=e.options)?void 0:f.captchaToken}}:null),xform:n.R_});if(s)throw s;if(!t||!t.session||!t.user){let e=new a.Ox;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:s})}catch(e){if((0,a.HY)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let t=await (0,o.U9)(this.storage,`${this.storageKey}-code-verifier`),[s,r]=(null!=t?t:"").split("/");try{if(!s&&"pkce"===this.flowType)throw new a.lh;let{data:t,error:i}=await (0,n.vE)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:s},xform:n.R_});if(await (0,o.Gb)(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!t||!t.session||!t.user){let e=new a.Ox;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign(Object.assign({},t),{redirectType:null!=r?r:null}),error:i})}catch(e){if(await (0,o.Gb)(this.storage,`${this.storageKey}-code-verifier`),(0,a.HY)(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:s,token:r,access_token:i,nonce:o}=e,{data:l,error:u}=await (0,n.vE)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:r,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:n.R_});if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){let e=new a.Ox;return this._returnResult({data:{user:null,session:null},error:e})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(e){if((0,a.HY)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){var t,s,r,i,l;try{if("email"in e){let{email:r,options:i}=e,a=null,l=null;"pkce"===this.flowType&&([a,l]=await (0,o.dS)(this.storage,this.storageKey));let{error:u}=await (0,n.vE)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:r,data:null!=(t=null==i?void 0:i.data)?t:{},create_user:null==(s=null==i?void 0:i.shouldCreateUser)||s,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:a,code_challenge_method:l},redirectTo:null==i?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:u})}if("phone"in e){let{phone:t,options:s}=e,{data:a,error:o}=await (0,n.vE)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!=(r=null==s?void 0:s.data)?r:{},create_user:null==(i=null==s?void 0:s.shouldCreateUser)||i,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},channel:null!=(l=null==s?void 0:s.channel)?l:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:null==a?void 0:a.message_id},error:o})}throw new a.U_("You must provide either an email or phone number.")}catch(e){if(await (0,o.Gb)(this.storage,`${this.storageKey}-code-verifier`),(0,a.HY)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){var t,s;try{let r,i;"options"in e&&(r=null==(t=e.options)?void 0:t.redirectTo,i=null==(s=e.options)?void 0:s.captchaToken);let{data:a,error:o}=await (0,n.vE)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:r,xform:n.R_});if(o)throw o;if(!a)throw Error("An error occurred on token verification.");let l=a.session,u=a.user;return(null==l?void 0:l.access_token)&&(await this._saveSession(l),await this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(e){if((0,a.HY)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){var t,s,r,i,l;try{let a=null,u=null;"pkce"===this.flowType&&([a,u]=await (0,o.dS)(this.storage,this.storageKey));let h=await (0,n.vE)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!=(s=null==(t=e.options)?void 0:t.redirectTo)?s:void 0}),(null==(r=null==e?void 0:e.options)?void 0:r.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:u}),headers:this.headers,xform:n.c2});return(null==(i=h.data)?void 0:i.url)&&(0,o.Bd)()&&!(null==(l=e.options)?void 0:l.skipBrowserRedirect)&&window.location.assign(h.data.url),this._returnResult(h)}catch(e){if(await (0,o.Gb)(this.storage,`${this.storageKey}-code-verifier`),(0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:s}=e;if(s)throw s;if(!t)throw new a.jG;let{error:r}=await (0,n.vE)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(e){if((0,a.HY)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if("email"in e){let{email:s,type:r,options:i}=e,{error:a}=await (0,n.vE)(this.fetch,"POST",t,{headers:this.headers,body:{email:s,type:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},redirectTo:null==i?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if("phone"in e){let{phone:s,type:r,options:i}=e,{data:a,error:o}=await (0,n.vE)(this.fetch,"POST",t,{headers:this.headers,body:{phone:s,type:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:null==a?void 0:a.message_id},error:o})}throw new a.U_("You must provide either an email or phone number and a type")}catch(e){if((0,a.HY)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await s}catch(e){}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(e){}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",Error().stack);try{let e=null,t=await (0,o.U9)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),null!==t&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let s=!!e.expires_at&&1e3*e.expires_at-Date.now()<i.CT;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",e.expires_at),!s){if(this.userStorage){let t=await (0,o.U9)(this.userStorage,this.storageKey+"-user");(null==t?void 0:t.user)?e.user=t.user:e.user=(0,o.QE)()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let t={value:this.suppressGetSessionWarning};e.user=(0,o.uO)(e.user,t),t.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}let{data:r,error:a}=await this._callRefreshToken(e.refresh_token);if(a)return this._returnResult({data:{session:null},error:a});return this._returnResult({data:{session:r},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{if(e)return await (0,n.vE)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:n.Cl});return await this._useSession(async e=>{var t,s,r;let{data:i,error:o}=e;if(o)throw o;return(null==(t=i.session)?void 0:t.access_token)||this.hasCustomAuthorizationHeader?await (0,n.vE)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!=(r=null==(s=i.session)?void 0:s.access_token)?r:void 0,xform:n.Cl}):{data:{user:null},error:new a.jG}})}catch(e){if((0,a.HY)(e))return(0,a.zq)(e)&&(await this._removeSession(),await (0,o.Gb)(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async s=>{let{data:r,error:i}=s;if(i)throw i;if(!r.session)throw new a.jG;let l=r.session,u=null,h=null;"pkce"===this.flowType&&null!=e.email&&([u,h]=await (0,o.dS)(this.storage,this.storageKey));let{data:c,error:d}=await (0,n.vE)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:u,code_challenge_method:h}),jwt:l.access_token,xform:n.Cl});if(d)throw d;return l.user=c.user,await this._saveSession(l),await this._notifyAllSubscribers("USER_UPDATED",l),this._returnResult({data:{user:l.user},error:null})})}catch(e){if(await (0,o.Gb)(this.storage,`${this.storageKey}-code-verifier`),(0,a.HY)(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new a.jG;let t=Date.now()/1e3,s=t,r=!0,i=null,{payload:n}=(0,o.Cq)(e.access_token);if(n.exp&&(r=(s=n.exp)<=t),r){let{data:t,error:s}=await this._callRefreshToken(e.refresh_token);if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:r,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:"bearer",expires_in:s-t,expires_at:s},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(e){if((0,a.HY)(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var s;if(!e){let{data:r,error:i}=t;if(i)throw i;e=null!=(s=r.session)?s:void 0}if(!(null==e?void 0:e.refresh_token))throw new a.jG;let{data:r,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):r?this._returnResult({data:{user:r.user,session:r},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if((0,a.HY)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!(0,o.Bd)())throw new a.MR("No browser detected.");if(e.error||e.error_description||e.error_code)throw new a.MR(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if("pkce"===this.flowType)throw new a.Uw("Not a valid PKCE flow url.");break;case"pkce":if("implicit"===this.flowType)throw new a.MR("Not a valid implicit grant flow url.")}if("pkce"===t){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new a.Uw("No code detected.");let{data:t,error:s}=await this._exchangeCodeForSession(e.code);if(s)throw s;let r=new URL(window.location.href);return r.searchParams.delete("code"),window.history.replaceState(window.history.state,"",r.toString()),{data:{session:t.session,redirectType:null},error:null}}let{provider_token:s,provider_refresh_token:r,access_token:n,refresh_token:l,expires_in:u,expires_at:h,token_type:c}=e;if(!n||!u||!l||!c)throw new a.MR("No session defined in URL");let d=Math.round(Date.now()/1e3),_=parseInt(u),w=d+_;h&&(w=parseInt(h));let g=w-d;1e3*g<=i.a4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${g}s, should have been closer to ${_}s`);let f=w-_;d-f>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",f,w,d):d-f<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",f,w,d);let{data:y,error:b}=await this._getUser(n);if(b)throw b;let p={provider_token:s,provider_refresh_token:r,access_token:n,expires_in:_,expires_at:w,refresh_token:l,token_type:c,user:y.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:p,redirectType:e.type},error:null})}catch(e){if((0,a.HY)(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return"function"==typeof this.detectSessionInUrl?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){let t=await (0,o.U9)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var s;let{data:r,error:i}=t;if(i&&!(0,a.zq)(i))return this._returnResult({error:i});let n=null==(s=r.session)?void 0:s.access_token;if(n){let{error:t}=await this.admin.signOut(n,e);if(t&&!((0,a.NA)(t)&&(404===t.status||401===t.status||403===t.status)||(0,a.zq)(t)))return this._returnResult({error:t})}return"others"!==e&&(await this._removeSession(),await (0,o.Gb)(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let t=(0,o.KY)(),s={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,s),(async()=>{await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:s}}}async _emitInitialSession(e){return await this._useSession(async t=>{var s,r;try{let{data:{session:r},error:i}=t;if(i)throw i;await (null==(s=this.stateChangeEmitters.get(e))?void 0:s.callback("INITIAL_SESSION",r)),this._debug("INITIAL_SESSION","callback id",e,"session",r)}catch(t){await (null==(r=this.stateChangeEmitters.get(e))?void 0:r.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),(0,a.zq)(t)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let s=null,r=null;"pkce"===this.flowType&&([s,r]=await (0,o.dS)(this.storage,this.storageKey,!0));try{return await (0,n.vE)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:s,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await (0,o.Gb)(this.storage,`${this.storageKey}-code-verifier`),(0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){var e;try{let{data:t,error:s}=await this.getUser();if(s)throw s;return this._returnResult({data:{identities:null!=(e=t.user.identities)?e:[]},error:null})}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var t;try{let{data:s,error:r}=await this._useSession(async t=>{var s,r,i,a,o;let{data:l,error:u}=t;if(u)throw u;let h=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null==(s=e.options)?void 0:s.redirectTo,scopes:null==(r=e.options)?void 0:r.scopes,queryParams:null==(i=e.options)?void 0:i.queryParams,skipBrowserRedirect:!0});return await (0,n.vE)(this.fetch,"GET",h,{headers:this.headers,jwt:null!=(o=null==(a=l.session)?void 0:a.access_token)?o:void 0})});if(r)throw r;return!(0,o.Bd)()||(null==(t=e.options)?void 0:t.skipBrowserRedirect)||window.location.assign(null==s?void 0:s.url),this._returnResult({data:{provider:e.provider,url:null==s?void 0:s.url},error:null})}catch(t){if((0,a.HY)(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var s;try{let{error:r,data:{session:i}}=t;if(r)throw r;let{options:o,provider:l,token:u,access_token:h,nonce:c}=e,{data:d,error:_}=await (0,n.vE)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:null!=(s=null==i?void 0:i.access_token)?s:void 0,body:{provider:l,id_token:u,access_token:h,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken}},xform:n.R_});if(_)return this._returnResult({data:{user:null,session:null},error:_});if(!d||!d.session||!d.user)return this._returnResult({data:{user:null,session:null},error:new a.Ox});return d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("USER_UPDATED",d.session)),this._returnResult({data:d,error:_})}catch(e){if(await (0,o.Gb)(this.storage,`${this.storageKey}-code-verifier`),(0,a.HY)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var s,r;let{data:i,error:a}=t;if(a)throw a;return await (0,n.vE)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!=(r=null==(s=i.session)?void 0:s.access_token)?r:void 0})})}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{let s=Date.now();return await (0,o.PB)(async s=>(s>0&&await (0,o.yy)(200*Math.pow(2,s-1)),this._debug(t,"refreshing attempt",s),await (0,n.vE)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:n.R_})),(e,t)=>{let r=200*Math.pow(2,e);return t&&(0,a.Fw)(t)&&Date.now()+r-s<i.a4})}catch(e){if(this._debug(t,"error",e),(0,a.HY)(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,"end")}}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){let s=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",s),(0,o.Bd)()&&!t.skipBrowserRedirect&&window.location.assign(s),{data:{provider:e,url:s},error:null}}async _recoverAndRefresh(){var e,t;let s="#_recoverAndRefresh()";this._debug(s,"begin");try{let r=await (0,o.U9)(this.storage,this.storageKey);if(r&&this.userStorage){let t=await (0,o.U9)(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!t&&(t={user:r.user},await (0,o.Oi)(this.userStorage,this.storageKey+"-user",t)),r.user=null!=(e=null==t?void 0:t.user)?e:(0,o.QE)()}else if(r&&!r.user&&!r.user){let e=await (0,o.U9)(this.storage,this.storageKey+"-user");e&&(null==e?void 0:e.user)?(r.user=e.user,await (0,o.Gb)(this.storage,this.storageKey+"-user"),await (0,o.Oi)(this.storage,this.storageKey,r)):r.user=(0,o.QE)()}if(this._debug(s,"session from storage",r),!this._isValidSession(r)){this._debug(s,"session is not valid"),null!==r&&await this._removeSession();return}let n=(null!=(t=r.expires_at)?t:1/0)*1e3-Date.now()<i.CT;if(this._debug(s,`session has${n?"":" not"} expired with margin of ${i.CT}s`),n){if(this.autoRefreshToken&&r.refresh_token){let{error:e}=await this._callRefreshToken(r.refresh_token);e&&(console.error(e),(0,a.Fw)(e)||(this._debug(s,"refresh failed with a non-retryable error, removing the session",e),await this._removeSession()))}}else if(r.user&&!0===r.user.__isUserNotAvailableProxy)try{let{data:e,error:t}=await this._getUser(r.access_token);!t&&(null==e?void 0:e.user)?(r.user=e.user,await this._saveSession(r),await this._notifyAllSubscribers("SIGNED_IN",r)):this._debug(s,"could not get user data, skipping SIGNED_IN notification")}catch(e){console.error("Error getting user data:",e),this._debug(s,"error getting user data, skipping SIGNED_IN notification",e)}else await this._notifyAllSubscribers("SIGNED_IN",r)}catch(e){this._debug(s,"error",e),console.error(e);return}finally{this._debug(s,"end")}}async _callRefreshToken(e){var t,s;if(!e)throw new a.jG;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let r=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{this.refreshingDeferred=new o.cY;let{data:t,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!t.session)throw new a.jG;await this._saveSession(t.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);let r={data:t.session,error:null};return this.refreshingDeferred.resolve(r),r}catch(e){if(this._debug(r,"error",e),(0,a.HY)(e)){let s={data:null,error:e};return(0,a.Fw)(e)||await this._removeSession(),null==(t=this.refreshingDeferred)||t.resolve(s),s}throw null==(s=this.refreshingDeferred)||s.reject(e),e}finally{this.refreshingDeferred=null,this._debug(r,"end")}}async _notifyAllSubscribers(e,t,s=!0){let r=`#_notifyAllSubscribers(${e})`;this._debug(r,"begin",t,`broadcast = ${s}`);try{this.broadcastChannel&&s&&this.broadcastChannel.postMessage({event:e,session:t});let r=[],i=Array.from(this.stateChangeEmitters.values()).map(async s=>{try{await s.callback(e,t)}catch(e){r.push(e)}});if(await Promise.all(i),r.length>0){for(let e=0;e<r.length;e+=1)console.error(r[e]);throw r[0]}}finally{this._debug(r,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await (0,o.Gb)(this.storage,`${this.storageKey}-code-verifier`);let t=Object.assign({},e),s=t.user&&!0===t.user.__isUserNotAvailableProxy;if(this.userStorage){!s&&t.user&&await (0,o.Oi)(this.userStorage,this.storageKey+"-user",{user:t.user});let e=Object.assign({},t);delete e.user;let r=(0,o.Go)(e);await (0,o.Oi)(this.storage,this.storageKey,r)}else{let e=(0,o.Go)(t);await (0,o.Oi)(this.storage,this.storageKey,e)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await (0,o.Gb)(this.storage,this.storageKey),await (0,o.Gb)(this.storage,this.storageKey+"-code-verifier"),await (0,o.Gb)(this.storage,this.storageKey+"-user"),this.userStorage&&await (0,o.Gb)(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,o.Bd)()&&(null==window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(e){console.error("removing visibilitychange callback failed",e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),i.a4);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&"object"==typeof t&&"function"==typeof t.unref?t.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:s}}=t;if(!s||!s.refresh_token||!s.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");let r=Math.floor((1e3*s.expires_at-e)/i.a4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts ${i.a4}ms, refresh threshold is ${i.YI} ticks`),r<=i.YI&&await this._callRefreshToken(s.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof u.nb)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,o.Bd)()||!(null==window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},null==window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if("visible"!==document.visibilityState)return void this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");await this._recoverAndRefresh()}))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,s){let r=[`provider=${encodeURIComponent(t)}`];if((null==s?void 0:s.redirectTo)&&r.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),(null==s?void 0:s.scopes)&&r.push(`scopes=${encodeURIComponent(s.scopes)}`),"pkce"===this.flowType){let[e,t]=await (0,o.dS)(this.storage,this.storageKey),s=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});r.push(s.toString())}if(null==s?void 0:s.queryParams){let e=new URLSearchParams(s.queryParams);r.push(e.toString())}return(null==s?void 0:s.skipBrowserRedirect)&&r.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${e}?${r.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var s;let{data:r,error:i}=t;return i?this._returnResult({data:null,error:i}):await (0,n.vE)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null==(s=null==r?void 0:r.session)?void 0:s.access_token})})}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{var s,r;let{data:i,error:a}=t;if(a)return this._returnResult({data:null,error:a});let o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},"phone"===e.factorType?{phone:e.phone}:"totp"===e.factorType?{issuer:e.issuer}:{}),{data:l,error:u}=await (0,n.vE)(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:null==(s=null==i?void 0:i.session)?void 0:s.access_token});return u?this._returnResult({data:null,error:u}):("totp"===e.factorType&&"totp"===l.type&&(null==(r=null==l?void 0:l.totp)?void 0:r.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var s;let{data:r,error:i}=t;if(i)return this._returnResult({data:null,error:i});let a=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:"create"===e.webauthn.type?(0,w.sy)(e.webauthn.credential_response):(0,w.CP)(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:l}=await (0,n.vE)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:a,headers:this.headers,jwt:null==(s=null==r?void 0:r.session)?void 0:s.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:l}))})}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var s;let{data:r,error:i}=t;if(i)return this._returnResult({data:null,error:i});let a=await (0,n.vE)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:null==(s=null==r?void 0:r.session)?void 0:s.access_token});if(a.error)return a;let{data:o}=a;if("webauthn"!==o.type)return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:(0,w.sC)(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:(0,w.KE)(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}})}async _challengeAndVerify(e){let{data:t,error:s}=await this._challenge({factorId:e.factorId});return s?this._returnResult({data:null,error:s}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;let{data:{user:t},error:s}=await this.getUser();if(s)return{data:null,error:s};let r={all:[],phone:[],totp:[],webauthn:[]};for(let s of null!=(e=null==t?void 0:t.factors)?e:[])r.all.push(s),"verified"===s.status&&r[s.factor_type].push(s);return{data:r,error:null}}async _getAuthenticatorAssuranceLevel(e){var t,s,r,i;if(e)try{let{payload:r}=(0,o.Cq)(e),i=null;r.aal&&(i=r.aal);let a=i,{data:{user:n},error:l}=await this.getUser(e);if(l)return this._returnResult({data:null,error:l});(null!=(s=null==(t=null==n?void 0:n.factors)?void 0:t.filter(e=>"verified"===e.status))?s:[]).length>0&&(a="aal2");let u=r.amr||[];return{data:{currentLevel:i,nextLevel:a,currentAuthenticationMethods:u},error:null}}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:n},error:l}=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:u}=(0,o.Cq)(n.access_token),h=null;u.aal&&(h=u.aal);let c=h;return(null!=(i=null==(r=n.user.factors)?void 0:r.filter(e=>"verified"===e.status))?i:[]).length>0&&(c="aal2"),{data:{currentLevel:h,nextLevel:c,currentAuthenticationMethods:u.amr||[]},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:s},error:r}=t;return r?this._returnResult({data:null,error:r}):s?await (0,n.vE)(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:s.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new a.jG})})}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async s=>{let{data:{session:r},error:i}=s;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new a.jG});let l=await (0,n.vE)(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"approve"},xform:e=>({data:e,error:null})});return l.data&&l.data.redirect_url&&(0,o.Bd)()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(l.data.redirect_url),l})}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async s=>{let{data:{session:r},error:i}=s;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new a.jG});let l=await (0,n.vE)(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"deny"},xform:e=>({data:e,error:null})});return l.data&&l.data.redirect_url&&(0,o.Bd)()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(l.data.redirect_url),l})}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:s}=e;return s?this._returnResult({data:null,error:s}):t?await (0,n.vE)(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new a.jG})})}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:s},error:r}=t;return r?this._returnResult({data:null,error:r}):s?(await (0,n.vE)(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:s.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new a.jG})})}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let s=t.keys.find(t=>t.kid===e);if(s)return s;let r=Date.now();if((s=this.jwks.keys.find(t=>t.kid===e))&&this.jwks_cached_at+i.$W>r)return s;let{data:a,error:o}=await (0,n.vE)(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return a.keys&&0!==a.keys.length&&(this.jwks=a,this.jwks_cached_at=r,s=a.keys.find(t=>t.kid===e))?s:null}async getClaims(e,t={}){try{let s=e;if(!s){let{data:e,error:t}=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});s=e.session.access_token}let{header:r,payload:i,signature:n,raw:{header:l,payload:u}}=(0,o.Cq)(s);(null==t?void 0:t.allowExpired)||(0,o.c2)(i.exp);let h=!r.alg||r.alg.startsWith("HS")||!r.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(r.kid,(null==t?void 0:t.keys)?{keys:t.keys}:null==t?void 0:t.jwks);if(!h){let{error:e}=await this.getUser(s);if(e)throw e;return{data:{claims:i,header:r,signature:n},error:null}}let c=(0,o.K8)(r.alg),_=await crypto.subtle.importKey("jwk",h,c,!0,["verify"]);if(!await crypto.subtle.verify(c,_,n,(0,d.Al)(`${l}.${u}`)))throw new a.xL("Invalid JWT signature");return{data:{claims:i,header:r,signature:n},error:null}}catch(e){if((0,a.HY)(e))return this._returnResult({data:null,error:e});throw e}}}b.nextInstanceID={};let p=b}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7200],{1525:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},1528:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DecodeError:function(){return h},MiddlewareNotFoundError:function(){return P},MissingStaticPage:function(){return m},NormalizeError:function(){return y},PageNotFoundError:function(){return g},SP:function(){return p},ST:function(){return d},WEB_VITALS:function(){return r},execOnce:function(){return n},getDisplayName:function(){return l},getLocationOrigin:function(){return a},getURL:function(){return i},isAbsoluteUrl:function(){return u},isResSent:function(){return s},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return c},stringifyError:function(){return b}});let r=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return function(){for(var n=arguments.length,o=Array(n),u=0;u<n;u++)o[u]=arguments[u];return r||(r=!0,t=e(...o)),t}}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,u=e=>o.test(e);function a(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function i(){let{href:e}=window.location,t=a();return e.substring(t.length)}function l(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function s(e){return e.finished||e.headersSent}function c(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function f(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&s(r))return n;if(!n)throw Object.defineProperty(Error('"'+l(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.'),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let p="undefined"!=typeof performance,d=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class h extends Error{}class y extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class m extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class P extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function b(e){return JSON.stringify({message:e.message,stack:e.stack})}},1932:(e,t,r)=>{var n=r(2892);r.o(n,"useParams")&&r.d(t,{useParams:function(){return n.useParams}}),r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},2742:(e,t)=>{function r(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function n(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e))if(Array.isArray(o))for(let e of o)t.append(r,n(e));else t.set(r,n(o));return t}function u(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(let t of r){for(let r of t.keys())e.delete(r);for(let[r,n]of t.entries())e.append(r,n)}return e}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{assign:function(){return u},searchParamsToUrlQuery:function(){return r},urlQueryToSearchParams:function(){return o}})},3483:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return g},useLinkStatus:function(){return P}});let n=r(5552),o=r(655),u=n._(r(4519)),a=r(7174),i=r(3232),l=r(9744),s=r(1528),c=r(10);r(1293);let f=r(7099),p=r(4367),d=r(6943);r(1525);let h=r(5712);function y(e){return"string"==typeof e?e:(0,a.formatUrl)(e)}function g(e){var t;let r,n,a,[g,P]=(0,u.useOptimistic)(f.IDLE_LINK_STATUS),b=(0,u.useRef)(null),{href:_,as:v,children:E,prefetch:O=null,passHref:j,replace:S,shallow:C,scroll:N,onClick:T,onMouseEnter:R,onTouchStart:x,legacyBehavior:A=!1,onNavigate:M,ref:L,unstable_dynamicOnHover:k,...I}=e;r=E,A&&("string"==typeof r||"number"==typeof r)&&(r=(0,o.jsx)("a",{children:r}));let U=u.default.useContext(i.AppRouterContext),w=!1!==O,F=!1!==O?null===(t=O)||"auto"===t?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:D,as:K}=u.default.useMemo(()=>{let e=y(_);return{href:e,as:v?y(v):e}},[_,v]);A&&(n=u.default.Children.only(r));let B=A?n&&"object"==typeof n&&n.ref:L,z=u.default.useCallback(e=>(null!==U&&(b.current=(0,f.mountLinkInstance)(e,D,U,F,w,P)),()=>{b.current&&((0,f.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,f.unmountPrefetchableInstance)(e)}),[w,D,U,F,P]),Q={ref:(0,l.useMergedRef)(z,B),onClick(e){A||"function"!=typeof T||T(e),A&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),U&&(e.defaultPrevented||function(e,t,r,n,o,a,i){let{nodeName:l}=e.currentTarget;if(!("A"===l.toUpperCase()&&function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||e.currentTarget.hasAttribute("download"))){if(!(0,p.isLocalURL)(t)){o&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}u.default.startTransition(()=>{(0,d.dispatchNavigateAction)(r||t,o?"replace":"push",null==a||a,n.current)})}}(e,D,K,b,S,N,M))},onMouseEnter(e){A||"function"!=typeof R||R(e),A&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),U&&w&&(0,f.onNavigationIntent)(e.currentTarget,!0===k)},onTouchStart:function(e){A||"function"!=typeof x||x(e),A&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),U&&w&&(0,f.onNavigationIntent)(e.currentTarget,!0===k)}};return(0,s.isAbsoluteUrl)(K)?Q.href=K:A&&!j&&("a"!==n.type||"href"in n.props)||(Q.href=(0,c.addBasePath)(K)),a=A?u.default.cloneElement(n,Q):(0,o.jsx)("a",{...I,...Q,children:r}),(0,o.jsx)(m.Provider,{value:g,children:a})}let m=(0,u.createContext)(f.IDLE_LINK_STATUS),P=()=>(0,u.useContext)(m);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4367:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return u}});let n=r(1528),o=r(4145);function u(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},7174:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{formatUrl:function(){return u},formatWithValidation:function(){return i},urlObjectKeys:function(){return a}});let n=r(5552)._(r(2742)),o=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,u=e.protocol||"",a=e.pathname||"",i=e.hash||"",l=e.query||"",s=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?s=t+e.host:r&&(s=t+(~r.indexOf(":")?"["+r+"]":r),e.port&&(s+=":"+e.port)),l&&"object"==typeof l&&(l=String(n.urlQueryToSearchParams(l)));let c=e.search||l&&"?"+l||"";return u&&!u.endsWith(":")&&(u+=":"),e.slashes||(!u||o.test(u))&&!1!==s?(s="//"+(s||""),a&&"/"!==a[0]&&(a="/"+a)):s||(s=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),""+u+s+(a=a.replace(/[?#]/g,encodeURIComponent))+(c=c.replace("#","%23"))+i}let a=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function i(e){return u(e)}},9744:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=r(4519);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=u(e,n)),t&&(o.current=u(t,n))},[e,t])}function u(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7066,9584,9877],{4462:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,3483,23)),Promise.resolve().then(n.bind(n,1123)),Promise.resolve().then(n.bind(n,6597)),Promise.resolve().then(n.bind(n,4059))}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=4462)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3831,4345,7299],{2880:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,3483,23)),Promise.resolve().then(n.bind(n,1123)),Promise.resolve().then(n.bind(n,6597)),Promise.resolve().then(n.bind(n,4059))}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=2880)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6733],{1078:(e,n,t)=>{"use strict";t.d(n,{b:()=>a});var i=t(7069);let r=null;function a(){if(r)return r;let e="https://mrrghkzfjgfszricdchr.supabase.co",n="sb_publishable_EMTUmRBbNoB8fh4T05Wp5Q_cGJP430c";if(!e||!n)throw Error("Missing NEXT_PUBLIC_SUPABASE_URL or NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY");return r=(0,i.createBrowserClient)(e,n)}},4528:(e,n,t)=>{Promise.resolve().then(t.t.bind(t,3483,23)),Promise.resolve().then(t.bind(t,7961)),Promise.resolve().then(t.bind(t,1123)),Promise.resolve().then(t.bind(t,6597)),Promise.resolve().then(t.bind(t,4059))},7961:(e,n,t)=>{"use strict";t.d(n,{CliLogin:()=>o});var i=t(655),r=t(4519),a=t(1078),s=t(9244);function o(e){let{token:n}=e,[t,o]=(0,r.useState)({kind:"loading"});async function l(){let e=(0,a.b)(),t=new URL("/auth/callback",window.location.origin);t.searchParams.set("next","/cli/login?token=".concat(encodeURIComponent(n)));let{error:i}=await e.auth.signInWithOAuth({provider:"github",options:{redirectTo:t.toString()}});i&&o({kind:"error",message:i.message})}return(0,r.useEffect)(()=>{if(!n)return void o({kind:"no-token"});let e=(0,a.b)(),t=!1;return async function(){var i,r,a,s,c,l,u;let{data:d,error:m}=await e.from("cli_tokens").select("token, claimed_at, expires_at, user_id").eq("token",n).maybeSingle();if(t)return;if(m)return o({kind:"error",message:m.message});if(!d)return o({kind:"invalid-token"});if(new Date(d.expires_at).getTime()<Date.now())return o({kind:"expired-token"});let{data:h}=await e.auth.getSession(),g=h.session,k=null==g?void 0:g.user;if(d.claimed_at&&d.user_id&&k&&d.user_id!==k.id)return o({kind:"error",message:"This CLI token has already been claimed by another account."});if(d.claimed_at&&k)return o({kind:"success",email:null!=(a=k.email)?a:null});if(!k)return o({kind:"awaiting-signin"});o({kind:"claiming"});let x=null!=(c=null!=(s=null==(i=k.user_metadata)?void 0:i.user_name)?s:null==(r=k.user_metadata)?void 0:r.preferred_username)?c:null,f=new Date(Date.now()+7776e6),{error:p}=await e.from("cli_tokens").update({user_id:k.id,user_email:null!=(l=k.email)?l:null,user_login:x,claimed_at:new Date().toISOString(),expires_at:f.toISOString()}).eq("token",n).is("claimed_at",null);if(!t){if(p)return o({kind:"error",message:p.message});o({kind:"success",email:null!=(u=k.email)?u:null})}}(),()=>{t=!0}},[n]),(0,i.jsxs)("div",{className:"mx-auto flex max-w-md flex-col items-center px-6 pt-16 text-center sm:pt-24",children:[(0,i.jsx)("span",{className:"badge badge-accent mb-6",children:"promptarc cli"}),(0,i.jsx)("h1",{className:"text-2xl font-semibold tracking-tight text-ink-0 sm:text-3xl",children:function(e){switch(e.kind){case"loading":return"Checking your CLI token…";case"no-token":return"No token in URL";case"invalid-token":return"Token not found";case"expired-token":return"Token expired";case"awaiting-signin":return"Sign in to authorize this CLI";case"claiming":return"Authorizing…";case"success":return"✓ Signed in";case"error":return"Something went wrong"}}(t)}),(0,i.jsx)("p",{className:"mt-3 text-sm text-ink-2",children:function(e){switch(e.kind){case"loading":return"One moment.";case"no-token":return"This page expects a ?token=... query string from the CLI.";case"invalid-token":return"The CLI token in the URL is unknown. Run `promptarc login` again to mint a fresh one.";case"expired-token":return"CLI tokens are valid for 15 minutes. Run `promptarc login` again to mint a fresh one.";case"awaiting-signin":return"Sign in to attach this CLI session to your promptarc account. We only request your basic GitHub profile.";case"claiming":return"Linking your account to the CLI…";case"success":return"You can close this tab and return to your terminal".concat(e.email?" (".concat(e.email,")"):"",".");case"error":return e.message}}(t)}),"awaiting-signin"===t.kind?(0,i.jsxs)("button",{type:"button",onClick:l,className:"mt-8 inline-flex items-center gap-2 rounded-md border border-accent/40 bg-accent px-5 py-2.5 text-sm font-semibold text-surface-0 hover:bg-accent/90",children:[(0,i.jsx)(s.Hk,{className:"h-4 w-4"}),"Continue with GitHub"]}):null,"loading"===t.kind||"claiming"===t.kind?(0,i.jsx)(c,{}):null,n?(0,i.jsxs)("div",{className:"mt-10 text-2xs text-ink-4",children:["Token: ",(0,i.jsxs)("code",{className:"font-mono",children:[n.slice(0,8),"…"]})]}):null]})}function c(){return(0,i.jsxs)("svg",{className:"mt-8 h-5 w-5 animate-spin text-accent",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[(0,i.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.6",opacity:"0.25"}),(0,i.jsx)("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}},9244:(e,n,t)=>{"use strict";t.d(n,{Hk:()=>r});var i=t(655);function r(e){let{className:n="h-4 w-4"}=e;return(0,i.jsx)("svg",{className:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M8 0C3.58 0 0 3.58 0 8a8 8 0 005.47 7.59c.4.07.55-.17.55-.38v-1.32c-2.22.48-2.69-1.07-2.69-1.07-.36-.92-.89-1.17-.89-1.17-.73-.5.05-.49.05-.49.81.06 1.23.83 1.23.83.72 1.23 1.88.87 2.34.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.13 0 0 .67-.21 2.2.82a7.7 7.7 0 014 0c1.53-1.04 2.2-.82 2.2-.82.44 1.11.16 1.93.08 2.13.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48v2.2c0 .21.15.46.55.38A8 8 0 0016 8c0-4.42-3.58-8-8-8z"})})}}},e=>{e.O(0,[2994,7200,896,1029,7575,4695,7358],()=>e(e.s=4528)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3831,4345,7299],{2880:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,3483,23)),Promise.resolve().then(n.bind(n,1123)),Promise.resolve().then(n.bind(n,6597)),Promise.resolve().then(n.bind(n,4059))}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=2880)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8080],{1937:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,3483,23)),Promise.resolve().then(r.bind(r,2786)),Promise.resolve().then(r.bind(r,1123)),Promise.resolve().then(r.bind(r,6597)),Promise.resolve().then(r.bind(r,4059))},2786:(e,t,r)=>{"use strict";r.d(t,{FeedbackForm:()=>i});var n=r(655),s=r(4519),a=r(4094);let c=(0,a.createServerReference)("4020b14586c972e8d84979311919f2aa5ab7b81f22",a.callServer,void 0,a.findSourceMapURL,"submitFeedbackAction");function i(){let[e,t]=(0,s.useState)(""),[r,a]=(0,s.useState)(null),[i,o]=(0,s.useState)(!1),[l,u]=(0,s.useTransition)();return(0,n.jsxs)("div",{className:"card px-5 py-5",children:[(0,n.jsx)("h3",{className:"mb-3 text-sm font-semibold text-ink-1",children:"Share your feedback"}),(0,n.jsxs)("form",{onSubmit:function(r){r.preventDefault(),l||e.trim().length<5||(a(null),u(async()=>{let r=await c(e);r.ok?(t(""),o(!0),setTimeout(()=>o(!1),3e3)):a(r.error)}))},children:[(0,n.jsx)("textarea",{value:e,onChange:e=>t(e.target.value),placeholder:"Bug report, feature request, or just say hi...",rows:4,maxLength:2e3,className:"w-full resize-none rounded-md border border-surface-border bg-surface-0 px-3 py-2 text-sm text-ink-1 placeholder:text-ink-4 focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent"}),(0,n.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,n.jsxs)("span",{className:"text-2xs text-ink-4",children:[e.length,"/2000"]}),(0,n.jsx)("button",{type:"submit",disabled:l||e.trim().length<5,className:"rounded-md border border-accent/40 bg-accent px-4 py-1.5 text-xs font-semibold text-surface-0 hover:bg-accent/90 disabled:opacity-50",children:l?"Sending...":i?"Sent!":"Submit"})]}),r?(0,n.jsx)("p",{className:"mt-2 text-2xs text-danger",children:r}):null,(0,n.jsx)("p",{className:"mt-2 text-2xs text-ink-4",children:"Your feedback is public and visible to everyone. Max 5 per day."})]})]})}},4094:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{callServer:function(){return n.callServer},createServerReference:function(){return a.createServerReference},findSourceMapURL:function(){return s.findSourceMapURL}});let n=r(3609),s=r(4433),a=r(7041)}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=1937)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{340:(e,t,n)=>{"use strict";n.d(t,{Analytics:()=>f});var r=n(4519),a=n(1932),o=n(56);function s(){return"undefined"!=typeof window}function c(){return"production"}function u(){return"development"===((s()?window.vam:c())||"production")}function i(e){return new RegExp("/".concat(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"(?=[/?#]|$)"))}function d(e){return(0,r.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),(0,r.useEffect)(()=>{var t;!function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{debug:!0};if(!s())return;!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto";if("auto"===e){window.vam=c();return}window.vam=e}(t.mode),window.va||(window.va=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];(window.vaq=window.vaq||[]).push(t)}),t.beforeSend&&(null==(e=window.va)||e.call(window,"beforeSend",t.beforeSend));let n=t.scriptSrc?t.scriptSrc:u()?"https://va.vercel-scripts.com/v1/script.debug.js":t.basePath?"".concat(t.basePath,"/insights/script.js"):"/_vercel/insights/script.js";if(document.head.querySelector('script[src*="'.concat(n,'"]')))return;let r=document.createElement("script");r.src=n,r.defer=!0,r.dataset.sdkn="@vercel/analytics"+(t.framework?"/".concat(t.framework):""),r.dataset.sdkv="1.6.1",t.disableAutoTrack&&(r.dataset.disableAutoTrack="1"),t.endpoint?r.dataset.endpoint=t.endpoint:t.basePath&&(r.dataset.endpoint="".concat(t.basePath,"/insights")),t.dsn&&(r.dataset.dsn=t.dsn),r.onerror=()=>{let e=u()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log("[Vercel Web Analytics] Failed to load script from ".concat(n,". ").concat(e))},u()&&!1===t.debug&&(r.dataset.debug="false"),document.head.appendChild(r)}({framework:e.framework||"react",basePath:null!=(t=e.basePath)?t:function(){if(void 0!==o&&void 0!==o.env)return o.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...void 0!==e.route&&{disableAutoTrack:!0},...e})},[]),(0,r.useEffect)(()=>{e.route&&e.path&&function(e){var t;let{route:n,path:r}=e;null==(t=window.va)||t.call(window,"pageview",{route:n,path:r})}({route:e.route,path:e.path})},[e.route,e.path]),null}function l(e){let{route:t,path:n}=(()=>{let e=(0,a.useParams)(),t=(0,a.useSearchParams)(),n=(0,a.usePathname)();return e?{route:function(e,t){if(!e||!t)return e;let n=e;try{let e=Object.entries(t);for(let[t,r]of e)if(!Array.isArray(r)){let e=i(r);e.test(n)&&(n=n.replace(e,"/[".concat(t,"]")))}for(let[t,r]of e)if(Array.isArray(r)){let e=i(r.join("/"));e.test(n)&&(n=n.replace(e,"/[...".concat(t,"]")))}return n}catch(t){return e}}(n,Object.keys(e).length?e:Object.fromEntries(t.entries())),path:n}:{route:null,path:n}})();return r.createElement(d,{path:n,route:t,...e,basePath:function(){if(void 0!==o&&void 0!==o.env)return o.env.NEXT_PUBLIC_VERCEL_OBSERVABILITY_BASEPATH}(),framework:"next"})}function f(e){return r.createElement(r.Suspense,{fallback:null},r.createElement(l,{...e}))}},1932:(e,t,n)=>{"use strict";var r=n(2892);n.o(r,"useParams")&&n.d(t,{useParams:function(){return r.useParams}}),n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},3070:()=>{},4188:(e,t,n)=>{Promise.resolve().then(n.bind(n,340)),Promise.resolve().then(n.t.bind(n,3070,23))}},e=>{e.O(0,[1293,7575,4695,7358],()=>e(e.s=4188)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8203],{1929:(e,t,r)=>{"use strict";r.d(t,{P:()=>a});var n=r(4094);let a=(0,n.createServerReference)("604e221da7d1e53a392af07e4defc91423301b6668",n.callServer,void 0,n.findSourceMapURL,"setVisibilityAction")},3160:(e,t,r)=>{"use strict";r.d(t,{R:()=>a});var n=r(4094);let a=(0,n.createServerReference)("601b12dded4f2a95f0cfd3ee7586bbb91555662b74",n.callServer,void 0,n.findSourceMapURL,"setAutoSyncAction")},4094:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{callServer:function(){return n.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}});let n=r(3609),a=r(4433),i=r(7041)},6521:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,3483,23)),Promise.resolve().then(r.bind(r,9464)),Promise.resolve().then(r.bind(r,1123)),Promise.resolve().then(r.bind(r,6597)),Promise.resolve().then(r.bind(r,4059))},9464:(e,t,r)=>{"use strict";r.d(t,{ShareRowActions:()=>d});var n=r(655),a=r(4519),i=r(1929),s=r(3160),o=r(4094);let c=(0,o.createServerReference)("40c1e2583896b3c4303bdbb5fd24338dc278eca377",o.callServer,void 0,o.findSourceMapURL,"deleteShareAction"),l={public:"badge badge-success",unlisted:"badge",private:"badge badge-warning"};function d(e){let{slug:t,visibility:r,autoSync:o}=e,[d,u]=(0,a.useState)(r),[b,p]=(0,a.useState)(o),[f,h]=(0,a.useState)(!1),[m,v]=(0,a.useState)(!1),[x,g]=(0,a.useState)(null),[y,w]=(0,a.useTransition)(),[S,k]=(0,a.useTransition)();async function j(){try{await navigator.clipboard.writeText("".concat(window.location.origin,"/r/").concat(t)),h(!0),setTimeout(()=>h(!1),1400)}catch(e){}}return(0,n.jsxs)("div",{className:"flex shrink-0 flex-col items-end gap-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("label",{className:"relative",children:[(0,n.jsx)("span",{className:"sr-only",children:"Visibility"}),(0,n.jsxs)("select",{value:d,onChange:e=>{var r;(r=e.target.value)!==d&&(u(r),g(null),k(async()=>{let e=await (0,i.P)(t,r);e.ok||(u(d),g(e.error))}))},disabled:S,className:"".concat(l[d]," cursor-pointer appearance-none border-0 bg-transparent pr-3 disabled:opacity-60"),children:[(0,n.jsx)("option",{value:"public",children:"Public"}),(0,n.jsx)("option",{value:"unlisted",children:"Unlisted"}),(0,n.jsx)("option",{value:"private",children:"Private"})]})]}),(0,n.jsxs)("button",{type:"button",onClick:function(){let e=!b;p(e),g(null),k(async()=>{let r=await (0,s.R)(t,e);r.ok||(p(!e),g(r.error))})},disabled:S,className:"badge cursor-pointer ".concat(b?"badge-accent":""," disabled:opacity-60"),title:b?"Auto-sync ON — share stays current as the local session changes":"Auto-sync OFF — share is a one-time snapshot",children:[(0,n.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full ".concat(b?"bg-accent":"bg-ink-4")}),b?"sync on":"sync off"]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("button",{type:"button",onClick:j,className:"rounded-md border border-surface-border bg-surface-2 px-2 py-1 text-2xs font-medium text-ink-2 hover:bg-surface-3 hover:text-ink-1",children:f?"Copied":"Copy link"}),(0,n.jsx)("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText("promptarc pull ".concat(t)),v(!0),setTimeout(()=>v(!1),1500)}catch(e){}},className:"rounded-md border border-surface-border bg-surface-2 px-2 py-1 text-2xs font-medium text-ink-2 hover:bg-surface-3 hover:text-ink-1",title:"Copy `promptarc pull` command for another machine",children:m?"Copied!":"Pull"}),(0,n.jsx)("a",{href:"/api/share/download/".concat(t),download:!0,className:"rounded-md border border-surface-border bg-surface-2 px-2 py-1 text-2xs font-medium text-ink-2 hover:bg-surface-3 hover:text-ink-1",title:"Download session as .jsonl file (redacted)",children:"Download"}),(0,n.jsx)("button",{type:"button",onClick:function(){window.confirm("Delete this share? The public link will stop working immediately and cannot be undone.")&&(g(null),w(async()=>{let e=await c(t);e.ok||g(e.error)}))},disabled:y,className:"rounded-md border border-danger/30 bg-danger/10 px-2 py-1 text-2xs font-medium text-danger hover:bg-danger/20 disabled:cursor-not-allowed disabled:opacity-60",children:y?"Deleting…":"Delete"})]}),x?(0,n.jsx)("span",{className:"max-w-[12rem] truncate text-2xs text-danger",title:x,children:x}):null]})}}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=6521)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7806],{2109:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var s=n(655);function r(e){let{children:t,className:n="",hoverable:r=!1}=e;return(0,s.jsx)("div",{className:"card ".concat(r?"card-hover":""," ").concat(n),children:t})}},3660:(e,t,n)=>{"use strict";n.d(t,{FQ:()=>l,Kc:()=>d,v7:()=>i});let s=new Intl.NumberFormat("en-US"),r=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}),a=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"});function l(e){return s.format(e)}function i(e){return e?"".concat(!e?"—":r.format(e)," \xb7 ").concat(e?a.format(e):""):"—"}let c=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60],["second",1]],o=new Intl.RelativeTimeFormat("en-US",{numeric:"auto"});function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;if(!e)return"—";let n=Math.round((e.getTime()-t.getTime())/1e3);for(let[e,t]of c)if(Math.abs(n)>=t||"second"===e)return o.format(Math.round(n/t),e);return o.format(n,"second")}},3863:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,3483,23)),Promise.resolve().then(n.bind(n,5830)),Promise.resolve().then(n.bind(n,1123)),Promise.resolve().then(n.bind(n,6597)),Promise.resolve().then(n.bind(n,4059))},5830:(e,t,n)=>{"use strict";n.d(t,{ProjectList:()=>m});var s=n(655),r=n(4519),a=n(3483),l=n.n(a),i=n(2109),c=n(5840),o=n(3660);let d=[{kind:"all",label:"All"},{kind:"claude-code",label:"Claude Code"},{kind:"codex",label:"Codex"},{kind:"cursor",label:"Cursor"}];function u(e){return"codex"===e?"Codex":"cursor"===e?"Cursor":null}function m(e){let{projects:t}=e,[n,a]=(0,r.useState)(""),[m,x]=(0,r.useState)("all"),h=(0,r.useMemo)(()=>{let e=new Set;for(let n of t)e.add(n.agentSource);return e},[t]),f=h.size>1,g=(0,r.useMemo)(()=>{let e=t;if("all"!==m&&(e=e.filter(e=>e.agentSource===m)),n.trim()){let t=n.toLowerCase().split(/\s+/).filter(Boolean);e=e.filter(e=>{let n="".concat(e.name," ").concat(e.key).toLowerCase();return t.every(e=>n.includes(e))})}return e},[t,n,m]);return(0,s.jsxs)(s.Fragment,{children:[f?(0,s.jsx)("div",{className:"mb-4 flex gap-1 rounded-md border border-surface-border bg-surface-0 p-0.5 w-fit",children:d.filter(e=>"all"===e.kind||h.has(e.kind)).map(e=>{let n="all"===e.kind?t.length:t.filter(t=>t.agentSource===e.kind).length;return(0,s.jsxs)("button",{type:"button",onClick:()=>x(e.kind),className:"rounded-md px-3 py-1.5 text-xs font-medium transition-colors ".concat(m===e.kind?"bg-surface-2 text-ink-1":"text-ink-3 hover:text-ink-1"),children:[e.label,(0,s.jsx)("span",{className:"ml-1.5 tabular-nums text-ink-4",children:n})]},e.kind)})}):null,(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("input",{type:"text",value:n,onChange:e=>a(e.target.value),placeholder:"Search projects...",className:"w-full rounded-md border border-surface-border bg-surface-0 px-3 py-2 text-sm text-ink-1 placeholder:text-ink-4 focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent"}),n.trim()&&(0,s.jsxs)("div",{className:"mt-1.5 text-2xs text-ink-3",children:[g.length," of ",t.length," result",1===t.length?"":"s"]})]}),(0,s.jsx)("div",{className:"flex flex-col gap-2",children:g.map(e=>(0,s.jsx)(l(),{href:"/my-projects/".concat(encodeURIComponent(e.key)),children:(0,s.jsx)(i.Z,{hoverable:!0,className:"px-5 py-4",children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"truncate text-sm font-semibold text-ink-1",children:e.name}),u(e.agentSource)?(0,s.jsx)(c.E,{variant:"accent",children:u(e.agentSource)}):null,e.syncing?(0,s.jsx)(c.E,{variant:"success",children:"syncing"}):null]}),(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-2xs text-ink-3",children:[(0,s.jsxs)("span",{children:[(0,o.FQ)(e.shareCount)," shares"]}),e.publicCount>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:[e.publicCount," public"]})]}):null,e.unlistedCount>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:[e.unlistedCount," unlisted"]})]}):null,e.privateCount>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:[e.privateCount," private"]})]}):null,e.totalViews>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)(c.E,{variant:"accent",children:[(0,o.FQ)(e.totalViews)," views"]})]}):null]})]}),(0,s.jsx)("div",{className:"shrink-0 text-2xs text-ink-3",children:e.lastActivityAt&&e.shareCount>0?(0,o.Kc)(new Date(e.lastActivityAt)):"no activity yet"})]})})},e.key))})]})}},5840:(e,t,n)=>{"use strict";n.d(t,{E:()=>a});var s=n(655);let r={default:"badge",accent:"badge badge-accent",success:"badge badge-success",warning:"badge badge-warning",danger:"badge badge-danger"};function a(e){let{children:t,variant:n="default"}=e;return(0,s.jsx)("span",{className:r[n],children:t})}}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=3863)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[111],{1929:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(4094);let a=(0,r.createServerReference)("604e221da7d1e53a392af07e4defc91423301b6668",r.callServer,void 0,r.findSourceMapURL,"setVisibilityAction")},2109:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(655);function a(e){let{children:t,className:n="",hoverable:a=!1}=e;return(0,r.jsx)("div",{className:"card ".concat(a?"card-hover":""," ").concat(n),children:t})}},3160:(e,t,n)=>{"use strict";n.d(t,{R:()=>a});var r=n(4094);let a=(0,r.createServerReference)("601b12dded4f2a95f0cfd3ee7586bbb91555662b74",r.callServer,void 0,r.findSourceMapURL,"setAutoSyncAction")},3660:(e,t,n)=>{"use strict";n.d(t,{FQ:()=>l,Kc:()=>d,v7:()=>c});let r=new Intl.NumberFormat("en-US"),a=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}),s=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"});function l(e){return r.format(e)}function c(e){return e?"".concat(!e?"—":a.format(e)," \xb7 ").concat(e?s.format(e):""):"—"}let i=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60],["second",1]],o=new Intl.RelativeTimeFormat("en-US",{numeric:"auto"});function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;if(!e)return"—";let n=Math.round((e.getTime()-t.getTime())/1e3);for(let[e,t]of i)if(Math.abs(n)>=t||"second"===e)return o.format(Math.round(n/t),e);return o.format(n,"second")}},4094:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{callServer:function(){return r.callServer},createServerReference:function(){return s.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}});let r=n(3609),a=n(4433),s=n(7041)},5840:(e,t,n)=>{"use strict";n.d(t,{E:()=>s});var r=n(655);let a={default:"badge",accent:"badge badge-accent",success:"badge badge-success",warning:"badge badge-warning",danger:"badge badge-danger"};function s(e){let{children:t,variant:n="default"}=e;return(0,r.jsx)("span",{className:a[n],children:t})}},5949:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,3483,23)),Promise.resolve().then(n.bind(n,6130)),Promise.resolve().then(n.bind(n,1123)),Promise.resolve().then(n.bind(n,6597)),Promise.resolve().then(n.bind(n,4059))},6130:(e,t,n)=>{"use strict";n.d(t,{ShareList:()=>h});var r=n(655),a=n(4519),s=n(3483),l=n.n(s),c=n(2109),i=n(5840),o=n(3660),d=n(9464);let u=[{kind:"all",label:"All"},{kind:"claude-code",label:"Claude Code"},{kind:"codex",label:"Codex"},{kind:"cursor",label:"Cursor"}];function m(e){var t;return null!=(t=e.agent_source)?t:"claude-code"}function x(e){return"codex"===e?"Codex":"cursor"===e?"Cursor":null}function h(e){let{rows:t}=e,[n,s]=(0,a.useState)(""),[h,b]=(0,a.useState)("all"),f=(0,a.useMemo)(()=>{let e=new Set;for(let n of t)e.add(m(n));return e},[t]),p=f.size>1,g=(0,a.useMemo)(()=>{let e=t;if("all"!==h&&(e=e.filter(e=>m(e)===h)),n.trim()){let t=n.toLowerCase().split(/\s+/).filter(Boolean);e=e.filter(e=>{var n,r;let a="".concat(e.title," ").concat(null!=(n=e.project_name)?n:""," ").concat(null!=(r=e.project_key)?r:"").toLowerCase();return t.every(e=>a.includes(e))})}return e},[t,n,h]),v=(0,a.useMemo)(()=>(function(e){let t=new Map;for(let l of e){var n,r,a,s;let e=null!=(r=null!=(n=l.project_key)?n:l.project_name)?r:"unknown",c=t.get(e);c||(c={key:e,name:null!=(s=null!=(a=l.project_name)?a:l.project_key)?s:"Other",projectKey:l.project_key,rows:[]},t.set(e,c)),c.rows.push(l)}return Array.from(t.values()).sort((e,t)=>{var n,r,a,s;let l=new Date(null!=(a=null==(n=e.rows[0])?void 0:n.created_at)?a:0).getTime();return new Date(null!=(s=null==(r=t.rows[0])?void 0:r.created_at)?s:0).getTime()-l})})(g),[g]);return(0,r.jsxs)(r.Fragment,{children:[p?(0,r.jsx)("div",{className:"mb-4 flex gap-1 rounded-md border border-surface-border bg-surface-0 p-0.5 w-fit",children:u.filter(e=>"all"===e.kind||f.has(e.kind)).map(e=>{let n="all"===e.kind?t.length:t.filter(t=>m(t)===e.kind).length;return(0,r.jsxs)("button",{type:"button",onClick:()=>b(e.kind),className:"rounded-md px-3 py-1.5 text-xs font-medium transition-colors ".concat(h===e.kind?"bg-surface-2 text-ink-1":"text-ink-3 hover:text-ink-1"),children:[e.label,(0,r.jsx)("span",{className:"ml-1.5 tabular-nums text-ink-4",children:n})]},e.kind)})}):null,(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("input",{type:"text",value:n,onChange:e=>s(e.target.value),placeholder:"Search shares...",className:"w-full rounded-md border border-surface-border bg-surface-0 px-3 py-2 text-sm text-ink-1 placeholder:text-ink-4 focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent"}),n.trim()&&(0,r.jsxs)("div",{className:"mt-1.5 text-2xs text-ink-3",children:[g.length," of ",t.length," result",1===t.length?"":"s"]})]}),(0,r.jsx)("div",{className:"flex flex-col gap-6",children:v.map(e=>(0,r.jsxs)("section",{children:[(0,r.jsxs)("header",{className:"mb-2 flex items-baseline justify-between gap-3",children:[(0,r.jsxs)("h2",{className:"truncate text-sm font-semibold text-ink-1",children:[e.name,(0,r.jsxs)("span",{className:"ml-2 text-2xs font-normal text-ink-3",children:[(0,o.FQ)(e.rows.length)," share",1===e.rows.length?"":"s"]})]}),e.projectKey?(0,r.jsx)(l(),{href:"/my-projects/".concat(encodeURIComponent(e.projectKey)),className:"text-2xs text-ink-3 hover:text-ink-1",children:"open project →"}):null]}),(0,r.jsx)("div",{className:"flex flex-col gap-2",children:e.rows.map(e=>{var t;return(0,r.jsx)(c.Z,{className:"px-5 py-4",children:(0,r.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)(l(),{href:"/r/".concat(e.slug),className:"line-clamp-2 text-sm font-semibold text-ink-1 hover:text-accent",children:e.title}),(0,r.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-2xs text-ink-3",children:[x(m(e))?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.E,{variant:"accent",children:x(m(e))}),(0,r.jsx)("span",{children:"\xb7"})]}):null,(0,r.jsxs)("span",{children:[(0,o.FQ)(e.message_count)," msgs"]}),(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)("span",{children:[(0,o.FQ)(e.tool_call_count)," tools"]}),e.file_change_count>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)("span",{children:[(0,o.FQ)(e.file_change_count)," edits"]})]}):null,(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)("span",{children:[(e.bytes/1024).toFixed(0)," KB"]}),e.view_count>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)(i.E,{variant:"accent",children:[(0,o.FQ)(e.view_count)," views"]})]}):null]}),(0,r.jsxs)("div",{className:"mt-1 truncate text-2xs text-ink-4",title:(0,o.v7)(new Date(e.created_at)),children:["shared ",(0,o.Kc)(new Date(e.created_at))," \xb7 /r/",e.slug]})]}),(0,r.jsx)(d.ShareRowActions,{slug:e.slug,visibility:null!=(t=e.visibility)?t:"unlisted",autoSync:!0===e.auto_sync})]})},e.slug)})})]},e.key))})]})}},9464:(e,t,n)=>{"use strict";n.d(t,{ShareRowActions:()=>d});var r=n(655),a=n(4519),s=n(1929),l=n(3160),c=n(4094);let i=(0,c.createServerReference)("40c1e2583896b3c4303bdbb5fd24338dc278eca377",c.callServer,void 0,c.findSourceMapURL,"deleteShareAction"),o={public:"badge badge-success",unlisted:"badge",private:"badge badge-warning"};function d(e){let{slug:t,visibility:n,autoSync:c}=e,[d,u]=(0,a.useState)(n),[m,x]=(0,a.useState)(c),[h,b]=(0,a.useState)(!1),[f,p]=(0,a.useState)(!1),[g,v]=(0,a.useState)(null),[j,y]=(0,a.useTransition)(),[w,k]=(0,a.useTransition)();async function N(){try{await navigator.clipboard.writeText("".concat(window.location.origin,"/r/").concat(t)),b(!0),setTimeout(()=>b(!1),1400)}catch(e){}}return(0,r.jsxs)("div",{className:"flex shrink-0 flex-col items-end gap-1.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("label",{className:"relative",children:[(0,r.jsx)("span",{className:"sr-only",children:"Visibility"}),(0,r.jsxs)("select",{value:d,onChange:e=>{var n;(n=e.target.value)!==d&&(u(n),v(null),k(async()=>{let e=await (0,s.P)(t,n);e.ok||(u(d),v(e.error))}))},disabled:w,className:"".concat(o[d]," cursor-pointer appearance-none border-0 bg-transparent pr-3 disabled:opacity-60"),children:[(0,r.jsx)("option",{value:"public",children:"Public"}),(0,r.jsx)("option",{value:"unlisted",children:"Unlisted"}),(0,r.jsx)("option",{value:"private",children:"Private"})]})]}),(0,r.jsxs)("button",{type:"button",onClick:function(){let e=!m;x(e),v(null),k(async()=>{let n=await (0,l.R)(t,e);n.ok||(x(!e),v(n.error))})},disabled:w,className:"badge cursor-pointer ".concat(m?"badge-accent":""," disabled:opacity-60"),title:m?"Auto-sync ON — share stays current as the local session changes":"Auto-sync OFF — share is a one-time snapshot",children:[(0,r.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full ".concat(m?"bg-accent":"bg-ink-4")}),m?"sync on":"sync off"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{type:"button",onClick:N,className:"rounded-md border border-surface-border bg-surface-2 px-2 py-1 text-2xs font-medium text-ink-2 hover:bg-surface-3 hover:text-ink-1",children:h?"Copied":"Copy link"}),(0,r.jsx)("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText("promptarc pull ".concat(t)),p(!0),setTimeout(()=>p(!1),1500)}catch(e){}},className:"rounded-md border border-surface-border bg-surface-2 px-2 py-1 text-2xs font-medium text-ink-2 hover:bg-surface-3 hover:text-ink-1",title:"Copy `promptarc pull` command for another machine",children:f?"Copied!":"Pull"}),(0,r.jsx)("a",{href:"/api/share/download/".concat(t),download:!0,className:"rounded-md border border-surface-border bg-surface-2 px-2 py-1 text-2xs font-medium text-ink-2 hover:bg-surface-3 hover:text-ink-1",title:"Download session as .jsonl file (redacted)",children:"Download"}),(0,r.jsx)("button",{type:"button",onClick:function(){window.confirm("Delete this share? The public link will stop working immediately and cannot be undone.")&&(v(null),y(async()=>{let e=await i(t);e.ok||v(e.error)}))},disabled:j,className:"rounded-md border border-danger/30 bg-danger/10 px-2 py-1 text-2xs font-medium text-danger hover:bg-danger/20 disabled:cursor-not-allowed disabled:opacity-60",children:j?"Deleting…":"Delete"})]}),g?(0,r.jsx)("span",{className:"max-w-[12rem] truncate text-2xs text-danger",title:g,children:g}):null]})}}},e=>{e.O(0,[200,29,575,695,358],()=>e(e.s=5949)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[492],{1929:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(4094);let a=(0,r.createServerReference)("604e221da7d1e53a392af07e4defc91423301b6668",r.callServer,void 0,r.findSourceMapURL,"setVisibilityAction")},2109:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(655);function a(e){let{children:t,className:n="",hoverable:a=!1}=e;return(0,r.jsx)("div",{className:"card ".concat(a?"card-hover":""," ").concat(n),children:t})}},3160:(e,t,n)=>{"use strict";n.d(t,{R:()=>a});var r=n(4094);let a=(0,r.createServerReference)("601b12dded4f2a95f0cfd3ee7586bbb91555662b74",r.callServer,void 0,r.findSourceMapURL,"setAutoSyncAction")},3660:(e,t,n)=>{"use strict";n.d(t,{FQ:()=>l,Kc:()=>d,v7:()=>c});let r=new Intl.NumberFormat("en-US"),a=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}),s=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"});function l(e){return r.format(e)}function c(e){return e?"".concat(!e?"—":a.format(e)," \xb7 ").concat(e?s.format(e):""):"—"}let i=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60],["second",1]],o=new Intl.RelativeTimeFormat("en-US",{numeric:"auto"});function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;if(!e)return"—";let n=Math.round((e.getTime()-t.getTime())/1e3);for(let[e,t]of i)if(Math.abs(n)>=t||"second"===e)return o.format(Math.round(n/t),e);return o.format(n,"second")}},4094:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{callServer:function(){return r.callServer},createServerReference:function(){return s.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}});let r=n(3609),a=n(4433),s=n(7041)},5840:(e,t,n)=>{"use strict";n.d(t,{E:()=>s});var r=n(655);let a={default:"badge",accent:"badge badge-accent",success:"badge badge-success",warning:"badge badge-warning",danger:"badge badge-danger"};function s(e){let{children:t,variant:n="default"}=e;return(0,r.jsx)("span",{className:a[n],children:t})}},5949:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,3483,23)),Promise.resolve().then(n.bind(n,6130)),Promise.resolve().then(n.bind(n,1123)),Promise.resolve().then(n.bind(n,6597)),Promise.resolve().then(n.bind(n,4059))},6130:(e,t,n)=>{"use strict";n.d(t,{ShareList:()=>h});var r=n(655),a=n(4519),s=n(3483),l=n.n(s),c=n(2109),i=n(5840),o=n(3660),d=n(9464);let u=[{kind:"all",label:"All"},{kind:"claude-code",label:"Claude Code"},{kind:"codex",label:"Codex"},{kind:"cursor",label:"Cursor"}];function m(e){var t;return null!=(t=e.agent_source)?t:"claude-code"}function x(e){return"codex"===e?"Codex":"cursor"===e?"Cursor":null}function h(e){let{rows:t}=e,[n,s]=(0,a.useState)(""),[h,b]=(0,a.useState)("all"),f=(0,a.useMemo)(()=>{let e=new Set;for(let n of t)e.add(m(n));return e},[t]),p=f.size>1,g=(0,a.useMemo)(()=>{let e=t;if("all"!==h&&(e=e.filter(e=>m(e)===h)),n.trim()){let t=n.toLowerCase().split(/\s+/).filter(Boolean);e=e.filter(e=>{var n,r;let a="".concat(e.title," ").concat(null!=(n=e.project_name)?n:""," ").concat(null!=(r=e.project_key)?r:"").toLowerCase();return t.every(e=>a.includes(e))})}return e},[t,n,h]),v=(0,a.useMemo)(()=>(function(e){let t=new Map;for(let l of e){var n,r,a,s;let e=null!=(r=null!=(n=l.project_key)?n:l.project_name)?r:"unknown",c=t.get(e);c||(c={key:e,name:null!=(s=null!=(a=l.project_name)?a:l.project_key)?s:"Other",projectKey:l.project_key,rows:[]},t.set(e,c)),c.rows.push(l)}return Array.from(t.values()).sort((e,t)=>{var n,r,a,s;let l=new Date(null!=(a=null==(n=e.rows[0])?void 0:n.created_at)?a:0).getTime();return new Date(null!=(s=null==(r=t.rows[0])?void 0:r.created_at)?s:0).getTime()-l})})(g),[g]);return(0,r.jsxs)(r.Fragment,{children:[p?(0,r.jsx)("div",{className:"mb-4 flex gap-1 rounded-md border border-surface-border bg-surface-0 p-0.5 w-fit",children:u.filter(e=>"all"===e.kind||f.has(e.kind)).map(e=>{let n="all"===e.kind?t.length:t.filter(t=>m(t)===e.kind).length;return(0,r.jsxs)("button",{type:"button",onClick:()=>b(e.kind),className:"rounded-md px-3 py-1.5 text-xs font-medium transition-colors ".concat(h===e.kind?"bg-surface-2 text-ink-1":"text-ink-3 hover:text-ink-1"),children:[e.label,(0,r.jsx)("span",{className:"ml-1.5 tabular-nums text-ink-4",children:n})]},e.kind)})}):null,(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("input",{type:"text",value:n,onChange:e=>s(e.target.value),placeholder:"Search shares...",className:"w-full rounded-md border border-surface-border bg-surface-0 px-3 py-2 text-sm text-ink-1 placeholder:text-ink-4 focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent"}),n.trim()&&(0,r.jsxs)("div",{className:"mt-1.5 text-2xs text-ink-3",children:[g.length," of ",t.length," result",1===t.length?"":"s"]})]}),(0,r.jsx)("div",{className:"flex flex-col gap-6",children:v.map(e=>(0,r.jsxs)("section",{children:[(0,r.jsxs)("header",{className:"mb-2 flex items-baseline justify-between gap-3",children:[(0,r.jsxs)("h2",{className:"truncate text-sm font-semibold text-ink-1",children:[e.name,(0,r.jsxs)("span",{className:"ml-2 text-2xs font-normal text-ink-3",children:[(0,o.FQ)(e.rows.length)," share",1===e.rows.length?"":"s"]})]}),e.projectKey?(0,r.jsx)(l(),{href:"/my-projects/".concat(encodeURIComponent(e.projectKey)),className:"text-2xs text-ink-3 hover:text-ink-1",children:"open project →"}):null]}),(0,r.jsx)("div",{className:"flex flex-col gap-2",children:e.rows.map(e=>{var t;return(0,r.jsx)(c.Z,{className:"px-5 py-4",children:(0,r.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)(l(),{href:"/r/".concat(e.slug),className:"line-clamp-2 text-sm font-semibold text-ink-1 hover:text-accent",children:e.title}),e.ai_summary?(0,r.jsx)("p",{className:"mt-1 line-clamp-2 text-2xs leading-relaxed text-ink-2",children:e.ai_summary}):null,(0,r.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-2xs text-ink-3",children:[x(m(e))?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.E,{variant:"accent",children:x(m(e))}),(0,r.jsx)("span",{children:"\xb7"})]}):null,(0,r.jsxs)("span",{children:[(0,o.FQ)(e.message_count)," msgs"]}),(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)("span",{children:[(0,o.FQ)(e.tool_call_count)," tools"]}),e.file_change_count>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)("span",{children:[(0,o.FQ)(e.file_change_count)," edits"]})]}):null,(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)("span",{children:[(e.bytes/1024).toFixed(0)," KB"]}),e.view_count>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)(i.E,{variant:"accent",children:[(0,o.FQ)(e.view_count)," views"]})]}):null]}),(0,r.jsxs)("div",{className:"mt-1 truncate text-2xs text-ink-4",title:(0,o.v7)(new Date(e.created_at)),children:["shared ",(0,o.Kc)(new Date(e.created_at))," \xb7 /r/",e.slug]})]}),(0,r.jsx)(d.ShareRowActions,{slug:e.slug,visibility:null!=(t=e.visibility)?t:"unlisted",autoSync:!0===e.auto_sync})]})},e.slug)})})]},e.key))})]})}},9464:(e,t,n)=>{"use strict";n.d(t,{ShareRowActions:()=>d});var r=n(655),a=n(4519),s=n(1929),l=n(3160),c=n(4094);let i=(0,c.createServerReference)("40c1e2583896b3c4303bdbb5fd24338dc278eca377",c.callServer,void 0,c.findSourceMapURL,"deleteShareAction"),o={public:"badge badge-success",unlisted:"badge",private:"badge badge-warning"};function d(e){let{slug:t,visibility:n,autoSync:c}=e,[d,u]=(0,a.useState)(n),[m,x]=(0,a.useState)(c),[h,b]=(0,a.useState)(!1),[f,p]=(0,a.useState)(!1),[g,v]=(0,a.useState)(null),[j,y]=(0,a.useTransition)(),[w,k]=(0,a.useTransition)();async function N(){try{await navigator.clipboard.writeText("".concat(window.location.origin,"/r/").concat(t)),b(!0),setTimeout(()=>b(!1),1400)}catch(e){}}return(0,r.jsxs)("div",{className:"flex shrink-0 flex-col items-end gap-1.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("label",{className:"relative",children:[(0,r.jsx)("span",{className:"sr-only",children:"Visibility"}),(0,r.jsxs)("select",{value:d,onChange:e=>{var n;(n=e.target.value)!==d&&(u(n),v(null),k(async()=>{let e=await (0,s.P)(t,n);e.ok||(u(d),v(e.error))}))},disabled:w,className:"".concat(o[d]," cursor-pointer appearance-none border-0 bg-transparent pr-3 disabled:opacity-60"),children:[(0,r.jsx)("option",{value:"public",children:"Public"}),(0,r.jsx)("option",{value:"unlisted",children:"Unlisted"}),(0,r.jsx)("option",{value:"private",children:"Private"})]})]}),(0,r.jsxs)("button",{type:"button",onClick:function(){let e=!m;x(e),v(null),k(async()=>{let n=await (0,l.R)(t,e);n.ok||(x(!e),v(n.error))})},disabled:w,className:"badge cursor-pointer ".concat(m?"badge-accent":""," disabled:opacity-60"),title:m?"Auto-sync ON — share stays current as the local session changes":"Auto-sync OFF — share is a one-time snapshot",children:[(0,r.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full ".concat(m?"bg-accent":"bg-ink-4")}),m?"sync on":"sync off"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{type:"button",onClick:N,className:"rounded-md border border-surface-border bg-surface-2 px-2 py-1 text-2xs font-medium text-ink-2 hover:bg-surface-3 hover:text-ink-1",children:h?"Copied":"Copy link"}),(0,r.jsx)("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText("promptarc pull ".concat(t)),p(!0),setTimeout(()=>p(!1),1500)}catch(e){}},className:"rounded-md border border-surface-border bg-surface-2 px-2 py-1 text-2xs font-medium text-ink-2 hover:bg-surface-3 hover:text-ink-1",title:"Copy `promptarc pull` command for another machine",children:f?"Copied!":"Pull"}),(0,r.jsx)("a",{href:"/api/share/download/".concat(t),download:!0,className:"rounded-md border border-surface-border bg-surface-2 px-2 py-1 text-2xs font-medium text-ink-2 hover:bg-surface-3 hover:text-ink-1",title:"Download session as .jsonl file (redacted)",children:"Download"}),(0,r.jsx)("button",{type:"button",onClick:function(){window.confirm("Delete this share? The public link will stop working immediately and cannot be undone.")&&(v(null),y(async()=>{let e=await i(t);e.ok||v(e.error)}))},disabled:j,className:"rounded-md border border-danger/30 bg-danger/10 px-2 py-1 text-2xs font-medium text-danger hover:bg-danger/20 disabled:cursor-not-allowed disabled:opacity-60",children:j?"Deleting…":"Delete"})]}),g?(0,r.jsx)("span",{className:"max-w-[12rem] truncate text-2xs text-danger",title:g,children:g}):null]})}}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=5949)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3831,4345,7299],{2880:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,3483,23)),Promise.resolve().then(n.bind(n,1123)),Promise.resolve().then(n.bind(n,6597)),Promise.resolve().then(n.bind(n,4059))}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=2880)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{697:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,3483,23)),Promise.resolve().then(s.bind(s,982)),Promise.resolve().then(s.bind(s,5995)),Promise.resolve().then(s.bind(s,1123)),Promise.resolve().then(s.bind(s,6597)),Promise.resolve().then(s.bind(s,4059))},982:(e,t,s)=>{"use strict";s.d(t,{DashboardContent:()=>u});var r=s(655),n=s(4519),a=s(3483),i=s.n(a),c=s(2109),o=s(5840),l=s(3660),d=s(3692);let x=[{kind:"all",label:"All",prefix:""},{kind:"claude-code",label:"Claude Code",prefix:""},{kind:"codex",label:"Codex",prefix:"codex:"},{kind:"cursor",label:"Cursor",prefix:"cursor:"}];function u(e){let{projects:t,sessions:s,settingsMap:a,signedIn:u}=e,[m,h]=(0,n.useState)("all"),p=(0,n.useMemo)(()=>{let e=new Set;for(let s of t)s.id.startsWith("codex:")?e.add("codex"):s.id.startsWith("cursor:")?e.add("cursor"):e.add("claude-code");return e},[t]),f=p.size>1,b=(0,n.useMemo)(()=>"all"===m?t:"claude-code"===m?t.filter(e=>!e.id.startsWith("codex:")&&!e.id.startsWith("cursor:")):t.filter(e=>{var t,s;return e.id.startsWith(null!=(s=null==(t=x.find(e=>e.kind===m))?void 0:t.prefix)?s:"___")}),[t,m]),j=(0,n.useMemo)(()=>"all"===m?s:"claude-code"===m?s.filter(e=>!e.projectId.startsWith("codex:")&&!e.projectId.startsWith("cursor:")):s.filter(e=>{var t,s;return e.projectId.startsWith(null!=(s=null==(t=x.find(e=>e.kind===m))?void 0:t.prefix)?s:"___")}),[s,m]),g={syncToCloud:!1};return(0,r.jsxs)(r.Fragment,{children:[f?(0,r.jsx)("div",{className:"mb-6 flex gap-1 rounded-md border border-surface-border bg-surface-0 p-0.5 w-fit",children:x.filter(e=>"all"===e.kind||p.has(e.kind)).map(e=>{let s="all"===e.kind?t.length:"claude-code"===e.kind?t.filter(e=>!e.id.startsWith("codex:")&&!e.id.startsWith("cursor:")).length:t.filter(t=>t.id.startsWith(e.prefix)).length;return(0,r.jsxs)("button",{type:"button",onClick:()=>h(e.kind),className:"rounded-md px-3 py-1.5 text-xs font-medium transition-colors ".concat(m===e.kind?"bg-surface-2 text-ink-1":"text-ink-3 hover:text-ink-1"),children:[e.label,(0,r.jsx)("span",{className:"ml-1.5 tabular-nums text-ink-4",children:s})]},e.kind)})}):null,(0,r.jsxs)("div",{className:"grid gap-6 lg:grid-cols-[1.1fr_1fr]",children:[(0,r.jsxs)("section",{children:[(0,r.jsx)("h2",{className:"mb-3 text-2xs font-medium uppercase tracking-wider text-ink-3",children:"Projects"}),(0,r.jsx)("div",{className:"flex flex-col gap-2",children:b.map(e=>{var t;let s=null!=(t=a[e.id])?t:g,n=e.id.startsWith("codex:"),x=e.id.startsWith("cursor:");return(0,r.jsxs)("div",{className:"flex items-stretch gap-2",children:[(0,r.jsx)(i(),{href:"/projects/".concat(encodeURIComponent(e.id)),className:"min-w-0 flex-1",children:(0,r.jsxs)(c.Z,{hoverable:!0,className:"flex items-center gap-4 px-5 py-4",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"truncate text-sm font-semibold text-ink-1",children:e.name}),(0,r.jsxs)(o.E,{children:[(0,l.FQ)(e.sessionCount)," sessions"]}),n?(0,r.jsx)(o.E,{variant:"accent",children:"Codex"}):x?(0,r.jsx)(o.E,{variant:"accent",children:"Cursor"}):null,s.syncToCloud?(0,r.jsx)(o.E,{variant:"success",children:"syncing"}):null]}),(0,r.jsx)("div",{className:"mt-0.5 truncate font-mono text-2xs text-ink-3",children:e.path})]}),(0,r.jsx)("div",{className:"text-2xs text-ink-3",children:e.lastActiveAt?(0,l.Kc)(new Date(e.lastActiveAt)):""})]})}),n||x?null:(0,r.jsx)("div",{className:"flex items-center",children:(0,r.jsx)(d.ProjectSettingsButton,{projectKey:e.id,initial:s,signedIn:u,sessionCount:e.sessionCount})})]},e.id)})})]}),(0,r.jsxs)("section",{children:[(0,r.jsx)("h2",{className:"mb-3 text-2xs font-medium uppercase tracking-wider text-ink-3",children:"Recent sessions"}),(0,r.jsx)("div",{className:"flex flex-col gap-2",children:j.slice(0,12).map(e=>{var t;let s=e.projectId.startsWith("codex:")?"Codex":e.projectId.startsWith("cursor:")?"Cursor":null;return(0,r.jsx)(i(),{href:"/sessions/".concat(encodeURIComponent(e.projectId),"/").concat(encodeURIComponent(e.id)),children:(0,r.jsxs)(c.Z,{hoverable:!0,className:"px-5 py-4",children:[(0,r.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,r.jsx)("span",{className:"line-clamp-1 text-sm font-medium text-ink-1",children:e.title}),(0,r.jsx)("span",{className:"shrink-0 text-2xs text-ink-3",children:(0,l.Kc)(new Date(null!=(t=e.endedAt)?t:e.startedAt))})]}),(0,r.jsxs)("div",{className:"mt-1 flex items-center gap-2 text-2xs text-ink-3",children:[e.projectName?(0,r.jsx)("span",{children:e.projectName}):null,e.projectName?(0,r.jsx)("span",{children:"\xb7"}):null,s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.E,{variant:"accent",children:s}),(0,r.jsx)("span",{children:"\xb7"})]}):null,(0,r.jsxs)("span",{children:[(0,l.FQ)(e.messageCount)," msgs"]}),(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)("span",{children:[(0,l.FQ)(e.toolCallCount)," tools"]}),e.fileChangeCount>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)("span",{children:[(0,l.FQ)(e.fileChangeCount)," edits"]})]}):null,e.hasErrors?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsx)(o.E,{variant:"danger",children:"errors"})]}):null]})]})},"".concat(e.projectId,"/").concat(e.id))})})]})]})]})}},2109:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var r=s(655);function n(e){let{children:t,className:s="",hoverable:n=!1}=e;return(0,r.jsx)("div",{className:"card ".concat(n?"card-hover":""," ").concat(s),children:t})}},3660:(e,t,s)=>{"use strict";s.d(t,{FQ:()=>i,Kc:()=>d,v7:()=>c});let r=new Intl.NumberFormat("en-US"),n=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}),a=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"});function i(e){return r.format(e)}function c(e){return e?"".concat(!e?"—":n.format(e)," \xb7 ").concat(e?a.format(e):""):"—"}let o=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60],["second",1]],l=new Intl.RelativeTimeFormat("en-US",{numeric:"auto"});function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;if(!e)return"—";let s=Math.round((e.getTime()-t.getTime())/1e3);for(let[e,t]of o)if(Math.abs(s)>=t||"second"===e)return l.format(Math.round(s/t),e);return l.format(s,"second")}},3692:(e,t,s)=>{"use strict";s.d(t,{ProjectSettingsButton:()=>c});var r=s(655),n=s(4519),a=s(4094);let i=(0,a.createServerReference)("4040ec48cb8a5b57c7617a575b90d5e8155f685372",a.callServer,void 0,a.findSourceMapURL,"upsertProjectSettingsAction");function c(e){let{projectKey:t,initial:s,signedIn:a,sessionCount:c,variant:l="icon"}=e,[d,x]=(0,n.useState)(!1),[u,m]=(0,n.useState)(s),[h,p]=(0,n.useState)(null),[f,b]=(0,n.useTransition)(),j="icon"===l?(0,r.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),x(!0)},className:"rounded-md border border-surface-border bg-surface-1 p-1.5 text-ink-3 hover:border-surface-4 hover:text-ink-1",title:"Project settings","aria-label":"Project settings",children:(0,r.jsx)(o,{})}):(0,r.jsxs)("button",{type:"button",onClick:()=>x(!0),className:"inline-flex items-center gap-1.5 rounded-md border border-surface-border bg-surface-1 px-3 py-1.5 text-xs font-medium text-ink-2 hover:border-surface-4 hover:text-ink-1",children:[(0,r.jsx)(o,{}),"Project settings",u.syncToCloud?(0,r.jsx)("span",{className:"rounded-full bg-success/15 px-1.5 py-0.5 text-2xs text-success",children:"syncing"}):null]});return(0,r.jsxs)(r.Fragment,{children:[j,d?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4",onClick:e=>{e.stopPropagation(),x(!1)},children:(0,r.jsxs)("div",{className:"w-full max-w-md overflow-hidden rounded-xl border border-surface-border bg-surface-1 shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("header",{className:"flex items-center justify-between border-b border-surface-border px-5 py-3",children:[(0,r.jsxs)("h2",{className:"truncate text-sm font-semibold text-ink-1",children:["Project settings \xb7 ",(0,r.jsx)("span",{className:"font-mono text-ink-3",children:function(e){var t;if(!e.startsWith("-"))return e;let s=e.split("-").filter(Boolean);return null!=(t=s[s.length-1])?t:e}(t)})]}),(0,r.jsx)("button",{type:"button",onClick:()=>x(!1),className:"rounded-md p-1 text-ink-3 hover:bg-surface-2 hover:text-ink-1",children:"\xd7"})]}),(0,r.jsxs)("div",{className:"space-y-4 px-5 py-4",children:[a?null:(0,r.jsx)("p",{className:"rounded-md border border-warning/30 bg-warning/10 px-3 py-2 text-2xs text-warning",children:"Sign in to save project settings to your account."}),(0,r.jsxs)("fieldset",{children:[(0,r.jsx)("legend",{className:"mb-2 text-2xs font-medium uppercase tracking-wider text-ink-3",children:"Sync to cloud"}),(0,r.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 text-xs text-ink-2",children:[(0,r.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:u.syncToCloud,onChange:e=>(function(e){let s={...u,...e};m(s),p(null),b(async()=>{let e=await i({projectKey:t,archiveNewSessions:s.syncToCloud});e.ok||(p(e.error),m(u))})})({syncToCloud:e.target.checked}),disabled:!a||f}),(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"font-medium text-ink-1",children:"Back up this project to my account"}),(0,r.jsxs)("span",{className:"ml-1 text-ink-3",children:["— uploads every session as a private cloud copy",null!=c&&c>0?" (".concat(c," session").concat(1===c?"":"s"," will sync now, plus any new ones going forward)"):" (existing and new)",". Promote individual sessions to unlisted/public from My shares."]})]})]})]}),h?(0,r.jsx)("p",{className:"rounded-md border border-danger/30 bg-danger/10 px-3 py-2 text-2xs text-danger",children:h}):null]}),(0,r.jsxs)("footer",{className:"border-t border-surface-border bg-surface-0/40 px-5 py-3 text-2xs text-ink-3",children:["Projects are never public. Use the ",(0,r.jsx)("strong",{children:"Share session"})," ","button on a session to publish individual ones."]})]})}):null]})}function o(){return(0,r.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"2",stroke:"currentColor",strokeWidth:"1.4"}),(0,r.jsx)("path",{d:"M8 1v2m0 10v2M3.5 3.5l1.4 1.4m6.2 6.2l1.4 1.4M1 8h2m10 0h2M3.5 12.5l1.4-1.4m6.2-6.2l1.4-1.4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}},4094:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var s in t)Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}(t,{callServer:function(){return r.callServer},createServerReference:function(){return a.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}});let r=s(3609),n=s(4433),a=s(7041)},5840:(e,t,s)=>{"use strict";s.d(t,{E:()=>a});var r=s(655);let n={default:"badge",accent:"badge badge-accent",success:"badge badge-success",warning:"badge badge-warning",danger:"badge badge-danger"};function a(e){let{children:t,variant:s="default"}=e;return(0,r.jsx)("span",{className:n[s],children:t})}},5995:(e,t,s)=>{"use strict";s.d(t,{InstallCTA:()=>a});var r=s(655),n=s(4519);function a(){return(0,r.jsxs)("section",{className:"relative px-6 py-20 sm:py-28",children:[(0,r.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-accent/30 to-transparent"}),(0,r.jsx)("div",{className:"mx-auto max-w-[820px]",children:(0,r.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border border-surface-border bg-surface-1 shadow-2xl shadow-black/30",children:[(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0 -z-10",style:{background:"radial-gradient(ellipse at top right, rgba(129,140,248,0.15), transparent 50%), radial-gradient(ellipse at bottom left, rgba(99,102,241,0.1), transparent 50%)"}}),(0,r.jsxs)("div",{className:"px-8 py-12 sm:px-12",children:[(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-2xs font-medium uppercase tracking-wider text-accent",children:"Get started"}),(0,r.jsx)("h2",{className:"mt-2 text-3xl font-semibold tracking-tight text-ink-0 sm:text-4xl",children:"One command. Zero config."}),(0,r.jsx)("p",{className:"mx-auto mt-3 max-w-md text-sm leading-relaxed text-ink-2",children:"Run it, browse your sessions, share what matters. Nothing leaves your machine until you click Share."})]}),(0,r.jsx)("div",{className:"mx-auto mt-8 max-w-md",children:(0,r.jsx)(i,{command:"npx promptarc"})}),(0,r.jsxs)("div",{className:"mt-10 grid gap-4 sm:grid-cols-3",children:[(0,r.jsxs)(c,{n:"01",title:"Multi-agent",children:["Reads ",(0,r.jsx)("code",{className:"font-mono text-2xs",children:"~/.claude/"}),","," ",(0,r.jsx)("code",{className:"font-mono text-2xs",children:"~/.codex/"}),", and"," ",(0,r.jsx)("code",{className:"font-mono text-2xs",children:"~/.cursor/"})," ","in one dashboard with tabs."]}),(0,r.jsx)(c,{n:"02",title:"Zero config",children:"No accounts. No setup. Run one command and your sessions are instantly browseable with inline diffs."}),(0,r.jsxs)(c,{n:"03",title:"AI-powered",children:["AI summaries on every share. PR descriptions from the terminal with ",(0,r.jsx)("code",{className:"font-mono text-2xs",children:"promptarc pr"}),". Full-text search across your cloud archive."]})]}),(0,r.jsx)("div",{className:"mt-8 flex justify-center",children:(0,r.jsxs)("a",{href:"https://www.npmjs.com/package/promptarc",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-md border border-surface-border bg-surface-2 px-4 py-2 text-xs font-medium text-ink-2 transition-colors hover:border-surface-4 hover:text-ink-1",children:[(0,r.jsx)(o,{}),"View on npm"]})})]})]})})]})}function i(e){let{command:t}=e,[s,a]=(0,n.useState)(!1);async function i(){try{await navigator.clipboard.writeText(t),a(!0),setTimeout(()=>a(!1),1500)}catch(e){}}return(0,r.jsxs)("button",{type:"button",onClick:i,className:"group flex w-full items-center justify-between gap-3 rounded-xl border border-surface-border bg-surface-0 px-5 py-3.5 font-mono text-sm text-ink-1 transition-all hover:border-surface-4 hover:shadow-lg hover:shadow-black/20",children:[(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"text-ink-4",children:"$"})," ",t]}),(0,r.jsx)("span",{className:"shrink-0 rounded-md border border-surface-border bg-surface-2 px-2 py-0.5 text-2xs font-sans text-ink-3 transition-colors group-hover:border-surface-4 group-hover:text-ink-1",children:s?"copied!":"copy"})]})}function c(e){let{n:t,title:s,children:n}=e;return(0,r.jsxs)("div",{className:"rounded-xl border border-surface-border bg-surface-0/50 px-5 py-5",children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,r.jsx)("span",{className:"flex h-6 w-6 items-center justify-center rounded-md border border-accent/30 bg-accent-soft font-mono text-2xs font-bold text-accent",children:t}),(0,r.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider text-ink-3",children:s})]}),(0,r.jsx)("p",{className:"text-2xs leading-relaxed text-ink-2",children:n})]})}function o(){return(0,r.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[(0,r.jsx)("rect",{x:"1",y:"3",width:"12",height:"8",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),(0,r.jsx)("path",{d:"M4 6v2.5M7 6v2.5M7 7.5h1.5V6",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]})}}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=697)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7066,9584,9877],{4462:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,3483,23)),Promise.resolve().then(n.bind(n,1123)),Promise.resolve().then(n.bind(n,6597)),Promise.resolve().then(n.bind(n,4059))}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=4462)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6801],{3692:(e,r,t)=>{"use strict";t.d(r,{ProjectSettingsButton:()=>c});var s=t(655),n=t(4519),o=t(4094);let i=(0,o.createServerReference)("4040ec48cb8a5b57c7617a575b90d5e8155f685372",o.callServer,void 0,o.findSourceMapURL,"upsertProjectSettingsAction");function c(e){let{projectKey:r,initial:t,signedIn:o,sessionCount:c,variant:a="icon"}=e,[d,u]=(0,n.useState)(!1),[x,p]=(0,n.useState)(t),[b,h]=(0,n.useState)(null),[f,m]=(0,n.useTransition)(),g="icon"===a?(0,s.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),u(!0)},className:"rounded-md border border-surface-border bg-surface-1 p-1.5 text-ink-3 hover:border-surface-4 hover:text-ink-1",title:"Project settings","aria-label":"Project settings",children:(0,s.jsx)(l,{})}):(0,s.jsxs)("button",{type:"button",onClick:()=>u(!0),className:"inline-flex items-center gap-1.5 rounded-md border border-surface-border bg-surface-1 px-3 py-1.5 text-xs font-medium text-ink-2 hover:border-surface-4 hover:text-ink-1",children:[(0,s.jsx)(l,{}),"Project settings",x.syncToCloud?(0,s.jsx)("span",{className:"rounded-full bg-success/15 px-1.5 py-0.5 text-2xs text-success",children:"syncing"}):null]});return(0,s.jsxs)(s.Fragment,{children:[g,d?(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4",onClick:e=>{e.stopPropagation(),u(!1)},children:(0,s.jsxs)("div",{className:"w-full max-w-md overflow-hidden rounded-xl border border-surface-border bg-surface-1 shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("header",{className:"flex items-center justify-between border-b border-surface-border px-5 py-3",children:[(0,s.jsxs)("h2",{className:"truncate text-sm font-semibold text-ink-1",children:["Project settings \xb7 ",(0,s.jsx)("span",{className:"font-mono text-ink-3",children:function(e){var r;if(!e.startsWith("-"))return e;let t=e.split("-").filter(Boolean);return null!=(r=t[t.length-1])?r:e}(r)})]}),(0,s.jsx)("button",{type:"button",onClick:()=>u(!1),className:"rounded-md p-1 text-ink-3 hover:bg-surface-2 hover:text-ink-1",children:"\xd7"})]}),(0,s.jsxs)("div",{className:"space-y-4 px-5 py-4",children:[o?null:(0,s.jsx)("p",{className:"rounded-md border border-warning/30 bg-warning/10 px-3 py-2 text-2xs text-warning",children:"Sign in to save project settings to your account."}),(0,s.jsxs)("fieldset",{children:[(0,s.jsx)("legend",{className:"mb-2 text-2xs font-medium uppercase tracking-wider text-ink-3",children:"Sync to cloud"}),(0,s.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 text-xs text-ink-2",children:[(0,s.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:x.syncToCloud,onChange:e=>(function(e){let t={...x,...e};p(t),h(null),m(async()=>{let e=await i({projectKey:r,archiveNewSessions:t.syncToCloud});e.ok||(h(e.error),p(x))})})({syncToCloud:e.target.checked}),disabled:!o||f}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"font-medium text-ink-1",children:"Back up this project to my account"}),(0,s.jsxs)("span",{className:"ml-1 text-ink-3",children:["— uploads every session as a private cloud copy",null!=c&&c>0?" (".concat(c," session").concat(1===c?"":"s"," will sync now, plus any new ones going forward)"):" (existing and new)",". Promote individual sessions to unlisted/public from My shares."]})]})]})]}),b?(0,s.jsx)("p",{className:"rounded-md border border-danger/30 bg-danger/10 px-3 py-2 text-2xs text-danger",children:b}):null]}),(0,s.jsxs)("footer",{className:"border-t border-surface-border bg-surface-0/40 px-5 py-3 text-2xs text-ink-3",children:["Projects are never public. Use the ",(0,s.jsx)("strong",{children:"Share session"})," ","button on a session to publish individual ones."]})]})}):null]})}function l(){return(0,s.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[(0,s.jsx)("circle",{cx:"8",cy:"8",r:"2",stroke:"currentColor",strokeWidth:"1.4"}),(0,s.jsx)("path",{d:"M8 1v2m0 10v2M3.5 3.5l1.4 1.4m6.2 6.2l1.4 1.4M1 8h2m10 0h2M3.5 12.5l1.4-1.4m6.2-6.2l1.4-1.4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}},4094:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,r){for(var t in r)Object.defineProperty(e,t,{enumerable:!0,get:r[t]})}(r,{callServer:function(){return s.callServer},createServerReference:function(){return o.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}});let s=t(3609),n=t(4433),o=t(7041)},9563:(e,r,t)=>{Promise.resolve().then(t.t.bind(t,3483,23)),Promise.resolve().then(t.bind(t,3692)),Promise.resolve().then(t.bind(t,1123)),Promise.resolve().then(t.bind(t,6597)),Promise.resolve().then(t.bind(t,4059))}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=9563)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9485],{1455:(e,r,t)=>{Promise.resolve().then(t.t.bind(t,3483,23)),Promise.resolve().then(t.bind(t,9677)),Promise.resolve().then(t.bind(t,1123)),Promise.resolve().then(t.bind(t,6597)),Promise.resolve().then(t.bind(t,4059)),Promise.resolve().then(t.bind(t,4785)),Promise.resolve().then(t.bind(t,4485))},4485:(e,r,t)=>{"use strict";t.d(r,{ToolCall:()=>a});var n=t(655),s=t(4519);function o(e){var r;let{preview:t}=e,[o,a]=(0,s.useState)(!1);if(!t.text.trim())return null;let i=null!=(r=t.text.split("\n",1)[0])?r:"",c=t.text.includes("\n")||t.truncated;return(0,n.jsxs)("div",{className:"overflow-hidden rounded-md border text-2xs ".concat(t.isError?"border-danger/30 bg-danger/5":"border-surface-border bg-surface-0/40"),children:[(0,n.jsxs)("button",{type:"button",onClick:()=>c&&a(e=>!e),disabled:!c,className:"flex w-full items-center gap-2 px-3 py-1 text-left ".concat(c?"hover:bg-surface-2/40":""),children:[(0,n.jsx)("span",{className:"rounded px-1.5 py-px font-mono ".concat(t.isError?"bg-danger/20 text-danger":"bg-surface-2 text-ink-3"),children:t.isError?"error":"output"}),(0,n.jsx)("span",{className:"line-clamp-1 flex-1 text-ink-2",children:i||"(empty)"}),c?(0,n.jsx)("span",{className:"text-ink-4",children:o?"▾":"▸"}):null]}),o?(0,n.jsxs)("pre",{className:"max-h-72 overflow-auto whitespace-pre-wrap border-t border-surface-border bg-surface-0/40 px-3 py-2 font-mono text-2xs text-ink-2",children:[t.text,t.truncated?(0,n.jsx)("span",{className:"text-ink-4",children:"\n… truncated (".concat(t.fullLines," lines)")}):null]}):null]})}function a(e){let{name:r,input:t,result:a,diff:c}=e,[l,d]=(0,s.useState)(!1),u=function(e,r){var t,s,o,a,i,c,l,d,u,x,p;if(!r||"object"!=typeof r)return"";switch(e){case"Bash":return(0,n.jsx)("code",{className:"font-mono",children:String(null!=(s=null!=(t=r.command)?t:r.description)?s:"")});case"Read":return(0,n.jsx)("code",{className:"font-mono",children:String(null!=(o=r.file_path)?o:"")});case"Edit":case"Write":return(0,n.jsx)("code",{className:"font-mono",children:String(null!=(a=r.file_path)?a:"")});case"Grep":return(0,n.jsxs)("code",{className:"font-mono",children:[String(null!=(i=r.pattern)?i:""),r.path?" in ".concat(r.path):""]});case"Glob":return(0,n.jsx)("code",{className:"font-mono",children:String(null!=(c=r.pattern)?c:"")});case"TaskCreate":return String(null!=(l=r.subject)?l:"");case"TaskUpdate":return"".concat(String(null!=(d=r.taskId)?d:"")," → ").concat(String(null!=(u=r.status)?u:""));case"Agent":return String(null!=(p=null!=(x=r.description)?x:r.prompt)?p:"");default:for(let[,e]of Object.entries(r))if("string"==typeof e&&e.length>0)return e;return""}}(r,t);return(0,n.jsxs)("div",{className:"overflow-hidden rounded-md border border-surface-border bg-surface-1/80",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>d(e=>!e),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-2xs hover:bg-surface-2",children:[(0,n.jsx)(i,{open:l}),(0,n.jsx)("span",{className:"rounded bg-accent-soft px-1.5 py-px font-mono text-2xs text-accent",children:r}),(0,n.jsx)("span",{className:"line-clamp-1 flex-1 text-ink-2",children:u})]}),l?(0,n.jsx)("pre",{className:"max-h-72 overflow-auto border-t border-surface-border bg-surface-0/40 px-3 py-2 font-mono text-2xs text-ink-2",children:function(e){try{return JSON.stringify(e,null,2)}catch(r){return String(e)}}(t)}):null,c?(0,n.jsx)("div",{className:"border-t border-surface-border p-2",children:c}):null,a?(0,n.jsx)("div",{className:"border-t border-surface-border p-2",children:(0,n.jsx)(o,{preview:a})}):null]})}function i(e){let{open:r}=e;return(0,n.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",className:"shrink-0 text-ink-3 transition-transform ".concat(r?"rotate-90":""),children:(0,n.jsx)("path",{d:"M3.5 2.5L6.5 5L3.5 7.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}},4785:(e,r,t)=>{"use strict";t.d(r,{ThinkingBlock:()=>o});var n=t(655),s=t(4519);function o(e){let{text:r}=e,[t,o]=(0,s.useState)(!1);return r.trim()?(0,n.jsxs)("details",{className:"group rounded-md border border-surface-border bg-surface-1/60 text-2xs",open:t,onToggle:e=>o(e.target.open),children:[(0,n.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-3 py-1.5 text-ink-3 hover:text-ink-2",children:[(0,n.jsx)(a,{open:t}),(0,n.jsx)("span",{className:"font-medium uppercase tracking-wider",children:"Thinking"}),(0,n.jsxs)("span",{className:"text-ink-4",children:[r.length," chars"]})]}),(0,n.jsx)("pre",{className:"whitespace-pre-wrap border-t border-surface-border px-3 py-2 font-mono text-2xs text-ink-3",children:r})]}):null}function a(e){let{open:r}=e;return(0,n.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",className:"transition-transform ".concat(r?"rotate-90":""),children:(0,n.jsx)("path",{d:"M3.5 2.5L6.5 5L3.5 7.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}},9677:(e,r,t)=>{"use strict";t.d(r,{PRSummaryButton:()=>o});var n=t(655),s=t(4519);function o(e){let{slug:r}=e,[t,o]=(0,s.useState)("idle"),[c,l]=(0,s.useState)(""),[d,u]=(0,s.useState)(""),[x,p]=(0,s.useState)(!1);async function h(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];o("loading"),u("");try{let n=await fetch("/api/ai/pr-summary",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({slug:r,force:e})});if(!n.ok){var t;let e=await n.json();throw Error(null!=(t=e.error)?t:"HTTP ".concat(n.status))}let s=await n.json();l(s.markdown),o(s.stale?"stale":"done")}catch(e){u(e instanceof Error?e.message:String(e)),o("error")}}async function m(){try{await navigator.clipboard.writeText(c),p(!0),setTimeout(()=>p(!1),1500)}catch(e){}}return"idle"===t?(0,n.jsxs)("button",{type:"button",onClick:()=>h(!1),className:"flex w-full items-center gap-2 rounded-md border border-surface-border bg-surface-1 px-3 py-2 text-xs font-medium text-ink-2 hover:border-surface-4 hover:text-ink-1",children:[(0,n.jsx)(a,{}),"Generate PR description"]}):"loading"===t?(0,n.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-surface-border bg-surface-1 px-3 py-2 text-xs text-ink-3",children:[(0,n.jsx)(i,{}),"Generating..."]}):"error"===t?(0,n.jsxs)("div",{className:"rounded-md border border-danger/30 bg-danger/10 px-3 py-2",children:[(0,n.jsx)("p",{className:"text-2xs text-danger",children:d}),(0,n.jsx)("button",{type:"button",onClick:()=>h(!0),className:"mt-1 text-2xs font-medium text-danger hover:underline",children:"Try again"})]}):(0,n.jsxs)("div",{className:"rounded-md border border-surface-border bg-surface-1",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between border-b border-surface-border px-3 py-2",children:[(0,n.jsx)("span",{className:"text-2xs font-medium text-ink-3",children:"PR description"}),(0,n.jsx)("button",{type:"button",onClick:m,className:"rounded border border-surface-border bg-surface-2 px-2 py-0.5 text-2xs font-medium text-ink-2 hover:border-surface-4 hover:text-ink-1",children:x?"Copied!":"Copy"})]}),(0,n.jsx)("pre",{className:"max-h-64 overflow-y-auto whitespace-pre-wrap p-3 font-mono text-2xs leading-relaxed text-ink-2",children:c}),"stale"===t?(0,n.jsxs)("div",{className:"border-t border-warning/20 bg-warning/5 px-3 py-2",children:[(0,n.jsx)("p",{className:"text-2xs text-warning",children:"Session updated since this was generated."}),(0,n.jsx)("button",{type:"button",onClick:()=>h(!0),className:"mt-1 text-2xs font-medium text-warning hover:underline",children:"Regenerate"})]}):(0,n.jsx)("div",{className:"border-t border-surface-border px-3 py-1.5 text-2xs text-ink-4",children:"Paste into your GitHub PR body"})]})}function a(){return(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[(0,n.jsx)("circle",{cx:"5",cy:"4",r:"2",stroke:"currentColor",strokeWidth:"1.4"}),(0,n.jsx)("circle",{cx:"11",cy:"12",r:"2",stroke:"currentColor",strokeWidth:"1.4"}),(0,n.jsx)("path",{d:"M5 6v6M11 10V6c0-1-1-2-3-2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function i(){return(0,n.jsxs)("svg",{className:"h-3.5 w-3.5 animate-spin text-accent",viewBox:"0 0 16 16",fill:"none",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.6",opacity:"0.25"}),(0,n.jsx)("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=1455)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150,450,565,880,1426,1499,1889,2119,2467,2748,3282,3559,3784,3925,3944,3972,4725,4771,5015,5125,5413,5475,6202,6963,8011,8662,9492,9751,9878],{4549:()=>{}},_=>{_.O(0,[7575,4695,7358],()=>_(_.s=4549)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2959],{224:(e,t,n)=>{"use strict";n.d(t,{CloudSearchBox:()=>c});var r=n(655),s=n(4519),a=n(3483),l=n.n(a),i=n(3660);function c(){let[e,t]=(0,s.useState)(""),[n,a]=(0,s.useState)([]),[c,o]=(0,s.useState)(!1),[u,d]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null),x=(0,s.useRef)(null),f=(0,s.useCallback)(async e=>{if(e.trim().length<2){a([]),d(!1);return}o(!0),h(null);try{let n=await fetch("/api/search",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({q:e.trim(),limit:30})});if(!n.ok){var t;let e=await n.json();throw Error(null!=(t=e.error)?t:"HTTP ".concat(n.status))}let r=await n.json();a(r.results),d(!0)}catch(e){h(e instanceof Error?e.message:String(e)),a([]),d(!0)}finally{o(!1)}},[]);return(0,r.jsxs)("div",{children:[(0,r.jsx)("form",{onSubmit:function(t){t.preventDefault(),x.current&&clearTimeout(x.current),f(e)},className:"mb-6",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("input",{type:"text",value:e,onChange:e=>{var n;t(n=e.target.value),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>f(n),350)},placeholder:'Search... e.g. "OAuth redirect error" or "tsconfig"',autoFocus:!0,className:"flex-1 rounded-md border border-surface-border bg-surface-0 px-4 py-2.5 text-sm text-ink-1 placeholder:text-ink-4 focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent"}),(0,r.jsx)("button",{type:"submit",disabled:c||e.trim().length<2,className:"shrink-0 rounded-md border border-accent/40 bg-accent px-4 py-2.5 text-sm font-semibold text-surface-0 hover:bg-accent/90 disabled:opacity-50",children:c?"Searching...":"Search"})]})}),m?(0,r.jsx)("div",{className:"rounded-md border border-danger/30 bg-danger/10 px-4 py-3 text-sm text-danger",children:m}):null,u&&!m?(0,r.jsx)("div",{className:"mb-3 text-2xs text-ink-3",children:0===n.length?"No results found.":"".concat(n.length," result").concat(1===n.length?"":"s")}):null,n.length>0?(0,r.jsx)("div",{className:"flex flex-col gap-2",children:n.map(e=>(0,r.jsx)(l(),{href:"/r/".concat(e.slug),children:(0,r.jsxs)("div",{className:"card hoverable px-5 py-4",children:[(0,r.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,r.jsx)("span",{className:"line-clamp-1 text-sm font-medium text-ink-1",children:e.title}),(0,r.jsx)("span",{className:"shrink-0 text-2xs text-ink-3",children:(0,i.Kc)(new Date(e.createdAt))})]}),e.headline?(0,r.jsx)("p",{className:"mt-1 line-clamp-2 text-2xs text-ink-2",dangerouslySetInnerHTML:{__html:e.headline}}):null,(0,r.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 text-2xs text-ink-3",children:[e.projectName?(0,r.jsx)("span",{className:"font-medium",children:e.projectName}):null,e.projectName?(0,r.jsx)("span",{children:"\xb7"}):null,(0,r.jsxs)("span",{children:[(0,i.FQ)(e.messageCount)," msgs"]}),(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)("span",{children:[(0,i.FQ)(e.toolCallCount)," tools"]}),e.fileChangeCount>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)("span",{children:[(0,i.FQ)(e.fileChangeCount)," edits"]})]}):null,(0,r.jsx)("span",{className:"badge text-2xs",children:e.visibility})]})]})},e.slug))}):null,u||c?null:(0,r.jsxs)("div",{className:"mt-8 text-center text-sm text-ink-3",children:[(0,r.jsx)("p",{children:"Search your entire cloud archive."}),(0,r.jsx)("p",{className:"mt-2 text-2xs",children:"Try a file path, error message, command, function name, or anything from a conversation with your AI agent."})]})]})}},3660:(e,t,n)=>{"use strict";n.d(t,{FQ:()=>l,Kc:()=>u,v7:()=>i});let r=new Intl.NumberFormat("en-US"),s=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}),a=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"});function l(e){return r.format(e)}function i(e){return e?"".concat(!e?"—":s.format(e)," \xb7 ").concat(e?a.format(e):""):"—"}let c=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60],["second",1]],o=new Intl.RelativeTimeFormat("en-US",{numeric:"auto"});function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;if(!e)return"—";let n=Math.round((e.getTime()-t.getTime())/1e3);for(let[e,t]of c)if(Math.abs(n)>=t||"second"===e)return o.format(Math.round(n/t),e);return o.format(n,"second")}},5106:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,3483,23)),Promise.resolve().then(n.bind(n,224)),Promise.resolve().then(n.bind(n,1123)),Promise.resolve().then(n.bind(n,6597)),Promise.resolve().then(n.bind(n,4059))}},e=>{e.O(0,[7200,1029,7575,4695,7358],()=>e(e.s=5106)),_N_E=e.O()}]);