@yina-npm/openrouterx 0.5.9 → 0.5.10

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 (137) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +4 -4
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/admin/keys/page.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/admin/keys/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/admin/users/page.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/admin/users/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/user/page.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/user/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  49. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  50. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  51. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  52. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  53. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  54. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  55. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  56. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  58. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  59. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  60. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  61. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  62. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  63. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  64. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  65. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  66. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  67. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  68. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  69. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  70. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/callback.html +1 -1
  72. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  73. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  74. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  75. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  76. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  77. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  78. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  79. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  80. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  81. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  82. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  83. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  85. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  86. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  87. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  88. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  90. package/app/.next-cli-build/server/app/index.html +1 -1
  91. package/app/.next-cli-build/server/app/index.rsc +4 -4
  92. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  93. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  94. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  95. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  96. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  97. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  98. package/app/.next-cli-build/server/app/landing.html +1 -1
  99. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  100. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  101. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  102. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  103. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  104. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  105. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  106. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  107. package/app/.next-cli-build/server/app/login.html +1 -1
  108. package/app/.next-cli-build/server/app/login.rsc +5 -5
  109. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  110. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  111. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  112. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  113. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  114. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  115. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  116. package/app/.next-cli-build/server/app-paths-manifest.json +4 -4
  117. package/app/.next-cli-build/server/chunks/1350.js +1 -1
  118. package/app/.next-cli-build/server/chunks/3412.js +1 -1
  119. package/app/.next-cli-build/server/chunks/412.js +1 -1
  120. package/app/.next-cli-build/server/chunks/5816.js +1 -1
  121. package/app/.next-cli-build/server/chunks/6151.js +1 -1
  122. package/app/.next-cli-build/server/chunks/6688.js +1 -1
  123. package/app/.next-cli-build/server/chunks/7259.js +1 -1
  124. package/app/.next-cli-build/server/chunks/7937.js +1 -1
  125. package/app/.next-cli-build/server/chunks/801.js +1 -1
  126. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  127. package/app/.next-cli-build/server/pages/404.html +1 -1
  128. package/app/.next-cli-build/server/pages/500.html +1 -1
  129. package/app/.next-cli-build/static/chunks/{1321-dbbab49aa820c76b.js → 1321-7d926378b0f39749.js} +1 -1
  130. package/app/.next-cli-build/static/chunks/{5497-215b48f00706d2c8.js → 5497-53b71597ca1b53f8.js} +5 -5
  131. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-929ab76c6137174e.js +1 -0
  132. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-b38e9f02aacbdcc5.js → layout-8151b85461a99f83.js} +1 -1
  133. package/app/package.json +1 -1
  134. package/package.json +1 -1
  135. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-95bd9413da0d98a6.js +0 -1
  136. /package/app/.next-cli-build/static/{Z1O3mWLKLCkJm5SRaYg62 → DLZR81Hq9OqOrl2Xc2iHn}/_buildManifest.js +0 -0
  137. /package/app/.next-cli-build/static/{Z1O3mWLKLCkJm5SRaYg62 → DLZR81Hq9OqOrl2Xc2iHn}/_ssgManifest.js +0 -0
