@karan171996/metricflow 0.4.0 → 0.5.1

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 (167) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_1gfkiq9._.js +1 -1
  3. package/.next/build/chunks/{node_modules__pnpm_0q5gz_g._.js → node_modules__pnpm_0x15692._.js} +95 -40
  4. package/.next/build-manifest.json +3 -3
  5. package/.next/fallback-build-manifest.json +3 -3
  6. package/.next/next-server.js.nft.json +1 -1
  7. package/.next/prerender-manifest.json +6 -6
  8. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  9. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/_global-error.html +1 -1
  11. package/.next/server/app/_global-error.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/server/app/_not-found/page.js +1 -1
  16. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  17. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/_not-found.html +2 -2
  19. package/.next/server/app/_not-found.rsc +41 -40
  20. package/.next/server/app/_not-found.segments/_full.segment.rsc +41 -40
  21. package/.next/server/app/_not-found.segments/_index.segment.rsc +32 -31
  22. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  24. package/.next/server/app/api/analyze/route.js +1 -1
  25. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  26. package/.next/server/app/api/connect/route.js +1 -1
  27. package/.next/server/app/api/connect/route.js.nft.json +1 -1
  28. package/.next/server/app/api/health/route.js.nft.json +1 -1
  29. package/.next/server/app/api/metrics/route.js +2 -2
  30. package/.next/server/app/api/metrics/route.js.nft.json +1 -1
  31. package/.next/server/app/api/settings/route.js +1 -1
  32. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  33. package/.next/server/app/api/setup/ai/route.js +1 -1
  34. package/.next/server/app/api/setup/ai/route.js.nft.json +1 -1
  35. package/.next/server/app/api/setup/route.js +1 -1
  36. package/.next/server/app/api/setup/route.js.nft.json +1 -1
  37. package/.next/server/app/connect/page.js +1 -1
  38. package/.next/server/app/connect/page.js.nft.json +1 -1
  39. package/.next/server/app/connect/page_client-reference-manifest.js +1 -1
  40. package/.next/server/app/connect.html +6 -5
  41. package/.next/server/app/connect.rsc +42 -41
  42. package/.next/server/app/connect.segments/_full.segment.rsc +42 -41
  43. package/.next/server/app/connect.segments/_index.segment.rsc +32 -31
  44. package/.next/server/app/connect.segments/_tree.segment.rsc +2 -2
  45. package/.next/server/app/connect.segments/connect/__PAGE__.segment.rsc +6 -6
  46. package/.next/server/app/index.html +2 -2
  47. package/.next/server/app/index.rsc +42 -41
  48. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  49. package/.next/server/app/index.segments/_full.segment.rsc +42 -41
  50. package/.next/server/app/index.segments/_index.segment.rsc +32 -31
  51. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  52. package/.next/server/app/page.js +1 -1
  53. package/.next/server/app/page.js.nft.json +1 -1
  54. package/.next/server/app/page_client-reference-manifest.js +1 -1
  55. package/.next/server/app/performance/[slug]/page.js +2 -2
  56. package/.next/server/app/performance/[slug]/page.js.nft.json +1 -1
  57. package/.next/server/app/performance/[slug]/page_client-reference-manifest.js +1 -1
  58. package/.next/server/app/performance/page.js +1 -1
  59. package/.next/server/app/performance/page.js.nft.json +1 -1
  60. package/.next/server/app/performance/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app/performance.html +2 -2
  62. package/.next/server/app/performance.rsc +55 -53
  63. package/.next/server/app/performance.segments/_full.segment.rsc +55 -53
  64. package/.next/server/app/performance.segments/_index.segment.rsc +32 -31
  65. package/.next/server/app/performance.segments/_tree.segment.rsc +2 -2
  66. package/.next/server/app/performance.segments/performance/__PAGE__.segment.rsc +23 -22
  67. package/.next/server/app/settings/page.js +3 -3
  68. package/.next/server/app/settings/page.js.nft.json +1 -1
  69. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  70. package/.next/server/app/settings.html +2 -2
  71. package/.next/server/app/settings.rsc +57 -56
  72. package/.next/server/app/settings.segments/_full.segment.rsc +57 -56
  73. package/.next/server/app/settings.segments/_index.segment.rsc +32 -31
  74. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  75. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +17 -17
  76. package/.next/server/app/setup/page.js +1 -1
  77. package/.next/server/app/setup/page.js.nft.json +1 -1
  78. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  79. package/.next/server/app/setup.html +2 -2
  80. package/.next/server/app/setup.rsc +43 -42
  81. package/.next/server/app/setup.segments/_full.segment.rsc +43 -42
  82. package/.next/server/app/setup.segments/_index.segment.rsc +32 -31
  83. package/.next/server/app/setup.segments/_tree.segment.rsc +2 -2
  84. package/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +7 -7
  85. package/.next/server/app/tools/[tool]/page.js +2 -2
  86. package/.next/server/app/tools/[tool]/page.js.nft.json +1 -1
  87. package/.next/server/app/tools/[tool]/page_client-reference-manifest.js +1 -1
  88. package/.next/server/chunks/[root-of-the-server]__00bbqkl._.js +3 -0
  89. package/.next/server/chunks/[root-of-the-server]__0fkj1-q._.js +1 -1
  90. package/.next/server/chunks/[root-of-the-server]__0rfr72x._.js +3 -0
  91. package/.next/server/chunks/[root-of-the-server]__186pj_c._.js +3 -0
  92. package/.next/server/chunks/[root-of-the-server]__19yigji._.js +3 -0
  93. package/.next/server/chunks/[root-of-the-server]__1igrw77._.js +3 -0
  94. package/.next/server/chunks/[root-of-the-server]__1xo4bin._.js +3 -0
  95. package/.next/server/chunks/_08xo8nu._.js +7 -7
  96. package/.next/server/chunks/_0w8wvdn._.js +1 -1
  97. package/.next/server/chunks/_0wct7-r._.js +8 -7
  98. package/.next/server/chunks/_1l9d64o._.js +1 -1
  99. package/.next/server/chunks/ssr/0x0c_next_dist_1icgwks._.js +1 -1
  100. package/.next/server/chunks/ssr/[root-of-the-server]__0o_fd5z._.js +3 -0
  101. package/.next/server/chunks/ssr/{[root-of-the-server]__07myivi._.js → [root-of-the-server]__0qb6-a-._.js} +1 -1
  102. package/.next/server/chunks/ssr/[root-of-the-server]__14_2v5e._.js +3 -0
  103. package/.next/server/chunks/ssr/{[root-of-the-server]__1wd0g6g._.js → [root-of-the-server]__1r29vac._.js} +1 -1
  104. package/.next/server/chunks/ssr/[root-of-the-server]__1s_ikmb._.js +3 -0
  105. package/.next/server/chunks/ssr/_045bvlq._.js +3 -0
  106. package/.next/server/chunks/ssr/_0_02db6._.js +3 -0
  107. package/.next/server/chunks/ssr/_0bxxvzb._.js +3 -0
  108. package/.next/server/chunks/ssr/_0cq6qjs._.js +67 -0
  109. package/.next/server/chunks/ssr/_0htqt7_._.js +5 -5
  110. package/.next/server/chunks/ssr/_0ompurr._.js +7 -0
  111. package/.next/server/chunks/ssr/_0un641_._.js +3 -0
  112. package/.next/server/chunks/ssr/_13m9nev._.js +1 -1
  113. package/.next/server/chunks/ssr/_14aoqb2._.js +151 -0
  114. package/.next/server/chunks/ssr/_19s4g71._.js +3 -0
  115. package/.next/server/chunks/ssr/{_1rd2o5p._.js → _1n6rdd2._.js} +2 -2
  116. package/.next/server/chunks/ssr/{components_0j32dj5._.js → components_1_8btz1._.js} +1 -1
  117. package/.next/server/chunks/ssr/node_modules__pnpm_0o-aqpb._.js +3 -0
  118. package/.next/server/middleware-build-manifest.js +3 -3
  119. package/.next/server/pages/404.html +2 -2
  120. package/.next/server/pages/500.html +1 -1
  121. package/.next/static/chunks/0798_gs3g5aja.js +1 -0
  122. package/.next/static/chunks/1_dhsu7ouiell.js +5 -0
  123. package/.next/static/chunks/1habrj18124lo.js +1 -0
  124. package/.next/static/chunks/268zd4cpgc5jh.js +1 -0
  125. package/.next/static/chunks/278--y-yo6m9v.js +1 -0
  126. package/.next/static/chunks/2bt9wtnw1g0g_.css +1 -0
  127. package/.next/static/chunks/2mi013mf2pu08.js +1 -0
  128. package/.next/static/chunks/{3dwrl3svcft9m.js → 2p8myet8kmrgx.js} +1 -1
  129. package/.next/static/chunks/39h0f3s2ddxz_.js +65 -0
  130. package/.next/static/chunks/3ah6umj9qtdhc.js +1 -0
  131. package/.next/static/chunks/3wwhtfj-3akyd.js +1 -0
  132. package/.next/trace +1 -1
  133. package/.next/trace-build +1 -1
  134. package/README.md +1 -0
  135. package/bin/cli.mjs +2 -2
  136. package/bin/output.mjs +1 -0
  137. package/package.json +1 -1
  138. package/.next/server/chunks/[root-of-the-server]__0gv2l08._.js +0 -3
  139. package/.next/server/chunks/[root-of-the-server]__0pbux_a._.js +0 -3
  140. package/.next/server/chunks/[root-of-the-server]__16h-056._.js +0 -3
  141. package/.next/server/chunks/[root-of-the-server]__1mwvot_._.js +0 -3
  142. package/.next/server/chunks/[root-of-the-server]__1o8nu3b._.js +0 -3
  143. package/.next/server/chunks/[root-of-the-server]__1p0_79u._.js +0 -3
  144. package/.next/server/chunks/ssr/0x0c_next_dist_client_components_server-async-storage_1-oepaa.js +0 -3
  145. package/.next/server/chunks/ssr/[root-of-the-server]__031i31p._.js +0 -3
  146. package/.next/server/chunks/ssr/[root-of-the-server]__0kocjhm._.js +0 -3
  147. package/.next/server/chunks/ssr/[root-of-the-server]__1thxzex._.js +0 -3
  148. package/.next/server/chunks/ssr/_0defuav._.js +0 -3
  149. package/.next/server/chunks/ssr/_0e_s0v0._.js +0 -3
  150. package/.next/server/chunks/ssr/_0initzv._.js +0 -151
  151. package/.next/server/chunks/ssr/_0me-cg5._.js +0 -3
  152. package/.next/server/chunks/ssr/_0q0a6th._.js +0 -7
  153. package/.next/server/chunks/ssr/_1bk0z6l._.js +0 -3
  154. package/.next/server/chunks/ssr/_1t7ag6f._.js +0 -3
  155. package/.next/server/chunks/ssr/_1tpe22e._.js +0 -66
  156. package/.next/static/chunks/0cpw50mf8n-fl.js +0 -5
  157. package/.next/static/chunks/1ou_bh9mvu5x1.js +0 -1
  158. package/.next/static/chunks/1t-tmstauvn0u.js +0 -1
  159. package/.next/static/chunks/3dfy6smxuju__.js +0 -1
  160. package/.next/static/chunks/3gx5w553rdjfv.js +0 -1
  161. package/.next/static/chunks/3k7zn53z9c7_r.css +0 -1
  162. package/.next/static/chunks/3ptt1nvmavhqg.js +0 -1
  163. package/.next/static/chunks/3s-0xgj-1d8cp.js +0 -64
  164. package/.next/static/chunks/3xupay20_o0lm.js +0 -1
  165. /package/.next/static/{wxoN5sme_nnxf8fLQMX1S → ucaTykj_MXE8yhAPTYNl7}/_buildManifest.js +0 -0
  166. /package/.next/static/{wxoN5sme_nnxf8fLQMX1S → ucaTykj_MXE8yhAPTYNl7}/_clientMiddlewareManifest.js +0 -0
  167. /package/.next/static/{wxoN5sme_nnxf8fLQMX1S → ucaTykj_MXE8yhAPTYNl7}/_ssgManifest.js +0 -0
