@vibgrate/cli 2026.628.1 → 2026.629.1

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.
@@ -0,0 +1,75 @@
1
+ import {a}from'./chunk-MKDRULJ6.js';import {p,o,j,n,a as a$1,i,k,d,e,q as q$1,r,s}from'./chunk-XTHPCEME.js';import {b}from'./chunk-EK7ODJWE.js';import*as _ from'path';import {basename,dirname}from'path';import*as ye from'fs/promises';import {readFile,mkdtemp,rm,mkdir,writeFile}from'fs/promises';import F from'typescript';import*as Es from'crypto';import E from'chalk';import*as on from'os';import {spawn}from'child_process';import {createRequire}from'module';import*as No from'zlib';import {promisify}from'util';import {mkdirSync,writeFileSync}from'fs';function zo(t){switch(t){case "node":return "nodejs";case "python":return "python";case "dotnet":return "dotnet";case "java":return "java";case "php":return "php";case "ruby":return "ruby";case "go":return "go";default:return null}}function Ke(t,e){if(!e)return null;switch(t){case "python":case "php":case "ruby":case "go":{let n=e.match(/(\d+)\.(\d+)/);return n?`${n[1]}.${n[2]}`:null}case "dotnet":{let n=e.match(/(\d+)\.(\d+)/)??e.match(/(\d+)/);return n?n[2]!==void 0?`${n[1]}.${n[2]}`:`${n[1]}.0`:null}case "node":{let n=e.match(/(\d+)/);return n?n[1]:null}case "java":{let n=e.match(/1\.(\d+)/);if(n)return n[1];let r=e.match(/(\d+)/);return r?r[1]:null}default:return null}}function Jo(t,e,n=Date.now()){let r=e.find(o=>String(o.cycle)===t);if(!r)return null;if(typeof r.eol=="boolean")return r.eol;let s=Date.parse(r.eol);return Number.isNaN(s)?null:s<=n}function qs(t){let e=String(t).match(/^(\d+)(?:\.(\d+))?/);return e?{major:parseInt(e[1],10),minor:e[2]?parseInt(e[2],10):0}:null}function vn(t){return t.major*1e3+t.minor}function Gs(t,e){if(typeof t.releaseDate!="string")return true;let n=Date.parse(t.releaseDate);return Number.isNaN(n)?true:n<=e}function Ko(t,e){if(t.lts===true)return true;if(typeof t.lts=="string"){let n=Date.parse(t.lts);return !Number.isNaN(n)&&n<=e}return false}function wn(t,e){return t.products[e]?.cycles??[]}function Ht(t,e,n=Date.now()){let r=null;for(let s of wn(t,e)){if(!Gs(s,n))continue;let o=qs(s.cycle);o&&(!r||vn(o)>vn(r))&&(r=o);}return r}function Yn(t,e,n=Date.now()){let r=null;for(let s of wn(t,e)){if(!Gs(s,n)||!Ko(s,n))continue;let o=qs(s.cycle);o&&(!r||vn(o)>vn(r))&&(r=o);}return r}function st(t,e,n){let r=wn(t,e).find(s=>String(s.cycle)===n);return r&&typeof r.eol=="string"?r.eol:void 0}function rt(t,e,n,r=Date.now()){let s=zo(e);if(!s)return null;let o=Ke(e,n);return o?Jo(o,wn(t,s),r):null}var Ee={generatedAt:"2026-06-01",source:"endoflife.date",products:{nodejs:{product:"nodejs",cycles:[{cycle:"24",releaseDate:"2025-05-06",lts:"2025-10-28",eol:"2028-04-30"},{cycle:"23",releaseDate:"2024-10-16",lts:false,eol:"2025-06-01"},{cycle:"22",releaseDate:"2024-04-24",lts:"2024-10-29",eol:"2027-04-30"},{cycle:"20",releaseDate:"2023-04-18",lts:"2023-10-24",eol:"2026-04-30"},{cycle:"18",releaseDate:"2022-04-19",lts:"2022-10-25",eol:"2025-04-30"}]},python:{product:"python",cycles:[{cycle:"3.14",releaseDate:"2025-10-07",eol:"2030-10-01"},{cycle:"3.13",releaseDate:"2024-10-07",eol:"2029-10-01"},{cycle:"3.12",releaseDate:"2023-10-02",eol:"2028-10-01"},{cycle:"3.11",releaseDate:"2022-10-24",eol:"2027-10-01"},{cycle:"3.10",releaseDate:"2021-10-04",eol:"2026-10-01"},{cycle:"3.9",releaseDate:"2020-10-05",eol:"2025-10-01"},{cycle:"3.8",releaseDate:"2019-10-14",eol:"2024-10-07"}]},dotnet:{product:"dotnet",cycles:[{cycle:"10.0",releaseDate:"2025-11-11",lts:true,eol:"2028-11-10"},{cycle:"9.0",releaseDate:"2024-11-12",lts:false,eol:"2026-05-12"},{cycle:"8.0",releaseDate:"2023-11-14",lts:true,eol:"2026-11-10"},{cycle:"7.0",releaseDate:"2022-11-08",lts:false,eol:"2024-05-14"},{cycle:"6.0",releaseDate:"2021-11-08",lts:true,eol:"2024-11-12"}]},java:{product:"java",cycles:[{cycle:"25",releaseDate:"2025-09-16",lts:true,eol:"2033-09-01"},{cycle:"21",releaseDate:"2023-09-19",lts:true,eol:"2031-09-01"},{cycle:"17",releaseDate:"2021-09-14",lts:true,eol:"2029-09-01"},{cycle:"11",releaseDate:"2018-09-25",lts:true,eol:"2026-09-01"},{cycle:"8",releaseDate:"2014-03-18",lts:true,eol:"2030-12-01"}]},php:{product:"php",cycles:[{cycle:"8.4",releaseDate:"2024-11-21",eol:"2028-12-31"},{cycle:"8.3",releaseDate:"2023-11-23",eol:"2027-12-31"},{cycle:"8.2",releaseDate:"2022-12-08",eol:"2026-12-31"},{cycle:"8.1",releaseDate:"2021-11-25",eol:"2025-12-31"},{cycle:"8.0",releaseDate:"2020-11-26",eol:"2023-11-26"}]},ruby:{product:"ruby",cycles:[{cycle:"3.5",releaseDate:"2025-12-25",eol:"2029-03-31"},{cycle:"3.4",releaseDate:"2024-12-25",eol:"2028-03-31"},{cycle:"3.3",releaseDate:"2023-12-25",eol:"2027-03-31"},{cycle:"3.2",releaseDate:"2022-12-25",eol:"2026-03-31"},{cycle:"3.1",releaseDate:"2021-12-25",eol:"2025-03-31"}]},go:{product:"go",cycles:[{cycle:"1.25",releaseDate:"2025-08-13",eol:false},{cycle:"1.24",releaseDate:"2025-02-11",eol:false},{cycle:"1.23",releaseDate:"2024-08-13",eol:true},{cycle:"1.22",releaseDate:"2024-02-06",eol:true}]}}};var ve=b(a(),1),et=b(a(),1),ht=b(a(),1);var Hs=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Qo=Hs+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Yo="["+Hs+"]["+Qo+"]*",Xo=new RegExp("^"+Yo+"$");function Sn(t,e){let n=[],r=e.exec(t);for(;r;){let s=[];s.startIndex=e.lastIndex-r[0].length;let o=r.length;for(let a=0;a<o;a++)s.push(r[a]);n.push(s),r=e.exec(t);}return n}var Xn=function(t){let e=Xo.exec(t);return !(e===null||typeof e>"u")};function Ws(t){return typeof t<"u"}var Wt=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],kn=["__proto__","constructor","prototype"];var Zo={allowBooleanAttributes:false,unpairedTags:[]};function Ys(t,e){e=Object.assign({},Zo,e);let n=[],r=false,s=false;t[0]==="\uFEFF"&&(t=t.substr(1));for(let o=0;o<t.length;o++)if(t[o]==="<"&&t[o+1]==="?"){if(o+=2,o=Js(t,o),o.err)return o}else if(t[o]==="<"){let a=o;if(o++,t[o]==="!"){o=Ks(t,o);continue}else {let i=false;t[o]==="/"&&(i=true,o++);let c="";for(;o<t.length&&t[o]!==">"&&t[o]!==" "&&t[o]!==" "&&t[o]!==`
2
+ `&&t[o]!=="\r";o++)c+=t[o];if(c=c.trim(),c[c.length-1]==="/"&&(c=c.substring(0,c.length-1),o--),!ai(c)){let p;return c.trim().length===0?p="Invalid space after '<'.":p="Tag '"+c+"' is an invalid name.",B("InvalidTag",p,K(t,o))}let l=ni(t,o);if(l===false)return B("InvalidAttr","Attributes for '"+c+"' have open quote.",K(t,o));let u=l.value;if(o=l.index,u[u.length-1]==="/"){let p=o-u.length;u=u.substring(0,u.length-1);let d=Qs(u,e);if(d===true)r=true;else return B(d.err.code,d.err.msg,K(t,p+d.err.line))}else if(i)if(l.tagClosed){if(u.trim().length>0)return B("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",K(t,a));if(n.length===0)return B("InvalidTag","Closing tag '"+c+"' has not been opened.",K(t,a));{let p=n.pop();if(c!==p.tagName){let d=K(t,p.tagStartPos);return B("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+d.line+", col "+d.col+") instead of closing tag '"+c+"'.",K(t,a))}n.length==0&&(s=true);}}else return B("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",K(t,o));else {let p=Qs(u,e);if(p!==true)return B(p.err.code,p.err.msg,K(t,o-u.length+p.err.line));if(s===true)return B("InvalidXml","Multiple possible root nodes found.",K(t,o));e.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:a}),r=true;}for(o++;o<t.length;o++)if(t[o]==="<")if(t[o+1]==="!"){o++,o=Ks(t,o);continue}else if(t[o+1]==="?"){if(o=Js(t,++o),o.err)return o}else break;else if(t[o]==="&"){let p=oi(t,o);if(p==-1)return B("InvalidChar","char '&' is not expected.",K(t,o));o=p;}else if(s===true&&!zs(t[o]))return B("InvalidXml","Extra text at the end",K(t,o));t[o]==="<"&&o--;}}else {if(zs(t[o]))continue;return B("InvalidChar","char '"+t[o]+"' is not expected.",K(t,o))}if(r){if(n.length==1)return B("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",K(t,n[0].tagStartPos));if(n.length>0)return B("InvalidXml","Invalid '"+JSON.stringify(n.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return B("InvalidXml","Start tag expected.",1);return true}function zs(t){return t===" "||t===" "||t===`
3
+ `||t==="\r"}function Js(t,e){let n=e;for(;e<t.length;e++)if(t[e]=="?"||t[e]==" "){let r=t.substr(n,e-n);if(e>5&&r==="xml")return B("InvalidXml","XML declaration allowed only at the start of the document.",K(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function Ks(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++)if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let n=1;for(e+=8;e<t.length;e++)if(t[e]==="<")n++;else if(t[e]===">"&&(n--,n===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++)if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}return e}var ei='"',ti="'";function ni(t,e){let n="",r="",s=false;for(;e<t.length;e++){if(t[e]===ei||t[e]===ti)r===""?r=t[e]:r!==t[e]||(r="");else if(t[e]===">"&&r===""){s=true;break}n+=t[e];}return r!==""?false:{value:n,index:e,tagClosed:s}}var si=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Qs(t,e){let n=Sn(t,si),r={};for(let s=0;s<n.length;s++){if(n[s][1].length===0)return B("InvalidAttr","Attribute '"+n[s][2]+"' has no space in starting.",zt(n[s]));if(n[s][3]!==void 0&&n[s][4]===void 0)return B("InvalidAttr","Attribute '"+n[s][2]+"' is without value.",zt(n[s]));if(n[s][3]===void 0&&!e.allowBooleanAttributes)return B("InvalidAttr","boolean attribute '"+n[s][2]+"' is not allowed.",zt(n[s]));let o=n[s][2];if(!ii(o))return B("InvalidAttr","Attribute '"+o+"' is an invalid name.",zt(n[s]));if(!Object.prototype.hasOwnProperty.call(r,o))r[o]=1;else return B("InvalidAttr","Attribute '"+o+"' is repeated.",zt(n[s]))}return true}function ri(t,e){let n=/\d/;for(t[e]==="x"&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(n))break}return -1}function oi(t,e){if(e++,t[e]===";")return -1;if(t[e]==="#")return e++,ri(t,e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(t[e]===";")break;return -1}return e}function B(t,e,n){return {err:{code:t,msg:e,line:n.line||n,col:n.col}}}function ii(t){return Xn(t)}function ai(t){return Xn(t)}function K(t,e){let n=t.substring(0,e).split(/\r?\n/);return {line:n.length,col:n[n.length-1].length+1}}function zt(t){return t.startIndex+t[1].length}var En={cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",euro:"\u20AC",dollar:"$",fnof:"\u0192",inr:"\u20B9",af:"\u060B",birr:"\u1265\u122D",peso:"\u20B1",rub:"\u20BD",won:"\u20A9",yuan:"\xA5",cedil:"\xB8"},Jt={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Zn={nbsp:"\xA0",copy:"\xA9",reg:"\xAE",trade:"\u2122",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",laquo:"\xAB",raquo:"\xBB",lsquo:"\u2018",rsquo:"\u2019",ldquo:"\u201C",rdquo:"\u201D",bull:"\u2022",para:"\xB6",sect:"\xA7",deg:"\xB0",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE"};var At=Object.freeze({ALLOW:"allow",BLOCK:"block",THROW:"throw"}),li=new Set("!?\\\\/[]$%{}^&*()<>|+");function ur(t){if(t[0]==="#")throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${t}"`);for(let e of t)if(li.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${t}"`);return t}function Kt(...t){let e=Object.create(null);for(let n of t)if(n)for(let r of Object.keys(n)){let s=n[r];if(typeof s=="string")e[r]=s;else if(s&&typeof s=="object"&&s.val!==void 0){let o=s.val;typeof o=="string"&&(e[r]=o);}}return e}var ot="external",jn="base",es="all";function ui(t){return !t||t===ot?new Set([ot]):t===es?new Set([es]):t===jn?new Set([jn]):Array.isArray(t)?new Set(t):new Set([ot])}var X=Object.freeze({allow:0,leave:1,remove:2,throw:3}),pi=new Set([9,10,13]);function di(t){if(!t)return {xmlVersion:1,onLevel:X.allow,nullLevel:X.remove};let e=t.xmlVersion===1.1?1.1:1,n=X[t.onNCR]??X.allow,r=X[t.nullNCR]??X.remove,s=Math.max(r,X.remove);return {xmlVersion:e,onLevel:n,nullLevel:s}}var Pt=class{constructor(e={}){this._limit=e.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof e.postCheck=="function"?e.postCheck:r=>r,this._limitTiers=ui(this._limit.applyLimitsTo??ot),this._numericAllowed=e.numericAllowed??true,this._baseMap=Kt(Jt,e.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(e.remove&&Array.isArray(e.remove)?e.remove:[]),this._leaveSet=new Set(e.leave&&Array.isArray(e.leave)?e.leave:[]);let n=di(e.ncr);this._ncrXmlVersion=n.xmlVersion,this._ncrOnLevel=n.onLevel,this._ncrNullLevel=n.nullLevel,this._onExternalEntity=typeof e.onExternalEntity=="function"?e.onExternalEntity:null,this._onInputEntity=typeof e.onInputEntity=="function"?e.onInputEntity:null;}_applyRegistrationHook(e,n,r,s){if(!e)return true;let o=e(n,r);if(o===At.BLOCK)return false;if(o===At.THROW)throw new Error(`[EntityDecoder] Registration of ${s} entity "&${n};" was rejected by hook`);return true}setExternalEntities(e){if(e)for(let s of Object.keys(e))ur(s);if(!this._onExternalEntity){this._externalMap=Kt(e);return}let n=Kt(e),r=Object.create(null);for(let[s,o]of Object.entries(n))this._applyRegistrationHook(this._onExternalEntity,s,o,"external")&&(r[s]=o);this._externalMap=r;}addExternalEntity(e,n){ur(e),typeof n=="string"&&n.indexOf("&")===-1&&this._applyRegistrationHook(this._onExternalEntity,e,n,"external")&&(this._externalMap[e]=n);}addInputEntities(e){if(this._totalExpansions=0,this._expandedLength=0,!this._onInputEntity){this._inputMap=Kt(e);return}let n=Kt(e),r=Object.create(null);for(let[s,o]of Object.entries(n))this._applyRegistrationHook(this._onInputEntity,s,o,"input")&&(r[s]=o);this._inputMap=r;}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(e){this._ncrXmlVersion=e===1.1?1.1:1;}decode(e){if(typeof e!="string"||e.length===0||e.indexOf("&")===-1)return e;let n=e,r=[],s=e.length,o=0,a=0,i=this._maxTotalExpansions>0,c=this._maxExpandedLength>0,l=i||c;for(;a<s;){if(e.charCodeAt(a)!==38){a++;continue}let p=a+1;for(;p<s&&e.charCodeAt(p)!==59&&p-a<=32;)p++;if(p>=s||e.charCodeAt(p)!==59){a++;continue}let d=e.slice(a+1,p);if(d.length===0){a++;continue}let f,g;if(this._removeSet.has(d))f="",g===void 0&&(g=ot);else if(this._leaveSet.has(d)){a++;continue}else if(d.charCodeAt(0)===35){let h=this._resolveNCR(d);if(h===void 0){a++;continue}f=h,g=jn;}else {let h=this._resolveName(d);f=h?.value,g=h?.tier;}if(f===void 0){a++;continue}if(a>o&&r.push(e.slice(o,a)),r.push(f),o=p+1,a=o,l&&this._tierCounts(g)){if(i&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(c){let h=f.length-(d.length+2);if(h>0&&(this._expandedLength+=h,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}o<s&&r.push(e.slice(o));let u=r.length===0?e:r.join("");return this._postCheck(u,n)}_tierCounts(e){return this._limitTiers.has(es)?true:this._limitTiers.has(e)}_resolveName(e){if(e in this._inputMap)return {value:this._inputMap[e],tier:ot};if(e in this._externalMap)return {value:this._externalMap[e],tier:ot};if(e in this._baseMap)return {value:this._baseMap[e],tier:jn}}_classifyNCR(e){return e===0?this._ncrNullLevel:e>=55296&&e<=57343||this._ncrXmlVersion===1&&e>=1&&e<=31&&!pi.has(e)?X.remove:-1}_applyNCRAction(e,n,r){switch(e){case X.allow:return String.fromCodePoint(r);case X.remove:return "";case X.leave:return;case X.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${n}; (U+${r.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(r)}}_resolveNCR(e){let n=e.charCodeAt(1),r;if(n===120||n===88?r=parseInt(e.slice(2),16):r=parseInt(e.slice(1),10),Number.isNaN(r)||r<0||r>1114111)return;let s=this._classifyNCR(r);if(!this._numericAllowed&&s<X.remove)return;let o=s===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,s);return this._applyNCRAction(o,e,r)}};var pr=t=>Wt.includes(t)?"__"+t:t,fi={preserveOrder:false,attributeNamePrefix:"@_",attributesGroupName:false,textNodeName:"#text",ignoreAttributes:true,removeNSPrefix:false,allowBooleanAttributes:false,parseTagValue:true,parseAttributeValue:false,trimValues:true,cdataPropName:false,numberParseOptions:{hex:true,leadingZeros:true,eNotation:true,unicode:false},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:false,isArray:()=>false,commentPropName:false,unpairedTags:[],processEntities:true,htmlEntities:false,entityDecoder:null,ignoreDeclaration:false,ignorePiTags:false,transformTagName:false,transformAttributeName:false,updateTag:function(t,e,n){return t},captureMetaData:false,maxNestedTags:100,strictReservedNames:true,jPath:true,onDangerousProperty:pr};function hi(t,e){if(typeof t!="string")return;let n=t.toLowerCase();if(Wt.some(r=>n===r.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);if(kn.some(r=>n===r.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`)}function dr(t,e){return typeof t=="boolean"?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof t=="object"&&t!==null?{enabled:t.enabled!==false,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??1e3),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null,appliesTo:t.appliesTo??"all"}:dr(true)}var fr=function(t){let e=Object.assign({},fi,t),n=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(let{value:r,name:s}of n)r&&hi(r,s);return e.onDangerousProperty===null&&(e.onDangerousProperty=pr),e.processEntities=dr(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(r=>typeof r=="string"&&r.startsWith("*.")?".."+r.substring(2):r)),e};var xn;typeof Symbol!="function"?xn="@@xmlMetadata":xn=Symbol("XML Node Metadata");var Z=class{constructor(e){this.tagname=e,this.child=[],this[":@"]=Object.create(null);}add(e,n){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:n});}addChild(e,n){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),n!==void 0&&(this.child[this.child.length-1][xn]={startIndex:n});}static getMetaDataSymbol(){return xn}};var hr=":A-Za-z_\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",mi=hr+"\\-\\.\\d\xB7\u0300-\u036F\u203F-\u2040",mr=":A-Za-z_\xC0-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",gi=mr+"\\-\\.\\d\xB7\u0300-\u036F\u0487\u203F-\u2040",gr=(t,e,n="")=>{let r=t.replace(":",""),s=e.replace(":",""),o=`[${r}][${s}]*`;return {name:new RegExp(`^[${t}][${e}]*$`,n),ncName:new RegExp(`^${o}$`,n),qName:new RegExp(`^${o}(?::${o})?$`,n),nmToken:new RegExp(`^[${e}]+$`,n),nmTokens:new RegExp(`^[${e}]+(?:\\s+[${e}]+)*$`,n)}},yi=gr(hr,mi),bi=gr(mr,gi,"u"),vi=(t="1.0")=>t==="1.1"?bi:yi;var ts=(t,{xmlVersion:e="1.0"}={})=>vi(e).qName.test(t);var Yt=class{constructor(e,n){this.suppressValidationErr=!e,this.options=e,this.xmlVersion=n||1;}setXmlVersion(e=1){this.xmlVersion=e;}readDocType(e,n){let r=Object.create(null),s=0;if(e[n+3]==="O"&&e[n+4]==="C"&&e[n+5]==="T"&&e[n+6]==="Y"&&e[n+7]==="P"&&e[n+8]==="E"){n=n+9;let o=1,a=false,i=false,c="";for(;n<e.length;n++)if(e[n]==="<"&&!i){if(a&&it(e,"!ENTITY",n)){n+=7;let l,u;if([l,u,n]=this.readEntityExp(e,n+1,this.suppressValidationErr),u.indexOf("&")===-1){if(this.options.enabled!==false&&this.options.maxEntityCount!=null&&s>=this.options.maxEntityCount)throw new Error(`Entity count (${s+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);r[l]=u,s++;}}else if(a&&it(e,"!ELEMENT",n)){n+=8;let{index:l}=this.readElementExp(e,n+1);n=l;}else if(a&&it(e,"!ATTLIST",n))n+=8;else if(a&&it(e,"!NOTATION",n)){n+=9;let{index:l}=this.readNotationExp(e,n+1,this.suppressValidationErr);n=l;}else if(it(e,"!--",n))i=true;else throw new Error("Invalid DOCTYPE");o++,c="";}else if(e[n]===">"){if(i?e[n-1]==="-"&&e[n-2]==="-"&&(i=false,o--):o--,o===0)break}else e[n]==="["?a=true:c+=e[n];if(o!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return {entities:r,i:n}}readEntityExp(e,n){n=ee(e,n);let r=n;for(;n<e.length&&!/\s/.test(e[n])&&e[n]!=='"'&&e[n]!=="'";)n++;let s=e.substring(r,n);if(Qt(s,{xmlVersion:this.xmlVersion}),n=ee(e,n),!this.suppressValidationErr){if(e.substring(n,n+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[n]==="%")throw new Error("Parameter entities are not supported")}let o="";if([n,o]=this.readIdentifierVal(e,n,"entity"),this.options.enabled!==false&&this.options.maxEntitySize!=null&&o.length>this.options.maxEntitySize)throw new Error(`Entity "${s}" size (${o.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return n--,[s,o,n]}readNotationExp(e,n){n=ee(e,n);let r=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;let s=e.substring(r,n);!this.suppressValidationErr&&Qt(s,{xmlVersion:this.xmlVersion}),n=ee(e,n);let o=e.substring(n,n+6).toUpperCase();if(!this.suppressValidationErr&&o!=="SYSTEM"&&o!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${o}"`);n+=o.length,n=ee(e,n);let a=null,i=null;if(o==="PUBLIC")[n,a]=this.readIdentifierVal(e,n,"publicIdentifier"),n=ee(e,n),(e[n]==='"'||e[n]==="'")&&([n,i]=this.readIdentifierVal(e,n,"systemIdentifier"));else if(o==="SYSTEM"&&([n,i]=this.readIdentifierVal(e,n,"systemIdentifier"),!this.suppressValidationErr&&!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return {notationName:s,publicIdentifier:a,systemIdentifier:i,index:--n}}readIdentifierVal(e,n,r){let s="",o=e[n];if(o!=='"'&&o!=="'")throw new Error(`Expected quoted string, found "${o}"`);n++;let a=n;for(;n<e.length&&e[n]!==o;)n++;if(s=e.substring(a,n),e[n]!==o)throw new Error(`Unterminated ${r} value`);return n++,[n,s]}readElementExp(e,n){n=ee(e,n);let r=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;let s=e.substring(r,n);if(!this.suppressValidationErr&&!ts(s,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid element name: "${s}"`);n=ee(e,n);let o="";if(e[n]==="E"&&it(e,"MPTY",n))n+=4;else if(e[n]==="A"&&it(e,"NY",n))n+=2;else if(e[n]==="("){n++;let a=n;for(;n<e.length&&e[n]!==")";)n++;if(o=e.substring(a,n),e[n]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[n]}"`);return {elementName:s,contentModel:o.trim(),index:n}}readAttlistExp(e,n){n=ee(e,n);let r=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;let s=e.substring(r,n);for(Qt(s,{xmlVersion:this.xmlVersion}),n=ee(e,n),r=n;n<e.length&&!/\s/.test(e[n]);)n++;let o=e.substring(r,n);if(!Qt(o,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid attribute name: "${o}"`);n=ee(e,n);let a="";if(e.substring(n,n+8).toUpperCase()==="NOTATION"){if(a="NOTATION",n+=8,n=ee(e,n),e[n]!=="(")throw new Error(`Expected '(', found "${e[n]}"`);n++;let c=[];for(;n<e.length&&e[n]!==")";){let l=n;for(;n<e.length&&e[n]!=="|"&&e[n]!==")";)n++;let u=e.substring(l,n);if(u=u.trim(),!Qt(u,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid notation name: "${u}"`);c.push(u),e[n]==="|"&&(n++,n=ee(e,n));}if(e[n]!==")")throw new Error("Unterminated list of notations");n++,a+=" ("+c.join("|")+")";}else {let c=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;a+=e.substring(c,n);let l=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!l.includes(a.toUpperCase()))throw new Error(`Invalid attribute type: "${a}"`)}n=ee(e,n);let i="";return e.substring(n,n+8).toUpperCase()==="#REQUIRED"?(i="#REQUIRED",n+=8):e.substring(n,n+7).toUpperCase()==="#IMPLIED"?(i="#IMPLIED",n+=7):[n,i]=this.readIdentifierVal(e,n,"ATTLIST"),{elementName:s,attributeName:o,attributeType:a,defaultValue:i,index:n}}},ee=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function it(t,e,n){for(let r=0;r<e.length;r++)if(e[r]!==t[n+r+1])return false;return true}function Qt(t,e){if(ts(t,{xmlVersion:e}))return t;throw new Error(`Invalid entity name ${t}`)}var wi=[48,1632,1776,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,65296,120782,120792,120802,120812,120822,66720,68912,69734,69872,69942,70096,70384,70736,70864,71248,71360,71472,71904,72016,72688,72784,73040,73120,73552,92768,92864,93008,123200,123632,124144,125264,130032],Tn=255,Cn=new Map,yr=65535,br=1632,Mt=br,Si=yr-br+1,An=new Uint8Array(Si).fill(Tn);for(let t of wi)for(let e=0;e<10;e++){let n=t+e;n<=yr?An[n-Mt]=e:Cn.set(n,e);}var vr=48,wr=57,Sr=45,Pn=new Set([8722,65293,65123]);function ki(t){if(typeof t!="string")return t;let e=t.length;if(e===0)return t;let n=-1;for(let s=0;s<e;s++){let o=t.charCodeAt(s);if(!(o>=vr&&o<=wr||o===Sr)){if(o<Mt){if(Pn.has(o)){n=s;break}continue}if(o>=55296&&o<=56319){if(s+1<e){let a=t.charCodeAt(s+1);if(a>=56320&&a<=57343){let i=65536+(o-55296<<10)+(a-56320);if(Cn.has(i)){n=s;break}}}continue}if(An[o-Mt]!==Tn||Pn.has(o)){n=s;break}}}if(n===-1)return t;let r=[];n>0&&r.push(t.slice(0,n));for(let s=n;s<e;s++){let o=t.charCodeAt(s);if(o>=vr&&o<=wr||o===Sr){r.push(t[s]);continue}if(o<Mt){r.push(Pn.has(o)?"-":t[s]);continue}if(o>=55296&&o<=56319){if(s+1<e){let i=t.charCodeAt(s+1);if(i>=56320&&i<=57343){let c=65536+(o-55296<<10)+(i-56320),l=Cn.get(c);if(l!==void 0){r.push(String.fromCharCode(l+48)),s++;continue}}}r.push(t[s]);continue}if(Pn.has(o)){r.push("-");continue}let a=An[o-Mt];r.push(a!==Tn?String.fromCharCode(a+48):t[s]);}return r.join("")}var kr=ki;var Ei=/^[-+]?0x[a-fA-F0-9]+$/,ji=/^0b[01]+$/,xi=/^0o[0-7]+$/,Ti=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Ci={hex:true,binary:false,octal:false,leadingZeros:true,decimalPoint:".",eNotation:true,infinity:"original",unicode:false};function ss(t,e={}){if(e=Object.assign({},Ci,e),!t||typeof t!="string")return t;let n=t.trim();if(n.length===0)return t;if(e.skipLike!==void 0&&e.skipLike.test(n))return t;if(n==="0"||e.unicode&&(n=kr(n),n==="0"))return 0;if(e.hex&&Ei.test(n))return ns(n,16);if(e.binary&&ji.test(n))return ns(n,2);if(e.octal&&xi.test(n))return ns(n,8);if(isFinite(n)){if(n.includes("e")||n.includes("E"))return Pi(t,n,e);{let r=Ti.exec(n);if(r){let s=r[1]||"",o=r[2],a=Mi(r[3]),i=s?t[o.length+1]===".":t[o.length]===".";if(!e.leadingZeros&&(o.length>1||o.length===1&&!i))return t;{let c=Number(n),l=String(c);if(c===0)return c;if(l.search(/[eE]/)!==-1)return e.eNotation?c:t;if(n.indexOf(".")!==-1)return l==="0"||l===a||l===`${s}${a}`?c:t;let u=o?a:n;return o?u===l||s+u===l?c:t:u===l||u===s+l?c:t}}else return t}}else return $i(t,Number(n),e)}var Ai=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Pi(t,e,n){if(!n.eNotation)return t;let r=e.match(Ai);if(r){let s=r[1]||"",o=r[3].indexOf("e")===-1?"E":"e",a=r[2],i=s?t[a.length+1]===o:t[a.length]===o;return a.length>1&&i?t:a.length===1&&(r[3].startsWith(`.${o}`)||r[3][0]===o)?Number(e):a.length>0?n.leadingZeros&&!i?(e=(r[1]||"")+r[3],Number(e)):t:Number(e)}else return t}function Mi(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substring(0,t.length-1))),t}function ns(t,e){let n=t.trim();if((e===2||e===8)&&(t=n.substring(2)),parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function $i(t,e,n){let r=e===1/0;switch(n.infinity.toLowerCase()){case "null":return null;case "infinity":return e;case "string":return r?"Infinity":"-Infinity";default:return t}}function rs(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(let n of t)if(typeof n=="string"&&e===n||n instanceof RegExp&&n.test(e))return true}:()=>false}var at=class{constructor(e,n={},r){this.pattern=e,this.separator=n.separator||".",this.segments=this._parse(e),this.data=r,this._hasDeepWildcard=this.segments.some(s=>s.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(s=>s.attrName!==void 0),this._hasPositionSelector=this.segments.some(s=>s.position!==void 0);}_parse(e){let n=[],r=0,s="";for(;r<e.length;)e[r]===this.separator?r+1<e.length&&e[r+1]===this.separator?(s.trim()&&(n.push(this._parseSegment(s.trim())),s=""),n.push({type:"deep-wildcard"}),r+=2):(s.trim()&&n.push(this._parseSegment(s.trim())),s="",r++):(s+=e[r],r++);return s.trim()&&n.push(this._parseSegment(s.trim())),n}_parseSegment(e){let n={type:"tag"},r=null,s=e,o=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(o&&(s=o[1]+o[3],o[2])){let u=o[2].slice(1,-1);u&&(r=u);}let a,i=s;if(s.includes("::")){let u=s.indexOf("::");if(a=s.substring(0,u).trim(),i=s.substring(u+2).trim(),!a)throw new Error(`Invalid namespace in pattern: ${e}`)}let c,l=null;if(i.includes(":")){let u=i.lastIndexOf(":"),p=i.substring(0,u).trim(),d=i.substring(u+1).trim();["first","last","odd","even"].includes(d)||/^nth\(\d+\)$/.test(d)?(c=p,l=d):c=i;}else c=i;if(!c)throw new Error(`Invalid segment pattern: ${e}`);if(n.tag=c,a&&(n.namespace=a),r)if(r.includes("=")){let u=r.indexOf("=");n.attrName=r.substring(0,u).trim(),n.attrValue=r.substring(u+1).trim();}else n.attrName=r.trim();if(l){let u=l.match(/^nth\((\d+)\)$/);u?(n.position="nth",n.positionValue=parseInt(u[1],10)):n.position=l;}return n}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}};var $t=class{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._deepByTerminalTag=new Map,this._patterns=new Set,this._sealed=false;}add(e){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(e.pattern))return this;if(this._patterns.add(e.pattern),e.hasDeepWildcard()){let o=e.segments[e.segments.length-1];if(o&&o.type!=="deep-wildcard"&&o.tag!=="*"){let a=o.tag;this._deepByTerminalTag.has(a)||this._deepByTerminalTag.set(a,[]),this._deepByTerminalTag.get(a).push(e);}else this._deepWildcards.push(e);return this}let n=e.length,s=e.segments[e.segments.length-1]?.tag;if(!s||s==="*")this._wildcardByDepth.has(n)||this._wildcardByDepth.set(n,[]),this._wildcardByDepth.get(n).push(e);else {let o=`${n}:${s}`;this._byDepthAndTag.has(o)||this._byDepthAndTag.set(o,[]),this._byDepthAndTag.get(o).push(e);}return this}addAll(e){for(let n of e)this.add(n);return this}has(e){return this._patterns.has(e.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=true,this}get isSealed(){return this._sealed}matchesAny(e){return this.findMatch(e)!==null}findMatch(e){let n=e.getDepth(),r=e.getCurrentTag(),s=`${n}:${r}`,o=this._byDepthAndTag.get(s);if(o){for(let c=0;c<o.length;c++)if(e.matches(o[c]))return o[c]}let a=this._wildcardByDepth.get(n);if(a){for(let c=0;c<a.length;c++)if(e.matches(a[c]))return a[c]}let i=this._deepByTerminalTag.get(r);if(i){for(let c=0;c<i.length;c++)if(e.matches(i[c]))return i[c]}for(let c=0;c<this._deepWildcards.length;c++)if(e.matches(this._deepWildcards[c]))return this._deepWildcards[c];return null}};var os=class{constructor(e){this._matcher=e;}get separator(){return this._matcher.separator}getCurrentTag(){let e=this._matcher.path;return e.length>0?e[e.length-1].tag:void 0}getCurrentNamespace(){let e=this._matcher.path;return e.length>0?e[e.length-1].namespace:void 0}getAttrValue(e){let n=this._matcher.path;if(n.length!==0)return n[n.length-1].values?.[e]}hasAttr(e){let n=this._matcher.path;if(n.length===0)return false;let r=n[n.length-1];return r.values!==void 0&&e in r.values}getAnyParentAttr(e){return this._matcher.getAnyParentAttr(e)}hasAnyParentAttr(e){return this._matcher.hasAnyParentAttr(e)}getPosition(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].position??0}getCounter(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(e,n=true){return this._matcher.toString(e,n)}toArray(){return this._matcher.path.map(e=>e.tag)}matches(e){return this._matcher.matches(e)}matchesAny(e){return e.matchesAny(this._matcher)}},Lt=class{constructor(e={}){this.separator=e.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new os(this),this._keptAttrs=[];}push(e,n=null,r=null,s=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let o=this.path.length;this.siblingStacks[o]||(this.siblingStacks[o]=new Map);let a=this.siblingStacks[o],i=r?`${r}:${e}`:e,c=a.get(i)||0,l=0;for(let f of a.values())l+=f;a.set(i,c+1);let u={tag:e,position:l,counter:c};r!=null&&(u.namespace=r),n!=null&&(u.values=n),this.path.push(u);let p=this.path.length,d=s!==null?s.keep:null;if(d!=null&&d.length>0&&n)for(let f=0;f<d.length;f++){let g=d[f];n[g]!==void 0&&this._keptAttrs.push({depth:p,name:g,value:n[g]});}}pop(){if(this.path.length===0)return;this._pathStringCache=null;let e=this.path.pop();this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1);let n=this.path.length+1;for(;this._keptAttrs.length>0&&this._keptAttrs[this._keptAttrs.length-1].depth>=n;)this._keptAttrs.pop();return e}updateCurrent(e){if(this.path.length>0){let n=this.path[this.path.length-1];e!=null&&(n.values=e);}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return false;let n=this.path[this.path.length-1];return n.values!==void 0&&e in n.values}getAnyParentAttr(e){let n=this._keptAttrs;for(let r=n.length-1;r>=0;r--)if(n[r].name===e)return n[r].value}hasAnyParentAttr(e){let n=this._keptAttrs;for(let r=n.length-1;r>=0;r--)if(n[r].name===e)return true;return false}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,n=true){let r=e||this.separator;if(r===this.separator&&n===true){if(this._pathStringCache!==null)return this._pathStringCache;let o=this.path.map(a=>a.namespace?`${a.namespace}:${a.tag}`:a.tag).join(r);return this._pathStringCache=o,o}return this.path.map(o=>n&&o.namespace?`${o.namespace}:${o.tag}`:o.tag).join(r)}toArray(){return this.path.map(e=>e.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[],this._keptAttrs=[];}matches(e){let n=e.segments;return n.length===0?false:e.hasDeepWildcard()?this._matchWithDeepWildcard(n):this._matchSimple(n)}_matchSimple(e){if(this.path.length!==e.length)return false;for(let n=0;n<e.length;n++)if(!this._matchSegment(e[n],this.path[n],n===this.path.length-1))return false;return true}_matchWithDeepWildcard(e){let n=this.path.length-1,r=e.length-1;for(;r>=0&&n>=0;){let s=e[r];if(s.type==="deep-wildcard"){if(r--,r<0)return true;let o=e[r],a=false;for(let i=n;i>=0;i--)if(this._matchSegment(o,this.path[i],i===this.path.length-1)){n=i-1,r--,a=true;break}if(!a)return false}else {if(!this._matchSegment(s,this.path[n],n===this.path.length-1))return false;n--,r--;}}return r<0}_matchSegment(e,n,r){if(e.tag!=="*"&&e.tag!==n.tag||e.namespace!==void 0&&e.namespace!=="*"&&e.namespace!==n.namespace||e.attrName!==void 0&&(!r||!n.values||!(e.attrName in n.values)||e.attrValue!==void 0&&String(n.values[e.attrName])!==String(e.attrValue)))return false;if(e.position!==void 0){if(!r)return false;let s=n.counter??0;if(e.position==="first"&&s!==0)return false;if(e.position==="odd"&&s%2!==1)return false;if(e.position==="even"&&s%2!==0)return false;if(e.position==="nth"&&s!==e.positionValue)return false}return true}matchesAny(e){return e.matchesAny(this)}snapshot(){return {path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e)),keptAttrs:this._keptAttrs.map(e=>({...e}))}}restore(e){this._pathStringCache=null,this.path=e.path.map(n=>({...n})),this.siblingStacks=e.siblingStacks.map(n=>new Map(n)),this._keptAttrs=(e.keptAttrs||[]).map(n=>({...n}));}readOnly(){return this._view}};var Li=[{id:"html-script-open",description:"<script opening tag",pattern:/<script[\s>/]/i},{id:"html-script-close",description:"</script closing tag",pattern:/<\/script[\s>]/i},{id:"html-javascript-protocol",description:"javascript: URI scheme (with optional whitespace/encoding)",pattern:/j[\t\n\r ]*a[\t\n\r ]*v[\t\n\r ]*a[\t\n\r ]*s[\t\n\r ]*c[\t\n\r ]*r[\t\n\r ]*i[\t\n\r ]*p[\t\n\r ]*t[\t\n\r ]*:/i},{id:"html-vbscript-protocol",description:"vbscript: URI scheme",pattern:/vbscript[\t\n\r ]*:/i},{id:"html-data-html",description:"data:text/html URI \u2014 can execute scripts in browsers",pattern:/data[\t\n\r ]*:[\t\n\r ]*text\/html/i},{id:"html-data-xhtml",description:"data:application/xhtml+xml URI",pattern:/data[\t\n\r ]*:[\t\n\r ]*application\/xhtml/i},{id:"html-data-svg",description:"data:image/svg+xml URI \u2014 can execute scripts",pattern:/data[\t\n\r ]*:[\t\n\r ]*image\/svg\+xml/i},{id:"html-inline-event-handler",description:"Inline event handler attributes: onclick=, onerror=, onload=, etc.",pattern:/\bon\w{1,30}\s*=/i},{id:"html-entity-obfuscated-script",description:"HTML-entity-encoded <script (e.g. &#x3C;script or &lt;script)",pattern:/(?:&#x0*3[Cc];?|&#0*60;?|&lt;)\s*script/i},{id:"html-entity-obfuscated-javascript",description:'HTML-entity-encoded javascript: (partial \u2014 catches common &#106; or &#x6a; for "j")',pattern:/(?:&#x0*6[Aa];?|&#0*106;?)\s*(?:&#x0*61;?|a)[\s\S]{0,80}script\s*:/i},{id:"html-style-expression",description:"CSS expression() \u2014 IE-era code execution in style attributes",pattern:/style[\s\S]{0,20}expression\s*\(/i},{id:"html-object-embed",description:"<object or <embed tags that can load active content",pattern:/<(?:object|embed)[\s>/]/i},{id:"html-base-tag",description:"<base href= \u2014 can hijack all relative URLs on a page",pattern:/<base[\s>]/i},{id:"html-meta-refresh",description:'<meta http-equiv="refresh" \u2014 can redirect users',pattern:/<meta[\s\S]{0,40}http-equiv[\s\S]{0,20}refresh/i},{id:"html-srcdoc",description:"srcdoc= attribute on iframes \u2014 embeds HTML that can run scripts",pattern:/srcdoc\s*=/i},{id:"html-iframe",description:"<iframe tag",pattern:/<iframe[\s>/]/i},{id:"html-form",description:"<form tag \u2014 can be used for phishing / credential harvesting injection",pattern:/<form[\s>/]/i}],Er=Li;var Ni=[{id:"xml-cdata-injection",description:"CDATA section injection: <![CDATA[ breaks out of text node context",pattern:/<!\[CDATA\[/i},{id:"xml-cdata-close",description:"CDATA close sequence: ]]> can terminate an enclosing CDATA section",pattern:/\]\]>/},{id:"xml-processing-instruction",description:"XML processing instruction: <?xml-stylesheet or <?php etc.",pattern:/<\?(?:xml[\- ]|php|asp)/i},{id:"xml-doctype-injection",description:"DOCTYPE declaration embedded in content \u2014 can define entities",pattern:/<!DOCTYPE(?:[\s[]|$)/i},{id:"xml-entity-system",description:"SYSTEM keyword \u2014 used in external entity declarations (XXE)",pattern:/\bSYSTEM\s+["']/i},{id:"xml-entity-public",description:"PUBLIC keyword \u2014 used in external entity declarations (XXE)",pattern:/\bPUBLIC\s+["']/i},{id:"xml-entity-declaration",description:"<!ENTITY declaration \u2014 defines entities, potential XXE or entity expansion",pattern:/<!ENTITY[\s%]/i},{id:"xml-billion-laughs",description:"Entity reference chaining / billion laughs: repeated &eX; style references",pattern:/(?:&\w{1,20};){3,}/},{id:"xml-namespace-confusion",description:"xmlns: attribute injection \u2014 can redefine namespaces to confuse parsers",pattern:/\bxmlns\s*(?::\w{1,40})?\s*=/i},{id:"xml-comment-injection",description:"<!-- comment injection \u2014 can hide content from some parsers",pattern:/<!--/},{id:"xml-comment-close",description:"--> closes an enclosing XML comment",pattern:/-->/},{id:"xml-pi-close",description:"?> closes an enclosing processing instruction",pattern:/\?>/}],jr=Ni;var Ri=[{id:"svg-script-element",description:"<script element inside SVG executes JavaScript",pattern:/<script[\s>/]/i},{id:"svg-xlink-href-javascript",description:"xlink:href with javascript: \u2014 classic SVG XSS via <a> or <use>",pattern:/xlink\s*:\s*href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-href-javascript",description:"href= with javascript: in SVG context (<a>, <animate>, etc.)",pattern:/href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-foreignobject",description:"<foreignObject embeds HTML inside SVG \u2014 can execute scripts",pattern:/<foreignObject[\s>/]/i},{id:"svg-use-external",description:"<use xlink:href or href pointing to external resource (non-fragment URL)",pattern:/<use[\s\S]{0,60}(?:xlink\s*:\s*)?href\s*=\s*(?:["'][^#]|[^"'#\s>])/i},{id:"svg-animate-href",description:'<animate attributeName="href" \u2014 can dynamically change href to javascript:',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*href["']/i},{id:"svg-animate-xlinkhref",description:'<animate attributeName="xlink:href"',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*xlink\s*:\s*href["']/i},{id:"svg-set-javascript",description:'<set to="javascript:..." \u2014 sets an attribute to a javascript: URI',pattern:/<set[\s\S]{0,80}to\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-event-handler",description:"SVG-specific event handler attributes: onload=, onerror=, onactivate=, etc.",pattern:/\bon(?:load|error|activate|begin|end|repeat|focus|blur|click|mouse\w{1,20}|key\w{1,20})\s*=/i},{id:"svg-handler-generic",description:"Generic on* handler catch-all for SVG attributes",pattern:/\bon\w{1,30}\s*=/i},{id:"svg-filter-feimage",description:"<feImage href= \u2014 filter primitive that can load external resources",pattern:/<feImage[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=/i},{id:"svg-image-external",description:"<image xlink:href with http/https or javascript protocol",pattern:/<image[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=\s*["']?\s*(?:https?|javascript)\s*:/i},{id:"svg-style-javascript",description:"style= attribute containing javascript: (e.g. background:url(javascript:...))",pattern:/style\s*=[\s\S]{0,60}javascript\s*:/i}],xr=Ri;var Ii=[{id:"sql-block-comment-open",description:"SQL block comment open: /* ... */ \u2014 unusual in legitimate user text",pattern:/\/\*/},{id:"sql-union-select",description:"UNION SELECT \u2014 most common SQL injection aggregation attack",pattern:/\bUNION\s{1,20}(?:ALL\s{1,20})?SELECT\b/i},{id:"sql-drop-table",description:"DROP TABLE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}TABLE\b/i},{id:"sql-drop-database",description:"DROP DATABASE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}DATABASE\b/i},{id:"sql-insert-into",description:"INSERT INTO \u2014 data injection",pattern:/\bINSERT\s{1,20}INTO\b/i},{id:"sql-delete-from",description:"DELETE FROM \u2014 data deletion injection",pattern:/\bDELETE\s{1,20}FROM\b/i},{id:"sql-update-set",description:"UPDATE ... SET \u2014 data modification injection",pattern:/\bUPDATE\b[\s\S]{1,60}\bSET\b/i},{id:"sql-exec-xp",description:"EXEC xp_ \u2014 MSSQL extended stored procedure execution",pattern:/\bEXEC(?:UTE)?\s{1,20}xp_/i},{id:"sql-tautology-string",description:`Classic string tautology: ' OR '1'='1 or " OR "1"="1"`,pattern:/'\s{0,10}OR\s{0,10}'[^']{0,20}'\s*=\s*'[^']{0,20}/i},{id:"sql-tautology-numeric",description:"Numeric tautology: OR 1=1",pattern:/\bOR\s{1,10}1\s*=\s*1\b/i},{id:"sql-always-true-zero",description:"Numeric tautology: OR 0=0",pattern:/\bOR\s{1,10}0\s*=\s*0\b/i},{id:"sql-sleep-benchmark",description:"Time-based blind injection: SLEEP() or BENCHMARK()",pattern:/\b(?:SLEEP|BENCHMARK)\s*\(/i},{id:"sql-waitfor-delay",description:"MSSQL time-based blind injection: WAITFOR DELAY",pattern:/\bWAITFOR\s{1,20}DELAY\b/i},{id:"sql-char-function",description:"CHAR() function \u2014 used to obfuscate injected strings",pattern:/\bCHAR\s*\(\s*\d{1,3}/i},{id:"sql-information-schema",description:"INFORMATION_SCHEMA \u2014 reconnaissance query for table/column enumeration",pattern:/\bINFORMATION_SCHEMA\b/i}],Mn=Ii;var _i=[{id:"sql-line-comment",description:"SQL line comment: -- followed by whitespace or end of string",pattern:/--(?:\s|$)/},{id:"sql-stacked-query",description:"Stacked queries: semicolon immediately followed by a SQL keyword",pattern:/;\s{0,10}(?:SELECT|INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|EXEC)\b/i},{id:"sql-hex-encoding",description:"Hex-encoded string injection: 0x41414141 style (MySQL)",pattern:/\b0x[0-9a-f]{4,}/i}],Fi=[...Mn,..._i],Tr=Fi;var Oi=[{id:"shell-path-traversal-unix",description:"Unix path traversal: ../ \u2014 climbing the directory tree",pattern:/\.\.\//},{id:"shell-path-traversal-windows",description:"Windows path traversal: ..\\ \u2014 climbing the directory tree",pattern:/\.\.\\/},{id:"shell-path-traversal-encoded",description:"URL-encoded path traversal: %2e%2e or %2f variants",pattern:/%2e%2e|%2f\.\.|\.\.%2f/i},{id:"shell-null-byte",description:"Null byte injection: \\x00 or %00 \u2014 truncates strings in C-backed functions",pattern:/\x00|%00/},{id:"shell-semicolon",description:"Semicolon command separator: cmd1; cmd2",pattern:/;/},{id:"shell-pipe",description:"Pipe operator: cmd1 | cmd2",pattern:/\|/},{id:"shell-and-operator",description:"AND operator: cmd1 && cmd2",pattern:/&&/},{id:"shell-or-operator",description:"OR operator: cmd1 || cmd2",pattern:/\|\|/},{id:"shell-backtick",description:"Backtick command substitution: `cmd`",pattern:/`/},{id:"shell-dollar-paren",description:"Dollar-paren command substitution: $(cmd)",pattern:/\$\(/},{id:"shell-dollar-brace",description:"Dollar-brace variable expansion: ${var} \u2014 can be abused for injection",pattern:/\$\{/},{id:"shell-redirect-out",description:"Output redirection: cmd > file or cmd >> file",pattern:/>{1,2}/},{id:"shell-redirect-in",description:"Input redirection: cmd < file",pattern:/</},{id:"shell-newline-injection",description:"Newline injection: \\n or \\r \u2014 can inject new shell commands",pattern:/[\n\r]/},{id:"shell-glob-star",description:"Glob expansion: * or ? \u2014 can expand to unintended files",pattern:/[/\\][*?]/},{id:"shell-absolute-root",description:"Absolute root path injection: string starting with / or \\ (Windows UNC)",pattern:/^(?:\/|\\\\)/},{id:"shell-windows-drive",description:"Windows drive letter path injection: C:\\ or D:/",pattern:/^[a-zA-Z]:[/\\]/},{id:"shell-curl-wget",description:"curl/wget with URL or flags \u2014 can exfiltrate data or download payloads",pattern:/\b(?:curl|wget)\s+(?:https?:\/\/|ftp:\/\/|-)/i}],Cr=Oi;var Bi=[{id:"redos-nested-quantifier-plus",description:"Nested + quantifier inside a group with outer quantifier: (a+)+, (.+b)*, etc.",pattern:/\([^)]*\+[^)]*\)[+*]/},{id:"redos-nested-quantifier-star",description:"Nested * quantifier: (a*)* or (a*)+ \u2014 catastrophic backtracking",pattern:/\([^)]*\*[^)]*\)[*+]/},{id:"redos-nested-groups",description:"Doubly nested quantified groups: ((a+)+) \u2014 guaranteed catastrophic",pattern:/\(\([^)]{0,40}\)[+*]\)[+*]/},{id:"redos-alternation-overlap",description:"Overlapping alternation under quantifier: (a|a)+ \u2014 ambiguous NFA paths",pattern:/\(([^|()]{1,20})\|(?:\1)(?:\|[^|()]{1,20}){0,5}\)[+*?]{1,2}/},{id:"redos-star-plus-concat",description:"(x*x)+ pattern \u2014 triggers super-linear backtracking",pattern:/\([^)]{0,10}\*[^)]{0,10}\)[+*]/},{id:"redos-dot-star-greedy",description:"(.*){n,} or (.+){n,} \u2014 repeated greedy dot quantifiers",pattern:/\(\.[*+]\)\{?\d/},{id:"redos-large-repetition",description:"Very large fixed or range repetition count {1000,} or {1000,n} \u2014 denial of service via backtracking",pattern:/\{\d{4,}(?:,\d*)?\}/},{id:"redos-catastrophic-alternation",description:"Long alternation with many similar branches \u2014 polynomial backtracking risk",pattern:/\([^)]{0,200}(?:\|[^|)]{0,50}){9,}\)/}],Ar=Bi;var oe=`["'\\s]*:`,Di=[{id:"nosql-where-operator",description:"$where \u2014 executes arbitrary JavaScript server-side in MongoDB",pattern:new RegExp(`\\$where${oe}`,"i")},{id:"nosql-ne-operator",description:'$ne \u2014 "not equal" operator used to bypass equality checks',pattern:new RegExp(`\\$ne${oe}`,"i")},{id:"nosql-gt-operator",description:'$gt \u2014 "greater than" used to bypass password/value checks',pattern:new RegExp(`\\$gte?${oe}`,"i")},{id:"nosql-lt-operator",description:'$lt / $lte \u2014 "less than" bypass variants',pattern:new RegExp(`\\$lte?${oe}`,"i")},{id:"nosql-regex-operator",description:"$regex \u2014 can be used to extract data character by character (blind injection)",pattern:new RegExp(`\\$regex${oe}`,"i")},{id:"nosql-or-operator",description:"$or \u2014 logical OR; used to create always-true conditions",pattern:new RegExp(`\\$or${oe}\\s*\\[`,"i")},{id:"nosql-and-operator",description:"$and \u2014 logical AND operator injection",pattern:new RegExp(`\\$and${oe}\\s*\\[`,"i")},{id:"nosql-nor-operator",description:"$nor \u2014 logical NOR operator injection",pattern:new RegExp(`\\$nor${oe}\\s*\\[`,"i")},{id:"nosql-exists-operator",description:"$exists \u2014 can enumerate fields to determine schema",pattern:new RegExp(`\\$exists${oe}`,"i")},{id:"nosql-in-operator",description:"$in \u2014 matches any value in a list; can enumerate values",pattern:new RegExp(`\\$in${oe}\\s*\\[`,"i")},{id:"nosql-expr-operator",description:"$expr \u2014 allows aggregation expressions in queries (MongoDB 3.6+)",pattern:new RegExp(`\\$expr${oe}`,"i")},{id:"nosql-function-operator",description:"$function \u2014 executes arbitrary JavaScript in MongoDB 4.4+",pattern:new RegExp(`\\$function${oe}`,"i")},{id:"nosql-accumulator-operator",description:"$accumulator \u2014 custom aggregation with arbitrary JS execution",pattern:new RegExp(`\\$accumulator${oe}`,"i")},{id:"nosql-proto-pollution",description:"__proto__ \u2014 prototype pollution via object key injection",pattern:/__proto__/},{id:"nosql-constructor-prototype",description:"constructor.prototype \u2014 alternative prototype pollution vector (dot notation or JSON key)",pattern:/constructor[\s"':.,{\[]*prototype/i},{id:"nosql-proto-bracket",description:'["__proto__"] \u2014 bracket-notation prototype pollution',pattern:/\[["']__proto__["']\]/}],Pr=Di;var Vi=[{id:"log-crlf-injection",description:"CRLF injection: literal \\r or \\n embeds fake log lines",pattern:/[\r\n]/},{id:"log-url-encoded-crlf",description:"URL-encoded CRLF: %0d, %0a, %0D, %0A \u2014 decoded by some log parsers",pattern:/%0[dDaA]/},{id:"log-unicode-newline",description:"Unicode newline variants: U+2028 (line separator), U+2029 (paragraph separator)",pattern:/[\u2028\u2029]/},{id:"log-log4shell-jndi",description:"Log4Shell: ${jndi:...} triggers remote code execution in Apache Log4j",pattern:/\$\{jndi\s*:/i},{id:"log-log4shell-obfuscated",description:"Obfuscated Log4Shell: ${::-j}... lookup-bypass prefix used to evade WAF detection",pattern:/\$\{::-/},{id:"log-log4j-lookup",description:"Log4j lookup syntax: ${env:...}, ${sys:...}, ${ctx:...} \u2014 data exfiltration",pattern:/\$\{(?:env|sys|ctx|main|map|sd|web|docker|k8s|spring)\s*:/i},{id:"log-ssti-double-brace",description:"SSTI double-brace: {{expression}} \u2014 Jinja2, Twig, Handlebars, etc.",pattern:/\{\{[\s\S]{0,80}\}\}/},{id:"log-ssti-hash-brace",description:"SSTI hash-brace: #{expression} \u2014 Thymeleaf, Velocity, Ruby ERB",pattern:/#\{[\s\S]{0,80}\}/},{id:"log-ssti-dollar-brace",description:"SSTI/EL injection: ${expression with operators or method calls} \u2014 JSP EL, Freemarker, SpEL",pattern:/\$\{[^}]*(?:\.|\(|\*|\+|\bclass\b|\bruntime\b|\bprocess\b|\bexec\b)[^}]{0,80}\}/i},{id:"log-ssti-percent-tag",description:"SSTI ERB/ASP tag: <%= expression %> \u2014 Ruby ERB, ASP",pattern:/<%=[\s\S]{0,80}%>/},{id:"log-null-byte",description:"Null byte: \\x00 or %00 \u2014 can truncate log entries in C-backed loggers",pattern:/\x00|%00/},{id:"log-ansi-escape",description:"ANSI escape sequence: ESC[ \u2014 can manipulate terminal output when logs are tailed",pattern:/\x1b\[/}],Mr=Vi;var $r={HTML:Er,XML:jr,SVG:xr,SQL:Mn,"SQL-STRICT":Tr,SHELL:Cr,REDOS:Ar,NOSQL:Pr,LOG:Mr},$n=$r,Nt=Object.freeze(Object.fromEntries(Object.keys($r).map(t=>[t,t])));function Ui(t){if(typeof t!="string")throw new TypeError(`is-unsafe: first argument must be a string, got ${typeof t}`)}function qi(t){if(!(t instanceof RegExp)){if(typeof t=="string"){if(!$n[t])throw new TypeError(`is-unsafe: unknown context "${t}". Valid contexts: ${Object.keys(Nt).join(", ")}`);return}if(Array.isArray(t)){if(t.length===0)throw new TypeError("is-unsafe: context array must not be empty");for(let e of t)if(typeof e!="string"||!$n[e])throw new TypeError(`is-unsafe: unknown context "${e}" in array. Valid contexts: ${Object.keys(Nt).join(", ")}`);return}throw new TypeError(`is-unsafe: second argument must be a context string, array of context strings, or RegExp. Got: ${typeof t}`)}}function Lr(t,e){let n=$n[e];for(let r of n)if(r.pattern.test(t))return {context:e,id:r.id,description:r.description,pattern:r.pattern};return null}function Nr(t,e){if(Ui(t),qi(e),e instanceof RegExp)return e.test(t);if(typeof e=="string")return Lr(t,e)!==null;for(let n of e)if(Lr(t,n)!==null)return true;return false}function Gi(t,e){if(!t)return {};let n=e.attributesGroupName?t[e.attributesGroupName]:t;if(!n)return {};let r={};for(let s in n)if(s.startsWith(e.attributeNamePrefix)){let o=s.substring(e.attributeNamePrefix.length);r[o]=n[s];}else r[s]=n[s];return r}function Hi(t){if(!t||typeof t!="string")return;let e=t.indexOf(":");if(e!==-1&&e>0){let n=t.substring(0,e);if(n!=="xmlns")return n}}var Xt=class{constructor(e,n){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Qi,this.parseTextData=Wi,this.resolveNameSpace=zi,this.buildAttributesMap=Ki,this.isItStopNode=ea,this.replaceEntitiesValue=Xi,this.readStopNodeData=sa,this.saveTextToParentTag=Zi,this.addChild=Yi,this.ignoreAttributesFn=rs(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0;let r={...Jt};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?r=this.options.htmlEntities:this.options.htmlEntities===true&&(r={...Zn,...En}),this.entityDecoder=new Pt({namedEntities:{...r,...n},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo},onInputEntity:(o,a)=>Nr(a,[Nt.HTML,Nt.XML])?At.BLOCK:At.ALLOW})),this.matcher=new Lt,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=false,this.stopNodeExpressionsSet=new $t;let s=this.options.stopNodes;if(s&&s.length>0){for(let o=0;o<s.length;o++){let a=s[o];typeof a=="string"?this.stopNodeExpressionsSet.add(new at(a)):a instanceof at&&this.stopNodeExpressionsSet.add(a);}this.stopNodeExpressionsSet.seal();}}};function Wi(t,e,n,r,s,o,a){let i=this.options;if(t!==void 0&&(i.trimValues&&!r&&(t=t.trim()),t.length>0)){a||(t=this.replaceEntitiesValue(t,e,n));let c=i.jPath?n.toString():n,l=i.tagValueProcessor(e,t,c,s,o);return l==null?t:typeof l!=typeof t||l!==t?l:i.trimValues||t.trim()===t?cs(t,i.parseTagValue,i.numberParseOptions):t}}function zi(t){if(this.options.removeNSPrefix){let e=t.split(":"),n=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return "";e.length===2&&(t=n+e[1]);}return t}var Ji=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Ki(t,e,n,r=false){let s=this.options;if(r===true||s.ignoreAttributes!==true&&typeof t=="string"){let o=Sn(t,Ji),a=o.length,i={},c=new Array(a),l=false,u={};for(let f=0;f<a;f++){let g=this.resolveNameSpace(o[f][1]),h=o[f][4];if(g.length&&h!==void 0){let y=h;s.trimValues&&(y=y.trim()),y=this.replaceEntitiesValue(y,n,this.readonlyMatcher),c[f]=y,u[g]=y,l=true;}}l&&typeof e=="object"&&e.updateCurrent&&e.updateCurrent(u);let p=s.jPath?e.toString():this.readonlyMatcher,d=false;for(let f=0;f<a;f++){let g=this.resolveNameSpace(o[f][1]);if(this.ignoreAttributesFn(g,p))continue;let h=s.attributeNamePrefix+g;if(g.length)if(s.transformAttributeName&&(h=s.transformAttributeName(h)),h=Rr(h,s),o[f][4]!==void 0){let y=c[f],j=s.attributeValueProcessor(g,y,p);j==null?i[h]=y:typeof j!=typeof y||j!==y?i[h]=j:i[h]=cs(y,s.parseAttributeValue,s.numberParseOptions),d=true;}else s.allowBooleanAttributes&&(i[h]=true,d=true);}if(!d)return;if(s.attributesGroupName&&!s.preserveOrder){let f={};return f[s.attributesGroupName]=i,f}return i}}var Qi=function(t){t=t.replace(/\r\n?/g,`
4
+ `);let e=new Z("!xml"),n=e,r="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let s=this.options,o=new Yt(s.processEntities),a=t.length;for(let i=0;i<a;i++)if(t[i]==="<"){let l=t.charCodeAt(i+1);if(l===47){let u=Rt(t,">",i,"Closing Tag is not closed."),p=t.substring(i+2,u).trim();if(s.removeNSPrefix){let f=p.indexOf(":");f!==-1&&(p=p.substr(f+1));}p=is(s.transformTagName,p,"",s).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));let d=this.matcher.getCurrentTag();if(p&&s.unpairedTagsSet.has(p))throw new Error(`Unpaired tag can not be used as closing tag: </${p}>`);d&&s.unpairedTagsSet.has(d)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=false,n=this.tagsNodeStack.pop(),r="",i=u;}else if(l===63){let u=as(t,i,false,"?>");if(!u)throw new Error("Pi Tag is not closed.");r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let p=this.buildAttributesMap(u.tagExp,this.matcher,u.tagName,true);if(p){let d=p[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(d)||1),o.setXmlVersion(Number(d)||1);}if(!(s.ignoreDeclaration&&u.tagName==="?xml"||s.ignorePiTags)){let d=new Z(u.tagName);d.add(s.textNodeName,""),u.tagName!==u.tagExp&&u.attrExpPresent&&s.ignoreAttributes!==true&&(d[":@"]=p),this.addChild(n,d,this.readonlyMatcher,i);}i=u.closeIndex+1;}else if(l===33&&t.charCodeAt(i+2)===45&&t.charCodeAt(i+3)===45){let u=Rt(t,"-->",i+4,"Comment is not closed.");if(s.commentPropName){let p=t.substring(i+4,u-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(s.commentPropName,[{[s.textNodeName]:p}]);}i=u;}else if(l===33&&t.charCodeAt(i+2)===68){let u=o.readDocType(t,i);this.entityDecoder.addInputEntities(u.entities),i=u.i;}else if(l===33&&t.charCodeAt(i+2)===91){let u=Rt(t,"]]>",i,"CDATA is not closed.")-2,p=t.substring(i+9,u);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let d=this.parseTextData(p,n.tagname,this.readonlyMatcher,true,false,true,true);d==null&&(d=""),s.cdataPropName?n.add(s.cdataPropName,[{[s.textNodeName]:p}]):n.add(s.textNodeName,d),i=u+2;}else {let u=as(t,i,s.removeNSPrefix);if(!u){let b=t.substring(Math.max(0,i-50),Math.min(a,i+50));throw new Error(`readTagExp returned undefined at position ${i}. Context: "${b}"`)}let p=u.tagName,d=u.rawTagName,f=u.tagExp,g=u.attrExpPresent,h=u.closeIndex;if({tagName:p,tagExp:f}=is(s.transformTagName,p,f,s),s.strictReservedNames&&(p===s.commentPropName||p===s.cdataPropName||p===s.textNodeName||p===s.attributesGroupName))throw new Error(`Invalid tag name: ${p}`);n&&r&&n.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,false));let y=n;y&&s.unpairedTagsSet.has(y.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let j=false;f.length>0&&f.lastIndexOf("/")===f.length-1&&(j=true,p[p.length-1]==="/"?(p=p.substr(0,p.length-1),f=p):f=f.substr(0,f.length-1),g=p!==f);let C=null,T;T=Hi(d),p!==e.tagname&&this.matcher.push(p,{},T),p!==f&&g&&(C=this.buildAttributesMap(f,this.matcher,p),C&&(Gi(C,s))),p!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let v=i;if(this.isCurrentNodeStopNode){let b="";if(j)i=u.closeIndex;else if(s.unpairedTagsSet.has(p))i=u.closeIndex;else {let w=this.readStopNodeData(t,d,h+1);if(!w)throw new Error(`Unexpected end of ${d}`);i=w.i,b=w.tagContent;}let S=new Z(p);C&&(S[":@"]=C),S.add(s.textNodeName,b),this.matcher.pop(),this.isCurrentNodeStopNode=false,this.addChild(n,S,this.readonlyMatcher,v);}else {if(j){({tagName:p,tagExp:f}=is(s.transformTagName,p,f,s));let b=new Z(p);C&&(b[":@"]=C),this.addChild(n,b,this.readonlyMatcher,v),this.matcher.pop(),this.isCurrentNodeStopNode=false;}else if(s.unpairedTagsSet.has(p)){let b=new Z(p);C&&(b[":@"]=C),this.addChild(n,b,this.readonlyMatcher,v),this.matcher.pop(),this.isCurrentNodeStopNode=false,i=u.closeIndex;continue}else {let b=new Z(p);if(this.tagsNodeStack.length>s.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),C&&(b[":@"]=C),this.addChild(n,b,this.readonlyMatcher,v),n=b;}r="",i=h;}}}else r+=t[i];return e.child};function Yi(t,e,n,r){this.options.captureMetaData||(r=void 0);let s=this.options.jPath?n.toString():n,o=this.options.updateTag(e.tagname,s,e[":@"]);o===false||(typeof o=="string"&&(e.tagname=o),t.addChild(e,r));}function Xi(t,e,n){let r=this.options.processEntities;if(!r||!r.enabled)return t;if(r.allowedTags){let s=this.options.jPath?n.toString():n;if(!(Array.isArray(r.allowedTags)?r.allowedTags.includes(e):r.allowedTags(e,s)))return t}if(r.tagFilter){let s=this.options.jPath?n.toString():n;if(!r.tagFilter(e,s))return t}return this.entityDecoder.decode(t)}function Zi(t,e,n,r){return t&&(r===void 0&&(r=e.child.length===0),t=this.parseTextData(t,e.tagname,n,false,e[":@"]?Object.keys(e[":@"]).length!==0:false,r),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}function ea(){return this.stopNodeExpressionsSet.size===0?false:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function ta(t,e,n=">"){let r=0,s=t.length,o=n.charCodeAt(0),a=n.length>1?n.charCodeAt(1):-1,i="",c=e;for(let l=e;l<s;l++){let u=t.charCodeAt(l);if(r)u===r&&(r=0);else if(u===34||u===39)r=u;else if(u===o)if(a!==-1){if(t.charCodeAt(l+1)===a)return i+=t.substring(c,l),{data:i,index:l}}else return i+=t.substring(c,l),{data:i,index:l};else u===9&&!r&&(i+=t.substring(c,l)+" ",c=l+1);}}function Rt(t,e,n,r){let s=t.indexOf(e,n);if(s===-1)throw new Error(r);return s+e.length-1}function na(t,e,n,r){let s=t.indexOf(e,n);if(s===-1)throw new Error(r);return s}function as(t,e,n,r=">"){let s=ta(t,e+1,r);if(!s)return;let o=s.data,a=s.index,i=o.search(/\s/),c=o,l=true;i!==-1&&(c=o.substring(0,i),o=o.substring(i+1).trimStart());let u=c;if(n){let p=c.indexOf(":");p!==-1&&(c=c.substr(p+1),l=c!==s.data.substr(p+1));}return {tagName:c,tagExp:o,closeIndex:a,attrExpPresent:l,rawTagName:u}}function sa(t,e,n){let r=n,s=1,o=t.length;for(;n<o;n++)if(t[n]==="<"){let a=t.charCodeAt(n+1);if(a===47){let i=na(t,">",n,`${e} is not closed`);if(t.substring(n+2,i).trim()===e&&(s--,s===0))return {tagContent:t.substring(r,n),i};n=i;}else if(a===63)n=Rt(t,"?>",n+1,"StopNode is not closed.");else if(a===33&&t.charCodeAt(n+2)===45&&t.charCodeAt(n+3)===45)n=Rt(t,"-->",n+3,"StopNode is not closed.");else if(a===33&&t.charCodeAt(n+2)===91)n=Rt(t,"]]>",n,"StopNode is not closed.")-2;else {let i=as(t,n,false);i&&((i&&i.tagName)===e&&i.tagExp[i.tagExp.length-1]!=="/"&&s++,n=i.closeIndex);}}}function cs(t,e,n){if(e&&typeof t=="string"){let r=t.trim();return r==="true"?true:r==="false"?false:ss(t,n)}else return Ws(t)?t:""}function is(t,e,n,r){if(t){let s=t(e);n===e&&(n=s),e=s;}return e=Rr(e,r),{tagName:e,tagExp:n}}function Rr(t,e){if(kn.includes(t))throw new Error(`[SECURITY] Invalid name: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);return Wt.includes(t)?e.onDangerousProperty(t):t}var ls=Z.getMetaDataSymbol();function ra(t,e){if(!t||typeof t!="object")return {};if(!e)return t;let n={};for(let r in t)if(r.startsWith(e)){let s=r.substring(e.length);n[s]=t[r];}else n[r]=t[r];return n}function us(t,e,n,r){return Ir(t,e,n,r)}function Ir(t,e,n,r){let s,o={};for(let a=0;a<t.length;a++){let i=t[a],c=oa(i);if(c!==void 0&&c!==e.textNodeName){let l=ra(i[":@"]||{},e.attributeNamePrefix);n.push(c,l);}if(c===e.textNodeName)s===void 0?s=i[c]:s+=""+i[c];else {if(c===void 0)continue;if(i[c]){let l=Ir(i[c],e,n,r),u=aa(l,e);if(Object.keys(l).length===0&&e.alwaysCreateTextNode&&(l[e.textNodeName]=""),i[":@"]?ia(l,i[":@"],r,e):Object.keys(l).length===1&&l[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?l=l[e.textNodeName]:Object.keys(l).length===0&&(e.alwaysCreateTextNode?l[e.textNodeName]="":l=""),i[ls]!==void 0&&typeof l=="object"&&l!==null&&(l[ls]=i[ls]),o[c]!==void 0&&Object.prototype.hasOwnProperty.call(o,c))Array.isArray(o[c])||(o[c]=[o[c]]),o[c].push(l);else {let p=e.jPath?r.toString():r;e.isArray(c,p,u)?o[c]=[l]:o[c]=l;}c!==void 0&&c!==e.textNodeName&&n.pop();}}}return typeof s=="string"?s.length>0&&(o[e.textNodeName]=s):s!==void 0&&(o[e.textNodeName]=s),o}function oa(t){let e=Object.keys(t);for(let n=0;n<e.length;n++){let r=e[n];if(r!==":@")return r}}function ia(t,e,n,r){if(e){let s=Object.keys(e),o=s.length;for(let a=0;a<o;a++){let i=s[a],c=i.startsWith(r.attributeNamePrefix)?i.substring(r.attributeNamePrefix.length):i,l=r.jPath?n.toString()+"."+c:n;r.isArray(i,l,true,true)?t[i]=[e[i]]:t[i]=e[i];}}}function aa(t,e){let{textNodeName:n}=e,r=Object.keys(t).length;return !!(r===0||r===1&&(t[n]||typeof t[n]=="boolean"||t[n]===0))}var Qe=class{constructor(e){this.externalEntities={},this.options=fr(e);}parse(e,n){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===true&&(n={});let o=Ys(e,n);if(o!==true)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}let r=new Xt(this.options,this.externalEntities),s=r.parseXml(e);return this.options.preserveOrder||s===void 0?s:us(s,this.options,r.matcher,r.readonlyMatcher)}addEntity(e,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=n;}static getMetaDataSymbol(){return Z.getMetaDataSymbol()}};var mt=b(a(),1),gt=b(a(),1);var yt=b(a(),1),xe=b(a(),1),Te=b(a(),1),Ce=b(a(),1),Ae=b(a(),1),Pe=b(a(),1),Dn=b(a(),1),me=b(a(),1),Vn=b(a(),1),bt=b(a(),1),ge=b(a(),1),Dt=b(a(),1),Y=b(a(),1),Me=b(a(),1),an=b(a(),1),cn=b(a(),1),ln=b(a(),1),te=b(a(),1),pe=b(a(),1),de=b(a(),1),fe=b(a(),1),he=b(a(),1),$o=b(a(),1);var ca=["vibgrate.config.ts","vibgrate.config.js","vibgrate.config.json"],la="VIBGRATE_TRUST_CONFIG";function ua(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function en(t,e){if(F.isParenthesizedExpression(t))return en(t.expression,e);if(F.isStringLiteralLike(t))return t.text;if(F.isNumericLiteral(t))return Number(t.text);if(t.kind===F.SyntaxKind.TrueKeyword)return true;if(t.kind===F.SyntaxKind.FalseKeyword)return false;if(t.kind===F.SyntaxKind.NullKeyword)return null;if(F.isArrayLiteralExpression(t))return t.elements.map(n=>{if(F.isSpreadElement(n))throw new Error("Spread not supported in static config arrays");return en(n,e)});if(F.isObjectLiteralExpression(t)){let n={};for(let r of t.properties){if(!F.isPropertyAssignment(r)||r.initializer===void 0)throw new Error("Only plain object properties are supported in static config");if(F.isComputedPropertyName(r.name))throw new Error("Computed property names are not supported in static config");let s=F.isIdentifier(r.name)||F.isStringLiteral(r.name)||F.isNumericLiteral(r.name)?r.name.text:null;if(s===null)throw new Error("Unsupported object key in static config");n[s]=en(r.initializer,e);}return n}if(F.isIdentifier(t)){let n=e.get(t.text);if(!n)throw new Error(`Unknown identifier in static config: ${t.text}`);return en(n,e)}throw new Error("Non-static expression in config")}function pa(t,e){let n=e.endsWith(".ts")?F.ScriptKind.TS:F.ScriptKind.JS,r=F.createSourceFile(e,t,F.ScriptTarget.ESNext,true,n),s=new Map;for(let o of r.statements)if(F.isVariableStatement(o)&&o.declarationList.flags&F.NodeFlags.Const)for(let a of o.declarationList.declarations)F.isIdentifier(a.name)&&a.initializer&&s.set(a.name.text,a.initializer);for(let o of r.statements){if(!F.isExportAssignment(o))continue;let a=en(o.expression,s);return ua(a)?{..._n,...a}:null}return null}var da=5242880,fa=180,_n={exclude:[],maxFileSizeToScan:da,projectScanTimeout:fa,thresholds:{failOnError:{eolDays:180,frameworkMajorLag:3,dependencyTwoPlusPercent:50},warn:{frameworkMajorLag:2,dependencyTwoPlusPercent:30}}};async function ha(t){let e=_n;for(let r of ca){let s=_.join(t,r);if(await p(s)){if(r.endsWith(".json")){let i=await o(s);e={..._n,...JSON.parse(i)};break}let o$1=await o(s),a=null;try{a=pa(o$1,s);}catch{a=null;}if(a){e=a;break}if(process.env[la]==="1")try{let i=await import(s);e={..._n,...i.default??i};break}catch{}}}let n=_.join(t,".vibgrate","auto-excludes.json");if(await p(n))try{let r=await o(n),s=JSON.parse(r);if(Array.isArray(s)&&s.length>0){let o=e.exclude??[];e={...e,exclude:[...new Set([...o,...s])]};}}catch{}return e}async function sf(t){let e=_.join(t,"vibgrate.config.ts");return await ye.writeFile(e,`import type { VibgrateConfig } from '@vibgrate/cli';
5
+
6
+ const config: VibgrateConfig = {
7
+ // exclude: ['legacy/**'],
8
+ // maxFileSizeToScan: 5_242_880, // 5 MB (default)
9
+ // projectScanTimeout: 180, // 3 min per project (default, in seconds)
10
+ thresholds: {
11
+ failOnError: {
12
+ eolDays: 180,
13
+ frameworkMajorLag: 3,
14
+ dependencyTwoPlusPercent: 50,
15
+ },
16
+ warn: {
17
+ frameworkMajorLag: 2,
18
+ dependencyTwoPlusPercent: 30,
19
+ },
20
+ },
21
+ };
22
+
23
+ export default config;
24
+ `,"utf8"),e}async function ma(t,e){if(e.length===0)return false;let n=_.join(t,"vibgrate.config.json");if(await p(n))try{let i=await o(n),c=JSON.parse(i),l=Array.isArray(c.exclude)?c.exclude:[],u=[...new Set([...l,...e])];return c.exclude=u,await ye.writeFile(n,JSON.stringify(c,null,2)+`
25
+ `,"utf8"),!0}catch{}let r=_.join(t,".vibgrate"),s=_.join(r,"auto-excludes.json"),o$1=[];if(await p(s))try{let i=await o(s),c=JSON.parse(i);Array.isArray(c)&&(o$1=c);}catch{}let a=[...new Set([...o$1,...e])];try{return await ye.mkdir(r,{recursive:!0}),await ye.writeFile(s,JSON.stringify(a,null,2)+`
26
+ `,"utf8"),!0}catch{return false}}var ga=864e5,ya=365.25;function ba(t,e,n){if(!t||!e||!n)return null;let r=n[t],s=n[e];if(!r||!s)return null;let o=Date.parse(r),a=Date.parse(s);if(Number.isNaN(o)||Number.isNaN(a))return null;let i=(a-o)/ga;return i>0?i:0}function va(t){return t===null?null:t/ya}function wa(t){let e=0,n=0,r=0;for(let s of t)s==null||Number.isNaN(s)||(e+=s,s>n&&(n=s),r++);return r===0?null:{total:e,max:n,measured:r}}function Sa(t){if(!t||t.measured===0)return null;let e=t.total/t.measured,n=Math.min(e*20,100),r=Math.min(t.max*10,100),s=100-(n*.7+r*.3);return Math.max(0,Math.min(100,Math.round(s)))}var _r="driftscore-2.0",Fr={failOnError:{eolDays:180,frameworkMajorLag:3,dependencyTwoPlusPercent:50},warn:{frameworkMajorLag:2,dependencyTwoPlusPercent:30}};function ro(t,e,n){return Math.min(n,Math.max(e,t))}function ka(t){if(t.length===0)return null;let e=t.map(r=>r.runtimeMajorsBehind).filter(r=>r!==void 0);if(e.length===0)return null;let n=Math.max(...e);return n===0?100:n===1?80:n===2?50:n===3?20:0}function Ea(t){let e=t.flatMap(i=>i.frameworks);if(e.length===0)return null;let n=e.map(i=>i.majorsBehind).filter(i=>i!==null);if(n.length===0)return null;let r=Math.max(...n),s=n.reduce((i,c)=>i+c,0)/n.length,o=Math.min(r*20,100),a=Math.min(s*15,100);return ro(100-(o*.6+a*.4),0,100)}function ja(t){let e=0,n=0,r=0,s=0;for(let l of t)e+=l.dependencyAgeBuckets.current,n+=l.dependencyAgeBuckets.oneBehind,r+=l.dependencyAgeBuckets.twoPlusBehind,s+=l.dependencyAgeBuckets.unknown;let o=e+n+r;if(o===0)return null;let a=e/o,i=n/o,c=r/o;return ro(Math.round(a*100-i*10-c*40),0,100)}var Or=1e3*60*60*24*30;function xa(t){if(!t.some(s=>s.runtimeMajorsBehind!==void 0||s.runtimeEol!==void 0&&s.runtimeEol!==null))return null;let n=100,r=Date.now();for(let s of t){if(s.runtimeEol===true){n=Math.min(n,0);continue}if(s.runtimeEol===false){if(s.runtimeEolDate){let o=Date.parse(s.runtimeEolDate)-r;Number.isNaN(o)||(o<=6*Or?n=Math.min(n,40):o<=12*Or&&(n=Math.min(n,75)));}continue}s.type==="node"&&s.runtimeMajorsBehind!==void 0&&(s.runtimeMajorsBehind>=3?n=Math.min(n,0):s.runtimeMajorsBehind>=2?n=Math.min(n,30):s.runtimeMajorsBehind>=1&&(n=Math.min(n,70))),s.type==="dotnet"&&s.runtimeMajorsBehind!==void 0&&(s.runtimeMajorsBehind>=3?n=Math.min(n,0):s.runtimeMajorsBehind>=2?n=Math.min(n,20):s.runtimeMajorsBehind>=1&&(n=Math.min(n,60))),s.type==="python"&&s.runtimeMajorsBehind!==void 0&&(s.runtimeMajorsBehind>=6?n=Math.min(n,0):s.runtimeMajorsBehind>=4?n=Math.min(n,20):s.runtimeMajorsBehind>=2&&(n=Math.min(n,60))),s.type==="java"&&s.runtimeMajorsBehind!==void 0&&(s.runtimeMajorsBehind>=10?n=Math.min(n,0):s.runtimeMajorsBehind>=4?n=Math.min(n,30):s.runtimeMajorsBehind>=1&&(n=Math.min(n,70)));}return n}function Ta(t){let e=t.map(o=>o.libyears).filter(o=>!!o);if(e.length===0)return null;let n=e.reduce((o,a)=>o+a.total,0),r=e.reduce((o,a)=>o+a.measured,0),s=e.reduce((o,a)=>Math.max(o,a.max),0);return r===0?null:Sa({total:n,max:s,measured:r})}function Ca(t){let e=0,n=0;for(let s of t)e+=s.dependencyAgeBuckets.current+s.dependencyAgeBuckets.oneBehind+s.dependencyAgeBuckets.twoPlusBehind,n+=s.dependencyAgeBuckets.unknown;let r=e+n;return r===0?null:Math.round(e/r*100)/100}function ps(t){let e=ka(t),n=Ea(t),r=ja(t),s=xa(t),o=Ta(t),a=[{score:e,weight:.25},{score:n,weight:.25},{score:r,weight:.3},{score:s,weight:.2},{score:o,weight:.15}],i=Ca(t)??void 0,c=y=>100-y,l=()=>{let y={runtimeScore:c(Math.round(e??100)),frameworkScore:c(Math.round(n??100)),dependencyScore:c(Math.round(r??100)),eolScore:c(Math.round(s??100))};return o!==null&&(y.freshnessScore=c(Math.round(o))),y},u=a.filter(y=>y.score!==null);if(u.length===0)return {score:0,riskLevel:"low",components:l(),methodologyVersion:_r,...i!==void 0?{confidence:i}:{}};let p=u.reduce((y,j)=>y+j.weight,0),d=0;for(let y of u)d+=y.score*(y.weight/p);let f=c(Math.round(d)),g;f<=30?g="low":f<=60?g="moderate":g="high";let h=[];return e!==null&&h.push("runtime"),n!==null&&h.push("framework"),r!==null&&h.push("dependency"),s!==null&&h.push("eol"),o!==null&&h.push("freshness"),{score:f,riskLevel:g,components:l(),measured:h,methodologyVersion:_r,...i!==void 0?{confidence:i}:{}}}function Aa(t,e){let n={failOnError:{...Fr.failOnError,...e?.thresholds?.failOnError},warn:{...Fr.warn,...e?.thresholds?.warn}},r=[];for(let s of t){let o=s.type==="node"?"Node.js":s.type==="dotnet"?".NET":s.type==="python"?"Python":s.type==="java"?"Java":s.type;if(s.runtimeEol===true){let i=s.runtimeEolDate?` on ${s.runtimeEolDate}`:"";r.push({ruleId:"vibgrate/runtime-eol",level:"error",message:`${o} runtime "${s.runtime}" reached end-of-life${i} (latest: ${s.runtimeLatest}).`,location:s.path});}else s.runtimeMajorsBehind!==void 0&&s.runtimeMajorsBehind>=3?r.push({ruleId:"vibgrate/runtime-eol",level:"error",message:`${o} runtime "${s.runtime}" is ${s.runtimeMajorsBehind} major versions behind (latest: ${s.runtimeLatest}). Likely at or past EOL.`,location:s.path}):s.runtimeMajorsBehind!==void 0&&s.runtimeMajorsBehind>=2&&r.push({ruleId:"vibgrate/runtime-lag",level:"warning",message:`${o} runtime "${s.runtime}" is ${s.runtimeMajorsBehind} major versions behind (latest: ${s.runtimeLatest}).`,location:s.path});for(let i of s.frameworks)i.majorsBehind!==null&&n.failOnError.frameworkMajorLag!==void 0&&i.majorsBehind>=n.failOnError.frameworkMajorLag?r.push({ruleId:"vibgrate/framework-major-lag",level:"error",message:`${i.name} is ${i.majorsBehind} major versions behind (current: ${i.currentVersion}, latest: ${i.latestVersion}).`,location:s.path}):i.majorsBehind!==null&&n.warn.frameworkMajorLag!==void 0&&i.majorsBehind>=n.warn.frameworkMajorLag&&r.push({ruleId:"vibgrate/framework-major-lag",level:"warning",message:`${i.name} is ${i.majorsBehind} major versions behind (current: ${i.currentVersion}, latest: ${i.latestVersion}).`,location:s.path});let a=s.dependencyAgeBuckets.current+s.dependencyAgeBuckets.oneBehind+s.dependencyAgeBuckets.twoPlusBehind;if(a>0){let i=s.dependencyAgeBuckets.twoPlusBehind/a*100;n.failOnError.dependencyTwoPlusPercent!==void 0&&i>=n.failOnError.dependencyTwoPlusPercent?r.push({ruleId:"vibgrate/dependency-rot",level:"error",message:`${Math.round(i)}% of dependencies are 2+ major versions behind in ${s.name}.`,location:s.path}):n.warn.dependencyTwoPlusPercent!==void 0&&i>=n.warn.dependencyTwoPlusPercent&&r.push({ruleId:"vibgrate/dependency-rot",level:"warning",message:`${Math.round(i)}% of dependencies are 2+ major versions behind in ${s.name}.`,location:s.path});}for(let i of s.dependencies)i.majorsBehind!==null&&i.majorsBehind>=3&&r.push({ruleId:"vibgrate/dependency-major-lag",level:"error",message:`${i.package} is ${i.majorsBehind} major versions behind (spec: ${i.currentSpec}, latest: ${i.latestStable}).`,location:s.path});}return r}function Pa(t,e,n){let r=n?`${t}:${e}:${n}`:`${t}:${e}`;return Es.createHash("sha256").update(r).digest("hex").slice(0,16)}function Ma(t,e,n){let r=n?`${t}:${e}:${n}`:`${t}:${e}`;return Es.createHash("sha256").update(r).digest("hex").slice(0,16)}var $a=20,La=50,Br={red:"#E5484D",amber:"#F5A524",green:"#30A46C",unknown:"#6B7280"},rf="#24292F";function of(t){if(t==null||!Number.isFinite(t))return "unknown";let e=Math.round(t);return e<=$a?"green":e<=La?"amber":"red"}function af(t){if(t==null||!Number.isFinite(t))return "unknown";let e=Math.round(Math.min(100,Math.max(0,t)));return e===100?"100":String(e).padStart(2,"0")}function cf(t){return Br[t]??Br.unknown}function Na(t){let e=[];e.push(""),e.push(E.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),e.push(E.bold.cyan("\u2551 Vibgrate Drift Report \u2551")),e.push(E.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),e.push("");for(let i of t.projects){if(e.push(E.bold(` \u2500\u2500 ${i.name} `)+E.dim(`(${i.type}) ${i.path}`)),i.runtime){let u=i.runtimeMajorsBehind!==void 0&&i.runtimeMajorsBehind>0?E.yellow(` (${i.runtimeMajorsBehind} major${i.runtimeMajorsBehind>1?"s":""} behind)`):E.green(" (current)");e.push(` Runtime: ${i.runtime}${u}`);}if(i.targetFramework&&e.push(` Target: ${i.targetFramework}`),i.frameworks.length>0){e.push(" Frameworks:");for(let u of i.frameworks){let p=u.majorsBehind!==null?u.majorsBehind===0?E.green("current"):E.yellow(`${u.majorsBehind} behind`):E.dim("unknown");e.push(` ${u.name}: ${u.currentVersion??"?"} \u2192 ${u.latestVersion??"?"} (${p})`);}}let c=i.dependencyAgeBuckets;c.current+c.oneBehind+c.twoPlusBehind+c.unknown>0&&(e.push(" Dependencies:"),e.push(` ${E.green(`${c.current} current`)} ${E.yellow(`${c.oneBehind} 1-behind`)} ${E.red(`${c.twoPlusBehind} 2+ behind`)} ${E.dim(`${c.unknown} unknown`)}`)),e.push("");}if(t.delta!==void 0){let i=t.delta<0?E.green(`${t.delta}`):t.delta>0?E.red(`+${t.delta}`):E.dim("0");e.push(E.bold(" Drift Delta: ")+i+" (vs baseline)"),e.push("");}if(t.extended&&e.push(...Ia(t.extended)),t.findings.length>0){let i=t.findings.filter(p=>p.level==="error"),c=t.findings.filter(p=>p.level==="warning"),l=t.findings.filter(p=>p.level==="note"),u=[i.length>0?E.red(`${i.length} error${i.length!==1?"s":""}`):"",c.length>0?E.yellow(`${c.length} warning${c.length!==1?"s":""}`):"",l.length>0?E.blue(`${l.length} note${l.length!==1?"s":""}`):""].filter(Boolean).join(E.dim(", "));e.push(E.bold.underline(" Findings")+E.dim(` (${u})`));for(let p of t.findings){let d=p.level==="error"?E.red("\u2716"):p.level==="warning"?E.yellow("\u26A0"):E.blue("\u2139");e.push(` ${d} ${p.message}`),e.push(E.dim(` ${p.ruleId} in ${p.location}`));}e.push("");}let n=Fa(t);if(n.length>0){e.push(E.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),e.push(E.bold.cyan("\u2551 Top Priority Actions \u2551")),e.push(E.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),e.push("");for(let i=0;i<n.length;i++){let c=n[i],l=E.bold.cyan(` ${i+1}.`);e.push(`${l} ${E.bold(c.title)}`),e.push(E.dim(` ${c.explanation}`)),c.impact&&e.push(` Impact: ${E.green(c.impact)}`),e.push("");}}if(t.extended?.architecture&&e.push(..._a(t.extended.architecture)),t.solutions&&t.solutions.length>0){e.push(E.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),e.push(E.bold.cyan("\u2551 Solution Drift Summary \u2551")),e.push(E.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),e.push("");for(let i of t.solutions){let c=i.drift?.score,l=typeof c=="number"?c<=30?E.green:c<=60?E.yellow:E.red:E.dim;e.push(` \u2022 ${i.name} (${i.projectPaths.length} projects) \u2014 ${typeof c=="number"?l(`${c}/100`):E.dim("n/a")}`);}e.push("");}let r=t.drift.score<=30?E.green:t.drift.score<=60?E.yellow:E.red;e.push(E.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),e.push(E.bold.cyan("\u2551 Drift Score Summary \u2551")),e.push(E.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),e.push(""),e.push(E.bold(" Drift Score: ")+r.bold(`${t.drift.score}/100`)),e.push(E.bold(" Risk Level: ")+Ra(t.drift.riskLevel)),e.push(E.bold(" Projects: ")+`${t.projects.length}`);let s=t.billing;if(s&&(e.push(E.bold(" Classified: ")+`${E.cyan(s.nanoCount)} nano \xB7 ${E.cyan(s.microCount)} micro \xB7 ${E.cyan(s.smallCount)} small \xB7 ${E.cyan(s.standardCount)} standard`),e.push(E.bold(" Billable: ")+E.bold.white(`${s.billableProjects}`)+E.dim(` \xB7 ${s.totalScanned} detected \u2192 ${s.billableProjects} billable (micro-project pricing)`))),t.vcs){let i=[t.vcs.type];t.vcs.branch&&i.push(t.vcs.branch),t.vcs.shortSha&&i.push(E.dim(t.vcs.shortSha)),e.push(E.bold(" VCS: ")+i.join(" "));}e.push("");let o=new Set(t.drift.measured??["runtime","framework","dependency","eol"]);e.push(" "+E.bold.underline("Score Breakdown")),e.push(` Runtime: ${o.has("runtime")?tn(t.drift.components.runtimeScore):E.dim("n/a")}`),e.push(` Frameworks: ${o.has("framework")?tn(t.drift.components.frameworkScore):E.dim("n/a")}`),e.push(` Dependencies: ${o.has("dependency")?tn(t.drift.components.dependencyScore):E.dim("n/a")}`),e.push(` EOL Risk: ${o.has("eol")?tn(t.drift.components.eolScore):E.dim("n/a")}`),e.push("");let a=[`Scanned at ${t.timestamp}`];if(t.durationMs!==void 0){let i=(t.durationMs/1e3).toFixed(1);a.push(`${i}s`);}return t.filesScanned!==void 0&&a.push(`${t.filesScanned} file${t.filesScanned!==1?"s":""} scanned`),t.treeSummary&&(a.push(`${t.treeSummary.totalFiles.toLocaleString()} workspace files`),a.push(`${t.treeSummary.totalDirs.toLocaleString()} dirs`)),e.push(E.dim(` ${a.join(" \xB7 ")}`)),e.push(""),e.join(`
27
+ `)}function Ra(t){switch(t){case "low":return E.bgGreen.black(" LOW ");case "moderate":return E.bgYellow.black(" MODERATE ");case "high":return E.bgRed.white(" HIGH ");default:return t}}function tn(t){let n=Math.round(t/100*20),r=20-n;return (t<=30?E.green:t<=60?E.yellow:E.red)("\u2588".repeat(n))+E.dim("\u2591".repeat(r))+` ${Math.round(t)}`}var Dr={frontend:"Frontend",metaFrameworks:"Meta-frameworks",bundlers:"Bundlers",css:"CSS / UI",backend:"Backend",orm:"ORM / Database",testing:"Testing",lintFormat:"Lint & Format",apiMessaging:"API & Messaging",observability:"Observability",payment:"Payment",auth:"Auth",email:"Email",cloud:"Cloud",databases:"Databases",messaging:"Messaging",crm:"CRM & Comms",storage:"Storage",search:"Search & AI"};function Ia(t){let e=[];if(t.toolingInventory){let n=t.toolingInventory,r=Object.entries(n).filter(([,s])=>s.length>0);if(r.length>0){e.push(E.bold.underline(" Tech Stack"));for(let[s,o]of r){let a=Dr[s]??s,i=o.map(c=>E.white(c.name)).join(E.dim(", "));e.push(` ${E.cyan(a)}: ${i}`);}e.push("");}}if(t.serviceDependencies){let n=t.serviceDependencies,r=Object.entries(n).filter(([,s])=>s.length>0);if(r.length>0){e.push(E.bold.underline(" Services & Integrations"));for(let[s,o]of r){let a=Dr[s]??s,i=o.map(c=>{let l=c.version?E.dim(` ${c.version}`):"";return E.white(c.name)+l}).join(E.dim(", "));e.push(` ${E.cyan(a)}: ${i}`);}e.push("");}}if(t.breakingChangeExposure){let n=t.breakingChangeExposure;if(n.deprecatedPackages.length>0||n.legacyPolyfills.length>0){e.push(E.bold.underline(" Breaking Change Exposure"));let r=n.exposureScore>=40?E.red:n.exposureScore>=20?E.yellow:E.green;e.push(` Exposure Score: ${r.bold(`${n.exposureScore}/100`)}`),n.deprecatedPackages.length>0&&e.push(` ${E.red("Deprecated")}: ${n.deprecatedPackages.map(o=>E.dim(o)).join(", ")}`),n.legacyPolyfills.length>0&&e.push(` ${E.yellow("Polyfills")}: ${n.legacyPolyfills.map(o=>E.dim(o)).join(", ")}`),n.peerConflictsDetected&&e.push(` ${E.red("\u26A0")} Peer dependency conflicts detected`),e.push(` Recommendation: ${E.bold(n.overallRecommendation)}`);let s=n.projectIntelligence.filter(o=>o.packages.length>0).slice(0,3);if(s.length>0){e.push(" Major Upgrade Intelligence:");for(let o of s){e.push(` - ${o.project} (${o.recommendation})`);for(let a of o.packages.slice(0,2))e.push(` \xB7 ${a.package} ${a.currentVersion??"?"} \u2192 ${a.targetVersion??"?"} | touched ~${a.usage.touchedPercent}% | ${a.automatable}`);}}e.push("");}}if(t.tsModernity&&t.tsModernity.typescriptVersion){let n=t.tsModernity;e.push(E.bold.underline(" TypeScript"));let r=[];r.push(`v${n.typescriptVersion}`),n.strict===true?r.push(E.green("strict \u2714")):n.strict===false&&r.push(E.yellow("strict \u2716")),n.moduleType&&r.push(n.moduleType.toUpperCase()),n.target&&r.push(`target: ${n.target}`),e.push(` ${r.join(E.dim(" \xB7 "))}`),e.push("");}if(t.buildDeploy){let n=t.buildDeploy;(n.ci.length>0||n.docker.dockerfileCount>0||n.packageManagers.length>0)&&(e.push(E.bold.underline(" Build & Deploy")),n.ci.length>0&&e.push(` CI: ${n.ci.join(", ")}`),n.docker.dockerfileCount>0&&e.push(` Docker: ${n.docker.dockerfileCount} Dockerfile${n.docker.dockerfileCount!==1?"s":""} (${n.docker.baseImages.join(", ")})`),n.packageManagers.length>0&&e.push(` Package Managers: ${n.packageManagers.join(", ")}`),n.monorepoTools.length>0&&e.push(` Monorepo: ${n.monorepoTools.join(", ")}`),n.iac.length>0&&e.push(` IaC: ${n.iac.join(", ")}`),e.push(""));}if(t.uiPurpose){let n=t.uiPurpose;e.push(E.bold.underline(" Product Purpose Signals")),e.push(` Frameworks: ${n.detectedFrameworks.length>0?n.detectedFrameworks.join(", "):E.dim("unknown")}`),e.push(` Evidence: ${n.topEvidence.length}${n.capped?E.dim(` of ${n.evidenceCount} (capped)`):""}`);let r=n.topEvidence.slice(0,8);if(r.length>0){e.push(" Top Signals:");for(let s of r)e.push(` - [${s.kind}] ${s.value} ${E.dim(`(${s.file})`)}`);}if(n.unknownSignals.length>0){e.push(" Unknowns:");for(let s of n.unknownSignals.slice(0,4))e.push(` - ${E.yellow(s)}`);}e.push("");}if(t.securityPosture){let n=t.securityPosture;e.push(E.bold.underline(" Security Posture"));let r=[];r.push(n.lockfilePresent?E.green("Lockfile \u2714"):E.red("Lockfile \u2716")),r.push(n.gitignoreCoversEnv?E.green(".env \u2714"):E.red(".env \u2716")),r.push(n.gitignoreCoversNodeModules?E.green("node_modules \u2714"):E.yellow("node_modules \u2716")),n.multipleLockfileTypes&&r.push(E.yellow("Multiple lockfiles \u26A0")),n.envFilesTracked&&r.push(E.red("Env files tracked \u2716")),e.push(` ${r.join(E.dim(" \xB7 "))}`),e.push("");}if(t.platformMatrix){let n=t.platformMatrix;(n.nativeModules.length>0||n.dockerBaseImages.length>0)&&(e.push(E.bold.underline(" Platform")),n.nativeModules.length>0&&e.push(` Native modules: ${n.nativeModules.map(r=>E.dim(r)).join(", ")}`),n.osAssumptions.length>0&&e.push(` OS assumptions: ${n.osAssumptions.join(", ")}`),e.push(""));}if(t.codeQuality){let n=t.codeQuality;if(e.push(E.bold.underline(" Code Quality")),e.push(` Files: ${E.white(`${n.filesAnalyzed}`)} \xB7 Functions: ${E.white(`${n.functionsAnalyzed}`)} \xB7 Avg complexity: ${E.white(`${n.avgCyclomaticComplexity}`)} \xB7 Avg length: ${E.white(`${n.avgFunctionLength}`)} lines`),e.push(` Max nesting: ${n.maxNestingDepth} \xB7 Circular deps: ${n.circularDependencies} \xB7 Dead code: ${n.deadCodePercent}%`),n.godFiles.length>0){let r=n.godFiles.slice(0,3).map(s=>`${s.path} (${s.lines} lines)`).join(", ");e.push(` ${E.yellow("God files")}: ${r}`);}e.push("");}if(t.dependencyGraph){let n=t.dependencyGraph;n.lockfileType&&(e.push(E.bold.underline(" Dependency Graph")),e.push(` ${n.lockfileType}: ${E.white(`${n.totalUnique}`)} unique, ${E.white(`${n.totalInstalled}`)} installed`),n.duplicatedPackages.length>0&&e.push(` ${E.yellow(`${n.duplicatedPackages.length} duplicated`)} packages`),n.phantomDependencies.length>0&&e.push(` ${E.red(`${n.phantomDependencies.length} phantom`)} dependencies`),e.push(""));}return e}function _a(t){let e=[];if(e.push(E.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),e.push(E.bold.cyan("\u2551 Architecture Layers \u2551")),e.push(E.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),e.push(""),e.push(E.bold(" Archetype: ")+`${t.archetype}`+E.dim(` (${Math.round(t.archetypeConfidence*100)}% confidence)`)),e.push(` Files classified: ${t.totalClassified}`+(t.unclassified>0?E.dim(` (${t.unclassified} unclassified)`):"")),e.push(""),t.layers.length>0){for(let n of t.layers){let r=n.riskLevel==="none"?E.dim("none"):n.riskLevel==="low"?E.green("low"):n.riskLevel==="moderate"?E.yellow("moderate"):E.red("high");e.push(` ${E.bold(n.layer)} ${n.fileCount} file${n.fileCount!==1?"s":""} drift ${tn(n.driftScore)} risk ${r}`);}e.push("");}return e}function Fa(t){let e=[],n=t.projects.filter(a=>a.runtimeMajorsBehind!==void 0&&a.runtimeMajorsBehind>=3);if(n.length>0){let a=n.map(l=>l.name).join(", "),i="End-of-life runtimes no longer receive security patches and block ecosystem upgrades.",c=[];for(let l of n)c.push(`
28
+ ./${l.path}`),c.push(`
29
+ ${l.runtime} \u2192 ${l.runtimeLatest} (${l.runtimeMajorsBehind} major${l.runtimeMajorsBehind>1?"s":""} behind)`);i+=c.join(""),e.push({title:`Upgrade EOL runtime${n.length>1?"s":""} in ${a}`,explanation:i,impact:`\u2212${Math.min(n.length*10,30)} drift points (runtime & EOL)`,severity:100});}let r=[];for(let a of t.projects)for(let i of a.frameworks)i.majorsBehind!==null&&i.majorsBehind>=3&&r.push({name:i.name,fw:`${i.currentVersion} \u2192 ${i.latestVersion}`,behind:i.majorsBehind,project:a.name,projectPath:a.path});if(r.length>0){let a=r.sort((d,f)=>f.behind-d.behind)[0],i=r.length>1?` (+${r.length-1} more)`:"",c=`${a.behind} major versions behind. Major framework drift increases breaking change risk and blocks access to security fixes and performance improvements.`,l=[],u=0;for(let d of r){if(u>=8)break;l.push(`
30
+ ./${d.projectPath}`),l.push(`
31
+ ${d.name}: ${d.fw} (${d.behind} major${d.behind>1?"s":""} behind)`),u++;}let p=r.length-u;c+=l.join(""),p>0&&(c+=`
32
+ ... and ${p} more`),e.push({title:`Upgrade ${a.name} ${a.fw} in ${a.project}${i}`,explanation:c,impact:"\u22125\u201315 drift points",severity:90});}for(let a of t.projects){let i=a.dependencyAgeBuckets,c=i.current+i.oneBehind+i.twoPlusBehind;if(c===0)continue;let l=Math.round(i.twoPlusBehind/c*100);if(l>=40){let u=`${i.twoPlusBehind} of ${c} dependencies are 2+ majors behind. Run \`npm outdated\` and prioritise packages with known CVEs or breaking API changes.`,p=a.dependencies.filter(d=>d.majorsBehind!==null&&d.majorsBehind>=2).sort((d,f)=>(f.majorsBehind??0)-(d.majorsBehind??0));if(p.length>0){let d=[],f=0;d.push(`
33
+ ./${a.path}`);for(let h of p){if(f>=8)break;let y=h.resolvedVersion??h.currentSpec,j=h.latestStable??"?";d.push(`
34
+ ${h.package}: ${y} \u2192 ${j} (${h.majorsBehind} major${h.majorsBehind>1?"s":""} behind)`),f++;}let g=p.length-f;u+=d.join(""),g>0&&(u+=`
35
+ ... and ${g} more`);}e.push({title:`Reduce dependency rot in ${a.name} (${l}% severely outdated)`,explanation:u,impact:"\u22125\u201310 drift points",severity:80+l/10});}}let s=[];for(let a of t.projects)for(let i of a.frameworks)i.majorsBehind===2&&s.push({name:i.name,project:a.name,projectPath:a.path,fw:`${i.currentVersion} \u2192 ${i.latestVersion}`});let o=[...new Map(s.map(a=>[a.name,a])).values()];if(o.length>0){let a=o.slice(0,3).map(d=>`${d.name} (${d.fw})`).join(", "),i=o.length>3?` +${o.length-3} more`:"",c="These frameworks are 2 major versions behind. Create upgrade tickets and check migration guides \u2014 the gap will widen with each new release.",l=[],u=0;for(let d of s){if(u>=8)break;l.push(`
36
+ ./${d.projectPath}`),l.push(`
37
+ ${d.name}: ${d.fw}`),u++;}let p=s.length-u;c+=l.join(""),p>0&&(c+=`
38
+ ... and ${p} more`),e.push({title:`Plan major framework upgrades: ${a}${i}`,explanation:c,impact:"\u22125\u201310 drift points",severity:60});}if(t.extended?.breakingChangeExposure){let a=t.extended.breakingChangeExposure,i=a.deprecatedPackages.length+a.legacyPolyfills.length;if(i>0){let c=[...a.deprecatedPackages,...a.legacyPolyfills].slice(0,5).join(", "),l=i>5?` +${i-5} more`:"",u=`${i} package${i!==1?"s":""} are deprecated or legacy polyfills. These receive no updates and may have known vulnerabilities.`,p=new Set([...a.deprecatedPackages,...a.legacyPolyfills]),d=[],f=0;for(let h of t.projects){let y=h.dependencies.filter(j=>p.has(j.package));if(y.length!==0){if(f>=10)break;d.push(`
39
+ ./${h.path}`);for(let j of y){if(f>=10)break;let C=j.resolvedVersion??j.currentSpec,A=a.deprecatedPackages.includes(j.package)?"deprecated":"polyfill";d.push(`
40
+ ${j.package}: ${C} (${A})`),f++;}}}let g=i-f;u+=d.join(""),g>0&&(u+=`
41
+ ... and ${g} more`),e.push({title:`Replace deprecated/legacy packages: ${c}${l}`,explanation:u,severity:55});}}if(t.extended?.dependencyGraph){let a=t.extended.dependencyGraph,i=a.phantomDependencies.length;if(i>=10){let c="Packages used in code but not declared in package.json. These rely on transitive installs and can break unpredictably when other packages update.",l=a.phantomDependencyDetails;if(l&&l.length>0){let u=new Map;for(let g of l)u.has(g.sourcePath)||u.set(g.sourcePath,[]),u.get(g.sourcePath).push({package:g.package,spec:g.spec});let p=[],d=0;for(let[g,h]of u){if(d>=10)break;p.push(`
42
+ ./${g}`);for(let y of h){if(d>=10)break;p.push(`
43
+ ${y.package}: ${y.spec}`),d++;}}let f=i-d;c+=p.join(""),f>0&&(c+=`
44
+ ... and ${f} more`);}e.push({title:`Fix ${i} phantom dependencies`,explanation:c,severity:45});}}if(t.extended?.securityPosture){let a=t.extended.securityPosture;if(a.envFilesTracked||!a.lockfilePresent){let i=[];a.envFilesTracked&&i.push(".env files are tracked in git"),a.lockfilePresent||i.push("no lockfile found");let c;a.envFilesTracked?(c="Environment files may contain secrets. Add them to .gitignore and rotate any exposed credentials immediately.",c+=`
45
+ ./.gitignore`,c+=`
46
+ Add: .env, .env.*, .env.local`):(c="Without a lockfile, installs are non-deterministic. Run the install command to generate one and commit it.",c+=`
47
+ ./`,c+=`
48
+ Missing: ${a.lockfileTypes.length>0?a.lockfileTypes.join(", ")+" (multiple types detected)":"package-lock.json, pnpm-lock.yaml, or yarn.lock"}`),e.push({title:`Fix security posture: ${i.join(", ")}`,explanation:c,severity:95});}}if(t.extended?.dependencyGraph){let i=t.extended.dependencyGraph.duplicatedPackages.filter(c=>c.versions.length>=3);if(i.length>=3){i.slice(0,4).map(f=>`${f.name} (${f.versions.length}v)`).join(", ");let l=`${i.length} packages have 3+ versions installed. Run \`npm dedupe\` to reduce bundle size and install time.`,u=[],p=0;for(let f of i){if(p>=8)break;u.push(`
49
+ ${f.name}: ${f.versions.join(", ")} (${f.consumers} consumer${f.consumers!==1?"s":""})`),p++;}let d=i.length-p;l+=u.join(""),d>0&&(l+=`
50
+ ... and ${d} more`),e.push({title:"Deduplicate heavily-versioned packages",explanation:l,severity:35});}}return e.sort((a,i)=>i.severity-a.severity),e.slice(0,5)}function Oa(t){let e=Ba(t.findings),n=t.findings.map(r=>Da(r));return {$schema:"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/main/sarif-2.1/schema/sarif-schema-2.1.0.json",version:"2.1.0",runs:[{tool:{driver:{name:"vibgrate",version:t.vibgrateVersion,informationUri:"https://vibgrate.com",rules:e}},results:n,invocations:[{executionSuccessful:true,startTimeUtc:t.timestamp}]}]}}function Ba(t){return [...new Set(t.map(n=>n.ruleId))].map(n=>({"vibgrate/runtime-eol":{id:"vibgrate/runtime-eol",shortDescription:{text:"Runtime at or past end-of-life"},helpUri:"https://vibgrate.com/rules/runtime-eol"},"vibgrate/runtime-lag":{id:"vibgrate/runtime-lag",shortDescription:{text:"Runtime major version lag"},helpUri:"https://vibgrate.com/rules/runtime-lag"},"vibgrate/framework-major-lag":{id:"vibgrate/framework-major-lag",shortDescription:{text:"Framework major version behind latest"},helpUri:"https://vibgrate.com/rules/framework-major-lag"},"vibgrate/dependency-rot":{id:"vibgrate/dependency-rot",shortDescription:{text:"High percentage of outdated dependencies"},helpUri:"https://vibgrate.com/rules/dependency-rot"},"vibgrate/dependency-major-lag":{id:"vibgrate/dependency-major-lag",shortDescription:{text:"Individual dependency severely behind"},helpUri:"https://vibgrate.com/rules/dependency-major-lag"}})[n]??{id:n,shortDescription:{text:n},helpUri:"https://vibgrate.com"})}function Da(t){return {ruleId:t.ruleId,level:t.level==="error"?"error":t.level==="warning"?"warning":"note",message:{text:t.message},locations:[{physicalLocation:{artifactLocation:{uri:t.location}}}]}}function Va(t){let e=[],n=t.billing;e.push("# Vibgrate Drift Report"),e.push(""),e.push("| Metric | Value |"),e.push("|--------|-------|"),e.push(`| **Drift Score** | ${t.drift.score}/100 |`),e.push(`| **Risk Level** | ${t.drift.riskLevel.toUpperCase()} |`),e.push(`| **Projects** | ${t.projects.length} |`),n&&(e.push(`| **Classification** | ${n.nanoCount} nano \xB7 ${n.microCount} micro \xB7 ${n.smallCount} small \xB7 ${n.standardCount} standard |`),e.push(`| **Billable Projects** | ${n.billableProjects} (${n.totalScanned} detected \u2192 ${n.billableProjects} billable) |`));let r=[t.timestamp];t.durationMs!==void 0&&r.push(`${(t.durationMs/1e3).toFixed(1)}s`),t.filesScanned!==void 0&&r.push(`${t.filesScanned} files`),t.treeSummary&&r.push(`${t.treeSummary.totalFiles.toLocaleString()} workspace files \xB7 ${t.treeSummary.totalDirs.toLocaleString()} dirs`),e.push(`| **Scanned** | ${r.join(" \xB7 ")} |`),t.vcs&&(e.push(`| **VCS** | ${t.vcs.type} |`),t.vcs.branch&&e.push(`| **Branch** | ${t.vcs.branch} |`),t.vcs.sha&&e.push(`| **Commit** | \`${t.vcs.shortSha}\` |`)),e.push(""),e.push("## Score Breakdown"),e.push(""),e.push("| Component | Score |"),e.push("|-----------|-------|"),e.push(`| Runtime | ${t.drift.components.runtimeScore} |`),e.push(`| Frameworks | ${t.drift.components.frameworkScore} |`),e.push(`| Dependencies | ${t.drift.components.dependencyScore} |`),e.push(`| EOL Risk | ${t.drift.components.eolScore} |`),e.push(""),e.push("## Projects"),e.push("");for(let s of t.projects){if(e.push(`### ${s.name} (${s.type})`),e.push(""),s.runtime){let i=s.runtimeMajorsBehind!==void 0&&s.runtimeMajorsBehind>0?` \u2014 ${s.runtimeMajorsBehind} major(s) behind`:" \u2014 current";e.push(`- **Runtime:** ${s.runtime}${i}`);}if(s.frameworks.length>0){e.push("- **Frameworks:**");for(let i of s.frameworks){let c=i.majorsBehind!==null?i.majorsBehind===0?"current":`${i.majorsBehind} behind`:"unknown";e.push(` - ${i.name}: ${i.currentVersion??"?"} \u2192 ${i.latestVersion??"?"} (${c})`);}}let o=s.dependencyAgeBuckets;o.current+o.oneBehind+o.twoPlusBehind+o.unknown>0&&e.push(`- **Dependencies:** ${o.current} current, ${o.oneBehind} 1-behind, ${o.twoPlusBehind} 2+ behind, ${o.unknown} unknown`),e.push("");}if(t.extended?.uiPurpose){let s=t.extended.uiPurpose;if(e.push("## Product Purpose Signals"),e.push(""),e.push(`- **Frameworks:** ${s.detectedFrameworks.length>0?s.detectedFrameworks.join(", "):"unknown"}`),e.push(`- **Evidence Items:** ${s.topEvidence.length}${s.capped?` (capped from ${s.evidenceCount})`:""}`),s.topEvidence.length>0){e.push("- **Top Evidence:**");for(let o of s.topEvidence.slice(0,10))e.push(` - [${o.kind}] ${o.value} (${o.file})`);}if(s.unknownSignals.length>0){e.push("- **Unknowns:**");for(let o of s.unknownSignals.slice(0,5))e.push(` - ${o}`);}e.push("");}if(t.extended?.standards&&t.extended.standards.recommended.length>0){let s=t.extended.standards;e.push("## Recommended Standards"),e.push("");let o=s.projectPurposes.map(a=>`${a.project} \u2192 ${a.category}`).join(", ");if(o&&e.push(`- **Detected purpose:** ${o}`),s.frameworks.length>0){e.push("- **Compliance framework coverage:**");for(let a of s.frameworks)e.push(` - ${a.name}: ${a.recommendedMembers}/${a.totalMembers} member standards apply`);}e.push("- **Top standards to consider:**");for(let a of s.recommended.slice(0,10)){let i=a.complianceRelevant?" _(compliance)_":"";e.push(` - **${a.name}** \u2014 ${a.reason}${i}`);}e.push("");}if(t.findings.length>0){e.push("## Findings"),e.push(""),e.push("| Level | Rule | Message | Location |"),e.push("|-------|------|---------|----------|");for(let s of t.findings){let o=s.level==="error"?"\u{1F534}":s.level==="warning"?"\u{1F7E1}":"\u{1F535}";e.push(`| ${o} ${s.level} | ${s.ruleId} | ${s.message} | ${s.location} |`);}e.push("");}if(t.delta!==void 0){let s=t.delta>0?"\u{1F4C8}":t.delta<0?"\u{1F4C9}":"\u27A1\uFE0F";e.push(`## Drift Delta: ${s} ${t.delta>0?"+":""}${t.delta} vs baseline`),e.push("");}return e.join(`
51
+ `)}async function Se(t,e){let n,r=new Promise(s=>{n=setTimeout(()=>s({ok:false}),e);});try{return await Promise.race([t.then(o=>({ok:!0,value:o})),r])}finally{clearTimeout(n);}}function Wa(t,e){return new Promise((n,r)=>{let s=spawn(t,e,{stdio:["ignore","pipe","pipe"]}),o="",a="";s.stdout.on("data",i=>o+=String(i)),s.stderr.on("data",i=>a+=String(i)),s.on("error",r),s.on("close",i=>{if(i!==0){r(new Error(`${t} ${e.join(" ")} failed (code=${i}): ${a.trim()}`));return}n(o);});})}async function ao(t,e){try{return JSON.parse(t)}catch{throw new Error(`Invalid JSON in package version manifest: ${e}`)}}async function za(t){let e=await mkdtemp(_.join(on.tmpdir(),"vibgrate-manifest-"));try{await Wa("unzip",["-qq",t,"-d",e]);let n=[_.join(e,"package-versions.json"),_.join(e,"manifest.json"),_.join(e,"index.json")];for(let r of n)try{let s=await readFile(r,"utf8");return await ao(s,r)}catch{}throw new Error("Zip must contain package-versions.json, manifest.json, or index.json")}finally{await rm(e,{recursive:true,force:true});}}async function Ja(t){let e=_.resolve(t);if(e.toLowerCase().endsWith(".zip"))return za(e);let n=await readFile(e,"utf8");return ao(n,e)}function H(t,e,n){if(!t)return;let r=t[e];if(r)return e==="nuget"?r[n.toLowerCase()]??r[n]:r[n]}function sn(t){return t.filter(e=>et.valid(e)&&et.prerelease(e)===null)}function Fn(t){let e=sn(t);return e.length===0?null:e.sort(et.rcompare)[0]??null}function Ka(t){if(!t||typeof t!="object")return;let e={};for(let[n,r]of Object.entries(t))n==="created"||n==="modified"||typeof r=="string"&&(e[n]=r);return Object.keys(e).length>0?e:void 0}function Ln(t){let e=null,n=[],r=null,s;if(t&&typeof t=="object"){let i=t,c=i["dist-tags.latest"];typeof c=="string"&&(e=c);let l=i["dist-tags"];!e&&l&&typeof l=="object"&&typeof l.latest=="string"&&(e=l.latest);let u=i.versions;Array.isArray(u)?n=u.map(String):typeof u=="string"&&(n=[u]),r=co(i.license??i.licenses),s=Ka(i.time);}let o=sn(n),a=Fn(o);return !e&&a&&(e=a),{latest:e,stableVersions:o,latestStableOverall:a,license:r,...s?{releaseDates:s}:{}}}function co(t){if(!t)return null;if(typeof t=="string")return t.trim()||null;if(Array.isArray(t)){let e=t.map(co).filter(n=>!!n);return e.length===0?null:e.length===1?e[0]:`(${e.join(" OR ")})`}if(typeof t=="object"){let e=t;if(typeof e.type=="string")return e.type.trim()||null;if(typeof e.spdx=="string")return e.spdx.trim()||null}return null}var Qa=24,Ya=7e3,Xa=3e4,Za=process.platform==="win32"?"npm.cmd":"npm";function ec(t,e=process.platform){let n=e==="win32"?Ya:Xa,r=[],s=[],o=0;for(let a of t){let i=a.length+1;(s.length>=Qa||s.length>0&&o+i>n)&&(r.push(s),s=[],o=0),s.push(a),o+=i;}return s.length>0&&r.push(s),r}async function nn(t,e){return new Promise((n,r)=>{let s=spawn(Za,["view",...t,"--json"],{cwd:e,stdio:["ignore","pipe","pipe"]}),o="",a="";s.stdout.on("data",i=>o+=String(i)),s.stderr.on("data",i=>a+=String(i)),s.on("error",r),s.on("close",i=>{if(i!==0){r(new Error(`npm view ${t.join(" ")} failed (code=${i}): ${a.trim()}`));return}let c=o.trim();if(!c){n(null);return}try{n(JSON.parse(c));}catch{n(c.replace(/^"|"$/g,""));}});})}var tc=class{constructor(t,e,n,r=false){this.cwd=t,this.sem=e,this.manifest=n,this.offline=r;}meta=new Map;async prefetch(t){let n=[...new Set(t.filter(Boolean))].filter(s=>!this.meta.has(s));if(n.length===0)return;let r=this.sem.run(()=>this.fetchBatch(n));for(let s of n){let o=r.then(a=>a.get(s)??{latest:null,stableVersions:[],latestStableOverall:null,license:null});this.meta.set(s,o);}await r;}get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(()=>this.fetchOne(t));return this.meta.set(t,n),n}async fetchBatch(t){let e=new Map,n=[];for(let r of t){let s=H(this.manifest,"npm",r);if(s){let o=sn(s.versions??[]),a=Fn(o);e.set(r,{latest:s.latest??a,stableVersions:o,latestStableOverall:a,license:s.license??null,...s.releaseDates?{releaseDates:s.releaseDates}:{}});}else this.offline?e.set(r,{latest:null,stableVersions:[],latestStableOverall:null,license:null}):n.push(r);}if(n.length===0)return e;for(let r of ec(n)){let s=await this.fetchRemoteChunk(r);for(let[o,a]of s)e.set(o,a);}return e}async fetchRemoteChunk(t){let e=new Map;if(t.length===1)return e.set(t[0],await this.fetchOneRemote(t[0])),e;try{let n=await nn([...t,"dist-tags.latest","versions","license","licenses","time"],this.cwd);if(Array.isArray(n))for(let r=0;r<n.length&&r<t.length;r++)e.set(t[r],Ln(n[r]));else if(n&&typeof n=="object"){let r=n,s=0;for(let o of t)o in r&&(e.set(o,Ln(r[o])),s++);s===0&&t.length===1&&e.set(t[0],Ln(r));}}catch{}for(let n of t)e.has(n)||e.set(n,await this.fetchOneRemote(n));return e}async fetchOne(t){let e=H(this.manifest,"npm",t);if(e){let n=sn(e.versions??[]),r=Fn(n);return {latest:e.latest??r,stableVersions:n,latestStableOverall:r,license:e.license??null,...e.releaseDates?{releaseDates:e.releaseDates}:{}}}return this.offline?{latest:null,stableVersions:[],latestStableOverall:null,license:null}:this.fetchOneRemote(t)}async fetchOneRemote(t){try{let e=await nn([t,"dist-tags.latest","versions","license","licenses","time"],this.cwd);return Ln(e)}catch{let e=null,n=[];try{let o=await nn([t,"dist-tags"],this.cwd);o&&typeof o=="object"&&typeof o.latest=="string"&&(e=o.latest);}catch{}try{let o=await nn([t,"versions"],this.cwd);Array.isArray(o)?n=o.map(String):typeof o=="string"&&(n=[o]);}catch{}let r=sn(n),s=Fn(r);return !e&&s&&(e=s),{latest:e,stableVersions:r,latestStableOverall:s,license:null}}}};async function nc(t){try{let e=new AbortController,n=setTimeout(()=>e.abort(),5e3),r=await fetch("https://registry.npmjs.org/npm/latest",{method:"HEAD",signal:e.signal});return clearTimeout(n),r.ok}catch{try{let e=await nn(["npm","dist-tags.latest"],t);return typeof e=="string"&&e.length>0}catch{return false}}}function lo(t){let e=t.trim();return !e||e.startsWith("workspace:")||e.startsWith("file:")||e.startsWith("link:")||e.startsWith("git+")||e.includes("://")||e.startsWith("github:")?false:e==="*"||e.toLowerCase()==="latest"?true:et.validRange(e)!==null}function uo(t){switch(t){case "public-domain":case "permissive":return "low";case "weak-copyleft":return "medium";case "copyleft":case "network-copyleft":case "proprietary":return "high";default:return "medium"}}var po={attribution:false,copyleft:false,networkCopyleft:false,discloseSource:false,patentGrant:false,commercialRestriction:false};function sc(t){return {spdxId:t.id,name:t.name,family:t.family,category:t.category,osiApproved:t.osi??false,fsfLibre:t.fsf??false,deprecated:t.deprecated??false,referenceUrl:t.url??`https://spdx.org/licenses/${t.id}.html`,riskLevel:uo(t.category),obligations:{...po,...t.obligations??{}}}}var q={attribution:true},rc={attribution:true,patentGrant:true},ie={attribution:true,copyleft:true,discloseSource:true},Ye={attribution:true,copyleft:true,discloseSource:true},Nn={attribution:true,copyleft:true,networkCopyleft:true,discloseSource:true},oc=[{id:"CC0-1.0",name:"Creative Commons Zero v1.0 Universal",family:"CC",category:"public-domain",fsf:true},{id:"Unlicense",name:"The Unlicense",family:"Public Domain",category:"public-domain",osi:true,fsf:true},{id:"0BSD",name:"BSD Zero Clause License",family:"BSD",category:"permissive",osi:true},{id:"WTFPL",name:"Do What The F*ck You Want To Public License",family:"WTFPL",category:"permissive",fsf:true},{id:"MIT",name:"MIT License",family:"MIT",category:"permissive",osi:true,fsf:true,obligations:q},{id:"MIT-0",name:"MIT No Attribution",family:"MIT",category:"permissive",osi:true},{id:"ISC",name:"ISC License",family:"ISC",category:"permissive",osi:true,fsf:true,obligations:q},{id:"BSD-2-Clause",name:'BSD 2-Clause "Simplified" License',family:"BSD",category:"permissive",osi:true,fsf:true,obligations:q},{id:"BSD-3-Clause",name:'BSD 3-Clause "New" or "Revised" License',family:"BSD",category:"permissive",osi:true,fsf:true,obligations:q},{id:"BSD-3-Clause-Clear",name:"BSD 3-Clause Clear License",family:"BSD",category:"permissive",osi:true,obligations:q},{id:"Apache-2.0",name:"Apache License 2.0",family:"Apache",category:"permissive",osi:true,fsf:true,obligations:rc},{id:"Apache-1.1",name:"Apache Software License 1.1",family:"Apache",category:"permissive",osi:true,obligations:q},{id:"Zlib",name:"zlib License",family:"Zlib",category:"permissive",osi:true,fsf:true},{id:"BSL-1.0",name:"Boost Software License 1.0",family:"Boost",category:"permissive",osi:true,fsf:true,obligations:q},{id:"PostgreSQL",name:"PostgreSQL License",family:"BSD",category:"permissive",osi:true,obligations:q},{id:"Python-2.0",name:"Python License 2.0",family:"Python",category:"permissive",osi:true,obligations:q},{id:"PSF-2.0",name:"Python Software Foundation License 2.0",family:"Python",category:"permissive",obligations:q},{id:"Artistic-2.0",name:"Artistic License 2.0",family:"Artistic",category:"permissive",osi:true,fsf:true,obligations:q},{id:"NCSA",name:"University of Illinois/NCSA Open Source License",family:"NCSA",category:"permissive",osi:true,fsf:true,obligations:q},{id:"Unicode-DFS-2016",name:"Unicode License Agreement - Data Files and Software (2016)",family:"Unicode",category:"permissive",osi:true,obligations:q},{id:"BlueOak-1.0.0",name:"Blue Oak Model License 1.0.0",family:"BlueOak",category:"permissive",obligations:q},{id:"LGPL-2.0-only",name:"GNU Library General Public License v2 only",family:"LGPL",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"LGPL-2.1-only",name:"GNU Lesser General Public License v2.1 only",family:"LGPL",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"LGPL-2.1-or-later",name:"GNU Lesser General Public License v2.1 or later",family:"LGPL",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"LGPL-3.0-only",name:"GNU Lesser General Public License v3.0 only",family:"LGPL",category:"weak-copyleft",osi:true,fsf:true,obligations:{...ie,patentGrant:true}},{id:"LGPL-3.0-or-later",name:"GNU Lesser General Public License v3.0 or later",family:"LGPL",category:"weak-copyleft",osi:true,fsf:true,obligations:{...ie,patentGrant:true}},{id:"MPL-2.0",name:"Mozilla Public License 2.0",family:"MPL",category:"weak-copyleft",osi:true,fsf:true,obligations:{...ie,patentGrant:true}},{id:"MPL-1.1",name:"Mozilla Public License 1.1",family:"MPL",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"EPL-1.0",name:"Eclipse Public License 1.0",family:"EPL",category:"weak-copyleft",osi:true,fsf:true,obligations:{...ie,patentGrant:true}},{id:"EPL-2.0",name:"Eclipse Public License 2.0",family:"EPL",category:"weak-copyleft",osi:true,fsf:true,obligations:{...ie,patentGrant:true}},{id:"CDDL-1.0",name:"Common Development and Distribution License 1.0",family:"CDDL",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"CDDL-1.1",name:"Common Development and Distribution License 1.1",family:"CDDL",category:"weak-copyleft",obligations:ie},{id:"CPL-1.0",name:"Common Public License 1.0",family:"CPL",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"MS-PL",name:"Microsoft Public License",family:"Microsoft",category:"weak-copyleft",osi:true,fsf:true,obligations:q},{id:"MS-RL",name:"Microsoft Reciprocal License",family:"Microsoft",category:"weak-copyleft",osi:true,fsf:true,obligations:ie},{id:"GPL-2.0-only",name:"GNU General Public License v2.0 only",family:"GPL",category:"copyleft",osi:true,fsf:true,obligations:Ye},{id:"GPL-2.0-or-later",name:"GNU General Public License v2.0 or later",family:"GPL",category:"copyleft",osi:true,fsf:true,obligations:Ye},{id:"GPL-3.0-only",name:"GNU General Public License v3.0 only",family:"GPL",category:"copyleft",osi:true,fsf:true,obligations:{...Ye,patentGrant:true}},{id:"GPL-3.0-or-later",name:"GNU General Public License v3.0 or later",family:"GPL",category:"copyleft",osi:true,fsf:true,obligations:{...Ye,patentGrant:true}},{id:"EUPL-1.1",name:"European Union Public License 1.1",family:"EUPL",category:"copyleft",osi:true,fsf:true,obligations:Ye},{id:"EUPL-1.2",name:"European Union Public License 1.2",family:"EUPL",category:"copyleft",osi:true,fsf:true,obligations:Ye},{id:"OSL-3.0",name:"Open Software License 3.0",family:"OSL",category:"copyleft",osi:true,fsf:true,obligations:{...Ye,patentGrant:true}},{id:"CECILL-2.1",name:"CeCILL Free Software License Agreement v2.1",family:"CeCILL",category:"copyleft",osi:true,fsf:true,obligations:Ye},{id:"CC-BY-SA-4.0",name:"Creative Commons Attribution Share Alike 4.0 International",family:"CC",category:"copyleft",obligations:{attribution:true,copyleft:true}},{id:"AGPL-3.0-only",name:"GNU Affero General Public License v3.0 only",family:"AGPL",category:"network-copyleft",osi:true,fsf:true,obligations:{...Nn,patentGrant:true}},{id:"AGPL-3.0-or-later",name:"GNU Affero General Public License v3.0 or later",family:"AGPL",category:"network-copyleft",osi:true,fsf:true,obligations:{...Nn,patentGrant:true}},{id:"SSPL-1.0",name:"Server Side Public License 1.0",family:"SSPL",category:"network-copyleft",obligations:Nn},{id:"BUSL-1.1",name:"Business Source License 1.1",family:"BUSL",category:"proprietary",obligations:{commercialRestriction:true,discloseSource:true}},{id:"Elastic-2.0",name:"Elastic License 2.0",family:"Elastic",category:"proprietary",obligations:{commercialRestriction:true}},{id:"RPL-1.5",name:"Reciprocal Public License 1.5",family:"RPL",category:"network-copyleft",osi:true,obligations:Nn},{id:"Commons-Clause",name:"Commons Clause License Condition v1.0",family:"Commons-Clause",category:"proprietary",obligations:{commercialRestriction:true}},{id:"LicenseRef-Proprietary",name:"Proprietary / Commercial",family:"Proprietary",category:"proprietary",obligations:{commercialRestriction:true}},{id:"CC-BY-NC-4.0",name:"Creative Commons Attribution Non Commercial 4.0 International",family:"CC",category:"proprietary",obligations:{attribution:true,commercialRestriction:true}},{id:"CC-BY-4.0",name:"Creative Commons Attribution 4.0 International",family:"CC",category:"permissive",obligations:q}],ic=oc.map(sc),fo=new Map;for(let t of ic)fo.set(t.spdxId.toLowerCase(),t);function V(t){return fo.get(t.trim().toLowerCase())}function On(t="Unknown"){return {spdxId:"NOASSERTION",name:t,family:"Unknown",category:"unknown",osiApproved:false,fsfLibre:false,deprecated:false,referenceUrl:"",riskLevel:"medium",obligations:{...po}}}function ho(t){return t.trim().toLowerCase().replace(/^\(+|\)+$/g,"").replace(/[._]/g,"-").replace(/\s+/g," ").replace(/\s*-\s*/g,"-").replace(/\bversion\b/g,"v").replace(/\blicen[sc]e\b/g,"").replace(/\s+/g," ").trim()}var ac={mit:"MIT","mit license":"MIT","the mit license":"MIT",expat:"MIT",isc:"ISC",apache:"Apache-2.0","apache 2":"Apache-2.0",apache2:"Apache-2.0","apache 2.0":"Apache-2.0","apache-2":"Apache-2.0","apache license 2.0":"Apache-2.0","apache license version 2.0":"Apache-2.0","asl 2.0":"Apache-2.0",al2:"Apache-2.0",bsd:"BSD-3-Clause","bsd license":"BSD-3-Clause","bsd-2":"BSD-2-Clause","bsd 2-clause":"BSD-2-Clause","simplified bsd":"BSD-2-Clause",freebsd:"BSD-2-Clause","bsd-3":"BSD-3-Clause","bsd 3-clause":"BSD-3-Clause","new bsd":"BSD-3-Clause","modified bsd":"BSD-3-Clause","revised bsd":"BSD-3-Clause",gpl:"GPL-3.0-or-later",gplv2:"GPL-2.0-only",gpl2:"GPL-2.0-only","gpl-2":"GPL-2.0-only","gpl 2.0":"GPL-2.0-only","gpl-2.0":"GPL-2.0-only","gpl-2.0+":"GPL-2.0-or-later","gnu gpl v2":"GPL-2.0-only",gplv3:"GPL-3.0-only",gpl3:"GPL-3.0-only","gpl-3":"GPL-3.0-only","gpl 3.0":"GPL-3.0-only","gpl-3.0":"GPL-3.0-only","gpl-3.0+":"GPL-3.0-or-later","gnu gpl v3":"GPL-3.0-only","gnu general public v3":"GPL-3.0-only",lgpl:"LGPL-3.0-or-later","lgplv2.1":"LGPL-2.1-only","lgpl-2.1":"LGPL-2.1-only","lgpl 2.1":"LGPL-2.1-only",lgplv3:"LGPL-3.0-only","lgpl-3":"LGPL-3.0-only","lgpl-3.0":"LGPL-3.0-only","lgpl 3.0":"LGPL-3.0-only",agpl:"AGPL-3.0-or-later",agplv3:"AGPL-3.0-only","agpl-3":"AGPL-3.0-only","agpl-3.0":"AGPL-3.0-only","agpl 3.0":"AGPL-3.0-only","gnu agpl v3":"AGPL-3.0-only",mpl:"MPL-2.0","mpl 2.0":"MPL-2.0","mpl-2":"MPL-2.0","mozilla public 2.0":"MPL-2.0",epl:"EPL-2.0","eclipse public 2.0":"EPL-2.0","epl-2":"EPL-2.0",sspl:"SSPL-1.0","server side public":"SSPL-1.0",busl:"BUSL-1.1","business source":"BUSL-1.1",elastic:"Elastic-2.0","elastic-2":"Elastic-2.0","commons clause":"Commons-Clause",proprietary:"LicenseRef-Proprietary",commercial:"LicenseRef-Proprietary","see license in license":"LicenseRef-Proprietary",unlicensed:"LicenseRef-Proprietary","all rights reserved":"LicenseRef-Proprietary",cc0:"CC0-1.0","cc0 1.0":"CC0-1.0","public domain":"CC0-1.0","the unlicense":"Unlicense",wtfpl:"WTFPL",boost:"BSL-1.0",bsl:"BSL-1.0","zlib/libpng":"Zlib",python:"Python-2.0",psf:"PSF-2.0",artistic:"Artistic-2.0"},mo=new Map;for(let[t,e]of Object.entries(ac))mo.set(ho(t),e);function go(t){return mo.get(ho(t))}var cc=/\(|\)|\bWITH\b|\bAND\b|\bOR\b|[^\s()]+/gi;function lc(t){let e=(t??"").trim(),n=[],r=[],s=false,o=false,a=false,i=false,c=e.match(cc)??[];for(let u of c){let p=u.toUpperCase();if(u==="("||u===")")continue;if(p==="OR"){s=true,i=false;continue}if(p==="AND"){o=true,i=false;continue}if(p==="WITH"){i=true;continue}if(i){r.includes(u)||r.push(u),i=false;continue}let d=u;d.endsWith("+")&&(a=true,d=d.slice(0,-1)),d&&!n.includes(d)&&n.push(d);}let l=s?"OR":o?"AND":"SINGLE";return {licenseIds:n,exceptions:r,operator:l,orLater:a,normalized:uc(n,r,l,a,e)}}function uc(t,e,n,r,s){if(t.length===0)return s.trim();if(t.length===1){let a=t[0];return r&&!a.endsWith("+")&&(a+="+"),e.length>0&&(a+=` WITH ${e.join(" WITH ")}`),a}let o=n==="AND"?" AND ":" OR ";return t.join(o)}function pc(t){return /\b(?:AND|OR|WITH)\b|\+\s*$|\(/i.test(t)}var Vr={"public-domain":0,permissive:1,"weak-copyleft":2,copyleft:3,"network-copyleft":4,proprietary:5,unknown:2};function be(t,e,n,r,s){return {spdxId:t.spdxId,name:t.name,expression:r??t.spdxId,family:t.family,category:t.category,riskLevel:t.riskLevel,osiApproved:t.osiApproved,fsfLibre:t.fsfLibre,obligations:t.obligations,matchStatus:e,confidence:n,components:s??[t.spdxId]}}function yo(t){let e=t.toLowerCase();if(/\bagpl/.test(e))return V("AGPL-3.0-or-later");if(/\bsspl/.test(e))return V("SSPL-1.0");if(/\bbusl|business source/.test(e))return V("BUSL-1.1");if(/\blgpl/.test(e))return V("LGPL-3.0-or-later");if(/\bgpl/.test(e))return V("GPL-3.0-or-later");if(/\bmpl|mozilla/.test(e))return V("MPL-2.0");if(/\bepl|eclipse/.test(e))return V("EPL-2.0");if(/\bapache/.test(e))return V("Apache-2.0");if(/\bbsd/.test(e))return V("BSD-3-Clause");if(/\bmit\b/.test(e))return V("MIT");if(/\bisc\b/.test(e))return V("ISC");if(/commons clause/.test(e))return V("Commons-Clause");if(/proprietary|commercial|all rights reserved/.test(e))return V("LicenseRef-Proprietary");if(/public domain|cc0/.test(e))return V("CC0-1.0")}function dc(t){let e=(t??"").trim();if(!e||/^(unknown|noassertion|none|n\/a)$/i.test(e))return be(On(),"unknown",0);let n=V(e);if(n)return be(n,"exact",1);if(pc(e))return fc(e);let r=go(e);if(r){let o=V(r);if(o)return be(o,"alias",.95)}let s=yo(e);return s?{...be(s,"fuzzy",.6),name:e.slice(0,120)}:be(On(e.slice(0,120)),"unknown",0)}function fc(t){let e=lc(t);if(e.licenseIds.length===0)return be(On(t.slice(0,120)),"unknown",0);let n=e.licenseIds.map(c=>{let l=V(c);if(l)return be(l,"exact",1);let u=go(c);if(u){let d=V(u);if(d)return be(d,"alias",.95)}let p=yo(c);return p?be(p,"fuzzy",.6):be(On(c),"unknown",0)}),r=e.operator!=="OR",s=n[0];for(let c of n){let l=Vr[c.category]>Vr[s.category];(r?l:!l)&&(s=c);}let o=hc(r?n:[s]),a=n.map(c=>c.spdxId),i=s.category;return {spdxId:s.spdxId,name:e.normalized,expression:e.normalized,family:s.family,category:i,riskLevel:uo(i),osiApproved:n.every(c=>c.osiApproved),fsfLibre:n.every(c=>c.fsfLibre),obligations:o,matchStatus:"expression",confidence:Math.min(...n.map(c=>c.confidence))||.5,components:a}}function hc(t){let e={attribution:false,copyleft:false,networkCopyleft:false,discloseSource:false,patentGrant:false,commercialRestriction:false};for(let n of t)e.attribution||=n.obligations.attribution,e.copyleft||=n.obligations.copyleft,e.networkCopyleft||=n.obligations.networkCopyleft,e.discloseSource||=n.obligations.discloseSource,e.patentGrant||=n.obligations.patentGrant,e.commercialRestriction||=n.obligations.commercialRestriction;return e}function mc(t,e){let n=(t??"").trim();if(!n)return {raw:null,spdxId:null,source:"none",confidence:0};let r=dc(n);return {raw:n.slice(0,200),spdxId:r.matchStatus==="unknown"?null:r.spdxId,source:e,confidence:r.confidence}}var Ur={react:"React","react-dom":"React DOM",vue:"Vue","@angular/core":"Angular",svelte:"Svelte","solid-js":"Solid",preact:"Preact",lit:"Lit",qwik:"Qwik","htmx.org":"htmx",alpinejs:"Alpine.js",stimulus:"Stimulus",next:"Next.js",nuxt:"Nuxt","@remix-run/react":"Remix","@remix-run/node":"Remix (Node)",gatsby:"Gatsby",astro:"Astro","@sveltejs/kit":"SvelteKit","@analogjs/platform":"Analog","@tanstack/start":"TanStack Start",express:"Express",fastify:"Fastify","@nestjs/core":"NestJS",hono:"Hono",koa:"Koa","@hapi/hapi":"Hapi",restify:"Restify","@elysiajs/eden":"Elysia",elysia:"Elysia","@adonisjs/core":"AdonisJS",moleculer:"Moleculer","@feathersjs/feathers":"Feathers",sails:"Sails",typescript:"TypeScript",redux:"Redux","@reduxjs/toolkit":"Redux Toolkit",zustand:"Zustand",mobx:"MobX",jotai:"Jotai",recoil:"Recoil",pinia:"Pinia",vuex:"Vuex","@tanstack/react-query":"TanStack Query",swr:"SWR",xstate:"XState","@ngrx/store":"NgRx",prisma:"Prisma","drizzle-orm":"Drizzle",typeorm:"TypeORM",sequelize:"Sequelize","@mikro-orm/core":"MikroORM",mongoose:"Mongoose",knex:"Knex",kysely:"Kysely",objection:"Objection.js",vite:"Vite",webpack:"webpack",rollup:"Rollup",esbuild:"esbuild",parcel:"Parcel",turbo:"Turbo",tsup:"tsup","@swc/core":"SWC",bun:"Bun",vitest:"Vitest",jest:"Jest","@playwright/test":"Playwright",cypress:"Cypress",mocha:"Mocha",ava:"AVA",storybook:"Storybook","@storybook/react":"Storybook"};async function gc(t,e,n$1,r,s=Ee){let o=n$1?await n$1.findPackageJsonFiles(t):await j(t),a=[],i=new Map,c;try{let h=n$1?j=>n$1.pathExists(j):p,y=_.join(t,"package.json");if(await h(y))try{let j=n$1?await n$1.readJsonFile(y):await n(y);if(j.packageManager){let C=j.packageManager.split("@")[0]?.toLowerCase();C&&["pnpm","yarn","npm","bun"].includes(C)&&(c=C);}}catch{}c||await h(_.join(t,"pnpm-workspace.yaml"))&&(c="pnpm"),c||(await h(_.join(t,"pnpm-lock.yaml"))?c="pnpm":await h(_.join(t,"yarn.lock"))?c="yarn":await h(_.join(t,"package-lock.json"))?c="npm":await h(_.join(t,"bun.lockb"))&&(c="bun"));}catch{}let l=r??n$1?.projectScanTimeout??18e4,u=typeof on.availableParallelism=="function"?on.availableParallelism():on.cpus().length||4,p$1=Math.max(2,Math.min(16,u*2)),d=new a$1(p$1),f=new Set;if(await Promise.all(o.map(async h=>{try{let y=n$1?await n$1.readJsonFile(h):await n(h),j=[y.dependencies,y.devDependencies,y.peerDependencies,y.optionalDependencies];for(let C of j)if(C)for(let[A,T]of Object.entries(C))lo(T)&&f.add(A);}catch{}})),f.size>0)try{await e.prefetch([...f]);}catch{}let g=await Promise.all(o.map(async h=>d.run(async()=>{try{let y=yc(h,t,e,n$1,s),j=await Se(y,l);if(j.ok)return j.value;let C=_.relative(t,_.dirname(h));return n$1&&n$1.addStuckPath(C||"."),console.error(`Timeout scanning ${h} (>${l/1e3}s) \u2014 skipped`),n$1?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects"),null}catch(y){let j=y instanceof Error?y.message:String(y);return console.error(`Error scanning ${h}: ${j}`),null}})));for(let h of g)h&&(a.push(h),i.set(h.name,h.path));for(let h of a){let y=[];for(let j of h.dependencies){let C=i.get(j.package);C&&C!==h.path&&y.push({path:C,name:j.package,refType:"workspace"});}y.length>0&&(h.projectReferences=y),c&&(h.packageManager=c);}return a}async function yc(t,e,n$1,r,s){let o=r?await r.readJsonFile(t):await n(t),a=_.dirname(t),i=_.relative(e,a)||".",c=o.engines?.node??void 0,l,u,p,d;if(c){let v=Yn(s,"nodejs"),b=ve.minVersion(c);if(v&&b){let w=ve.major(b);l=`${v.major}.0.0`,u=Math.max(0,v.major-w);}p=rt(s,"node",c);let S=Ke("node",c);S&&(d=st(s,"nodejs",S));}let f=[{name:"dependencies",deps:o.dependencies},{name:"devDependencies",deps:o.devDependencies},{name:"peerDependencies",deps:o.peerDependencies},{name:"optionalDependencies",deps:o.optionalDependencies}],g=[],h=[],y={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},j=[];for(let v of f)if(v.deps)for(let[b,S]of Object.entries(v.deps))lo(S)&&j.push({pkg:b,section:v.name,spec:S});await n$1.prefetch(j.map(v=>v.pkg));let C=j.map(async v=>{let b=await n$1.get(v.pkg);return {...v,meta:b}}),A=await Promise.all(C);for(let{pkg:v,section:b,spec:S,meta:w}of A){let x=w.stableVersions.length>0?ve.maxSatisfying(w.stableVersions,S)??null:null,m=w.latestStableOverall,P=null,L="unknown";if(x&&m){let ne=ve.major(x);P=ve.major(m)-ne,P===0?L=ve.eq(x,m)?"current":"minor-behind":L="major-behind",P===0?y.current++:P===1?y.oneBehind++:y.twoPlusBehind++;}else y.unknown++;let D=ba(x,m,w.releaseDates),ce=va(D);g.push({package:v,section:b,currentSpec:S,resolvedVersion:x,latestStable:m,majorsBehind:P,drift:L,license:mc(w.license,"registry"),ageDays:D,libyears:ce}),v in Ur&&h.push({name:Ur[v],currentVersion:x,latestVersion:m,majorsBehind:P});}for(let v of f)if(v.deps)for(let[b,S]of Object.entries(v.deps))S.trim().startsWith("workspace:")&&(g.push({package:b,section:v.name,currentSpec:S,resolvedVersion:null,latestStable:null,majorsBehind:null,drift:"unknown",license:{raw:null,spdxId:null,source:"none",confidence:0}}),y.unknown++);g.sort((v,b)=>{let S={"major-behind":0,"minor-behind":1,current:2,unknown:3},w=(S[v.drift]??9)-(S[b.drift]??9);return w!==0?w:v.package.localeCompare(b.package)});let T;try{T=r?await r.countFilesUnder(e,a):void 0;}catch{}return {type:"node",path:i,name:o.name??_.basename(a),runtime:c,runtimeLatest:l,runtimeMajorsBehind:u,runtimeEol:p,runtimeEolDate:d,frameworks:h,dependencies:g,dependencyAgeBuckets:y,libyears:wa(g.map(v=>v.libyears))??void 0,fileCount:T}}var bo=new Qe({ignoreAttributes:false,attributeNamePrefix:"@_"}),qr={"Microsoft.AspNetCore.App":"ASP.NET Core","Microsoft.AspNetCore.Mvc":"ASP.NET Core MVC","Microsoft.AspNetCore.Components":"Blazor","Microsoft.AspNetCore.Components.WebAssembly":"Blazor WASM","Microsoft.AspNetCore.SignalR":"SignalR","Microsoft.AspNetCore.OData":"OData","Microsoft.AspNetCore.Identity":"ASP.NET Identity","Microsoft.AspNetCore.Authentication.JwtBearer":"JWT Bearer Auth","Microsoft.AspNetCore.Diagnostics.HealthChecks":"Health Checks","Swashbuckle.AspNetCore":"Swashbuckle","NSwag.AspNetCore":"NSwag","Microsoft.EntityFrameworkCore":"EF Core","Microsoft.EntityFrameworkCore.SqlServer":"EF Core SQL Server","Microsoft.EntityFrameworkCore.Sqlite":"EF Core SQLite","Microsoft.EntityFrameworkCore.Design":"EF Core Design","Microsoft.EntityFrameworkCore.Tools":"EF Core Tools","Npgsql.EntityFrameworkCore.PostgreSQL":"EF Core PostgreSQL","Pomelo.EntityFrameworkCore.MySql":"EF Core MySQL (Pomelo)","MongoDB.EntityFrameworkCore":"EF Core MongoDB",Dapper:"Dapper","Dapper.Contrib":"Dapper Contrib",NHibernate:"NHibernate",Npgsql:"Npgsql",MySqlConnector:"MySqlConnector","MongoDB.Driver":"MongoDB Driver","StackExchange.Redis":"StackExchange.Redis","Microsoft.Data.SqlClient":"SqlClient","Oracle.ManagedDataAccess.Core":"Oracle (Managed)",Cassandra:"Cassandra Driver","Neo4j.Driver":"Neo4j Driver",Marten:"Marten",LiteDB:"LiteDB","RavenDB.Client":"RavenDB","Microsoft.Extensions.Hosting":".NET Hosting","Microsoft.Extensions.Hosting.Abstractions":".NET Hosting Abstractions","Microsoft.Extensions.DependencyInjection":".NET DI","Microsoft.Extensions.DependencyInjection.Abstractions":".NET DI Abstractions","Microsoft.Extensions.Configuration":".NET Configuration","Microsoft.Extensions.Configuration.Abstractions":".NET Configuration Abstractions","Microsoft.Extensions.Configuration.Binder":".NET Configuration Binder","Microsoft.Extensions.Configuration.EnvironmentVariables":".NET Configuration EnvVars","Microsoft.Extensions.Configuration.Json":".NET Configuration JSON","Microsoft.Extensions.Configuration.UserSecrets":".NET Configuration UserSecrets","Microsoft.Extensions.Logging":".NET Logging","Microsoft.Extensions.Logging.Abstractions":".NET Logging Abstractions","Microsoft.Extensions.Logging.Console":".NET Logging Console","Microsoft.Extensions.Logging.Debug":".NET Logging Debug","Microsoft.Extensions.Logging.EventSource":".NET Logging EventSource","Microsoft.Extensions.Options":".NET Options","Microsoft.Extensions.Options.ConfigurationExtensions":".NET Options Configuration","Microsoft.Extensions.Options.DataAnnotations":".NET Options DataAnnotations","Microsoft.Extensions.Caching.Memory":".NET Memory Cache","Microsoft.Extensions.Caching.Abstractions":".NET Caching Abstractions","Microsoft.Extensions.Caching.StackExchangeRedis":".NET Redis Cache","Microsoft.Extensions.Http":".NET HttpClientFactory","Microsoft.Extensions.Http.Resilience":".NET HttpClient Resilience","Microsoft.Extensions.Resilience":".NET Resilience","Microsoft.Extensions.Diagnostics":".NET Diagnostics","Microsoft.Extensions.Diagnostics.HealthChecks":".NET Health Checks (Extensions)","Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions":".NET Health Checks Abstractions","Microsoft.Extensions.FileProviders.Abstractions":".NET File Providers","Microsoft.Extensions.FileProviders.Physical":".NET File Providers Physical","Microsoft.Extensions.Localization":".NET Localization","Microsoft.Extensions.Localization.Abstractions":".NET Localization Abstractions","Microsoft.Extensions.Primitives":".NET Primitives","System.Text.Json":".NET System.Text.Json","System.Text.Encodings.Web":".NET System.Text.Encodings.Web","System.Net.Http.Json":".NET System.Net.Http.Json","System.ComponentModel.Annotations":".NET ComponentModel Annotations",MediatR:"MediatR",Wolverine:"Wolverine",Brighter:"Brighter",AutoMapper:"AutoMapper",Mapster:"Mapster","Riok.Mapperly":"Mapperly",FluentValidation:"FluentValidation","FluentValidation.AspNetCore":"FluentValidation ASP.NET","Newtonsoft.Json":"Newtonsoft.Json",MessagePack:"MessagePack","protobuf-net":"protobuf-net",CsvHelper:"CsvHelper",Serilog:"Serilog","Serilog.AspNetCore":"Serilog ASP.NET","Serilog.Sinks.Console":"Serilog Console","Serilog.Sinks.Seq":"Serilog Seq","Serilog.Sinks.File":"Serilog File","Serilog.Sinks.Elasticsearch":"Serilog Elasticsearch",NLog:"NLog","NLog.Web.AspNetCore":"NLog ASP.NET",log4net:"log4net",OpenTelemetry:"OpenTelemetry","OpenTelemetry.Extensions.Hosting":"OpenTelemetry Hosting","OpenTelemetry.Instrumentation.AspNetCore":"OpenTelemetry ASP.NET","OpenTelemetry.Exporter.Prometheus":"OpenTelemetry Prometheus","OpenTelemetry.Exporter.Jaeger":"OpenTelemetry Jaeger","OpenTelemetry.Exporter.OpenTelemetryProtocol":"OpenTelemetry OTLP","App.Metrics":"App.Metrics","prometheus-net":"Prometheus.NET","Elastic.Apm":"Elastic APM",xunit:"xUnit","xunit.runner.visualstudio":"xUnit Runner",NUnit:"NUnit",NUnit3TestAdapter:"NUnit Adapter","MSTest.TestFramework":"MSTest","MSTest.TestAdapter":"MSTest Adapter",Moq:"Moq",NSubstitute:"NSubstitute",FakeItEasy:"FakeItEasy",FluentAssertions:"FluentAssertions",Shouldly:"Shouldly",Bogus:"Bogus",AutoFixture:"AutoFixture","WireMock.Net":"WireMock.Net",Testcontainers:"Testcontainers",Respawn:"Respawn",BenchmarkDotNet:"BenchmarkDotNet","coverlet.collector":"Coverlet",SpecFlow:"SpecFlow",TUnit:"TUnit","Verify.Xunit":"Verify",Snapshooter:"Snapshooter",MassTransit:"MassTransit","MassTransit.RabbitMQ":"MassTransit RabbitMQ","MassTransit.Azure.ServiceBus.Core":"MassTransit Azure SB",NServiceBus:"NServiceBus","RabbitMQ.Client":"RabbitMQ Client","Confluent.Kafka":"Confluent Kafka","Azure.Messaging.ServiceBus":"Azure Service Bus","Azure.Messaging.EventHubs":"Azure Event Hubs","Amazon.SQS":"AWS SQS","Amazon.SNS":"AWS SNS",Rebus:"Rebus",EasyNetQ:"EasyNetQ",SlimMessageBus:"SlimMessageBus",CAP:"DotNetCore.CAP","AWSSDK.Core":"AWS SDK Core","AWSSDK.S3":"AWS SDK S3","AWSSDK.SQS":"AWS SDK SQS","AWSSDK.DynamoDBv2":"AWS SDK DynamoDB","AWSSDK.Lambda":"AWS SDK Lambda","AWSSDK.SecretsManager":"AWS SDK Secrets Manager","AWSSDK.CloudWatch":"AWS SDK CloudWatch","Azure.Storage.Blobs":"Azure Blob Storage","Azure.Identity":"Azure Identity","Azure.Security.KeyVault.Secrets":"Azure Key Vault","Azure.Cosmos":"Azure Cosmos DB","Microsoft.Azure.Functions.Worker":"Azure Functions","Google.Cloud.Storage.V1":"GCP Storage","Google.Cloud.PubSub.V1":"GCP Pub/Sub","Google.Cloud.Firestore":"GCP Firestore","Microsoft.Identity.Web":"Microsoft Identity Web","Microsoft.Identity.Client":"MSAL",IdentityServer4:"IdentityServer4","Duende.IdentityServer":"Duende IdentityServer","Microsoft.AspNetCore.Authentication.OpenIdConnect":"OpenID Connect",IdentityModel:"IdentityModel",Refit:"Refit",RestSharp:"RestSharp","Flurl.Http":"Flurl",Polly:"Polly","Polly.Extensions.Http":"Polly HTTP","Microsoft.Extensions.Http.Polly":"HttpClient Polly","Grpc.AspNetCore":"gRPC ASP.NET","Grpc.Net.Client":"gRPC Client","GraphQL.Server.All":"GraphQL Server","HotChocolate.AspNetCore":"Hot Chocolate (GraphQL)",Hangfire:"Hangfire","Hangfire.Core":"Hangfire Core","Hangfire.AspNetCore":"Hangfire ASP.NET",Quartz:"Quartz.NET","Quartz.Extensions.Hosting":"Quartz.NET Hosting",Coravel:"Coravel",EPPlus:"EPPlus",ClosedXML:"ClosedXML",iTextSharp:"iTextSharp",QuestPDF:"QuestPDF",ImageSharp:"ImageSharp","SixLabors.ImageSharp":"ImageSharp","LaunchDarkly.ServerSdk":"LaunchDarkly","Microsoft.FeatureManagement":"Feature Management","Microsoft.FeatureManagement.AspNetCore":"Feature Management ASP.NET","Dapr.Client":"Dapr","Steeltoe.Discovery.ClientCore":"Steeltoe",Ocelot:"Ocelot (API Gateway)","Yarp.ReverseProxy":"YARP","Microsoft.AspNetCore.SignalR.Client":"SignalR Client"};function ys(t){return t.replace(/\\/g,"/")}function bc(t){let e=t.match(/^net(\d+)\.\d+$/);if(e?.[1])return parseInt(e[1],10);let n=t.match(/^netcoreapp(\d+)\.\d+$/);return n?.[1]?parseInt(n[1],10):(t.startsWith("netstandard")||t.match(/^net(\d)(\d+)?$/),null)}function Gr(t){return t.endsWith(".csproj")||t.endsWith(".vbproj")}function bs(t){return _.basename(t).replace(/\.(cs|vb)proj$/i,"")}function vc(t,e){let r=bo.parse(t)?.Project;if(!r)return {targetFrameworks:[],packageReferences:[],projectReferences:[],projectName:bs(e)};let s=Array.isArray(r.PropertyGroup)?r.PropertyGroup:r.PropertyGroup?[r.PropertyGroup]:[],o=[];for(let l of s)if(l.TargetFramework&&o.push(String(l.TargetFramework)),l.TargetFrameworks){let u=String(l.TargetFrameworks).split(";").map(p=>p.trim()).filter(Boolean);o.push(...u);}let a=Array.isArray(r.ItemGroup)?r.ItemGroup:r.ItemGroup?[r.ItemGroup]:[],i=[],c=[];for(let l of a){let u=Array.isArray(l.PackageReference)?l.PackageReference:l.PackageReference?[l.PackageReference]:[];for(let d of u){let f=d["@_Include"]??d["@_include"]??"",g=d["@_Version"]??d["@_version"]??d.Version??"";f&&g&&i.push({name:String(f),version:String(g)});}let p=Array.isArray(l.ProjectReference)?l.ProjectReference:l.ProjectReference?[l.ProjectReference]:[];for(let d of p){let f=d["@_Include"]??d["@_include"]??"";f&&c.push(String(f).replace(/\\/g,"/"));}}return {targetFrameworks:[...new Set(o)],packageReferences:i,projectReferences:c,projectName:bs(e)}}function wc(t){let n=bo.parse(t)?.packages;if(!n)return [];let r=Array.isArray(n.package)?n.package:n.package?[n.package]:[],s=[];for(let o of r){let a=o["@_id"]??o["@_Id"]??"",i=o["@_version"]??o["@_Version"]??"";a&&i&&s.push({name:String(a),version:String(i)});}return s}async function Sc(t,e,n,r,s=Ee){let o$1=n?await n.findFiles(t,Gr):await i(t,Gr),a=n?await n.findSolutionFiles(t):await k(t),i$1=new Set;for(let p of a)try{let d=n?await n.readTextFile(p):await o(p),f=_.dirname(p),g=/Project\("[^"]*"\)\s*=\s*"[^"]*",\s*"([^"]+\.(?:cs|vb)proj)"/g,h;for(;(h=g.exec(d))!==null;)if(h[1]){let y=_.resolve(f,h[1].replace(/\\/g,"/"));i$1.add(y);}}catch{}let c=new Set([...o$1,...i$1]),l=[],u=r??n?.projectScanTimeout??18e4;for(let p of c)try{let d=kc(p,t,e,n,s),f=await Se(d,u);if(f.ok)l.push(f.value);else {let g=ys(_.relative(t,_.dirname(p)));n&&n.addStuckPath(g||"."),console.error(`Timeout scanning ${p} (>${u/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(d){let f=d instanceof Error?d.message:String(d);console.error(`Error scanning ${p}: ${f}`);}return l}async function kc(t,e,n,r,s){let o$1=r?await r.readTextFile(t):await o(t),a=vc(o$1,t),i=_.dirname(t);{let v=_.join(i,"packages.config");try{let b=r?await r.readTextFile(v):await o(v),S=new Set(a.packageReferences.map(w=>w.name.toLowerCase()));for(let w of wc(b))S.has(w.name.toLowerCase())||(a.packageReferences.push(w),S.add(w.name.toLowerCase()));}catch{}}let c=a.targetFrameworks[0],l=Ht(s,"dotnet")?.major,u,p,d,f=c;if(c){let v=bc(c);v!==null&&l!==void 0&&(u=Math.max(0,l-v)),p=rt(s,"dotnet",c);let b=Ke("dotnet",c);b&&(d=st(s,"dotnet",b));}let g=[],h={current:0,oneBehind:0,twoPlusBehind:0,unknown:0};if(n){let v=a.packageReferences.map(async S=>{let w=await n.get(S.name);return {ref:S,meta:w}}),b=await Promise.all(v);for(let{ref:S,meta:w}of b){let x=ht.valid(S.version)?S.version:null,m=w.latestStableOverall,P=null,L="unknown";if(x&&m){let D=ht.major(x);P=ht.major(m)-D,P===0?L=ht.eq(x,m)?"current":"minor-behind":P>0?L="major-behind":L="current",P<=0?h.current++:P===1?h.oneBehind++:h.twoPlusBehind++;}else h.unknown++;g.push({package:S.name,section:"dependencies",currentSpec:S.version,resolvedVersion:x,latestStable:m,majorsBehind:P,drift:L});}}else for(let v of a.packageReferences)g.push({package:v.name,section:"dependencies",currentSpec:v.version,resolvedVersion:v.version,latestStable:null,majorsBehind:null,drift:"unknown"}),h.unknown++;let y=[],j=new Map(g.map(v=>[v.package,v]));for(let v of a.packageReferences)if(v.name in qr){let b=j.get(v.name);y.push({name:qr[v.name],currentVersion:b?.resolvedVersion??v.version,latestVersion:b?.latestStable??null,majorsBehind:b?.majorsBehind??null});}let C=a.projectReferences.map(v=>{let b=_.resolve(i,v),S=ys(_.relative(e,_.dirname(b))),w=bs(b);return {path:S||".",name:w,refType:"project"}}),A;try{A=r?await r.countFilesUnder(e,i):void 0;}catch{}g.sort((v,b)=>{let S={"major-behind":0,"minor-behind":1,current:2,unknown:3},w=(S[v.drift]??9)-(S[b.drift]??9);return w!==0?w:v.package.localeCompare(b.package)});let T=h;return {type:"dotnet",path:ys(_.relative(e,i))||".",name:a.projectName,targetFramework:f,runtime:c,runtimeLatest:l!==void 0?`net${l}.0`:void 0,runtimeMajorsBehind:u,runtimeEol:p,runtimeEolDate:d,frameworks:y,dependencies:g,dependencyAgeBuckets:T,projectReferences:C.length>0?C:void 0,fileCount:A}}var Hr={django:"Django",flask:"Flask",fastapi:"FastAPI",starlette:"Starlette",tornado:"Tornado",bottle:"Bottle",sanic:"Sanic",falcon:"Falcon",aiohttp:"aiohttp",quart:"Quart",litestar:"Litestar",robyn:"Robyn",sqlalchemy:"SQLAlchemy","django-rest-framework":"DRF",djangorestframework:"DRF",peewee:"Peewee","tortoise-orm":"Tortoise ORM",sqlmodel:"SQLModel",pony:"Pony ORM",alembic:"Alembic",psycopg2:"psycopg2","psycopg2-binary":"psycopg2",psycopg:"psycopg3",asyncpg:"asyncpg",pymongo:"PyMongo",motor:"Motor",redis:"redis-py",celery:"Celery",boto3:"AWS SDK (boto3)",botocore:"AWS SDK (botocore)",numpy:"NumPy",pandas:"pandas",scipy:"SciPy","scikit-learn":"scikit-learn",tensorflow:"TensorFlow",torch:"PyTorch",keras:"Keras",matplotlib:"Matplotlib",seaborn:"Seaborn",plotly:"Plotly",polars:"Polars",dask:"Dask",xgboost:"XGBoost",lightgbm:"LightGBM",transformers:"Transformers (HF)",langchain:"LangChain",openai:"OpenAI SDK",pytest:"pytest",unittest2:"unittest2",nose2:"nose2",tox:"tox",hypothesis:"Hypothesis","factory-boy":"factory_boy",faker:"Faker",coverage:"Coverage.py",responses:"responses",httpx:"HTTPX",uvicorn:"Uvicorn",gunicorn:"Gunicorn",hypercorn:"Hypercorn",dramatiq:"Dramatiq",rq:"RQ",huey:"Huey",pyjwt:"PyJWT",authlib:"Authlib","python-jose":"python-jose",passlib:"Passlib",cryptography:"cryptography",pydantic:"Pydantic",marshmallow:"Marshmallow",attrs:"attrs",cerberus:"Cerberus",msgpack:"msgpack",protobuf:"protobuf",requests:"Requests",urllib3:"urllib3",ansible:"Ansible",fabric:"Fabric",invoke:"Invoke",paramiko:"Paramiko",black:"Black",ruff:"Ruff",flake8:"Flake8",mypy:"mypy",pylint:"Pylint",isort:"isort",bandit:"Bandit",structlog:"structlog",loguru:"Loguru","sentry-sdk":"Sentry SDK","opentelemetry-api":"OpenTelemetry","prometheus-client":"prometheus-client"};function js(t){let e=t.trim();if(!e||e.startsWith("#")||e.startsWith("-"))return null;let r=e.split(";")[0].trim().match(/^([A-Za-z0-9][-A-Za-z0-9_.]*[A-Za-z0-9]?)(?:\[.*?\])?\s*(.*)?$/);if(!r)return null;let s=r[1],o=(r[2]??"").trim(),a=s.toLowerCase().replace(/[_.]+/g,"-");return {name:s,spec:o,normalisedName:a}}function Ec(t){return t.match(/^==\s*([^\s,;]+)/)?.[1]??null}function jc(t){let e=t.replace(/^[vV]/,"").trim();if(/(?:a\d|b\d|rc\d|alpha|beta|dev|post)/i.test(e))return null;let n=e.split(".");for(;n.length<3;)n.push("0");return e=n.slice(0,3).join("."),mt.valid(e)}function xc(t){let e=[];for(let n of t.split(`
52
+ `)){let r=js(n);r&&e.push(r);}return e}function Tc(t){let e={dependencies:[]},n=t.match(/^\s*name\s*=\s*"([^"]+)"/m);n&&(e.projectName=n[1]);let r=t.match(/^\s*requires-python\s*=\s*"([^"]+)"/m);r&&(e.pythonVersion=r[1]);let s=t.match(/^\s*dependencies\s*=\s*\[([\s\S]*?)\]/m);if(s){let a=s[1],i=/"([^"]+)"/g,c;for(;(c=i.exec(a))!==null;){let l=js(c[1]);l&&e.dependencies.push(l);}}let o=t.match(/\[tool\.poetry\.dependencies\]([\s\S]*?)(?=\n\s*\[|\n*$)/);if(o){let a=o[1].split(`
53
+ `);for(let i of a){let c=i.match(/^\s*([A-Za-z0-9][-A-Za-z0-9_.]*)\s*=\s*(?:"([^"]+)"|{.*?version\s*=\s*"([^"]+)".*?})/);if(c){let l=c[1];if(l.toLowerCase()==="python"){e.pythonVersion=c[2]??c[3]??void 0;continue}let u=c[2]??c[3]??"",p=l.toLowerCase().replace(/[_.]+/g,"-");e.dependencies.push({name:l,spec:u?`==${u}`:"",normalisedName:p});}}}return e}function Cc(t){let e=[],n=t.match(/\[packages\]([\s\S]*?)(?=\n\s*\[|\n*$)/);if(n){let s=n[1].split(`
54
+ `);for(let o of s){let a=o.match(/^\s*([A-Za-z0-9][-A-Za-z0-9_.]*)\s*=\s*(?:"([^"]+)"|{.*?version\s*=\s*"([^"]+)".*?}|\*|"[*]")/);if(a){let i=a[1],c=a[2]??a[3]??"",l=i.toLowerCase().replace(/[_.]+/g,"-");e.push({name:i,spec:c||"*",normalisedName:l});}}}let r=t.match(/\[dev-packages\]([\s\S]*?)(?=\n\s*\[|\n*$)/);if(r){let s=r[1].split(`
55
+ `);for(let o of s){let a=o.match(/^\s*([A-Za-z0-9][-A-Za-z0-9_.]*)\s*=\s*(?:"([^"]+)"|{.*?version\s*=\s*"([^"]+)".*?}|\*|"[*]")/);if(a){let i=a[1],c=a[2]??a[3]??"",l=i.toLowerCase().replace(/[_.]+/g,"-");e.push({name:i,spec:c||"*",normalisedName:l});}}}return e}function Ac(t){let e={deps:[]},n=t.match(/\[metadata\]([\s\S]*?)(?=\n\s*\[|\n*$)/);if(n){let s=n[1].match(/^\s*name\s*=\s*(.+)$/m);s&&(e.name=s[1].trim());}let r=t.match(/\[options\]([\s\S]*?)(?=\n\s*\[|\n*$)/);if(r){let s=r[1].match(/^\s*python_requires\s*=\s*(.+)$/m);s&&(e.pythonVersion=s[1].trim());let o=r[1].match(/install_requires\s*=\s*\n((?:\s+.*\n?)*)/);if(o){let a=o[1];for(let i of a.split(`
56
+ `)){let c=js(i);c&&e.deps.push(c);}}}return e}var vo=new Set(["requirements.txt","requirements-dev.txt","requirements_dev.txt","requirements-test.txt","dev-requirements.txt","pyproject.toml","setup.py","setup.cfg","Pipfile"]);async function Pc(t,e,n,r,s=Ee){let o=n?await n.findFiles(t,l=>vo.has(l)||/^requirements.*\.txt$/.test(l)):await Mc(t),a=new Map;for(let l of o){let u=_.dirname(l);a.has(u)||a.set(u,[]),a.get(u).push(l);}let i=[],c=r??n?.projectScanTimeout??18e4;for(let[l,u]of a)try{let p=$c(l,u,t,e,n,s),d=await Se(p,c);if(d.ok)i.push(d.value);else {let f=_.relative(t,l);n&&n.addStuckPath(f||"."),console.error(`Timeout scanning Python project ${l} (>${c/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(p){let d=p instanceof Error?p.message:String(p);console.error(`Error scanning Python project ${l}: ${d}`);}return i}async function Mc(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>vo.has(n)||/^requirements.*\.txt$/.test(n))}async function $c(t,e,n,r,s,o$1){let a=_.relative(n,t)||".",i=_.basename(t===n?n:t),c,l=new Map;for(let v of e){let b=_.basename(v),S=s?await s.readTextFile(v):await o(v);if(b==="pyproject.toml"){let w=Tc(S);w.projectName&&(i=w.projectName),w.pythonVersion&&(c=w.pythonVersion);for(let x of w.dependencies)l.has(x.normalisedName)||l.set(x.normalisedName,x);}else if(b==="setup.cfg"){let w=Ac(S);w.name&&(i=w.name),w.pythonVersion&&!c&&(c=w.pythonVersion);for(let x of w.deps)l.has(x.normalisedName)||l.set(x.normalisedName,x);}else if(b==="Pipfile")for(let w of Cc(S))l.has(w.normalisedName)||l.set(w.normalisedName,w);else if(b.startsWith("requirements")&&b.endsWith(".txt"))for(let w of xc(S))l.has(w.normalisedName)||l.set(w.normalisedName,w);}let u,p,d,f;if(c){let v=c.match(/(\d+)\.(\d+)/);if(v){let S=parseInt(v[1],10),w=parseInt(v[2],10),x=Ht(o$1,"python");x&&(S===x.major?u=Math.max(0,x.minor-w):S<x.major&&(u=x.minor+(x.major-S)*10),p=`${x.major}.${x.minor}`);}d=rt(o$1,"python",c);let b=Ke("python",c);b&&(f=st(o$1,"python",b));}let g=[],h=[],y={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},C=[...l.values()].map(async v=>{let b=await r.get(v.normalisedName);return {dep:v,meta:b}}),A=await Promise.all(C);for(let{dep:v,meta:b}of A){let S=Ec(v.spec),w=S?jc(S):null,x=b.latestStableOverall,m=null,P="unknown";if(w&&x){let L=mt.major(w);m=mt.major(x)-L,m===0?P=mt.eq(w,x)?"current":"minor-behind":m>0?P="major-behind":P="current",m<=0?y.current++:m===1?y.oneBehind++:y.twoPlusBehind++;}else y.unknown++;g.push({package:v.name,section:"dependencies",currentSpec:v.spec||"*",resolvedVersion:w,latestStable:x,majorsBehind:m,drift:P}),v.normalisedName in Hr&&h.push({name:Hr[v.normalisedName],currentVersion:w,latestVersion:x,majorsBehind:m});}g.sort((v,b)=>{let S={"major-behind":0,"minor-behind":1,current:2,unknown:3},w=(S[v.drift]??9)-(S[b.drift]??9);return w!==0?w:v.package.localeCompare(b.package)});let T;try{T=s?await s.countFilesUnder(n,t):void 0;}catch{}return {type:"python",path:a,name:i,runtime:c,runtimeLatest:p,runtimeMajorsBehind:u,runtimeEol:d,runtimeEolDate:f,frameworks:h,dependencies:g,dependencyAgeBuckets:y,fileCount:T}}var Lc=new Qe({ignoreAttributes:false,attributeNamePrefix:"@_"}),Wr={"org.springframework.boot:spring-boot-starter-web":"Spring Boot Web","org.springframework.boot:spring-boot-starter":"Spring Boot","org.springframework.boot:spring-boot-starter-data-jpa":"Spring Data JPA","org.springframework.boot:spring-boot-starter-security":"Spring Security","org.springframework.boot:spring-boot-starter-webflux":"Spring WebFlux","org.springframework.boot:spring-boot-starter-actuator":"Spring Actuator","org.springframework.boot:spring-boot-starter-test":"Spring Boot Test","org.springframework:spring-core":"Spring Framework","org.springframework:spring-web":"Spring Web","org.springframework:spring-webmvc":"Spring MVC","org.springframework.cloud:spring-cloud-starter-netflix-eureka-client":"Spring Cloud Eureka","org.springframework.cloud:spring-cloud-starter-gateway":"Spring Cloud Gateway","org.springframework.kafka:spring-kafka":"Spring Kafka","jakarta.platform:jakarta.jakartaee-api":"Jakarta EE","jakarta.servlet:jakarta.servlet-api":"Jakarta Servlet","javax.servlet:javax.servlet-api":"Java Servlet (Legacy)","io.micronaut:micronaut-core":"Micronaut","io.micronaut:micronaut-http-server-netty":"Micronaut HTTP","io.quarkus:quarkus-core":"Quarkus","io.quarkus:quarkus-resteasy":"Quarkus RESTEasy","io.quarkus:quarkus-resteasy-reactive":"Quarkus RESTEasy Reactive","io.vertx:vertx-core":"Vert.x","io.vertx:vertx-web":"Vert.x Web","org.hibernate.orm:hibernate-core":"Hibernate","org.hibernate:hibernate-core":"Hibernate","org.mybatis:mybatis":"MyBatis","org.mybatis.spring.boot:mybatis-spring-boot-starter":"MyBatis Spring Boot","org.jooq:jooq":"jOOQ","org.flywaydb:flyway-core":"Flyway","org.liquibase:liquibase-core":"Liquibase","com.zaxxer:HikariCP":"HikariCP","org.postgresql:postgresql":"PostgreSQL JDBC","com.mysql:mysql-connector-j":"MySQL Connector","mysql:mysql-connector-java":"MySQL Connector (Legacy)","com.oracle.database.jdbc:ojdbc11":"Oracle JDBC","org.mongodb:mongodb-driver-sync":"MongoDB Driver","io.lettuce:lettuce-core":"Lettuce (Redis)","redis.clients:jedis":"Jedis (Redis)","org.apache.kafka:kafka-clients":"Apache Kafka","com.rabbitmq:amqp-client":"RabbitMQ Client","software.amazon.awssdk:sqs":"AWS SQS","software.amazon.awssdk:sns":"AWS SNS","com.squareup.okhttp3:okhttp":"OkHttp","com.squareup.retrofit2:retrofit":"Retrofit","org.apache.httpcomponents.client5:httpclient5":"Apache HttpClient 5","io.grpc:grpc-netty":"gRPC","com.graphql-java:graphql-java":"GraphQL Java","com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter":"Netflix DGS","com.fasterxml.jackson.core:jackson-databind":"Jackson","com.google.code.gson:gson":"Gson","junit:junit":"JUnit 4","org.junit.jupiter:junit-jupiter":"JUnit 5","org.junit.jupiter:junit-jupiter-api":"JUnit 5","org.mockito:mockito-core":"Mockito","org.assertj:assertj-core":"AssertJ","org.testcontainers:testcontainers":"Testcontainers","io.rest-assured:rest-assured":"REST Assured","org.awaitility:awaitility":"Awaitility","com.tngtech.archunit:archunit-junit5":"ArchUnit","org.hamcrest:hamcrest":"Hamcrest","org.slf4j:slf4j-api":"SLF4J","ch.qos.logback:logback-classic":"Logback","org.apache.logging.log4j:log4j-core":"Log4j2","org.projectlombok:lombok":"Lombok","org.mapstruct:mapstruct":"MapStruct","software.amazon.awssdk:bom":"AWS SDK v2","com.google.cloud:google-cloud-bom":"Google Cloud SDK","com.azure:azure-sdk-bom":"Azure SDK","io.jsonwebtoken:jjwt-api":"JJWT","com.nimbusds:nimbus-jose-jwt":"Nimbus JOSE+JWT","io.micrometer:micrometer-core":"Micrometer","io.opentelemetry:opentelemetry-api":"OpenTelemetry","io.prometheus:simpleclient":"Prometheus Client","io.projectreactor:reactor-core":"Project Reactor","io.reactivex.rxjava3:rxjava":"RxJava 3"};function Nc(t,e){let r=Lc.parse(t)?.project;if(!r)return {artifactId:_.basename(_.dirname(e)),dependencies:[],modules:[],properties:{}};let s={};if(r.properties&&typeof r.properties=="object")for(let[h,y]of Object.entries(r.properties))(typeof y=="string"||typeof y=="number")&&(s[h]=String(y));let o,a=["java.version","maven.compiler.source","maven.compiler.target","maven.compiler.release","java.source.version"];for(let h of a)if(s[h]){o=String(s[h]);break}let i=r.dependencies,l=(i?.dependency?Array.isArray(i.dependency)?i.dependency:[i.dependency]:[]).filter(h=>h.groupId&&h.artifactId).map(h=>({groupId:It(String(h.groupId??""),s),artifactId:It(String(h.artifactId??""),s),version:It(String(h.version??""),s),scope:h.scope?String(h.scope):void 0})),u=r.dependencyManagement?.dependencies,p=u?.dependency?Array.isArray(u.dependency)?u.dependency:[u.dependency]:[];for(let h of p)h.groupId&&h.artifactId&&h.version&&l.push({groupId:It(String(h.groupId),s),artifactId:It(String(h.artifactId),s),version:It(String(h.version),s),scope:h.scope?String(h.scope):void 0});let f=(r.modules?.module?Array.isArray(r.modules.module)?r.modules.module:[r.modules.module]:[]).map(String),g;return r.parent?.groupId&&r.parent?.artifactId&&(g={groupId:String(r.parent.groupId),artifactId:String(r.parent.artifactId),version:String(r.parent.version??"")}),{groupId:r.groupId?String(r.groupId):g?.groupId,artifactId:String(r.artifactId??_.basename(_.dirname(e))),version:r.version?String(r.version):g?.version,packaging:r.packaging?String(r.packaging):void 0,javaVersion:o,dependencies:l,modules:f,parent:g,properties:s}}function It(t,e){return t.replace(/\$\{([^}]+)\}/g,(n,r)=>e[r]??`\${${r}}`)}function Rc(t,e){let n=[],r=_.basename(_.dirname(e)),s,o=t.match(/(?:sourceCompatibility|targetCompatibility|javaVersion)\s*[=:]\s*['"]?(?:JavaVersion\.VERSION_)?(\d+)['"]?/);o&&(s=o[1]);let a=t.match(/JavaLanguageVersion\.of\((\d+)\)/);a&&(s=a[1]);let i=/(?:implementation|api|compileOnly|runtimeOnly|testImplementation|testRuntimeOnly|annotationProcessor|kapt)\s*(?:\(?\s*)?['"]([^'"]+)['"]/g,c;for(;(c=i.exec(t))!==null;){let p=c[1].split(":");p.length>=2&&n.push({groupId:p[0],artifactId:p[1],version:p[2]??"",configuration:c[0].split(/\s/)[0]});}let l=/(?:implementation|api|compileOnly|runtimeOnly|testImplementation|testRuntimeOnly|annotationProcessor|kapt)\s*\(\s*"([^"]+)"\s*\)/g;for(;(c=l.exec(t))!==null;){let p=c[1].split(":");if(p.length>=2){let d=`${p[0]}:${p[1]}`;n.some(f=>`${f.groupId}:${f.artifactId}`===d)||n.push({groupId:p[0],artifactId:p[1],version:p[2]??"",configuration:c[0].split(/\s/)[0]});}}let u=/(?:implementation|api)\s*(?:\(?\s*)?platform\s*\(\s*['"]([^'"]+)['"]\s*\)/g;for(;(c=u.exec(t))!==null;){let p=c[1].split(":");p.length>=2&&n.push({groupId:p[0],artifactId:p[1],version:p[2]??"",configuration:"platform"});}return {javaVersion:s,dependencies:n,projectName:r}}function Ic(t){let e=t.trim();if(!e||e.includes("$")||/(?:[-.](?:SNAPSHOT|alpha|beta|rc|M\d+|CR\d+))/i.test(e))return null;e=e.replace(/\.(?:RELEASE|Final|GA)$/i,"");let n=e.split(".");for(;n.length<3;)n.push("0");return e=n.slice(0,3).join("."),gt.valid(e)}var wo=new Set(["pom.xml","build.gradle","build.gradle.kts"]);async function _c(t,e,n,r,s=Ee){let o=n?await n.findFiles(t,u=>wo.has(u)):await Fc(t),a=new Map;for(let u of o){let p=_.dirname(u);a.has(p)||a.set(p,[]),a.get(p).push(u);}let i=[],c=r??n?.projectScanTimeout??18e4;for(let[u,p]of a)try{let d=Oc(u,p,t,e,n,s),f=await Se(d,c);if(f.ok)i.push(f.value);else {let g=_.relative(t,u);n&&n.addStuckPath(g||"."),console.error(`Timeout scanning Java project ${u} (>${c/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(d){let f=d instanceof Error?d.message:String(d);console.error(`Error scanning Java project ${u}: ${f}`);}let l=new Map;for(let u of i)l.set(u.name,u.path);return i}async function Fc(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>wo.has(n))}async function Oc(t,e,n,r,s,o$1){let a=_.relative(n,t)||".",i=_.basename(t===n?n:t),c,l=new Map,u=[];for(let S of e){let w=_.basename(S),x=s?await s.readTextFile(S):await o(S);if(w==="pom.xml"){let m=Nc(x,S);m.artifactId&&(i=m.artifactId),m.javaVersion&&(c=m.javaVersion);for(let P of m.dependencies){let L=`${P.groupId}:${P.artifactId}`;!l.has(L)&&P.version&&!P.version.includes("${")&&l.set(L,P);}for(let P of m.modules)u.push({path:_.join(a,P),name:P,refType:"project"});}else if(w==="build.gradle"||w==="build.gradle.kts"){let m=Rc(x,S);m.projectName&&(i=m.projectName),m.javaVersion&&(c=m.javaVersion);for(let P of m.dependencies){let L=`${P.groupId}:${P.artifactId}`;!l.has(L)&&P.version&&l.set(L,P);}}}let p,d,f,g=Yn(o$1,"java")?.major,h=g!==void 0?String(g):void 0;if(c){let S=c.match(/^(1\.)?(\d+)/);if(S){let x=(S[1],parseInt(S[2],10));g!==void 0&&(p=Math.max(0,g-x));}d=rt(o$1,"java",c);let w=Ke("java",c);w&&(f=st(o$1,"java",w));}let y=[],j=[],C={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},T=[...l.entries()].map(async([S,w])=>{let x=await r.get(w.groupId,w.artifactId);return {key:S,dep:w,meta:x}}),v=await Promise.all(T);for(let{key:S,dep:w,meta:x}of v){let m=Ic(w.version),P=x.latestStableOverall,L=null,D="unknown";if(m&&P){let ce=gt.major(m);L=gt.major(P)-ce,L===0?D=gt.eq(m,P)?"current":"minor-behind":L>0?D="major-behind":D="current",L<=0?C.current++:L===1?C.oneBehind++:C.twoPlusBehind++;}else C.unknown++;y.push({package:S,section:"dependencies",currentSpec:w.version,resolvedVersion:m,latestStable:P,majorsBehind:L,drift:D}),S in Wr&&j.push({name:Wr[S],currentVersion:m,latestVersion:P,majorsBehind:L});}y.sort((S,w)=>{let x={"major-behind":0,"minor-behind":1,current:2,unknown:3},m=(x[S.drift]??9)-(x[w.drift]??9);return m!==0?m:S.package.localeCompare(w.package)});let b;try{b=s?await s.countFilesUnder(n,t):void 0;}catch{}return {type:"java",path:a,name:i,runtime:c?`Java ${c}`:void 0,runtimeLatest:h,runtimeMajorsBehind:p,runtimeEol:d,runtimeEolDate:f,targetFramework:c?`Java ${c}`:void 0,frameworks:j,dependencies:y,dependencyAgeBuckets:C,projectReferences:u.length>0?u:void 0,fileCount:b}}var zr={rails:"Ruby on Rails",sinatra:"Sinatra",hanami:"Hanami",padrino:"Padrino",roda:"Roda",grape:"Grape",cuba:"Cuba",camping:"Camping",ramaze:"Ramaze","jsonapi-resources":"JSONAPI::Resources",active_model_serializers:"AMS",blueprinter:"Blueprinter",alba:"Alba","grape-entity":"Grape Entity",jbuilder:"Jbuilder",graphql:"GraphQL Ruby",activerecord:"ActiveRecord",sequel:"Sequel","rom-rb":"ROM",mongoid:"Mongoid",redis:"redis-rb",pg:"pg (PostgreSQL)",mysql2:"mysql2",sqlite3:"sqlite3",sidekiq:"Sidekiq",resque:"Resque",delayed_job:"Delayed Job",good_job:"GoodJob",solid_queue:"Solid Queue",que:"Que",rspec:"RSpec","rspec-rails":"RSpec Rails",minitest:"Minitest",capybara:"Capybara",factory_bot:"FactoryBot",factory_bot_rails:"FactoryBot Rails",faker:"Faker","shoulda-matchers":"Shoulda Matchers",vcr:"VCR",webmock:"WebMock",simplecov:"SimpleCov",cucumber:"Cucumber",devise:"Devise",omniauth:"OmniAuth",pundit:"Pundit",cancancan:"CanCanCan",rodauth:"Rodauth",jwt:"JWT",doorkeeper:"Doorkeeper","turbo-rails":"Turbo","stimulus-rails":"Stimulus","importmap-rails":"Importmap Rails",sprockets:"Sprockets",webpacker:"Webpacker","cssbundling-rails":"CSS Bundling","jsbundling-rails":"JS Bundling","tailwindcss-rails":"Tailwind CSS Rails",propshaft:"Propshaft",faraday:"Faraday",httparty:"HTTParty","rest-client":"REST Client",typhoeus:"Typhoeus",httpx:"HTTPX",puma:"Puma",unicorn:"Unicorn",thin:"Thin",passenger:"Passenger",falcon:"Falcon",capistrano:"Capistrano",kamal:"Kamal",mina:"Mina","sentry-ruby":"Sentry","sentry-rails":"Sentry Rails",newrelic_rpm:"New Relic",datadog:"Datadog",lograge:"Lograge",rubocop:"RuboCop","rubocop-rails":"RuboCop Rails","rubocop-rspec":"RuboCop RSpec","rubocop-performance":"RuboCop Performance",brakeman:"Brakeman","bundler-audit":"Bundler Audit",standard:"Standard",kaminari:"Kaminari",pagy:"Pagy",ransack:"Ransack",searchkick:"Searchkick","elasticsearch-rails":"Elasticsearch Rails",carrierwave:"CarrierWave",shrine:"Shrine",active_storage:"Active Storage",activeadmin:"ActiveAdmin",administrate:"Administrate",avo:"Avo",aasm:"AASM",statesman:"Statesman",dotenv:"dotenv",figaro:"Figaro"};function Bc(t){let e=t.trim();if(!e||e.startsWith("#"))return null;let n=e.match(/^\s*gem\s+['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"])?/);if(!n)return null;let r=n[1],s=n[2]??"*";return {name:r,spec:s}}function Dc(t){if(t==="*")return null;let e=t.match(/(?:~>|>=|>|=|<=|<)?\s*(\d+(?:\.\d+)*)/);return e?e[1]:null}function Vc(t){let e=t.trim();if(/(?:\.pre|\.rc|\.beta|\.alpha|\.dev)/i.test(e))return null;let n=e.split(".");if(n.length<2)return null;for(;n.length<3;)n.push("0");let r=n.slice(0,3).join(".");return yt.valid(r)}function Uc(t){let e=[],n="default",r=[];for(let s of t.split(/\r?\n/)){let o=s.trim(),a=o.match(/^\s*group\s+:(\w+)/);if(a){r.push(n);let u=a[1].toLowerCase();u==="development"||u==="dev"?n="development":u==="test"&&(n="test");}if(o==="end"&&r.length>0){n=r.pop();continue}let i=Bc(o);if(!i)continue;let c=n,l=o.match(/group:\s*(?::(\w+)|\[([^\]]+)\])/);if(l){let u=(l[1]??l[2]??"").toLowerCase();u.includes("development")||u.includes("dev")?c="development":u.includes("test")&&(c="test");}e.push({name:i.name,spec:i.spec,group:c});}return e}function qc(t){let e=[];for(let n of t.split(/\r?\n/)){let s=n.trim().match(/\.add_(runtime_|development_)?dependency\s+['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"])?/);if(!s)continue;let o=s[1]??"runtime_",a=s[2],i=s[3]??"*";e.push({name:a,spec:i,group:o.startsWith("development")?"development":"default"});}return e}function Gc(t){return t.match(/^\s*ruby\s+['"]([^'"]+)['"]/m)?.[1]}var So=new Set(["Gemfile"]);function xs(t){return t.endsWith(".gemspec")}async function Hc(t,e,n,r,s=Ee){let o=n?await n.findFiles(t,l=>So.has(l)||xs(l)):await Wc(t),a=new Map;for(let l of o){let u=_.dirname(l);a.has(u)||a.set(u,[]),a.get(u).push(l);}let i=[],c=r??n?.projectScanTimeout??18e4;for(let[l,u]of a)try{let p=zc(l,u,t,e,n,s),d=await Se(p,c);if(d.ok)i.push(d.value);else {let f=_.relative(t,l);n&&n.addStuckPath(f||"."),console.error(`Timeout scanning Ruby project ${l} (>${c/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(p){let d=p instanceof Error?p.message:String(p);console.error(`Error scanning Ruby project ${l}: ${d}`);}return i}async function Wc(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>So.has(n)||xs(n))}async function zc(t,e,n,r,s,o$1){let a=_.relative(n,t)||".",i=_.basename(t===n?n:t),c,l=new Map;for(let v of e){let b=_.basename(v),S=s?await s.readTextFile(v):await o(v);if(b==="Gemfile"){let w=Gc(S);w&&(c=w);for(let x of Uc(S))l.has(x.name)||l.set(x.name,x);}else if(xs(b)){let w=b.replace(/\.gemspec$/,"");w&&(i=w);for(let x of qc(S))l.has(x.name)||l.set(x.name,x);}}let u,p,d,f;if(c){let v=c.match(/(\d+)\.(\d+)/);if(v){let S=parseInt(v[1],10),w=parseInt(v[2],10),x=Ht(o$1,"ruby");x&&(S===x.major?u=Math.max(0,x.minor-w):S<x.major&&(u=x.minor+(x.major-S)*10),p=`${x.major}.${x.minor}`);}d=rt(o$1,"ruby",c);let b=Ke("ruby",c);b&&(f=st(o$1,"ruby",b));}let g=[],h=[],y={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},C=[...l.values()].map(async v=>{let b=await r.get(v.name);return {dep:v,meta:b}}),A=await Promise.all(C);for(let{dep:v,meta:b}of A){let S=Dc(v.spec),w=S?Vc(S):null,x=b.latestStableOverall,m=null,P="unknown";if(w&&x){let D=yt.major(w);m=yt.major(x)-D,m===0?P=yt.eq(w,x)?"current":"minor-behind":m>0?P="major-behind":P="current",m<=0?y.current++:m===1?y.oneBehind++:y.twoPlusBehind++;}else y.unknown++;let L=v.group==="development"||v.group==="test"?"devDependencies":"dependencies";g.push({package:v.name,section:L,currentSpec:v.spec,resolvedVersion:w,latestStable:x,majorsBehind:m,drift:P}),v.name in zr&&h.push({name:zr[v.name],currentVersion:w,latestVersion:x,majorsBehind:m});}g.sort((v,b)=>{let S={"major-behind":0,"minor-behind":1,current:2,unknown:3},w=(S[v.drift]??9)-(S[b.drift]??9);return w!==0?w:v.package.localeCompare(b.package)});let T;try{T=s?await s.countFilesUnder(n,t):void 0;}catch{}return {type:"ruby",path:a,name:i,runtime:c,runtimeLatest:p,runtimeMajorsBehind:u,runtimeEol:d,runtimeEolDate:f,frameworks:h,dependencies:g,dependencyAgeBuckets:y,fileCount:T}}var Jr={vapor:"Vapor",hummingbird:"Hummingbird",perfect:"Perfect",kitura:"Kitura",alamofire:"Alamofire",moya:"Moya","apollo-ios":"Apollo iOS",fluent:"Fluent","sqlite.swift":"SQLite.swift","realm-swift":"Realm Swift","grdb.swift":"GRDB.swift",kingfisher:"Kingfisher",snapkit:"SnapKit",sdwebimage:"SDWebImage",rxswift:"RxSwift",combine:"Combine",reactiveswift:"ReactiveSwift",quick:"Quick",nimble:"Nimble",snapshotTesting:"SnapshotTesting",swiftlog:"SwiftLog",cocoalumberjack:"CocoaLumberjack",swinject:"Swinject",needle:"Needle",swiftyjson:"SwiftyJSON",promisekit:"PromiseKit",then:"Then"},ct={major:6,minor:0};function Jc(t){let e=[],n=/\.package\s*\(\s*url:\s*"([^"]+)"[^)]*?(from|exact|upToNextMajor|revision|branch):\s*"([^"]+)"/g,r;for(;(r=n.exec(t))!==null;){let s=r[1],o=r[2],a=r[3],c=s.match(/\/([^/]+?)(\.git)?$/)?.[1]??s,l="range",u=a;o==="exact"?l="exact":o==="branch"?l="branch":o==="revision"&&(l="revision"),e.push({name:c,url:s,version:u,type:l});}return e}function Kc(t){let e=new Map;try{let n=JSON.parse(t);if(!n.pins)return e;for(let r of n.pins)!r.identity||!r.state?.version||e.set(r.identity.toLowerCase(),r.state.version);}catch{}return e}function Qc(t){return t.match(/\/\/\s*swift-tools-version:\s*(\d+\.\d+)/i)?.[1]}var ko=new Set(["Package.swift"]);async function Yc(t,e,n,r){let s=n?await n.findFiles(t,i=>ko.has(i)):await Xc(t),o=[],a=r??n?.projectScanTimeout??18e4;for(let i of s){let c=_.dirname(i);try{let l=Zc(c,i,t,e,n),u=await Se(l,a);if(u.ok)o.push(u.value);else {let p=_.relative(t,c);n&&n.addStuckPath(p||"."),console.error(`Timeout scanning Swift project ${c} (>${a/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(l){let u=l instanceof Error?l.message:String(l);console.error(`Error scanning Swift project ${c}: ${u}`);}}return o}async function Xc(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>ko.has(n))}async function Zc(t,e,n,r,s){let o$1=_.relative(n,t)||".",a=_.basename(t===n?n:t),i=s?await s.readTextFile(e):await o(e),c=Qc(i),l=Jc(i),u=_.join(t,"Package.resolved"),p=new Map;try{let T=s?await s.readTextFile(u):await o(u);p=Kc(T);}catch{}let d,f;if(c){let T=c.match(/(\d+)\.(\d+)/);if(T){let v=parseInt(T[1],10),b=parseInt(T[2],10);v===ct.major?d=Math.max(0,ct.minor-b):v<ct.major&&(d=(ct.major-v)*10+ct.minor),f=`${ct.major}.${ct.minor}`;}}let g=[],h=[],y={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},j=l.map(async T=>{let v=await r.get(T.url);return {dep:T,meta:v}}),C=await Promise.all(j);for(let{dep:T,meta:v}of C){let b=p.get(T.name.toLowerCase())??(T.type==="exact"?T.version:null),S=b?xe.valid(xe.clean(b)):null,w=v.latestStableOverall,x=null,m="unknown";if(S&&w){let L=xe.major(S);x=xe.major(w)-L,x===0?m=xe.eq(S,w)?"current":"minor-behind":x>0?m="major-behind":m="current",x<=0?y.current++:x===1?y.oneBehind++:y.twoPlusBehind++;}else y.unknown++;g.push({package:T.name,section:"dependencies",currentSpec:T.version,resolvedVersion:S,latestStable:w,majorsBehind:x,drift:m});let P=T.name.toLowerCase();P in Jr&&h.push({name:Jr[P],currentVersion:S,latestVersion:w,majorsBehind:x});}g.sort((T,v)=>{let b={"major-behind":0,"minor-behind":1,current:2,unknown:3},S=(b[T.drift]??9)-(b[v.drift]??9);return S!==0?S:T.package.localeCompare(v.package)});let A;try{A=s?await s.countFilesUnder(n,t):void 0;}catch{}return {type:"swift",path:o$1,name:a,runtime:c,runtimeLatest:f,runtimeMajorsBehind:d,frameworks:h,dependencies:g,dependencyAgeBuckets:y,fileCount:A}}var Kr={"github.com/gin-gonic/gin":"Gin","github.com/labstack/echo":"Echo","github.com/gofiber/fiber":"Fiber","github.com/gorilla/mux":"Gorilla Mux","github.com/go-chi/chi":"Chi","github.com/beego/beego":"Beego","github.com/revel/revel":"Revel","k8s.io/kubernetes":"Kubernetes","k8s.io/client-go":"Kubernetes Client","github.com/prometheus/prometheus":"Prometheus","github.com/prometheus/client_golang":"Prometheus Client","go.etcd.io/etcd":"etcd","github.com/hashicorp/consul":"Consul","github.com/hashicorp/vault":"Vault","github.com/traefik/traefik":"Traefik","github.com/istio/istio":"Istio","gorm.io/gorm":"GORM","github.com/jmoiron/sqlx":"sqlx","github.com/go-sql-driver/mysql":"MySQL Driver","github.com/lib/pq":"PostgreSQL Driver","go.mongodb.org/mongo-driver":"MongoDB Driver","github.com/redis/go-redis":"Redis Client","github.com/go-redis/redis":"go-redis","google.golang.org/grpc":"gRPC","google.golang.org/protobuf":"Protobuf","github.com/grpc-ecosystem/grpc-gateway":"gRPC Gateway","github.com/stretchr/testify":"Testify","github.com/onsi/ginkgo":"Ginkgo","github.com/onsi/gomega":"Gomega","github.com/golang/mock":"GoMock","go.uber.org/zap":"Zap","github.com/sirupsen/logrus":"Logrus","github.com/rs/zerolog":"Zerolog","github.com/spf13/viper":"Viper","github.com/spf13/cobra":"Cobra","github.com/urfave/cli":"urfave/cli","github.com/go-resty/resty":"Resty","github.com/json-iterator/go":"jsoniter","gopkg.in/yaml.v3":"YAML v3","github.com/segmentio/kafka-go":"kafka-go","github.com/rabbitmq/amqp091-go":"RabbitMQ","github.com/nats-io/nats.go":"NATS","github.com/google/uuid":"UUID","github.com/spf13/cast":"Cast","github.com/pkg/errors":"pkg/errors"};function el(t){let e=[],n,r=false;for(let s of t.split(/\r?\n/)){let o=s.trim();if(o.startsWith("go ")){let l=o.match(/^go\s+(\d+\.\d+)/);l&&(n=l[1]);continue}if(o.startsWith("require (")){r=true;continue}if(o===")"&&r){r=false;continue}let a=o;if(r)a=o;else if(o.startsWith("require "))a=o.substring(8);else continue;let i=a.includes("// indirect");a=a.replace(/\/\/.*$/,"").trim();let c=a.split(/\s+/);if(c.length>=2){let[l,u]=c;l&&u&&e.push({path:l,version:u,indirect:i});}}return {goVersion:n,deps:e}}var Eo=new Set(["go.mod"]);async function tl(t,e,n,r,s=Ee){let o=n?await n.findFiles(t,c=>Eo.has(c)):await nl(t),a=[],i=r??n?.projectScanTimeout??18e4;for(let c of o){let l=_.dirname(c);try{let u=sl(l,c,t,e,n,s),p=await Se(u,i);if(p.ok)a.push(p.value);else {let d=_.relative(t,l);n&&n.addStuckPath(d||"."),console.error(`Timeout scanning Go project ${l} (>${i/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(u){let p=u instanceof Error?u.message:String(u);console.error(`Error scanning Go project ${l}: ${p}`);}}return a}async function nl(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>Eo.has(n))}async function sl(t,e,n,r,s,o$1){let a=_.relative(n,t)||".",i=_.basename(t===n?n:t),c=s?await s.readTextFile(e):await o(e),{goVersion:l,deps:u}=el(c),p=u.filter(b=>!b.indirect),d,f,g,h;if(l){let b=l.match(/(\d+)\.(\d+)/);if(b){let w=parseInt(b[1],10),x=parseInt(b[2],10),m=Ht(o$1,"go");m&&(w===m.major?d=Math.max(0,m.minor-x):w<m.major&&(d=m.minor+(m.major-w)*100),f=`${m.major}.${m.minor}`);}g=rt(o$1,"go",l);let S=Ke("go",l);S&&(h=st(o$1,"go",S));}let y=[],j=[],C={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},A=p.map(async b=>{let S=await r.get(b.path);return {dep:b,meta:S}}),T=await Promise.all(A);for(let{dep:b,meta:S}of T){let w=Te.valid(Te.clean(b.version)),x=S.latestStableOverall,m=null,P="unknown";if(w&&x){let L=Te.major(w);m=Te.major(x)-L,m===0?P=Te.eq(w,x)?"current":"minor-behind":m>0?P="major-behind":P="current",m<=0?C.current++:m===1?C.oneBehind++:C.twoPlusBehind++;}else C.unknown++;y.push({package:b.path,section:"dependencies",currentSpec:b.version,resolvedVersion:w,latestStable:x,majorsBehind:m,drift:P}),b.path in Kr&&j.push({name:Kr[b.path],currentVersion:w,latestVersion:x,majorsBehind:m});}y.sort((b,S)=>{let w={"major-behind":0,"minor-behind":1,current:2,unknown:3},x=(w[b.drift]??9)-(w[S.drift]??9);return x!==0?x:b.package.localeCompare(S.package)});let v;try{v=s?await s.countFilesUnder(n,t):void 0;}catch{}return {type:"go",path:a,name:i,runtime:l,runtimeLatest:f,runtimeMajorsBehind:d,runtimeEol:g,runtimeEolDate:h,frameworks:j,dependencies:y,dependencyAgeBuckets:C,fileCount:v}}var Qr={"actix-web":"Actix Web",rocket:"Rocket",axum:"Axum",warp:"Warp",tide:"Tide",poem:"Poem",tokio:"Tokio","async-std":"async-std",smol:"smol",serde:"Serde",serde_json:"Serde JSON",bincode:"Bincode",toml:"TOML",diesel:"Diesel",sqlx:"SQLx","sea-orm":"SeaORM",reqwest:"reqwest",hyper:"hyper",ureq:"ureq",clap:"clap",structopt:"structopt",log:"log",env_logger:"env_logger",tracing:"tracing","tracing-subscriber":"tracing-subscriber",anyhow:"anyhow",thiserror:"thiserror",eyre:"eyre",criterion:"Criterion",proptest:"proptest",mockall:"mockall",ring:"ring",rustls:"rustls",webpki:"webpki",bevy:"Bevy",wgpu:"wgpu",winit:"winit","wasm-bindgen":"wasm-bindgen","wasm-pack":"wasm-pack",substrate:"Substrate",ethers:"ethers-rs"};function rl(t){let e=[],n=null;for(let r of t.split(/\r?\n/)){let s=r.trim();if(s==="[dependencies]"){n="dependencies";continue}else if(s==="[dev-dependencies]"){n="dev-dependencies";continue}else if(s.startsWith("[")&&s.endsWith("]")){n=null;continue}if(!n)continue;let o=s.match(/^([\w-]+)\s*=\s*"([^"]+)"/);if(o){e.push({name:o[1],version:o[2],optional:false,features:[],isDev:n==="dev-dependencies"});continue}let a=s.match(/^([\w-]+)\s*=\s*\{([^}]+)\}/);if(a){let i=a[1],c=a[2],u=c.match(/version\s*=\s*"([^"]+)"/)?.[1]??"*",d=!!c.match(/optional\s*=\s*true/),f=c.match(/features\s*=\s*\[([^\]]*)\]/),g=f?f[1].split(",").map(h=>h.trim().replace(/"/g,"")):[];e.push({name:i,version:u,optional:d,features:g,isDev:n==="dev-dependencies"});}}return e}function ol(t){return t.match(/^\s*edition\s*=\s*"(\d+)"/m)?.[1]}var jo=new Set(["Cargo.toml"]);async function il(t,e,n,r){let s=n?await n.findFiles(t,i=>jo.has(i)):await al(t),o=[],a=r??n?.projectScanTimeout??18e4;for(let i of s){let c=_.dirname(i);try{let l=cl(c,i,t,e,n),u=await Se(l,a);if(u.ok)o.push(u.value);else {let p=_.relative(t,c);n&&n.addStuckPath(p||"."),console.error(`Timeout scanning Rust project ${c} (>${a/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(l){let u=l instanceof Error?l.message:String(l);console.error(`Error scanning Rust project ${c}: ${u}`);}}return o}async function al(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>jo.has(n))}async function cl(t,e,n,r,s){let o$1=_.relative(n,t)||".",a=_.basename(t===n?n:t),i=s?await s.readTextFile(e):await o(e),c=ol(i),u=rl(i).filter(A=>!A.isDev),p,d;if(c){let A=parseInt(c,10),T=2024;p=Math.max(0,Math.floor((T-A)/3)),d=T.toString();}let f=[],g=[],h={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},y=u.map(async A=>{let T=await r.get(A.name);return {dep:A,meta:T}}),j=await Promise.all(y);for(let{dep:A,meta:T}of j){let v=Ce.valid(Ce.coerce(A.version)),b=T.latestStableOverall,S=null,w="unknown";if(v&&b){let m=Ce.major(v);S=Ce.major(b)-m,S===0?w=Ce.eq(v,b)?"current":"minor-behind":S>0?w="major-behind":w="current",S<=0?h.current++:S===1?h.oneBehind++:h.twoPlusBehind++;}else h.unknown++;let x=A.isDev?"devDependencies":"dependencies";f.push({package:A.name,section:x,currentSpec:A.version,resolvedVersion:v,latestStable:b,majorsBehind:S,drift:w}),A.name in Qr&&g.push({name:Qr[A.name],currentVersion:v,latestVersion:b,majorsBehind:S});}f.sort((A,T)=>{let v={"major-behind":0,"minor-behind":1,current:2,unknown:3},b=(v[A.drift]??9)-(v[T.drift]??9);return b!==0?b:A.package.localeCompare(T.package)});let C;try{C=s?await s.countFilesUnder(n,t):void 0;}catch{}return {type:"rust",path:o$1,name:a,runtime:c,runtimeLatest:d,runtimeMajorsBehind:p,frameworks:g,dependencies:f,dependencyAgeBuckets:h,fileCount:C}}var Yr={"laravel/framework":"Laravel","symfony/symfony":"Symfony","symfony/http-foundation":"Symfony HttpFoundation","cakephp/cakephp":"CakePHP","yiisoft/yii2":"Yii 2","codeigniter4/framework":"CodeIgniter","slim/slim":"Slim","laminas/laminas-mvc":"Laminas","roots/wordpress":"WordPress","johnpbloch/wordpress":"WordPress Core","doctrine/orm":"Doctrine ORM","doctrine/dbal":"Doctrine DBAL","illuminate/database":"Laravel Eloquent","propel/propel":"Propel","phpunit/phpunit":"PHPUnit","pestphp/pest":"Pest","behat/behat":"Behat","codeception/codeception":"Codeception","mockery/mockery":"Mockery","guzzlehttp/guzzle":"Guzzle","symfony/http-client":"Symfony HttpClient","twig/twig":"Twig","smarty/smarty":"Smarty","league/plates":"Plates","firebase/php-jwt":"PHP-JWT","lcobucci/jwt":"JWT","league/fractal":"Fractal","api-platform/core":"API Platform","symfony/console":"Symfony Console","monolog/monolog":"Monolog","nesbot/carbon":"Carbon","ramsey/uuid":"UUID","vlucas/phpdotenv":"PHP dotenv","phpstan/phpstan":"PHPStan","vimeo/psalm":"Psalm","friendsofphp/php-cs-fixer":"PHP CS Fixer","squizlabs/php_codesniffer":"PHP_CodeSniffer"},lt={major:8,minor:4};async function ll(t,e){let n$1=e?await e.readJsonFile(t):await n(t),r=[],s;if(n$1.require?.php&&(s=n$1.require.php),n$1.require&&typeof n$1.require=="object")for(let[o,a]of Object.entries(n$1.require))o==="php"||o.startsWith("ext-")||r.push({name:o,version:String(a),isDev:false});if(n$1["require-dev"]&&typeof n$1["require-dev"]=="object")for(let[o,a]of Object.entries(n$1["require-dev"]))o==="php"||o.startsWith("ext-")||r.push({name:o,version:String(a),isDev:true});return {phpVersion:s,deps:r}}async function ul(t,e){let n$1=new Map;try{let r=e?await e.readJsonFile(t):await n(t);for(let s of r.packages??[])s.name&&s.version&&n$1.set(s.name,s.version);for(let s of r["packages-dev"]??[])s.name&&s.version&&n$1.set(s.name,s.version);}catch{}return n$1}function pl(t){return t.match(/(\d+)\.(\d+)/)?.[0]}var xo=new Set(["composer.json"]);async function dl(t,e,n,r){let s=n?await n.findFiles(t,i=>xo.has(i)):await fl(t),o=[],a=r??n?.projectScanTimeout??18e4;for(let i of s){let c=_.dirname(i);try{let l=hl(c,i,t,e,n),u=await Se(l,a);if(u.ok)o.push(u.value);else {let p=_.relative(t,c);n&&n.addStuckPath(p||"."),console.error(`Timeout scanning PHP project ${c} (>${a/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(l){let u=l instanceof Error?l.message:String(l);console.error(`Error scanning PHP project ${c}: ${u}`);}}return o}async function fl(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>xo.has(n))}async function hl(t,e,n,r,s){let o=_.relative(n,t)||".",a=_.basename(t===n?n:t),{phpVersion:i,deps:c}=await ll(e,s),l=_.join(t,"composer.lock"),u=new Map;try{u=await ul(l,s);}catch{}let p=c.filter(v=>!v.isDev),d,f,g;if(i&&(g=pl(i),g)){let v=g.match(/(\d+)\.(\d+)/);if(v){let b=parseInt(v[1],10),S=parseInt(v[2],10);b===lt.major?d=Math.max(0,lt.minor-S):b<lt.major&&(d=lt.minor+(lt.major-b)*10),f=`${lt.major}.${lt.minor}`;}}let h=[],y=[],j={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},C=p.map(async v=>{let b=await r.get(v.name);return {dep:v,meta:b}}),A=await Promise.all(C);for(let{dep:v,meta:b}of A){let S=u.get(v.name),w=S?Ae.valid(Ae.clean(S)):null,x=b.latestStableOverall,m=null,P="unknown";if(w&&x){let D=Ae.major(w);m=Ae.major(x)-D,m===0?P=Ae.eq(w,x)?"current":"minor-behind":m>0?P="major-behind":P="current",m<=0?j.current++:m===1?j.oneBehind++:j.twoPlusBehind++;}else j.unknown++;let L=v.isDev?"devDependencies":"dependencies";h.push({package:v.name,section:L,currentSpec:v.version,resolvedVersion:w,latestStable:x,majorsBehind:m,drift:P}),v.name in Yr&&y.push({name:Yr[v.name],currentVersion:w,latestVersion:x,majorsBehind:m});}h.sort((v,b)=>{let S={"major-behind":0,"minor-behind":1,current:2,unknown:3},w=(S[v.drift]??9)-(S[b.drift]??9);return w!==0?w:v.package.localeCompare(b.package)});let T;try{T=s?await s.countFilesUnder(n,t):void 0;}catch{}return {type:"php",path:o,name:a,runtime:g,runtimeLatest:f,runtimeMajorsBehind:d,frameworks:y,dependencies:h,dependencyAgeBuckets:j,fileCount:T}}var Xr={flutter:"Flutter SDK",flutter_test:"Flutter Test",provider:"Provider",riverpod:"Riverpod",flutter_riverpod:"Flutter Riverpod",bloc:"BLoC",flutter_bloc:"Flutter BLoC",get:"GetX",mobx:"MobX",redux:"Redux",go_router:"GoRouter",auto_route:"AutoRoute",http:"http",dio:"Dio",retrofit:"Retrofit",graphql_flutter:"GraphQL Flutter",sqflite:"SQFlite",hive:"Hive",isar:"Isar",drift:"Drift",firebase_core:"Firebase Core",cloud_firestore:"Cloud Firestore",flutter_svg:"Flutter SVG",cached_network_image:"Cached Network Image",shimmer:"Shimmer",lottie:"Lottie",flutter_staggered_grid_view:"Staggered Grid View",mockito:"Mockito",mocktail:"Mocktail",integration_test:"Integration Test",test:"Test",intl:"Intl",shared_preferences:"Shared Preferences",path_provider:"Path Provider",package_info_plus:"Package Info Plus",url_launcher:"URL Launcher",image_picker:"Image Picker",json_serializable:"JSON Serializable",freezed:"Freezed",built_value:"Built Value",logger:"Logger",sentry_flutter:"Sentry Flutter",firebase_crashlytics:"Firebase Crashlytics",build_runner:"Build Runner",injectable:"Injectable",flutter_lints:"Flutter Lints",lint:"Lint"},ut={major:3,minor:6};function ml(t){let e=[],n,r=null;for(let s of t.split(/\r?\n/)){let o=s.trim();if(o.startsWith("sdk:")){let i=o.match(/sdk:\s*['"]?>?=?\s*(\d[^<'"]*)/);i&&(n=i[1].trim());continue}if(o==="dependencies:"){r="dependencies";continue}else if(o==="dev_dependencies:"){r="dev_dependencies";continue}else if(/^\w+:/.test(s)){r=null;continue}if(!r)continue;let a=o.match(/^([\w_]+):\s*([^\s{]+)/);if(a){let i=a[1],c=a[2];if(c==="sdk:"||o.includes("sdk: flutter"))continue;e.push({name:i,version:c,isDev:r==="dev_dependencies"});}}return {dartVersion:n,deps:e}}async function gl(t,e){let n=new Map;try{let r=e?await e.readTextFile(t):await o(t),s=null;for(let o of r.split(/\r?\n/)){let a=o.trim(),i=o.match(/^ {2}(\w+):$/);if(i){s=i[1];continue}if(s&&a.startsWith("version:")){let c=a.match(/version:\s*"?([^"]+)"?/);c&&(n.set(s,c[1]),s=null);}}}catch{}return n}function yl(t){return t.match(/(\d+\.\d+\.\d+)/)?.[0]}var To=new Set(["pubspec.yaml"]);async function bl(t,e,n,r){let s=n?await n.findFiles(t,i=>To.has(i)):await vl(t),o=[],a=r??n?.projectScanTimeout??18e4;for(let i of s){let c=_.dirname(i);try{let l=wl(c,i,t,e,n),u=await Se(l,a);if(u.ok)o.push(u.value);else {let p=_.relative(t,c);n&&n.addStuckPath(p||"."),console.error(`Timeout scanning Dart project ${c} (>${a/1e3}s) \u2014 skipped`),n?.shouldShowTimeoutHint()&&console.error(" Tip: increase projectScanTimeout in vibgrate.config.ts (or --project-scan-timeout <seconds>) for large projects");}}catch(l){let u=l instanceof Error?l.message:String(l);console.error(`Error scanning Dart project ${c}: ${u}`);}}return o}async function vl(t){let{findFiles:e}=await import('./fs-PXXYZATK-ZP2RBR47.js');return e(t,n=>To.has(n))}async function wl(t,e,n,r,s){let o$1=_.relative(n,t)||".",a=_.basename(t===n?n:t),i=s?await s.readTextFile(e):await o(e),{dartVersion:c,deps:l}=ml(i),u=_.join(t,"pubspec.lock"),p=new Map;try{p=await gl(u,s);}catch{}let d=l.filter(b=>!b.isDev),f,g,h;if(c&&(h=yl(c),h)){let b=h.match(/(\d+)\.(\d+)/);if(b){let S=parseInt(b[1],10),w=parseInt(b[2],10);S===ut.major?f=Math.max(0,ut.minor-w):S<ut.major&&(f=ut.minor+(ut.major-S)*10),g=`${ut.major}.${ut.minor}`;}}let y=[],j=[],C={current:0,oneBehind:0,twoPlusBehind:0,unknown:0},A=d.map(async b=>{let S=await r.get(b.name);return {dep:b,meta:S}}),T=await Promise.all(A);for(let{dep:b,meta:S}of T){let w=p.get(b.name),x=w?Pe.valid(Pe.clean(w)):null,m=S.latestStableOverall,P=null,L="unknown";if(x&&m){let ce=Pe.major(x);P=Pe.major(m)-ce,P===0?L=Pe.eq(x,m)?"current":"minor-behind":P>0?L="major-behind":L="current",P<=0?C.current++:P===1?C.oneBehind++:C.twoPlusBehind++;}else C.unknown++;let D=b.isDev?"devDependencies":"dependencies";y.push({package:b.name,section:D,currentSpec:b.version,resolvedVersion:x,latestStable:m,majorsBehind:P,drift:L}),b.name in Xr&&j.push({name:Xr[b.name],currentVersion:x,latestVersion:m,majorsBehind:P});}y.sort((b,S)=>{let w={"major-behind":0,"minor-behind":1,current:2,unknown:3},x=(w[b.drift]??9)-(w[S.drift]??9);return x!==0?x:b.package.localeCompare(S.package)});let v;try{v=s?await s.countFilesUnder(n,t):void 0;}catch{}return {type:"dart",path:o$1,name:a,runtime:h,runtimeLatest:g,runtimeMajorsBehind:f,frameworks:j,dependencies:y,dependencyAgeBuckets:C,fileCount:v}}var Sl="https://hex.pm/api",kl=1e4,El=10;async function jl(t,e,n,r=false){let s=H(e,"hex",t);if(s?.latest)return s.latest;if(r)return null;let o=async()=>{try{let a=new AbortController,i=setTimeout(()=>a.abort(),kl),c=`${Sl}/packages/${t}`,l=await fetch(c,{signal:a.signal,headers:{"User-Agent":"vibgrate-cli"}});if(clearTimeout(i),!l.ok)return null;let p=(await l.json()).releases;if(!p||p.length===0)return null;let d=p.filter(f=>!f.retired).map(f=>f.version).filter(f=>{try{return new Dn.SemVer(f).prerelease.length===0}catch{return !1}});return d.length===0?null:(d.sort((f,g)=>{try{return (0,Dn.gt)(f,g)?-1:1}catch{return 0}}),d[0])}catch(a){return a?.name==="AbortError",null}};return n?n.run(o):o()}async function xl(t,e,n=false){let r=new Map,s=new a$1(El),o=t.map(async a=>{let i=await jl(a,e,s,n);i&&r.set(a,i);});return await Promise.all(o),r}var Tl=new Set(["mix.exs"]),Cl=new Set(["phoenix","phoenix_live_view","phoenix_html","phoenix_ecto","phoenix_pubsub","ecto","ecto_sql","plug","plug_cowboy","cowboy","ranch","absinthe","absinthe_plug","guardian","comeonin","bcrypt_elixir","argon2_elixir","pbkdf2_elixir","ex_machina","mock","mox","excoveralls","credo","dialyxir","ex_doc","jason","poison","httpoison","tesla","finch","mint","hackney","timex","quantum","oban","broadway","gen_stage","flow","bamboo","swoosh","ex_aws","ex_aws_s3","redix","cachex","nebulex","floki","wallaby","hound"]);async function Al(t,e){let n=e?await e.readTextFile(t):await o(t),r=[],s,o$1=n.match(/elixir:\s*"([^"]+)"/);o$1&&(s=o$1[1]);let a=/\{\s*:(\w+)\s*,\s*"([^"]+)"(?:,\s*(?:only|optional|runtime):\s*:(\w+))?\s*\}/g,i;for(;(i=a.exec(n))!==null;){let l=i[1],u=i[2],p=i[3];r.push({name:l,version:u,isDev:p==="dev"||p==="test"});}let c=/\{\s*:(\w+)\s*,\s*git:\s*"[^"]+"/g;for(;(i=c.exec(n))!==null;){i[1];}return {elixirVersion:s,deps:r}}async function Pl(t,e){let n=new Map;try{let r=e?await e.readTextFile(t):await o(t),s=/"(\w+)":\s*\{\s*:hex\s*,\s*:\w+\s*,\s*"([^"]+)"/g,o$1;for(;(o$1=s.exec(r))!==null;){let a=o$1[1],i=o$1[2];n.set(a,i);}}catch{}return n}function Ml(t,e){try{let n=t.replace(/^[~><=\s]+/,""),r=(0,me.minVersion)((0,me.validRange)(n)||n);if(!r)return "unknown";if(!(0,me.gt)(e,r.version))return "current";let s=(0,me.minVersion)(e);return s?s.major>r.major?"major-behind":"minor-behind":"unknown"}catch{return "unknown"}}async function $l(t,e,n,r=false){let s=`${t}/mix.exs`;if(!(e?await e.pathExists(s):await p(s)))return null;let{elixirVersion:a,deps:i}=await Al(s,e),c=`${t}/mix.lock`,l=await Pl(c,e),u=i.filter(y=>!y.isDev),p$1=u.map(y=>y.name),d=await xl(p$1,n,r),f=[],g=[],h={current:0,oneBehind:0,twoPlusBehind:0,unknown:0};for(let y of u){let j=l.get(y.name),C=j||y.version,A=d.get(y.name),T=A?Ml(C,A):"unknown",v=null;if(j&&A)try{let b=(0,me.minVersion)((0,me.validRange)(C)||C),S=(0,me.minVersion)((0,me.validRange)(A)||A);b&&S&&(v=S.major-b.major);}catch{}f.push({package:y.name,section:y.isDev?"devDependencies":"dependencies",currentSpec:y.version,resolvedVersion:j||null,latestStable:A||null,majorsBehind:v,drift:T}),T==="current"?h.current++:v===1?h.oneBehind++:v&&v>1?h.twoPlusBehind++:h.unknown++,Cl.has(y.name)&&g.push({name:y.name,currentVersion:j||null,latestVersion:A||null,majorsBehind:v});}return {type:"elixir",path:_.relative(t.includes("/")?t.split("/").slice(0,-1).join("/"):".",t)||".",name:_.basename(t),runtime:a,frameworks:g,dependencies:f,dependencyAgeBuckets:h}}async function Ll(t,e,n,r,s=false){let o=n?await n.findFiles(t,c=>Tl.has(c)):[],a=new Map;for(let c of o){let l=_.dirname(c);a.has(l)||a.set(l,[]),a.get(l).push(c);}let i=[];for(let[c]of a)try{let l=await $l(c,n,e,s);l&&(l.path=_.relative(t,c)||".",i.push(l));}catch(l){console.error(`Error scanning Elixir project at ${c}:`,l);}return i}var Nl="https://hub.docker.com/v2",Rl=1e4,Il=10;function Ts(t){let e,n,r,s,[o,a]=t.split(":");s=a;let i=o.split("/");return i.length>1&&(i[0].includes(".")||i[0]==="localhost")?(e=i[0],i.length===3?(n=i[1],r=i[2]):r=i[1]):i.length===2?(n=i[0],r=i[1]):r=o,{registry:e,namespace:n,image:r,tag:s}}async function _l(t,e,n){let r=async()=>{try{let s=new AbortController,o=setTimeout(()=>s.abort(),Rl),a=`${Nl}/repositories/${t}/${e}/tags?page_size=100`,i=await fetch(a,{signal:s.signal,headers:{"User-Agent":"vibgrate-cli"}});return clearTimeout(o),i.ok?((await i.json()).results||[]).map(u=>u.name):[]}catch(s){return s?.name==="AbortError"?[]:[]}};return n?n.run(r):r()}function Fl(t){let e=[];for(let n of t){if(["latest","master","main","stable","edge","dev"].includes(n))continue;let r=n.replace(/^v/,""),s=r.indexOf("-");s>0&&(r=r.substring(0,s));try{let o=new Vn.SemVer(r);o.prerelease.length===0&&e.push(o);}catch{}}return e.length===0?null:(e.sort((n,r)=>(0, Vn.gt)(n.version,r.version)?-1:1),e[0].version)}async function Ol(t,e,n,r=false){let s=Ts(t),o=`${s.namespace||"library"}/${s.image}`,a=H(e,"docker",o);if(a?.latest)return a.latest;if(r||s.registry&&s.registry!=="docker.io")return null;let i=s.namespace||"library",c=await _l(i,s.image,n);return Fl(c)}async function Bl(t,e,n=false){let r=new Map,s=new a$1(Il),o=t.map(async a=>{let i=await Ol(a,e,s,n);i&&r.set(a,i);});return await Promise.all(o),r}var Dl=new Set(["Dockerfile","docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"]);async function Vl(t,e){let n=e?await e.readTextFile(t):await o(t),r=[],s=/^FROM\s+(?:--platform=[^\s]+\s+)?([^\s]+)/gm,o$1;for(;(o$1=s.exec(n))!==null;){let a=o$1[1];if(a==="scratch")continue;let i=Ts(a);r.push({name:`${i.namespace||"library"}/${i.image}`,currentTag:i.tag||"latest"});}return r}async function Ul(t,e){let n=e?await e.readTextFile(t):await o(t),r=[],s=/^\s*image:\s*([^\s#]+)/gm,o$1;for(;(o$1=s.exec(n))!==null;){let a=o$1[1].trim().replace(/["']/g,""),i=Ts(a);r.push({name:`${i.namespace||"library"}/${i.image}`,currentTag:i.tag||"latest"});}return r}function ql(t,e){try{if(t==="latest"||t==="stable")return "current";let n=t.replace(/^v/,""),r=n.indexOf("-");r>0&&(n=n.substring(0,r));let s=new bt.SemVer(n),o=new bt.SemVer(e);return (0,bt.gt)(o.version,s.version)?o.major>s.major?"major-behind":"minor-behind":"current"}catch{return "unknown"}}async function Gl(t,e,n,r=false){let s=[],o=`${t}/Dockerfile`;if(e?await e.pathExists(o):await p(o)){let f=await Vl(o,e);s.push(...f);}let i=["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"];for(let f of i){let g=`${t}/${f}`;if(e?await e.pathExists(g):await p(g)){let y=await Ul(g,e);s.push(...y);break}}if(s.length===0)return null;let c=new Map;for(let f of s)c.has(f.name)||c.set(f.name,f.currentTag);let l=Array.from(c.keys()),u=await Bl(l,n,r),p$1=[],d={current:0,oneBehind:0,twoPlusBehind:0,unknown:0};for(let f of l){let g=c.get(f),h=u.get(f),y=h?ql(g,h):"unknown",j=null;if(h)try{let C=g.replace(/^v/,"").split("-")[0],A=new bt.SemVer(C);j=new bt.SemVer(h).major-A.major;}catch{}p$1.push({package:f,section:"dependencies",currentSpec:g,resolvedVersion:g,latestStable:h||null,majorsBehind:j,drift:y}),y==="current"?d.current++:j===1?d.oneBehind++:j&&j>1?d.twoPlusBehind++:d.unknown++;}return {type:"docker",path:_.relative(t.includes("/")?t.split("/").slice(0,-1).join("/"):".",t)||".",name:_.basename(t),frameworks:[],dependencies:p$1,dependencyAgeBuckets:d}}async function Hl(t,e,n,r,s=false){let o=n?await n.findFiles(t,c=>Dl.has(c)):[],a=new Map;for(let c of o){let l=_.dirname(c);a.has(l)||a.set(l,[]),a.get(l).push(c);}let i=[];for(let[c]of a)try{let l=await Gl(c,n,e,s);l&&(l.path=_.relative(t,c)||".",i.push(l));}catch(l){console.error(`Error scanning Docker project at ${c}:`,l);}return i}var Wl="https://artifacthub.io/api/v1",zl=1e4,Jl=10;async function Kl(t,e,n,r,s=false){let o=e?`${e}/${t}`:t,a=H(n,"helm",o);if(a?.latest)return a.latest;if(s)return null;let i=async()=>{try{let c=new AbortController,l=setTimeout(()=>c.abort(),zl),u=`${Wl}/packages/search?kind=0&ts_query_web=${encodeURIComponent(t)}&limit=10`,p=await fetch(u,{signal:c.signal,headers:{"User-Agent":"vibgrate-cli"}});if(clearTimeout(l),!p.ok)return null;let f=(await p.json()).packages||[],g=f.find(h=>h.name===t);return e&&f.length>1&&(g=f.find(h=>h.name===t&&h.repository?.name===e)||g),g?g.version:null}catch(c){return c?.name==="AbortError",null}};return r?r.run(i):i()}async function Ql(t,e,n=false){let r=new Map,s=new a$1(Jl),o=t.map(async a=>{let i=await Kl(a.name,a.repo,e,s,n);if(i){let c=a.repo?`${a.repo}/${a.name}`:a.name;r.set(c,i);}});return await Promise.all(o),r}var Yl=new Set(["Chart.yaml","Chart.yml"]);async function Xl(t,e){let n=e?await e.readTextFile(t):await o(t),r=[],s,o$1,a,i=n.match(/^name:\s*(.+)$/m);i&&(s=i[1].trim().replace(/["']/g,""));let c=n.match(/^version:\s*(.+)$/m);c&&(o$1=c[1].trim().replace(/["']/g,""));let l=n.match(/^appVersion:\s*(.+)$/m);l&&(a=l[1].trim().replace(/["']/g,""));let u=n.match(/^dependencies:\s*$/m);if(u){let p=u.index+u[0].length,d=n.substring(p),f=/^\s*-\s+name:\s*(.+)$/gm,g;for(;(g=f.exec(d))!==null;){let h=g[1].trim().replace(/["']/g,""),y=g.index,j=f.exec(d),C=j?j.index:d.length;f.lastIndex=y+1;let A=d.substring(y,C),T=A.match(/version:\s*(.+)$/m),v=T?T[1].trim().replace(/["']/g,""):"*",b=A.match(/repository:\s*(.+)$/m),S=b?b[1].trim().replace(/["']/g,""):void 0,w=A.match(/condition:\s*(.+)$/m),x=w?w[1].trim().replace(/["']/g,""):void 0;r.push({name:h,version:v,repository:S,condition:x});}}return {chartName:s,chartVersion:o$1,appVersion:a,dependencies:r}}async function Zl(t,e){let n=new Map;try{let r=e?await e.readTextFile(t):await o(t),s=/^\s*-\s+name:\s*(.+)$/gm,o$1;for(;(o$1=s.exec(r))!==null;){let a=o$1[1].trim().replace(/["']/g,""),i=o$1.index,c=s.exec(r),l=c?c.index:r.length;s.lastIndex=i+1;let p=r.substring(i,l).match(/version:\s*(.+)$/m);if(p){let d=p[1].trim().replace(/["']/g,"");n.set(a,d);}}}catch{}return n}function eu(t,e){try{let n=t.replace(/^[~^><=\s]+/,""),r=(0,ge.minVersion)((0,ge.validRange)(n)||n);if(!r)return "unknown";if(!(0,ge.gt)(e,r.version))return "current";let s=(0,ge.minVersion)(e);return s?s.major>r.major?"major-behind":"minor-behind":"unknown"}catch{return "unknown"}}async function tu(t,e,n,r=false){let s=null;for(let h of ["Chart.yaml","Chart.yml"]){let y=`${t}/${h}`;if(e?await e.pathExists(y):await p(y)){s=y;break}}if(!s)return null;let{chartName:o,chartVersion:a,appVersion:i,dependencies:c}=await Xl(s,e),l=`${t}/Chart.lock`,u=await Zl(l,e),p$1=c.map(h=>({name:h.name,repo:h.repository})),d=await Ql(p$1,n,r),f=[],g={current:0,oneBehind:0,twoPlusBehind:0,unknown:0};for(let h of c){let y=u.get(h.name),j=y||h.version,C=h.repository?`${h.repository}/${h.name}`:h.name,A=d.get(C),T=A?eu(j,A):"unknown",v=null;if(A)try{let b=(0,ge.minVersion)((0,ge.validRange)(j)||j),S=(0,ge.minVersion)((0,ge.validRange)(A)||A);b&&S&&(v=S.major-b.major);}catch{}f.push({package:h.name,section:"dependencies",currentSpec:h.version,resolvedVersion:y||null,latestStable:A||null,majorsBehind:v,drift:T}),T==="current"?g.current++:v===1?g.oneBehind++:v&&v>1?g.twoPlusBehind++:g.unknown++;}return {type:"helm",path:_.relative(t.includes("/")?t.split("/").slice(0,-1).join("/"):".",t)||".",name:o||_.basename(t),runtime:i,frameworks:[],dependencies:f,dependencyAgeBuckets:g}}async function nu(t,e,n,r,s=false){let o=n?await n.findFiles(t,c=>Yl.has(c)):[],a=new Map;for(let c of o){let l=_.dirname(c);a.has(l)||a.set(l,[]),a.get(l).push(c);}let i=[];for(let[c]of a)try{let l=await tu(c,n,e,s);l&&(l.path=_.relative(t,c)||".",i.push(l));}catch(l){console.error(`Error scanning Helm chart at ${c}:`,l);}return i}var Co="https://registry.terraform.io/v1",Ao=1e4,su=10;async function ru(t,e,n,r,s=false){let o=`${t}/${e}`,a=H(n,"terraform",o);if(a?.latest)return a.latest;if(s)return null;let i=async()=>{try{let c=new AbortController,l=setTimeout(()=>c.abort(),Ao),u=`${Co}/providers/${t}/${e}/versions`,p=await fetch(u,{signal:c.signal,headers:{"User-Agent":"vibgrate-cli"}});if(clearTimeout(l),!p.ok)return null;let f=(await p.json()).versions||[];if(f.length===0)return null;let g=[];for(let h of f)try{let y=new Dt.SemVer(h.version);y.prerelease.length===0&&g.push(y);}catch{}return g.length===0?null:(g.sort((h,y)=>(0,Dt.gt)(h.version,y.version)?-1:1),g[0].version)}catch(c){return c?.name==="AbortError",null}};return r?r.run(i):i()}async function ou(t,e,n,r,s,o=false){let a=`${t}/${e}/${n}`,i=H(r,"terraform",a);if(i?.latest)return i.latest;if(o)return null;let c=async()=>{try{let l=new AbortController,u=setTimeout(()=>l.abort(),Ao),p=`${Co}/modules/${t}/${e}/${n}/versions`,d=await fetch(p,{signal:l.signal,headers:{"User-Agent":"vibgrate-cli"}});if(clearTimeout(u),!d.ok)return null;let g=(await d.json()).modules||[];if(g.length===0||!g[0].versions)return null;let h=g[0].versions,y=[];for(let j of h)try{let C=new Dt.SemVer(j.version);C.prerelease.length===0&&y.push(C);}catch{}return y.length===0?null:(y.sort((j,C)=>(0,Dt.gt)(j.version,C.version)?-1:1),y[0].version)}catch(l){return l?.name==="AbortError",null}};return s?s.run(c):c()}async function iu(t,e,n=false){let r=new Map,s=new a$1(su),o=t.map(async a=>{let i=null,c;a.type==="provider"?(c=`${a.namespace}/${a.name}`,i=await ru(a.namespace,a.name,e,s,n)):(c=`${a.namespace}/${a.name}/${a.provider}`,i=await ou(a.namespace,a.name,a.provider,e,s,n)),i&&r.set(c,i);});return await Promise.all(o),r}async function au(t,e){let n=e?await e.readTextFile(t):await o(t),r=[],s=[],o$1,a=n.match(/terraform\s*\{[^}]*required_version\s*=\s*"([^"]+)"/s);a&&(o$1=a[1]);let i=n.match(/required_providers\s*\{([^}]+)\}/s);if(i){let d=i[1],f=/(\w+)\s*=\s*\{([^}]+)\}/g,g;for(;(g=f.exec(d))!==null;){let h=g[2],y=h.match(/source\s*=\s*"([^"]+)"/);if(!y)continue;let j=y[1],C=h.match(/version\s*=\s*"([^"]+)"/),A=C?C[1]:void 0;r.push({source:j,version:A});}}let c=/provider\s+"(\w+)"\s*\{([^}]+)\}/g,l;for(;(l=c.exec(n))!==null;){let d=l[1],g=l[2].match(/version\s*=\s*"([^"]+)"/);g&&(r.find(y=>y.source.endsWith(`/${d}`))||r.push({source:`hashicorp/${d}`,version:g[1]}));}let u=/module\s+"[^"]+"\s*\{([^}]+)\}/g,p;for(;(p=u.exec(n))!==null;){let d=p[1],f=d.match(/source\s*=\s*"([^"]+)"/);if(!f)continue;let g=f[1];if(g.startsWith("./")||g.startsWith("../")||g.startsWith("git::"))continue;let h=d.match(/version\s*=\s*"([^"]+)"/),y=h?h[1]:void 0;s.push({source:g,version:y});}return {terraformVersion:o$1,providers:r,modules:s}}async function cu(t,e){let n=new Map;try{let r=e?await e.readTextFile(t):await o(t),s=/provider\s+"[^"]*\/([^/"]+\/[^/"]+)"\s*\{([^}]+)\}/g,o$1;for(;(o$1=s.exec(r))!==null;){let a=o$1[1],c=o$1[2].match(/version\s*=\s*"([^"]+)"/);c&&n.set(a,c[1]);}}catch{}return n}function Zr(t,e){try{let n=t.replace(/^[~><=\s]+/,""),r=(0,Y.minVersion)((0,Y.validRange)(n)||n);if(!r)return "unknown";if(!(0,Y.gt)(e,r.version))return "current";let s=(0,Y.minVersion)(e);return s?s.major>r.major?"major-behind":"minor-behind":"unknown"}catch{return "unknown"}}async function lu(t,e,n,r=false){let s=[];if(e){let y=await e.findFiles(t,j=>j.endsWith(".tf"));s.push(...y);}else {let y=["main.tf","variables.tf","outputs.tf","versions.tf","providers.tf"];for(let j of y){let C=`${t}/${j}`;await p(C)&&s.push(C);}}if(s.length===0)return null;let o,a=[],i=[];for(let y of s){let{terraformVersion:j,providers:C,modules:A}=await au(y,e);j&&!o&&(o=j),a.push(...C),i.push(...A);}let c=new Map;for(let y of a)c.has(y.source)||c.set(y.source,y.version);let l=new Map;for(let y of i)l.has(y.source)||l.set(y.source,y.version);let u=`${t}/.terraform.lock.hcl`,p$1=await cu(u,e),d=[];for(let[y]of c){let[j,C]=y.split("/");d.push({type:"provider",namespace:j,name:C});}for(let[y]of l){let j=y.split("/");if(j.length===3){let[C,A,T]=j;d.push({type:"module",namespace:C,name:A,provider:T});}}let f=await iu(d,n,r),g=[],h={current:0,oneBehind:0,twoPlusBehind:0,unknown:0};for(let[y,j]of c){let C=p$1.get(y),A=C||j||"unknown",T=f.get(y),v=T&&A!=="unknown"?Zr(A,T):"unknown",b=null;if(T&&A!=="unknown")try{let S=(0,Y.minVersion)((0,Y.validRange)(A)||A),w=(0,Y.minVersion)((0,Y.validRange)(T)||T);S&&w&&(b=w.major-S.major);}catch{}g.push({package:`provider:${y}`,section:"dependencies",currentSpec:j||"unknown",resolvedVersion:C||null,latestStable:T||null,majorsBehind:b,drift:v}),v==="current"?h.current++:b===1?h.oneBehind++:b&&b>1?h.twoPlusBehind++:h.unknown++;}for(let[y,j]of l){let C=j||"unknown",A=f.get(y),T=A&&C!=="unknown"?Zr(C,A):"unknown",v=null;if(A&&C!=="unknown")try{let b=(0,Y.minVersion)((0,Y.validRange)(C)||C),S=(0,Y.minVersion)((0,Y.validRange)(A)||A);b&&S&&(v=S.major-b.major);}catch{}g.push({package:`module:${y}`,section:"dependencies",currentSpec:j||"unknown",resolvedVersion:null,latestStable:A||null,majorsBehind:v,drift:T}),T==="current"?h.current++:v===1?h.oneBehind++:v&&v>1?h.twoPlusBehind++:h.unknown++;}return {type:"terraform",path:_.relative(t.includes("/")?t.split("/").slice(0,-1).join("/"):".",t)||".",name:_.basename(t),runtime:o,frameworks:[],dependencies:g,dependencyAgeBuckets:h}}async function uu(t,e,n,r,s=false){let o=n?await n.findFiles(t,c=>c.endsWith(".tf")):[],a=new Map;for(let c of o){let l=_.dirname(c);a.has(l)||a.set(l,[]),a.get(l).push(c);}let i=[];for(let[c]of a)try{let l=await lu(c,n,e,s);l&&(l.path=_.relative(t,c)||".",i.push(l));}catch(l){console.error(`Error scanning Terraform project at ${c}:`,l);}return i}var eo=[{name:"go.mod",type:"go"},{name:"Cargo.toml",type:"rust"},{name:"composer.json",type:"php"},{name:"Package.swift",type:"swift"},{name:"pubspec.yaml",type:"dart"},{name:"build.gradle.kts",type:"kotlin"},{name:"build.sbt",type:"scala"},{name:"DESCRIPTION",type:"r"},{name:"Podfile",type:"objective-c"},{name:"mix.exs",type:"elixir"},{name:"cpanfile",type:"perl"},{name:"Project.toml",type:"julia"},{name:"deps.edn",type:"clojure"},{name:"build.gradle",type:"groovy"},{name:"tsconfig.json",type:"typescript"},{name:"Makefile",type:"c"},{name:"CMakeLists.txt",type:"cpp"},{name:"*.vbp",type:"visual-basic"}],pu=[{extensions:[".m",".mm"],type:"objective-c"},{extensions:[".c",".h"],type:"c"},{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],type:"cpp"},{extensions:[".cob",".cbl",".cpy"],type:"cobol"},{extensions:[".f",".for",".f90",".f95",".f03",".f08"],type:"fortran"},{extensions:[".pas",".pp",".lpr"],type:"pascal"},{extensions:[".adb",".ads",".ada"],type:"ada"},{extensions:[".asm",".s",".s43",".s65"],type:"assembly"},{extensions:[".rpg",".rpgle",".sqlrpgle"],type:"rpg"}];function pt(t,e="unknown"){return {package:t,section:"dependencies",currentSpec:e,resolvedVersion:null,latestStable:null,majorsBehind:null,drift:"unknown"}}function _t(t,e,n=1){let r=new Set;for(let s of t.split(/\r?\n/)){let o=s.match(e);o?.[n]&&r.add(o[n]);}return [...r]}function du(t,e){return _.basename(t)||_.basename(e)}function fu(t){return /^\s*(CC|CFLAGS|LDFLAGS)\s*[:?+]?=/m.test(t)||/\b(gcc|clang)\b/.test(t)||/\.(c|o)\b/.test(t)}function ds(t,e,n,r,s,o=[]){let a=r||".",i=`${n}:${a}`;e.has(i)||(e.add(i),t.push({type:n,path:a,name:du(a,s),frameworks:[],dependencies:o,dependencyAgeBuckets:{current:0,oneBehind:0,twoPlusBehind:0,unknown:o.length}}));}async function hu(t,e){let n$1=_.basename(t),r=async()=>e?e.readTextFile(t):o(t);if(n$1==="composer.json"){let o=e?await e.readJsonFile(t):await n(t);if(!o||typeof o!="object")return [];let a=new Set;for(let i of ["require","require-dev"]){let c=o[i];if(c&&typeof c=="object")for(let l of Object.keys(c))a.add(l);}return [...a].map(i=>pt(i))}let s=await r();return s?n$1==="go.mod"?_t(s,/^\s*require\s+([^\s]+)\s+(.+)$/).map(o=>pt(o)):n$1==="Cargo.toml"?_t(s,/^\s*([A-Za-z0-9_\-]+)\s*=\s*['"{]/).map(o=>pt(o)):n$1==="pubspec.yaml"?_t(s,/^\s{2,}([A-Za-z0-9_\-]+):\s*.+$/).map(o=>pt(o)):n$1==="mix.exs"?_t(s,/\{\s*:([a-zA-Z0-9_]+),/).map(o=>pt(o)):n$1==="cpanfile"?_t(s,/^\s*requires\s+['"]([^'"]+)['"]/).map(o=>pt(o)):n$1==="build.sbt"?_t(s,/"([A-Za-z0-9_.\-]+)"\s*%{1,2}\s*"([A-Za-z0-9_.\-]+)"/,2).map(o=>pt(o)):[]:[]}function mu(t){let e=new Map;for(let n of t){if(!n.isFile)continue;let r=_.extname(n.name).toLowerCase();if(r)for(let s of pu){if(!s.extensions.includes(r))continue;let o=_.dirname(n.relPath)||".";e.has(o)||e.set(o,new Set),e.get(o)?.add(s.type);}}return e}async function gu(t,e){let n=e?await e.walkDir(t):[],r=n.filter(c=>c.isFile&&eo.some(l=>l.name===c.name||l.name.startsWith("*.")&&c.name.endsWith(l.name.slice(1)))),s=new Set(n.filter(c=>c.isFile&&c.name.endsWith(".sh")).map(c=>_.dirname(c.relPath)||".")),o$1=[],a=new Set;for(let c of r){let l=eo.find(d=>d.name===c.name||d.name.startsWith("*.")&&c.name.endsWith(d.name.slice(1)));if(!l)continue;if(c.name==="Makefile"){let d=e?await e.readTextFile(c.absPath):await o(c.absPath);if(!fu(d))continue}let u=_.dirname(c.relPath)||".",p=await hu(c.absPath,e);ds(o$1,a,l.type,u,t,p);}for(let c of s)ds(o$1,a,"shell",c,t);let i=mu(n);for(let[c,l]of i)for(let u of l)ds(o$1,a,u,c,t);return o$1}var yu=10,bu=1048576,vu=5,wu=20,Su=2621440,ku=10,Eu=30,ju=5242880,xu=25,vs=25,ws=10,Ss=3,mf=1;function fs(t,e,n,r){let s=0;return t.fileCount!==void 0&&t.fileCount>=1&&t.fileCount<e&&s++,t.sizeBytes!==void 0&&t.sizeBytes>0&&t.sizeBytes<n&&s++,t.dependencyCount!==void 0&&t.dependencyCount<r&&s++,s}function Tu(t){return fs(t,yu,bu,vu)>=2?"nano":fs(t,wu,Su,ku)>=2?"micro":fs(t,Eu,ju,xu)>=2?"small":"standard"}function Cu(t){switch(t){case "nano":return "nano";case "micro":case "function":return "micro";case "small":return "small";default:return "standard"}}function gf(t){switch(t){case "nano":return 1/vs;case "micro":return 1/ws;case "small":return 1/Ss;default:return 1}}function Au(t){let e=0,n=0,r=0,s=0;for(let a of t)switch(Cu(a.classification)){case "nano":e++;break;case "micro":n++;break;case "small":r++;break;default:s++;break}let o=s+r/Ss+n/ws+e/vs;return {nanoCount:e,microCount:n,smallCount:r,standardCount:s,totalScanned:e+n+r+s,nanoBillingRatio:vs,microBillingRatio:ws,smallBillingRatio:Ss,billableProjectsRaw:Math.round(o*100)/100,billableProjects:Math.floor(o)}}var Pu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;baseUrl="https://api.nuget.org/v3-flatcontainer";get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let r=H(this.manifest,"nuget",t);if(r){let s=(r.versions??[]).filter(i=>Me.valid(i)&&Me.prerelease(i)===null),a=[...s].sort(Me.rcompare)[0]??null;return {latest:r.latest??a,stableVersions:s,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let s=`${this.baseUrl}/${t.toLowerCase()}/index.json`,o=await fetch(s,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json"}});if(!o.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let c=((await o.json()).versions??[]).filter(p=>Me.valid(p)&&Me.prerelease(p)===null),u=[...c].sort(Me.rcompare)[0]??null;return {latest:u,stableVersions:c,latestStableOverall:u}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}};function Rn(t){let e=t.replace(/^[vV]/,"").trim();if(/(?:a|b|rc|alpha|beta|dev|post)\d*/i.test(e))return null;let n=e.split(".");for(;n.length<3;)n.push("0");return e=n.slice(0,3).join("."),an.valid(e)}var Mu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let r=H(this.manifest,"pypi",t);if(r){let s=[];for(let i of r.versions??[]){let c=Rn(i);c&&s.push(c);}let a=[...s].sort(an.rcompare)[0]??null;return {latest:r.latest?Rn(r.latest)??a:a,stableVersions:s,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let s=`https://pypi.org/pypi/${encodeURIComponent(t)}/json`,o=await fetch(s,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json"}});if(!o.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let a=await o.json(),i=Object.keys(a.releases??{}),c=[];for(let f of i){let g=Rn(f);g&&c.push(g);}let l=a.info?.version??null,u=l?Rn(l):null,d=[...c].sort(an.rcompare)[0]??u??null;return {latest:u??d,stableVersions:c,latestStableOverall:d}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}};function hs(t){let e=t.trim();if(/(?:[-.](?:SNAPSHOT|alpha|beta|rc|M\d+|CR\d+))/i.test(e))return null;e=e.replace(/\.(?:RELEASE|Final|GA)$/i,"");let n=e.split(".");for(;n.length<3;)n.push("0");return e=n.slice(0,3).join("."),cn.valid(e)}var $u=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t,e){let n=`${t}:${e}`,r=this.meta.get(n);if(r)return r;let s=this.sem.run(async()=>{let o=`${t}:${e}`,a=H(this.manifest,"maven",o);if(a){let i=[];for(let u of a.versions??[]){let p=hs(u);p&&i.push(p);}let l=[...i].sort(cn.rcompare)[0]??null;return {latest:a.latest?hs(a.latest)??l:l,stableVersions:i,latestStableOverall:l}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let i=`https://search.maven.org/solrsearch/select?q=g:%22${encodeURIComponent(t)}%22+AND+a:%22${encodeURIComponent(e)}%22&core=gav&rows=100&wt=json`,c=await fetch(i,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json"}});if(!c.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let p=((await c.json()).response?.docs??[]).map(h=>h.v).filter(h=>typeof h=="string"),d=[];for(let h of p){let y=hs(h);y&&d.push(y);}let g=[...d].sort(cn.rcompare)[0]??null;return {latest:g,stableVersions:d,latestStableOverall:g}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(n,s),s}};function ms(t){let e=t.trim();if(/(?:\.pre|\.rc|\.beta|\.alpha|\.dev)/i.test(e))return null;let n=e.split(".");if(n.length<2)return null;for(;n.length<3;)n.push("0");let r=n.slice(0,3).join(".");return ln.valid(r)}var Lu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let r=H(this.manifest,"rubygems",t);if(r){let s=[];for(let i of r.versions??[]){let c=ms(i);c&&s.push(c);}let a=[...s].sort(ln.rcompare)[0]??null;return {latest:r.latest?ms(r.latest)??a:a,stableVersions:s,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let s=`https://rubygems.org/api/v1/versions/${encodeURIComponent(t)}.json`,o=await fetch(s,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json"}});if(!o.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let a=await o.json();if(!Array.isArray(a))return {latest:null,stableVersions:[],latestStableOverall:null};let i=[];for(let u of a){if(u.prerelease)continue;let p=u.number;if(!p)continue;let d=ms(p);d&&i.push(d);}let l=[...i].sort(ln.rcompare)[0]??null;return {latest:l,stableVersions:i,latestStableOverall:l}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}},Nu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let r=H(this.manifest,"swift",t);if(r){let s=[];for(let i of r.versions??[]){let c=te.valid(te.clean(i));c&&s.push(c);}let a=[...s].sort(te.rcompare)[0]??null;return {latest:r.latest?te.valid(te.clean(r.latest))??a:a,stableVersions:s,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let s=t.match(/github\.com[/:]([^/]+\/[^/]+?)(\.git)?$/i);if(!s)return {latest:null,stableVersions:[],latestStableOverall:null};let o=s[1],a=`https://api.github.com/repos/${o}/releases`,i=await fetch(a,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/vnd.github+json","User-Agent":"vibgrate-cli"}});if(!i.ok)return this.fetchFromTags(o);let c=await i.json();if(!Array.isArray(c))return {latest:null,stableVersions:[],latestStableOverall:null};let l=[];for(let d of c){if(d.prerelease||d.draft)continue;let f=d.tag_name;if(!f)continue;let g=te.valid(te.clean(f));g&&l.push(g);}let p=[...l].sort(te.rcompare)[0]??null;return {latest:p,stableVersions:l,latestStableOverall:p}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}async fetchFromTags(t){try{let e=`https://api.github.com/repos/${t}/tags`,n=await fetch(e,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/vnd.github+json","User-Agent":"vibgrate-cli"}});if(!n.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let r=await n.json();if(!Array.isArray(r))return {latest:null,stableVersions:[],latestStableOverall:null};let s=[];for(let i of r){let c=i.name;if(!c||/(?:alpha|beta|rc|pre|dev)/i.test(c))continue;let l=te.valid(te.clean(c));l&&s.push(l);}let a=[...s].sort(te.rcompare)[0]??null;return {latest:a,stableVersions:s,latestStableOverall:a}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}}},Ru=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let r=H(this.manifest,"go",t);if(r){let s=[];for(let i of r.versions??[]){let c=pe.valid(pe.clean(i));c&&s.push(c);}let a=[...s].sort(pe.rcompare)[0]??null;return {latest:r.latest?pe.valid(pe.clean(r.latest))??a:a,stableVersions:s,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let o=`https://proxy.golang.org/${encodeURIComponent(t)}/@v/list`,a=await fetch(o,{signal:AbortSignal.timeout(1e4),headers:{Accept:"text/plain"}});if(!a.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let c=(await a.text()).split(`
57
+ `).filter(Boolean),l=[];for(let d of c){if(/[+-](?:alpha|beta|rc|pre|dev)/i.test(d)||/v\d+\.\d+\.\d+-\d{14}-[a-f0-9]+/.test(d))continue;let f=pe.valid(pe.clean(d));f&&l.push(f);}let p=[...l].sort(pe.rcompare)[0]??null;return {latest:p,stableVersions:l,latestStableOverall:p}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}},Iu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let r=H(this.manifest,"cargo",t);if(r){let s=[];for(let i of r.versions??[]){let c=de.valid(de.clean(i));c&&s.push(c);}let a=[...s].sort(de.rcompare)[0]??null;return {latest:r.latest?de.valid(de.clean(r.latest))??a:a,stableVersions:s,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let s=`https://crates.io/api/v1/crates/${encodeURIComponent(t)}`,o=await fetch(s,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json","User-Agent":"vibgrate-cli (https://github.com/vibgrate/vibgrate-cli)"}});if(!o.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let a=await o.json();if(!a.versions)return {latest:null,stableVersions:[],latestStableOverall:null};let i=[];for(let u of a.versions){if(u.yanked||!u.num||/[+-](?:alpha|beta|rc|pre|dev)/i.test(u.num))continue;let p=de.valid(de.clean(u.num));p&&i.push(p);}let l=[...i].sort(de.rcompare)[0]??null;return {latest:l,stableVersions:i,latestStableOverall:l}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}},_u=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let r=H(this.manifest,"composer",t);if(r){let s=[];for(let i of r.versions??[]){let c=fe.valid(fe.clean(i));c&&s.push(c);}let a=[...s].sort(fe.rcompare)[0]??null;return {latest:r.latest?fe.valid(fe.clean(r.latest))??a:a,stableVersions:s,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let s=`https://repo.packagist.org/p2/${encodeURIComponent(t)}.json`,o=await fetch(s,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json"}});if(!o.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let a=await o.json();if(!a.packages)return {latest:null,stableVersions:[],latestStableOverall:null};let i=a.packages[t];if(!i||!Array.isArray(i))return {latest:null,stableVersions:[],latestStableOverall:null};let c=[];for(let p of i){let d=p.version??p.version_normalized;if(!d||d==="dev-master"||d.startsWith("dev-")||/[+-](?:alpha|beta|rc|pre|dev)/i.test(d))continue;let f=fe.valid(fe.clean(d));f&&c.push(f);}let u=[...c].sort(fe.rcompare)[0]??null;return {latest:u,stableVersions:c,latestStableOverall:u}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}},Fu=class{constructor(t,e,n=false){this.sem=t,this.manifest=e,this.offline=n;}meta=new Map;get(t){let e=this.meta.get(t);if(e)return e;let n=this.sem.run(async()=>{let r=H(this.manifest,"pub",t);if(r){let s=[];for(let i of r.versions??[]){let c=he.valid(he.clean(i));c&&s.push(c);}let a=[...s].sort(he.rcompare)[0]??null;return {latest:r.latest?he.valid(he.clean(r.latest))??a:a,stableVersions:s,latestStableOverall:a}}if(this.offline)return {latest:null,stableVersions:[],latestStableOverall:null};try{let s=`https://pub.dev/api/packages/${encodeURIComponent(t)}`,o=await fetch(s,{signal:AbortSignal.timeout(1e4),headers:{Accept:"application/json"}});if(!o.ok)return {latest:null,stableVersions:[],latestStableOverall:null};let a=await o.json();if(!a.versions)return {latest:null,stableVersions:[],latestStableOverall:null};let i=[];for(let u of a.versions){if(!u.version||/[+-](?:alpha|beta|rc|pre|dev)/i.test(u.version))continue;let p=he.valid(he.clean(u.version));p&&i.push(p);}let l=[...i].sort(he.rcompare)[0]??null;return {latest:l,stableVersions:i,latestStableOverall:l}}catch{return {latest:null,stableVersions:[],latestStableOverall:null}}});return this.meta.set(t,n),n}};async function Po(t){try{return await Ou(t)}catch{return {type:"unknown"}}}async function Ou(t){let e=await Bu(t);if(!e)return {type:"unknown"};let n=_.join(e,"HEAD"),r;try{r=(await ye.readFile(n,"utf8")).trim();}catch{return {type:"unknown"}}let s,o;if(r.startsWith("ref: ")){let i=r.slice(5);o=i.startsWith("refs/heads/")?i.slice(11):i,s=await Du(e,i);}else /^[0-9a-f]{40}$/i.test(r)&&(s=r);let a=await Vu(e);return {type:"git",sha:s??void 0,shortSha:s?s.slice(0,7):void 0,branch:o??void 0,remoteUrl:a}}async function Bu(t){let e=_.resolve(t),n=_.parse(e).root;for(;e!==n;){let r=_.join(e,".git");try{let s=await ye.stat(r);if(s.isDirectory())return r;if(s.isFile()){let o=(await ye.readFile(r,"utf8")).trim();if(o.startsWith("gitdir: "))return _.resolve(e,o.slice(8))}}catch{}e=_.dirname(e);}return null}async function Du(t,e){let n=_.join(t,e);try{let s=(await ye.readFile(n,"utf8")).trim();if(/^[0-9a-f]{40}$/i.test(s))return s}catch{}let r=_.join(t,"packed-refs");try{let s=await ye.readFile(r,"utf8");for(let o of s.split(`
58
+ `)){if(o.startsWith("#")||o.startsWith("^"))continue;let a=o.trim().split(" ");if(a.length>=2&&a[1]===e)return a[0]}}catch{}}async function Vu(t){let e=await Uu(t);if(e)try{let r=(await ye.readFile(e,"utf8")).match(/\[remote\s+"origin"\]([\s\S]*?)(?=\n\[|$)/);return r?r[1]?.match(/\n\s*url\s*=\s*(.+)\s*/)?.[1]?.trim():void 0}catch{return}}async function Uu(t){let e=_.join(t,"config");try{if((await ye.stat(e)).isFile())return e}catch{}let n=_.join(t,"commondir");try{let r=(await ye.readFile(n,"utf8")).trim();if(!r)return;let s=_.resolve(t,r),o=_.join(s,"config");if((await ye.stat(o)).isFile())return o}catch{return}}function je(t){return t.replace(/[^a-zA-Z0-9_]/g,"_")}function Ft(t){return t.replace(/"/g,'\\"')}function Ot(t){return t===void 0||Number.isNaN(t)?"scoreUnknown":t>=80?"scoreHigh":t>=50?"scoreModerate":"scoreLow"}function rn(t){let e=t.drift?.score;return typeof e=="number"?`${t.name} (${e})`:t.name}function Cs(){return ["classDef scoreHigh fill:#1e293b,stroke:#10b981,color:#f1f5f9,stroke-width:2px","classDef scoreModerate fill:#1e293b,stroke:#f59e0b,color:#f1f5f9,stroke-width:2px","classDef scoreLow fill:#1e293b,stroke:#ef4444,color:#f1f5f9,stroke-width:2px","classDef scoreUnknown fill:#1e293b,stroke:#64748b,color:#94a3b8,stroke-width:2px"]}function qu(t){let e=["flowchart LR"],n=new Map(t.map(a=>[a.path,a])),r=[],s=new Set;for(let a of t){let i=je(a.projectId||a.path||a.name);for(let c of a.projectReferences??[]){let l=n.get(c.path);if(!l)continue;let u=je(l.projectId||l.path||l.name);r.push(`${i} --> ${u}`),s.add(i),s.add(u);}}let o=s.size===0;for(let a of t){let i=je(a.projectId||a.path||a.name);!o&&!s.has(i)||(e.push(`${i}["${Ft(rn(a))}"]`),e.push(`class ${i} ${Ot(a.drift?.score)}`));}return e.push(...r),e.push(...Cs()),{mermaid:e.join(`
59
+ `)}}function Gu(t,e){let n=["flowchart LR"],r=new Map(e.map(i=>[i.path,i])),s=e.filter(i=>i.projectReferences?.some(c=>c.path===t.path)),o=(t.projectReferences??[]).map(i=>r.get(i.path)).filter(i=>!!i),a=je(t.projectId||t.path||t.name);n.push(`${a}["${Ft(rn(t))}"]`),n.push(`class ${a} ${Ot(t.drift?.score)}`);for(let i of s){let c=je(i.projectId||i.path||i.name);n.push(`${c}["${Ft(rn(i))}"]`),n.push(`class ${c} ${Ot(i.drift?.score)}`),n.push(`${c} --> ${a}`);}for(let i of o){let c=je(i.projectId||i.path||i.name);n.push(`${c}["${Ft(rn(i))}"]`),n.push(`class ${c} ${Ot(i.drift?.score)}`),n.push(`${a} --> ${c}`);}return n.push(...Cs()),{mermaid:n.join(`
60
+ `)}}function Hu(t,e){let n=["flowchart TB"],r=je(t.solutionId||t.path||t.name),s=t.drift?.score,o=typeof s=="number"?` (${s})`:" (n/a)";n.push(`${r}["${Ft(`${t.name}${o}`)}"]`),n.push(`class ${r} ${Ot(s)}`);let a=new Map(e.map(i=>[i.path,i]));for(let i of t.projectPaths){let c=a.get(i);if(!c)continue;let l=je(c.projectId||c.path||c.name);n.push(`${l}["${Ft(rn(c))}"]`),n.push(`class ${l} ${Ot(c.drift?.score)}`),n.push(`${r} --> ${l}`);for(let u of c.projectReferences??[]){let p=a.get(u.path);if(!p)continue;let d=je(p.projectId||p.path||p.name);n.push(`${l} --> ${d}`);}}return n.push(...Cs()),{mermaid:n.join(`
61
+ `)}}var zu=createRequire(import.meta.url),Ju=zu("../package.json");Ju.version;var Ku="https://registry.npmjs.org/@vibgrate%2fcli/latest",Lo=_.join(on.homedir(),".vibgrate"),Qu=_.join(Lo,"update-check.json");async function wf(){try{let t=new AbortController,e=setTimeout(()=>t.abort(),1e4);e.unref?.();let n;try{n=await fetch(Ku,{headers:{Accept:"application/json"},signal:t.signal});}finally{clearTimeout(e);}if(!n.ok)return null;let s=(await n.json()).version;return !s||!$o.default.valid(s)?null:(await Yu({latest:s,checkedAt:Date.now()}),s)}catch{return null}}async function Yu(t){try{await ye.mkdir(Lo,{recursive:!0}),await ye.writeFile(Qu,JSON.stringify(t),"utf-8");}catch{}}var Xu=[{category:"pricing",pattern:/price|pricing|billing|subscri|trial|credit|plan|tier|upgrade|premium|pro|enterprise/i},{category:"auth",pattern:/sign[- ]?in|sign[- ]?up|log[- ]?in|log[- ]?out|auth|sso|oauth|password|register|invite|onboard/i},{category:"dashboard",pattern:/dashboard|overview|home|main|summary|stats/i},{category:"settings",pattern:/setting|config|preference|option|profile|account/i},{category:"users",pattern:/user|member|team|role|permission|access|admin|owner/i},{category:"integrations",pattern:/integrat|connect|webhook|api[- ]?key|sync|import|export/i},{category:"reports",pattern:/report|analy|metric|chart|graph|insight|track/i},{category:"workflows",pattern:/workflow|automat|schedule|trigger|action|job|task|pipeline/i},{category:"projects",pattern:/project|workspace|organization|folder|repo/i},{category:"navigation",pattern:/menu|nav|sidebar|header|footer|breadcrumb/i}];function Zu(t,e=3){let n=t.topEvidence,r=n.filter(u=>u.kind==="dependency").map(u=>u.value).slice(0,10),s=sp(n.filter(u=>u.kind==="route").map(u=>u.value)).slice(0,15),o=n.filter(u=>u.kind!=="dependency"&&u.kind!=="route"&&u.kind!=="feature_flag"),a=new Map,i={};for(let u of o){let p=ep(u.value);a.has(p)||a.set(p,new Set);let d=tp(u.value);d.length>=3&&a.get(p).add(d);}let c=[];for(let[u,p]of a){let d=np([...p]);i[u]=d.length;for(let f of d.slice(0,e))c.push({kind:"text",value:f,category:u});}let l=n.filter(u=>u.kind==="feature_flag");return l.length>0&&(i.feature_flags=l.length,c.push({kind:"feature_flag",value:"feature flags detected",category:"feature_flags"})),{samples:c,categoryCounts:i,originalCount:n.length,dependencies:r,routes:s,detectedFrameworks:t.detectedFrameworks}}function ep(t){for(let{category:e,pattern:n}of Xu)if(n.test(t))return e;return "general"}function tp(t){return t.toLowerCase().replace(/[^a-z0-9\s-]/g," ").replace(/\s+/g," ").trim().slice(0,60)}function np(t){let e=t.sort((r,s)=>s.length-r.length),n=[];for(let r of e)n.some(o=>{let a=r.slice(0,6);return o.startsWith(a)||o.includes(r)||r.includes(o)})||n.push(r);return n}function sp(t){let e=new Set,n=[];for(let r of t){let s=r.replace(/:[a-z_]+/gi,":param").replace(/\[\[*\.*\.*[a-z_]+\]*\]/gi,":param").replace(/\/+$/,"").toLowerCase();e.has(s)||(e.add(s),n.push(r));}return n}var op=promisify(No.gzip),ue=50;function Zt(t){let e=t.match(/^(.+?)\s*\(/);return e?e[1].trim():t.trim()}function ip(t){return {databaseTechnologies:t.databaseTechnologies.slice(0,10),connectionStrings:[],connectionPoolSettings:t.connectionPoolSettings.slice(0,ue),replicationSettings:t.replicationSettings.slice(0,20),readReplicaSettings:t.readReplicaSettings.slice(0,20),failoverSettings:t.failoverSettings.slice(0,20),collationAndEncoding:t.collationAndEncoding.slice(0,20),queryTimeoutDefaults:t.queryTimeoutDefaults.slice(0,20),manualIndexes:t.manualIndexes.map(Zt).slice(0,ue),tables:t.tables.map(Zt).slice(0,ue),views:t.views.map(Zt).slice(0,ue),storedProcedures:t.storedProcedures.map(Zt).slice(0,ue),triggers:t.triggers.map(Zt).slice(0,ue),rowLevelSecurityPolicies:t.rowLevelSecurityPolicies.slice(0,20),otherServices:t.otherServices.slice(0,20)}}function ap(t){let e=new Set;return {integrations:t.integrations.filter(r=>{let s=r.provider.split(":")[0];return e.has(s)?false:(e.add(s),true)}).slice(0,ue).map(r=>({provider:r.provider,endpoint:"",version:r.version,parameters:[],configOptions:[],authHints:[],files:[]})),openApiSpecifications:t.openApiSpecifications.slice(0,10),webhookUrls:t.webhookUrls.slice(0,20),callbackEndpoints:t.callbackEndpoints.slice(0,20),apiVersionPins:t.apiVersionPins.slice(0,20),tokenExpirationPolicies:t.tokenExpirationPolicies.slice(0,20),rateLimitOverrides:t.rateLimitOverrides.slice(0,20),customHeaders:t.customHeaders.slice(0,20),corsPolicies:t.corsPolicies.slice(0,20),oauthScopes:t.oauthScopes.slice(0,20),apiTokens:[]}}function cp(t){return {faviconFiles:t.faviconFiles.slice(0,1),productLogos:[]}}function lp(t){let e={...t};if(e.extended){let n={...e.extended};if(n.dataStores&&(n.dataStores=ip(n.dataStores)),n.apiSurface&&(n.apiSurface=ap(n.apiSurface)),n.assetBranding&&(n.assetBranding=cp(n.assetBranding)),n.uiPurpose){let r=Zu(n.uiPurpose);n.uiPurpose={enabled:n.uiPurpose.enabled,detectedFrameworks:r.detectedFrameworks,evidenceCount:r.originalCount,capped:n.uiPurpose.capped,topEvidence:[],unknownSignals:[],compacted:r};}if(n.runtimeConfiguration&&(n.runtimeConfiguration={...n.runtimeConfiguration,environmentVariables:n.runtimeConfiguration.environmentVariables.slice(0,100),hiddenConfigFiles:n.runtimeConfiguration.hiddenConfigFiles.slice(0,ue),startupArguments:n.runtimeConfiguration.startupArguments.slice(0,100)}),n.operationalResilience){let r=n.operationalResilience;n.operationalResilience={implicitTimeouts:r.implicitTimeouts.slice(0,30),defaultPaginationSize:r.defaultPaginationSize.slice(0,30),implicitRetryLogic:r.implicitRetryLogic.slice(0,30),defaultLocale:r.defaultLocale.slice(0,20),defaultCurrency:r.defaultCurrency.slice(0,20),implicitTimezone:r.implicitTimezone.slice(0,20),defaultCharacterEncoding:r.defaultCharacterEncoding.slice(0,20),sessionStores:r.sessionStores.slice(0,20),distributedLocks:r.distributedLocks.slice(0,20),jobSchedulers:r.jobSchedulers.slice(0,30),idempotencyKeys:r.idempotencyKeys.slice(0,20),rateLimitingCounters:r.rateLimitingCounters.slice(0,20),circuitBreakerState:r.circuitBreakerState.slice(0,20),abTestToggles:r.abTestToggles.slice(0,20),regionalEnablementRules:r.regionalEnablementRules.slice(0,20),betaAccessGroups:r.betaAccessGroups.slice(0,20),licensingEnforcementLogic:r.licensingEnforcementLogic.slice(0,20),killSwitches:r.killSwitches.slice(0,20),connectorRetryLogic:r.connectorRetryLogic.slice(0,20),apiPollingIntervals:r.apiPollingIntervals.slice(0,20),fieldMappings:r.fieldMappings.slice(0,20),schemaRegistryRules:r.schemaRegistryRules.slice(0,20),deadLetterQueueBehavior:r.deadLetterQueueBehavior.slice(0,20),dataMaskingRules:r.dataMaskingRules.slice(0,20),transformationLogic:r.transformationLogic.slice(0,20),timezoneHandling:r.timezoneHandling.slice(0,20),encryptionSettings:r.encryptionSettings.slice(0,30),hardcodedSecretSignals:r.hardcodedSecretSignals.slice(0,20)};}n.dependencyGraph&&(n.dependencyGraph={...n.dependencyGraph,phantomDependencies:n.dependencyGraph.phantomDependencies.slice(0,ue),phantomDependencyDetails:n.dependencyGraph.phantomDependencyDetails?.slice(0,ue),duplicatedPackages:n.dependencyGraph.duplicatedPackages.slice(0,ue)}),e.extended=n;}return e}async function up(t){let e=JSON.stringify(t);return op(e,{level:9})}async function kf(t){let e=lp(t);return {body:await up(e),contentEncoding:"gzip"}}function pp(t){let n=t.replace(/[\x00-\x1F\x7F\uFEFF\u200B-\u200D\u2060]/g,"").trim().match(/^vibgrate\+(https?):?\/\/([^:]+):([^@]+)@([^/]+)\/(.+)$/);return n?{scheme:n[1],keyId:n[2],secret:n[3],host:n[4],workspaceId:n[5]}:null}async function Ef(t,e,n){let r=e,s=new URL(`${t.scheme}://${r}/v1/ingest/scan/preflight`);n?.repositoryName&&s.searchParams.set("repository",n.repositoryName),n?.vcsSha&&s.searchParams.set("vcsSha",n.vcsSha);let o=String(Date.now()),a=await fetch(s.toString(),{method:"GET",headers:{"X-Vibgrate-Timestamp":o,Authorization:`VibgrateDSN ${t.keyId}:${t.secret}`}}),i=await a.json();if(!a.ok&&i.status!=="error")throw new Error(`HTTP ${a.status}: ${JSON.stringify(i)}`);return i}async function dp(t){let e=_.join(t,"package.json"),n$1=_.basename(t);if(await p(e))try{let r=await n(e);typeof r.name=="string"&&r.name.trim()&&(n$1=r.name.trim());}catch{}return n$1}var fp=new Set(["node_modules",".git",".vibgrate",".wrangler",".next","dist","build","out",".turbo",".cache","coverage","bin","obj",".vs","TestResults",".nuxt",".output",".svelte-kit"]);async function jf(t,e){let n=e??await Po(t);if(n.type==="git"&&n.sha)return {vcsSha:n.sha,method:"git_sha"};let r=await hp(t);return r?{treeHash:r,method:"tree_metadata"}:{method:"unknown"}}async function hp(t,e){let n=e?.maxFilesPerDirectory??500,r=[];async function s(a,i){let c;try{c=await ye.readdir(a,{withFileTypes:!0});}catch{return}let l=c.filter(u=>u.isFile());if(l.length>n){r.push(`${i||"."}|dir_overflow|${l.length}`);return}for(let u of c){if(u.isDirectory()){if(fp.has(u.name))continue;let f=i?`${i}/${u.name}`:u.name;await s(_.join(a,u.name),f);continue}if(!u.isFile())continue;let p=i?`${i}/${u.name}`:u.name,d=_.join(a,u.name);try{let f=await ye.stat(d);r.push(`${p}|${f.size}|${f.mtimeMs}`);}catch{}}}if(await s(_.resolve(t),""),r.length===0)return;r.sort();let o=Es.createHash("sha256");for(let a of r)o.update(a),o.update(`
62
+ `);return o.digest("hex")}var bp="https://api.vibgrate.com",vp=1e3*60*60*24,wp=5e3;function gs(t){return !!t&&typeof t=="object"&&typeof t.generatedAt=="string"&&typeof t.products=="object"&&t.products!==null}var Sp=class{apiBase;offline;manifest;cacheDir;fetchImpl;resolution=null;constructor(t={}){this.apiBase=(t.apiBase??process.env.VIBGRATE_API_BASE??bp).replace(/\/+$/,""),this.offline=t.offline??false,this.manifest=t.manifest,this.cacheDir=t.cacheDir??_.join(on.homedir(),".vibgrate","cache"),this.fetchImpl=t.fetchImpl??globalThis.fetch;}resolve(){return this.resolution||(this.resolution=this.doResolve()),this.resolution}get cacheFile(){return _.join(this.cacheDir,"runtimes.json")}async doResolve(){let t;if(!this.offline){let n=await this.readCache();if(n){if(Date.now()-Date.parse(n.fetchedAt)<vp)return {catalog:n.catalog,source:"cache"};t=n.catalog;}let r=await this.fetchFromApi();if(r)return await this.writeCache(r),{catalog:r,source:"api"}}let e=this.manifest?.runtimes;return gs(e)?{catalog:e,source:"manifest"}:t&&Date.parse(t.generatedAt)>Date.parse(Ee.generatedAt)?{catalog:t,source:"cache"}:{catalog:Ee,source:"bundled"}}async fetchFromApi(){if(!this.fetchImpl)return null;let t=new AbortController,e=setTimeout(()=>t.abort(),wp);try{let n=await this.fetchImpl(`${this.apiBase}/v1/reference/runtimes`,{signal:t.signal,headers:{Accept:"application/json"}});if(!n.ok)return null;let r=await n.json();return gs(r)?r:null}catch{return null}finally{clearTimeout(e);}}async readCache(){try{let t=await readFile(this.cacheFile,"utf8"),e=JSON.parse(t);if(e&&typeof e.fetchedAt=="string"&&gs(e.catalog))return e}catch{}return null}async writeCache(t){try{await mkdir(this.cacheDir,{recursive:!0});let e={fetchedAt:new Date().toISOString(),catalog:t};await writeFile(this.cacheFile,JSON.stringify(e),"utf8");}catch{}}},Tp=class _o{constructor(e){this.outPath=e;}events=[];start=Date.now();lastThrottled=new Map;flushed=false;static fromEnv(){let e=process.env.VIBGRATE_TRACE_EVENTS;return e?new _o(e):null}record(e,n={}){this.flushed||this.events.push({t:Date.now()-this.start,op:e,...n});}recordThrottled(e,n,r={},s=120){if(this.flushed)return;let o=Date.now(),a=this.lastThrottled.get(e)??0;o-a<s||(this.lastThrottled.set(e,o),this.record(n,r));}flush(e){if(this.flushed)return;this.flushed=true;let n={traceVersion:1,cliVersion:e.cliVersion,workspace:basename(e.rootDir)||e.rootDir,recordedAt:new Date().toISOString(),durationMs:Date.now()-this.start,events:this.events};try{mkdirSync(dirname(this.outPath),{recursive:!0}),writeFileSync(this.outPath,JSON.stringify(n));}catch{}}},In=[E.cyan(" \u256D\u2500\u2500\u2500\u256E")+E.greenBright("\u279C"),E.cyan(" \u256D\u2524")+E.greenBright("\u25C9 \u25C9")+E.cyan("\u251C\u256E"),E.cyan(" \u2570\u2524")+E.dim("\u2500\u2500\u2500")+E.cyan("\u251C\u256F"),E.cyan(" \u2570\u2500\u2500\u2500\u256F")];function to(t){return [E.bold.white(" V I B G R A T E"),E.dim(" Drift Intelligence Engine")+E.dim(` v${t}`)]}var no=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],Cp=class{steps=[];stats={projects:0,dependencies:0,frameworks:0,findings:{warnings:0,errors:0,notes:0}};spinnerFrame=0;timer=null;lastRowCount=0;startTime=Date.now();isTTY;useLiveUpdates;rootDir="";lastFrame="";cursorHidden=false;estimatedTotalMs=null;stepEstimates=new Map;stepStartTimes=new Map;stepTimings=[];lastLoggedStates=new Map;version;trace;constructor(t,e="unknown"){if(this.version=e,this.trace=Tp.fromEnv(),this.isTTY=process.stderr.isTTY??false,this.useLiveUpdates=this.isTTY&&process.env.VIBGRATE_PROGRESS_MODE!=="plain",this.rootDir=t,this.isTTY){let n=()=>{this.cursorHidden&&(process.stderr.write("\x1B[?25h"),this.cursorHidden=false);};process.on("exit",n),process.on("SIGINT",()=>{n(),process.exit(130);}),process.on("SIGTERM",()=>{n(),process.exit(143);});}}setEstimatedTotal(t){this.estimatedTotalMs=t,this.trace?.record("setEstimatedTotal",{estimatedMs:t});}setStepEstimates(t){this.stepEstimates=t;}getStepTimings(){return [...this.stepTimings]}setSteps(t){if(this.steps=t.map(e=>({...e,status:"pending",weight:e.weight??1})),this.trace?.record("setSteps",{steps:t.map(e=>({id:e.id,label:e.label,weight:e.weight??1}))}),this.isTTY){let e=["",` ${In[0]} ${to(this.version)[0]}`,` ${In[1]} ${to(this.version)[1]}`,` ${In[2]}`,` ${In[3]} ${E.dim(this.rootDir)}`,""].join(`
63
+ `)+`
64
+ `;process.stderr.write(e),this.useLiveUpdates&&this.startSpinner();}this.render();}insertStepBefore(t,e){let n=this.steps.findIndex(s=>s.id===t),r={...e,status:"pending",weight:e.weight??1};n>=0?this.steps.splice(n,0,r):this.steps.push(r),this.trace?.record("insertStepBefore",{beforeId:t,step:{id:e.id,label:e.label,weight:e.weight??1}});}startStep(t,e){let n=this.steps.find(r=>r.id===t);n&&(n.status="active",n.detail=void 0,n.count=void 0,n.subProgress=0,n.subTotal=e),this.stepStartTimes.set(t,Date.now()),this.trace?.record("startStep",{id:t,subTotal:e}),this.render();}completeStep(t,e,n){let r=this.steps.find(o=>o.id===t);r&&(r.status="done",r.detail=e,r.count=n);let s=this.stepStartTimes.get(t);s&&this.stepTimings.push({id:t,durationMs:Date.now()-s}),this.trace?.record("completeStep",{id:t,detail:e,count:n}),this.render();}skipStep(t){let e=this.steps.find(n=>n.id===t);e&&(e.status="skipped",e.detail="disabled"),this.trace?.record("skipStep",{id:t}),this.render();}updateStepProgress(t,e,n,r){let s=this.steps.find(o=>o.id===t);s&&(s.subProgress=e,n!==void 0&&(s.subTotal=n),r!==void 0&&(s.subLabel=r)),this.trace?.recordThrottled(`sub:${t}`,"updateStepProgress",{id:t,current:e,total:n,label:r}),this.render();}updateStats(t){Object.assign(this.stats,t),this.traceStats(true),this.render();}addProjects(t){this.stats.projects+=t,this.traceStats(),this.render();}addDependencies(t){this.stats.dependencies+=t,this.traceStats(),this.render();}addFrameworks(t){this.stats.frameworks+=t,this.traceStats(),this.render();}addFindings(t,e,n){this.stats.findings.warnings+=t,this.stats.findings.errors+=e,this.stats.findings.notes+=n,this.traceStats(),this.render();}traceStats(t=false){if(!this.trace)return;let e={stats:{...this.stats,findings:{...this.stats.findings},treeSummary:this.stats.treeSummary?{...this.stats.treeSummary}:void 0}};t?this.trace.record("stats",e):this.trace.recordThrottled("stats","stats",e);}finish(){if(this.timer&&(clearInterval(this.timer),this.timer=null),this.isTTY){let n="";this.lastRowCount>0&&(n+=`\x1B[${this.lastRowCount}A`,n+="\x1B[J"),n+="\x1B[?25h",n&&process.stderr.write(n),this.cursorHidden=false,this.lastRowCount=0;}let t=this.formatElapsed(Date.now()-this.startTime),e=this.steps.filter(n=>n.status==="done").length;process.stderr.write(E.dim(` \u2714 ${e} scanners completed in ${t}
65
+
66
+ `)),this.trace?.record("finish",{doneCount:e,elapsedMs:Date.now()-this.startTime,summary:`${e} scanners completed in ${t}`}),this.trace?.flush({cliVersion:this.version,rootDir:this.rootDir}),this.isTTY&&process.platform==="win32"&&process.stdout.write("\x1B[0G\x1B[K");}startSpinner(){this.cursorHidden||(process.stderr.write("\x1B[?25l"),this.cursorHidden=true),this.timer=setInterval(()=>{this.spinnerFrame=(this.spinnerFrame+1)%no.length,this.render();},120);}clearLines(){}render(){if(!this.useLiveUpdates){this.renderCI();return}let t=[];for(let g of this.steps)t.push(this.renderStep(g));t.push("");let e=this.steps.reduce((g,h)=>g+(h.weight??1),0),n=0;for(let g of this.steps){let h=g.weight??1;if(g.status==="done"||g.status==="skipped")n+=h;else if(g.status==="active"&&g.subTotal&&g.subTotal>0&&g.subProgress!==void 0)n+=h*Math.min(g.subProgress/g.subTotal,.99);else if(g.status==="active"){let y=this.stepStartTimes.get(g.id),j=this.stepEstimates.get(g.id);if(y&&j&&j>0){let C=Date.now()-y;n+=h*Math.min(C/j,.95);}}}let r=e>0?Math.min(Math.round(n/e*100),99):0,s=30,o=Math.round(n/Math.max(e,1)*s),a=E.greenBright("\u2501".repeat(Math.min(o,s)))+E.dim("\u254C".repeat(Math.max(s-o,0))),i=Date.now()-this.startTime,c=this.formatElapsed(i),l=this.computeEtaString(i,n,e),u=this.stats.treeSummary?E.dim(` \xB7 ${this.stats.treeSummary.totalFiles.toLocaleString()} files \xB7 ${this.stats.treeSummary.totalDirs.toLocaleString()} dirs`):"";t.push(` ${a} ${E.bold.white(`${r}%`)} ${E.dim(c)}${l}${u}`),t.push(""),t.push(this.renderStats()),t.push("");let p=t.join(`
67
+ `)+`
68
+ `,d=this.countRenderedRows(t);if(p===this.lastFrame&&this.lastRowCount===d)return;this.lastFrame=p;let f="";this.lastRowCount>0&&(f+=`\x1B[${this.lastRowCount}A`,f+="\x1B[J"),f+=p,process.stderr.write(f),this.lastRowCount=d;}countRenderedRows(t){let e=Math.max(process.stderr.columns??80,20);return t.reduce((n,r)=>n+this.countWrappedRows(r,e),0)}countWrappedRows(t,e){let n=Math.max(this.getDisplayWidth(t),1);return Math.max(1,Math.ceil(n/e))}getDisplayWidth(t){let e=this.stripAnsi(t).replace(/\r/g,""),n=0;for(let r of e){let s=r.codePointAt(0);s!==void 0&&(s>=0&&s<32||s>=127&&s<160||(n+=this.isWideCodePoint(s)?2:1));}return n}stripAnsi(t){return t.replace(/\x1b(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\))/g,"")}isWideCodePoint(t){return t>=4352&&(t<=4447||t===9001||t===9002||t>=11904&&t<=42191&&t!==12351||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65135||t>=65280&&t<=65376||t>=65504&&t<=65510||t>=127744&&t<=128591||t>=129280&&t<=129535||t>=131072&&t<=262141)}renderStep(t){let e=no[this.spinnerFrame],n,r,s="";switch(t.status){case "done":n=E.green("\u2714"),r=E.white(t.label);break;case "active":if(n=E.cyan(e),r=E.bold.white(t.label),t.subTotal&&t.subTotal>0&&t.subProgress!==void 0&&t.subProgress>0&&(s=E.dim(` \xB7 ${t.subProgress.toLocaleString()} / ${t.subTotal.toLocaleString()}`)),t.subLabel){let a=t.subLabel.length>50?"\u2026"+t.subLabel.slice(-49):t.subLabel;s+=E.dim(` ${a}`);}break;case "skipped":n=E.dim("\u25CC"),r=E.dim.strikethrough(t.label);break;default:n=E.dim("\u25CB"),r=E.dim(t.label);break}return t.detail&&(s=E.dim(` \xB7 ${t.detail}`)),t.count!==void 0&&t.count>0&&(s+=E.cyan(` (${t.count})`)),` ${n} ${r}${s}`}renderStats(){let t=this.stats.projects,e=this.stats.dependencies,n=this.stats.frameworks,r=this.stats.findings.warnings,s=this.stats.findings.errors,o=this.stats.findings.notes,a=[E.bold.white(` ${t}`)+E.dim(` project${t!==1?"s":""}`),E.white(`${e}`)+E.dim(` dep${e!==1?"s":""}`),E.white(`${n}`)+E.dim(` framework${n!==1?"s":""}`)],i=[];return s>0&&i.push(E.red(`${s} \u2716`)),r>0&&i.push(E.yellow(`${r} \u26A0`)),o>0&&i.push(E.blue(`${o} \u2139`)),i.length>0&&a.push(i.join(E.dim(" \xB7 "))),` ${E.dim("\u2503")} ${a.join(E.dim(" \u2502 "))}`}renderCI(){for(let t of this.steps){let e=t.status==="done"?[t.status,t.detail??"",t.count?.toString()??""].join("|"):t.status;if(this.lastLoggedStates.get(t.id)!==e){if(this.lastLoggedStates.set(t.id,e),t.status==="active"){process.stderr.write(` \u25C9 ${t.label}...
69
+ `);continue}if(t.status==="done"){let n=this.formatLoggedStepDetail(t);process.stderr.write(` \u2714 ${t.label}${n}
70
+ `);continue}if(t.status==="skipped"){let n=t.detail?` \xB7 ${t.detail}`:"";process.stderr.write(` \u25CC ${t.label}${n}
71
+ `);}}}}formatLoggedStepDetail(t){let e="";return t.detail&&(e+=` \xB7 ${t.detail}`),t.count!==void 0&&t.count>0&&(e+=` (${t.count})`),e}formatElapsed(t){let e=t/1e3;if(e<90)return `${e.toFixed(1)}s`;let n=Math.floor(e/60),r=Math.floor(e%60);return `${n}m ${r.toString().padStart(2,"0")}s`}computeEtaString(t,e,n){if(n===0||t<2e3)return "";let r=e/n;if(r<.03){if(this.estimatedTotalMs!==null&&this.estimatedTotalMs>0){let a=Math.max(0,this.estimatedTotalMs-t);if(a>1e3)return E.dim(` \xB7 ~${this.formatElapsed(a)} left`)}return ""}let s=t/r*(1-r),o;if(this.estimatedTotalMs!==null&&this.estimatedTotalMs>0){let a=Math.max(0,this.estimatedTotalMs-t),i=Math.max(.1,1-r),c=a*i+s*(1-i);o=Math.min(a,c);}else o=s;return o<1500?"":E.dim(` \xB7 ~${this.formatElapsed(o)} left`)}},Fo="scan_history.json",so=10;async function Oo(t){let e=_.join(t,".vibgrate",Fo);try{let n=await ye.readFile(e,"utf8"),r=JSON.parse(n);return r.version===1&&Array.isArray(r.records)?r:null}catch{return null}}async function Ap(t,e){let n=_.join(t,".vibgrate"),r=_.join(n,Fo),s,o=await Oo(t);o?(s=o,s.records.push(e),s.records.length>so&&(s.records=s.records.slice(-so))):s={version:1,records:[e]};try{await ye.mkdir(n,{recursive:!0}),await ye.writeFile(r,JSON.stringify(s,null,2)+`
72
+ `,"utf8");}catch{}}function Pp(t,e){if(!t||t.records.length===0)return null;let n=t.records.filter(s=>{if(s.totalFiles===0||e===0)return false;let o=e/s.totalFiles;return o>=.33&&o<=3});if(n.length>0){let s=0,o=0;for(let a=0;a<n.length;a++){let i=n[a],c=a+1,l=e/i.totalFiles;s+=i.totalDurationMs*l*c,o+=c;}return Math.round(s/o)}let r=t.records[t.records.length-1];if(r.totalFiles>0&&e>0){let s=e/r.totalFiles;return Math.round(r.totalDurationMs*s)}return r.totalDurationMs}function Mp(t,e){let n=new Map;if(!t||t.records.length===0)return n;let r=null;for(let o=t.records.length-1;o>=0;o--){let a=t.records[o];if(a.steps.length>0){r=a;break}}if(!r)return n;let s=r.totalFiles>0&&e>0?e/r.totalFiles:1;for(let o of r.steps)n.set(o.id,Math.round(o.durationMs*s));return n}async function $p(t,e){let n=await e.findSolutionFiles(t),r=[];for(let s of n)try{let o=await e.readTextFile(s),a=_.dirname(s),c=[_.basename(t),_.relative(t,s).replace(/\\/g,"/")].join("/"),l=new Set,u=/Project\("[^"]*"\)\s*=\s*"([^"]*)",\s*"([^"]+\.(?:cs|vb)proj)"/g,p;for(;(p=u.exec(o))!==null;){let f=p[2],g=_.resolve(a,f.replace(/\\/g,"/"));l.add(_.relative(t,g).replace(/\\/g,"/"));}let d=_.basename(s,_.extname(s));r.push({path:c,name:d,type:"dotnet-sln",projectPaths:[...l]});}catch{}return r}async function Mf(t,e$1,n$1){let r$1=e$1.vibgrateVersion??"unknown",s$1=Date.now(),o=await ha(t),a=new a$1(e$1.concurrency),i=e$1.packageManifest?await Ja(e$1.packageManifest):void 0,c=e$1.offline===true,l=e$1.maxPrivacy===true,u=new tc(t,a,i,c),p$1=new Pu(a,i,c),d$1=new Mu(a,i,c),f=new $u(a,i,c),g=new Lu(a,i,c),h=new Nu(a,i,c),y=new Ru(a,i,c),j=new Iu(a,i,c),C=new _u(a,i,c),A=new Fu(a,i,c),T=new d,v=[...new Set([...o.exclude??[],...e$1.exclude??[]])];T.setExcludePatterns(v);let b=(e$1.projectScanTimeout??o.projectScanTimeout??180)*1e3;T.setMaxFileSize(o.maxFileSizeToScan??5242880),T.setProjectScanTimeout(b);let S=o.scanners,w=0,x=k=>{w+=k;},m=new Cp(t,r$1),P=[{id:"config",label:"Loading configuration"},{id:"discovery",label:"Discovering workspace",weight:3},{id:"vcs",label:"Detecting version control"},{id:"walk",label:"Indexing files",weight:8},{id:"drift",label:"Computing drift score"},{id:"findings",label:"Generating findings"}];if(m.setSteps(P),m.completeStep("config","loaded"),!(c?true:await nc(t))){m.finish();let k=["",E.red.bold(" \u2716 Vibgrate cannot connect to the npm registry to check package versions."),"",E.dim(" Possible causes:"),E.dim(" \u2022 No internet connection"),E.dim(" \u2022 Corporate proxy/firewall blocking registry.npmjs.org"),E.dim(" \u2022 npm is not installed or not in PATH"),"",E.dim(" Try running: ")+E.cyan("npm view npm dist-tags.latest"),""].join(`
73
+ `);throw new Error(k)}let ce=await new Sp({offline:c,manifest:i}).resolve(),ne=ce.catalog,Ps=e(t,v);m.startStep("discovery");let se=await Ps;m.updateStats({treeSummary:se}),m.completeStep("discovery",`${se.totalFiles.toLocaleString()} files \xB7 ${se.totalDirs.toLocaleString()} dirs`);let Ms=await Oo(t),Bo=Pp(Ms,se.totalFiles);m.setEstimatedTotal(Bo),m.setStepEstimates(Mp(Ms,se.totalFiles)),m.startStep("vcs");let ke=await Po(t),Do=ke.type!=="unknown"?`${ke.type}${ke.branch?` ${ke.branch}`:""}${ke.shortSha?` @ ${ke.shortSha}`:""}`:"none detected";m.completeStep("vcs",Do),m.startStep("walk",se.totalFiles),await T.walkDir(t,(k,M)=>{m.updateStepProgress("walk",k,se.totalFiles,M);});let pn=T.getWalkSummary(t);pn&&(pn.totalFiles!==se.totalFiles||pn.totalDirs!==se.totalDirs)&&m.updateStats({treeSummary:pn}),m.completeStep("walk",`${se.totalFiles.toLocaleString()} files indexed`);let Re=await gc(t,u,T,b,ne);if(Re.length>0){m.insertStepBefore("drift",{id:"node",label:"Found Node projects",weight:4}),m.startStep("node");for(let k of Re)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Re.length,m.addProjects(Re.length),m.completeStep("node",`${Re.length} project${Re.length!==1?"s":""}`,Re.length);}let Ie=await Sc(t,p$1,T,b,ne);if(Ie.length>0){m.insertStepBefore("drift",{id:"dotnet",label:"Found .NET projects",weight:2}),m.startStep("dotnet");for(let k of Ie)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Ie.length,m.addProjects(Ie.length),m.completeStep("dotnet",`${Ie.length} project${Ie.length!==1?"s":""}`,Ie.length);}let _e=await Pc(t,d$1,T,b,ne);if(_e.length>0){m.insertStepBefore("drift",{id:"python",label:"Found Python projects",weight:3}),m.startStep("python");for(let k of _e)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=_e.length,m.addProjects(_e.length),m.completeStep("python",`${_e.length} project${_e.length!==1?"s":""}`,_e.length);}let Fe=await _c(t,f,T,b,ne);if(Fe.length>0){m.insertStepBefore("drift",{id:"java",label:"Found Java projects",weight:3}),m.startStep("java");for(let k of Fe)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Fe.length,m.addProjects(Fe.length),m.completeStep("java",`${Fe.length} project${Fe.length!==1?"s":""}`,Fe.length);}let Oe=await Hc(t,g,T,b,ne);if(Oe.length>0){m.insertStepBefore("drift",{id:"ruby",label:"Found Ruby projects",weight:2}),m.startStep("ruby");for(let k of Oe)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Oe.length,m.addProjects(Oe.length),m.completeStep("ruby",`${Oe.length} project${Oe.length!==1?"s":""}`,Oe.length);}let Be=await Yc(t,h,T,b);if(Be.length>0){m.insertStepBefore("drift",{id:"swift",label:"Found Swift projects",weight:2}),m.startStep("swift");for(let k of Be)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Be.length,m.addProjects(Be.length),m.completeStep("swift",`${Be.length} project${Be.length!==1?"s":""}`,Be.length);}let De=await tl(t,y,T,b,ne);if(De.length>0){m.insertStepBefore("drift",{id:"go",label:"Found Go projects",weight:2}),m.startStep("go");for(let k of De)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=De.length,m.addProjects(De.length),m.completeStep("go",`${De.length} project${De.length!==1?"s":""}`,De.length);}let Ve=await il(t,j,T,b);if(Ve.length>0){m.insertStepBefore("drift",{id:"rust",label:"Found Rust projects",weight:2}),m.startStep("rust");for(let k of Ve)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Ve.length,m.addProjects(Ve.length),m.completeStep("rust",`${Ve.length} project${Ve.length!==1?"s":""}`,Ve.length);}let Ue=await dl(t,C,T,b);if(Ue.length>0){m.insertStepBefore("drift",{id:"php",label:"Found PHP projects",weight:2}),m.startStep("php");for(let k of Ue)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Ue.length,m.addProjects(Ue.length),m.completeStep("php",`${Ue.length} project${Ue.length!==1?"s":""}`,Ue.length);}let qe=await bl(t,A,T,b);if(qe.length>0){m.insertStepBefore("drift",{id:"dart",label:"Found Dart projects",weight:2}),m.startStep("dart");for(let k of qe)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=qe.length,m.addProjects(qe.length),m.completeStep("dart",`${qe.length} project${qe.length!==1?"s":""}`,qe.length);}let Ge=await Ll(t,i,T,b,c);if(Ge.length>0){m.insertStepBefore("drift",{id:"elixir",label:"Found Elixir projects",weight:2}),m.startStep("elixir");for(let k of Ge)m.addDependencies(k.dependencies.length),k.frameworks&&m.addFrameworks(k.frameworks.length);w+=Ge.length,m.addProjects(Ge.length),m.completeStep("elixir",`${Ge.length} project${Ge.length!==1?"s":""}`,Ge.length);}let He=await Hl(t,i,T,b,c);if(He.length>0){m.insertStepBefore("drift",{id:"docker",label:"Found Docker images",weight:2}),m.startStep("docker");for(let k of He)m.addDependencies(k.dependencies.length);w+=He.length,m.addProjects(He.length),m.completeStep("docker",`${He.length} project${He.length!==1?"s":""}`,He.length);}let We=await nu(t,i,T,b,c);if(We.length>0){m.insertStepBefore("drift",{id:"helm",label:"Found Helm charts",weight:2}),m.startStep("helm");for(let k of We)m.addDependencies(k.dependencies.length),k.frameworks&&m.addFrameworks(k.frameworks.length);w+=We.length,m.addProjects(We.length),m.completeStep("helm",`${We.length} project${We.length!==1?"s":""}`,We.length);}let ze=await uu(t,i,T,b,c);if(ze.length>0){m.insertStepBefore("drift",{id:"terraform",label:"Found Terraform configs",weight:2}),m.startStep("terraform");for(let k of ze)m.addDependencies(k.dependencies.length);w+=ze.length,m.addProjects(ze.length),m.completeStep("terraform",`${ze.length} project${ze.length!==1?"s":""}`,ze.length);}let Je=await gu(t,T);if(Je.length>0){m.insertStepBefore("drift",{id:"polyglot",label:"Found additional language projects",weight:2}),m.startStep("polyglot");for(let k of Je)m.addDependencies(k.dependencies.length),m.addFrameworks(k.frameworks.length);w+=Je.length,m.addProjects(Je.length),m.completeStep("polyglot",`${Je.length} project${Je.length!==1?"s":""}`,Je.length);}let Vo=new Set(["docker","helm","terraform"]),Hn=k=>Vo.has(k.type)?`${k.type}:${k.path}`:k.path,Uo=[...Re,...Ie,..._e,...Fe,...Oe,...Be,...De,...Ve,...Ue,...qe,...Ge,...He,...We,...ze,...Je],dn=new Map;for(let k of Uo){let M=dn.get(Hn(k));if(!M)dn.set(Hn(k),k);else {let O=Kn=>Kn.dependencies.filter(tt=>tt.resolvedVersion||tt.latestStable).length,Fs=O(k)>O(M)||O(k)===O(M)&&k.dependencies.length>M.dependencies.length,qt=Fs?k:M,Jn=Fs?M:k;if(Jn.projectReferences?.length)if(!qt.projectReferences)qt.projectReferences=Jn.projectReferences;else {let Kn=new Set(qt.projectReferences.map(tt=>tt.path));for(let tt of Jn.projectReferences)Kn.has(tt.path)||qt.projectReferences.push(tt);}dn.set(Hn(k),qt);}}let re=[...dn.values()],$s=e$1.dsn||process.env.VIBGRATE_DSN,Ls=($s?pp($s):null)?.workspaceId;for(let k of re){k.drift=ps([k]),k.projectId=Pa(k.path,k.name,Ls);let M=_.resolve(t,k.path);try{let O=await T.sourceMetricsUnder(t,M);k.fileCount===void 0&&(k.fileCount=O.fileCount),k.sizeBytes=O.sizeBytes;}catch{}k.dependencyCount=k.dependencies.length,k.classification=Tu({fileCount:k.fileCount,sizeBytes:k.sizeBytes,dependencyCount:k.dependencyCount});}let Ns=_.join(t,".vibgrate","solutions.json"),Rs=new Map;if(await p(Ns))try{let k=await n(Ns);for(let M of k.solutions??[])M.path&&M.solutionId&&Rs.set(M.path,M.solutionId);}catch{}let xt=(await $p(t,T)).map(k=>({solutionId:Rs.get(k.path)??Ma(k.path,k.name,Ls),path:k.path,name:k.name,type:k.type,projectPaths:k.projectPaths})),Wn=new Map(re.map(k=>[k.path,k]));for(let k of xt){let M=k.projectPaths.map(O=>Wn.get(O)??Wn.get(_.dirname(O).replace(/\\/g,"/"))).filter(O=>!!O);k.drift=M.length>0?ps(M):void 0;for(let O of M)O.solutionId=k.solutionId,O.solutionName=k.name;}for(let k of re)k.relationshipDiagram=Gu(k,re);for(let k of xt)k.relationshipDiagram=Hu(k,re);let qo=qu(re),Ut={};n$1&&await n$1({rootDir:t,opts:e$1,config:o,scanners:S,maxPrivacyMode:l,allProjects:re,solutions:xt,projectsByPath:Wn,fileCache:T,progress:m,runtimeCatalog:ne,extended:Ut,addFilesScanned:x});let Is=(Date.now()-Date.parse(ne.generatedAt))/(1e3*60*60*24),Go=Number.isFinite(Is)&&Is>30;Ut.runtimeCatalogInfo={generatedAt:ne.generatedAt,source:ce.source,stale:Go},m.startStep("drift");let zn=ps(re);m.completeStep("drift",`${zn.score}/100 \u2014 ${zn.riskLevel} risk`),m.startStep("findings");let fn=Aa(re,o),hn=fn.filter(k=>k.level==="warning").length,mn=fn.filter(k=>k.level==="error").length,gn=fn.filter(k=>k.level==="note").length;m.addFindings(hn,mn,gn);let yn=[];mn>0&&yn.push(`${mn} error${mn!==1?"s":""}`),hn>0&&yn.push(`${hn} warning${hn!==1?"s":""}`),gn>0&&yn.push(`${gn} note${gn!==1?"s":""}`),m.completeStep("findings",yn.join(", ")||"none"),m.finish();let Tt=T.stuckPaths,Ct=T.skippedLargeFiles;if(Tt.length>0){console.log(E.yellow(`
74
+ \u26A0 ${Tt.length} path${Tt.length===1?"":"s"} timed out (>${Math.round(b/1e3)}s) and ${Tt.length===1?"was":"were"} skipped:`));for(let O of Tt)console.log(E.dim(` \u2192 ${O}`));let k=Tt.map(O=>`${O}/**`);await ma(t,k)&&console.log(E.green("\u2714")+` Added ${k.length} pattern${k.length!==1?"s":""} to exclude list in config`);}if(Ct.length>0){let M=((o.maxFileSizeToScan??5242880)/1048576).toFixed(0);console.log(E.yellow(`
75
+ \u26A0 ${Ct.length} file${Ct.length===1?"":"s"} skipped (>${M} MB):`));for(let O of Ct.slice(0,10))console.log(E.dim(` \u2192 ${O}`));Ct.length>10&&console.log(E.dim(` \u2026 and ${Ct.length-10} more`));}T.clear(),re.length===0&&console.log(E.yellow("No projects found."));let _s=Date.now()-s$1,Ho=await Lp(t,ke.remoteUrl,Ut.buildDeploy?.ci,e$1.repositoryName),Wo=Au(re),ae={schemaVersion:"1.0",timestamp:new Date().toISOString(),vibgrateVersion:r$1,rootPath:_.basename(t),...ke.type!=="unknown"?{vcs:ke}:{},repository:Ho,projects:re,...xt.length>0?{solutions:xt}:{},drift:zn,findings:fn,...Object.keys(Ut).length>0?{extended:Ut}:{},durationMs:_s,filesScanned:w,treeSummary:se,relationshipDiagram:qo,billing:Wo};if(e$1.baseline){let k=_.resolve(e$1.baseline);if(await p(k))try{let M=await n(k);ae.baseline=k,ae.delta=ae.drift.score-M.drift.score;}catch{console.error(E.yellow(`Warning: Could not read baseline file: ${k}`));}}if(!e$1.noLocalArtifacts&&!l){let k=_.join(t,".vibgrate");await q$1(k),await r(_.join(k,"scan_result.json"),ae),await r(_.join(k,"solutions.json"),{scannedAt:ae.timestamp,solutions:xt.map(M=>({solutionId:M.solutionId,name:M.name,path:M.path,type:M.type,projectPaths:M.projectPaths}))});}if(!e$1.noLocalArtifacts&&!l&&await Ap(t,{timestamp:ae.timestamp,totalDurationMs:_s,totalFiles:se.totalFiles,totalDirs:se.totalDirs,steps:m.getStepTimings()}),!e$1.noLocalArtifacts&&!l){let k={};for(let M of re)M.drift&&M.path&&(k[M.path]={projectId:M.projectId,name:M.name,type:M.type,path:M.path,score:M.drift.score,riskLevel:M.drift.riskLevel,components:M.drift.components,measured:M.drift.measured,scannedAt:ae.timestamp,vibgrateVersion:r$1,solutionId:M.solutionId,solutionName:M.solutionName});if(Object.keys(k).length>0){let M=_.join(t,".vibgrate");await q$1(M),await r(_.join(M,"project_scores.json"),k);}}if(e$1.format==="json"){let k=JSON.stringify(ae,null,2);e$1.out?(await s(_.resolve(e$1.out),k),console.log(E.green("\u2714")+` JSON written to ${e$1.out}`)):console.log(k);}else if(e$1.format==="sarif"){let k=Oa(ae),M=JSON.stringify(k,null,2);e$1.out?(await s(_.resolve(e$1.out),M),console.log(E.green("\u2714")+` SARIF written to ${e$1.out}`)):console.log(M);}else if(e$1.format==="md"){let k=Va(ae);console.log(k),e$1.out&&await s(_.resolve(e$1.out),k);}else {let k=Na(ae);console.log(k),e$1.out&&await s(_.resolve(e$1.out),k);}return ae}async function Lp(t,e,n$1,r){let s=r?.trim()?r.trim():await dp(t),o,a=_.join(t,"package.json");if(await p(a))try{let i=await n(a);typeof i.version=="string"&&i.version.trim()&&(o=i.version.trim());}catch{}return {name:s,...o?{version:o}:{},...n$1&&n$1.length>0?{pipeline:n$1.join(",")}:{},...e?{remoteUrl:e}:{}}}export{Tu as $,Sc as A,Pc as B,_c as C,Hc as D,Yc as E,tl as F,il as G,dl as H,bl as I,Ll as J,Hl as K,nu as L,uu as M,gu as N,yu as O,bu as P,vu as Q,wu as R,Su as S,ku as T,Eu as U,ju as V,xu as W,vs as X,ws as Y,Ss as Z,mf as _,ha as a,Cu as aa,sf as b,gf as ba,ma as c,Au as ca,ba as d,Pu as da,va as e,Mu as ea,wa as f,$u as fa,Sa as g,Lu as ga,_r as h,Nu as ha,ps as i,Ru as ia,Aa as j,Iu as ja,Pa as k,_u as ka,Ma as l,Fu as la,$a as m,Po as ma,La as n,qu as na,Br as o,Gu as oa,rf as p,Hu as pa,of as q,wf as qa,af as r,Zu as ra,cf as s,kf as sa,Na as t,pp as ta,Oa as u,Ef as ua,Va as v,dp as va,Ja as w,jf as wa,tc as x,hp as xa,nc as y,Mf as ya,gc as z};