@karan171996/metricflow 0.5.0 → 0.5.2

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 (108) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/fallback-build-manifest.json +3 -3
  4. package/.next/server/app/_global-error.html +1 -1
  5. package/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  9. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  10. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/_not-found.html +2 -2
  12. package/.next/server/app/_not-found.rsc +6 -6
  13. package/.next/server/app/_not-found.segments/_full.segment.rsc +6 -6
  14. package/.next/server/app/_not-found.segments/_index.segment.rsc +6 -6
  15. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  17. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  18. package/.next/server/app/api/connect/route.js.nft.json +1 -1
  19. package/.next/server/app/api/health/route.js.nft.json +1 -1
  20. package/.next/server/app/api/metrics/route.js.nft.json +1 -1
  21. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  22. package/.next/server/app/api/setup/ai/route.js.nft.json +1 -1
  23. package/.next/server/app/api/setup/route.js.nft.json +1 -1
  24. package/.next/server/app/connect/page.js.nft.json +1 -1
  25. package/.next/server/app/connect/page_client-reference-manifest.js +1 -1
  26. package/.next/server/app/connect.html +2 -2
  27. package/.next/server/app/connect.rsc +8 -8
  28. package/.next/server/app/connect.segments/_full.segment.rsc +8 -8
  29. package/.next/server/app/connect.segments/_index.segment.rsc +6 -6
  30. package/.next/server/app/connect.segments/_tree.segment.rsc +1 -1
  31. package/.next/server/app/connect.segments/connect/__PAGE__.segment.rsc +6 -6
  32. package/.next/server/app/index.html +2 -2
  33. package/.next/server/app/index.rsc +8 -8
  34. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  35. package/.next/server/app/index.segments/_full.segment.rsc +8 -8
  36. package/.next/server/app/index.segments/_index.segment.rsc +6 -6
  37. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  38. package/.next/server/app/page.js.nft.json +1 -1
  39. package/.next/server/app/page_client-reference-manifest.js +1 -1
  40. package/.next/server/app/performance/[slug]/page.js.nft.json +1 -1
  41. package/.next/server/app/performance/[slug]/page_client-reference-manifest.js +1 -1
  42. package/.next/server/app/performance/page.js.nft.json +1 -1
  43. package/.next/server/app/performance/page_client-reference-manifest.js +1 -1
  44. package/.next/server/app/performance.html +2 -2
  45. package/.next/server/app/performance.rsc +9 -9
  46. package/.next/server/app/performance.segments/_full.segment.rsc +9 -9
  47. package/.next/server/app/performance.segments/_index.segment.rsc +6 -6
  48. package/.next/server/app/performance.segments/_tree.segment.rsc +1 -1
  49. package/.next/server/app/performance.segments/performance/__PAGE__.segment.rsc +7 -7
  50. package/.next/server/app/settings/page.js.nft.json +1 -1
  51. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  52. package/.next/server/app/settings.html +2 -2
  53. package/.next/server/app/settings.rsc +17 -17
  54. package/.next/server/app/settings.segments/_full.segment.rsc +17 -17
  55. package/.next/server/app/settings.segments/_index.segment.rsc +6 -6
  56. package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  57. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +16 -16
  58. package/.next/server/app/setup/page.js.nft.json +1 -1
  59. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  60. package/.next/server/app/setup.html +2 -2
  61. package/.next/server/app/setup.rsc +9 -9
  62. package/.next/server/app/setup.segments/_full.segment.rsc +9 -9
  63. package/.next/server/app/setup.segments/_index.segment.rsc +6 -6
  64. package/.next/server/app/setup.segments/_tree.segment.rsc +1 -1
  65. package/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +7 -7
  66. package/.next/server/app/tools/[tool]/page.js.nft.json +1 -1
  67. package/.next/server/app/tools/[tool]/page_client-reference-manifest.js +1 -1
  68. package/.next/server/chunks/[root-of-the-server]__00bbqkl._.js +1 -1
  69. package/.next/server/chunks/[root-of-the-server]__0fkj1-q._.js +1 -1
  70. package/.next/server/chunks/[root-of-the-server]__0rfr72x._.js +1 -1
  71. package/.next/server/chunks/[root-of-the-server]__186pj_c._.js +1 -1
  72. package/.next/server/chunks/[root-of-the-server]__19yigji._.js +1 -1
  73. package/.next/server/chunks/[root-of-the-server]__1igrw77._.js +1 -1
  74. package/.next/server/chunks/[root-of-the-server]__1xo4bin._.js +1 -1
  75. package/.next/server/chunks/_0w8wvdn._.js +1 -1
  76. package/.next/server/chunks/_0wct7-r._.js +1 -1
  77. package/.next/server/chunks/ssr/0x0c_next_dist_1icgwks._.js +1 -1
  78. package/.next/server/chunks/ssr/[root-of-the-server]__0o_fd5z._.js +1 -1
  79. package/.next/server/chunks/ssr/_0_02db6._.js +1 -1
  80. package/.next/server/chunks/ssr/_0bxxvzb._.js +1 -1
  81. package/.next/server/chunks/ssr/_0htqt7_._.js +1 -1
  82. package/.next/server/chunks/ssr/_0ompurr._.js +2 -2
  83. package/.next/server/chunks/ssr/_0un641_._.js +1 -1
  84. package/.next/server/chunks/ssr/_13m9nev._.js +1 -1
  85. package/.next/server/chunks/ssr/_14aoqb2._.js +1 -1
  86. package/.next/server/middleware-build-manifest.js +3 -3
  87. package/.next/server/pages/404.html +2 -2
  88. package/.next/server/pages/500.html +1 -1
  89. package/.next/static/chunks/0_xh0vh4uh0vk.js +1 -0
  90. package/.next/static/chunks/19qbz8dh8aqt6.js +1 -0
  91. package/.next/static/chunks/2-az50vi0iboz.js +5 -0
  92. package/.next/static/chunks/2wmat901j6po0.js +1 -0
  93. package/.next/static/chunks/{2p8myet8kmrgx.js → 332-owz6utwp5.js} +1 -1
  94. package/.next/static/chunks/3ab7oxjuh1asy.js +1 -0
  95. package/.next/trace +1 -1
  96. package/.next/trace-build +1 -1
  97. package/README.md +1 -0
  98. package/bin/cli.mjs +2 -2
  99. package/bin/output.mjs +1 -0
  100. package/package.json +1 -1
  101. package/.next/static/chunks/0798_gs3g5aja.js +0 -1
  102. package/.next/static/chunks/1_dhsu7ouiell.js +0 -5
  103. package/.next/static/chunks/268zd4cpgc5jh.js +0 -1
  104. package/.next/static/chunks/3ah6umj9qtdhc.js +0 -1
  105. package/.next/static/chunks/3wwhtfj-3akyd.js +0 -1
  106. /package/.next/static/{eV4px19Q3p5aL-JnEEP-F → wZ6L7QBGYuFD01WhrymMz}/_buildManifest.js +0 -0
  107. /package/.next/static/{eV4px19Q3p5aL-JnEEP-F → wZ6L7QBGYuFD01WhrymMz}/_clientMiddlewareManifest.js +0 -0
  108. /package/.next/static/{eV4px19Q3p5aL-JnEEP-F → wZ6L7QBGYuFD01WhrymMz}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
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"))},12892,67119,e=>{"use strict";var t=e.i(2157),r=e.i(50227),n=e.i(39151),o=e.i(19374);function s(e,t=[],r=[]){let a,i="string"==typeof e?function(e,t,r=[]){if(null==t)throw Error("[lucide]: iconNode is required when icon name is used");return{name:e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),size:24,node:t,...r.length>0?{aliases:r}:{}}}(e,t,r):e,l=(0,n.forwardRef)(({className:e,...t},r)=>(0,n.createElement)(o.default,{ref:r,icon:i,className:e,...t}));return i.name&&(l.displayName=(a=(e=>{let t="",r=!1;for(let n of e){if("-"===n||"_"===n||n<=" "){r=t.length>0;continue}0===t.length?t+=n.toLowerCase():t+=r?n.toUpperCase():n,r=!1}return t})(i.name)).charAt(0).toUpperCase()+a.slice(1)),l}let a={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"}]]};a.node;let i=s(a),l={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"}]]};l.node;let c=s(l);function u(e){if(!Number.isFinite(e))return"—";let t=Math.abs(Math.round(e));if(t<1e3)return`${Math.round(e)}ms`;if(t<59950)return`${+(e/1e3).toFixed(1)}s`;let r=Math.round(t/1e3),n=e<0?"-":"";return r<3600?`${n}${Math.floor(r/60)}m ${r%60}s`:`${n}${Math.floor(r/3600)}h ${Math.floor(r%3600/60)}m`}let p=e=>e.length?e.reduce((e,t)=>e+t,0)/e.length:0,d={"new-relic":{label:"New Relic",icon:i,description:"Real-user performance per page: load time, Core Web Vitals, throughput and Apdex.",keys:{required:["NEWRELIC_API_KEY","NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID"],optional:["NEWRELIC_INSERT_KEY"]},stats:e=>[{label:"Avg Load Time",value:u(p(e.map(e=>e.newRelic.loadTime)))},{label:"Avg LCP",value:u(p(e.map(e=>e.newRelic.lcp)))},{label:"Avg TTFB",value:u(p(e.map(e=>e.newRelic.ttfb)))},{label:"Avg Apdex",value:p(e.map(e=>e.newRelic.apdexScore)).toFixed(2)}],columns:[{header:"Load",cell:e=>u(e.newRelic.loadTime)},{header:"LCP",cell:e=>u(e.newRelic.lcp)},{header:"TTFB",cell:e=>u(e.newRelic.ttfb)},{header:"CLS",cell:e=>e.newRelic.cls.toFixed(2)},{header:"INP",cell:e=>void 0===e.newRelic.inp?"—":u(e.newRelic.inp)},{header:"Error Rate",cell:e=>`${e.newRelic.errorRate.toFixed(2)}%`},{header:"Throughput",cell:e=>e.newRelic.throughput.toLocaleString()},{header:"Apdex",cell:e=>e.newRelic.apdexScore.toFixed(2)}]},sentry:{label:"Sentry",icon:c,description:"Errors captured per page over the last 24 hours.",keys:{required:["SENTRY_API_KEY","SENTRY_DSN"],optional:[]},stats:e=>{let t=e.reduce((e,t)=>(t.sentry?.errorCount??0)>(e?.sentry?.errorCount??0)?t:e,null);return[{label:"Total Errors",value:String(e.map(e=>e.sentry?.errorCount??0).reduce((e,t)=>e+t,0))},{label:"Pages With Errors",value:`${e.filter(e=>(e.sentry?.errorCount??0)>0).length} of ${e.length}`},{label:"Noisiest Page",value:t?.name??"None"}]},columns:[{header:"Errors",cell:e=>String(e.sentry?.errorCount??0)},{header:"Latest Error",cell:e=>e.sentry?.latestErrors[0]?.title??"—"},{header:"Last Seen",cell:e=>{let t=Date.parse(e.sentry?.latestErrors[0]?.lastSeen??"");return Number.isNaN(t)?"—":new Date(t).toLocaleString()}}]}},h=Object.keys(d);e.s(["KEY_LABELS",0,{NEWRELIC_API_KEY:"New Relic User API key",NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID:"New Relic account ID",SENTRY_API_KEY:"Sentry auth token",SENTRY_DSN:"Sentry DSN"},"TOOLS",0,d,"TOOL_IDS",0,h],67119);let E="NEWRELIC_REGION",f={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"}},x={gemini:{label:"Google Gemini",key:"GEMINI_API_KEY"},claude:{label:"Anthropic Claude",key:"CLAUDE_API_KEY"},openai:{label:"OpenAI",key:"OPENAI_API_KEY"}},m="AI_PROVIDER";function g(e){return process.env[e]??""}let y=e=>d[e].keys.required.every(e=>g(e));function R(){return process.env.METRICFLOW_PROJECT_DIR||process.cwd()}e.s(["AI_PROVIDERS",0,x,"AI_PROVIDER_KEY",0,m,"INSERT_KEY",0,"NEWRELIC_INSERT_KEY","REGION_KEY",0,E,"SETUP_KEYS",0,["NEWRELIC_API_KEY","NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID","SENTRY_API_KEY","SENTRY_DSN"],"activeAi",0,function(){let e=process.env[m];for(let t of(e&&e in x?[e]:[]).concat(Object.keys(x))){let e=process.env[x[t].key];if(e)return{provider:t,key:e}}return null},"connectedTools",0,()=>h.filter(y),"env",0,g,"isToolConnected",0,y,"nrHosts",0,(e="eu"===process.env[E]?"eu":"us")=>f[e],"projectDir",0,R,"writeEnvLocal",0,function(e,n=process.env.METRICFLOW_ENV_FILE||(0,r.join)(R(),".env.local")){let o=(0,t.existsSync)(n)?(0,t.readFileSync)(n,"utf8").split("\n"):[],s=new Map(Object.entries(e)),a=o.map(e=>{let t=e.match(/^\s*([A-Z0-9_]+)\s*=/)?.[1];if(t&&s.has(t)){let e=s.get(t);return s.delete(t),`${t}=${e}`}return e});for(;a.length&&""===a[a.length-1];)a.pop();for(let[e,t]of s)a.push(`${e}=${t}`);let i=`${n}.tmp`;for(let[r,o]of((0,t.writeFileSync)(i,a.join("\n")+"\n",{mode:384}),(0,t.renameSync)(i,n),Object.entries(e)))process.env[r]=o}],12892)},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 o=(e.headers.get("host")??"").replace(/:\d+$/,"");if(!t.has(o))return!1;let s=e.headers.get("origin");try{return!s||t.has(new URL(s).hostname)}catch{return!1}}])},84594,e=>{"use strict";var t=e.i(60756),r=e.i(12892);async function n(e,o=()=>!1){let s,a;if(process.env[r.REGION_KEY])return e((0,r.nrHosts)());try{if(s=await e((0,r.nrHosts)("us")),!o(s))return s}catch(r){let e=t.default.isAxiosError(r)?r.response?.status:void 0;if(401!==e&&403!==e)throw r;a=r}try{let t=await e((0,r.nrHosts)("eu"));if(!o(t))return process.env[r.REGION_KEY]="eu",t}catch{}if(a)throw a;return s}async function o(e,r,o){return(await n(n=>t.default.post(n.graphql,{query:r},{headers:{"API-Key":e,"Content-Type":"application/json"},timeout:o}),e=>!e.data?.data?.actor)).data}e.s(["nrGraphql",0,o,"withRegion",0,n])},83808,e=>{"use strict";var t=e.i(60756);async function r(e,r){let n={Authorization:`Bearer ${e}`},o=r.orgId?await t.default.get(`${r.apiBase}/organizations/`,{headers:n,timeout:8e3}):await t.default.get(`${r.apiBase}/projects/`,{headers:n,timeout:8e3}),s=Array.isArray(o.data)?o.data:[];return(r.orgId?s.find(e=>String(e.id)===r.orgId)?.slug:s.find(e=>String(e.id)===r.projectId)?.organization?.slug)??null}e.s(["orgSlugForDsn",0,r,"parseSentryDsn",0,function(e){let t;try{t=new URL(e)}catch{return{ok:!1,error:"Sentry DSN is not a valid URL."}}if("https:"!==t.protocol&&"http:"!==t.protocol)return{ok:!1,error:"Sentry DSN must be an http(s) URL."};if(!t.username)return{ok:!1,error:"Sentry DSN is missing its public key."};let r=t.pathname.replace(/^\/|\/$/g,"");if(!/^\d+$/.test(r))return{ok:!1,error:"Sentry DSN is missing a numeric project id."};let n=t.host.match(/^o(\d+)\.ingest\.(.+)$/i),o=n?n[2]:t.host;return{ok:!0,projectId:r,orgId:n?n[1]:null,apiBase:`${t.protocol}//${o}/api/0`}}])},27252,e=>{"use strict";e.s(["default",()=>t]);let t=(0,e.i(18286).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")},19374,e=>{"use strict";var t=e.i(27252);e.n(t)},18286,(e,t,r)=>{"use strict";t.exports=e.r(99403).vendored["react-rsc"].ReactServerDOMTurbopackServer}];
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"))},12892,67119,e=>{"use strict";var t=e.i(2157),r=e.i(50227),s=e.i(39151),o=e.i(19374);function a(e,t=[],r=[]){let n,i="string"==typeof e?function(e,t,r=[]){if(null==t)throw Error("[lucide]: iconNode is required when icon name is used");return{name:e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),size:24,node:t,...r.length>0?{aliases:r}:{}}}(e,t,r):e,l=(0,s.forwardRef)(({className:e,...t},r)=>(0,s.createElement)(o.default,{ref:r,icon:i,className:e,...t}));return i.name&&(l.displayName=(n=(e=>{let t="",r=!1;for(let s of e){if("-"===s||"_"===s||s<=" "){r=t.length>0;continue}0===t.length?t+=s.toLowerCase():t+=r?s.toUpperCase():s,r=!1}return t})(i.name)).charAt(0).toUpperCase()+n.slice(1)),l}let n={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"}]]};n.node;let i=a(n),l={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"}]]};l.node;let c=a(l);function d(e){if(!Number.isFinite(e))return"—";let t=Math.abs(Math.round(e));if(t<1e3)return`${Math.round(e)}ms`;if(t<59950)return`${+(e/1e3).toFixed(1)}s`;let r=Math.round(t/1e3),s=e<0?"-":"";return r<3600?`${s}${Math.floor(r/60)}m ${r%60}s`:`${s}${Math.floor(r/3600)}h ${Math.floor(r%3600/60)}m`}let u=["pages","traffic","loadTime","apdex","vitals","ajax","errorRate","errors"],p=e=>e.length?e.reduce((e,t)=>e+t,0)/e.length:0,h={"new-relic":{label:"New Relic",icon:i,description:"Real-user performance per page: load time, Core Web Vitals, throughput and Apdex.",connectReason:"Add your New Relic keys to see load time and Core Web Vitals for each page.",setupNote:"The key that sends events (Ingest - License) is separate and is added later on the Connect page.",keys:{required:["NEWRELIC_API_KEY","NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID"],optional:["NEWRELIC_INSERT_KEY"],derived:["NEWRELIC_REGION"]},capabilities:["pages","traffic","loadTime","apdex","vitals","ajax","errorRate"],stats:e=>[{label:"Avg Load Time",value:d(p(e.map(e=>e.newRelic.loadTime)))},{label:"Avg LCP",value:d(p(e.map(e=>e.newRelic.lcp)))},{label:"Avg TTFB",value:d(p(e.map(e=>e.newRelic.ttfb)))},{label:"Avg Apdex",value:p(e.map(e=>e.newRelic.apdexScore)).toFixed(2)}],columns:[{needs:"loadTime",header:"Load",cell:e=>d(e.newRelic.loadTime)},{needs:"vitals",header:"LCP",cell:e=>d(e.newRelic.lcp)},{needs:"vitals",header:"TTFB",cell:e=>d(e.newRelic.ttfb)},{needs:"vitals",header:"CLS",cell:e=>e.newRelic.cls.toFixed(2)},{needs:"vitals",header:"INP",cell:e=>{let t=e.newRelic.inp;return void 0===t?"—":d(t)}},{needs:"errorRate",header:"Error Rate",cell:e=>`${e.newRelic.errorRate.toFixed(2)}%`},{needs:"traffic",header:"Throughput",cell:e=>e.newRelic.throughput.toLocaleString()},{needs:"apdex",header:"Apdex",cell:e=>e.newRelic.apdexScore.toFixed(2)}]},sentry:{label:"Sentry",icon:c,description:"Errors captured per page over the last 24 hours.",connectReason:"Add your Sentry keys to see the errors on each page.",keys:{required:["SENTRY_API_KEY","SENTRY_DSN"],optional:[]},capabilities:["errors"],stats:e=>{let t=e.reduce((e,t)=>(t.sentry?.errorCount??0)>(e?.sentry?.errorCount??0)?t:e,null);return[{label:"Total Errors",value:String(e.map(e=>e.sentry?.errorCount??0).reduce((e,t)=>e+t,0))},{label:"Pages With Errors",value:`${e.filter(e=>(e.sentry?.errorCount??0)>0).length} of ${e.length}`},{label:"Noisiest Page",value:t?.name??"None"}]},columns:[{needs:"errors",header:"Errors",cell:e=>String(e.sentry?.errorCount??0)},{needs:"errors",header:"Latest Error",cell:e=>e.sentry?.latestErrors[0]?.title??"—"},{needs:"errors",header:"Last Seen",cell:e=>{let t=Date.parse(e.sentry?.latestErrors[0]?.lastSeen??"");return Number.isNaN(t)?"—":new Date(t).toLocaleString()}}]}},f=Object.fromEntries(Object.entries({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".'},NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID:{label:"New Relic account ID",secret:!1,help:"A plain number, shown next to your keys in New Relic."},SENTRY_API_KEY:{label:"Sentry auth token",secret:!0,help:"Lets the dashboard read issues (scopes: project:read, event:read)."},SENTRY_DSN:{label:"Sentry DSN",secret:!1,help:"Project settings, then Client Keys (DSN). The project and host are read from it."}}).map(([e,t])=>[e,t.label])),x=Object.keys(h);e.s(["KEY_LABELS",0,f,"TOOLS",0,h,"TOOL_IDS",0,x,"mergeMetrics",0,function(e,t,r){let s={};for(let[o,a]of Object.entries(t)){let t=r.includes(a)?void 0:e[a]?.[o];void 0!==t&&(s[o]=t)}return s},"sourcesFor",0,function(e){let t={};for(let r of u){let s=x.find(t=>e.includes(t)&&h[t].capabilities.includes(r));s&&(t[r]=s)}return t}],67119);let y=x.flatMap(e=>h[e].keys.required),m="NEWRELIC_REGION",E={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"}},g={gemini:{label:"Google Gemini",key:"GEMINI_API_KEY"},claude:{label:"Anthropic Claude",key:"CLAUDE_API_KEY"},openai:{label:"OpenAI",key:"OPENAI_API_KEY"}},v="AI_PROVIDER";function R(e){return process.env[e]??""}let b=e=>h[e].keys.required.every(e=>R(e));function S(){return process.env.METRICFLOW_PROJECT_DIR||process.cwd()}let w=/[\s\0#"'`\\$]/;e.s(["AI_PROVIDERS",0,g,"AI_PROVIDER_KEY",0,v,"INSERT_KEY",0,"NEWRELIC_INSERT_KEY","REGION_KEY",0,m,"SETUP_KEYS",0,y,"UNSAFE",0,w,"activeAi",0,function(){let e=process.env[v];for(let t of(e&&e in g?[e]:[]).concat(Object.keys(g))){let e=process.env[g[t].key];if(e)return{provider:t,key:e}}return null},"connectedTools",0,()=>x.filter(b),"env",0,R,"isToolConnected",0,b,"nrHosts",0,(e="eu"===process.env[m]?"eu":"us")=>E[e],"projectDir",0,S,"writeEnvLocal",0,function(e,s=process.env.METRICFLOW_ENV_FILE||(0,r.join)(S(),".env.local")){let o=new Set([...Object.values(h).flatMap(e=>[...e.keys.required,...e.keys.optional,...e.keys.derived??[]]),...Object.values(g).map(e=>e.key),v]);for(let[t,r]of Object.entries(e)){if(!o.has(t))throw Error("Refused to write a key name no tool declares.");if(w.test(r))throw Error("Refused to write a value with unsafe characters.")}let a=(0,t.existsSync)(s)?(0,t.readFileSync)(s,"utf8").split("\n"):[],n=new Map(Object.entries(e)),i=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(;i.length&&""===i[i.length-1];)i.pop();for(let[e,t]of n)i.push(`${e}=${t}`);let l=`${s}.tmp`;for(let[r,o]of((0,t.writeFileSync)(l,i.join("\n")+"\n",{mode:384}),(0,t.renameSync)(l,s),Object.entries(e)))process.env[r]=o}],12892)},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 o=(e.headers.get("host")??"").replace(/:\d+$/,"");if(!t.has(o))return!1;let a=e.headers.get("origin");try{return!a||t.has(new URL(a).hostname)}catch{return!1}}])},84594,e=>{"use strict";var t=e.i(60756),r=e.i(12892);async function s(e,o=()=>!1){let a,n;if(process.env[r.REGION_KEY])return e((0,r.nrHosts)());try{if(a=await e((0,r.nrHosts)("us")),!o(a))return a}catch(r){let e=t.default.isAxiosError(r)?r.response?.status:void 0;if(401!==e&&403!==e)throw r;n=r}try{let t=await e((0,r.nrHosts)("eu"));if(!o(t))return process.env[r.REGION_KEY]="eu",t}catch{}if(n)throw n;return a}async function o(e,r,o){return(await s(s=>t.default.post(s.graphql,{query:r},{headers:{"API-Key":e,"Content-Type":"application/json"},timeout:o}),e=>!e.data?.data?.actor)).data}e.s(["nrGraphql",0,o,"withRegion",0,s])},83808,e=>{"use strict";var t=e.i(60756);async function r(e,r){let s={Authorization:`Bearer ${e}`},o=r.orgId?await t.default.get(`${r.apiBase}/organizations/`,{headers:s,timeout:8e3}):await t.default.get(`${r.apiBase}/projects/`,{headers:s,timeout:8e3}),a=Array.isArray(o.data)?o.data:[];return(r.orgId?a.find(e=>String(e.id)===r.orgId)?.slug:a.find(e=>String(e.id)===r.projectId)?.organization?.slug)??null}e.s(["orgSlugForDsn",0,r,"parseSentryDsn",0,function(e){let t;try{t=new URL(e)}catch{return{ok:!1,error:"Sentry DSN is not a valid URL."}}if("https:"!==t.protocol&&"http:"!==t.protocol)return{ok:!1,error:"Sentry DSN must be an http(s) URL."};if(!t.username)return{ok:!1,error:"Sentry DSN is missing its public key."};let r=t.pathname.replace(/^\/|\/$/g,"");if(!/^\d+$/.test(r))return{ok:!1,error:"Sentry DSN is missing a numeric project id."};let s=t.host.match(/^o(\d+)\.ingest\.(.+)$/i),o=s?s[2]:t.host;return{ok:!0,projectId:r,orgId:s?s[1]:null,apiBase:`${t.protocol}//${o}/api/0`}}])},27252,e=>{"use strict";e.s(["default",()=>t]);let t=(0,e.i(18286).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")},19374,e=>{"use strict";var t=e.i(27252);e.n(t)},18286,(e,t,r)=>{"use strict";t.exports=e.r(99403).vendored["react-rsc"].ReactServerDOMTurbopackServer}];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__1xo4bin._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[35907,e=>{"use strict";var t=e.i(12892),r=e.i(67119),a=e.i(24514),s=e.i(60756),n=e.i(83808);function o(e,t){let r=s.default.isAxiosError(e)?e.response?.status:void 0;return 401===r||403===r?`${t} was rejected (check the key and its permissions).`:404===r?`${t} was not found.`:`Could not reach ${t} to check it.`}async function i(e,r){if(!/^\d+$/.test(r))return{NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID:{ok:!1,error:"Account ID must be a number."}};try{let a,n=a=>s.default.post((0,t.nrHosts)(a).graphql,{query:`{ actor { user { id } account(id: ${r}) { id } } }`},{headers:{"API-Key":e},timeout:8e3}),o="us";try{if(a=await n("us"),!a.data?.data?.actor?.user?.id)throw Error("rejected")}catch(e){try{if(a=await n("eu"),!a.data?.data?.actor?.user?.id)throw e;o="eu"}catch{throw e}}let i="eu"===o?{region:o}:{},l=a.data?.data?.actor;if(!l?.user?.id)return{NEWRELIC_API_KEY:{ok:!1,error:"New Relic User key was rejected."}};if(!l.account?.id)return{NEWRELIC_API_KEY:{ok:!0,...i},NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID:{ok:!1,error:"This key cannot see that account ID."}};return{NEWRELIC_API_KEY:{ok:!0,...i},NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID:{ok:!0}}}catch(e){return{NEWRELIC_API_KEY:{ok:!1,error:o(e,"New Relic")}}}}async function l(e,t){let r=(0,n.parseSentryDsn)(t);if(!r.ok)return{SENTRY_DSN:{ok:!1,error:r.error}};try{if(!await (0,n.orgSlugForDsn)(e,r))return{SENTRY_API_KEY:{ok:!0},SENTRY_DSN:{ok:!1,error:"This DSN does not match a project the token can read."}};return{SENTRY_API_KEY:{ok:!0},SENTRY_DSN:{ok:!0}}}catch(e){return{SENTRY_API_KEY:{ok:!1,error:o(e,"Sentry token")}}}}async function u(e){let[t,r]=await Promise.all([e.NEWRELIC_API_KEY&&e.NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID?i(e.NEWRELIC_API_KEY,e.NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID):{},e.SENTRY_API_KEY&&e.SENTRY_DSN?l(e.SENTRY_API_KEY,e.SENTRY_DSN):{}]);return{...t,...r}}let c=/[\s\0#"'`\\$]/,d="Contains spaces or special characters (# \" ' ` $ \\). Paste the value without them.",p=()=>Response.json({error:(0,a.REFUSAL_MESSAGE)()},{status:403});async function E(e){return(0,a.isLocalRequest)(e)?Response.json({configured:(0,t.connectedTools)().length>0,tools:(0,t.connectedTools)(),keys:Object.fromEntries([...t.SETUP_KEYS,t.INSERT_KEY].map(e=>[e,!!(0,t.env)(e)]))}):p()}async function h(e){let s;if(!(0,a.isLocalRequest)(e))return p();try{s=await e.json()}catch{return Response.json({error:"Invalid request body."},{status:400})}let n="string"==typeof s[t.INSERT_KEY]?s[t.INSERT_KEY].trim():"";if(n&&t.SETUP_KEYS.every(e=>!s[e])){if(!(0,t.isToolConnected)("new-relic"))return Response.json({saved:!1,error:"Finish setup first."},{status:400});let e=c.test(n)?d:/^NRAK-/i.test(n)?'That is a User API key (starts NRAK-), which reads data. The Insert key sends data: New Relic > API keys > create key, type "Ingest - License".':null;if(e)return Response.json({saved:!1,results:{[t.INSERT_KEY]:{ok:!1,error:e}}},{status:400});try{(0,t.writeEnvLocal)({[t.INSERT_KEY]:n})}catch{return Response.json({saved:!1,error:".env.local could not be written. Check folder permissions."},{status:500})}return Response.json({saved:!0,results:{[t.INSERT_KEY]:{ok:!0}}})}let o={},i={},l=0;for(let e of r.TOOL_IDS){let a=r.TOOLS[e].keys.required,n=a.filter(e=>"string"==typeof s[e]&&s[e].trim());if(n.length){for(let e of(l++,n)){let t=s[e].trim();c.test(t)?i[e]={ok:!1,error:d}:o[e]=t}for(let s of a.filter(e=>!n.includes(e)&&!(0,t.env)(e)))i[s]={ok:!1,error:`Add the ${r.KEY_LABELS[s]}, or clear the ${r.KEY_LABELS[n[0]]} to skip ${r.TOOLS[e].label}.`};for(let e of a.filter(e=>!n.includes(e)&&(0,t.env)(e)))o[e]=(0,t.env)(e)}}if(!l)return Response.json({saved:!1,error:"Fill in both fields for at least one tool."},{status:400});if(Object.keys(i).length)return Response.json({saved:!1,results:i},{status:400});let E=await u(o);if(Object.values(E).some(e=>!e.ok))return Response.json({saved:!1,results:E},{status:422});try{let e=E.NEWRELIC_API_KEY;(0,t.writeEnvLocal)({...o,...e?{[t.REGION_KEY]:e.ok&&"eu"===e.region?"eu":"us"}:{}})}catch{return Response.json({saved:!1,error:"Keys are valid but .env.local could not be written. Check folder permissions."},{status:500})}return Response.json({saved:!0,results:E})}e.s(["GET",0,E,"POST",0,h],35907)},97962,e=>{"use strict";var t=e.i(12425),r=e.i(83353),a=e.i(47902),s=e.i(37892),n=e.i(54261),o=e.i(39548),i=e.i(68187),l=e.i(63984),u=e.i(88743),c=e.i(24698),d=e.i(13487),p=e.i(48776),E=e.i(29398),h=e.i(31610),R=e.i(45919),f=e.i(93695),_=e.i(12741);e.i(95315);var v=e.i(98732);let N=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/setup/route",pathname:"/api/setup",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/setup/route.ts",nextConfigOutput:"",userland:()=>e.r(35907),...{}}),{workAsyncStorage:C,workUnitAsyncStorage:T,serverHooks:I}=N;async function S(e,t,a){a.requestMeta&&(0,s.setRequestMeta)(e,a.requestMeta),N.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let C="/api/setup/route";C=C.replace(/\/index$/,"")||"/";let T=await N.prepare(e,t,{srcPage:C,multiZoneDraftMode:!1});if(!T)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:I,deploymentId:S,params:w,nextConfig:A,parsedUrl:y,isDraftMode:m,prerenderManifest:g,routerServerContext:P,isOnDemandRevalidate:k,revalidateOnlyGenerated:O,resolvedPathname:L,clientReferenceManifest:b,serverActionsManifest:x}=T,K=(0,i.normalizeAppPath)(C),Y=!!g.routes[L]&&(N.isDev||(0,_.isRouteCacheOwner)(L,N.cacheOwner,g.routes[L])),D=!!(g.dynamicRoutes[K]||Y),U=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,y,!1):t.end("This page could not be found"),null);if(D&&!m){let e=g.dynamicRoutes[K];if(e&&!1===e.fallback&&!Y){if(A.adapterPath)return await U();throw new f.NoFallbackError}}let j=null;!D||N.isDev||m||(j="/index"===(j=L)?"/":j);let q=!0===N.isDev||!D,H=D&&!q;x&&b&&(0,o.setManifestsSingleton)({page:C,clientReferenceManifest:b,serverActionsManifest:x});let M=e.method||"GET",$=(0,n.getTracer)(),W=$.getActiveScopeSpan(),B=!!(null==P?void 0:P.isWrappedByNextServer),F=!!(0,s.getRequestMeta)(e,"minimalMode"),G=(0,s.getRequestMeta)(e,"incrementalCache")||await N.getIncrementalCache(e,A,g,F);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let X={params:w,previewProps:g.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts,useCacheTimeout:A.experimental.useCacheTimeout},cacheComponents:!!A.cacheComponents,validationLevel:A.experimental.instantInsights.validationLevel,isDraftMode:m,supportsDynamicResponse:q,incrementalCache:G,hmrRefreshHash:(0,s.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:A.cacheLife,staticPageGenerationTimeout:A.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,s)=>N.onRequestError(e,t,a,s,P)},sharedContext:{buildId:I,deploymentId:S}},V=new l.NodeNextRequest(e),z=new l.NodeNextResponse(t),Z=u.NextRequestAdapter.fromNodeNextRequest(V,(0,u.signalFromNodeResponse)(t)),J=async({previousCacheEntry:r})=>{try{if(!F&&k&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await N.handle(Z,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let n=X.renderOpts.pendingWaitUntil;n&&a.waitUntil&&(a.waitUntil(n),n=void 0);let o=X.renderOpts.collectedTags;if(!D)return await (0,p.sendResponse)(V,z,s,n),null;{let e=await s.blob(),t=(0,E.toNodeOutgoingHttpHeaders)(s.headers);o&&(t[R.NEXT_CACHE_TAGS_HEADER]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=R.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,a=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=R.INFINITE_CACHE?!1!==r&&r>0?A.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await N.onRequestError(e,t,{routerKind:"App Router",routePath:C,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:k})},!1,P),t}},Q=async(s,o)=>{try{var i,l;let s=await N.handleResponse({req:e,nextConfig:A,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:g,isRoutePPREnabled:!1,isOnDemandRevalidate:k,revalidateOnlyGenerated:O,responseGenerator:J,waitUntil:a.waitUntil,isMinimalMode:F});if(!D)return;if((null==s||null==(i=s.value)?void 0:i.kind)!==v.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});F||t.setHeader("x-nextjs-cache",k?"REVALIDATED":s.isMiss?"MISS":s.isStale?"STALE":"HIT"),m&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let n=(0,E.fromNodeOutgoingHttpHeaders)(s.value.headers);F&&D||n.delete(R.NEXT_CACHE_TAGS_HEADER),!s.cacheControl||t.getHeader("Cache-Control")||n.get("Cache-Control")||n.set("Cache-Control",(0,h.getCacheControlHeader)(s.cacheControl)),await (0,p.sendResponse)(V,z,new Response(s.value.body,{headers:n,status:s.value.status||200}));return}catch(t){if(t instanceof f.NoFallbackError||await N.onRequestError(e,t,{routerKind:"App Router",routePath:K,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:k})},!1,P),D)throw t;await (0,p.sendResponse)(V,z,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:n.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 a=r.get("next.route")||K,i=`${M} ${a}`;s.setAttributes({"next.route":a,"http.route":a,"next.span_name":i}),s.updateName(i),o&&o!==s&&(o.setAttribute("http.route",a),o.updateName(i))})()}};if(B&&W)await Q(W,void 0);else{let t=$.getActiveScopeSpan();await $.withPropagatedContext(e.headers,()=>$.trace(c.BaseServerSpan.handleRequest,{spanName:`${M} ${C}`,kind:n.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},e=>Q(e,t)),void 0,!B)}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:T})},"routeModule",0,N,"serverHooks",0,I,"workAsyncStorage",0,C,"workUnitAsyncStorage",0,T])}];
1
+ module.exports=[35907,e=>{"use strict";var t=e.i(12892),r=e.i(67119),a=e.i(24514),s=e.i(60756),n=e.i(83808);function o(e,t){let r=s.default.isAxiosError(e)?e.response?.status:void 0;return 401===r||403===r?`${t} was rejected (check the key and its permissions).`:404===r?`${t} was not found.`:`Could not reach ${t} to check it.`}async function i(e,r){if(!/^\d+$/.test(r))return{NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID:{ok:!1,error:"Account ID must be a number."}};try{let a,n=a=>s.default.post((0,t.nrHosts)(a).graphql,{query:`{ actor { user { id } account(id: ${r}) { id } } }`},{headers:{"API-Key":e},timeout:8e3}),o="us";try{if(a=await n("us"),!a.data?.data?.actor?.user?.id)throw Error("rejected")}catch(e){try{if(a=await n("eu"),!a.data?.data?.actor?.user?.id)throw e;o="eu"}catch{throw e}}let i="eu"===o?{region:o}:{},l=a.data?.data?.actor;if(!l?.user?.id)return{NEWRELIC_API_KEY:{ok:!1,error:"New Relic User key was rejected."}};if(!l.account?.id)return{NEWRELIC_API_KEY:{ok:!0,...i},NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID:{ok:!1,error:"This key cannot see that account ID."}};return{NEWRELIC_API_KEY:{ok:!0,...i},NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID:{ok:!0}}}catch(e){return{NEWRELIC_API_KEY:{ok:!1,error:o(e,"New Relic")}}}}async function l(e,t){let r=(0,n.parseSentryDsn)(t);if(!r.ok)return{SENTRY_DSN:{ok:!1,error:r.error}};try{if(!await (0,n.orgSlugForDsn)(e,r))return{SENTRY_API_KEY:{ok:!0},SENTRY_DSN:{ok:!1,error:"This DSN does not match a project the token can read."}};return{SENTRY_API_KEY:{ok:!0},SENTRY_DSN:{ok:!0}}}catch(e){return{SENTRY_API_KEY:{ok:!1,error:o(e,"Sentry token")}}}}async function u(e){let[t,r]=await Promise.all([e.NEWRELIC_API_KEY&&e.NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID?i(e.NEWRELIC_API_KEY,e.NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID):{},e.SENTRY_API_KEY&&e.SENTRY_DSN?l(e.SENTRY_API_KEY,e.SENTRY_DSN):{}]);return{...t,...r}}let c="Contains spaces or special characters (# \" ' ` $ \\). Paste the value without them.",d=()=>Response.json({error:(0,a.REFUSAL_MESSAGE)()},{status:403});async function p(e){return(0,a.isLocalRequest)(e)?Response.json({configured:(0,t.connectedTools)().length>0,tools:(0,t.connectedTools)(),keys:Object.fromEntries([...t.SETUP_KEYS,t.INSERT_KEY].map(e=>[e,!!(0,t.env)(e)]))}):d()}async function E(e){let s;if(!(0,a.isLocalRequest)(e))return d();try{s=await e.json()}catch{return Response.json({error:"Invalid request body."},{status:400})}let n="string"==typeof s[t.INSERT_KEY]?s[t.INSERT_KEY].trim():"";if(n&&t.SETUP_KEYS.every(e=>!s[e])){if(!(0,t.isToolConnected)("new-relic"))return Response.json({saved:!1,error:"Finish setup first."},{status:400});let e=t.UNSAFE.test(n)?c:/^NRAK-/i.test(n)?'That is a User API key (starts NRAK-), which reads data. The Insert key sends data: New Relic > API keys > create key, type "Ingest - License".':null;if(e)return Response.json({saved:!1,results:{[t.INSERT_KEY]:{ok:!1,error:e}}},{status:400});try{(0,t.writeEnvLocal)({[t.INSERT_KEY]:n})}catch{return Response.json({saved:!1,error:".env.local could not be written. Check folder permissions."},{status:500})}return Response.json({saved:!0,results:{[t.INSERT_KEY]:{ok:!0}}})}let o={},i={},l=0;for(let e of r.TOOL_IDS){let a=r.TOOLS[e].keys.required,n=a.filter(e=>"string"==typeof s[e]&&s[e].trim());if(n.length){for(let e of(l++,n)){let r=s[e].trim();t.UNSAFE.test(r)?i[e]={ok:!1,error:c}:o[e]=r}for(let s of a.filter(e=>!n.includes(e)&&!(0,t.env)(e)))i[s]={ok:!1,error:`Add the ${r.KEY_LABELS[s]}, or clear the ${r.KEY_LABELS[n[0]]} to skip ${r.TOOLS[e].label}.`};for(let e of a.filter(e=>!n.includes(e)&&(0,t.env)(e)))o[e]=(0,t.env)(e)}}if(!l)return Response.json({saved:!1,error:"Fill in both fields for at least one tool."},{status:400});if(Object.keys(i).length)return Response.json({saved:!1,results:i},{status:400});let p=await u(o);if(Object.values(p).some(e=>!e.ok))return Response.json({saved:!1,results:p},{status:422});try{let e=p.NEWRELIC_API_KEY;(0,t.writeEnvLocal)({...o,...e?{[t.REGION_KEY]:e.ok&&"eu"===e.region?"eu":"us"}:{}})}catch{return Response.json({saved:!1,error:"Keys are valid but .env.local could not be written. Check folder permissions."},{status:500})}return Response.json({saved:!0,results:p})}e.s(["GET",0,p,"POST",0,E],35907)},97962,e=>{"use strict";var t=e.i(12425),r=e.i(83353),a=e.i(47902),s=e.i(37892),n=e.i(54261),o=e.i(39548),i=e.i(68187),l=e.i(63984),u=e.i(88743),c=e.i(24698),d=e.i(13487),p=e.i(48776),E=e.i(29398),h=e.i(31610),R=e.i(45919),f=e.i(93695),_=e.i(12741);e.i(95315);var v=e.i(98732);let N=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/setup/route",pathname:"/api/setup",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/setup/route.ts",nextConfigOutput:"",userland:()=>e.r(35907),...{}}),{workAsyncStorage:C,workUnitAsyncStorage:T,serverHooks:I}=N;async function S(e,t,a){a.requestMeta&&(0,s.setRequestMeta)(e,a.requestMeta),N.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let C="/api/setup/route";C=C.replace(/\/index$/,"")||"/";let T=await N.prepare(e,t,{srcPage:C,multiZoneDraftMode:!1});if(!T)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:I,deploymentId:S,params:w,nextConfig:A,parsedUrl:y,isDraftMode:m,prerenderManifest:g,routerServerContext:P,isOnDemandRevalidate:k,revalidateOnlyGenerated:O,resolvedPathname:L,clientReferenceManifest:b,serverActionsManifest:x}=T,K=(0,i.normalizeAppPath)(C),Y=!!g.routes[L]&&(N.isDev||(0,_.isRouteCacheOwner)(L,N.cacheOwner,g.routes[L])),U=!!(g.dynamicRoutes[K]||Y),D=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,y,!1):t.end("This page could not be found"),null);if(U&&!m){let e=g.dynamicRoutes[K];if(e&&!1===e.fallback&&!Y){if(A.adapterPath)return await D();throw new f.NoFallbackError}}let j=null;!U||N.isDev||m||(j="/index"===(j=L)?"/":j);let q=!0===N.isDev||!U,H=U&&!q;x&&b&&(0,o.setManifestsSingleton)({page:C,clientReferenceManifest:b,serverActionsManifest:x});let M=e.method||"GET",$=(0,n.getTracer)(),F=$.getActiveScopeSpan(),W=!!(null==P?void 0:P.isWrappedByNextServer),B=!!(0,s.getRequestMeta)(e,"minimalMode"),G=(0,s.getRequestMeta)(e,"incrementalCache")||await N.getIncrementalCache(e,A,g,B);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let X={params:w,previewProps:g.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts,useCacheTimeout:A.experimental.useCacheTimeout},cacheComponents:!!A.cacheComponents,validationLevel:A.experimental.instantInsights.validationLevel,isDraftMode:m,supportsDynamicResponse:q,incrementalCache:G,hmrRefreshHash:(0,s.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:A.cacheLife,staticPageGenerationTimeout:A.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,s)=>N.onRequestError(e,t,a,s,P)},sharedContext:{buildId:I,deploymentId:S}},V=new l.NodeNextRequest(e),z=new l.NodeNextResponse(t),Z=u.NextRequestAdapter.fromNodeNextRequest(V,(0,u.signalFromNodeResponse)(t)),J=async({previousCacheEntry:r})=>{try{if(!B&&k&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await N.handle(Z,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let n=X.renderOpts.pendingWaitUntil;n&&a.waitUntil&&(a.waitUntil(n),n=void 0);let o=X.renderOpts.collectedTags;if(!U)return await (0,p.sendResponse)(V,z,s,n),null;{let e=await s.blob(),t=(0,E.toNodeOutgoingHttpHeaders)(s.headers);o&&(t[R.NEXT_CACHE_TAGS_HEADER]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=R.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,a=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=R.INFINITE_CACHE?!1!==r&&r>0?A.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await N.onRequestError(e,t,{routerKind:"App Router",routePath:C,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:k})},!1,P),t}},Q=async(s,o)=>{try{var i,l;let s=await N.handleResponse({req:e,nextConfig:A,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:g,isRoutePPREnabled:!1,isOnDemandRevalidate:k,revalidateOnlyGenerated:O,responseGenerator:J,waitUntil:a.waitUntil,isMinimalMode:B});if(!U)return;if((null==s||null==(i=s.value)?void 0:i.kind)!==v.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});B||t.setHeader("x-nextjs-cache",k?"REVALIDATED":s.isMiss?"MISS":s.isStale?"STALE":"HIT"),m&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let n=(0,E.fromNodeOutgoingHttpHeaders)(s.value.headers);B&&U||n.delete(R.NEXT_CACHE_TAGS_HEADER),!s.cacheControl||t.getHeader("Cache-Control")||n.get("Cache-Control")||n.set("Cache-Control",(0,h.getCacheControlHeader)(s.cacheControl)),await (0,p.sendResponse)(V,z,new Response(s.value.body,{headers:n,status:s.value.status||200}));return}catch(t){if(t instanceof f.NoFallbackError||await N.onRequestError(e,t,{routerKind:"App Router",routePath:K,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:k})},!1,P),U)throw t;await (0,p.sendResponse)(V,z,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:n.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 a=r.get("next.route")||K,i=`${M} ${a}`;s.setAttributes({"next.route":a,"http.route":a,"next.span_name":i}),s.updateName(i),o&&o!==s&&(o.setAttribute("http.route",a),o.updateName(i))})()}};if(W&&F)await Q(F,void 0);else{let t=$.getActiveScopeSpan();await $.withPropagatedContext(e.headers,()=>$.trace(c.BaseServerSpan.handleRequest,{spanName:`${M} ${C}`,kind:n.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},e=>Q(e,t)),void 0,!W)}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:T})},"routeModule",0,N,"serverHooks",0,I,"workAsyncStorage",0,C,"workUnitAsyncStorage",0,T])}];
2
2
 