@@ -0,0 +1,65 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29821,e=>{"use strict";var t=e.i(40798),s=e.i(96341),r=e.i(3547),a=e.i(70065),n=e.i(67881),i=e.i(23750);let o=`// emitMetric.ts - sends a custom event through the New Relic browser agent (no key in your code)
2
+ // Needs a recent @newrelic/browser-agent (recordCustomEvent). Using New Relic's copy-paste snippet instead? Call window.newrelic.recordCustomEvent the same way.
3
+ import { getAgent } from './newrelic'; // from snippet 1
4
+
5
+ export function emitMetric(name: string, value: number, attrs: Record<string, string | number | boolean> = {}) {
6
+ // No-op until <NewRelicAgent /> has mounted, so this is safe to call anywhere.
7
+ getAgent()?.recordCustomEvent('MetricFlowEvent', { name, value, page: location.pathname, ...attrs });
8
+ }
9
+
10
+ // emitMetric('checkout_step', 2, { step: 'payment' });`,l=`// npm i @sentry/browser
11
+ import * as Sentry from '@sentry/browser';
12
+
13
+ Sentry.init({
14
+ dsn: '<YOUR_SENTRY_DSN>', // Sentry > Project settings > Client Keys (DSN)
15
+ integrations: [Sentry.browserTracingIntegration()], // records page loads and web vitals (LCP, CLS, INP, TTFB)
16
+ tracesSampleRate: 0.1, // share of page loads recorded; raise it on low-traffic sites
17
+ });`,c="border-[#2d3748] bg-[#1a202c] shadow-md";function d({n:e,title:r,help:i,code:o}){let[l,h]=(0,s.useState)(null);return(0,t.jsxs)(a.Card,{className:c,children:[(0,t.jsxs)(a.CardHeader,{children:[(0,t.jsx)(a.CardTitle,{className:"text-base font-bold text-white",children:r}),(0,t.jsx)(a.CardDescription,{className:"text-sm text-gray-400",children:i})]}),(0,t.jsxs)(a.CardContent,{className:"flex flex-col gap-3",children:[(0,t.jsx)("pre",{tabIndex:0,"aria-label":`Code snippet ${e}`,className:"overflow-x-auto rounded-md border border-[#2d3748] bg-[#0f1419] p-3 text-xs text-gray-300",children:o}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(n.Button,{variant:"outline","aria-label":`Copy snippet ${e}: ${r.replace(/^\d+\. /,"")}`,onClick:()=>{navigator.clipboard.writeText(o).then(()=>h("ok"),()=>h("fail")),setTimeout(()=>h(null),2500)},children:"Copy"}),(0,t.jsx)("span",{"aria-live":"polite",className:`text-sm ${"fail"===l?"text-[#f87171]":"text-[#3ee0a1]"}`,children:"ok"===l?"Copied":"fail"===l?"Copy failed, select the text and copy manually":""})]})]})]})}function h({label:e,state:s,detail:r}){let a="ok"===s?"text-[#3ee0a1]":"bad"===s?"text-[#f87171]":"text-gray-400";return(0,t.jsxs)("div",{className:"flex items-start gap-3 border-b border-[#2d3748] py-2 last:border-0",children:[(0,t.jsx)("span",{className:`font-mono text-sm ${a}`,"aria-hidden":!0,children:"ok"===s?"✓":"bad"===s?"✗":"…"}),(0,t.jsx)("span",{className:"sr-only",children:"ok"===s?"working":"bad"===s?"not working":"checking"}),(0,t.jsx)("span",{className:"text-sm text-gray-300 w-56 shrink-0",children:e}),(0,t.jsx)("span",{className:`min-w-0 text-sm ${a}`,children:r})]})}function u({label:e,s}){let r="Checking…",a="text-gray-400";if(s?.error)r=s.error,a="text-[#f87171]";else if(s){let e=null!==s.recent&&s.recent>0;r=e?`Receiving data${s.lastEventAt?` \xb7 last event ${new Date(s.lastEventAt).toLocaleTimeString()}`:""}`:s.lastEventAt?`None in the last 5 minutes \xb7 last event ${new Date(s.lastEventAt).toLocaleString()}`:"None yet",a=e?"text-[#3ee0a1]":"text-[#f59e0b]"}return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b border-[#2d3748] py-2 last:border-0",children:[(0,t.jsx)("span",{className:"text-sm text-gray-300 shrink-0",children:e}),(0,t.jsx)("span",{className:`min-w-0 break-words text-right text-sm ${a}`,children:r})]})}e.s(["ConnectPage",0,function(){let[e,p]=(0,s.useState)(null),[x,m]=(0,s.useState)(""),[g,y]=(0,s.useState)(null),[f,b]=(0,s.useState)(!1),[w,N]=(0,s.useState)(!1),C=(0,s.useCallback)(()=>{fetch("/api/connect").then(e=>e.json()).then(p).catch(()=>{})},[]);async function k(){b(!0),y(null);try{let e=await fetch("/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({NEWRELIC_INSERT_KEY:x})}),t=await e.json();t.saved?(m(""),N(!1),y({ok:!0,text:"Insert key saved."}),C()):y({ok:!1,text:t.error??t.results?.NEWRELIC_INSERT_KEY?.error??"Could not save the key."})}catch{y({ok:!1,text:"Could not reach the dashboard server."})}finally{b(!1)}}async function j(){b(!0),y(null);try{let e=await fetch("/api/connect",{method:"POST"}),t=await e.json();y(t.sent?{ok:!0,text:"Test event sent. It can take up to a minute to show below."}:{ok:!1,text:t.error??"Failed."}),C()}catch{y({ok:!1,text:"Could not reach the dashboard server."})}finally{b(!1)}}if((0,s.useEffect)(()=>{C();let e=setInterval(()=>{document.hidden||C()},5e3);return()=>clearInterval(e)},[C]),e?.error)return(0,t.jsx)(a.Card,{className:c,children:(0,t.jsx)(a.CardContent,{className:"p-10 text-center","aria-live":"polite",children:(0,t.jsx)("p",{className:"text-sm text-[#f87171]",children:e.error})})});if(e&&!e.configured)return(0,t.jsx)(a.Card,{className:c,children:(0,t.jsxs)(a.CardContent,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Set up your keys first"}),(0,t.jsx)("p",{className:"max-w-md text-sm text-gray-400",children:"Add your New Relic or Sentry keys, then come back to connect your site."}),(0,t.jsx)(r.default,{href:"/setup",className:(0,n.buttonVariants)(),children:"Go to setup"})]})});let v=!e?.tools||e.tools.includes("new-relic"),I=!e?.tools||e.tools.includes("sentry"),S=2*!!v+ +!!I+1;return(0,t.jsxs)("div",{className:"flex flex-col gap-6 max-w-3xl",children:[v&&(0,t.jsxs)(a.Card,{className:c,children:[(0,t.jsxs)(a.CardHeader,{children:[(0,t.jsx)(a.CardTitle,{className:"text-base font-bold text-white",children:"Connection"}),(0,t.jsx)(a.CardDescription,{className:"text-sm text-gray-400",children:"Each link in the chain from your site to this dashboard. Fix the first \\u2717."})]}),(0,t.jsxs)(a.CardContent,{"aria-live":"polite",children:[(0,t.jsx)(h,{label:"Keys for reading",state:e?"ok":"wait",detail:e?.accountId?`Reading New Relic account ${e.accountId}`:"Checking…"}),(0,t.jsx)(h,{label:"Browser app in New Relic",state:e?.setup?e.setup.error?"bad":e.setup.appCount>0?"ok":"bad":"wait",detail:e?.setup?e.setup.error?e.setup.error:e.setup.appCount>0?`${e.setup.appName} \u00b7 application ID ${e.setup.applicationId}`:"None yet. Create one: New Relic > Add data > Browser monitoring. Until then your site has no application ID to send to.":"Checking…"}),(0,t.jsx)(h,{label:"Browser key",state:e?.setup?e.setup.browserKey?"ok":"bad":"wait",detail:e?.setup?e.setup.browserKey?`${e.setup.browserKey} \u00b7 already filled into snippet 1 below`:"Could not read it. Copy the key VALUE from New Relic > API keys (type Ingest - Browser), not the ID beside it.":"Checking…"}),(0,t.jsx)(h,{label:"Your site sending data",state:e?.browser?(e.browser.recent??0)>0?"ok":"bad":"wait",detail:e?.browser?(e.browser.recent??0)>0?"New Relic is receiving page views":"No page views yet. Load your site, then check for blocked requests to nr-data.net - ad and privacy blockers drop them silently.":"Checking…"})]})]}),(0,t.jsxs)(a.Card,{className:c,children:[(0,t.jsxs)(a.CardHeader,{children:[(0,t.jsx)(a.CardTitle,{className:"text-base font-bold text-white",children:"Events received (last 5 minutes)"}),(0,t.jsxs)(a.CardDescription,{className:"text-sm text-gray-400",children:[e?.accountId?(0,t.jsxs)(t.Fragment,{children:["Querying New Relic account ",(0,t.jsx)("span",{className:"font-mono text-gray-200",children:e.accountId}),". "]}):null,"Updates every few seconds. All rows empty? Check this is the account your site sends to."]})]}),(0,t.jsxs)(a.CardContent,{"aria-live":"polite",children:[v&&(0,t.jsx)(u,{label:"Browser agent (page views)",s:e?.browser}),v&&(0,t.jsx)(u,{label:"Custom events (emitMetric / test event)",s:e?.custom}),I&&(0,t.jsx)(u,{label:"Sentry errors",s:e?.sentry})]})]}),v&&(0,t.jsxs)(a.Card,{className:c,children:[(0,t.jsxs)(a.CardHeader,{children:[(0,t.jsx)(a.CardTitle,{className:"text-base font-bold text-white",children:"Two different New Relic keys"}),(0,t.jsxs)(a.CardDescription,{className:"text-sm text-gray-400",children:[(0,t.jsx)("strong",{className:"text-gray-200",children:"User API key"})," (set on Setup): lets this dashboard ",(0,t.jsx)("em",{children:"read"})," your data."," ",(0,t.jsx)("strong",{className:"text-gray-200",children:"Ingest - License key"})," (below): lets a script ",(0,t.jsx)("em",{children:"send"})," events. Only the Insert key is used by the test button. The Browser agent snippet uses a third key, the ",(0,t.jsx)("strong",{className:"text-gray-200",children:"Ingest - Browser"})," key. Dashboards for US New Relic accounts only."]})]}),(0,t.jsxs)(a.CardContent,{className:"flex flex-col gap-3",children:[e?.insertKeySet&&!w?(0,t.jsxs)("p",{className:"text-sm text-[#3ee0a1]",children:["✓ Insert key is set"," ",(0,t.jsx)("button",{type:"button",className:"ml-2 text-gray-300 underline",onClick:()=>N(!0),children:"Replace"})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("label",{htmlFor:"insert-key",className:"text-sm font-medium text-gray-300",children:"Insert key · sends test events"}),(0,t.jsx)("p",{id:"insert-key-help",className:"text-xs text-gray-400",children:'Only needed for the test button and custom events. Different from the User key. Create it as type "Ingest - License".'}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Input,{id:"insert-key","aria-describedby":"insert-key-help",type:"password",autoComplete:"off",spellCheck:!1,placeholder:"Ingest - License key",value:x,onChange:e=>m(e.target.value),className:"bg-[#0f1419] border-[#2d3748] text-gray-200 font-mono text-xs"}),(0,t.jsx)(n.Button,{onClick:k,disabled:f||!x.trim(),children:"Save"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(n.Button,{onClick:j,disabled:f||!e?.insertKeySet,children:"Send test event"}),!e?.insertKeySet&&(0,t.jsx)("span",{className:"text-sm text-gray-400",children:"Add an Insert key first"}),g&&(0,t.jsx)("span",{"aria-live":"polite",className:`text-sm ${g.ok?"text-[#3ee0a1]":"text-[#f87171]"}`,children:g.text})]})]})]}),v&&(0,t.jsx)(a.Card,{className:c,children:(0,t.jsxs)(a.CardContent,{className:"p-4 text-sm text-[#f87171] border-l-2 border-[#f87171]",children:[(0,t.jsx)("strong",{children:"Snippet 1 runs in the browser, so its key is public."})," Use the ",(0,t.jsx)("strong",{children:"Ingest - Browser"})," key (starts ",(0,t.jsx)("span",{className:"font-mono",children:"NRJS-"}),"), never your ",(0,t.jsx)("span",{className:"font-mono",children:"NRAK-"})," User key from Setup - that one would hand every visitor full read/write access to your account. The application ID is also not your account ID."]})}),v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{n:1,title:"1. New Relic Browser agent",help:"Gives page views, load timing and Core Web Vitals. Create the Browser app in New Relic first (Add data > Browser monitoring) - that is where the NRJS- key and the application ID come from.",code:(({accountId:e,applicationId:t,browserKey:s}={})=>`// Step 0 - create the Browser app first: New Relic > Add data > Browser monitoring.
18
+ // Without it there is no ingest key and no application ID to copy.
19
+ // That page gives you both:
20
+ // ingest key starts with NRJS- (NOT your NRAK- User API key from Setup)
21
+ // application ID a plain number (NOT your account ID - they look identical)
22
+ // Copy the key VALUE, not the ID shown beside it in the key list: an ID is
23
+ // accepted by the form but rejected by the beacon, and nothing is logged.
24
+ // npm i @newrelic/browser-agent
25
+
26
+ // .env.local - NEXT_PUBLIC_* values are inlined into your public JavaScript.
27
+ // Only the NRJS- ingest key belongs here. An NRAK- User key would be published
28
+ // to every visitor as a full-account read/write credential.
29
+ // NEXT_PUBLIC_NEWRELIC_BROWSER_KEY=${s??"NRJS-xxxxxxxxxxxxxxxxxxx"}
30
+ // NEXT_PUBLIC_NEWRELIC_APP_ID=${t??"123456789"}
31
+ // NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID=${e??"1234567"}
32
+
33
+ // newrelic.ts
34
+ import { BrowserAgent } from '@newrelic/browser-agent/loaders/browser-agent';
35
+
36
+ const licenseKey = process.env.NEXT_PUBLIC_NEWRELIC_BROWSER_KEY!;
37
+ const applicationID = process.env.NEXT_PUBLIC_NEWRELIC_APP_ID!;
38
+ const accountID = process.env.NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID!;
39
+
40
+ let agent: BrowserAgent | undefined;
41
+
42
+ // Never construct at import time: the agent touches window, so a module-level
43
+ // \`export const agent = new BrowserAgent(...)\` fails \`next build\` on any
44
+ // prerendered route - TypeError: Cannot create property 'NREUM' on boolean 'false'.
45
+ export function startAgent() {
46
+ agent ??= new BrowserAgent({
47
+ init: { distributed_tracing: { enabled: true }, privacy: { cookies_enabled: true } },
48
+ info: { beacon: 'bam.nr-data.net', errorBeacon: 'bam.nr-data.net', licenseKey, applicationID, sa: 1 },
49
+ loader_config: { accountID, trustKey: accountID, agentID: applicationID, licenseKey, applicationID },
50
+ });
51
+ return agent;
52
+ }
53
+
54
+ export const getAgent = () => agent;
55
+
56
+ // app/newrelic-agent.tsx - render <NewRelicAgent /> once in app/layout.tsx.
57
+ 'use client';
58
+ import { useEffect } from 'react';
59
+
60
+ export function NewRelicAgent() {
61
+ // Dynamic import keeps the agent out of the server bundle entirely.
62
+ useEffect(() => { import('./newrelic').then(m => m.startAgent()); }, []);
63
+ return null;
64
+ }
65
+ // That alone gives you PageView, load timing, Core Web Vitals and JS errors.`)({accountId:e?.accountId,applicationId:e?.setup?.applicationId,browserKey:e?.setup?.browserKey})}),(0,t.jsx)(d,{n:2,title:"2. emitMetric() helper",help:"Send your own numbers from your site. Uses the agent from snippet 1, so no key goes in your code.",code:o})]}),I&&(0,t.jsx)(d,{n:v?3:1,title:`${v?3:1}. Sentry errors and web vitals`,help:"Send JavaScript errors, page loads and web vitals to Sentry. Call it once, before anything else on your site runs. Use your project's DSN.",code:l}),(0,t.jsx)(a.Card,{className:c,children:(0,t.jsxs)(a.CardHeader,{children:[(0,t.jsxs)(a.CardTitle,{className:"text-base font-bold text-white",children:[S,". Verify"]}),(0,t.jsx)(a.CardDescription,{className:"text-sm text-gray-400",children:v?(0,t.jsx)(t.Fragment,{children:'Reload your site, then watch "Events received" above turn green. Use Send test event to check the custom-event path.'}):(0,t.jsx)(t.Fragment,{children:'Cause an error on your site, then watch "Sentry errors" above turn green.'})})]})})]})}],29821)},70065,e=>{"use strict";var t=e.i(40798),s=e.i(28603);e.s(["Card",0,function({className:e,size:r="default",...a}){return(0,t.jsx)("div",{"data-slot":"card","data-size":r,className:(0,s.cn)("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...a})},"CardContent",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-(--card-spacing)",e),...r})},"CardDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-sm text-muted-foreground",e),...r})},"CardHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...r})},"CardTitle",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...r})}])},91153,e=>{"use strict";var t=e.i(96341);let s=(...e)=>e.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim(),r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},a=(0,t.createContext)({}),n=(0,t.forwardRef)(({color:e,size:n,width:i,height:o,strokeWidth:l,absoluteStrokeWidth:c,nonScalingStroke:d,className:h="",children:u,iconNode:p=[],icon:x={node:p,aliases:[],size:24},...m},g)=>{let{size:y=24,strokeWidth:f=2,absoluteStrokeWidth:b=!1,nonScalingStroke:w=!1,color:N="currentColor",className:C=""}=(0,t.useContext)(a)??{},k=!!u||(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(m),[j,v,I=[]]=function(e,t={}){return function(e,t={}){let a=t.attributeNames??{},n=e=>a[e]??e,i=e.size??e.width??r.width,o=e.size??e.height??r.height,l=e.aliases?.filter(e=>"string"==typeof e&&""!==e.trim()).map(e=>`lucide-${e}`)??[],c=[...e.name?[`lucide-${e.name}`]:[],...l],d=t.className?.split(" ").filter(Boolean)??[],h=!1===t.includeDefaultClasses?s(...d):s("lucide",...c,...d),u=t.absoluteStrokeWidth?Number(t.strokeWidth??r["stroke-width"])*Number(e.size??e.width??r.width)/Number(t.size??t.width??r.width):t.strokeWidth??r["stroke-width"];return["svg",{...Object.entries(r).reduce((e,[t,s])=>(e[n(t)]=s,e),{}),..."color"in t&&t.color&&{[n("stroke")]:t.color},..."size"in t&&null!=t.size&&{[n("width")]:t.size,[n("height")]:t.size},..."width"in t&&null!=t.width&&{[n("width")]:t.width},..."height"in t&&null!=t.height&&{[n("height")]:t.height},[n("stroke-width")]:u,...h&&{[n("class")]:h},[n("viewBox")]:`0 0 ${i} ${o}`,...!1===t.hasA11yProp?{[n("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(e=>{let[s,r,a]=e,i=t.nonScalingStroke?{[n("vector-effect")]:"non-scaling-stroke",...r}:r;return a?[s,i,a]:[s,i]})]}(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(x,{color:e??N,width:i??n??y,height:o??n??y,strokeWidth:l??f,absoluteStrokeWidth:c??b,nonScalingStroke:d??w,className:s(C,h),hasA11yProp:k,attributes:m});return(0,t.createElement)(j,{ref:g,...v},[...I.map(([e,s])=>(0,t.createElement)(e,s)),...Array.isArray(u)?u:[u]])});e.s(["default",0,n],91153)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24851,e=>{"use strict";var t=e.i(40798),a=e.i(3547),r=e.i(70065),s=e.i(67881);e.s(["EmptyState",0,function({title:e="No data yet",reason:i="Keys work, but no page events have arrived.",href:l="/connect",cta:n="Send your first events",onRetry:d}){return(0,t.jsx)(r.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md",children:(0,t.jsxs)(r.CardContent,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-white",children:e}),(0,t.jsx)("p",{className:"max-w-md text-sm text-gray-400",children:i}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(a.default,{href:l,className:(0,s.buttonVariants)(),children:n}),d&&(0,t.jsx)(s.Button,{variant:"outline",onClick:d,children:"Retry"})]})]})})}])},98537,e=>{"use strict";var t=e.i(40798),a=e.i(19085),r=e.i(47627),s=e.i(70065),i=e.i(71428),l=e.i(24851),n=e.i(78320),d=e.i(93834);e.s(["ToolInsights",0,function({tool:e}){let{state:o,retry:c}=(0,n.useMetrics)(),h=(0,a.useRouter)(),{label:u,stats:m,columns:x}=d.TOOLS[e];if("loading"===o.status)return(0,t.jsx)(i.Skeleton,{className:"mt-6 h-64 w-full bg-[#2d3748]"});if("error"===o.status)return(0,t.jsx)(l.EmptyState,{title:"Could not load metrics",reason:o.message,onRetry:c});if(!o.configured)return(0,t.jsx)(l.EmptyState,{title:"Connect your data",reason:"Add your New Relic or Sentry keys to see real numbers.",href:"/setup",cta:"Set up keys"});if(!o.tools.includes("new-relic"))return(0,t.jsx)(l.EmptyState,{...n.NEEDS_NEW_RELIC});if(o.failed.includes(e))return(0,t.jsx)(l.EmptyState,{title:`Could not load ${u} data`,reason:"The request failed. Your other data is unaffected.",onRetry:c});let g=o.pages.filter(n.hasData);return g.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-4 mb-8 mt-4",children:m(g).map(e=>(0,t.jsx)(s.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md",children:(0,t.jsxs)(s.CardContent,{className:"p-6",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-400",children:e.label}),(0,t.jsx)("div",{className:"mt-4 truncate text-3xl font-bold text-white tracking-tight",children:e.value})]})},e.label))}),(0,t.jsxs)(s.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md flex-1",children:[(0,t.jsx)(s.CardHeader,{children:(0,t.jsxs)(s.CardTitle,{className:"text-[18px] font-bold text-white tracking-tight",children:[u," by Page"]})}),(0,t.jsx)(s.CardContent,{children:(0,t.jsx)("div",{className:"rounded-md border border-[#2d3748] overflow-hidden",children:(0,t.jsxs)(r.Table,{children:[(0,t.jsx)(r.TableHeader,{className:"bg-[#0f1419]",children:(0,t.jsxs)(r.TableRow,{className:"border-[#2d3748] hover:bg-transparent",children:[(0,t.jsx)(r.TableHead,{className:"text-gray-400",children:"Page Name"}),(0,t.jsx)(r.TableHead,{className:"text-gray-400",children:"Path"}),x.map(e=>(0,t.jsx)(r.TableHead,{className:"text-gray-400",children:e.header},e.header))]})}),(0,t.jsx)(r.TableBody,{children:o.pages.map(e=>(0,t.jsxs)(r.TableRow,{className:"border-[#2d3748] hover:bg-white/5 transition-colors cursor-pointer",onClick:()=>h.push(`/performance/${e.slug}`),children:[(0,t.jsx)(r.TableCell,{className:"font-medium text-white",children:e.name}),(0,t.jsx)(r.TableCell,{className:"text-gray-500 font-mono text-xs",children:e.url}),x.map(a=>(0,t.jsx)(r.TableCell,{className:"max-w-[320px] truncate text-gray-400",children:(0,n.hasData)(e)?a.cell(e):"—"},a.header))]},e.slug))})]})})})]})]}):(0,t.jsx)(l.EmptyState,{})}])},70065,e=>{"use strict";var t=e.i(40798),a=e.i(28603);e.s(["Card",0,function({className:e,size:r="default",...s}){return(0,t.jsx)("div",{"data-slot":"card","data-size":r,className:(0,a.cn)("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...s})},"CardContent",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-(--card-spacing)",e),...r})},"CardDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,a.cn)("text-sm text-muted-foreground",e),...r})},"CardHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...r})},"CardTitle",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,a.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...r})}])},47627,e=>{"use strict";var t=e.i(40798),a=e.i(28603);e.s(["Table",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,t.jsx)("table",{"data-slot":"table",className:(0,a.cn)("w-full caption-bottom text-sm",e),...r})})},"TableBody",0,function({className:e,...r}){return(0,t.jsx)("tbody",{"data-slot":"table-body",className:(0,a.cn)("[&_tr:last-child]:border-0",e),...r})},"TableCell",0,function({className:e,...r}){return(0,t.jsx)("td",{"data-slot":"table-cell",className:(0,a.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...r})},"TableHead",0,function({className:e,...r}){return(0,t.jsx)("th",{"data-slot":"table-head",className:(0,a.cn)("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",e),...r})},"TableHeader",0,function({className:e,...r}){return(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,a.cn)("[&_tr]:border-b",e),...r})},"TableRow",0,function({className:e,...r}){return(0,t.jsx)("tr",{"data-slot":"table-row",className:(0,a.cn)("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...r})}])},91153,e=>{"use strict";var t=e.i(96341);let a=(...e)=>e.filter((e,t,a)=>!!e&&""!==e.trim()&&a.indexOf(e)===t).join(" ").trim(),r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},s=(0,t.createContext)({}),i=(0,t.forwardRef)(({color:e,size:i,width:l,height:n,strokeWidth:d,absoluteStrokeWidth:o,nonScalingStroke:c,className:h="",children:u,iconNode:m=[],icon:x={node:m,aliases:[],size:24},...g},b)=>{let{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:w=!1,nonScalingStroke:j=!1,color:N="currentColor",className:v=""}=(0,t.useContext)(s)??{},y=!!u||(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(g),[k,C,T=[]]=function(e,t={}){return function(e,t={}){let s=t.attributeNames??{},i=e=>s[e]??e,l=e.size??e.width??r.width,n=e.size??e.height??r.height,d=e.aliases?.filter(e=>"string"==typeof e&&""!==e.trim()).map(e=>`lucide-${e}`)??[],o=[...e.name?[`lucide-${e.name}`]:[],...d],c=t.className?.split(" ").filter(Boolean)??[],h=!1===t.includeDefaultClasses?a(...c):a("lucide",...o,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??r["stroke-width"])*Number(e.size??e.width??r.width)/Number(t.size??t.width??r.width):t.strokeWidth??r["stroke-width"];return["svg",{...Object.entries(r).reduce((e,[t,a])=>(e[i(t)]=a,e),{}),..."color"in t&&t.color&&{[i("stroke")]:t.color},..."size"in t&&null!=t.size&&{[i("width")]:t.size,[i("height")]:t.size},..."width"in t&&null!=t.width&&{[i("width")]:t.width},..."height"in t&&null!=t.height&&{[i("height")]:t.height},[i("stroke-width")]:u,...h&&{[i("class")]:h},[i("viewBox")]:`0 0 ${l} ${n}`,...!1===t.hasA11yProp?{[i("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(e=>{let[a,r,s]=e,l=t.nonScalingStroke?{[i("vector-effect")]:"non-scaling-stroke",...r}:r;return s?[a,l,s]:[a,l]})]}(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(x,{color:e??N,width:l??i??f,height:n??i??f,strokeWidth:d??p,absoluteStrokeWidth:o??w,nonScalingStroke:c??j,className:a(v,h),hasA11yProp:y,attributes:g});return(0,t.createElement)(k,{ref:b,...C},[...T.map(([e,a])=>(0,t.createElement)(e,a)),...Array.isArray(u)?u:[u]])});e.s(["default",0,i],91153)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,55370,e=>{"use strict";var t=e.i(40798),a=e.i(96341),r=e.i(70065),s=e.i(67881),i=e.i(23750);let n=[{id:"gemini",label:"Google Gemini",help:"Create a key at aistudio.google.com/apikey."},{id:"claude",label:"Anthropic Claude",help:"Create a key at console.anthropic.com > API keys."},{id:"openai",label:"OpenAI",help:"Create a key at platform.openai.com/api-keys."}];e.s(["AiKeyForm",0,function(){let[e,o]=(0,a.useState)(n[0].id),[l,d]=(0,a.useState)(""),[c,h]=(0,a.useState)(null),[u,m]=(0,a.useState)({}),[p,x]=(0,a.useState)(null),[g,f]=(0,a.useState)(!1);async function b(t){t.preventDefault(),f(!0),x(null);try{let t=await fetch("/api/setup/ai",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,key:l})}),a=await t.json();a.saved?(d(""),h(e),m({...u,[e]:!0}),x({ok:!0,text:"Saved. AI suggestions now use this provider. No restart needed."})):x({ok:!1,text:a.error??"Nothing was saved."})}catch{x({ok:!1,text:"Could not reach the dashboard server."})}finally{f(!1)}}(0,a.useEffect)(()=>{fetch("/api/setup/ai").then(e=>e.json()).then(e=>{e.keys&&(m(e.keys),h(e.provider),e.provider&&o(e.provider))}).catch(()=>{})},[]);let v=n.find(t=>t.id===e);return(0,t.jsxs)(r.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md max-w-2xl mt-6",children:[(0,t.jsxs)(r.CardHeader,{children:[(0,t.jsx)(r.CardTitle,{className:"text-[18px] font-bold text-white tracking-tight",children:"AI suggestions (optional)"}),(0,t.jsx)(r.CardDescription,{className:"text-sm text-gray-400",children:"Add a Gemini, Claude or OpenAI key to get AI insights and recommendations for your pages. Only page names, load times and error counts are sent to the provider you pick. Without a key, the dashboard shows sample suggestions."})]}),(0,t.jsx)(r.CardContent,{children:(0,t.jsxs)("form",{onSubmit:b,className:"flex flex-col gap-5",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("label",{htmlFor:"ai-provider",className:"text-sm font-medium text-gray-300",children:"Provider"}),(0,t.jsx)("select",{id:"ai-provider",value:e,onChange:e=>o(e.target.value),className:"h-9 rounded-md border border-[#2d3748] bg-[#0f1419] px-3 text-sm text-gray-200",children:n.map(e=>(0,t.jsxs)("option",{value:e.id,children:[e.label,c===e.id?" (in use)":u[e.id]?" (key saved)":""]},e.id))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("label",{htmlFor:"ai-key",className:"text-sm font-medium text-gray-300",children:[v.label," API key ",u[e]&&(0,t.jsx)("span",{className:"ml-2 text-xs text-[#3ee0a1]",children:"✓ Set"})]}),(0,t.jsx)(i.Input,{id:"ai-key",type:"password",autoComplete:"off",spellCheck:!1,placeholder:u[e]?"•••••••• (type to replace)":"",value:l,onChange:e=>d(e.target.value),"aria-describedby":"ai-key-help",className:"bg-[#0f1419] border-[#2d3748] text-gray-200 font-mono text-xs"}),(0,t.jsx)("p",{id:"ai-key-help",className:"text-xs text-gray-400",children:v.help})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(s.Button,{type:"submit",disabled:g||!l.trim(),children:g?"Checking…":"Check and save"}),(0,t.jsx)("span",{"aria-live":"polite",className:`text-sm ${p?.ok?"text-[#3ee0a1]":"text-[#f87171]"}`,children:p?.text})]})]})})]})}])},4603,e=>{"use strict";var t=e.i(40798),a=e.i(96341),r=e.i(3547),s=e.i(70065),i=e.i(67881),n=e.i(23750),o=e.i(94179),l=e.i(93834);let d=[{name:"NEWRELIC_API_KEY",tool:"new-relic",label:l.KEY_LABELS.NEWRELIC_API_KEY,secret:!0,help:'READS your data (starts NRAK-). Create it under API keys > key type "User".'},{name:"NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID",tool:"new-relic",label:l.KEY_LABELS.NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID,secret:!1,help:"A plain number, shown next to your keys in New Relic."},{name:"SENTRY_API_KEY",tool:"sentry",label:l.KEY_LABELS.SENTRY_API_KEY,secret:!0,help:"Lets the dashboard read issues (scopes: project:read, event:read)."},{name:"SENTRY_DSN",tool:"sentry",label:l.KEY_LABELS.SENTRY_DSN,secret:!1,help:"Project settings, then Client Keys (DSN). The project and host are read from it."}];e.s(["SetupForm",0,function(){let[e,c]=(0,a.useState)({}),[h,u]=(0,a.useState)({}),[m,p]=(0,a.useState)({}),[x,g]=(0,a.useState)(null),[f,b]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),[k,N]=(0,a.useState)(null),j=(0,a.useRef)(null);async function C(t){t.preventDefault(),b(!0),g(null);try{let t=await fetch("/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json(),r=a.results??{};p(r);let s=d.find(e=>r[e.name]&&!r[e.name].ok);if(s&&setTimeout(()=>j.current?.querySelector(`#${s.name}`)?.focus(),0),a.saved){y(!0),c({});let t=new Set(d.filter(t=>e[t.name]?.trim()).map(e=>e.tool));u(e=>({...e,...Object.fromEntries(d.filter(e=>t.has(e.tool)).map(e=>[e.name,!0]))}));let a=l.TOOL_IDS.filter(e=>t.has(e)||k?.includes(e));N(a),g({ok:!0,text:`Saved. ${a.map(e=>l.TOOLS[e].label).join(" and ")} ${a.length>1?"are":"is"} connected. No restart needed.`})}else g({ok:!1,text:a.error??"Nothing was saved. Fix the fields marked below."})}catch{g({ok:!1,text:"Could not reach the dashboard server."})}finally{b(!1)}}return(0,a.useEffect)(()=>{fetch("/api/setup").then(e=>e.json()).then(e=>{e.keys&&u(e.keys),Array.isArray(e.tools)?N(e.tools):e.error&&g({ok:!1,text:e.error})}).catch(()=>{})},[]),(0,t.jsxs)(s.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md max-w-2xl",children:[(0,t.jsxs)(s.CardHeader,{children:[(0,t.jsx)(s.CardTitle,{className:"text-[18px] font-bold text-white tracking-tight",children:"Connect your tools"}),(0,t.jsx)(s.CardDescription,{className:"text-sm text-gray-400",children:"Add keys for the tools you use. You only need one. Keys are checked once, saved to .env.local in this folder, and never shown again."})]}),(0,t.jsx)(s.CardContent,{children:(0,t.jsxs)("form",{ref:j,onSubmit:C,className:"flex flex-col gap-5",children:[l.TOOL_IDS.map(a=>(0,t.jsxs)("fieldset",{id:a,className:"flex flex-col gap-5 rounded-lg border border-[#2d3748] p-4",children:[(0,t.jsxs)("legend",{className:"flex items-center gap-2 px-2 text-sm font-semibold text-white",children:[l.TOOLS[a].label,k?.includes(a)?(0,t.jsx)(o.Badge,{variant:"outline",className:"border-[#3ee0a1] text-[#3ee0a1] bg-[#3ee0a1]/10",children:"✓ Connected"}):(0,t.jsx)(o.Badge,{variant:"outline",className:"border-[#4a5568] text-gray-400",children:"Optional"})]}),d.filter(e=>e.tool===a).map(a=>{let r=m[a.name];return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("label",{htmlFor:a.name,className:"text-sm font-medium text-gray-300",children:[a.label," ",h[a.name]&&(0,t.jsx)("span",{className:"ml-2 text-xs text-[#3ee0a1]",children:"✓ Set"})]}),(0,t.jsx)(n.Input,{id:a.name,name:a.name,type:a.secret?"password":"text",autoComplete:"off",spellCheck:!1,placeholder:h[a.name]?"•••••••• (leave blank to keep, type to replace)":"",value:e[a.name]??"",onChange:t=>c({...e,[a.name]:t.target.value}),"aria-invalid":!!r&&!r.ok||void 0,"aria-describedby":`${a.name}-help ${a.name}-result`,className:"bg-[#0f1419] border-[#2d3748] text-gray-200 font-mono text-xs"}),(0,t.jsx)("p",{id:`${a.name}-help`,className:"text-xs text-gray-400",children:a.help}),(0,t.jsxs)("div",{id:`${a.name}-result`,"aria-live":"polite",children:[r&&!r.ok&&(0,t.jsxs)("p",{className:"text-xs text-[#f87171]",children:["✗ ",r.error]}),r?.ok&&(0,t.jsx)("p",{className:"text-xs text-[#3ee0a1]",children:"✓ Checked"})]})]},a.name)}),"new-relic"===a&&(0,t.jsx)("p",{className:"text-xs text-gray-400",children:"The key that sends events (Ingest - License) is separate and is added later on the Connect page."})]},a)),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(i.Button,{type:"submit",disabled:f||!d.some(t=>e[t.name]?.trim()),children:f?"Checking…":"Check and save"}),(0,t.jsx)("span",{"aria-live":"polite",className:`text-sm ${x?.ok?"text-[#3ee0a1]":"text-[#f87171]"}`,children:x?.text}),!d.some(t=>e[t.name]?.trim())&&!x&&!v&&(0,t.jsx)("span",{className:"text-sm text-gray-400",children:k?.length?"Type a new key to change what is saved.":"Fill in both fields for at least one tool."}),v&&(0,t.jsx)(r.default,{href:"/connect",className:(0,i.buttonVariants)({variant:"outline"}),children:"Next: connect your app"})]})]})})]})}])},94179,e=>{"use strict";var t=e.i(46987),a=e.i(10063),r=e.i(94237),s=e.i(28603);let i=(0,r.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",render:n,...o}){return(0,a.useRender)({defaultTagName:"span",props:(0,t.mergeProps)({className:(0,s.cn)(i({variant:r}),e)},o),render:n,state:{slot:"badge",variant:r}})}])},70065,e=>{"use strict";var t=e.i(40798),a=e.i(28603);e.s(["Card",0,function({className:e,size:r="default",...s}){return(0,t.jsx)("div",{"data-slot":"card","data-size":r,className:(0,a.cn)("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...s})},"CardContent",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-(--card-spacing)",e),...r})},"CardDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,a.cn)("text-sm text-muted-foreground",e),...r})},"CardHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...r})},"CardTitle",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,a.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...r})}])},91153,e=>{"use strict";var t=e.i(96341);let a=(...e)=>e.filter((e,t,a)=>!!e&&""!==e.trim()&&a.indexOf(e)===t).join(" ").trim(),r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},s=(0,t.createContext)({}),i=(0,t.forwardRef)(({color:e,size:i,width:n,height:o,strokeWidth:l,absoluteStrokeWidth:d,nonScalingStroke:c,className:h="",children:u,iconNode:m=[],icon:p={node:m,aliases:[],size:24},...x},g)=>{let{size:f=24,strokeWidth:b=2,absoluteStrokeWidth:v=!1,nonScalingStroke:y=!1,color:k="currentColor",className:N=""}=(0,t.useContext)(s)??{},j=!!u||(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(x),[C,w,S=[]]=function(e,t={}){return function(e,t={}){let s=t.attributeNames??{},i=e=>s[e]??e,n=e.size??e.width??r.width,o=e.size??e.height??r.height,l=e.aliases?.filter(e=>"string"==typeof e&&""!==e.trim()).map(e=>`lucide-${e}`)??[],d=[...e.name?[`lucide-${e.name}`]:[],...l],c=t.className?.split(" ").filter(Boolean)??[],h=!1===t.includeDefaultClasses?a(...c):a("lucide",...d,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??r["stroke-width"])*Number(e.size??e.width??r.width)/Number(t.size??t.width??r.width):t.strokeWidth??r["stroke-width"];return["svg",{...Object.entries(r).reduce((e,[t,a])=>(e[i(t)]=a,e),{}),..."color"in t&&t.color&&{[i("stroke")]:t.color},..."size"in t&&null!=t.size&&{[i("width")]:t.size,[i("height")]:t.size},..."width"in t&&null!=t.width&&{[i("width")]:t.width},..."height"in t&&null!=t.height&&{[i("height")]:t.height},[i("stroke-width")]:u,...h&&{[i("class")]:h},[i("viewBox")]:`0 0 ${n} ${o}`,...!1===t.hasA11yProp?{[i("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(e=>{let[a,r,s]=e,n=t.nonScalingStroke?{[i("vector-effect")]:"non-scaling-stroke",...r}:r;return s?[a,n,s]:[a,n]})]}(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(p,{color:e??k,width:n??i??f,height:o??i??f,strokeWidth:l??b,absoluteStrokeWidth:d??v,nonScalingStroke:c??y,className:a(N,h),hasA11yProp:j,attributes:x});return(0,t.createElement)(C,{ref:g,...w},[...S.map(([e,a])=>(0,t.createElement)(e,a)),...Array.isArray(u)?u:[u]])});e.s(["default",0,i],91153)}]);
package/.next/trace CHANGED
@@ -1 +1 @@
1
- [{"name":"generate-buildid","duration":233,"timestamp":205980268582,"id":4,"parentId":1,"tags":{},"startTime":1791147676508,"traceId":"838348af54d5acd7"},{"name":"load-custom-routes","duration":416,"timestamp":205980268932,"id":5,"parentId":1,"tags":{},"startTime":1791147676509,"traceId":"838348af54d5acd7"},{"name":"create-dist-dir","duration":194,"timestamp":205980269377,"id":6,"parentId":1,"tags":{},"startTime":1791147676509,"traceId":"838348af54d5acd7"},{"name":"clean","duration":61343,"timestamp":205980270297,"id":7,"parentId":1,"tags":{},"startTime":1791147676510,"traceId":"838348af54d5acd7"},{"name":"discover-routes","duration":5699,"timestamp":205980340682,"id":8,"parentId":1,"tags":{},"startTime":1791147676580,"traceId":"838348af54d5acd7"},{"name":"create-root-mapping","duration":66,"timestamp":205980346417,"id":9,"parentId":1,"tags":{},"startTime":1791147676586,"traceId":"838348af54d5acd7"},{"name":"generate-route-types","duration":16175,"timestamp":205980347810,"id":10,"parentId":1,"tags":{},"startTime":1791147676587,"traceId":"838348af54d5acd7"},{"name":"public-dir-conflict-check","duration":86,"timestamp":205980364041,"id":11,"parentId":1,"tags":{},"startTime":1791147676604,"traceId":"838348af54d5acd7"},{"name":"generate-routes-manifest","duration":2456,"timestamp":205980364214,"id":12,"parentId":1,"tags":{},"startTime":1791147676604,"traceId":"838348af54d5acd7"},{"name":"run-turbopack","duration":2178694,"timestamp":205980375043,"id":14,"parentId":1,"tags":{},"startTime":1791147676615,"traceId":"838348af54d5acd7"},{"name":"turbopack-build-events","duration":69,"timestamp":205980680547,"id":15,"parentId":1,"tags":{},"startTime":1791147676920,"traceId":"838348af54d5acd7"},{"name":"turbopack-persistence","duration":137000,"timestamp":205982016049,"id":16,"parentId":15,"tags":{"reason":"stop","snapshot_duration_ms":2.985888,"persist_duration_ms":134.05124700000002,"task_count":2772,"bytes_written":1614073,"bytes_deleted":0},"startTime":1791147678392,"traceId":"838348af54d5acd7"},{"name":"run-typescript","duration":2484161,"timestamp":205982557611,"id":18,"parentId":1,"tags":{},"startTime":1791147678795,"traceId":"838348af54d5acd7"},{"name":"generate-required-server-files","duration":621,"timestamp":205985042281,"id":20,"parentId":1,"tags":{},"startTime":1791147681278,"traceId":"838348af54d5acd7"},{"name":"check-static-error-page","duration":5992,"timestamp":205985057679,"id":22,"parentId":21,"tags":{},"startTime":1791147681294,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":977540,"timestamp":205985064892,"id":42,"parentId":24,"tags":{},"startTime":1791147681301,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":982782,"timestamp":205985059713,"id":24,"parentId":21,"tags":{"page":"/_global-error"},"startTime":1791147681296,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1134319,"timestamp":205985065289,"id":50,"parentId":32,"tags":{},"startTime":1791147681301,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1138454,"timestamp":205985061198,"id":32,"parentId":21,"tags":{"page":"/api/timings"},"startTime":1791147681297,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1211500,"timestamp":205985064661,"id":41,"parentId":23,"tags":{},"startTime":1791147681301,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1217804,"timestamp":205985058400,"id":23,"parentId":21,"tags":{"page":"/_not-found"},"startTime":1791147681295,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1211680,"timestamp":205985070401,"id":54,"parentId":37,"tags":{},"startTime":1791147681307,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1218777,"timestamp":205985063346,"id":37,"parentId":21,"tags":{"page":"/performance"},"startTime":1791147681299,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1229747,"timestamp":205985065036,"id":45,"parentId":27,"tags":{},"startTime":1791147681301,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1234687,"timestamp":205985060142,"id":27,"parentId":21,"tags":{"page":"/api/health"},"startTime":1791147681296,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1248121,"timestamp":205985065335,"id":51,"parentId":34,"tags":{},"startTime":1791147681301,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1252056,"timestamp":205985061449,"id":34,"parentId":21,"tags":{"page":"/icon.svg"},"startTime":1791147681298,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1243207,"timestamp":205985070389,"id":53,"parentId":35,"tags":{},"startTime":1791147681307,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1252068,"timestamp":205985061546,"id":35,"parentId":21,"tags":{"page":"/"},"startTime":1791147681298,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1250545,"timestamp":205985065184,"id":48,"parentId":30,"tags":{},"startTime":1791147681301,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1255378,"timestamp":205985060396,"id":30,"parentId":21,"tags":{"page":"/api/setup/ai"},"startTime":1791147681297,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1246760,"timestamp":205985070370,"id":52,"parentId":33,"tags":{},"startTime":1791147681306,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1255839,"timestamp":205985061328,"id":33,"parentId":21,"tags":{"page":"/connect"},"startTime":1791147681297,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1249906,"timestamp":205985070408,"id":55,"parentId":38,"tags":{},"startTime":1791147681307,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1256921,"timestamp":205985063439,"id":38,"parentId":21,"tags":{"page":"/settings"},"startTime":1791147681300,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1263623,"timestamp":205985064996,"id":44,"parentId":26,"tags":{},"startTime":1791147681301,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1268600,"timestamp":205985060048,"id":26,"parentId":21,"tags":{"page":"/api/connect"},"startTime":1791147681296,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1266156,"timestamp":205985065129,"id":47,"parentId":29,"tags":{},"startTime":1791147681301,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1270998,"timestamp":205985060321,"id":29,"parentId":21,"tags":{"page":"/api/settings"},"startTime":1791147681296,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1266349,"timestamp":205985065077,"id":46,"parentId":28,"tags":{},"startTime":1791147681301,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1271204,"timestamp":205985060238,"id":28,"parentId":21,"tags":{"page":"/api/metrics"},"startTime":1791147681296,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1268703,"timestamp":205985064949,"id":43,"parentId":25,"tags":{},"startTime":1791147681301,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1273727,"timestamp":205985059944,"id":25,"parentId":21,"tags":{"page":"/api/analyze"},"startTime":1791147681296,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1271904,"timestamp":205985065243,"id":49,"parentId":31,"tags":{},"startTime":1791147681301,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1276694,"timestamp":205985060478,"id":31,"parentId":21,"tags":{"page":"/api/setup"},"startTime":1791147681297,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1280021,"timestamp":205985070414,"id":56,"parentId":39,"tags":{},"startTime":1791147681307,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1286954,"timestamp":205985063523,"id":39,"parentId":21,"tags":{"page":"/setup"},"startTime":1791147681300,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1291190,"timestamp":205985070424,"id":58,"parentId":36,"tags":{},"startTime":1791147681307,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1299975,"timestamp":205985061671,"id":36,"parentId":21,"tags":{"page":"/performance/[slug]"},"startTime":1791147681298,"traceId":"838348af54d5acd7"},{"name":"is-page-static","duration":1297969,"timestamp":205985070419,"id":57,"parentId":40,"tags":{},"startTime":1791147681307,"traceId":"838348af54d5acd7"},{"name":"check-page","duration":1304811,"timestamp":205985063595,"id":40,"parentId":21,"tags":{"page":"/tools/[tool]"},"startTime":1791147681300,"traceId":"838348af54d5acd7"},{"name":"static-check","duration":1311188,"timestamp":205985057238,"id":21,"parentId":1,"tags":{},"startTime":1791147681293,"traceId":"838348af54d5acd7"},{"name":"write-routes-manifest","duration":640,"timestamp":205986369548,"id":60,"parentId":1,"tags":{},"startTime":1791147682605,"traceId":"838348af54d5acd7"},{"name":"load-dotenv","duration":31,"timestamp":205986379712,"id":63,"parentId":62,"tags":{},"startTime":1791147682615,"traceId":"838348af54d5acd7"},{"name":"run-export-path-map","duration":456,"timestamp":205986383437,"id":64,"parentId":62,"tags":{},"startTime":1791147682619,"traceId":"838348af54d5acd7"},{"name":"next-export","duration":541035,"timestamp":205986378887,"id":62,"parentId":1,"tags":{},"startTime":1791147682614,"traceId":"838348af54d5acd7"},{"name":"move-exported-app-not-found-","duration":970,"timestamp":205986922007,"id":65,"parentId":61,"tags":{},"startTime":1791147683157,"traceId":"838348af54d5acd7"},{"name":"move-exported-app-global-error-","duration":561,"timestamp":205986923068,"id":66,"parentId":61,"tags":{},"startTime":1791147683158,"traceId":"838348af54d5acd7"},{"name":"static-generation","duration":551325,"timestamp":205986372845,"id":61,"parentId":1,"tags":{},"startTime":1791147682608,"traceId":"838348af54d5acd7"},{"name":"write-routes-manifest","duration":627,"timestamp":205986924358,"id":67,"parentId":1,"tags":{},"startTime":1791147683159,"traceId":"838348af54d5acd7"},{"name":"print-tree-view","duration":2714,"timestamp":205986990551,"id":68,"parentId":1,"tags":{},"startTime":1791147683226,"traceId":"838348af54d5acd7"},{"name":"write-route-bundle-stats","duration":6782,"timestamp":205986993296,"id":69,"parentId":1,"tags":{},"startTime":1791147683228,"traceId":"838348af54d5acd7"},{"name":"telemetry-flush","duration":427060,"timestamp":205987000093,"id":70,"parentId":1,"tags":{},"startTime":1791147683235,"traceId":"838348af54d5acd7"},{"name":"next-build","duration":7206215,"timestamp":205980220963,"id":1,"tags":{"buildMode":"default","version":"16.3.8","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1791147676461,"traceId":"838348af54d5acd7"}]
1
+ [{"name":"generate-buildid","duration":204,"timestamp":193623907071,"id":4,"parentId":1,"tags":{},"startTime":1791456660203,"traceId":"f6fa64ef3f79a610"},{"name":"load-custom-routes","duration":395,"timestamp":193623907378,"id":5,"parentId":1,"tags":{},"startTime":1791456660203,"traceId":"f6fa64ef3f79a610"},{"name":"create-dist-dir","duration":195,"timestamp":193623907795,"id":6,"parentId":1,"tags":{},"startTime":1791456660203,"traceId":"f6fa64ef3f79a610"},{"name":"clean","duration":69899,"timestamp":193623908658,"id":7,"parentId":1,"tags":{},"startTime":1791456660204,"traceId":"f6fa64ef3f79a610"},{"name":"discover-routes","duration":7379,"timestamp":193623988481,"id":8,"parentId":1,"tags":{},"startTime":1791456660284,"traceId":"f6fa64ef3f79a610"},{"name":"create-root-mapping","duration":62,"timestamp":193623995905,"id":9,"parentId":1,"tags":{},"startTime":1791456660291,"traceId":"f6fa64ef3f79a610"},{"name":"generate-route-types","duration":17796,"timestamp":193623997448,"id":10,"parentId":1,"tags":{},"startTime":1791456660293,"traceId":"f6fa64ef3f79a610"},{"name":"public-dir-conflict-check","duration":85,"timestamp":193624015307,"id":11,"parentId":1,"tags":{},"startTime":1791456660311,"traceId":"f6fa64ef3f79a610"},{"name":"generate-routes-manifest","duration":2593,"timestamp":193624015499,"id":12,"parentId":1,"tags":{},"startTime":1791456660311,"traceId":"f6fa64ef3f79a610"},{"name":"run-turbopack","duration":2495840,"timestamp":193624023259,"id":14,"parentId":1,"tags":{},"startTime":1791456660319,"traceId":"f6fa64ef3f79a610"},{"name":"turbopack-build-events","duration":70,"timestamp":193624394229,"id":15,"parentId":1,"tags":{},"startTime":1791456660690,"traceId":"f6fa64ef3f79a610"},{"name":"turbopack-persistence","duration":126000,"timestamp":193625981910,"id":16,"parentId":15,"tags":{"reason":"stop","snapshot_duration_ms":2.968842,"persist_duration_ms":122.177614,"task_count":991,"bytes_written":973617,"bytes_deleted":0},"startTime":1791456662405,"traceId":"f6fa64ef3f79a610"},{"name":"run-typescript","duration":2984298,"timestamp":193626522554,"id":18,"parentId":1,"tags":{},"startTime":1791456662818,"traceId":"f6fa64ef3f79a610"},{"name":"generate-required-server-files","duration":1018,"timestamp":193629507540,"id":20,"parentId":1,"tags":{},"startTime":1791456665803,"traceId":"f6fa64ef3f79a610"},{"name":"check-static-error-page","duration":18163,"timestamp":193629531729,"id":22,"parentId":21,"tags":{},"startTime":1791456665827,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":950187,"timestamp":193629551690,"id":42,"parentId":24,"tags":{},"startTime":1791456665847,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":965534,"timestamp":193629536466,"id":24,"parentId":21,"tags":{"page":"/_global-error"},"startTime":1791456665832,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1338806,"timestamp":193629566092,"id":52,"parentId":33,"tags":{},"startTime":1791456665862,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1367172,"timestamp":193629537771,"id":33,"parentId":21,"tags":{"page":"/connect"},"startTime":1791456665834,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1343690,"timestamp":193629566117,"id":53,"parentId":35,"tags":{},"startTime":1791456665862,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1371834,"timestamp":193629538019,"id":35,"parentId":21,"tags":{"page":"/"},"startTime":1791456665834,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1359590,"timestamp":193629551384,"id":41,"parentId":23,"tags":{},"startTime":1791456665847,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1376340,"timestamp":193629534672,"id":23,"parentId":21,"tags":{"page":"/_not-found"},"startTime":1791456665830,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1348114,"timestamp":193629566128,"id":54,"parentId":37,"tags":{},"startTime":1791456665862,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1365033,"timestamp":193629549261,"id":37,"parentId":21,"tags":{"page":"/performance"},"startTime":1791456665845,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1351830,"timestamp":193629566143,"id":56,"parentId":39,"tags":{},"startTime":1791456665862,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1368435,"timestamp":193629549583,"id":39,"parentId":21,"tags":{"page":"/setup"},"startTime":1791456665845,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1368259,"timestamp":193629566136,"id":55,"parentId":38,"tags":{},"startTime":1791456665862,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1384977,"timestamp":193629549463,"id":38,"parentId":21,"tags":{"page":"/settings"},"startTime":1791456665845,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1390778,"timestamp":193629552024,"id":47,"parentId":29,"tags":{},"startTime":1791456665848,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1405534,"timestamp":193629537311,"id":29,"parentId":21,"tags":{"page":"/api/settings"},"startTime":1791456665833,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1396528,"timestamp":193629551913,"id":45,"parentId":27,"tags":{},"startTime":1791456665848,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1411446,"timestamp":193629537057,"id":27,"parentId":21,"tags":{"page":"/api/health"},"startTime":1791456665833,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1409299,"timestamp":193629551966,"id":46,"parentId":28,"tags":{},"startTime":1791456665848,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1424134,"timestamp":193629537187,"id":28,"parentId":21,"tags":{"page":"/api/metrics"},"startTime":1791456665833,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1415957,"timestamp":193629552274,"id":50,"parentId":32,"tags":{},"startTime":1791456665848,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1430603,"timestamp":193629537660,"id":32,"parentId":21,"tags":{"page":"/api/timings"},"startTime":1791456665833,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1416537,"timestamp":193629552334,"id":51,"parentId":34,"tags":{},"startTime":1791456665848,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1430982,"timestamp":193629537913,"id":34,"parentId":21,"tags":{"page":"/icon.svg"},"startTime":1791456665834,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1404798,"timestamp":193629566149,"id":57,"parentId":40,"tags":{},"startTime":1791456665862,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1421299,"timestamp":193629549675,"id":40,"parentId":21,"tags":{"page":"/tools/[tool]"},"startTime":1791456665845,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1424350,"timestamp":193629551755,"id":43,"parentId":25,"tags":{},"startTime":1791456665847,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1439353,"timestamp":193629536779,"id":25,"parentId":21,"tags":{"page":"/api/analyze"},"startTime":1791456665833,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1429819,"timestamp":193629566156,"id":58,"parentId":36,"tags":{},"startTime":1791456665862,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1457858,"timestamp":193629538143,"id":36,"parentId":21,"tags":{"page":"/performance/[slug]"},"startTime":1791456665834,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1451647,"timestamp":193629552188,"id":49,"parentId":31,"tags":{},"startTime":1791456665848,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1466336,"timestamp":193629537527,"id":31,"parentId":21,"tags":{"page":"/api/setup"},"startTime":1791456665833,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1455174,"timestamp":193629552117,"id":48,"parentId":30,"tags":{},"startTime":1791456665848,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1469906,"timestamp":193629537419,"id":30,"parentId":21,"tags":{"page":"/api/setup/ai"},"startTime":1791456665833,"traceId":"f6fa64ef3f79a610"},{"name":"is-page-static","duration":1457000,"timestamp":193629551813,"id":44,"parentId":26,"tags":{},"startTime":1791456665848,"traceId":"f6fa64ef3f79a610"},{"name":"check-page","duration":1471917,"timestamp":193629536915,"id":26,"parentId":21,"tags":{"page":"/api/connect"},"startTime":1791456665833,"traceId":"f6fa64ef3f79a610"},{"name":"static-check","duration":1477672,"timestamp":193629531185,"id":21,"parentId":1,"tags":{},"startTime":1791456665827,"traceId":"f6fa64ef3f79a610"},{"name":"write-routes-manifest","duration":635,"timestamp":193631009593,"id":60,"parentId":1,"tags":{},"startTime":1791456667305,"traceId":"f6fa64ef3f79a610"},{"name":"load-dotenv","duration":36,"timestamp":193631020063,"id":63,"parentId":62,"tags":{},"startTime":1791456667316,"traceId":"f6fa64ef3f79a610"},{"name":"run-export-path-map","duration":456,"timestamp":193631021671,"id":64,"parentId":62,"tags":{},"startTime":1791456667317,"traceId":"f6fa64ef3f79a610"},{"name":"next-export","duration":543898,"timestamp":193631019125,"id":62,"parentId":1,"tags":{},"startTime":1791456667315,"traceId":"f6fa64ef3f79a610"},{"name":"move-exported-app-not-found-","duration":780,"timestamp":193631565346,"id":65,"parentId":61,"tags":{},"startTime":1791456667861,"traceId":"f6fa64ef3f79a610"},{"name":"move-exported-app-global-error-","duration":681,"timestamp":193631566193,"id":66,"parentId":61,"tags":{},"startTime":1791456667862,"traceId":"f6fa64ef3f79a610"},{"name":"static-generation","duration":555072,"timestamp":193631012130,"id":61,"parentId":1,"tags":{},"startTime":1791456667308,"traceId":"f6fa64ef3f79a610"},{"name":"write-routes-manifest","duration":315,"timestamp":193631567411,"id":67,"parentId":1,"tags":{},"startTime":1791456667863,"traceId":"f6fa64ef3f79a610"},{"name":"print-tree-view","duration":2865,"timestamp":193631633696,"id":68,"parentId":1,"tags":{},"startTime":1791456667929,"traceId":"f6fa64ef3f79a610"},{"name":"write-route-bundle-stats","duration":6619,"timestamp":193631636578,"id":69,"parentId":1,"tags":{},"startTime":1791456667932,"traceId":"f6fa64ef3f79a610"},{"name":"telemetry-flush","duration":429467,"timestamp":193631643211,"id":70,"parentId":1,"tags":{},"startTime":1791456667939,"traceId":"f6fa64ef3f79a610"},{"name":"next-build","duration":8282344,"timestamp":193623790365,"id":1,"tags":{"buildMode":"default","version":"16.3.8","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1791456660086,"traceId":"f6fa64ef3f79a610"}]
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-turbopack","duration":2178694,"timestamp":205980375043,"id":14,"parentId":1,"tags":{},"startTime":1791147676615,"traceId":"838348af54d5acd7"},{"name":"turbopack-build-events","duration":69,"timestamp":205980680547,"id":15,"parentId":1,"tags":{},"startTime":1791147676920,"traceId":"838348af54d5acd7"},{"name":"turbopack-persistence","duration":137000,"timestamp":205982016049,"id":16,"parentId":15,"tags":{"reason":"stop","snapshot_duration_ms":2.985888,"persist_duration_ms":134.05124700000002,"task_count":2772,"bytes_written":1614073,"bytes_deleted":0},"startTime":1791147678392,"traceId":"838348af54d5acd7"},{"name":"run-typescript","duration":2484161,"timestamp":205982557611,"id":18,"parentId":1,"tags":{},"startTime":1791147678795,"traceId":"838348af54d5acd7"},{"name":"static-check","duration":1311188,"timestamp":205985057238,"id":21,"parentId":1,"tags":{},"startTime":1791147681293,"traceId":"838348af54d5acd7"},{"name":"static-generation","duration":551325,"timestamp":205986372845,"id":61,"parentId":1,"tags":{},"startTime":1791147682608,"traceId":"838348af54d5acd7"},{"name":"telemetry-flush","duration":427060,"timestamp":205987000093,"id":70,"parentId":1,"tags":{},"startTime":1791147683235,"traceId":"838348af54d5acd7"},{"name":"next-build","duration":7206215,"timestamp":205980220963,"id":1,"tags":{"buildMode":"default","version":"16.3.8","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1791147676461,"traceId":"838348af54d5acd7"}]
1
+ [{"name":"run-turbopack","duration":2495840,"timestamp":193624023259,"id":14,"parentId":1,"tags":{},"startTime":1791456660319,"traceId":"f6fa64ef3f79a610"},{"name":"turbopack-build-events","duration":70,"timestamp":193624394229,"id":15,"parentId":1,"tags":{},"startTime":1791456660690,"traceId":"f6fa64ef3f79a610"},{"name":"turbopack-persistence","duration":126000,"timestamp":193625981910,"id":16,"parentId":15,"tags":{"reason":"stop","snapshot_duration_ms":2.968842,"persist_duration_ms":122.177614,"task_count":991,"bytes_written":973617,"bytes_deleted":0},"startTime":1791456662405,"traceId":"f6fa64ef3f79a610"},{"name":"run-typescript","duration":2984298,"timestamp":193626522554,"id":18,"parentId":1,"tags":{},"startTime":1791456662818,"traceId":"f6fa64ef3f79a610"},{"name":"static-check","duration":1477672,"timestamp":193629531185,"id":21,"parentId":1,"tags":{},"startTime":1791456665827,"traceId":"f6fa64ef3f79a610"},{"name":"static-generation","duration":555072,"timestamp":193631012130,"id":61,"parentId":1,"tags":{},"startTime":1791456667308,"traceId":"f6fa64ef3f79a610"},{"name":"telemetry-flush","duration":429467,"timestamp":193631643211,"id":70,"parentId":1,"tags":{},"startTime":1791456667939,"traceId":"f6fa64ef3f79a610"},{"name":"next-build","duration":8282344,"timestamp":193623790365,"id":1,"tags":{"buildMode":"default","version":"16.3.8","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1791456660086,"traceId":"f6fa64ef3f79a610"}]
package/README.md CHANGED
@@ -148,6 +148,7 @@ performance-dashboard [port] [options]
148
148
  | `-v`, `--version` | Print the version |
149
149
  | `--json` | Machine-readable output: one JSON object per line on stdout (`event` is `ok`, `info`, `warn`, `error` or `summary`) |
150
150
  | `--no-color` | Disable colors (also honors `NO_COLOR` and non-TTY output) |
151
+ | `--no-open` | Start the server without opening a browser |
151
152
  | `--host <addr>` | Address to listen on. Default `127.0.0.1` (this machine only). `--host 0.0.0.0` exposes the dashboard, and the New Relic/Sentry data behind it, to your network and prints a warning |
152
153
  | `[port]` | Port to listen on; default `3000`. The `PORT` environment variable also works |
153
154
 
package/bin/cli.mjs CHANGED
@@ -99,12 +99,12 @@ async function printConnection() {
99
99
  }
100
100
  }
101
101
 
102
- // Open the browser once the port accepts connections.
102
+ // Open the browser once the port accepts connections (--no-open skips it: tests, CI, remote shells).
103
103
  const open = () => {
104
104
  const [cmd, ...args] =
105
105
  process.platform === "darwin" ? ["open"] :
106
106
  process.platform === "win32" ? ["cmd", "/c", "start", ""] : ["xdg-open"];
107
- spawn(cmd, [...args, url], { stdio: "ignore", detached: true }).on("error", () => {}).unref();
107
+ if (!process.argv.includes("--no-open")) spawn(cmd, [...args, url], { stdio: "ignore", detached: true }).on("error", () => {}).unref();
108
108
  stopSpinner();
109
109
  out.ok("Dashboard is running", { url, host, port: +port });
110
110
  out.kv([["URL", url], ["Stop", "Ctrl+C"]]);
package/bin/output.mjs CHANGED
@@ -74,6 +74,7 @@ ${c.bold("Options")}
74
74
  --host 0.0.0.0 exposes the dashboard to your network
75
75
  --json Machine-readable output: one JSON object per line
76
76
  --no-color Disable colors (also honors NO_COLOR and non-TTY)
77
+ --no-open Start the server without opening a browser
77
78
 
78
79
  ${c.bold("Environment")}
79
80
  PORT Port to listen on (default 3000)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karan171996/metricflow",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "Local performance dashboard: New Relic page metrics and Sentry errors per page, with AI suggestions. Run with one npx command.",
5
5
  "keywords": [
6
6
  "performance",
@@ -1,3 +0,0 @@
1
- module.exports=[54799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,t,r)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},60780,e=>{"use strict";var t=e.i(2157),r=e.i(50227),n=e.i(24514),s=e.i(12892);let a={loadSeconds:1.5,errorPercent:2,uptimeSLA:99.9},o=()=>process.env.METRICFLOW_SETTINGS_FILE||(0,r.join)((0,s.projectDir)(),".metricflow-settings.json"),i={loadSeconds:[.1,30],errorPercent:[.1,100],uptimeSLA:[90,100]};function l(){try{return{...a,...JSON.parse((0,t.readFileSync)(o(),"utf8"))}}catch{return a}}async function u(){return Response.json(l())}async function c(e){let r;if(!(0,n.isLocalRequest)(e))return Response.json({error:(0,n.REFUSAL_MESSAGE)()},{status:403});try{r=await e.json()}catch{return Response.json({error:"Invalid request body."},{status:400})}let s=l();for(let[e,[t,n]]of Object.entries(i)){if(void 0===r[e])continue;let a=r[e];if("number"!=typeof a||!Number.isFinite(a)||a<t||a>n)return Response.json({error:`${e} must be a number between ${t} and ${n}.`},{status:400});s[e]=a}try{let e=`${o()}.tmp`;(0,t.writeFileSync)(e,JSON.stringify(s,null,2)),(0,t.renameSync)(e,o())}catch{return Response.json({error:"Settings could not be written. Check folder permissions."},{status:500})}return Response.json(s)}e.s(["GET",0,u,"PUT",0,c],60780)},30229,e=>{"use strict";var t=e.i(12425),r=e.i(83353),n=e.i(47902),s=e.i(37892),a=e.i(54261),o=e.i(39548),i=e.i(68187),l=e.i(63984),u=e.i(88743),c=e.i(24698),p=e.i(13487),d=e.i(48776),h=e.i(29398),R=e.i(31610),E=e.i(45919),f=e.i(93695),v=e.i(12741);e.i(95315);var x=e.i(98732);let g=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/settings/route",pathname:"/api/settings",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/settings/route.ts",nextConfigOutput:"",userland:()=>e.r(60780),...{}}),{workAsyncStorage:m,workUnitAsyncStorage:w,serverHooks:S}=g;async function C(e,t,n){n.requestMeta&&(0,s.setRequestMeta)(e,n.requestMeta),g.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/settings/route";m=m.replace(/\/index$/,"")||"/";let w=await g.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:S,deploymentId:C,params:_,nextConfig:y,parsedUrl:A,isDraftMode:I,prerenderManifest:b,routerServerContext:T,isOnDemandRevalidate:O,revalidateOnlyGenerated:N,resolvedPathname:P,clientReferenceManifest:q,serverActionsManifest:j}=w,L=(0,i.normalizeAppPath)(m),k=!!b.routes[P]&&(g.isDev||(0,v.isRouteCacheOwner)(P,g.cacheOwner,b.routes[P])),D=!!(b.dynamicRoutes[L]||k),M=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,A,!1):t.end("This page could not be found"),null);if(D&&!I){let e=b.dynamicRoutes[L];if(e&&!1===e.fallback&&!k){if(y.adapterPath)return await M();throw new f.NoFallbackError}}let U=null;!D||g.isDev||I||(U="/index"===(U=P)?"/":U);let F=!0===g.isDev||!D,H=D&&!F;j&&q&&(0,o.setManifestsSingleton)({page:m,clientReferenceManifest:q,serverActionsManifest:j});let K=e.method||"GET",$=(0,a.getTracer)(),G=$.getActiveScopeSpan(),Y=!!(null==T?void 0:T.isWrappedByNextServer),W=!!(0,s.getRequestMeta)(e,"minimalMode"),B=(0,s.getRequestMeta)(e,"incrementalCache")||await g.getIncrementalCache(e,y,b,W);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let V={params:_,previewProps:b.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,isDraftMode:I,supportsDynamicResponse:F,incrementalCache:B,hmrRefreshHash:(0,s.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,s)=>g.onRequestError(e,t,n,s,T)},sharedContext:{buildId:S,deploymentId:C}},X=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),Z=u.NextRequestAdapter.fromNodeNextRequest(X,(0,u.signalFromNodeResponse)(t)),z=async({previousCacheEntry:r})=>{try{if(!W&&O&&N&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await g.handle(Z,V);e.fetchMetrics=V.renderOpts.fetchMetrics;let a=V.renderOpts.pendingWaitUntil;a&&n.waitUntil&&(n.waitUntil(a),a=void 0);let o=V.renderOpts.collectedTags;if(!D)return await (0,d.sendResponse)(X,J,s,a),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);o&&(t[E.NEXT_CACHE_TAGS_HEADER]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=E.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,n=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=E.INFINITE_CACHE?!1!==r&&r>0?y.expireTime:void 0:V.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await g.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:O})},!1,T),t}},Q=async(s,o)=>{try{var i,l;let s=await g.handleResponse({req:e,nextConfig:y,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:N,responseGenerator:z,waitUntil:n.waitUntil,isMinimalMode:W});if(!D)return;if((null==s||null==(i=s.value)?void 0:i.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==s||null==(l=s.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});W||t.setHeader("x-nextjs-cache",O?"REVALIDATED":s.isMiss?"MISS":s.isStale?"STALE":"HIT"),I&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let a=(0,h.fromNodeOutgoingHttpHeaders)(s.value.headers);W&&D||a.delete(E.NEXT_CACHE_TAGS_HEADER),!s.cacheControl||t.getHeader("Cache-Control")||a.get("Cache-Control")||a.set("Cache-Control",(0,R.getCacheControlHeader)(s.cacheControl)),await (0,d.sendResponse)(X,J,new Response(s.value.body,{headers:a,status:s.value.status||200}));return}catch(t){if(t instanceof f.NoFallbackError||await g.onRequestError(e,t,{routerKind:"App Router",routePath:L,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:O})},!1,T),D)throw t;await (0,d.sendResponse)(X,J,new Response(null,{status:500}));return}finally{(()=>{if(!s)return;let e=t.statusCode;s.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(s.setStatus({code:a.SpanStatusCode.ERROR}),s.setAttribute("error.type",e.toString()));let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route")||L,i=`${K} ${n}`;s.setAttributes({"next.route":n,"http.route":n,"next.span_name":i}),s.updateName(i),o&&o!==s&&(o.setAttribute("http.route",n),o.updateName(i))})()}};if(Y&&G)await Q(G,void 0);else{let t=$.getActiveScopeSpan();await $.withPropagatedContext(e.headers,()=>$.trace(c.BaseServerSpan.handleRequest,{spanName:`${K} ${m}`,kind:a.SpanKind.SERVER,attributes:{"http.method":K,"http.target":e.url}},e=>Q(e,t)),void 0,!Y)}}e.s(["handler",0,C,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:m,workUnitAsyncStorage:w})},"routeModule",0,g,"serverHooks",0,S,"workAsyncStorage",0,m,"workUnitAsyncStorage",0,w])},12892,e=>{"use strict";var t=e.i(2157),r=e.i(50227);let n=["NEWRELIC_API_KEY","NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID","SENTRY_API_KEY","SENTRY_DSN"],s="NEWRELIC_REGION",a={us:{graphql:"https://api.newrelic.com/graphql",ingest:"https://insights-collector.newrelic.com"},eu:{graphql:"https://api.eu.newrelic.com/graphql",ingest:"https://insights-collector.eu01.nr-data.net"}},o={gemini:{label:"Google Gemini",key:"GEMINI_API_KEY"},claude:{label:"Anthropic Claude",key:"CLAUDE_API_KEY"},openai:{label:"OpenAI",key:"OPENAI_API_KEY"}},i="AI_PROVIDER";function l(e){return process.env[e]??""}function u(){return process.env.METRICFLOW_PROJECT_DIR||process.cwd()}e.s(["AI_PROVIDERS",0,o,"AI_PROVIDER_KEY",0,i,"INSERT_KEY",0,"NEWRELIC_INSERT_KEY","REGION_KEY",0,s,"SETUP_KEYS",0,n,"activeAi",0,function(){let e=process.env[i];for(let t of(e&&e in o?[e]:[]).concat(Object.keys(o))){let e=process.env[o[t].key];if(e)return{provider:t,key:e}}return null},"env",0,l,"isConfigured",0,function(){return n.every(e=>l(e))},"nrHosts",0,(e="eu"===process.env[s]?"eu":"us")=>a[e],"projectDir",0,u,"writeEnvLocal",0,function(e,n=process.env.METRICFLOW_ENV_FILE||(0,r.join)(u(),".env.local")){let s=(0,t.existsSync)(n)?(0,t.readFileSync)(n,"utf8").split("\n"):[],a=new Map(Object.entries(e)),o=s.map(e=>{let t=e.match(/^\s*([A-Z0-9_]+)\s*=/)?.[1];if(t&&a.has(t)){let e=a.get(t);return a.delete(t),`${t}=${e}`}return e});for(;o.length&&""===o[o.length-1];)o.pop();for(let[e,t]of a)o.push(`${e}=${t}`);let i=`${n}.tmp`;for(let[r,s]of((0,t.writeFileSync)(i,o.join("\n")+"\n",{mode:384}),(0,t.renameSync)(i,n),Object.entries(e)))process.env[r]=s}])},24514,e=>{"use strict";let t=new Set(["localhost","127.0.0.1","[::1]"]),r=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]);e.s(["REFUSAL_MESSAGE",0,()=>"1"===process.env.METRICFLOW_EXPOSED?"Setup and Connect are disabled because the dashboard is exposed on the network (--host). Restart without --host to use them.":"Setup is only available from localhost.","isLocalRequest",0,function(e){if("1"===process.env.METRICFLOW_EXPOSED)return!1;let n=e.headers.get("x-forwarded-for");if(n&&!n.split(",").every(e=>r.has(e.trim().replace(/^\[|\]$/g,""))))return!1;let s=(e.headers.get("host")??"").replace(/:\d+$/,"");if(!t.has(s))return!1;let a=e.headers.get("origin");try{return!a||t.has(new URL(a).hostname)}catch{return!1}}])}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0gv2l08._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[49719,(e,r,t)=>{r.exports=e.x("assert",()=>require("assert"))},54799,(e,r,t)=>{r.exports=e.x("crypto",()=>require("crypto"))},27699,(e,r,t)=>{r.exports=e.x("events",()=>require("events"))},22734,(e,r,t)=>{r.exports=e.x("fs",()=>require("fs"))},21517,(e,r,t)=>{r.exports=e.x("http",()=>require("http"))},25328,(e,r,t)=>{r.exports=e.x("http2",()=>require("http2"))},24836,(e,r,t)=>{r.exports=e.x("https",()=>require("https"))},4446,(e,r,t)=>{r.exports=e.x("net",()=>require("net"))},18622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,r,t)=>{r.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},2157,(e,r,t)=>{r.exports=e.x("node:fs",()=>require("node:fs"))},50227,(e,r,t)=>{r.exports=e.x("node:path",()=>require("node:path"))},81111,(e,r,t)=>{r.exports=e.x("node:stream",()=>require("node:stream"))},46786,(e,r,t)=>{r.exports=e.x("os",()=>require("os"))},14747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},88947,(e,r,t)=>{r.exports=e.x("stream",()=>require("stream"))},55004,(e,r,t)=>{r.exports=e.x("tls",()=>require("tls"))},70722,(e,r,t)=>{r.exports=e.x("tty",()=>require("tty"))},92509,(e,r,t)=>{r.exports=e.x("url",()=>require("url"))},24361,(e,r,t)=>{r.exports=e.x("util",()=>require("util"))},6461,(e,r,t)=>{r.exports=e.x("zlib",()=>require("zlib"))},90770,e=>{"use strict";let r=new Map;e.s(["getTimings",0,function(){return Array.from(r.entries()).map(([e,r])=>({name:e,value:r})).sort((e,r)=>r.value-e.value)},"recordTiming",0,function(e,t){r.set(e,Math.round(t))}])},12892,e=>{"use strict";var r=e.i(2157),t=e.i(50227);let s=["NEWRELIC_API_KEY","NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID","SENTRY_API_KEY","SENTRY_DSN"],n="NEWRELIC_REGION",o={us:{graphql:"https://api.newrelic.com/graphql",ingest:"https://insights-collector.newrelic.com"},eu:{graphql:"https://api.eu.newrelic.com/graphql",ingest:"https://insights-collector.eu01.nr-data.net"}},i={gemini:{label:"Google Gemini",key:"GEMINI_API_KEY"},claude:{label:"Anthropic Claude",key:"CLAUDE_API_KEY"},openai:{label:"OpenAI",key:"OPENAI_API_KEY"}},p="AI_PROVIDER";function a(e){return process.env[e]??""}function u(){return process.env.METRICFLOW_PROJECT_DIR||process.cwd()}e.s(["AI_PROVIDERS",0,i,"AI_PROVIDER_KEY",0,p,"INSERT_KEY",0,"NEWRELIC_INSERT_KEY","REGION_KEY",0,n,"SETUP_KEYS",0,s,"activeAi",0,function(){let e=process.env[p];for(let r of(e&&e in i?[e]:[]).concat(Object.keys(i))){let e=process.env[i[r].key];if(e)return{provider:r,key:e}}return null},"env",0,a,"isConfigured",0,function(){return s.every(e=>a(e))},"nrHosts",0,(e="eu"===process.env[n]?"eu":"us")=>o[e],"projectDir",0,u,"writeEnvLocal",0,function(e,s=process.env.METRICFLOW_ENV_FILE||(0,t.join)(u(),".env.local")){let n=(0,r.existsSync)(s)?(0,r.readFileSync)(s,"utf8").split("\n"):[],o=new Map(Object.entries(e)),i=n.map(e=>{let r=e.match(/^\s*([A-Z0-9_]+)\s*=/)?.[1];if(r&&o.has(r)){let e=o.get(r);return o.delete(r),`${r}=${e}`}return e});for(;i.length&&""===i[i.length-1];)i.pop();for(let[e,r]of o)i.push(`${e}=${r}`);let p=`${s}.tmp`;for(let[t,n]of((0,r.writeFileSync)(p,i.join("\n")+"\n",{mode:384}),(0,r.renameSync)(p,s),Object.entries(e)))process.env[t]=n}])}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0pbux_a._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[49719,(e,r,t)=>{r.exports=e.x("assert",()=>require("assert"))},54799,(e,r,t)=>{r.exports=e.x("crypto",()=>require("crypto"))},27699,(e,r,t)=>{r.exports=e.x("events",()=>require("events"))},22734,(e,r,t)=>{r.exports=e.x("fs",()=>require("fs"))},21517,(e,r,t)=>{r.exports=e.x("http",()=>require("http"))},25328,(e,r,t)=>{r.exports=e.x("http2",()=>require("http2"))},24836,(e,r,t)=>{r.exports=e.x("https",()=>require("https"))},4446,(e,r,t)=>{r.exports=e.x("net",()=>require("net"))},18622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,r,t)=>{r.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},2157,(e,r,t)=>{r.exports=e.x("node:fs",()=>require("node:fs"))},50227,(e,r,t)=>{r.exports=e.x("node:path",()=>require("node:path"))},81111,(e,r,t)=>{r.exports=e.x("node:stream",()=>require("node:stream"))},46786,(e,r,t)=>{r.exports=e.x("os",()=>require("os"))},14747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},88947,(e,r,t)=>{r.exports=e.x("stream",()=>require("stream"))},55004,(e,r,t)=>{r.exports=e.x("tls",()=>require("tls"))},70722,(e,r,t)=>{r.exports=e.x("tty",()=>require("tty"))},92509,(e,r,t)=>{r.exports=e.x("url",()=>require("url"))},24361,(e,r,t)=>{r.exports=e.x("util",()=>require("util"))},6461,(e,r,t)=>{r.exports=e.x("zlib",()=>require("zlib"))},12892,e=>{"use strict";var r=e.i(2157),t=e.i(50227);let s=["NEWRELIC_API_KEY","NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID","SENTRY_API_KEY","SENTRY_DSN"],n="NEWRELIC_REGION",o={us:{graphql:"https://api.newrelic.com/graphql",ingest:"https://insights-collector.newrelic.com"},eu:{graphql:"https://api.eu.newrelic.com/graphql",ingest:"https://insights-collector.eu01.nr-data.net"}},i={gemini:{label:"Google Gemini",key:"GEMINI_API_KEY"},claude:{label:"Anthropic Claude",key:"CLAUDE_API_KEY"},openai:{label:"OpenAI",key:"OPENAI_API_KEY"}},a="AI_PROVIDER";function p(e){return process.env[e]??""}function u(){return process.env.METRICFLOW_PROJECT_DIR||process.cwd()}e.s(["AI_PROVIDERS",0,i,"AI_PROVIDER_KEY",0,a,"INSERT_KEY",0,"NEWRELIC_INSERT_KEY","REGION_KEY",0,n,"SETUP_KEYS",0,s,"activeAi",0,function(){let e=process.env[a];for(let r of(e&&e in i?[e]:[]).concat(Object.keys(i))){let e=process.env[i[r].key];if(e)return{provider:r,key:e}}return null},"env",0,p,"isConfigured",0,function(){return s.every(e=>p(e))},"nrHosts",0,(e="eu"===process.env[n]?"eu":"us")=>o[e],"projectDir",0,u,"writeEnvLocal",0,function(e,s=process.env.METRICFLOW_ENV_FILE||(0,t.join)(u(),".env.local")){let n=(0,r.existsSync)(s)?(0,r.readFileSync)(s,"utf8").split("\n"):[],o=new Map(Object.entries(e)),i=n.map(e=>{let r=e.match(/^\s*([A-Z0-9_]+)\s*=/)?.[1];if(r&&o.has(r)){let e=o.get(r);return o.delete(r),`${r}=${e}`}return e});for(;i.length&&""===i[i.length-1];)i.pop();for(let[e,r]of o)i.push(`${e}=${r}`);let a=`${s}.tmp`;for(let[t,n]of((0,r.writeFileSync)(a,i.join("\n")+"\n",{mode:384}),(0,r.renameSync)(a,s),Object.entries(e)))process.env[t]=n}])},24514,e=>{"use strict";let r=new Set(["localhost","127.0.0.1","[::1]"]),t=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]);e.s(["REFUSAL_MESSAGE",0,()=>"1"===process.env.METRICFLOW_EXPOSED?"Setup and Connect are disabled because the dashboard is exposed on the network (--host). Restart without --host to use them.":"Setup is only available from localhost.","isLocalRequest",0,function(e){if("1"===process.env.METRICFLOW_EXPOSED)return!1;let s=e.headers.get("x-forwarded-for");if(s&&!s.split(",").every(e=>t.has(e.trim().replace(/^\[|\]$/g,""))))return!1;let n=(e.headers.get("host")??"").replace(/:\d+$/,"");if(!r.has(n))return!1;let o=e.headers.get("origin");try{return!o||r.has(new URL(o).hostname)}catch{return!1}}])},84594,e=>{"use strict";var r=e.i(60756),t=e.i(12892);async function s(e,n=()=>!1){let o,i;if(process.env[t.REGION_KEY])return e((0,t.nrHosts)());try{if(o=await e((0,t.nrHosts)("us")),!n(o))return o}catch(t){let e=r.default.isAxiosError(t)?t.response?.status:void 0;if(401!==e&&403!==e)throw t;i=t}try{let r=await e((0,t.nrHosts)("eu"));if(!n(r))return process.env[t.REGION_KEY]="eu",r}catch{}if(i)throw i;return o}async function n(e,t,n){return(await s(s=>r.default.post(s.graphql,{query:t},{headers:{"API-Key":e,"Content-Type":"application/json"},timeout:n}),e=>!e.data?.data?.actor)).data}e.s(["nrGraphql",0,n,"withRegion",0,s])},83808,e=>{"use strict";var r=e.i(60756);async function t(e,t){let s={Authorization:`Bearer ${e}`},n=t.orgId?await r.default.get(`${t.apiBase}/organizations/`,{headers:s,timeout:8e3}):await r.default.get(`${t.apiBase}/projects/`,{headers:s,timeout:8e3}),o=Array.isArray(n.data)?n.data:[];return(t.orgId?o.find(e=>String(e.id)===t.orgId)?.slug:o.find(e=>String(e.id)===t.projectId)?.organization?.slug)??null}e.s(["orgSlugForDsn",0,t,"parseSentryDsn",0,function(e){let r;try{r=new URL(e)}catch{return{ok:!1,error:"Sentry DSN is not a valid URL."}}if("https:"!==r.protocol&&"http:"!==r.protocol)return{ok:!1,error:"Sentry DSN must be an http(s) URL."};if(!r.username)return{ok:!1,error:"Sentry DSN is missing its public key."};let t=r.pathname.replace(/^\/|\/$/g,"");if(!/^\d+$/.test(t))return{ok:!1,error:"Sentry DSN is missing a numeric project id."};let s=r.host.match(/^o(\d+)\.ingest\.(.+)$/i),n=s?s[2]:r.host;return{ok:!0,projectId:t,orgId:s?s[1]:null,apiBase:`${r.protocol}//${n}/api/0`}}])}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__16h-056._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[49719,(e,r,t)=>{r.exports=e.x("assert",()=>require("assert"))},54799,(e,r,t)=>{r.exports=e.x("crypto",()=>require("crypto"))},27699,(e,r,t)=>{r.exports=e.x("events",()=>require("events"))},22734,(e,r,t)=>{r.exports=e.x("fs",()=>require("fs"))},21517,(e,r,t)=>{r.exports=e.x("http",()=>require("http"))},25328,(e,r,t)=>{r.exports=e.x("http2",()=>require("http2"))},24836,(e,r,t)=>{r.exports=e.x("https",()=>require("https"))},4446,(e,r,t)=>{r.exports=e.x("net",()=>require("net"))},18622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,r,t)=>{r.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},66680,(e,r,t)=>{r.exports=e.x("node:crypto",()=>require("node:crypto"))},2157,(e,r,t)=>{r.exports=e.x("node:fs",()=>require("node:fs"))},50227,(e,r,t)=>{r.exports=e.x("node:path",()=>require("node:path"))},81111,(e,r,t)=>{r.exports=e.x("node:stream",()=>require("node:stream"))},46786,(e,r,t)=>{r.exports=e.x("os",()=>require("os"))},14747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},88947,(e,r,t)=>{r.exports=e.x("stream",()=>require("stream"))},55004,(e,r,t)=>{r.exports=e.x("tls",()=>require("tls"))},70722,(e,r,t)=>{r.exports=e.x("tty",()=>require("tty"))},92509,(e,r,t)=>{r.exports=e.x("url",()=>require("url"))},24361,(e,r,t)=>{r.exports=e.x("util",()=>require("util"))},6461,(e,r,t)=>{r.exports=e.x("zlib",()=>require("zlib"))},90770,e=>{"use strict";let r=new Map;e.s(["getTimings",0,function(){return Array.from(r.entries()).map(([e,r])=>({name:e,value:r})).sort((e,r)=>r.value-e.value)},"recordTiming",0,function(e,t){r.set(e,Math.round(t))}])},12892,e=>{"use strict";var r=e.i(2157),t=e.i(50227);let s=["NEWRELIC_API_KEY","NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID","SENTRY_API_KEY","SENTRY_DSN"],n="NEWRELIC_REGION",o={us:{graphql:"https://api.newrelic.com/graphql",ingest:"https://insights-collector.newrelic.com"},eu:{graphql:"https://api.eu.newrelic.com/graphql",ingest:"https://insights-collector.eu01.nr-data.net"}},i={gemini:{label:"Google Gemini",key:"GEMINI_API_KEY"},claude:{label:"Anthropic Claude",key:"CLAUDE_API_KEY"},openai:{label:"OpenAI",key:"OPENAI_API_KEY"}},a="AI_PROVIDER";function p(e){return process.env[e]??""}function u(){return process.env.METRICFLOW_PROJECT_DIR||process.cwd()}e.s(["AI_PROVIDERS",0,i,"AI_PROVIDER_KEY",0,a,"INSERT_KEY",0,"NEWRELIC_INSERT_KEY","REGION_KEY",0,n,"SETUP_KEYS",0,s,"activeAi",0,function(){let e=process.env[a];for(let r of(e&&e in i?[e]:[]).concat(Object.keys(i))){let e=process.env[i[r].key];if(e)return{provider:r,key:e}}return null},"env",0,p,"isConfigured",0,function(){return s.every(e=>p(e))},"nrHosts",0,(e="eu"===process.env[n]?"eu":"us")=>o[e],"projectDir",0,u,"writeEnvLocal",0,function(e,s=process.env.METRICFLOW_ENV_FILE||(0,t.join)(u(),".env.local")){let n=(0,r.existsSync)(s)?(0,r.readFileSync)(s,"utf8").split("\n"):[],o=new Map(Object.entries(e)),i=n.map(e=>{let r=e.match(/^\s*([A-Z0-9_]+)\s*=/)?.[1];if(r&&o.has(r)){let e=o.get(r);return o.delete(r),`${r}=${e}`}return e});for(;i.length&&""===i[i.length-1];)i.pop();for(let[e,r]of o)i.push(`${e}=${r}`);let a=`${s}.tmp`;for(let[t,n]of((0,r.writeFileSync)(a,i.join("\n")+"\n",{mode:384}),(0,r.renameSync)(a,s),Object.entries(e)))process.env[t]=n}])},84594,e=>{"use strict";var r=e.i(60756),t=e.i(12892);async function s(e,n=()=>!1){let o,i;if(process.env[t.REGION_KEY])return e((0,t.nrHosts)());try{if(o=await e((0,t.nrHosts)("us")),!n(o))return o}catch(t){let e=r.default.isAxiosError(t)?t.response?.status:void 0;if(401!==e&&403!==e)throw t;i=t}try{let r=await e((0,t.nrHosts)("eu"));if(!n(r))return process.env[t.REGION_KEY]="eu",r}catch{}if(i)throw i;return o}async function n(e,t,n){return(await s(s=>r.default.post(s.graphql,{query:t},{headers:{"API-Key":e,"Content-Type":"application/json"},timeout:n}),e=>!e.data?.data?.actor)).data}e.s(["nrGraphql",0,n,"withRegion",0,s])},83808,e=>{"use strict";var r=e.i(60756);async function t(e,t){let s={Authorization:`Bearer ${e}`},n=t.orgId?await r.default.get(`${t.apiBase}/organizations/`,{headers:s,timeout:8e3}):await r.default.get(`${t.apiBase}/projects/`,{headers:s,timeout:8e3}),o=Array.isArray(n.data)?n.data:[];return(t.orgId?o.find(e=>String(e.id)===t.orgId)?.slug:o.find(e=>String(e.id)===t.projectId)?.organization?.slug)??null}e.s(["orgSlugForDsn",0,t,"parseSentryDsn",0,function(e){let r;try{r=new URL(e)}catch{return{ok:!1,error:"Sentry DSN is not a valid URL."}}if("https:"!==r.protocol&&"http:"!==r.protocol)return{ok:!1,error:"Sentry DSN must be an http(s) URL."};if(!r.username)return{ok:!1,error:"Sentry DSN is missing its public key."};let t=r.pathname.replace(/^\/|\/$/g,"");if(!/^\d+$/.test(t))return{ok:!1,error:"Sentry DSN is missing a numeric project id."};let s=r.host.match(/^o(\d+)\.ingest\.(.+)$/i),n=s?s[2]:r.host;return{ok:!0,projectId:t,orgId:s?s[1]:null,apiBase:`${r.protocol}//${n}/api/0`}}])}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__1mwvot_._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[49719,(e,r,t)=>{r.exports=e.x("assert",()=>require("assert"))},54799,(e,r,t)=>{r.exports=e.x("crypto",()=>require("crypto"))},27699,(e,r,t)=>{r.exports=e.x("events",()=>require("events"))},22734,(e,r,t)=>{r.exports=e.x("fs",()=>require("fs"))},21517,(e,r,t)=>{r.exports=e.x("http",()=>require("http"))},25328,(e,r,t)=>{r.exports=e.x("http2",()=>require("http2"))},24836,(e,r,t)=>{r.exports=e.x("https",()=>require("https"))},4446,(e,r,t)=>{r.exports=e.x("net",()=>require("net"))},18622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,r,t)=>{r.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},2157,(e,r,t)=>{r.exports=e.x("node:fs",()=>require("node:fs"))},50227,(e,r,t)=>{r.exports=e.x("node:path",()=>require("node:path"))},81111,(e,r,t)=>{r.exports=e.x("node:stream",()=>require("node:stream"))},46786,(e,r,t)=>{r.exports=e.x("os",()=>require("os"))},14747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},88947,(e,r,t)=>{r.exports=e.x("stream",()=>require("stream"))},55004,(e,r,t)=>{r.exports=e.x("tls",()=>require("tls"))},70722,(e,r,t)=>{r.exports=e.x("tty",()=>require("tty"))},92509,(e,r,t)=>{r.exports=e.x("url",()=>require("url"))},24361,(e,r,t)=>{r.exports=e.x("util",()=>require("util"))},6461,(e,r,t)=>{r.exports=e.x("zlib",()=>require("zlib"))},12892,e=>{"use strict";var r=e.i(2157),t=e.i(50227);let s=["NEWRELIC_API_KEY","NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID","SENTRY_API_KEY","SENTRY_DSN"],n="NEWRELIC_REGION",o={us:{graphql:"https://api.newrelic.com/graphql",ingest:"https://insights-collector.newrelic.com"},eu:{graphql:"https://api.eu.newrelic.com/graphql",ingest:"https://insights-collector.eu01.nr-data.net"}},i={gemini:{label:"Google Gemini",key:"GEMINI_API_KEY"},claude:{label:"Anthropic Claude",key:"CLAUDE_API_KEY"},openai:{label:"OpenAI",key:"OPENAI_API_KEY"}},a="AI_PROVIDER";function p(e){return process.env[e]??""}function l(){return process.env.METRICFLOW_PROJECT_DIR||process.cwd()}e.s(["AI_PROVIDERS",0,i,"AI_PROVIDER_KEY",0,a,"INSERT_KEY",0,"NEWRELIC_INSERT_KEY","REGION_KEY",0,n,"SETUP_KEYS",0,s,"activeAi",0,function(){let e=process.env[a];for(let r of(e&&e in i?[e]:[]).concat(Object.keys(i))){let e=process.env[i[r].key];if(e)return{provider:r,key:e}}return null},"env",0,p,"isConfigured",0,function(){return s.every(e=>p(e))},"nrHosts",0,(e="eu"===process.env[n]?"eu":"us")=>o[e],"projectDir",0,l,"writeEnvLocal",0,function(e,s=process.env.METRICFLOW_ENV_FILE||(0,t.join)(l(),".env.local")){let n=(0,r.existsSync)(s)?(0,r.readFileSync)(s,"utf8").split("\n"):[],o=new Map(Object.entries(e)),i=n.map(e=>{let r=e.match(/^\s*([A-Z0-9_]+)\s*=/)?.[1];if(r&&o.has(r)){let e=o.get(r);return o.delete(r),`${r}=${e}`}return e});for(;i.length&&""===i[i.length-1];)i.pop();for(let[e,r]of o)i.push(`${e}=${r}`);let a=`${s}.tmp`;for(let[t,n]of((0,r.writeFileSync)(a,i.join("\n")+"\n",{mode:384}),(0,r.renameSync)(a,s),Object.entries(e)))process.env[t]=n}])},24514,e=>{"use strict";let r=new Set(["localhost","127.0.0.1","[::1]"]),t=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]);e.s(["REFUSAL_MESSAGE",0,()=>"1"===process.env.METRICFLOW_EXPOSED?"Setup and Connect are disabled because the dashboard is exposed on the network (--host). Restart without --host to use them.":"Setup is only available from localhost.","isLocalRequest",0,function(e){if("1"===process.env.METRICFLOW_EXPOSED)return!1;let s=e.headers.get("x-forwarded-for");if(s&&!s.split(",").every(e=>t.has(e.trim().replace(/^\[|\]$/g,""))))return!1;let n=(e.headers.get("host")??"").replace(/:\d+$/,"");if(!r.has(n))return!1;let o=e.headers.get("origin");try{return!o||r.has(new URL(o).hostname)}catch{return!1}}])},83808,e=>{"use strict";var r=e.i(60756);async function t(e,t){let s={Authorization:`Bearer ${e}`},n=t.orgId?await r.default.get(`${t.apiBase}/organizations/`,{headers:s,timeout:8e3}):await r.default.get(`${t.apiBase}/projects/`,{headers:s,timeout:8e3}),o=Array.isArray(n.data)?n.data:[];return(t.orgId?o.find(e=>String(e.id)===t.orgId)?.slug:o.find(e=>String(e.id)===t.projectId)?.organization?.slug)??null}e.s(["orgSlugForDsn",0,t,"parseSentryDsn",0,function(e){let r;try{r=new URL(e)}catch{return{ok:!1,error:"Sentry DSN is not a valid URL."}}if("https:"!==r.protocol&&"http:"!==r.protocol)return{ok:!1,error:"Sentry DSN must be an http(s) URL."};if(!r.username)return{ok:!1,error:"Sentry DSN is missing its public key."};let t=r.pathname.replace(/^\/|\/$/g,"");if(!/^\d+$/.test(t))return{ok:!1,error:"Sentry DSN is missing a numeric project id."};let s=r.host.match(/^o(\d+)\.ingest\.(.+)$/i),n=s?s[2]:r.host;return{ok:!0,projectId:t,orgId:s?s[1]:null,apiBase:`${r.protocol}//${n}/api/0`}}])}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__1o8nu3b._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[49719,(e,t,r)=>{t.exports=e.x("assert",()=>require("assert"))},54799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},27699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},21517,(e,t,r)=>{t.exports=e.x("http",()=>require("http"))},25328,(e,t,r)=>{t.exports=e.x("http2",()=>require("http2"))},24836,(e,t,r)=>{t.exports=e.x("https",()=>require("https"))},4446,(e,t,r)=>{t.exports=e.x("net",()=>require("net"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,t,r)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},46786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},88947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},55004,(e,t,r)=>{t.exports=e.x("tls",()=>require("tls"))},70722,(e,t,r)=>{t.exports=e.x("tty",()=>require("tty"))},92509,(e,t,r)=>{t.exports=e.x("url",()=>require("url"))},24361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},6461,(e,t,r)=>{t.exports=e.x("zlib",()=>require("zlib"))},83464,e=>{"use strict";var t=e.i(60756),r=e.i(12892),s=e.i(24514);let a=/[\s\0#"'`\\$]/,n=()=>Response.json({error:(0,s.REFUSAL_MESSAGE)()},{status:403}),o={gemini:e=>t.default.get("https://generativelanguage.googleapis.com/v1beta/models",{params:{key:e},timeout:8e3}),claude:e=>t.default.get("https://api.anthropic.com/v1/models",{headers:{"x-api-key":e,"anthropic-version":"2023-06-01"},timeout:8e3}),openai:e=>t.default.get("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${e}`},timeout:8e3})};async function i(e){return(0,s.isLocalRequest)(e)?Response.json({provider:(0,r.activeAi)()?.provider??null,keys:Object.fromEntries(Object.entries(r.AI_PROVIDERS).map(([e,t])=>[e,!!process.env[t.key]]))}):n()}async function l(e){let i;if(!(0,s.isLocalRequest)(e))return n();try{i=await e.json()}catch{return Response.json({error:"Invalid request body."},{status:400})}let l=i.provider;if(!("string"==typeof l&&l in r.AI_PROVIDERS))return Response.json({saved:!1,error:"Choose a provider."},{status:400});let u="string"==typeof i.key?i.key.trim():"";if(!u)return Response.json({saved:!1,error:"Required."},{status:400});if(a.test(u))return Response.json({saved:!1,error:"Contains spaces or special characters. Paste the key without them."},{status:400});try{await o[l](u)}catch(a){let e=t.default.isAxiosError(a)?a.response?.status:void 0,s=400===e||401===e||403===e?`${r.AI_PROVIDERS[l].label} rejected this key.`:`Could not reach ${r.AI_PROVIDERS[l].label} to check the key.`;return Response.json({saved:!1,error:s},{status:422})}try{(0,r.writeEnvLocal)({[r.AI_PROVIDER_KEY]:l,[r.AI_PROVIDERS[l].key]:u})}catch{return Response.json({saved:!1,error:"Key is valid but .env.local could not be written. Check folder permissions."},{status:500})}return Response.json({saved:!0,provider:l})}e.s(["GET",0,i,"POST",0,l])},9001,e=>{"use strict";var t=e.i(12425),r=e.i(83353),s=e.i(47902),a=e.i(37892),n=e.i(54261),o=e.i(39548),i=e.i(68187),l=e.i(63984),u=e.i(88743),p=e.i(24698),c=e.i(13487),d=e.i(48776),h=e.i(29398),R=e.i(31610),x=e.i(45919),v=e.i(93695),E=e.i(12741);e.i(95315);var f=e.i(98732);let m=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/setup/ai/route",pathname:"/api/setup/ai",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/setup/ai/route.ts",nextConfigOutput:"",userland:()=>e.r(83464),...{}}),{workAsyncStorage:g,workUnitAsyncStorage:y,serverHooks:w}=m;async function _(e,t,s){s.requestMeta&&(0,a.setRequestMeta)(e,s.requestMeta),m.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/setup/ai/route";g=g.replace(/\/index$/,"")||"/";let y=await m.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!y)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:w,deploymentId:_,params:C,nextConfig:I,parsedUrl:A,isDraftMode:S,prerenderManifest:q,routerServerContext:b,isOnDemandRevalidate:O,revalidateOnlyGenerated:P,resolvedPathname:T,clientReferenceManifest:N,serverActionsManifest:j}=y,k=(0,i.normalizeAppPath)(g),D=!!q.routes[T]&&(m.isDev||(0,E.isRouteCacheOwner)(T,m.cacheOwner,q.routes[T])),L=!!(q.dynamicRoutes[k]||D),M=async()=>((null==b?void 0:b.render404)?await b.render404(e,t,A,!1):t.end("This page could not be found"),null);if(L&&!S){let e=q.dynamicRoutes[k];if(e&&!1===e.fallback&&!D){if(I.adapterPath)return await M();throw new v.NoFallbackError}}let U=null;!L||m.isDev||S||(U="/index"===(U=T)?"/":U);let H=!0===m.isDev||!L,K=L&&!H;j&&N&&(0,o.setManifestsSingleton)({page:g,clientReferenceManifest:N,serverActionsManifest:j});let $=e.method||"GET",F=(0,n.getTracer)(),G=F.getActiveScopeSpan(),V=!!(null==b?void 0:b.isWrappedByNextServer),Y=!!(0,a.getRequestMeta)(e,"minimalMode"),W=(0,a.getRequestMeta)(e,"incrementalCache")||await m.getIncrementalCache(e,I,q,Y);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let B={params:C,previewProps:q.preview,renderOpts:{experimental:{authInterrupts:!!I.experimental.authInterrupts,useCacheTimeout:I.experimental.useCacheTimeout},cacheComponents:!!I.cacheComponents,validationLevel:I.experimental.instantInsights.validationLevel,isDraftMode:S,supportsDynamicResponse:H,incrementalCache:W,hmrRefreshHash:(0,a.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:I.cacheLife,staticPageGenerationTimeout:I.staticPageGenerationTimeout,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,a)=>m.onRequestError(e,t,s,a,b)},sharedContext:{buildId:w,deploymentId:_}},X=new l.NodeNextRequest(e),z=new l.NodeNextResponse(t),Z=u.NextRequestAdapter.fromNodeNextRequest(X,(0,u.signalFromNodeResponse)(t)),J=async({previousCacheEntry:r})=>{try{if(!Y&&O&&P&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await m.handle(Z,B);e.fetchMetrics=B.renderOpts.fetchMetrics;let n=B.renderOpts.pendingWaitUntil;n&&s.waitUntil&&(s.waitUntil(n),n=void 0);let o=B.renderOpts.collectedTags;if(!L)return await (0,d.sendResponse)(X,z,a,n),null;{let e=await a.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(a.headers);o&&(t[x.NEXT_CACHE_TAGS_HEADER]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=x.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,s=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=x.INFINITE_CACHE?!1!==r&&r>0?I.expireTime:void 0:B.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await m.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:K,isOnDemandRevalidate:O})},!1,b),t}},Q=async(a,o)=>{try{var i,l;let a=await m.handleResponse({req:e,nextConfig:I,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:q,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:P,responseGenerator:J,waitUntil:s.waitUntil,isMinimalMode:Y});if(!L)return;if((null==a||null==(i=a.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==a||null==(l=a.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});Y||t.setHeader("x-nextjs-cache",O?"REVALIDATED":a.isMiss?"MISS":a.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let n=(0,h.fromNodeOutgoingHttpHeaders)(a.value.headers);Y&&L||n.delete(x.NEXT_CACHE_TAGS_HEADER),!a.cacheControl||t.getHeader("Cache-Control")||n.get("Cache-Control")||n.set("Cache-Control",(0,R.getCacheControlHeader)(a.cacheControl)),await (0,d.sendResponse)(X,z,new Response(a.value.body,{headers:n,status:a.value.status||200}));return}catch(t){if(t instanceof v.NoFallbackError||await m.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:K,isOnDemandRevalidate:O})},!1,b),L)throw t;await (0,d.sendResponse)(X,z,new Response(null,{status:500}));return}finally{(()=>{if(!a)return;let e=t.statusCode;a.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(a.setStatus({code:n.SpanStatusCode.ERROR}),a.setAttribute("error.type",e.toString()));let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route")||k,i=`${$} ${s}`;a.setAttributes({"next.route":s,"http.route":s,"next.span_name":i}),a.updateName(i),o&&o!==a&&(o.setAttribute("http.route",s),o.updateName(i))})()}};if(V&&G)await Q(G,void 0);else{let t=F.getActiveScopeSpan();await F.withPropagatedContext(e.headers,()=>F.trace(p.BaseServerSpan.handleRequest,{spanName:`${$} ${g}`,kind:n.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},e=>Q(e,t)),void 0,!V)}}e.s(["handler",0,_,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:g,workUnitAsyncStorage:y})},"routeModule",0,m,"serverHooks",0,w,"workAsyncStorage",0,g,"workUnitAsyncStorage",0,y])},12892,e=>{"use strict";var t=e.i(2157),r=e.i(50227);let s=["NEWRELIC_API_KEY","NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID","SENTRY_API_KEY","SENTRY_DSN"],a="NEWRELIC_REGION",n={us:{graphql:"https://api.newrelic.com/graphql",ingest:"https://insights-collector.newrelic.com"},eu:{graphql:"https://api.eu.newrelic.com/graphql",ingest:"https://insights-collector.eu01.nr-data.net"}},o={gemini:{label:"Google Gemini",key:"GEMINI_API_KEY"},claude:{label:"Anthropic Claude",key:"CLAUDE_API_KEY"},openai:{label:"OpenAI",key:"OPENAI_API_KEY"}},i="AI_PROVIDER";function l(e){return process.env[e]??""}function u(){return process.env.METRICFLOW_PROJECT_DIR||process.cwd()}e.s(["AI_PROVIDERS",0,o,"AI_PROVIDER_KEY",0,i,"INSERT_KEY",0,"NEWRELIC_INSERT_KEY","REGION_KEY",0,a,"SETUP_KEYS",0,s,"activeAi",0,function(){let e=process.env[i];for(let t of(e&&e in o?[e]:[]).concat(Object.keys(o))){let e=process.env[o[t].key];if(e)return{provider:t,key:e}}return null},"env",0,l,"isConfigured",0,function(){return s.every(e=>l(e))},"nrHosts",0,(e="eu"===process.env[a]?"eu":"us")=>n[e],"projectDir",0,u,"writeEnvLocal",0,function(e,s=process.env.METRICFLOW_ENV_FILE||(0,r.join)(u(),".env.local")){let a=(0,t.existsSync)(s)?(0,t.readFileSync)(s,"utf8").split("\n"):[],n=new Map(Object.entries(e)),o=a.map(e=>{let t=e.match(/^\s*([A-Z0-9_]+)\s*=/)?.[1];if(t&&n.has(t)){let e=n.get(t);return n.delete(t),`${t}=${e}`}return e});for(;o.length&&""===o[o.length-1];)o.pop();for(let[e,t]of n)o.push(`${e}=${t}`);let i=`${s}.tmp`;for(let[r,a]of((0,t.writeFileSync)(i,o.join("\n")+"\n",{mode:384}),(0,t.renameSync)(i,s),Object.entries(e)))process.env[r]=a}])},24514,e=>{"use strict";let t=new Set(["localhost","127.0.0.1","[::1]"]),r=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]);e.s(["REFUSAL_MESSAGE",0,()=>"1"===process.env.METRICFLOW_EXPOSED?"Setup and Connect are disabled because the dashboard is exposed on the network (--host). Restart without --host to use them.":"Setup is only available from localhost.","isLocalRequest",0,function(e){if("1"===process.env.METRICFLOW_EXPOSED)return!1;let s=e.headers.get("x-forwarded-for");if(s&&!s.split(",").every(e=>r.has(e.trim().replace(/^\[|\]$/g,""))))return!1;let a=(e.headers.get("host")??"").replace(/:\d+$/,"");if(!t.has(a))return!1;let n=e.headers.get("origin");try{return!n||t.has(new URL(n).hostname)}catch{return!1}}])}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__1p0_79u._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[23904,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={actionAsyncStorage:function(){return f.actionAsyncStorage},workAsyncStorage:function(){return g.workAsyncStorage},workUnitAsyncStorage:function(){return h.workUnitAsyncStorage}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(20635),g=a.r(56704),h=a.r(32319);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)}];
2
-
3
- //# sourceMappingURL=0x0c_next_dist_client_components_server-async-storage_1-oepaa.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},71385,a=>{a.v("/_next/static/media/icon.23mz8iwcatff2.svg"+(globalThis.NEXT_CLIENT_ASSET_SUFFIX||""))},48760,a=>{"use strict";let b={src:a.i(71385).default,width:32,height:32};a.s(["default",0,b])},33951,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(18060).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/node_modules/.pnpm/lucide-react@1.47.0_react@19.2.8/node_modules/lucide-react/dist/esm/Icon.mjs 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.")},"[project]/node_modules/.pnpm/lucide-react@1.47.0_react@19.2.8/node_modules/lucide-react/dist/esm/Icon.mjs","default")},50254,a=>{"use strict";var b=a.i(33951);a.n(b)},7969,a=>{"use strict";var b=a.i(56149),c=a.i(50254);a.s(["default",0,function(a,d=[],e=[]){let f,g="string"==typeof a?function(a,b,c=[]){if(null==b)throw Error("[lucide]: iconNode is required when icon name is used");return{name:a?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),size:24,node:b,...c.length>0?{aliases:c}:{}}}(a,d,e):a,h=(0,b.forwardRef)(({className:a,...d},e)=>(0,b.createElement)(c.default,{ref:e,icon:g,className:a,...d}));return g.name&&(h.displayName=(f=(a=>{let b="",c=!1;for(let d of a){if("-"===d||"_"===d||d<=" "){c=b.length>0;continue}0===b.length?b+=d.toLowerCase():b+=c?d.toUpperCase():d,c=!1}return b})(g.name)).charAt(0).toUpperCase()+f.slice(1)),h}],7969)},29347,a=>{"use strict";var b=a.i(46797),c=a.i(282),d=a.i(89196);a.i(60796);let e=(0,b.instrumentModuleGetter)(()=>a.r(48760)),f=(0,b.instrumentModuleGetter)(()=>a.r(70864)),g=(0,b.instrumentModuleGetter)(()=>a.r(45538)),h=(0,b.instrumentModuleGetter)(()=>a.r(54254)),i=(0,b.instrumentModuleGetter)(()=>a.r(73833)),j=(0,b.instrumentModuleGetter)(()=>a.r(35191)),k=(0,b.instrumentModuleGetter)(()=>a.r(68119)),l=(0,b.instrumentModuleGetter)(()=>a.r(44821)),m=["",{children:["settings",{children:["__PAGE__",{},{metadata:{},page:[(0,b.instrumentModuleGetter)(()=>a.r(51425)),"[project]/app/settings/page.tsx"]},[]]},{metadata:{},loading:[l,"[project]/app/settings/loading.tsx"]},[]]},{metadata:{icon:[async()=>{let a=(0,d.interopDefault)(await e());return[{url:`/icon.svg?${a.src.split("/").splice(-1)[0]}`,sizes:"any",type:"image/svg+xml"}]}]},layout:[f,"[project]/app/layout.tsx"],loading:[g,"[project]/app/loading.tsx"],"not-found":[h,"[project]/node_modules/.pnpm/next@16.3.8_@babel+core@7.29.7_supports-color@8.1.1__@opentelemetry+api@1.9.1_@types+no_c2c791d25241ae4161c9f48ecf186c77/node_modules/next/dist/client/components/builtin/not-found.js"],forbidden:[i,"[project]/node_modules/.pnpm/next@16.3.8_@babel+core@7.29.7_supports-color@8.1.1__@opentelemetry+api@1.9.1_@types+no_c2c791d25241ae4161c9f48ecf186c77/node_modules/next/dist/client/components/builtin/forbidden.js"],unauthorized:[j,"[project]/node_modules/.pnpm/next@16.3.8_@babel+core@7.29.7_supports-color@8.1.1__@opentelemetry+api@1.9.1_@types+no_c2c791d25241ae4161c9f48ecf186c77/node_modules/next/dist/client/components/builtin/unauthorized.js"],"global-error":[k,"[project]/node_modules/.pnpm/next@16.3.8_@babel+core@7.29.7_supports-color@8.1.1__@opentelemetry+api@1.9.1_@types+no_c2c791d25241ae4161c9f48ecf186c77/node_modules/next/dist/client/components/builtin/global-error.js"]},[]],n=a.r.bind(a),o=a.l.bind(a),p=(0,c.createAppPageEntrypoint)({tree:m,page:"/settings/page",pathname:"/settings",require:n,loadChunk:o,interopDefault:d.interopDefault}),q=p.__next_app__,r=p.routeModule,s=p.handler;a.s(["__next_app__",0,q,"handler",0,s,"routeModule",0,r],82600),a.i(82600);var t=a.i(25948);a.s(["ClientPageRoot",()=>t.ClientPageRoot,"ClientSegmentRoot",()=>t.ClientSegmentRoot,"Fragment",()=>t.Fragment,"HTTPAccessFallbackBoundary",()=>t.HTTPAccessFallbackBoundary,"InstantValidation",()=>t.InstantValidation,"LayoutRouter",()=>t.LayoutRouter,"LoadingBoundaryProvider",()=>t.LoadingBoundaryProvider,"Postpone",()=>t.Postpone,"RenderFromTemplateContext",()=>t.RenderFromTemplateContext,"RootLayoutBoundary",()=>t.RootLayoutBoundary,"SegmentViewNode",()=>t.SegmentViewNode,"SegmentViewStateNode",()=>t.SegmentViewStateNode,"__next_app__",0,q,"captureOwnerStack",()=>t.captureOwnerStack,"collectPrefetchHints",()=>t.collectPrefetchHints,"collectSegmentData",()=>t.collectSegmentData,"createElement",()=>t.createElement,"createMetadataComponents",()=>t.createMetadataComponents,"createPrerenderParamsForClientSegment",()=>t.createPrerenderParamsForClientSegment,"createPrerenderSearchParamsForClientPage",()=>t.createPrerenderSearchParamsForClientPage,"createServerParamsForServerSegment",()=>t.createServerParamsForServerSegment,"createServerSearchParamsForServerPage",()=>t.createServerSearchParamsForServerPage,"createTemporaryReferenceSet",()=>t.createTemporaryReferenceSet,"decodeAction",()=>t.decodeAction,"decodeFormState",()=>t.decodeFormState,"decodeReply",()=>t.decodeReply,"handler",0,s,"isEmptyHTMLPrelude",()=>t.isEmptyHTMLPrelude,"patchFetch",()=>t.patchFetch,"preconnect",()=>t.preconnect,"preloadFont",()=>t.preloadFont,"preloadStyle",()=>t.preloadStyle,"prerender",()=>t.prerender,"prerenderToNodeStream",()=>t.prerenderToNodeStream,"renderToPipeableStream",()=>t.renderToPipeableStream,"renderToReadableStream",()=>t.renderToReadableStream,"routeModule",0,r,"serverHooks",()=>t.serverHooks,"taintObjectReference",()=>t.taintObjectReference],29347)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__031i31p._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},71385,a=>{a.v("/_next/static/media/icon.23mz8iwcatff2.svg"+(globalThis.NEXT_CLIENT_ASSET_SUFFIX||""))},48760,a=>{"use strict";let b={src:a.i(71385).default,width:32,height:32};a.s(["default",0,b])},83138,a=>{"use strict";var b=a.i(91396);a.i(52040);var c=a.i(19973);a.i(90103);var d=a.i(24084),e=a.i(97728);a.i(59682);var f=a.i(22381),g=a.i(30358),h=a.i(7969);let i={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};i.node;let j=(0,h.default)(i),k={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};k.node;let l=(0,h.default)(k);function m(a){if(!Number.isFinite(a))return"—";let b=Math.abs(Math.round(a));if(b<1e3)return`${Math.round(a)}ms`;if(b<59950)return`${+(a/1e3).toFixed(1)}s`;let c=Math.round(b/1e3),d=a<0?"-":"";return c<3600?`${d}${Math.floor(c/60)}m ${c%60}s`:`${d}${Math.floor(c/3600)}h ${Math.floor(c%3600/60)}m`}let n=a=>a.length?a.reduce((a,b)=>a+b,0)/a.length:0,o={"new-relic":{label:"New Relic",icon:j,description:"Real-user performance per page: load time, Core Web Vitals, throughput and Apdex.",stats:a=>[{label:"Avg Load Time",value:m(n(a.map(a=>a.newRelic.loadTime)))},{label:"Avg LCP",value:m(n(a.map(a=>a.newRelic.lcp)))},{label:"Avg TTFB",value:m(n(a.map(a=>a.newRelic.ttfb)))},{label:"Avg Apdex",value:n(a.map(a=>a.newRelic.apdexScore)).toFixed(2)}],columns:[{header:"Load",cell:a=>m(a.newRelic.loadTime)},{header:"LCP",cell:a=>m(a.newRelic.lcp)},{header:"TTFB",cell:a=>m(a.newRelic.ttfb)},{header:"CLS",cell:a=>a.newRelic.cls.toFixed(2)},{header:"INP",cell:a=>void 0===a.newRelic.inp?"—":m(a.newRelic.inp)},{header:"Error Rate",cell:a=>`${a.newRelic.errorRate.toFixed(2)}%`},{header:"Throughput",cell:a=>a.newRelic.throughput.toLocaleString()},{header:"Apdex",cell:a=>a.newRelic.apdexScore.toFixed(2)}]},sentry:{label:"Sentry",icon:l,description:"Errors captured per page over the last 24 hours.",stats:a=>{let b=a.reduce((a,b)=>b.sentry.errorCount>(a?.sentry.errorCount??0)?b:a,null);return[{label:"Total Errors",value:String(a.map(a=>a.sentry.errorCount).reduce((a,b)=>a+b,0))},{label:"Pages With Errors",value:`${a.filter(a=>a.sentry.errorCount>0).length} of ${a.length}`},{label:"Noisiest Page",value:b?.name??"None"}]},columns:[{header:"Errors",cell:a=>String(a.sentry.errorCount)},{header:"Latest Error",cell:a=>a.sentry.latestErrors[0]?.title??"—"},{header:"Last Seen",cell:a=>{let b=Date.parse(a.sentry.latestErrors[0]?.lastSeen??"");return Number.isNaN(b)?"—":new Date(b).toLocaleString()}}]}};async function p({params:a}){let{tool:h}=await a;return Object.hasOwn(o,h)||(0,c.notFound)(),(0,b.jsxs)(e.SidebarProvider,{children:[(0,b.jsx)(d.AppSidebar,{}),(0,b.jsxs)(e.SidebarInset,{className:"bg-dash-surface",children:[(0,b.jsx)(f.Header,{}),(0,b.jsxs)("div",{className:"flex flex-1 flex-col p-6 md:p-8 max-w-[1600px] mx-auto w-full",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold text-white tracking-tight mb-2",children:o[h].label}),(0,b.jsx)("p",{className:"text-sm text-gray-400",children:o[h].description}),(0,b.jsx)(g.ToolInsights,{tool:h})]})]})]})}Object.keys(o),a.s(["default",0,p],83138)},58839,function(a){a.n(a.i(83138))},57784,a=>{"use strict";a.s(["ToolInsights",()=>b]);let b=(0,a.i(18060).registerClientReference)(function(){throw Error("Attempted to call ToolInsights() from the server but ToolInsights 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.")},"[project]/components/ToolInsights/ToolInsights.tsx","ToolInsights")},30358,a=>{"use strict";var b=a.i(57784);a.n(b)},33951,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(18060).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/node_modules/.pnpm/lucide-react@1.47.0_react@19.2.8/node_modules/lucide-react/dist/esm/Icon.mjs 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.")},"[project]/node_modules/.pnpm/lucide-react@1.47.0_react@19.2.8/node_modules/lucide-react/dist/esm/Icon.mjs","default")},50254,a=>{"use strict";var b=a.i(33951);a.n(b)},7969,a=>{"use strict";var b=a.i(56149),c=a.i(50254);a.s(["default",0,function(a,d=[],e=[]){let f,g="string"==typeof a?function(a,b,c=[]){if(null==b)throw Error("[lucide]: iconNode is required when icon name is used");return{name:a?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),size:24,node:b,...c.length>0?{aliases:c}:{}}}(a,d,e):a,h=(0,b.forwardRef)(({className:a,...d},e)=>(0,b.createElement)(c.default,{ref:e,icon:g,className:a,...d}));return g.name&&(h.displayName=(f=(a=>{let b="",c=!1;for(let d of a){if("-"===d||"_"===d||d<=" "){c=b.length>0;continue}0===b.length?b+=d.toLowerCase():b+=c?d.toUpperCase():d,c=!1}return b})(g.name)).charAt(0).toUpperCase()+f.slice(1)),h}],7969)},36256,a=>{"use strict";var b=a.i(46797),c=a.i(282),d=a.i(89196);a.i(60796);let e=(0,b.instrumentModuleGetter)(()=>a.r(48760)),f=(0,b.instrumentModuleGetter)(()=>a.r(70864)),g=(0,b.instrumentModuleGetter)(()=>a.r(45538)),h=(0,b.instrumentModuleGetter)(()=>a.r(54254)),i=(0,b.instrumentModuleGetter)(()=>a.r(73833)),j=(0,b.instrumentModuleGetter)(()=>a.r(35191)),k=(0,b.instrumentModuleGetter)(()=>a.r(68119)),l=["",{children:["tools",{children:["[tool]",{children:["__PAGE__",{},{metadata:{},page:[(0,b.instrumentModuleGetter)(()=>a.r(58839)),"[project]/app/tools/[tool]/page.tsx"]},[]]},{metadata:{}},[]]},{metadata:{}},[]]},{metadata:{icon:[async()=>{let a=(0,d.interopDefault)(await e());return[{url:`/icon.svg?${a.src.split("/").splice(-1)[0]}`,sizes:"any",type:"image/svg+xml"}]}]},layout:[f,"[project]/app/layout.tsx"],loading:[g,"[project]/app/loading.tsx"],"not-found":[h,"[project]/node_modules/.pnpm/next@16.3.8_@babel+core@7.29.7_supports-color@8.1.1__@opentelemetry+api@1.9.1_@types+no_c2c791d25241ae4161c9f48ecf186c77/node_modules/next/dist/client/components/builtin/not-found.js"],forbidden:[i,"[project]/node_modules/.pnpm/next@16.3.8_@babel+core@7.29.7_supports-color@8.1.1__@opentelemetry+api@1.9.1_@types+no_c2c791d25241ae4161c9f48ecf186c77/node_modules/next/dist/client/components/builtin/forbidden.js"],unauthorized:[j,"[project]/node_modules/.pnpm/next@16.3.8_@babel+core@7.29.7_supports-color@8.1.1__@opentelemetry+api@1.9.1_@types+no_c2c791d25241ae4161c9f48ecf186c77/node_modules/next/dist/client/components/builtin/unauthorized.js"],"global-error":[k,"[project]/node_modules/.pnpm/next@16.3.8_@babel+core@7.29.7_supports-color@8.1.1__@opentelemetry+api@1.9.1_@types+no_c2c791d25241ae4161c9f48ecf186c77/node_modules/next/dist/client/components/builtin/global-error.js"]},[]],m=a.r.bind(a),n=a.l.bind(a),o=(0,c.createAppPageEntrypoint)({tree:l,page:"/tools/[tool]/page",pathname:"/tools/[tool]",require:m,loadChunk:n,interopDefault:d.interopDefault}),p=o.__next_app__,q=o.routeModule,r=o.handler;a.s(["__next_app__",0,p,"handler",0,r,"routeModule",0,q],52931),a.i(52931);var s=a.i(25948);a.s(["ClientPageRoot",()=>s.ClientPageRoot,"ClientSegmentRoot",()=>s.ClientSegmentRoot,"Fragment",()=>s.Fragment,"HTTPAccessFallbackBoundary",()=>s.HTTPAccessFallbackBoundary,"InstantValidation",()=>s.InstantValidation,"LayoutRouter",()=>s.LayoutRouter,"LoadingBoundaryProvider",()=>s.LoadingBoundaryProvider,"Postpone",()=>s.Postpone,"RenderFromTemplateContext",()=>s.RenderFromTemplateContext,"RootLayoutBoundary",()=>s.RootLayoutBoundary,"SegmentViewNode",()=>s.SegmentViewNode,"SegmentViewStateNode",()=>s.SegmentViewStateNode,"__next_app__",0,p,"captureOwnerStack",()=>s.captureOwnerStack,"collectPrefetchHints",()=>s.collectPrefetchHints,"collectSegmentData",()=>s.collectSegmentData,"createElement",()=>s.createElement,"createMetadataComponents",()=>s.createMetadataComponents,"createPrerenderParamsForClientSegment",()=>s.createPrerenderParamsForClientSegment,"createPrerenderSearchParamsForClientPage",()=>s.createPrerenderSearchParamsForClientPage,"createServerParamsForServerSegment",()=>s.createServerParamsForServerSegment,"createServerSearchParamsForServerPage",()=>s.createServerSearchParamsForServerPage,"createTemporaryReferenceSet",()=>s.createTemporaryReferenceSet,"decodeAction",()=>s.decodeAction,"decodeFormState",()=>s.decodeFormState,"decodeReply",()=>s.decodeReply,"handler",0,r,"isEmptyHTMLPrelude",()=>s.isEmptyHTMLPrelude,"patchFetch",()=>s.patchFetch,"preconnect",()=>s.preconnect,"preloadFont",()=>s.preloadFont,"preloadStyle",()=>s.preloadStyle,"prerender",()=>s.prerender,"prerenderToNodeStream",()=>s.prerenderToNodeStream,"renderToPipeableStream",()=>s.renderToPipeableStream,"renderToReadableStream",()=>s.renderToReadableStream,"routeModule",0,q,"serverHooks",()=>s.serverHooks,"taintObjectReference",()=>s.taintObjectReference],36256)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0kocjhm._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[49719,(a,b,c)=>{b.exports=a.x("assert",()=>require("assert"))},27699,(a,b,c)=>{b.exports=a.x("events",()=>require("events"))},22734,(a,b,c)=>{b.exports=a.x("fs",()=>require("fs"))},21517,(a,b,c)=>{b.exports=a.x("http",()=>require("http"))},25328,(a,b,c)=>{b.exports=a.x("http2",()=>require("http2"))},24836,(a,b,c)=>{b.exports=a.x("https",()=>require("https"))},4446,(a,b,c)=>{b.exports=a.x("net",()=>require("net"))},93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},46786,(a,b,c)=>{b.exports=a.x("os",()=>require("os"))},88947,(a,b,c)=>{b.exports=a.x("stream",()=>require("stream"))},55004,(a,b,c)=>{b.exports=a.x("tls",()=>require("tls"))},70722,(a,b,c)=>{b.exports=a.x("tty",()=>require("tty"))},92509,(a,b,c)=>{b.exports=a.x("url",()=>require("url"))},6461,(a,b,c)=>{b.exports=a.x("zlib",()=>require("zlib"))},71385,a=>{a.v("/_next/static/media/icon.23mz8iwcatff2.svg"+(globalThis.NEXT_CLIENT_ASSET_SUFFIX||""))},48760,a=>{"use strict";let b={src:a.i(71385).default,width:32,height:32};a.s(["default",0,b])},28281,a=>{"use strict";var b=a.i(46797),c=a.i(282),d=a.i(89196);a.i(60796);let e=(0,b.instrumentModuleGetter)(()=>a.r(48760)),f=(0,b.instrumentModuleGetter)(()=>a.r(70864)),g=(0,b.instrumentModuleGetter)(()=>a.r(45538)),h=(0,b.instrumentModuleGetter)(()=>a.r(54254)),i=(0,b.instrumentModuleGetter)(()=>a.r(73833)),j=(0,b.instrumentModuleGetter)(()=>a.r(35191)),k=(0,b.instrumentModuleGetter)(()=>a.r(68119)),l=(0,b.instrumentModuleGetter)(()=>a.r(78932)),m=(0,b.instrumentModuleGetter)(()=>a.r(27991)),n=["",{children:["performance",{children:["[slug]",{children:["__PAGE__",{},{metadata:{},page:[(0,b.instrumentModuleGetter)(()=>a.r(77450)),"[project]/app/performance/[slug]/page.tsx"]},[]]},{metadata:{},loading:[m,"[project]/app/performance/[slug]/loading.tsx"]},[]]},{metadata:{},loading:[l,"[project]/app/performance/loading.tsx"]},[]]},{metadata:{icon:[async()=>{let a=(0,d.interopDefault)(await e());return[{url:`/icon.svg?${a.src.split("/").splice(-1)[0]}`,sizes:"any",type:"image/svg+xml"}]}]},layout:[f,"[project]/app/layout.tsx"],loading:[g,"[project]/app/loading.tsx"],"not-found":[h,"[project]/node_modules/.pnpm/next@16.3.8_@babel+core@7.29.7_supports-color@8.1.1__@opentelemetry+api@1.9.1_@types+no_c2c791d25241ae4161c9f48ecf186c77/node_modules/next/dist/client/components/builtin/not-found.js"],forbidden:[i,"[project]/node_modules/.pnpm/next@16.3.8_@babel+core@7.29.7_supports-color@8.1.1__@opentelemetry+api@1.9.1_@types+no_c2c791d25241ae4161c9f48ecf186c77/node_modules/next/dist/client/components/builtin/forbidden.js"],unauthorized:[j,"[project]/node_modules/.pnpm/next@16.3.8_@babel+core@7.29.7_supports-color@8.1.1__@opentelemetry+api@1.9.1_@types+no_c2c791d25241ae4161c9f48ecf186c77/node_modules/next/dist/client/components/builtin/unauthorized.js"],"global-error":[k,"[project]/node_modules/.pnpm/next@16.3.8_@babel+core@7.29.7_supports-color@8.1.1__@opentelemetry+api@1.9.1_@types+no_c2c791d25241ae4161c9f48ecf186c77/node_modules/next/dist/client/components/builtin/global-error.js"]},[]],o=a.r.bind(a),p=a.l.bind(a),q=(0,c.createAppPageEntrypoint)({tree:n,page:"/performance/[slug]/page",pathname:"/performance/[slug]",require:o,loadChunk:p,interopDefault:d.interopDefault}),r=q.__next_app__,s=q.routeModule,t=q.handler;a.s(["__next_app__",0,r,"handler",0,t,"routeModule",0,s],66578),a.i(66578);var u=a.i(25948);a.s(["ClientPageRoot",()=>u.ClientPageRoot,"ClientSegmentRoot",()=>u.ClientSegmentRoot,"Fragment",()=>u.Fragment,"HTTPAccessFallbackBoundary",()=>u.HTTPAccessFallbackBoundary,"InstantValidation",()=>u.InstantValidation,"LayoutRouter",()=>u.LayoutRouter,"LoadingBoundaryProvider",()=>u.LoadingBoundaryProvider,"Postpone",()=>u.Postpone,"RenderFromTemplateContext",()=>u.RenderFromTemplateContext,"RootLayoutBoundary",()=>u.RootLayoutBoundary,"SegmentViewNode",()=>u.SegmentViewNode,"SegmentViewStateNode",()=>u.SegmentViewStateNode,"__next_app__",0,r,"captureOwnerStack",()=>u.captureOwnerStack,"collectPrefetchHints",()=>u.collectPrefetchHints,"collectSegmentData",()=>u.collectSegmentData,"createElement",()=>u.createElement,"createMetadataComponents",()=>u.createMetadataComponents,"createPrerenderParamsForClientSegment",()=>u.createPrerenderParamsForClientSegment,"createPrerenderSearchParamsForClientPage",()=>u.createPrerenderSearchParamsForClientPage,"createServerParamsForServerSegment",()=>u.createServerParamsForServerSegment,"createServerSearchParamsForServerPage",()=>u.createServerSearchParamsForServerPage,"createTemporaryReferenceSet",()=>u.createTemporaryReferenceSet,"decodeAction",()=>u.decodeAction,"decodeFormState",()=>u.decodeFormState,"decodeReply",()=>u.decodeReply,"handler",0,t,"isEmptyHTMLPrelude",()=>u.isEmptyHTMLPrelude,"patchFetch",()=>u.patchFetch,"preconnect",()=>u.preconnect,"preloadFont",()=>u.preloadFont,"preloadStyle",()=>u.preloadStyle,"prerender",()=>u.prerender,"prerenderToNodeStream",()=>u.prerenderToNodeStream,"renderToPipeableStream",()=>u.renderToPipeableStream,"renderToReadableStream",()=>u.renderToReadableStream,"routeModule",0,s,"serverHooks",()=>u.serverHooks,"taintObjectReference",()=>u.taintObjectReference],28281)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__1thxzex._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[47872,a=>{"use strict";var b=a.i(47350),c=a.i(75086),d=a.i(3130),e=a.i(40695),f=a.i(5522);let g=[{id:"gemini",label:"Google Gemini",help:"Create a key at aistudio.google.com/apikey."},{id:"claude",label:"Anthropic Claude",help:"Create a key at console.anthropic.com > API keys."},{id:"openai",label:"OpenAI",help:"Create a key at platform.openai.com/api-keys."}];a.s(["AiKeyForm",0,function(){let[a,h]=(0,c.useState)(g[0].id),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(null),[m,n]=(0,c.useState)({}),[o,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(!1);async function s(b){b.preventDefault(),r(!0),p(null);try{let b=await fetch("/api/setup/ai",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:a,key:i})}),c=await b.json();c.saved?(j(""),l(a),n({...m,[a]:!0}),p({ok:!0,text:"Saved. AI suggestions now use this provider. No restart needed."})):p({ok:!1,text:c.error??"Nothing was saved."})}catch{p({ok:!1,text:"Could not reach the dashboard server."})}finally{r(!1)}}(0,c.useEffect)(()=>{fetch("/api/setup/ai").then(a=>a.json()).then(a=>{a.keys&&(n(a.keys),l(a.provider),a.provider&&h(a.provider))}).catch(()=>{})},[]);let t=g.find(b=>b.id===a);return(0,b.jsxs)(d.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md max-w-2xl mt-6",children:[(0,b.jsxs)(d.CardHeader,{children:[(0,b.jsx)(d.CardTitle,{className:"text-[18px] font-bold text-white tracking-tight",children:"AI suggestions (optional)"}),(0,b.jsx)(d.CardDescription,{className:"text-sm text-gray-400",children:"Add a Gemini, Claude or OpenAI key to get AI insights and recommendations for your pages. Only page names, load times and error counts are sent to the provider you pick. Without a key, the dashboard shows sample suggestions."})]}),(0,b.jsx)(d.CardContent,{children:(0,b.jsxs)("form",{onSubmit:s,className:"flex flex-col gap-5",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)("label",{htmlFor:"ai-provider",className:"text-sm font-medium text-gray-300",children:"Provider"}),(0,b.jsx)("select",{id:"ai-provider",value:a,onChange:a=>h(a.target.value),className:"h-9 rounded-md border border-[#2d3748] bg-[#0f1419] px-3 text-sm text-gray-200",children:g.map(a=>(0,b.jsxs)("option",{value:a.id,children:[a.label,k===a.id?" (in use)":m[a.id]?" (key saved)":""]},a.id))})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,b.jsxs)("label",{htmlFor:"ai-key",className:"text-sm font-medium text-gray-300",children:[t.label," API key ",m[a]&&(0,b.jsx)("span",{className:"ml-2 text-xs text-[#3ee0a1]",children:"✓ Set"})]}),(0,b.jsx)(f.Input,{id:"ai-key",type:"password",autoComplete:"off",spellCheck:!1,placeholder:m[a]?"•••••••• (type to replace)":"",value:i,onChange:a=>j(a.target.value),"aria-describedby":"ai-key-help",className:"bg-[#0f1419] border-[#2d3748] text-gray-200 font-mono text-xs"}),(0,b.jsx)("p",{id:"ai-key-help",className:"text-xs text-gray-400",children:t.help})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)(e.Button,{type:"submit",disabled:q||!i.trim(),children:q?"Checking…":"Check and save"}),(0,b.jsx)("span",{"aria-live":"polite",className:`text-sm ${o?.ok?"text-[#3ee0a1]":"text-[#f87171]"}`,children:o?.text})]})]})})]})}])},46334,a=>{"use strict";var b=a.i(47350),c=a.i(75086),d=a.i(56561),e=a.i(3130),f=a.i(40695),g=a.i(5522);let h=[{name:"NEWRELIC_API_KEY",label:"New Relic User API key",secret:!0,help:'READS your data (starts NRAK-). Create it under API keys > key type "User".'},{name:"NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID",label:"New Relic account ID",secret:!1,help:"A plain number, shown next to your keys in New Relic."},{name:"SENTRY_API_KEY",label:"Sentry auth token",secret:!0,help:"Lets the dashboard read issues (scopes: project:read, event:read)."},{name:"SENTRY_DSN",label:"Sentry DSN",secret:!1,help:"Project settings, then Client Keys (DSN). The project and host are read from it."}];a.s(["SetupForm",0,function(){let[a,i]=(0,c.useState)({}),[j,k]=(0,c.useState)({}),[l,m]=(0,c.useState)({}),[n,o]=(0,c.useState)(null),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),t=(0,c.useRef)(null);async function u(b){b.preventDefault(),q(!0),o(null);try{let b=await fetch("/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json(),d=c.results??{};m(d);let e=h.find(a=>d[a.name]&&!d[a.name].ok);e&&setTimeout(()=>t.current?.querySelector(`#${e.name}`)?.focus(),0),c.saved?(s(!0),i({}),k(Object.fromEntries(h.map(a=>[a.name,!0]))),o({ok:!0,text:"Saved. Your keys are valid and stored in .env.local. No restart needed."})):o({ok:!1,text:c.error??"Nothing was saved. Fix the fields marked below."})}catch{o({ok:!1,text:"Could not reach the dashboard server."})}finally{q(!1)}}return(0,c.useEffect)(()=>{fetch("/api/setup").then(a=>a.json()).then(a=>{a.keys?k(a.keys):a.error&&o({ok:!1,text:a.error})}).catch(()=>{})},[]),(0,b.jsxs)(e.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md max-w-2xl",children:[(0,b.jsxs)(e.CardHeader,{children:[(0,b.jsx)(e.CardTitle,{className:"text-[18px] font-bold text-white tracking-tight",children:"Connect New Relic and Sentry"}),(0,b.jsx)(e.CardDescription,{className:"text-sm text-gray-400",children:"Keys are checked once, saved to .env.local in this folder, and never shown again. The key that sends events (Ingest - License) is separate and is added later on the Connect page."})]}),(0,b.jsx)(e.CardContent,{children:(0,b.jsxs)("form",{ref:t,onSubmit:u,className:"flex flex-col gap-5",children:[h.map(c=>{let d=l[c.name];return(0,b.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,b.jsxs)("label",{htmlFor:c.name,className:"text-sm font-medium text-gray-300",children:[c.label," ",j[c.name]&&(0,b.jsx)("span",{className:"ml-2 text-xs text-[#3ee0a1]",children:"✓ Set"})]}),(0,b.jsx)(g.Input,{id:c.name,name:c.name,type:c.secret?"password":"text",autoComplete:"off",spellCheck:!1,placeholder:j[c.name]?"•••••••• (leave blank to keep, type to replace)":"",value:a[c.name]??"",onChange:b=>i({...a,[c.name]:b.target.value}),"aria-invalid":!!d&&!d.ok||void 0,"aria-describedby":`${c.name}-help ${c.name}-result`,className:"bg-[#0f1419] border-[#2d3748] text-gray-200 font-mono text-xs"}),(0,b.jsx)("p",{id:`${c.name}-help`,className:"text-xs text-gray-400",children:c.help}),(0,b.jsxs)("div",{id:`${c.name}-result`,"aria-live":"polite",children:[d&&!d.ok&&(0,b.jsxs)("p",{className:"text-xs text-[#f87171]",children:["✗ ",d.error]}),d?.ok&&(0,b.jsx)("p",{className:"text-xs text-[#3ee0a1]",children:"✓ Checked"})]})]},c.name)}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)(f.Button,{type:"submit",disabled:p,children:p?"Checking…":"Check and save"}),(0,b.jsx)("span",{"aria-live":"polite",className:`text-sm ${n?.ok?"text-[#3ee0a1]":"text-[#f87171]"}`,children:n?.text}),r&&(0,b.jsx)(d.default,{href:"/connect",className:(0,f.buttonVariants)({variant:"outline"}),children:"Next: connect your app"})]})]})})]})}])},3130,a=>{"use strict";var b=a.i(47350),c=a.i(85198);a.s(["Card",0,function({className:a,size:d="default",...e}){return(0,b.jsx)("div",{"data-slot":"card","data-size":d,className:(0,c.cn)("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...e})},"CardContent",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-content",className:(0,c.cn)("px-(--card-spacing)",a),...d})},"CardDescription",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-description",className:(0,c.cn)("text-sm text-muted-foreground",a),...d})},"CardHeader",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-header",className:(0,c.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",a),...d})},"CardTitle",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-title",className:(0,c.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",a),...d})}])},23904,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={actionAsyncStorage:function(){return f.actionAsyncStorage},workAsyncStorage:function(){return g.workAsyncStorage},workUnitAsyncStorage:function(){return h.workUnitAsyncStorage}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(20635),g=a.r(56704),h=a.r(32319);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)}];
2
-
3
- //# sourceMappingURL=_0defuav._.js.map