makearmy-app/.next/server/app/lasers/page.js
2025-09-22 10:37:53 -04:00

1 line
No EOL
9.5 KiB
JavaScript

(()=>{var e={};e.id=8339,e.ids=[8339],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:e=>{"use strict";e.exports=require("path")},36319:()=>{},41518:(e,s,t)=>{"use strict";t.r(s),t.d(s,{GlobalError:()=>l.a,__next_app__:()=>m,pages:()=>c,routeModule:()=>p,tree:()=>d});var r=t(65239),n=t(48088),a=t(88170),l=t.n(a),i=t(30893),o={};for(let e in i)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>i[e]);t.d(s,o);let d={children:["",{children:["lasers",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(t.bind(t,52300)),"/app/app/lasers/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(t.bind(t,58014)),"/app/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(t.t.bind(t,57398,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(t.t.bind(t,89999,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(t.t.bind(t,65284,23)),"next/dist/client/components/unauthorized-error"]}]}.children,c=["/app/app/lasers/page.tsx"],m={require:t,loadChunk:()=>Promise.resolve()},p=new r.AppPageRouteModule({definition:{kind:n.RouteKind.APP_PAGE,page:"/lasers/page",pathname:"/lasers",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},52300:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>r});let r=(0,t(12907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/app/app/lasers/page.tsx\" 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.")},"/app/app/lasers/page.tsx","default")},56444:(e,s,t)=>{Promise.resolve().then(t.t.bind(t,16444,23)),Promise.resolve().then(t.t.bind(t,16042,23)),Promise.resolve().then(t.t.bind(t,88170,23)),Promise.resolve().then(t.t.bind(t,49477,23)),Promise.resolve().then(t.t.bind(t,29345,23)),Promise.resolve().then(t.t.bind(t,12089,23)),Promise.resolve().then(t.t.bind(t,46577,23)),Promise.resolve().then(t.t.bind(t,31307,23))},58014:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>a,metadata:()=>n});var r=t(37413);t(90061);let n={title:"LE-DB",description:"Laser Everything Community Database"};function a({children:e}){return(0,r.jsx)("html",{lang:"en",className:"dark",children:(0,r.jsx)("body",{children:e})})}},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66172:(e,s,t)=>{Promise.resolve().then(t.t.bind(t,86346,23)),Promise.resolve().then(t.t.bind(t,27924,23)),Promise.resolve().then(t.t.bind(t,35656,23)),Promise.resolve().then(t.t.bind(t,40099,23)),Promise.resolve().then(t.t.bind(t,38243,23)),Promise.resolve().then(t.t.bind(t,28827,23)),Promise.resolve().then(t.t.bind(t,62763,23)),Promise.resolve().then(t.t.bind(t,97173,23))},76154:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>i});var r=t(60687),n=t(43210),a=t(85814),l=t.n(a);function i(){let[e,s]=(0,n.useState)([]),[t,a]=(0,n.useState)(""),[i,o]=(0,n.useState)(""),[d,c]=(0,n.useState)({}),[m,p]=(0,n.useState)("model"),[x,h]=(0,n.useState)("asc"),u=(e,s)=>s&&e?e.split(RegExp(`(${s})`,"gi")).map((e,t)=>e.toLowerCase()===s.toLowerCase()?(0,r.jsx)("mark",{children:e},t):e):e,b=(0,n.useMemo)(()=>{let s=i.toLowerCase();return e.filter(e=>[e.make,e.model].filter(Boolean).some(e=>e.toLowerCase().includes(s)))},[e,i]),j=(0,n.useMemo)(()=>b.reduce((e,s)=>{let t=s.make||"Unknown Make";return e[t]=e[t]||[],e[t].push(s),e},{}),[b]),f=[10600,1064,455,355],v=(e,s)=>{c(t=>({...t,[e]:t[e]===s?null:s}))},N=e=>{p(e),h(e=>"asc"===e?"desc":"asc")},g=(e,s)=>e?"w"===s?parseFloat(e.replace(/[^\d.]/g,""))||0:["mj","nm","khz","ns","v"].includes(s.toLowerCase())?parseFloat(e)||0:e.toString().toLowerCase():"",w=e=>m===e?"asc"===x?" ▲":" ▼":"",k=(0,n.useMemo)(()=>{let s=new Set,t={};for(let r of e)if(r.make&&s.add(r.make),r.nm){let e=r.nm;t[e]=(t[e]||0)+1}let r=Object.entries(t).sort((e,s)=>(Number(s[1])||0)-(Number(e[1])||0))[0]?.[0]||"—";return{total:e.length,uniqueMakes:s.size,commonNm:r}},[e]),y=(0,n.useMemo)(()=>[...e].filter(e=>e.submission_id).sort((e,s)=>s.submission_id-e.submission_id).slice(0,5),[e]);return(0,r.jsxs)("div",{className:"p-6 max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"grid gap-4 md:grid-cols-3 mb-6",children:[(0,r.jsxs)("div",{className:"card p-4",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold mb-2",children:"Database Summary"}),(0,r.jsxs)("p",{children:["Total Sources: ",k.total]}),(0,r.jsxs)("p",{children:["Unique Makes: ",k.uniqueMakes]}),(0,r.jsxs)("p",{children:["Most Common Wavelength: ",k.commonNm]})]}),(0,r.jsxs)("div",{className:"card p-4",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold mb-2",children:"Recent Additions"}),(0,r.jsx)("ul",{className:"text-sm list-disc pl-4",children:y.map(e=>(0,r.jsx)("li",{children:(0,r.jsxs)(l(),{className:"text-accent underline",href:`/lasers/${e.submission_id}`,children:[e.make," ",e.model]})},e.id))})]}),(0,r.jsxs)("div",{className:"card p-4",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold mb-2",children:"Feedback"}),(0,r.jsx)("p",{className:"text-sm mb-2",children:"See something wrong or want to suggest an improvement?"}),(0,r.jsx)(l(),{href:"#",className:"btn-primary inline-block",children:"Submit Feedback"})]})]}),(0,r.jsxs)("div",{className:"mb-6 card bg-card text-card-foreground",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold mb-2",children:"Laser Source Database"}),(0,r.jsx)("input",{type:"search",value:t,onChange:e=>a(e.target.value),placeholder:"Search by make or model...",className:"w-full max-w-md mb-4 dark:bg-background border border-border rounded-md p-2"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Browse laser source specifications collected from community-submitted and verified sources."})]}),0===Object.entries(j).length?(0,r.jsx)("p",{className:"text-muted",children:"No laser sources found."}):(0,r.jsx)("div",{className:"space-y-6",children:Object.entries(j).map(([e,s])=>{let t=null!=d[e]?s.filter(s=>parseInt(s.nm)===d[e]):s,n=[...t].sort((e,s)=>{let t=g(e[m],m),r=g(s[m],m);return t<r?"asc"===x?-1:1:t>r?"asc"===x?1:-1:0});return(0,r.jsxs)("details",{className:"border border-border rounded-md",children:[(0,r.jsxs)("summary",{className:"bg-card px-4 py-2 font-semibold cursor-pointer flex justify-between items-center",children:[(0,r.jsxs)("span",{children:[e," ",(0,r.jsxs)("span",{className:"text-sm text-muted",children:["(",t.length,")"]})]}),(0,r.jsx)("div",{className:"space-x-2",children:f.map(s=>(0,r.jsx)("button",{onClick:t=>{t.stopPropagation(),v(e,s)},className:`px-2 py-1 text-xs rounded-md border ${d[e]===s?"bg-accent text-white":"bg-muted text-muted-foreground"}`,children:s},s))})]}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full min-w-[900px] text-sm whitespace-nowrap",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-2 py-2 text-left",children:"Make"}),(0,r.jsx)("th",{className:"px-2 py-2 text-left w-64",children:(0,r.jsxs)("button",{onClick:()=>N("model"),children:["Model",w("model")]})}),(0,r.jsx)("th",{className:"px-2 py-2 text-left",children:(0,r.jsxs)("button",{onClick:()=>N("w"),children:["W",w("w")]})}),(0,r.jsx)("th",{className:"px-2 py-2 text-left",children:(0,r.jsxs)("button",{onClick:()=>N("mj"),children:["mJ",w("mj")]})}),(0,r.jsx)("th",{className:"px-2 py-2 text-left",children:(0,r.jsxs)("button",{onClick:()=>N("op"),children:["OP",w("op")]})}),(0,r.jsx)("th",{className:"px-2 py-2 text-left",children:(0,r.jsxs)("button",{onClick:()=>N("nm"),children:["nm",w("nm")]})}),(0,r.jsx)("th",{className:"px-2 py-2 text-left",children:(0,r.jsxs)("button",{onClick:()=>N("kHz"),children:["kHz",w("kHz")]})}),(0,r.jsx)("th",{className:"px-2 py-2 text-left",children:(0,r.jsxs)("button",{onClick:()=>N("ns"),children:["ns",w("ns")]})}),(0,r.jsx)("th",{className:"px-2 py-2 text-left",children:(0,r.jsxs)("button",{onClick:()=>N("v"),children:["V",w("v")]})})]})}),(0,r.jsx)("tbody",{children:n.map(e=>(0,r.jsxs)("tr",{className:"border-t border-border",children:[(0,r.jsx)("td",{className:"px-2 py-2 truncate max-w-[10rem]",children:u(e.make||"—",i)}),(0,r.jsx)("td",{className:"px-2 py-2 truncate max-w-[16rem]",children:(0,r.jsx)(l(),{href:`/lasers/${e.submission_id}`,className:"text-accent underline",children:u(e.model||"—",i)})}),(0,r.jsx)("td",{className:"px-2 py-2 whitespace-nowrap",children:e.w||"—"}),(0,r.jsx)("td",{className:"px-2 py-2 whitespace-nowrap",children:e.mj||"—"}),(0,r.jsx)("td",{className:"px-2 py-2 whitespace-nowrap",children:e.op?.label||e.op||"—"}),(0,r.jsx)("td",{className:"px-2 py-2 whitespace-nowrap",children:e.nm||"—"}),(0,r.jsx)("td",{className:"px-2 py-2 whitespace-nowrap",children:e.kHz||"—"}),(0,r.jsx)("td",{className:"px-2 py-2 whitespace-nowrap",children:e.ns||"—"}),(0,r.jsx)("td",{className:"px-2 py-2 whitespace-nowrap",children:e.v||"—"})]},e.id))})]})})]},e)})})]})}},85022:(e,s,t)=>{Promise.resolve().then(t.bind(t,76154))},89750:(e,s,t)=>{Promise.resolve().then(t.bind(t,52300))},90061:()=>{},96999:()=>{}};var s=require("../../webpack-runtime.js");s.C(e);var t=e=>s(s.s=e),r=s.X(0,[7719,4825,5814],()=>t(41518));module.exports=r})();