1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d66dbb3b-be50-4f18-8791-e3188196d265",e._sentryDebugIdIdentifier="sentry-dbid-d66dbb3b-be50-4f18-8791-e3188196d265")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8973],{78973:function(e,t,i){i.r(t),i.d(t,{default:function(){return b}});var l=i(57437),n=i(64552),r=i(2265),o=i(81822),s=i(17951),a=i(10309),d=i(47195);let c=["FSC","PEFC","Cradle-to-Cradle","BREEAM","LEED","Indoor Air Comfort","EPD Verified","Declare","GreenGuard Gold","Blauer Engel"],h={EPD:{bg:"#E8EBF0",text:"#182A41"},EC3:{bg:"#EBF0F5",text:"#2A3A4A"},Manual:{bg:"#F5F0EB",text:"#6B5B4E"},Estimated:{bg:"#EDEAE6",text:"#6B6863"}},p=["#182A41","#4A7A64","#7AA894","#B4D4C8","#182A41","#5C8870","#9ABCB0","#D0E8E0","#8A6F52","#B89A7A","#3D3A36","#696860"];function g(e){let{pct:t,color:i="#182A41",thin:n}=e;return(0,l.jsx)("div",{style:{flex:1,height:n?6:8,background:"#EDEAE6",borderRadius:99,overflow:"hidden"},children:(0,l.jsx)("div",{style:{width:"".concat(Math.min(100,Math.max(0,t)),"%"),height:"100%",background:i,borderRadius:99,transition:"width 0.4s"}})})}function x(e){var t,i;let{label:n,color:r}=e,o=h[n];return(0,l.jsx)("span",{style:{display:"inline-block",fontSize:10,fontWeight:600,borderRadius:3,padding:"2px 6px",background:null!==(t=null==o?void 0:o.bg)&&void 0!==t?t:"#EDEAE6",color:null!==(i=null==o?void 0:o.text)&&void 0!==i?i:"#3D3A36"},children:n})}function u(e){let{slices:t,size:i=140,total:n}
1=e,r=i/2-14,s=i/2,a=i/2,d=2*Math.PI*r,c=-90;return(0,l.jsxs)("svg",{width:i,height:i,style:{flexShrink:0},children:[t.map((e,t)=>{let i=e.value/n*360,o=e.value/n*d,h=(0,l.jsx)("circle",{cx:s,cy:a,r:r,fill:"none",stroke:e.color,strokeWidth:22,strokeDasharray:"".concat(o," ").concat(d-o),strokeDashoffset:d/4,transform:"rotate(".concat(c," ").concat(s," ").concat(a,")")},t);return c+=i,h}),(0,l.jsx)("circle",{cx:s,cy:a,r:r-14,fill:"#fff"}),(0,l.jsx)("text",{x:s,y:a-6,textAnchor:"middle",style:{fontSize:13,fontWeight:700,fill:"#1A1814",fontFamily:o.nb},children:n.toFixed(0)}),(0,l.jsx)("text",{x:s,y:a+10,textAnchor:"middle",style:{fontSize:9,fill:"#8A8680",fontFamily:o.nb},children:"kgCOâe"})]})}function f(e){var t;if(null==e.gwpKgCo2)return 3;let i=(null!==(t=e.gwpDataSource)&&void 0!==t?t:"").toLowerCase();return"epd"===i?1:"ec3"===i?2:3}async function y(e){if(e.startsWith("r2://")){try{let i=await fetch("/api/storage/serve?key=".concat(encodeURIComponent(e.replace("r2://",""))));if(i.ok){var t;let l=await i.json();return null!==(t=l.url)&&void 0!==t?t:e}}catch(e){}return e}return e.startsWith("http")?e:"https://".concat(e)}function b(e){var t,i;let{products:h,projectId:b,project:j,onProductsChange:m,onProjectChange:v}=e,A=(0,n.NT)(),[w,S]=(0,r.useState)(null),[E,C]=(0,r.useState)({}),[k,D]=(0,r.useState)({}),[T,z]=(0,r.useState)({}),[F,B]=(0,r.useState)(!1),[W,I]=(0,r.useState)(""),R=h.filter(e=>null!=e.gwpKgCo2&&e.gwpKgCo2>0),P=h.length>0?R.length/h.length*100:0,O=R.reduce((e,t)=>{var i,l;return e+(null!==(i=t.gwpKgCo2)&&void 0!==i?i:0)*(null!==(l=t.quantity)&&void 0!==l?l:1)},0),K=Object.entries(R.reduce((e,t)=>{var i,l,n;let r=t.category||"Other";return e[r]=(null!==(i=e[r])&&void 0!==i?i:0)+(null!==(l=t.gwpKgCo2)&&void 0!==l?l:0)*(null!==(n=t.quantity)&&void 0!==n?n:1),e},{})).sort((e,t)=>t[1]-e[1]).slice(0,6),N=[...R].map(e=>{var t,i;return{...e,totalGwp:(null!==(t=e.gwpKgCo2)&&void 0!==t?t:0)*(null!==(i=e.quantity)&&void 0!==i?i:1)}}).sort((e,t)=>t.totalGwp-e.totalGwp).slice(0,15),G=null!==(i=null===(t=N[0])||void 0===t?void 0:t.totalGwp)&&void 0!==i?i:1,_=Object.entries(R.reduce((e,t)=>{var i,l,n;let r=t.space||"General";return e[r]=(null!==(i=e[r])&&void 0!==i?i:0)+(null!==(l=t.gwpKgCo2)&&void 0!==l?l:0)*(null!==(n=t.quantity)&&void 0!==n?n:1),e},{})).sort((e,t)=>t[1]-e[1]),q=_.map((e,t)=>{let[i,l]=e;return{label:i,value:l,color:p[t%p.length]}}),M=h.filter(e=>1===f(e)),L=h.filter(e=>2===f(e)),U=h.filter(e=>3===f(e)&&null!=e.gwpKgCo2),V=h.filter(e=>null==e.gwpKgCo2),H=c.reduce((e,t)=>(e[t]=h.filter(e=>{var i;return null===(i=e.certifications)||void 0===i?void 0:i.includes(t)}).length,e),{}),Y=Math.max(...Object.values(H),1),J=h.reduce((e,t)=>{let i=t.space||"General";return e[i]||(e[i]=[]),e[i].push(t),e},{}),Z=Object.keys(J).sort(),Q=function(e,t){if(!t||t<=0||0===e)return{label:"Set target to compare",color:"#8A8680",bg:"#EDEAE6",dot:"#8A8680"};let i=e/t;return i<=.5?{label:"RIBA 2030 â On Track",color:"#182A41",bg:"#F3F5F8",dot:"#182A41"}:i<=.8?{label:"RIBA 2030 â Good",color:"#182A41",bg:"#F0F3E2",dot:"#6A8A28"}:i<=1?{label:"RIBA 2030 â Near Limit",color:"#5C4400",bg:"#FFF7E0",dot:"#C8880A"}:{label:"RIBA 2030 â Over Limit",color:"#7A2010",bg:"#F3E6DF",dot:"#C04030"}}(O,null==j?void 0:j.carbonTarget);function X(){let e=parseFloat(W.replace(/[^0-9.]/g,""));if(j&&v&&!isNaN(e)&&e>0){let t={...j,carbonTarget:e};v(t),(0,s.UI)(t)}B(!1),I("")}async function $(e){D(t=>({...t,[e.id]:!0})),z(t=>{let i={...t};return delete i[e.id],i});try{let l=await fetch("/api/ec3-lookup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({productName:e.name,category:e.category})}),n=await l.json();if(!l.ok||n.error){var t,i;let l=null!==(i=null!==(t=n.message)&&void 0!==t?t:n.error)&&void 0!==i?i:"EC3 lookup failed";"not_configured"===n.error?z(t=>({...t,[e.id]:"Add EC3_API_KEY to enable"})):z(t=>({...t,[e.id]:l}));return}let r=h.map(t=>t.id===e.id?{...t,gwpKgCo2:n.gwp,gwpDataSource:"EC3"}:t);(0,a.N)(b,r,h),m(r)}catch(t){z(t=>({...t,[e.id]:"Network error"}))}finally{D(t=>{let i={...t};return delete i[e.id],i})}}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{style:{maxWidth:960,margin:"0 auto",padding:"24px 24px 80px",fontFamily:o.nb},children:[(0,l.jsxs)("section",{style:{marginBottom:40},children:[(0,l.jsx)("h2",{style:{fontSize:11,fontWeight:700,color:"#8A8680",textTransform:"uppercase",letterSpacing:"0.1em",margin:"0 0 16px"},children:A("sustainabilityTab.carbonOverview")}),(0,l.jsxs)("div",{style:{background:"#1A1814",borderRadius:8,padding:"24px 28px",color:"#fff"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:24,flexWrap:"wrap",gap:16},children:[(0,l.jsxs)("div",{style:{display:"flex",gap:40,flexWrap:"wrap"},children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontSize:28,fontWeight:700,lineHeight:1},children:h.length}),(0,l.jsx)("div",{style:{fontSize:11,color:"#8A8680",marginTop:4},children:A("sustainabilityTab.totalProducts")})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontSize:28,fontWeight:700,lineHeight:1},children:R.length}),(0,l.jsxs)("div",{style:{fontSize:11,color:"#8A8680",marginTop:4},children:["With GWP data (",P.toFixed(0),"%)"]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontSize:28,fontWeight:700,lineHeight:1},children:O>0?O.toFixed(0):"â"}),(0,l.jsx)("div",{style:{fontSize:11,color:"#8A8680",marginTop:4},children:O>0?A("sustainabilityTab.kgCO2eTotal"):A("sustainabilityTab.noGwpData")})]})]}),(0,l.jsxs)("div",{style:{background:"rgba(255,255,255,0.06)",borderRadius:6,padding:"10px 14px",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4,flexShrink:0},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,l.jsx)("span",{style:{width:7,height:7,borderRadius:"50%",background:Q.dot,flexShrink:0}}),(0,l.jsx)("span",{style:{fontSize:11,fontWeight:600,color:"#D4D1CC"},children:Q.label})]}),(0,l.jsx)("span",{style:{fontSize:9,color:"#696860",textTransform:"uppercase",letterSpacing:"0.08em"},children:"RIBA 2030 Challenge"})]})]}),j&&(()=>{let e=j.carbonTarget,t=null!=e&&O>e,i=null!=e&&e>0?Math.min(100,O/e*100):0,n=t?"#C0392B":O/(null!=e?e:1)>.8?"#E67E22":"#4A7A64";return(0,l.jsxs)("div",{style:{marginBottom:20},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[(0,l.jsx)("span",{style:{fontSize:11,color:"#8A8680",flexShrink:0},children:A("sustainabilityTab.carbonTarget")}
1),F?(0,l.jsx)("input",{autoFocus:!0,type:"number",min:0,value:W,onChange:e=>I(e.target.value),onBlur:X,onKeyDown:e=>{"Enter"===e.key&&X(),"Escape"===e.key&&(B(!1),I(""))},placeholder:A("sustainabilityTab.unitKgCo2e"),style:{background:"transparent",border:"none",borderBottom:"1px solid #8A8680",color:"#fff",fontSize:12,width:100,outline:"none",padding:"2px 0",fontVariantNumeric:"tabular-nums"}}):null!=e?(0,l.jsxs)("span",{style:{fontSize:12,color:t?"#C0392B":"#4A7A64",cursor:"pointer",fontVariantNumeric:"tabular-nums"},title:A("sustainabilityTab.editCarbonTarget"),onClick:()=>{B(!0),I(String(e))},children:[O>0?"".concat(O.toFixed(0)," / "):"",e.toFixed(0)," kgCOâe",O>0&&(0,l.jsx)("span",{style:{marginLeft:6,fontWeight:700},children:t?"â² over":"â¼ under"})]}):(0,l.jsx)("span",{style:{fontSize:11,color:"#8A8680",cursor:"pointer",borderBottom:"1px dashed #555",paddingBottom:1},onClick:()=>{B(!0),I("")},children:A("sustainabilityTab.setTarget")})]}),null!=e&&O>0&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,l.jsx)("div",{style:{flex:1,height:8,background:"#3D3A36",borderRadius:99,overflow:"hidden"},children:(0,l.jsx)("div",{style:{width:"".concat(i,"%"),height:"100%",background:n,borderRadius:99,transition:"width 0.4s"}})}),(0,l.jsxs)("span",{style:{fontSize:11,color:"#8A8680",width:36,textAlign:"right"},children:[i.toFixed(0),"%"]})]})]})})(),h.length>0&&(0,l.jsx)("div",{style:{marginBottom:K.length>0?24:0},children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,l.jsx)("span",{style:{fontSize:11,color:"#8A8680",width:80,flexShrink:0},children:A("sustainabilityTab.dataCoverage")}),(0,l.jsx)("div",{style:{flex:1,height:8,background:"#3D3A36",borderRadius:99,overflow:"hidden"},children:(0,l.jsx)("div",{style:{width:"".concat(P,"%"),height:"100%",background:"#4A7A64",borderRadius:99,transition:"width 0.4s"}})}),(0,l.jsxs)("span",{style:{fontSize:11,color:"#8A8680",width:36,textAlign:"right"},children:[P.toFixed(0),"%"]})]})}),K.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"#8A8680",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:12},children:A("sustainabilityTab.byCategory")}),(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:K.map(e=>{let[t,i]=e,n=O>0?i/O*100:0;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,l.jsx)("span",{style:{fontSize:12,color:"#D4D1CC",width:180,flexShrink:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),(0,l.jsx)("div",{style:{flex:1,height:8,background:"#3D3A36",borderRadius:99,overflow:"hidden"},children:(0,l.jsx)("div",{style:{width:"".concat(n,"%"),height:"100%",background:"#4A7A64",borderRadius:99,transition:"width 0.4s"}})}),(0,l.jsxs)("span",{style:{fontSize:11,color:"#8A8680",width:100,textAlign:"right",flexShrink:0},children:[i.toFixed(0)," kgCOâe (",n.toFixed(0),"%)"]})]},t)})})]}),0===h.length&&(0,l.jsx)("div",{style:{color:"#8A8680",fontSize:13},children:A("sustainabilityTab.noProductsYet")}),h.length>0&&0===R.length&&(0,l.jsx)("div",{style:{color:"#8A8680",fontSize:13,marginTop:8},children:A("sustainabilityTab.promptAddCarbonData")})]})]}),N.length>0&&(0,l.jsxs)("section",{style:{marginBottom:40},children:[(0,l.jsx)("h2",{style:{fontSize:11,fontWeight:700,color:"#8A8680",textTransform:"uppercase",letterSpacing:"0.1em",margin:"0 0 16px"},children:"Top products by carbon"}),(0,l.jsxs)("div",{style:{background:"#fff",border:"0.5px solid #E8E5E1",borderRadius:8,padding:"20px 24px"},children:[(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:N.map(e=>{let t=e.totalGwp/G*100,i=f(e);return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,l.jsx)("span",{style:{fontSize:11,color:"#1A1814",width:200,flexShrink:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.name,children:e.name}),(0,l.jsx)("div",{style:{flex:1,height:10,background:"#EDEAE6",borderRadius:99,overflow:"hidden"},children:(0,l.jsx)("div",{style:{width:"".concat(t,"%"),height:"100%",background:1===i?"#182A41":2===i?"#4A7A64":"#B89A7A",borderRadius:99,transition:"width 0.4s"}})}),(0,l.jsxs)("span",{style:{fontSize:11,color:"#3D3A36",width:90,textAlign:"right",flexShrink:0,fontVariantNumeric:"tabular-nums"},children:[e.totalGwp.toFixed(1)," kgCOâe"]}),e.gwpDataSource&&(0,l.jsx)("span",{style:{width:52,flexShrink:0},children:(0,l.jsx)(x,{label:e.gwpDataSource})})]},e.id)})}),(0,l.jsx)("div",{style:{display:"flex",gap:16,marginTop:16,paddingTop:12,borderTop:"0.5px solid #E8E5E1"},children:[{color:"#182A41",label:"Tier 1 â Product EPD"},{color:"#4A7A64",label:"Tier 2 â EC3 average"},{color:"#B89A7A",label:"Tier 3 â Estimate"}].map(e=>{let{color:t,label:i}=e;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},children:[(0,l.jsx)("span",{style:{width:10,height:10,borderRadius:2,background:t,flexShrink:0}}
1),(0,l.jsx)("span",{style:{fontSize:10,color:"#8A8680"},children:i})]},i)})})]})]}),q.length>0&&O>0&&(0,l.jsxs)("section",{style:{marginBottom:40},children:[(0,l.jsx)("h2",{style:{fontSize:11,fontWeight:700,color:"#8A8680",textTransform:"uppercase",letterSpacing:"0.1em",margin:"0 0 16px"},children:"Carbon by room"}),(0,l.jsxs)("div",{style:{background:"#fff",border:"0.5px solid #E8E5E1",borderRadius:8,padding:"20px 24px",display:"flex",gap:32,alignItems:"center",flexWrap:"wrap"},children:[(0,l.jsx)(u,{slices:q,total:O,size:160}),(0,l.jsx)("div",{style:{flex:1,minWidth:200},children:(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:_.map((e,t)=>{let[i,n]=e,r=n/O*100;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,l.jsx)("span",{style:{width:10,height:10,borderRadius:2,background:p[t%p.length],flexShrink:0}}),(0,l.jsx)("span",{style:{fontSize:12,color:"#1A1814",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}),(0,l.jsxs)("span",{style:{fontSize:11,color:"#8A8680",flexShrink:0,fontVariantNumeric:"tabular-nums"},children:[n.toFixed(0)," kgCOâe"]}),(0,l.jsxs)("span",{style:{fontSize:11,color:"#3D3A36",width:34,textAlign:"right",flexShrink:0},children:[r.toFixed(0),"%"]})]},i)})})})]})]}),h.length>0&&(0,l.jsxs)("section",{style:{marginBottom:40},children:[(0,l.jsx)("h2",{style:{fontSize:11,fontWeight:700,color:"#8A8680",textTransform:"uppercase",letterSpacing:"0.1em",margin:"0 0 16px"},children:"EPD data quality"}),(0,l.jsx)("div",{style:{background:"#fff",border:"0.5px solid #E8E5E1",borderRadius:8,overflow:"hidden"},children:[{tier:1,label:"Tier 1 â Product-specific EPD",desc:"Verified environmental product declaration for this exact product",count:M.length,color:"#182A41",bg:"#F3F5F8",text:"#182A41"},{tier:2,label:"Tier 2 â Industry-average EPD",desc:"EC3 database average for this product category",count:L.length,color:"#4A7A64",bg:"#E8EBF0",text:"#182A41"},{tier:3,label:"Tier 3 â Manual estimate",desc:"User-entered estimate; lower confidence",count:U.length,color:"#B89A7A",bg:"#F5F0EB",text:"#6B5B4E"},{tier:0,label:"No data",desc:"No carbon data assigned â use EC3 Lookup to fill gaps",count:V.length,color:"#D4D1CC",bg:"#EDEAE6",text:"#6B6863"}].map((e,t)=>(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,padding:"14px 20px",borderBottom:t<3?"0.5px solid #E8E5E1":"none"},children:[(0,l.jsx)("div",{style:{width:28,height:28,borderRadius:"50%",background:e.bg,color:e.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:700,flexShrink:0},children:e.tier||"â"}),(0,l.jsxs)("div",{style:{flex:1},children:[(0,l.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"#1A1814",marginBottom:2},children:e.label}),(0,l.jsx)("div",{style:{fontSize:11,color:"#8A8680"},children:e.desc})]}),(0,l.jsxs)("div",{style:{textAlign:"right",flexShrink:0},children:[(0,l.jsx)("div",{style:{fontSize:20,fontWeight:700,color:e.count>0?"#1A1814":"#D4D1CC",lineHeight:1},children:e.count}),(0,l.jsx)("div",{style:{fontSize:10,color:"#8A8680"},children:h.length>0?"".concat((e.count/h.length*100).toFixed(0),"%"):"â"})]}),0===e.tier&&e.count>0&&(0,l.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"#5C4400",background:"#FFF7E0",border:"0.5px solid #C8880A",borderRadius:3,padding:"3px 8px",flexShrink:0},children:"Add EC3 data"})]},e.tier))}),h.length>0&&(0,l.jsxs)("div",{style:{marginTop:12,display:"flex",alignItems:"center",gap:12},children:[(0,l.jsx)("span",{style:{fontSize:11,color:"#8A8680",flexShrink:0},children:"Coverage"}),(0,l.jsxs)("div",{style:{flex:1,height:6,background:"#EDEAE6",borderRadius:99,overflow:"hidden",display:"flex"},children:[(0,l.jsx)("div",{style:{width:"".concat(M.length/h.length*100,"%"),height:"100%",background:"#182A41"}}),(0,l.jsx)("div",{style:{width:"".concat(L.length/h.length*100,"%"),height:"100%",background:"#4A7A64"}}),(0,l.jsx)("div",{style:{width:"".concat(U.length/h.length*100,"%"),height:"100%",background:"#B89A7A"}})]}),(0,l.jsxs)("span",{style:{fontSize:11,color:"#3D3A36",fontWeight:600,flexShrink:0},children:[((M.length+L.length+U.length)/h.length*100).toFixed(0),"% covered"]})]})]}),(0,l.jsxs)("section",{style:{marginBottom:40},children:[(0,l.jsx)("h2",{style:{fontSize:11,fontWeight:700,color:"#8A8680",textTransform:"uppercase",letterSpacing:"0.1em",margin:"0 0 16px"},children:A("sustainabilityTab.productCarbonData")}),0===h.length?(0,l.jsx)("div",{style:{color:"#8A8680",fontSize:13,padding:"24px 0"},children:A("sustainabilityTab.noProducts")}):Z.map(e=>{let t=J[e],i=!E[e],n=t.reduce((e,t)=>
1{var i,l;return e+(null!==(i=t.gwpKgCo2)&&void 0!==i?i:0)*(null!==(l=t.quantity)&&void 0!==l?l:1)},0);return(0,l.jsxs)("div",{style:{marginBottom:8,border:"0.5px solid #E8E5E1",borderRadius:6,overflow:"hidden"},children:[(0,l.jsxs)("button",{onClick:()=>C(t=>({...t,[e]:!t[e]})),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",background:"#F9F8F6",border:"none",cursor:"pointer",fontFamily:o.nb,textAlign:"left"},children:[(0,l.jsxs)("span",{style:{fontSize:12,fontWeight:700,color:"#1A1814",textTransform:"uppercase",letterSpacing:"0.05em"},children:[i?"â¼":"â¶"," ",e]}),(0,l.jsxs)("span",{style:{fontSize:11,color:"#8A8680"},children:[t.length," product",1!==t.length?"s":"",n>0&&(0,l.jsxs)("span",{style:{marginLeft:12,fontWeight:600,color:"#182A41"},children:[n.toFixed(1)," kgCOâe"]})]})]}),i&&(0,l.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse"},children:[(0,l.jsx)("thead",{children:(0,l.jsx)("tr",{style:{borderBottom:"0.5px solid #E8E5E1",background:"#FAF9F7"},children:[A("sustainabilityTab.col.product"),A("sustainabilityTab.col.category"),A("sustainabilityTab.col.gwpPerUnit"),A("sustainabilityTab.col.qty"),A("sustainabilityTab.col.totalGwp"),A("sustainabilityTab.col.recycled"),A("sustainabilityTab.col.source"),A("sustainabilityTab.col.certs"),""].map(e=>(0,l.jsx)("th",{style:{textAlign:"left",fontSize:10,fontWeight:700,color:"#8A8680",textTransform:"uppercase",letterSpacing:"0.06em",padding:"7px 10px"},children:e},e))})}),(0,l.jsx)("tbody",{children:t.map(e=>{var t,i,n;let r=null!=e.gwpKgCo2?e.gwpKgCo2*(null!==(i=e.quantity)&&void 0!==i?i:1):null,s=k[e.id],a=T[e.id];return(0,l.jsxs)("tr",{style:{borderBottom:"0.5px solid #F0EEEC"},children:[(0,l.jsx)("td",{style:{padding:"9px 10px",fontSize:12,color:"#1A1814",fontWeight:500,maxWidth:180},children:(0,l.jsx)("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name})}),(0,l.jsx)("td",{style:{padding:"9px 10px",fontSize:11,color:"#8A8680",maxWidth:140},children:(0,l.jsx)("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.category})}),(0,l.jsx)("td",{style:{padding:"9px 10px",fontSize:12,color:null!=e.gwpKgCo2?"#1A1814":"#D4D1CC",fontWeight:null!=e.gwpKgCo2?600:400},children:null!=e.gwpKgCo2?"".concat(e.gwpKgCo2):"â"}),(0,l.jsx)("td",{style:{padding:"9px 10px",fontSize:12,color:"#3D3A36"},children:null!==(n=e.quantity)&&void 0!==n?n:1}),(0,l.jsx)("td",{style:{padding:"9px 10px",fontSize:12,color:null!=r?"#182A41":"#D4D1CC",fontWeight:600},children:null!=r?r.toFixed(1):"â"}),(0,l.jsx)("td",{style:{padding:"9px 10px",fontSize:12,color:null!=e.recycledContentPct?"#182A41":"#D4D1CC",fontWeight:null!=e.recycledContentPct?600:400},children:null!=e.recycledContentPct?"".concat(e.recycledContentPct,"%"):"â"}),(0,l.jsx)("td",{style:{padding:"9px 10px"},children:e.gwpDataSource?e.epdUrl?(0,l.jsx)("button",{onClick:async()=>{var t;S({url:await y(e.epdUrl),filename:"".concat(null!==(t=e.name)&&void 0!==t?t:"EPD"," â EPD.pdf")})},style:{background:"none",border:"none",padding:0,cursor:"pointer"},title:A("productDetailPanel.openEpdDocument"),children:(0,l.jsx)(x,{label:e.gwpDataSource})}):(0,l.jsx)(x,{label:e.gwpDataSource}):(0,l.jsx)("span",{style:{color:"#D4D1CC",fontSize:11},children:"â"})}),(0,l.jsx)("td",{style:{padding:"9px 10px"},children:(null===(t=e.certifications)||void 0===t?void 0:t.length)?(0,l.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:3},children:e.certifications.map(e=>(0,l.jsx)("span",{style:{fontSize:9,background:"#EDEAE6",color:"#3D3A36",borderRadius:3,padding:"1px 5px"},children:e},e))}):(0,l.jsx)("span",{style:{color:"#D4D1CC",fontSize:11},children:"â"})}),(0,l.jsx)("td",{style:{padding:"9px 10px",whiteSpace:"nowrap"},children:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:3,alignItems:"flex-end"},children:[(0,l.jsx)("button",{onClick:()=>$(e),disabled:s,title:A("sustainabilityTab.lookupCarbonData"),style:{fontSize:10,fontWeight:600,padding:"3px 8px",borderRadius:3,cursor:s?"default":"pointer",border:"0.5px solid #D4D1CC",background:s?"#EDEAE6":"#FAF9F7",color:s?"#8A8680":"#3D3A36",fontFamily:o.nb,whiteSpace:"nowrap"},children:s?A("sustainabilityTab.fetching"):A("sustainabilityTab.buttonEc3")}),a&&(0,l.jsx)("span",{style:{fontSize:9,color:"#7A3535",maxWidth:120,textAlign:"right",lineHeight:1.3},children:a})]})})]},e.id)})})]})]},e)})]}),(0,l.jsxs)("section",{children:[(0,l.jsx)("h2",{style:{fontSize:11,fontWeight:700,color:"#8A8680",textTransform:"uppercase",letterSpacing:"0.1em",margin:"0 0 16px"},children:A("sustainabilityTab.certificationsInProject")}),(0,l.jsxs)("div",{style:{background:"#fff",border:"0.5px solid #E8E5E1",borderRadius:8,padding:"20px 24px"},children:[(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:c.map(e=>{var t;let i=null!==(t=H[e])&&void 0!==t?t:0;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,l.jsx)("span",{style:{fontSize:12,color:i>0?"#1A1814":"#D4D1CC",width:150,flexShrink:0},children:e}),(0,l.jsx)(g,{pct:i/Y*100,color:i>0?"#182A41":"#EDEAE6",thin:!0}),(0,l.jsx)("span",{style:{fontSize:11,color:i>0?"#182A41":"#D4D1CC",fontWeight:i>0?600:400,width:70},children:i>0?"".concat(i," product").concat(1!==i?"s":""):"0 products"})]},e)})}),h.length>0&&Object.values(H).every(e=>0===e)&&(0,l.jsx)("div",{style:{fontSize:12,color:"#8A8680",marginTop:16},children:A("sustainabilityTab.promptAddCertifications")})]})]})]}),w&&(0,l.jsx)(d.Z,{url:w.url,filename:w.filename,onClose:()=>S(null)})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.