@visulima/vis 1.0.7 → 1.0.8

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.
@@ -1,4 +1,4 @@
1
- import{createRequire as at}from"node:module";import{U as dt,$ as tt,e as rt,j as Ke,O as I,q as oe,I as mi,s as Ue}from"../packem_shared/index.server-qvZ-cy29.js";import{o as pe,p as xe,L as Co,t as ht,s as lt,i as vt,n as yt,a as ct,b as bt}from"../packem_shared/index-ZfYDID5E.js";import{N as Oe,r as Ae}from"../packem_shared/Table-BGIHvenQ-D2oJtNQj.js";import{t as pt}from"../packem_shared/package-version-DBJLduJL.js";const ut=at(import.meta.url),be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gt=i=>{if(typeof be<"u"&&be.versions&&be.versions.node){const[e,o]=be.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return be.getBuiltinModule(i)}return ut(i)},{createRequire:st}=gt("node:module"),wt=/^#?([a-f\d]{3}|[a-f\d]{6})$/i,Ko=i=>{let[,e]=wt.exec(i)??[];const o=e?e.length:0;if(o===3){const a=e.charAt(0),u=e.charAt(1),g=e.charAt(2);e=a+a+u+u+g+g}else if(o!==6)return globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`[@visulima/colorize] Invalid hex color "${i}"; expected a 3- or 6-digit hex string (e.g. "#96C" or "#E0115F"). Falling back to black.`),[0,0,0];const n=Number.parseInt(e,16);return[n>>16&255,n>>8&255,n&255]},Lu=(i,e,o)=>i===e&&e===o?i<8?16:i>248?231:Math.round((i-8)/247*24)+232:16+36*Math.round(i/51)+6*Math.round(e/51)+Math.round(o/51),Oo=i=>{let e,o,n;if(i<8)return 30+i;if(i<16)return 90+(i-8);if(i>=232)e=o=n=((i-232)*10+8)/255;else{i-=16;const g=i%36;e=Math.floor(i/36)/5,o=Math.floor(g/6)/5,n=g%6/5}const a=Math.max(e,o,n)*2;if(a===0)return 30;const u=30+(Math.round(n)<<2|Math.round(o)<<1|Math.round(e));return a===2?u+60:u},aa=(i,e,o)=>Oo(Lu(i,e,o));function jt({onlyFirst:i=!1}={}){const e="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(e,i?void 0:"g")}const Mi=(i,e,o)=>e>i?e:Math.min(i,o),N=39,x=49,ua=10,ga={close:"",open:""},Zu=i=>{const e=i>0?(h,v)=>({close:`\x1B[${String(v)}m`,open:`\x1B[${String(h)}m`}):()=>ga,o=h=>(v,y,c)=>h(Lu(Number(v),Number(y),Number(c))),n=h=>v=>{const[y,c,b]=Ko(v);return h(y,c,b)};let a=h=>e(`38;5;${String(h)}`,N),u=h=>e(`48;5;${String(h)}`,x),g=(h,v,y)=>e(`38;2;${String(h)};${String(v)};${String(y)}`,N),d=(h,v,y)=>e(`48;2;${String(h)};${String(v)};${String(y)}`,x);i===1?(a=h=>e(Oo(Number(h)),N),u=h=>e(Oo(Number(h))+ua,x),g=(h,v,y)=>e(aa(Number(h),Number(v),Number(y)),N),d=(h,v,y)=>e(aa(Number(h),Number(v),Number(y))+ua,x)):i===2&&(g=o(a),d=o(u));const r={bold:e(1,22),dim:e(2,22),hidden:e(8,28),inverse:e(7,27),italic:e(3,23),overline:e(53,55),reset:e(0,0),strike:e(9,29),strikethrough:e(9,29),underline:e(4,24),visible:ga},s={bgBlack:e(40,x),bgBlackBright:e(100,x),bgBlue:e(44,x),bgBlueBright:e(104,x),bgCyan:e(46,x),bgCyanBright:e(106,x),bgGray:e(100,x),bgGreen:e(42,x),bgGreenBright:e(102,x),bgGrey:e(100,x),bgMagenta:e(45,x),bgMagentaBright:e(105,x),bgRed:e(41,x),bgRedBright:e(101,x),bgWhite:e(47,x),bgWhiteBright:e(107,x),bgYellow:e(43,x),bgYellowBright:e(103,x),black:e(30,N),blackBright:e(90,N),blue:e(34,N),blueBright:e(94,N),cyan:e(36,N),cyanBright:e(96,N),gray:e(90,N),green:e(32,N),greenBright:e(92,N),grey:e(90,N),magenta:e(35,N),magentaBright:e(95,N),red:e(31,N),redBright:e(91,N),white:e(37,N),whiteBright:e(97,N),yellow:e(33,N),yellowBright:e(93,N)},l={bg:h=>u(Mi(h,0,255)),bgHex:n(d),bgRgb:(h,v,y)=>d(Mi(h,0,255),Mi(v,0,255),Mi(y,0,255)),fg:h=>a(Mi(h,0,255)),hex:n(g),rgb:(h,v,y)=>g(Mi(h,0,255),Mi(v,0,255),Mi(y,0,255))};return{baseColors:s,baseStyles:r,styleMethods:l}},Su=dt();tt();Zu(Su);const mt=(i,e,o)=>{if(e==="")return i;let n=i.indexOf(e);if(n<0)return i;const a=e.length;let u=0,g="";for(;~n;)g+=i.slice(u,n)+o,u=n+a,n=i.indexOf(e,u);return g+i.slice(u)},ft=(i,e,o)=>{if(!i)return"";let n;if(i.raw===void 0?n=String(i):n=String.raw(i,...e),n.includes("\x1B"))for(let a=o;a;a=a.props)n=mt(n,a.close,a.open);return n.includes(`
1
+ import{createRequire as at}from"node:module";import{U as dt,$ as tt,e as rt,j as Ke,O as I,q as oe,I as mi,s as Ue}from"../packem_shared/index.server-qvZ-cy29.js";import{o as pe,p as xe,L as Co,t as ht,s as lt,i as vt,n as yt,a as ct,b as bt}from"../packem_shared/index-D_6ru_ek.js";import{N as Oe,r as Ae}from"../packem_shared/Table-BGIHvenQ-D2oJtNQj.js";import{t as pt}from"../packem_shared/package-version-mvGIa7gN.js";const ut=at(import.meta.url),be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gt=i=>{if(typeof be<"u"&&be.versions&&be.versions.node){const[e,o]=be.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return be.getBuiltinModule(i)}return ut(i)},{createRequire:st}=gt("node:module"),wt=/^#?([a-f\d]{3}|[a-f\d]{6})$/i,Ko=i=>{let[,e]=wt.exec(i)??[];const o=e?e.length:0;if(o===3){const a=e.charAt(0),u=e.charAt(1),g=e.charAt(2);e=a+a+u+u+g+g}else if(o!==6)return globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`[@visulima/colorize] Invalid hex color "${i}"; expected a 3- or 6-digit hex string (e.g. "#96C" or "#E0115F"). Falling back to black.`),[0,0,0];const n=Number.parseInt(e,16);return[n>>16&255,n>>8&255,n&255]},Lu=(i,e,o)=>i===e&&e===o?i<8?16:i>248?231:Math.round((i-8)/247*24)+232:16+36*Math.round(i/51)+6*Math.round(e/51)+Math.round(o/51),Oo=i=>{let e,o,n;if(i<8)return 30+i;if(i<16)return 90+(i-8);if(i>=232)e=o=n=((i-232)*10+8)/255;else{i-=16;const g=i%36;e=Math.floor(i/36)/5,o=Math.floor(g/6)/5,n=g%6/5}const a=Math.max(e,o,n)*2;if(a===0)return 30;const u=30+(Math.round(n)<<2|Math.round(o)<<1|Math.round(e));return a===2?u+60:u},aa=(i,e,o)=>Oo(Lu(i,e,o));function jt({onlyFirst:i=!1}={}){const e="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(e,i?void 0:"g")}const Mi=(i,e,o)=>e>i?e:Math.min(i,o),N=39,x=49,ua=10,ga={close:"",open:""},Zu=i=>{const e=i>0?(h,v)=>({close:`\x1B[${String(v)}m`,open:`\x1B[${String(h)}m`}):()=>ga,o=h=>(v,y,c)=>h(Lu(Number(v),Number(y),Number(c))),n=h=>v=>{const[y,c,b]=Ko(v);return h(y,c,b)};let a=h=>e(`38;5;${String(h)}`,N),u=h=>e(`48;5;${String(h)}`,x),g=(h,v,y)=>e(`38;2;${String(h)};${String(v)};${String(y)}`,N),d=(h,v,y)=>e(`48;2;${String(h)};${String(v)};${String(y)}`,x);i===1?(a=h=>e(Oo(Number(h)),N),u=h=>e(Oo(Number(h))+ua,x),g=(h,v,y)=>e(aa(Number(h),Number(v),Number(y)),N),d=(h,v,y)=>e(aa(Number(h),Number(v),Number(y))+ua,x)):i===2&&(g=o(a),d=o(u));const r={bold:e(1,22),dim:e(2,22),hidden:e(8,28),inverse:e(7,27),italic:e(3,23),overline:e(53,55),reset:e(0,0),strike:e(9,29),strikethrough:e(9,29),underline:e(4,24),visible:ga},s={bgBlack:e(40,x),bgBlackBright:e(100,x),bgBlue:e(44,x),bgBlueBright:e(104,x),bgCyan:e(46,x),bgCyanBright:e(106,x),bgGray:e(100,x),bgGreen:e(42,x),bgGreenBright:e(102,x),bgGrey:e(100,x),bgMagenta:e(45,x),bgMagentaBright:e(105,x),bgRed:e(41,x),bgRedBright:e(101,x),bgWhite:e(47,x),bgWhiteBright:e(107,x),bgYellow:e(43,x),bgYellowBright:e(103,x),black:e(30,N),blackBright:e(90,N),blue:e(34,N),blueBright:e(94,N),cyan:e(36,N),cyanBright:e(96,N),gray:e(90,N),green:e(32,N),greenBright:e(92,N),grey:e(90,N),magenta:e(35,N),magentaBright:e(95,N),red:e(31,N),redBright:e(91,N),white:e(37,N),whiteBright:e(97,N),yellow:e(33,N),yellowBright:e(93,N)},l={bg:h=>u(Mi(h,0,255)),bgHex:n(d),bgRgb:(h,v,y)=>d(Mi(h,0,255),Mi(v,0,255),Mi(y,0,255)),fg:h=>a(Mi(h,0,255)),hex:n(g),rgb:(h,v,y)=>g(Mi(h,0,255),Mi(v,0,255),Mi(y,0,255))};return{baseColors:s,baseStyles:r,styleMethods:l}},Su=dt();tt();Zu(Su);const mt=(i,e,o)=>{if(e==="")return i;let n=i.indexOf(e);if(n<0)return i;const a=e.length;let u=0,g="";for(;~n;)g+=i.slice(u,n)+o,u=n+a,n=i.indexOf(e,u);return g+i.slice(u)},ft=(i,e,o)=>{if(!i)return"";let n;if(i.raw===void 0?n=String(i):n=String.raw(i,...e),n.includes("\x1B"))for(let a=o;a;a=a.props)n=mt(n,a.close,a.open);return n.includes(`
2
2
  `)&&(n=n.replace(/(\r*\n)/g,`${o.closeStack}$1${o.openStack}`)),o.openStack+n+o.closeStack},Yt=function(i){const e=i?.level??Su,{baseColors:o,baseStyles:n,styleMethods:a}=Zu(e),u={};let g=null;const d=({props:s},{close:l,open:h})=>{const v=(s?.openStack??"")+h,y=l+(s?.closeStack??""),c=(b,...p)=>ft(b,p,c.props);return Object.setPrototypeOf(c,g),c.props={close:l,closeStack:y,open:h,openStack:v,props:s},c.open=v,c.close=y,c},r=s=>String(s);r.strip=s=>s.replaceAll(jt(),"");for(const s in o)u[s]={get(){const l=d(this,o[s]);return Object.defineProperty(this,s,{value:l}),l}};for(const s in n)u[s]={get(){const l=d(this,n[s]);return Object.defineProperty(this,s,{value:l}),l}};for(const s in a)u[s]={get(){return(...l)=>d(this,a[s](...l))}};return u.ansi256=u.fg,u.bgAnsi256=u.bg,g=Object.defineProperties({},u),Object.setPrototypeOf(r,g),r},kt=i=>(e,...o)=>{if(!Array.isArray(e)||!Array.isArray(e.raw))throw new TypeError("A tagged template literal must be provided");const n=[e.raw[0]];for(let a=1;a<e.raw.length;a+=1)n.push(String(o[a-1]).replaceAll(/[{}\\]/g,String.raw`\$&`),String(e.raw[a]));return i(n.join(""))},Lt=new Map([["0","\0"],["\\","\\"],["a","\x07"],["b","\b"],["e","\x1B"],["f","\f"],["n",`
