@preventive/triage 1.0.0-alpha.68 → 1.0.0-alpha.69
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.
- package/out/activity.js +3 -3
- package/out/{chunk-D37M7J4B.js → chunk-DVIYJG3F.js} +1 -1
- package/out/{chunk-SCN2TBP2.js → chunk-NA3BSFFM.js} +2 -2
- package/out/{chunk-OAWY4T6R.js → chunk-Y3MWMG7M.js} +1 -1
- package/out/compare.js +3 -3
- package/out/dialogs.js +38 -38
- package/out/index.html +2 -2
- package/out/scan.js +1 -1
- package/out/view.js +15 -15
- package/package.json +1 -1
- package/server-managed/dependency-review-comments.ts +10 -8
- package/server-managed/http.ts +30 -19
- package/server-managed/pull-dependencies.ts +21 -15
- package/server-managed/pull-dependency-reviews.ts +46 -18
- package/server-managed/reviewed-dependencies.ts +44 -24
- package/server-managed/stasis-dependencies.ts +5 -4
- package/server.ts +1 -1
|
@@ -192,7 +192,7 @@ You can change this anytime from the lock icon in the sidebar header.`)?(await m
|
|
|
192
192
|
`}function lz(e,t){let n=t?`gu`:`giu`,r=t?`g`:`gi`;try{return{re:new RegExp(e,n)}}catch{try{return{re:new RegExp(e,r)}}catch(e){return{error:e.message}}}}function uz(e,t,n){if(t){let t=lz(e,n);if(t.error)return{error:t.error};let{re:r}=t;return{ranges(e){r.lastIndex=0;let t=[],n;for(;(n=r.exec(e))!==null;)if(n[0].length===0)r.lastIndex++;else if(t.push([n.index,n.index+n[0].length]),t.length>=50)break;return t}}}let r=n?e:e.toLowerCase(),i=r.length;return{ranges(e){let t=n?e:e.toLowerCase(),a=[],o=0,s;for(;(s=t.indexOf(r,o))!==-1&&(a.push([s,s+i]),o=s+i,!(a.length>=50)););return a}}}function dz(e,t,n){let r=[],i=0,a=!1;for(let o of n){let n=e.get(o);if(typeof n!=`string`)continue;let s=n.split(`
|
|
193
193
|
`),c=[];for(let e=0;e<s.length;e++){let n=t.ranges(s[e]);if(n.length!==0&&(c.push({ln:e+1,ranges:n}),i++,i>=5e3)){a=!0;break}}if(c.length>0&&r.push({path:o,lines:s,hits:c}),a)break;if(r.length>=500){a=!0;break}}return{fileResults:r,totalHits:i,truncated:a}}function fz(e,t){let n=[],r=0;for(let{path:i,lines:a,hits:o}of e.fileResults){let e=[];for(let{ln:n}of o){let i=t.ranges(a[n-1]);i.length!==0&&(e.push({ln:n,ranges:i}),r++)}e.length>0&&n.push({path:i,lines:a,hits:e})}return{fileResults:n,totalHits:r,truncated:!1}}var pz={tag:null,useRegex:!1,caseSensitive:!1,entries:[]};function mz(e,t,n,r,i,a=null){if(!n)return{fileResults:[],totalHits:0,truncated:!1};let o=uz(n,r,i);if(o.error)return{error:o.error};(pz.tag!==e||pz.useRegex!==r||pz.caseSensitive!==i)&&(pz.tag=e,pz.useRegex=r,pz.caseSensitive=i,pz.entries.length=0);let s=r||i?e=>e:e=>e.toLowerCase(),c=s(n),l=null,u=-1;for(let e=0;e<pz.entries.length;e++){let t=pz.entries[e],n=s(t.query);if(n===c)return pz.entries.splice(e,1),pz.entries.unshift(t),t.result;r||t.result.truncated||n.length<=u||!c.includes(n)||(l=t.result,u=n.length)}let d=l?fz(l,o):dz(t,o,a??[...t.keys()].toSorted());return pz.entries.unshift({query:n,result:d}),pz.entries.length>8&&pz.entries.pop(),d}var hz=200,gz=28,_z=12;function vz(e,t){let n=t.length>0?t[0][0]:0;return bz(e,t,n-(e.length-e.trimStart().length)>gz?n-_z:0,hz)}function yz(e,t){let n=vz(e,t);return M`${n.clipped?M`<span class="bundle-search-clip">…</span>`:P}${xz(n.text,n.ranges)}`}function bz(e,t,n,r){let i=e.slice(n,n+r);if(n===0)return{text:i,ranges:t,clipped:!1};let a=[];for(let[e,r]of t){let t=e-n,o=r-n;o<=0||t>=i.length||a.push([Math.max(0,t),Math.min(i.length,o)])}return{text:i,ranges:a,clipped:!0}}function xz(e,t){if(t.length===0)return e;let n=[],r=0;for(let[i,a]of t){let t=Math.max(r,Math.min(i,e.length)),o=Math.max(t,Math.min(a,e.length));o<=t||(t>r&&n.push(e.slice(r,t)),n.push(M`<mark class="bundle-search-mark">${e.slice(t,o)}</mark>`),r=o)}return r<e.length&&n.push(e.slice(r)),n}function Sz(e,t,n){let r=new Set;for(let[i,a]of e)Xr(i,n?.get(i))&&r.add(t(a));return r}function Cz(e,t,n){let r=new Set;for(let i of e?.bundle?.entries??[]){let e=t.get(i);e!==void 0&&r.add(n(e))}return r}function wz(e,t,n,r){let i=n.has(r)?r:null;if(i===null)return{tree:e,origToStripped:t,selected:i};let a=new Map([...t].filter(([e])=>n.get(i).has(e))),o=new Set(a.values());return{tree:Object.fromEntries([...o].map(t=>[t,{...e[t],imports:(e[t].imports??[]).filter(e=>o.has(e))}])),origToStripped:a,selected:i}}function Tz(e,t,n=t,r){let i=_e(e),a=new Set(e?.bundle?.entries??[]),o=[],s=new Set,c=[...a];for(let e of c){if(s.has(e))continue;if(s.add(e),t.has(e)){a.has(e)&&o.push({file:t.get(e)});continue}if(n.has(e))continue;let l=[];for(let r of i.get(e)??[])t.has(r)?l.push(t.get(r)):!n.has(r)&&i.has(r)&&(l.push(r),c.push(r));o.push({file:e,origFile:e,virtual:!0,...a.has(e)?{}:{entry:!1},pkg:Yr(e,{packageDir:r?.get(e)}),imports:l})}return o}function Ez(e,t,n,r,i=t){let a=_e(e),o=new Set;for(let[e,i]of t)Yr(e,{packageDir:r?.get(e)})===`__own__`&&o.add(n(i));for(let r of Cz(e,t,n))o.add(r);if(o.size===0){let e=Sz(t,n,r),i=new Set;for(let[r,o]of a){let a=t.get(r);if(a!==void 0&&e.has(n(a)))for(let e of o){let r=t.get(e);r!==void 0&&n(a)!==n(r)&&i.add(n(r))}}for(let t of e)i.has(t)||o.add(t)}let s=new Set;for(let[e,o]of a)if(!i.has(e)&&Yr(e,{packageDir:r?.get(e)})===`__own__`)for(let e of o){let r=t.get(e);r!==void 0&&s.add(n(r))}return s.size>0&&o.add(`__own__`),{roots:[...o],appImports:[...s]}}function Dz(e,t){let n=new Map(e.map(e=>[e,[...t.get(e)].map(([n,r])=>{let i=t.get(e),a=t.get(n),o=i.size<a.size?i:a,s=0,c=0;for(let e of o.keys())if(i.has(e)&&a.has(e)&&s++,++c===32)break;return{to:n,score:r*2+s}}).toSorted((e,n)=>n.score-e.score||t.get(e.to).size-t.get(n.to).size||e.to.localeCompare(n.to))])),r=[],i=new Set;for(let t of e){let e=[t];for(;e.length>0;){let t=e.pop();if(!i.has(t)){i.add(t),r.push(t);for(let{to:r}of n.get(t).toReversed())i.has(r)||e.push(r)}}}return r}function Oz(e,t,n){let r=e.toSorted(),i=new Set(r),a=new Map,o=new Map(r.map(e=>[e,new Map]));for(let e of r){a.set(e,new Map);for(let n of t.get(e)??[])e===n||!i.has(n)||(a.get(e).set(n,{to:n,count:1}),o.get(e).set(n,(o.get(e).get(n)??0)+1),o.get(n).set(e,(o.get(n).get(e)??0)+1))}let s=Tn(r,a),c=r.map((e,t)=>({col:t%n,row:Math.floor(t/n)})),l=c.map(({col:e,row:t})=>({col:t%2?n-e-1:e,row:t})),u=(e,t)=>Math.abs(e.col-t.col)+Math.abs(e.row-t.row),d=e=>r.reduce((t,n)=>t+[...o.get(n)].reduce((t,[r,i])=>t+i*u(e.get(n),e.get(r)),0),0),f=new Map(r.map((e,t)=>[e,c[t]])),p=d(f);for(let e of[s,Dz(r,o)])for(let t of[c,l]){let n=new Map(e.map((e,n)=>[e,t[n]])),r=d(n);r<p&&(f=n,p=r)}let m=({col:e,row:t})=>`${e},${t}`,h=new Map([...f].map(([e,t])=>[m(t),e])),g=(e,t,n,r)=>{let i=0;for(let[a,s]of o.get(e))i+=s*u(t,a===n?r:f.get(a));return i};for(let e=0;e<8;e++){let e=!1;for(let t of r){let n=f.get(t),r=o.get(t),i=0,a=0,s=0;for(let[e,t]of r)i+=f.get(e).col*t,a+=f.get(e).row*t,s+=t;if(!s)continue;let c=new Set;for(let e of[n,{col:Math.round(i/s),row:Math.round(a/s)}])for(let n=-1;n<=1;n++)for(let r=-1;r<=1;r++){let i=h.get(`${e.col+n},${e.row+r}`);i!==void 0&&i!==t&&c.add(i)}let l=0,u=null;for(let e of c){let r=f.get(e),i=g(t,r,e,n)+g(e,n,t,r)-g(t,n,e,r)-g(e,r,t,n);i<l&&(l=i,u=e)}if(u!==null){let r=f.get(u);f.set(t,r),f.set(u,n),h.set(m(r),t),h.set(m(n),u),e=!0}}if(!e)break}return r.map(e=>({id:e,...f.get(e)})).toSorted((e,t)=>e.row-t.row||e.col-t.col)}var kz=216,Az=48,jz=32,Mz=20,Nz=24,Pz=20,Fz=10;function Iz(e,t){let n=e=>e&&(e.collapsed||e.members.length===1),r=e.map((t,r)=>e.length>5&&n(t)&&n(e[r+1])),i=0,a=0;e.forEach((t,n)=>{r[n]?a+=t.width:i+=t.width+(n===e.length-1?0:Mz)});let o=Math.min(t,kz*5+Mz*4),s=a?Math.max(.3,Math.min(.9,(o-i)/a)):1,c=0;return{groups:e.map((t,n)=>{let i=t.width*(r[n]?s:1),a={...t,x:c,visibleWidth:i,stacked:!!(r[n]||r[n-1])};return c+=i+(r[n]||n===e.length-1?0:Mz),a}),width:c,height:Math.max(...e.map(e=>e.height))}}function Lz(e){let t=`M${e[0].join(`,`)}`;for(let n=1;n<e.length-1;n++){let[r,i]=e[n],[a,o]=e[n-1],[s,c]=e[n+1],l=Math.hypot(s-r,c-i),u=Math.hypot(r-a,i-o);if(!u||!l)continue;let d=Math.min(6,u/2,l/2);t+=` L${r-(r-a)/u*d},${i-(i-o)/u*d} Q${r},${i} ${r+(s-r)/l*d},${i+(c-i)/l*d}`}return`${t} L${e.at(-1).join(`,`)}`}var Rz=({count:e,index:t})=>(t-(e-1)/2)*Math.min(8,48/Math.max(1,e-1));function zz(e,t,n,r){let i=e.packages.find(e=>e.id===t),a=Rz(r),o=n?e.y-12:e.rowBottom;if(e.members.length===1||e.collapsed){let t=e.x+e.visibleWidth/2+a;return[[t,n?e.y-5:e.y+e.height],[t,o]]}let s=e.x+i.x+(n?0:kz),c=e.y+i.y+Az/2+a/2,l=s+(n?-7-r.lane*6:3+r.lane*6);return[[s+(n?-4:0),c],[l,c],[l,o]]}function Bz(e,t){let n=(t,n)=>{let r=e.get(t[n]),i=r.packages.find(e=>e.id===t[`${n}Package`]);return r.members.length===1||r.collapsed?[r.x+r.visibleWidth/2,r.y+r.height/2]:i?[r.x+i.x+kz/2,r.y+i.y+Az/2]:[r.x+r.width/2,r.y+r.height/2]},r=(r,i,a=e=>n(e,i))=>{let o=new Map,s=Map.groupBy(t,t=>{let n=e.get(t[r]);return n.collapsed?n:t[`${r}Package`]});for(let e of s.values())e.toSorted((e,t)=>{let[n,o]=a(e),[s,c]=a(t);return(e.bypassLane??n)-(t.bypassLane??s)||o-c||e[`${i}Package`].localeCompare(t[`${i}Package`])||e[`${r}Package`].localeCompare(t[`${r}Package`])}).forEach((t,n)=>o.set(t,{count:e.length,index:n}));for(let e of Map.groupBy(t,e=>e[r]).values())e.toSorted((e,t)=>{let[i,a]=n(e,r),[s,c]=n(t,r);return i-s||a-c||Rz(o.get(e))-Rz(o.get(t))}).forEach((t,n)=>{let i=n/Math.max(1,e.length-1);o.get(t).lane=r===`from`?1-i:i});return o},i=r(`from`,`to`),a=r(`to`,`from`,t=>{let n=zz(e.get(t.from),t.fromPackage,!1,i.get(t));return[n.at(-1)[0],n[0][1]]}),o=t.map(t=>{let n=e.get(t.from),r=e.get(t.to),o=zz(n,t.fromPackage,!1,i.get(t)),s=zz(r,t.toPackage,!0,a.get(t));return{edge:t,end:s,start:o,rowBottom:n.rowBottom,x1:o.at(-1)[0],x2:t.bypassLane??s.at(-1)[0]}});for(let e of Map.groupBy(o,e=>e.rowBottom).values())for(let t of[!0,!1]){let n=e.filter(e=>e.x2<e.x1===t).toSorted((e,n)=>(t?1:-1)*(e.x1-n.x1||e.x2-n.x2));n.forEach((e,t)=>{e.bendY=e.rowBottom+9+12*t/Math.max(1,n.length-1)})}return o.map(({edge:e,end:t,start:n,x1:r,x2:i,bendY:a})=>{let o=[[r,a],[i,a]],{bypassLane:s,...c}=e;return s!==null&&o.push([i,t.at(-1)[1]]),{...c,path:Lz([...n,...o,...t.toReversed()])}})}function Vz(e,t){let n=Math.sign(t.x-e.x),r=Math.sign(t.y-e.y),i=Az,a=kz;if(r===0&&Math.abs(t.x-e.x)===a+Mz){let r=e.y+i/2-n*6;return`M${e.x+(n>0?a:0)},${r} L${t.x+(n>0?-4:a+4)},${r}`}if(n===0&&Math.abs(t.y-e.y)===i+Nz){let n=e.x+a/2+r*8;return`M${n},${e.y+(r>0?i:0)} L${n},${t.y+(r>0?-4:i+4)}`}let o=n||r,s=e.x+(o>0?a:0),c=e.y+i/2,l=s+o*(Mz/2-3),u=t.x+a/2+o*8,d=r>0||r===0&&n>0,f=t.y+(d?-10:i+10),p=t.y+(d?-4:i+4);return Lz([[s,c],[l,c],[l,f],[u,f],[u,p]])}function Hz(e,t,n,r=1184,i=!1){if(i)return{id:e,members:t,collapsed:i,packages:[],internalEdges:[],width:kz+Fz*2,height:Az};let a=t.length>1,o=Math.max(1,Math.floor((r-Fz*2+Mz)/(kz+Mz))),s=a?Math.min(o,Math.max(2,Math.ceil(Math.sqrt(t.length/2)))):1,c=a?Fz:0,l=Math.ceil(t.length/s),u=a?Pz:0,d=(a?Oz(t,n,s):[{id:t[0],col:0,row:0}]).map(e=>({id:e.id,x:c+e.col*(kz+Mz),y:c+u+e.row*(Az+Nz)})),f=new Map(d.map(e=>[e.id,e])),p=[];if(a)for(let e of t)for(let t of n.get(e)??[])e!==t&&f.has(t)&&p.push({from:e,to:t,path:Vz(f.get(e),f.get(t))});return{id:e,members:t,collapsed:i,packages:d,internalEdges:p,width:s*kz+(s-1)*Mz+c*2,height:l*Az+(l-1)*Nz+c*2+u}}function Uz(e,t={}){let n=t.ecosystem??(/(?:^|\/)node_modules\//u.test(e)?`npm`:``);return{id:e,name:t.name||(e===`.`?`App`:e),ecosystem:n,version:t.version??``,own:e===`.`,root:!1,target:!1}}var Wz=e=>e.ecosystem===`npm`?e.name:`${e.ecosystem}:${e.name}`;function Gz(e,t){let n=e?.bundle?.modules.get(t);if(!t||t===`.`||!n)return null;let r=Uz(t,n);return{packageKey:r.ecosystem?Wz(r):r.name,packageGroup:Yr(``,{packageDir:t})}}function Kz(e,{packageKey:t,packageGroup:n,version:r,scope:i=``}){let a=new Map,o=new Map,s=new Map,c=It(e)??new Map,l=new Map([...c.keys()].map(e=>[e,e])),u=ve(e).files(i),d=new Map([...l].filter(([e])=>!u||u.has(e)));for(let t of new Set([...d.keys()].map(e=>c.get(e))))s.set(t,Uz(t,e.bundle.modules.get(t)));let f=(e,t)=>{e!==t&&(o.has(e)||o.set(e,new Set),a.has(t)||a.set(t,new Set),o.get(e).add(t),a.get(t).add(e))};for(let[t,n]of _e(e))if(d.has(t))for(let e of n){if(!d.has(e))continue;let n=c.get(t),r=c.get(e);if(kn(t,e,r===`.`,n===`.`))f(n,r);else if(n!==r){let e=s.get(r);e.excludedImporters??=new Set,e.excludedImporters.add(n)}}let{roots:p,appImports:m}=Ez(e,d,e=>c.get(e),c,l);m.length>0&&!s.has(`.`)&&s.set(`.`,Uz(`.`));for(let e of m)f(`.`,e);for(let[e,t]of s){if(!(t.own||t.ecosystem===`npm`&&(t.name===`@babel/core`||t.name===`react-native`&&o.get(`.`)?.has(e))))continue;t.traceBoundary=!0;let n=a.get(e);for(let t of n??[])t!==`.`&&(n.delete(t),o.get(t).delete(e))}for(let e of p){let t=s.get(e===`__own__`?`.`:e);t&&(t.root=!0)}let h=[];for(let e of s.values()){let i=Wz(e),a=n===void 0?e.ecosystem===`github`?i.toLowerCase()===t.toLowerCase():i===t:Yr(``,{packageDir:e.id})===n,o=e.ecosystem===`github`&&e.version===`.`?`0.0.0`:e.version;!e.own&&a&&(r===void 0||o===r)&&(e.target=!0,h.push(e.id))}let g=new Set(h),_=[...h];for(let e=0;e<_.length;e++)for(let t of a.get(_[e])??[])g.has(t)||(g.add(t),_.push(t));let v=e=>new Map([...g].map(t=>[t,new Set([...e.get(t)??[]].filter(e=>g.has(e)))]));return{nodes:new Map([...s].filter(([e])=>g.has(e))),imports:v(o),importedBy:v(a),targets:h}}function qz(e,{maxWidth:t=1280,expandedCycles:n=new Set}={}){let r=[...e.nodes.keys()].toSorted(),{groups:i,componentOf:a}=Mn(r,e.imports),o=i.map(()=>new Set),s=[];for(let[t,n]of e.imports){let e=a.get(t);for(let r of n){let n=a.get(r);e!==n&&(o[e].add(n),s.push({from:e,to:n,fromPackage:t,toPackage:r}))}}let c=i.map(()=>0),l=i.map(()=>0);for(let e of o)for(let t of e)l[t]++;let u=i.flatMap((e,t)=>l[t]===0?[t]:[]);for(let e=0;e<u.length;e++){let t=u[e];for(let e of o[t])c[e]=Math.max(c[e],c[t]+1),--l[e]===0&&u.push(e)}let d=o.some((e,t)=>[...e].some(e=>c[e]!==c[t]+1)),f=t-jz-24-(d?56:0),p=[...Map.groupBy(i.map((t,r)=>{let i=t.length>10;return{...Hz(r,t,e.imports,f,i&&!n.has(r)),collapsible:i}}),e=>c[e.id])].toSorted(([e],[t])=>e-t).map(([,e])=>Iz(e,f)),m=p.reduce((e,t)=>Math.max(e,t.width+24),240),h=new Map,g=12;for(let{groups:e,width:t,height:n}of p){for(let r of e)h.set(r.id,{...r,x:r.x+(m-t)/2,y:g,rowBottom:g+n});g+=n+36}let _=0,v=Bz(h,s.map(e=>{let t=c[e.to]===c[e.from]+1?null:m+8+_++%4*10;return{...e,bypassLane:t}}));return{boxes:[...h.values()],componentOf:a,edges:v,width:m+(_?56:0),height:Math.max(0,g-24)}}function Jz(e,t){if(t===null)return null;let n=new Set,r=new Set([t]);for(let i of[!1,!0]){let a=new Map,o=[t],s=new Set([t]);for(let t of e.edges){let e=i?t.to:t.from,n=i?t.from:t.to;a.has(e)||a.set(e,[]),a.get(e).push(n)}for(let e=0;e<o.length;e++)for(let t of a.get(o[e])??[])s.has(t)||(s.add(t),r.add(t),o.push(t));for(let t of e.edges)s.has(t.from)&&s.has(t.to)&&n.add(t)}return{groups:r,edges:n}}var Yz=100,Xz=new WeakMap;function Zz(e){let t=e?.kind===`stasis`?e.bundle?.imports:e?.kind===`sourcemap`&&(e.edges||e.map)?Et(e):null;if(!t||(t.size??t.length)===0)return null;if(Xz.has(t))return Xz.get(t);let n=new Map,r=(e,t,r)=>{if(typeof r!=`string`||r===e)return;n.has(r)||n.set(r,new Map);let i=n.get(r);i.has(e)||i.set(e,new Set),t!==void 0&&i.get(e).add(t)};if(e.kind===`stasis`)for(let e of t.values())for(let[t,n]of e)for(let[e,i]of n)for(let n of typeof i==`string`?[i]:i instanceof Map?i.values():[])r(t,e,n);else for(let[e,n,i]of t)r(e,i,n);return Xz.set(t,n),n}var Qz=new WeakMap;function $z(e,t,n){let r=e.get(t);if(typeof r!=`string`)return null;Qz.has(e)||Qz.set(e,new Map);let i=Qz.get(e),a=JSON.stringify([t,...n]);if(!i.has(a)){let e=-1;for(let t of n)for(let n of[`'`,`"`,"`"]){let i=r.indexOf(`${n}${t}${n}`);i!==-1&&(e===-1||i<e)&&(e=i)}let t=null;if(e!==-1){t=1;for(let n=r.indexOf(`
|
|
194
194
|
`);n!==-1&&n<e;n=r.indexOf(`
|
|
195
|
-
`,n+1))t++}i.set(a,t)}return i.get(a)}function eB(e,t){let n=Zz(e);if(!n)return null;let r=Ot(e);return[...n.get(t)??[]].toSorted(([e],[t])=>e.localeCompare(t)).map(([e,t])=>{let n=r.has(e);return{path:e,specifiers:[...t].toSorted(),held:n,line:n?$z(r,e,t):null}})}var tB=M`<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 4.5V2h5.5L14 4.5V14H6v-2.5"/><path d="M1.5 8h8M7 5.5 9.5 8 7 10.5"/></svg>`,nB=e=>`${e.toLocaleString()} ${e===1?`file`:`files`}`;function rB(e){if(e.newState!==`open`)return;let t=e.currentTarget,n=t.getRootNode().querySelector?.(`[popovertarget="${t.id}"]`);if(!n)return;let r=n.getBoundingClientRect(),i=t.offsetHeight||200,a=t.offsetWidth||320,o=Math.max(4,Math.min(r.left,window.innerWidth-a-4)),s=r.bottom+4;t.style.left=`${o}px`,t.style.top=`${s+i>window.innerHeight-4&&r.top>i+4?r.top-i-4:s}px`}function iB(e,t){let n=eB(e,t);if(!n)return P;let r=e.kind===`stasis`&&e.bundle.entries?.has(t),i=n.length===0?`Imported by no file${r?` · an entry point`:``}`:`Imported by ${nB(n.length)}`;return M`<button type="button" class="bundle-code-importers-toggle" popovertarget="bundle-code-importers" popovertargetaction="toggle" aria-label="${i}" data-tooltip="${i}">${tB}<span class="bundle-code-importers-count">${n.length.toLocaleString()}</span></button><div popover="auto" id="bundle-code-importers" class="bundle-code-importers" role="menu" aria-label="Imported by" @beforetoggle="${rB}" @click="${e=>{e.target.closest(`[data-bundle-view-source]`)&&e.currentTarget.hidePopover()}}"><div class="bundle-code-importers-head">${n.length===0?i:`Imported by ${nB(n.length)}`}</div>${n.slice(0,Yz).map(t=>{let n=M`${Le(t.path,Fe(e,t.path))}<span class="bundle-code-importers-path mono">${t.path}</span>${t.specifiers.length>0?M`<span class="bundle-code-importers-specifier mono">${t.specifiers.join(`, `)}</span>`:P}`;return t.held?M`<button type="button" class="bundle-code-importers-item" role="menuitem" data-tooltip-truncated data-tooltip="${t.path}" data-bundle-view-source="${t.path}" data-bundle-view-line="${t.line??P}">${n}</button>`:M`<span class="bundle-code-importers-item is-absent" role="menuitem" aria-disabled="true" data-tooltip="${`${t.path} \xB7 not in this bundle`}">${n}</span>`})} ${n.length>Yz?M`<div class="bundle-code-importers-more">and ${nB(n.length-Yz)} more</div>`:P}</div>`}var aB=new Map,oB=new Map,sB=[];function cB(e){if(!e?.managedId)return aB;let t=L.managedSession,n=L.managedTeams&&Vs(L.managedTeams),r=[t?.id,t?.role,t?.csrfToken,L.currentManagedTeam,n];return r.some((e,t)=>e!==sB[t])&&(sB=r,oB=new Map),oB}var lB=new WeakMap;function uB(e){return lB.has(e)||lB.set(e,{reasons:ve(e),selected:``}),lB.get(e)}function dB(e,t=uB(e).selected){return JSON.stringify([e.managedId??e.integrity,t])}var fB=`deepview.advisories.proxyConsent`;function pB(){try{return localStorage.getItem(fB)===`1`}catch{return!1}}function mB(){try{localStorage.setItem(fB,`1`)}catch{}}function hB(e){if(!e||e.kind!==`stasis`||!e.bundle)return!1;for(let[t,n]of e.bundle.modules)if(t.includes(`node_modules`)&&n?.name&&typeof n.version==`string`&&n.version)return!0;return!1}function gB(e){if(!e||e.kind!==`stasis`||!e.bundle)return!1;for(let[t,n]of e.bundle.modules)if(t!==`.`&&typeof n?.name==`string`&&n.name&&typeof n.version==`string`&&n.version&&(n.ecosystem||/(?:^|\/)node_modules\//u.test(t)))return!0;return!1}function _B(e){if(e.bundle&&!gB(e))return!0;let t=cB(e).get(dB(e,``));return t?.state===`ok`&&t.query.size===0&&t.skipped.length===0}function vB(e,t,n=!1){return!e||e.managedId&&!bB(e)||yB(e,t)<1||e.summary?.versionedPackages===0?!1:n?!0:CR(e.name)===`stasis`?!t||t.integrity!==e.integrity?!0:e.managedId?!t.bundle||gB(t):hB(t):!1}function yB(e,t){let n=t?.integrity===e.integrity&&t.bundle?t.bundle.version:e.summary?.stasisVersion;return Number.isSafeInteger(n)?n:1/0}function bB(e){let t=L.managedSession?.role;return[`admin`,`manage`].includes(t)?!0:[`view`,`triage`].includes(t)?L.managedTeams.some(t=>(L.currentManagedTeam==null||t.id===L.currentManagedTeam)&&t.permissions?.security===!0&&t.bundles?.some(t=>t.id===e.managedId)):!1}function xB(e){return Object.fromEntries([...e].map(([e,t])=>[e,[...t].toSorted()]))}var SB=e=>e.ecosystem===`npm`?e.name:`${e.ecosystem}:${e.name}`;function CB(e){return{...e,title:e.title||e.id,severity:e.severity??`unknown`,cvss:{score:e.cvss,vectorString:e.cvssVector},vulnerable_versions:e.range}}function wB(e){let t=Array.isArray(e),n=t?Map.groupBy(e.map(CB),SB):new Map(Object.entries(e??{}));for(let[e,r]of n){let i=Array.isArray(r)?r.filter(e=>e&&typeof e.title==`string`&&typeof e.severity==`string`):[];i.length>0?n.set(e,t?i:i.map(e=>({...e,source:`registry`}))):n.delete(e)}return n}function TB(e,t){return!!(e?.managedId&&t?.state===`ok`&&!t.recheckingRepositories&&t.query.size>0)}async function EB(e){let t=await fetch(`/api/npm-advisories`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(xB(e))});if(!t.ok){let e=`HTTP ${t.status}`;try{let n=await t.json();typeof n?.error==`string`&&n.error&&(e=`${n.error} (HTTP ${t.status})`)}catch{}throw Error(e)}return t.json()}function DB(e,t){return kB(e,t)}function OB(e,t){return kB(e,t,!0)}async function kB(e,t,n=!1){if(!e?.integrity||!e.managedId&&!pB())return;let r=cB(e),i=dB(e),a=r.get(i);if(n){if(!TB(e,a))return;r.set(i,{...a,recheckingRepositories:!0,repositoryError:null}),t()}else if(a)return;let{reasons:o,selected:s}=uB(e),c=e.managedId?new Map:Rt(e,o.files(s));n||r.set(i,{state:`loading`,query:c});try{let t,a=[];if(e.managedId){let r=await Wx(e.managedId,void 0,s,n,n);c=Array.isArray(r.packages)?new Map(r.packages.map(e=>[SB(e),new Set(e.versions)])):new Map(Object.entries(r.packages).map(([e,t])=>[e,new Set(t)])),t=r.advisories,a=Array.isArray(r.skipped)?r.skipped:[]}else t=c.size>0?await EB(c):{};r.set(i,{state:`ok`,byPackage:wB(t),query:c,skipped:a})}catch(e){let t=e?.message??`fetch-failed`;r.set(i,n&&![401,403,404].includes(e?.status)?{...a,recheckingRepositories:!1,repositoryError:t}:{state:`error`,reason:t,query:c})}t()}async function AB(e,t){if(!e?.integrity)return;let n=cB(e),r=dB(e);n.get(r)?.state===`error`&&(n.delete(r),await DB(e,t))}var jB={critical:0,high:1,moderate:2,low:3,info:4};function MB(e){return jB[e]??999}function NB(){let e=typeof window>`u`?``:window.location.host;return M`<div class="bundle-advisories-consent"><div class="bundle-advisories-consent-card"><p class="bundle-advisories-consent-text">This bundle's dependency names and versions will be sent to the npm registry through a same-origin proxy (<span class="mono">${e}</span> → <span class="mono">registry.npmjs.org</span>) to look up published security advisories.</p><button type="button" class="bundle-advisories-consent-btn" data-advisories-consent>Confirm</button><p class="bundle-advisories-consent-note">This preference will be saved and reused for other bundles.</p></div></div>`}function PB(e,t=()=>{},n=null){let r=e?uB(e):null,i=r?be(r.reasons):[],a=IB(e),o=!!e?.managedId&&!_B(e);return M`<div class="bundle-advisories-panel">${a!==P||i.length>0||o?M`<div class="bundle-advisories-toolbar">${a} ${i.length>0||o?M`<div class="bundle-advisories-scopes">${o?FB(e,t):P} ${i.length>0?M`<bundle-scope-selector .reasons="${i}" .value="${r.selected}" label="Choose advisory scope" @scope-change="${n=>{r.selected=r.reasons.has(n.detail.value)?n.detail.value:``;let i=DB(e,t);return t(),i}}"></bundle-scope-selector>`:P} ${o&&n?M`<button type="button" class="bundle-advisories-retry bundle-advisories-scan" @click="${n}">${j(fa)}<span>Validate</span></button>`:P}</div>`:P}</div>`:P} ${RB(e)}</div>`}function FB(e,t){if(!e?.managedId)return P;let n=cB(e).get(dB(e)),r=!!n?.recheckingRepositories;return M`<button type="button" class="bundle-advisories-retry bundle-advisories-recheck" ?disabled="${!TB(e,n)}" aria-busy="${String(r)}" @click="${()=>OB(e,t)}">${r?`Rechecking…`:`Recheck against repositories`}</button>`}function IB(e){if(!e||!e.managedId&&!pB())return P;let t=cB(e).get(dB(e));if(t?.state!==`ok`)return P;let n=t.query.size,r=t.byPackage.size;if(r===0)return P;let i=[...t.byPackage.values()].reduce((e,t)=>e+t.length,0);return M`<div class="bundle-advisories-summary">${i} ${i===1?`advisory`:`advisories`} across ${r} of ${n} ${n===1?`package`:`packages`}</div>`}function LB(e,t){let n=t.query.size;return n===0&&t.skipped.length>0?M`No packages could be audited.`:M`No advisories for the ${n} ${t.skipped.length>0?`audited `:``}${n===1?`package`:`packages`} in ${uB(e).selected?`this scope`:`this bundle`}.`}function RB(e){if(!e)return M`<div class="bundle-advisories-empty">Bundle not loaded yet.</div>`;if(e.kind!==`stasis`||!e.managedId&&!e.bundle)return M`<div class="bundle-advisories-empty">Advisories are only available for stasis bundles.</div>`;if(!e.managedId&&!pB())return NB();let t=cB(e).get(dB(e));if(!t||t.state===`loading`)return M`<div class="bundle-advisories-empty">Loading advisories…</div>`;if(t.state===`error`)return M`<div class="bundle-advisories-empty is-error"><span>Failed to fetch advisories: ${t.reason}</span> <button type="button" class="bundle-advisories-retry" data-advisories-retry>Retry</button></div>`;let n=t.byPackage.size===0?M`<div class="bundle-advisories-empty"><span>${LB(e,t)}</span></div>`:P;if(t.byPackage.size===0&&t.skipped.length===0&&!t.repositoryError)return n;let r=[...t.byPackage.entries()].toSorted(([e,t],[n,r])=>{let i=Math.min(...t.map(e=>MB(e.severity))),a=Math.min(...r.map(e=>MB(e.severity)));return i===a?e.localeCompare(n):i-a});return M`${n}<div class="bundle-advisories">${t.repositoryError?M`<div class="bundle-advisories-empty is-error" role="alert">Repository recheck failed: ${t.repositoryError}. Previous results are shown.</div>`:P} ${t.skipped.length>0?M`<section class="bundle-advisories-skipped" aria-label="Dependencies not audited"><h3>Not audited</h3><ul>${t.skipped.map(e=>M`<li><span class="mono">${SB(e)}@${e.version}</span>: ${e.because}</li>`)}</ul></section>`:P}<ul class="bundle-advisories-list">${r.map(([n,r])=>zB(e,n,r,t.query.get(n),()=>cB(e).get(dB(e))?.byPackage===t.byPackage))}</ul></div>`}function zB(e,t,n,r,i){let a=[...n].toSorted((e,t)=>{let n=MB(e.severity)-MB(t.severity);return n===0?(e.title??``).localeCompare(t.title??``):n}),o=r?[...r].toSorted():[];return M`<li class="bundle-advisories-section"><div class="bundle-advisories-package"><span class="bundle-advisories-section-name">${t}</span> ${o.length>0?M`<span class="bundle-advisories-section-versions">${o.map(n=>M`<button type="button" class="bundle-advisories-version" aria-haspopup="dialog" aria-label="${`Why is ${t}@${n} here?`}" @click="${()=>Oe({details:e,packageKey:t,version:n,scope:uB(e).selected,isCurrent:i})}">${n}</button>`)}</span>`:P}</div><ul class="bundle-advisories-rows">${a.map(e=>oP(e,({title:e,severity:t,details:n})=>nt({heading:e,severity:t,markdown:n,isCurrent:i})))}</ul></li>`}var BB=3e5,VB=3e4,HB=3e4,UB=2,WB=5,GB=20,KB=new Map,qB=[],JB=[],YB=new Map,XB=new Set,ZB=null,QB=0;function $B(e){return XB.add(e),()=>XB.delete(e)}var eV=e=>{for(let t of XB)t(e)};function tV(){KB.clear(),qB.length=0,JB.length=0,YB.clear()}globalThis.addEventListener?.(`dependency-review-changed`,()=>{tV(),eV()});function nV(){let e=L.managedSession?`${L.managedSession.id}\0${L.managedSession.role}`:null;return e!==ZB&&(tV(),ZB=e),KB}var rV=e=>e?.touchesLockfile===!0||e?.touchesLockfile===null,iV=e=>Number.isSafeInteger(e)&&e>=0?e:null,aV={git:`From git, which isn’t reviewed`,tarball:`A tarball not npm’s registry’s of its version, which isn’t reviewed`,integrity:`Locked with no integrity, which its reviews are held to`,unlocked:`Locked by none of the lockfiles read for it at its commit, so nothing holds its reviews to an integrity`},oV=new Set(Object.keys(aV)),sV=e=>e.error===`stasis-pending`,cV=e=>`${e.name}@${e.version??``}\0${e.patch?.hash??``}`;function lV(e){if(typeof e?.name!=`string`)return[];let{was:t,reviews:n,rejected:r,commented:i,reviewers:a,baseline:o,reviewed:s,unsupported:c,patch:l,unreached:u,...d}=e,f=dV(a);return[{...d,...Array.isArray(t)&&t.length>0&&t.every(e=>typeof e==`string`)?{was:t}:{},...typeof l?.hash==`string`?{patch:{hash:l.hash,...li(l.path)?{path:l.path}:{}}}:{},...u===!0?{unreached:u}:{},...oV.has(c)?{unsupported:c}:o===!0?{baseline:o}:s===!0?{reviewed:s}:iV(n)===null?{}:{reviews:n,...r===!0?{rejected:r}:{},...iV(i)>0?{commented:i}:{},...f.length>0?{reviewers:f}:{}}}]}var uV=new Set([`accept`,`accept-with-nits`,`request-changes`,`reject`]),dV=e=>Array.isArray(e)?e.flatMap(e=>typeof e?.login==`string`&&uV.has(e.status)?[{login:e.login,status:e.status,...e.passes===!0?{passes:!0}:{},...e.comment===!0?{comment:!0}:{}}]:[]):[],fV=e=>Array.isArray(e)?e.flatMap(lV):[];function pV(e){if(!Array.isArray(e?.lockfiles))throw TypeError(`The server answered with no lockfiles.`);let t=e.lockfiles.filter(e=>Array.isArray(e?.paths)&&(Array.isArray(e.added)||typeof e.error==`string`)).map(e=>e.error?e:{...e,added:e.added.flatMap(lV),more:iV(e.more)??0,unreviewed:fV(e.unreviewed),moreUnreviewed:iV(e.moreUnreviewed)??0,unsupported:fV(e.unsupported),moreUnsupported:iV(e.moreUnsupported)??0,moreLocked:iV(e.moreLocked)??0}),n=e.review;return{lockfiles:t,cut:e.cut===!0,pending:t.some(sV),...typeof e.head==`string`&&/^[\da-f]{40}$/u.test(e.head)?{head:e.head}:{},...typeof e.formatted==`string`&&e.formatted.trim()!==``?{formatted:e.formatted}:{},...iV(n?.required)>0?{review:{required:n.required,since:typeof n.since==`string`?n.since:null,canReview:n.canReview===!0,...iV(n.toReview)===null?{}:{toReview:n.toReview},...iV(n.unreviewed)===null?{}:{unreviewed:n.unreviewed},...iV(n.unsupported)===null?{}:{unsupported:n.unsupported},...Array.isArray(n.baselineUnread)&&n.baselineUnread.every(e=>typeof e==`string`)?{baselineUnread:n.baselineUnread}:{},...n.reviewedDependencies===!0?{reviewedDependencies:!0}:{},...iV(n.unasked)>0?{unasked:n.unasked}:{},...iV(n.commentReviews)>0?{commentReviews:n.commentReviews}:{},...n.commentsFailed===!0?{commentsFailed:!0}:{},...n.byComments===!0?{byComments:!0}:{},...typeof n.baselineError==`string`?{baselineError:n.baselineError}:{},...[`exclude`,`include`].includes(n.lockfiles?.mode)&&Array.isArray(n.lockfiles.paths)&&n.lockfiles.paths.every(e=>typeof e==`string`)?{lockfiles:{mode:n.lockfiles.mode,paths:n.lockfiles.paths}}:{}}}:{}}}function mV(){for(;QB<UB&&qB.length+JB.length>0;){let e=qB.shift()??JB.shift(),[t,n]=e.background?[JB,GB]:[qB,WB],r=[e];for(let i=0;i<t.length&&r.length<n;){let n=t[i];n.pull.repoId===e.pull.repoId&&n.review===e.review&&n.listed===e.listed?r.push(...t.splice(i,1)):i++}for(let e of r)YB.delete(e.key);QB++,gV(r).finally(()=>hV(r))}}function hV(e){QB--;for(let t of e)eV(t.pull);mV()}function gV(e){let[{pull:{repoId:t,number:n},review:r,listed:i}]=e;return e.length===1?Jb(t,n,{review:r,listed:i}).then(e[0].settle,e[0].settle):Yb(t,e.map(e=>e.pull.number),{review:r,listed:i}).then(t=>{for(let n of e)n.settle(t.get(n.pull.number)??Error(`The server answered with none of it.`));return null},t=>{for(let n of e)n.settle(t)})}function _V(e,t,n=!1,{background:r=!1,listed:i=!1}={}){let a=nV(),o=`${e}\0${t}\0${n}${i?`\0listed`:``}`,s=a.get(o);if(s&&Date.now()<s.until){let e=YB.get(o);return!r&&e?.background&&(JB.splice(JB.indexOf(e),1),e.background=!1,qB.push(e)),s}let c=s?.status===`ready`?{...s,until:1/0,refreshing:!0}:{status:`loading`,until:1/0};a.set(o,c);let l={key:o,background:r,review:n,listed:i,pull:{repoId:e,number:t},settle:n=>{if(a.get(o)!==c)return;let r=yV(n,s);r?a.set(o,r):a.delete(o),r?.pending&&vV({repoId:e,number:t})}};return YB.set(o,l),(r?JB:qB).push(l),mV(),c}var vV=e=>{setTimeout(()=>eV(e),HB).unref?.()};function yV(e,t){let n=e instanceof Error?e:null;if(!n)try{let t=pV(e);return{status:`ready`,until:Date.now()+(t.pending?HB:BB),...t}}catch(e){n=e}return n?.name===`AbortError`?t?.status===`ready`?t:null:{status:`error`,until:Date.now()+VB,error:n?.message||`Its lockfiles could not be read.`}}function bV(e,t,n=!1){let r=nV();for(let[i,a]of t){let t=`${e}\0${i}\0${n}`,o=YB.get(t);if(o){let e=o.background?JB:qB;e.splice(e.indexOf(o),1),YB.delete(t)}let s=yV(a,null);s&&r.set(t,s),s?.pending&&vV({repoId:e,number:i}),eV({repoId:e,number:i})}}function xV(e,t,n=!1){return nV().get(`${e}\0${t}\0${n}`)??null}var SV=new WeakMap;function CV(e,{lockfiles:t,review:n},r){let i=SV.get(t)??SV.set(t,new Map).get(t),a=i.get(e);if(a&&a.review===n)return a.value;let o=r();return i.set(e,{review:n,value:o}),o}function wV(e){return CV(`added`,e,()=>TV(e))}function TV({lockfiles:e,review:t}){let n=new Map;for(let r of e.flatMap(e=>e.added??[])){let e=cV(r),i=n.get(e);if(!i){n.set(e,r);continue}let{reviews:a,baseline:o,reviewed:s,unsupported:c,reviewers:l,...u}=i;n.set(e,{...u,...r.was||i.was?{was:[...new Set([...i.was??[],...r.was??[]])]}:{},...EV(i,r),...OV(i,r,t)})}let r=[...n.values()],i=r.filter(e=>!e.was);return{versions:[...i,...r.filter(e=>e.was)],fresh:i.length,updated:r.length-i.length,more:e.some(e=>e.more>0),toReview:t?.toReview??r.filter(e=>kV(e,t)===`wanted`).length}}var EV=(e,t)=>!e.patch?.path&&t.patch?.path?{patch:t.patch}:{},DV={unsupported:0,wanted:1,passed:2,baseline:3};function OV(e,t,n){let r=e=>DV[kV(e,n)]??4,{unsupported:i,baseline:a,reviewed:o,reviews:s,rejected:c,reviewers:l}=r(t)<r(e)||r(t)===r(e)&&(t.reviews??1/0)<(e.reviews??1/0)?t:e,u=Math.max(e.commented??0,t.commented??0);return{...i?{unsupported:i}:a?{baseline:a}:o?{reviewed:o}:s==null?{}:{reviews:s,...c?{rejected:c}:{},...u>0?{commented:u}:{},...l?{reviewers:l}:{}}}}function kV(e,t){return t?e.unsupported?`unsupported`:e.baseline?`baseline`:e.reviewed?`passed`:e.reviews==null?null:e.reviews>=t.required&&!e.rejected?`passed`:`wanted`:null}function AV(e){return CV(`unreviewed`,e,()=>jV(e))}function jV({lockfiles:e,review:t}){let n=new Map;for(let t of e.flatMap(e=>e.unreviewed??[])){let e=cV(t),r=n.get(e);n.set(e,r?{...r,...EV(r,t)}:t)}return{versions:[...n.values()],count:t?.unreviewed??n.size+e.reduce((e,t)=>e+(t.moreUnreviewed??0),0)}}function MV(e){return CV(e.cut?`failures-cut`:`failures`,e,()=>NV(e))}function NV({lockfiles:e,cut:t,review:n}){if(!n)return null;let r=new Map;for(let t of e.flatMap(e=>e.unsupported??[])){let e=`${t.source}\0${t.name}@${t.version??``}\0${t.from??``}`;r.has(e)||r.set(e,t)}let i=t=>e.reduce((e,n)=>e+(n[t]??0),0),a={versions:[...r.values()],count:n.unsupported??r.size+i(`moreUnsupported`),unread:e.filter(e=>e.error&&!sV(e)),unchecked:i(`moreLocked`),cut:t};return a.count>0||a.unread.length>0||a.unchecked>0||t?a:null}var X=e=>M`<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true">${e}</svg>`,PV=N`<circle cx="8" cy="8" r="6.25"/>`,FV=N`<circle cx="4.5" cy="3.5" r="1.6"/><circle cx="4.5" cy="12.5" r="1.6"/><path d="M4.5 5.1v5.8"/><circle cx="11.5" cy="12.5" r="1.6"/>`,IV={issues:{open:X(N`${PV}<circle class="fill" cx="8" cy="8" r="1.6"/>`),completed:X(N`${PV}<path d="M5.4 8.3l1.8 1.8 3.4-3.7"/>`),"not-planned":X(N`${PV}<path d="M3.9 12.1l8.2-8.2"/>`)},pulls:{open:X(N`${FV}<path d="M11.5 10.9V6.5a2 2 0 0 0-2-2H7.4M8.9 3 7.4 4.5 8.9 6"/>`),draft:X(N`${FV}<path class="dotted" d="M11.5 10.9V4"/>`),merged:X(N`<circle cx="4.5" cy="3.5" r="1.6"/><circle cx="4.5" cy="12.5" r="1.6"/><path d="M4.5 5.1v5.8M4.5 5.1c0 2.4 2.4 3.4 5.4 3.4"/><circle cx="11.5" cy="8.5" r="1.6"/>`),closed:X(N`${FV}<path d="M9.6 3.1l3.8 3.8M13.4 3.1 9.6 6.9"/>`)}},LV=X(N`<path d="M2.6 3.2h10.8v7.3H8l-3.2 2.6v-2.6H2.6z"/>`),RV={success:[`Checks passed`,X(N`<path d="M3.5 8.4l2.9 2.9 6.1-6.6"/>`)],failure:[`Checks failed`,X(N`<path d="M4.2 4.2l7.6 7.6M11.8 4.2l-7.6 7.6"/>`)],pending:[`Checks running`,X(N`<circle class="fill" cx="8" cy="8" r="3"/>`)]},zV={approved:[`Approved`,X(N`${PV}<path d="M5.4 8.3l1.8 1.8 3.4-3.7"/>`)],changes:[`Changes requested`,X(N`<path d="M3.75 1.75h5.5l3 3v9.5h-8.5z"/><path d="M8 4.5v4M6 6.5h4M6 11h4"/>`)],required:[`Review required`,X(N`<path d="M1.25 8S3.75 3.5 8 3.5 14.75 8 14.75 8 12.25 12.5 8 12.5 1.25 8 1.25 8z"/><circle cx="8" cy="8" r="2"/>`)]},BV=X(N`<circle cx="4" cy="3.5" r="1.5"/><circle cx="4" cy="12.5" r="1.5"/><circle cx="12" cy="12.5" r="1.5"/><path d="M4 5v6M12 11V6a2 2 0 0 0-2-2H7m1.5-1.5L7 4l1.5 1.5"/>`),VV=X(N`<circle cx="4" cy="3" r="1.5"/><circle cx="4" cy="13" r="1.5"/><circle cx="12" cy="3" r="1.5"/><path d="M4 4.5v7m0-3h3a5 5 0 0 0 5-4"/>`),HV=X(N`<circle cx="8" cy="8" r="3"/><path d="M1 8h4m6 0h4"/>`),UV=X(N`<path d="M8 1.75 2.25 4.5v7L8 14.25l5.75-2.75v-7z"/><path d="M2.25 4.5 8 7.25l5.75-2.75M8 7.25v7"/>`);function WV(e,t){return e===`pulls`?t.state===`merged`?[`merged`,`Merged`]:t.state===`closed`?[`closed`,`Closed`]:t.draft?[`draft`,`Draft`]:[`open`,`Open`]:t.state===`open`?[`open`,`Open`]:t.reason===`not-planned`||t.reason===`duplicate`?[`not-planned`,t.reason===`duplicate`?`Closed as duplicate`:`Closed as not planned`]:[`completed`,`Closed`]}var GV={claude:M`<span class="agent-logo" aria-hidden="true">${Hy(`anthropic`)}</span>`,codex:M`<span class="agent-logo" aria-hidden="true">${Hy(`openai`)}</span>`,copilot:M`<span class="agent-logo" aria-hidden="true">${Hy(`github-copilot`)}</span>`},KV={claude:`Claude`,codex:`Codex`},qV=new Map;function JV(e){for(let t of e)qV.set(t.id,t)}var YV=e=>KV[e]??qV.get(e)?.name??e;function XV(e){if(GV[e])return GV[e];let t=qV.get(e)?.avatar;return t?M`<img class="agent-avatar" src="${`/api/avatar/${t}`}" alt="" width="14" height="14" loading="lazy" decoding="async">`:P}var ZV=e=>e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;function QV(e){return e.sessions[0]?`https://claude.ai/code/${e.sessions[0]}`:e.tasks[0]?`https://chatgpt.com/codex/tasks/${e.tasks[0]}`:null}function $V(e,t){return t?e.pulls[0]?`https://github.com/${t}/pull/${e.pulls[0].number}`:e.commits[0]?`https://github.com/${t}/commit/${e.commits[0].oid}`:e.branches[0]?eH(t,e.branches[0]):null:null}function eH(e,t){let[n,r]=t.includes(`:`)?[t.slice(0,t.indexOf(`:`)),t.slice(t.indexOf(`:`)+1)]:[null,t],i=r.split(`/`).map(encodeURIComponent).join(`/`);return n?`https://github.com/${encodeURIComponent(n)}/${encodeURIComponent(e.split(`/`)[1]??``)}/tree/${i}`:`https://github.com/${e}/tree/${i}`}var tH=(e,t)=>QV(e)??$V(e,t),nH=`100% 0px`,rH=new WeakMap,iH=new WeakMap,aH=[],oH=!1,sH=new WeakMap;function cH(e){let t=sH.get(e);if(t===void 0){let n=getComputedStyle(e).overflowY;t=n===`auto`||n===`scroll`||n===`overlay`,sH.set(e,t)}return t}function lH(e){let t=e.parentNode;for(;t;)if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE)t=t.host??null;else{if(t.nodeType!==Node.ELEMENT_NODE||t===document.documentElement)return null;if(cH(t))return t;t=t.parentNode}return null}function uH(e){for(let t of e)iH.get(t.target)?.cb(t.isIntersecting)}function dH(e){let t=e??document,n=rH.get(t);return n||(n=new IntersectionObserver(uH,{root:e,rootMargin:nH,threshold:0}),rH.set(t,n)),n}function fH(e,t){let n=iH.get(e);n?.io&&n.io.unobserve(e),iH.set(e,{cb:t,io:null}),aH.push(e),oH||(oH=!0,queueMicrotask(pH))}function pH(){oH=!1;let e=aH;aH=[];for(let t of e){let e=iH.get(t);!e||e.io||(e.io=dH(lH(t)),e.io.observe(t))}}function mH(e){let t=iH.get(e);t&&(t.io?.unobserve(e),iH.delete(e))}var hH=2,gH=50,_H=6e3,vH=6e4,yH=new Map,bH=new Map,xH=[],SH=new Set,CH=null,wH=0,TH=!1,EH=e=>{for(let t of SH)t(e)};function DH(){let e=L.managedSession?`${L.managedSession.id}\0${L.managedSession.role}`:null;return e!==CH&&(yH.clear(),bH.clear(),xH.length=0,CH=e),yH}var OH=e=>Number.isSafeInteger(e)&&e>=0?e:null,kH=e=>OH(e?.additions)===null||OH(e?.deletions)===null?null:{additions:e.additions,deletions:e.deletions},AH=(e,t)=>({status:`ready`,until:1/0,...e,typeless:kH(t.typeless),binary:t.binary===!0}),jH=e=>({status:`error`,until:Date.now()+vH,error:e});function MH(e,t,n){let r=DH(),i=`${e}\0${t}\0${n}`,a=r.get(i);if(a&&Date.now()<a.until)return a;let o={status:`loading`,until:1/0};return r.set(i,o),bH.set(i,{asked:[e,t,n],loading:o}),TH||(TH=!0,globalThis.requestAnimationFrame?requestAnimationFrame(PH):setTimeout(PH,0)),o}function NH(e){let t=DH();for(let[n,r,i,a]of e){let e=kH(a),o=`${n}\0${r}\0${i}`;!e||t.get(o)?.status===`ready`||(bH.delete(o),t.set(o,AH(e,a)),EH(o))}}function PH(){TH=!1;let e=0,t=[];for(let[n,r]of bH){let i=encodeURIComponent(JSON.stringify(r.asked)).length+3;(t.length===gH||t.length>0&&e+i>_H)&&(xH.push(t),t=[],e=0),t.push({key:n,...r}),e+=i}t.length>0&&xH.push(t),bH.clear(),FH()}function FH(){for(;wH<hH&&xH.length>0;){let e=xH.shift().filter(({key:e,loading:t})=>yH.get(e)===t);e.length!==0&&(wH++,LH(e).finally(IH))}}function IH(){wH--,FH()}function LH(e){let t=yH,n=new Map(e.map(({key:e,loading:t})=>[e,t])),r=(e,r)=>{n.has(e)&&(t.get(e)===n.get(e)&&(r?t.set(e,r):t.delete(e)),n.delete(e),EH(e))};return ex(e.map(e=>e.asked),e=>{let t=kH(e);r(`${e.name}\0${e.version}\0${e.otherVersion}`,typeof e.error==`string`?jH(e.error):t?AH(t,e):jH(`The server answered with no lines.`))}).then(()=>{for(let e of[...n.keys()])r(e,jH(`The server answered with none of it.`));return null},e=>{for(let t of[...n.keys()])r(t,e?.name===`AbortError`?null:jH(e?.message||`Its lines couldn’t be counted.`))})}var RH=e=>e.was?.find(t=>t!==e.version)??`(empty)`,zH=(e,t)=>M`<span class="is-added">+${e.toLocaleString(`en-US`)}</span> <span class="is-deleted">−${t.toLocaleString(`en-US`)}</span>`,BH=class extends Ca{static properties={name:{attribute:!1},version:{attribute:!1},base:{attribute:!1}};createRenderRoot(){return this}constructor(){super(),this._near=!1,this._notify=e=>{this._near&&(!e||e===`${this.name}\0${this.version}\0${this.base??`(empty)`}`)&&this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this._watch()}disconnectedCallback(){super.disconnectedCallback(),this._unwatch()}_watch(){SH.add(this._notify),!this._near&&fH(this,e=>{!e||this._near||(this._near=!0,mH(this),this.requestUpdate())})}_unwatch(){SH.delete(this._notify),mH(this)}render(){if(!this._near||!this.name||!this.version)return P;let e=MH(this.name,this.version,this.base??`(empty)`),t=this.base&&this.base!==`(empty)`?`against ${this.base}`:`the whole package`;if(e.status===`loading`)return M`<span class="npm-delta is-loading" aria-label="Counting its lines">…</span>`;if(e.status===`error`)return M`<span class="npm-delta is-error" data-tooltip="${e.error}" .tooltipContent="${M`<div class="compare-tip"><div class="compare-tip-head">Lines not counted</div><div>${e.error}</div></div>`}">?</span>`;let n=M`<div class="compare-tip"><div class="compare-tip-head">Lines changed</div><div class="compare-tip-rows"><span class="compare-tip-label">Against</span><span>${this.base&&this.base!==`(empty)`?this.base:`none, the whole package`}</span> <span class="compare-tip-label">Added</span><span class="is-added">+${e.additions.toLocaleString(`en-US`)}</span> <span class="compare-tip-label">Removed</span><span class="is-deleted">−${e.deletions.toLocaleString(`en-US`)}</span> ${e.typeless?M`<span class="compare-tip-label">Types aside</span><span>${zH(e.typeless.additions,e.typeless.deletions)}</span>`:P}</div>${e.typeless?M`<div class="compare-tip-note">Types aside: leaving out the declaration files changed in types alone</div>`:P} ${e.binary?M`<div class="compare-tip-note">Binary files changed too, which no line counts</div>`:P}</div>`;return M`<span class="npm-delta" data-tooltip="${`Lines it adds and removes, ${t}`}" .tooltipContent="${n}">${zH(e.additions,e.deletions)}${e.binary?M`<span class="npm-delta-binary">, binary</span>`:P}${e.typeless?M`<span class="npm-delta-typeless">(${zH(e.typeless.additions,e.typeless.deletions)} -types)</span>`:P}</span>`}};customElements.get(`npm-delta`)||customElements.define(`npm-delta`,BH);var VH=class extends Ca{static properties={text:{attribute:!1},label:{attribute:!1},_copied:{state:!0},_error:{state:!0}};createRenderRoot(){return this}constructor(){super(),this.text=null,this.label=`Copy dependency review`}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this._timer)}async _copy(){if(this._copyable()){this._error=!1;try{await navigator.clipboard.writeText(this.text),this._copied=!0,clearTimeout(this._timer),this._timer=setTimeout(()=>{this._copied=!1},2e3)}catch{this._error=!0}}}_copyable(){return typeof this.text==`string`&&this.text.trim()!==``}render(){return this._copyable()?M`<button type="button" class="${`bundle-code-copy-path dependency-review-copy-button${this._copied?` copied`:``}`}" aria-label="${this.label}" data-tooltip="${this.label}" @click="${()=>this._copy()}">${Ww}</button> ${this._error?M`<span role="alert">Could not copy to the clipboard.</span>`:P}`:P}};customElements.define(`dependency-review-copy`,VH);var HH=12e4,UH=3e4,WH=3,GH=12,KH=48,qH=3,JH=[[`pulls`,`Pull requests`],[`versions`,`Versions`],[`branch`,`Default branch`],[`reviews`,`Reviews`]],YH=(e,t)=>e.repo.name<t.repo.name?-1:e.repo.name>t.repo.name?1:t.item.number-e.item.number,XH=e=>(t,n)=>(n.item[e]??0)-(t.item[e]??0)||YH(t,n),ZH=(e,t)=>+(e.size===0)-(t.size===0)||e.size-t.size||e.others-t.others||YH(e,t),QH={newest:[`Newest`,XH(`createdAt`)],updated:[`Updated`,XH(`updatedAt`)],fewest:[`Fewest to review`,ZH]},$H={status:`loading`,until:1/0};function eU(e,t){let n=xV(e,t,!0);return n?.pending?_V(e,t,!0,{background:!0}):n??$H}var tU=50,nU=new Map,rU=new Set,iU=new Map,aU=new Map,oU=null,sU=!1,cU=()=>{for(let e of rU)e()};function lU(){nU.clear();for(let e of iU.keys())e.abort();iU.clear()}function uU(){sU||(sU=!0,queueMicrotask(()=>{sU=!1;let e=new Set(aU.values());for(let[t,n]of iU)e.has(n)||t.abort()}))}globalThis.addEventListener?.(`dependency-review-changed`,()=>{lU(),cU()});function dU(){let e=L.managedSession?`${L.managedSession.id}\0${L.managedSession.role}`:null;return e!==oU&&(lU(),oU=e),nU}function fU(e,t){let n=dU(),r=[],i=t.map(e=>{let t=n.get(e);if(t&&Date.now()<t.until)return t;let i=t?.status===`ready`?{...t,until:1/0,telling:null,refreshing:!0}:{status:`loading`,until:1/0};return n.set(e,i),r.push(e),i});return r.length>0&&pU(e,r,r.length===t.length?null:r,WH),i}function pU(e,t,n,r){let i=nU,a=new Map(t.map(e=>[e,i.get(e)])),o=(e,t)=>{i.get(e)===a.get(e)&&i.set(e,t),i.get(e)===t&&t.telling?a.set(e,t):a.delete(e)},s=new AbortController;iU.set(s,e);let c=null;$b(e,e=>{s.signal.aborted||(typeof e.done==`boolean`?c=e.done?[]:Array.isArray(e.unread)?e.unread:[]:a.has(e.repoId)&&(mU(e,a.get(e.repoId),t=>o(e.repoId,t)),cU()))},{repoIds:n,signal:s.signal}).then(()=>{let t=(c??[]).filter(e=>a.has(e)),n=t.length>0&&r>0;for(let[e,r]of[...a])n&&t.includes(e)||o(e,gU(e,r,c===null?`The server’s answer ended short.`:t.includes(e)?`Reading its pull requests took too long.`:null));return n&&pU(e,t,t,r-1),null},e=>{for(let[t,n]of[...a])e?.name===`AbortError`?i.get(t)===n&&(n.status===`ready`?i.set(t,{...n,until:0,telling:null}):i.delete(t)):o(t,gU(t,n,e?.message||`It couldn’t be read.`))}).finally(()=>{iU.delete(s),cU()})}function mU(e,t,n){if(Array.isArray(e.deltas)&&NH(e.deltas),typeof e.error==`string`)n({status:`error`,until:Date.now()+UH,error:e.error});else if(e.branch===null)n({status:`ready`,until:Date.now()+HH,branch:null});else if(e.branch){let t;try{t=pV(e.branch)}catch(e){n({status:`error`,until:Date.now()+UH,error:e.message});return}let r=(Array.isArray(e.pulls?.items)?e.pulls.items:[]).filter(e=>Number.isSafeInteger(e?.number)&&e.number>0),i=typeof e.pulls?.error==`string`&&e.pulls.error?{error:e.pulls.error}:{};n(hU({status:`ready`,branch:t,pulls:{items:r,more:e.pulls?.more===!0,...i},...t.pending?{pending:!0}:{}},new Set(r.filter(rV).map(e=>e.number))))}else e.dependencies instanceof Map&&t.telling&&(bV(e.repoId,e.dependencies,!0),n(hU(t,new Set([...t.telling].filter(t=>!e.dependencies.has(t))))))}function hU(e,t){if(t.size>0)return{...e,until:1/0,telling:t};let n=e.pulls?.error||e.pending?UH:HH;return e.pending&&setTimeout(cU,n+tU).unref?.(),{...e,until:Date.now()+n,telling:null}}function gU(e,t,n){return t.telling?(bV(e,new Map([...t.telling].map(e=>[e,Error(n??`The server’s answer ended short.`)])),!0),{...t,until:Date.now()+UH,telling:null}):n?{status:`error`,until:Date.now()+UH,error:n}:{status:`ready`,until:Date.now()+HH,branch:null}}var _U=(e,t)=>`${e.toLocaleString(`en-US`)} ${t}${e===1?``:`s`}`,vU=({repo:e,item:t})=>`${e.name}#${t.number}`,yU=()=>L.managedSession?.login?.toLowerCase()??null,bU=e=>e.login.toLowerCase()===yU();function xU(e,t){let n=kV(e,t);return n===`unsupported`?{label:`can’t review`,tint:`is-failed`,said:aV[e.unsupported]}:e.rejected?{label:`rejected`,tint:`is-failed`,said:`A reviewer rejects it: it wants their newer accepting review`}:n===`wanted`?{label:`${e.reviews}/${t.required}`,tint:`is-wanted`,said:`${_U(e.reviews,`review`)} of ${t.required} required${e.commented?`; ${_U(e.commented,`reviewer`)} in its comments, which count here alone`:``}`}:null}function SU(e,t){let n=xU(e,t);return!n||n.tint===`is-wanted`&&e.reviews===0?P:M`<span class="team-deps-review ${n.tint}">${n.label}</span>`}var CU={accept:`accepts`,"accept-with-nits":`accepts with nits`,"request-changes":`requests changes`,reject:`rejects`},wU=new Set([`accept`,`accept-with-nits`]),TU=(e,t)=>({passed:`passes`,baseline:`needs none`})[kV(e,t)]??xU(e,t)?.label??null,EU=e=>new Map((e.reviewers??[]).flatMap(e=>e.passes?[[`+${e.login.toLowerCase()}`,e]]:e.status===`reject`?[[`-${e.login.toLowerCase()}`,e]]:[]));function DU(e,t){let n=new Map;for(let t of e)for(let e of t.wanted){let r=EU(e);(n.get(cV(e))??n.set(cV(e),[]).get(cV(e))).push({pull:t,has:r,alike:[...r.keys()].toSorted().join(`\0`)})}let r=(e,t)=>!e||t.has.size>e.has.size||t.has.size===e.has.size&&t.pull.left<e.pull.left?t:e,i=new Map;for(let[e,a]of n){let n=new Map;for(let{pull:r,pkg:i}of t.get(e)?.values()??[])for(let[e,t]of EU(i))t.comment&&(n.get(e)??n.set(e,{login:t.login,status:t.status,pulls:[]}).get(e)).pulls.push(r);let o=new Map,s=new Map,c=null;for(let e of a){let{pull:t,has:i,alike:a}=e,l=i.size>0?[...n].filter(([e])=>!i.has(e)).map(([,e])=>e):[];l.length===0?(!s.has(a)||t.left<s.get(a).pull.left)&&s.set(a,e):(o.set(vU(t),{lacks:l}),c=r(c,e))}let l=[...s.values()].filter(({has:e})=>e.size>0).reduce(r,null)??c;for(let{pull:e,alike:t}of a){if(o.has(vU(e)))continue;let n=(t===``&&l?l:s.get(t)).pull;o.set(vU(e),e===n?{}:{under:n})}i.set(e,o)}return i}var OU=e=>(e.reviews??0)>0||e.rejected===!0,kU=e=>(e.unreached?2:0)+ +!OU(e),AU=(e,t=e=>e)=>e.toSorted((e,n)=>kU(t(e))-kU(t(n))),jU=(e,t=e.length-1)=>`${e[0]}${t>0?` +${t}`:``}`,MU=`by its lockfile alone: the stasis.config.json beside it reaches it by no entry`;function NU(e,t,{added:n,under:r,lacks:i,involved:a,here:o}){let s=xU(e,t),c=[n?[`Present`,e.was?.join(`, `)||`none, new`]:null,e.source!==`registry`&&e.from?[`From`,e.from]:null,e.patch?[`Patched`,e.patch.path??`by a patch whose file isn’t known, which reviews here can’t read`]:null,e.unreached?[`Asked for`,MU]:null,s?[`Review`,s.said??s.label]:null,r?[`Listed`,`under ${r}`]:null,i.length>0?[`Lacks`,i.map(e=>`${bU(e)?`your`:`${e.login}\u2019s`} review in ${e.where.join(`, `)}`).join(`; `)]:null].filter(Boolean),l=new Map;for(let{name:t,pkg:n}of[{name:o,pkg:e},...a])for(let e of n.reviewers??[]){if(e.comment&&!t)continue;let n=e.comment?`${e.login}\0${t}`:e.login;l.has(n)||l.set(n,{...e,where:e.comment?t:null})}return M`<div class="compare-tip"><div class="team-deps-tip-name">${e.name}${e.version?`@${e.version}`:``}${e.patch?` (patched)`:``}</div>${c.length>0?M`<div class="compare-tip-rows">${c.map(([e,t])=>M`<span class="compare-tip-label">${e}</span><span>${t}</span>`)}</div>`:P} ${a.length>0?M`<div class="compare-tip-head">Pull requests</div><div class="compare-tip-rows">${a.map(({name:e,adds:t,pkg:n,review:r})=>M`<span class="${e===o?`team-deps-tip-here`:P}">${e}</span> <span>${[t?`adds it`:`locks it`,TU(n,r)].filter(Boolean).join(`, `)}</span>`)}</div>`:P} ${l.size>0?M`<div class="compare-tip-head">Reviewed by</div><div class="compare-tip-rows">${[...l.values()].map(e=>M`<span>${e.login}</span> <span>${CU[e.status]}${wU.has(e.status)&&!e.passes?`, not counted`:``}${e.where?`, in ${e.where}\u2019s comments`:``}</span>`)}</div>`:P}</div>`}function PU(e,t,{others:n=[],adders:r=!1,elsewhere:i=[],under:a=null,lacks:o=[],lacking:s=[],added:c=!1,involved:l=[],here:u=null,repoId:d=null,head:f=null}={}){let p=e.source===`registry`&&e.version,m=e.patch&&e.was?.includes(e.version)?e.version:e.was?.find(t=>t!==e.version),h=e.patch?.path&&d&&f?{hash:e.patch.hash,repoId:d,commit:f,path:e.patch.path}:null,g=t?.canReview&&(!e.patch||h)&&kV(e,t)!==`unsupported`,_=p?mi({view:`npm`,packageName:e.name,packageSpec:e.version,...g?{bundleTab:`review`,...m?{reviewPackage:e.name,reviewSpec:m}:{},...h?{patch:h}:{}}:{}}):null,v=`${e.name}${e.version?`@${e.version}`:``}${e.patch?` (patched)`:``}`,y=NU(e,t,{added:c,under:a,lacks:o,involved:l,here:u}),b=i.filter(e=>!s.includes(e)),x=r?n.filter(e=>!i.includes(e)&&!s.includes(e)):n,S=M`${He(e.ecosystem)}<span class="team-deps-name">${e.name}${e.version?M`<span class="team-deps-version">@${e.version}</span>`:P}</span> ${e.patch?M`<span class="team-deps-patched">patched</span>`:P} ${e.unreached?M`<span class="team-deps-unreached" role="img" aria-label="${`Asked for ${MU}`}">!</span>`:P} ${p&&!e.patch&&kV(e,t)===`wanted`?M`<npm-delta .name="${e.name}" .version="${e.version}" .base="${RH(e)}"></npm-delta>`:P} ${SU(e,t)} ${a?M`<span class="team-deps-under">${a}</span>`:P} ${s.length>0?M`<span class="team-deps-lacks">${jU(s)}</span>`:P} ${b.length>0?M`<span class="team-deps-elsewhere">${jU(b)}</span>`:P} ${x.length>0?M`<span class="team-deps-also">${r?jU(x):`+${n.length}`}</span>`:P}`,ee=o.length>0?` is-behind`:``;return M`<li>${_?M`<a class="team-deps-row${ee}" href="${_}" target="_blank" rel="noopener noreferrer" data-tooltip="${v}" .tooltipContent="${y}">${S}</a>`:M`<span class="team-deps-row${ee}" data-tooltip="${v}" .tooltipContent="${y}">${S}</span>`}</li>`}var FU=e=>({repoId:e.repo.repoId,head:e.entry.head??null}),IU=X(N`<path d="m6 4 4 4-4 4"/>`),LU=class extends eg{static properties={repositories:{attribute:!1},team:{attribute:!1},_open:{state:!0}};createRenderRoot(){return this}constructor(){super(),this.repositories=[],this.team=null,this._open=new Set,this._notify=()=>this.requestUpdate()}pick(e,{push:t=!0}={}){L.teamDependenciesTab=e;let n=xi({view:`workspace-dependencies`,teamId:this.team,dependencyTab:e},L.managedTeams);t?q?.pushRoute(n):q?.replaceRoute(n)}updated(){this._shown&&this._shown!==L.teamDependenciesTab&&this.pick(this._shown,{push:!1})}toggle(e){let t=new Set(this._open);t.delete(e)||t.add(e),this._open=t}connectedCallback(){super.connectedCallback(),rU.add(this._notify),this._unsubscribe=$B(this._notify),aU.set(this,this.team)}disconnectedCallback(){super.disconnectedCallback(),rU.delete(this._notify),this._unsubscribe?.(),aU.delete(this),uU()}open(e,{repo:t,item:n}){e.preventDefault(),ye({repository:{repoId:t.repoId,repo:t.name},target:{number:n.number,preview:{...n,kind:`pulls`}}})}rows(e,t,n,r=GH,i=!1){if(t.length===0)return P;let a=this._open.has(e);return M`<ul class="team-deps-versions${i?` is-same`:``}">${(a?t:t.slice(0,r)).map(n)}</ul>${t.length>r?M`<button type="button" class="team-deps-more" aria-expanded="${String(a)}" @click="${()=>this.toggle(e)}">${IU}${a?`Show fewer`:`and ${(t.length-r).toLocaleString(`en-US`)} more`}</button>`:P}`}disclosed(e,t,n,r,i=0){let a=this._open.has(e);return M`<div class="team-deps-disclosed"><button type="button" class="team-deps-more" aria-expanded="${String(a)}" @click="${()=>this.toggle(e)}">${IU}${t}</button> ${a?M`${this.rows(e,n,r,KH)}${i>0?M`<p class="team-deps-quiet">and ${i.toLocaleString(`en-US`)} more, not listed</p>`:P}`:P}</div>`}render(){this.isConnected&&aU.get(this)!==this.team&&(aU.has(this)&&uU(),aU.set(this,this.team));let e=[...new Map((this.repositories??[]).map(e=>[e.repoId,e])).values()],t=fU(this.team,e.map(e=>e.repoId)),n=e.map((e,n)=>({repo:e,read:t[n]})),r=n.filter(({read:e})=>e.status===`ready`&&e.branch),i=r.flatMap(({repo:e,read:t})=>t.pulls.items.filter(rV).map(t=>({repo:e,item:t,entry:eU(e.repoId,t.number)}))),a=i.filter(({entry:e})=>e.status===`ready`&&e.review).map(e=>{let{review:t}=e.entry,n=wV(e.entry).versions.filter(e=>[`wanted`,`unsupported`].includes(kV(e,t))),r=n.filter(e=>kV(e,t)===`wanted`),i=Math.max(t.toReview??r.length,r.length),a=i-r.length;return{...e,wanted:n,failed:MV(e.entry),toReview:i,untold:a,size:n.length+a,left:r.reduce((e,n)=>e+Math.max(1,t.required-n.reviews),a*t.required),others:AV(e.entry).count}}).filter(e=>e.size>0||e.others>0||e.failed).toSorted(ZH),o=Object.hasOwn(QH,L.teamDependenciesSort)?L.teamDependenciesSort:`newest`,s=o===`fewest`?a:a.toSorted(QH[o][1]),c=r.filter(({read:e})=>e.pulls.more&&!e.pulls.error),l=r.filter(({read:e})=>e.pulls.error),u=new Map;for(let e of a)for(let t of e.wanted){let n=u.get(cV(t))??u.set(cV(t),{pkg:t,pulls:[],told:[]}).get(cV(t));n.pulls.push(e),n.told.push(t),!n.patched&&t.patch?.path&&(n.patched={patch:t.patch,pull:e})}let d=n.some(({read:e})=>e.status===`loading`)||i.some(({entry:e})=>e.status===`loading`),f=i.some(({entry:e})=>e.pending)||r.some(({read:e})=>e.branch.pending),p=[...n.filter(({read:e})=>e.status===`error`).map(({repo:e,read:t})=>[e.name,t.error]),...l.map(({repo:e,read:t})=>[e.name,t.pulls.error]),...i.filter(({entry:e})=>e.status===`error`).map(e=>[vU(e),e.entry.error])],m=r.flatMap(({repo:e,read:t})=>{let{count:n}=AV(t.branch),r=MV(t.branch);return n>0||r||t.branch.pending?[{repo:e,read:t,count:n+(r?.count??0)}]:[]}),h=new Map;for(let e of i.filter(({entry:e})=>e.status===`ready`&&e.review))for(let[t,n]of[[!0,wV(e.entry).versions],[!1,AV(e.entry).versions]])for(let r of n){let n=h.get(cV(r))??h.set(cV(r),new Map).get(cV(r));n.has(vU(e))||n.set(vU(e),{pull:e,pkg:r,adds:t})}let g=new Set(n.filter(({read:e})=>e.status!==`ready`||e.branch).map(({repo:e})=>e.name.split(`/`)[0])).size===1?e=>e.slice(e.indexOf(`/`)+1):e=>e,_=e=>g(vU(e)),v=e=>[...h.get(cV(e))?.values()??[]].map(({pull:e,pkg:t,adds:n})=>({name:_(e),adds:n,pkg:t,review:e.entry.review})),y=(e,t=null)=>[...h.get(cV(e))?.values()??[]].filter(e=>e.pkg.commented>0&&(!t||vU(e.pull)!==vU(t))).map(e=>_(e.pull)),b=DU(a,h),x=(e,t)=>{let{under:n=null,lacks:r=[]}=b.get(cV(e))?.get(vU(t))??{};return{under:n&&_(n),lacks:r.map(e=>({login:e.login,status:e.status,where:e.pulls.map(_)}))}},S={elsewhere:y,named:_,shorten:g,among:v,standing:x},ee=s.map(e=>{let t=AU(e.wanted.filter(t=>x(t,e).under)),n=AU(e.wanted.filter(e=>!t.includes(e)));return{pull:e,listed:n,same:t,lacking:n.filter(t=>x(t,e).lacks.length>0).length,covered:n.length===0&&t.length>0&&e.untold===0&&!e.failed}}),C=ee.reduce((e,t)=>e+t.lacking,0),te=p.map(([e,t])=>`${g(e)}: ${t}`),ne=L.teamDependenciesTab,re=JH.filter(([e])=>e!==`branch`||m.length>0||d&&ne===`branch`),ie=re.some(([e])=>e===ne)?ne:`pulls`;this._shown=ie;let ae={pulls:a.length,versions:u.size,branch:m.reduce((e,{count:t})=>e+t,0)};return M`<div class="team-deps">${SS({tabs:re.map(([e,t])=>({id:e,label:M`${t}${ae[e]==null||d&&ae[e]===0?P:M`<span class="team-deps-tab-n">${ae[e].toLocaleString(`en-US`)}</span>`}`})),current:ie,prefix:`team-deps`,select:e=>this.pick(e)})}<div class="team-deps-panel" role="tabpanel" id="${`team-deps-panel-${ie}`}" aria-labelledby="${`team-deps-tab-${ie}`}">${ie===`reviews`?QR(()=>M`<dependency-review-list .session="${L.managedSession}" .team="${this.team}"></dependency-review-list>`):M`<div class="team-deps-bar">${d?M`<p class="team-deps-quiet" role="status">Reading their pull requests…</p>`:f?M`<p class="team-deps-quiet" role="status">Stasis is still working out what some <code>stasis.config.json</code> entries reach; they are asked again as it does.</p>`:P} ${te.length===1?M`<p class="team-deps-quiet" data-tooltip="${te[0]}" role="alert">${te[0]}</p>`:te.length>1?M`<p class="team-deps-quiet" role="alert" data-tooltip="${te.join(`
|
|
195
|
+
`,n+1))t++}i.set(a,t)}return i.get(a)}function eB(e,t){let n=Zz(e);if(!n)return null;let r=Ot(e);return[...n.get(t)??[]].toSorted(([e],[t])=>e.localeCompare(t)).map(([e,t])=>{let n=r.has(e);return{path:e,specifiers:[...t].toSorted(),held:n,line:n?$z(r,e,t):null}})}var tB=M`<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 4.5V2h5.5L14 4.5V14H6v-2.5"/><path d="M1.5 8h8M7 5.5 9.5 8 7 10.5"/></svg>`,nB=e=>`${e.toLocaleString()} ${e===1?`file`:`files`}`;function rB(e){if(e.newState!==`open`)return;let t=e.currentTarget,n=t.getRootNode().querySelector?.(`[popovertarget="${t.id}"]`);if(!n)return;let r=n.getBoundingClientRect(),i=t.offsetHeight||200,a=t.offsetWidth||320,o=Math.max(4,Math.min(r.left,window.innerWidth-a-4)),s=r.bottom+4;t.style.left=`${o}px`,t.style.top=`${s+i>window.innerHeight-4&&r.top>i+4?r.top-i-4:s}px`}function iB(e,t){let n=eB(e,t);if(!n)return P;let r=e.kind===`stasis`&&e.bundle.entries?.has(t),i=n.length===0?`Imported by no file${r?` · an entry point`:``}`:`Imported by ${nB(n.length)}`;return M`<button type="button" class="bundle-code-importers-toggle" popovertarget="bundle-code-importers" popovertargetaction="toggle" aria-label="${i}" data-tooltip="${i}">${tB}<span class="bundle-code-importers-count">${n.length.toLocaleString()}</span></button><div popover="auto" id="bundle-code-importers" class="bundle-code-importers" role="menu" aria-label="Imported by" @beforetoggle="${rB}" @click="${e=>{e.target.closest(`[data-bundle-view-source]`)&&e.currentTarget.hidePopover()}}"><div class="bundle-code-importers-head">${n.length===0?i:`Imported by ${nB(n.length)}`}</div>${n.slice(0,Yz).map(t=>{let n=M`${Le(t.path,Fe(e,t.path))}<span class="bundle-code-importers-path mono">${t.path}</span>${t.specifiers.length>0?M`<span class="bundle-code-importers-specifier mono">${t.specifiers.join(`, `)}</span>`:P}`;return t.held?M`<button type="button" class="bundle-code-importers-item" role="menuitem" data-tooltip-truncated data-tooltip="${t.path}" data-bundle-view-source="${t.path}" data-bundle-view-line="${t.line??P}">${n}</button>`:M`<span class="bundle-code-importers-item is-absent" role="menuitem" aria-disabled="true" data-tooltip="${`${t.path} \xB7 not in this bundle`}">${n}</span>`})} ${n.length>Yz?M`<div class="bundle-code-importers-more">and ${nB(n.length-Yz)} more</div>`:P}</div>`}var aB=new Map,oB=new Map,sB=[];function cB(e){if(!e?.managedId)return aB;let t=L.managedSession,n=L.managedTeams&&Vs(L.managedTeams),r=[t?.id,t?.role,t?.csrfToken,L.currentManagedTeam,n];return r.some((e,t)=>e!==sB[t])&&(sB=r,oB=new Map),oB}var lB=new WeakMap;function uB(e){return lB.has(e)||lB.set(e,{reasons:ve(e),selected:``}),lB.get(e)}function dB(e,t=uB(e).selected){return JSON.stringify([e.managedId??e.integrity,t])}var fB=`deepview.advisories.proxyConsent`;function pB(){try{return localStorage.getItem(fB)===`1`}catch{return!1}}function mB(){try{localStorage.setItem(fB,`1`)}catch{}}function hB(e){if(!e||e.kind!==`stasis`||!e.bundle)return!1;for(let[t,n]of e.bundle.modules)if(t.includes(`node_modules`)&&n?.name&&typeof n.version==`string`&&n.version)return!0;return!1}function gB(e){if(!e||e.kind!==`stasis`||!e.bundle)return!1;for(let[t,n]of e.bundle.modules)if(t!==`.`&&typeof n?.name==`string`&&n.name&&typeof n.version==`string`&&n.version&&(n.ecosystem||/(?:^|\/)node_modules\//u.test(t)))return!0;return!1}function _B(e){if(e.bundle&&!gB(e))return!0;let t=cB(e).get(dB(e,``));return t?.state===`ok`&&t.query.size===0&&t.skipped.length===0}function vB(e,t,n=!1){return!e||e.managedId&&!bB(e)||yB(e,t)<1||e.summary?.versionedPackages===0?!1:n?!0:CR(e.name)===`stasis`?!t||t.integrity!==e.integrity?!0:e.managedId?!t.bundle||gB(t):hB(t):!1}function yB(e,t){let n=t?.integrity===e.integrity&&t.bundle?t.bundle.version:e.summary?.stasisVersion;return Number.isSafeInteger(n)?n:1/0}function bB(e){let t=L.managedSession?.role;return[`admin`,`manage`].includes(t)?!0:[`view`,`triage`].includes(t)?L.managedTeams.some(t=>(L.currentManagedTeam==null||t.id===L.currentManagedTeam)&&t.permissions?.security===!0&&t.bundles?.some(t=>t.id===e.managedId)):!1}function xB(e){return Object.fromEntries([...e].map(([e,t])=>[e,[...t].toSorted()]))}var SB=e=>e.ecosystem===`npm`?e.name:`${e.ecosystem}:${e.name}`;function CB(e){return{...e,title:e.title||e.id,severity:e.severity??`unknown`,cvss:{score:e.cvss,vectorString:e.cvssVector},vulnerable_versions:e.range}}function wB(e){let t=Array.isArray(e),n=t?Map.groupBy(e.map(CB),SB):new Map(Object.entries(e??{}));for(let[e,r]of n){let i=Array.isArray(r)?r.filter(e=>e&&typeof e.title==`string`&&typeof e.severity==`string`):[];i.length>0?n.set(e,t?i:i.map(e=>({...e,source:`registry`}))):n.delete(e)}return n}function TB(e,t){return!!(e?.managedId&&t?.state===`ok`&&!t.recheckingRepositories&&t.query.size>0)}async function EB(e){let t=await fetch(`/api/npm-advisories`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(xB(e))});if(!t.ok){let e=`HTTP ${t.status}`;try{let n=await t.json();typeof n?.error==`string`&&n.error&&(e=`${n.error} (HTTP ${t.status})`)}catch{}throw Error(e)}return t.json()}function DB(e,t){return kB(e,t)}function OB(e,t){return kB(e,t,!0)}async function kB(e,t,n=!1){if(!e?.integrity||!e.managedId&&!pB())return;let r=cB(e),i=dB(e),a=r.get(i);if(n){if(!TB(e,a))return;r.set(i,{...a,recheckingRepositories:!0,repositoryError:null}),t()}else if(a)return;let{reasons:o,selected:s}=uB(e),c=e.managedId?new Map:Rt(e,o.files(s));n||r.set(i,{state:`loading`,query:c});try{let t,a=[];if(e.managedId){let r=await Wx(e.managedId,void 0,s,n,n);c=Array.isArray(r.packages)?new Map(r.packages.map(e=>[SB(e),new Set(e.versions)])):new Map(Object.entries(r.packages).map(([e,t])=>[e,new Set(t)])),t=r.advisories,a=Array.isArray(r.skipped)?r.skipped:[]}else t=c.size>0?await EB(c):{};r.set(i,{state:`ok`,byPackage:wB(t),query:c,skipped:a})}catch(e){let t=e?.message??`fetch-failed`;r.set(i,n&&![401,403,404].includes(e?.status)?{...a,recheckingRepositories:!1,repositoryError:t}:{state:`error`,reason:t,query:c})}t()}async function AB(e,t){if(!e?.integrity)return;let n=cB(e),r=dB(e);n.get(r)?.state===`error`&&(n.delete(r),await DB(e,t))}var jB={critical:0,high:1,moderate:2,low:3,info:4};function MB(e){return jB[e]??999}function NB(){let e=typeof window>`u`?``:window.location.host;return M`<div class="bundle-advisories-consent"><div class="bundle-advisories-consent-card"><p class="bundle-advisories-consent-text">This bundle's dependency names and versions will be sent to the npm registry through a same-origin proxy (<span class="mono">${e}</span> → <span class="mono">registry.npmjs.org</span>) to look up published security advisories.</p><button type="button" class="bundle-advisories-consent-btn" data-advisories-consent>Confirm</button><p class="bundle-advisories-consent-note">This preference will be saved and reused for other bundles.</p></div></div>`}function PB(e,t=()=>{},n=null){let r=e?uB(e):null,i=r?be(r.reasons):[],a=IB(e),o=!!e?.managedId&&!_B(e);return M`<div class="bundle-advisories-panel">${a!==P||i.length>0||o?M`<div class="bundle-advisories-toolbar">${a} ${i.length>0||o?M`<div class="bundle-advisories-scopes">${o?FB(e,t):P} ${i.length>0?M`<bundle-scope-selector .reasons="${i}" .value="${r.selected}" label="Choose advisory scope" @scope-change="${n=>{r.selected=r.reasons.has(n.detail.value)?n.detail.value:``;let i=DB(e,t);return t(),i}}"></bundle-scope-selector>`:P} ${o&&n?M`<button type="button" class="bundle-advisories-retry bundle-advisories-scan" @click="${n}">${j(fa)}<span>Validate</span></button>`:P}</div>`:P}</div>`:P} ${RB(e)}</div>`}function FB(e,t){if(!e?.managedId)return P;let n=cB(e).get(dB(e)),r=!!n?.recheckingRepositories;return M`<button type="button" class="bundle-advisories-retry bundle-advisories-recheck" ?disabled="${!TB(e,n)}" aria-busy="${String(r)}" @click="${()=>OB(e,t)}">${r?`Rechecking…`:`Recheck against repositories`}</button>`}function IB(e){if(!e||!e.managedId&&!pB())return P;let t=cB(e).get(dB(e));if(t?.state!==`ok`)return P;let n=t.query.size,r=t.byPackage.size;if(r===0)return P;let i=[...t.byPackage.values()].reduce((e,t)=>e+t.length,0);return M`<div class="bundle-advisories-summary">${i} ${i===1?`advisory`:`advisories`} across ${r} of ${n} ${n===1?`package`:`packages`}</div>`}function LB(e,t){let n=t.query.size;return n===0&&t.skipped.length>0?M`No packages could be audited.`:M`No advisories for the ${n} ${t.skipped.length>0?`audited `:``}${n===1?`package`:`packages`} in ${uB(e).selected?`this scope`:`this bundle`}.`}function RB(e){if(!e)return M`<div class="bundle-advisories-empty">Bundle not loaded yet.</div>`;if(e.kind!==`stasis`||!e.managedId&&!e.bundle)return M`<div class="bundle-advisories-empty">Advisories are only available for stasis bundles.</div>`;if(!e.managedId&&!pB())return NB();let t=cB(e).get(dB(e));if(!t||t.state===`loading`)return M`<div class="bundle-advisories-empty">Loading advisories…</div>`;if(t.state===`error`)return M`<div class="bundle-advisories-empty is-error"><span>Failed to fetch advisories: ${t.reason}</span> <button type="button" class="bundle-advisories-retry" data-advisories-retry>Retry</button></div>`;let n=t.byPackage.size===0?M`<div class="bundle-advisories-empty"><span>${LB(e,t)}</span></div>`:P;if(t.byPackage.size===0&&t.skipped.length===0&&!t.repositoryError)return n;let r=[...t.byPackage.entries()].toSorted(([e,t],[n,r])=>{let i=Math.min(...t.map(e=>MB(e.severity))),a=Math.min(...r.map(e=>MB(e.severity)));return i===a?e.localeCompare(n):i-a});return M`${n}<div class="bundle-advisories">${t.repositoryError?M`<div class="bundle-advisories-empty is-error" role="alert">Repository recheck failed: ${t.repositoryError}. Previous results are shown.</div>`:P} ${t.skipped.length>0?M`<section class="bundle-advisories-skipped" aria-label="Dependencies not audited"><h3>Not audited</h3><ul>${t.skipped.map(e=>M`<li><span class="mono">${SB(e)}@${e.version}</span>: ${e.because}</li>`)}</ul></section>`:P}<ul class="bundle-advisories-list">${r.map(([n,r])=>zB(e,n,r,t.query.get(n),()=>cB(e).get(dB(e))?.byPackage===t.byPackage))}</ul></div>`}function zB(e,t,n,r,i){let a=[...n].toSorted((e,t)=>{let n=MB(e.severity)-MB(t.severity);return n===0?(e.title??``).localeCompare(t.title??``):n}),o=r?[...r].toSorted():[];return M`<li class="bundle-advisories-section"><div class="bundle-advisories-package"><span class="bundle-advisories-section-name">${t}</span> ${o.length>0?M`<span class="bundle-advisories-section-versions">${o.map(n=>M`<button type="button" class="bundle-advisories-version" aria-haspopup="dialog" aria-label="${`Why is ${t}@${n} here?`}" @click="${()=>Oe({details:e,packageKey:t,version:n,scope:uB(e).selected,isCurrent:i})}">${n}</button>`)}</span>`:P}</div><ul class="bundle-advisories-rows">${a.map(e=>oP(e,({title:e,severity:t,details:n})=>nt({heading:e,severity:t,markdown:n,isCurrent:i})))}</ul></li>`}var BB=3e5,VB=3e4,HB=3e4,UB=2,WB=5,GB=20,KB=new Map,qB=[],JB=[],YB=new Map,XB=new Set,ZB=null,QB=0;function $B(e){return XB.add(e),()=>XB.delete(e)}var eV=e=>{for(let t of XB)t(e)};function tV(){KB.clear(),qB.length=0,JB.length=0,YB.clear()}globalThis.addEventListener?.(`dependency-review-changed`,()=>{tV(),eV()});function nV(){let e=L.managedSession?`${L.managedSession.id}\0${L.managedSession.role}`:null;return e!==ZB&&(tV(),ZB=e),KB}var rV=e=>e?.touchesLockfile===!0||e?.touchesLockfile===null,iV=e=>Number.isSafeInteger(e)&&e>=0?e:null,aV={git:`From git, which isn’t reviewed`,tarball:`A tarball not npm’s registry’s of its version, which isn’t reviewed`,integrity:`Locked with no integrity, which its reviews are held to`,unlocked:`Locked by none of the lockfiles read for it at its commit, so nothing holds its reviews to an integrity`},oV=new Set(Object.keys(aV)),sV=e=>e.error===`stasis-pending`,cV=e=>`${e.name}@${e.version??``}\0${e.patch?.hash??``}`;function lV(e){if(typeof e?.name!=`string`)return[];let{was:t,base:n,reviews:r,rejected:i,commented:a,reviewers:o,baseline:s,reviewed:c,unsupported:l,patch:u,unreached:d,...f}=e,p=dV(o);return[{...f,...Array.isArray(t)&&t.length>0&&t.every(e=>typeof e==`string`)?{was:t}:{},...typeof n?.name==`string`&&typeof n.version==`string`?{base:{name:n.name,version:n.version}}:{},...typeof u?.hash==`string`?{patch:{hash:u.hash,...li(u.path)?{path:u.path}:{}}}:{},...d===!0?{unreached:d}:{},...oV.has(l)?{unsupported:l}:s===!0?{baseline:s}:c===!0?{reviewed:c}:iV(r)===null?{}:{reviews:r,...i===!0?{rejected:i}:{},...iV(a)>0?{commented:a}:{},...p.length>0?{reviewers:p}:{}}}]}var uV=new Set([`accept`,`accept-with-nits`,`request-changes`,`reject`]),dV=e=>Array.isArray(e)?e.flatMap(e=>typeof e?.login==`string`&&uV.has(e.status)?[{login:e.login,status:e.status,...e.passes===!0?{passes:!0}:{},...e.comment===!0?{comment:!0}:{}}]:[]):[],fV=e=>Array.isArray(e)?e.flatMap(lV):[];function pV(e){if(!Array.isArray(e?.lockfiles))throw TypeError(`The server answered with no lockfiles.`);let t=e.lockfiles.filter(e=>Array.isArray(e?.paths)&&(Array.isArray(e.added)||typeof e.error==`string`)).map(e=>e.error?e:{...e,added:e.added.flatMap(lV),more:iV(e.more)??0,unreviewed:fV(e.unreviewed),moreUnreviewed:iV(e.moreUnreviewed)??0,unsupported:fV(e.unsupported),moreUnsupported:iV(e.moreUnsupported)??0,moreLocked:iV(e.moreLocked)??0}),n=e.review;return{lockfiles:t,cut:e.cut===!0,pending:t.some(sV),...typeof e.head==`string`&&/^[\da-f]{40}$/u.test(e.head)?{head:e.head}:{},...typeof e.formatted==`string`&&e.formatted.trim()!==``?{formatted:e.formatted}:{},...iV(n?.required)>0?{review:{required:n.required,since:typeof n.since==`string`?n.since:null,canReview:n.canReview===!0,...iV(n.toReview)===null?{}:{toReview:n.toReview},...iV(n.unreviewed)===null?{}:{unreviewed:n.unreviewed},...iV(n.unsupported)===null?{}:{unsupported:n.unsupported},...Array.isArray(n.baselineUnread)&&n.baselineUnread.every(e=>typeof e==`string`)?{baselineUnread:n.baselineUnread}:{},...n.reviewedDependencies===!0?{reviewedDependencies:!0}:{},...n.reviewedBases===!0?{reviewedBases:!0}:{},...iV(n.unasked)>0?{unasked:n.unasked}:{},...iV(n.commentReviews)>0?{commentReviews:n.commentReviews}:{},...n.commentsFailed===!0?{commentsFailed:!0}:{},...n.byComments===!0?{byComments:!0}:{},...typeof n.baselineError==`string`?{baselineError:n.baselineError}:{},...[`exclude`,`include`].includes(n.lockfiles?.mode)&&Array.isArray(n.lockfiles.paths)&&n.lockfiles.paths.every(e=>typeof e==`string`)?{lockfiles:{mode:n.lockfiles.mode,paths:n.lockfiles.paths}}:{}}}:{}}}function mV(){for(;QB<UB&&qB.length+JB.length>0;){let e=qB.shift()??JB.shift(),[t,n]=e.background?[JB,GB]:[qB,WB],r=[e];for(let i=0;i<t.length&&r.length<n;){let n=t[i];n.pull.repoId===e.pull.repoId&&n.review===e.review&&n.listed===e.listed?r.push(...t.splice(i,1)):i++}for(let e of r)YB.delete(e.key);QB++,gV(r).finally(()=>hV(r))}}function hV(e){QB--;for(let t of e)eV(t.pull);mV()}function gV(e){let[{pull:{repoId:t,number:n},review:r,listed:i}]=e;return e.length===1?Jb(t,n,{review:r,listed:i}).then(e[0].settle,e[0].settle):Yb(t,e.map(e=>e.pull.number),{review:r,listed:i}).then(t=>{for(let n of e)n.settle(t.get(n.pull.number)??Error(`The server answered with none of it.`));return null},t=>{for(let n of e)n.settle(t)})}function _V(e,t,n=!1,{background:r=!1,listed:i=!1}={}){let a=nV(),o=`${e}\0${t}\0${n}${i?`\0listed`:``}`,s=a.get(o);if(s&&Date.now()<s.until){let e=YB.get(o);return!r&&e?.background&&(JB.splice(JB.indexOf(e),1),e.background=!1,qB.push(e)),s}let c=s?.status===`ready`?{...s,until:1/0,refreshing:!0}:{status:`loading`,until:1/0};a.set(o,c);let l={key:o,background:r,review:n,listed:i,pull:{repoId:e,number:t},settle:n=>{if(a.get(o)!==c)return;let r=yV(n,s);r?a.set(o,r):a.delete(o),r?.pending&&vV({repoId:e,number:t})}};return YB.set(o,l),(r?JB:qB).push(l),mV(),c}var vV=e=>{setTimeout(()=>eV(e),HB).unref?.()};function yV(e,t){let n=e instanceof Error?e:null;if(!n)try{let t=pV(e);return{status:`ready`,until:Date.now()+(t.pending?HB:BB),...t}}catch(e){n=e}return n?.name===`AbortError`?t?.status===`ready`?t:null:{status:`error`,until:Date.now()+VB,error:n?.message||`Its lockfiles could not be read.`}}function bV(e,t,n=!1){let r=nV();for(let[i,a]of t){let t=`${e}\0${i}\0${n}`,o=YB.get(t);if(o){let e=o.background?JB:qB;e.splice(e.indexOf(o),1),YB.delete(t)}let s=yV(a,null);s&&r.set(t,s),s?.pending&&vV({repoId:e,number:i}),eV({repoId:e,number:i})}}function xV(e,t,n=!1){return nV().get(`${e}\0${t}\0${n}`)??null}var SV=new WeakMap;function CV(e,{lockfiles:t,review:n},r){let i=SV.get(t)??SV.set(t,new Map).get(t),a=i.get(e);if(a&&a.review===n)return a.value;let o=r();return i.set(e,{review:n,value:o}),o}function wV(e){return CV(`added`,e,()=>TV(e))}function TV({lockfiles:e,review:t}){let n=new Map;for(let r of e.flatMap(e=>e.added??[])){let e=cV(r),i=n.get(e);if(!i){n.set(e,r);continue}let{reviews:a,baseline:o,reviewed:s,unsupported:c,reviewers:l,base:u,...d}=i;n.set(e,{...d,...r.was||i.was?{was:[...new Set([...i.was??[],...r.was??[]])]}:{},...EV(i,r),...OV(i,r,t)})}let r=[...n.values()],i=r.filter(e=>!e.was);return{versions:[...i,...r.filter(e=>e.was)],fresh:i.length,updated:r.length-i.length,more:e.some(e=>e.more>0),toReview:t?.toReview??r.filter(e=>kV(e,t)===`wanted`).length}}var EV=(e,t)=>!e.patch?.path&&t.patch?.path?{patch:t.patch}:{},DV={unsupported:0,wanted:1,passed:2,baseline:3};function OV(e,t,n){let r=e=>DV[kV(e,n)]??4,{unsupported:i,baseline:a,reviewed:o,reviews:s,rejected:c,reviewers:l,base:u}=r(t)<r(e)||r(t)===r(e)&&(t.reviews??1/0)<(e.reviews??1/0)?t:e,d=Math.max(e.commented??0,t.commented??0);return{...u?{base:u}:{},...i?{unsupported:i}:a?{baseline:a}:o?{reviewed:o}:s==null?{}:{reviews:s,...c?{rejected:c}:{},...d>0?{commented:d}:{},...l?{reviewers:l}:{}}}}function kV(e,t){return t?e.unsupported?`unsupported`:e.baseline?`baseline`:e.reviewed?`passed`:e.reviews==null?null:e.reviews>=t.required&&!e.rejected?`passed`:`wanted`:null}function AV(e){return CV(`unreviewed`,e,()=>jV(e))}function jV({lockfiles:e,review:t}){let n=new Map;for(let t of e.flatMap(e=>e.unreviewed??[])){let e=cV(t),r=n.get(e);n.set(e,r?{...r,...EV(r,t)}:t)}return{versions:[...n.values()],count:t?.unreviewed??n.size+e.reduce((e,t)=>e+(t.moreUnreviewed??0),0)}}function MV(e){return CV(e.cut?`failures-cut`:`failures`,e,()=>NV(e))}function NV({lockfiles:e,cut:t,review:n}){if(!n)return null;let r=new Map;for(let t of e.flatMap(e=>e.unsupported??[])){let e=`${t.source}\0${t.name}@${t.version??``}\0${t.from??``}`;r.has(e)||r.set(e,t)}let i=t=>e.reduce((e,n)=>e+(n[t]??0),0),a={versions:[...r.values()],count:n.unsupported??r.size+i(`moreUnsupported`),unread:e.filter(e=>e.error&&!sV(e)),unchecked:i(`moreLocked`),cut:t};return a.count>0||a.unread.length>0||a.unchecked>0||t?a:null}var X=e=>M`<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true">${e}</svg>`,PV=N`<circle cx="8" cy="8" r="6.25"/>`,FV=N`<circle cx="4.5" cy="3.5" r="1.6"/><circle cx="4.5" cy="12.5" r="1.6"/><path d="M4.5 5.1v5.8"/><circle cx="11.5" cy="12.5" r="1.6"/>`,IV={issues:{open:X(N`${PV}<circle class="fill" cx="8" cy="8" r="1.6"/>`),completed:X(N`${PV}<path d="M5.4 8.3l1.8 1.8 3.4-3.7"/>`),"not-planned":X(N`${PV}<path d="M3.9 12.1l8.2-8.2"/>`)},pulls:{open:X(N`${FV}<path d="M11.5 10.9V6.5a2 2 0 0 0-2-2H7.4M8.9 3 7.4 4.5 8.9 6"/>`),draft:X(N`${FV}<path class="dotted" d="M11.5 10.9V4"/>`),merged:X(N`<circle cx="4.5" cy="3.5" r="1.6"/><circle cx="4.5" cy="12.5" r="1.6"/><path d="M4.5 5.1v5.8M4.5 5.1c0 2.4 2.4 3.4 5.4 3.4"/><circle cx="11.5" cy="8.5" r="1.6"/>`),closed:X(N`${FV}<path d="M9.6 3.1l3.8 3.8M13.4 3.1 9.6 6.9"/>`)}},LV=X(N`<path d="M2.6 3.2h10.8v7.3H8l-3.2 2.6v-2.6H2.6z"/>`),RV={success:[`Checks passed`,X(N`<path d="M3.5 8.4l2.9 2.9 6.1-6.6"/>`)],failure:[`Checks failed`,X(N`<path d="M4.2 4.2l7.6 7.6M11.8 4.2l-7.6 7.6"/>`)],pending:[`Checks running`,X(N`<circle class="fill" cx="8" cy="8" r="3"/>`)]},zV={approved:[`Approved`,X(N`${PV}<path d="M5.4 8.3l1.8 1.8 3.4-3.7"/>`)],changes:[`Changes requested`,X(N`<path d="M3.75 1.75h5.5l3 3v9.5h-8.5z"/><path d="M8 4.5v4M6 6.5h4M6 11h4"/>`)],required:[`Review required`,X(N`<path d="M1.25 8S3.75 3.5 8 3.5 14.75 8 14.75 8 12.25 12.5 8 12.5 1.25 8 1.25 8z"/><circle cx="8" cy="8" r="2"/>`)]},BV=X(N`<circle cx="4" cy="3.5" r="1.5"/><circle cx="4" cy="12.5" r="1.5"/><circle cx="12" cy="12.5" r="1.5"/><path d="M4 5v6M12 11V6a2 2 0 0 0-2-2H7m1.5-1.5L7 4l1.5 1.5"/>`),VV=X(N`<circle cx="4" cy="3" r="1.5"/><circle cx="4" cy="13" r="1.5"/><circle cx="12" cy="3" r="1.5"/><path d="M4 4.5v7m0-3h3a5 5 0 0 0 5-4"/>`),HV=X(N`<circle cx="8" cy="8" r="3"/><path d="M1 8h4m6 0h4"/>`),UV=X(N`<path d="M8 1.75 2.25 4.5v7L8 14.25l5.75-2.75v-7z"/><path d="M2.25 4.5 8 7.25l5.75-2.75M8 7.25v7"/>`);function WV(e,t){return e===`pulls`?t.state===`merged`?[`merged`,`Merged`]:t.state===`closed`?[`closed`,`Closed`]:t.draft?[`draft`,`Draft`]:[`open`,`Open`]:t.state===`open`?[`open`,`Open`]:t.reason===`not-planned`||t.reason===`duplicate`?[`not-planned`,t.reason===`duplicate`?`Closed as duplicate`:`Closed as not planned`]:[`completed`,`Closed`]}var GV={claude:M`<span class="agent-logo" aria-hidden="true">${Hy(`anthropic`)}</span>`,codex:M`<span class="agent-logo" aria-hidden="true">${Hy(`openai`)}</span>`,copilot:M`<span class="agent-logo" aria-hidden="true">${Hy(`github-copilot`)}</span>`},KV={claude:`Claude`,codex:`Codex`},qV=new Map;function JV(e){for(let t of e)qV.set(t.id,t)}var YV=e=>KV[e]??qV.get(e)?.name??e;function XV(e){if(GV[e])return GV[e];let t=qV.get(e)?.avatar;return t?M`<img class="agent-avatar" src="${`/api/avatar/${t}`}" alt="" width="14" height="14" loading="lazy" decoding="async">`:P}var ZV=e=>e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;function QV(e){return e.sessions[0]?`https://claude.ai/code/${e.sessions[0]}`:e.tasks[0]?`https://chatgpt.com/codex/tasks/${e.tasks[0]}`:null}function $V(e,t){return t?e.pulls[0]?`https://github.com/${t}/pull/${e.pulls[0].number}`:e.commits[0]?`https://github.com/${t}/commit/${e.commits[0].oid}`:e.branches[0]?eH(t,e.branches[0]):null:null}function eH(e,t){let[n,r]=t.includes(`:`)?[t.slice(0,t.indexOf(`:`)),t.slice(t.indexOf(`:`)+1)]:[null,t],i=r.split(`/`).map(encodeURIComponent).join(`/`);return n?`https://github.com/${encodeURIComponent(n)}/${encodeURIComponent(e.split(`/`)[1]??``)}/tree/${i}`:`https://github.com/${e}/tree/${i}`}var tH=(e,t)=>QV(e)??$V(e,t),nH=`100% 0px`,rH=new WeakMap,iH=new WeakMap,aH=[],oH=!1,sH=new WeakMap;function cH(e){let t=sH.get(e);if(t===void 0){let n=getComputedStyle(e).overflowY;t=n===`auto`||n===`scroll`||n===`overlay`,sH.set(e,t)}return t}function lH(e){let t=e.parentNode;for(;t;)if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE)t=t.host??null;else{if(t.nodeType!==Node.ELEMENT_NODE||t===document.documentElement)return null;if(cH(t))return t;t=t.parentNode}return null}function uH(e){for(let t of e)iH.get(t.target)?.cb(t.isIntersecting)}function dH(e){let t=e??document,n=rH.get(t);return n||(n=new IntersectionObserver(uH,{root:e,rootMargin:nH,threshold:0}),rH.set(t,n)),n}function fH(e,t){let n=iH.get(e);n?.io&&n.io.unobserve(e),iH.set(e,{cb:t,io:null}),aH.push(e),oH||(oH=!0,queueMicrotask(pH))}function pH(){oH=!1;let e=aH;aH=[];for(let t of e){let e=iH.get(t);!e||e.io||(e.io=dH(lH(t)),e.io.observe(t))}}function mH(e){let t=iH.get(e);t&&(t.io?.unobserve(e),iH.delete(e))}var hH=2,gH=50,_H=6e3,vH=6e4,yH=new Map,bH=new Map,xH=[],SH=new Set,CH=null,wH=0,TH=!1,EH=e=>{for(let t of SH)t(e)};function DH(){let e=L.managedSession?`${L.managedSession.id}\0${L.managedSession.role}`:null;return e!==CH&&(yH.clear(),bH.clear(),xH.length=0,CH=e),yH}var OH=e=>Number.isSafeInteger(e)&&e>=0?e:null,kH=e=>OH(e?.additions)===null||OH(e?.deletions)===null?null:{additions:e.additions,deletions:e.deletions},AH=(e,t)=>({status:`ready`,until:1/0,...e,typeless:kH(t.typeless),binary:t.binary===!0}),jH=e=>({status:`error`,until:Date.now()+vH,error:e});function MH(e,t,n){let r=DH(),i=`${e}\0${t}\0${n}`,a=r.get(i);if(a&&Date.now()<a.until)return a;let o={status:`loading`,until:1/0};return r.set(i,o),bH.set(i,{asked:[e,t,n],loading:o}),TH||(TH=!0,globalThis.requestAnimationFrame?requestAnimationFrame(PH):setTimeout(PH,0)),o}function NH(e){let t=DH();for(let[n,r,i,a]of e){let e=kH(a),o=`${n}\0${r}\0${i}`;!e||t.get(o)?.status===`ready`||(bH.delete(o),t.set(o,AH(e,a)),EH(o))}}function PH(){TH=!1;let e=0,t=[];for(let[n,r]of bH){let i=encodeURIComponent(JSON.stringify(r.asked)).length+3;(t.length===gH||t.length>0&&e+i>_H)&&(xH.push(t),t=[],e=0),t.push({key:n,...r}),e+=i}t.length>0&&xH.push(t),bH.clear(),FH()}function FH(){for(;wH<hH&&xH.length>0;){let e=xH.shift().filter(({key:e,loading:t})=>yH.get(e)===t);e.length!==0&&(wH++,LH(e).finally(IH))}}function IH(){wH--,FH()}function LH(e){let t=yH,n=new Map(e.map(({key:e,loading:t})=>[e,t])),r=(e,r)=>{n.has(e)&&(t.get(e)===n.get(e)&&(r?t.set(e,r):t.delete(e)),n.delete(e),EH(e))};return ex(e.map(e=>e.asked),e=>{let t=kH(e);r(`${e.name}\0${e.version}\0${e.otherVersion}`,typeof e.error==`string`?jH(e.error):t?AH(t,e):jH(`The server answered with no lines.`))}).then(()=>{for(let e of[...n.keys()])r(e,jH(`The server answered with none of it.`));return null},e=>{for(let t of[...n.keys()])r(t,e?.name===`AbortError`?null:jH(e?.message||`Its lines couldn’t be counted.`))})}function RH(e,t){if(t?.reviewedBases)return e.base??null;let n=e.patch&&e.was?.includes(e.version)?e.version:e.was?.find(t=>t!==e.version);return n?{name:e.name,version:n}:null}var zH=(e,t)=>M`<span class="is-added">+${e.toLocaleString(`en-US`)}</span> <span class="is-deleted">−${t.toLocaleString(`en-US`)}</span>`,BH=class extends Ca{static properties={name:{attribute:!1},version:{attribute:!1},base:{attribute:!1}};createRenderRoot(){return this}constructor(){super(),this._near=!1,this._notify=e=>{this._near&&(!e||e===`${this.name}\0${this.version}\0${this.base??`(empty)`}`)&&this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this._watch()}disconnectedCallback(){super.disconnectedCallback(),this._unwatch()}_watch(){SH.add(this._notify),!this._near&&fH(this,e=>{!e||this._near||(this._near=!0,mH(this),this.requestUpdate())})}_unwatch(){SH.delete(this._notify),mH(this)}render(){if(!this._near||!this.name||!this.version)return P;let e=MH(this.name,this.version,this.base??`(empty)`),t=this.base&&this.base!==`(empty)`?`against ${this.base}`:`the whole package`;if(e.status===`loading`)return M`<span class="npm-delta is-loading" aria-label="Counting its lines">…</span>`;if(e.status===`error`)return M`<span class="npm-delta is-error" data-tooltip="${e.error}" .tooltipContent="${M`<div class="compare-tip"><div class="compare-tip-head">Lines not counted</div><div>${e.error}</div></div>`}">?</span>`;let n=M`<div class="compare-tip"><div class="compare-tip-head">Lines changed</div><div class="compare-tip-rows"><span class="compare-tip-label">Against</span><span>${this.base&&this.base!==`(empty)`?this.base:`none, the whole package`}</span> <span class="compare-tip-label">Added</span><span class="is-added">+${e.additions.toLocaleString(`en-US`)}</span> <span class="compare-tip-label">Removed</span><span class="is-deleted">−${e.deletions.toLocaleString(`en-US`)}</span> ${e.typeless?M`<span class="compare-tip-label">Types aside</span><span>${zH(e.typeless.additions,e.typeless.deletions)}</span>`:P}</div>${e.typeless?M`<div class="compare-tip-note">Types aside: leaving out the declaration files changed in types alone</div>`:P} ${e.binary?M`<div class="compare-tip-note">Binary files changed too, which no line counts</div>`:P}</div>`;return M`<span class="npm-delta" data-tooltip="${`Lines it adds and removes, ${t}`}" .tooltipContent="${n}">${zH(e.additions,e.deletions)}${e.binary?M`<span class="npm-delta-binary">, binary</span>`:P}${e.typeless?M`<span class="npm-delta-typeless">(${zH(e.typeless.additions,e.typeless.deletions)} -types)</span>`:P}</span>`}};customElements.get(`npm-delta`)||customElements.define(`npm-delta`,BH);var VH=class extends Ca{static properties={text:{attribute:!1},label:{attribute:!1},_copied:{state:!0},_error:{state:!0}};createRenderRoot(){return this}constructor(){super(),this.text=null,this.label=`Copy dependency review`}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this._timer)}async _copy(){if(this._copyable()){this._error=!1;try{await navigator.clipboard.writeText(this.text),this._copied=!0,clearTimeout(this._timer),this._timer=setTimeout(()=>{this._copied=!1},2e3)}catch{this._error=!0}}}_copyable(){return typeof this.text==`string`&&this.text.trim()!==``}render(){return this._copyable()?M`<button type="button" class="${`bundle-code-copy-path dependency-review-copy-button${this._copied?` copied`:``}`}" aria-label="${this.label}" data-tooltip="${this.label}" @click="${()=>this._copy()}">${Ww}</button> ${this._error?M`<span role="alert">Could not copy to the clipboard.</span>`:P}`:P}};customElements.define(`dependency-review-copy`,VH);var HH=12e4,UH=3e4,WH=3,GH=12,KH=48,qH=3,JH=[[`pulls`,`Pull requests`],[`versions`,`Versions`],[`branch`,`Default branch`],[`reviews`,`Reviews`]],YH=(e,t)=>e.repo.name<t.repo.name?-1:e.repo.name>t.repo.name?1:t.item.number-e.item.number,XH=e=>(t,n)=>(n.item[e]??0)-(t.item[e]??0)||YH(t,n),ZH=(e,t)=>+(e.size===0)-(t.size===0)||e.size-t.size||e.others-t.others||YH(e,t),QH={newest:[`Newest`,XH(`createdAt`)],updated:[`Updated`,XH(`updatedAt`)],fewest:[`Fewest to review`,ZH]},$H={status:`loading`,until:1/0};function eU(e,t){let n=xV(e,t,!0);return n?.pending?_V(e,t,!0,{background:!0}):n??$H}var tU=50,nU=new Map,rU=new Set,iU=new Map,aU=new Map,oU=null,sU=!1,cU=()=>{for(let e of rU)e()};function lU(){nU.clear();for(let e of iU.keys())e.abort();iU.clear()}function uU(){sU||(sU=!0,queueMicrotask(()=>{sU=!1;let e=new Set(aU.values());for(let[t,n]of iU)e.has(n)||t.abort()}))}globalThis.addEventListener?.(`dependency-review-changed`,()=>{lU(),cU()});function dU(){let e=L.managedSession?`${L.managedSession.id}\0${L.managedSession.role}`:null;return e!==oU&&(lU(),oU=e),nU}function fU(e,t){let n=dU(),r=[],i=t.map(e=>{let t=n.get(e);if(t&&Date.now()<t.until)return t;let i=t?.status===`ready`?{...t,until:1/0,telling:null,refreshing:!0}:{status:`loading`,until:1/0};return n.set(e,i),r.push(e),i});return r.length>0&&pU(e,r,r.length===t.length?null:r,WH),i}function pU(e,t,n,r){let i=nU,a=new Map(t.map(e=>[e,i.get(e)])),o=(e,t)=>{i.get(e)===a.get(e)&&i.set(e,t),i.get(e)===t&&t.telling?a.set(e,t):a.delete(e)},s=new AbortController;iU.set(s,e);let c=null;$b(e,e=>{s.signal.aborted||(typeof e.done==`boolean`?c=e.done?[]:Array.isArray(e.unread)?e.unread:[]:a.has(e.repoId)&&(mU(e,a.get(e.repoId),t=>o(e.repoId,t)),cU()))},{repoIds:n,signal:s.signal}).then(()=>{let t=(c??[]).filter(e=>a.has(e)),n=t.length>0&&r>0;for(let[e,r]of[...a])n&&t.includes(e)||o(e,gU(e,r,c===null?`The server’s answer ended short.`:t.includes(e)?`Reading its pull requests took too long.`:null));return n&&pU(e,t,t,r-1),null},e=>{for(let[t,n]of[...a])e?.name===`AbortError`?i.get(t)===n&&(n.status===`ready`?i.set(t,{...n,until:0,telling:null}):i.delete(t)):o(t,gU(t,n,e?.message||`It couldn’t be read.`))}).finally(()=>{iU.delete(s),cU()})}function mU(e,t,n){if(Array.isArray(e.deltas)&&NH(e.deltas),typeof e.error==`string`)n({status:`error`,until:Date.now()+UH,error:e.error});else if(e.branch===null)n({status:`ready`,until:Date.now()+HH,branch:null});else if(e.branch){let t;try{t=pV(e.branch)}catch(e){n({status:`error`,until:Date.now()+UH,error:e.message});return}let r=(Array.isArray(e.pulls?.items)?e.pulls.items:[]).filter(e=>Number.isSafeInteger(e?.number)&&e.number>0),i=typeof e.pulls?.error==`string`&&e.pulls.error?{error:e.pulls.error}:{};n(hU({status:`ready`,branch:t,pulls:{items:r,more:e.pulls?.more===!0,...i},...t.pending?{pending:!0}:{}},new Set(r.filter(rV).map(e=>e.number))))}else e.dependencies instanceof Map&&t.telling&&(bV(e.repoId,e.dependencies,!0),n(hU(t,new Set([...t.telling].filter(t=>!e.dependencies.has(t))))))}function hU(e,t){if(t.size>0)return{...e,until:1/0,telling:t};let n=e.pulls?.error||e.pending?UH:HH;return e.pending&&setTimeout(cU,n+tU).unref?.(),{...e,until:Date.now()+n,telling:null}}function gU(e,t,n){return t.telling?(bV(e,new Map([...t.telling].map(e=>[e,Error(n??`The server’s answer ended short.`)])),!0),{...t,until:Date.now()+UH,telling:null}):n?{status:`error`,until:Date.now()+UH,error:n}:{status:`ready`,until:Date.now()+HH,branch:null}}var _U=(e,t)=>`${e.toLocaleString(`en-US`)} ${t}${e===1?``:`s`}`,vU=({repo:e,item:t})=>`${e.name}#${t.number}`,yU=()=>L.managedSession?.login?.toLowerCase()??null,bU=e=>e.login.toLowerCase()===yU();function xU(e,t){let n=kV(e,t);return n===`unsupported`?{label:`can’t review`,tint:`is-failed`,said:aV[e.unsupported]}:e.rejected?{label:`rejected`,tint:`is-failed`,said:`A reviewer rejects it: it wants their newer accepting review`}:n===`wanted`?{label:`${e.reviews}/${t.required}`,tint:`is-wanted`,said:`${_U(e.reviews,`review`)} of ${t.required} required${e.commented?`; ${_U(e.commented,`reviewer`)} in its comments, which count here alone`:``}`}:null}function SU(e,t){let n=xU(e,t);return!n||n.tint===`is-wanted`&&e.reviews===0?P:M`<span class="team-deps-review ${n.tint}">${n.label}</span>`}var CU={accept:`accepts`,"accept-with-nits":`accepts with nits`,"request-changes":`requests changes`,reject:`rejects`},wU=new Set([`accept`,`accept-with-nits`]),TU=(e,t)=>({passed:`passes`,baseline:`needs none`})[kV(e,t)]??xU(e,t)?.label??null,EU=e=>new Map((e.reviewers??[]).flatMap(e=>e.passes?[[`+${e.login.toLowerCase()}`,e]]:e.status===`reject`?[[`-${e.login.toLowerCase()}`,e]]:[]));function DU(e,t){let n=new Map;for(let t of e)for(let e of t.wanted){let r=EU(e);(n.get(cV(e))??n.set(cV(e),[]).get(cV(e))).push({pull:t,has:r,alike:[...r.keys()].toSorted().join(`\0`)})}let r=(e,t)=>!e||t.has.size>e.has.size||t.has.size===e.has.size&&t.pull.left<e.pull.left?t:e,i=new Map;for(let[e,a]of n){let n=new Map;for(let{pull:r,pkg:i}of t.get(e)?.values()??[])for(let[e,t]of EU(i))t.comment&&(n.get(e)??n.set(e,{login:t.login,status:t.status,pulls:[]}).get(e)).pulls.push(r);let o=new Map,s=new Map,c=null;for(let e of a){let{pull:t,has:i,alike:a}=e,l=i.size>0?[...n].filter(([e])=>!i.has(e)).map(([,e])=>e):[];l.length===0?(!s.has(a)||t.left<s.get(a).pull.left)&&s.set(a,e):(o.set(vU(t),{lacks:l}),c=r(c,e))}let l=[...s.values()].filter(({has:e})=>e.size>0).reduce(r,null)??c;for(let{pull:e,alike:t}of a){if(o.has(vU(e)))continue;let n=(t===``&&l?l:s.get(t)).pull;o.set(vU(e),e===n?{}:{under:n})}i.set(e,o)}return i}var OU=e=>(e.reviews??0)>0||e.rejected===!0,kU=e=>(e.unreached?2:0)+ +!OU(e),AU=(e,t=e=>e)=>e.toSorted((e,n)=>kU(t(e))-kU(t(n))),jU=(e,t=e.length-1)=>`${e[0]}${t>0?` +${t}`:``}`,MU=`by its lockfile alone: the stasis.config.json beside it reaches it by no entry`;function NU(e,t,{added:n,under:r,lacks:i,involved:a,here:o}){let s=xU(e,t),c=[n?[`Present`,e.was?.join(`, `)||`none, new`]:null,e.source!==`registry`&&e.from?[`From`,e.from]:null,e.patch?[`Patched`,e.patch.path??`by a patch whose file isn’t known, which reviews here can’t read`]:null,e.unreached?[`Asked for`,MU]:null,s?[`Review`,s.said??s.label]:null,r?[`Listed`,`under ${r}`]:null,i.length>0?[`Lacks`,i.map(e=>`${bU(e)?`your`:`${e.login}\u2019s`} review in ${e.where.join(`, `)}`).join(`; `)]:null].filter(Boolean),l=new Map;for(let{name:t,pkg:n}of[{name:o,pkg:e},...a])for(let e of n.reviewers??[]){if(e.comment&&!t)continue;let n=e.comment?`${e.login}\0${t}`:e.login;l.has(n)||l.set(n,{...e,where:e.comment?t:null})}return M`<div class="compare-tip"><div class="team-deps-tip-name">${e.name}${e.version?`@${e.version}`:``}${e.patch?` (patched)`:``}</div>${c.length>0?M`<div class="compare-tip-rows">${c.map(([e,t])=>M`<span class="compare-tip-label">${e}</span><span>${t}</span>`)}</div>`:P} ${a.length>0?M`<div class="compare-tip-head">Pull requests</div><div class="compare-tip-rows">${a.map(({name:e,adds:t,pkg:n,review:r})=>M`<span class="${e===o?`team-deps-tip-here`:P}">${e}</span> <span>${[t?`adds it`:`locks it`,TU(n,r)].filter(Boolean).join(`, `)}</span>`)}</div>`:P} ${l.size>0?M`<div class="compare-tip-head">Reviewed by</div><div class="compare-tip-rows">${[...l.values()].map(e=>M`<span>${e.login}</span> <span>${CU[e.status]}${wU.has(e.status)&&!e.passes?`, not counted`:``}${e.where?`, in ${e.where}\u2019s comments`:``}</span>`)}</div>`:P}</div>`}function PU(e,t,{others:n=[],adders:r=!1,elsewhere:i=[],under:a=null,lacks:o=[],lacking:s=[],added:c=!1,involved:l=[],here:u=null,repoId:d=null,head:f=null}={}){let p=e.source===`registry`&&e.version,m=RH(e,t),h=e.patch?.path&&d&&f?{hash:e.patch.hash,repoId:d,commit:f,path:e.patch.path}:null,g=t?.canReview&&(!e.patch||h)&&kV(e,t)!==`unsupported`,_=p?mi({view:`npm`,packageName:e.name,packageSpec:e.version,...g?{bundleTab:`review`,...m?{reviewPackage:m.name,reviewSpec:m.version}:{},...h?{patch:h}:{}}:{}}):null,v=`${e.name}${e.version?`@${e.version}`:``}${e.patch?` (patched)`:``}`,y=NU(e,t,{added:c,under:a,lacks:o,involved:l,here:u}),b=i.filter(e=>!s.includes(e)),x=r?n.filter(e=>!i.includes(e)&&!s.includes(e)):n,S=M`${He(e.ecosystem)}<span class="team-deps-name">${e.name}${e.version?M`<span class="team-deps-version">@${e.version}</span>`:P}</span> ${e.patch?M`<span class="team-deps-patched">patched</span>`:P} ${e.unreached?M`<span class="team-deps-unreached" role="img" aria-label="${`Asked for ${MU}`}">!</span>`:P} ${p&&!e.patch&&kV(e,t)===`wanted`&&(!m||m.name===e.name)?M`<npm-delta .name="${e.name}" .version="${e.version}" .base="${m?.version??`(empty)`}"></npm-delta>`:P} ${SU(e,t)} ${a?M`<span class="team-deps-under">${a}</span>`:P} ${s.length>0?M`<span class="team-deps-lacks">${jU(s)}</span>`:P} ${b.length>0?M`<span class="team-deps-elsewhere">${jU(b)}</span>`:P} ${x.length>0?M`<span class="team-deps-also">${r?jU(x):`+${n.length}`}</span>`:P}`,ee=o.length>0?` is-behind`:``;return M`<li>${_?M`<a class="team-deps-row${ee}" href="${_}" target="_blank" rel="noopener noreferrer" data-tooltip="${v}" .tooltipContent="${y}">${S}</a>`:M`<span class="team-deps-row${ee}" data-tooltip="${v}" .tooltipContent="${y}">${S}</span>`}</li>`}var FU=e=>({repoId:e.repo.repoId,head:e.entry.head??null}),IU=X(N`<path d="m6 4 4 4-4 4"/>`),LU=class extends eg{static properties={repositories:{attribute:!1},team:{attribute:!1},_open:{state:!0}};createRenderRoot(){return this}constructor(){super(),this.repositories=[],this.team=null,this._open=new Set,this._notify=()=>this.requestUpdate()}pick(e,{push:t=!0}={}){L.teamDependenciesTab=e;let n=xi({view:`workspace-dependencies`,teamId:this.team,dependencyTab:e},L.managedTeams);t?q?.pushRoute(n):q?.replaceRoute(n)}updated(){this._shown&&this._shown!==L.teamDependenciesTab&&this.pick(this._shown,{push:!1})}toggle(e){let t=new Set(this._open);t.delete(e)||t.add(e),this._open=t}connectedCallback(){super.connectedCallback(),rU.add(this._notify),this._unsubscribe=$B(this._notify),aU.set(this,this.team)}disconnectedCallback(){super.disconnectedCallback(),rU.delete(this._notify),this._unsubscribe?.(),aU.delete(this),uU()}open(e,{repo:t,item:n}){e.preventDefault(),ye({repository:{repoId:t.repoId,repo:t.name},target:{number:n.number,preview:{...n,kind:`pulls`}}})}rows(e,t,n,r=GH,i=!1){if(t.length===0)return P;let a=this._open.has(e);return M`<ul class="team-deps-versions${i?` is-same`:``}">${(a?t:t.slice(0,r)).map(n)}</ul>${t.length>r?M`<button type="button" class="team-deps-more" aria-expanded="${String(a)}" @click="${()=>this.toggle(e)}">${IU}${a?`Show fewer`:`and ${(t.length-r).toLocaleString(`en-US`)} more`}</button>`:P}`}disclosed(e,t,n,r,i=0){let a=this._open.has(e);return M`<div class="team-deps-disclosed"><button type="button" class="team-deps-more" aria-expanded="${String(a)}" @click="${()=>this.toggle(e)}">${IU}${t}</button> ${a?M`${this.rows(e,n,r,KH)}${i>0?M`<p class="team-deps-quiet">and ${i.toLocaleString(`en-US`)} more, not listed</p>`:P}`:P}</div>`}render(){this.isConnected&&aU.get(this)!==this.team&&(aU.has(this)&&uU(),aU.set(this,this.team));let e=[...new Map((this.repositories??[]).map(e=>[e.repoId,e])).values()],t=fU(this.team,e.map(e=>e.repoId)),n=e.map((e,n)=>({repo:e,read:t[n]})),r=n.filter(({read:e})=>e.status===`ready`&&e.branch),i=r.flatMap(({repo:e,read:t})=>t.pulls.items.filter(rV).map(t=>({repo:e,item:t,entry:eU(e.repoId,t.number)}))),a=i.filter(({entry:e})=>e.status===`ready`&&e.review).map(e=>{let{review:t}=e.entry,n=wV(e.entry).versions.filter(e=>[`wanted`,`unsupported`].includes(kV(e,t))),r=n.filter(e=>kV(e,t)===`wanted`),i=Math.max(t.toReview??r.length,r.length),a=i-r.length;return{...e,wanted:n,failed:MV(e.entry),toReview:i,untold:a,size:n.length+a,left:r.reduce((e,n)=>e+Math.max(1,t.required-n.reviews),a*t.required),others:AV(e.entry).count}}).filter(e=>e.size>0||e.others>0||e.failed).toSorted(ZH),o=Object.hasOwn(QH,L.teamDependenciesSort)?L.teamDependenciesSort:`newest`,s=o===`fewest`?a:a.toSorted(QH[o][1]),c=r.filter(({read:e})=>e.pulls.more&&!e.pulls.error),l=r.filter(({read:e})=>e.pulls.error),u=new Map;for(let e of a)for(let t of e.wanted){let n=u.get(cV(t))??u.set(cV(t),{pkg:t,pulls:[],told:[]}).get(cV(t));n.pulls.push(e),n.told.push(t),!n.patched&&t.patch?.path&&(n.patched={patch:t.patch,pull:e})}let d=n.some(({read:e})=>e.status===`loading`)||i.some(({entry:e})=>e.status===`loading`),f=i.some(({entry:e})=>e.pending)||r.some(({read:e})=>e.branch.pending),p=[...n.filter(({read:e})=>e.status===`error`).map(({repo:e,read:t})=>[e.name,t.error]),...l.map(({repo:e,read:t})=>[e.name,t.pulls.error]),...i.filter(({entry:e})=>e.status===`error`).map(e=>[vU(e),e.entry.error])],m=r.flatMap(({repo:e,read:t})=>{let{count:n}=AV(t.branch),r=MV(t.branch);return n>0||r||t.branch.pending?[{repo:e,read:t,count:n+(r?.count??0)}]:[]}),h=new Map;for(let e of i.filter(({entry:e})=>e.status===`ready`&&e.review))for(let[t,n]of[[!0,wV(e.entry).versions],[!1,AV(e.entry).versions]])for(let r of n){let n=h.get(cV(r))??h.set(cV(r),new Map).get(cV(r));n.has(vU(e))||n.set(vU(e),{pull:e,pkg:r,adds:t})}let g=new Set(n.filter(({read:e})=>e.status!==`ready`||e.branch).map(({repo:e})=>e.name.split(`/`)[0])).size===1?e=>e.slice(e.indexOf(`/`)+1):e=>e,_=e=>g(vU(e)),v=e=>[...h.get(cV(e))?.values()??[]].map(({pull:e,pkg:t,adds:n})=>({name:_(e),adds:n,pkg:t,review:e.entry.review})),y=(e,t=null)=>[...h.get(cV(e))?.values()??[]].filter(e=>e.pkg.commented>0&&(!t||vU(e.pull)!==vU(t))).map(e=>_(e.pull)),b=DU(a,h),x=(e,t)=>{let{under:n=null,lacks:r=[]}=b.get(cV(e))?.get(vU(t))??{};return{under:n&&_(n),lacks:r.map(e=>({login:e.login,status:e.status,where:e.pulls.map(_)}))}},S={elsewhere:y,named:_,shorten:g,among:v,standing:x},ee=s.map(e=>{let t=AU(e.wanted.filter(t=>x(t,e).under)),n=AU(e.wanted.filter(e=>!t.includes(e)));return{pull:e,listed:n,same:t,lacking:n.filter(t=>x(t,e).lacks.length>0).length,covered:n.length===0&&t.length>0&&e.untold===0&&!e.failed}}),C=ee.reduce((e,t)=>e+t.lacking,0),te=p.map(([e,t])=>`${g(e)}: ${t}`),ne=L.teamDependenciesTab,re=JH.filter(([e])=>e!==`branch`||m.length>0||d&&ne===`branch`),ie=re.some(([e])=>e===ne)?ne:`pulls`;this._shown=ie;let ae={pulls:a.length,versions:u.size,branch:m.reduce((e,{count:t})=>e+t,0)};return M`<div class="team-deps">${SS({tabs:re.map(([e,t])=>({id:e,label:M`${t}${ae[e]==null||d&&ae[e]===0?P:M`<span class="team-deps-tab-n">${ae[e].toLocaleString(`en-US`)}</span>`}`})),current:ie,prefix:`team-deps`,select:e=>this.pick(e)})}<div class="team-deps-panel" role="tabpanel" id="${`team-deps-panel-${ie}`}" aria-labelledby="${`team-deps-tab-${ie}`}">${ie===`reviews`?QR(()=>M`<dependency-review-list .session="${L.managedSession}" .team="${this.team}"></dependency-review-list>`):M`<div class="team-deps-bar">${d?M`<p class="team-deps-quiet" role="status">Reading their pull requests…</p>`:f?M`<p class="team-deps-quiet" role="status">Stasis is still working out what some <code>stasis.config.json</code> entries reach; they are asked again as it does.</p>`:P} ${te.length===1?M`<p class="team-deps-quiet" data-tooltip="${te[0]}" role="alert">${te[0]}</p>`:te.length>1?M`<p class="team-deps-quiet" role="alert" data-tooltip="${te.join(`
|
|
196
196
|
`)}" .tooltipContent="${M`<div class="compare-tip"><div class="compare-tip-head">Couldn’t be read</div><div class="compare-tip-rows">${p.map(([e,t])=>M`<span>${g(e)}</span><span>${t}</span>`)}</div></div>`}">${_U(te.length,`repository or pull request`)} couldn’t be read.</p>`:P} ${ie===`pulls`&&C>0?M`<p class="team-deps-quiet team-deps-key">${_U(C,`version`)} ${C===1?`lacks`:`lack`} reviews made elsewhere</p>`:P} ${ie===`pulls`&&r.length>0&&s.length>1?M`<span class="bundles-overview-sort" role="group" aria-label="Pull request order">${Object.entries(QH).map(([e,[t]])=>M`<button type="button" aria-pressed="${String(e===o)}" @click="${()=>{L.teamDependenciesSort=e}}">${t}</button>`)}</span>`:P}</div>${!d&&n.length>0&&r.length===0&&p.length===0?M`<p class="workspace-content-empty">None of this team’s repositories reviews its dependencies for you.</p>`:P} ${ie===`branch`?P:c.map(({repo:e,read:t})=>M`<p class="team-deps-quiet" role="alert">Only ${g(e.name)}’s ${_U(t.pulls.items.length,`open pull request`)} updated latest are checked; its others aren’t.</p>`)} ${r.length===0?P:ie===`pulls`?this.renderPulls(ee,u,d||f,c.length+l.length>0,S):ie===`versions`?this.renderVersions(u,d||f,S):m.map(({repo:e,read:t})=>this.renderBranch(e,t,S))}`}</div></div>`}renderPulls(e,t,n,r,{elsewhere:i,named:a,among:o,standing:s}){if(e.length===0)return n?P:M`<p class="workspace-content-empty">No open pull request${r?` checked`:``} wants its dependencies reviewed.</p>`;let c=e=>n=>{let{under:r,lacks:i}=s(n,e);return PU(n,e.entry.review,{others:(t.get(cV(n))?.pulls??[]).map(a).filter(t=>t!==a(e)&&t!==r),under:r,lacks:i,added:!0,involved:o(n),here:a(e),...FU(e)})},l=({pull:e,listed:t,same:n,covered:r})=>{let l=vU(e),u=AV(e.entry),d=`https://github.com/${e.repo.name}/pull/${e.item.number}`,f=!r||this._open.has(`${l}:covered`);return M`<li class="team-deps-pull${r?` is-covered`:``}"><div class="team-deps-pull-top">${r?M`<button type="button" class="team-deps-fold" aria-expanded="${String(f)}" aria-label="${`${a(e)}\u2019s versions`}" @click="${()=>this.toggle(`${l}:covered`)}">${IU}</button>`:P}<a class="team-deps-pull-head" href="${d}" target="_blank" rel="noopener noreferrer" @click="${t=>this.open(t,e)}"> <span class="team-deps-pull-name">${a(e)}</span><span class="team-deps-pull-title">${e.item.title||`(no title)`}</span> ${r?M`${e.others>0?M`<span class="team-deps-count is-wanted">${e.others.toLocaleString(`en-US`)} ${e.others===1?`other`:`others`} unreviewed</span>`:P} <span class="team-deps-under">${jU([...new Set(n.map(t=>s(t,e).under))])}</span>`:e.failed?M`<span class="team-deps-count is-failed">review fails</span>`:e.size===0?M`<span class="team-deps-count is-wanted">${_U(e.others,`other version`)} unreviewed</span>`:e.toReview>1?M`<span class="team-deps-count">${e.toReview.toLocaleString(`en-US`)} deps</span>`:P} </a>${e.entry.formatted?M`<dependency-review-copy .text="${e.entry.formatted}" .label="${`Copy your dependency reviews of its versions`}"></dependency-review-copy>`:P}</div>${f?M`${this.rows(`${l}:own`,t,c(e))} ${e.untold>0?M`<p class="team-deps-quiet">and ${_U(e.untold,`more version`)} past those listed</p>`:P} ${this.rows(`${l}:same`,n,c(e),r?GH:qH,!0)} ${e.others>0?this.disclosed(`${l}:others`,e.size>0||e.failed?`${_U(e.others,`other version`)} its lockfiles lock ${e.others===1?`wants`:`want`} reviews`:`Its own versions pass; ${_U(e.others,`version`)} its lockfiles locked before ${e.others===1?`wants`:`want`} reviews`,AU(u.versions),t=>PU(t,e.entry.review,{elsewhere:i(t,e),involved:o(t),here:a(e),...FU(e)}),e.others-u.versions.length):P}`:P}</li>`},u=e.filter(e=>e.covered),d=this._open.has(`covered`);return M`<ol class="team-deps-pulls" aria-label="Pull requests wanting reviews">${e.filter(e=>!e.covered).map(l)}</ol>${u.length>0?M`<section class="team-deps-covered" aria-label="Pull requests adding only versions listed above"><button type="button" class="team-deps-more" aria-expanded="${String(!d)}" @click="${()=>this.toggle(`covered`)}">${IU}${u.length.toLocaleString(`en-US`)} more ${u.length===1?`adds`:`add`} only versions listed above</button> ${d?P:M`<ol class="team-deps-pulls is-covered">${u.map(l)}</ol>`}</section>`:P}`}renderVersions(e,t,{elsewhere:n,named:r,among:i,standing:a}){if(e.size===0)return t?P:M`<p class="workspace-content-empty">No version an open pull request adds wants a review.</p>`;let o=[...e.values()].map(({pulls:e,told:t,patched:n})=>{let r=e.map((e,n)=>a(t[n],e)),i=r.flatMap(({under:e,lacks:t},n)=>!e&&t.length===0?[n]:[]),o=(i.length>0?i:r.map((e,t)=>t)).reduce((e,n)=>EU(t[n]).size>EU(t[e]).size?n:e);return{pulls:e,stands:r,at:o,patched:n,pkg:{...t[o],...n?{patch:n.patch}:{},unreached:t.every(e=>e.unreached)}}});return M`<section class="team-deps-section" aria-label="Versions to review">${this.rows(`versions`,AU(o,e=>e.pkg),({pulls:e,stands:t,at:a,patched:o,pkg:s})=>PU(s,e[a].entry.review,{others:e.map(r),adders:!0,elsewhere:n(s),lacking:e.filter((e,n)=>t[n].lacks.length>0).map(r),added:!0,involved:i(s),...FU(o?.pull??e[a])}),1/0)}</section>`}renderBranch(e,t,{elsewhere:n,shorten:r,among:i}){let{versions:a,count:o}=AV(t.branch),s=MV(t.branch),c=s?.unread.flatMap(e=>e.paths)??[],l=[...AU(a),...s?.versions??[]];return M`<section class="team-deps-section" aria-label="${`${r(e.name)}\u2019s default branch`}"><h2>${r(e.name)}</h2><p class="team-deps-quiet">${_U(o,`version`)} unreviewed${s?.count?`, ${s.count.toLocaleString(`en-US`)} can\u2019t be reviewed`:``}${c.length>0?`, ${_U(c.length,`lockfile`)} unread`:``}</p>${c.length>0?M`<p class="team-deps-quiet" role="alert">Unread, so what ${c.length===1?`it locks isn’t`:`they lock aren’t`} checked: ${c.map((e,t)=>M`${t>0?`, `:``}<code>${e}</code>`)}</p>`:P} ${this.rows(`branch:${e.repoId}`,l,r=>PU(r,t.branch.review,{elsewhere:n(r),involved:i(r),repoId:e.repoId,head:t.branch.head??null}),KH)} ${o>a.length?M`<p class="team-deps-quiet">and ${(o-a.length).toLocaleString(`en-US`)} more, not listed</p>`:P}</section>`}};customElements.define(`team-dependencies`,LU);var RU=12e4,zU=3e4,BU=new Map,VU=new Set,HU=null,UU=()=>{};function WU(){let e=L.managedSession?`${L.managedSession.id}\0${L.managedSession.role}`:null;return e!==HU&&(BU.clear(),VU.clear(),HU=e),BU}globalThis.addEventListener?.(`dependency-review-changed`,()=>{BU.clear(),UU()});var GU=e=>Number.isSafeInteger(e)&&e>=0?e:0,KU=e=>typeof e?.name==`string`&&typeof e.version==`string`;function qU(e){if(!e?.review)return null;let t=pV(e);return t.review?{...t,versions:GU(e.versions),moreUnlocked:GU(e.moreUnlocked),unlocked:Array.isArray(e.unlocked)?e.unlocked.filter(KU).map(({name:e,version:t})=>({name:e,version:t,unsupported:`unlocked`})):[]}:null}function JU(e){let t=WU(),n=`${e.managedId}\0${e.repoId}\0${e.repoDirectory??``}`,r=t.get(n);if(r&&Date.now()<r.until)return r;let i=r?.status===`ready`?{...r,until:1/0,refreshing:!0}:{status:`loading`,until:1/0};return t.set(n,i),Xb(e.managedId).then(e=>({status:`ready`,until:Date.now()+RU,answer:qU(e)})).catch(e=>e?.name===`AbortError`?null:{status:`error`,until:Date.now()+zU,error:e?.message||`It couldn’t be read.`}).then(e=>t.get(n)===i&&(e?t.set(n,e):t.delete(n),UU(),!0)),i}var YU=(e,t)=>`${e.toLocaleString(`en-US`)} ${t}${e===1?``:`s`}`,XU=X(N`<path d="m6 4 4 4-4 4"/>`),ZU=e=>e.map((e,t)=>M`${t>0?`, `:``}<code>${e}</code>`);function QU(e){let{versions:t,count:n}=AV(e),r=MV(e),i=e.unlocked.length+e.moreUnlocked,a=r?.unread.flatMap(e=>e.paths)??[],o=[r?.count?`${r.count.toLocaleString(`en-US`)} can\u2019t be reviewed`:null,i?`${i.toLocaleString(`en-US`)} not locked at its commit`:null,a.length>0?`${YU(a.length,`lockfile`)} unread`:null,r?.unchecked?`${YU(r.unchecked,`version`)} past those checked`:null].filter(Boolean),s=`of ${YU(e.versions,`npm version`)}`;return{chip:o.length>0?M`<span class="bundle-review-state is-failed">Fails</span>`:n>0?M`<span class="bundle-review-state is-wanted">${n.toLocaleString(`en-US`)} to review</span>`:M`<span class="bundle-review-state is-passed">${RV.success[1]}Passes</span>`,said:o.length>0?`${o.join(`, `)}${n>0?`; ${n.toLocaleString(`en-US`)} to review`:``}, ${s}`:n>0?s:`${YU(e.versions,`npm version`)}, each reviewed or needing none`,listed:[...r?.versions??[],...e.unlocked,...t],more:Math.max(0,(r?.count??0)-(r?.versions.length??0))+e.moreUnlocked+Math.max(0,n-t.length),unread:a}}function $U(e,t){let{required:n,since:r,reviewedDependencies:i,unasked:a,baselineError:o,baselineUnread:s=[],byComments:c,lockfiles:l}=e.review,u=e.lockfiles.filter(e=>!e.error).flatMap(e=>e.paths),d=e.head?M` at <code>${e.head.slice(0,7)}</code>`:P;return M`<p class="team-deps-quiet">${c?`Each version needs the server’s reviewed dependencies to pass it`:M`Each version needs ${YU(n,`full, accepting review`)} by as many reviewers, of it whole or compared with any version of its package${i?`, or the server’s reviewed dependencies to pass it`:r?M`; those the repository’s lockfiles locked at <code>${r.slice(0,7)}</code> need none`:P}`}.</p><p class="team-deps-quiet">${u.length>0?M`As ${ZU(u)} ${u.length===1?`locks`:`lock`} them${d}, the nearest first.`:M`No lockfile installing it was read${d}.`}</p>${t.length>0?M`<p class="team-deps-quiet" role="alert">Unread, so what ${t.length===1?`it locks isn’t`:`they lock aren’t`} checked: ${ZU(t)}.</p>`:P} ${o?M`<p class="team-deps-quiet" role="alert">The versions locked at the commit reviewed since couldn’t be read (${o}), so every version wants its reviews.</p>`:P} ${s.length>0?M`<p class="team-deps-quiet" role="alert">At the commit reviewed since, ${ZU(s.slice(0,5))}${s.length>5?` and ${(s.length-5).toLocaleString(`en-US`)} more`:``} couldn’t be read, so the versions ${s.length===1?`it`:`they`} locked want reviews.</p>`:P} ${a?M`<p class="team-deps-quiet" role="alert">The server’s reviewed dependencies didn’t answer for ${YU(a,`version`)}, so ${a===1?`it wants`:`they want`} reviews.</p>`:P} ${l?M`<p class="team-deps-quiet">${l.mode===`include`?`Only these lockfiles are reviewed: `:`These lockfiles aren’t reviewed: `}${l.paths.length===0?`none`:ZU(l.paths)}.</p>`:P}`}function eW(e,t){if(!e?.managedId||e.repoId==null||e.kind!==`stasis`||!L.managedSession||L.managedSession.publicShare)return P;UU=t;let n=JU(e);if(n.status===`loading`)return P;if(n.status===`error`)return M`<dt>Dependency review</dt><dd class="bundle-review"><span class="bundle-review-error" role="alert">Couldn’t check its dependencies: ${n.error}</span></dd>`;let{answer:r}=n;if(!r)return P;let{chip:i,said:a,listed:o,more:s,unread:c}=QU(r),l=e.managedId,u=VU.has(l);return M`<dt>Dependency review</dt><dd class="bundle-review"><div class="bundle-review-line">${i}<span class="bundle-review-said">${a}</span> <button type="button" class="team-deps-more" aria-expanded="${String(u)}" @click="${()=>{VU.has(l)?VU.delete(l):VU.add(l),t()}}">${XU}<span>Details</span></button></div>${u?M`<div class="bundle-review-details">${$U(r,c)} ${o.length>0?M`<ul class="team-deps-versions bundle-review-versions">${o.map(t=>PU(t,r.review,{repoId:e.repoId,head:r.head??null}))}</ul>`:P} ${s>0?M`<p class="team-deps-quiet">and ${s.toLocaleString(`en-US`)} more, not listed</p>`:P}</div>`:P}</dd>`}var tW={skipped:`skipped (--only-deps): its dependencies alone validated`,"no-repository":`no repository to read it of`,"no-commit":`no commit to read it at`,"commit-not-in-history":`its commit is in the history of no branch or tag of its repository (a fork's, say)`,"history-unread":`its commit is at no tag or branch head, nor in its default branch's history, and not every other branch was compared`},nW={local:`installed from a directory of the repository, which isn't read`,"patch-unverified":`as patched by the bundle's patch, which isn't verified against the repository`,git:`locked from git, not a registry`,"not-a-submodule":`no submodule of its repository's tree at its path`,"git-built":`locked from git: of the files its repository hasn't at the commit, which its install may build, none verified`,"not-registry":`locked from elsewhere than its registry`,"no-integrity":`locked with no sha512 to hold its tarball to`,unsupported:`no upstream package for its ecosystem`,unnamed:`no name or version recorded`,"not-published":`not published`,unreadable:`its registry refused it`,timeout:`not reached in time`,failed:`could not be fetched`,"alias-unverified":`installed under another name, an alias no lockfile read tells of`,misplaced:`installed where its path or its lockfile names another package or version`,"not-locked":`not locked by the lockfile`,"integrity-mismatch":`its registry's tarball is not the one it is locked or recorded with`,"integrity-conflict":`locked or recorded with two integrities`,"integrity-not-locked":`records an integrity its lockfile doesn't lock it with`,"commit-not-locked":`records another commit than its repository's tree pins it at`,"patch-not-locked":`records a patch its lockfile doesn't patch it with`,"patch-not-recorded":`records an integrity and no patch, where its lockfile patches it`,"patch-conflict":`its copies record different patches, or one of them none, where pnpm patches every copy with one`,"patch-file-mismatch":`records its patch in another file than the one it is found in`},rW={"patch-not-in-repository":`is the bundle's, not the repository's`,"patch-not-found":`is in no file of its hash (the bundle's, or the patches directory's)`,"patch-mismatch":`is not of the hash its lockfile locks`},iW={symlink:`a symlink in the repository`,submodule:`in a submodule`,"tree-cut":`the repository's tree was too large to list whole`,generated:`not as the repository's Prisma schema generates it`,"not-generated":`in a Prisma Client's output, which generates no such file`,listed:`the repository's tree was listed, not read, and a lockfile records its integrity alone`},aW={"no-lockfile":`no lockfile of its repository locks them`,"lockfile-ambiguous":`more than one package manager's lockfile installs it`,"lockfile-unreadable":`its lockfile couldn't be read`,"lockfile-unsupported":`its lockfile is of a kind validate doesn't read`};function oW(e){let{patch:t}=e;if(e.reason)return[nW[e.reason]??e.reason,...e.at?[`: `,{path:e.at}]:[]];if(t?.error)return[`its patch`,...t.path?[` `,{path:t.path}]:[],` ${rW[t.error]??`could not be applied (${t.error})`}`];if(!t)return e.directory?[`held to `,{path:e.directory},` of the repository`]:[];let n=t.from===`bundle`?[t.verified?` (the bundle's, as the repository has it)`:` (the bundle's, not verified against the repository)`]:[];return[t.applied===!1?`bundled as published, not patched`:`patched`,...t.path?[` by `,{path:t.path},...n]:[],...t.recorded?[`, as recorded`]:[]]}var sW=12e4,cW=3e4,lW=new Map,uW=new Set,dW=null,fW=()=>{};function pW(){let e=L.managedSession?`${L.managedSession.id}\0${L.managedSession.role}`:null;return e!==dW&&(lW.clear(),uW.clear(),dW=e),lW}var mW=e=>`${e.managedId}\0${e.repoId??``}\0${e.repoDirectory??``}`;function hW(e,t,n,r){return e.get(t)===n&&(r?e.set(t,r):e.delete(t),fW(),!0)}var gW=new Set([`valid`,`invalid`,`incomplete`]),_W=e=>gW.has(e?.status)?e:null;function vW(e){let t=pW(),n=mW(e),r=t.get(n);if(r&&(r.running||Date.now()<r.until))return r;let i=r?.status===`ready`?{...r,until:1/0}:{status:`loading`,until:1/0};return t.set(n,i),Zb(e.managedId).then(e=>({status:`ready`,until:Date.now()+sW,validation:_W(e?.validation)})).catch(e=>e?.name===`AbortError`?null:{status:`error`,until:Date.now()+cW,error:e?.message||`It couldn’t be read.`}).then(e=>hW(t,n,i,e)),i}async function yW(e){let t=pW(),n=mW(e),r=t.get(n);if(r?.running||!L.managedSession?.csrfToken)return;let i={...r?.status===`ready`?r:{status:`ready`,validation:null},until:1/0,running:!0};t.set(n,i),fW();let a;try{let t=await Qb(e.managedId,L.managedSession.csrfToken);a={status:`ready`,until:Date.now()+sW,validation:_W(t?.validation)}}catch(e){a=e?.name===`AbortError`?null:{...i,running:!1,until:Date.now()+sW,runError:e?.message||`It couldn’t be validated.`}}hW(t,n,i,a)}var bW=(e,t)=>`${e.toLocaleString(`en-US`)} ${t}${e===1?``:`s`}`,xW=X(N`<path d="m6 4 4 4-4 4"/>`),SW={...tW,"no-access":`you may read only part of its repository`},CW={valid:`Valid`,invalid:`Invalid`,incomplete:`Incomplete`},wW={valid:`passed`,invalid:`failed`,incomplete:`wanted`,unverified:`wanted`,differs:`failed`,unexpected:`failed`},TW=[[`differs`,`differ`],[`unexpected`,`unexpected`],[`unverified`,`unverified`]],EW=[[`lockFailures`,`failing its lockfile`,`failing their lockfile`],[`misplaced`,`installed where another is`,`installed where others are`]],DW=e=>e===null?``:new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`});function OW({counts:e,own:t}){let n=TW.filter(([t])=>e[t]).map(([t,n])=>`${e[t].toLocaleString(`en-US`)} ${n}`),r=EW.filter(([t])=>e[t]).map(([t,n,r])=>`${bW(e[t],`package`)} ${e[t]===1?n:r}`);return`${n.length>0?`${n.join(`, `)}, of `:`every one of `}${bW(e.files,`file`)}${r.map(e=>`; ${e}`).join(``)}${t.checked?``:`; own code not checked`}`}function kW(e){let t=oW(e).map(e=>typeof e==`string`?e:M`<code>${e.path}</code>`);return M`<li class="bundle-validation-row"><span class="team-deps-name">${e.name}<span class="team-deps-version">@${e.version}</span></span> <span class="team-deps-review is-${wW[e.status]}">${e.status}</span> <span class="bundle-validation-note">${t}</span></li>`}function AW(e){let{own:t,problems:n,moreProblems:r,packages:i,counts:a,lockfiles:o}=e,s=t.checked&&t.ref?t.ref.tag?M`, tag <code>${t.ref.tag}</code>`:M` of <code>${t.ref.branch}</code>`:P;return M`<div class="bundle-review-details"><p class="team-deps-quiet">${t.checked?M`Own code held to <code>${t.repository}</code> at <code>${t.commit.slice(0,7)}</code>${s}${t.directory?M` under <code>${t.directory}</code>`:P}${a.eol?`, ${bW(a.eol,`file`)} with a checkout\u2019s CRLF line endings`:``}${t.cut?`; its tree was too large to list whole`:``}.`:P} ${a.packages?` ${bW(a.validPackages,`package`)} of ${a.packages.toLocaleString(`en-US`)} as published.`:``} ${o?.length?M` Dependencies held to ${o.map((e,t)=>M`${t?`, `:``}<code>${e}</code>`)}.`:P}</p>${n.length>0?M`<ul class="bundle-validation-list">${n.map(e=>M`<li class="bundle-validation-row"><span class="team-deps-review is-${wW[e.kind]}">${e.kind}</span> <span class="team-deps-name">${e.path}</span> <span class="bundle-validation-note">${e.of===`own`?`own code`:e.of.replace(/^[a-z-]+:/u,``)}${e.reason?`, ${iW[e.reason]??e.reason}`:``}</span></li>`)}</ul>`:P} ${r>0?M`<p class="team-deps-quiet">and ${bW(r,`file`)} more, not listed</p>`:P} ${i.length>0?M`<ul class="bundle-validation-list">${i.map(kW)}</ul>`:P}</div>`}function jW(e,t){if(!e?.managedId||e.kind!==`stasis`||!L.managedSession||L.managedSession.publicShare)return P;fW=t;let n=vW(e);if(n.status===`loading`)return P;let{validation:r}=n,i=mW(e),a=uW.has(i),o=()=>{uW.has(i)?uW.delete(i):uW.add(i),t()},s=n.running?M`<span class="bundle-review-state" role="status">Validating…</span>`:r?M`<span class="bundle-review-state is-${wW[r.status]}">${CW[r.status]}</span>`:M`<span class="bundle-review-state">Not validated</span>`;return M`<dt>Validation</dt><dd class="bundle-review bundle-validation"><div class="bundle-review-line">${s} ${r?M`<span class="bundle-review-said">${OW(r)}${r.validatedAt?` \xB7 ${DW(r.validatedAt)}`:``}</span>`:P} <button type="button" class="bundles-download-btn bundle-validate-btn" ?disabled="${!!n.running}" @click="${()=>{yW(e)}}">${r?`Validate again`:`Validate`}</button> ${r?M`<button type="button" class="team-deps-more" aria-expanded="${String(a)}" @click="${o}">${xW}<span>Details</span></button>`:P}</div>${r&&!r.own.checked?M`<p class="bundle-validation-warning" role="alert">Own code couldn’t be verified: ${SW[r.own.reason]??r.own.reason}.</p>`:P} ${r?.lockfileError&&r.counts.packages?M`<p class="bundle-validation-warning" role="alert">Dependencies held to no lockfile, each to its registry’s integrity alone: ${aW[r.lockfileError]??r.lockfileError}.</p>`:P} ${n.status===`error`?M`<p class="bundle-validation-warning" role="alert">Couldn’t read its validation: ${n.error}</p>`:P} ${n.runError?M`<p class="bundle-validation-warning" role="alert">Couldn’t validate it: ${n.runError}</p>`:P} ${r&&a?AW(r):P}</dd>`}var MW=e=>R()?[]:If(e),NW=()=>R()?0:Lf(),PW=null,FW=new WeakMap;function IW(e){if(FW.has(e))return FW.get(e);let t=Ft(e),n=_e(e),r=[...t.keys()],{stripped:i}=In(r),a=new Map(r.map((e,t)=>[e,i[t]])),o={};for(let e of r){let r=a.get(e),i=n.get(e);o[r]={imports:i?[...i].map(e=>a.get(e)).filter(Boolean):[],size:t.get(e)}}let s={tree:o,origToStripped:a};return FW.set(e,s),s}function LW(e,t=null){let n={inprogress:0,fixed:0,invalid:0,deleted:0,ignored:0};if(!e?.fileHashes)return n;let r=new Set;for(let[a,o]of e.fileHashes)if((!t||t.has(a))&&!r.has(o)){r.add(o);for(let e of MW(o)){let t=i(e,L.triage.get(O(e)));t&&n[t]!==void 0&&n[t]++}}return n}function RW(e,t=`graph`){if(!e||e.size===0)return new Map;let n=new Map;for(let[r,a]of e){let e=MW(a);if(e.length===0)continue;let o=e.filter(e=>{let n=i(e,L.triage.get(O(e)))??null;return t===`issues`?n!==`invalid`&&n!==`deleted`:n===L.shownTriage});o.length!==0&&n.set(r,o)}return n}function zW(e){let t=IW(e),n=ve(e,t.origToStripped.keys());D.bundleReasonFor!==e.integrity&&(D.bundleReasonFor=e.integrity,D.dependencyPackagesView=!1,D.bundleReason=null);let r=VW(t,n,D.bundleReason),{tree:i,origToStripped:a,selected:o}=r;D.bundleReason=o;let s=r.files;if(s.length===0)return null;let c=null;if(e.fileHashes&&e.fileHashes.size>0){c=new Map;for(let[t,n]of e.fileHashes){let e=a.get(t);e!==void 0&&c.set(e,n)}}let l=RW(c),u=l.size>0||[...e.fileHashes??[]].some(([e,n])=>t.origToStripped.has(e)&&MW(n).length>0),d=u&&D.bundleIssues,f=new Map,p=new Map,m=new Map,h=new Map;for(let[e,t]of d?l:[]){let n={critical:0,high:0,medium:0,low:0,high_bug:0,bug:0,informational:0},r=new Set,i=new Set,a=[];for(let e of t){n[e.severity]=(n[e.severity]||0)+1,r.add(e.severity);let t=L.triage.get(O(e))?.color??`none`;i.add(t),a.push({severity:e.severity,color:t})}f.set(e,n),p.set(e,r),m.set(e,i),h.set(e,a)}let g=[`flow`,`package-flow`].includes(D.bundleLayout),_=D.bundleLayout===`matrix`||g||f.size===0?null:Ar(i,f),v=new Map;for(let[e,t]of a)v.set(t,e);let y=It(e),b=new Map(y?[...e.bundle.modules].map(([e,t])=>[e,{directory:e,version:typeof t.version==`string`?t.version:void 0}]):[]),x=e=>{let t=v.get(e)??e;return Yr(t,{packageDir:y?.get(t)})},S=s.filter(e=>x(e)===`__own__`),ee=Ez(e,a,x,y,t.origToStripped),C=new Set;for(let e of s)if(C.add(x(e)),C.size>=3)break;let te=C.size>=3,ne=s;if(D.focusedPkg){r.focused.has(D.focusedPkg)||r.focused.set(D.focusedPkg,s.filter(e=>x(e)===D.focusedPkg));let e=r.focused.get(D.focusedPkg);e.length>0?ne=e:D.focusedPkg=null}return D.selected&&!Object.hasOwn(i,D.selected)&&(D.selected=null),{treeData:i,files:ne,ownCounts:f,transitiveCounts:_,severitySets:p,colorSets:m,fileFindings:h,options:{pkgOf:x,packageInfoOf:e=>b.get(y?.get(v.get(e)??e))},strippedToOrig:v,canPackagesView:te,hasIssues:u,issuesShown:d,viewId:e.integrity??null,supportsLayers:!0,layerRoots:ee,flowEntries:g?Tz(e,a,t.origToStripped,y):void 0,ownSourcePackages:Sz(a,x,y),entryPackages:Cz(e,a,x),ownSourceFiles:new Set(S),reasons:be(n)}}var BW=new WeakMap;function VW(e,t,n){let r=t.has(n)?n:null;BW.has(e)||BW.set(e,new Map);let i=BW.get(e);if(!i.has(r)){let n=wz(e.tree,e.origToStripped,new Map(r===null?[]:[[r,t.files(r)]]),r);i.set(r,{...n,files:Object.keys(n.tree),focused:new Map})}return i.get(r)}function HW(){if(!PW)return;let e=uE();e&&e.refreshSidebar(PW,{isBundleContext:!0,findingsJump:!R()})}function UW(){if(!PW)return;let e=uE();e&&e.refreshTopPkgs(PW)}function WW(e){PW=e}function GW(e,t,n){let{totalByPkg:r,whyQueries:i,total:a}=e;if(a===0)return P;e.sorted.has(t)||e.sorted.set(t,[...r.entries()].toSorted((e,n)=>+(n[0]===`__own__`)-(e[0]===`__own__`)||(t===`size`?n[1]-e[1]:0)||Qr(e[0]).localeCompare(Qr(n[0]))||e[0].localeCompare(n[0])));let o=e.sorted.get(t);return M`<div class="bundles-dist"><div class="bundles-dist-bar" aria-hidden="true">${A(o,([e])=>e,([e,t])=>M`<span class="bundles-dist-seg" style="${k({flexGrow:t,background:Cn(e)})}" data-tooltip="${e===`__own__`?P:`${e}: ${Gr(t)}`}"></span>`)}</div><ul class="bundles-dist-list">${A(o,([e])=>e,([e,t])=>{let r=(t/a*100).toFixed(1),o=Qr(e),s=Cn(e),c=i.get(e);return M`<li><span class="bundles-dist-dot" style="${k({background:s})}"></span> ${c?M`<button type="button" class="bundles-dist-pkg" aria-haspopup="dialog" aria-label="${`Show dependency chains for ${o}`}" @click="${()=>KW(n,c)}" data-tooltip-truncated data-tooltip="${e}">${o}</button>`:M`<span class="bundles-dist-pkg" data-tooltip-truncated data-tooltip="${e===`__own__`?P:e}">${o}</span>`} <span class="bundles-dist-bar-row" aria-hidden="true"><span class="bundles-dist-bar-fill" style="${k({width:`${r}%`,background:s})}"></span> </span><span class="bundles-dist-size">${Gr(t)}</span> <span class="bundles-dist-percent">${r}%</span></li>`})}</ul></div>`}function KW(e,t){let n=L.currentManagedTeam,r=L.currentWorkspace,i=L.managedSession&&Vs(L.managedSession);return Oe({details:e,...t,isCurrent:()=>L.currentView===`bundles`&&L.selectedBundle===e.integrity&&(L.bundleDetails&&Vs(L.bundleDetails))===Vs(e)&&L.currentWorkspace===r&&L.currentManagedTeam===n&&(L.managedSession&&Vs(L.managedSession))===i})}var qW=new WeakMap;function JW(e,t,n,r){let i=qW.get(e);if(i&&i.packageDirs===n&&i.details===r&&i.sizes.length===t.length&&i.sizes.every((e,n)=>e===t[n]))return i;let{prefix:a,stripped:o}=In(e),s=t=>n?.get(e[t]),c=new Set;for(let t=0;t<o.length;t++)c.add(Yr(e[t],{packageDir:s(t)}));let l=o.map((e,t)=>t).toSorted((e,t)=>o[e].localeCompare(o[t])),u=o.map((e,t)=>t).toSorted((e,n)=>(t[n]??-1)-(t[e]??-1)||o[e].localeCompare(o[n])),d=YW(e.map((e,n)=>({path:e,size:t[n],pkgDir:s(n)})),r),f={sizes:[...t],packageDirs:n,details:r,prefix:a,stripped:o,packages:c,byName:l,bySize:u,dist:d};return qW.set(e,f),f}function YW(e,t){let n=new Map,r=new Map,i=0;for(let{path:a,size:o,pkgDir:s}of e){if(typeof o!=`number`||o<=0)continue;let e=Yr(a,{packageDir:s});n.set(e,(n.get(e)??0)+o),r.has(e)||r.set(e,Gz(t,s)),i+=o}return{totalByPkg:n,whyQueries:r,total:i,sorted:new Map}}function XW(e,t,n,r,i,a,{bundleSize:o=null,unpackedSize:s=null,resources:c=null,details:l=null,leadColumn:u=null,trailColumns:d=P,summaryExtra:f=P,fileTag:p=null,fileIcon:m=null,fileFlags:h=null,overviewClass:g=``,fileFilter:_=null,lines:v=null,sized:y=(e,t,n)=>n}={}){let b=JW(n,r,i,l),{prefix:x,stripped:S,packages:ee}=b,C=S.map((e,t)=>t).filter(e=>!_||_.keeps(n[e])),te=e=>h?.(n[e])??[],ne=C.some(e=>te(e).length>0),re=L.bundleOverviewFilesSort===`flags`&&!ne?`name`:L.bundleOverviewFilesSort,ie=re===`size`?b.bySize:b.byName,ae=re===`flags`?RI(C,te,e=>S[e]):_?ie.filter(e=>_.keeps(n[e])):ie,oe=L.bundleOverviewPackagesSort,se=GW(b.dist,oe,l),ce=se===P?M`<p class="bundles-overview-col-empty">No size information for this bundle's sources.</p>`:se,le={critical:0,high:0,medium:0,low:0,high_bug:0,bug:0,informational:0},ue=0,de=new Map;if(L.bundleDetails?.fileHashes){let e=RW(L.bundleDetails.fileHashes,`issues`);for(let t of e.values())for(let e of t){le[e.severity]!==void 0&&le[e.severity]++,ue++;for(let t of Bf(e.fileHash,e))de.set(t,(de.get(t)??0)+1)}}let fe=[...de.keys()].toSorted(),pe=zi.filter(e=>le[e]>0).map(e=>M`<span class="${`tree-count-chip ${e}`}">${le[e]} ${e.replaceAll(`_`,` `)}</span>`),me=n.length>0?M`<ul class="bundles-sources-list">${ae.map(e=>{let t=n[e],i=r[e],a=M`${m?m(t):P}<span class="bundles-source-path" data-tooltip-truncated data-tooltip="${t}">${S[e]}</span> ${p?p(t):P} ${i==null?P:M`<span class="bundles-source-size">${Gr(i)}</span>`}`;return M`<li>${c?.has(t)?M`<div class="bundles-source-row is-resource">${a}</div>`:M`<button type="button" class="bundles-source-row" data-bundle-view-source="${t}">${a}</button>`}</li>`})}</ul>`:M`<p class="bundles-overview-col-empty">No source files in this bundle.</p>`,he=fe.length>0?M`<ul class="bundles-reports-list">${fe.map(e=>{let t=pS[_S(e)]??pS.default,n=de.get(e)??0;return M`<li><button type="button" class="report-chip bundles-report-chip" data-bundle-issue-report="${e}">${j(t)}<span class="report-chip-label" data-tooltip-truncated data-tooltip="${e}">${w(e)}</span> <span class="bundles-report-count">${n} ${n===1?`issue`:`issues`}</span></button></li>`})}</ul>`:M`<p class="bundles-overview-col-empty">No matching reports indexed yet.</p>`,ge=n.length-(c?.size??0);return M`<div class="bundles-overview ${g}"><div class="bundles-overview-summary"><div class="bundles-detail-meta-row">${e(x)}<dl class="bundles-detail-meta is-build">${t}<dt>Sources</dt><dd>${v==null?y(`files`,ge,ge):M`${y(`files`,ge,`${ge} ${ge===1?`file`:`files`}`)} · ${y(`lines`,v,`${v.toLocaleString(`en`)} LoC`)}`}</dd>${o==null?P:M`<dt>Size</dt><dd>${Gr(o)}</dd>`} ${s==null?P:M`<dt>Unpacked</dt><dd>${y(`unpacked`,s,Gr(s))}</dd>`} ${c?.size?M`<dt>Resources</dt><dd>${c.size}</dd>`:P}</dl>${a??P}</div>${ue>0?M`<div class="bundles-issue-summary tree-count-chips">${pe}</div>`:P} ${f}</div><div class="bundles-overview-columns">${u??AA({title:`Packages`,count:ee.size,body:ce,tools:M`<span class="bundles-overview-sort" role="group" aria-label="Package order">${[[`name`,`Name`],[`size`,`Size`]].map(([e,t])=>M`<button type="button" aria-pressed="${String(oe===e)}" @click="${()=>{L.bundleOverviewPackagesSort=e,Z()}}">${t}</button>`)}</span>`})} ${AA({title:`Files`,count:_?`${ae.length} of ${n.length}`:n.length,body:me,list:!0,extra:_?M`<button type="button" class="bundles-overview-filter" aria-label="${`Show every file, not only ${_.label}`}" @click="${_.clear}">${_.label}<span aria-hidden="true">×</span></button>`:P,tools:M`<span class="bundles-overview-sort" role="group" aria-label="File order">${[[`name`,`Name`],[`size`,`Size`],...ne?[[`flags`,`Flags`]]:[]].map(([e,t])=>M`<button type="button" aria-pressed="${String(re===e)}" @click="${()=>{L.bundleOverviewFilesSort=e,Z()}}">${t}</button>`)}</span>`})} ${fe.length>0?AA({title:`Reports`,count:fe.length,body:he,list:!0}):P} ${d}</div></div>`}var ZW=16,QW=new Map,$W=new Set,eG=e=>L.bundleSourceFile===e||L.currentView===`lockfile`&&L.droppedLockfile?.name===e,tG=()=>M`<button type="button" class="bundle-source-wrap-toggle" data-bundle-source-wrap hidden aria-pressed="${L.bundleSourceWrap?`true`:`false`}" aria-label="Wrap lines" data-tooltip="Wrap lines">${qw}</button>`;function nG(e,t){let n=e?.status;return M`<button type="button" class="${E({"bundle-source-pretty-toggle":!0,"is-loading":n===`loading`,"is-error":n===`error`,"is-folded":yk(t)})}" data-bundle-source-pretty="${t?`json`:``}" aria-pressed="${L.bundleSourcePretty?`true`:`false`}" aria-busy="${n===`loading`?`true`:P}" aria-label="Pretty-print" data-tooltip="${_k(e,t)}">${gk}</button>`}function rG(e,t,n,r,i,a){let o=Wk(e,t,n,r),s=o?iA(e,t,n,r,()=>{L.bundleSourceFile===n&&Z()}):null,c=s?.status===`ready`;return{pretty:c,toggle:o?nG(s,CD(n)):P,content:c?s.text:r,fileFindings:c?[]:i,lineFindings:c?new Map:a}}function iG(e){let t=e?.status;return M`<button type="button" class="${E({"bundle-source-lockfile-toggle":!0,"is-loading":t===`loading`,"is-error":t===`error`})}" data-bundle-source-lockfile aria-pressed="${L.bundleSourceLockfile?`true`:`false`}" aria-busy="${t===`loading`?`true`:P}" aria-label="View lockfile" data-tooltip="${wA(e)}">${j(la)}</button>`}function aG(){queueMicrotask(()=>{document.querySelector(`.bundle-code-rail-body .bundle-code-tree-link.current`)?.scrollIntoView({block:`nearest`})})}function oG(e){requestAnimationFrame(()=>requestAnimationFrame(()=>{document.querySelector(`.bundle-code-main .bundle-source-lineno-row[data-line="${e}"]`)?.scrollIntoView({block:`center`})}))}function sG(e){for(let t of zi)for(let n of e)if(n.severity===t)return t;return e[0]?.severity??null}var cG={content:``,parts:``};function lG(e){if(cG.content===e)return cG.parts;let t=e;if(e.length>NE||FC(e)){let n=e=>[IE(e)].flat();t=[];let r=0;for(let i=0;i<e.length;){let a=e.indexOf(`
|
|
197
197
|
`,i),o=a===-1?e.length:a+1;(a===-1?o:a)-i>PE&&(t.push(...n(e.slice(r,i)),M`<span class="bundle-source-long-line">${n(e.slice(i,o))}</span>`),r=o),i=o}t.push(...n(e.slice(r)))}return cG={content:e,parts:t},t}function uG(e,t,n,r,i=null,a=!1,o=!1){let s=kt(e),c=L.bundleSourceTargetLine,l=!o&&c&&c.path===t&&c.bundle===(n?.integrity??null)?c.line:null,u=l==null?null:Math.max(c.end??l,l),d=String(s).length,f=wt(t,n?.kind===`stasis`?n.bundle?.formats?.get(t):void 0,e),p=`${n?.integrity??``}\0${t}${o?`\0pretty`:``}`;f&&!QW.has(p)&&!$W.has(p)&&($W.add(p),(async()=>{let r=await aC(e,f,wC(n,t));QW.set(p,typeof r==`string`?zC(r):null),QW.size>ZW&&QW.delete(QW.keys().next().value),$W.delete(p),eG(t)&&Z()})());let m=QW.get(p);QW.has(p)&&(QW.delete(p),QW.set(p,m));let h=L.bundleSourceFindingIdx,g=[...r].map(([e,t])=>`${e}:${sG(t.map(e=>e.f))}:${t.map(e=>e.idx).join(`,`)}`).join(` `);return M`<div class="${E({"bundle-source-lines":!0,"is-wrapped":L.bundleSourceWrap})}" style="${k({"--lineno-width":`${d}ch`})}" ${ME(_D)}><aside class="bundle-source-lineno-col" aria-hidden="true">${CE([s,g,h,i,a,l,u],()=>Array.from({length:s},(e,t)=>{let n=t+1,o=r.get(n),s=o?sG(o.map(e=>e.f)):null,c=o&&h!=null&&o.some(e=>e.idx===h);return M`<div class="${E({"bundle-source-lineno-row":!0,"is-match":i?.has(n)??!1,"is-target":l!=null&&n>=l&&n<=u})}" data-line="${n}">${o?M`<button type="button" class="${E({"bundle-source-dot":!0,[`sev-${s}`]:!0,active:c})}" data-bundle-source-finding="${o[0].idx}" data-tooltip="${`${o.length} ${o.length===1?`issue`:`issues`} on line ${n}`}" aria-label="${`${o.length} issues on line ${n}`}"></button>`:M`<span class="bundle-source-dot-placeholder"></span>`} <span class="bundle-source-lineno-num" data-bundle-source-line="${a?n:P}">${n}</span></div>`}))}</aside><pre class="bundle-source-code" tabindex="-1" aria-label="${t}"><code class="${f?`language-${f}`:``}">${typeof m==`string`?j(m):lG(e)}</code></pre></div>`}function dG(e){let t=L.bundleSourceFindingIdx;if(t==null)return P;let n=e[t];if(!n)return P;let r=n.fileHash?Bf(n.fileHash,n):[],a=i(n,L.triage.get(O(n))),o=a===`fixed`?`Fixed`:a===`inprogress`?`In progress`:a===`ignored`?`Ignored`:null,s=zn(n),c=SK(n.line);return M`<aside class="bundle-source-panel"><header class="bundle-source-panel-bar"><span class="${`bundle-source-panel-sev sev-${n.severity}`}">${n.severity.replaceAll(`_`,` `)}</span> ${o?M`<span class="${`bundle-source-panel-triage triage-${a}`}">${o}</span>`:P} <button type="button" class="bundle-source-panel-close" data-action="bundle-source-panel-close" aria-label="Close finding details">×</button></header><div class="bundle-source-panel-body">${c||s?M`<div class="bundle-source-panel-line-row">${c?M`<span class="bundle-source-panel-line">${c}</span>`:P} ${s?M`<span class="bundle-source-panel-meta" data-tooltip-truncated data-tooltip="${s}">${s}</span>`:P}</div>`:P}<div class="bundle-source-panel-desc">${sT(Qi(n),{paragraphs:!1})}</div>${r.length>0?M`<div class="bundle-source-panel-reports"><div class="bundle-source-panel-reports-label">Reported by</div>${r.map(e=>{let t=Ze[_S(e)]??Ze.default;return M`<button type="button" class="report-chip bundle-source-panel-report" data-bundle-issue-report="${e}">${j(t)}<span class="report-chip-label" data-tooltip-truncated data-tooltip="${e}">${w(e)}</span></button>`})}</div>`:P}</div></aside>`}function fG(e,t,n,r=null){let i=[],a=new Map;if(typeof n==`string`&&e?.fileHashes){let n=(r??RW(e.fileHashes,`issues`)).get(t)??[];for(let e=0;e<n.length;e++){let t=n[e];i.push(t);let r=parseInt(t.line,10);Number.isFinite(r)&&r>0&&(a.has(r)||a.set(r,[]),a.get(r).push({f:t,idx:e}))}}return{fileFindings:i,lineFindings:a}}function pG(e,t=null,n=P){return M`<header class="bundle-source-bar"><div class="bundle-source-title mono" data-tooltip-truncated data-tooltip="${e}">${e}</div>${t?.files.length>1?JG(t):P} ${tG()} ${n} <button type="button" class="bundle-source-close" data-action="bundle-source-close" aria-label="Close source viewer">×</button></header>`}function mG(e,t,n,r,i,a=null,o=!1,s=!1){return M`<div class="bundle-source-code-wrap">${typeof t==`string`?uG(t,e,n,i,a,o,s):M`<div class="bundle-source-empty">Source content not bundled.</div>`}</div>${dG(r)}`}function hG(){let e=L.bundleSourceFile;if(!e||L.bundleDetailsTab===`code`||L.bundleDetailsTab===`search`)return P;let t=L.bundleDetails,n=t?.sourceError||t?.error,r=!n&&(!t||t.metadataOnly===!0),i=Ot(t),{fileFindings:a,lineFindings:o}=fG(t,e,i.get(e)),s=L.bundles?.find(e=>e.integrity===t?.integrity)??(t?.npm?{npm:t.npm}:null),c=r||n?null:rG(t,s,e,i.get(e),a,o);return M`<div class="bundle-source-overlay"><div class="${E({"bundle-source-modal":!0,"with-panel":L.bundleSourceFindingIdx!=null})}">${pG(e,pA(L.bundleCodeHistory,t?.integrity??null,e),c?.toggle)}<div class="bundle-source-body" aria-busy="${String(r)}">${n?M`<div class="bundles-slide-placeholder is-error" role="status">Failed to load source: ${n}</div>`:r?M`<div class="bundles-slide-placeholder" role="status">Loading source…</div>`:mG(e,c.content,t,c.fileFindings,c.lineFindings,null,!1,c.pretty)}</div></div></div>`}var gG=new Map,_G=null,vG=null,yG=0;function bG(e,t){let n=DG(e??``,t).split(`/`);for(let e=1;e<n.length;e++)gG.set(n.slice(0,e).join(`/`),!0);yG++}function xG(e,t){L.bundleCodeSearchMode=`files`,L.bundleCodeSearchQuery=``,bG(e,t),Z(),aG()}function SG(e){let t=e=>{for(let n of e.dirs.values())gG.set(n.path,!1),t(n)};t(e),yG++,Z()}function CG(e){L.bundleCodeTerminal=e,Z(),e?gE():document.querySelector(`[data-bundle-code-terminal-toggle]`)?.focus()}function wG(){return M`<bundle-code-terminal-splitter role="separator" tabindex="0" aria-orientation="horizontal" aria-label="Resize terminal" data-tooltip="Drag to resize · double-click to reset"></bundle-code-terminal-splitter><section class="bundle-code-terminal" aria-label="Terminal"><header class="bundle-code-terminal-bar"><span class="bundle-code-rail-label">Terminal</span> <button type="button" class="bundle-code-rail-action" aria-label="Close terminal" @click="${()=>CG(!1)}">×</button></header><div id="bundle-terminal-slot" class="bundle-code-terminal-slot"></div></section>`}function TG(e,t){let n=0,r=null;if(!t||t.size===0)return{count:n,worst:r};let i=e=>{for(let i of e.files.values()){let e=t.get(i);if(!e||e.length===0)continue;n+=e.length;let a=sG(e);(r===null||(Ri[a]??0)>(Ri[r]??0))&&(r=a)}for(let t of e.dirs.values())i(t)};return i(e),{count:n,worst:r}}function EG(e,t,n=0,r=null,i=!1,a=null,o=null,s=null){let c=[...e.dirs.entries()].toSorted(([e,t],[n,r])=>$E(e,t).localeCompare($E(n,r))||t.path.localeCompare(r.path)),l=[...e.files.entries()].toSorted(([e],[t])=>e.localeCompare(t)),u=e=>{if(!t)return!1;for(let n of e.files.values())if(n===t)return!0;for(let t of e.dirs.values())if(u(t))return!0;return!1},d=(e,t)=>i?!0:gG.has(e)?gG.get(e):!!s?.has(e)||u(t),f=e=>t=>{gG.set(e,!t.currentTarget.parentElement.open)};return M`<ul class="${E({"bundle-code-tree":!0,root:n===0})}" aria-label="${n===0?`Source files`:P}" @keydown="${n===0?sD:P}">${A(c,([,e])=>e.path,([e,c])=>{let l=c.path,u=tD(e,c,n),p=c.package,m=p?.ecosystem===`cargo`||p?.ecosystem===`composer`||p?.ecosystem===`soldeer`,h=p||c.dependencyRoot?He(p?.ecosystem??c.dependencyRoot):P,g=p?.variant?`${u.node.sourcePath}
|
|
198
198
|
Variant ${p.variant}`:u.node.sourcePath,_=c.packageInfo,v=!!_||!!p?.variant,y=_&&o?e=>{let{bytes:t,loc:n}=KE(o,c.sourcePath);Object.assign(e.dataset,{tooltipLoc:String(n),tooltipSize:Gr(t)})}:void 0,b=TG(c,r);return M`<li class="bundle-code-tree-dir"><details .open="${Ne(d(l,c))}"><summary @click="${f(l)}" .prepareTooltip="${y}" data-tooltip-package="${_?.name??P}" data-tooltip-ecosystem="${_?.ecosystem??P}" data-tooltip-version="${_?.version??P}" data-tooltip-files="${_?.fileCount??P}" data-tooltip-repo="${_?.github?_.github+(_.directory?`/${_.directory}`:``):P}" data-tooltip-commit="${_?.commit??P}" data-tooltip="${v?g:P}" data-tooltip-placement="${v?`right-start`:P}"><span class="bundle-code-tree-chevron" aria-hidden="true"></span> ${h} <span class="${E({"bundle-code-tree-dirname":!0,"bundle-code-tree-package":!!p,"bundle-code-tree-package-vendored":m})}" data-tooltip-truncated data-tooltip="${v?P:g}">${p?M`<span class="bundle-code-tree-package-name">${p.name}</span>${p.version?M`<span class="bundle-code-tree-package-version">${m?`- `:`@`}${p.version}</span>`:P}`:u.names.map((e,t)=>M`${t>0?M`<span class="bundle-code-tree-separator">/</span>`:P}${e}`)} </span>${p?.variant?M`<span class="bundle-code-tree-variant">variant ${p.variant}</span>`:P} ${b.count>0?M`<span class="${`bundle-code-tree-count sev-${b.worst}`}" data-tooltip="${`${b.count} ${b.count===1?`issue`:`issues`} inside`}">${b.count}</span>`:P}</summary>${EG(u.node,t,n+1,r,i,a,o,s)}</details></li>`})} ${A(l,([,e])=>e,([e,n])=>{let i=r?.get(n),o=i&&i.length>0?sG(i):null,s=i?.length??0;return M`<li class="bundle-code-tree-file"><button type="button" class="${E({"bundle-code-tree-link":!0,current:n===t})}" data-bundle-view-source="${n}" aria-current="${n===t?`true`:P}">${Le(n,a?.get(n))}<span class="bundle-code-tree-name" data-tooltip-truncated data-tooltip="${n}">${e}</span> ${s>0?M`<span class="${`bundle-code-tree-count sev-${o}`}" data-tooltip="${`${s} ${s===1?`issue`:`issues`}`}">${s}</span>`:P}</button></li>`})}</ul>`}function DG(e,t){return t&&e.startsWith(t)?e.slice(t.length):e}var OG={tree:null,query:``,prefix:``,filtered:null};function kG(e,t,n,r,i=``,a=null,o=null){let s=OG;n&&(s.tree!==e||s.query!==n||s.prefix!==i)&&(OG={tree:e,query:n,prefix:i,filtered:eD(e,n,i)});let c=n?OG.filtered:e;return CE([c,t,AG(r),a,o,yG],()=>c?EG(c,t,0,r,!!n,a,o,n?null:oD(e)):M`<div class="bundle-code-search-empty">No files match.</div>`)}function AG(e){return[...e].map(([e,t])=>`${e}\0${t.length}\0${sG(t)}`).join(`
|
|
@@ -213,7 +213,7 @@ To complete cleanup, remove the DeepView passkey from your password manager / OS
|
|
|
213
213
|
• macOS / iOS: Settings → Passwords
|
|
214
214
|
• Windows: Settings → Accounts → Sign-in options → Passkeys
|
|
215
215
|
• Chrome: chrome://settings/passkeys
|
|
216
|
-
• Hardware security key: use the vendor's management tool`)}catch(e){alert(`Could not disable encryption: ${e?.message??e}`)}}function r$(){t$()}function i$(e){if(!e||e===e$)return;e$=e;let t=!1;e$.addEventListener(`click`,async()=>{if(await KQ(),!R()&&!t){t=!0;try{if(!ko()){await me();return}if(!Ao()){await Zv();return}await n$()}finally{t=!1}}}),zo(t$),t$()}export{Vs as a,Hs as b,xo as c,ko as d,Ao as e,jo as f,No as g,zo as h,Vo as i,Uo as j,Jo as k,Za as l,to as m,ao as n,Ws as o,Ks as p,qs as q,Js as r,Xs as s,nc as t,oc as u,uc as v,L as w,R as x,Zc as y,el as z,tl as A,gl as B,_l as C,Sl as D,Ol as E,Pl as F,Pf as G,Zf as H,np as I,Ju as J,cu as K,B as L,pu as M,vu as N,Ou as O,_p as P,pd as Q,bd as R,Dd as S,Ld as T,Gd as U,Jd as V,Ep as W,jp as X,Mp as Y,Np as Z,Pp as _,Fp as $,zp as aa,Bp as ba,Vp as ca,nm as da,im as ea,Yd as fa,Xd as ga,Qd as ha,$d as ia,q as ja,ry as ka,sy as la,cy as ma,fy as na,Hy as oa,nb as pa,ib as qa,lb as ra,ub as sa,db as ta,fb as ua,pb as va,mb as wa,hb as xa,xb as ya,wb as za,Ab as Aa,Mb as Ba,Vb as Ca,Hb as Da,Ub as Ea,Gb as Fa,Kb as Ga,qb as Ha,tx as Ia,nx as Ja,yx as Ka,bx as La,xx as Ma,Sx as Na,wx as Oa,Tx as Pa,Ix as Qa,Lx as Ra,Rx as Sa,Gx as Ta,Kx as Ua,qx as Va,Jx as Wa,Yx as Xa,fH as Ya,mH as Za,pS as _a,_S as $a,sh as ab,V as bb,ch as cb,lh as db,uh as eb,Kv as fb,qv as gb,Jv as hb,bS as ib,SS as jb,CS as kb,TS as lb,DS as mb,OS as nb,kS as ob,VS as pb,jh as qb,Mh as rb,Nh as sb,Rh as tb,zh as ub,Bh as vb,Hh as wb,Uh as xb,Wh as yb,Kh as zb,Zh as Ab,Qh as Bb,U as Cb,d_ as Db,f_ as Eb,p_ as Fb,w_ as Gb,E_ as Hb,O_ as Ib,k_ as Jb,A_ as Kb,N_ as Lb,P_ as Mb,L_ as Nb,rv as Ob,cv as Pb,sg as Qb,xg as Rb,Sg as Sb,Cg as Tb,W as Ub,Eg as Vb,jg as Wb,Mg as Xb,Ng as Yb,G as Zb,Pg as _b,Rg as $b,Hg as ac,Wg as bc,Gg as cc,qg as dc,Jg as ec,Yg as fc,Xg as gc,Zg as hc,$g as ic,o_ as jc,s_ as kc,c_ as lc,l_ as mc,eg as nc,aC as oc,oC as pc,zC as qc,UC as rc,WC as sc,GC as tc,$C as uc,rw as vc,iw as wc,dw as xc,pw as yc,hw as zc,bw as Ac,Sw as Bc,Cw as Cc,ww as Dc,Tw as Ec,Ew as Fc,Ow as Gc,kw as Hc,Lw as Ic,Rw as Jc,zw as Kc,Bw as Lc,Hw as Mc,Uw as Nc,Ww as Oc,Gw as Pc,Kw as Qc,Jw as Rc,Xw as Sc,Zw as Tc,sT as Uc,zT as Vc,QT as Wc,$T as Xc,eE as Yc,tE as Zc,nS as _c,aS as $c,oS as ad,lS as bd,PE as cd,IE as dd,YE as ed,XE as fd,eD as gd,tD as hd,oD as id,sD as jd,cD as kd,lD as ld,dD as md,fD as nd,SD as od,CD as pd,ND as qd,IO as rd,RO as sd,HO as td,UO as ud,WO as vd,qO as wd,ek as xd,mk as yd,hk as zd,gk as Ad,_k as Bd,yk as Cd,Pk as Dd,uA as Ed,dA as Fd,fA as Gd,pA as Hd,mA as Id,hA as Jd,CA as Kd,BA as Ld,cj as Md,uj as Nd,dj as Od,Dj as Pd,K as Qd,Mj as Rd,Lj as Sd,Kj as Td,qj as Ud,YM as Vd,ZM as Wd,$M as Xd,eN as Yd,tN as Zd,nN as _d,sP as $d,mP as ae,hP as be,yP as ce,SP as de,CP as ee,wP as fe,TP as ge,OP as he,kP as ie,RI as je,zI as ke,Yv as le,eS as me,tS as ne,WY as oe,XY as pe,mX as qe,FX as re,IX as se,$ as te,CQ as ue,KQ as ve,iR as we,hR as xe,gR as ye,AR as ze,MR as Ae,NR as Be,LR as Ce,VR as De,JR as Ee,tz as Fe,oz as Ge,cz as He,uz as Ie,yz as Je,kz as Ke,Az as Le,jz as Me,Kz as Ne,qz as Oe,Jz as Pe,mB as Qe,AB as Re,$B as Se,rV as Te,aV as Ue,sV as Ve,_V as We,wV as Xe,kV as Ye,AV as Ze,MV as _e,X as $e,IV as af,LV as bf,RV as cf,zV as df,BV as ef,VV as ff,HV as gf,UV as hf,WV as if,JV as jf,YV as kf,XV as lf,ZV as mf,QV as nf,$V as of,eH as pf,tH as qf,
|
|
216
|
+
• Hardware security key: use the vendor's management tool`)}catch(e){alert(`Could not disable encryption: ${e?.message??e}`)}}function r$(){t$()}function i$(e){if(!e||e===e$)return;e$=e;let t=!1;e$.addEventListener(`click`,async()=>{if(await KQ(),!R()&&!t){t=!0;try{if(!ko()){await me();return}if(!Ao()){await Zv();return}await n$()}finally{t=!1}}}),zo(t$),t$()}export{Vs as a,Hs as b,xo as c,ko as d,Ao as e,jo as f,No as g,zo as h,Vo as i,Uo as j,Jo as k,Za as l,to as m,ao as n,Ws as o,Ks as p,qs as q,Js as r,Xs as s,nc as t,oc as u,uc as v,L as w,R as x,Zc as y,el as z,tl as A,gl as B,_l as C,Sl as D,Ol as E,Pl as F,Pf as G,Zf as H,np as I,Ju as J,cu as K,B as L,pu as M,vu as N,Ou as O,_p as P,pd as Q,bd as R,Dd as S,Ld as T,Gd as U,Jd as V,Ep as W,jp as X,Mp as Y,Np as Z,Pp as _,Fp as $,zp as aa,Bp as ba,Vp as ca,nm as da,im as ea,Yd as fa,Xd as ga,Qd as ha,$d as ia,q as ja,ry as ka,sy as la,cy as ma,fy as na,Hy as oa,nb as pa,ib as qa,lb as ra,ub as sa,db as ta,fb as ua,pb as va,mb as wa,hb as xa,xb as ya,wb as za,Ab as Aa,Mb as Ba,Vb as Ca,Hb as Da,Ub as Ea,Gb as Fa,Kb as Ga,qb as Ha,tx as Ia,nx as Ja,yx as Ka,bx as La,xx as Ma,Sx as Na,wx as Oa,Tx as Pa,Ix as Qa,Lx as Ra,Rx as Sa,Gx as Ta,Kx as Ua,qx as Va,Jx as Wa,Yx as Xa,fH as Ya,mH as Za,pS as _a,_S as $a,sh as ab,V as bb,ch as cb,lh as db,uh as eb,Kv as fb,qv as gb,Jv as hb,bS as ib,SS as jb,CS as kb,TS as lb,DS as mb,OS as nb,kS as ob,VS as pb,jh as qb,Mh as rb,Nh as sb,Rh as tb,zh as ub,Bh as vb,Hh as wb,Uh as xb,Wh as yb,Kh as zb,Zh as Ab,Qh as Bb,U as Cb,d_ as Db,f_ as Eb,p_ as Fb,w_ as Gb,E_ as Hb,O_ as Ib,k_ as Jb,A_ as Kb,N_ as Lb,P_ as Mb,L_ as Nb,rv as Ob,cv as Pb,sg as Qb,xg as Rb,Sg as Sb,Cg as Tb,W as Ub,Eg as Vb,jg as Wb,Mg as Xb,Ng as Yb,G as Zb,Pg as _b,Rg as $b,Hg as ac,Wg as bc,Gg as cc,qg as dc,Jg as ec,Yg as fc,Xg as gc,Zg as hc,$g as ic,o_ as jc,s_ as kc,c_ as lc,l_ as mc,eg as nc,aC as oc,oC as pc,zC as qc,UC as rc,WC as sc,GC as tc,$C as uc,rw as vc,iw as wc,dw as xc,pw as yc,hw as zc,bw as Ac,Sw as Bc,Cw as Cc,ww as Dc,Tw as Ec,Ew as Fc,Ow as Gc,kw as Hc,Lw as Ic,Rw as Jc,zw as Kc,Bw as Lc,Hw as Mc,Uw as Nc,Ww as Oc,Gw as Pc,Kw as Qc,Jw as Rc,Xw as Sc,Zw as Tc,sT as Uc,zT as Vc,QT as Wc,$T as Xc,eE as Yc,tE as Zc,nS as _c,aS as $c,oS as ad,lS as bd,PE as cd,IE as dd,YE as ed,XE as fd,eD as gd,tD as hd,oD as id,sD as jd,cD as kd,lD as ld,dD as md,fD as nd,SD as od,CD as pd,ND as qd,IO as rd,RO as sd,HO as td,UO as ud,WO as vd,qO as wd,ek as xd,mk as yd,hk as zd,gk as Ad,_k as Bd,yk as Cd,Pk as Dd,uA as Ed,dA as Fd,fA as Gd,pA as Hd,mA as Id,hA as Jd,CA as Kd,BA as Ld,cj as Md,uj as Nd,dj as Od,Dj as Pd,K as Qd,Mj as Rd,Lj as Sd,Kj as Td,qj as Ud,YM as Vd,ZM as Wd,$M as Xd,eN as Yd,tN as Zd,nN as _d,sP as $d,mP as ae,hP as be,yP as ce,SP as de,CP as ee,wP as fe,TP as ge,OP as he,kP as ie,RI as je,zI as ke,Yv as le,eS as me,tS as ne,WY as oe,XY as pe,mX as qe,FX as re,IX as se,$ as te,CQ as ue,KQ as ve,iR as we,hR as xe,gR as ye,AR as ze,MR as Ae,NR as Be,LR as Ce,VR as De,JR as Ee,tz as Fe,oz as Ge,cz as He,uz as Ie,yz as Je,kz as Ke,Az as Le,jz as Me,Kz as Ne,qz as Oe,Jz as Pe,mB as Qe,AB as Re,$B as Se,rV as Te,aV as Ue,sV as Ve,_V as We,wV as Xe,kV as Ye,AV as Ze,MV as _e,X as $e,IV as af,LV as bf,RV as cf,zV as df,BV as ef,VV as ff,HV as gf,UV as hf,WV as if,JV as jf,YV as kf,XV as lf,ZV as mf,QV as nf,$V as of,eH as pf,tH as qf,RH as rf,HW as sf,UW as tf,aG as uf,qq as vf,tJ as wf,nJ as xf,Z as yf,mY as zf,hY as Af,gY as Bf,_Y as Cf,vY as Df,yY as Ef,SY as Ff,wY as Gf,TY as Hf,DN as If,zN as Jf};
|
|
217
217
|
/*! Bundled license information:
|
|
218
218
|
|
|
219
219
|
lit-html/directives/map.js:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Db as e,Eb as t,Fb as n,Hb as r,Ib as i,Jb as a,Ob as o,dc as s,jc as c,w as l}from"./chunk-
|
|
1
|
+
import{Db as e,Eb as t,Fb as n,Hb as r,Ib as i,Jb as a,Ob as o,dc as s,jc as c,w as l}from"./chunk-NA3BSFFM.js";import{k as u,l as d}from"./chunk-QPGM3DTI.js";import{e as f,f as p,g as m,j as h}from"./chunk-QRKFPLA4.js";import{c as g}from"./chunk-2XUEZHIP.js";var _=`.md-quote,.md-alert{margin:0;&:not(:first-child),+*{margin-top:.5lh}>:first-child{margin-top:0}>:last-child{margin-bottom:0}}.md-quote{padding-inline-start:.85em;border-inline-start:.25em solid rgb(from currentcolor r g b / .3);color:rgb(from currentcolor r g b / calc(alpha*.78));.md-quote{color:inherit}}.md-alert{--md-alert: var(--info);padding:.35lh .85em;border-inline-start:.25em solid var(--md-alert);background:rgb(from var(--md-alert) r g b / .06);border-radius:0 var(--ui-radius, 4px) var(--ui-radius, 4px) 0}.md-alert-tip{--md-alert: var(--green)}.md-alert-important{--md-alert: var(--purple)}.md-alert-warning{--md-alert: var(--warning)}.md-alert-caution{--md-alert: var(--critical)}.md-alert-title{display:flex;align-items:center;gap:.45em;margin-bottom:.2lh;color:var(--md-alert);font-weight:600}.md-alert-icon{flex:none;width:1.05em;height:1.05em}
|
|
2
2
|
`,v=`.token.comment,.token.prolog,.token.cdata{color:var(--code-comment);font-style:italic}.token.punctuation{color:var(--muted)}.token.string,.token.attr-value,.token.char,.token.regex{color:var(--code-string)}.token.number,.token.boolean,.token.constant,.token.symbol{color:var(--code-number)}.token.keyword,.token.builtin,.token.important,.token.atrule{color:var(--code-keyword)}.token.function,.token.class-name,.token.tag{color:var(--code-function)}.token.operator,.token.entity,.token.url,.token.attr-name,.token.selector{color:var(--code-operator)}.token.variable,.token.property,.token.parameter{color:var(--code-variable)}.token.annotation{color:var(--code-function)}.token.deleted{color:var(--code-deleted)}.token.inserted{color:var(--code-inserted)}.token.italic{font-style:italic}.token.bold{font-weight:700}.code-control{padding:0 .3em;margin:0 .1em;border-radius:3px;font-size:.8em;line-height:0;font-style:normal;font-weight:400;color:var(--warning);background:rgb(from var(--warning) r g b / .14);box-shadow:inset 0 0 0 1px rgb(from var(--warning) r g b / .45);white-space:nowrap;user-select:none}
|
|
3
3
|
`,y=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`,b=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.8" y="5" width="20.4" height="14" rx="2"/><path d="M5.6 15.6V8.4l3.1 3.6 3.1-3.6v7.2"/><path d="M16.9 8.4v7.2m-2.6-2.9 2.6 2.9 2.6-2.9"/></svg>`,x=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M6 9V2h12v7"/><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><rect x="6" y="14" width="12" height="8"/></svg>`;function S(e,t){let n=u.find(t=>t.value===e)?.label??e;return d(e)?.includes(`partial`)?t===`exclude`?`${n} (full only)`:t===`only`?`${n} (partial only)`:n:n}function C(e){return h.filter(t=>e.has(t)).map(e=>f[e]??e).join(`, `)}function w(r=l){let i=[];if(r.filterSeverities.size>0&&i.push({key:`severity`,label:`Severity`,value:C(r.filterSeverities),clear:{filterSeverities:new Set}}),r.filterColors.size>0&&i.push({key:`marks`,label:`Marks`,value:[...r.filterColors].map(e=>m[e]??e).join(`, `),clear:{filterColors:new Set}}),r.filterSources.size===1&&i.push({key:`source`,label:`Source`,value:r.filterSources.has(`own`)?`Sources only`:`Dependencies only`,clear:{filterSources:new Set}}),r.filterAnalyzer&&i.push({key:`analyzer`,label:`Analyzer`,value:r.filterAnalyzer===e?`(none)`:r.filterAnalyzer,clear:{filterAnalyzer:``}}),r.filterModel&&i.push({key:`model`,label:`Model`,value:r.filterModel===n?`(none)`:r.filterModel,clear:{filterModel:``}}),r.filterValidationModel&&i.push({key:`validationModel`,label:`Validation model`,value:r.filterValidationModel===n?`(none)`:r.filterValidationModel,clear:{filterValidationModel:``}}),r.filterRepo&&i.push({key:`repo`,label:`Repository`,value:r.filterRepo===t?`(no repo)`:r.filterRepo,clear:{filterRepo:``}}),d(r.filterRevalidate)&&i.push({key:`revalidate`,label:`Revalidation`,value:S(r.filterRevalidate,r.filterPartial),clear:{filterRevalidate:``,filterPartial:``}}),!r.filterRevalidate&&(r.filterConfMin>0||r.filterConfMax<10)){let e;e=r.filterConfMin>0&&r.filterConfMax<10?`${r.filterConfMin}\u2013${r.filterConfMax}`:r.filterConfMin>0?`\u2265 ${r.filterConfMin}`:`\u2264 ${r.filterConfMax}`,i.push({key:`confidence`,label:`Confidence`,value:e,clear:{filterConfMin:0,filterConfMax:10}})}r.filterInclude&&i.push({key:`search`,label:r.filterIncludeNegate?`Excluding`:`Search`,value:`"${r.filterInclude}"`,clear:{filterInclude:``,filterIncludeNegate:!1}});for(let[e,t]of[[`filterComment`,`comment`],[`filterIssue`,`issue`],[`filterFix`,`fix`],[`filterFlagged`,`flag`]]){let n=r[e];n&&i.push({key:`annotation:${t}`,label:`Annotation`,value:`${n===`with`?`With`:`Without`} ${t}`,clear:{[e]:``}})}return!l.currentWorkspace&&r.filterDuplicates&&i.push({key:`duplicates`,label:`Duplicates`,value:r.filterDuplicates===`with`?`Only rows linked to other reports`:`Exclude rows linked to other reports`,clear:{filterDuplicates:``}}),r.filterCrossContext&&i.push({key:`cross-context`,label:`Context`,value:r.filterCrossContext===`with`?`Only rows across multiple repos or packages`:`Exclude rows across multiple repos or packages`,clear:{filterCrossContext:``}}),r.filterAppStacked&&i.push({key:`app-stacked`,label:`App stack`,value:r.filterAppStacked===`with`?`Only rows with multiple App findings`:`Exclude rows with multiple App findings`,clear:{filterAppStacked:``}}),r.filterSecurity&&i.push({key:`security`,label:`Security`,value:r.filterSecurity===`with`?`Only security-related rows`:`Exclude security-related rows`,clear:{filterSecurity:``}}),i}function T(){return c().filter(e=>s(e).commonTriage===l.shownTriage)}function E(){return l.shownTriage?p[l.shownTriage]??l.shownTriage:null}function D(e,t=r()){let n=T(),s=n.length;i(t);let c;try{c=o(n).length}finally{a()}return{included:c,total:s,excluded:s-c,fields:t,filters:w(t),bucketLabel:E(),focusedOnly:e===`print`&&l.viewMode===`focus`}}var O=`.managed-comment{container:managed-comment / inline-size;white-space:normal}.managed-comment-row{display:grid;grid-template-columns:minmax(0,max-content) minmax(0,1fr) auto;align-items:start;gap:.35rem .65rem;line-height:1.5}.managed-comment-author{grid-column:1;grid-row:1;display:flex;align-items:center;gap:.45rem;min-width:0;max-width:14rem;& strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}}.managed-comment-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:1.3rem;height:1.3rem;overflow:hidden;border-radius:50%;background:rgb(from var(--muted) r g b / .15);color:var(--muted);font-size:.65rem;font-weight:600;& img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}& img[hidden]{display:none}}.managed-comment-body{grid-column:2;grid-row:1;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;& a{color:var(--accent);text-decoration:none}& a:hover{text-decoration:underline}& a.comment-self-ref{text-decoration:underline dotted;text-underline-offset:2px}& a.comment-self-ref:hover{text-decoration:underline solid}}.managed-comment-time{color:var(--muted);font-size:.7rem;font-weight:400;white-space:nowrap;text-align:right}.managed-comment-meta{grid-column:3;grid-row:1;justify-self:end;display:flex;align-items:center;gap:.5rem;min-height:1.3rem}.managed-comment-actions{display:flex;align-items:center;gap:.15rem}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr) auto;.managed-comment-body{grid-column:1}.managed-comment-meta{grid-column:2}}@container managed-comment (max-width: 28rem){.managed-comment-row:has(.managed-comment-meta){grid-template-columns:minmax(0,max-content) minmax(0,1fr);.managed-comment-meta{grid-column:1 / -1;grid-row:1}.managed-comment-author,.managed-comment-body{grid-row:2}}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr)}.managed-comment-author{max-width:9rem}}
|
|
4
4
|
`;export{_ as a,v as b,y as c,b as d,x as e,w as f,T as g,E as h,D as i,O as j};
|