3
3
  //# sourceMappingURL=_0w8wvdn._.js.map
@@ -13,6 +13,6 @@ module.exports=[51980,e=>{"use strict";var t=e.i(50227),r=e.i(66680);let a="WHER
13
13
  }
14
14
  }
15
15
  }
16
- `;try{s=await (0,i.nrGraphql)(e,l,1e4)}catch{throw Error("Could not reach New Relic to discover pages.")}let c=s.data?.actor?.account?.nrql?.results;if(!c)throw Error("New Relic rejected the page discovery query. Check your key and account ID.");return function(e){let t=new Map;for(let{url:r,views:a}of e){let e=n(r);null!==e&&t.set(e,(t.get(e)??0)+(Number.isFinite(a)?a:0))}let a=[...t].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,20),i=new Map;for(let[e]of a)i.set(o(e),(i.get(o(e))??0)+1);return a.map(([e,t])=>{let a=o(e),n=i.get(a)>1?`${a}-${(0,r.createHash)("sha1").update(e).digest("hex").slice(0,6)}`:a;return{url:e,slug:n,name:"/"===e?"Homepage":e.split("/").filter(Boolean).map(e=>e.replace(/[-_]+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())||e).join(" / "),views:t}})}(c.map(e=>({url:String(e.pageUrl??e.facet??""),views:Number(e.views??e.count??0)})))}var h=e.i(60756),g=e.i(83808);class f extends s{apiKey;dsn;constructor(e,t){super(),this.apiKey=e,this.dsn=t}async fetchRows(){let e=this.apiKey&&this.dsn?(0,g.parseSentryDsn)(this.dsn):null;if(!this.apiKey||!e?.ok)return[];try{let t=await (0,g.orgSlugForDsn)(this.apiKey,e);if(!t)return[];let r=await h.default.get(`${e.apiBase}/organizations/${encodeURIComponent(t)}/events/`,{headers:{Authorization:`Bearer ${this.apiKey}`},timeout:1e4,params:{project:e.projectId,field:["url","title","count()","last_seen()"],query:"event.type:error",statsPeriod:"24h",sort:"-last_seen",per_page:100},paramsSerializer:{indexes:null}});return r.data?.data??[]}catch(e){throw console.error("Sentry API error:",h.default.isAxiosError(e)?e.response?.status:"request failed"),Error("Sentry request failed")}}mergeVariants(e){if(0===e.length)return null;let t=0,r=[];for(let a of e){let e=Number(a["count()"]??0);t+=e,r.length<5&&r.push({title:a.title??"Unknown error",count:e,lastSeen:a["last_seen()"]??""})}return{errorCount:t,errorRate:0,warningCount:0,latestErrors:r}}onError(e){throw e}}var R=e.i(12892);let m=[];var w=e.i(90770);async function E(){let e=(0,R.connectedTools)();if(!e.length)return Response.json({configured:!1,tools:e,project:C(),pages:[],history:[],timestamp:new Date().toISOString()});if(!e.includes("new-relic"))return Response.json({configured:!0,tools:e,project:C(),pages:[],history:[],timestamp:new Date().toISOString()});try{let t=performance.now(),r=await p((0,R.env)("NEWRELIC_API_KEY"),(0,R.env)("NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID"));if(0===r.length)return Response.json({configured:!0,tools:e,project:C(),pages:[],history:m,timestamp:new Date().toISOString()});let a=performance.now(),n=new c((0,R.env)("NEWRELIC_API_KEY"),(0,R.env)("NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID")).byPath().then(e=>((0,w.recordTiming)("New Relic: metrics",performance.now()-a),e)),o=performance.now(),i=e.includes("sentry")?new f((0,R.env)("SENTRY_API_KEY"),(0,R.env)("SENTRY_DSN")).byPath().then(e=>((0,w.recordTiming)("Sentry: events",performance.now()-o),e)):Promise.resolve(null),[s,l]=await Promise.all([n,i.catch(()=>void 0)]),u=void 0===l?["sentry"]:[],d=l??{};console.log(`[timing] combined New Relic + Sentry batch: ${Math.round(performance.now()-t)}ms`);let h=r.map(({name:t,slug:r,url:a,views:n})=>{var o,i;let l=s[a]??v,c=e.includes("sentry")&&!u.length?d[a]??y:void 0;return{name:t,slug:r,url:a,visitors:(o=n)>=1e3?`${(o/1e3).toFixed(1)}k`:String(o),status:(i=l).errorRate>5?"Critical":i.errorRate>1||i.apdexScore<.9?"Warning":"Healthy",newRelic:l,sentry:c,recordedAt:new Date().toISOString()}});return m.push({timestamp:new Date().toISOString(),pages:h}),m.length>20&&m.shift(),Response.json({configured:!0,tools:e,failed:u,project:C(),pages:h,history:m,timestamp:new Date().toISOString()})}catch(e){return console.error("Metrics API error:",e),Response.json({error:e instanceof Error?e.message:"Unknown error"},{status:500})}}let v={loadTime:0,lcp:0,ttfb:0,cls:0,inp:0,fid:0,errorRate:0,throughput:0,apdexScore:0},y={errorCount:0,errorRate:0,warningCount:0,latestErrors:[]};function C(){return(0,R.env)("METRICFLOW_PROJECT_NAME")||(0,t.basename)(process.cwd())}e.s(["GET",0,E],51980)},6408,e=>{"use strict";var t=e.i(12425),r=e.i(83353),a=e.i(47902),n=e.i(37892),o=e.i(54261),i=e.i(39548),s=e.i(68187),l=e.i(63984),c=e.i(88743),u=e.i(24698),p=e.i(13487),d=e.i(48776),h=e.i(29398),g=e.i(31610),f=e.i(45919),R=e.i(93695),m=e.i(12741);e.i(95315);var w=e.i(98732);let E=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/metrics/route",pathname:"/api/metrics",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/metrics/route.ts",nextConfigOutput:"",userland:()=>e.r(51980),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:y,serverHooks:C}=E;async function S(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),E.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/metrics/route";v=v.replace(/\/index$/,"")||"/";let y=await E.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!y)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:C,deploymentId:S,params:A,nextConfig:T,parsedUrl:I,isDraftMode:x,prerenderManifest:N,routerServerContext:P,isOnDemandRevalidate:b,revalidateOnlyGenerated:O,resolvedPathname:_,clientReferenceManifest:U,serverActionsManifest:$}=y,j=(0,s.normalizeAppPath)(v),q=!!N.routes[_]&&(E.isDev||(0,m.isRouteCacheOwner)(_,E.cacheOwner,N.routes[_])),M=!!(N.dynamicRoutes[j]||q),D=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,I,!1):t.end("This page could not be found"),null);if(M&&!x){let e=N.dynamicRoutes[j];if(e&&!1===e.fallback&&!q){if(T.adapterPath)return await D();throw new R.NoFallbackError}}let L=null;!M||E.isDev||x||(L="/index"===(L=_)?"/":L);let F=!0===E.isDev||!M,H=M&&!F;$&&U&&(0,i.setManifestsSingleton)({page:v,clientReferenceManifest:U,serverActionsManifest:$});let k=e.method||"GET",K=(0,o.getTracer)(),B=K.getActiveScopeSpan(),W=!!(null==P?void 0:P.isWrappedByNextServer),V=!!(0,n.getRequestMeta)(e,"minimalMode"),G=(0,n.getRequestMeta)(e,"incrementalCache")||await E.getIncrementalCache(e,T,N,V);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let z={params:A,previewProps:N.preview,renderOpts:{experimental:{authInterrupts:!!T.experimental.authInterrupts,useCacheTimeout:T.experimental.useCacheTimeout},cacheComponents:!!T.cacheComponents,validationLevel:T.experimental.instantInsights.validationLevel,isDraftMode:x,supportsDynamicResponse:F,incrementalCache:G,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:T.cacheLife,staticPageGenerationTimeout:T.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>E.onRequestError(e,t,a,n,P)},sharedContext:{buildId:C,deploymentId:S}},X=new l.NodeNextRequest(e),Y=new l.NodeNextResponse(t),J=c.NextRequestAdapter.fromNodeNextRequest(X,(0,c.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:r})=>{try{if(!V&&b&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await E.handle(J,z);e.fetchMetrics=z.renderOpts.fetchMetrics;let o=z.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let i=z.renderOpts.collectedTags;if(!M)return await (0,d.sendResponse)(X,Y,n,o),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);i&&(t[f.NEXT_CACHE_TAGS_HEADER]=i),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==z.renderOpts.collectedRevalidate&&!(z.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&z.renderOpts.collectedRevalidate,a=void 0===z.renderOpts.collectedExpire||z.renderOpts.collectedExpire>=f.INFINITE_CACHE?!1!==r&&r>0?T.expireTime:void 0:z.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:b})},!1,P),t}},Q=async(n,i)=>{try{var s,l;let n=await E.handleResponse({req:e,nextConfig:T,cacheKey:L,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:b,revalidateOnlyGenerated:O,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:V});if(!M)return;if((null==n||null==(s=n.value)?void 0:s.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});V||t.setHeader("x-nextjs-cache",b?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),x&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let o=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);V&&M||o.delete(f.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||o.get("Cache-Control")||o.set("Cache-Control",(0,g.getCacheControlHeader)(n.cacheControl)),await (0,d.sendResponse)(X,Y,new Response(n.value.body,{headers:o,status:n.value.status||200}));return}catch(t){if(t instanceof R.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:b})},!1,P),M)throw t;await (0,d.sendResponse)(X,Y,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:o.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let r=K.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.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 a=r.get("next.route")||j,s=`${k} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":s}),n.updateName(s),i&&i!==n&&(i.setAttribute("http.route",a),i.updateName(s))})()}};if(W&&B)await Q(B,void 0);else{let t=K.getActiveScopeSpan();await K.withPropagatedContext(e.headers,()=>K.trace(u.BaseServerSpan.handleRequest,{spanName:`${k} ${v}`,kind:o.SpanKind.SERVER,attributes:{"http.method":k,"http.target":e.url}},e=>Q(e,t)),void 0,!W)}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:y})},"routeModule",0,E,"serverHooks",0,C,"workAsyncStorage",0,v,"workUnitAsyncStorage",0,y])}];
16
+ `;try{s=await (0,i.nrGraphql)(e,l,1e4)}catch{throw Error("Could not reach New Relic to discover pages.")}let c=s.data?.actor?.account?.nrql?.results;if(!c)throw Error("New Relic rejected the page discovery query. Check your key and account ID.");return function(e){let t=new Map;for(let{url:r,views:a}of e){let e=n(r);null!==e&&t.set(e,(t.get(e)??0)+(Number.isFinite(a)?a:0))}let a=[...t].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,20),i=new Map;for(let[e]of a)i.set(o(e),(i.get(o(e))??0)+1);return a.map(([e,t])=>{let a=o(e),n=i.get(a)>1?`${a}-${(0,r.createHash)("sha1").update(e).digest("hex").slice(0,6)}`:a;return{url:e,slug:n,name:"/"===e?"Homepage":e.split("/").filter(Boolean).map(e=>e.replace(/[-_]+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())||e).join(" / "),views:t}})}(c.map(e=>({url:String(e.pageUrl??e.facet??""),views:Number(e.views??e.count??0)})))}var h=e.i(60756),g=e.i(83808);class f extends s{apiKey;dsn;constructor(e,t){super(),this.apiKey=e,this.dsn=t}async fetchRows(){let e=this.apiKey&&this.dsn?(0,g.parseSentryDsn)(this.dsn):null;if(!this.apiKey||!e?.ok)return[];try{let t=await (0,g.orgSlugForDsn)(this.apiKey,e);if(!t)return[];let r=await h.default.get(`${e.apiBase}/organizations/${encodeURIComponent(t)}/events/`,{headers:{Authorization:`Bearer ${this.apiKey}`},timeout:1e4,params:{project:e.projectId,field:["url","title","count()","last_seen()"],query:"event.type:error",statsPeriod:"24h",sort:"-last_seen",per_page:100},paramsSerializer:{indexes:null}});return r.data?.data??[]}catch(e){throw console.error("Sentry API error:",h.default.isAxiosError(e)?e.response?.status:"request failed"),Error("Sentry request failed")}}mergeVariants(e){if(0===e.length)return null;let t=0,r=[];for(let a of e){let e=Number(a["count()"]??0);t+=e,r.length<5&&r.push({title:a.title??"Unknown error",count:e,lastSeen:a["last_seen()"]??""})}return{errorCount:t,errorRate:0,warningCount:0,latestErrors:r}}onError(e){throw e}}var R=e.i(12892);let m=[];var w=e.i(67119),E=e.i(90770);async function v(){let e=(0,R.connectedTools)(),t=(0,w.sourcesFor)(e);if(!e.length)return Response.json({configured:!1,tools:e,sources:t,project:S(),pages:[],history:[],timestamp:new Date().toISOString()});if(!e.includes("new-relic"))return Response.json({configured:!0,tools:e,sources:t,project:S(),pages:[],history:[],timestamp:new Date().toISOString()});try{var r;let a=performance.now(),n=await p((0,R.env)("NEWRELIC_API_KEY"),(0,R.env)("NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID"));if(0===n.length)return Response.json({configured:!0,tools:e,sources:t,project:S(),pages:[],history:m,timestamp:new Date().toISOString()});let o=performance.now(),i=new c((0,R.env)("NEWRELIC_API_KEY"),(0,R.env)("NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID")).byPath().then(e=>((0,E.recordTiming)("New Relic: metrics",performance.now()-o),e)),s=performance.now(),l=e.includes("sentry")?new f((0,R.env)("SENTRY_API_KEY"),(0,R.env)("SENTRY_DSN")).byPath().then(e=>((0,E.recordTiming)("Sentry: events",performance.now()-s),e)):Promise.resolve(null),[u,d]=await Promise.all([i,l.catch(()=>void 0)]),h=void 0===d?["sentry"]:[],g=d??{};console.log(`[timing] combined New Relic + Sentry batch: ${Math.round(performance.now()-a)}ms`);let v=(r=n.map(({name:t,slug:r,url:a,views:n})=>{var o,i;let s=u[a]??y,l=e.includes("sentry")&&!h.length?g[a]??C:void 0;return{name:t,slug:r,url:a,visitors:(o=n)>=1e3?`${(o/1e3).toFixed(1)}k`:String(o),status:(i=s).errorRate>5?"Critical":i.errorRate>1||i.apdexScore<.9?"Warning":"Healthy",newRelic:s,sentry:l,recordedAt:new Date().toISOString()}}),r.map(e=>{let r,a;if(e.metrics&&e.byTool)return e;let n={...e.newRelic&&{"new-relic":{traffic:{count:(r=e.newRelic).throughput},loadTime:r.loadTime,apdex:r.apdexScore,vitals:{lcp:r.lcp,cls:r.cls,inp:r.inp,ttfb:r.ttfb,fid:r.fid},...void 0!==r.ajaxLatency&&{ajax:{latency:r.ajaxLatency,failRate:r.ajaxFailRate??0}},errorRate:r.errorRate}},...e.sentry&&{sentry:{errors:{count:(a=e.sentry).errorCount,latest:a.latestErrors}}}};return{...e,metrics:(0,w.mergeMetrics)(n,t,h),byTool:n}}));return m.push({timestamp:new Date().toISOString(),sources:t,pages:v}),m.length>20&&m.shift(),Response.json({configured:!0,tools:e,failed:h,sources:t,project:S(),pages:v,history:m,timestamp:new Date().toISOString()})}catch(e){return console.error("Metrics API error:",e),Response.json({error:e instanceof Error?e.message:"Unknown error"},{status:500})}}let y={loadTime:0,lcp:0,ttfb:0,cls:0,inp:0,fid:0,errorRate:0,throughput:0,apdexScore:0},C={errorCount:0,errorRate:0,warningCount:0,latestErrors:[]};function S(){return(0,R.env)("METRICFLOW_PROJECT_NAME")||(0,t.basename)(process.cwd())}e.s(["GET",0,v],51980)},6408,e=>{"use strict";var t=e.i(12425),r=e.i(83353),a=e.i(47902),n=e.i(37892),o=e.i(54261),i=e.i(39548),s=e.i(68187),l=e.i(63984),c=e.i(88743),u=e.i(24698),p=e.i(13487),d=e.i(48776),h=e.i(29398),g=e.i(31610),f=e.i(45919),R=e.i(93695),m=e.i(12741);e.i(95315);var w=e.i(98732);let E=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/metrics/route",pathname:"/api/metrics",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/metrics/route.ts",nextConfigOutput:"",userland:()=>e.r(51980),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:y,serverHooks:C}=E;async function S(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),E.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/metrics/route";v=v.replace(/\/index$/,"")||"/";let y=await E.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!y)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:C,deploymentId:S,params:A,nextConfig:T,parsedUrl:x,isDraftMode:I,prerenderManifest:N,routerServerContext:b,isOnDemandRevalidate:P,revalidateOnlyGenerated:O,resolvedPathname:_,clientReferenceManifest:j,serverActionsManifest:U}=y,$=(0,s.normalizeAppPath)(v),L=!!N.routes[_]&&(E.isDev||(0,m.isRouteCacheOwner)(_,E.cacheOwner,N.routes[_])),M=!!(N.dynamicRoutes[$]||L),q=async()=>((null==b?void 0:b.render404)?await b.render404(e,t,x,!1):t.end("This page could not be found"),null);if(M&&!I){let e=N.dynamicRoutes[$];if(e&&!1===e.fallback&&!L){if(T.adapterPath)return await q();throw new R.NoFallbackError}}let D=null;!M||E.isDev||I||(D="/index"===(D=_)?"/":D);let F=!0===E.isDev||!M,H=M&&!F;U&&j&&(0,i.setManifestsSingleton)({page:v,clientReferenceManifest:j,serverActionsManifest:U});let k=e.method||"GET",K=(0,o.getTracer)(),B=K.getActiveScopeSpan(),W=!!(null==b?void 0:b.isWrappedByNextServer),V=!!(0,n.getRequestMeta)(e,"minimalMode"),G=(0,n.getRequestMeta)(e,"incrementalCache")||await E.getIncrementalCache(e,T,N,V);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let z={params:A,previewProps:N.preview,renderOpts:{experimental:{authInterrupts:!!T.experimental.authInterrupts,useCacheTimeout:T.experimental.useCacheTimeout},cacheComponents:!!T.cacheComponents,validationLevel:T.experimental.instantInsights.validationLevel,isDraftMode:I,supportsDynamicResponse:F,incrementalCache:G,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:T.cacheLife,staticPageGenerationTimeout:T.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>E.onRequestError(e,t,a,n,b)},sharedContext:{buildId:C,deploymentId:S}},X=new l.NodeNextRequest(e),Y=new l.NodeNextResponse(t),J=c.NextRequestAdapter.fromNodeNextRequest(X,(0,c.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:r})=>{try{if(!V&&P&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await E.handle(J,z);e.fetchMetrics=z.renderOpts.fetchMetrics;let o=z.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let i=z.renderOpts.collectedTags;if(!M)return await (0,d.sendResponse)(X,Y,n,o),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);i&&(t[f.NEXT_CACHE_TAGS_HEADER]=i),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==z.renderOpts.collectedRevalidate&&!(z.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&z.renderOpts.collectedRevalidate,a=void 0===z.renderOpts.collectedExpire||z.renderOpts.collectedExpire>=f.INFINITE_CACHE?!1!==r&&r>0?T.expireTime:void 0:z.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:P})},!1,b),t}},Q=async(n,i)=>{try{var s,l;let n=await E.handleResponse({req:e,nextConfig:T,cacheKey:D,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:P,revalidateOnlyGenerated:O,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:V});if(!M)return;if((null==n||null==(s=n.value)?void 0:s.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});V||t.setHeader("x-nextjs-cache",P?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),I&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let o=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);V&&M||o.delete(f.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||o.get("Cache-Control")||o.set("Cache-Control",(0,g.getCacheControlHeader)(n.cacheControl)),await (0,d.sendResponse)(X,Y,new Response(n.value.body,{headers:o,status:n.value.status||200}));return}catch(t){if(t instanceof R.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:$,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:P})},!1,b),M)throw t;await (0,d.sendResponse)(X,Y,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:o.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let r=K.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.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 a=r.get("next.route")||$,s=`${k} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":s}),n.updateName(s),i&&i!==n&&(i.setAttribute("http.route",a),i.updateName(s))})()}};if(W&&B)await Q(B,void 0);else{let t=K.getActiveScopeSpan();await K.withPropagatedContext(e.headers,()=>K.trace(u.BaseServerSpan.handleRequest,{spanName:`${k} ${v}`,kind:o.SpanKind.SERVER,attributes:{"http.method":k,"http.target":e.url}},e=>Q(e,t)),void 0,!W)}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:y})},"routeModule",0,E,"serverHooks",0,C,"workAsyncStorage",0,v,"workUnitAsyncStorage",0,y])}];
17
17
 