3
3
  `],["r","\r"],["t"," "],["v","\v"]]),Ju=i=>{const e=i.startsWith("u"),o=i[1]==="{";return e&&!o&&i.length===5||i.startsWith("x")&&i.length===3?String.fromCodePoint(Number.parseInt(i.slice(1),16)):e&&o?String.fromCodePoint(Number.parseInt(i.slice(2,-1),16)):Lt.get(i)??i},Zt=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|\{(~)?(#?[\w:]+(?:\([^)]*\))?(?:\.#?[\w:]+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n))|(\})|((?:.|[\r\n\f])+?)/gi,da=/(?:^|\.)(?:(\w+)(?:\(([^)]*)\))?|#(?=[:a-f\d]{2,})([a-f\d]{6})?(?::([a-f\d]{6}))?)/gi,St=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Jt=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,Ct=/\s*,\s*/,Xt=(i,e)=>{const o=[],n=e.trim().split(Ct);let a;for(const u of n){const g=Number(u);if(!Number.isNaN(g))o.push(g);else if(a=St.exec(u))o.push(a[2].replaceAll(Jt,(d,r,s)=>r?Ju(r):s));else throw new Error(`Invalid template style argument: ${u} (in style '${i}')`)}return o},Ht=i=>{da.lastIndex=0;const e=[];let o;for(;(o=da.exec(i))!==null;){const n=o[1];o[2]?e.push([n,...Xt(n,o[2])]):o[3]||o[4]?(o[3]&&e.push(["rgb",...Ko(o[3])]),o[4]&&e.push(["bgRgb",...Ko(o[4])])):e.push([n])}return e},ta=(i,e)=>{const o={};for(const a of e)for(const u of a.styles)o[u[0]]=a.inverse?void 0:u.slice(1);let n=i;for(const[a,u]of Object.entries(o))if(Array.isArray(u)){if(!(a in n))throw new Error(`Unknown style: ${a}`);n=u.length>0?n[a](...u):n[a]}return n},Dt=i=>e=>{const o=[],n=[];let a=[];if(e.replaceAll(Zt,(u,g,d,r,s,l)=>{if(g)a.push(Ju(g));else if(r){const h=a.join("");a=[],n.push(o.length===0?h:ta(i,o)(h)),o.push({inverse:d,styles:Ht(r)})}else if(s){if(o.length===0)throw new Error("Found extraneous } in template literal");n.push(ta(i,o)(a.join(""))),a=[],o.pop()}else a.push(l)}),n.push(a.join("")),o.length>0)throw new Error(`template literal is missing ${String(o.length)} closing bracket${o.length===1?"":"s"} (\`}\`)`);return n.join("")},Tt=new Yt,Bt=Dt(Tt),Qt=kt(Bt),Mt=st(import.meta.url),Vi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xe=i=>{if(typeof Vi<"u"&&Vi.versions&&Vi.versions.node){const[e,o]=Vi.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return Vi.getBuiltinModule(i)}return Mt(i)},{createRequire:Gt}=Xe("node:module"),Ri=Vi,{execFileSync:Nt}=Xe("node:child_process"),Ye=Xe("node:fs"),xt=Xe("node:tty"),Wt=Xe("node:os"),Pt=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Ft=12288,Kt=65510,Ot=[12288,12288,65281,65376,65504,65510],At=8361,Rt=65518,_t=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],zt=32,Et=10630,qt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],It=4352,Ut=262141,Cu=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],He=(i,e)=>{let o=0,n=Math.floor(i.length/2)-1;for(;o<=n;){const a=Math.floor((o+n)/2),u=a*2;if(e<i[u])n=a-1;else if(e>i[u+1])o=a+1;else return!0}return!1},ra=19968,[$t,Vt]=ir(Cu);function ir(i){let e=i[0],o=i[1];for(let n=0;n<i.length;n+=2){const a=i[n],u=i[n+1];if(ra>=a&&ra<=u)return[a,u];u-a>o-e&&(e=a,o=u)}return[e,o]}const er=i=>i<161||i>1114109?!1:He(Pt,i),or=i=>i<Ft||i>Kt?!1:He(Ot,i),nr=i=>i<At||i>Rt?!1:He(_t,i),ar=i=>i<zt||i>Et?!1:He(qt,i),ur=i=>i>=$t&&i<=Vt?!0:i<It||i>Ut?!1:He(Cu,i);function gr(i){return er(i)?"ambiguous":or(i)?"fullwidth":nr(i)?"halfwidth":ar(i)?"narrow":ur(i)?"wide":"neutral"}function dr(i){if(!Number.isSafeInteger(i))throw new TypeError(`Expected a code point, got \`${typeof i}\`.`)}function Xu(i){return dr(i),gr(i)}const sa=new Map,tr=i=>[i.ambiguousIsNarrow?1:0,i.control,i.fullWidth,i.regular,i.wide].join("|"),rr=i=>{const e=tr(i.width);let o=sa.get(e);return o||(o=new Map,sa.set(e,o)),o},We=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Hu=i=>i>=32&&i<=126?"latin":i===8203||i===8204||i===8205||i===8288?"zero":i<=31||i>=127&&i<=159?"control":i>=160&&i<=255||i>=9472&&i<=9599?"latin":i>=4352&&i<=4607||i>=11904&&i<=40959||i>=44032&&i<=55215||i>=63744&&i<=64255||i>=65280&&i<=65519&&!(i>=65377&&i<=65439)||i>=12352&&i<=12543?"wide":i===8230?"latin":"other",sr=(i,e)=>{const o=rr(e),n=Math.floor(i/65536),a=i%65536;let u=o.get(n);if(u||(u=new Map,o.set(n,u)),u.has(a))return u.get(a);let g;switch(Hu(i)){case"control":{g=e.width.control;break}case"latin":{g=e.width.regular;break}case"wide":{g=e.width.wide;break}case"zero":{g=0;break}default:switch(Xu(i)){case"ambiguous":{g=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{g=e.width.fullWidth;break}case"wide":{g=e.width.wide;break}default:g=e.width.regular}}return u.set(a,g),g},hr=i=>i>=768&&i<=879||i>=6832&&i<=6911||i>=7616&&i<=7679||i>=8400&&i<=8447||i>=65056&&i<=65071||i>=917760&&i<=917999||i>=65024&&i<=65039||i>=3633&&i<=3642||i>=3655&&i<=3662||i>=3761&&i<=3769||i>=3771&&i<=3772||i>=3784&&i<=3789||i>=2304&&i<=2307||i>=2362&&i<=2383||i>=2385&&i<=2391||i>=2402&&i<=2403||i>=2433&&i<=2435||i>=2492&&i<=2500||i>=2509&&i<=2509||i>=2561&&i<=2563||i>=2620&&i<=2637||i>=1611&&i<=1631||i>=1648&&i<=1648||i>=1750&&i<=1773||i>=2276&&i<=2302||i>=1425&&i<=1469||i>=1471&&i<=1471||i>=1473&&i<=1474||i>=1476&&i<=1477||i>=1479&&i<=1479||i>=3893&&i<=3893||i>=3895&&i<=3895||i>=3897&&i<=3897||i>=3953&&i<=3966||i>=3968&&i<=3972||i>=3974&&i<=3975?!0:i>=768&&i<=777||i>=803&&i<=803,Ao=(i,e={})=>{if(!i||i.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const o={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?Ao(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},n=Math.max(0,o.truncation.limit-o.truncation.ellipsisWidth),{length:a}=i,u=a>1e4;let g=0,d=0,r=a,s=!1;const l=i.includes("\x1B")||i.includes("›");for(;g<a;){if(l&&(i[g]==="\x1B"||i[g]==="›")){if(i.startsWith("\x1B]8;;",g)){const p="\x1B]8;;\x07",j=p.length,L=i.indexOf("\x07",g+5);if(L!==-1){const A=i.indexOf(p,L+1);if(A!==-1){const R=A+j,E=i.slice(L+1,A).replace(pe,""),Q=Ao(E,{ambiguousIsNarrow:o.width.ambiguousIsNarrow,ansiWidth:o.width.ansi,controlWidth:o.width.control,countAnsiEscapeCodes:!1,ellipsis:o.truncation.ellipsis,ellipsisWidth:o.truncation.ellipsisWidth,emojiWidth:o.width.emoji,fullWidth:o.width.fullWidth,halfWidth:o.width.halfWidth,limit:Math.max(0,n-d),regularWidth:o.width.regular,tabWidth:o.width.tab,wideWidth:o.width.wide}),q=Q.width;if(Q.truncated)s=!0,r=Math.min(r,g);else if(d+q>n&&(r=Math.min(r,g),s=!0,d+q>o.truncation.limit))break;if(d+=q,g=R,s&&d>=o.truncation.limit)break;continue}}}if(pe.lastIndex=g,pe.test(i)){const p=pe.lastIndex-g,j=o.truncation.countAnsiEscapeCodes?p:o.width.ansi;if(d+j>n&&(r=Math.min(r,g),d+j>o.truncation.limit)){s=!0;break}d+=j,g=pe.lastIndex;continue}}const y=i.codePointAt(g);if(y===8203||y===65279||y>=8288&&y<=8292){g+=1;continue}if(y===9){if(d+o.width.tab>n&&(r=Math.min(r,g),d+o.width.tab>o.truncation.limit)){s=!0;break}d+=o.width.tab,g+=1;continue}if(We.lastIndex=g,We.test(i)){const p=(We.lastIndex-g)*o.width.regular;if(d+p>n){const j=Math.floor((n-d)/o.width.regular);if(r=Math.min(r,g+j),d+p>o.truncation.limit){s=!0;break}}d+=p,g=We.lastIndex;continue}if((y<=31||y>=127&&y<=159)&&(xe.lastIndex=g,xe.test(i))){const p=(xe.lastIndex-g)*o.width.control;if(d+p>n&&(r=Math.min(r,g+Math.floor((n-d)/o.width.control)),d+p>o.truncation.limit)){s=!0;break}d+=p,g=xe.lastIndex;continue}if(Co.lastIndex=g,Co.test(i)){if(d+o.width.emoji>n&&(r=Math.min(r,g),d+o.width.emoji>o.truncation.limit)){s=!0;break}d+=o.width.emoji,g=Co.lastIndex;continue}const c=i.codePointAt(g)??0;if(hr(c)){g+=c>65535?2:1;continue}let b;if(u)b=sr(c,o);else switch(Hu(c)){case"control":{b=o.width.control;break}case"latin":{b=o.width.regular;break}case"wide":{b=o.width.wide;break}case"zero":{b=0;break}default:switch(Xu(c)){case"ambiguous":{b=o.width.ambiguousIsNarrow?o.width.regular:o.width.wide;break}case"fullwidth":{b=o.width.fullWidth;break}case"wide":{b=o.width.wide;break}default:b=o.width.regular}}if(d+b>n&&(r=Math.min(r,g),d+b>o.truncation.limit)){s=!0;break}d+=b,g+=c>65535?2:1}let h=d,v=!1;return s&&o.truncation.limit>=o.truncation.ellipsisWidth&&(h=o.truncation.limit,v=!0),{ellipsed:v,index:s?r:a,truncated:s,width:h}},lr=(i,e={})=>Ao(i,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,vr=Gt(import.meta.url),we=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yr=i=>{if(typeof we<"u"&&we.versions&&we.versions.node){const[e,o]=we.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return we.getBuiltinModule(i)}return vr(i)};yr("node:util");function cr(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Xo,ha;function br(){if(ha)return Xo;ha=1,Xo=e;function i(n){return n instanceof Buffer?Buffer.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function e(n){if(n=n||{},n.circles)return o(n);const a=new Map;if(a.set(Date,s=>new Date(s)),a.set(Map,(s,l)=>new Map(g(Array.from(s),l))),a.set(Set,(s,l)=>new Set(g(Array.from(s),l))),n.constructorHandlers)for(const s of n.constructorHandlers)a.set(s[0],s[1]);let u=null;return n.proto?r:d;function g(s,l){const h=Object.keys(s),v=new Array(h.length);for(let y=0;y<h.length;y++){const c=h[y],b=s[c];typeof b!="object"||b===null?v[c]=b:b.constructor!==Object&&(u=a.get(b.constructor))?v[c]=u(b,l):ArrayBuffer.isView(b)?v[c]=i(b):v[c]=l(b)}return v}function d(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return g(s,d);if(s.constructor!==Object&&(u=a.get(s.constructor)))return u(s,d);const l={};for(const h in s){if(Object.hasOwnProperty.call(s,h)===!1)continue;const v=s[h];typeof v!="object"||v===null?l[h]=v:v.constructor!==Object&&(u=a.get(v.constructor))?l[h]=u(v,d):ArrayBuffer.isView(v)?l[h]=i(v):l[h]=d(v)}return l}function r(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return g(s,r);if(s.constructor!==Object&&(u=a.get(s.constructor)))return u(s,r);const l={};for(const h in s){const v=s[h];typeof v!="object"||v===null?l[h]=v:v.constructor!==Object&&(u=a.get(v.constructor))?l[h]=u(v,r):ArrayBuffer.isView(v)?l[h]=i(v):l[h]=r(v)}return l}}function o(n){const a=[],u=[],g=new Map;if(g.set(Date,h=>new Date(h)),g.set(Map,(h,v)=>new Map(r(Array.from(h),v))),g.set(Set,(h,v)=>new Set(r(Array.from(h),v))),n.constructorHandlers)for(const h of n.constructorHandlers)g.set(h[0],h[1]);let d=null;return n.proto?l:s;function r(h,v){const y=Object.keys(h),c=new Array(y.length);for(let b=0;b<y.length;b++){const p=y[b],j=h[p];if(typeof j!="object"||j===null)c[p]=j;else if(j.constructor!==Object&&(d=g.get(j.constructor)))c[p]=d(j,v);else if(ArrayBuffer.isView(j))c[p]=i(j);else{const L=a.indexOf(j);L!==-1?c[p]=u[L]:c[p]=v(j)}}return c}function s(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return r(h,s);if(h.constructor!==Object&&(d=g.get(h.constructor)))return d(h,s);const v={};a.push(h),u.push(v);for(const y in h){if(Object.hasOwnProperty.call(h,y)===!1)continue;const c=h[y];if(typeof c!="object"||c===null)v[y]=c;else if(c.constructor!==Object&&(d=g.get(c.constructor)))v[y]=d(c,s);else if(ArrayBuffer.isView(c))v[y]=i(c);else{const b=a.indexOf(c);b!==-1?v[y]=u[b]:v[y]=s(c)}}return a.pop(),u.pop(),v}function l(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return r(h,l);if(h.constructor!==Object&&(d=g.get(h.constructor)))return d(h,l);const v={};a.push(h),u.push(v);for(const y in h){const c=h[y];if(typeof c!="object"||c===null)v[y]=c;else if(c.constructor!==Object&&(d=g.get(c.constructor)))v[y]=d(c,l);else if(ArrayBuffer.isView(c))v[y]=i(c);else{const b=a.indexOf(c);b!==-1?v[y]=u[b]:v[y]=l(c)}}return a.pop(),u.pop(),v}}return Xo}var pr=br();const Du=cr(pr);Du();var Tu=typeof global=="object"&&global&&global.Object===Object&&global,wr=typeof self=="object"&&self&&self.Object===Object&&self,K=Tu||wr||Function("return this")(),z=K.Symbol,Bu=Object.prototype,jr=Bu.hasOwnProperty,mr=Bu.toString,je=z?z.toStringTag:void 0;function fr(i){var e=jr.call(i,je),o=i[je];try{i[je]=void 0;var n=!0}catch{}var a=mr.call(i);return n&&(e?i[je]=o:delete i[je]),a}var Yr=Object.prototype,kr=Yr.toString;function Lr(i){return kr.call(i)}var Zr="[object Null]",Sr="[object Undefined]",la=z?z.toStringTag:void 0;function $(i){return i==null?i===void 0?Sr:Zr:la&&la in Object(i)?fr(i):Lr(i)}function W(i){return i!=null&&typeof i=="object"}var Jr="[object Symbol]";function ui(i){return typeof i=="symbol"||W(i)&&$(i)==Jr}var Cr=NaN;function va(i){return typeof i=="number"?i:ui(i)?Cr:+i}function M(i,e){for(var o=-1,n=i==null?0:i.length,a=Array(n);++o<n;)a[o]=e(i[o],o,i);return a}var k=Array.isArray,ya=z?z.prototype:void 0,ca=ya?ya.toString:void 0;function gi(i){if(typeof i=="string")return i;if(k(i))return M(i,gi)+"";if(ui(i))return ca?ca.call(i):"";var e=i+"";return e=="0"&&1/i==-1/0?"-0":e}function oo(i,e){return function(o,n){var a;if(o===void 0&&n===void 0)return e;if(o!==void 0&&(a=o),n!==void 0){if(a===void 0)return n;typeof o=="string"||typeof n=="string"?(o=gi(o),n=gi(n)):(o=va(o),n=va(n)),a=i(o,n)}return a}}var Xr=oo(function(i,e){return i+e},0),Hr=/\s/;function Qu(i){for(var e=i.length;e--&&Hr.test(i.charAt(e)););return e}var Dr=/^\s+/;function Mu(i){return i&&i.slice(0,Qu(i)+1).replace(Dr,"")}function G(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}var ba=NaN,Tr=/^[-+]0x[0-9a-f]+$/i,Br=/^0b[01]+$/i,Qr=/^0o[0-7]+$/i,Mr=parseInt;function si(i){if(typeof i=="number")return i;if(ui(i))return ba;if(G(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=G(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=Mu(i);var o=Br.test(i);return o||Qr.test(i)?Mr(i.slice(2),o?2:8):Tr.test(i)?ba:+i}var pa=1/0,Gr=17976931348623157e292;function Ci(i){if(!i)return i===0?i:0;if(i=si(i),i===pa||i===-pa){var e=i<0?-1:1;return e*Gr}return i===i?i:0}function Z(i){var e=Ci(i),o=e%1;return e===e?o?e-o:e:0}var Nr="Expected a function";function xr(i,e){if(typeof e!="function")throw new TypeError(Nr);return i=Z(i),function(){if(--i<1)return e.apply(this,arguments)}}function oi(i){return i}var Wr="[object AsyncFunction]",Pr="[object Function]",Fr="[object GeneratorFunction]",Kr="[object Proxy]";function Xi(i){if(!G(i))return!1;var e=$(i);return e==Pr||e==Fr||e==Wr||e==Kr}var Re=K["__core-js_shared__"],wa=(function(){var i=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function Or(i){return!!wa&&wa in i}var Ar=Function.prototype,Rr=Ar.toString;function qi(i){if(i!=null){try{return Rr.call(i)}catch{}try{return i+""}catch{}}return""}var _r=/[\\^$.*+?()[\]{}|]/g,zr=/^\[object .+?Constructor\]$/,Er=Function.prototype,qr=Object.prototype,Ir=Er.toString,Ur=qr.hasOwnProperty,$r=RegExp("^"+Ir.call(Ur).replace(_r,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gu(i){if(!G(i)||Or(i))return!1;var e=Xi(i)?$r:zr;return e.test(qi(i))}function Vr(i,e){return i?.[e]}function Ii(i,e){var o=Vr(i,e);return Gu(o)?o:void 0}var Le=Ii(K,"WeakMap"),$e=Le&&new Le,Nu=$e?function(i,e){return $e.set(i,e),i}:oi,ja=Object.create,de=(function(){function i(){}return function(e){if(!G(e))return{};if(ja)return ja(e);i.prototype=e;var o=new i;return i.prototype=void 0,o}})();function Ze(i){return function(){var e=arguments;switch(e.length){case 0:return new i;case 1:return new i(e[0]);case 2:return new i(e[0],e[1]);case 3:return new i(e[0],e[1],e[2]);case 4:return new i(e[0],e[1],e[2],e[3]);case 5:return new i(e[0],e[1],e[2],e[3],e[4]);case 6:return new i(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new i(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var o=de(i.prototype),n=i.apply(o,e);return G(n)?n:o}}var is=1;function es(i,e,o){var n=e&is,a=Ze(i);function u(){var g=this&&this!==K&&this instanceof u?a:i;return g.apply(n?o:this,arguments)}return u}function di(i,e,o){switch(o.length){case 0:return i.call(e);case 1:return i.call(e,o[0]);case 2:return i.call(e,o[0],o[1]);case 3:return i.call(e,o[0],o[1],o[2])}return i.apply(e,o)}var os=Math.max;function xu(i,e,o,n){for(var a=-1,u=i.length,g=o.length,d=-1,r=e.length,s=os(u-g,0),l=Array(r+s),h=!n;++d<r;)l[d]=e[d];for(;++a<g;)(h||a<u)&&(l[o[a]]=i[a]);for(;s--;)l[d++]=i[a++];return l}var ns=Math.max;function Wu(i,e,o,n){for(var a=-1,u=i.length,g=-1,d=o.length,r=-1,s=e.length,l=ns(u-d,0),h=Array(l+s),v=!n;++a<l;)h[a]=i[a];for(var y=a;++r<s;)h[y+r]=e[r];for(;++g<d;)(v||a<u)&&(h[y+o[g]]=i[a++]);return h}function as(i,e){for(var o=i.length,n=0;o--;)i[o]===e&&++n;return n}function no(){}var us=4294967295;function J(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=us,this.__views__=[]}J.prototype=de(no.prototype);J.prototype.constructor=J;function dn(){}var tn=$e?function(i){return $e.get(i)}:dn,ne={},gs=Object.prototype,ds=gs.hasOwnProperty;function _e(i){for(var e=i.name+"",o=ne[e],n=ds.call(ne,e)?o.length:0;n--;){var a=o[n],u=a.func;if(u==null||u==i)return a.name}return e}function li(i,e){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}li.prototype=de(no.prototype);li.prototype.constructor=li;function ei(i,e){var o=-1,n=i.length;for(e||(e=Array(n));++o<n;)e[o]=i[o];return e}function Pu(i){if(i instanceof J)return i.clone();var e=new li(i.__wrapped__,i.__chain__);return e.__actions__=ei(i.__actions__),e.__index__=i.__index__,e.__values__=i.__values__,e}var ts=Object.prototype,rs=ts.hasOwnProperty;function t(i){if(W(i)&&!k(i)&&!(i instanceof J)){if(i instanceof li)return i;if(rs.call(i,"__wrapped__"))return Pu(i)}return new li(i)}t.prototype=no.prototype;t.prototype.constructor=t;function Ro(i){var e=_e(i),o=t[e];if(typeof o!="function"||!(e in J.prototype))return!1;if(i===o)return!0;var n=tn(o);return!!n&&i===n[0]}var ss=800,hs=16,ls=Date.now;function Fu(i){var e=0,o=0;return function(){var n=ls(),a=hs-(n-o);if(o=n,a>0){if(++e>=ss)return arguments[0]}else e=0;return i.apply(void 0,arguments)}}var Ku=Fu(Nu),vs=/\{\n\/\* \[wrapped with (.+)\] \*/,ys=/,? & /;function cs(i){var e=i.match(vs);return e?e[1].split(ys):[]}var bs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function ps(i,e){var o=e.length;if(!o)return i;var n=o-1;return e[n]=(o>1?"& ":"")+e[n],e=e.join(o>2?", ":" "),i.replace(bs,`{
4
4
  /* [wrapped with `+e+`] */
@@ -1,2 +1,2 @@
1
- import{p}from"./cli-main.js";import{A as b}from"../packem_shared/pm-runner-D5NWL8yv.js";import{r as m,l as w,L as $}from"../packem_shared/dependency-scan-173U3WXB.js";import{v,m as y,f as C}from"../packem_shared/index-D75r1yKp.js";import{D as S}from"../packem_shared/package-version-DBJLduJL.js";import"../packem_shared/public-api-WqUCiyIe.js";import{e as x}from"../packem_shared/index-BtbefKtY.js";const M=e=>{const s=e.trim();return s===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(s)||/^(?:github|gitlab|bitbucket|gist):/i.test(s)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(s)&&!s.includes("@")?!0:/^https?:\/\//i.test(s)},L=(e,s)=>{for(const t of s)if(t===e||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},D=(e,s,t={})=>{const o=m(e,s);if(!o)return[];let i;try{i=v(y(e,o.file))}catch{return[]}const n=S(i,o.type);if(n.length===0)return[];const c=t.allow??[],l=[],f=new Set;for(const r of n){const a=`${r.name}@${r.version}`;for(const d of[r.dependencies,r.optionalDependencies])if(d){for(const[u,h]of Object.entries(d))if(!L(u,c))for(const k of h){if(!M(k))continue;const g=`${a}->${u}@${k}`;f.has(g)||(f.add(g),l.push({declaredBy:a,packageName:u,source:k}))}}}return l.sort((r,a)=>r.packageName.localeCompare(a.packageName)||r.declaredBy.localeCompare(a.declaredBy))},E=new Set(["firstSeen","publisherChange"]),N=e=>e.severity==="block"&&e.acceptedRisk===void 0,R=e=>{const s=e.security?.policies?.firstSeen?.minutes,t=typeof s=="number"&&s>0,o=e.security?.policies?.publisherChange?.mode==="no-downgrade",i=e.security?.blockExoticSubdeps===!0;return t||o||i},V=async e=>{const{offline:s=!1,packageManager:t,visConfig:o,workspaceRoot:i}=e,n=Date.now();if(!R(o))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const c=m(i,t);if(!c||!C(y(i,c.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=w(i,t,{includeDev:!0}),f=l.length,r=await x({offline:s,packageManager:t,packages:l,workspaceRoot:i},"install",{enabledPolicies:new Set(E),visConfig:o}),a=o.security?.blockExoticSubdeps===!0?D(i,t,{allow:o.security.exoticSubdepsAllow}):[],d=r.some(u=>N(u))||a.length>0;return{decisions:r,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:d?"fail":"pass"}},B=e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,P=e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const s=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${B(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${s}`];const t=[`✗ Lockfile failed supply-chain policy check ${s}`];for(const o of e.decisions)o.severity==="block"&&o.acceptedRisk===void 0&&t.push(` [${o.policy}] ${o.reason}`);for(const o of e.exoticViolations)t.push(` [blockExoticSubdeps] ${o.packageName} pulled from exotic source by ${o.declaredBy}: ${o.source}`);return t},K=async({options:e,visConfig:s,workspaceRoot:t})=>{const o=t??process.cwd(),i=b(o);if(!$[i.name]){p.warn(`Package manager '${i.name}' has no lockfile vis can verify.`);return}const n=await V({offline:!!e.offline,packageManager:i.name,visConfig:s??{},workspaceRoot:o});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
1
+ import{p}from"./cli-main.js";import{A as b}from"../packem_shared/pm-runner-D5NWL8yv.js";import{r as m,l as w,L as $}from"../packem_shared/dependency-scan-7szXDRxn.js";import{v,m as y,f as C}from"../packem_shared/index-D75r1yKp.js";import{D as S}from"../packem_shared/package-version-mvGIa7gN.js";import"../packem_shared/public-api-WqUCiyIe.js";import{e as x}from"../packem_shared/index-BQSyPcXq.js";const M=e=>{const s=e.trim();return s===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(s)||/^(?:github|gitlab|bitbucket|gist):/i.test(s)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(s)&&!s.includes("@")?!0:/^https?:\/\//i.test(s)},L=(e,s)=>{for(const t of s)if(t===e||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},D=(e,s,t={})=>{const o=m(e,s);if(!o)return[];let i;try{i=v(y(e,o.file))}catch{return[]}const n=S(i,o.type);if(n.length===0)return[];const c=t.allow??[],l=[],f=new Set;for(const r of n){const a=`${r.name}@${r.version}`;for(const d of[r.dependencies,r.optionalDependencies])if(d){for(const[u,h]of Object.entries(d))if(!L(u,c))for(const k of h){if(!M(k))continue;const g=`${a}->${u}@${k}`;f.has(g)||(f.add(g),l.push({declaredBy:a,packageName:u,source:k}))}}}return l.sort((r,a)=>r.packageName.localeCompare(a.packageName)||r.declaredBy.localeCompare(a.declaredBy))},E=new Set(["firstSeen","publisherChange"]),N=e=>e.severity==="block"&&e.acceptedRisk===void 0,R=e=>{const s=e.security?.policies?.firstSeen?.minutes,t=typeof s=="number"&&s>0,o=e.security?.policies?.publisherChange?.mode==="no-downgrade",i=e.security?.blockExoticSubdeps===!0;return t||o||i},V=async e=>{const{offline:s=!1,packageManager:t,visConfig:o,workspaceRoot:i}=e,n=Date.now();if(!R(o))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const c=m(i,t);if(!c||!C(y(i,c.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=w(i,t,{includeDev:!0}),f=l.length,r=await x({offline:s,packageManager:t,packages:l,workspaceRoot:i},"install",{enabledPolicies:new Set(E),visConfig:o}),a=o.security?.blockExoticSubdeps===!0?D(i,t,{allow:o.security.exoticSubdepsAllow}):[],d=r.some(u=>N(u))||a.length>0;return{decisions:r,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:d?"fail":"pass"}},B=e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,P=e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const s=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${B(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${s}`];const t=[`✗ Lockfile failed supply-chain policy check ${s}`];for(const o of e.decisions)o.severity==="block"&&o.acceptedRisk===void 0&&t.push(` [${o.policy}] ${o.reason}`);for(const o of e.exoticViolations)t.push(` [blockExoticSubdeps] ${o.packageName} pulled from exotic source by ${o.declaredBy}: ${o.source}`);return t},K=async({options:e,visConfig:s,workspaceRoot:t})=>{const o=t??process.cwd(),i=b(o);if(!$[i.name]){p.warn(`Package manager '${i.name}' has no lockfile vis can verify.`);return}const n=await V({offline:!!e.offline,packageManager:i.name,visConfig:s??{},workspaceRoot:o});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
2
2
  `),n.status==="fail"&&(process.exitCode=1);return}const[c,...l]=P(n);if(n.status==="skipped"){p.info(c);return}if(n.status==="pass"){p.success(c);return}p.error(c);for(const f of l)p.error(f);process.exitCode=1};export{K as default};
@@ -1 +1 @@
1
- import{createRequire as g}from"node:module";import{c as b}from"./compile-cache-B_Vf_WxT.js";import{i as y,h as w,t as $,p as m,c as M,m as R}from"./package-version-DBJLduJL.js";import{I as S}from"./index-B0EsgdzO.js";const _=g(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[s,o]=r.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return r.getBuiltinModule(e)}return _(e)},{createRequire:T}=x("node:module"),O=T(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[s,o]=t.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return t.getBuiltinModule(e)}return O(e)},{execFileSync:j}=f("node:child_process"),{totalmem:q}=f("node:os"),N=/--max-old-space-size=(\d+)/,z=/--max-semi-space-size=(\d+)/,C=e=>Math.floor(q()/1024/1024*e),B=e=>e<=512?4:e<=1024?8:e<=2048?16:e<=4096?32:e<=8192?64:Math.floor(Math.log2(e))*8,d=(e,s)=>{for(const o of s){const n=e.exec(o);if(n)return Number.parseInt(n[1],10)}},E=e=>{const o=[...M()],n=[...y()],a=d(N,o),p=d(z,o);if(a!==void 0&&p!==void 0)return;const l=a??C(.75),h=p??B(l),c=[];if(a===void 0&&c.push(`--max-old-space-size=${String(l)}`),p===void 0&&c.push(`--max-semi-space-size=${String(h)}`),c.length!==0)try{j(w(),[...c,...o,...n.slice(1)],{env:$(),stdio:"inherit"}),m(0)}catch(v){const u=v.status;m(typeof u=="number"?u:1)}},I=()=>{process.env.VIS_VERSION=R()},Y=e=>{!process.stdout.isTTY||S||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${e}\x07`)},L=new Set(["","--help","--version","-h","-v","completion","dlx","exec","x"]),i=process.argv[2]??"";!L.has(i)&&!process.argv.includes("--help")&&!process.argv.includes("-h")&&E();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");I();b();(async()=>{if(i==="__pm-shim"){const{dispatchShim:s}=await import("../packem_chunks/dispatch.js");s(process.argv[3]??"",process.argv.slice(4));return}if(i==="x"){const{runLeanX:s}=await import("../packem_chunks/lean.js");await s(process.argv.slice(3));return}if(i==="exec"||i==="dlx"){const{runExecCli:s}=await import("../packem_chunks/cli-exec.js");await s();return}const{runCli:e}=await import("../packem_chunks/cli-main.js").then(s=>s.aq);await e()})();export{Y as s};
1
+ import{createRequire as g}from"node:module";import{c as b}from"./compile-cache-B_Vf_WxT.js";import{i as y,h as w,t as $,p as m,c as M,m as R}from"./package-version-mvGIa7gN.js";import{I as S}from"./index-B0EsgdzO.js";const _=g(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[s,o]=r.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return r.getBuiltinModule(e)}return _(e)},{createRequire:T}=x("node:module"),O=T(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[s,o]=t.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return t.getBuiltinModule(e)}return O(e)},{execFileSync:j}=f("node:child_process"),{totalmem:q}=f("node:os"),N=/--max-old-space-size=(\d+)/,z=/--max-semi-space-size=(\d+)/,C=e=>Math.floor(q()/1024/1024*e),B=e=>e<=512?4:e<=1024?8:e<=2048?16:e<=4096?32:e<=8192?64:Math.floor(Math.log2(e))*8,d=(e,s)=>{for(const o of s){const n=e.exec(o);if(n)return Number.parseInt(n[1],10)}},E=e=>{const o=[...M()],n=[...y()],a=d(N,o),p=d(z,o);if(a!==void 0&&p!==void 0)return;const l=a??C(.75),h=p??B(l),c=[];if(a===void 0&&c.push(`--max-old-space-size=${String(l)}`),p===void 0&&c.push(`--max-semi-space-size=${String(h)}`),c.length!==0)try{j(w(),[...c,...o,...n.slice(1)],{env:$(),stdio:"inherit"}),m(0)}catch(v){const u=v.status;m(typeof u=="number"?u:1)}},I=()=>{process.env.VIS_VERSION=R()},Y=e=>{!process.stdout.isTTY||S||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${e}\x07`)},L=new Set(["","--help","--version","-h","-v","completion","dlx","exec","x"]),i=process.argv[2]??"";!L.has(i)&&!process.argv.includes("--help")&&!process.argv.includes("-h")&&E();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");I();b();(async()=>{if(i==="__pm-shim"){const{dispatchShim:s}=await import("../packem_chunks/dispatch.js");s(process.argv[3]??"",process.argv.slice(4));return}if(i==="x"){const{runLeanX:s}=await import("../packem_chunks/lean.js");await s(process.argv.slice(3));return}if(i==="exec"||i==="dlx"){const{runExecCli:s}=await import("../packem_chunks/cli-exec.js");await s();return}const{runCli:e}=await import("../packem_chunks/cli-main.js").then(s=>s.aq);await e()})();export{Y as s};
@@ -1,4 +1,4 @@
1
- import{createRequire as ie}from"node:module";import{m as E,v as ue}from"./index-D75r1yKp.js";import{r as le}from"./docker-B2h5KRZH.js";import{a as oe}from"./readJsonSync-DuMMeB3s-wlhgSHes.js";import{e as fe}from"./license-t5KnNX6v.js";import{D as de}from"./package-version-DBJLduJL.js";import"./public-api-WqUCiyIe.js";import{u as he}from"./index-BAe6e0XE.js";const ae=ie(import.meta.url),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,se=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[n,t]=P.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return P.getBuiltinModule(e)}return ae(e)},{randomUUID:pe}=se("node:crypto"),{readdirSync:me}=se("node:fs"),X=e=>e.replaceAll(/[^\w.~-]/g,n=>`%${(n.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),C=(e,n)=>{const t=e.toLowerCase();if(t.startsWith("@")){const s=t.indexOf("/");if(s>0){const r=t.slice(0,s),p=t.slice(s+1);return`pkg:npm/${X(r)}/${X(p)}@${X(n)}`}}return`pkg:npm/${X(t)}@${X(n)}`},m={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},_e=[m.STRING,m.NUMBER,m.BOOLEAN],ge='<?xml version="1.0" encoding="UTF-8"?>',ee=["_selfCloseTag","_attrs"],ye=(e="",n=0)=>e.repeat(n),Y=e=>Array.isArray(e)&&m.ARRAY||typeof e===m.OBJECT&&e!==null&&e._name&&m.JSTOXML_OBJECT||e instanceof Date&&m.DATE||e===null&&m.NULL||typeof e,re=e=>e.startsWith("<![CDATA["),ce=(e="",n={},t)=>{let s=e;if(typeof e===m.STRING){if(re(e))return e;const r=new RegExp(`(${Object.keys(n).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(r,(p,h)=>n[h]||"")}return typeof t=="function"?t(s):s},be=(e={},n,t,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,p])=>({[r]:p}))).reduce((r,p)=>{const h=Object.keys(p)[0],_=p[h];if(typeof t===m.FUNCTION&&t(h,_))return r;const y=n?ce(_,n):_,$=!s&&y===!0?"":`="${y}"`;return r.push(`${h}${$}`),r},[]),$e=(e={},n,t,s)=>{const r=be(e,n,t,s);return r.length===0?"":` ${r.join(" ")}`},Oe=(e={})=>Object.keys(e).map(n=>({_name:n,_content:e[n]})),ve=e=>_e.includes(Y(e)),je=e=>!e.match("<"),ke=({header:e,isOutputStart:n})=>e&&n?typeof e===m.BOOLEAN?ge:e:"",ne={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"},U=(e={},n={})=>{const{depth:t=0,indent:s,_isFirstItem:r,_isOutputStart:p=!0,header:h,attributeReplacements:_={},attributeFilter:y,attributeExplicitTrue:$=!1,contentReplacements:F={},contentMap:M,selfCloseTags:B=!0}=n,J=typeof _=="boolean"&&!_?{}:{...ne,..._},G=typeof F=="boolean"&&!F?{}:{...ne,...F},D=typeof s=="string",k=ye(s,t),W=Y(e),L=ke({header:h,isOutputStart:p}),N=p&&!L&&r&&t===0,R=D&&!N?`
1
+ import{createRequire as ie}from"node:module";import{m as E,v as ue}from"./index-D75r1yKp.js";import{r as le}from"./docker-B2h5KRZH.js";import{a as oe}from"./readJsonSync-DuMMeB3s-wlhgSHes.js";import{e as fe}from"./license-t5KnNX6v.js";import{D as de}from"./package-version-mvGIa7gN.js";import"./public-api-WqUCiyIe.js";import{u as he}from"./index-BAe6e0XE.js";const ae=ie(import.meta.url),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,se=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[n,t]=P.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return P.getBuiltinModule(e)}return ae(e)},{randomUUID:pe}=se("node:crypto"),{readdirSync:me}=se("node:fs"),X=e=>e.replaceAll(/[^\w.~-]/g,n=>`%${(n.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),C=(e,n)=>{const t=e.toLowerCase();if(t.startsWith("@")){const s=t.indexOf("/");if(s>0){const r=t.slice(0,s),p=t.slice(s+1);return`pkg:npm/${X(r)}/${X(p)}@${X(n)}`}}return`pkg:npm/${X(t)}@${X(n)}`},m={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},_e=[m.STRING,m.NUMBER,m.BOOLEAN],ge='<?xml version="1.0" encoding="UTF-8"?>',ee=["_selfCloseTag","_attrs"],ye=(e="",n=0)=>e.repeat(n),Y=e=>Array.isArray(e)&&m.ARRAY||typeof e===m.OBJECT&&e!==null&&e._name&&m.JSTOXML_OBJECT||e instanceof Date&&m.DATE||e===null&&m.NULL||typeof e,re=e=>e.startsWith("<![CDATA["),ce=(e="",n={},t)=>{let s=e;if(typeof e===m.STRING){if(re(e))return e;const r=new RegExp(`(${Object.keys(n).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(r,(p,h)=>n[h]||"")}return typeof t=="function"?t(s):s},be=(e={},n,t,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,p])=>({[r]:p}))).reduce((r,p)=>{const h=Object.keys(p)[0],_=p[h];if(typeof t===m.FUNCTION&&t(h,_))return r;const y=n?ce(_,n):_,$=!s&&y===!0?"":`="${y}"`;return r.push(`${h}${$}`),r},[]),$e=(e={},n,t,s)=>{const r=be(e,n,t,s);return r.length===0?"":` ${r.join(" ")}`},Oe=(e={})=>Object.keys(e).map(n=>({_name:n,_content:e[n]})),ve=e=>_e.includes(Y(e)),je=e=>!e.match("<"),ke=({header:e,isOutputStart:n})=>e&&n?typeof e===m.BOOLEAN?ge:e:"",ne={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"},U=(e={},n={})=>{const{depth:t=0,indent:s,_isFirstItem:r,_isOutputStart:p=!0,header:h,attributeReplacements:_={},attributeFilter:y,attributeExplicitTrue:$=!1,contentReplacements:F={},contentMap:M,selfCloseTags:B=!0}=n,J=typeof _=="boolean"&&!_?{}:{...ne,..._},G=typeof F=="boolean"&&!F?{}:{...ne,...F},D=typeof s=="string",k=ye(s,t),W=Y(e),L=ke({header:h,isOutputStart:p}),N=p&&!L&&r&&t===0,R=D&&!N?`
2
2
  `:"";let b="";switch(W){case m.JSTOXML_OBJECT:{const{_name:f,_content:u}=e;if(u===null&&typeof M!="function"){b=`${R}${k}${f}`;break}if(Array.isArray(u)&&u.every(ve))return u.map(j=>U({_name:f,_content:j},{...n,depth:t,_isOutputStart:!1})).join("");if(ee.includes(f))break;const g=U(u,{...n,depth:t+1,_isOutputStart:N}),w=Y(g),O=je(g),v=re(g),x=`${R}${k}`;if(f==="_comment"){b+=`${x}<!-- ${u} -->`;break}const H=w==="undefined"||g==="",c=B,o=e._selfCloseTag,a=typeof o===m.BOOLEAN?H&&o:H&&c,i=a?"/":"",l=$e(e._attrs,J,y,$),d=`<${f}${l}${i}>`,T=D&&!O&&!v?`
3
3
  ${k}`:"",S=a?"":`${g}${T}</${f}>`;b+=`${x}${d}${S}`;break}case m.OBJECT:{const f=Object.keys(e);b=f.map((u,g)=>{const w={...n,_isFirstItem:g===0,_isLastItem:g+1===f.length,_isOutputStart:N},O={_name:u};if(Y(e[u])===m.OBJECT&&(ee.forEach(v=>{const x=e[u][v];typeof x<"u"&&(O[v]=x,delete e[u][v])}),typeof e[u]._content<"u"&&Object.keys(e[u]).length>1)){const v=Object.assign({},e[u]);delete v._content,O._content=[...Oe(v),e[u]._content]}return typeof O._content>"u"&&(O._content=e[u]),U(O,w)},n).join("");break}case m.FUNCTION:{const f=e(n);b=U(f,n);break}case m.ARRAY:{b=e.map((f,u)=>{const g={...n,_isFirstItem:u===0,_isLastItem:u+1===e.length,_isOutputStart:N};return U(f,g)}).join("");break}default:{b=ce(e,G,M);break}}return`${L}${b}`},Q=e=>{try{return oe(e)}catch{return}},Te=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const n=e.indexOf("/");return n>1&&!e.includes("/",n+1)}return!e.includes("/")},Se=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),Ae=(e,n,t)=>{const s=`${n.replaceAll("/","+")}@${t}`,r=E(e,"node_modules",".pnpm"),p=Q(E(r,s,"node_modules",n,"package.json"));if(p)return p;let h;try{h=me(r)}catch{return}const _=`${s}_`;for(const y of h){if(!y.startsWith(_))continue;const $=Q(E(r,y,"node_modules",n,"package.json"));if($)return $}},we=(e,n,t)=>{const s=Q(E(e,"node_modules",n,"package.json"));return s?.version===t?s:void 0},xe=(e,n,t)=>{if(!(!Te(n)||!Se(t)))return Ae(e,n,t)??we(e,n,t)},De={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Ne={sha256:64,sha384:96,sha512:128},Re=e=>{const n={name:e.name,version:e.version},{integrity:t}=e;return t&&t.hex.length===Ne[t.algorithm]&&(n.hash={alg:De[t.algorithm],content:t.hex}),e.dependencies&&(n.dependencies=e.dependencies),e.peerDependencies&&(n.peerDependencies=e.peerDependencies),e.optionalDependencies&&(n.optionalDependencies=e.optionalDependencies),n},Ce=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Ee=e=>{for(const{file:n,type:t}of Ce){let s;try{s=ue(E(e,n))}catch{continue}const r=new Map;for(const p of de(s,t))r.set(`${p.name}@${p.version}`,Re(p));return{packages:r,type:t}}},Me=e=>{const n=e.indexOf(":");return n<=0?e:e.slice(0,n)==="npm"?e.slice(n+1):e},V=(e,n,t)=>{const s=t.get(e);if(!s||s.size===0)return;if(s.has(n))return n;const r=Me(n);if(r!==n&&s.has(r))return r;const p=[...s];return he.maxSatisfying(p,r,{includePrerelease:!0})||p[0]},Be="1.7",Le="CycloneDX",Ie="http://cyclonedx.org/schema/bom-1.7.schema.json",Ue="@visulima/vis",te=e=>{try{return oe(e)}catch{return}},Fe=e=>{if(e){if(typeof e=="string")return e;if(typeof e=="object"&&e.name)return e.email?`${e.name} <${e.email}>`:e.name}},Je=e=>{if(e)return typeof e=="string"?e:e.url},qe=e=>{if(e)return typeof e=="string"?e:e.url},Pe=e=>{const n=[];e.homepage&&n.push({type:"website",url:e.homepage});const t=Je(e.repository);t&&n.push({type:"vcs",url:t});const s=qe(e.bugs);return s&&n.push({type:"issue-tracker",url:s}),n.length>0?n:void 0},Xe=e=>e==="application"||e==="service"||e==="tool"?"application":"library",K=(e,n)=>{if(!n)return;n.description&&(e.description=n.description);const t=Fe(n.author);t&&(e.author=t);const s=fe(n);s&&(e.licenses=s);const r=Pe(n);r&&(e.externalReferences=r)},tn=e=>{const{focus:n,generatorVersion:t,includeDev:s=!1,now:r=new Date,projectGraph:p,serialNumber:h,workspace:_,workspaceRoot:y}=e,$=n&&n.length>0?[...le(n,p)].sort():Object.keys(_.projects).sort(),F=new Set($),M=new Map;for(const c of $){const o=_.projects[c];o&&M.set(c,te(E(y,o.root,"package.json")))}const B=[],J=new Map;for(const c of $){const o=_.projects[c];if(!o)continue;const a=M.get(c),i=a?.version??"0.0.0",l=C(c,i);J.set(c,l);const d={"bom-ref":l,name:c,purl:l,type:Xe(o.projectType),version:i};K(d,a),B.push(d)}const G=Ee(y),D=new Map,k=new Map;if(G)for(const c of G.packages.values()){D.set(`${c.name}@${c.version}`,c);let o=k.get(c.name);o||(o=new Set,k.set(c.name,o)),o.add(c.version)}const W=[],L=[],N=new Map;for(const c of $){const o=M.get(c);if(!o)continue;const a=[o.dependencies,o.peerDependencies];s&&a.push(o.devDependencies);const i=new Set,l=(d,T)=>{if(T)for(const[S,j]of Object.entries(T)){if(F.has(S)){const I=J.get(S);I&&i.add(I);continue}const A=V(S,j,k);A&&(i.add(C(S,A)),d.push(`${S}@${A}`))}};for(const d of a)l(W,d);l(L,o.optionalDependencies),N.set(c,i)}const R=new Map,b=new Map,f=(c,o)=>{const a=[...c];for(;a.length>0;){const i=a.pop(),l=R.get(i);if(l==="required"||l==="optional"&&o==="optional")continue;R.set(i,o);const d=D.get(i);if(!d)continue;const T=b.get(i)??new Set,S=[d.dependencies,d.peerDependencies];for(const j of S)if(j)for(const[A,I]of Object.entries(j))for(const q of I){const z=V(A,q,k);z&&(T.add(C(A,z)),a.push(`${A}@${z}`))}if(d.optionalDependencies)for(const[j,A]of Object.entries(d.optionalDependencies))for(const I of A){const q=V(j,I,k);q&&(T.add(C(j,q)),L.push(`${j}@${q}`))}T.size>0&&b.set(i,T)}};f(W,"required"),f(L,"optional");const u=[],g=[...R.keys()].sort();for(const c of g){const o=D.get(c);if(!o)continue;const a=C(o.name,o.version),i={"bom-ref":a,name:o.name,purl:a,scope:R.get(c)??"required",type:"library",version:o.version};o.hash&&(i.hashes=[o.hash]),K(i,xe(y,o.name,o.version)),u.push(i)}const w=[];for(const[c,o]of N){const a=J.get(c);if(!a)continue;const i=[...o].sort();w.push(i.length>0?{dependsOn:i,ref:a}:{ref:a})}for(const c of g){const o=D.get(c);if(!o)continue;const a=C(o.name,o.version),i=b.get(c),l=i?[...i].sort():[];w.push(l.length>0?{dependsOn:l,ref:a}:{ref:a})}w.sort((c,o)=>c.ref.localeCompare(o.ref));const O=te(E(y,"package.json")),v=(()=>{if(n?.length===1){const l=B.find(d=>d.name===n[0]);if(l)return{"bom-ref":l["bom-ref"],name:l.name,purl:l.purl,type:l.type,version:l.version}}const c=O?.name??"workspace",o=O?.version??"0.0.0",a=C(c,o),i={"bom-ref":a,name:c,purl:a,type:"application",version:o};return K(i,O),i})(),x=v["bom-ref"],H=x?B.filter(c=>c["bom-ref"]!==x):B;return{$schema:Ie,bomFormat:Le,components:[...H,...u],dependencies:w,metadata:{component:v,lifecycles:[{phase:"build"}],timestamp:r.toISOString(),tools:{components:[{name:Ue,type:"application",...t?{version:t}:{}}]}},serialNumber:h??`urn:uuid:${pe()}`,specVersion:Be,version:1}},sn=e=>{const n={version:e.version??1,xmlns:"http://cyclonedx.org/schema/bom/1.7"};e.serialNumber&&(n.serialNumber=e.serialNumber);const t=[];return e.metadata&&t.push(Ge(e.metadata)),e.components&&e.components.length>0&&t.push({_content:e.components.map(s=>Z(s)),_name:"components"}),e.dependencies&&e.dependencies.length>0&&t.push({_content:e.dependencies.map(s=>He(s)),_name:"dependencies"}),`${U({_attrs:n,_content:t,_name:"bom"},{header:!0,indent:" ",selfCloseTags:!0})}
4
4
  `},Ge=e=>{const n=[];return e.timestamp&&n.push({timestamp:e.timestamp}),e.lifecycles&&e.lifecycles.length>0&&n.push({_content:e.lifecycles.map(t=>{const s=[];return t.phase&&s.push({phase:t.phase}),t.name&&s.push({name:t.name}),t.description&&s.push({description:t.description}),{_content:s,_name:"lifecycle"}}),_name:"lifecycles"}),e.tools?.components&&n.push({_content:[{_content:e.tools.components.map(t=>Z(t)),_name:"components"}],_name:"tools"}),e.component&&n.push(Z(e.component)),{_content:n,_name:"metadata"}},Z=e=>{const n={type:e.type};e["bom-ref"]&&(n["bom-ref"]=e["bom-ref"]);const t=[];e.group&&t.push({group:e.group}),t.push({name:e.name}),e.version&&t.push({version:e.version}),e.description&&t.push({description:e.description}),e.author&&t.push({author:e.author}),e.hashes&&e.hashes.length>0&&t.push({_content:e.hashes.map(r=>({_attrs:{alg:r.alg},_content:r.content,_name:"hash"})),_name:"hashes"});const s=We(e.licenses);return s&&t.push(s),e.purl&&t.push({purl:e.purl}),e.scope&&t.push({scope:e.scope}),e.externalReferences&&e.externalReferences.length>0&&t.push({_content:e.externalReferences.map(r=>({_attrs:{type:r.type},_content:[{url:r.url}],_name:"reference"})),_name:"externalReferences"}),{_attrs:n,_content:t,_name:"component"}},We=e=>{if(!e||e.length===0)return;const n=[];for(const t of e){if("expression"in t){n.push({expression:t.expression});continue}const s=[];"id"in t.license&&t.license.id?s.push({id:t.license.id}):"name"in t.license&&t.license.name&&s.push({name:t.license.name}),n.push({_content:s,_name:"license"})}return{_content:n,_name:"licenses"}},He=e=>e.dependsOn&&e.dependsOn.length>0?{_attrs:{ref:e.ref},_content:e.dependsOn.map(n=>({_attrs:{ref:n},_name:"dependency"})),_name:"dependency"}:{_attrs:{ref:e.ref},_name:"dependency"};export{tn as b,sn as s,C as t};
@@ -1 +1 @@
1
- import{v as u,m as l,f as g}from"./index-D75r1yKp.js";import{D as d}from"./package-version-DBJLduJL.js";import"./public-api-WqUCiyIe.js";import{e as D,W as v}from"../packem_chunks/catalog.js";const w={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},j=o=>{const t=w[o];return t?[...t.aliases??[],t.file].map(e=>({file:e,type:t.type})):[]},m=(o,t)=>{const e=j(t);if(e.length!==0)return e.find(r=>g(l(o,r.file)))??e[e.length-1]},k=o=>{try{return JSON.parse(u(o))}catch{return}},y=o=>{const t=[],e=k(l(o,"package.json"));e&&t.push(e);const r=D(o);let c;if(r?c=r:e?.workspaces&&(Array.isArray(e.workspaces)?c=e.workspaces:e.workspaces.packages&&(c=e.workspaces.packages)),!c)return t;const a=v(o,c);for(const s of a){const n=k(l(o,s,"package.json"));n&&t.push(n)}return t},b=(o,t)=>{const e=new Set,r=[],c=new Map;for(const s of t){const n=c.get(s.name);n?n.push(s):c.set(s.name,[s])}const a=s=>{if(s)for(const n of Object.keys(s))e.has(n)||(e.add(n),r.push(n))};for(const s of y(o))a(s.dependencies),a(s.peerDependencies),a(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),n=c.get(s);if(n){for(const i of n)for(const p of[i.dependencies,i.peerDependencies,i.optionalDependencies])if(p)for(const f of Object.keys(p))e.has(f)||(e.add(f),r.push(f))}}return e},A=(o,t,e={})=>{const r=m(o,t);if(!r)return[];let c;try{c=u(l(o,r.file))}catch{return[]}const a=d(c,r.type);if(a.length===0)return[];const s=e.includeDev??!0?void 0:b(o,a),n=new Set,i=[];for(const p of a){if(s&&!s.has(p.name))continue;const f=`${p.name}@${p.version}`;n.has(f)||(n.add(f),i.push({isDev:!1,name:p.name,version:p.version}))}return i},E=(o,t)=>{const e=m(o,t);if(!e)return[];let r;try{r=u(l(o,e.file))}catch{return[]}const c=d(r,e.type);if(c.length===0)return[];const a=new Map;for(const n of c)a.has(n.name)||a.set(n.name,new Set),a.get(n.name).add(n.version);const s=[];for(const[n,i]of a)i.size<=1||s.push({name:n,versions:[...i]});return s.sort((n,i)=>n.name.localeCompare(i.name))},M=(o,t)=>{const e=m(o,t);if(!e)return;let r;try{r=u(l(o,e.file))}catch{return}const c=d(r,e.type);if(c.length===0)return;const a=[],s=new Set;for(const n of y(o))for(const i of[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies])if(i)for(const[p,f]of Object.entries(i)){const h=`${p}@${f}`;s.has(h)||(s.add(h),a.push({name:p,version:f}))}return{entries:c,roots:a}};export{w as L,M as a,E as f,A as l,m as r};
1
+ import{v as u,m as l,f as g}from"./index-D75r1yKp.js";import{D as d}from"./package-version-mvGIa7gN.js";import"./public-api-WqUCiyIe.js";import{e as D,W as v}from"../packem_chunks/catalog.js";const w={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},j=o=>{const t=w[o];return t?[...t.aliases??[],t.file].map(e=>({file:e,type:t.type})):[]},m=(o,t)=>{const e=j(t);if(e.length!==0)return e.find(r=>g(l(o,r.file)))??e[e.length-1]},k=o=>{try{return JSON.parse(u(o))}catch{return}},y=o=>{const t=[],e=k(l(o,"package.json"));e&&t.push(e);const r=D(o);let c;if(r?c=r:e?.workspaces&&(Array.isArray(e.workspaces)?c=e.workspaces:e.workspaces.packages&&(c=e.workspaces.packages)),!c)return t;const a=v(o,c);for(const s of a){const n=k(l(o,s,"package.json"));n&&t.push(n)}return t},b=(o,t)=>{const e=new Set,r=[],c=new Map;for(const s of t){const n=c.get(s.name);n?n.push(s):c.set(s.name,[s])}const a=s=>{if(s)for(const n of Object.keys(s))e.has(n)||(e.add(n),r.push(n))};for(const s of y(o))a(s.dependencies),a(s.peerDependencies),a(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),n=c.get(s);if(n){for(const i of n)for(const p of[i.dependencies,i.peerDependencies,i.optionalDependencies])if(p)for(const f of Object.keys(p))e.has(f)||(e.add(f),r.push(f))}}return e},A=(o,t,e={})=>{const r=m(o,t);if(!r)return[];let c;try{c=u(l(o,r.file))}catch{return[]}const a=d(c,r.type);if(a.length===0)return[];const s=e.includeDev??!0?void 0:b(o,a),n=new Set,i=[];for(const p of a){if(s&&!s.has(p.name))continue;const f=`${p.name}@${p.version}`;n.has(f)||(n.add(f),i.push({isDev:!1,name:p.name,version:p.version}))}return i},E=(o,t)=>{const e=m(o,t);if(!e)return[];let r;try{r=u(l(o,e.file))}catch{return[]}const c=d(r,e.type);if(c.length===0)return[];const a=new Map;for(const n of c)a.has(n.name)||a.set(n.name,new Set),a.get(n.name).add(n.version);const s=[];for(const[n,i]of a)i.size<=1||s.push({name:n,versions:[...i]});return s.sort((n,i)=>n.name.localeCompare(i.name))},M=(o,t)=>{const e=m(o,t);if(!e)return;let r;try{r=u(l(o,e.file))}catch{return}const c=d(r,e.type);if(c.length===0)return;const a=[],s=new Set;for(const n of y(o))for(const i of[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies])if(i)for(const[p,f]of Object.entries(i)){const h=`${p}@${f}`;s.has(h)||(s.add(h),a.push({name:p,version:f}))}return{entries:c,roots:a}};export{w as L,M as a,E as f,A as l,m as r};
@@ -1 +1 @@
1
- import{m as h,D as k,f as S}from"./provenance-ByHgofYo.js";import{g as $}from"./packument-BFekEvwn.js";import{H as d}from"./en-BRcjb70R.js";import{W as N}from"./build-scripts-CpTeQE1L.js";import{n as v}from"./license-t5KnNX6v.js";import{A as R,B as L,v as D}from"./index-D75r1yKp.js";import{D as A}from"./package-version-DBJLduJL.js";import"./public-api-WqUCiyIe.js";import{L as w}from"./dependency-scan-173U3WXB.js";const m={CRITICAL:0,HIGH:1,LOW:3,MODERATE:2,UNKNOWN:4},oe=(t,e)=>{const n=m[(t.vulnerability.severity??"UNKNOWN").toUpperCase()]??4,s=m[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??4;return n-s||t.packageName.localeCompare(e.packageName)||t.packageVersion.localeCompare(e.packageVersion)},P=(t,e)=>{const n=m[e.toUpperCase()]??2;return(m[t.toUpperCase()]??4)<=n},b=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],g=6e4,W=(t,e,n)=>{for(const s of n)if(s===t||s===`${t}@${e}`||s.endsWith("*")&&t.startsWith(s.slice(0,-1)))return!0;return!1},x=async(t,e)=>{const n=e.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:s}=n,a=n.exclude??[],r=e.security?.acceptedRisks,c=s*g,i=Date.now();return(await h(t.packages,k,async o=>{if(W(o.name,o.version,a))return;const l=await $(o.name,{workspaceRoot:t.workspaceRoot});if(l===void 0)return;const p=l.time?.[o.version];if(p===void 0)return;const u=Date.parse(p);if(Number.isNaN(u))return;const f=i-u;if(f>=c)return;const y=Math.max(0,Math.floor(f/g));return{acceptedRisk:d(o.name,o.version,r,"firstSeen"),data:{ageMinutes:y,minimumMinutes:s,publishedAt:p},packageName:o.name,policy:"firstSeen",reason:`${o.name}@${o.version} was published ${String(y)} min ago — below the ${String(s)} min firstSeen cooldown.`,severity:"block",version:o.version}})).filter(o=>o!==void 0)},O=(t,e)=>{const n=e.security?.policies?.installScripts;if(!n)return[];const s=n.allow??{},a=n.strict===!0;if(!a&&Object.keys(s).length===0)return[];const r=N(t.workspaceRoot,s,{pinVersions:e.security?.pinVersions===!0});if(r.unapproved.length===0)return[];const c=e.security?.acceptedRisks,i=a?"block":"warn";return r.unapproved.map(o=>({acceptedRisk:d(o.name,o.version??"*",c,"installScripts"),data:{hooks:o.hooks},packageName:o.name,policy:"installScripts",reason:`${o.name}${o.version?`@${o.version}`:""} declares unapproved build script(s): ${o.hooks.join(", ")}`,severity:i,version:o.version??"*"}))},U=new Set(["AND","OR"]),E=t=>{const e=t.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(a=>a.trim()).filter(a=>a.length>0),n=[];let s=!1;for(const a of e){const r=a.toUpperCase();if(s){s=!1;continue}if(r==="WITH"){s=!0;continue}if(U.has(r))continue;const c=a.endsWith("+"),i=c?a.slice(0,-1):a,o=v(i)??i;n.push(o),c&&n.push(`${o}-or-later`)}return n},F=t=>{if(typeof t.license=="string"){const e=t.license.trim();return e.length>0?e:void 0}if(t.license&&typeof t.license=="object"&&typeof t.license.type=="string"){const e=t.license.type.trim();if(e.length>0)return e}if(Array.isArray(t.licenses)&&t.licenses.length>0){const e=t.licenses.map(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(e.length>0)return e.length===1?e[0]:`(${e.join(" OR ")})`}},I=(t,e)=>{if(e.length===0)return;const n=new Set(e.map(s=>v(s)??s).map(s=>s.toLowerCase()));for(const s of t)if(n.has(s.toLowerCase()))return s},M=(t,e)=>{if(e.length===0)return;const n=new Set(e.map(s=>v(s)??s).map(s=>s.toLowerCase()));for(const s of t)if(!n.has(s.toLowerCase()))return s},V=(t,e)=>{const n=e.security?.policies?.license;if(!n)return[];const s=n.allow??[],a=n.deny??[];if(s.length===0&&a.length===0)return[];const r=e.security?.acceptedRisks,c=[];for(const i of t.packages){const o=t.manifestData?.get(`${i.name}@${i.version}`),l=o?F(o):void 0;if(!l){s.length>0&&c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{declaredLicense:null},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} declares no license; allow-list mode requires one of: ${s.join(", ")}`,severity:"block",version:i.version});continue}const p=E(l),u=I(p,a);if(u){c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:i.version});continue}const f=M(p,s);f&&c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{allowList:s,declaredLicense:l,unallowedLicense:f},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} uses license '${f}' which is not on the allow-list (declared: ${l})`,severity:"block",version:i.version})}return c},j=6e4,_=(t,e,n)=>{for(const s of n)if(s===t||s===`${t}@${e}`||s.endsWith("*")&&t.startsWith(s.slice(0,-1)))return!0;return!1},H=async(t,e)=>{const n=e.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const s=n.exclude??[],a=typeof n.ignoreAfter=="number"?n.ignoreAfter*j:void 0,r=e.security?.acceptedRisks,c=Date.now();return(await h(t.packages,k,async i=>{if(_(i.name,i.version,s))return;const o=await $(i.name,{workspaceRoot:t.workspaceRoot});if(o===void 0)return;if(a!==void 0){const p=o.time?.[i.version],u=p===void 0?Number.NaN:Date.parse(p);if(!Number.isNaN(u)&&c-u>a)return}if(o.versions[i.version]?.dist?.attestations?.provenance!==void 0)return;const l=S(o,i.version);if(l!==void 0)return{acceptedRisk:d(i.name,i.version,r,"publisherChange"),data:{priorVersionWithProvenance:l},packageName:i.name,policy:"publisherChange",reason:`${i.name}@${i.version} dropped the provenance attestation that ${i.name}@${l} carried — publisher trust downgrade.`,severity:"block",version:i.version}})).filter(i=>i!==void 0)},T=t=>{for(const e of Object.values(w))for(const n of[e.file,...e.aliases??[]])if(t===n||t.endsWith(`/${n}`)||t.endsWith(`.${n}`))return e.type},K=(t,e,n)=>{const s=R(e)?e:L(t,e);let a;try{a=D(s)}catch{return}const r=T(s)??w[n]?.type;if(!r)return;const c=A(a,r);if(c.length===0)return;const i=new Set;for(const o of c)i.add(`${o.name}@${o.version}`);return i},z=(t,e)=>{for(const n of e)if(n===t||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},Y=(t,e)=>{const n=e.security?.policies?.unexpectedDeps;if(!n)return[];const s=n.allow??[],a=n.baselineLockfile;if(s.length===0&&!a)return[];const r=a?K(t.workspaceRoot,a,t.packageManager):void 0,c=e.security?.acceptedRisks,i=[];for(const o of t.packages){const l=s.length===0||z(o.name,s),p=r?r.has(`${o.name}@${o.version}`):!0;if(l&&p)continue;const u=[],f={};l||(u.push(`not on allow-list (${s.length} entr${s.length===1?"y":"ies"})`),f.allowList=s),!p&&r&&(u.push(`not present in baseline lockfile (${a})`),f.baselineLockfile=a),i.push({acceptedRisk:d(o.name,o.version,c,"unexpectedDeps"),data:f,packageName:o.name,policy:"unexpectedDeps",reason:`${o.name}@${o.version} is unexpected: ${u.join("; ")}`,severity:"block",version:o.version})}return i},q=(t,e)=>{if(!t.osvFindings||t.osvFindings.size===0)return[];const n=e.security?.policies?.vulnerability?.failOn,s=e.security?.acceptedRisks,a=[];for(const r of t.packages){const c=t.osvFindings.get(r.name);if(!(!c||c.length===0))for(const i of c){const o=n?P(i.severity,n)?"block":"warn":"info";a.push({acceptedRisk:d(r.name,r.version,s,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:r.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${r.name}@${r.version}: ${i.summary}`,severity:o,version:r.version})}}return a},C=[{evaluate:q,isConfigured:t=>t.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:V,isConfigured:t=>{const e=t.security?.policies?.license;return!!(e&&(e.allow&&e.allow.length>0||e.deny&&e.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:O,isConfigured:t=>{const e=t.security?.policies?.installScripts;return!!(e&&(e.allow&&Object.keys(e.allow).length>0||e.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:Y,isConfigured:t=>{const e=t.security?.policies?.unexpectedDeps;return!!(e&&(e.allow&&e.allow.length>0||typeof e.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:x,isConfigured:t=>{const e=t.security?.policies?.firstSeen?.minutes;return typeof e=="number"&&e>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:H,isConfigured:t=>t.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],B=(t,e,n)=>C.filter(s=>s.surfaces.includes(t)?n!==void 0?n.has(s.name):s.isConfigured(e):!1),re=async(t,e,n)=>{const s=B(e,n.visConfig,n.enabledPolicies),a=[];for(const r of s){if(t.offline&&!r.offlineSupported){a.push({packageName:"*",policy:r.name,reason:`policy.${r.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const c=await r.evaluate(t,n.visConfig);a.push(...c)}catch(c){const i=c instanceof Error?c.message:String(c);a.push({packageName:"*",policy:r.name,reason:`policy.${r.name} failed: ${i}`,severity:"info",version:"*"})}}return a},G=(()=>{const t=new Map;for(const e of b)t.set(e.toLowerCase(),e);return t})(),ae=()=>C.map(t=>t.name),ce=(t,e)=>{if(t===void 0)return;const n=t.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(b);const s=new Set;for(const a of t.split(",").map(r=>r.trim()).filter(r=>r.length>0)){const r=a.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(i,o)=>o.toUpperCase()),c=G.get(r.toLowerCase());c===void 0?e?.(a):s.add(c)}return s};export{oe as c,re as e,ae as g,ce as p,P as s};
1
+ import{m as h,D as k,f as S}from"./provenance-ByHgofYo.js";import{g as $}from"./packument-BFekEvwn.js";import{H as d}from"./en-BRcjb70R.js";import{W as N}from"./build-scripts-CpTeQE1L.js";import{n as v}from"./license-t5KnNX6v.js";import{A as R,B as L,v as D}from"./index-D75r1yKp.js";import{D as A}from"./package-version-mvGIa7gN.js";import"./public-api-WqUCiyIe.js";import{L as w}from"./dependency-scan-7szXDRxn.js";const m={CRITICAL:0,HIGH:1,LOW:3,MODERATE:2,UNKNOWN:4},oe=(t,e)=>{const n=m[(t.vulnerability.severity??"UNKNOWN").toUpperCase()]??4,s=m[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??4;return n-s||t.packageName.localeCompare(e.packageName)||t.packageVersion.localeCompare(e.packageVersion)},P=(t,e)=>{const n=m[e.toUpperCase()]??2;return(m[t.toUpperCase()]??4)<=n},b=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],g=6e4,W=(t,e,n)=>{for(const s of n)if(s===t||s===`${t}@${e}`||s.endsWith("*")&&t.startsWith(s.slice(0,-1)))return!0;return!1},x=async(t,e)=>{const n=e.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:s}=n,a=n.exclude??[],r=e.security?.acceptedRisks,c=s*g,i=Date.now();return(await h(t.packages,k,async o=>{if(W(o.name,o.version,a))return;const l=await $(o.name,{workspaceRoot:t.workspaceRoot});if(l===void 0)return;const p=l.time?.[o.version];if(p===void 0)return;const u=Date.parse(p);if(Number.isNaN(u))return;const f=i-u;if(f>=c)return;const y=Math.max(0,Math.floor(f/g));return{acceptedRisk:d(o.name,o.version,r,"firstSeen"),data:{ageMinutes:y,minimumMinutes:s,publishedAt:p},packageName:o.name,policy:"firstSeen",reason:`${o.name}@${o.version} was published ${String(y)} min ago — below the ${String(s)} min firstSeen cooldown.`,severity:"block",version:o.version}})).filter(o=>o!==void 0)},O=(t,e)=>{const n=e.security?.policies?.installScripts;if(!n)return[];const s=n.allow??{},a=n.strict===!0;if(!a&&Object.keys(s).length===0)return[];const r=N(t.workspaceRoot,s,{pinVersions:e.security?.pinVersions===!0});if(r.unapproved.length===0)return[];const c=e.security?.acceptedRisks,i=a?"block":"warn";return r.unapproved.map(o=>({acceptedRisk:d(o.name,o.version??"*",c,"installScripts"),data:{hooks:o.hooks},packageName:o.name,policy:"installScripts",reason:`${o.name}${o.version?`@${o.version}`:""} declares unapproved build script(s): ${o.hooks.join(", ")}`,severity:i,version:o.version??"*"}))},U=new Set(["AND","OR"]),E=t=>{const e=t.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(a=>a.trim()).filter(a=>a.length>0),n=[];let s=!1;for(const a of e){const r=a.toUpperCase();if(s){s=!1;continue}if(r==="WITH"){s=!0;continue}if(U.has(r))continue;const c=a.endsWith("+"),i=c?a.slice(0,-1):a,o=v(i)??i;n.push(o),c&&n.push(`${o}-or-later`)}return n},F=t=>{if(typeof t.license=="string"){const e=t.license.trim();return e.length>0?e:void 0}if(t.license&&typeof t.license=="object"&&typeof t.license.type=="string"){const e=t.license.type.trim();if(e.length>0)return e}if(Array.isArray(t.licenses)&&t.licenses.length>0){const e=t.licenses.map(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(e.length>0)return e.length===1?e[0]:`(${e.join(" OR ")})`}},I=(t,e)=>{if(e.length===0)return;const n=new Set(e.map(s=>v(s)??s).map(s=>s.toLowerCase()));for(const s of t)if(n.has(s.toLowerCase()))return s},M=(t,e)=>{if(e.length===0)return;const n=new Set(e.map(s=>v(s)??s).map(s=>s.toLowerCase()));for(const s of t)if(!n.has(s.toLowerCase()))return s},V=(t,e)=>{const n=e.security?.policies?.license;if(!n)return[];const s=n.allow??[],a=n.deny??[];if(s.length===0&&a.length===0)return[];const r=e.security?.acceptedRisks,c=[];for(const i of t.packages){const o=t.manifestData?.get(`${i.name}@${i.version}`),l=o?F(o):void 0;if(!l){s.length>0&&c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{declaredLicense:null},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} declares no license; allow-list mode requires one of: ${s.join(", ")}`,severity:"block",version:i.version});continue}const p=E(l),u=I(p,a);if(u){c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:i.version});continue}const f=M(p,s);f&&c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{allowList:s,declaredLicense:l,unallowedLicense:f},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} uses license '${f}' which is not on the allow-list (declared: ${l})`,severity:"block",version:i.version})}return c},j=6e4,_=(t,e,n)=>{for(const s of n)if(s===t||s===`${t}@${e}`||s.endsWith("*")&&t.startsWith(s.slice(0,-1)))return!0;return!1},H=async(t,e)=>{const n=e.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const s=n.exclude??[],a=typeof n.ignoreAfter=="number"?n.ignoreAfter*j:void 0,r=e.security?.acceptedRisks,c=Date.now();return(await h(t.packages,k,async i=>{if(_(i.name,i.version,s))return;const o=await $(i.name,{workspaceRoot:t.workspaceRoot});if(o===void 0)return;if(a!==void 0){const p=o.time?.[i.version],u=p===void 0?Number.NaN:Date.parse(p);if(!Number.isNaN(u)&&c-u>a)return}if(o.versions[i.version]?.dist?.attestations?.provenance!==void 0)return;const l=S(o,i.version);if(l!==void 0)return{acceptedRisk:d(i.name,i.version,r,"publisherChange"),data:{priorVersionWithProvenance:l},packageName:i.name,policy:"publisherChange",reason:`${i.name}@${i.version} dropped the provenance attestation that ${i.name}@${l} carried — publisher trust downgrade.`,severity:"block",version:i.version}})).filter(i=>i!==void 0)},T=t=>{for(const e of Object.values(w))for(const n of[e.file,...e.aliases??[]])if(t===n||t.endsWith(`/${n}`)||t.endsWith(`.${n}`))return e.type},K=(t,e,n)=>{const s=R(e)?e:L(t,e);let a;try{a=D(s)}catch{return}const r=T(s)??w[n]?.type;if(!r)return;const c=A(a,r);if(c.length===0)return;const i=new Set;for(const o of c)i.add(`${o.name}@${o.version}`);return i},z=(t,e)=>{for(const n of e)if(n===t||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},Y=(t,e)=>{const n=e.security?.policies?.unexpectedDeps;if(!n)return[];const s=n.allow??[],a=n.baselineLockfile;if(s.length===0&&!a)return[];const r=a?K(t.workspaceRoot,a,t.packageManager):void 0,c=e.security?.acceptedRisks,i=[];for(const o of t.packages){const l=s.length===0||z(o.name,s),p=r?r.has(`${o.name}@${o.version}`):!0;if(l&&p)continue;const u=[],f={};l||(u.push(`not on allow-list (${s.length} entr${s.length===1?"y":"ies"})`),f.allowList=s),!p&&r&&(u.push(`not present in baseline lockfile (${a})`),f.baselineLockfile=a),i.push({acceptedRisk:d(o.name,o.version,c,"unexpectedDeps"),data:f,packageName:o.name,policy:"unexpectedDeps",reason:`${o.name}@${o.version} is unexpected: ${u.join("; ")}`,severity:"block",version:o.version})}return i},q=(t,e)=>{if(!t.osvFindings||t.osvFindings.size===0)return[];const n=e.security?.policies?.vulnerability?.failOn,s=e.security?.acceptedRisks,a=[];for(const r of t.packages){const c=t.osvFindings.get(r.name);if(!(!c||c.length===0))for(const i of c){const o=n?P(i.severity,n)?"block":"warn":"info";a.push({acceptedRisk:d(r.name,r.version,s,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:r.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${r.name}@${r.version}: ${i.summary}`,severity:o,version:r.version})}}return a},C=[{evaluate:q,isConfigured:t=>t.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:V,isConfigured:t=>{const e=t.security?.policies?.license;return!!(e&&(e.allow&&e.allow.length>0||e.deny&&e.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:O,isConfigured:t=>{const e=t.security?.policies?.installScripts;return!!(e&&(e.allow&&Object.keys(e.allow).length>0||e.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:Y,isConfigured:t=>{const e=t.security?.policies?.unexpectedDeps;return!!(e&&(e.allow&&e.allow.length>0||typeof e.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:x,isConfigured:t=>{const e=t.security?.policies?.firstSeen?.minutes;return typeof e=="number"&&e>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:H,isConfigured:t=>t.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],B=(t,e,n)=>C.filter(s=>s.surfaces.includes(t)?n!==void 0?n.has(s.name):s.isConfigured(e):!1),re=async(t,e,n)=>{const s=B(e,n.visConfig,n.enabledPolicies),a=[];for(const r of s){if(t.offline&&!r.offlineSupported){a.push({packageName:"*",policy:r.name,reason:`policy.${r.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const c=await r.evaluate(t,n.visConfig);a.push(...c)}catch(c){const i=c instanceof Error?c.message:String(c);a.push({packageName:"*",policy:r.name,reason:`policy.${r.name} failed: ${i}`,severity:"info",version:"*"})}}return a},G=(()=>{const t=new Map;for(const e of b)t.set(e.toLowerCase(),e);return t})(),ae=()=>C.map(t=>t.name),ce=(t,e)=>{if(t===void 0)return;const n=t.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(b);const s=new Set;for(const a of t.split(",").map(r=>r.trim()).filter(r=>r.length>0)){const r=a.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(i,o)=>o.toUpperCase()),c=G.get(r.toLowerCase());c===void 0?e?.(a):s.add(c)}return s};export{oe as c,re as e,ae as g,ce as p,P as s};
@@ -1,4 +1,4 @@
1
- import{createRequire as Dt}from"node:module";import{t as fe,g as Tt,p as G,b as jt,i as Ae,a as Rt,h as Bt,c as Wt,u as Se}from"./package-version-DBJLduJL.js";const Ut=Dt(import.meta.url),ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vt=t=>{if(typeof ne<"u"&&ne.versions&&ne.versions.node){const[e,n]=ne.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ne.getBuiltinModule(t)}return Ut(t)},{createRequire:Ce}=Vt("node:module"),zt=16,ge=32,Ft=64,j=128,he="positionals",qt=Ce(import.meta.url),ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gt=t=>{if(typeof ie<"u"&&ie.versions&&ie.versions.node){const[e,n]=ie.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ie.getBuiltinModule(t)}return qt(t)},{createRequire:at}=Gt("node:module"),Ht=globalThis.process??Object.create(null),Me={versions:{}},ke=new Proxy(Ht,{get(t,e){if(e in t)return t[e];if(e in Me)return Me[e]}}),Jt=t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
1
+ import{createRequire as Dt}from"node:module";import{t as fe,g as Tt,p as G,b as jt,i as Ae,a as Rt,h as Bt,c as Wt,u as Se}from"./package-version-mvGIa7gN.js";const Ut=Dt(import.meta.url),ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vt=t=>{if(typeof ne<"u"&&ne.versions&&ne.versions.node){const[e,n]=ne.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ne.getBuiltinModule(t)}return Ut(t)},{createRequire:Ce}=Vt("node:module"),zt=16,ge=32,Ft=64,j=128,he="positionals",qt=Ce(import.meta.url),ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gt=t=>{if(typeof ie<"u"&&ie.versions&&ie.versions.node){const[e,n]=ie.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ie.getBuiltinModule(t)}return qt(t)},{createRequire:at}=Gt("node:module"),Ht=globalThis.process??Object.create(null),Me={versions:{}},ke=new Proxy(Ht,{get(t,e){if(e in t)return t[e];if(e in Me)return Me[e]}}),Jt=t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
2
2
  `),Kt=(t,e,n,i)=>{const s={column:0,line:-1,...t.start},o={...s,...t.end},c=s.line,a=s.column,u=o.line,r=o.column;let l=Math.max(c-(n+1),0),d=Math.min(e.length,u+i);c===-1&&(l=0),u===-1&&(d=e.length);const p=u-c,f={};if(p)for(let h=0;h<=p;h++){const g=h+c;if(!a)f[g]=!0;else if(h===0){const $=e[g-1]?.length;f[g]=[a,($??0)-a+1]}else if(h===p)f[g]=[0,r];else{const $=e[g-h]?.length;f[g]=[0,$]}}else a===r?f[c]=a?[a,0]:!0:f[c]=[a,(r??0)-(a??0)];return{end:d,markerLines:f,start:l}},Yt=ke.platform==="win32"&&!ke.env?.WT_SESSION?">":"❯",Xt=(t,e,n)=>{const i={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:h=>h,marker:h=>h,message:h=>h,...n?.color}},s=typeof e.start.column=="number";let o=(t.includes("\r")?Jt(t):t).split(`
3
3
  `);typeof i.tabWidth=="number"&&t.includes(" ")&&(o=o.map(h=>h.replaceAll(" "," ".repeat(i.tabWidth))));const{end:c,markerLines:a,start:u}=Kt(e,o,i.linesAbove,i.linesBelow),r=String(c).length,{gutter:l,marker:d,message:p}=i.color;let f=o.slice(u,c).map((h,g)=>{const $=u+1+g,w=a[$],y=String($).padStart(r),x=!a[$+1],N=` ${y}${i.showGutter?" |":""}`;if(w){let E="";if(Array.isArray(w)){const I=h.replaceAll(/[^\t]/g," ").slice(0,Math.max(w[0]-1,0)),O=w[1]||1;E=[`
4
4
  `,i.prefix+l(N.replaceAll(/\d/g," "))," ",I,d("^").repeat(O)].join(""),x&&i.message&&(E+=` ${p(i.message)}`)}return[i.prefix+d(Yt),l(N),h.length>0?` ${h}`:"",E].join("")}return`${i.prefix} ${l(N)}${h.length>0?` ${h}`:""}`}).join(`
@@ -1,4 +1,4 @@
1
1
  import{createRequire as Bt}from"node:module";import{F as X,m as B,e as K,H as $,u as He,y as Ut,v as Mt,i as jt}from"./index-D75r1yKp.js";import{N as Wt,a as ze}from"./readJsonSync-DuMMeB3s-wlhgSHes.js";import"./public-api-WqUCiyIe.js";import{a as ve,g as _t}from"./_commonjsHelpers-B5Y90VFO.js";import{r as Ht,a as zt}from"./clean-DWjQl14S.js";const Rt=Bt(import.meta.url),I=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,J=c=>{if(typeof I<"u"&&I.versions&&I.versions.node){const[e,t]=I.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return I.getBuiltinModule(c)}return Rt(c)},{dirname:It}=J("node:path"),We=J("node:url"),{fileURLToPath:kt}=We,_e=J("node:module"),{createRequire:Y}=_e,Yt=J("util"),O=c=>"Deno"in c,N=c=>"Bun"in c,vr=()=>{if(O(globalThis)){const c=globalThis.Deno,e=c.execPath();let t=e;try{const{importMeta:i}=globalThis;i?.url&&(t=i.url)}catch{}return[e,t,...c.args]}return N(globalThis)?globalThis.Bun.process.argv:process.argv},yr=()=>O(globalThis)?globalThis.Deno.cwd():N(globalThis)?globalThis.Bun.process.cwd():process.cwd(),br=()=>{if(O(globalThis)){const c=globalThis.Deno;return new Proxy(c.env.toObject(),{get:(e,t)=>typeof t=="string"?c.env.get(t):e[t],has:(e,t)=>typeof t=="string"?c.env.has(t):t in e,set:(e,t,i)=>typeof t=="string"?(i===void 0||c.env.set(t,i),!0):!1})}return N(globalThis)?globalThis.Bun.process.env:process.env},Cr=()=>O(globalThis)?[]:N(globalThis)?globalThis.Bun.process.execArgv:process.execArgv,Pr=()=>O(globalThis)?globalThis.Deno.execPath():N(globalThis)?globalThis.Bun.process.execPath:process.execPath,Dr=()=>{if(O(globalThis)){const c=globalThis.Deno.build?.os??"unknown";return c==="windows"?"win32":c}return N(globalThis)?globalThis.Bun.platform??"unknown":process.platform},wr=()=>{if(O(globalThis)){const c=globalThis.Deno.build?.arch??"unknown";return c==="x86_64"?"x64":c==="aarch64"?"arm64":c}return N(globalThis)?globalThis.Bun.process.arch:process.arch},xr=(c=0)=>{if(O(globalThis))throw globalThis.Deno.exit(c),new Error("Deno exit failed");if(N(globalThis))throw globalThis.Bun.process.exit(c),new Error("Bun exit failed");process.exit(c)},Ar=(c,e)=>{if(O(globalThis))return()=>{};if(N(globalThis)){try{const i=globalThis.Bun;if(i.process?.on)return i.process.on(c,e),()=>{i.process?.removeListener&&i.process.removeListener(c,e)}}catch{}return()=>{}}const t=process;return t.on(c,e),()=>{t.removeListener(c,e)}},qt=Y(import.meta.url),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ye=c=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[e,t]=k.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return k.getBuiltinModule(c)}return qt(c)},{execFileSync:Vt}=Ye("node:child_process"),{existsSync:be,readFileSync:Kt}=Ye("node:fs"),Jt=["yarn.lock","package-lock.json","pnpm-lock.yaml","npm-shrinkwrap.json","bun.lock","bun.lockb"],Ce=new Set(["bun","npm","pnpm","yarn"]),qe=c=>{const e=Wt(Kt(c,"utf8"));return typeof e?.packageManager=="string"?e.packageManager:void 0},Xt=c=>{let e;if(Jt.forEach(i=>{!e&&be(B(c,i))&&(e=B(c,i))}),e)return e;const t=B(c,"package.json");if(be(t)&&qe(t)!==void 0)return t},Zt=c=>{if(!c)throw new K("Could not find a package manager");if(c.endsWith("package.json")){const e=qe(c);if(e){const t=["npm","yarn","pnpm","bun"].find(i=>e.startsWith(i));if(t)return{packageManager:t,path:$(c)}}}if(c.endsWith("yarn.lock"))return{packageManager:"yarn",path:$(c)};if(c.endsWith("package-lock.json")||c.endsWith("npm-shrinkwrap.json"))return{packageManager:"npm",path:$(c)};if(c.endsWith("pnpm-lock.yaml"))return{packageManager:"pnpm",path:$(c)};if(c.endsWith("bun.lock")||c.endsWith("bun.lockb"))return{packageManager:"bun",path:$(c)};throw new K("Could not find a package manager")},Qt=c=>{const e=X(Xt,{...c&&{cwd:c}});return Zt(e)},Er=c=>{if(!Ce.has(c))throw new Error(`Unsupported package manager "${c}". Expected one of: ${[...Ce].join(", ")}.`);return Vt(c,["--version"]).toString("utf8").trim()},ei=Y(import.meta.url),U=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ve=c=>{if(typeof U<"u"&&U.versions&&U.versions.node){const[e,t]=U.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return U.getBuiltinModule(c)}return ei(c)};Ve("node:fs");Ve("node:fs/promises");const ti={sha256:"sha256",sha384:"sha384",sha512:"sha512"},ii=1024,ri=/^[A-Z0-9+/]+={0,2}$/i,Pe="node_modules/",H=/^['"]/,z=/['"]$/,si=/^[a-z][a-zA-Z0-9]*:\s*$/m,ni=/resolution:\s*\{[^}]*integrity:\s*([^,}\s]+)/,oi=/^["']?((?:@[^/@"']+\/)?[^@"'\n]+)@[^\n]+\n((?:[\t ][^\n]*(?:\n|$))+)/gm,ai=/^\s+version:?\s+"?([^"\n]+)"?/m,li=/^\s+integrity[\s:]+"?([^"\s]+)"?/m,Z=c=>{if(c.length>ii)return;const e=c.indexOf("-");if(e<=0)return;const t=ti[c.slice(0,e).toLowerCase()];if(!t)return;const i=c.slice(e+1);if(ri.test(i))try{const s=Buffer.from(i,"base64");return s.length===0?void 0:{algorithm:t,hex:s.toString("hex")}}catch{return}},Q=(c,e,t)=>{const i=`${t.name}@${t.version}`;e.has(i)||(e.add(i),c.push(t))},x=(c,e,t)=>{t&&Object.keys(t).length>0&&(c[e]={...t})},R=c=>{if(!c)return;const e={};for(const[t,i]of Object.entries(c))e[t]=[i];return Object.keys(e).length>0?e:void 0},ci=c=>{const e=[],t=new Set;let i;try{i=JSON.parse(c)}catch{return e}if(!i.packages)return e;for(const[s,r]of Object.entries(i.packages)){if(!s||!r.version)continue;const o=s.lastIndexOf(Pe);if(o===-1)continue;const n=s.slice(o+Pe.length);if(n.length===0)continue;const a=n.split("/"),u=n.startsWith("@")?2:1;if(a.length!==u||a.some(v=>v.length===0))continue;const f=r.name??n;if(f.startsWith("."))continue;const g={name:f,version:r.version};if(r.integrity){const v=Z(r.integrity);v&&(g.integrity=v)}x(g,"dependencies",R(r.dependencies)),x(g,"peerDependencies",R(r.peerDependencies)),x(g,"optionalDependencies",R(r.optionalDependencies)),Q(e,t,g)}return e},Ke=c=>{let e=c.trim();e.startsWith("/")&&(e=e.slice(1)),e=e.replace(H,"").replace(z,"");const t=e.indexOf("(");t>0&&(e=e.slice(0,t));const i=e.lastIndexOf("@");if(i<=0)return;const s=e.slice(0,i),r=e.slice(i+1);if(!(!s||!r||r.startsWith("link:")||r.startsWith("workspace:")||r.startsWith("file:")))return{name:s,version:r}},Je=(c,e)=>{const t=new RegExp(String.raw`^${e}:\s*$`,"m").exec(c);if(!t)return;const i=t.index+t[0].length,s=si.exec(c.slice(i));return c.slice(i,s?i+s.index:c.length)},hi=c=>{const e=new Map,t=Je(c,"snapshots");if(!t)return e;const i=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let s;for(;(s=i.exec(t)??void 0)!==void 0;){const r=Ke(s[1]);if(!r)continue;const o=`${r.name}@${r.version}`,n=s[2],a=e.get(o)??{};for(const u of["dependencies","peerDependencies","optionalDependencies"]){const f=q(n,u);if(!f)continue;const g=a[u]??{};for(const[v,y]of Object.entries(f)){const b=g[v]??[];for(const m of y)b.includes(m)||b.push(m);g[v]=b}a[u]=g}e.set(o,a)}return e},ui=c=>{const e=[],t=new Set,i=Je(c,"packages");if(!i)return e;const s=hi(c),r=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let o;for(;(o=r.exec(i)??void 0)!==void 0;){const n=Ke(o[1]);if(!n)continue;const a=o[2],u=ni.exec(a),f={name:n.name,version:n.version};if(u?.[1]){const v=Z(u[1]);v&&(f.integrity=v)}const g=s.get(`${n.name}@${n.version}`);x(f,"dependencies",g?.dependencies??q(a,"dependencies")),x(f,"peerDependencies",g?.peerDependencies??q(a,"peerDependencies")),x(f,"optionalDependencies",g?.optionalDependencies??q(a,"optionalDependencies")),Q(e,t,f)}return e},q=(c,e)=>{const t=new RegExp(String.raw`^ {4}${e}:\s*\n((?: {6,}[^\n]*\n?)+)`,"m").exec(c);if(!t?.[1])return;const i={},s=/^ {6}([^\s:]+):\s*([^\n]+)/gm;let r;for(;(r=s.exec(t[1])??void 0)!==void 0;){const o=r[1].replace(H,"").replace(z,"");let n=r[2].trim();n=n.replace(H,"").replace(z,"");const a=n.indexOf("(");if(a>0&&(n=n.slice(0,a).trim()),!o||!n)continue;const u=i[o]??[];u.includes(n)||u.push(n),i[o]=u}return Object.keys(i).length>0?i:void 0},pi=c=>{const e=[],t=new Set,i=oi;i.lastIndex=0;let s;for(;(s=i.exec(c)??void 0)!==void 0;){const r=s[1].replace(H,"").replace(z,"");if(!r)continue;const o=s[2],n=ai.exec(o);if(!n?.[1])continue;const a={name:r,version:n[1].trim()},u=li.exec(o);if(u?.[1]){const f=Z(u[1]);f&&(a.integrity=f)}x(a,"dependencies",te(o,"dependencies")),x(a,"peerDependencies",te(o,"peerDependencies")),x(a,"optionalDependencies",te(o,"optionalDependencies")),Q(e,t,a)}return e},te=(c,e)=>{const t=new RegExp(String.raw`^ {2}${e}:\s*\n((?: {4,}[^\n]*\n?)+)`,"m").exec(c);if(!t?.[1])return;const i={},s=/^ {4}(['"]?[^\s:'"]+['"]?)\s*(?::\s*)?['"]([^'"\n]+)['"]/gm;let r;for(;(r=s.exec(t[1])??void 0)!==void 0;){const o=r[1].replace(H,"").replace(z,""),n=r[2];if(o&&n){const a=i[o]??[];a.includes(n)||a.push(n),i[o]=a}}return Object.keys(i).length>0?i:void 0},fi=/,(?=\s*[}\]])/g,di=c=>{const e=[],t=new Set;let i;try{i=JSON.parse(c.replaceAll(fi,""))}catch{return e}if(!i.packages)return e;for(const s of Object.values(i.packages)){const r=s[0];if(typeof r!="string")continue;const o=r.indexOf("@",1);if(o<=0)continue;const n=r.slice(0,o),a=r.slice(o+1);if(!n||!a||a.startsWith("workspace:")||a.startsWith("link:")||a.startsWith("file:"))continue;const u={name:n,version:a},f=s[3];if(typeof f=="string"&&f.length>0){const v=Z(f);v&&(u.integrity=v)}const g=s[2];if(g&&typeof g=="object"&&!Array.isArray(g)){const v=g;x(u,"dependencies",R(v.dependencies)),x(u,"peerDependencies",R(v.peerDependencies)),x(u,"optionalDependencies",R(v.optionalDependencies))}Q(e,t,u)}return e},$r=(c,e)=>{switch(e){case"bun":return di(c);case"npm":return ci(c);case"pnpm":return ui(c);case"yarn":return pi(c);default:return[]}},mi=Y(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gi=c=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[e,t]=M.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return M.getBuiltinModule(c)}return mi(c)},{existsSync:De,readFileSync:Li}=gi("node:fs"),Or=c=>{const e=X(["lerna.json","turbo.json"],{type:"file",...c&&{cwd:c}});if(e?.endsWith("lerna.json")){const i=ze(e);if(i.useWorkspaces||i.packages)return{path:$(e),strategy:"lerna"}}const t=e?.endsWith("turbo.json");try{const{packageManager:i,path:s}=Qt(c);if(["npm","yarn"].includes(i)){const r=B(s,"package.json");if(De(r)&&Li(B(s,"package.json"),"utf8").includes("workspaces"))return{path:s,strategy:t?"turbo":i}}else if(i==="pnpm"){const r=B(s,"pnpm-workspace.yaml");if(De(r))return{path:s,strategy:t?"turbo":"pnpm"}}}catch(i){if(!(i instanceof K))throw i}throw new Error(`No monorepo root could be found upwards from the directory ${String(c??process.cwd())} using lerna, yarn, pnpm, or npm as indicators.`)},Si=Y(import.meta.url),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vi=c=>{if(typeof j<"u"&&j.versions&&j.versions.node){const[e,t]=j.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return j.getBuiltinModule(c)}return Si(c)};vi("node:fs");var ie,we;function Xe(){return we||(we=1,ie=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","ALGLIB-Documentation","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Advanced-Cryptics-Dictionary","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BOLA-1.1","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-Tso","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Mark-Modifications","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","Buddy","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CAPEC-tou","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","ESA-PL-permissive-2.4","ESA-PL-strong-copyleft-2.4","ESA-PL-weak-copyleft-2.4","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-SMC","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HPND-sell-variant-critical-systems","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ISO-permission","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-STK","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MMPL-1.0.1","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-TNT","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSC-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OSSP","OpenMDW-1.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","ParaType-Free-Font-1.3","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGMLUG-PM","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TekHVC","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","UnRAR","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","Vixie-Cron","W3C","W3C-19980720","W3C-20150513","WTFNMFPL","WTFPL","Watcom-1.0","Widget-Workshop","WordNet","Wsuipa","X11","X11-distribute-modifications-variant","X11-no-permit-persons","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","hyphen-bulgarian","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"]),ie}var re,xe;function yi(){return xe||(xe=1,re=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"]),re}var se,Ae;function bi(){return Ae||(Ae=1,se=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"]),se}var ne,Ee;function Ci(){if(Ee)return ne;Ee=1;var c=[].concat(Xe()).concat(yi()),e=bi();return ne=function(t){var i=0;function s(){return i<t.length}function r(L){if(L instanceof RegExp){var h=t.slice(i),S=h.match(L);if(S)return i+=S[0].length,S[0]}else if(t.indexOf(L,i)===i)return i+=L.length,L}function o(){r(/[ ]*/)}function n(){for(var L,h=["WITH","AND","OR","(",")",":","+"],S=0;S<h.length&&(L=r(h[S]),!L);S++);if(L==="+"&&i>1&&t[i-2]===" ")throw new Error("Space before `+`");return L&&{type:"OPERATOR",string:L}}function a(){return r(/[A-Za-z0-9-.]+/)}function u(){var L=a();if(!L)throw new Error("Expected idstring at offset "+i);return L}function f(){if(r("DocumentRef-")){var L=u();return{type:"DOCUMENTREF",string:L}}}function g(){if(r("LicenseRef-")){var L=u();return{type:"LICENSEREF",string:L}}}function v(){var L=i,h=a();if(c.indexOf(h)!==-1)return{type:"LICENSE",string:h};if(e.indexOf(h)!==-1)return{type:"EXCEPTION",string:h};i=L}function y(){return n()||f()||g()||v()}for(var b=[];s()&&(o(),!!s());){var m=y();if(!m)throw new Error("Unexpected `"+t[i]+"` at offset "+i);b.push(m)}return b},ne}var oe,$e;function Pi(){return $e||($e=1,oe=function(c){var e=0;function t(){return e<c.length}function i(){return t()?c[e]:null}function s(){if(!t())throw new Error;e++}function r(m){var L=i();if(L&&L.type==="OPERATOR"&&m===L.string)return s(),L.string}function o(){if(r("WITH")){var m=i();if(m&&m.type==="EXCEPTION")return s(),m.string;throw new Error("Expected exception after `WITH`")}}function n(){var m=e,L="",h=i();if(h.type==="DOCUMENTREF"&&(s(),L+="DocumentRef-"+h.string+":",!r(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(h=i(),h.type==="LICENSEREF")return s(),L+="LicenseRef-"+h.string,{license:L};e=m}function a(){var m=i();if(m&&m.type==="LICENSE"){s();var L={license:m.string};r("+")&&(L.plus=!0);var h=o();return h&&(L.exception=h),L}}function u(){var m=r("(");if(m){var L=y();if(!r(")"))throw new Error("Expected `)`");return L}}function f(){return u()||n()||a()}function g(m,L){return function h(){var S=L();if(S){if(!r(m))return S;var C=h();if(!C)throw new Error("Expected expression");return{left:S,conjunction:m.toLowerCase(),right:C}}}}var v=g("AND",f),y=g("OR",v),b=y();if(!b||t())throw new Error("Syntax error");return b}),oe}var ae,Oe;function Ze(){if(Oe)return ae;Oe=1;var c=Ci(),e=Pi();return ae=function(t){return e(c(t))},ae}var le,Ne;function Di(){if(Ne)return le;Ne=1;var c=Ze(),e=Xe();function t(h){try{return c(h),!0}catch{return!1}}function i(h,S){var C=S[0].length-h[0].length;return C!==0?C:h[0].toUpperCase().localeCompare(S[0].toUpperCase())}var s=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(i),r=0,o=1,n=[function(h){return h.toUpperCase()},function(h){return h.trim()},function(h){return h.replace(/\./g,"")},function(h){return h.replace(/\s+/g,"")},function(h){return h.replace(/\s+/g,"-")},function(h){return h.replace("v","-")},function(h){return h.replace(/,?\s*(\d)/,"-$1")},function(h){return h.replace(/,?\s*(\d)/,"-$1.0")},function(h){return h.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(h){return h.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(h){return h[0].toUpperCase()+h.slice(1)},function(h){return h.replace("/","-")},function(h){return h.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(h){return h.indexOf("3.0")!==-1?h+"-or-later":h+"-only"},function(h){return h+"only"},function(h){return h.replace(/(\d)$/,"-$1.0")},function(h){return h.replace(/(-| )?(\d)$/,"-$2-Clause")},function(h){return h.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(h){return h.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(h){return h.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(h){return h.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(h){return h.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(h){return h.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(h){return"CC-"+h},function(h){return"CC-"+h+"-4.0"},function(h){return h.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(h){return"CC-"+h.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],a=e.map(function(h){var S=/^(.*)-\d+\.\d+$/.exec(h);return S?[S[0],S[1]]:[h,null]}).reduce(function(h,S){var C=S[1];return h[C]=h[C]||[],h[C].push(S[0]),h},{}),u=Object.keys(a).map(function(h){return[h,a[h]]}).filter(function(h){return h[1].length===1&&h[0]!==null&&h[0]!=="APL"}).map(function(h){return[h[0],h[1][0]]});a=void 0;var f=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(u).sort(i),g=0,v=1,y=function(h){for(var S=0;S<n.length;S++){var C=n[S](h).trim();if(C!==h&&t(C))return C}return null},b=function(h){for(var S=h.toUpperCase(),C=0;C<f.length;C++){var l=f[C];if(S.indexOf(l[g])>-1)return l[v]}return null},m=function(h,S){for(var C=0;C<s.length;C++){var l=s[C],p=l[r];if(h.indexOf(p)>-1){var d=h.replace(p,l[o]),P=S(d);if(P!==null)return P}}return null};le=function(h,S){S=S||{};var C=S.upgrade===void 0?!0:!!S.upgrade;function l(D){return C?L(D):D}var p=typeof h=="string"&&h.trim().length!==0;if(!p)throw Error("Invalid argument. Expected non-empty string.");if(h=h.trim(),t(h))return l(h);var d=h.replace(/\+$/,"").trim();if(t(d))return l(d);var P=y(h);return P!==null||(P=m(h,function(D){return t(D)?D:y(D)}),P!==null)||(P=b(h),P!==null)||(P=m(h,b),P!==null)?l(P):null};function L(h){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(h)!==-1?h+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(h)!==-1?h.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(h)!==-1?h+"-or-later":h}return le}var ce,Fe;function wi(){if(Fe)return ce;Fe=1;var c=Ze(),e=Di(),t='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',i=/^SEE LICEN[CS]E IN (.+)$/;function s(o,n){return n.slice(0,o.length)===o}function r(o){if(o.hasOwnProperty("license")){var n=o.license;return s("LicenseRef",n)||s("DocumentRef",n)}else return r(o.left)||r(o.right)}return ce=function(o){var n;try{n=c(o)}catch{var a;if(o==="UNLICENSED"||o==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(a=i.exec(o))return{validForOldPackages:!0,validForNewPackages:!0,inFile:a[1]};var u={validForOldPackages:!1,validForNewPackages:!1,warnings:[t]};if(o.trim().length!==0){var f=e(o);f&&u.warnings.push('license is similar to the valid expression "'+f+'"')}return u}return r(n)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[t]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},ce}var Qe={hasSubscribers:!1},w=Qe,G=Qe;import("node:diagnostics_channel").then(c=>{w=c.channel("lru-cache:metrics"),G=c.tracingChannel("lru-cache")}).catch(()=>{});var xi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,he=()=>w.hasSubscribers||G.hasSubscribers,et=new Set,Te=process||{},Ai=(c,e,t,i)=>{typeof Te.emitWarning=="function"?Te.emitWarning(c,e,t,i):console.error(`[${t}] ${e}: ${c}`)},Ei=c=>!et.has(c),T=c=>!!c&&c===Math.floor(c)&&c>0&&isFinite(c),tt=c=>T(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?V:null:null,V=class extends Array{constructor(c){super(c),this.fill(0)}},$i=class _{heap;length;static#s=!1;static create(e){let t=tt(e);if(!t)return[];_.#s=!0;let i=new _(e,t);return _.#s=!1,i}constructor(e,t){if(!_.#s)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Oi=class it{#s;#c;#t;#$;#L;#B;#R;#S;get perf(){return this.#S}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#o;#v;#n;#r;#e;#u;#f;#h;#a;#y;#l;#b;#C;#d;#m;#P;#I;#p;#O;static unsafeExposeInternals(e){return{starts:e.#C,ttls:e.#d,autopurgeTimers:e.#m,sizes:e.#b,keyMap:e.#n,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#f,get head(){return e.#h},get tail(){return e.#a},free:e.#y,isBackgroundFetch:t=>e.#i(t),backgroundFetch:(t,i,s,r)=>e.#M(t,i,s,r),moveToTail:t=>e.#G(t),indexes:t=>e.#D(t),rindexes:t=>e.#w(t),isStale:t=>e.#g(t)}}get max(){return this.#s}get maxSize(){return this.#c}get calculatedSize(){return this.#v}get size(){return this.#o}get fetchMethod(){return this.#B}get memoMethod(){return this.#R}get dispose(){return this.#t}get onInsert(){return this.#$}get disposeAfter(){return this.#L}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:n,allowStale:a,dispose:u,onInsert:f,disposeAfter:g,noDisposeOnSet:v,noUpdateTTL:y,maxSize:b=0,maxEntrySize:m=0,sizeCalculation:L,fetchMethod:h,memoMethod:S,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:l,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:d,ignoreFetchAbort:P,backgroundFetchSize:D=1,perf:A}=e;if(this.backgroundFetchSize=D,A!==void 0&&typeof A?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#S=A??xi,t!==0&&!T(t))throw new TypeError("max option must be a nonnegative integer");let E=t?tt(t):Array;if(!E)throw new Error("invalid max value: "+t);if(this.#s=t,this.#c=b,this.maxEntrySize=m||this.#c,this.sizeCalculation=L,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#R=S,h!==void 0&&typeof h!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#B=h,this.#I=!!h,this.#n=new Map,this.#r=Array.from({length:t}).fill(void 0),this.#e=Array.from({length:t}).fill(void 0),this.#u=new E(t),this.#f=new E(t),this.#h=0,this.#a=0,this.#y=$i.create(t),this.#o=0,this.#v=0,typeof u=="function"&&(this.#t=u),typeof f=="function"&&(this.#$=f),typeof g=="function"?(this.#L=g,this.#l=[]):(this.#L=void 0,this.#l=void 0),this.#P=!!this.#t,this.#O=!!this.#$,this.#p=!!this.#L,this.noDisposeOnSet=!!v,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!d,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!l,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!n,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#j()}if(this.#s===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#s&&!this.#c){let ee="LRU_CACHE_UNBOUNDED";Ei(ee)&&(et.add(ee),Ai("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ee,it))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#j(){let e=new V(this.#s),t=new V(this.#s);this.#d=e,this.#C=t;let i=this.ttlAutopurge?Array.from({length:this.#s}):void 0;this.#m=i,this.#W=(n,a,u=this.#S.now())=>{t[n]=a!==0?u:0,e[n]=a,s(n,a)},this.#N=n=>{t[n]=e[n]!==0?this.#S.now():0,s(n,e[n])};let s=this.ttlAutopurge?(n,a)=>{if(i?.[n]&&(clearTimeout(i[n]),i[n]=void 0),a&&a!==0&&i){let u=setTimeout(()=>{this.#g(n)&&this.#x(this.#r[n],"expire")},a+1);u.unref&&u.unref(),i[n]=u}}:()=>{};this.#A=(n,a)=>{if(e[a]){let u=e[a],f=t[a];if(!u||!f)return;n.ttl=u,n.start=f,n.now=r||o();let g=n.now-f;n.remainingTTL=u-g}};let r=0,o=()=>{let n=this.#S.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n};this.getRemainingTTL=n=>{let a=this.#n.get(n);if(a===void 0)return 0;let u=e[a],f=t[a];if(!u||!f)return 1/0;let g=(r||o())-f;return u-g},this.#g=n=>{let a=t[n],u=e[n];return!!u&&!!a&&(r||o())-a>u}}#N=()=>{};#A=()=>{};#W=()=>{};#g=()=>!1;#V(){let e=new V(this.#s);this.#v=0,this.#b=e,this.#F=t=>{this.#v-=e[t],e[t]=0},this.#_=(t,i,s,r)=>{if(!T(s)){if(this.#i(i))return this.backgroundFetchSize;if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(i,t),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#k=(t,i,s)=>{if(e[t]=i,this.#c){let r=this.#c-e[t];for(;this.#v>r;)this.#U(!0)}this.#v+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#v)}}#F=e=>{};#k=(e,t,i)=>{};#_=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#D({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#a;this.#H(t)&&((e||!this.#g(t))&&(yield t),t!==this.#h);)t=this.#f[t]}*#w({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#h;this.#H(t)&&((e||!this.#g(t))&&(yield t),t!==this.#a);)t=this.#u[t]}#H(e){return e!==void 0&&this.#n.get(this.#r[e])===e}*entries(){for(let e of this.#D())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*rentries(){for(let e of this.#w())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*keys(){for(let e of this.#D()){let t=this.#r[e];t!==void 0&&!this.#i(this.#e[e])&&(yield t)}}*rkeys(){for(let e of this.#w()){let t=this.#r[e];t!==void 0&&!this.#i(this.#e[e])&&(yield t)}}*values(){for(let e of this.#D())this.#e[e]!==void 0&&!this.#i(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#w())this.#e[e]!==void 0&&!this.#i(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#D()){let s=this.#e[i],r=this.#i(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#r[i],this))return this.#T(this.#r[i],t)}}forEach(e,t=this){for(let i of this.#D()){let s=this.#e[i],r=this.#i(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#r[i],this)}}rforEach(e,t=this){for(let i of this.#w()){let s=this.#e[i],r=this.#i(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#r[i],this)}}purgeStale(){let e=!1;for(let t of this.#w({allowStale:!0}))this.#g(t)&&(this.#x(this.#r[t],"expire"),e=!0);return e}info(e){let t=this.#n.get(e);if(t===void 0)return;let i=this.#e[t],s=this.#i(i)?i.__staleWhileFetching:i;if(s===void 0)return;let r={value:s};if(this.#d&&this.#C){let o=this.#d[t],n=this.#C[t];if(o&&n){let a=o-(this.#S.now()-n);r.ttl=a,r.start=Date.now()}}return this.#b&&(r.size=this.#b[t]),r}dump(){let e=[];for(let t of this.#D({allowStale:!0})){let i=this.#r[t],s=this.#e[t],r=this.#i(s)?s.__staleWhileFetching:s;if(r===void 0||i===void 0)continue;let o={value:r};if(this.#d&&this.#C){o.ttl=this.#d[t];let n=this.#S.now()-this.#C[t];o.start=Math.floor(Date.now()-n)}this.#b&&(o.size=this.#b[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#S.now()-s}this.#E(t,i.value,i)}}set(e,t,i={}){let{status:s=w.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let r=this.#E(e,t,i);return s&&w.hasSubscribers&&w.publish(s),r}#E(e,t,i,s){let{ttl:r=this.ttl,start:o,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,f=this.#i(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:g=this.noUpdateTTL}=i;u&&!f&&(u.value=t);let v=this.#_(e,t,i.size||0,a,u);if(this.maxEntrySize&&v>this.maxEntrySize)return this.#x(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let y=this.#o===0?void 0:this.#n.get(e);if(y===void 0)y=this.#o===0?this.#a:this.#y.length!==0?this.#y.pop():this.#o===this.#s?this.#U(!1):this.#o,this.#r[y]=e,this.#e[y]=t,this.#n.set(e,y),this.#u[this.#a]=y,this.#f[y]=this.#a,this.#a=y,this.#o++,this.#k(y,v,u),u&&(u.set="add"),g=!1,this.#O&&!f&&this.#$?.(t,e,"add");else{this.#G(y);let b=this.#e[y];if(t!==b){if(!n)if(this.#i(b)){b!==s&&b.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=b;m!==void 0&&m!==t&&(this.#P&&this.#t?.(m,e,"set"),this.#p&&this.#l?.push([m,e,"set"]))}else this.#P&&this.#t?.(b,e,"set"),this.#p&&this.#l?.push([b,e,"set"]);if(this.#F(y),this.#k(y,v,u),this.#e[y]=t,!f){let m=b&&this.#i(b)?b.__staleWhileFetching:b,L=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=L,m!==void 0&&(u.oldValue=m)),this.#O&&this.onInsert?.(t,e,L)}}else f||(u&&(u.set="update"),this.#O&&this.onInsert?.(t,e,"update"))}if(r!==0&&!this.#d&&this.#j(),this.#d&&(g||this.#W(y,r,o),u&&this.#A(u,y)),!n&&this.#p&&this.#l){let b=this.#l,m;for(;m=b?.shift();)this.#L?.(...m)}return this}pop(){try{for(;this.#o;){let e=this.#e[this.#h];if(this.#U(!0),this.#i(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#l){let e=this.#l,t;for(;t=e?.shift();)this.#L?.(...t)}}}#U(e){let t=this.#h,i=this.#r[t],s=this.#e[t],r=this.#i(s);r&&s.__abortController.abort(new Error("evicted"));let o=r?s.__staleWhileFetching:s;return(this.#P||this.#p)&&o!==void 0&&(this.#P&&this.#t?.(o,i,"evict"),this.#p&&this.#l?.push([o,i,"evict"])),this.#F(t),this.#m?.[t]&&(clearTimeout(this.#m[t]),this.#m[t]=void 0),e&&(this.#r[t]=void 0,this.#e[t]=void 0,this.#y.push(t)),this.#o===1?(this.#h=this.#a=0,this.#y.length=0):this.#h=this.#u[t],this.#n.delete(i),this.#o--,t}has(e,t={}){let{status:i=w.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let s=this.#K(e,t);return w.hasSubscribers&&w.publish(i),s}#K(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,r=this.#n.get(e);if(r!==void 0){let o=this.#e[r];if(this.#i(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#g(r))s&&(s.has="stale",this.#A(s,r));else return i&&this.#N(r),s&&(s.has="hit",this.#A(s,r)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=he()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#J(e,t);return w.hasSubscribers&&w.publish(i),s}#J(e,t){let{status:i,allowStale:s=this.allowStale}=t,r=this.#n.get(e);if(r===void 0||!s&&this.#g(r)){i&&(i.peek=r===void 0?"miss":"stale");return}let o=this.#e[r],n=this.#i(o)?o.__staleWhileFetching:o;return i&&(n!==void 0?(i.peek="hit",i.value=n):i.peek="miss"),n}#M(e,t,i,s){let r=t===void 0?void 0:this.#e[t];if(this.#i(r))return r;let o=new AbortController,{signal:n}=i;n?.addEventListener("abort",()=>o.abort(n.reason),{signal:o.signal});let a={signal:o.signal,options:i,context:s},u=(m,L=!1)=>{let{aborted:h}=o.signal,S=i.ignoreFetchAbort&&m!==void 0,C=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&m!==void 0);if(i.status&&(h&&!L?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),h&&!S&&!L)return g(o.signal.reason,C);let l=y,p=this.#e[t];return(p===y||p===void 0&&S&&L)&&(m===void 0?l.__staleWhileFetching!==void 0?this.#e[t]=l.__staleWhileFetching:this.#x(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#E(e,m,a.options,l))),m},f=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),g(m,!1)),g=(m,L)=>{let{aborted:h}=o.signal,S=h&&i.allowStaleOnFetchAbort,C=S||i.allowStaleOnFetchRejection,l=C||i.noDeleteOnFetchRejection,p=y;if(this.#e[t]===y&&(!l||!L&&p.__staleWhileFetching===void 0?this.#x(e,"fetch"):S||(this.#e[t]=p.__staleWhileFetching)),C)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw m},v=(m,L)=>{let h=this.#B?.(e,r,a);o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=S=>u(S,!0)))}),h&&h instanceof Promise?h.then(S=>m(S===void 0?void 0:S),L):h!==void 0&&m(h)};i.status&&(i.status.fetchDispatched=!0);let y=new Promise(v).then(u,f),b=Object.assign(y,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.#E(e,b,{...a.options,status:void 0}),t=this.#n.get(e)):this.#e[t]=b,b}#i(e){if(!this.#I)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=G.hasSubscribers,{status:s=he()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let r=this.#z(e,t);return s&&i&&(s.trace=!0,G.tracePromise(()=>r,s).catch(()=>{})),r}async#z(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:n=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:v=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:m,forceRefresh:L=!1,status:h,signal:S}=t;if(h&&(h.op="fetch",h.key=e,L&&(h.forceRefresh=!0),h.cache=this),!this.#I)return h&&(h.fetch="get"),this.#T(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:h});let C={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:n,size:a,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:b,ignoreFetchAbort:y,status:h,signal:S},l=this.#n.get(e);if(l===void 0){h&&(h.fetch="miss");let p=this.#M(e,l,C,m);return p.__returned=p}else{let p=this.#e[l];if(this.#i(p)){let A=i&&p.__staleWhileFetching!==void 0;return h&&(h.fetch="inflight",A&&(h.returnedStale=!0)),A?p.__staleWhileFetching:p.__returned=p}let d=this.#g(l);if(!L&&!d)return h&&(h.fetch="hit"),this.#G(l),s&&this.#N(l),h&&this.#A(h,l),p;let P=this.#M(e,l,C,m),D=P.__staleWhileFetching!==void 0&&i;return h&&(h.fetch=d?"stale":"refresh",D&&d&&(h.returnedStale=!0)),D?P.__staleWhileFetching:P.__returned=P}}forceFetch(e,t={}){let i=G.hasSubscribers,{status:s=he()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let r=this.#X(e,t);return s&&i&&(s.trace=!0,G.tracePromise(()=>r,s).catch(()=>{})),r}async#X(e,t={}){let i=await this.#z(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=w.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let s=this.#Z(e,t);return i&&(i.value=s),w.hasSubscribers&&w.publish(i),s}#Z(e,t={}){let i=this.#R;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:r,forceRefresh:o,...n}=t;r&&o&&(r.forceRefresh=!0);let a=this.#T(e,n),u=o||a===void 0;if(r&&(r.memo=u?"miss":"hit",u||(r.value=a)),!u)return a;let f=i(e,a,{options:n,context:s});return r&&(r.value=f),this.#E(e,f,n),f}get(e,t={}){let{status:i=w.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let s=this.#T(e,t);return i&&(s!==void 0&&(i.value=s),w.hasSubscribers&&w.publish(i)),s}#T(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=t,n=this.#n.get(e);if(n===void 0){o&&(o.get="miss");return}let a=this.#e[n],u=this.#i(a);return o&&this.#A(o,n),this.#g(n)?u?(o&&(o.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),a.__staleWhileFetching):void 0):(r||this.#x(e,"expire"),o&&(o.get="stale"),i?(o&&(o.returnedStale=!0),a):void 0):(o&&(o.get=u?"fetching":"hit"),this.#G(n),s&&this.#N(n),u?a.__staleWhileFetching:a)}#Y(e,t){this.#f[t]=e,this.#u[e]=t}#G(e){e!==this.#a&&(e===this.#h?this.#h=this.#u[e]:this.#Y(this.#f[e],this.#u[e]),this.#Y(this.#a,e),this.#a=e)}delete(e){return this.#x(e,"delete")}#x(e,t){w.hasSubscribers&&w.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#o!==0){let s=this.#n.get(e);if(s!==void 0)if(this.#m?.[s]&&(clearTimeout(this.#m?.[s]),this.#m[s]=void 0),i=!0,this.#o===1)this.#q(t);else{this.#F(s);let r=this.#e[s];if(this.#i(r)?r.__abortController.abort(new Error("deleted")):(this.#P||this.#p)&&(this.#P&&this.#t?.(r,e,t),this.#p&&this.#l?.push([r,e,t])),this.#n.delete(e),this.#r[s]=void 0,this.#e[s]=void 0,s===this.#a)this.#a=this.#f[s];else if(s===this.#h)this.#h=this.#u[s];else{let o=this.#f[s];this.#u[o]=this.#u[s];let n=this.#u[s];this.#f[n]=this.#f[s]}this.#o--,this.#y.push(s)}}if(this.#p&&this.#l?.length){let s=this.#l,r;for(;r=s?.shift();)this.#L?.(...r)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#w({allowStale:!0})){let i=this.#e[t];if(this.#i(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#r[t];this.#P&&this.#t?.(i,s,e),this.#p&&this.#l?.push([i,s,e])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#C){this.#d.fill(0),this.#C.fill(0);for(let t of this.#m??[])t!==void 0&&clearTimeout(t);this.#m?.fill(void 0)}if(this.#b&&this.#b.fill(0),this.#h=0,this.#a=0,this.#y.length=0,this.#v=0,this.#o=0,this.#p&&this.#l){let t=this.#l,i;for(;i=t?.shift();)this.#L?.(...i)}}};const Ni=Object.defineProperty({__proto__:null,LRUCache:Oi},Symbol.toStringTag,{value:"Module"}),Fi=ve(Ni);var ue,Ge;function Ti(){if(Ge)return ue;Ge=1;const c=(...r)=>r.every(o=>o)?r.join(""):"",e=r=>r?encodeURIComponent(r):"",t=r=>r.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),i={sshtemplate:({domain:r,user:o,project:n,committish:a})=>`git@${r}:${o}/${n}.git${c("#",a)}`,sshurltemplate:({domain:r,user:o,project:n,committish:a})=>`git+ssh://git@${r}/${o}/${n}.git${c("#",a)}`,edittemplate:({domain:r,user:o,project:n,committish:a,editpath:u,path:f})=>`https://${r}/${o}/${n}${c("/",u,"/",e(a||"HEAD"),"/",f)}`,browsetemplate:({domain:r,user:o,project:n,committish:a,treepath:u})=>`https://${r}/${o}/${n}${c("/",u,"/",e(a))}`,browsetreetemplate:({domain:r,user:o,project:n,committish:a,treepath:u,path:f,fragment:g,hashformat:v})=>`https://${r}/${o}/${n}/${u}/${e(a||"HEAD")}/${f}${c("#",v(g||""))}`,browseblobtemplate:({domain:r,user:o,project:n,committish:a,blobpath:u,path:f,fragment:g,hashformat:v})=>`https://${r}/${o}/${n}/${u}/${e(a||"HEAD")}/${f}${c("#",v(g||""))}`,docstemplate:({domain:r,user:o,project:n,treepath:a,committish:u})=>`https://${r}/${o}/${n}${c("/",a,"/",e(u))}#readme`,httpstemplate:({auth:r,domain:o,user:n,project:a,committish:u})=>`git+https://${c(r,"@")}${o}/${n}/${a}.git${c("#",u)}`,filetemplate:({domain:r,user:o,project:n,committish:a,path:u})=>`https://${r}/${o}/${n}/raw/${e(a||"HEAD")}/${u}`,shortcuttemplate:({type:r,user:o,project:n,committish:a})=>`${r}:${o}/${n}${c("#",a)}`,pathtemplate:({user:r,project:o,committish:n})=>`${r}/${o}${c("#",n)}`,bugstemplate:({domain:r,user:o,project:n})=>`https://${r}/${o}/${n}/issues`,hashformat:t},s={};s.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:r,user:o,project:n,committish:a,path:u})=>`https://${c(r,"@")}raw.githubusercontent.com/${o}/${n}/${e(a||"HEAD")}/${u}`,gittemplate:({auth:r,domain:o,user:n,project:a,committish:u})=>`git://${c(r,"@")}${o}/${n}/${a}.git${c("#",u)}`,tarballtemplate:({domain:r,user:o,project:n,committish:a})=>`https://codeload.${r}/${o}/${n}/tar.gz/${e(a||"HEAD")}`,extract:r=>{let[,o,n,a,u]=r.pathname.split("/",5);if(!(a&&a!=="tree")&&(a||(u=r.hash.slice(1)),n&&n.endsWith(".git")&&(n=n.slice(0,-4)),!(!o||!n)))return{user:o,project:n,committish:u}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:r,user:o,project:n,committish:a,treepath:u,path:f,editpath:g})=>`https://${r}/${o}/${n}${c("/",u,"/",e(a||"HEAD"),"/",f,g)}`,tarballtemplate:({domain:r,user:o,project:n,committish:a})=>`https://${r}/${o}/${n}/get/${e(a||"HEAD")}.tar.gz`,extract:r=>{let[,o,n,a]=r.pathname.split("/",4);if(!["get"].includes(a)&&(n&&n.endsWith(".git")&&(n=n.slice(0,-4)),!(!o||!n)))return{user:o,project:n,committish:r.hash.slice(1)}}},s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:({domain:r,user:o,project:n,committish:a})=>`https://${r}/api/v4/projects/${e(o+"/"+n)}/repository/archive.tar.gz?sha=${e(a||"HEAD")}`,extract:r=>{const o=r.pathname.slice(1);if(o.includes("/-/")||o.includes("/archive.tar.gz"))return;const n=o.split("/");let a=n.pop();a.endsWith(".git")&&(a=a.slice(0,-4));const u=n.join("/");if(!(!u||!a))return{user:u,project:a,committish:r.hash.slice(1)}}},s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:r,project:o,committish:n})=>`git@${r}:${o}.git${c("#",n)}`,sshurltemplate:({domain:r,project:o,committish:n})=>`git+ssh://git@${r}/${o}.git${c("#",n)}`,edittemplate:({domain:r,user:o,project:n,committish:a,editpath:u})=>`https://${r}/${o}/${n}${c("/",e(a))}/${u}`,browsetemplate:({domain:r,project:o,committish:n})=>`https://${r}/${o}${c("/",e(n))}`,browsetreetemplate:({domain:r,project:o,committish:n,path:a,hashformat:u})=>`https://${r}/${o}${c("/",e(n))}${c("#",u(a))}`,browseblobtemplate:({domain:r,project:o,committish:n,path:a,hashformat:u})=>`https://${r}/${o}${c("/",e(n))}${c("#",u(a))}`,docstemplate:({domain:r,project:o,committish:n})=>`https://${r}/${o}${c("/",e(n))}`,httpstemplate:({domain:r,project:o,committish:n})=>`git+https://${r}/${o}.git${c("#",n)}`,filetemplate:({user:r,project:o,committish:n,path:a})=>`https://gist.githubusercontent.com/${r}/${o}/raw${c("/",e(n))}/${a}`,shortcuttemplate:({type:r,project:o,committish:n})=>`${r}:${o}${c("#",n)}`,pathtemplate:({project:r,committish:o})=>`${r}${c("#",o)}`,bugstemplate:({domain:r,project:o})=>`https://${r}/${o}`,gittemplate:({domain:r,project:o,committish:n})=>`git://${r}/${o}.git${c("#",n)}`,tarballtemplate:({project:r,committish:o})=>`https://codeload.github.com/gist/${r}/tar.gz/${e(o||"HEAD")}`,extract:r=>{let[,o,n,a]=r.pathname.split("/",4);if(a!=="raw"){if(!n){if(!o)return;n=o,o=null}return n.endsWith(".git")&&(n=n.slice(0,-4)),{user:o,project:n,committish:r.hash.slice(1)}}},hashformat:function(r){return r&&"file-"+t(r)}},s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:r,user:o,project:n,committish:a,path:u})=>`https://${r}/${o}/${n}/blob/${e(a)||"HEAD"}/${u}`,httpstemplate:({domain:r,user:o,project:n,committish:a})=>`https://${r}/${o}/${n}${c("#",a)}`,tarballtemplate:({domain:r,user:o,project:n,committish:a})=>`https://${r}/${o}/${n}/archive/${e(a)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:r=>{let[,o,n,a]=r.pathname.split("/",4);if(!["archive"].includes(a)&&(n&&n.endsWith(".git")&&(n=n.slice(0,-4)),!(!o||!n)))return{user:o,project:n,committish:r.hash.slice(1)}}};for(const[r,o]of Object.entries(s))s[r]=Object.assign({},i,o);return ue=s,ue}var pe,Be;function rt(){if(Be)return pe;Be=1;const c=(s,r,o)=>{const n=s.indexOf(o);return s.lastIndexOf(r,n>-1?n:1/0)},e=s=>{try{return new URL(s)}catch{}},t=(s,r)=>{const o=s.indexOf(":"),n=s.slice(0,o+1);if(Object.prototype.hasOwnProperty.call(r,n)||s.substr(o,3)==="://")return s;const a=s.indexOf("@");return a>-1?a>o?`git+ssh://${s}`:s:`${s.slice(0,o+1)}//${s.slice(o+1)}`},i=s=>{const r=c(s,"@","#"),o=c(s,":","#");return o>r&&(s=s.slice(0,o)+"/"+s.slice(o+1)),c(s,":","#")===-1&&s.indexOf("//")===-1&&(s=`git+ssh://${s}`),s};return pe=(s,r)=>{const o=r?t(s,r):s;return e(o)||e(i(o))},pe}var fe,Re;function Gi(){if(Re)return fe;Re=1;const c=rt(),e=t=>{const i=t.indexOf("#"),s=t.indexOf("/"),r=t.indexOf("/",s+1),o=t.indexOf(":"),n=/\s/.exec(t),a=t.indexOf("@"),u=!n||i>-1&&n.index>i,f=a===-1||i>-1&&a>i,g=o===-1||i>-1&&o>i,v=r===-1||i>-1&&r>i,y=s>0,b=i>-1?t[i-1]!=="/":!t.endsWith("/"),m=!t.startsWith(".");return u&&y&&b&&m&&f&&g&&v};return fe=(t,i,{gitHosts:s,protocols:r})=>{if(!t)return;const o=e(t)?`github:${t}`:t,n=c(o,r);if(!n)return;const a=s.byShortcut[n.protocol],u=s.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],f=a||u;if(!f)return;const g=s[a||u];let v=null;r[n.protocol]?.auth&&(n.username||n.password)&&(v=`${n.username}${n.password?":"+n.password:""}`);let y=null,b=null,m=null,L=null;try{if(a){let h=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname;const S=h.indexOf("@");S>-1&&(h=h.slice(S+1));const C=h.lastIndexOf("/");C>-1?(b=decodeURIComponent(h.slice(0,C)),b||(b=null),m=decodeURIComponent(h.slice(C+1))):m=decodeURIComponent(h),m.endsWith(".git")&&(m=m.slice(0,-4)),n.hash&&(y=decodeURIComponent(n.hash.slice(1))),L="shortcut"}else{if(!g.protocols.includes(n.protocol))return;const h=g.extract(n);if(!h)return;b=h.user&&decodeURIComponent(h.user),m=decodeURIComponent(h.project),y=decodeURIComponent(h.committish),L=r[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(h){if(h instanceof URIError)return;throw h}return[f,b,v,m,y,L,i]},fe}var de,Ie;function Bi(){if(Ie)return de;Ie=1;const{LRUCache:c}=Fi,e=Ti(),t=Gi(),i=rt(),s=new c({max:1e3});function r(n){try{const{protocol:a,hostname:u,pathname:f}=new URL(n);if(!u)return null;const g=/(?:git\+)http:$/.test(a)?"http:":"https:",v=f.replace(/\.git$/,"");return`${g}//${u}${v}`}catch{return null}}class o{constructor(a,u,f,g,v,y,b={}){Object.assign(this,o.#s[a],{type:a,user:u,auth:f,project:g,committish:v,default:y,opts:b})}static#s={byShortcut:{},byDomain:{}};static#c={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(a,u){o.#s[a]=u,o.#s.byDomain[u.domain]=a,o.#s.byShortcut[`${a}:`]=a,o.#c[`${a}:`]={name:a}}static fromUrl(a,u){if(typeof a!="string")return;const f=a+JSON.stringify(u||{});if(!s.has(f)){const g=t(a,u,{gitHosts:o.#s,protocols:o.#c});s.set(f,g?new o(...g):void 0)}return s.get(f)}static fromManifest(a,u={}){if(!a||typeof a!="object")return;const f=a.repository,g=f&&(typeof f=="string"?f:typeof f=="object"&&typeof f.url=="string"?f.url:null);if(!g)throw new Error("no repository");const v=g&&o.fromUrl(g.replace(/^git\+/,""),u)||null;if(v)return v;const y=r(g);return o.fromUrl(y,u)||y}static parseUrl(a){return i(a)}#t(a,u){if(typeof a!="function")return null;const f={...this,...this.opts,...u};f.path||(f.path=""),f.path.startsWith("/")&&(f.path=f.path.slice(1)),f.noCommittish&&(f.committish=null);const g=a(f);return f.noGitPlus&&g.startsWith("git+")?g.slice(4):g}hash(){return this.committish?`#${this.committish}`:""}ssh(a){return this.#t(this.sshtemplate,a)}sshurl(a){return this.#t(this.sshurltemplate,a)}browse(a,...u){return typeof a!="string"?this.#t(this.browsetemplate,a):typeof u[0]!="string"?this.#t(this.browsetreetemplate,{...u[0],path:a}):this.#t(this.browsetreetemplate,{...u[1],fragment:u[0],path:a})}browseFile(a,...u){return typeof u[0]!="string"?this.#t(this.browseblobtemplate,{...u[0],path:a}):this.#t(this.browseblobtemplate,{...u[1],fragment:u[0],path:a})}docs(a){return this.#t(this.docstemplate,a)}bugs(a){return this.#t(this.bugstemplate,a)}https(a){return this.#t(this.httpstemplate,a)}git(a){return this.#t(this.gittemplate,a)}shortcut(a){return this.#t(this.shortcuttemplate,a)}path(a){return this.#t(this.pathtemplate,a)}tarball(a){return this.#t(this.tarballtemplate,{...a,noCommittish:!1})}file(a,u){return this.#t(this.filetemplate,{...u,path:a})}edit(a,u){return this.#t(this.edittemplate,{...u,path:a})}getDefaultRepresentation(){return this.default}toString(a){return this.default&&typeof this[this.default]=="function"?this[this.default](a):this.sshurl(a)}}for(const[n,a]of Object.entries(e))o.addHost(n,a);return de=o,de}var me,ke;function Ri(){if(ke)return me;ke=1,me=c;function c(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
2
2
  `);let t=0;for(;e[t]&&e[t].trim().match(/^(#|$)/);)t++;const i=e.length;let s=t+1;for(;s<i&&e[s].trim();)s++;return e.slice(t,s).join(" ").trim()}return me}var st={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},nt={web:"url",name:"url"},ot={server:"start",tests:"test"};const Ii={topLevel:st,bugs:nt,script:ot},ki=Object.defineProperty({__proto__:null,bugs:nt,default:Ii,script:ot,topLevel:st},Symbol.toStringTag,{value:"Module"}),Ui=ve(ki);var ge,Ue;function Mi(){if(Ue)return ge;Ue=1;var{URL:c}=We,e=Ht(),t=zt(),i=wi(),s=Bi(),{isBuiltin:r}=_e,o=["dependencies","devDependencies","optionalDependencies"],n=Ri(),a=Ui,u=l=>l.includes("@")&&l.indexOf("@")<l.lastIndexOf(".");ge={warn:function(){},fixRepositoryField:function(l){if(l.repositories&&(this.warn("repositories"),l.repository=l.repositories[0]),!l.repository)return this.warn("missingRepository");typeof l.repository=="string"&&(l.repository={type:"git",url:l.repository});var p=l.repository.url||"";if(p){var d=s.fromUrl(p);d&&(p=l.repository.url=d.getDefaultRepresentation()==="shortcut"?d.https():d.toString())}p.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",p)},fixTypos:function(l){Object.keys(a.topLevel).forEach(function(p){Object.prototype.hasOwnProperty.call(l,p)&&this.warn("typo",p,a.topLevel[p])},this)},fixScriptsField:function(l){if(l.scripts){if(typeof l.scripts!="object"){this.warn("nonObjectScripts"),delete l.scripts;return}Object.keys(l.scripts).forEach(function(p){typeof l.scripts[p]!="string"?(this.warn("nonStringScript"),delete l.scripts[p]):a.script[p]&&!l.scripts[a.script[p]]&&this.warn("typo",p,a.script[p],"scripts")},this)}},fixFilesField:function(l){var p=l.files;p&&!Array.isArray(p)?(this.warn("nonArrayFiles"),delete l.files):l.files&&(l.files=l.files.filter(function(d){return!d||typeof d!="string"?(this.warn("invalidFilename",d),!1):!0},this))},fixBinField:function(l){if(l.bin&&typeof l.bin=="string"){var p={},d;(d=l.name.match(/^@[^/]+[/](.*)$/))?p[d[1]]=l.bin:p[l.name]=l.bin,l.bin=p}},fixManField:function(l){l.man&&typeof l.man=="string"&&(l.man=[l.man])},fixBundleDependenciesField:function(l){var p="bundledDependencies",d="bundleDependencies";l[p]&&!l[d]&&(l[d]=l[p],delete l[p]),l[d]&&!Array.isArray(l[d])?(this.warn("nonArrayBundleDependencies"),delete l[d]):l[d]&&(l[d]=l[d].filter(function(P){return!P||typeof P!="string"?(this.warn("nonStringBundleDependency",P),!1):(l.dependencies||(l.dependencies={}),Object.prototype.hasOwnProperty.call(l.dependencies,P)||(this.warn("nonDependencyBundleDependency",P),l.dependencies[P]="*"),!0)},this))},fixDependencies:function(l){S(l,this.warn),L(l),this.fixBundleDependenciesField(l),["dependencies","devDependencies"].forEach(function(p){if(p in l){if(!l[p]||typeof l[p]!="object"){this.warn("nonObjectDependencies",p),delete l[p];return}Object.keys(l[p]).forEach(function(d){var P=l[p][d];typeof P!="string"&&(this.warn("nonStringDependency",d,JSON.stringify(P)),delete l[p][d]);var D=s.fromUrl(l[p][d]);D&&(l[p][d]=D.toString())},this)}},this)},fixModulesField:function(l){l.modules&&(this.warn("deprecatedModules"),delete l.modules)},fixKeywordsField:function(l){typeof l.keywords=="string"&&(l.keywords=l.keywords.split(/,\s+/)),l.keywords&&!Array.isArray(l.keywords)?(delete l.keywords,this.warn("nonArrayKeywords")):l.keywords&&(l.keywords=l.keywords.filter(function(p){return typeof p!="string"||!p?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(l,p){var d=!p;if(!l.version)return l.version="",!0;if(!e(l.version,d))throw new Error('Invalid version: "'+l.version+'"');return l.version=t(l.version,d),!0},fixPeople:function(l){y(l,b),y(l,m)},fixNameField:function(l,p){typeof p=="boolean"?p={strict:p}:typeof p>"u"&&(p={});var d=p.strict;if(!l.name&&!d){l.name="";return}if(typeof l.name!="string")throw new Error("name field must be a string.");d||(l.name=l.name.trim()),v(l.name,d,p.allowLegacyCase),r(l.name)&&this.warn("conflictingName",l.name)},fixDescriptionField:function(l){l.description&&typeof l.description!="string"&&(this.warn("nonStringDescription"),delete l.description),l.readme&&!l.description&&(l.description=n(l.readme)),l.description===void 0&&delete l.description,l.description||this.warn("missingDescription")},fixReadmeField:function(l){l.readme||(this.warn("missingReadme"),l.readme="ERROR: No README data found!")},fixBugsField:function(l){if(!l.bugs&&l.repository&&l.repository.url){var p=s.fromUrl(l.repository.url);p&&p.bugs()&&(l.bugs={url:p.bugs()})}else if(l.bugs){if(typeof l.bugs=="string")u(l.bugs)?l.bugs={email:l.bugs}:c.canParse(l.bugs)?l.bugs={url:l.bugs}:this.warn("nonEmailUrlBugsString");else{C(l.bugs,this.warn);var d=l.bugs;l.bugs={},d.url&&(c.canParse(d.url)?l.bugs.url=d.url:this.warn("nonUrlBugsUrlField")),d.email&&(typeof d.email=="string"&&u(d.email)?l.bugs.email=d.email:this.warn("nonEmailBugsEmailField"))}!l.bugs.email&&!l.bugs.url&&(delete l.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(l){if(!l.homepage&&l.repository&&l.repository.url){var p=s.fromUrl(l.repository.url);p&&p.docs()&&(l.homepage=p.docs())}if(l.homepage){if(typeof l.homepage!="string")return this.warn("nonUrlHomepage"),delete l.homepage;c.canParse(l.homepage)||(l.homepage="http://"+l.homepage)}},fixLicenseField:function(l){const p=l.license||l.licence;if(!p)return this.warn("missingLicense");if(typeof p!="string"||p.length<1||p.trim()==="")return this.warn("invalidLicense");if(!i(p).validForNewPackages)return this.warn("invalidLicense")}};function f(l){if(l.charAt(0)!=="@")return!1;var p=l.slice(1).split("/");return p.length!==2?!1:p[0]&&p[1]&&p[0]===encodeURIComponent(p[0])&&p[1]===encodeURIComponent(p[1])}function g(l){return!l.match(/[/@\s+%:]/)&&l===encodeURIComponent(l)}function v(l,p,d){if(l.charAt(0)==="."||!(f(l)||g(l))||p&&!d&&l!==l.toLowerCase()||l.toLowerCase()==="node_modules"||l.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(l))}function y(l,p){return l.author&&(l.author=p(l.author)),["maintainers","contributors"].forEach(function(d){Array.isArray(l[d])&&(l[d]=l[d].map(p))}),l}function b(l){if(typeof l=="string")return l;var p=l.name||"",d=l.url||l.web,P=d?" ("+d+")":"",D=l.email||l.mail,A=D?" <"+D+">":"";return p+A+P}function m(l){if(typeof l!="string")return l;var p=l.match(/^([^(<]+)/),d=l.match(/\(([^()]+)\)/),P=l.match(/<([^<>]+)>/),D={};return p&&p[0].trim()&&(D.name=p[0].trim()),P&&(D.email=P[1]),d&&(D.url=d[1]),D}function L(l){var p=l.optionalDependencies;if(p){var d=l.dependencies||{};Object.keys(p).forEach(function(P){d[P]=p[P]}),l.dependencies=d}}function h(l,p,d){if(!l)return{};if(typeof l=="string"&&(l=l.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(l))return l;d("deprecatedArrayDependencies",p);var P={};return l.filter(function(D){return typeof D=="string"}).forEach(function(D){D=D.trim().split(/(:?[@\s><=])/);var A=D.shift(),E=D.join("");E=E.trim(),E=E.replace(/^@/,""),P[A]=E}),P}function S(l,p){o.forEach(function(d){l[d]&&(l[d]=h(l[d],d,p))})}function C(l,p){l&&Object.keys(l).forEach(function(d){a.bugs[d]&&(p("typo",d,a.bugs[d],"bugs"),l[a.bugs[d]]=l[d],delete l[d])})}return ge}var at="'repositories' (plural) Not supported. Please pick one as the 'repository' field",lt="No repository field.",ct="Probably broken git url: %s",ht="scripts must be an object",ut="script values must be string commands",pt="Invalid 'files' member",ft="Invalid filename in 'files' list: %s",dt="Invalid 'bundleDependencies' list. Must be array of package names",mt="Invalid bundleDependencies member: %s",gt="Non-dependency in bundleDependencies: %s",Lt="%s field must be an object",St="Invalid dependency: %s %s",vt="specifying %s as array is deprecated",yt="modules field is deprecated",bt="keywords should be an array of strings",Ct="keywords should be an array of strings",Pt="%s is also the name of a node core module.",Dt="'description' field should be a string",wt="No description",xt="No README data",At="No license field.",Et="Bug string field must be url, email, or {email,url}",$t="bugs.url field must be a string url. Deleted.",Ot="bugs.email field must be a string email. Deleted.",Nt="Normalized value of bugs field is an empty object. Deleted.",Ft="homepage field must be a string url. Deleted.",Tt="license should be a valid SPDX license expression",Gt="%s should probably be %s.";const ji={repositories:at,missingRepository:lt,brokenGitUrl:ct,nonObjectScripts:ht,nonStringScript:ut,nonArrayFiles:pt,invalidFilename:ft,nonArrayBundleDependencies:dt,nonStringBundleDependency:mt,nonDependencyBundleDependency:gt,nonObjectDependencies:Lt,nonStringDependency:St,deprecatedArrayDependencies:vt,deprecatedModules:yt,nonArrayKeywords:bt,nonStringKeyword:Ct,conflictingName:Pt,nonStringDescription:Dt,missingDescription:wt,missingReadme:xt,missingLicense:At,nonEmailUrlBugsString:Et,nonUrlBugsUrlField:$t,nonEmailBugsEmailField:Ot,emptyNormalizedBugs:Nt,nonUrlHomepage:Ft,invalidLicense:Tt,typo:Gt},Wi=Object.defineProperty({__proto__:null,brokenGitUrl:ct,conflictingName:Pt,default:ji,deprecatedArrayDependencies:vt,deprecatedModules:yt,emptyNormalizedBugs:Nt,invalidFilename:ft,invalidLicense:Tt,missingDescription:wt,missingLicense:At,missingReadme:xt,missingRepository:lt,nonArrayBundleDependencies:dt,nonArrayFiles:pt,nonArrayKeywords:bt,nonDependencyBundleDependency:gt,nonEmailBugsEmailField:Ot,nonEmailUrlBugsString:Et,nonObjectDependencies:Lt,nonObjectScripts:ht,nonStringBundleDependency:mt,nonStringDependency:St,nonStringDescription:Dt,nonStringKeyword:Ct,nonStringScript:ut,nonUrlBugsUrlField:$t,nonUrlHomepage:Ft,repositories:at,typo:Gt},Symbol.toStringTag,{value:"Module"}),_i=ve(Wi);var Le,Me;function Hi(){if(Me)return Le;Me=1;var c=Yt,e=_i;Le=function(){var i=Array.prototype.slice.call(arguments,0),s=i.shift();if(s==="typo")return t.apply(null,i);var r=e[s]?e[s]:s+": '%s'";return i.unshift(r),c.format.apply(null,i)};function t(i,s,r){return r&&(i=r+"['"+i+"']",s=r+"['"+s+"']"),c.format(e.typo,i,s)}return Le}var Se,je;function zi(){if(je)return Se;je=1,Se=r;var c=Mi();r.fixer=c;var e=Hi(),t=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],s=t.map(function(n){return o(n)+"Field"});s=s.concat(i);function r(n,a,u){a===!0&&(a=null,u=!0),u||(u=!1),(!a||n.private)&&(a=function(){}),n.scripts&&n.scripts.install==="node-gyp rebuild"&&!n.scripts.preinstall&&(n.gypfile=!0),c.warn=function(){a(e.apply(null,arguments))},s.forEach(function(f){c["fix"+o(f)](n,u)}),n._id=n.name+"@"+n.version}function o(n){return n.charAt(0).toUpperCase()+n.slice(1)}return Se}var Yi=zi();const qi=_t(Yi),Vi=(c,e,t)=>{const i=$(c),s=$(e),r=s===i?".":Ut(i,s);return t.some(o=>{const n=o.startsWith("./")?o.slice(2):o,a=r.startsWith("./")?r.slice(2):r;if(n==="."&&a===".")return!0;if(n.endsWith("/**")){const u=n.slice(0,-3);return a===u||a.startsWith(`${u}/`)}if(n.endsWith("/*")){const u=n.slice(0,-2);return u===""?a!=="."&&!a.includes("/"):a.startsWith(`${u}/`)||a===u}return a===n||a.startsWith(`${n}/`)})},Ki=c=>{const e=X("pnpm-workspace.yaml",{cwd:$(c),type:"file"});if(!e)return;const t=He(e),i=Array.isArray(t.packages)?t.packages:[];if(!Vi(e,c,i))return;const s={};return t.catalog&&typeof t.catalog=="object"&&(s.catalog=t.catalog),t.catalogs&&typeof t.catalogs=="object"&&(s.catalogs=t.catalogs),Object.keys(s).length>0?s:void 0},Ji=(c,e,t)=>{if(e==="catalog:")return t.catalog?.[c];if(e.startsWith("catalog:")){const i=e.slice(8);return t.catalogs?.[i]?.[c]}},Xi=(c,e)=>{for(const[t,i]of Object.entries(c)){if(typeof i!="string")continue;const s=Ji(t,i,e);s&&(c[t]=s)}},Zi=(c,e)=>{const t=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const i of t){if(!c[i]||typeof c[i]!="object")continue;const s=c[i];Xi(s,e)}},Qi=Y(import.meta.url),W=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ye=c=>{if(typeof W<"u"&&W.versions&&W.versions.node){const[e,t]=W.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return W.getBuiltinModule(c)}return Qi(c)};ye("node:fs");ye("node:readline");ye("node:util");const er=/, ([^,]*)$/,tr=new Map,ir=(c,e={})=>`${c}|s${String(e.strict?1:0)}|c${String(e.resolveCatalogs?1:0)}|j${String(e.json5===!1?0:1)}|y${String(e.yaml===!1?0:1)}|w${String(e.ignoreWarnings?1:0)}`;class rr extends Error{constructor(e){super(`The following warnings were encountered while normalizing package data:
3
3
  - ${e.join(`
4
- - `)}`),this.name="PackageJsonValidationError"}}const sr=(c,e,t=[])=>{const i=[];if(qi(c,s=>{i.push(s)},e),e&&i.length>0){const s=i.filter(r=>!t.some(o=>o instanceof RegExp?o.test(r):o===r));if(s.length>0)throw new rr(s)}return c},nr=c=>He(c),or=c=>{const e=Mt(c);return jt.parse(e)},ar=(c,e)=>e?.yaml!==!1&&(c.endsWith(".yaml")||c.endsWith(".yml"))?nr(c):e?.json5!==!1&&c.endsWith(".json5")?or(c):ze(c),lr=(c,e={})=>{const t={type:"file"};c&&(t.cwd=c);const i=["package.json"];e.yaml!==!1&&i.push("package.yaml","package.yml"),e.json5!==!1&&i.push("package.json5");const s=X(i,t);if(!s)throw new K(`No such file or directory, for ${i.join(", ").replace(er," or $1")} found.`);const r=e.cache&&typeof e.cache!="boolean"?e.cache:tr,o=ir(s,e);if(e.cache&&r.has(o))return r.get(o);const n=ar(s,e);if(e.resolveCatalogs){const u=Ki(s);u&&Zi(n,u)}sr(n,e.strict??!1,e.ignoreWarnings);const a={packageJson:n,path:s};return e.cache&&r.set(o,a),a};var cr="1.0.6";const hr={version:cr},ur=hr.version,pr="@visulima/vis";let F;const Nr=()=>{if(F!==void 0)return F;const c=process.env.VIS_VERSION;if(c)return F=c,F;try{const{packageJson:e}=lr(It(kt(import.meta.url)),{json5:!1,yaml:!1});if(e.name===pr&&typeof e.version=="string")return F=e.version,F}catch{}return F=ur,F};export{$r as D,Qt as P,Or as S,Er as T,yr as a,wr as b,Cr as c,Dr as g,Pr as h,vr as i,Nr as m,xr as p,br as t,Ar as u};
4
+ - `)}`),this.name="PackageJsonValidationError"}}const sr=(c,e,t=[])=>{const i=[];if(qi(c,s=>{i.push(s)},e),e&&i.length>0){const s=i.filter(r=>!t.some(o=>o instanceof RegExp?o.test(r):o===r));if(s.length>0)throw new rr(s)}return c},nr=c=>He(c),or=c=>{const e=Mt(c);return jt.parse(e)},ar=(c,e)=>e?.yaml!==!1&&(c.endsWith(".yaml")||c.endsWith(".yml"))?nr(c):e?.json5!==!1&&c.endsWith(".json5")?or(c):ze(c),lr=(c,e={})=>{const t={type:"file"};c&&(t.cwd=c);const i=["package.json"];e.yaml!==!1&&i.push("package.yaml","package.yml"),e.json5!==!1&&i.push("package.json5");const s=X(i,t);if(!s)throw new K(`No such file or directory, for ${i.join(", ").replace(er," or $1")} found.`);const r=e.cache&&typeof e.cache!="boolean"?e.cache:tr,o=ir(s,e);if(e.cache&&r.has(o))return r.get(o);const n=ar(s,e);if(e.resolveCatalogs){const u=Ki(s);u&&Zi(n,u)}sr(n,e.strict??!1,e.ignoreWarnings);const a={packageJson:n,path:s};return e.cache&&r.set(o,a),a};var cr="1.0.7";const hr={version:cr},ur=hr.version,pr="@visulima/vis";let F;const Nr=()=>{if(F!==void 0)return F;const c=process.env.VIS_VERSION;if(c)return F=c,F;try{const{packageJson:e}=lr(It(kt(import.meta.url)),{json5:!1,yaml:!1});if(e.name===pr&&typeof e.version=="string")return F=e.version,F}catch{}return F=ur,F};export{$r as D,Qt as P,Or as S,Er as T,yr as a,wr as b,Cr as c,Dr as g,Pr as h,vr as i,Nr as m,xr as p,br as t,Ar as u};