@@ -1,2 +1,2 @@
1
- (()=>{var a={};a.id=4465,a.ids=[4465],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},643:a=>{"use strict";a.exports=require("node:perf_hooks")},962:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/McpMarketplaceModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/McpMarketplaceModal.js","default")},1708:a=>{"use strict";a.exports=require("node:process")},1932:a=>{"use strict";a.exports=require("url")},2422:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/UsageStats.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/UsageStats.js","default")},3080:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/OAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/OAuthModal.js","default")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},4996:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/CapacityBadges.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/CapacityBadges.js","default")},5843:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/NoAuthProxyCard.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/NoAuthProxyCard.js","default")},7066:a=>{"use strict";a.exports=require("node:tty")},7290:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Card.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Card.js","default")},10079:(a,b,c)=>{"use strict";c.d(b,{ConfirmModal:()=>f,default:()=>e});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Modal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Modal.js","default"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call ConfirmModal() from the server but ConfirmModal is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Modal.js","ConfirmModal")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},14285:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/KiroOAuthWrapper.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/KiroOAuthWrapper.js","default")},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},17891:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/get-segment-param")},18200:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/AddCustomEmbeddingModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/AddCustomEmbeddingModal.js","default")},18421:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Tooltip.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Tooltip.js","default")},19083:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/RequestLogger.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/RequestLogger.js","default")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20493:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/ComboFormModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/ComboFormModal.js","default")},21820:a=>{"use strict";a.exports=require("os")},26288:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/AddCustomImageModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/AddCustomImageModal.js","default")},26626:(a,b,c)=>{Promise.resolve().then(c.bind(c,18200)),Promise.resolve().then(c.bind(c,26288)),Promise.resolve().then(c.bind(c,70061)),Promise.resolve().then(c.bind(c,33893)),Promise.resolve().then(c.bind(c,45512)),Promise.resolve().then(c.bind(c,4996)),Promise.resolve().then(c.bind(c,7290)),Promise.resolve().then(c.bind(c,33811)),Promise.resolve().then(c.bind(c,20493)),Promise.resolve().then(c.bind(c,40167)),Promise.resolve().then(c.bind(c,70139)),Promise.resolve().then(c.bind(c,49123)),Promise.resolve().then(c.bind(c,64148)),Promise.resolve().then(c.bind(c,92669)),Promise.resolve().then(c.bind(c,29354)),Promise.resolve().then(c.bind(c,80342)),Promise.resolve().then(c.bind(c,71230)),Promise.resolve().then(c.bind(c,82448)),Promise.resolve().then(c.bind(c,14285)),Promise.resolve().then(c.bind(c,87228)),Promise.resolve().then(c.bind(c,45205)),Promise.resolve().then(c.bind(c,64420)),Promise.resolve().then(c.bind(c,61780)),Promise.resolve().then(c.bind(c,92082)),Promise.resolve().then(c.bind(c,70603)),Promise.resolve().then(c.bind(c,962)),Promise.resolve().then(c.bind(c,10079)),Promise.resolve().then(c.bind(c,94582)),Promise.resolve().then(c.bind(c,29674)),Promise.resolve().then(c.bind(c,5843)),Promise.resolve().then(c.bind(c,3080)),Promise.resolve().then(c.bind(c,81923)),Promise.resolve().then(c.bind(c,19083)),Promise.resolve().then(c.bind(c,54065)),Promise.resolve().then(c.bind(c,83784)),Promise.resolve().then(c.bind(c,26866)),Promise.resolve().then(c.bind(c,89886)),Promise.resolve().then(c.bind(c,40515)),Promise.resolve().then(c.bind(c,70092)),Promise.resolve().then(c.bind(c,18421)),Promise.resolve().then(c.bind(c,2422)),Promise.resolve().then(c.bind(c,76978))},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},26866:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Sidebar.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Sidebar.js","default")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29354:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/HeaderMenu.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/HeaderMenu.js","default")},29674:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/NineRemoteButton.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/NineRemoteButton.js","default")},30508:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>j});var d=c(5735),e=c(65573);c(45512),c(71230),c(83784),c(7290),c(10079),c(92082),c(70061),c(33893),c(70092),c(40515),c(89886),c(26866),c(92669),c(49123),c(3080),c(94582),c(70603),c(20493),c(962),c(2422),c(45205),c(29674),c(29354),c(33811),c(19083),c(82448),c(14285),c(87228),c(40167),c(80342),c(64148),c(70139),c(18200),c(26288),c(5843),c(54065),c(18421),c(81923),c(4996);var f=c(61780);c(64420);var g=c(76978),h=c(33792);async function i(){try{let a=await (0,e.UL)(),b=a.get("auth_token")?.value;if(!b)return null;let c=await (0,h.dY)(b);if(!c)return null;return{role:c.role||null,userId:c.userId||null,displayName:c.displayName||null}}catch{return null}}async function j({children:a}){let b=await i();return(0,d.jsx)(g.UserRoleProvider,{role:b?.role,userId:b?.userId,displayName:b?.displayName,children:(0,d.jsx)(f.default,{children:a})})}},31421:a=>{"use strict";a.exports=require("node:child_process")},32467:a=>{"use strict";a.exports=require("node:http2")},33811:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/ChangelogModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/ChangelogModal.js","default")},33873:a=>{"use strict";a.exports=require("path")},33893:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Badge.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Badge.js","default")},34589:a=>{"use strict";a.exports=require("node:assert")},34631:a=>{"use strict";a.exports=require("tls")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40167:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/CursorAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/CursorAuthModal.js","default")},40515:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/ThemeToggle.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/ThemeToggle.js","default")},40551:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(5735),e=c(79286);function f(){return(0,d.jsx)(e.default,{})}},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},43954:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/interception-routes")},44778:(a,b,c)=>{Promise.resolve().then(c.bind(c,67738)),Promise.resolve().then(c.bind(c,7913)),Promise.resolve().then(c.bind(c,25919)),Promise.resolve().then(c.bind(c,75171)),Promise.resolve().then(c.bind(c,99070)),Promise.resolve().then(c.bind(c,38930)),Promise.resolve().then(c.bind(c,17660)),Promise.resolve().then(c.bind(c,11229)),Promise.resolve().then(c.bind(c,62727)),Promise.resolve().then(c.bind(c,51109)),Promise.resolve().then(c.bind(c,51585)),Promise.resolve().then(c.bind(c,48781)),Promise.resolve().then(c.bind(c,43182)),Promise.resolve().then(c.bind(c,32456)),Promise.resolve().then(c.bind(c,3236)),Promise.resolve().then(c.bind(c,79488)),Promise.resolve().then(c.bind(c,83552)),Promise.resolve().then(c.bind(c,8590)),Promise.resolve().then(c.bind(c,5291)),Promise.resolve().then(c.bind(c,56110)),Promise.resolve().then(c.bind(c,267)),Promise.resolve().then(c.bind(c,53838)),Promise.resolve().then(c.bind(c,85306)),Promise.resolve().then(c.bind(c,74812)),Promise.resolve().then(c.bind(c,39645)),Promise.resolve().then(c.bind(c,20084)),Promise.resolve().then(c.bind(c,95145)),Promise.resolve().then(c.bind(c,83352)),Promise.resolve().then(c.bind(c,23048)),Promise.resolve().then(c.bind(c,50585)),Promise.resolve().then(c.bind(c,79346)),Promise.resolve().then(c.bind(c,11633)),Promise.resolve().then(c.bind(c,91809)),Promise.resolve().then(c.bind(c,91099)),Promise.resolve().then(c.bind(c,4770)),Promise.resolve().then(c.bind(c,42196)),Promise.resolve().then(c.bind(c,19308)),Promise.resolve().then(c.bind(c,53845)),Promise.resolve().then(c.bind(c,95514)),Promise.resolve().then(c.bind(c,32971)),Promise.resolve().then(c.bind(c,28403)),Promise.resolve().then(c.bind(c,37900))},45205:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/LanguageSwitcher.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/LanguageSwitcher.js","default")},45512:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Button.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Button.js","default")},46293:a=>{"use strict";a.exports=require("sql.js")},48161:a=>{"use strict";a.exports=require("node:os")},49123:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Footer.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Footer.js","default")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},54065:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/SegmentedControl.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/SegmentedControl.js","default")},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},58917:(a,b,c)=>{Promise.resolve().then(c.bind(c,79286))},61780:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/layouts/DashboardLayout.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/layouts/DashboardLayout.js","default")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64148:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/GitLabAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/GitLabAuthModal.js","default")},64420:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/layouts/AuthLayout.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/layouts/AuthLayout.js","default")},70061:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Avatar.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Avatar.js","default")},70092:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Toggle.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Toggle.js","default")},70139:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/EditConnectionModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/EditConnectionModal.js","default")},70603:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/ManualConfigModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/ManualConfigModal.js","default")},70722:a=>{"use strict";a.exports=require("next/dist/shared/lib/invariant-error")},71230:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Input.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Input.js","default")},71553:a=>{"use strict";a.exports=require("node:dns/promises")},72069:(a,b,c)=>{Promise.resolve().then(c.bind(c,73180))},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73180:(a,b,c)=>{"use strict";c.d(b,{default:()=>k});var d=c(48249),e=c(67484),f=c(50412);function g(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function h(a){if("string"==typeof a)return a;if(null==a)return"";if(Array.isArray(a))return a.map(h).filter(Boolean).join(" ");if("object"==typeof a){if("string"==typeof a.message)return a.message;if("string"==typeof a.error)return a.error;try{return JSON.stringify(a)}catch{}}return String(a)}function i(a=""){let b=h(a).replace(/\s+/g," ").trim();return b?b.length>52?`${b.slice(0,52).trimEnd()}…`:b:"New chat"}async function j(a){return await new Promise((b,c)=>{let d=new FileReader;d.onload=()=>b(String(d.result||"")),d.onerror=()=>c(d.error||Error("Failed to read file")),d.readAsDataURL(a)})}function k(){let[a,b]=(0,e.useState)([]),[c,k]=(0,e.useState)(!0),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(()=>[]),[p,q]=(0,e.useState)(()=>""),[r,s]=(0,e.useState)(()=>""),[t,u]=(0,e.useState)(""),[v,w]=(0,e.useState)(()=>""),[x,y]=(0,e.useState)([]),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(!1),L=(0,e.useRef)(null),M=(0,e.useRef)(null);(0,e.useRef)(!1);let N=(0,e.useRef)(null),O=(0,e.useRef)(null),P=(0,e.useMemo)(()=>{let b=new Map;for(let c of a)for(let a of c.models)b.set(a.id,{...a,providerId:c.providerId,providerName:c.providerName});return b},[a]),Q=(0,e.useMemo)(()=>a.find(a=>a.providerId===r)||a[0]||null,[a,r]),R=(0,e.useMemo)(()=>{if(t&&P.has(t))return P.get(t);if(p){let a=n.find(a=>a.id===p);if(a?.modelId&&P.has(a.modelId))return P.get(a.modelId)}return Q?.models?.[0]||null},[t,P,Q,n,p]),S=(0,e.useMemo)(()=>n.find(a=>a.id===p)||null,[n,p]),T=S?.messages||[],U=(0,e.useMemo)(()=>[...n].sort((a,b)=>new Date(b.updatedAt).getTime()-new Date(a.updatedAt).getTime()),[n]),V=!z&&!!R&&(v.trim().length>0||x.length>0),W=(a,b)=>{o(c=>c.map(c=>c.id===a?b({...c,messages:Array.isArray(c.messages)?c.messages.map(a=>({...a})):[]}):c))},X=a=>a?{id:g(),title:"New chat",providerId:a.providerId,providerName:a.providerName,modelId:a.id,modelName:a.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,Y=async a=>{let b=Array.from(a.target.files||[]);if(0===b.length)return;let c=b.filter(a=>a.type.startsWith("image/"));if(0===c.length){a.target.value="";return}let d=await Promise.all(c.map(async a=>({id:g(),name:a.name,type:a.type,size:a.size,dataUrl:await j(a)})));y(a=>[...a,...d]),a.target.value=""},Z=async()=>{let a=R||Q?.models?.[0]||null;if(!a)return;let b=v.trim();if(!b&&0===x.length)return;let c=p,d=n.find(a=>a.id===c);if(!d){if(!(d=X(a)))return;c=d.id,o(a=>[d,...a]),q(c)}let e={id:g(),role:"user",content:b,attachments:x.map(a=>({id:a.id,name:a.name,type:a.type,dataUrl:a.dataUrl})),createdAt:new Date().toISOString()},f=g(),j={id:f,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},k=[...d.messages||[],e,j];o(d=>d.map(d=>d.id===c?{...d,providerId:a.providerId,providerName:a.providerName,modelId:a.id,modelName:a.name,messages:k,updatedAt:new Date().toISOString(),title:"New chat"===d.title?i(b):d.title}:d)),w(""),y([]),A(!0),C(f),E(""),M.current?.abort(),M.current=new AbortController;let l=k.filter(a=>"assistant"!==a.role||a.id!==f).map(a=>({role:a.role,content:"user"===a.role?function(a){let b=h(a.content).trim(),c=Array.isArray(a.attachments)?a.attachments:[];if(0===c.length)return b;let d=[];for(let a of(b&&d.push({type:"text",text:b}),c))a?.dataUrl&&d.push({type:"image_url",image_url:{url:a.dataUrl}});return d.length>0?d:b}(a):a.content}));try{var r;let d,e=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:a.requestModel||a.id,messages:l,stream:!0}),signal:M.current.signal});if(!e.ok){let a=await e.json().catch(()=>({}));throw Error(h(a.error||a.message||`Request failed (${e.status})`))}let g=e.body?.getReader();if(!g){let a=await e.json().catch(()=>({})),b=h(a?.choices?.[0]?.message?.content||a?.output_text||a?.error||a?.message||"");W(c,a=>({...a,messages:a.messages.map(a=>a.id===f?{...a,content:b,status:"done"}:a),updatedAt:new Date().toISOString()}));return}let j=new TextDecoder,k="",m="";for(;;){let{value:a,done:b}=await g.read();if(b)break;let d=(k+=j.decode(a,{stream:!0})).split(/\r?\n/);for(let a of(k=d.pop()||"",d)){let b=a.trim();if(!b.startsWith("data:"))continue;let d=b.slice(5).trim();if(d&&"[DONE]"!==d)try{let a=JSON.parse(d),b=function(a){if(!a||"object"!=typeof a)return"";let b=a.choices?.[0];return[(b?.delta||{}).content,b?.message?.content,a.output_text,a.text].map(h).filter(Boolean)[0]||""}(a);if(!b)continue;m+=b,E(m),W(c,a=>({...a,messages:a.messages.map(a=>a.id===f?{...a,content:m,status:"streaming"}:a),updatedAt:new Date().toISOString()}))}catch{}}}W(c,a=>({...a,messages:a.messages.map(a=>a.id===f?{...a,content:m||a.content,status:"done"}:a),updatedAt:new Date().toISOString()})),r=c,d=i(b),W(r,a=>({...a,title:"New chat"===a.title?d:a.title,updatedAt:new Date().toISOString()}))}catch(a){if("AbortError"!==a.name){let b=h(a?.message||a);W(c,a=>({...a,messages:a.messages.map(a=>a.id===f?{...a,content:a.content||`Error: ${b}`,status:"error"}:a),updatedAt:new Date().toISOString()})),m(b||"Failed to send message.")}}finally{A(!1),C(""),E(""),M.current=null}},$=R?`${R.name}`:"Select model",_=R?R.requestModel:"Choose from connected providers";return(0,d.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-[#212121] text-white overflow-hidden",children:(0,d.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,d.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,d.jsxs)("div",{ref:N,className:"relative",children:[(0,d.jsx)("button",{type:"button",onClick:()=>I(a=>!a),className:"flex items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-left transition hover:bg-white/8",children:(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-semibold text-white",children:$}),(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-white/70",children:"expand_more"})]}),(0,d.jsx)("p",{className:"truncate text-xs text-white/55",children:_})]})}),H?(0,d.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-white/10 bg-[#262626] shadow-2xl shadow-black/50",children:[(0,d.jsxs)("div",{className:"border-b border-white/10 px-4 py-3",children:[(0,d.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Models"}),(0,d.jsx)("p",{className:"text-sm text-white/75",children:"Only from connected providers"})]}),(0,d.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:a.map(a=>(0,d.jsxs)("div",{className:"mb-2 rounded-[16px] border border-white/10 bg-black/20 p-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-white",children:a.providerName}),(0,d.jsx)(f.Ex,{size:"sm",variant:"default",children:a.models.length})]}),(0,d.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:a.models.map(a=>{let b=a.id===t;return(0,d.jsx)("button",{type:"button",onClick:()=>(a=>{let b=P.get(a);if(!b)return;let c=n.find(a=>a.id===p);if(c&&c.messages.length>0){let a=X(b);if(!a)return;o(b=>[a,...b]),q(a.id)}else if(c)o(a=>a.map(a=>a.id===c.id?{...a,providerId:b.providerId,providerName:b.providerName,modelId:b.id,modelName:b.name}:a)),q(c.id);else{let a=X(b);if(!a)return;o(b=>[a,...b]),q(a.id)}s(b.providerId),u(b.id),I(!1)})(a.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${b?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-sm font-medium text-white",children:a.name}),(0,d.jsx)("p",{className:"truncate text-[11px] text-white/45",children:a.requestModel})]}),b?(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-blue-300",children:"check_circle"}):null]})},a.id)})})]},a.providerId))})]}):null]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>K(a=>!a),className:"rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-sm text-white/80 transition hover:bg-white/8",children:"History"}),(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!p)return;let a=n.filter(a=>a.id!==p),b=a[0]||null;o(a),b?(q(b.id),s(b.providerId),u(b.modelId)):(q(""),s(""),u(""))},disabled:!p||0===n.length,children:"Clear"})]})]}),J?(0,d.jsxs)("div",{ref:O,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-white/10 bg-[#262626] p-2 shadow-2xl shadow-black/50 lg:right-6",children:[(0,d.jsx)("div",{className:"px-3 py-2",children:(0,d.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Recent chats"})}),(0,d.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===U.length?(0,d.jsx)("div",{className:"rounded-[16px] border border-dashed border-white/10 bg-white/5 p-4 text-sm text-white/55",children:"No conversations yet."}):U.map(a=>{let b=a.id===p,c=[...a.messages||[]].reverse().find(a=>"user"===a.role)||a.messages?.[0];return(0,d.jsx)("button",{type:"button",onClick:()=>{var b;let c;return b=a.id,void((c=n.find(a=>a.id===b))&&(q(b),s(c.providerId||r),u(c.modelId||t),K(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${b?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"truncate text-sm font-medium text-white",children:a.title}),(0,d.jsx)("p",{className:"mt-1 truncate text-xs text-white/50",children:h(c?.content)||"Empty chat"})]}),(0,d.jsx)("span",{className:"text-[10px] text-white/40 shrink-0",children:function(a){if(!a)return"Now";let b=new Date(a).getTime();if(Number.isNaN(b))return"Now";let c=Math.max(1,Math.round((Date.now()-b)/6e4));if(c<60)return`${c}m`;let d=Math.round(c/60);return d<24?`${d}h`:`${Math.round(d/24)}d`}(a.updatedAt)})]})},a.id)})})]}):null,l?(0,d.jsx)("div",{className:"mt-4 rounded-[18px] border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-rose-100",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,d.jsx)("p",{className:"text-sm leading-6",children:l})]})}):null,(0,d.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===T.length?(0,d.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,d.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,d.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-white/10 bg-white/5 text-white/80",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h2",{className:"text-2xl font-semibold text-white",children:"Start a conversation"}),(0,d.jsx)("p",{className:"text-sm leading-6 text-white/60",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,d.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:T.map(a=>{let b="user"===a.role,c="assistant"===a.role,e=c&&a.id===B&&"streaming"===a.status,f=h(a.content)||(c?D:"");return(0,d.jsx)("div",{className:`flex w-full ${b?"justify-end":"justify-start"} mb-6`,children:(0,d.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${b?"rounded-3xl bg-[#2f2f2f] px-5 py-3.5 text-white":"text-white/90"}`,children:[(0,d.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,d.jsx)("span",{className:"text-xs font-semibold",children:b?"You":R?.name||"Assistant"})}),a.attachments?.length?(0,d.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:a.attachments.map(a=>(0,d.jsx)("a",{href:a.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-white/10 bg-black/20",children:(0,d.jsx)("img",{src:a.dataUrl,alt:a.name,className:"h-28 w-full object-cover"})},a.id))}):null,(0,d.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[f,c&&e&&!D?(0,d.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]})]})},a.id)})})]}),(0,d.jsxs)("div",{className:"shrink-0 pt-2",children:[x.length>0?(0,d.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:x.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-2",children:[(0,d.jsx)("span",{className:"text-xs text-white/80 max-w-[12rem] truncate",children:a.name}),(0,d.jsx)("button",{type:"button",onClick:()=>{var b;return b=a.id,void y(a=>a.filter(a=>a.id!==b))},className:"text-white/55 hover:text-white","aria-label":"Remove attachment",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},a.id))}):null,(0,d.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,d.jsxs)("div",{className:"rounded-[26px] bg-[#2f2f2f] px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-white/5",children:[(0,d.jsx)("textarea",{value:v,onChange:a=>w(a.target.value),onKeyDown:a=>{"Enter"===a.key&&!a.shiftKey&&(a.preventDefault(),V&&Z())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-white outline-none placeholder:text-white/40 custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,d.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>L.current?.click(),disabled:!R||c,className:"p-2 text-white/50 hover:text-white transition rounded-full hover:bg-white/5",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,d.jsx)("input",{ref:L,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:Y}),(0,d.jsx)("span",{className:"text-xs font-medium text-white/30 truncate max-w-[120px]",children:R?R.name:"No model"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[z?(0,d.jsx)("button",{type:"button",onClick:()=>{M.current?.abort()},className:"p-2 text-white bg-white/10 hover:bg-white/20 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,d.jsx)("button",{onClick:Z,disabled:!V,className:`h-8 w-8 rounded-full flex items-center justify-center transition ${V?"bg-white text-black hover:opacity-90":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,d.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-white/30",children:"Model list is filtered from connected providers."})]})]})})}c(91431),c(92592)},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},76978:(a,b,c)=>{"use strict";c.d(b,{UserRoleProvider:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call UserRoleContext() from the server but UserRoleContext is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/UserRoleProvider.js","UserRoleContext");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call UserRoleProvider() from the server but UserRoleProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/UserRoleProvider.js","UserRoleProvider");(0,d.registerClientReference)(function(){throw Error("Attempted to call useUserRole() from the server but useUserRole is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/UserRoleProvider.js","useUserRole"),(0,d.registerClientReference)(function(){throw Error("Attempted to call useIsSuperAdmin() from the server but useIsSuperAdmin is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/UserRoleProvider.js","useIsSuperAdmin")},77030:a=>{"use strict";a.exports=require("node:net")},77068:a=>{"use strict";a.exports=require("next/dist/shared/lib/size-limit")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79286:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js","default")},79428:a=>{"use strict";a.exports=require("buffer")},79646:a=>{"use strict";a.exports=require("child_process")},80099:a=>{"use strict";a.exports=require("node:sqlite")},80342:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/IFlowCookieModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/IFlowCookieModal.js","default")},81115:a=>{"use strict";a.exports=require("constants")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},81923:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/ProviderInfoCard.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/ProviderInfoCard.js","default")},82448:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/KiroAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/KiroAuthModal.js","default")},83784:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Select.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Select.js","default")},83997:a=>{"use strict";a.exports=require("tty")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87228:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/KiroSocialOAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/KiroSocialOAuthModal.js","default")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},92082:(a,b,c)=>{"use strict";c.d(b,{CardSkeleton:()=>h,PageLoading:()=>f,Skeleton:()=>g,Spinner:()=>e,default:()=>i});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Spinner() from the server but Spinner is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Loading.js","Spinner"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageLoading() from the server but PageLoading is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Loading.js","PageLoading"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call Skeleton() from the server but Skeleton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Loading.js","Skeleton"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call CardSkeleton() from the server but CardSkeleton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Loading.js","CardSkeleton"),i=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Loading.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Loading.js","default")},92669:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Header.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Header.js","default")},92767:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>O,handler:()=>Q,routeModule:()=>P});var d=c(7553),e=c(84006),f=c(67798),g=c(34775),h=c(99373),i=c(73461),j=c(1020),k=c(26349),l=c(54365),m=c(16023),n=c(14965),o=c(63747),p=c(24235),q=c(23938),r=c(261),s=c(66758),t=c(77243),u=c(26713),v=c(37527),w=c(22820),x=c(88216),y=c(47929),z=c(79551),A=c(71797),B=c(89125),C=c(86439),D=c(77068),E=c(27269),F=c(37525),G=c(61287),H=c(81494),I=c(70722),J=c(70753),K=c(43954),L=c(17891),M={};for(let a in G)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(M[a]=()=>G[a]);c.d(b,M);let N={children:["",{children:["(dashboard)",{children:["dashboard",{children:["basic-chat",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,40551)),"/Users/bytedance/Documents/Projects/9router/src/app/(dashboard)/dashboard/basic-chat/page.js"]}]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,30508)),"/Users/bytedance/Documents/Projects/9router/src/app/(dashboard)/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,70440))).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,50385)),"/Users/bytedance/Documents/Projects/9router/src/app/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,70440))).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,O={require:c,loadChunk:()=>Promise.resolve()},P=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/(dashboard)/dashboard/basic-chat/page",pathname:"/dashboard/basic-chat",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:N},distDir:".next-cli-build",relativeProjectDir:""});async function Q(a,b,d){var M,R,S,T,U;d.requestMeta&&(0,h.setRequestMeta)(a,d.requestMeta),P.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let V=!!(0,h.getRequestMeta)(a,"minimalMode"),W="/(dashboard)/dashboard/basic-chat/page";"/index"===W&&(W="/");let X=await P.prepare(a,b,{srcPage:W,multiZoneDraftMode:!1});if(!X)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Y,query:Z,params:$,pageIsDynamic:_,buildManifest:aa,nextFontManifest:ab,reactLoadableManifest:ac,serverActionsManifest:ad,clientReferenceManifest:ae,subresourceIntegrityManifest:af,prerenderManifest:ag,isDraftMode:ah,resolvedPathname:ai,revalidateOnlyGenerated:aj,routerServerContext:ak,nextConfig:al,parsedUrl:am,interceptionRoutePatterns:an,deploymentId:ao,clientAssetToken:ap}=X,aq=(0,r.normalizeAppPath)(W),{isOnDemandRevalidate:ar}=X,as=al.experimental.ppr&&!al.cacheComponents&&(0,K.isInterceptionRouteAppPath)(ai)?null:P.match(ai,ag),at=(null==as?void 0:as.route)??null,au=!!ag.routes[ai],av=a.headers["user-agent"]||"",aw=(0,u.getBotType)(av),ax=(0,q.isHtmlBotRequest)(a),ay=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[t.NEXT_ROUTER_PREFETCH_HEADER],az=(0,h.getRequestMeta)(a,"isRSCRequest")??(0,n.f)(a.headers[t.RSC_HEADER]),aA=(0,s.getIsPossibleServerAction)(a),aB=(0,m.checkIsAppPPREnabled)(al.experimental.ppr),aC=a.headers[y.NEXT_RESUME_STATE_LENGTH_HEADER];if(!(0,h.getRequestMeta)(a,"postponed")&&V&&aB&&aA&&aC&&"string"==typeof aC){let e=parseInt(aC,10),{maxPostponedStateSize:f,maxPostponedStateSizeBytes:g}=(0,E.getMaxPostponedStateSize)(al.experimental.maxPostponedStateSize);if(!isNaN(e)&&e>0){if(e>g)return b.statusCode=413,b.end((0,E.getPostponedStateExceededErrorMessage)(f)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let i="1 MB",j=(null==(U=al.experimental.serverActions)?void 0:U.bodySizeLimit)??i,k=e+(j!==i?c(95726).parse(j):1048576),l=await (0,E.readBodyWithSizeLimit)(a,k);if(null===l)return b.statusCode=413,b.end("Request body exceeded limit. To configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;if(l.length>=e){let b=l.subarray(0,e).toString("utf8");(0,h.addRequestMeta)(a,"postponed",b);let c=l.subarray(e);(0,h.addRequestMeta)(a,"actionBody",c)}else throw Object.defineProperty(Error(`invariant: expected ${e} bytes of postponed state but only received ${l.length} bytes`),"__NEXT_ERROR_CODE",{value:"E979",enumerable:!1,configurable:!0})}}if(!(0,h.getRequestMeta)(a,"postponed")&&aB&&"1"===a.headers[y.NEXT_RESUME_HEADER]&&"POST"===a.method){let{maxPostponedStateSize:c,maxPostponedStateSizeBytes:e}=(0,E.getMaxPostponedStateSize)(al.experimental.maxPostponedStateSize),f=await (0,E.readBodyWithSizeLimit)(a,e);if(null===f)return b.statusCode=413,b.end((0,E.getPostponedStateExceededErrorMessage)(c)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let g=f.toString("utf8");(0,h.addRequestMeta)(a,"postponed",g)}let aD=!0===P.isDev||!0===al.experimental.exposeTestingApiInProductionBuild,aE=aD&&("1"===a.headers[t.NEXT_INSTANT_PREFETCH_HEADER]||!(0,n.f)(a.headers[t.RSC_HEADER])&&"string"==typeof a.headers.cookie&&a.headers.cookie.includes(t.NEXT_INSTANT_TEST_COOKIE+"=")),aF=(aB||aE)&&((null==(M=ag.routes[aq]??ag.dynamicRoutes[aq])?void 0:M.renderingMode)==="PARTIALLY_STATIC"||aE&&(aD||(null==ak?void 0:ak.experimentalTestProxy)===!0)),aG=aE&&aF,aH=aG&&!0===P.isDev,aI=!1,aJ=aF?(0,h.getRequestMeta)(a,"postponed"):void 0,aK=null==(R=ag.routes[ai])?void 0:R.prefetchDataRoute,aL=aF&&az&&!ay&&!aK;V&&(aL=aL&&!!aJ);let aM=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),aN=(!aw||!aF)&&(!av||(0,q.shouldServeStreamingMetadata)(av,al.htmlLimitedBots)),aO=!!((at||au||ag.routes[aq])&&!(aw&&aF)),aP=aF&&!0===al.cacheComponents,aQ=!0===P.isDev||!aO||"string"==typeof aJ||(aP&&(0,h.getRequestMeta)(a,"onCacheEntryV2")?aL&&!V:aL),aR=!!aw&&aF,aS=(null==at?void 0:at.remainingPrerenderableParams)??[],aT=(null==at?void 0:at.fallback)===null&&((null==(S=at.fallbackRootParams)?void 0:S.length)??0)>0,aU=null;if(!ah&&aO&&!aQ&&!aA&&!aJ&&!aL){let a=as?"string"==typeof(null==at?void 0:at.fallback)?at.fallback:as.source:null;if(!0===al.experimental.partialFallbacks&&a&&(null==at?void 0:at.fallbackRouteParams)&&!aT){if(aS.length>0){let b,c=(b=new Map(aS.map(a=>[a.paramName,a])),a.split("/").map(a=>{let c=(0,L.getSegmentParam)(a);if(!c)return a;let d=b.get(c.paramName);if(!d)return a;let e=null==$?void 0:$[d.paramName];if(!e)return a;let f=Array.isArray(e)?e.map(a=>encodeURIComponent(a)).join("/"):encodeURIComponent(e);return a.replace((0,o.buildDynamicSegmentPlaceholder)(d),f)}).join("/")||"/");aU=c!==a?c:null}}else aU=ai}let aV=aU;!aV&&(P.isDev||aO&&_&&(null==at?void 0:at.fallbackRouteParams)&&!aA)&&(aV=ai),P.isDev||ah||!aO||!az||aL||(0,k.d)(a.headers);let aW={...G,tree:N,handler:Q,routeModule:P,__next_app__:O};ad&&ae&&(0,p.setManifestsSingleton)({page:W,clientReferenceManifest:ae,serverActionsManifest:ad});let aX=a.method||"GET",aY=(0,g.getTracer)(),aZ=aY.getActiveScopeSpan(),a$=!!(null==ak?void 0:ak.isWrappedByNextServer),a_=!0===al.experimental.partialFallbacks&&aS.length>0?(null==at||null==(T=at.fallbackRouteParams)?void 0:T.filter(a=>!aS.some(b=>b.paramName===a.paramName)))??[]:[],a0=async()=>((null==ak?void 0:ak.render404)?await ak.render404(a,b,am,!1):b.end("This page could not be found"),null);try{let k,m=P.getVaryHeader(ai,an);b.setHeader("Vary",m);let n=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return P.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=aY.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=a.get("next.route");if(d){let a=`${aX} ${d}`;c.setAttributes({"next.route":d,"http.route":d,"next.span_name":a}),c.updateName(a),k&&k!==c&&(k.setAttribute("http.route",d),k.updateName(a))}else c.updateName(`${aX} ${W}`)})},p=(0,h.getRequestMeta)(a,"incrementalCache")||await P.getIncrementalCache(a,al,ag,V);null==p||p.resetRequestCache(),globalThis.__incrementalCache=p;let q=async({span:e,postponed:f,fallbackRouteParams:g,forceStaticRender:i})=>{let k={query:Z,params:$,page:aq,sharedContext:{buildId:Y,deploymentId:ao,clientAssetToken:ap},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aW,Component:(0,j.T)(aW),params:$,routeModule:P,page:W,postponed:f,shouldWaitOnAllReady:aR,serveStreamingMetadata:aN,supportsDynamicResponse:"string"==typeof f||aQ,buildManifest:aa,nextFontManifest:ab,reactLoadableManifest:ac,subresourceIntegrityManifest:af,setCacheStatus:null==ak?void 0:ak.setCacheStatus,setIsrStatus:null==ak?void 0:ak.setIsrStatus,setReactDebugChannel:null==ak?void 0:ak.setReactDebugChannel,sendErrorsToBrowser:null==ak?void 0:ak.sendErrorsToBrowser,dir:c(33873).join(process.cwd(),P.relativeProjectDir),isDraftMode:ah,botType:aw,isOnDemandRevalidate:ar,isPossibleServerAction:aA,assetPrefix:al.assetPrefix,nextConfigOutput:al.output,crossOrigin:al.crossOrigin,trailingSlash:al.trailingSlash,images:al.images,previewProps:ag.preview,enableTainting:al.experimental.taint,htmlLimitedBots:al.htmlLimitedBots,reactMaxHeadersLength:al.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:p,cacheLifeProfiles:al.cacheLife,basePath:al.basePath,serverActions:al.experimental.serverActions,logServerFunctions:"object"==typeof al.logging&&!!al.logging.serverFunctions,...aG||aH||aI?{isBuildTimePrerendering:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isDebugDynamicAccesses:aH}:{},cacheComponents:!!al.cacheComponents,experimental:{isRoutePPREnabled:aF,expireTime:al.expireTime,staleTimes:al.experimental.staleTimes,dynamicOnHover:!!al.experimental.dynamicOnHover,optimisticRouting:!!al.experimental.optimisticRouting,inlineCss:!!al.experimental.inlineCss,prefetchInlining:al.experimental.prefetchInlining??!1,authInterrupts:!!al.experimental.authInterrupts,cachedNavigations:!!al.experimental.cachedNavigations,clientTraceMetadata:al.experimental.clientTraceMetadata||[],clientParamParsingOrigins:al.experimental.clientParamParsingOrigins,maxPostponedStateSizeBytes:(0,D.parseMaxPostponedStateSize)(al.experimental.maxPostponedStateSize)},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d,e)=>P.onRequestError(a,b,d,e,ak),err:(0,h.getRequestMeta)(a,"invokeError")}};i&&(k.renderOpts.supportsDynamicResponse=!1);let l=await n(e,k),{metadata:m}=l,{cacheControl:o,headers:q={},fetchTags:r,fetchMetrics:s}=m;if(r&&(q[y.NEXT_CACHE_TAGS_HEADER]=r),a.fetchMetrics=s,aO&&(null==o?void 0:o.revalidate)===0&&!P.isDev&&!aF){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ai}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
1
+ (()=>{var a={};a.id=4465,a.ids=[4465],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},643:a=>{"use strict";a.exports=require("node:perf_hooks")},962:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/McpMarketplaceModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/McpMarketplaceModal.js","default")},1708:a=>{"use strict";a.exports=require("node:process")},1932:a=>{"use strict";a.exports=require("url")},2422:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/UsageStats.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/UsageStats.js","default")},3080:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/OAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/OAuthModal.js","default")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},4996:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/CapacityBadges.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/CapacityBadges.js","default")},5843:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/NoAuthProxyCard.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/NoAuthProxyCard.js","default")},7066:a=>{"use strict";a.exports=require("node:tty")},7290:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Card.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Card.js","default")},10079:(a,b,c)=>{"use strict";c.d(b,{ConfirmModal:()=>f,default:()=>e});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Modal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Modal.js","default"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call ConfirmModal() from the server but ConfirmModal is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Modal.js","ConfirmModal")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},14285:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/KiroOAuthWrapper.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/KiroOAuthWrapper.js","default")},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},17891:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/get-segment-param")},18200:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/AddCustomEmbeddingModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/AddCustomEmbeddingModal.js","default")},18421:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Tooltip.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Tooltip.js","default")},19083:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/RequestLogger.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/RequestLogger.js","default")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20493:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/ComboFormModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/ComboFormModal.js","default")},21820:a=>{"use strict";a.exports=require("os")},26288:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/AddCustomImageModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/AddCustomImageModal.js","default")},26626:(a,b,c)=>{Promise.resolve().then(c.bind(c,18200)),Promise.resolve().then(c.bind(c,26288)),Promise.resolve().then(c.bind(c,70061)),Promise.resolve().then(c.bind(c,33893)),Promise.resolve().then(c.bind(c,45512)),Promise.resolve().then(c.bind(c,4996)),Promise.resolve().then(c.bind(c,7290)),Promise.resolve().then(c.bind(c,33811)),Promise.resolve().then(c.bind(c,20493)),Promise.resolve().then(c.bind(c,40167)),Promise.resolve().then(c.bind(c,70139)),Promise.resolve().then(c.bind(c,49123)),Promise.resolve().then(c.bind(c,64148)),Promise.resolve().then(c.bind(c,92669)),Promise.resolve().then(c.bind(c,29354)),Promise.resolve().then(c.bind(c,80342)),Promise.resolve().then(c.bind(c,71230)),Promise.resolve().then(c.bind(c,82448)),Promise.resolve().then(c.bind(c,14285)),Promise.resolve().then(c.bind(c,87228)),Promise.resolve().then(c.bind(c,45205)),Promise.resolve().then(c.bind(c,64420)),Promise.resolve().then(c.bind(c,61780)),Promise.resolve().then(c.bind(c,92082)),Promise.resolve().then(c.bind(c,70603)),Promise.resolve().then(c.bind(c,962)),Promise.resolve().then(c.bind(c,10079)),Promise.resolve().then(c.bind(c,94582)),Promise.resolve().then(c.bind(c,29674)),Promise.resolve().then(c.bind(c,5843)),Promise.resolve().then(c.bind(c,3080)),Promise.resolve().then(c.bind(c,81923)),Promise.resolve().then(c.bind(c,19083)),Promise.resolve().then(c.bind(c,54065)),Promise.resolve().then(c.bind(c,83784)),Promise.resolve().then(c.bind(c,26866)),Promise.resolve().then(c.bind(c,89886)),Promise.resolve().then(c.bind(c,40515)),Promise.resolve().then(c.bind(c,70092)),Promise.resolve().then(c.bind(c,18421)),Promise.resolve().then(c.bind(c,2422)),Promise.resolve().then(c.bind(c,76978))},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},26866:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Sidebar.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Sidebar.js","default")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29354:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/HeaderMenu.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/HeaderMenu.js","default")},29674:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/NineRemoteButton.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/NineRemoteButton.js","default")},30508:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>j});var d=c(5735),e=c(65573);c(45512),c(71230),c(83784),c(7290),c(10079),c(92082),c(70061),c(33893),c(70092),c(40515),c(89886),c(26866),c(92669),c(49123),c(3080),c(94582),c(70603),c(20493),c(962),c(2422),c(45205),c(29674),c(29354),c(33811),c(19083),c(82448),c(14285),c(87228),c(40167),c(80342),c(64148),c(70139),c(18200),c(26288),c(5843),c(54065),c(18421),c(81923),c(4996);var f=c(61780);c(64420);var g=c(76978),h=c(33792);async function i(){try{let a=await (0,e.UL)(),b=a.get("auth_token")?.value;if(!b)return null;let c=await (0,h.dY)(b);if(!c)return null;return{role:c.role||null,userId:c.userId||null,displayName:c.displayName||null}}catch{return null}}async function j({children:a}){let b=await i();return(0,d.jsx)(g.UserRoleProvider,{role:b?.role,userId:b?.userId,displayName:b?.displayName,children:(0,d.jsx)(f.default,{children:a})})}},31421:a=>{"use strict";a.exports=require("node:child_process")},32467:a=>{"use strict";a.exports=require("node:http2")},33811:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/ChangelogModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/ChangelogModal.js","default")},33873:a=>{"use strict";a.exports=require("path")},33893:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Badge.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Badge.js","default")},34589:a=>{"use strict";a.exports=require("node:assert")},34631:a=>{"use strict";a.exports=require("tls")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40167:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/CursorAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/CursorAuthModal.js","default")},40515:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/ThemeToggle.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/ThemeToggle.js","default")},40551:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(5735),e=c(79286);function f(){return(0,d.jsx)(e.default,{})}},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},43954:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/interception-routes")},44778:(a,b,c)=>{Promise.resolve().then(c.bind(c,67738)),Promise.resolve().then(c.bind(c,31402)),Promise.resolve().then(c.bind(c,25919)),Promise.resolve().then(c.bind(c,75171)),Promise.resolve().then(c.bind(c,99070)),Promise.resolve().then(c.bind(c,38930)),Promise.resolve().then(c.bind(c,17660)),Promise.resolve().then(c.bind(c,11229)),Promise.resolve().then(c.bind(c,62727)),Promise.resolve().then(c.bind(c,51109)),Promise.resolve().then(c.bind(c,51585)),Promise.resolve().then(c.bind(c,48781)),Promise.resolve().then(c.bind(c,43182)),Promise.resolve().then(c.bind(c,32456)),Promise.resolve().then(c.bind(c,3236)),Promise.resolve().then(c.bind(c,79488)),Promise.resolve().then(c.bind(c,83552)),Promise.resolve().then(c.bind(c,8590)),Promise.resolve().then(c.bind(c,5291)),Promise.resolve().then(c.bind(c,56110)),Promise.resolve().then(c.bind(c,267)),Promise.resolve().then(c.bind(c,53838)),Promise.resolve().then(c.bind(c,85306)),Promise.resolve().then(c.bind(c,74812)),Promise.resolve().then(c.bind(c,39645)),Promise.resolve().then(c.bind(c,20084)),Promise.resolve().then(c.bind(c,95145)),Promise.resolve().then(c.bind(c,83352)),Promise.resolve().then(c.bind(c,23048)),Promise.resolve().then(c.bind(c,50585)),Promise.resolve().then(c.bind(c,79346)),Promise.resolve().then(c.bind(c,11633)),Promise.resolve().then(c.bind(c,91809)),Promise.resolve().then(c.bind(c,91099)),Promise.resolve().then(c.bind(c,4770)),Promise.resolve().then(c.bind(c,42196)),Promise.resolve().then(c.bind(c,19308)),Promise.resolve().then(c.bind(c,53845)),Promise.resolve().then(c.bind(c,95514)),Promise.resolve().then(c.bind(c,32971)),Promise.resolve().then(c.bind(c,28403)),Promise.resolve().then(c.bind(c,37900))},45205:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/LanguageSwitcher.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/LanguageSwitcher.js","default")},45512:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Button.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Button.js","default")},46293:a=>{"use strict";a.exports=require("sql.js")},48161:a=>{"use strict";a.exports=require("node:os")},49123:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Footer.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Footer.js","default")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},54065:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/SegmentedControl.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/SegmentedControl.js","default")},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},58917:(a,b,c)=>{Promise.resolve().then(c.bind(c,79286))},61780:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/layouts/DashboardLayout.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/layouts/DashboardLayout.js","default")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64148:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/GitLabAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/GitLabAuthModal.js","default")},64420:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/layouts/AuthLayout.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/layouts/AuthLayout.js","default")},70061:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Avatar.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Avatar.js","default")},70092:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Toggle.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Toggle.js","default")},70139:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/EditConnectionModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/EditConnectionModal.js","default")},70603:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/ManualConfigModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/ManualConfigModal.js","default")},70722:a=>{"use strict";a.exports=require("next/dist/shared/lib/invariant-error")},71230:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Input.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Input.js","default")},71553:a=>{"use strict";a.exports=require("node:dns/promises")},72069:(a,b,c)=>{Promise.resolve().then(c.bind(c,73180))},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73180:(a,b,c)=>{"use strict";c.d(b,{default:()=>k});var d=c(48249),e=c(67484),f=c(50412);function g(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function h(a){if("string"==typeof a)return a;if(null==a)return"";if(Array.isArray(a))return a.map(h).filter(Boolean).join(" ");if("object"==typeof a){if("string"==typeof a.message)return a.message;if("string"==typeof a.error)return a.error;try{return JSON.stringify(a)}catch{}}return String(a)}function i(a=""){let b=h(a).replace(/\s+/g," ").trim();return b?b.length>52?`${b.slice(0,52).trimEnd()}…`:b:"New chat"}async function j(a){return await new Promise((b,c)=>{let d=new FileReader;d.onload=()=>b(String(d.result||"")),d.onerror=()=>c(d.error||Error("Failed to read file")),d.readAsDataURL(a)})}function k(){let[a,b]=(0,e.useState)([]),[c,k]=(0,e.useState)(!0),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(()=>[]),[p,q]=(0,e.useState)(()=>""),[r,s]=(0,e.useState)(()=>""),[t,u]=(0,e.useState)(""),[v,w]=(0,e.useState)(()=>""),[x,y]=(0,e.useState)([]),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(!1),L=(0,e.useRef)(null),M=(0,e.useRef)(null);(0,e.useRef)(!1);let N=(0,e.useRef)(null),O=(0,e.useRef)(null),P=(0,e.useMemo)(()=>{let b=new Map;for(let c of a)for(let a of c.models)b.set(a.id,{...a,providerId:c.providerId,providerName:c.providerName});return b},[a]),Q=(0,e.useMemo)(()=>a.find(a=>a.providerId===r)||a[0]||null,[a,r]),R=(0,e.useMemo)(()=>{if(t&&P.has(t))return P.get(t);if(p){let a=n.find(a=>a.id===p);if(a?.modelId&&P.has(a.modelId))return P.get(a.modelId)}return Q?.models?.[0]||null},[t,P,Q,n,p]),S=(0,e.useMemo)(()=>n.find(a=>a.id===p)||null,[n,p]),T=S?.messages||[],U=(0,e.useMemo)(()=>[...n].sort((a,b)=>new Date(b.updatedAt).getTime()-new Date(a.updatedAt).getTime()),[n]),V=!z&&!!R&&(v.trim().length>0||x.length>0),W=(a,b)=>{o(c=>c.map(c=>c.id===a?b({...c,messages:Array.isArray(c.messages)?c.messages.map(a=>({...a})):[]}):c))},X=a=>a?{id:g(),title:"New chat",providerId:a.providerId,providerName:a.providerName,modelId:a.id,modelName:a.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,Y=async a=>{let b=Array.from(a.target.files||[]);if(0===b.length)return;let c=b.filter(a=>a.type.startsWith("image/"));if(0===c.length){a.target.value="";return}let d=await Promise.all(c.map(async a=>({id:g(),name:a.name,type:a.type,size:a.size,dataUrl:await j(a)})));y(a=>[...a,...d]),a.target.value=""},Z=async()=>{let a=R||Q?.models?.[0]||null;if(!a)return;let b=v.trim();if(!b&&0===x.length)return;let c=p,d=n.find(a=>a.id===c);if(!d){if(!(d=X(a)))return;c=d.id,o(a=>[d,...a]),q(c)}let e={id:g(),role:"user",content:b,attachments:x.map(a=>({id:a.id,name:a.name,type:a.type,dataUrl:a.dataUrl})),createdAt:new Date().toISOString()},f=g(),j={id:f,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},k=[...d.messages||[],e,j];o(d=>d.map(d=>d.id===c?{...d,providerId:a.providerId,providerName:a.providerName,modelId:a.id,modelName:a.name,messages:k,updatedAt:new Date().toISOString(),title:"New chat"===d.title?i(b):d.title}:d)),w(""),y([]),A(!0),C(f),E(""),M.current?.abort(),M.current=new AbortController;let l=k.filter(a=>"assistant"!==a.role||a.id!==f).map(a=>({role:a.role,content:"user"===a.role?function(a){let b=h(a.content).trim(),c=Array.isArray(a.attachments)?a.attachments:[];if(0===c.length)return b;let d=[];for(let a of(b&&d.push({type:"text",text:b}),c))a?.dataUrl&&d.push({type:"image_url",image_url:{url:a.dataUrl}});return d.length>0?d:b}(a):a.content}));try{var r;let d,e=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:a.requestModel||a.id,messages:l,stream:!0}),signal:M.current.signal});if(!e.ok){let a=await e.json().catch(()=>({}));throw Error(h(a.error||a.message||`Request failed (${e.status})`))}let g=e.body?.getReader();if(!g){let a=await e.json().catch(()=>({})),b=h(a?.choices?.[0]?.message?.content||a?.output_text||a?.error||a?.message||"");W(c,a=>({...a,messages:a.messages.map(a=>a.id===f?{...a,content:b,status:"done"}:a),updatedAt:new Date().toISOString()}));return}let j=new TextDecoder,k="",m="";for(;;){let{value:a,done:b}=await g.read();if(b)break;let d=(k+=j.decode(a,{stream:!0})).split(/\r?\n/);for(let a of(k=d.pop()||"",d)){let b=a.trim();if(!b.startsWith("data:"))continue;let d=b.slice(5).trim();if(d&&"[DONE]"!==d)try{let a=JSON.parse(d),b=function(a){if(!a||"object"!=typeof a)return"";let b=a.choices?.[0];return[(b?.delta||{}).content,b?.message?.content,a.output_text,a.text].map(h).filter(Boolean)[0]||""}(a);if(!b)continue;m+=b,E(m),W(c,a=>({...a,messages:a.messages.map(a=>a.id===f?{...a,content:m,status:"streaming"}:a),updatedAt:new Date().toISOString()}))}catch{}}}W(c,a=>({...a,messages:a.messages.map(a=>a.id===f?{...a,content:m||a.content,status:"done"}:a),updatedAt:new Date().toISOString()})),r=c,d=i(b),W(r,a=>({...a,title:"New chat"===a.title?d:a.title,updatedAt:new Date().toISOString()}))}catch(a){if("AbortError"!==a.name){let b=h(a?.message||a);W(c,a=>({...a,messages:a.messages.map(a=>a.id===f?{...a,content:a.content||`Error: ${b}`,status:"error"}:a),updatedAt:new Date().toISOString()})),m(b||"Failed to send message.")}}finally{A(!1),C(""),E(""),M.current=null}},$=R?`${R.name}`:"Select model",_=R?R.requestModel:"Choose from connected providers";return(0,d.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-[#212121] text-white overflow-hidden",children:(0,d.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,d.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,d.jsxs)("div",{ref:N,className:"relative",children:[(0,d.jsx)("button",{type:"button",onClick:()=>I(a=>!a),className:"flex items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-left transition hover:bg-white/8",children:(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-semibold text-white",children:$}),(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-white/70",children:"expand_more"})]}),(0,d.jsx)("p",{className:"truncate text-xs text-white/55",children:_})]})}),H?(0,d.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-white/10 bg-[#262626] shadow-2xl shadow-black/50",children:[(0,d.jsxs)("div",{className:"border-b border-white/10 px-4 py-3",children:[(0,d.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Models"}),(0,d.jsx)("p",{className:"text-sm text-white/75",children:"Only from connected providers"})]}),(0,d.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:a.map(a=>(0,d.jsxs)("div",{className:"mb-2 rounded-[16px] border border-white/10 bg-black/20 p-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-white",children:a.providerName}),(0,d.jsx)(f.Ex,{size:"sm",variant:"default",children:a.models.length})]}),(0,d.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:a.models.map(a=>{let b=a.id===t;return(0,d.jsx)("button",{type:"button",onClick:()=>(a=>{let b=P.get(a);if(!b)return;let c=n.find(a=>a.id===p);if(c&&c.messages.length>0){let a=X(b);if(!a)return;o(b=>[a,...b]),q(a.id)}else if(c)o(a=>a.map(a=>a.id===c.id?{...a,providerId:b.providerId,providerName:b.providerName,modelId:b.id,modelName:b.name}:a)),q(c.id);else{let a=X(b);if(!a)return;o(b=>[a,...b]),q(a.id)}s(b.providerId),u(b.id),I(!1)})(a.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${b?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-sm font-medium text-white",children:a.name}),(0,d.jsx)("p",{className:"truncate text-[11px] text-white/45",children:a.requestModel})]}),b?(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-blue-300",children:"check_circle"}):null]})},a.id)})})]},a.providerId))})]}):null]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>K(a=>!a),className:"rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-sm text-white/80 transition hover:bg-white/8",children:"History"}),(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!p)return;let a=n.filter(a=>a.id!==p),b=a[0]||null;o(a),b?(q(b.id),s(b.providerId),u(b.modelId)):(q(""),s(""),u(""))},disabled:!p||0===n.length,children:"Clear"})]})]}),J?(0,d.jsxs)("div",{ref:O,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-white/10 bg-[#262626] p-2 shadow-2xl shadow-black/50 lg:right-6",children:[(0,d.jsx)("div",{className:"px-3 py-2",children:(0,d.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Recent chats"})}),(0,d.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===U.length?(0,d.jsx)("div",{className:"rounded-[16px] border border-dashed border-white/10 bg-white/5 p-4 text-sm text-white/55",children:"No conversations yet."}):U.map(a=>{let b=a.id===p,c=[...a.messages||[]].reverse().find(a=>"user"===a.role)||a.messages?.[0];return(0,d.jsx)("button",{type:"button",onClick:()=>{var b;let c;return b=a.id,void((c=n.find(a=>a.id===b))&&(q(b),s(c.providerId||r),u(c.modelId||t),K(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${b?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"truncate text-sm font-medium text-white",children:a.title}),(0,d.jsx)("p",{className:"mt-1 truncate text-xs text-white/50",children:h(c?.content)||"Empty chat"})]}),(0,d.jsx)("span",{className:"text-[10px] text-white/40 shrink-0",children:function(a){if(!a)return"Now";let b=new Date(a).getTime();if(Number.isNaN(b))return"Now";let c=Math.max(1,Math.round((Date.now()-b)/6e4));if(c<60)return`${c}m`;let d=Math.round(c/60);return d<24?`${d}h`:`${Math.round(d/24)}d`}(a.updatedAt)})]})},a.id)})})]}):null,l?(0,d.jsx)("div",{className:"mt-4 rounded-[18px] border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-rose-100",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,d.jsx)("p",{className:"text-sm leading-6",children:l})]})}):null,(0,d.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===T.length?(0,d.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,d.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,d.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-white/10 bg-white/5 text-white/80",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h2",{className:"text-2xl font-semibold text-white",children:"Start a conversation"}),(0,d.jsx)("p",{className:"text-sm leading-6 text-white/60",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,d.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:T.map(a=>{let b="user"===a.role,c="assistant"===a.role,e=c&&a.id===B&&"streaming"===a.status,f=h(a.content)||(c?D:"");return(0,d.jsx)("div",{className:`flex w-full ${b?"justify-end":"justify-start"} mb-6`,children:(0,d.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${b?"rounded-3xl bg-[#2f2f2f] px-5 py-3.5 text-white":"text-white/90"}`,children:[(0,d.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,d.jsx)("span",{className:"text-xs font-semibold",children:b?"You":R?.name||"Assistant"})}),a.attachments?.length?(0,d.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:a.attachments.map(a=>(0,d.jsx)("a",{href:a.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-white/10 bg-black/20",children:(0,d.jsx)("img",{src:a.dataUrl,alt:a.name,className:"h-28 w-full object-cover"})},a.id))}):null,(0,d.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[f,c&&e&&!D?(0,d.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]})]})},a.id)})})]}),(0,d.jsxs)("div",{className:"shrink-0 pt-2",children:[x.length>0?(0,d.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:x.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-2",children:[(0,d.jsx)("span",{className:"text-xs text-white/80 max-w-[12rem] truncate",children:a.name}),(0,d.jsx)("button",{type:"button",onClick:()=>{var b;return b=a.id,void y(a=>a.filter(a=>a.id!==b))},className:"text-white/55 hover:text-white","aria-label":"Remove attachment",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},a.id))}):null,(0,d.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,d.jsxs)("div",{className:"rounded-[26px] bg-[#2f2f2f] px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-white/5",children:[(0,d.jsx)("textarea",{value:v,onChange:a=>w(a.target.value),onKeyDown:a=>{"Enter"===a.key&&!a.shiftKey&&(a.preventDefault(),V&&Z())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-white outline-none placeholder:text-white/40 custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,d.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>L.current?.click(),disabled:!R||c,className:"p-2 text-white/50 hover:text-white transition rounded-full hover:bg-white/5",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,d.jsx)("input",{ref:L,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:Y}),(0,d.jsx)("span",{className:"text-xs font-medium text-white/30 truncate max-w-[120px]",children:R?R.name:"No model"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[z?(0,d.jsx)("button",{type:"button",onClick:()=>{M.current?.abort()},className:"p-2 text-white bg-white/10 hover:bg-white/20 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,d.jsx)("button",{onClick:Z,disabled:!V,className:`h-8 w-8 rounded-full flex items-center justify-center transition ${V?"bg-white text-black hover:opacity-90":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,d.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-white/30",children:"Model list is filtered from connected providers."})]})]})})}c(91431),c(92592)},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},76978:(a,b,c)=>{"use strict";c.d(b,{UserRoleProvider:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call UserRoleContext() from the server but UserRoleContext is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/UserRoleProvider.js","UserRoleContext");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call UserRoleProvider() from the server but UserRoleProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/UserRoleProvider.js","UserRoleProvider");(0,d.registerClientReference)(function(){throw Error("Attempted to call useUserRole() from the server but useUserRole is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/UserRoleProvider.js","useUserRole"),(0,d.registerClientReference)(function(){throw Error("Attempted to call useIsSuperAdmin() from the server but useIsSuperAdmin is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/UserRoleProvider.js","useIsSuperAdmin")},77030:a=>{"use strict";a.exports=require("node:net")},77068:a=>{"use strict";a.exports=require("next/dist/shared/lib/size-limit")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79286:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js","default")},79428:a=>{"use strict";a.exports=require("buffer")},79646:a=>{"use strict";a.exports=require("child_process")},80099:a=>{"use strict";a.exports=require("node:sqlite")},80342:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/IFlowCookieModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/IFlowCookieModal.js","default")},81115:a=>{"use strict";a.exports=require("constants")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},81923:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/ProviderInfoCard.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/ProviderInfoCard.js","default")},82448:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/KiroAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/KiroAuthModal.js","default")},83784:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Select.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Select.js","default")},83997:a=>{"use strict";a.exports=require("tty")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87228:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/KiroSocialOAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/KiroSocialOAuthModal.js","default")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},92082:(a,b,c)=>{"use strict";c.d(b,{CardSkeleton:()=>h,PageLoading:()=>f,Skeleton:()=>g,Spinner:()=>e,default:()=>i});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Spinner() from the server but Spinner is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Loading.js","Spinner"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageLoading() from the server but PageLoading is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Loading.js","PageLoading"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call Skeleton() from the server but Skeleton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Loading.js","Skeleton"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call CardSkeleton() from the server but CardSkeleton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Loading.js","CardSkeleton"),i=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Loading.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Loading.js","default")},92669:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/Header.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/Header.js","default")},92767:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>O,handler:()=>Q,routeModule:()=>P});var d=c(7553),e=c(84006),f=c(67798),g=c(34775),h=c(99373),i=c(73461),j=c(1020),k=c(26349),l=c(54365),m=c(16023),n=c(14965),o=c(63747),p=c(24235),q=c(23938),r=c(261),s=c(66758),t=c(77243),u=c(26713),v=c(37527),w=c(22820),x=c(88216),y=c(47929),z=c(79551),A=c(71797),B=c(89125),C=c(86439),D=c(77068),E=c(27269),F=c(37525),G=c(61287),H=c(81494),I=c(70722),J=c(70753),K=c(43954),L=c(17891),M={};for(let a in G)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(M[a]=()=>G[a]);c.d(b,M);let N={children:["",{children:["(dashboard)",{children:["dashboard",{children:["basic-chat",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,40551)),"/Users/bytedance/Documents/Projects/9router/src/app/(dashboard)/dashboard/basic-chat/page.js"]}]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,30508)),"/Users/bytedance/Documents/Projects/9router/src/app/(dashboard)/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,70440))).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,50385)),"/Users/bytedance/Documents/Projects/9router/src/app/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,70440))).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,O={require:c,loadChunk:()=>Promise.resolve()},P=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/(dashboard)/dashboard/basic-chat/page",pathname:"/dashboard/basic-chat",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:N},distDir:".next-cli-build",relativeProjectDir:""});async function Q(a,b,d){var M,R,S,T,U;d.requestMeta&&(0,h.setRequestMeta)(a,d.requestMeta),P.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let V=!!(0,h.getRequestMeta)(a,"minimalMode"),W="/(dashboard)/dashboard/basic-chat/page";"/index"===W&&(W="/");let X=await P.prepare(a,b,{srcPage:W,multiZoneDraftMode:!1});if(!X)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Y,query:Z,params:$,pageIsDynamic:_,buildManifest:aa,nextFontManifest:ab,reactLoadableManifest:ac,serverActionsManifest:ad,clientReferenceManifest:ae,subresourceIntegrityManifest:af,prerenderManifest:ag,isDraftMode:ah,resolvedPathname:ai,revalidateOnlyGenerated:aj,routerServerContext:ak,nextConfig:al,parsedUrl:am,interceptionRoutePatterns:an,deploymentId:ao,clientAssetToken:ap}=X,aq=(0,r.normalizeAppPath)(W),{isOnDemandRevalidate:ar}=X,as=al.experimental.ppr&&!al.cacheComponents&&(0,K.isInterceptionRouteAppPath)(ai)?null:P.match(ai,ag),at=(null==as?void 0:as.route)??null,au=!!ag.routes[ai],av=a.headers["user-agent"]||"",aw=(0,u.getBotType)(av),ax=(0,q.isHtmlBotRequest)(a),ay=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[t.NEXT_ROUTER_PREFETCH_HEADER],az=(0,h.getRequestMeta)(a,"isRSCRequest")??(0,n.f)(a.headers[t.RSC_HEADER]),aA=(0,s.getIsPossibleServerAction)(a),aB=(0,m.checkIsAppPPREnabled)(al.experimental.ppr),aC=a.headers[y.NEXT_RESUME_STATE_LENGTH_HEADER];if(!(0,h.getRequestMeta)(a,"postponed")&&V&&aB&&aA&&aC&&"string"==typeof aC){let e=parseInt(aC,10),{maxPostponedStateSize:f,maxPostponedStateSizeBytes:g}=(0,E.getMaxPostponedStateSize)(al.experimental.maxPostponedStateSize);if(!isNaN(e)&&e>0){if(e>g)return b.statusCode=413,b.end((0,E.getPostponedStateExceededErrorMessage)(f)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let i="1 MB",j=(null==(U=al.experimental.serverActions)?void 0:U.bodySizeLimit)??i,k=e+(j!==i?c(95726).parse(j):1048576),l=await (0,E.readBodyWithSizeLimit)(a,k);if(null===l)return b.statusCode=413,b.end("Request body exceeded limit. To configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;if(l.length>=e){let b=l.subarray(0,e).toString("utf8");(0,h.addRequestMeta)(a,"postponed",b);let c=l.subarray(e);(0,h.addRequestMeta)(a,"actionBody",c)}else throw Object.defineProperty(Error(`invariant: expected ${e} bytes of postponed state but only received ${l.length} bytes`),"__NEXT_ERROR_CODE",{value:"E979",enumerable:!1,configurable:!0})}}if(!(0,h.getRequestMeta)(a,"postponed")&&aB&&"1"===a.headers[y.NEXT_RESUME_HEADER]&&"POST"===a.method){let{maxPostponedStateSize:c,maxPostponedStateSizeBytes:e}=(0,E.getMaxPostponedStateSize)(al.experimental.maxPostponedStateSize),f=await (0,E.readBodyWithSizeLimit)(a,e);if(null===f)return b.statusCode=413,b.end((0,E.getPostponedStateExceededErrorMessage)(c)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let g=f.toString("utf8");(0,h.addRequestMeta)(a,"postponed",g)}let aD=!0===P.isDev||!0===al.experimental.exposeTestingApiInProductionBuild,aE=aD&&("1"===a.headers[t.NEXT_INSTANT_PREFETCH_HEADER]||!(0,n.f)(a.headers[t.RSC_HEADER])&&"string"==typeof a.headers.cookie&&a.headers.cookie.includes(t.NEXT_INSTANT_TEST_COOKIE+"=")),aF=(aB||aE)&&((null==(M=ag.routes[aq]??ag.dynamicRoutes[aq])?void 0:M.renderingMode)==="PARTIALLY_STATIC"||aE&&(aD||(null==ak?void 0:ak.experimentalTestProxy)===!0)),aG=aE&&aF,aH=aG&&!0===P.isDev,aI=!1,aJ=aF?(0,h.getRequestMeta)(a,"postponed"):void 0,aK=null==(R=ag.routes[ai])?void 0:R.prefetchDataRoute,aL=aF&&az&&!ay&&!aK;V&&(aL=aL&&!!aJ);let aM=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),aN=(!aw||!aF)&&(!av||(0,q.shouldServeStreamingMetadata)(av,al.htmlLimitedBots)),aO=!!((at||au||ag.routes[aq])&&!(aw&&aF)),aP=aF&&!0===al.cacheComponents,aQ=!0===P.isDev||!aO||"string"==typeof aJ||(aP&&(0,h.getRequestMeta)(a,"onCacheEntryV2")?aL&&!V:aL),aR=!!aw&&aF,aS=(null==at?void 0:at.remainingPrerenderableParams)??[],aT=(null==at?void 0:at.fallback)===null&&((null==(S=at.fallbackRootParams)?void 0:S.length)??0)>0,aU=null;if(!ah&&aO&&!aQ&&!aA&&!aJ&&!aL){let a=as?"string"==typeof(null==at?void 0:at.fallback)?at.fallback:as.source:null;if(!0===al.experimental.partialFallbacks&&a&&(null==at?void 0:at.fallbackRouteParams)&&!aT){if(aS.length>0){let b,c=(b=new Map(aS.map(a=>[a.paramName,a])),a.split("/").map(a=>{let c=(0,L.getSegmentParam)(a);if(!c)return a;let d=b.get(c.paramName);if(!d)return a;let e=null==$?void 0:$[d.paramName];if(!e)return a;let f=Array.isArray(e)?e.map(a=>encodeURIComponent(a)).join("/"):encodeURIComponent(e);return a.replace((0,o.buildDynamicSegmentPlaceholder)(d),f)}).join("/")||"/");aU=c!==a?c:null}}else aU=ai}let aV=aU;!aV&&(P.isDev||aO&&_&&(null==at?void 0:at.fallbackRouteParams)&&!aA)&&(aV=ai),P.isDev||ah||!aO||!az||aL||(0,k.d)(a.headers);let aW={...G,tree:N,handler:Q,routeModule:P,__next_app__:O};ad&&ae&&(0,p.setManifestsSingleton)({page:W,clientReferenceManifest:ae,serverActionsManifest:ad});let aX=a.method||"GET",aY=(0,g.getTracer)(),aZ=aY.getActiveScopeSpan(),a$=!!(null==ak?void 0:ak.isWrappedByNextServer),a_=!0===al.experimental.partialFallbacks&&aS.length>0?(null==at||null==(T=at.fallbackRouteParams)?void 0:T.filter(a=>!aS.some(b=>b.paramName===a.paramName)))??[]:[],a0=async()=>((null==ak?void 0:ak.render404)?await ak.render404(a,b,am,!1):b.end("This page could not be found"),null);try{let k,m=P.getVaryHeader(ai,an);b.setHeader("Vary",m);let n=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return P.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=aY.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=a.get("next.route");if(d){let a=`${aX} ${d}`;c.setAttributes({"next.route":d,"http.route":d,"next.span_name":a}),c.updateName(a),k&&k!==c&&(k.setAttribute("http.route",d),k.updateName(a))}else c.updateName(`${aX} ${W}`)})},p=(0,h.getRequestMeta)(a,"incrementalCache")||await P.getIncrementalCache(a,al,ag,V);null==p||p.resetRequestCache(),globalThis.__incrementalCache=p;let q=async({span:e,postponed:f,fallbackRouteParams:g,forceStaticRender:i})=>{let k={query:Z,params:$,page:aq,sharedContext:{buildId:Y,deploymentId:ao,clientAssetToken:ap},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aW,Component:(0,j.T)(aW),params:$,routeModule:P,page:W,postponed:f,shouldWaitOnAllReady:aR,serveStreamingMetadata:aN,supportsDynamicResponse:"string"==typeof f||aQ,buildManifest:aa,nextFontManifest:ab,reactLoadableManifest:ac,subresourceIntegrityManifest:af,setCacheStatus:null==ak?void 0:ak.setCacheStatus,setIsrStatus:null==ak?void 0:ak.setIsrStatus,setReactDebugChannel:null==ak?void 0:ak.setReactDebugChannel,sendErrorsToBrowser:null==ak?void 0:ak.sendErrorsToBrowser,dir:c(33873).join(process.cwd(),P.relativeProjectDir),isDraftMode:ah,botType:aw,isOnDemandRevalidate:ar,isPossibleServerAction:aA,assetPrefix:al.assetPrefix,nextConfigOutput:al.output,crossOrigin:al.crossOrigin,trailingSlash:al.trailingSlash,images:al.images,previewProps:ag.preview,enableTainting:al.experimental.taint,htmlLimitedBots:al.htmlLimitedBots,reactMaxHeadersLength:al.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:p,cacheLifeProfiles:al.cacheLife,basePath:al.basePath,serverActions:al.experimental.serverActions,logServerFunctions:"object"==typeof al.logging&&!!al.logging.serverFunctions,...aG||aH||aI?{isBuildTimePrerendering:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isDebugDynamicAccesses:aH}:{},cacheComponents:!!al.cacheComponents,experimental:{isRoutePPREnabled:aF,expireTime:al.expireTime,staleTimes:al.experimental.staleTimes,dynamicOnHover:!!al.experimental.dynamicOnHover,optimisticRouting:!!al.experimental.optimisticRouting,inlineCss:!!al.experimental.inlineCss,prefetchInlining:al.experimental.prefetchInlining??!1,authInterrupts:!!al.experimental.authInterrupts,cachedNavigations:!!al.experimental.cachedNavigations,clientTraceMetadata:al.experimental.clientTraceMetadata||[],clientParamParsingOrigins:al.experimental.clientParamParsingOrigins,maxPostponedStateSizeBytes:(0,D.parseMaxPostponedStateSize)(al.experimental.maxPostponedStateSize)},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d,e)=>P.onRequestError(a,b,d,e,ak),err:(0,h.getRequestMeta)(a,"invokeError")}};i&&(k.renderOpts.supportsDynamicResponse=!1);let l=await n(e,k),{metadata:m}=l,{cacheControl:o,headers:q={},fetchTags:r,fetchMetrics:s}=m;if(r&&(q[y.NEXT_CACHE_TAGS_HEADER]=r),a.fetchMetrics=s,aO&&(null==o?void 0:o.revalidate)===0&&!P.isDev&&!aF){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ai}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
2
2
  see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:v.CachedRouteKind.APP_PAGE,html:l,headers:q,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:o}},r=async({hasResolved:c,previousCacheEntry:g,isRevalidating:i,span:j,forceStaticRender:k=!1})=>{let l=!1===P.isDev,m=c||b.writableEnded;try{var n;let f;if(ar&&aj&&!g&&!V)return(null==ak?void 0:ak.render404)?await ak.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(at&&(f=(0,w.parseFallbackField)(at.fallback)),!0===al.experimental.partialFallbacks&&(null==at?void 0:at.fallback)===null&&!aT&&aS.length>0&&(f=w.FallbackMode.PRERENDER),f===w.FallbackMode.PRERENDER&&(0,u.isBot)(av)&&(!aF||ax)&&(f=w.FallbackMode.BLOCKING_STATIC_RENDER),(null==g?void 0:g.isStale)===-1&&(ar=!0),ar&&(f!==w.FallbackMode.NOT_FOUND||g)&&(f=w.FallbackMode.BLOCKING_STATIC_RENDER),!V&&f!==w.FallbackMode.BLOCKING_STATIC_RENDER&&aV&&!m&&!ah&&_&&(l||!au)){if((l||at)&&f===w.FallbackMode.NOT_FOUND){if(al.adapterPath)return await a0();throw new C.NoFallbackError}if(aF&&(al.cacheComponents?!aL:!az)){let b=l&&"string"==typeof(null==at?void 0:at.fallback)?at.fallback:aq,f=(l||aG)&&(null==at?void 0:at.fallbackRouteParams)?(0,o.createOpaqueFallbackRouteParams)(at.fallbackRouteParams):aI?(0,o.getFallbackRouteParams)(aq,P):null;aG&&f&&(0,h.addRequestMeta)(a,"fallbackParams",f);let g=await P.handleResponse({cacheKey:b,req:a,nextConfig:al,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:ag,isRoutePPREnabled:aF,responseGenerator:async()=>q({span:j,postponed:void 0,fallbackRouteParams:f,forceStaticRender:!0}),waitUntil:d.waitUntil,isMinimalMode:V});if(null===g)return null;if(g)return V||!aF||!(aS.length>0)||!0!==al.experimental.partialFallbacks||!aU||!p||ar||aI||aD||aE||ay||(0,J.scheduleOnNextTick)(async()=>{let b=P.getResponseCache(a);try{await b.revalidate(aU,p,aF,!1,a=>q({span:a.span,postponed:void 0,fallbackRouteParams:a_.length>0?(0,o.createOpaqueFallbackRouteParams)(a_):null,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}),delete g.cacheControl,g}}let s=ar||i||!aJ?void 0:aJ;if(aP&&!V&&p&&(aL||aA)&&!k){let b=await p.get(ai,{kind:v.IncrementalCacheKind.APP_PAGE,isRoutePPREnabled:!0,isFallback:!1});b&&b.value&&b.value.kind===v.CachedRouteKind.APP_PAGE&&(s=b.value.postponed,b&&(-1===b.isStale||!0===b.isStale)&&(0,J.scheduleOnNextTick)(async()=>{let b=P.getResponseCache(a);try{await b.revalidate(ai,p,aF,!1,a=>r({...a,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}))}if((aG||aH)&&void 0!==s)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:v.CachedRouteKind.PAGES,html:x.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let t=!P.isDev&&_&&(null==at?void 0:at.fallbackRouteParams)?(0,o.getPlaceholderFallbackRouteParams)($,at.fallbackRouteParams):null,y=t&&t.length>0?t:null==at?void 0:at.fallbackRouteParams,z=null!=t&&t.length>0,A=null;if(al.cacheComponents&&(null==at?void 0:at.fallbackRouteParams)){let b=(0,h.getRequestMeta)(a,"resolvedRouteParamKeys");b&&b.size>0&&(A=at.fallbackRouteParams.filter(a=>!b.has(a.paramName)))}let B=(l&&(0,h.getRequestMeta)(a,"renderFallbackShell")||z||aG&&!au)&&y?(0,o.createOpaqueFallbackRouteParams)(y):A&&A.length>0&&A.length<((null==at||null==(n=at.fallbackRouteParams)?void 0:n.length)??0)?(0,o.createOpaqueFallbackRouteParams)(A):aI?(0,o.getFallbackRouteParams)(aq,P):null;if((l||aG)&&al.cacheComponents&&!au&&(null==at?void 0:at.fallbackRouteParams)){let b=(0,o.createOpaqueFallbackRouteParams)(y??at.fallbackRouteParams);b&&(0,h.addRequestMeta)(a,"fallbackParams",b)}return q({span:j,postponed:s,fallbackRouteParams:B,forceStaticRender:k})}catch(b){throw(null==g?void 0:g.isStale)&&await P.onRequestError(a,b,{routerKind:"App Router",routePath:W,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aO,isOnDemandRevalidate:ar})},!1,ak),b}},s=async c=>{var f,g,i,j,k,l;let m,n=await P.handleResponse({cacheKey:aU,responseGenerator:a=>r({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ar,isRoutePPREnabled:aF,req:a,nextConfig:al,prerenderManifest:ag,waitUntil:d.waitUntil,isMinimalMode:V});if(ah&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),P.isDev&&b.setHeader("Cache-Control","no-cache, must-revalidate"),!n){if(aU)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=n.value)?void 0:f.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=n.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let o="string"==typeof n.value.postponed;az&&!aA&&ao&&b.setHeader(y.NEXT_NAV_DEPLOYMENT_ID_HEADER,ao),aO&&!aL&&(!o||ay)&&(V||b.setHeader("x-nextjs-cache",ar?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),b.setHeader(t.NEXT_IS_PRERENDER_HEADER,"1"));let{value:p}=n;if(aJ)m={revalidate:0,expire:void 0};else if(aL)m={revalidate:0,expire:void 0};else if(!P.isDev)if(ah)m={revalidate:0,expire:void 0};else if(aO){if(n.cacheControl)if("number"==typeof n.cacheControl.revalidate){if(n.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${n.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});m={revalidate:n.cacheControl.revalidate,expire:(null==(j=n.cacheControl)?void 0:j.expire)??al.expireTime}}else m={revalidate:y.CACHE_ONE_YEAR_SECONDS,expire:void 0}}else b.getHeader("Cache-Control")||(m={revalidate:0,expire:void 0});if(n.cacheControl=m,"string"==typeof aM&&(null==p?void 0:p.kind)===v.CachedRouteKind.APP_PAGE&&p.segmentData){b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=p.headers)?void 0:k[y.NEXT_CACHE_TAGS_HEADER];V&&aO&&c&&"string"==typeof c&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,c);let d=p.segmentData.get(aM);return void 0!==d?(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.fromStatic(d,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl}):(b.statusCode=204,(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl}))}let s=aP?(0,h.getRequestMeta)(a,"onCacheEntryV2")??(0,h.getRequestMeta)(a,"onCacheEntry"):(0,h.getRequestMeta)(a,"onCacheEntry");if(s){let b=(0,h.getRequestMeta)(a,"initURL")??a.url,c=b?(null==(l=(0,F.parseUrl)(b))?void 0:l.pathname)??b:void 0;if(await s(n,{url:c}))return null}if(p.headers){let a={...p.headers};for(let[c,d]of(V&&aO||delete a[y.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let u=null==(g=p.headers)?void 0:g[y.NEXT_CACHE_TAGS_HEADER];if(V&&aO&&u&&"string"==typeof u&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,u),!p.status||az&&aF||(b.statusCode=p.status),!V&&p.status&&H.RedirectStatusCode[p.status]&&az&&(b.statusCode=200),o&&!aL&&b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"1"),az&&!ah){if(void 0===p.rscData){if(p.html.contentType!==t.RSC_CONTENT_TYPE_HEADER)if(al.cacheComponents)return b.statusCode=404,(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl});else throw Object.defineProperty(new I.InvariantError(`Expected RSC response, got ${p.html.contentType}`),"__NEXT_ERROR_CODE",{value:"E789",enumerable:!1,configurable:!0});return(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:p.html,cacheControl:n.cacheControl})}return(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.fromStatic(p.rscData,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl})}let w=p.html;if(aE&&aG){let c=!0===P.isDev?crypto.randomUUID():null;return w.pipeThrough(await (0,A.createInstantTestScriptInsertionTransformStream)(c)),(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:{revalidate:0,expire:void 0}})}if(!o||V||az)return(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:n.cacheControl});if(aG||aH)return w.push(new ReadableStream({start(a){a.enqueue(z.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:{revalidate:0,expire:void 0}});let C=new TransformStream;return w.push(C.readable),q({span:c,postponed:p.postponed,fallbackRouteParams:null,forceStaticRender:!1}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(C.writable)}).catch(a=>{C.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:{revalidate:0,expire:void 0}})};if(!a$||!aZ)return k=aY.getActiveScopeSpan(),await aY.withPropagatedContext(a.headers,()=>aY.trace(i.BaseServerSpan.handleRequest,{spanName:`${aX} ${W}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aX,"http.target":a.url}},s),void 0,!a$);await s(aZ)}catch(b){throw b instanceof C.NoFallbackError||await P.onRequestError(a,b,{routerKind:"App Router",routePath:W,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aO,isOnDemandRevalidate:ar})},!1,ak),b}}},94582:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/bytedance/Documents/Projects/9router/src/shared/components/ModelSelectModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/bytedance/Documents/Projects/9router/src/shared/components/ModelSelectModal.js","default")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,5592,7502,6936,4013,6001,7774,5296,5573,319,6482,3913,9718,5118,6070,8920,6306,1832,4989,1275,7937,8895,6182,6457,8271,3412,6777,412],()=>b(b.s=92767));module.exports=c})();