18
18
  //# sourceMappingURL=_0wct7-r._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[52040,1730,7779,a=>{"use strict";a.i(19973),a.s([],52040),a.i(2157),a.i(50227);var b=a.i(7969);let c={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"}]]};c.node;let d=(0,b.default)(c),e={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"}]]};e.node;let f=(0,b.default)(e);function g(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 h=a=>a.length?a.reduce((a,b)=>a+b,0)/a.length:0,i={"new-relic":{label:"New Relic",icon:d,description:"Real-user performance per page: load time, Core Web Vitals, throughput and Apdex.",keys:{required:["NEWRELIC_API_KEY","NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID"],optional:["NEWRELIC_INSERT_KEY"]},stats:a=>[{label:"Avg Load Time",value:g(h(a.map(a=>a.newRelic.loadTime)))},{label:"Avg LCP",value:g(h(a.map(a=>a.newRelic.lcp)))},{label:"Avg TTFB",value:g(h(a.map(a=>a.newRelic.ttfb)))},{label:"Avg Apdex",value:h(a.map(a=>a.newRelic.apdexScore)).toFixed(2)}],columns:[{header:"Load",cell:a=>g(a.newRelic.loadTime)},{header:"LCP",cell:a=>g(a.newRelic.lcp)},{header:"TTFB",cell:a=>g(a.newRelic.ttfb)},{header:"CLS",cell:a=>a.newRelic.cls.toFixed(2)},{header:"INP",cell:a=>void 0===a.newRelic.inp?"—":g(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:f,description:"Errors captured per page over the last 24 hours.",keys:{required:["SENTRY_API_KEY","SENTRY_DSN"],optional:[]},stats:a=>{let b=a.reduce((a,b)=>(b.sentry?.errorCount??0)>(a?.sentry?.errorCount??0)?b:a,null);return[{label:"Total Errors",value:String(a.map(a=>a.sentry?.errorCount??0).reduce((a,b)=>a+b,0))},{label:"Pages With Errors",value:`${a.filter(a=>(a.sentry?.errorCount??0)>0).length} of ${a.length}`},{label:"Noisiest Page",value:b?.name??"None"}]},columns:[{header:"Errors",cell:a=>String(a.sentry?.errorCount??0)},{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()}}]}},j=Object.keys(i);a.s(["TOOLS",0,i,"TOOL_IDS",0,j,"isToolId",0,a=>Object.hasOwn(i,a)],1730);let k="NEWRELIC_REGION",l={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"}};function m(a){return process.env[a]??""}a.s(["REGION_KEY",0,k,"env",0,m,"isToolConnected",0,a=>i[a].keys.required.every(a=>m(a)),"nrHosts",0,(a="eu"===process.env[k]?"eu":"us")=>l[a]],7779)},79898,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DynamicServerError:function(){return g},isDynamicServerError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="DYNAMIC_SERVER_USAGE";class g extends Error{constructor(a){super(`Dynamic server usage: ${a}`),this.description=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&"string"==typeof a.digest&&a.digest===f}("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)},85827,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={StaticGenBailoutError:function(){return g},isStaticGenBailoutError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="NEXT_STATIC_GEN_BAILOUT";class g extends Error{constructor(...a){super(...a),this.code=f}}function h(a){return"object"==typeof a&&null!==a&&"code"in a&&a.code===f}("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)},65297,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={METADATA_BOUNDARY_NAME:function(){return f},OUTLET_BOUNDARY_NAME:function(){return h},ROOT_LAYOUT_BOUNDARY_NAME:function(){return i},VIEWPORT_BOUNDARY_NAME:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="__next_metadata_boundary__",g="__next_viewport_boundary__",h="__next_outlet_boundary__",i="__next_root_layout_boundary__"},82299,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={atLeastOneTask:function(){return h},scheduleImmediate:function(){return g},scheduleOnNextTick:function(){return f},waitAtLeastOneReactRenderTask:function(){return i}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a=>{Promise.resolve().then(()=>{process.nextTick(a)})},g=a=>{setImmediate(a)};function h(){return new Promise(a=>g(a))}function i(){return new Promise(a=>setImmediate(a))}},55688,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={createDynamicBodyError:function(){return g},createDynamicBodyErrorInNavigation:function(){return j},createDynamicMetadataError:function(){return n},createDynamicOrRuntimeBodyError:function(){return k},createDynamicOrRuntimeMetadataError:function(){return s},createDynamicOrRuntimeViewportError:function(){return r},createDynamicViewportError:function(){return q},createLinkBodyErrorInNavigation:function(){return i},createLinkMetadataError:function(){return l},createLinkViewportError:function(){return o},createRuntimeBodyError:function(){return f},createRuntimeBodyErrorInNavigation:function(){return h},createRuntimeMetadataError:function(){return m},createRuntimeViewportError:function(){return p},logBuildDebugHint:function(){return t}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return Object.defineProperty(Error(`Route "${a}": Next.js encountered runtime data during prerendering.
