1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2135],{52135:function(t,e,a){a.d(e,{downloadCoiPdf:function(){return y}});var o=a(52258),l=a(69495),i=a(97742);let r={width:960,height:540},n={total:{x:34.56,y:277.92,w:439.2,h:93.6,align:"left"},preventableExits:{x:54.72,y:101.66,w:79.2,h:51.84,align:"left"},fteMonths:{x:359.22,y:101.66,w:79.2,h:51.84,align:"left"},perEmployee:{x:702.37,y:101.66,w:79.2,h:51.84,align:"left"}},c={x:360.74,y:265.94,w:460.96,h:96.49},s={template:"/coi/coi-report-template.pdf",fontBold:"/coi/Poppins-Bold-subset.ttf",fontRegular:"/coi/Poppins-Regular-subset.ttf"},h=t=>(0,l.rgb)(parseInt(t.slice(1,3),16)/255,parseInt(t.slice(3,5),16)/255,parseInt(t.slice(5,7),16)/255),d={navy:h("#003B73"),white:h("#FFFFFF"),chartBg:h("#F8F8F6"),chartTrack:h("#F5F4ED"),chartLabel:h("#575754"),chartValue:h("#141413"),pillars:[h("#0F6E56"),h("#185FA5"),h("#534AB7"),h("#854F0B"),h("#A32D2D")]},p={total:{size:54,dx:2.5,baselineFromBoxY:21.58,color:d.white,maxWidth:280},stat:{size:30,dx:1.5,baselineFromBoxY:14.84,color:d.navy,maxWidth:64}},f={titleX:12.21,titleBaselineFromTop:16.86,titleSize:7.15,labelX:12.21,labelSize:6.6,trackX:111.03,trackW:266.81,barH:4.07,valueRight:430.15,valueSize:6.75,valueGap:12,rowCentersFromTop:[28.48,42.43,56.39,70.34,84.29],textBaselineBelowCenter:2.3,minBarW:3},x=["Talent cost","Experience cost","Decision latency","HR operational efficiency","Platform debt"];async function u(t){let e=await fetch(t);if(!e.ok)throw Error("Cost of Inaction PDF: could not load ".concat(t," (").concat(e.status,")"));return e.arrayBuffer()}function w(t,e,a){let o=Math.max(...t.map(t=>e.widthOfTextAtSize(t,a.size)),1);return o<=a.maxWidth?a.size:a.size*(a.maxWidth/o)}function b(t,e,a,o,l){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:l.size,r=o.widthOfTextAtSize(a,i),n=e.x+l.dx;"center"===e.align?n=e.x+(e.w-r)/2:"right"===e.align&&(n=e.x+e.w-r),t.drawText(a,{x:n,y:e.y+l.baselineFromBoxY,size:i,font:o,color:l.color})}function m(t,e,a,o,l,i){let r=l/2,n=Math.max(0,o-l);t.drawCircle({x:e+r,y:a+r,size:r,color:i}),n>0&&(t.drawRectangle({x:e+r,y:a,width:n,height:l,color:i}),t.drawCircle({x:e+r+n,y:a+r,size:r,color:i}))}async function g(t){let{result:e}=t,a={...s,...t.assets},[h,g,y]=t.bytes?[t.bytes.template,t.bytes.fontBold,t.bytes.fontRegular]:await Promise.all([u(a.template),u(a.fontBold),u(a.fontRegular)]),z=await l.PDFDocument.load(h);z.registerFontkit(o.Z);let F=await z.embedFont(g,{subset:!0}),B=await z.embedFont(y,{subset:!0}),v=z.getPages(),k=v[4];if(!k)throw Error("Cost of Inaction PDF: template has ".concat(v.length," page(s); expected the results slide at index ").concat(4,"."));let{width:S,height:T}=k.getSize();(Math.abs(S-r.width)>1||Math.abs(T-r.height)>1)&&console.warn("[CoI] Template page is ".concat(S,"x").concat(T,"pt but pdfCoords.ts expects ")+"".concat(r.width,"x").concat(r.height,"pt. ")+"Re-run scripts/coi-extract-pdf-coords.js against the current deck.");let E=(0,i.Q$)(e.total);b(k,n.total,E,F,p.total,w([E],F,p.total));let R=[String(Math.round(e.preventableExits)),String(Math.round(e.fteMonths)),(0,i.Q$)(e.perEmployee)],C=w(R,F,p.stat);return[n.preventableExits,n.fteMonths,n.perEmployee].forEach((t,e)=>b(k,t,R[e],F,p.stat,C)),!function(t,e,a,o){let{x:l,y:r,w:n,h:s}=c,h=t=>r+s-t;t.drawRectangle({x:l,y:r,width:n,height:s,color:d.chartBg}),t.drawText("BREAKDOWN BY PILLAR",{x:l+f.titleX,y:h(f.titleBaselineFromTop),size:f.titleSize,font:a,color:d.chartLabel});let p=[e.talent,e.experience,e.decisionLatency,e.hrOps,e.platformDebt],u=Math.max(...p,1),w=e.total||1;p.forEach((e,r)=>{let n=f.rowCentersFromTop[r],c=h(n+f.barH/2),s=h(n+f.textBaselineBelowCenter);t.drawText(x[r],{x:l+f.labelX,y:s,size:f.labelSize,font:o,color:d.chartLabel}),m(t,l+f.trackX,c,f.trackW,f.barH,d.chartTrack);let p=Math.max(f.minBarW,e/u*f.trackW);m(t,l+f.trackX,c,p,f.barH,d.pillars[r]);let b=(0,i.Q$)(e),g=e/w*100,y=" (".concat(g>0&&g<.5?"<1":Math.round(g),"%)"),z=a.widthOfTextAtSize(b,f.valueSize),F=o.widthOfTextAtSize(y,f.valueSize),B=Math.max(l+f.trackX+f.trackW+f.valueGap,l+f.valueRight-(z+F));t.drawText(b,{x:B,y:s,size:f.valueSize,font:a,color:d.chartValue}),t.drawText(y,{x:B+z,y:s,size:f.valueSize,font:o,color:d.chartLabel})})}(k,e,F,B),z.save()}async function y(t){let e=await g(t),a=new Blob([e.slice()],{type:"application/pdf"}),o=URL.createObjectURL(a),l=document.createElement("a");l.href=o,l.download=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;return["cost-of-inaction",(t||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,40),e.toISOString().slice(0,10)].filter(
1Boolean).join("-")+".pdf"}(t.company),document.body.appendChild(l),l.click(),l.remove(),setTimeout(()=>URL.revokeObjectURL(o),1e4)}}}]);
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.