@equinor/fusion-framework-cli
Version:
[](./LICENSE)
1 lines • 254 kB
JavaScript
import{loadConfigFromFile as e,mergeConfig as t,build as r}from"vite";import n from"vite-tsconfig-paths";import{dirname as i,resolve as o,basename as s,extname as a,relative as c}from"node:path";import{readPackageUp as l}from"read-package-up";import u,{fileURLToPath as f}from"node:url";import p from"url";import h from"node:module";import d from"util";import{accessSync as m,constants as g,readFileSync as v,statSync as y,existsSync as E,mkdirSync as b,writeFileSync as w}from"node:fs";import{stat as L,mkdir as S}from"node:fs/promises";import{importConfig as C,FileNotFoundError as I}from"@equinor/fusion-imports";import _ from"deepmerge";import D from"node:assert";import{execSync as O}from"node:child_process";import N,{z as A}from"zod";import P from"fs";import T from"path";import R from"zlib";import $ from"crypto";import x from"ora";import{createDevServer as F,processServices as k}from"@equinor/fusion-framework-dev-server";import{enableAuthModule as U}from"@equinor/fusion-framework-module-msal-node";const B=(e=0)=>t=>`[${t+e}m`,M=(e=0)=>t=>`[${38+e};5;${t}m`,G=(e=0)=>(t,r,n)=>`[${38+e};2;${t};${r};${n}m`,j={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(j.modifier);Object.keys(j.color),Object.keys(j.bgColor);const z=function(){const e=new Map;for(const[t,r]of Object.entries(j)){for(const[t,n]of Object.entries(r))j[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},r[t]=j[t],e.set(n[0],n[1]);Object.defineProperty(j,t,{value:r,enumerable:!1})}return Object.defineProperty(j,"codes",{value:e,enumerable:!1}),j.color.close="[39m",j.bgColor.close="[49m",j.color.ansi=B(),j.color.ansi256=M(),j.color.ansi16m=G(),j.bgColor.ansi=B(10),j.bgColor.ansi256=M(10),j.bgColor.ansi16m=G(10),Object.defineProperties(j,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;3===r.length&&(r=[...r].map(e=>e+e).join(""));const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},enumerable:!1},hexToAnsi256:{value:e=>j.rgbToAnsi256(...j.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,r,n;if(e>=232)t=(10*(e-232)+8)/255,r=t,n=t;else{const i=(e-=16)%36;t=Math.floor(e/36)/5,r=Math.floor(i/6)/5,n=i%6/5}const i=2*Math.max(t,r,n);if(0===i)return 30;let o=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return 2===i&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>j.ansi256ToAnsi(j.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>j.ansi256ToAnsi(j.hexToAnsi256(e)),enumerable:!1}}),j}(),H=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:e})=>"Chromium"===e);if(e&&e.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),q=0!==H&&{level:H},V={stdout:q,stderr:q};function W(e,t,r){let n=e.indexOf(t);if(-1===n)return e;const i=t.length;let o=0,s="";do{s+=e.slice(o,n)+t+r,o=n+i,n=e.indexOf(t,o)}while(-1!==n);return s+=e.slice(o),s}const{stdout:Y,stderr:K}=V,X=Symbol("GENERATOR"),Z=Symbol("STYLER"),J=Symbol("IS_EMPTY"),Q=["ansi","ansi","ansi256","ansi16m"],ee=Object.create(null),te=e=>{const t=(...e)=>e.join(" ");return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=Y?Y.level:0;e.level=void 0===t.level?r:t.level})(t,e),Object.setPrototypeOf(t,re.prototype),t};function re(e){return te(e)}Object.setPrototypeOf(re.prototype,Function.prototype);for(const[e,t]of Object.entries(z))ee[e]={get(){const r=ae(this,se(t.open,t.close,this[Z]),this[J]);return Object.defineProperty(this,e,{value:r}),r}};ee.visible={get(){const e=ae(this,this[Z],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const ne=(e,t,r,...n)=>"rgb"===e?"ansi16m"===t?z[r].ansi16m(...n):"ansi256"===t?z[r].ansi256(z.rgbToAnsi256(...n)):z[r].ansi(z.rgbToAnsi(...n)):"hex"===e?ne("rgb",t,r,...z.hexToRgb(...n)):z[r][e](...n),ie=["rgb","hex","ansi256"];for(const e of ie){ee[e]={get(){const{level:t}=this;return function(...r){const n=se(ne(e,Q[t],"color",...r),z.color.close,this[Z]);return ae(this,n,this[J])}}};ee["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...r){const n=se(ne(e,Q[t],"bgColor",...r),z.bgColor.close,this[Z]);return ae(this,n,this[J])}}}}const oe=Object.defineProperties(()=>{},{...ee,level:{enumerable:!0,get(){return this[X].level},set(e){this[X].level=e}}}),se=(e,t,r)=>{let n,i;return void 0===r?(n=e,i=t):(n=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:i,parent:r}},ae=(e,t,r)=>{const n=(...e)=>ce(n,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(n,oe),n[X]=e,n[Z]=t,n[J]=r,n},ce=(e,t)=>{if(e.level<=0||!t)return e[J]?"":t;let r=e[Z];if(void 0===r)return t;const{openAll:n,closeAll:i}=r;if(t.includes(""))for(;void 0!==r;)t=W(t,r.close,r.open),r=r.parent;const o=t.indexOf("\n");return-1!==o&&(t=function(e,t,r,n){let i=0,o="";do{const s="\r"===e[n-1];o+=e.slice(i,s?n-1:n)+t+(s?"\r\n":"\n")+r,i=n+1,n=e.indexOf("\n",i)}while(-1!==n);return o+=e.slice(i),o}(t,i,n,o)),n+t+i};Object.defineProperties(re.prototype,ee);const le=re();function ue(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fe,pe,he,de;function me(){if(pe)return fe;pe=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return fe=e}function ge(){if(de)return he;de=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return he={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}re({level:K?K.level:0});var ve,ye,Ee,be,we,Le,Se,Ce,Ie,_e,De,Oe,Ne,Ae={exports:{}};function Pe(){return ve||(ve=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=ge(),o=me(),s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],u=t.t={};let f=0;const p="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[p,n]],d=(e,t,r)=>{const n=(e=>{for(const[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=f++;o(e,i,t),u[e]=i,c[i]=t,l[i]=n,s[i]=new RegExp(t,r?"g":void 0),a[i]=new RegExp(n,r?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),d("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${p}+`),d("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),d("FULL",`^${c[u.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),d("LOOSE",`^${c[u.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),d("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),d("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),d("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),d("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?`+`(?:${c[u.BUILD]})?(?:$|[^\\d])`),d("COERCERTL",c[u.COERCE],!0),d("COERCERTLFULL",c[u.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ae,Ae.exports)),Ae.exports}function Te(){if(Ee)return ye;Ee=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return ye=r=>r?"object"!=typeof r?e:r:t}function Re(){if(we)return be;we=1;const e=/^[0-9]+$/,t=(t,r)=>{if("number"==typeof t&&"number"==typeof r)return t===r?0:t<r?-1:1;const n=e.test(t),i=e.test(r);return n&&i&&(t=+t,r=+r),t===r?0:n&&!i?-1:i&&!n?1:t<r?-1:1};return be={compareIdentifiers:t,rcompareIdentifiers:(e,r)=>t(r,e)}}function $e(){if(Se)return Le;Se=1;const e=me(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=ge(),{safeRe:n,t:i}=Pe(),o=Te(),{compareIdentifiers:s}=Re();class a{constructor(s,c){if(c=o(c),s instanceof a){if(s.loose===!!c.loose&&s.includePrerelease===!!c.includePrerelease)return s;s=s.version}else if("string"!=typeof s)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",s,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const l=s.trim().match(c.loose?n[i.LOOSE]:n[i.FULL]);if(!l)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");l[4]?this.prerelease=l[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<r)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof a)){if("string"==typeof t&&t===this.version)return 0;t=new a(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof a||(e=new a(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(t){if(t instanceof a||(t=new a(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(e("prerelease compare",r,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return s(n,i)}while(++r)}compareBuild(t){t instanceof a||(t=new a(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(e("build compare",r,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return s(n,i)}while(++r)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===s(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Le=a}function xe(){if(Ie)return Ce;Ie=1;const e=$e();return Ce=(t,r,n=!1)=>{if(t instanceof e)return t;try{return new e(t,r)}catch(e){if(!n)return null;throw e}},Ce}function Fe(){if(De)return _e;De=1;const e=xe();return _e=(t,r)=>{const n=e(t,r);return n?n.version:null},_e}function ke(){if(Ne)return Oe;Ne=1;const e=xe();return Oe=(t,r)=>{const n=e(t.trim().replace(/^[=v]+/,""),r);return n?n.version:null},Oe}var Ue,Be,Me,Ge,je,ze,He,qe,Ve,We,Ye=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"],Ke=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"],Xe=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"];function Ze(){if(Be)return Ue;Be=1;var e=[].concat(Ye).concat(Ke),t=Xe;return Ue=function(r){var n=0;function i(){return n<r.length}function o(e){if(e instanceof RegExp){var t=r.slice(n).match(e);if(t)return n+=t[0].length,t[0]}else if(r.indexOf(e,n)===n)return n+=e.length,e}function s(){o(/[ ]*/)}function a(){return o(/[A-Za-z0-9-.]+/)}function c(){var e=a();if(!e)throw new Error("Expected idstring at offset "+n);return e}function l(){return function(){for(var e,t=["WITH","AND","OR","(",")",":","+"],i=0;i<t.length&&!(e=o(t[i]));i++);if("+"===e&&n>1&&" "===r[n-2])throw new Error("Space before `+`");return e&&{type:"OPERATOR",string:e}}()||function(){if(o("DocumentRef-"))return{type:"DOCUMENTREF",string:c()}}()||function(){if(o("LicenseRef-"))return{type:"LICENSEREF",string:c()}}()||(i=n,s=a(),-1!==e.indexOf(s)?{type:"LICENSE",string:s}:-1!==t.indexOf(s)?{type:"EXCEPTION",string:s}:void(n=i));var i,s}for(var u=[];i()&&(s(),i());){var f=l();if(!f)throw new Error("Unexpected `"+r[n]+"` at offset "+n);u.push(f)}return u}}function Je(){return Ge?Me:(Ge=1,Me=function(e){var t=0;function r(){return t<e.length}function n(){return r()?e[t]:null}function i(){if(!r())throw new Error;t++}function o(e){var t=n();if(t&&"OPERATOR"===t.type&&e===t.string)return i(),t.string}function s(){var e=n();if(e&&"LICENSE"===e.type){i();var t={license:e.string};o("+")&&(t.plus=!0);var r=function(){if(o("WITH")){var e=n();if(e&&"EXCEPTION"===e.type)return i(),e.string;throw new Error("Expected exception after `WITH`")}}();return r&&(t.exception=r),t}}function a(e,t){return function r(){var n=t();if(n){if(!o(e))return n;var i=r();if(!i)throw new Error("Expected expression");return{left:n,conjunction:e.toLowerCase(),right:i}}}}var c=a("AND",function(){return function(){if(o("(")){var e=l();if(!o(")"))throw new Error("Expected `)`");return e}}()||function(){var e=t,r="",s=n();if("DOCUMENTREF"===s.type&&(i(),r+="DocumentRef-"+s.string+":",!o(":")))throw new Error("Expected `:` after `DocumentRef-...`");if("LICENSEREF"===(s=n()).type)return i(),{license:r+="LicenseRef-"+s.string};t=e}()||s()}),l=a("OR",c),u=l();if(!u||r())throw new Error("Syntax error");return u})}function Qe(){if(ze)return je;ze=1;var e=Ze(),t=Je();return je=function(r){return t(e(r))}}function et(){if(We)return Ve;We=1;var e=Qe(),t=function(){if(qe)return He;qe=1;var e=Qe(),t=Ye;function r(t){try{return e(t),!0}catch(e){return!1}}function n(e,t){var r=t[0].length-e[0].length;return 0!==r?r:e[0].toUpperCase().localeCompare(t[0].toUpperCase())}var i=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(n),o=[function(e){return e.toUpperCase()},function(e){return e.trim()},function(e){return e.replace(/\./g,"")},function(e){return e.replace(/\s+/g,"")},function(e){return e.replace(/\s+/g,"-")},function(e){return e.replace("v","-")},function(e){return e.replace(/,?\s*(\d)/,"-$1")},function(e){return e.replace(/,?\s*(\d)/,"-$1.0")},function(e){return e.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(e){return e.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(e){return e[0].toUpperCase()+e.slice(1)},function(e){return e.replace("/","-")},function(e){return e.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(e){return-1!==e.indexOf("3.0")?e+"-or-later":e+"-only"},function(e){return e+"only"},function(e){return e.replace(/(\d)$/,"-$1.0")},function(e){return e.replace(/(-| )?(\d)$/,"-$2-Clause")},function(e){return e.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(e){return e.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(e){return e.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(e){return e.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(e){return e.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(e){return e.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(e){return"CC-"+e},function(e){return"CC-"+e+"-4.0"},function(e){return e.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(e){return"CC-"+e.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],s=t.map(function(e){var t=/^(.*)-\d+\.\d+$/.exec(e);return t?[t[0],t[1]]:[e,null]}).reduce(function(e,t){var r=t[1];return e[r]=e[r]||[],e[r].push(t[0]),e},{}),a=Object.keys(s).map(function(e){return[e,s[e]]}).filter(function(e){return 1===e[1].length&&null!==e[0]&&"APL"!==e[0]}).map(function(e){return[e[0],e[1][0]]});s=void 0;var c=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(a).sort(n),l=function(e){for(var t=0;t<o.length;t++){var n=o[t](e).trim();if(n!==e&&r(n))return n}return null},u=function(e){for(var t=e.toUpperCase(),r=0;r<c.length;r++){var n=c[r];if(t.indexOf(n[0])>-1)return n[1]}return null},f=function(e,t){for(var r=0;r<i.length;r++){var n=i[r],o=n[0];if(e.indexOf(o)>-1){var s=t(e.replace(o,n[1]));if(null!==s)return s}}return null};return He=function(e,t){var n=void 0===(t=t||{}).upgrade||!!t.upgrade;function i(e){return n?function(e){return-1!==["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(e)?e+"-only":-1!==["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(e)?e.replace(/\+$/,"-or-later"):-1!==["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(e)?e+"-or-later":e}(e):e}if("string"!=typeof e||0===e.trim().length)throw Error("Invalid argument. Expected non-empty string.");if(r(e=e.trim()))return i(e);var o=e.replace(/\+$/,"").trim();if(r(o))return i(o);var s=l(e);return null!==s||null!==(s=f(e,function(e){return r(e)?e:l(e)}))||null!==(s=u(e))||null!==(s=f(e,u))?i(s):null}}(),r='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',n=/^SEE LICEN[CS]E IN (.+)$/;function i(e,t){return t.slice(0,e.length)===e}function o(e){if(e.hasOwnProperty("license")){var t=e.license;return i("LicenseRef",t)||i("DocumentRef",t)}return o(e.left)||o(e.right)}return Ve=function(i){var s;try{s=e(i)}catch(e){var a;if("UNLICENSED"===i||"UNLICENCED"===i)return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(a=n.exec(i))return{validForOldPackages:!0,validForNewPackages:!0,inFile:a[1]};var c={validForOldPackages:!1,validForNewPackages:!1,warnings:[r]};if(0!==i.trim().length){var l=t(i);l&&c.warnings.push('license is similar to the valid expression "'+l+'"')}return c}return o(s)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[r]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}}}var tt,rt,nt,it,ot,st,at,ct,lt,ut,ft,pt={};function ht(){if(tt)return pt;tt=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.LRUCache=void 0;const e="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,t=new Set,r="object"==typeof process&&process?process:{},n=(e,t,n,i)=>{"function"==typeof r.emitWarning?r.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)};let i=globalThis.AbortController,o=globalThis.AbortSignal;if(void 0===i){o=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},i=class{constructor(){t()}signal=new o;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==r.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,n("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const s=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),a=e=>s(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?c:null:null;class c extends Array{constructor(e){super(e),this.fill(0)}}class l{heap;length;static#e=!1;static create(e){const t=a(e);if(!t)return[];l.#e=!0;const r=new l(e,t);return l.#e=!1,r}constructor(e,t){if(!l.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class u{#t;#r;#n;#i;#o;#s;#a;#c;get perf(){return this.#c}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#u;#f;#p;#h;#d;#m;#g;#v;#y;#E;#b;#w;#L;#S;#C;#I;#_;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#L,sizes:e.#b,keyMap:e.#f,keyList:e.#p,valList:e.#h,next:e.#d,prev:e.#m,get head(){return e.#g},get tail(){return e.#v},free:e.#y,isBackgroundFetch:t=>e.#D(t),backgroundFetch:(t,r,n,i)=>e.#O(t,r,n,i),moveToTail:t=>e.#N(t),indexes:t=>e.#A(t),rindexes:t=>e.#P(t),isStale:t=>e.#T(t)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#u}get size(){return this.#l}get fetchMethod(){return this.#s}get memoMethod(){return this.#a}get dispose(){return this.#n}get onInsert(){return this.#i}get disposeAfter(){return this.#o}constructor(r){const{max:i=0,ttl:o,ttlResolution:c=1,ttlAutopurge:f,updateAgeOnGet:p,updateAgeOnHas:h,allowStale:d,dispose:m,onInsert:g,disposeAfter:v,noDisposeOnSet:y,noUpdateTTL:E,maxSize:b=0,maxEntrySize:w=0,sizeCalculation:L,fetchMethod:S,memoMethod:C,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:_,allowStaleOnFetchRejection:D,allowStaleOnFetchAbort:O,ignoreFetchAbort:N,perf:A}=r;if(void 0!==A&&"function"!=typeof A?.now)throw new TypeError("perf option must have a now() method if specified");if(this.#c=A??e,0!==i&&!s(i))throw new TypeError("max option must be a nonnegative integer");const P=i?a(i):Array;if(!P)throw new Error("invalid max value: "+i);if(this.#t=i,this.#r=b,this.maxEntrySize=w||this.#r,this.sizeCalculation=L,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==C&&"function"!=typeof C)throw new TypeError("memoMethod must be a function if defined");if(this.#a=C,void 0!==S&&"function"!=typeof S)throw new TypeError("fetchMethod must be a function if specified");if(this.#s=S,this.#C=!!S,this.#f=new Map,this.#p=new Array(i).fill(void 0),this.#h=new Array(i).fill(void 0),this.#d=new P(i),this.#m=new P(i),this.#g=0,this.#v=0,this.#y=l.create(i),this.#l=0,this.#u=0,"function"==typeof m&&(this.#n=m),"function"==typeof g&&(this.#i=g),"function"==typeof v?(this.#o=v,this.#E=[]):(this.#o=void 0,this.#E=void 0),this.#S=!!this.#n,this.#_=!!this.#i,this.#I=!!this.#o,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!E,this.noDeleteOnFetchRejection=!!I,this.allowStaleOnFetchRejection=!!D,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!N,0!==this.maxEntrySize){if(0!==this.#r&&!s(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!s(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#R()}if(this.allowStale=!!d,this.noDeleteOnStaleGet=!!_,this.updateAgeOnGet=!!p,this.updateAgeOnHas=!!h,this.ttlResolution=s(c)||0===c?c:1,this.ttlAutopurge=!!f,this.ttl=o||0,this.ttl){if(!s(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#$()}if(0===this.#t&&0===this.ttl&&0===this.#r)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){const e="LRU_CACHE_UNBOUNDED";if((e=>!t.has(e))(e)){t.add(e);n("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,u)}}}getRemainingTTL(e){return this.#f.has(e)?1/0:0}#$(){const e=new c(this.#t),t=new c(this.#t);this.#L=e,this.#w=t,this.#x=(r,n,i=this.#c.now())=>{if(t[r]=0!==n?i:0,e[r]=n,0!==n&&this.ttlAutopurge){const e=setTimeout(()=>{this.#T(r)&&this.#F(this.#p[r],"expire")},n+1);e.unref&&e.unref()}},this.#k=r=>{t[r]=0!==e[r]?this.#c.now():0},this.#U=(i,o)=>{if(e[o]){const s=e[o],a=t[o];if(!s||!a)return;i.ttl=s,i.start=a,i.now=r||n();const c=i.now-a;i.remainingTTL=s-c}};let r=0;const n=()=>{const e=this.#c.now();if(this.ttlResolution>0){r=e;const t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=i=>{const o=this.#f.get(i);if(void 0===o)return 0;const s=e[o],a=t[o];if(!s||!a)return 1/0;return s-((r||n())-a)},this.#T=i=>{const o=t[i],s=e[i];return!!s&&!!o&&(r||n())-o>s}}#k=()=>{};#U=()=>{};#x=()=>{};#T=()=>!1;#R(){const e=new c(this.#t);this.#u=0,this.#b=e,this.#B=t=>{this.#u-=e[t],e[t]=0},this.#M=(e,t,r,n)=>{if(this.#D(t))return 0;if(!s(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(t,e),!s(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#G=(t,r,n)=>{if(e[t]=r,this.#r){const r=this.#r-e[t];for(;this.#u>r;)this.#j(!0)}this.#u+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#u)}}#B=e=>{};#G=(e,t,r)=>{};#M=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#v;this.#z(t)&&(!e&&this.#T(t)||(yield t),t!==this.#g);)t=this.#m[t]}*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#g;this.#z(t)&&(!e&&this.#T(t)||(yield t),t!==this.#v);)t=this.#d[t]}#z(e){return void 0!==e&&this.#f.get(this.#p[e])===e}*entries(){for(const e of this.#A())void 0===this.#h[e]||void 0===this.#p[e]||this.#D(this.#h[e])||(yield[this.#p[e],this.#h[e]])}*rentries(){for(const e of this.#P())void 0===this.#h[e]||void 0===this.#p[e]||this.#D(this.#h[e])||(yield[this.#p[e],this.#h[e]])}*keys(){for(const e of this.#A()){const t=this.#p[e];void 0===t||this.#D(this.#h[e])||(yield t)}}*rkeys(){for(const e of this.#P()){const t=this.#p[e];void 0===t||this.#D(this.#h[e])||(yield t)}}*values(){for(const e of this.#A()){void 0===this.#h[e]||this.#D(this.#h[e])||(yield this.#h[e])}}*rvalues(){for(const e of this.#P()){void 0===this.#h[e]||this.#D(this.#h[e])||(yield this.#h[e])}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const r of this.#A()){const n=this.#h[r],i=this.#D(n)?n.__staleWhileFetching:n;if(void 0!==i&&e(i,this.#p[r],this))return this.get(this.#p[r],t)}}forEach(e,t=this){for(const r of this.#A()){const n=this.#h[r],i=this.#D(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#p[r],this)}}rforEach(e,t=this){for(const r of this.#P()){const n=this.#h[r],i=this.#D(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#p[r],this)}}purgeStale(){let e=!1;for(const t of this.#P({allowStale:!0}))this.#T(t)&&(this.#F(this.#p[t],"expire"),e=!0);return e}info(e){const t=this.#f.get(e);if(void 0===t)return;const r=this.#h[t],n=this.#D(r)?r.__staleWhileFetching:r;if(void 0===n)return;const i={value:n};if(this.#L&&this.#w){const e=this.#L[t],r=this.#w[t];if(e&&r){const t=e-(this.#c.now()-r);i.ttl=t,i.start=Date.now()}}return this.#b&&(i.size=this.#b[t]),i}dump(){const e=[];for(const t of this.#A({allowStale:!0})){const r=this.#p[t],n=this.#h[t],i=this.#D(n)?n.__staleWhileFetching:n;if(void 0===i||void 0===r)continue;const o={value:i};if(this.#L&&this.#w){o.ttl=this.#L[t];const e=this.#c.now()-this.#w[t];o.start=Math.floor(Date.now()-e)}this.#b&&(o.size=this.#b[t]),e.unshift([r,o])}return e}load(e){this.clear();for(const[t,r]of e){if(r.start){const e=Date.now()-r.start;r.start=this.#c.now()-e}this.set(t,r.value,r)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;const{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const l=this.#M(e,t,r.size||0,s);if(this.maxEntrySize&&l>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#F(e,"set"),this;let u=0===this.#l?void 0:this.#f.get(e);if(void 0===u)u=0===this.#l?this.#v:0!==this.#y.length?this.#y.pop():this.#l===this.#t?this.#j(!1):this.#l,this.#p[u]=e,this.#h[u]=t,this.#f.set(e,u),this.#d[this.#v]=u,this.#m[u]=this.#v,this.#v=u,this.#l++,this.#G(u,l,a),a&&(a.set="add"),c=!1,this.#_&&this.#i?.(t,e,"add");else{this.#N(u);const r=this.#h[u];if(t!==r){if(this.#C&&this.#D(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;void 0===t||o||(this.#S&&this.#n?.(t,e,"set"),this.#I&&this.#E?.push([t,e,"set"]))}else o||(this.#S&&this.#n?.(r,e,"set"),this.#I&&this.#E?.push([r,e,"set"]));if(this.#B(u),this.#G(u,l,a),this.#h[u]=t,a){a.set="replace";const e=r&&this.#D(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update");this.#_&&this.onInsert?.(t,e,t===r?"update":"replace")}if(0===n||this.#L||this.#$(),this.#L&&(c||this.#x(u,n,i),a&&this.#U(a,u)),!o&&this.#I&&this.#E){const e=this.#E;let t;for(;t=e?.shift();)this.#o?.(...t)}return this}pop(){try{for(;this.#l;){const e=this.#h[this.#g];if(this.#j(!0),this.#D(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#I&&this.#E){const e=this.#E;let t;for(;t=e?.shift();)this.#o?.(...t)}}}#j(e){const t=this.#g,r=this.#p[t],n=this.#h[t];return this.#C&&this.#D(n)?n.__abortController.abort(new Error("evicted")):(this.#S||this.#I)&&(this.#S&&this.#n?.(n,r,"evict"),this.#I&&this.#E?.push([n,r,"evict"])),this.#B(t),e&&(this.#p[t]=void 0,this.#h[t]=void 0,this.#y.push(t)),1===this.#l?(this.#g=this.#v=0,this.#y.length=0):this.#g=this.#d[t],this.#f.delete(r),this.#l--,t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,i=this.#f.get(e);if(void 0!==i){const e=this.#h[i];if(this.#D(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#T(i))return r&&this.#k(i),n&&(n.has="hit",this.#U(n,i)),!0;n&&(n.has="stale",this.#U(n,i))}else n&&(n.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,n=this.#f.get(e);if(void 0===n||!r&&this.#T(n))return;const i=this.#h[n];return this.#D(i)?i.__staleWhileFetching:i}#O(e,t,r,n){const o=void 0===t?void 0:this.#h[t];if(this.#D(o))return o;const s=new i,{signal:a}=r;a?.addEventListener("abort",()=>s.abort(a.reason),{signal:s.signal});const c={signal:s.signal,options:r,context:n},l=(n,i=!1)=>{const{aborted:o}=s.signal,a=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(o&&!i?(r.status.fetchAborted=!0,r.status.fetchError=s.signal.reason,a&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),o&&!a&&!i)return u(s.signal.reason);const l=f;return this.#h[t]===f&&(void 0===n?void 0!==l.__staleWhileFetching?this.#h[t]=l.__staleWhileFetching:this.#F(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,c.options))),n},u=n=>{const{aborted:i}=s.signal,o=i&&r.allowStaleOnFetchAbort,a=o||r.allowStaleOnFetchRejection,c=a||r.noDeleteOnFetchRejection,l=f;if(this.#h[t]===f){!c||void 0===l.__staleWhileFetching?this.#F(e,"fetch"):o||(this.#h[t]=l.__staleWhileFetching)}if(a)return r.status&&void 0!==l.__staleWhileFetching&&(r.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw n};r.status&&(r.status.fetchDispatched=!0);const f=new Promise((t,n)=>{const i=this.#s?.(e,o,c);i&&i instanceof Promise&&i.then(e=>t(void 0===e?void 0:e),n),s.signal.addEventListener("abort",()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})}).then(l,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),u(e))),p=Object.assign(f,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return void 0===t?(this.set(e,p,{...c.options,status:void 0}),t=this.#f.get(e)):this.#h[t]=p,p}#D(e){if(!this.#C)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof i}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:h=this.allowStaleOnFetchAbort,context:d,forceRefresh:m=!1,status:g,signal:v}=t;if(!this.#C)return g&&(g.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:g});const y={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:h,ignoreFetchAbort:p,status:g,signal:v};let E=this.#f.get(e);if(void 0===E){g&&(g.fetch="miss");const t=this.#O(e,E,y,d);return t.__returned=t}{const t=this.#h[E];if(this.#D(t)){const e=r&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const i=this.#T(E);if(!m&&!i)return g&&(g.fetch="hit"),this.#N(E),n&&this.#k(E),g&&this.#U(g,E),t;const o=this.#O(e,E,y,d),s=void 0!==o.__staleWhileFetching&&r;return g&&(g.fetch=i?"stale":"refre