1
+ module.exports=[52040,1730,7779,a=>{"use strict";a.i(19973),a.s([],52040),a.i(2157),a.i(50227);var b=a.i(7969);let c={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"}]]};c.node;let d=(0,b.default)(c),e={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"}]]};e.node;let f=(0,b.default)(e);function g(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 h=a=>a.length?a.reduce((a,b)=>a+b,0)/a.length:0,i={"new-relic":{label:"New Relic",icon:d,description:"Real-user performance per page: load time, Core Web Vitals, throughput and Apdex.",connectReason:"Add your New Relic keys to see load time and Core Web Vitals for each page.",setupNote:"The key that sends events (Ingest - License) is separate and is added later on the Connect page.",keys:{required:["NEWRELIC_API_KEY","NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID"],optional:["NEWRELIC_INSERT_KEY"],derived:["NEWRELIC_REGION"]},capabilities:["pages","traffic","loadTime","apdex","vitals","ajax","errorRate"],stats:a=>[{label:"Avg Load Time",value:g(h(a.map(a=>a.newRelic.loadTime)))},{label:"Avg LCP",value:g(h(a.map(a=>a.newRelic.lcp)))},{label:"Avg TTFB",value:g(h(a.map(a=>a.newRelic.ttfb)))},{label:"Avg Apdex",value:h(a.map(a=>a.newRelic.apdexScore)).toFixed(2)}],columns:[{needs:"loadTime",header:"Load",cell:a=>g(a.newRelic.loadTime)},{needs:"vitals",header:"LCP",cell:a=>g(a.newRelic.lcp)},{needs:"vitals",header:"TTFB",cell:a=>g(a.newRelic.ttfb)},{needs:"vitals",header:"CLS",cell:a=>a.newRelic.cls.toFixed(2)},{needs:"vitals",header:"INP",cell:a=>{let b=a.newRelic.inp;return void 0===b?"—":g(b)}},{needs:"errorRate",header:"Error Rate",cell:a=>`${a.newRelic.errorRate.toFixed(2)}%`},{needs:"traffic",header:"Throughput",cell:a=>a.newRelic.throughput.toLocaleString()},{needs:"apdex",header:"Apdex",cell:a=>a.newRelic.apdexScore.toFixed(2)}]},sentry:{label:"Sentry",icon:f,description:"Errors captured per page over the last 24 hours.",connectReason:"Add your Sentry keys to see the errors on each page.",keys:{required:["SENTRY_API_KEY","SENTRY_DSN"],optional:[]},capabilities:["errors"],stats:a=>{let b=a.reduce((a,b)=>(b.sentry?.errorCount??0)>(a?.sentry?.errorCount??0)?b:a,null);return[{label:"Total Errors",value:String(a.map(a=>a.sentry?.errorCount??0).reduce((a,b)=>a+b,0))},{label:"Pages With Errors",value:`${a.filter(a=>(a.sentry?.errorCount??0)>0).length} of ${a.length}`},{label:"Noisiest Page",value:b?.name??"None"}]},columns:[{needs:"errors",header:"Errors",cell:a=>String(a.sentry?.errorCount??0)},{needs:"errors",header:"Latest Error",cell:a=>a.sentry?.latestErrors[0]?.title??"—"},{needs:"errors",header:"Last Seen",cell:a=>{let b=Date.parse(a.sentry?.latestErrors[0]?.lastSeen??"");return Number.isNaN(b)?"—":new Date(b).toLocaleString()}}]}};Object.fromEntries(Object.entries({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".'},NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID:{label:"New Relic account ID",secret:!1,help:"A plain number, shown next to your keys in New Relic."},SENTRY_API_KEY:{label:"Sentry auth token",secret:!0,help:"Lets the dashboard read issues (scopes: project:read, event:read)."},SENTRY_DSN:{label:"Sentry DSN",secret:!1,help:"Project settings, then Client Keys (DSN). The project and host are read from it."}}).map(([a,b])=>[a,b.label]));let j=Object.keys(i);a.s(["TOOLS",0,i,"TOOL_IDS",0,j,"isToolId",0,a=>Object.hasOwn(i,a)],1730),j.flatMap(a=>i[a].keys.required);let k="NEWRELIC_REGION",l={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"}};function m(a){return process.env[a]??""}a.s(["REGION_KEY",0,k,"env",0,m,"isToolConnected",0,a=>i[a].keys.required.every(a=>m(a)),"nrHosts",0,(a="eu"===process.env[k]?"eu":"us")=>l[a]],7779)},79898,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DynamicServerError:function(){return g},isDynamicServerError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="DYNAMIC_SERVER_USAGE";class g extends Error{constructor(a){super(`Dynamic server usage: ${a}`),this.description=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&"string"==typeof a.digest&&a.digest===f}("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)},85827,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={StaticGenBailoutError:function(){return g},isStaticGenBailoutError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="NEXT_STATIC_GEN_BAILOUT";class g extends Error{constructor(...a){super(...a),this.code=f}}function h(a){return"object"==typeof a&&null!==a&&"code"in a&&a.code===f}("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)},65297,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={METADATA_BOUNDARY_NAME:function(){return f},OUTLET_BOUNDARY_NAME:function(){return h},ROOT_LAYOUT_BOUNDARY_NAME:function(){return i},VIEWPORT_BOUNDARY_NAME:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="__next_metadata_boundary__",g="__next_viewport_boundary__",h="__next_outlet_boundary__",i="__next_root_layout_boundary__"},82299,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={atLeastOneTask:function(){return h},scheduleImmediate:function(){return g},scheduleOnNextTick:function(){return f},waitAtLeastOneReactRenderTask:function(){return i}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a=>{Promise.resolve().then(()=>{process.nextTick(a)})},g=a=>{setImmediate(a)};function h(){return new Promise(a=>g(a))}function i(){return new Promise(a=>setImmediate(a))}},55688,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={createDynamicBodyError:function(){return g},createDynamicBodyErrorInNavigation:function(){return j},createDynamicMetadataError:function(){return n},createDynamicOrRuntimeBodyError:function(){return k},createDynamicOrRuntimeMetadataError:function(){return s},createDynamicOrRuntimeViewportError:function(){return r},createDynamicViewportError:function(){return q},createLinkBodyErrorInNavigation:function(){return i},createLinkMetadataError:function(){return l},createLinkViewportError:function(){return o},createRuntimeBodyError:function(){return f},createRuntimeBodyErrorInNavigation:function(){return h},createRuntimeMetadataError:function(){return m},createRuntimeViewportError:function(){return p},logBuildDebugHint:function(){return t}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return Object.defineProperty(Error(`Route "${a}": Next.js encountered runtime data during prerendering.
2
2
 
3
3
  \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`<Suspense>\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.
4
4
 
@@ -1,3 +1,3 @@
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"))},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"))},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(1730),i=a.i(7779),j=a.i(78720),k=a.i(29171),l=a.i(43917);function m({title:a="No data yet",reason:c="Keys work, but no page events have arrived.",href:d="/connect",cta:e="Send your first events",onRetry:f}){return(0,b.jsx)(k.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md",children:(0,b.jsxs)(k.CardContent,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold text-white",children:a}),(0,b.jsx)("p",{className:"max-w-md text-sm text-gray-400",children:c}),(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsx)(j.default,{href:d,className:(0,l.buttonVariants)(),children:e}),f&&(0,b.jsx)(l.Button,{variant:"outline",onClick:f,children:"Retry"})]})]})})}let n={"new-relic":"Add your New Relic keys to see load time and Core Web Vitals for each page.",sentry:"Add your Sentry keys to see the errors on each page."};async function o({params:a}){let{tool:j}=await a;return(0,h.isToolId)(j)||(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:h.TOOLS[j].label}),(0,b.jsx)("p",{className:"text-sm text-gray-400",children:h.TOOLS[j].description}),(0,i.isToolConnected)(j)?(0,b.jsx)(g.ToolInsights,{tool:j}):(0,b.jsx)("div",{className:"mt-6",children:(0,b.jsx)(m,{title:`Connect ${h.TOOLS[j].label}`,reason:n[j],href:`/setup#${j}`,cta:`Add ${h.TOOLS[j].label} keys`})})]})]})]})}a.s(["default",0,o,"dynamic",0,"force-dynamic"],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)},43917,a=>{"use strict";let b,c;var d=a.i(91396),e=a.i(38182);let f=a=>"boolean"==typeof a?`${a}`:0===a?"0":a,g=function(){for(var a,b,c=0,d="",e=arguments.length;c<e;c++)(a=arguments[c])&&(b=function a(b){var c,d,e="";if("string"==typeof b||"number"==typeof b)e+=b;else if("object"==typeof b)if(Array.isArray(b)){var f=b.length;for(c=0;c<f;c++)b[c]&&(d=a(b[c]))&&(e&&(e+=" "),e+=d)}else for(d in b)b[d]&&(e&&(e+=" "),e+=d);return e}(a))&&(d&&(d+=" "),d+=b);return d};var h=a.i(67913);let i=(b="group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",c={variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}},a=>{var d;if((null==c?void 0:c.variants)==null)return g(b,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:e,defaultVariants:h}=c,i=Object.keys(e).map(b=>{let c=null==a?void 0:a[b],d=null==h?void 0:h[b];if(null===c)return null;let g=f(c)||f(d);return e[b][g]}),j=a&&Object.entries(a).reduce((a,b)=>{let[c,d]=b;return void 0===d||(a[c]=d),a},{});return g(b,i,null==c||null==(d=c.compoundVariants)?void 0:d.reduce((a,b)=>{let{class:c,className:d,...e}=b;return Object.entries(e).every(a=>{let[b,c]=a;return Array.isArray(c)?c.includes({...h,...j}[b]):({...h,...j})[b]===c})?[...a,c,d]:a},[]),null==a?void 0:a.class,null==a?void 0:a.className)});a.s(["Button",0,function({className:a,variant:b="default",size:c="default",...f}){return(0,d.jsx)(e.Button,{"data-slot":"button",className:(0,h.cn)(i({variant:b,size:c,className:a})),...f})},"buttonVariants",0,i],43917)},45603,a=>{"use strict";a.s(["Button",()=>b]);let b=(0,a.i(18060).registerClientReference)(function(){throw Error("Attempted to call Button() from the server but Button 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]/node_modules/.pnpm/@base-ui+react@1.8.0_@types+react@19.3.0_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@base-ui/react/button/Button.mjs","Button")},38182,a=>{"use strict";var b=a.i(45603);a.n(b)},25809,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},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)},40950,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(18060);a.n(d("[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/app-dir/link.js"))},53824,a=>{"use strict";var b=a.i(40950);a.n(b)},78720,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={default:function(){return i},useLinkStatus:function(){return h.useLinkStatus}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(25809),g=a.r(91396),h=f._(a.r(53824));function i(a){let b=a.legacyBehavior,c="string"==typeof a.children||"number"==typeof a.children||"string"==typeof a.children?.type,d=a.children?.type?.$$typeof===Symbol.for("react.client.reference");return!b||c||d||(a.children?.type?.$$typeof===Symbol.for("react.lazy")?console.error("Using a Lazy Component as a direct child of `<Link legacyBehavior>` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's `<a>` tag."):console.error("Using a Server Component as a direct child of `<Link legacyBehavior>` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's `<a>` tag.")),(0,g.jsx)(h.default,{...a})}("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)},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)}];
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"))},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"))},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(1730),i=a.i(7779),j=a.i(78720),k=a.i(29171),l=a.i(43917);function m({title:a="No data yet",reason:c="Keys work, but no page events have arrived.",href:d="/connect",cta:e="Send your first events",onRetry:f}){return(0,b.jsx)(k.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md",children:(0,b.jsxs)(k.CardContent,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold text-white",children:a}),(0,b.jsx)("p",{className:"max-w-md text-sm text-gray-400",children:c}),(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsx)(j.default,{href:d,className:(0,l.buttonVariants)(),children:e}),f&&(0,b.jsx)(l.Button,{variant:"outline",onClick:f,children:"Retry"})]})]})})}async function n({params:a}){let{tool:j}=await a;return(0,h.isToolId)(j)||(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:h.TOOLS[j].label}),(0,b.jsx)("p",{className:"text-sm text-gray-400",children:h.TOOLS[j].description}),(0,i.isToolConnected)(j)?(0,b.jsx)(g.ToolInsights,{tool:j}):(0,b.jsx)("div",{className:"mt-6",children:(0,b.jsx)(m,{title:`Connect ${h.TOOLS[j].label}`,reason:h.TOOLS[j].connectReason,href:`/setup#${j}`,cta:`Add ${h.TOOLS[j].label} keys`})})]})]})]})}a.s(["default",0,n,"dynamic",0,"force-dynamic"],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)},43917,a=>{"use strict";let b,c;var d=a.i(91396),e=a.i(38182);let f=a=>"boolean"==typeof a?`${a}`:0===a?"0":a,g=function(){for(var a,b,c=0,d="",e=arguments.length;c<e;c++)(a=arguments[c])&&(b=function a(b){var c,d,e="";if("string"==typeof b||"number"==typeof b)e+=b;else if("object"==typeof b)if(Array.isArray(b)){var f=b.length;for(c=0;c<f;c++)b[c]&&(d=a(b[c]))&&(e&&(e+=" "),e+=d)}else for(d in b)b[d]&&(e&&(e+=" "),e+=d);return e}(a))&&(d&&(d+=" "),d+=b);return d};var h=a.i(67913);let i=(b="group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",c={variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}},a=>{var d;if((null==c?void 0:c.variants)==null)return g(b,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:e,defaultVariants:h}=c,i=Object.keys(e).map(b=>{let c=null==a?void 0:a[b],d=null==h?void 0:h[b];if(null===c)return null;let g=f(c)||f(d);return e[b][g]}),j=a&&Object.entries(a).reduce((a,b)=>{let[c,d]=b;return void 0===d||(a[c]=d),a},{});return g(b,i,null==c||null==(d=c.compoundVariants)?void 0:d.reduce((a,b)=>{let{class:c,className:d,...e}=b;return Object.entries(e).every(a=>{let[b,c]=a;return Array.isArray(c)?c.includes({...h,...j}[b]):({...h,...j})[b]===c})?[...a,c,d]:a},[]),null==a?void 0:a.class,null==a?void 0:a.className)});a.s(["Button",0,function({className:a,variant:b="default",size:c="default",...f}){return(0,d.jsx)(e.Button,{"data-slot":"button",className:(0,h.cn)(i({variant:b,size:c,className:a})),...f})},"buttonVariants",0,i],43917)},45603,a=>{"use strict";a.s(["Button",()=>b]);let b=(0,a.i(18060).registerClientReference)(function(){throw Error("Attempted to call Button() from the server but Button 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]/node_modules/.pnpm/@base-ui+react@1.8.0_@types+react@19.3.0_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@base-ui/react/button/Button.mjs","Button")},38182,a=>{"use strict";var b=a.i(45603);a.n(b)},25809,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},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)},40950,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(18060);a.n(d("[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/app-dir/link.js"))},53824,a=>{"use strict";var b=a.i(40950);a.n(b)},78720,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={default:function(){return i},useLinkStatus:function(){return h.useLinkStatus}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(25809),g=a.r(91396),h=f._(a.r(53824));function i(a){let b=a.legacyBehavior,c="string"==typeof a.children||"number"==typeof a.children||"string"==typeof a.children?.type,d=a.children?.type?.$$typeof===Symbol.for("react.client.reference");return!b||c||d||(a.children?.type?.$$typeof===Symbol.for("react.lazy")?console.error("Using a Lazy Component as a direct child of `<Link legacyBehavior>` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's `<a>` tag."):console.error("Using a Server Component as a direct child of `<Link legacyBehavior>` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's `<a>` tag.")),(0,g.jsx)(h.default,{...a})}("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)},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
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__0o_fd5z._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[92994,a=>{"use strict";var b=a.i(47350),c=a.i(56561),d=a.i(3130),e=a.i(40695);a.s(["EmptyState",0,function({title:a="No data yet",reason:f="Keys work, but no page events have arrived.",href:g="/connect",cta:h="Send your first events",onRetry:i}){return(0,b.jsx)(d.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md",children:(0,b.jsxs)(d.CardContent,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold text-white",children:a}),(0,b.jsx)("p",{className:"max-w-md text-sm text-gray-400",children:f}),(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsx)(c.default,{href:g,className:(0,e.buttonVariants)(),children:h}),i&&(0,b.jsx)(e.Button,{variant:"outline",onClick:i,children:"Retry"})]})]})})}])},13392,a=>{"use strict";var b=a.i(47350),c=a.i(53840),d=a.i(88237),e=a.i(3130),f=a.i(50463),g=a.i(92994),h=a.i(62191),i=a.i(93673);a.s(["ToolInsights",0,function({tool:a}){let{state:j,retry:k}=(0,h.useMetrics)(),l=(0,c.useRouter)(),{label:m,stats:n,columns:o}=i.TOOLS[a];if("loading"===j.status)return(0,b.jsx)(f.Skeleton,{className:"mt-6 h-64 w-full bg-[#2d3748]"});if("error"===j.status)return(0,b.jsx)(g.EmptyState,{title:"Could not load metrics",reason:j.message,onRetry:k});if(!j.configured)return(0,b.jsx)(g.EmptyState,{title:"Connect your data",reason:"Add your New Relic or Sentry keys to see real numbers.",href:"/setup",cta:"Set up keys"});if(!j.tools.includes("new-relic"))return(0,b.jsx)(g.EmptyState,{...h.NEEDS_NEW_RELIC});if(j.failed.includes(a))return(0,b.jsx)(g.EmptyState,{title:`Could not load ${m} data`,reason:"The request failed. Your other data is unaffected.",onRetry:k});let p=j.pages.filter(h.hasData);return p.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-4 mb-8 mt-4",children:n(p).map(a=>(0,b.jsx)(e.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md",children:(0,b.jsxs)(e.CardContent,{className:"p-6",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-gray-400",children:a.label}),(0,b.jsx)("div",{className:"mt-4 truncate text-3xl font-bold text-white tracking-tight",children:a.value})]})},a.label))}),(0,b.jsxs)(e.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md flex-1",children:[(0,b.jsx)(e.CardHeader,{children:(0,b.jsxs)(e.CardTitle,{className:"text-[18px] font-bold text-white tracking-tight",children:[m," by Page"]})}),(0,b.jsx)(e.CardContent,{children:(0,b.jsx)("div",{className:"rounded-md border border-[#2d3748] overflow-hidden",children:(0,b.jsxs)(d.Table,{children:[(0,b.jsx)(d.TableHeader,{className:"bg-[#0f1419]",children:(0,b.jsxs)(d.TableRow,{className:"border-[#2d3748] hover:bg-transparent",children:[(0,b.jsx)(d.TableHead,{className:"text-gray-400",children:"Page Name"}),(0,b.jsx)(d.TableHead,{className:"text-gray-400",children:"Path"}),o.map(a=>(0,b.jsx)(d.TableHead,{className:"text-gray-400",children:a.header},a.header))]})}),(0,b.jsx)(d.TableBody,{children:j.pages.map(a=>(0,b.jsxs)(d.TableRow,{className:"border-[#2d3748] hover:bg-white/5 transition-colors cursor-pointer",onClick:()=>l.push(`/performance/${a.slug}`),children:[(0,b.jsx)(d.TableCell,{className:"font-medium text-white",children:a.name}),(0,b.jsx)(d.TableCell,{className:"text-gray-500 font-mono text-xs",children:a.url}),o.map(c=>(0,b.jsx)(d.TableCell,{className:"max-w-[320px] truncate text-gray-400",children:(0,h.hasData)(a)?c.cell(a):"—"},c.header))]},a.slug))})]})})})]})]}):(0,b.jsx)(g.EmptyState,{})}])},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})}])},88237,a=>{"use strict";var b=a.i(47350),c=a.i(85198);a.s(["Table",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,b.jsx)("table",{"data-slot":"table",className:(0,c.cn)("w-full caption-bottom text-sm",a),...d})})},"TableBody",0,function({className:a,...d}){return(0,b.jsx)("tbody",{"data-slot":"table-body",className:(0,c.cn)("[&_tr:last-child]:border-0",a),...d})},"TableCell",0,function({className:a,...d}){return(0,b.jsx)("td",{"data-slot":"table-cell",className:(0,c.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",a),...d})},"TableHead",0,function({className:a,...d}){return(0,b.jsx)("th",{"data-slot":"table-head",className:(0,c.cn)("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",a),...d})},"TableHeader",0,function({className:a,...d}){return(0,b.jsx)("thead",{"data-slot":"table-header",className:(0,c.cn)("[&_tr]:border-b",a),...d})},"TableRow",0,function({className:a,...d}){return(0,b.jsx)("tr",{"data-slot":"table-row",className:(0,c.cn)("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",a),...d})}])},39848,a=>{"use strict";var b=a.i(75086);let c=(...a)=>a.filter((a,b,c)=>!!a&&""!==a.trim()&&c.indexOf(a)===b).join(" ").trim(),d={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"},e=(0,b.createContext)({}),f=(0,b.forwardRef)(({color:a,size:f,width:g,height:h,strokeWidth:i,absoluteStrokeWidth:j,nonScalingStroke:k,className:l="",children:m,iconNode:n=[],icon:o={node:n,aliases:[],size:24},...p},q)=>{let{size:r=24,strokeWidth:s=2,absoluteStrokeWidth:t=!1,nonScalingStroke:u=!1,color:v="currentColor",className:w=""}=(0,b.useContext)(e)??{},x=!!m||(a=>{for(let b in a)if(b.startsWith("aria-")||"role"===b||"title"===b)return!0;return!1})(p),[y,z,A=[]]=function(a,b={}){return function(a,b={}){let e=b.attributeNames??{},f=a=>e[a]??a,g=a.size??a.width??d.width,h=a.size??a.height??d.height,i=a.aliases?.filter(a=>"string"==typeof a&&""!==a.trim()).map(a=>`lucide-${a}`)??[],j=[...a.name?[`lucide-${a.name}`]:[],...i],k=b.className?.split(" ").filter(Boolean)??[],l=!1===b.includeDefaultClasses?c(...k):c("lucide",...j,...k),m=b.absoluteStrokeWidth?Number(b.strokeWidth??d["stroke-width"])*Number(a.size??a.width??d.width)/Number(b.size??b.width??d.width):b.strokeWidth??d["stroke-width"];return["svg",{...Object.entries(d).reduce((a,[b,c])=>(a[f(b)]=c,a),{}),..."color"in b&&b.color&&{[f("stroke")]:b.color},..."size"in b&&null!=b.size&&{[f("width")]:b.size,[f("height")]:b.size},..."width"in b&&null!=b.width&&{[f("width")]:b.width},..."height"in b&&null!=b.height&&{[f("height")]:b.height},[f("stroke-width")]:m,...l&&{[f("class")]:l},[f("viewBox")]:`0 0 ${g} ${h}`,...!1===b.hasA11yProp?{[f("aria-hidden")]:"true"}:{},..."attributes"in b&&b.attributes},a.node.map(a=>{let[c,d,e]=a,g=b.nonScalingStroke?{[f("vector-effect")]:"non-scaling-stroke",...d}:d;return e?[c,g,e]:[c,g]})]}(a,{...b,attributeNames:{...b.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(o,{color:a??v,width:g??f??r,height:h??f??r,strokeWidth:i??s,absoluteStrokeWidth:j??t,nonScalingStroke:k??u,className:c(w,l),hasA11yProp:x,attributes:p});return(0,b.createElement)(y,{ref:q,...z},[...A.map(([a,c])=>(0,b.createElement)(a,c)),...Array.isArray(m)?m:[m]])});a.s(["default",0,f],39848)},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)}];
1
+ module.exports=[92994,a=>{"use strict";var b=a.i(47350),c=a.i(56561),d=a.i(3130),e=a.i(40695);a.s(["EmptyState",0,function({title:a="No data yet",reason:f="Keys work, but no page events have arrived.",href:g="/connect",cta:h="Send your first events",onRetry:i}){return(0,b.jsx)(d.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md",children:(0,b.jsxs)(d.CardContent,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold text-white",children:a}),(0,b.jsx)("p",{className:"max-w-md text-sm text-gray-400",children:f}),(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsx)(c.default,{href:g,className:(0,e.buttonVariants)(),children:h}),i&&(0,b.jsx)(e.Button,{variant:"outline",onClick:i,children:"Retry"})]})]})})}])},13392,a=>{"use strict";var b=a.i(47350),c=a.i(53840),d=a.i(88237),e=a.i(3130),f=a.i(50463),g=a.i(92994),h=a.i(62191),i=a.i(93673);a.s(["ToolInsights",0,function({tool:a}){let{state:j,retry:k}=(0,h.useMetrics)(),l=(0,c.useRouter)(),{label:m,stats:n}=i.TOOLS[a],o=(0,i.toolColumns)(a);if("loading"===j.status)return(0,b.jsx)(f.Skeleton,{className:"mt-6 h-64 w-full bg-[#2d3748]"});if("error"===j.status)return(0,b.jsx)(g.EmptyState,{title:"Could not load metrics",reason:j.message,onRetry:k});if(!j.configured)return(0,b.jsx)(g.EmptyState,{title:"Connect your data",reason:"Add your New Relic or Sentry keys to see real numbers.",href:"/setup",cta:"Set up keys"});if(!j.sources.pages)return(0,b.jsx)(g.EmptyState,{...h.NEEDS_NEW_RELIC});if(j.failed.includes(a))return(0,b.jsx)(g.EmptyState,{title:`Could not load ${m} data`,reason:"The request failed. Your other data is unaffected.",onRetry:k});let p=j.pages.filter(h.hasData);return p.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-4 mb-8 mt-4",children:n(p).map(a=>(0,b.jsx)(e.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md",children:(0,b.jsxs)(e.CardContent,{className:"p-6",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-gray-400",children:a.label}),(0,b.jsx)("div",{className:"mt-4 truncate text-3xl font-bold text-white tracking-tight",children:a.value})]})},a.label))}),(0,b.jsxs)(e.Card,{className:"border-[#2d3748] bg-[#1a202c] shadow-md flex-1",children:[(0,b.jsx)(e.CardHeader,{children:(0,b.jsxs)(e.CardTitle,{className:"text-[18px] font-bold text-white tracking-tight",children:[m," by Page"]})}),(0,b.jsx)(e.CardContent,{children:(0,b.jsx)("div",{className:"rounded-md border border-[#2d3748] overflow-hidden",children:(0,b.jsxs)(d.Table,{children:[(0,b.jsx)(d.TableHeader,{className:"bg-[#0f1419]",children:(0,b.jsxs)(d.TableRow,{className:"border-[#2d3748] hover:bg-transparent",children:[(0,b.jsx)(d.TableHead,{className:"text-gray-400",children:"Page Name"}),(0,b.jsx)(d.TableHead,{className:"text-gray-400",children:"Path"}),o.map(a=>(0,b.jsx)(d.TableHead,{className:"text-gray-400",children:a.header},a.header))]})}),(0,b.jsx)(d.TableBody,{children:j.pages.map(a=>(0,b.jsxs)(d.TableRow,{className:"border-[#2d3748] hover:bg-white/5 transition-colors cursor-pointer",onClick:()=>l.push(`/performance/${a.slug}`),children:[(0,b.jsx)(d.TableCell,{className:"font-medium text-white",children:a.name}),(0,b.jsx)(d.TableCell,{className:"text-gray-500 font-mono text-xs",children:a.url}),o.map(c=>(0,b.jsx)(d.TableCell,{className:"max-w-[320px] truncate text-gray-400",children:(0,h.hasData)(a)?c.cell(a):"—"},c.header))]},a.slug))})]})})})]})]}):(0,b.jsx)(g.EmptyState,{})}])},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})}])},88237,a=>{"use strict";var b=a.i(47350),c=a.i(85198);a.s(["Table",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,b.jsx)("table",{"data-slot":"table",className:(0,c.cn)("w-full caption-bottom text-sm",a),...d})})},"TableBody",0,function({className:a,...d}){return(0,b.jsx)("tbody",{"data-slot":"table-body",className:(0,c.cn)("[&_tr:last-child]:border-0",a),...d})},"TableCell",0,function({className:a,...d}){return(0,b.jsx)("td",{"data-slot":"table-cell",className:(0,c.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",a),...d})},"TableHead",0,function({className:a,...d}){return(0,b.jsx)("th",{"data-slot":"table-head",className:(0,c.cn)("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",a),...d})},"TableHeader",0,function({className:a,...d}){return(0,b.jsx)("thead",{"data-slot":"table-header",className:(0,c.cn)("[&_tr]:border-b",a),...d})},"TableRow",0,function({className:a,...d}){return(0,b.jsx)("tr",{"data-slot":"table-row",className:(0,c.cn)("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",a),...d})}])},39848,a=>{"use strict";var b=a.i(75086);let c=(...a)=>a.filter((a,b,c)=>!!a&&""!==a.trim()&&c.indexOf(a)===b).join(" ").trim(),d={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"},e=(0,b.createContext)({}),f=(0,b.forwardRef)(({color:a,size:f,width:g,height:h,strokeWidth:i,absoluteStrokeWidth:j,nonScalingStroke:k,className:l="",children:m,iconNode:n=[],icon:o={node:n,aliases:[],size:24},...p},q)=>{let{size:r=24,strokeWidth:s=2,absoluteStrokeWidth:t=!1,nonScalingStroke:u=!1,color:v="currentColor",className:w=""}=(0,b.useContext)(e)??{},x=!!m||(a=>{for(let b in a)if(b.startsWith("aria-")||"role"===b||"title"===b)return!0;return!1})(p),[y,z,A=[]]=function(a,b={}){return function(a,b={}){let e=b.attributeNames??{},f=a=>e[a]??a,g=a.size??a.width??d.width,h=a.size??a.height??d.height,i=a.aliases?.filter(a=>"string"==typeof a&&""!==a.trim()).map(a=>`lucide-${a}`)??[],j=[...a.name?[`lucide-${a.name}`]:[],...i],k=b.className?.split(" ").filter(Boolean)??[],l=!1===b.includeDefaultClasses?c(...k):c("lucide",...j,...k),m=b.absoluteStrokeWidth?Number(b.strokeWidth??d["stroke-width"])*Number(a.size??a.width??d.width)/Number(b.size??b.width??d.width):b.strokeWidth??d["stroke-width"];return["svg",{...Object.entries(d).reduce((a,[b,c])=>(a[f(b)]=c,a),{}),..."color"in b&&b.color&&{[f("stroke")]:b.color},..."size"in b&&null!=b.size&&{[f("width")]:b.size,[f("height")]:b.size},..."width"in b&&null!=b.width&&{[f("width")]:b.width},..."height"in b&&null!=b.height&&{[f("height")]:b.height},[f("stroke-width")]:m,...l&&{[f("class")]:l},[f("viewBox")]:`0 0 ${g} ${h}`,...!1===b.hasA11yProp?{[f("aria-hidden")]:"true"}:{},..."attributes"in b&&b.attributes},a.node.map(a=>{let[c,d,e]=a,g=b.nonScalingStroke?{[f("vector-effect")]:"non-scaling-stroke",...d}:d;return e?[c,g,e]:[c,g]})]}(a,{...b,attributeNames:{...b.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(o,{color:a??v,width:g??f??r,height:h??f??r,strokeWidth:i??s,absoluteStrokeWidth:j??t,nonScalingStroke:k??u,className:c(w,l),hasA11yProp:x,attributes:p});return(0,b.createElement)(y,{ref:q,...z},[...A.map(([a,c])=>(0,b.createElement)(a,c)),...Array.isArray(m)?m:[m]])});a.s(["default",0,f],39848)},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
2
 
3
3
  //# sourceMappingURL=_0_02db6._.js.map
@@ -1,3 +1,3 @@
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),h=a.i(54161),i=a.i(93673);let j=[{name:"NEWRELIC_API_KEY",tool:"new-relic",label:i.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:i.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:i.KEY_LABELS.SENTRY_API_KEY,secret:!0,help:"Lets the dashboard read issues (scopes: project:read, event:read)."},{name:"SENTRY_DSN",tool:"sentry",label:i.KEY_LABELS.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,k]=(0,c.useState)({}),[l,m]=(0,c.useState)({}),[n,o]=(0,c.useState)({}),[p,q]=(0,c.useState)(null),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(null),x=(0,c.useRef)(null);async function y(b){b.preventDefault(),s(!0),q(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??{};o(d);let e=j.find(a=>d[a.name]&&!d[a.name].ok);if(e&&setTimeout(()=>x.current?.querySelector(`#${e.name}`)?.focus(),0),c.saved){u(!0),k({});let b=new Set(j.filter(b=>a[b.name]?.trim()).map(a=>a.tool));m(a=>({...a,...Object.fromEntries(j.filter(a=>b.has(a.tool)).map(a=>[a.name,!0]))}));let c=i.TOOL_IDS.filter(a=>b.has(a)||v?.includes(a));w(c),q({ok:!0,text:`Saved. ${c.map(a=>i.TOOLS[a].label).join(" and ")} ${c.length>1?"are":"is"} connected. No restart needed.`})}else q({ok:!1,text:c.error??"Nothing was saved. Fix the fields marked below."})}catch{q({ok:!1,text:"Could not reach the dashboard server."})}finally{s(!1)}}return(0,c.useEffect)(()=>{fetch("/api/setup").then(a=>a.json()).then(a=>{a.keys&&m(a.keys),Array.isArray(a.tools)?w(a.tools):a.error&&q({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 your tools"}),(0,b.jsx)(e.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,b.jsx)(e.CardContent,{children:(0,b.jsxs)("form",{ref:x,onSubmit:y,className:"flex flex-col gap-5",children:[i.TOOL_IDS.map(c=>(0,b.jsxs)("fieldset",{id:c,className:"flex flex-col gap-5 rounded-lg border border-[#2d3748] p-4",children:[(0,b.jsxs)("legend",{className:"flex items-center gap-2 px-2 text-sm font-semibold text-white",children:[i.TOOLS[c].label,v?.includes(c)?(0,b.jsx)(h.Badge,{variant:"outline",className:"border-[#3ee0a1] text-[#3ee0a1] bg-[#3ee0a1]/10",children:"✓ Connected"}):(0,b.jsx)(h.Badge,{variant:"outline",className:"border-[#4a5568] text-gray-400",children:"Optional"})]}),j.filter(a=>a.tool===c).map(c=>{let d=n[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," ",l[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:l[c.name]?"•••••••• (leave blank to keep, type to replace)":"",value:a[c.name]??"",onChange:b=>k({...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)}),"new-relic"===c&&(0,b.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."})]},c)),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)(f.Button,{type:"submit",disabled:r||!j.some(b=>a[b.name]?.trim()),children:r?"Checking…":"Check and save"}),(0,b.jsx)("span",{"aria-live":"polite",className:`text-sm ${p?.ok?"text-[#3ee0a1]":"text-[#f87171]"}`,children:p?.text}),!j.some(b=>a[b.name]?.trim())&&!p&&!t&&(0,b.jsx)("span",{className:"text-sm text-gray-400",children:v?.length?"Type a new key to change what is saved.":"Fill in both fields for at least one tool."}),t&&(0,b.jsx)(d.default,{href:"/connect",className:(0,f.buttonVariants)({variant:"outline"}),children:"Next: connect your app"})]})]})})]})}])},54161,a=>{"use strict";var b=a.i(18915),c=a.i(68228),d=a.i(42261),e=a.i(85198);let f=(0,d.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"}});a.s(["Badge",0,function({className:a,variant:d="default",render:g,...h}){return(0,c.useRender)({defaultTagName:"span",props:(0,b.mergeProps)({className:(0,e.cn)(f({variant:d}),a)},h),render:g,state:{slot:"badge",variant:d}})}])},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})}])},39848,a=>{"use strict";var b=a.i(75086);let c=(...a)=>a.filter((a,b,c)=>!!a&&""!==a.trim()&&c.indexOf(a)===b).join(" ").trim(),d={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"},e=(0,b.createContext)({}),f=(0,b.forwardRef)(({color:a,size:f,width:g,height:h,strokeWidth:i,absoluteStrokeWidth:j,nonScalingStroke:k,className:l="",children:m,iconNode:n=[],icon:o={node:n,aliases:[],size:24},...p},q)=>{let{size:r=24,strokeWidth:s=2,absoluteStrokeWidth:t=!1,nonScalingStroke:u=!1,color:v="currentColor",className:w=""}=(0,b.useContext)(e)??{},x=!!m||(a=>{for(let b in a)if(b.startsWith("aria-")||"role"===b||"title"===b)return!0;return!1})(p),[y,z,A=[]]=function(a,b={}){return function(a,b={}){let e=b.attributeNames??{},f=a=>e[a]??a,g=a.size??a.width??d.width,h=a.size??a.height??d.height,i=a.aliases?.filter(a=>"string"==typeof a&&""!==a.trim()).map(a=>`lucide-${a}`)??[],j=[...a.name?[`lucide-${a.name}`]:[],...i],k=b.className?.split(" ").filter(Boolean)??[],l=!1===b.includeDefaultClasses?c(...k):c("lucide",...j,...k),m=b.absoluteStrokeWidth?Number(b.strokeWidth??d["stroke-width"])*Number(a.size??a.width??d.width)/Number(b.size??b.width??d.width):b.strokeWidth??d["stroke-width"];return["svg",{...Object.entries(d).reduce((a,[b,c])=>(a[f(b)]=c,a),{}),..."color"in b&&b.color&&{[f("stroke")]:b.color},..."size"in b&&null!=b.size&&{[f("width")]:b.size,[f("height")]:b.size},..."width"in b&&null!=b.width&&{[f("width")]:b.width},..."height"in b&&null!=b.height&&{[f("height")]:b.height},[f("stroke-width")]:m,...l&&{[f("class")]:l},[f("viewBox")]:`0 0 ${g} ${h}`,...!1===b.hasA11yProp?{[f("aria-hidden")]:"true"}:{},..."attributes"in b&&b.attributes},a.node.map(a=>{let[c,d,e]=a,g=b.nonScalingStroke?{[f("vector-effect")]:"non-scaling-stroke",...d}:d;return e?[c,g,e]:[c,g]})]}(a,{...b,attributeNames:{...b.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(o,{color:a??v,width:g??f??r,height:h??f??r,strokeWidth:i??s,absoluteStrokeWidth:j??t,nonScalingStroke:k??u,className:c(w,l),hasA11yProp:x,attributes:p});return(0,b.createElement)(y,{ref:q,...z},[...A.map(([a,c])=>(0,b.createElement)(a,c)),...Array.isArray(m)?m:[m]])});a.s(["default",0,f],39848)},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)}];
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),h=a.i(54161),i=a.i(93673);let j=i.TOOL_IDS.flatMap(a=>i.TOOLS[a].keys.required.map(b=>({name:b,tool:a,...i.KEY_FIELDS[b]})));a.s(["SetupForm",0,function(){let[a,k]=(0,c.useState)({}),[l,m]=(0,c.useState)({}),[n,o]=(0,c.useState)({}),[p,q]=(0,c.useState)(null),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(null),x=(0,c.useRef)(null);async function y(b){b.preventDefault(),s(!0),q(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??{};o(d);let e=j.find(a=>d[a.name]&&!d[a.name].ok);if(e&&setTimeout(()=>x.current?.querySelector(`#${e.name}`)?.focus(),0),c.saved){u(!0),k({});let b=new Set(j.filter(b=>a[b.name]?.trim()).map(a=>a.tool));m(a=>({...a,...Object.fromEntries(j.filter(a=>b.has(a.tool)).map(a=>[a.name,!0]))}));let c=i.TOOL_IDS.filter(a=>b.has(a)||v?.includes(a));w(c),q({ok:!0,text:`Saved. ${c.map(a=>i.TOOLS[a].label).join(" and ")} ${c.length>1?"are":"is"} connected. No restart needed.`})}else q({ok:!1,text:c.error??"Nothing was saved. Fix the fields marked below."})}catch{q({ok:!1,text:"Could not reach the dashboard server."})}finally{s(!1)}}return(0,c.useEffect)(()=>{fetch("/api/setup").then(a=>a.json()).then(a=>{a.keys&&m(a.keys),Array.isArray(a.tools)?w(a.tools):a.error&&q({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 your tools"}),(0,b.jsx)(e.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,b.jsx)(e.CardContent,{children:(0,b.jsxs)("form",{ref:x,onSubmit:y,className:"flex flex-col gap-5",children:[i.TOOL_IDS.map(c=>(0,b.jsxs)("fieldset",{id:c,className:"flex flex-col gap-5 rounded-lg border border-[#2d3748] p-4",children:[(0,b.jsxs)("legend",{className:"flex items-center gap-2 px-2 text-sm font-semibold text-white",children:[i.TOOLS[c].label,v?.includes(c)?(0,b.jsx)(h.Badge,{variant:"outline",className:"border-[#3ee0a1] text-[#3ee0a1] bg-[#3ee0a1]/10",children:"✓ Connected"}):(0,b.jsx)(h.Badge,{variant:"outline",className:"border-[#4a5568] text-gray-400",children:"Optional"})]}),j.filter(a=>a.tool===c).map(c=>{let d=n[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," ",l[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:l[c.name]?"•••••••• (leave blank to keep, type to replace)":"",value:a[c.name]??"",onChange:b=>k({...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)}),i.TOOLS[c].setupNote&&(0,b.jsx)("p",{className:"text-xs text-gray-400",children:i.TOOLS[c].setupNote})]},c)),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)(f.Button,{type:"submit",disabled:r||!j.some(b=>a[b.name]?.trim()),children:r?"Checking…":"Check and save"}),(0,b.jsx)("span",{"aria-live":"polite",className:`text-sm ${p?.ok?"text-[#3ee0a1]":"text-[#f87171]"}`,children:p?.text}),!j.some(b=>a[b.name]?.trim())&&!p&&!t&&(0,b.jsx)("span",{className:"text-sm text-gray-400",children:v?.length?"Type a new key to change what is saved.":"Fill in both fields for at least one tool."}),t&&(0,b.jsx)(d.default,{href:"/connect",className:(0,f.buttonVariants)({variant:"outline"}),children:"Next: connect your app"})]})]})})]})}])},54161,a=>{"use strict";var b=a.i(18915),c=a.i(68228),d=a.i(42261),e=a.i(85198);let f=(0,d.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"}});a.s(["Badge",0,function({className:a,variant:d="default",render:g,...h}){return(0,c.useRender)({defaultTagName:"span",props:(0,b.mergeProps)({className:(0,e.cn)(f({variant:d}),a)},h),render:g,state:{slot:"badge",variant:d}})}])},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})}])},39848,a=>{"use strict";var b=a.i(75086);let c=(...a)=>a.filter((a,b,c)=>!!a&&""!==a.trim()&&c.indexOf(a)===b).join(" ").trim(),d={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"},e=(0,b.createContext)({}),f=(0,b.forwardRef)(({color:a,size:f,width:g,height:h,strokeWidth:i,absoluteStrokeWidth:j,nonScalingStroke:k,className:l="",children:m,iconNode:n=[],icon:o={node:n,aliases:[],size:24},...p},q)=>{let{size:r=24,strokeWidth:s=2,absoluteStrokeWidth:t=!1,nonScalingStroke:u=!1,color:v="currentColor",className:w=""}=(0,b.useContext)(e)??{},x=!!m||(a=>{for(let b in a)if(b.startsWith("aria-")||"role"===b||"title"===b)return!0;return!1})(p),[y,z,A=[]]=function(a,b={}){return function(a,b={}){let e=b.attributeNames??{},f=a=>e[a]??a,g=a.size??a.width??d.width,h=a.size??a.height??d.height,i=a.aliases?.filter(a=>"string"==typeof a&&""!==a.trim()).map(a=>`lucide-${a}`)??[],j=[...a.name?[`lucide-${a.name}`]:[],...i],k=b.className?.split(" ").filter(Boolean)??[],l=!1===b.includeDefaultClasses?c(...k):c("lucide",...j,...k),m=b.absoluteStrokeWidth?Number(b.strokeWidth??d["stroke-width"])*Number(a.size??a.width??d.width)/Number(b.size??b.width??d.width):b.strokeWidth??d["stroke-width"];return["svg",{...Object.entries(d).reduce((a,[b,c])=>(a[f(b)]=c,a),{}),..."color"in b&&b.color&&{[f("stroke")]:b.color},..."size"in b&&null!=b.size&&{[f("width")]:b.size,[f("height")]:b.size},..."width"in b&&null!=b.width&&{[f("width")]:b.width},..."height"in b&&null!=b.height&&{[f("height")]:b.height},[f("stroke-width")]:m,...l&&{[f("class")]:l},[f("viewBox")]:`0 0 ${g} ${h}`,...!1===b.hasA11yProp?{[f("aria-hidden")]:"true"}:{},..."attributes"in b&&b.attributes},a.node.map(a=>{let[c,d,e]=a,g=b.nonScalingStroke?{[f("vector-effect")]:"non-scaling-stroke",...d}:d;return e?[c,g,e]:[c,g]})]}(a,{...b,attributeNames:{...b.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(o,{color:a??v,width:g??f??r,height:h??f??r,strokeWidth:i??s,absoluteStrokeWidth:j??t,nonScalingStroke:k??u,className:c(w,l),hasA11yProp:x,attributes:p});return(0,b.createElement)(y,{ref:q,...z},[...A.map(([a,c])=>(0,b.createElement)(a,c)),...Array.isArray(m)?m:[m]])});a.s(["default",0,f],39848)},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
2
 
3
3
  //# sourceMappingURL=_0bxxvzb._.js.map