@preventive/triage 1.0.0-alpha.77 → 1.0.0-alpha.79

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.
Files changed (63) hide show
  1. package/common/line-diff.d.ts +2 -0
  2. package/common/line-diff.js +54 -0
  3. package/common/managed/dependency-routes.js +25 -0
  4. package/common/managed/finding-values.d.ts +2 -2
  5. package/common/managed/finding-values.js +128 -34
  6. package/common/managed/routes.js +9 -12
  7. package/common/pretty-json.js +95 -0
  8. package/common/pretty-print.d.ts +1 -0
  9. package/common/pretty-print.js +6 -0
  10. package/common/whitespace-insensitive.js +19 -0
  11. package/out/activity.js +2 -2
  12. package/out/{chunk-OCE6KQGJ.js → chunk-26W3E5JE.js} +1 -1
  13. package/out/chunk-3S4YWYOM.js +1 -0
  14. package/out/{chunk-OQS2USZM.js → chunk-55YIWY3H.js} +1 -1
  15. package/out/{chunk-IVDE66N5.js → chunk-6VXEPL32.js} +1 -1
  16. package/out/{chunk-XVKDPU4D.js → chunk-6Y6PZ2BU.js} +1 -1
  17. package/out/{chunk-S5PPXPAT.js → chunk-ATT2QA77.js} +1 -1
  18. package/out/{chunk-2V6Q4ZOZ.js → chunk-B64CTMVU.js} +1 -1
  19. package/out/{chunk-EXQQ5VQJ.js → chunk-BEKYZCPX.js} +1 -1
  20. package/out/{chunk-S2ZIKK45.js → chunk-EEJA7JBI.js} +1 -1
  21. package/out/{chunk-4IW3VD3H.js → chunk-FSU2PLJL.js} +1 -1
  22. package/out/{chunk-N7TD27UJ.js → chunk-IIJK4F4U.js} +1 -1
  23. package/out/{chunk-I6UQQKAH.js → chunk-LVSLM7HB.js} +1 -1
  24. package/out/{chunk-T6EXDRB7.js → chunk-MKX6JODK.js} +1 -1
  25. package/out/chunk-NTJJIEHS.js +259 -0
  26. package/out/{chunk-NEFCZAIY.js → chunk-PKLVXUEI.js} +1 -1
  27. package/out/chunk-QBIUW5EF.js +2 -0
  28. package/out/{chunk-ADMVRLNP.js → chunk-QD3IBSF4.js} +1 -1
  29. package/out/{chunk-GSNSP3EF.js → chunk-RPNO56H2.js} +1 -1
  30. package/out/{chunk-QBFT2DDR.js → chunk-UR4WYMIP.js} +1 -1
  31. package/out/{chunk-5DWOFBKS.js → chunk-V43XH2JQ.js} +1 -1
  32. package/out/{chunk-UH6NZBSU.js → chunk-VHEXSGGP.js} +1 -1
  33. package/out/chunk-XLX6XXJF.js +1 -0
  34. package/out/{chunk-BXQCCW7F.js → chunk-XM4RLC4A.js} +1 -1
  35. package/out/chunk-Z54AXVCK.js +3 -0
  36. package/out/client-managed-import.js +1 -1
  37. package/out/client-managed.js +4 -4
  38. package/out/compare.js +14 -14
  39. package/out/dialogs.js +37 -37
  40. package/out/graph.js +1 -1
  41. package/out/index.html +9 -7
  42. package/out/scan.js +2 -2
  43. package/out/terminal.js +7 -7
  44. package/out/view.css +1 -1
  45. package/out/view.js +8 -8
  46. package/package.json +8 -2
  47. package/server-managed/dependency-review-comments.ts +17 -10
  48. package/server-managed/http.ts +83 -19
  49. package/server-managed/npm-delta-worker.js +58 -12
  50. package/server-managed/npm-delta.ts +52 -28
  51. package/server-managed/npm-kept.ts +11 -1
  52. package/server-managed/pretty-copies.ts +22 -0
  53. package/server-managed/pretty-format.d.ts +3 -0
  54. package/server-managed/pretty-format.js +13 -0
  55. package/server-managed/pretty-print.ts +34 -24
  56. package/server-managed/public-workspace.ts +1 -1
  57. package/server-managed/team-reports.ts +25 -15
  58. package/out/chunk-G6YPDPW7.js +0 -2
  59. package/out/chunk-JCIIBLKR.js +0 -1
  60. package/out/chunk-SDLETN3Z.js +0 -3
  61. package/out/chunk-WGQ7D5DB.js +0 -1
  62. package/out/chunk-Z6DL5PPO.js +0 -255
  63. /package/out/{chunk-Z667U2UJ.js → chunk-SZWPYLPC.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{a as e,e as t}from"./chunk-UJSJMXEG.js";import{A as n,B as r,C as i,E as a,F as o,G as s,H as c,M as l,O as u,Q as ee,S as d,a as f,d as p,e as m,f as te,i as ne,m as h,n as g,o as re,p as ie,q as _,r as v,u as ae,v as oe,x as y,z as se}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{d as b,e as ce,f as x,g as le,h as S,i as C,j as ue,l as de,m as fe}from"./chunk-7HP2VYIC.js";import"./chunk-OOJM4CTU.js";function w(e,t=new Set){if(t.has(e))return;t.add(e);let{parent:n}=e;if(n===void 0)return;let r=w(n,t);return r===void 0?n.bundleDependencies?.includes(e.folder)||e.edgesIn.some(e=>w(e.from,t)===n)?n:void 0:r}var pe=({parent:e})=>e!==void 0&&(e.bundleDependencies!==void 0||pe(e)),me=e=>pe(e)?w(e):void 0;function he(e,t){let n=me(e);return n!==void 0&&n!==t}function ge(e,t){let n=me(e);if(e.inBundle!==(n!==void 0))throw new b(n===void 0?`set, where nothing bundles it`:`expected true, as ${S(n.location)} bundles it`,C(e.where,`inBundle`));let{resolution:r}=e;if(n===void 0||n===t){if(r===void 0)throw new b(`expected where it comes from, resolved or an integrity`,e.where)}else if(r!==void 0){let t=r.type===`git`||r.tarball!==void 0?`resolved`:`integrity`;throw new b(`npm takes it from the tarball of ${S(n.location)}, and from nothing else`,C(e.where,t))}}function _e(e){let t=e.get(``);for(let n of e.values())n.kind===`package`&&ge(n,t)}var T=e=>e?.endsWith(`.git`)?e.slice(0,-4):e;function E(e,t,n){let r=T(t);return e&&r?{user:e,project:r,committish:n}:void 0}var ve=e=>t=>{let[,n,r,i]=t.pathname.split(`/`,4);return i===e?void 0:E(n,r,t.hash.slice(1))},D={__proto__:null,github:{protocols:[`git:`,`http:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`github.com`,extract:e=>{let[,t,n,r,i]=e.pathname.split(`/`,5);if(!(r&&r!==`tree`))return E(t,n,r?i:e.hash.slice(1))}},bitbucket:{protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`bitbucket.org`,extract:ve(`get`)},gitlab:{protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gitlab.com`,extract:e=>{let t=e.pathname.slice(1);if(t.includes(`/-/`)||t.includes(`/archive.tar.gz`))return;let n=t.split(`/`),r=n.pop();return E(n.join(`/`),r,e.hash.slice(1))}},gist:{protocols:[`git:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gist.github.com`,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(r!==`raw`&&(t||n))return{user:n?t:null,project:T(n||t),committish:e.hash.slice(1)}}},sourcehut:{protocols:[`git+ssh:`,`https:`],domain:`git.sr.ht`,extract:ve(`archive`)}},ye=new Map(Object.entries(D).map(([e,t])=>[t.domain,e])),be=new Map(Object.keys(D).map(e=>[`${e}:`,e])),xe=new Set([`git+ssh:`,`ssh:`,`git+https:`,`git:`,`http:`,`https:`,`git+http:`,...be.keys()]);function Se(e){let t=e.indexOf(`#`),n=e=>e===-1||t>-1&&e>t,r=e.indexOf(`/`);return n(e.search(/\s/u))&&r>0&&(t>-1?e[t-1]!==`/`:!e.endsWith(`/`))&&!e.startsWith(`.`)&&n(e.indexOf(`@`))&&n(e.indexOf(`:`))&&n(e.indexOf(`/`,r+1))}var O=(e,t,n)=>{let r=e.indexOf(n);return e.lastIndexOf(t,r>-1?r:1/0)};function Ce(e){let t=e.indexOf(`:`);if(xe.has(e.slice(0,t+1))||e.slice(t,t+3)===`://`)return e;let n=e.indexOf(`@`);return n>-1?n>t?`git+ssh://${e}`:e:`${e.slice(0,t+1)}//${e.slice(t+1)}`}function we(e){let t=e,n=O(t,`:`,`#`);return n>O(t,`@`,`#`)&&(t=`${t.slice(0,n)}/${t.slice(n+1)}`),O(t,`:`,`#`)===-1&&!t.includes(`//`)&&(t=`git+ssh://${t}`),t}var k=e=>e&&decodeURIComponent(e);function Te(e){let t=e.pathname.startsWith(`/`)?e.pathname.slice(1):e.pathname,n=t.indexOf(`@`);n>-1&&(t=t.slice(n+1));let r=t.lastIndexOf(`/`),i=T(k(t.slice(r+1)));return{user:r>-1&&k(t.slice(0,r))||null,project:i,committish:k(e.hash.slice(1))||null}}function A(e){if(!e)return;let t=Ce(Se(e)?`github:${e}`:e),n=URL.parse(t)??URL.parse(we(t));if(n===null)return;let r=be.get(n.protocol),i=r??ye.get(n.hostname.replace(/^www\./u,``));if(i!==void 0)try{if(r!==void 0)return{type:i,...Te(n)};if(!D[i].protocols.includes(n.protocol))return;let e=D[i].extract(n);return e===void 0?void 0:{type:i,user:k(e.user),project:k(e.project),committish:k(e.committish)||null}}catch(e){if(e instanceof URIError)return;throw e}}function Ee({type:e,user:t,project:n,committish:r},i){let a=i&&r?`#${r}`:``;return e===`gist`?`git@${D[e].domain}:${n}.git${a}`:`git@${D[e].domain}:${t}/${n}.git${a}`}var De=/^(?:[Gg][Ii][Tt]\+)?[A-Za-z]+:/u,Oe=/^[^@]+@[^.:]+\.[^:]+:.+$/iu,j=/\.(?:tgz|tar\.gz|tar)$/iu,ke=e=>j.test(e),M=/^git(?:\+(?:https?|rsync|ftp|ssh))?:/u,N=(e,t)=>new b(`${S(e)} is ${t}`);function Ae(e,t){let n=j.test(e)?`file`:`directory`;if(/^file:/iu.test(e)&&!e.startsWith(`file:`))throw N(e,`a path whose "file:" npm reads in another case otherwise`);let r=e.startsWith(`file:`)?e.slice(5):e;if(/^(?:[/~]|[A-Za-z]:)/u.test(r))throw N(e,`a path from the root, a drive or the home directory, which a lockfile does not hold`);return{type:n,path:o(t,r)}}function P(e,t){let n={committish:null,range:null};for(let r of t?t.split(`::`):[]){let[t,i]=r.includes(`:`)?r.split(`:`):[void 0,r];if(t===`path`)throw N(e,`a subdirectory of a repository, which is not supported`);if(t!==void 0&&t!==`semver`)throw N(e,`a git spec with ${S(t)}, which npm passes over`);if(n.committish!==null||n.range!==null)throw N(e,`a git spec with two refs or ranges, which npm refuses`);t===void 0?n.committish=i:n.range=je(e,i)}return n}var je=(e,t)=>x(()=>decodeURIComponent(t),()=>{throw N(e,`a git spec npm cannot decode`)});function Me(e){let t=e.startsWith(`git+ssh:`)?/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/iu.exec(e):null;if(t!==null&&!/:\d+(?:\/|$)/u.test(t[1]))return{type:`git`,hosted:void 0,fetchSpec:t[1],...P(e,t[2])};let n=URL.parse(e);if(n===null)throw N(e,`not a URL npm reads`);if(n.protocol===`http:`||n.protocol===`https:`)return{type:`remote`,url:e};if(!M.test(n.protocol))throw N(e,`of a protocol npm does not read, ${S(n.protocol)}`);let r=P(e,n.hash.slice(1));return n.hash=``,{type:`git`,hosted:void 0,fetchSpec:n.href.replace(/^git\+/u,``),...r}}function Ne(e,t,n){let r=t.trim();if(n===void 0)return{type:`registry`,name:e,fetchSpec:r,kind:void 0};let i=`tag`;if(n.valid(r,!0)===null?n.validRange(r,!0)!==null&&(i=`range`):i=`version`,i===`tag`&&encodeURIComponent(r)!==r)throw N(t,`a tag npm refuses, of a character a URL escapes`);return{type:`registry`,name:e,fetchSpec:r,kind:i}}function F(e,t,n,r){if(/^(?:file:|[.]|~\/|\/|[A-Za-z]:)/iu.test(t))return Ae(t,n);if(/^npm:/iu.test(t))return Fe(t,n,r);let i=A(t);return i===void 0?De.test(t)?Me(t):t.includes(`/`)||j.test(t)?Ae(t,n):Ne(e,t,r):{type:`git`,hosted:i,fetchSpec:void 0,...P(t,i.committish)}}function Pe(e,t,n){let r=e.indexOf(`@`,1),i=r>0?e.slice(0,r):e;return De.test(e)?F(void 0,e,t,n):Oe.test(e)?F(void 0,`git+ssh://${e}`,t,n):!i.startsWith(`@`)&&(i.includes(`/`)||j.test(i))?F(void 0,e,t,n):F(y(i,void 0),r>0&&e.slice(r+1)||`*`,t,n)}function Fe(e,t,n){let r=Pe(e.slice(4),t,n);if(r.type===`alias`)throw N(e,`an alias of an alias, which npm refuses`);if(r.type!==`registry`||r.name===void 0)throw N(e,`an alias of no package of the registry, which npm refuses`);return{type:`alias`,sub:r}}var I=(e,t,n,r)=>F(e,t||`*`,n,r),Ie=e=>F(void 0,e,`.`,void 0),L=[`dev`,`optional`,`devOptional`,`peer`],Le=[`name`,`version`,`dependencies`,`optionalDependencies`,`peerDependencies`,`peerDependenciesMeta`,`bundleDependencies`,`acceptDependencies`,`funding`,`engines`,`os`,`cpu`,`libc`,`license`,`hasInstallScript`,`bin`,`deprecated`,`workspaces`,...L],Re={link:[`link`,`resolved`],importer:[...Le,`devDependencies`],package:[...Le,`resolved`,`integrity`,`inBundle`]},ze={hasShrinkwrap:`a shrinkwrap of its own, which is not supported`,extraneous:`nothing leads to it, and npm prunes it rather than install it`};function R(e,t){if(typeof e==`object`&&e&&Object.keys(e).length===0)throw new b(`expected what npm writes, which leaves an empty ${Array.isArray(e)?`sequence`:`mapping`} out`,t);return e}var Be=e=>(t,n)=>ie(R(t,n),n,e),z=(e,t)=>_(R(e,t),t,y),Ve=(e,t)=>y(g(e,t),t),He=(e,t)=>re(R(e,t),t,y),B=(e,t)=>re(R(e,t),t),V=e=>(t,n)=>Array.isArray(t)?B(t,n):e(t,n),Ue=Be((e,t,n)=>(y(n,t),{optional:h(m(e,t),`optional`,t,ne)??!1}));function We(e,t){return typeof e==`string`?g(e,t):(m(R(e,t),t),{type:h(e,`type`,t,g),url:h(e,`url`,t,g)})}var Ge=(e,t)=>Array.isArray(e)?R(e,t).map((e,n)=>We(e,`${t}[${n}]`)):We(e,t);function Ke(e,t,i){if(!n(i)||/[/:]/u.test(i))throw new b(`${S(i)} is not the name of a bin, as npm writes one`,t);if(!r(g(e,t).replace(/\/$/u,``)))throw new b(`${S(e)} is not a path within the package, as npm writes a bin's`,t);return e}var qe=V((e,t)=>(m(R(e,t),t,[`packages`,`nohoist`]),h(e,`nohoist`,t,B),B(e.packages,C(t,`packages`)))),Je={__proto__:null,dependencies:z,optionalDependencies:z,peerDependencies:z,devDependencies:(e,t)=>_(e,t,y),peerDependenciesMeta:Ue,acceptDependencies:z,bundleDependencies:He,funding:Ge,engines:V((e,t)=>_(R(e,t),t)),os:B,cpu:B,libc:B,license:V(g),bin:Be(Ke),deprecated:g,workspaces:qe};function Ye(e,t){let n=Object.fromEntries(L.map(n=>[n,v(e[n],C(t,n))]));if(n.devOptional&&(n.dev||n.optional))throw new b(`set beside dev or optional, where npm leaves it out`,C(t,`devOptional`));return n}var Xe=(e,t)=>u(e,t)&&e;function Ze(e,t,n,r){if(e.startsWith(`file:`)){if(!ke(e))throw new b(`${S(e)} is a directory, which npm packs again at every install: not supported`,r);i(e.slice(5),r)}else{if(!ee(e))throw new b(`${S(e)} is not an http(s) URL, a file: tarball or a git URL`,r);if(A(e)!==void 0)throw new b(`${S(e)} is a repository to npm, which it reads as one on a git host`,r);d(e,t,n,r)}}function Qe(e,t,n,r){let i=C(t,`resolved`),a=h(e,`resolved`,t,g),o=h(e,`integrity`,t,Xe);if(a===void 0)return o===void 0?void 0:{type:`tarball`,tarball:void 0,integrity:o};if(M.test(a)){if(o!==void 0)throw new b(`an integrity, which npm does not check for a git repository`,C(t,`integrity`));let e=a.lastIndexOf(`#`);if(e===-1||!c(a.slice(e+1)))throw new b(`expected a full commit hash after the "#" of ${S(a)}`,i);return{type:`git`,repo:l(a.slice(0,e),i),commit:a.slice(e+1)}}if(Ze(a,n,r,i),o===void 0)throw new b(`expected an integrity, which npm checks the tarball with`,t);return{type:`tarball`,tarball:a,integrity:o}}function $e(e){let t=e.split(`/`),n=t.at(-1);return t.at(-2)?.startsWith(`@`)?`${t.at(-2)}/${n}`:n}function et(e,t){if(m(e,t,Re.link,ze),e.link!==!0)throw p(`true`,e.link,C(t,`link`));return e.resolved===``?``:i(e.resolved,C(t,`resolved`))}function tt(e,t,n,r){m(e,t,Re[n],ze);let i=Object.create(null);for(let[n,r]of Object.entries(Je))i[n]=h(e,n,t,r);if(n===`importer`&&r!==void 0&&i.bundleDependencies!==void 0)throw new b(`a bundle of a directory, which is not supported`,C(t,`bundleDependencies`));let a=h(e,`name`,t,Ve);if(a!==void 0&&a===r)throw new b(`the name of its folder, which npm leaves out`,C(t,`name`));let o=h(e,`version`,t,n===`package`?se:g);if(n===`package`&&o===void 0&&!M.test(e.resolved??``))throw new b(`expected a version, which only a package from a git repository is read without`,C(t,`version`));let s={name:a??r,version:o,...i,hasInstallScript:v(e.hasInstallScript,C(t,`hasInstallScript`)),flags:Ye(e,t)};return n===`package`&&(s.resolution=Qe(e,t,s.name,o),s.inBundle=v(e.inBundle,C(t,`inBundle`))),s}var H=`packages`,nt=/^(?:(.+)\/)?node_modules\/((?:@[^/]+\/)?[^/]+)$/u;function rt(e,t){if(e===``)return{kind:`root`,parent:void 0,folder:void 0};i(e,t);let n=nt.exec(e);if(n!==null){if(n[2]===`node_modules`)throw new b(`a folder named "node_modules", which no package is`,t);return{kind:`package`,parent:n[1]??``,folder:y(n[2],t)}}let r=e.split(`/`);if(r.includes(`node_modules`))throw new b(`in a node_modules, but none of its packages`,t);if(r.every(e=>e===`..`))throw new b(`a directory the project is in, which is not supported`,t);return{kind:`importer`,parent:void 0,folder:$e(e)}}function it(e,t,n){let{kind:r,parent:i,folder:a}=rt(e,n),o={location:e,where:n,kind:r,parentLocation:i,folder:a,parent:void 0,fsParent:void 0,children:new Map,links:[],edges:new Map,edgesIn:[]};if(t?.link===void 0)return Object.assign(o,tt(t,n,r===`package`?`package`:`importer`,a));if(r!==`package`)throw new b(`a link outside a node_modules, where npm writes none`,n);return Object.assign(o,{kind:`link`,targetLocation:et(t,n),target:void 0})}function at(e,t){let n=t.get(e.parentLocation);if(n===void 0)throw new b(`in the node_modules of ${S(e.parentLocation)}, which the lockfile does not have`,e.where);if(n.kind===`link`)throw new b(`in the node_modules of ${S(e.parentLocation)}, a link, in which npm installs nothing`,e.where);let r=e.folder.toLowerCase(),i=n.children.get(r);if(i!==void 0)throw new b(`in the folder of ${S(i.location)} to npm, which takes names in one case`,e.where);n.children.set(r,e),e.parent=n}function ot(e,t){let n=t.get(e.targetLocation),r=C(e.where,`resolved`);if(n===void 0)throw new b(`${S(e.targetLocation)} is not in the lockfile, where npm looks for what a link leads to`,r);if(n.kind===`link`)throw new b(`${S(e.targetLocation)} is a link, where npm links the project, a directory or a package`,r);e.target=n,n.links.push(e)}function st(e,t){let n=e.location.split(`/`);for(;n.pop()!==void 0&&n.at(-1)!==`..`;){let e=t.get(n.join(`/`));if(e!==void 0)return e}}var U=e=>e.parent??e.fsParent,W=e=>e.kind===`link`?e.target:e,G=e=>e.location||`.`;function ct(e,t){let n=t.toLowerCase();for(let t=e;t!==void 0;t=U(t)){let e=t.children.get(n);if(e!==void 0)return e}}function lt(e){let t=new Map;for(let[n,r,i]of te(e,H))t.set(n,it(n,r,i));t.has(``)||t.set(``,it(``,Object.create(null),C(H,``)));for(let e of t.values())e.parentLocation!==void 0&&at(e,t),e.kind===`link`&&ot(e,t);for(let e of t.values())if(e.kind===`importer`){if(e.links.length===0)throw new b(`a directory no link leads to, of which npm installs nothing`,e.where);e.fsParent=st(e,t)}return t}function ut(n){let r=n.get(``),i=C(r.where,`workspaces`),a=new Map;for(let[o,s]of(r.workspaces??[]).entries()){let r=e(s.replace(/^\.?\/+/u,``),`${i}[${o}]`);for(let e of n.values()){if(e.kind!==`importer`||a.get(e.name)===e||!t(r,e.location))continue;let n=y(e.name,C(e.where,`name`));if(a.has(n))throw new b(`the name of the workspace ${S(a.get(n).location)} too, of which npm keeps one`,e.where);a.set(n,e)}}return a}var dt={__proto__:null,workspace:`workspaces`,peer:`peerDependencies`,peerOptional:`peerDependencies`,prod:`dependencies`,optional:`optionalDependencies`,dev:`devDependencies`},ft=e=>e.type===`workspace`?C(e.from.where,`workspaces`):C(C(e.from.where,dt[e.type]),e.name);function pt(e,t,n){let r=(t,n,r)=>{let i=t.toLowerCase(),a=e.edges.get(i);if(a?.type===`workspace`)return;let o={name:t,type:n,spec:r,accept:e.acceptDependencies?.[t],from:e,to:void 0};if(a!==void 0&&a.name!==t)throw new b(`${S(a.name)} too, to npm, which takes names in one case`,ft(o));e.edges.delete(i),e.edges.set(i,o)};if(e.kind===`root`)for(let[e,{location:n}]of t)r(e,`workspace`,`file:${n}`);let i=e.peerDependenciesMeta??Object.create(null),a=n?[]:Object.entries(e.peerDependencies??{});for(let[e,t]of a)i[e]?.optional||r(e,`peer`,t);for(let[e,t]of a)i[e]?.optional&&r(e,`peerOptional`,t);for(let t of e.parent===void 0?[`prod`,`optional`,`dev`]:[`prod`,`optional`])for(let[n,i]of Object.entries(e[dt[t]]??{}))r(n,t,i)}function mt(e,t,n){for(let r of e.values())r.kind!==`link`&&pt(r,t,n);for(let t of e.values())for(let e of t.edges.values())e.to=ct(t,e.name),e.to?.edgesIn.push(e)}var K=[...L,`extraneous`],ht=e=>new Map([...e.values()].map(e=>[e,Object.fromEntries(K.map(t=>[t,e.kind!==`root`]))]));function gt(e,t,n){if(!e.get(t)[n])for(let r=U(t);r!==void 0&&e.get(r)[n];r=U(r))e.get(r)[n]=!1}function _t(e,t){let[n,r,i]=[t===`dev`,t===`optional`||t===`peerOptional`,t.startsWith(`peer`)];return{extraneous:!e.extraneous&&!(i&&r),dev:!e.dev&&!n,optional:!e.optional&&!r,devOptional:!e.devOptional&&!e.dev&&!e.optional&&!n&&!r,peer:!e.peer&&!i}}function vt(e,t){let n=ht(e),r=new Set,i=[e.get(``)];for(;i.length>0;){let e=i.pop();r.add(e);let a=n.get(e);if(gt(n,e,`extraneous`),e.kind===`link`){let o=n.get(e.target),s=K.filter(e=>o[e]&&!a[e]);if(t)Object.assign(o,a);else for(let e of s)o[e]=!1;(t||s.length>0||!r.has(e.target))&&i.push(e.target)}else for(let{type:t,to:r}of e.edges.values()){if(r===void 0)continue;let e=_t(a,t),o=n.get(r),s=K.filter(t=>o[t]&&e[t]);for(let e of s)o[e]=!1;s.length>0&&i.push(r)}}return n}function yt(e,t,n){let r=[e],i=new Set;for(;r.length>0;){let e=r.pop();i.has(e)||(i.add(e),r.push(...n(e,t(e))))}}function bt(e){let t=ht(e),n=(e,n)=>{if(!t.get(e)[n])return;let r=e=>Object.assign(t.get(e),{extraneous:!1,[n]:!1});yt(e,e=>{r(e),e.kind===`link`&&r(e.target)},e=>[...W(e).edges.values()].filter(({type:e,to:r})=>r!==void 0&&t.get(r)[n]&&(n!==`peer`&&e===`peer`||e===`prod`)).map(({to:e})=>e))},r=e=>{let i=t.get(e);i.extraneous=!1;for(let n of K)gt(t,e,n);if(e.kind===`link`){for(let n of L)t.get(e.target)[n]=i[n];return r(e.target)}for(let{type:r,to:a}of e.edges.values()){if(a===void 0)continue;t.get(a).extraneous=!1;let e=_t(i,r);for(let t of[`peer`,`devOptional`,`dev`,`optional`])e[t]&&n(a,t)}return e};return yt(e.get(``),r,(e,t)=>[...t.edges.values()].map(({to:e})=>e).filter(e=>e!==void 0)),t}function xt(e,t,n){for(let r of e.values()){let e=t.get(r);if(e.extraneous)return new b(`nothing installed leads to it, so ${n} takes it as extraneous, and prunes it`,r.where);if(r.kind===`link`)continue;let i={...e,devOptional:e.devOptional&&!e.dev&&!e.optional},a=L.find(e=>r.flags[e]!==i[e]);if(a!==void 0)return new b(`expected ${i[a]?`true`:`none`}, as ${n} sets it from what depends on it`,C(r.where,a))}}var q=[e=>vt(e,!1),e=>vt(e,!0),bt];function St(e){let[t,n,r]=e.split(`.`).map(Number);return t>11||t===11&&n>=18?q[0]:q[t===11&&(n>6||n===6&&r>=3)?1:2]}function Ct(e,t,n=t===void 0?`npm`:`npm ${t}`){let r=xt(e,(t===void 0?q[0]:St(t))(e),n);if(r!==void 0&&(t!==void 0||q.slice(1).every(t=>xt(e,t(e),`npm`)!==void 0)))throw r}var wt=64;function J(e,t){if(typeof e!=`object`||!e)return e;if(t>wt)throw new b(`nested more than ${wt} deep, as npm writes nothing`);if(Array.isArray(e))return e.map(e=>J(e,t+1));let n=Object.create(null);for(let[r,i]of Object.entries(e))n[r]=J(i,t+1);return n}function Tt(e,t){let n=e.split(`
1
+ import{a as e,e as t}from"./chunk-UJSJMXEG.js";import{A as n,B as r,C as i,E as a,F as o,G as s,H as c,M as l,O as u,Q as ee,S as d,a as f,d as p,e as m,f as te,i as ne,m as h,n as g,o as re,p as ie,q as _,r as v,u as ae,v as oe,x as y,z as se}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import{d as b,e as ce,f as x,g as le,h as S,i as C,j as ue,l as de,m as fe}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";function w(e,t=new Set){if(t.has(e))return;t.add(e);let{parent:n}=e;if(n===void 0)return;let r=w(n,t);return r===void 0?n.bundleDependencies?.includes(e.folder)||e.edgesIn.some(e=>w(e.from,t)===n)?n:void 0:r}var pe=({parent:e})=>e!==void 0&&(e.bundleDependencies!==void 0||pe(e)),me=e=>pe(e)?w(e):void 0;function he(e,t){let n=me(e);return n!==void 0&&n!==t}function ge(e,t){let n=me(e);if(e.inBundle!==(n!==void 0))throw new b(n===void 0?`set, where nothing bundles it`:`expected true, as ${S(n.location)} bundles it`,C(e.where,`inBundle`));let{resolution:r}=e;if(n===void 0||n===t){if(r===void 0)throw new b(`expected where it comes from, resolved or an integrity`,e.where)}else if(r!==void 0){let t=r.type===`git`||r.tarball!==void 0?`resolved`:`integrity`;throw new b(`npm takes it from the tarball of ${S(n.location)}, and from nothing else`,C(e.where,t))}}function _e(e){let t=e.get(``);for(let n of e.values())n.kind===`package`&&ge(n,t)}var T=e=>e?.endsWith(`.git`)?e.slice(0,-4):e;function E(e,t,n){let r=T(t);return e&&r?{user:e,project:r,committish:n}:void 0}var ve=e=>t=>{let[,n,r,i]=t.pathname.split(`/`,4);return i===e?void 0:E(n,r,t.hash.slice(1))},D={__proto__:null,github:{protocols:[`git:`,`http:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`github.com`,extract:e=>{let[,t,n,r,i]=e.pathname.split(`/`,5);if(!(r&&r!==`tree`))return E(t,n,r?i:e.hash.slice(1))}},bitbucket:{protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`bitbucket.org`,extract:ve(`get`)},gitlab:{protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gitlab.com`,extract:e=>{let t=e.pathname.slice(1);if(t.includes(`/-/`)||t.includes(`/archive.tar.gz`))return;let n=t.split(`/`),r=n.pop();return E(n.join(`/`),r,e.hash.slice(1))}},gist:{protocols:[`git:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gist.github.com`,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(r!==`raw`&&(t||n))return{user:n?t:null,project:T(n||t),committish:e.hash.slice(1)}}},sourcehut:{protocols:[`git+ssh:`,`https:`],domain:`git.sr.ht`,extract:ve(`archive`)}},ye=new Map(Object.entries(D).map(([e,t])=>[t.domain,e])),be=new Map(Object.keys(D).map(e=>[`${e}:`,e])),xe=new Set([`git+ssh:`,`ssh:`,`git+https:`,`git:`,`http:`,`https:`,`git+http:`,...be.keys()]);function Se(e){let t=e.indexOf(`#`),n=e=>e===-1||t>-1&&e>t,r=e.indexOf(`/`);return n(e.search(/\s/u))&&r>0&&(t>-1?e[t-1]!==`/`:!e.endsWith(`/`))&&!e.startsWith(`.`)&&n(e.indexOf(`@`))&&n(e.indexOf(`:`))&&n(e.indexOf(`/`,r+1))}var O=(e,t,n)=>{let r=e.indexOf(n);return e.lastIndexOf(t,r>-1?r:1/0)};function Ce(e){let t=e.indexOf(`:`);if(xe.has(e.slice(0,t+1))||e.slice(t,t+3)===`://`)return e;let n=e.indexOf(`@`);return n>-1?n>t?`git+ssh://${e}`:e:`${e.slice(0,t+1)}//${e.slice(t+1)}`}function we(e){let t=e,n=O(t,`:`,`#`);return n>O(t,`@`,`#`)&&(t=`${t.slice(0,n)}/${t.slice(n+1)}`),O(t,`:`,`#`)===-1&&!t.includes(`//`)&&(t=`git+ssh://${t}`),t}var k=e=>e&&decodeURIComponent(e);function Te(e){let t=e.pathname.startsWith(`/`)?e.pathname.slice(1):e.pathname,n=t.indexOf(`@`);n>-1&&(t=t.slice(n+1));let r=t.lastIndexOf(`/`),i=T(k(t.slice(r+1)));return{user:r>-1&&k(t.slice(0,r))||null,project:i,committish:k(e.hash.slice(1))||null}}function A(e){if(!e)return;let t=Ce(Se(e)?`github:${e}`:e),n=URL.parse(t)??URL.parse(we(t));if(n===null)return;let r=be.get(n.protocol),i=r??ye.get(n.hostname.replace(/^www\./u,``));if(i!==void 0)try{if(r!==void 0)return{type:i,...Te(n)};if(!D[i].protocols.includes(n.protocol))return;let e=D[i].extract(n);return e===void 0?void 0:{type:i,user:k(e.user),project:k(e.project),committish:k(e.committish)||null}}catch(e){if(e instanceof URIError)return;throw e}}function Ee({type:e,user:t,project:n,committish:r},i){let a=i&&r?`#${r}`:``;return e===`gist`?`git@${D[e].domain}:${n}.git${a}`:`git@${D[e].domain}:${t}/${n}.git${a}`}var De=/^(?:[Gg][Ii][Tt]\+)?[A-Za-z]+:/u,Oe=/^[^@]+@[^.:]+\.[^:]+:.+$/iu,j=/\.(?:tgz|tar\.gz|tar)$/iu,ke=e=>j.test(e),M=/^git(?:\+(?:https?|rsync|ftp|ssh))?:/u,N=(e,t)=>new b(`${S(e)} is ${t}`);function Ae(e,t){let n=j.test(e)?`file`:`directory`;if(/^file:/iu.test(e)&&!e.startsWith(`file:`))throw N(e,`a path whose "file:" npm reads in another case otherwise`);let r=e.startsWith(`file:`)?e.slice(5):e;if(/^(?:[/~]|[A-Za-z]:)/u.test(r))throw N(e,`a path from the root, a drive or the home directory, which a lockfile does not hold`);return{type:n,path:o(t,r)}}function P(e,t){let n={committish:null,range:null};for(let r of t?t.split(`::`):[]){let[t,i]=r.includes(`:`)?r.split(`:`):[void 0,r];if(t===`path`)throw N(e,`a subdirectory of a repository, which is not supported`);if(t!==void 0&&t!==`semver`)throw N(e,`a git spec with ${S(t)}, which npm passes over`);if(n.committish!==null||n.range!==null)throw N(e,`a git spec with two refs or ranges, which npm refuses`);t===void 0?n.committish=i:n.range=je(e,i)}return n}var je=(e,t)=>x(()=>decodeURIComponent(t),()=>{throw N(e,`a git spec npm cannot decode`)});function Me(e){let t=e.startsWith(`git+ssh:`)?/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/iu.exec(e):null;if(t!==null&&!/:\d+(?:\/|$)/u.test(t[1]))return{type:`git`,hosted:void 0,fetchSpec:t[1],...P(e,t[2])};let n=URL.parse(e);if(n===null)throw N(e,`not a URL npm reads`);if(n.protocol===`http:`||n.protocol===`https:`)return{type:`remote`,url:e};if(!M.test(n.protocol))throw N(e,`of a protocol npm does not read, ${S(n.protocol)}`);let r=P(e,n.hash.slice(1));return n.hash=``,{type:`git`,hosted:void 0,fetchSpec:n.href.replace(/^git\+/u,``),...r}}function Ne(e,t,n){let r=t.trim();if(n===void 0)return{type:`registry`,name:e,fetchSpec:r,kind:void 0};let i=`tag`;if(n.valid(r,!0)===null?n.validRange(r,!0)!==null&&(i=`range`):i=`version`,i===`tag`&&encodeURIComponent(r)!==r)throw N(t,`a tag npm refuses, of a character a URL escapes`);return{type:`registry`,name:e,fetchSpec:r,kind:i}}function F(e,t,n,r){if(/^(?:file:|[.]|~\/|\/|[A-Za-z]:)/iu.test(t))return Ae(t,n);if(/^npm:/iu.test(t))return Fe(t,n,r);let i=A(t);return i===void 0?De.test(t)?Me(t):t.includes(`/`)||j.test(t)?Ae(t,n):Ne(e,t,r):{type:`git`,hosted:i,fetchSpec:void 0,...P(t,i.committish)}}function Pe(e,t,n){let r=e.indexOf(`@`,1),i=r>0?e.slice(0,r):e;return De.test(e)?F(void 0,e,t,n):Oe.test(e)?F(void 0,`git+ssh://${e}`,t,n):!i.startsWith(`@`)&&(i.includes(`/`)||j.test(i))?F(void 0,e,t,n):F(y(i,void 0),r>0&&e.slice(r+1)||`*`,t,n)}function Fe(e,t,n){let r=Pe(e.slice(4),t,n);if(r.type===`alias`)throw N(e,`an alias of an alias, which npm refuses`);if(r.type!==`registry`||r.name===void 0)throw N(e,`an alias of no package of the registry, which npm refuses`);return{type:`alias`,sub:r}}var I=(e,t,n,r)=>F(e,t||`*`,n,r),Ie=e=>F(void 0,e,`.`,void 0),L=[`dev`,`optional`,`devOptional`,`peer`],Le=[`name`,`version`,`dependencies`,`optionalDependencies`,`peerDependencies`,`peerDependenciesMeta`,`bundleDependencies`,`acceptDependencies`,`funding`,`engines`,`os`,`cpu`,`libc`,`license`,`hasInstallScript`,`bin`,`deprecated`,`workspaces`,...L],Re={link:[`link`,`resolved`],importer:[...Le,`devDependencies`],package:[...Le,`resolved`,`integrity`,`inBundle`]},ze={hasShrinkwrap:`a shrinkwrap of its own, which is not supported`,extraneous:`nothing leads to it, and npm prunes it rather than install it`};function R(e,t){if(typeof e==`object`&&e&&Object.keys(e).length===0)throw new b(`expected what npm writes, which leaves an empty ${Array.isArray(e)?`sequence`:`mapping`} out`,t);return e}var Be=e=>(t,n)=>ie(R(t,n),n,e),z=(e,t)=>_(R(e,t),t,y),Ve=(e,t)=>y(g(e,t),t),He=(e,t)=>re(R(e,t),t,y),B=(e,t)=>re(R(e,t),t),V=e=>(t,n)=>Array.isArray(t)?B(t,n):e(t,n),Ue=Be((e,t,n)=>(y(n,t),{optional:h(m(e,t),`optional`,t,ne)??!1}));function We(e,t){return typeof e==`string`?g(e,t):(m(R(e,t),t),{type:h(e,`type`,t,g),url:h(e,`url`,t,g)})}var Ge=(e,t)=>Array.isArray(e)?R(e,t).map((e,n)=>We(e,`${t}[${n}]`)):We(e,t);function Ke(e,t,i){if(!n(i)||/[/:]/u.test(i))throw new b(`${S(i)} is not the name of a bin, as npm writes one`,t);if(!r(g(e,t).replace(/\/$/u,``)))throw new b(`${S(e)} is not a path within the package, as npm writes a bin's`,t);return e}var qe=V((e,t)=>(m(R(e,t),t,[`packages`,`nohoist`]),h(e,`nohoist`,t,B),B(e.packages,C(t,`packages`)))),Je={__proto__:null,dependencies:z,optionalDependencies:z,peerDependencies:z,devDependencies:(e,t)=>_(e,t,y),peerDependenciesMeta:Ue,acceptDependencies:z,bundleDependencies:He,funding:Ge,engines:V((e,t)=>_(R(e,t),t)),os:B,cpu:B,libc:B,license:V(g),bin:Be(Ke),deprecated:g,workspaces:qe};function Ye(e,t){let n=Object.fromEntries(L.map(n=>[n,v(e[n],C(t,n))]));if(n.devOptional&&(n.dev||n.optional))throw new b(`set beside dev or optional, where npm leaves it out`,C(t,`devOptional`));return n}var Xe=(e,t)=>u(e,t)&&e;function Ze(e,t,n,r){if(e.startsWith(`file:`)){if(!ke(e))throw new b(`${S(e)} is a directory, which npm packs again at every install: not supported`,r);i(e.slice(5),r)}else{if(!ee(e))throw new b(`${S(e)} is not an http(s) URL, a file: tarball or a git URL`,r);if(A(e)!==void 0)throw new b(`${S(e)} is a repository to npm, which it reads as one on a git host`,r);d(e,t,n,r)}}function Qe(e,t,n,r){let i=C(t,`resolved`),a=h(e,`resolved`,t,g),o=h(e,`integrity`,t,Xe);if(a===void 0)return o===void 0?void 0:{type:`tarball`,tarball:void 0,integrity:o};if(M.test(a)){if(o!==void 0)throw new b(`an integrity, which npm does not check for a git repository`,C(t,`integrity`));let e=a.lastIndexOf(`#`);if(e===-1||!c(a.slice(e+1)))throw new b(`expected a full commit hash after the "#" of ${S(a)}`,i);return{type:`git`,repo:l(a.slice(0,e),i),commit:a.slice(e+1)}}if(Ze(a,n,r,i),o===void 0)throw new b(`expected an integrity, which npm checks the tarball with`,t);return{type:`tarball`,tarball:a,integrity:o}}function $e(e){let t=e.split(`/`),n=t.at(-1);return t.at(-2)?.startsWith(`@`)?`${t.at(-2)}/${n}`:n}function et(e,t){if(m(e,t,Re.link,ze),e.link!==!0)throw p(`true`,e.link,C(t,`link`));return e.resolved===``?``:i(e.resolved,C(t,`resolved`))}function tt(e,t,n,r){m(e,t,Re[n],ze);let i=Object.create(null);for(let[n,r]of Object.entries(Je))i[n]=h(e,n,t,r);if(n===`importer`&&r!==void 0&&i.bundleDependencies!==void 0)throw new b(`a bundle of a directory, which is not supported`,C(t,`bundleDependencies`));let a=h(e,`name`,t,Ve);if(a!==void 0&&a===r)throw new b(`the name of its folder, which npm leaves out`,C(t,`name`));let o=h(e,`version`,t,n===`package`?se:g);if(n===`package`&&o===void 0&&!M.test(e.resolved??``))throw new b(`expected a version, which only a package from a git repository is read without`,C(t,`version`));let s={name:a??r,version:o,...i,hasInstallScript:v(e.hasInstallScript,C(t,`hasInstallScript`)),flags:Ye(e,t)};return n===`package`&&(s.resolution=Qe(e,t,s.name,o),s.inBundle=v(e.inBundle,C(t,`inBundle`))),s}var H=`packages`,nt=/^(?:(.+)\/)?node_modules\/((?:@[^/]+\/)?[^/]+)$/u;function rt(e,t){if(e===``)return{kind:`root`,parent:void 0,folder:void 0};i(e,t);let n=nt.exec(e);if(n!==null){if(n[2]===`node_modules`)throw new b(`a folder named "node_modules", which no package is`,t);return{kind:`package`,parent:n[1]??``,folder:y(n[2],t)}}let r=e.split(`/`);if(r.includes(`node_modules`))throw new b(`in a node_modules, but none of its packages`,t);if(r.every(e=>e===`..`))throw new b(`a directory the project is in, which is not supported`,t);return{kind:`importer`,parent:void 0,folder:$e(e)}}function it(e,t,n){let{kind:r,parent:i,folder:a}=rt(e,n),o={location:e,where:n,kind:r,parentLocation:i,folder:a,parent:void 0,fsParent:void 0,children:new Map,links:[],edges:new Map,edgesIn:[]};if(t?.link===void 0)return Object.assign(o,tt(t,n,r===`package`?`package`:`importer`,a));if(r!==`package`)throw new b(`a link outside a node_modules, where npm writes none`,n);return Object.assign(o,{kind:`link`,targetLocation:et(t,n),target:void 0})}function at(e,t){let n=t.get(e.parentLocation);if(n===void 0)throw new b(`in the node_modules of ${S(e.parentLocation)}, which the lockfile does not have`,e.where);if(n.kind===`link`)throw new b(`in the node_modules of ${S(e.parentLocation)}, a link, in which npm installs nothing`,e.where);let r=e.folder.toLowerCase(),i=n.children.get(r);if(i!==void 0)throw new b(`in the folder of ${S(i.location)} to npm, which takes names in one case`,e.where);n.children.set(r,e),e.parent=n}function ot(e,t){let n=t.get(e.targetLocation),r=C(e.where,`resolved`);if(n===void 0)throw new b(`${S(e.targetLocation)} is not in the lockfile, where npm looks for what a link leads to`,r);if(n.kind===`link`)throw new b(`${S(e.targetLocation)} is a link, where npm links the project, a directory or a package`,r);e.target=n,n.links.push(e)}function st(e,t){let n=e.location.split(`/`);for(;n.pop()!==void 0&&n.at(-1)!==`..`;){let e=t.get(n.join(`/`));if(e!==void 0)return e}}var U=e=>e.parent??e.fsParent,W=e=>e.kind===`link`?e.target:e,G=e=>e.location||`.`;function ct(e,t){let n=t.toLowerCase();for(let t=e;t!==void 0;t=U(t)){let e=t.children.get(n);if(e!==void 0)return e}}function lt(e){let t=new Map;for(let[n,r,i]of te(e,H))t.set(n,it(n,r,i));t.has(``)||t.set(``,it(``,Object.create(null),C(H,``)));for(let e of t.values())e.parentLocation!==void 0&&at(e,t),e.kind===`link`&&ot(e,t);for(let e of t.values())if(e.kind===`importer`){if(e.links.length===0)throw new b(`a directory no link leads to, of which npm installs nothing`,e.where);e.fsParent=st(e,t)}return t}function ut(n){let r=n.get(``),i=C(r.where,`workspaces`),a=new Map;for(let[o,s]of(r.workspaces??[]).entries()){let r=e(s.replace(/^\.?\/+/u,``),`${i}[${o}]`);for(let e of n.values()){if(e.kind!==`importer`||a.get(e.name)===e||!t(r,e.location))continue;let n=y(e.name,C(e.where,`name`));if(a.has(n))throw new b(`the name of the workspace ${S(a.get(n).location)} too, of which npm keeps one`,e.where);a.set(n,e)}}return a}var dt={__proto__:null,workspace:`workspaces`,peer:`peerDependencies`,peerOptional:`peerDependencies`,prod:`dependencies`,optional:`optionalDependencies`,dev:`devDependencies`},ft=e=>e.type===`workspace`?C(e.from.where,`workspaces`):C(C(e.from.where,dt[e.type]),e.name);function pt(e,t,n){let r=(t,n,r)=>{let i=t.toLowerCase(),a=e.edges.get(i);if(a?.type===`workspace`)return;let o={name:t,type:n,spec:r,accept:e.acceptDependencies?.[t],from:e,to:void 0};if(a!==void 0&&a.name!==t)throw new b(`${S(a.name)} too, to npm, which takes names in one case`,ft(o));e.edges.delete(i),e.edges.set(i,o)};if(e.kind===`root`)for(let[e,{location:n}]of t)r(e,`workspace`,`file:${n}`);let i=e.peerDependenciesMeta??Object.create(null),a=n?[]:Object.entries(e.peerDependencies??{});for(let[e,t]of a)i[e]?.optional||r(e,`peer`,t);for(let[e,t]of a)i[e]?.optional&&r(e,`peerOptional`,t);for(let t of e.parent===void 0?[`prod`,`optional`,`dev`]:[`prod`,`optional`])for(let[n,i]of Object.entries(e[dt[t]]??{}))r(n,t,i)}function mt(e,t,n){for(let r of e.values())r.kind!==`link`&&pt(r,t,n);for(let t of e.values())for(let e of t.edges.values())e.to=ct(t,e.name),e.to?.edgesIn.push(e)}var K=[...L,`extraneous`],ht=e=>new Map([...e.values()].map(e=>[e,Object.fromEntries(K.map(t=>[t,e.kind!==`root`]))]));function gt(e,t,n){if(!e.get(t)[n])for(let r=U(t);r!==void 0&&e.get(r)[n];r=U(r))e.get(r)[n]=!1}function _t(e,t){let[n,r,i]=[t===`dev`,t===`optional`||t===`peerOptional`,t.startsWith(`peer`)];return{extraneous:!e.extraneous&&!(i&&r),dev:!e.dev&&!n,optional:!e.optional&&!r,devOptional:!e.devOptional&&!e.dev&&!e.optional&&!n&&!r,peer:!e.peer&&!i}}function vt(e,t){let n=ht(e),r=new Set,i=[e.get(``)];for(;i.length>0;){let e=i.pop();r.add(e);let a=n.get(e);if(gt(n,e,`extraneous`),e.kind===`link`){let o=n.get(e.target),s=K.filter(e=>o[e]&&!a[e]);if(t)Object.assign(o,a);else for(let e of s)o[e]=!1;(t||s.length>0||!r.has(e.target))&&i.push(e.target)}else for(let{type:t,to:r}of e.edges.values()){if(r===void 0)continue;let e=_t(a,t),o=n.get(r),s=K.filter(t=>o[t]&&e[t]);for(let e of s)o[e]=!1;s.length>0&&i.push(r)}}return n}function yt(e,t,n){let r=[e],i=new Set;for(;r.length>0;){let e=r.pop();i.has(e)||(i.add(e),r.push(...n(e,t(e))))}}function bt(e){let t=ht(e),n=(e,n)=>{if(!t.get(e)[n])return;let r=e=>Object.assign(t.get(e),{extraneous:!1,[n]:!1});yt(e,e=>{r(e),e.kind===`link`&&r(e.target)},e=>[...W(e).edges.values()].filter(({type:e,to:r})=>r!==void 0&&t.get(r)[n]&&(n!==`peer`&&e===`peer`||e===`prod`)).map(({to:e})=>e))},r=e=>{let i=t.get(e);i.extraneous=!1;for(let n of K)gt(t,e,n);if(e.kind===`link`){for(let n of L)t.get(e.target)[n]=i[n];return r(e.target)}for(let{type:r,to:a}of e.edges.values()){if(a===void 0)continue;t.get(a).extraneous=!1;let e=_t(i,r);for(let t of[`peer`,`devOptional`,`dev`,`optional`])e[t]&&n(a,t)}return e};return yt(e.get(``),r,(e,t)=>[...t.edges.values()].map(({to:e})=>e).filter(e=>e!==void 0)),t}function xt(e,t,n){for(let r of e.values()){let e=t.get(r);if(e.extraneous)return new b(`nothing installed leads to it, so ${n} takes it as extraneous, and prunes it`,r.where);if(r.kind===`link`)continue;let i={...e,devOptional:e.devOptional&&!e.dev&&!e.optional},a=L.find(e=>r.flags[e]!==i[e]);if(a!==void 0)return new b(`expected ${i[a]?`true`:`none`}, as ${n} sets it from what depends on it`,C(r.where,a))}}var q=[e=>vt(e,!1),e=>vt(e,!0),bt];function St(e){let[t,n,r]=e.split(`.`).map(Number);return t>11||t===11&&n>=18?q[0]:q[t===11&&(n>6||n===6&&r>=3)?1:2]}function Ct(e,t,n=t===void 0?`npm`:`npm ${t}`){let r=xt(e,(t===void 0?q[0]:St(t))(e),n);if(r!==void 0&&(t!==void 0||q.slice(1).every(t=>xt(e,t(e),`npm`)!==void 0)))throw r}var wt=64;function J(e,t){if(typeof e!=`object`||!e)return e;if(t>wt)throw new b(`nested more than ${wt} deep, as npm writes nothing`);if(Array.isArray(e))return e.map(e=>J(e,t+1));let n=Object.create(null);for(let[r,i]of Object.entries(e))n[r]=J(i,t+1);return n}function Tt(e,t){let n=e.split(`
2
2
  `),r=t.split(`
3
3
  `),i=0;for(;n[i]===r[i];)i++;if(i===r.length-1&&i===n.length)return ue(`expected a line end after the last "}"`,i-1);let a=i<n.length?S(n[i]):`the end of the file`;return ue(`expected ${i<r.length?S(r[i]):`the end of the file`}, as npm writes it, found ${a}`,i)}function Et(e){de(e,`npm`);let[t,n]=fe(e,`npm`),r=x(()=>JSON.parse(e),e=>ce(`not JSON: ${e.message}`)),i=J(r,0),a=`${JSON.stringify(r,null,n)}
4
4
  `.replaceAll(`
@@ -1,3 +1,3 @@
1
- import{b as e,c as t,r as n,w as r}from"./chunk-WGQ7D5DB.js";import{a as i}from"./chunk-TUII34K2.js";var a=3,o=4,s=/^[\w-]{4}$/u,c=/^[\w-]{8}$/u,l=`AAAA`,u={report:`deepview/finding-link/report/v1
1
+ import{b as e,c as t,r as n,w as r}from"./chunk-XLX6XXJF.js";import{a as i}from"./chunk-TUII34K2.js";var a=3,o=4,s=/^[\w-]{4}$/u,c=/^[\w-]{8}$/u,l=`AAAA`,u={report:`deepview/finding-link/report/v1
2
2
  `,workspace:`deepview/finding-link/workspace/v1
3
3
  `},d=new Map;function f(e,t){return`${e}\0${t}`}function p(e){return typeof e==`string`&&s.test(e)}async function m(e,t){let n=u[e];if(!n||typeof t!=`string`||!t)return null;let r=f(e,t),o=d.get(r);if(o!==void 0)return o;let s;try{let e=await crypto.subtle.digest(`SHA-256`,i(n+t));s=new Uint8Array(e).slice(0,a).toBase64({alphabet:`base64url`,omitPadding:!0})}catch{return null}return d.set(r,s),s}function h(e,t){return typeof t!=`string`||!t?null:d.get(f(e,t))??null}function g(e,t){let n=[];for(let[r,i]of[[`report`,e],[`workspace`,t]])if(i==null||i===``)n.push(l);else{if(!p(i))throw TypeError(`encodeFindingRef: ${r} must be a link hint token, not a name`);n.push(i)}return n.every(e=>e===l)?null:n[0]===l?`w${n[1]}`:n.join(``)}function _(e){let t=[e.slice(0,o),e.slice(o)].map(e=>e===l?null:e);return{report:t[0],workspace:t[1]}}function v({id:e,report:n,workspace:r}={}){if(!t(e))throw TypeError(`encodeFindingRef: a persistent finding id is required`);let i=[`finding=${encodeURIComponent(e)}`],a=g(n,r);return a&&i.push(`v=${a}`),i.join(`&`)}function y(e,t){let n=v(e);return typeof location>`u`?`${t??``}#${n}`:`${location.origin}${t??location.pathname}#${n}`}function b(n){let r=typeof n==`string`?n:typeof location>`u`?``:location.hash;if(!r)return null;let i=r.replace(/^#/u,``);if(!i)return null;let a={id:null,report:null,workspace:null};for(let n of i.split(`&`)){let r=n.indexOf(`=`);if(r<0)continue;let i=n.slice(0,r),o=n.slice(r+1);if(!o)continue;if(i===`v`){if(o.length===5&&o[0]===`w`&&p(o.slice(1))){let e=o.slice(1);Object.assign(a,{report:null,workspace:e===l?null:e});continue}if(!c.test(o))continue;Object.assign(a,_(o));continue}if(i!==`finding`||o.length>e*3)continue;let s;try{s=decodeURIComponent(o)}catch{continue}t(s)&&(a.id=s)}return a.id?a:null}function x(e,{managed:t=!1}={}){if(typeof location>`u`)return null;let i;try{i=new URL(e)}catch{return null}if(i.href!==e||i.protocol!==location.protocol||i.host!==location.host||i.username||i.password)return null;let a=r(i);if(a?.finding)return{id:a.finding.id,fragment:v(a.finding),path:n(a)};if(t&&a?.view!==`home`&&!/\/(?:index|view)\.html$/u.test(i.pathname))return null;let o=b(i.hash);if(!o)return null;let s=v(o);return{id:o.id,fragment:s,path:`/#${s}`}}function S(e,t){if(typeof e!=`string`)return!1;let n=e.replaceAll(`\\`,`/`);return n.startsWith(`${t}/`)||n.includes(`/${t}/`)}function C(e){let t=!1;for(let n of e){for(let e of n.groups??[])for(let n of e){if(S(n.file,`node_modules`))return`node_modules`;S(n.file,`vendor`)&&(t=!0)}let e=n.tree?w(n.tree):n.treeDependencies;if(e===`node_modules`)return`node_modules`;e===`vendor`&&(t=!0)}return t?`vendor`:`dependencies`}function w(e){let t=!1;for(let n of Object.keys(e??{})){if(S(n,`node_modules`))return`node_modules`;S(n,`vendor`)&&(t=!0)}return t?`vendor`:null}export{S as a,C as b,m as c,h as d,v as e,y as f,b as g,x as h};
@@ -1,4 +1,4 @@
1
- import{b as e,c as t,d as n}from"./chunk-K4XJHM2T.js";import{a as r}from"./chunk-QI66YA4F.js";import{a as i,c as a,d as o,f as s,g as c}from"./chunk-GX5UXWT4.js";import{H as l,I as u,M as d,R as f,h as p,k as m,m as h,u as g}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{a as _,e as v,f as y,g as b}from"./chunk-VYYUMYVW.js";import{d as x,h as S,i as C}from"./chunk-7HP2VYIC.js";import"./chunk-OOJM4CTU.js";var w=/[/?<>\\:*|"]|[^\P{Cc}\u007F]/gu,T=/^\.+$/u,E=/^(?:con|prn|aux|nul|com\d|lpt\d)(?:\..*)?$/iu,D=/(?<![. ])[. ]+$/u,O=new TextEncoder,k=new Uint8Array(255),A=e=>e.slice(0,O.encodeInto(e,k).read);function j(e,{windows:t,truncate:n,replacement:r}){if(typeof e!=`string`||typeof r!=`string`)throw TypeError(`expected a string`);let i=e.replaceAll(w,()=>r).replace(T,()=>r);return t&&(i=i.replace(E,()=>r).replace(D,()=>r)),n?A(i):i}var M=new Set([`version`,`url`,`git`,`rev`,`branch`,`tag`,`project_root`]),N=e=>[!1,!0].map(t=>j(e,{windows:t,truncate:!0,replacement:`-`}));function P(e,t,n,r){for(let[i,a]of N(t).entries()){let t=e.get(`${i}/${a}`);if(t!==void 0)throw new x(`installed in the folder ${S(a)}, as ${S(t)} is`,r);e.set(`${i}/${a}`,n)}}function F(e,t){if(e===void 0||s(e,t)===``)throw new x(`expected a version, which Soldeer requires`,t);return e}function I(e,t){if(typeof e==`string`)return{kind:`registry`,version:F(e,t)};a(e,t);let n=Object.keys(e).find(e=>!M.has(e));if(n!==void 0)throw new x(`a field Soldeer does not read`,C(t,n));for(let n of M)n!==`version`&&h(e,n,t,s);let{url:r,git:i,rev:o}=e,c=i===void 0?r===void 0?`registry`:`URL`:`git`,l={kind:c,version:F(e.version,C(t,`version`)),url:r,git:i,rev:o},u=[`rev`,`branch`,`tag`].filter(t=>e[t]!==void 0);if(i===void 0&&u.length>0)throw new x(`a field Soldeer ignores without a git repository`,C(t,u[0]));if(i!==void 0&&r!==void 0)throw new x(`a url beside a git repository, which Soldeer refuses`,C(t,`url`));if(u.length>1)throw new x(`${u.join(` and `)}, of which Soldeer takes one alone`,t);if(c!==`registry`&&l.version.includes(`=`))throw new x(`${S(l.version)} has an "=", which Soldeer refuses in the version of what it does not resolve`,C(t,`version`));return l}function L(r,i){let a=i.split(`,`),o=t(i)?.map((e,t)=>e.op===`^`&&!/^ *\^/u.test(a[t])?{...e,op:`=`}:e),s=e(r);if(o!==void 0&&s!==void 0)return n(o,s);let[c,l]=[N(r),N(i)];return c[0]===l[0]&&c[1]===l[1]}var R={http:`a registry`,git:`a git`,private:`a private registry`},z={registry:[`http`,`private`],URL:[`http`],git:[`git`]};function B(e,t,n){let{kind:r}=t;if(!z[r].includes(e.type))throw new x(`a ${r} dependency, whose entry is ${R[e.type]} one`,n);let i=r!==`registry`;if(i?e.version!==t.version:!L(e.version,t.version))throw new x(`${S(t.version)}, which its entry's version, ${S(e.version)}, ${i?`is not`:`does not satisfy`}`,C(n,`version`));for(let r of[`url`,`git`,`rev`])if(t[r]!==void 0&&t[r]!==e[r])throw new x(`${S(t[r])}, where its entry has ${S(e[r])}`,C(n,r))}var V=[`remappings_generate`,`remappings_regenerate`,`remappings_version`,`recursive_deps`],H=[...V,`remappings_prefix`,`remappings_location`];function U(e,t){if(e===void 0)return;a(e,t,H);for(let n of V)h(e,n,t,c);h(e,`remappings_prefix`,t,s);let n=e.remappings_location;if(![void 0,`txt`,`config`].includes(n))throw new x(`expected "txt" or "config", found ${i(n)}`,C(t,`remappings_location`));if(e.recursive_deps===!0)throw new x(`has Soldeer install what each dependency depends on too, which the lockfile does not have`,C(t,`recursive_deps`))}function W(e,t){if(e!==void 0&&y(a(e,t)))throw new x(`an inline table, from which Soldeer reads no dependency`,t);return m(e)}function G(e,t){a(e,`config`),U(e.soldeer,`config.soldeer`);let n=W(e.dependencies,`config.dependencies`),r=new Map;for(let[e,i,a]of o(n,`config.dependencies`)){let n=I(i,a);P(r,e,e,a);let o=t[e];if(o===void 0)throw new x(`no entry in the lockfile, which Soldeer then resolves anew`,a);B(o,n,a)}for(let e of Object.keys(t))if(!Object.hasOwn(n,e))throw new x(`nothing in the config asks for it, and Soldeer drops it`,C(`dependencies`,e))}var K=[`name`,`version`,`git`,`url`,`rev`,`checksum`,`integrity`],q={http:[`name`,`version`,`url`,`checksum`,`integrity`],git:[`name`,`version`,`git`,`rev`],private:[`name`,`version`,`checksum`,`integrity`]},J={http:`a url`,git:`a git repository`,private:`neither a url nor a git repository`},Y=e=>e!==``&&![...e].some(e=>e<=`\x1F`||e===`\x7F`||e===`"`||e===`\\`);function X(e,t,n){let r=p(e[t],n);if(!Y(r))throw new x(`${S(r)} is empty, or has a quote, backslash or control character, which this reader does not take`,n);if((t===`checksum`||t===`integrity`)&&!u(r))throw new x(`${S(r)} is not a hex sha256`,n);if(t===`rev`&&!l(r))throw new x(`${S(r)} is not a full commit hash, as Soldeer writes`,n);if(t===`url`&&!f(r))throw new x(`${S(r)} is not an http(s) URL`,n);return t===`git`&&d(r,n),r}function Z(e,t){let n=`dependencies[${t}]`;if(!v(e))throw new x(`expected a table`,n);typeof e.name==`string`&&Y(e.name)&&(n=C(`dependencies`,e.name));for(let t of Object.keys(e)){if(t===`source`)throw new x(`a field of Soldeer 0.3 and older, whose entries 0.4 and later do not read`,C(n,t));if(!K.includes(t))throw new x(`unsupported field ${S(t)}`,C(n,t))}if(e.url!==void 0&&e.git!==void 0)throw new x(`both a url and a git repository, which Soldeer refuses`,n);let r=e.url===void 0?e.git===void 0?`private`:`git`:`http`,i={type:r};for(let t of q[r]){if(e[t]===void 0)throw new x(`expected ${t}, which Soldeer requires of an entry with ${J[r]}`,n);i[t]=X(e,t,C(n,t))}let a=K.find(t=>e[t]!==void 0&&!q[r].includes(t));if(a!==void 0)throw new x(`a field Soldeer does not write for an entry with ${J[r]}`,C(n,a));return[i,n]}function Q(e,t){let n=e===void 0?[]:[`version = ${e}`];if(t.length===0)return`${[...n,`dependencies = []`].join(`
1
+ import{b as e,c as t,d as n}from"./chunk-K4XJHM2T.js";import{a as r}from"./chunk-QI66YA4F.js";import{a as i,c as a,d as o,f as s,g as c}from"./chunk-GX5UXWT4.js";import{H as l,I as u,M as d,R as f,h as p,k as m,m as h,u as g}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import{a as _,e as v,f as y,g as b}from"./chunk-VYYUMYVW.js";import{d as x,h as S,i as C}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";var w=/[/?<>\\:*|"]|[^\P{Cc}\u007F]/gu,T=/^\.+$/u,E=/^(?:con|prn|aux|nul|com\d|lpt\d)(?:\..*)?$/iu,D=/(?<![. ])[. ]+$/u,O=new TextEncoder,k=new Uint8Array(255),A=e=>e.slice(0,O.encodeInto(e,k).read);function j(e,{windows:t,truncate:n,replacement:r}){if(typeof e!=`string`||typeof r!=`string`)throw TypeError(`expected a string`);let i=e.replaceAll(w,()=>r).replace(T,()=>r);return t&&(i=i.replace(E,()=>r).replace(D,()=>r)),n?A(i):i}var M=new Set([`version`,`url`,`git`,`rev`,`branch`,`tag`,`project_root`]),N=e=>[!1,!0].map(t=>j(e,{windows:t,truncate:!0,replacement:`-`}));function P(e,t,n,r){for(let[i,a]of N(t).entries()){let t=e.get(`${i}/${a}`);if(t!==void 0)throw new x(`installed in the folder ${S(a)}, as ${S(t)} is`,r);e.set(`${i}/${a}`,n)}}function F(e,t){if(e===void 0||s(e,t)===``)throw new x(`expected a version, which Soldeer requires`,t);return e}function I(e,t){if(typeof e==`string`)return{kind:`registry`,version:F(e,t)};a(e,t);let n=Object.keys(e).find(e=>!M.has(e));if(n!==void 0)throw new x(`a field Soldeer does not read`,C(t,n));for(let n of M)n!==`version`&&h(e,n,t,s);let{url:r,git:i,rev:o}=e,c=i===void 0?r===void 0?`registry`:`URL`:`git`,l={kind:c,version:F(e.version,C(t,`version`)),url:r,git:i,rev:o},u=[`rev`,`branch`,`tag`].filter(t=>e[t]!==void 0);if(i===void 0&&u.length>0)throw new x(`a field Soldeer ignores without a git repository`,C(t,u[0]));if(i!==void 0&&r!==void 0)throw new x(`a url beside a git repository, which Soldeer refuses`,C(t,`url`));if(u.length>1)throw new x(`${u.join(` and `)}, of which Soldeer takes one alone`,t);if(c!==`registry`&&l.version.includes(`=`))throw new x(`${S(l.version)} has an "=", which Soldeer refuses in the version of what it does not resolve`,C(t,`version`));return l}function L(r,i){let a=i.split(`,`),o=t(i)?.map((e,t)=>e.op===`^`&&!/^ *\^/u.test(a[t])?{...e,op:`=`}:e),s=e(r);if(o!==void 0&&s!==void 0)return n(o,s);let[c,l]=[N(r),N(i)];return c[0]===l[0]&&c[1]===l[1]}var R={http:`a registry`,git:`a git`,private:`a private registry`},z={registry:[`http`,`private`],URL:[`http`],git:[`git`]};function B(e,t,n){let{kind:r}=t;if(!z[r].includes(e.type))throw new x(`a ${r} dependency, whose entry is ${R[e.type]} one`,n);let i=r!==`registry`;if(i?e.version!==t.version:!L(e.version,t.version))throw new x(`${S(t.version)}, which its entry's version, ${S(e.version)}, ${i?`is not`:`does not satisfy`}`,C(n,`version`));for(let r of[`url`,`git`,`rev`])if(t[r]!==void 0&&t[r]!==e[r])throw new x(`${S(t[r])}, where its entry has ${S(e[r])}`,C(n,r))}var V=[`remappings_generate`,`remappings_regenerate`,`remappings_version`,`recursive_deps`],H=[...V,`remappings_prefix`,`remappings_location`];function U(e,t){if(e===void 0)return;a(e,t,H);for(let n of V)h(e,n,t,c);h(e,`remappings_prefix`,t,s);let n=e.remappings_location;if(![void 0,`txt`,`config`].includes(n))throw new x(`expected "txt" or "config", found ${i(n)}`,C(t,`remappings_location`));if(e.recursive_deps===!0)throw new x(`has Soldeer install what each dependency depends on too, which the lockfile does not have`,C(t,`recursive_deps`))}function W(e,t){if(e!==void 0&&y(a(e,t)))throw new x(`an inline table, from which Soldeer reads no dependency`,t);return m(e)}function G(e,t){a(e,`config`),U(e.soldeer,`config.soldeer`);let n=W(e.dependencies,`config.dependencies`),r=new Map;for(let[e,i,a]of o(n,`config.dependencies`)){let n=I(i,a);P(r,e,e,a);let o=t[e];if(o===void 0)throw new x(`no entry in the lockfile, which Soldeer then resolves anew`,a);B(o,n,a)}for(let e of Object.keys(t))if(!Object.hasOwn(n,e))throw new x(`nothing in the config asks for it, and Soldeer drops it`,C(`dependencies`,e))}var K=[`name`,`version`,`git`,`url`,`rev`,`checksum`,`integrity`],q={http:[`name`,`version`,`url`,`checksum`,`integrity`],git:[`name`,`version`,`git`,`rev`],private:[`name`,`version`,`checksum`,`integrity`]},J={http:`a url`,git:`a git repository`,private:`neither a url nor a git repository`},Y=e=>e!==``&&![...e].some(e=>e<=`\x1F`||e===`\x7F`||e===`"`||e===`\\`);function X(e,t,n){let r=p(e[t],n);if(!Y(r))throw new x(`${S(r)} is empty, or has a quote, backslash or control character, which this reader does not take`,n);if((t===`checksum`||t===`integrity`)&&!u(r))throw new x(`${S(r)} is not a hex sha256`,n);if(t===`rev`&&!l(r))throw new x(`${S(r)} is not a full commit hash, as Soldeer writes`,n);if(t===`url`&&!f(r))throw new x(`${S(r)} is not an http(s) URL`,n);return t===`git`&&d(r,n),r}function Z(e,t){let n=`dependencies[${t}]`;if(!v(e))throw new x(`expected a table`,n);typeof e.name==`string`&&Y(e.name)&&(n=C(`dependencies`,e.name));for(let t of Object.keys(e)){if(t===`source`)throw new x(`a field of Soldeer 0.3 and older, whose entries 0.4 and later do not read`,C(n,t));if(!K.includes(t))throw new x(`unsupported field ${S(t)}`,C(n,t))}if(e.url!==void 0&&e.git!==void 0)throw new x(`both a url and a git repository, which Soldeer refuses`,n);let r=e.url===void 0?e.git===void 0?`private`:`git`:`http`,i={type:r};for(let t of q[r]){if(e[t]===void 0)throw new x(`expected ${t}, which Soldeer requires of an entry with ${J[r]}`,n);i[t]=X(e,t,C(n,t))}let a=K.find(t=>e[t]!==void 0&&!q[r].includes(t));if(a!==void 0)throw new x(`a field Soldeer does not write for an entry with ${J[r]}`,C(n,a));return[i,n]}function Q(e,t){let n=e===void 0?[]:[`version = ${e}`];if(t.length===0)return`${[...n,`dependencies = []`].join(`
2
2
  `)}
3
3
  `;let r=t.map(e=>[`[[dependencies]]`,...q[e.type].map(t=>`${t} = "${e[t]}"`)].join(`
4
4
  `));return`${[...n,...r].join(`
@@ -1 +1 @@
1
- import{a as e}from"./chunk-GO7FT4OD.js";import{c as t,d as n,e as r,h as i,i as a,j as o,m as s,n as c,o as l,p as u}from"./chunk-G6YPDPW7.js";import{a as d}from"./chunk-7YFJUT2P.js";import"./chunk-PXK7EU4V.js";import{a as f,c as p}from"./chunk-JCIIBLKR.js";import"./chunk-PQPKHAI5.js";import{m,q as h,s as g,w as _}from"./chunk-OWIBDEJJ.js";import"./chunk-S5HSDGTP.js";import{b as v}from"./chunk-IYPY47MC.js";import"./chunk-QRKFPLA4.js";import"./chunk-TUII34K2.js";import"./chunk-OOJM4CTU.js";function y(e){if(e instanceof Uint8Array)return{proven:!1,reason:`unsupported`,at:null};if(typeof e!=`string`)throw TypeError(`a text must be a string or its UTF-8 bytes, not ${typeof e}`);if(!e.isWellFormed())throw TypeError(`a text must be a well-formed string`);return{proven:!1,reason:`unsupported`,at:null}}var b=e=>e.subarray(0,8e3).includes(0),x=(e,t)=>(e+Math.imul(t,97)>>>0)%107927,S=e=>Uint8Array.from({length:256},(t,n)=>Number(n===10||e.includes(String.fromCodePoint(n)))),C=S(``),w=S(`,;={}`);function T(e,t=C){let n=!b(e),r=new Map,i=(e,t)=>r.set(e,(r.get(e)??0)+t),a=0,o=0,s=0;for(let r=0;r<e.length;r++){let c=e[r];if(n&&c===13&&e[r+1]===10)continue;let l=a;a=(a<<7^o>>>25)+c>>>0,o=(o<<7^l>>>25)>>>0,!(++s<64&&t[c]===0)&&(i(x(a,o),s),s=0,a=0,o=0)}s>0&&i(x(a,o),s);let c=Uint32Array.from(r.keys()).sort();return{hashes:c,bytes:Float64Array.from(c,e=>r.get(e)),total:r.values().reduce((e,t)=>e+t,0)}}function E(e,t){let n=0;for(let r=0,i=0;r<e.hashes.length&&i<t.hashes.length;)e.hashes[r]<t.hashes[i]?r++:e.hashes[r]>t.hashes[i]?i++:n+=Math.min(e.bytes[r++],t.bytes[i++]);return n}function D(e,t,n){let r=0,i=e.total,a=t.total;for(let o=0,s=0;o<e.hashes.length&&s<t.hashes.length;)if(e.hashes[o]<t.hashes[s]?i-=e.bytes[o++]:(e.hashes[o]>t.hashes[s]||(r+=Math.min(e.bytes[o],t.bytes[s]),i-=e.bytes[o++]),a-=t.bytes[s++]),(r+Math.min(i,a))*6e4<n)return 0;return r}function O(e,t,n,r,i=!1){if(e===null||t===null||t.length===0)return 0;let a=Math.abs(e.length-t.length),o=Math.max(e.length,t.length);if(o*(6e4-n)<a*6e4)return 0;let s=r(e),c=r(t),l=i?D(s,c,n*o):E(s,c);return Math.trunc(l*6e4/o)}var k=/^[\w-]{6,}$/u,A=/[\dA-Z]/u,ee=/^(?:\.[\w-]+)+$/u,te=/^[\w-]{8,32}$/u;function j(e){let t=[];for(let n=e.length-1;n>0;n--){if(e[n]!==`-`&&e[n]!==`.`)continue;let r=e.indexOf(`.`,n+1),i=e.slice(r),a=e.slice(n+1,r);r!==-1&&te.test(a)&&ee.test(i)&&/[A-Za-z]/u.test(a)&&A.test(a)&&t.push([e.slice(0,n),a,i])}return t}var M=e=>e.replaceAll(/\d/gu,`0`).replaceAll(/[a-z]/gu,`a`).replaceAll(/[A-Z]/gu,`A`);function ne(e,t){let n=j(t);for(let[t,r,i]of j(e)){let e=n.find(e=>e[2]===i);if(e&&e[1]!==r)return e[0]===t&&M(e[1])!==M(r)}return!1}function re(e){let t=e.lastIndexOf(`/`),n=e.slice(t+1),r=n.lastIndexOf(`.`),i=r>0?n.slice(r):``;return{name:n,key:`${e.slice(0,t+1)}\0${i}\0${n.length}`}}function ie(e,t){let n=e.length,r=0;for(;r<e.length&&e[r]===t[r];)r++;for(;n>r&&e[n-1]===t[n-1];)n--;for(;r>0&&!`-._`.includes(e[r-1]);)r--;for(;n<e.length&&e[n]!==`.`;)n++;let i=e.slice(r,n),a=t.slice(r,n);return r>0&&k.test(i)&&k.test(a)&&(A.test(i)||A.test(a))}function ae({sources:e,dests:t,pairs:n,used:r,record:i,punctuatedScoreOf:a},{remaining:o,open:s},c,l){let u=(e,t)=>new Map(t.filter(t=>e[t].type===`file`).map(t=>[t,re(e[t].path)])),d=u(t,s),f=u(e,o),p=Map.groupBy(f.keys(),e=>f.get(e).key),m=Map.groupBy(d.keys(),e=>d.get(e).key),h=[];for(let[e,t]of m){let n=p.get(e)??[];for(let e of t)for(let t of n)ie(f.get(t).name,d.get(e).name)&&h.push({s:t,d:e})}let g=Map.groupBy(h,({d:e})=>e),_=Map.groupBy(h,({s:e})=>e),v=[];for(let{s:e,d:t}of h){let n=_.get(e).length===1&&g.get(t).length===1&&ne(f.get(e).name,d.get(t).name),r=a(e,t,n?0:c);(n||r>=c)&&v.push({s:e,d:t,score:r})}let y=[],b=new Set,x=new Set;for(let e of v.sort((e,t)=>t.score-e.score))n.has(e.d)||r.has(e.s)||(x.has(e.s)||b.has(e.d)||l(e)?(y.push(e),x.add(e.s),b.add(e.d)):i(e.d,e.s,e.score));return y}function oe(e,t){let n=e.length;if(n!==t.length)return!1;let r=0;if(n>=32&&(e.byteOffset&3)==(t.byteOffset&3)){for(let n=4-(e.byteOffset&3)&3;r<n;r++)if(e[r]!==t[r])return!1;let i=n-r>>>2,a=new Int32Array(e.buffer,e.byteOffset+r,i),o=new Int32Array(t.buffer,t.byteOffset+r,i);for(let e=0;e<i;e++)if(a[e]!==o[e])return!1;r+=i*4}for(;r<n;r++)if(e[r]!==t[r])return!1;return!0}var N=class extends Error{constructor(e,t,n){let r=n===void 0?``:` in the ${n} tree`;super(t===void 0?e:`${e}: ${JSON.stringify(t)}${r}`),this.name=`CompareError`,this.path=t,this.tree=n}},se=new Set([`file`,`contiguous-file`]),ce=new Set([`fifo`,`character-device`,`block-device`]),le=/(?:^|\/)\.{0,2}(?:\/|$)/u;function ue(e){if(!Number.isInteger(e)||e<0||e>4095)throw RangeError(`a mode must be an integer from 0 to 0o7777, not ${e}`)}function de(e,t,n,r){if(typeof e!=`string`)throw TypeError(`an entry's name must be a string, not ${typeof e}`);if(e!==`.`||t!==`directory`){if(r?e===``:le.test(e))throw new N(r?`a name must not be empty`:"a name must be a relative path with no empty, `.` or `..` segment",e,n);if(!e.isWellFormed())throw new N(`a name must be well-formed Unicode`,e,n)}}function fe(e,t,n){if(typeof e!=`string`||e===``)throw new N(`a link must name its target`,t,n);if(!e.isWellFormed())throw new N(`a link target must be well-formed Unicode`,t,n);return e}function pe(e){if(e===void 0)return new Uint8Array;if(e instanceof Uint8Array)return e;if(typeof e!=`string`)throw TypeError(`a file's data must be a string or a Uint8Array, not ${typeof e}`);if(!e.isWellFormed())throw TypeError(`a file's text must be well-formed Unicode`);return e}var P=e=>typeof e==`string`?d(e):e;function me(e,t,n){if(typeof e!=`object`||!e)throw TypeError(`an entry must be an object, not ${e===null?`null`:typeof e}`);let{name:r,type:i=`file`,mode:a,linkname:o,data:s}=e;if(de(r,i,t,n),a!==void 0&&ue(a),se.has(i))return{path:r,type:`file`,mode:a??420,data:pe(s)};if(i===`symlink`||i===`hardlink`)return{path:r,type:i,target:fe(o,r,t)};if(i===`directory`)return{path:r,type:i};throw ce.has(i)?new N(`a ${i} is neither a file nor a link`,r,t):TypeError(`${JSON.stringify(i)} is not an entry type`)}function F(e,t){return e.type===t.type?e.type===`symlink`?e.target===t.target:e.data===t.data?!0:typeof e.data==`string`&&typeof t.data==`string`?!1:oe(P(e.data),P(t.data)):!1}function he(e,t,n){let r=new Set([e.path]),i=t.get(e.target);for(;i?.type===`hardlink`;){if(r.has(i.path))throw new N(`a hard link leads back to itself`,e.path,n);r.add(i.path),i=t.get(i.target)}if(i===void 0||i.type===`directory`)throw new N(`a hard link must name a file or a link in the tree`,e.path,n);return{...i,path:e.path}}function I(e,t,n){let r=new Map;for(let i of e){let e=me(i,t,n);if(e.type!==`directory`||e.path!==`.`){if(r.has(e.path))throw new N(`a name is given twice`,e.path,t);r.set(e.path,e)}}let i=new Map;for(let[e,a]of r){for(let i=n?-1:e.lastIndexOf(`/`);i>0;i=e.lastIndexOf(`/`,i-1)){let n=r.get(e.slice(0,i));if(n!==void 0&&n.type!==`directory`)throw new N(`a path lies under a ${n.type===`symlink`?`link`:`file`}`,e,t)}a.type===`hardlink`?i.set(e,he(a,r,t)):a.type!==`directory`&&i.set(e,a)}return i}var ge=100,_e=4,L=e=>e.slice(e.lastIndexOf(`/`)+1);function R(t,n){if(t.type===`symlink`)return`l${t.target}`;let r=n(t);return`f${r.length}:${e(r)}`}function ve({sources:e,dests:t,sourceNames:n,destNames:r,used:i,record:a,bytes:o}){let s=Map.groupBy(e.keys(),t=>R(e[t],o));for(let c=0;c<t.length;c++){let l=-1,u=ge;for(let a of s.get(R(t[c],o))??[])if(!i.has(a)&&F(e[a],t[c])&&((l===-1||n[a]===r[c])&&(l=a),n[a]===r[c]||--u===0))break;l!==-1&&a(c,l,6e4)}}var ye=new Map([[`.ts`,`.js`],[`.mts`,`.mjs`],[`.cts`,`.cjs`],[`.tsx`,`.jsx`]]),be=new Map([...[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.mts`,`.cts`,`.tsx`].map(e=>[e,`script`]),...[`.css`,`.scss`,`.sass`,`.less`].map(e=>[e,`style`])]);function z(e){let t=e.split(`/`),n=t.pop(),r=n.lastIndexOf(`.`);return r>0?{dirs:t,stem:n.slice(0,r),extension:n.slice(r)}:{dirs:t,stem:n,extension:``}}function B(e){let{dirs:t,stem:n,extension:r}=z(e);return JSON.stringify([t.map(e=>e===`lib`||e===`src`?null:e),n,ye.get(r)??r])}function xe(e){let{dirs:t,stem:n,extension:r}=z(e),i=[n,be.get(r)??r],a=t.lastIndexOf(`node_modules`),o=a===-1?0:a+(t[a+1]?.startsWith(`@`)?3:2),s=[JSON.stringify([...i,t])];for(let e=o;e<t.length;e++)s.push(JSON.stringify([...i,t.toSpliced(e,1,null)]));return s}var V=(e,t)=>Math.max(t,e+Math.trunc((6e4-e)/2));function H({pairs:e,used:t,scoreOf:n},{remaining:r,open:i},{s:a,d:o,score:s},c){let l=V(s,c);return i.some(t=>t!==o&&!e.has(t)&&n(a,t,l)>=l)||r.some(e=>e!==a&&!t.has(e)&&n(e,o,l)>=l)}function Se(e,t,n,r){let{sources:i,dests:a,pairs:o,used:s,record:c,scoreOf:l}=e,u=Map.groupBy(t.remaining.filter(e=>i[e].type===`file`),e=>B(i[e].path)),d=t.open.filter(e=>a[e].type===`file`).flatMap(e=>(u.get(B(a[e].path))??[]).map(t=>({s:t,d:e,score:l(t,e,0)})));for(let i of d.sort((e,t)=>t.score-e.score))o.has(i.d)||s.has(i.s)||n&&H(e,t,i,r)||c(i.d,i.s,i.score)}function Ce(e,t,n,r){let{sources:i,dests:a,pairs:o,used:s,record:c,scoreOf:l}=e,u=new Map,d=(e,t,n)=>new Map(t.filter(t=>e[t].type===`file`).map(t=>{let r=xe(e[t].path);for(let e of r)(u.get(e)??u.set(e,{sources:[],dests:[]}).get(e))[n].push(t);return[t,r]})),f=d(a,t.open.filter(e=>!o.has(e)),`dests`),p=d(i,t.remaining.filter(e=>!s.has(e)),`sources`),m=(e,t)=>{let n=new Set(e.flatMap(e=>u.get(e)[t]));return n.size===1?[...n][0]:-1};for(let[i,a]of p){let o=m(a,`dests`);if(o===-1||m(f.get(o),`sources`)!==i)continue;let s={s:i,d:o,score:l(i,o,0)};n&&H(e,t,s,r)||c(o,i,s.score)}}function we(e,t,n){let r=G(e),i=t<6e4&&r.remaining.length*r.open.length<=n*n;Se(e,r,i,t),Ce(e,r,i,t)}function U(e,t){let n=new Map;for(let r of t)n.set(e[r],n.has(e[r])?-1:r);return n}function Te({sourceNames:e,destNames:t,record:n,scoreOf:r},{remaining:i,open:a},o){let s=U(t,a),c=U(e,i);for(let t of i){let i=s.get(e[t]);if(i===void 0||i===-1||c.get(e[t])===-1)continue;let a=r(t,i,o);a>=o&&n(i,t,a)}}var W=(e,t)=>t.score-e.score||t.nameScore-e.nameScore;function Ee(e,t){if(e.length<_e){e.push(t);return}let n=0;for(let t=1;t<e.length;t++)W(e[t],e[n])>0&&(n=t);W(e[n],t)>0&&(e[n]=t)}function De({sourceNames:e,destNames:t,pairs:n,used:r,record:i,scoreOf:a},{remaining:o,open:s},c,l){let u=[];for(let n of s){let r=[];for(let i of o)Ee(r,{score:a(i,n,c),nameScore:+(e[i]===t[n]),dst:n,src:i});u.push(...r)}let d=0,f=e=>{for(;d<l.length&&V(l[d].score,c)>e;d++){let{s:e,d:t,score:a}=l[d];!n.has(t)&&!r.has(e)&&i(t,e,a)}};for(let{dst:e,src:t,score:a}of u.sort(W)){if(a<c)break;f(a),!n.has(e)&&!r.has(t)&&i(e,t,a)}f(-1/0)}var G=({sources:e,dests:t,pairs:n,used:r})=>({remaining:e.keys().filter(e=>!r.has(e)).toArray(),open:t.keys().filter(e=>!n.has(e)).toArray()}),K=e=>V(e,e);function q(e,t,{minimum:n,limit:r,byPath:i}){let a=new Map,o=new Set;if(e.length===0||t.length===0)return a;let s=new Map,c=new Map,l=new Map,u=e=>e.type===`file`?c.get(e)??c.set(e,P(e.data)).get(e):null,d=e=>s.get(e)??s.set(e,T(e)).get(e),f=e=>l.get(e)??l.set(e,T(e,w)).get(e),p={sources:e,dests:t,pairs:a,used:o,sourceNames:e.map(e=>L(e.path)),destNames:t.map(e=>L(e.path)),record(e,t,n){a.set(e,{source:t,score:n}),o.add(t)},bytes:u,scoreOf:(n,r,i)=>O(u(e[n]),u(t[r]),i,d),punctuatedScoreOf:(n,r,i)=>O(u(e[n]),u(t[r]),i,f,!0)};if(ve(p),i&&we(p,n,r),n>=6e4)return a;Te(p,G(p),K(n));let m=G(p);if(m.remaining.length*m.open.length>r*r)return a;let h=i?ae(p,m,K(n),e=>H(p,m,e,n)):[];return De(p,G(p),n,h),a}var Oe=50,ke=1e3;function J(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return e.codePointAt(r)-t.codePointAt(r);return e.length-t.length}function Ae(e){if(e===!1)return null;let t=e===!0?Oe:e;if(typeof t!=`number`)throw TypeError(`renames must be a boolean or a percentage, not ${typeof e}`);if(!(t>0&&t<=100))throw RangeError(`renames must be a percentage above 0 and at most 100, not ${e}`);return Math.max(1,Math.trunc(6e4*t/100))}function je({renamesByPath:e,renameLimit:t,renameGroup:n,paths:r,lines:i}){if(typeof e!=`boolean`)throw TypeError(`renamesByPath must be a boolean, not ${typeof e}`);if(t!==1/0&&!(Number.isSafeInteger(t)&&t>=0))throw RangeError(`renameLimit must be a whole number or Infinity, not ${t}`);if(n!==null&&typeof n!=`function`)throw TypeError(`renameGroup must be a function, not ${typeof n}`);if(r!==`tree`&&r!==`keys`)throw RangeError(`paths must be 'tree' or 'keys', not ${r}`);if(typeof i!=`boolean`)throw TypeError(`lines must be a boolean, not ${typeof i}`)}var Me=(e,t)=>F(e,t)&&(e.type!==`file`||e.mode===t.mode),Y=(e,t,n,r=null)=>({status:e,old:t,new:n,similarity:r}),Ne=/\.d\.(?:[^./]+\.)?[cm]?ts$/u,Pe=e=>e.endsWith(`.mts`)?`module`:e.endsWith(`.cts`)?`commonjs`:null,Fe=/^export\s*\{\s*\}\s*;?$/u;function Ie(e){if(e===null)return{proven:!0,runtime:``,loads:!1};try{return t(e)===void 0?{proven:!1}:y(e.data)}catch{return{proven:!1}}}function Le(e){if(![e.old,e.new].filter(e=>e!==null).every(e=>e.type===`file`&&Ne.test(e.path))||e.old&&e.new&&e.old.mode!==e.new.mode)return e;let t=Ie(e.new),n=Ie(e.old);return!n.proven||!t.proven||n.runtime!==t.runtime&&!(e.old===null&&Fe.test(t.runtime))||n.loads&&e.old&&e.new&&e.old.path!==e.new.path&&Pe(e.old.path)!==Pe(e.new.path)?e:{...e,typeOnly:!0}}function Re(e,t){let n=[],r=[],i=[];for(let[n,a]of e){let e=t.get(n);e===void 0?i.push(a):e.type===a.type?Me(a,e)||r.push(Y(`modified`,a,e)):r.push(Y(`type-changed`,a,e))}for(let[r,i]of t)e.has(r)||n.push(i);return i.sort((e,t)=>J(e.path,t.path)),n.sort((e,t)=>J(e.path,t.path)),{changes:r,deleted:i,added:n}}function ze(e,t,{group:n,...r}){if(n===null)return q(e,t,r);let i=new Map,a=e=>Map.groupBy(e.keys(),t=>n(e[t].path)),o=a(e);for(let[n,s]of a(t)){let a=o.get(n);if(a!==void 0)for(let[n,{source:o,score:c}]of q(a.map(t=>e[t]),s.map(e=>t[e]),r))i.set(s[n],{source:a[o],score:c})}return i}function Be(e,t,{renames:i=!0,renamesByPath:a=!0,renameLimit:o=ke,renameGroup:s=null,paths:c=`tree`,lines:l=!0,horizon:u,whitespace:d,ignoreCase:f}={}){let p=Ae(i);je({renamesByPath:a,renameLimit:o,renameGroup:s,paths:c,lines:l});let m=n({horizon:u,whitespace:d,ignoreCase:f}),h=c===`keys`,{changes:g,deleted:_,added:v}=Re(I(e,`old`,h),I(t,`new`,h)),y=p===null?new Map:ze(_,v,{minimum:p,limit:o,byPath:a,group:s});for(let[e,t]of v.entries()){let n=y.get(e);g.push(n===void 0?Y(`added`,null,t):Y(`renamed`,_[n.source],t,Math.trunc(n.score*100/6e4)))}let b=new Set(y.values().map(({source:e})=>e));for(let[e,t]of _.entries())b.has(e)||g.push(Y(`deleted`,t,null));return g.sort((e,t)=>J((e.new??e.old).path,(t.new??t.old).path)),(l?g.map(e=>({...e,...r(e.old,e.new,m)})):g).map(Le)}function X(e,t,n){let r=new Map,o=new Set,s=0;for(let a of e){let e=i(n,a);e===null||!t.has(e)||(r.set(a,e),o.add(e),e!==a&&s++)}for(let n of e)r.has(n)||!t.has(n)||o.has(n)||(r.set(n,n),o.add(n));let c=r.size;for(let s of e){if(r.has(s))continue;let e=i(n,s)??a(n,s);for(;t.has(e)||o.has(e);)e=`../${e}`;r.set(s,e),o.add(e)}return{paths:r,paired:c,moved:s}}function Ve(e,t){let n=new Set(e),r=new Set(t),i=(e,t)=>{let n=new Map;for(let r of e)for(let e=r.indexOf(`/`);e!==-1;e=r.indexOf(`/`,e+1)){let i=r.slice(0,e+1);t.has(r.slice(e+1))&&n.set(i,(n.get(i)??0)+1)}let r=null,i=!1;for(let[e,t]of n)t>(n.get(r)??0)?[r,i]=[e,!1]:t===n.get(r)&&(i=!0);return i?null:r},a=X(n,r,null).paired,o=[[{base:``,other:i(r,n)},n],[{base:i(n,r),other:``},r]].filter(([e])=>e.base!==null&&e.other!==null).map(([e,t])=>({root:e,side:t,...X(n,r,e)})).filter(({side:e,paired:t,moved:n})=>t>a&&n*2>=e.size);return o.length===2&&o[0].paired===o[1].paired?null:o.toSorted((e,t)=>t.paired-e.paired)[0]?.root??null}function He(e,t){let n=[...e],r=new Set(t),i=Ve(n,r);return{root:i,paths:X(n,r,i).paths}}function Ue(e,t,n){if(!e&&!t)return null;let r=[...e??[]],i=Map.groupBy(r,([,e])=>e),a=new Map(i.entries().map(([e,t])=>[e,o(n,e,t.map(([t])=>t.slice(e.length+1)))]));return new Map([...r.map(([e,t])=>[n.paths.get(e)??e,a.get(t)]),...t??[]])}function We(e,t,n=new Map,r=new Map,i=null,a=()=>!1){let o=e=>{let t=n.get(e)??r.get(e);return t===void 0?[...new Set([e,Ze(i,e)??e])]:[t]},s=[],c=[],u=[],d=new Set;for(let n of e.values()){let e=o(n.parent).map(e=>t.get(l(e,n.specifier,n.conditions,n.platform))).find(Boolean),i=r.get(n.target)??n.target;if(e){if(d.add(e.key),!o(n.target).includes(e.target)){let{target:t,...n}=e;s.push({...n,baseTarget:i,otherTarget:t})}continue}let u=o(n.parent).find(a);if(u===void 0)continue;let{specifier:f,conditions:p,platform:m}=n;c.push({key:l(u,f,p,m),parent:u,specifier:f,conditions:p,platform:m,baseTarget:i,otherTarget:null})}for(let e of t.values()){if(d.has(e.key)||!a(e.parent))continue;let{target:t,...n}=e;u.push({...n,baseTarget:null,otherTarget:t})}for(let e of[s,c,u])e.sort((e,t)=>e.key.localeCompare(t.key));return{changed:s,onlyBase:c,onlyOther:u,totalChanges:s.length+c.length+u.length}}function Z(e){return m(e)??0}function Ge(e,t){return e===t||e?.format===`base64`&&t?.format===`base64`&&e.data===t.data||e?.format===`digest`&&t?.format===`digest`&&e.digest===t.digest}function Q(e){if(e?.npmExecutable instanceof Set)return t=>({executable:e.npmExecutable.has(t)});if(e?.kind!==`stasis`||!e.bundle)return null;let{formats:t,executable:n,entries:r}=e.bundle;return e=>({format:t?.get(e),executable:n?.has(e)??!1,entry:r?.has(e)??!1})}function Ke(e,t){return!e||!t?[]:[`format`,`executable`,`entry`].filter(n=>e[n]!==t[n]).map(n=>({field:n,from:e[n],to:t[n]}))}function qe(e){return(t,n)=>Math.abs(n.delta)-Math.abs(t.delta)||t[e].localeCompare(n[e])}function $(e){return(t,n)=>n.bytes-t.bytes||t[e].localeCompare(n[e])}function Je(e,t){return typeof e==`string`?`\0text\0${e.toWellFormed()}`:e?.format===`base64`?`\0base64\0${e.data}`:e?.format===`digest`?`\0digest\0${e.digest}`:`\0none\0${t}`}var Ye=250;function Xe(e,t,n,r,i){let a=(e,t,n)=>e.filter(({path:e})=>e!==``&&e.isWellFormed()).map(({path:e},r)=>({name:e,data:Je(t.get(e),`${n}${r}`)})),o={paths:`keys`,renameGroup:i,renameLimit:Ye,lines:!1},s=Be(a(e,n,`a`),a(t,r,`b`),o);return new Map(s.filter(({status:e})=>e===`renamed`).map(e=>[e.old.path,e.new.path]))}function Ze(e,t){return e?e.base===``?`${e.other}${t}`:t.startsWith(e.base)?t.slice(e.base.length):null:t}function Qe(){return{baseBytes:0,otherBytes:0,onlyBaseFiles:0,onlyOtherFiles:0,changedFiles:0}}function $e(e,t,n,r=He(e.keys(),t.keys()),i=[]){let{root:a,paths:o}=r,s=new Map([...o].map(([e,t])=>[t,e]));e=new Map([...e].map(([e,t])=>[o.get(e),t]));let c=e=>s.get(e)===e?{}:{basePath:s.get(e)},l=(e,t)=>{let n=Ke(i[0]?.(e),i[1]?.(t));return n.length>0?{meta:n}:{}},u=[],d=[],f=[],p=0,m=0,h=0,g=0,_=0,v=0,y=new Map,b=e=>{let t=n(e),r=y.get(t);return r||(r=Qe(),y.set(t,r)),r},x=new Set([...e.keys(),...t.keys()]);for(let n of x){let r=e.has(n),i=t.has(n),a=b(n);if(r&&i){let r=e.get(n),i=t.get(n),o=Ge(r,i),u=l(s.get(n),n),d=Z(r),h=o?d:Z(i);if(p+=d,m+=h,a.baseBytes+=d,a.otherBytes+=h,o&&!u.meta)v++;else{let e=h-d;f.push({path:n,...c(n),baseBytes:d,otherBytes:h,delta:e,...u,...o?{modified:!1}:{}}),_+=e,a.changedFiles++}}else if(r){let t=Z(e.get(n));p+=t,h+=t,a.baseBytes+=t,a.onlyBaseFiles++,u.push({path:n,...c(n),bytes:t})}else{let e=Z(t.get(n));m+=e,g+=e,a.otherBytes+=e,a.onlyOtherFiles++,d.push({path:n,bytes:e})}}let S=Xe(u,d,e,t,n);if(S.size>0){let n=new Set(S.values());for(let[n,r]of S){let i=e.get(n),a=t.get(r),o=Ge(i,a),c=Z(i),u=o?c:Z(a);h-=c,g-=u,f.push({path:r,renamedFrom:n,basePath:s.get(n),baseBytes:c,otherBytes:u,delta:u-c,modified:!o,...l(s.get(n),r)}),_+=u-c;let d=b(n);d.onlyBaseFiles--,d.onlyOtherFiles--,d.changedFiles++}u.splice(0,u.length,...u.filter(e=>!S.has(e.path))),d.splice(0,d.length,...d.filter(e=>!n.has(e.path)))}let C=[],w=[],T=[],E=[];for(let[e,t]of y){let n=t.baseBytes>0||t.onlyBaseFiles>0||t.changedFiles>0,r=t.otherBytes>0||t.onlyOtherFiles>0||t.changedFiles>0,i=t.onlyBaseFiles+t.onlyOtherFiles+t.changedFiles;n&&!r?C.push({pkg:e,bytes:t.baseBytes}):r&&!n?w.push({pkg:e,bytes:t.otherBytes}):i>0||t.baseBytes!==t.otherBytes?T.push({pkg:e,baseBytes:t.baseBytes,otherBytes:t.otherBytes,delta:t.otherBytes-t.baseBytes}):E.push({pkg:e,bytes:t.baseBytes})}return u.sort($(`path`)),d.sort($(`path`)),f.sort(qe(`path`)),C.sort($(`pkg`)),w.sort($(`pkg`)),T.sort(qe(`pkg`)),{totals:{baseFiles:e.size,baseBytes:p,otherFiles:t.size,otherBytes:m,onlyBaseFiles:u.length,onlyBaseBytes:h,onlyOtherFiles:d.length,onlyOtherBytes:g,changedFiles:f.length,renamedFiles:S.size,changedDelta:_,unchangedFiles:v,fileDelta:t.size-e.size,byteDelta:m-p,identical:u.length===0&&d.length===0&&f.length===0},files:{onlyBase:u,onlyOther:d,changed:f,root:a,basePaths:o},packages:{onlyBase:C,onlyOther:w,changed:T,unchanged:E}}}function et(e,t,n=null){let[r,i]=[e,t],[a,o]=s(r,i,n),l=c(r,a),d=c(i,o),m=He(l.keys(),d.keys()),y=Ue(h(r),h(i),m),b=$e(l,d,e=>v(e,{packageDir:y?.get(e)}),m,[Q(r),Q(i)]),x=_(r),S=_(i),C=(e,t)=>{let n=0;for(let r of t)n+=e.get(r)??0;return n};Object.assign(b.totals,{baseLines:C(x,l.keys()),otherLines:C(S,d.keys())});for(let e of b.files.onlyBase)e.lines=x.get(e.basePath??e.path)??0;for(let e of b.files.onlyOther)e.lines=S.get(e.path)??0;for(let e of b.files.changed)Object.assign(e,{baseLines:x.get(e.basePath??e.path)??0,otherLines:S.get(e.path)??0});let w=new Set([...b.files.onlyOther,...b.files.changed.filter(e=>e.modified!==!1)].map(e=>e.path));b.resolutions=We(u(r,a),u(i,o),new Map(b.files.changed.filter(e=>e.renamedFrom!=null).map(e=>[e.basePath,e.path])),b.files.basePaths,b.files.root,e=>d.has(e)&&!w.has(e));let T=e=>v(``,{packageDir:e}),E=g(r,a?l.keys():null,T),D=g(i,o?d.keys():null,T);return b.versionUpdates=p(E,D),b.packageRows=f(b.packages,E,D),b.scope=n??``,b}export{et as prepareComparison};
1
+ import{a as e}from"./chunk-GO7FT4OD.js";import{b as t,c as n,d as r,e as i}from"./chunk-3S4YWYOM.js";import{c as a,d as o,e as s,h as c,i as l,j as u,l as d,n as f}from"./chunk-QBIUW5EF.js";import"./chunk-PQPKHAI5.js";import{a as p}from"./chunk-7YFJUT2P.js";import"./chunk-PXK7EU4V.js";import{m,q as h,s as g,w as _}from"./chunk-OWIBDEJJ.js";import"./chunk-S5HSDGTP.js";import{b as v}from"./chunk-IYPY47MC.js";import"./chunk-QRKFPLA4.js";import"./chunk-TUII34K2.js";import"./chunk-OOJM4CTU.js";function y(e){if(e instanceof Uint8Array)return{proven:!1,reason:`unsupported`,at:null};if(typeof e!=`string`)throw TypeError(`a text must be a string or its UTF-8 bytes, not ${typeof e}`);if(!e.isWellFormed())throw TypeError(`a text must be a well-formed string`);return{proven:!1,reason:`unsupported`,at:null}}var b=e=>e.subarray(0,8e3).includes(0),x=(e,t)=>(e+Math.imul(t,97)>>>0)%107927,S=e=>Uint8Array.from({length:256},(t,n)=>Number(n===10||e.includes(String.fromCodePoint(n)))),C=S(``),w=S(`,;={}`);function T(e,t=C){let n=!b(e),r=new Map,i=(e,t)=>r.set(e,(r.get(e)??0)+t),a=0,o=0,s=0;for(let r=0;r<e.length;r++){let c=e[r];if(n&&c===13&&e[r+1]===10)continue;let l=a;a=(a<<7^o>>>25)+c>>>0,o=(o<<7^l>>>25)>>>0,!(++s<64&&t[c]===0)&&(i(x(a,o),s),s=0,a=0,o=0)}s>0&&i(x(a,o),s);let c=Uint32Array.from(r.keys()).sort();return{hashes:c,bytes:Float64Array.from(c,e=>r.get(e)),total:r.values().reduce((e,t)=>e+t,0)}}function E(e,t){let n=0;for(let r=0,i=0;r<e.hashes.length&&i<t.hashes.length;)e.hashes[r]<t.hashes[i]?r++:e.hashes[r]>t.hashes[i]?i++:n+=Math.min(e.bytes[r++],t.bytes[i++]);return n}function D(e,t,n){let r=0,i=e.total,a=t.total;for(let o=0,s=0;o<e.hashes.length&&s<t.hashes.length;)if(e.hashes[o]<t.hashes[s]?i-=e.bytes[o++]:(e.hashes[o]>t.hashes[s]||(r+=Math.min(e.bytes[o],t.bytes[s]),i-=e.bytes[o++]),a-=t.bytes[s++]),(r+Math.min(i,a))*6e4<n)return 0;return r}function O(e,t,n,r,i=!1){if(e===null||t===null||t.length===0)return 0;let a=Math.abs(e.length-t.length),o=Math.max(e.length,t.length);if(o*(6e4-n)<a*6e4)return 0;let s=r(e),c=r(t),l=i?D(s,c,n*o):E(s,c);return Math.trunc(l*6e4/o)}var k=/^[\w-]{6,}$/u,A=/[\dA-Z]/u,ee=/^(?:\.[\w-]+)+$/u,te=/^[\w-]{8,32}$/u;function j(e){let t=[];for(let n=e.length-1;n>0;n--){if(e[n]!==`-`&&e[n]!==`.`)continue;let r=e.indexOf(`.`,n+1),i=e.slice(r),a=e.slice(n+1,r);r!==-1&&te.test(a)&&ee.test(i)&&/[A-Za-z]/u.test(a)&&A.test(a)&&t.push([e.slice(0,n),a,i])}return t}var M=e=>e.replaceAll(/\d/gu,`0`).replaceAll(/[a-z]/gu,`a`).replaceAll(/[A-Z]/gu,`A`);function ne(e,t){let n=j(t);for(let[t,r,i]of j(e)){let e=n.find(e=>e[2]===i);if(e&&e[1]!==r)return e[0]===t&&M(e[1])!==M(r)}return!1}function re(e){let t=e.lastIndexOf(`/`),n=e.slice(t+1),r=n.lastIndexOf(`.`),i=r>0?n.slice(r):``;return{name:n,key:`${e.slice(0,t+1)}\0${i}\0${n.length}`}}function ie(e,t){let n=e.length,r=0;for(;r<e.length&&e[r]===t[r];)r++;for(;n>r&&e[n-1]===t[n-1];)n--;for(;r>0&&!`-._`.includes(e[r-1]);)r--;for(;n<e.length&&e[n]!==`.`;)n++;let i=e.slice(r,n),a=t.slice(r,n);return r>0&&k.test(i)&&k.test(a)&&(A.test(i)||A.test(a))}function ae({sources:e,dests:t,pairs:n,used:r,record:i,punctuatedScoreOf:a},{remaining:o,open:s},c,l){let u=(e,t)=>new Map(t.filter(t=>e[t].type===`file`).map(t=>[t,re(e[t].path)])),d=u(t,s),f=u(e,o),p=Map.groupBy(f.keys(),e=>f.get(e).key),m=Map.groupBy(d.keys(),e=>d.get(e).key),h=[];for(let[e,t]of m){let n=p.get(e)??[];for(let e of t)for(let t of n)ie(f.get(t).name,d.get(e).name)&&h.push({s:t,d:e})}let g=Map.groupBy(h,({d:e})=>e),_=Map.groupBy(h,({s:e})=>e),v=[];for(let{s:e,d:t}of h){let n=_.get(e).length===1&&g.get(t).length===1&&ne(f.get(e).name,d.get(t).name),r=a(e,t,n?0:c);(n||r>=c)&&v.push({s:e,d:t,score:r})}let y=[],b=new Set,x=new Set;for(let e of v.sort((e,t)=>t.score-e.score))n.has(e.d)||r.has(e.s)||(x.has(e.s)||b.has(e.d)||l(e)?(y.push(e),x.add(e.s),b.add(e.d)):i(e.d,e.s,e.score));return y}function oe(e,t){let n=e.length;if(n!==t.length)return!1;let r=0;if(n>=32&&(e.byteOffset&3)==(t.byteOffset&3)){for(let n=4-(e.byteOffset&3)&3;r<n;r++)if(e[r]!==t[r])return!1;let i=n-r>>>2,a=new Int32Array(e.buffer,e.byteOffset+r,i),o=new Int32Array(t.buffer,t.byteOffset+r,i);for(let e=0;e<i;e++)if(a[e]!==o[e])return!1;r+=i*4}for(;r<n;r++)if(e[r]!==t[r])return!1;return!0}var N=class extends Error{constructor(e,t,n){let r=n===void 0?``:` in the ${n} tree`;super(t===void 0?e:`${e}: ${JSON.stringify(t)}${r}`),this.name=`CompareError`,this.path=t,this.tree=n}},se=new Set([`file`,`contiguous-file`]),ce=new Set([`fifo`,`character-device`,`block-device`]),le=/(?:^|\/)\.{0,2}(?:\/|$)/u;function ue(e){if(!Number.isInteger(e)||e<0||e>4095)throw RangeError(`a mode must be an integer from 0 to 0o7777, not ${e}`)}function de(e,t,n,r){if(typeof e!=`string`)throw TypeError(`an entry's name must be a string, not ${typeof e}`);if(e!==`.`||t!==`directory`){if(r?e===``:le.test(e))throw new N(r?`a name must not be empty`:"a name must be a relative path with no empty, `.` or `..` segment",e,n);if(!e.isWellFormed())throw new N(`a name must be well-formed Unicode`,e,n)}}function fe(e,t,n){if(typeof e!=`string`||e===``)throw new N(`a link must name its target`,t,n);if(!e.isWellFormed())throw new N(`a link target must be well-formed Unicode`,t,n);return e}function pe(e){if(e===void 0)return new Uint8Array;if(e instanceof Uint8Array)return e;if(typeof e!=`string`)throw TypeError(`a file's data must be a string or a Uint8Array, not ${typeof e}`);if(!e.isWellFormed())throw TypeError(`a file's text must be well-formed Unicode`);return e}var P=e=>typeof e==`string`?p(e):e;function me(e,t,n){if(typeof e!=`object`||!e)throw TypeError(`an entry must be an object, not ${e===null?`null`:typeof e}`);let{name:r,type:i=`file`,mode:a,linkname:o,data:s}=e;if(de(r,i,t,n),a!==void 0&&ue(a),se.has(i))return{path:r,type:`file`,mode:a??420,data:pe(s)};if(i===`symlink`||i===`hardlink`)return{path:r,type:i,target:fe(o,r,t)};if(i===`directory`)return{path:r,type:i};throw ce.has(i)?new N(`a ${i} is neither a file nor a link`,r,t):TypeError(`${JSON.stringify(i)} is not an entry type`)}function F(e,t){return e.type===t.type?e.type===`symlink`?e.target===t.target:e.data===t.data?!0:typeof e.data==`string`&&typeof t.data==`string`?!1:oe(P(e.data),P(t.data)):!1}function he(e,t,n){let r=new Set([e.path]),i=t.get(e.target);for(;i?.type===`hardlink`;){if(r.has(i.path))throw new N(`a hard link leads back to itself`,e.path,n);r.add(i.path),i=t.get(i.target)}if(i===void 0||i.type===`directory`)throw new N(`a hard link must name a file or a link in the tree`,e.path,n);return{...i,path:e.path}}function I(e,t,n){let r=new Map;for(let i of e){let e=me(i,t,n);if(e.type!==`directory`||e.path!==`.`){if(r.has(e.path))throw new N(`a name is given twice`,e.path,t);r.set(e.path,e)}}let i=new Map;for(let[e,a]of r){for(let i=n?-1:e.lastIndexOf(`/`);i>0;i=e.lastIndexOf(`/`,i-1)){let n=r.get(e.slice(0,i));if(n!==void 0&&n.type!==`directory`)throw new N(`a path lies under a ${n.type===`symlink`?`link`:`file`}`,e,t)}a.type===`hardlink`?i.set(e,he(a,r,t)):a.type!==`directory`&&i.set(e,a)}return i}var ge=100,_e=4,L=e=>e.slice(e.lastIndexOf(`/`)+1);function R(t,n){if(t.type===`symlink`)return`l${t.target}`;let r=n(t);return`f${r.length}:${e(r)}`}function ve({sources:e,dests:t,sourceNames:n,destNames:r,used:i,record:a,bytes:o}){let s=Map.groupBy(e.keys(),t=>R(e[t],o));for(let c=0;c<t.length;c++){let l=-1,u=ge;for(let a of s.get(R(t[c],o))??[])if(!i.has(a)&&F(e[a],t[c])&&((l===-1||n[a]===r[c])&&(l=a),n[a]===r[c]||--u===0))break;l!==-1&&a(c,l,6e4)}}var ye=new Map([[`.ts`,`.js`],[`.mts`,`.mjs`],[`.cts`,`.cjs`],[`.tsx`,`.jsx`]]),be=new Map([...[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.mts`,`.cts`,`.tsx`].map(e=>[e,`script`]),...[`.css`,`.scss`,`.sass`,`.less`].map(e=>[e,`style`])]);function z(e){let t=e.split(`/`),n=t.pop(),r=n.lastIndexOf(`.`);return r>0?{dirs:t,stem:n.slice(0,r),extension:n.slice(r)}:{dirs:t,stem:n,extension:``}}function B(e){let{dirs:t,stem:n,extension:r}=z(e);return JSON.stringify([t.map(e=>e===`lib`||e===`src`?null:e),n,ye.get(r)??r])}function xe(e){let{dirs:t,stem:n,extension:r}=z(e),i=[n,be.get(r)??r],a=t.lastIndexOf(`node_modules`),o=a===-1?0:a+(t[a+1]?.startsWith(`@`)?3:2),s=[JSON.stringify([...i,t])];for(let e=o;e<t.length;e++)s.push(JSON.stringify([...i,t.toSpliced(e,1,null)]));return s}var V=(e,t)=>Math.max(t,e+Math.trunc((6e4-e)/2));function H({pairs:e,used:t,scoreOf:n},{remaining:r,open:i},{s:a,d:o,score:s},c){let l=V(s,c);return i.some(t=>t!==o&&!e.has(t)&&n(a,t,l)>=l)||r.some(e=>e!==a&&!t.has(e)&&n(e,o,l)>=l)}function Se(e,t,n,r){let{sources:i,dests:a,pairs:o,used:s,record:c,scoreOf:l}=e,u=Map.groupBy(t.remaining.filter(e=>i[e].type===`file`),e=>B(i[e].path)),d=t.open.filter(e=>a[e].type===`file`).flatMap(e=>(u.get(B(a[e].path))??[]).map(t=>({s:t,d:e,score:l(t,e,0)})));for(let i of d.sort((e,t)=>t.score-e.score))o.has(i.d)||s.has(i.s)||n&&H(e,t,i,r)||c(i.d,i.s,i.score)}function Ce(e,t,n,r){let{sources:i,dests:a,pairs:o,used:s,record:c,scoreOf:l}=e,u=new Map,d=(e,t,n)=>new Map(t.filter(t=>e[t].type===`file`).map(t=>{let r=xe(e[t].path);for(let e of r)(u.get(e)??u.set(e,{sources:[],dests:[]}).get(e))[n].push(t);return[t,r]})),f=d(a,t.open.filter(e=>!o.has(e)),`dests`),p=d(i,t.remaining.filter(e=>!s.has(e)),`sources`),m=(e,t)=>{let n=new Set(e.flatMap(e=>u.get(e)[t]));return n.size===1?[...n][0]:-1};for(let[i,a]of p){let o=m(a,`dests`);if(o===-1||m(f.get(o),`sources`)!==i)continue;let s={s:i,d:o,score:l(i,o,0)};n&&H(e,t,s,r)||c(o,i,s.score)}}function we(e,t,n){let r=G(e),i=t<6e4&&r.remaining.length*r.open.length<=n*n;Se(e,r,i,t),Ce(e,r,i,t)}function U(e,t){let n=new Map;for(let r of t)n.set(e[r],n.has(e[r])?-1:r);return n}function Te({sourceNames:e,destNames:t,record:n,scoreOf:r},{remaining:i,open:a},o){let s=U(t,a),c=U(e,i);for(let t of i){let i=s.get(e[t]);if(i===void 0||i===-1||c.get(e[t])===-1)continue;let a=r(t,i,o);a>=o&&n(i,t,a)}}var W=(e,t)=>t.score-e.score||t.nameScore-e.nameScore;function Ee(e,t){if(e.length<_e){e.push(t);return}let n=0;for(let t=1;t<e.length;t++)W(e[t],e[n])>0&&(n=t);W(e[n],t)>0&&(e[n]=t)}function De({sourceNames:e,destNames:t,pairs:n,used:r,record:i,scoreOf:a},{remaining:o,open:s},c,l){let u=[];for(let n of s){let r=[];for(let i of o)Ee(r,{score:a(i,n,c),nameScore:+(e[i]===t[n]),dst:n,src:i});u.push(...r)}let d=0,f=e=>{for(;d<l.length&&V(l[d].score,c)>e;d++){let{s:e,d:t,score:a}=l[d];!n.has(t)&&!r.has(e)&&i(t,e,a)}};for(let{dst:e,src:t,score:a}of u.sort(W)){if(a<c)break;f(a),!n.has(e)&&!r.has(t)&&i(e,t,a)}f(-1/0)}var G=({sources:e,dests:t,pairs:n,used:r})=>({remaining:e.keys().filter(e=>!r.has(e)).toArray(),open:t.keys().filter(e=>!n.has(e)).toArray()}),K=e=>V(e,e);function q(e,t,{minimum:n,limit:r,byPath:i}){let a=new Map,o=new Set;if(e.length===0||t.length===0)return a;let s=new Map,c=new Map,l=new Map,u=e=>e.type===`file`?c.get(e)??c.set(e,P(e.data)).get(e):null,d=e=>s.get(e)??s.set(e,T(e)).get(e),f=e=>l.get(e)??l.set(e,T(e,w)).get(e),p={sources:e,dests:t,pairs:a,used:o,sourceNames:e.map(e=>L(e.path)),destNames:t.map(e=>L(e.path)),record(e,t,n){a.set(e,{source:t,score:n}),o.add(t)},bytes:u,scoreOf:(n,r,i)=>O(u(e[n]),u(t[r]),i,d),punctuatedScoreOf:(n,r,i)=>O(u(e[n]),u(t[r]),i,f,!0)};if(ve(p),i&&we(p,n,r),n>=6e4)return a;Te(p,G(p),K(n));let m=G(p);if(m.remaining.length*m.open.length>r*r)return a;let h=i?ae(p,m,K(n),e=>H(p,m,e,n)):[];return De(p,G(p),n,h),a}var Oe=50,ke=1e3;function J(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return e.codePointAt(r)-t.codePointAt(r);return e.length-t.length}function Ae(e){if(e===!1)return null;let t=e===!0?Oe:e;if(typeof t!=`number`)throw TypeError(`renames must be a boolean or a percentage, not ${typeof e}`);if(!(t>0&&t<=100))throw RangeError(`renames must be a percentage above 0 and at most 100, not ${e}`);return Math.max(1,Math.trunc(6e4*t/100))}function je({renamesByPath:e,renameLimit:t,renameGroup:n,paths:r,lines:i}){if(typeof e!=`boolean`)throw TypeError(`renamesByPath must be a boolean, not ${typeof e}`);if(t!==1/0&&!(Number.isSafeInteger(t)&&t>=0))throw RangeError(`renameLimit must be a whole number or Infinity, not ${t}`);if(n!==null&&typeof n!=`function`)throw TypeError(`renameGroup must be a function, not ${typeof n}`);if(r!==`tree`&&r!==`keys`)throw RangeError(`paths must be 'tree' or 'keys', not ${r}`);if(typeof i!=`boolean`)throw TypeError(`lines must be a boolean, not ${typeof i}`)}var Me=(e,t)=>F(e,t)&&(e.type!==`file`||e.mode===t.mode),Y=(e,t,n,r=null)=>({status:e,old:t,new:n,similarity:r}),Ne=/\.d\.(?:[^./]+\.)?[cm]?ts$/u,Pe=e=>e.endsWith(`.mts`)?`module`:e.endsWith(`.cts`)?`commonjs`:null,Fe=/^export\s*\{\s*\}\s*;?$/u;function Ie(e){if(e===null)return{proven:!0,runtime:``,loads:!1};try{return a(e)===void 0?{proven:!1}:y(e.data)}catch{return{proven:!1}}}function Le(e){if(![e.old,e.new].filter(e=>e!==null).every(e=>e.type===`file`&&Ne.test(e.path))||e.old&&e.new&&e.old.mode!==e.new.mode)return e;let t=Ie(e.new),n=Ie(e.old);return!n.proven||!t.proven||n.runtime!==t.runtime&&!(e.old===null&&Fe.test(t.runtime))||n.loads&&e.old&&e.new&&e.old.path!==e.new.path&&Pe(e.old.path)!==Pe(e.new.path)?e:{...e,typeOnly:!0}}function Re(e,t){let n=[],r=[],i=[];for(let[n,a]of e){let e=t.get(n);e===void 0?i.push(a):e.type===a.type?Me(a,e)||r.push(Y(`modified`,a,e)):r.push(Y(`type-changed`,a,e))}for(let[r,i]of t)e.has(r)||n.push(i);return i.sort((e,t)=>J(e.path,t.path)),n.sort((e,t)=>J(e.path,t.path)),{changes:r,deleted:i,added:n}}function ze(e,t,{group:n,...r}){if(n===null)return q(e,t,r);let i=new Map,a=e=>Map.groupBy(e.keys(),t=>n(e[t].path)),o=a(e);for(let[n,s]of a(t)){let a=o.get(n);if(a!==void 0)for(let[n,{source:o,score:c}]of q(a.map(t=>e[t]),s.map(e=>t[e]),r))i.set(s[n],{source:a[o],score:c})}return i}function Be(e,t,{renames:n=!0,renamesByPath:r=!0,renameLimit:i=ke,renameGroup:a=null,paths:c=`tree`,lines:l=!0,horizon:u,whitespace:d,ignoreCase:f}={}){let p=Ae(n);je({renamesByPath:r,renameLimit:i,renameGroup:a,paths:c,lines:l});let m=o({horizon:u,whitespace:d,ignoreCase:f}),h=c===`keys`,{changes:g,deleted:_,added:v}=Re(I(e,`old`,h),I(t,`new`,h)),y=p===null?new Map:ze(_,v,{minimum:p,limit:i,byPath:r,group:a});for(let[e,t]of v.entries()){let n=y.get(e);g.push(n===void 0?Y(`added`,null,t):Y(`renamed`,_[n.source],t,Math.trunc(n.score*100/6e4)))}let b=new Set(y.values().map(({source:e})=>e));for(let[e,t]of _.entries())b.has(e)||g.push(Y(`deleted`,t,null));return g.sort((e,t)=>J((e.new??e.old).path,(t.new??t.old).path)),(l?g.map(e=>({...e,...s(e.old,e.new,m)})):g).map(Le)}function X(e,t,n){let r=new Map,i=new Set,a=0;for(let o of e){let e=c(n,o);e===null||!t.has(e)||(r.set(o,e),i.add(e),e!==o&&a++)}for(let n of e)r.has(n)||!t.has(n)||i.has(n)||(r.set(n,n),i.add(n));let o=r.size;for(let a of e){if(r.has(a))continue;let e=c(n,a)??l(n,a);for(;t.has(e)||i.has(e);)e=`../${e}`;r.set(a,e),i.add(e)}return{paths:r,paired:o,moved:a}}function Ve(e,t){let n=new Set(e),r=new Set(t),i=(e,t)=>{let n=new Map;for(let r of e)for(let e=r.indexOf(`/`);e!==-1;e=r.indexOf(`/`,e+1)){let i=r.slice(0,e+1);t.has(r.slice(e+1))&&n.set(i,(n.get(i)??0)+1)}let r=null,i=!1;for(let[e,t]of n)t>(n.get(r)??0)?[r,i]=[e,!1]:t===n.get(r)&&(i=!0);return i?null:r},a=X(n,r,null).paired,o=[[{base:``,other:i(r,n)},n],[{base:i(n,r),other:``},r]].filter(([e])=>e.base!==null&&e.other!==null).map(([e,t])=>({root:e,side:t,...X(n,r,e)})).filter(({side:e,paired:t,moved:n})=>t>a&&n*2>=e.size);return o.length===2&&o[0].paired===o[1].paired?null:o.toSorted((e,t)=>t.paired-e.paired)[0]?.root??null}function He(e,t){let n=[...e],r=new Set(t),i=Ve(n,r);return{root:i,paths:X(n,r,i).paths}}function Ue(e,t,n){if(!e&&!t)return null;let r=[...e??[]],i=Map.groupBy(r,([,e])=>e),a=new Map(i.entries().map(([e,t])=>[e,u(n,e,t.map(([t])=>t.slice(e.length+1)))]));return new Map([...r.map(([e,t])=>[n.paths.get(e)??e,a.get(t)]),...t??[]])}function We(e,t,n=new Map,i=new Map,a=null,o=()=>!1){let s=e=>{let t=n.get(e)??i.get(e);return t===void 0?[...new Set([e,Ze(a,e)??e])]:[t]},c=[],l=[],u=[],d=new Set;for(let n of e.values()){let e=s(n.parent).map(e=>t.get(r(e,n.specifier,n.conditions,n.platform))).find(Boolean),a=i.get(n.target)??n.target;if(e){if(d.add(e.key),!s(n.target).includes(e.target)){let{target:t,...n}=e;c.push({...n,baseTarget:a,otherTarget:t})}continue}let u=s(n.parent).find(o);if(u===void 0)continue;let{specifier:f,conditions:p,platform:m}=n;l.push({key:r(u,f,p,m),parent:u,specifier:f,conditions:p,platform:m,baseTarget:a,otherTarget:null})}for(let e of t.values()){if(d.has(e.key)||!o(e.parent))continue;let{target:t,...n}=e;u.push({...n,baseTarget:null,otherTarget:t})}for(let e of[c,l,u])e.sort((e,t)=>e.key.localeCompare(t.key));return{changed:c,onlyBase:l,onlyOther:u,totalChanges:c.length+l.length+u.length}}function Z(e){return m(e)??0}function Ge(e,t){return e===t||e?.format===`base64`&&t?.format===`base64`&&e.data===t.data||e?.format===`digest`&&t?.format===`digest`&&e.digest===t.digest}function Q(e){if(e?.npmExecutable instanceof Set)return t=>({executable:e.npmExecutable.has(t)});if(e?.kind!==`stasis`||!e.bundle)return null;let{formats:t,executable:n,entries:r}=e.bundle;return e=>({format:t?.get(e),executable:n?.has(e)??!1,entry:r?.has(e)??!1})}function Ke(e,t){return!e||!t?[]:[`format`,`executable`,`entry`].filter(n=>e[n]!==t[n]).map(n=>({field:n,from:e[n],to:t[n]}))}function qe(e){return(t,n)=>Math.abs(n.delta)-Math.abs(t.delta)||t[e].localeCompare(n[e])}function $(e){return(t,n)=>n.bytes-t.bytes||t[e].localeCompare(n[e])}function Je(e,t){return typeof e==`string`?`\0text\0${e.toWellFormed()}`:e?.format===`base64`?`\0base64\0${e.data}`:e?.format===`digest`?`\0digest\0${e.digest}`:`\0none\0${t}`}var Ye=250;function Xe(e,t,n,r,i){let a=(e,t,n)=>e.filter(({path:e})=>e!==``&&e.isWellFormed()).map(({path:e},r)=>({name:e,data:Je(t.get(e),`${n}${r}`)})),o={paths:`keys`,renameGroup:i,renameLimit:Ye,lines:!1},s=Be(a(e,n,`a`),a(t,r,`b`),o);return new Map(s.filter(({status:e})=>e===`renamed`).map(e=>[e.old.path,e.new.path]))}function Ze(e,t){return e?e.base===``?`${e.other}${t}`:t.startsWith(e.base)?t.slice(e.base.length):null:t}function Qe(){return{baseBytes:0,otherBytes:0,onlyBaseFiles:0,onlyOtherFiles:0,changedFiles:0}}function $e(e,t,n,r=He(e.keys(),t.keys()),i=[]){let{root:a,paths:o}=r,s=new Map([...o].map(([e,t])=>[t,e]));e=new Map([...e].map(([e,t])=>[o.get(e),t]));let c=e=>s.get(e)===e?{}:{basePath:s.get(e)},l=(e,t)=>{let n=Ke(i[0]?.(e),i[1]?.(t));return n.length>0?{meta:n}:{}},u=[],d=[],f=[],p=0,m=0,h=0,g=0,_=0,v=0,y=new Map,b=e=>{let t=n(e),r=y.get(t);return r||(r=Qe(),y.set(t,r)),r},x=new Set([...e.keys(),...t.keys()]);for(let n of x){let r=e.has(n),i=t.has(n),a=b(n);if(r&&i){let r=e.get(n),i=t.get(n),o=Ge(r,i),u=l(s.get(n),n),d=Z(r),h=o?d:Z(i);if(p+=d,m+=h,a.baseBytes+=d,a.otherBytes+=h,o&&!u.meta)v++;else{let e=h-d;f.push({path:n,...c(n),baseBytes:d,otherBytes:h,delta:e,...u,...o?{modified:!1}:{}}),_+=e,a.changedFiles++}}else if(r){let t=Z(e.get(n));p+=t,h+=t,a.baseBytes+=t,a.onlyBaseFiles++,u.push({path:n,...c(n),bytes:t})}else{let e=Z(t.get(n));m+=e,g+=e,a.otherBytes+=e,a.onlyOtherFiles++,d.push({path:n,bytes:e})}}let S=Xe(u,d,e,t,n);if(S.size>0){let n=new Set(S.values());for(let[n,r]of S){let i=e.get(n),a=t.get(r),o=Ge(i,a),c=Z(i),u=o?c:Z(a);h-=c,g-=u,f.push({path:r,renamedFrom:n,basePath:s.get(n),baseBytes:c,otherBytes:u,delta:u-c,modified:!o,...l(s.get(n),r)}),_+=u-c;let d=b(n);d.onlyBaseFiles--,d.onlyOtherFiles--,d.changedFiles++}u.splice(0,u.length,...u.filter(e=>!S.has(e.path))),d.splice(0,d.length,...d.filter(e=>!n.has(e.path)))}let C=[],w=[],T=[],E=[];for(let[e,t]of y){let n=t.baseBytes>0||t.onlyBaseFiles>0||t.changedFiles>0,r=t.otherBytes>0||t.onlyOtherFiles>0||t.changedFiles>0,i=t.onlyBaseFiles+t.onlyOtherFiles+t.changedFiles;n&&!r?C.push({pkg:e,bytes:t.baseBytes}):r&&!n?w.push({pkg:e,bytes:t.otherBytes}):i>0||t.baseBytes!==t.otherBytes?T.push({pkg:e,baseBytes:t.baseBytes,otherBytes:t.otherBytes,delta:t.otherBytes-t.baseBytes}):E.push({pkg:e,bytes:t.baseBytes})}return u.sort($(`path`)),d.sort($(`path`)),f.sort(qe(`path`)),C.sort($(`pkg`)),w.sort($(`pkg`)),T.sort(qe(`pkg`)),{totals:{baseFiles:e.size,baseBytes:p,otherFiles:t.size,otherBytes:m,onlyBaseFiles:u.length,onlyBaseBytes:h,onlyOtherFiles:d.length,onlyOtherBytes:g,changedFiles:f.length,renamedFiles:S.size,changedDelta:_,unchangedFiles:v,fileDelta:t.size-e.size,byteDelta:m-p,identical:u.length===0&&d.length===0&&f.length===0},files:{onlyBase:u,onlyOther:d,changed:f,root:a,basePaths:o},packages:{onlyBase:C,onlyOther:w,changed:T,unchanged:E}}}function et(e,r,a=null){let[o,s]=[e,r],[c,l]=t(o,s,a),u=n(o,c),p=n(s,l),m=He(u.keys(),p.keys()),y=Ue(h(o),h(s),m),b=$e(u,p,e=>v(e,{packageDir:y?.get(e)}),m,[Q(o),Q(s)]),x=_(o),S=_(s),C=(e,t)=>{let n=0;for(let r of t)n+=e.get(r)??0;return n};Object.assign(b.totals,{baseLines:C(x,u.keys()),otherLines:C(S,p.keys())});for(let e of b.files.onlyBase)e.lines=x.get(e.basePath??e.path)??0;for(let e of b.files.onlyOther)e.lines=S.get(e.path)??0;for(let e of b.files.changed)Object.assign(e,{baseLines:x.get(e.basePath??e.path)??0,otherLines:S.get(e.path)??0});let w=new Set([...b.files.onlyOther,...b.files.changed.filter(e=>e.modified!==!1)].map(e=>e.path));b.resolutions=We(i(o,c),i(s,l),new Map(b.files.changed.filter(e=>e.renamedFrom!=null).map(e=>[e.basePath,e.path])),b.files.basePaths,b.files.root,e=>p.has(e)&&!w.has(e));let T=e=>v(``,{packageDir:e}),E=g(o,c?u.keys():null,T),D=g(s,l?p.keys():null,T);return b.versionUpdates=f(E,D),b.packageRows=d(b.packages,E,D),b.scope=a??``,b}export{et as prepareComparison};
@@ -1,4 +1,4 @@
1
- import{a as e,b as t,c as n,d as r}from"./chunk-UJP4PQJA.js";import{a as i,b as a,c as o,d as s,e as c}from"./chunk-UJSJMXEG.js";import{C as l,F as u,H as d,J as f,M as p,O as m,Q as h,S as g,e as _,f as v,h as y,k as b,m as x,n as S,o as C,p as w,u as T,v as E,w as D,x as O,z as k}from"./chunk-LVW7WWV4.js";import{b as ee}from"./chunk-DEVAORP2.js";import{d as te}from"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{a as ne,d as A,h as j,i as M,j as N,k as P,l as re,o as ie,p as F,r as ae,s as I,t as oe}from"./chunk-7HP2VYIC.js";import"./chunk-OOJM4CTU.js";var se=[`name`,`version`,`uid`,`resolved`,`integrity`,`dependencies`,`optionalDependencies`];function ce(e,t){let n=e.indexOf(`@`,1);if(n===-1)throw new A(`${j(e)} is not a pattern of the form name@range`,t);return{name:O(e.slice(0,n),t),range:e.slice(n+1)}}function le(e){if(!e.startsWith(`npm:`))return;let t=e.slice(4),n=t.indexOf(`@`,1);return n===-1?{name:t,range:``}:{name:t.slice(0,n),range:t.slice(n+1)}}var ue=new Set([`github.com`,`gitlab.com`,`bitbucket.com`,`bitbucket.org`]);function L(e){if(/^(?:git:|git\+.+:|ssh:|https?:.+\.git(?:$|#.))/u.test(e))return!0;let t=URL.parse(e);return t!==null&&ue.has(t.hostname)&&`${t.pathname}${t.search}`.split(`/`).filter(Boolean).length===2}var de=/^[^:@%/\s.-][^:@%/\s]*\/[^:@\s/%][^:@\s/%#]*(?:#.*)?$/u;function R(e){return L(e)?`git`:/^https?:\/\//u.test(e)||!e.includes(`@`)&&/\.(?:tgz|tar\.gz)$/u.test(e)?`tarball`:e.startsWith(`github:`)||de.test(e)?`github`:/^(?:file:|\.{1,2}\/|\/)/u.test(e)?`file`:/^(link|gitlab|gist|bitbucket):/u.exec(e)?.[1]??`registry`}var fe={github:{host:`github.com`,archive:e=>[`https://codeload.github.com/${e}/tar.gz/`,``]},gitlab:{host:`gitlab.com`,archive:e=>[`https://gitlab.com/${e}/repository/archive.tar.gz?ref=`,``]},bitbucket:{host:`bitbucket.org`,archive:e=>[`https://bitbucket.org/${e}/get/`,`.tar.gz`]}};function pe(e){let t=e.split(`@`),n=(t.length>2?`${t[1]}@${t[2]}`:e).replace(/#.*/u,``).replace(/^.*:/u,``).replace(/.git$/u,``).split(`/`);return n.length<2?void 0:n.slice(-2).join(`/`)}function z(e){let t=e.replace(/^(?:file|link):/u,``);return t.startsWith(`/`)?`/${t.split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`)}`:u(`.`,t)}function me(e,t,n){let r=k(e,t);if(n!==void 0&&n.valid(r)===null)throw new A(`${j(r)} is not a version semver reads`,t);return r}function he(e,t,n,r,i){if(e.startsWith(`file:`))l(e.slice(e.startsWith(`file:./`)?7:5),r);else if(!h(e))throw new A(`${j(e)} is not an http(s) URL, a file: path or a git URL`,r);if(t!==void 0&&!f(t))throw new A(`${j(t)} is not the hex sha1 of a tarball`,r);let a=n===void 0?void 0:m(n,i).get(`sha1`);if(t!==void 0&&a!==void 0&&a.slice(5)!==te(ee(t)))throw new A(`${j(a)} is not the sha1 after the "#" of resolved`,i);return{type:`tarball`,tarball:e,sha1:t,integrity:n}}function ge(e,t){let n=M(t,`resolved`),r=M(t,`integrity`);if(e.resolved===void 0){if(e.integrity!==void 0)throw new A(`an integrity, with nothing resolved`,r);return}let[i,a,...o]=S(e.resolved,n).split(`#`);if(o.length>0)throw new A(`more than one "#", of which yarn reads the first alone`,n);if(!L(i))return he(i,a,e.integrity,n,r);if(e.integrity!==void 0)throw new A(`an integrity, which yarn does not check for a git repository`,r);if(a===void 0||!d(a))throw new A(`expected a full commit hash after the "#" of ${j(i)}`,n);return{type:`git`,repo:p(i,n),commit:a}}function B(e){if(e!==void 0)return e.type===`git`?`${e.repo}#${e.commit}`:e.tarball.replace(/^file:\.\//u,`file:`)}var _e=e=>e===void 0?`nothing, as for a directory`:e.type===`git`?`a git repository`:`a file: tarball`;function ve(e,t,n){let[r]=e,i=e.find(e=>e.name!==r.name);if(i!==void 0)throw new A(`${j(r.key)} and ${j(i.key)} give it two names, of which yarn installs it under one alone`,n);if(t.name!==void 0){let e=y(t.name,M(n,`name`)),i=e===r.name?`the name its patterns give, which yarn does not write`:`yarn installs this as ${j(e)}, and leaves ${j(r.name)} out, which its patterns ask for`;throw new A(i,M(n,`name`))}let a=e.filter(e=>e.source===`registry`).map(({key:e,name:t,alias:r})=>[e,r===void 0?t:O(r.name,n)]),o=a.find(([,e])=>e!==a[0][1]);if(o!==void 0)throw new A(`${j(a[0][0])} and ${j(o[0])} ask for two packages, ${j(a[0][1])} and ${j(o[1])}`,n);return a[0]?.[1]}function ye({range:e,source:t},n){let r=e.split(`#`)[0];if(t===`file`||t===`link`)return n===void 0;if(t===`tarball`)return n?.tarball===r;if(t===`git`)return n?.repo===r;if(t===`gist`)return n?.repo===`https://gist.github.com/${r.slice(5)}.git`;let{host:i,archive:a}=fe[t],o=pe(e);if(o===void 0||n===void 0)return!1;if(n.type===`git`)return n.repo===`git+ssh://git@${i}/${o}.git`;let[s,c]=a(o),{tarball:l}=n;return l.startsWith(s)&&l.endsWith(c)&&d(l.slice(s.length,l.length-c.length))}function be(e,t){let[n,...r]=e.filter(e=>e.source===`file`||e.source===`link`),i=r.find(e=>n.source===`link`||e.source===`link`||z(e.range)!==z(n.range));if(i!==void 0)throw new A(`${j(n.key)} and ${j(i.key)} share an entry, where yarn writes one for each`,t)}function xe(e,t,{asks:n,version:r},i){let a=e.filter(e=>e.source!==`registry`),o=a.find(e=>!ye(e,t));if(o!==void 0)throw new A(`${j(o.key)} resolves to another source than it names`,M(i,`resolved`));be(e,i);let s=e.find(e=>e.source===`registry`);if((a.length===0||a.some(e=>e.source===`tarball`))&&t?.type===`tarball`&&t.sha1===void 0&&t.integrity===void 0)throw new A(`a tarball with no hash, neither a sha1 after "#" nor an integrity, where yarn writes the sha1`,M(i,`resolved`));if(s!==void 0){if(a.length>0)return{registry:s.key,sources:a.map(e=>e.key)};if(t===void 0&&e.length===1)return{registry:s.key,sources:[]};if(t?.type!==`tarball`||t.tarball.startsWith(`file:`))throw new A(`${j(s.key)} asks for the registry, and resolves to ${_e(t)}`,i);g(t.tarball,n,r,M(i,`resolved`))}}function Se(e,t,n){let r=Object.create(null);for(let[i,a,o]of v(b(e),t)){let e=`${O(i,o)}@${y(a,o)}`;r[i]=e,n.push({targets:r,name:i,range:a,pattern:e,where:o})}return r}function Ce({keys:e,fields:n},r,i){_(n,r,se);let a=e.map(e=>{let{name:t,range:n}=ce(e,M(``,e));return{key:e,name:t,range:n,source:R(n),alias:le(n)}}),o=ve(a,n,r),s=me(n.version,M(r,`version`),i),c=ge(n,r),l=xe(a,c,{asks:o,version:s},r),u=[],{dependencies:d,optionalDependencies:f}=t(n,r,(e,t)=>Se(e,t,u)),p=x(n,`uid`,r,y);if(p===s)throw new A(`the version, which yarn does not write as a uid`,M(r,`uid`));return{pkg:{patterns:e,name:a[0].name,version:s,uid:p,resolution:c,dependencies:d,optionalDependencies:f},patterns:a,handed:l,requests:u}}var we=/^(?![vV=]?\d|[xX*](?:\.|$))[A-Za-z][\w.-]*$/u;function V(e,t){return t===void 0?!/[:/@#]/u.test(e)&&!we.test(e):t.validRange(e)!==null}function Te(e,t,n,r,i){let a=e=>e.source===`registry`&&V(e.range,r),o=t.find(a)??n.patterns.find(a);if(o!==void 0)throw new A(`is ${e.name} ${e.version}, as ${j(n.key)} is, and yarn gives ${j(o.key)} whichever it resolves first`,i)}var H=({integrity:e})=>e===void 0?new Map:m(e),U=e=>JSON.stringify(Object.entries(e).sort(([e],[t])=>e<t?-1:1));function W(e,t,n,r){for(let i of[`dependencies`,`optionalDependencies`])if(U(e[i])!==U(t[i]))throw new A(`other ${i} ${n}`,M(r,i))}function Ee(e,t,n){let r=`than ${j(t.patterns[0])}, of the same ${e.resolution.type===`git`?`commit`:`tarball`}`;if(e.version!==t.version)throw new A(`another version ${r}`,M(n,`version`));W(e,t,r,n);let[i,a]=[e.resolution,t.resolution];if(i.sha1!==void 0&&a.sha1!==void 0&&i.sha1!==a.sha1)throw new A(`another sha1 ${r}`,M(n,`resolved`));let o=H(a);for(let[e,t]of H(i))if(o.has(e)&&o.get(e)!==t)throw new A(`another ${e} integrity ${r}`,M(n,`integrity`))}function De(e,t){let n=Object.create(null),r=[],i=[],a=[],o=new Map,s=new Map,c=new Map;for(let l of e){let[e]=l.keys,u=M(``,e),d=Ce(l,u,t),{pkg:f}=d;for(let e of l.keys)n[e]=f;r.push(...d.patterns),i.push(...d.requests),d.handed!==void 0&&a.push({pkg:f,...d.handed});let p=d.patterns.find(e=>e.source===`file`),m=l.fields.resolved??(p===void 0?void 0:`
1
+ import{a as e,b as t,c as n,d as r}from"./chunk-UJP4PQJA.js";import{a as i,b as a,c as o,d as s,e as c}from"./chunk-UJSJMXEG.js";import{C as l,F as u,H as d,J as f,M as p,O as m,Q as h,S as g,e as _,f as v,h as y,k as b,m as x,n as S,o as C,p as w,u as T,v as E,w as D,x as O,z as k}from"./chunk-LVW7WWV4.js";import{b as ee}from"./chunk-DEVAORP2.js";import{d as te}from"./chunk-ZQHLECTI.js";import{a as ne,d as A,h as j,i as M,j as N,k as P,l as re,o as ie,p as F,r as ae,s as I,t as oe}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";var se=[`name`,`version`,`uid`,`resolved`,`integrity`,`dependencies`,`optionalDependencies`];function ce(e,t){let n=e.indexOf(`@`,1);if(n===-1)throw new A(`${j(e)} is not a pattern of the form name@range`,t);return{name:O(e.slice(0,n),t),range:e.slice(n+1)}}function le(e){if(!e.startsWith(`npm:`))return;let t=e.slice(4),n=t.indexOf(`@`,1);return n===-1?{name:t,range:``}:{name:t.slice(0,n),range:t.slice(n+1)}}var ue=new Set([`github.com`,`gitlab.com`,`bitbucket.com`,`bitbucket.org`]);function L(e){if(/^(?:git:|git\+.+:|ssh:|https?:.+\.git(?:$|#.))/u.test(e))return!0;let t=URL.parse(e);return t!==null&&ue.has(t.hostname)&&`${t.pathname}${t.search}`.split(`/`).filter(Boolean).length===2}var de=/^[^:@%/\s.-][^:@%/\s]*\/[^:@\s/%][^:@\s/%#]*(?:#.*)?$/u;function R(e){return L(e)?`git`:/^https?:\/\//u.test(e)||!e.includes(`@`)&&/\.(?:tgz|tar\.gz)$/u.test(e)?`tarball`:e.startsWith(`github:`)||de.test(e)?`github`:/^(?:file:|\.{1,2}\/|\/)/u.test(e)?`file`:/^(link|gitlab|gist|bitbucket):/u.exec(e)?.[1]??`registry`}var fe={github:{host:`github.com`,archive:e=>[`https://codeload.github.com/${e}/tar.gz/`,``]},gitlab:{host:`gitlab.com`,archive:e=>[`https://gitlab.com/${e}/repository/archive.tar.gz?ref=`,``]},bitbucket:{host:`bitbucket.org`,archive:e=>[`https://bitbucket.org/${e}/get/`,`.tar.gz`]}};function pe(e){let t=e.split(`@`),n=(t.length>2?`${t[1]}@${t[2]}`:e).replace(/#.*/u,``).replace(/^.*:/u,``).replace(/.git$/u,``).split(`/`);return n.length<2?void 0:n.slice(-2).join(`/`)}function z(e){let t=e.replace(/^(?:file|link):/u,``);return t.startsWith(`/`)?`/${t.split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`)}`:u(`.`,t)}function me(e,t,n){let r=k(e,t);if(n!==void 0&&n.valid(r)===null)throw new A(`${j(r)} is not a version semver reads`,t);return r}function he(e,t,n,r,i){if(e.startsWith(`file:`))l(e.slice(e.startsWith(`file:./`)?7:5),r);else if(!h(e))throw new A(`${j(e)} is not an http(s) URL, a file: path or a git URL`,r);if(t!==void 0&&!f(t))throw new A(`${j(t)} is not the hex sha1 of a tarball`,r);let a=n===void 0?void 0:m(n,i).get(`sha1`);if(t!==void 0&&a!==void 0&&a.slice(5)!==te(ee(t)))throw new A(`${j(a)} is not the sha1 after the "#" of resolved`,i);return{type:`tarball`,tarball:e,sha1:t,integrity:n}}function ge(e,t){let n=M(t,`resolved`),r=M(t,`integrity`);if(e.resolved===void 0){if(e.integrity!==void 0)throw new A(`an integrity, with nothing resolved`,r);return}let[i,a,...o]=S(e.resolved,n).split(`#`);if(o.length>0)throw new A(`more than one "#", of which yarn reads the first alone`,n);if(!L(i))return he(i,a,e.integrity,n,r);if(e.integrity!==void 0)throw new A(`an integrity, which yarn does not check for a git repository`,r);if(a===void 0||!d(a))throw new A(`expected a full commit hash after the "#" of ${j(i)}`,n);return{type:`git`,repo:p(i,n),commit:a}}function B(e){if(e!==void 0)return e.type===`git`?`${e.repo}#${e.commit}`:e.tarball.replace(/^file:\.\//u,`file:`)}var _e=e=>e===void 0?`nothing, as for a directory`:e.type===`git`?`a git repository`:`a file: tarball`;function ve(e,t,n){let[r]=e,i=e.find(e=>e.name!==r.name);if(i!==void 0)throw new A(`${j(r.key)} and ${j(i.key)} give it two names, of which yarn installs it under one alone`,n);if(t.name!==void 0){let e=y(t.name,M(n,`name`)),i=e===r.name?`the name its patterns give, which yarn does not write`:`yarn installs this as ${j(e)}, and leaves ${j(r.name)} out, which its patterns ask for`;throw new A(i,M(n,`name`))}let a=e.filter(e=>e.source===`registry`).map(({key:e,name:t,alias:r})=>[e,r===void 0?t:O(r.name,n)]),o=a.find(([,e])=>e!==a[0][1]);if(o!==void 0)throw new A(`${j(a[0][0])} and ${j(o[0])} ask for two packages, ${j(a[0][1])} and ${j(o[1])}`,n);return a[0]?.[1]}function ye({range:e,source:t},n){let r=e.split(`#`)[0];if(t===`file`||t===`link`)return n===void 0;if(t===`tarball`)return n?.tarball===r;if(t===`git`)return n?.repo===r;if(t===`gist`)return n?.repo===`https://gist.github.com/${r.slice(5)}.git`;let{host:i,archive:a}=fe[t],o=pe(e);if(o===void 0||n===void 0)return!1;if(n.type===`git`)return n.repo===`git+ssh://git@${i}/${o}.git`;let[s,c]=a(o),{tarball:l}=n;return l.startsWith(s)&&l.endsWith(c)&&d(l.slice(s.length,l.length-c.length))}function be(e,t){let[n,...r]=e.filter(e=>e.source===`file`||e.source===`link`),i=r.find(e=>n.source===`link`||e.source===`link`||z(e.range)!==z(n.range));if(i!==void 0)throw new A(`${j(n.key)} and ${j(i.key)} share an entry, where yarn writes one for each`,t)}function xe(e,t,{asks:n,version:r},i){let a=e.filter(e=>e.source!==`registry`),o=a.find(e=>!ye(e,t));if(o!==void 0)throw new A(`${j(o.key)} resolves to another source than it names`,M(i,`resolved`));be(e,i);let s=e.find(e=>e.source===`registry`);if((a.length===0||a.some(e=>e.source===`tarball`))&&t?.type===`tarball`&&t.sha1===void 0&&t.integrity===void 0)throw new A(`a tarball with no hash, neither a sha1 after "#" nor an integrity, where yarn writes the sha1`,M(i,`resolved`));if(s!==void 0){if(a.length>0)return{registry:s.key,sources:a.map(e=>e.key)};if(t===void 0&&e.length===1)return{registry:s.key,sources:[]};if(t?.type!==`tarball`||t.tarball.startsWith(`file:`))throw new A(`${j(s.key)} asks for the registry, and resolves to ${_e(t)}`,i);g(t.tarball,n,r,M(i,`resolved`))}}function Se(e,t,n){let r=Object.create(null);for(let[i,a,o]of v(b(e),t)){let e=`${O(i,o)}@${y(a,o)}`;r[i]=e,n.push({targets:r,name:i,range:a,pattern:e,where:o})}return r}function Ce({keys:e,fields:n},r,i){_(n,r,se);let a=e.map(e=>{let{name:t,range:n}=ce(e,M(``,e));return{key:e,name:t,range:n,source:R(n),alias:le(n)}}),o=ve(a,n,r),s=me(n.version,M(r,`version`),i),c=ge(n,r),l=xe(a,c,{asks:o,version:s},r),u=[],{dependencies:d,optionalDependencies:f}=t(n,r,(e,t)=>Se(e,t,u)),p=x(n,`uid`,r,y);if(p===s)throw new A(`the version, which yarn does not write as a uid`,M(r,`uid`));return{pkg:{patterns:e,name:a[0].name,version:s,uid:p,resolution:c,dependencies:d,optionalDependencies:f},patterns:a,handed:l,requests:u}}var we=/^(?![vV=]?\d|[xX*](?:\.|$))[A-Za-z][\w.-]*$/u;function V(e,t){return t===void 0?!/[:/@#]/u.test(e)&&!we.test(e):t.validRange(e)!==null}function Te(e,t,n,r,i){let a=e=>e.source===`registry`&&V(e.range,r),o=t.find(a)??n.patterns.find(a);if(o!==void 0)throw new A(`is ${e.name} ${e.version}, as ${j(n.key)} is, and yarn gives ${j(o.key)} whichever it resolves first`,i)}var H=({integrity:e})=>e===void 0?new Map:m(e),U=e=>JSON.stringify(Object.entries(e).sort(([e],[t])=>e<t?-1:1));function W(e,t,n,r){for(let i of[`dependencies`,`optionalDependencies`])if(U(e[i])!==U(t[i]))throw new A(`other ${i} ${n}`,M(r,i))}function Ee(e,t,n){let r=`than ${j(t.patterns[0])}, of the same ${e.resolution.type===`git`?`commit`:`tarball`}`;if(e.version!==t.version)throw new A(`another version ${r}`,M(n,`version`));W(e,t,r,n);let[i,a]=[e.resolution,t.resolution];if(i.sha1!==void 0&&a.sha1!==void 0&&i.sha1!==a.sha1)throw new A(`another sha1 ${r}`,M(n,`resolved`));let o=H(a);for(let[e,t]of H(i))if(o.has(e)&&o.get(e)!==t)throw new A(`another ${e} integrity ${r}`,M(n,`integrity`))}function De(e,t){let n=Object.create(null),r=[],i=[],a=[],o=new Map,s=new Map,c=new Map;for(let l of e){let[e]=l.keys,u=M(``,e),d=Ce(l,u,t),{pkg:f}=d;for(let e of l.keys)n[e]=f;r.push(...d.patterns),i.push(...d.requests),d.handed!==void 0&&a.push({pkg:f,...d.handed});let p=d.patterns.find(e=>e.source===`file`),m=l.fields.resolved??(p===void 0?void 0:`
2
2
  ${z(p.range)}`),h=m===void 0?void 0:`${f.name}
3
3
  ${m}`;if(o.has(h))throw new A(`resolves as ${j(o.get(h))} does, which yarn writes as one entry`,u);h!==void 0&&o.set(h,e);let g=B(f.resolution);if(g!==void 0){let e=s.get(g)??s.set(g,[]).get(g);e.length>0&&Ee(f,e[0],u),e.push(f)}if(d.handed?.sources.length===0)continue;let _=`${f.name}
4
4
  ${f.version}`,v=c.get(_);v===void 0?c.set(_,{key:e,patterns:d.patterns}):Te(f,d.patterns,v,t,u)}for(let e of a)e.other=s.get(B(e.pkg.resolution))?.find(t=>t!==e.pkg);return{packages:n,patterns:r,requests:i,mixed:a}}var G=`manifests`;function Oe(e,t,n){let r=/^(?:file|link):/u.exec(e)?.[0];if(r===void 0&&!e.startsWith(`/`))return e;let i=e.slice(r?.length??0);if(i.startsWith(`/`)||/^[A-Za-z]:/u.test(i))throw new A(`${j(e)} is an absolute path`,n);let a=l(u(t,i),n);return`${r}${a!==`.`&&/^\.(?:\/|$)/u.test(i)&&!/^\.{0,2}\//u.test(a)?`./`:``}${a}`}var K=(e,t,n)=>n===void 0?e.version===t||void 0:n.satisfies(e.version,t,{loose:!0});function q({name:e,range:t,pattern:n,where:r},i,a){let o=i.get(e);if(o!==void 0&&K(o,t,a)===!0)throw new A(`${j(n)} is satisfied by the workspace ${j(o.dir)}, which yarn links instead`,r)}function J({name:e,range:t,pattern:n,where:r},i,a){let o=i?.get(e);if(o===void 0)throw new A(`${j(n)} is not a pattern of the lockfile${i===void 0?`, nor a workspace's, as only the manifests may say`:``}`,r);if(K(o,t,a)===!1)throw new A(`${j(n)} is not a pattern of the lockfile, nor satisfied by the workspace ${j(o.dir)}, ${o.version}`,r);return`link:${o.dir}`}function Y(e,t,n,r){for(let i of e)i.pattern in t||(i.targets[i.name]=J(i,n,r))}function X(e,{packages:t,workspaces:n,semver:r}){return e.pattern in t?(q(e,n,r),e.pattern):J(e,n,r)}var ke=[`optionalDependencies`,`dependencies`,`devDependencies`];function Ae(t,n,r,i){let a=new Map;for(let e of ke)for(let[n,i,o]of v(b(t[e]),M(r,e))){if(n===`//`)continue;let t=y(i,o),r=a.get(n)??a.set(n,{kind:e,value:t,here:o,range:void 0}).get(n);r.range===void 0&&t!==``&&t!==`*`&&(r.range=t)}let o=Object.create(null);for(let t of e)o[t]=Object.create(null);for(let[e,{kind:t,value:r,here:s,range:c}]of a){let a=Oe(c??r,n,s);o[t][e]=X({name:e,range:a,pattern:`${O(e,s)}@${a}`,where:s},i)}return o}function je(e,t,n){let r=[];for(let[a,o,s]of v(b(e),t)){if(a===`//`)continue;if(/\/$|\/\/|\*$/u.test(a))throw new A(`${j(a)} is a path yarn ignores`,s);let e=a.match(/(?:@[^/]+\/)?[^/]+/gu)??[a],t=i(e.length===1?`**/${a}`:a,s),c=O(e.at(-1),s),l=e.slice(0,-1).find(e=>e!==`**`&&!D(e.replaceAll(/[*?]/gu,`x`)));if(l!==void 0)throw new A(`${j(l)} is not a package name, or a glob of one`,s);let u=y(o,s);if(R(u)===`registry`&&!V(u,n))throw new A(`${j(u)} is a range yarn ignores in a resolution: neither a semver range nor a source`,s);r.push({path:a,tests:t,name:c,range:u,pattern:`${c}@${u}`,where:s})}return r}function Me(t,r,i){let a=Object.values(t).flatMap(t=>e.map(e=>t[e])),o=n([i.map(e=>e.pattern).filter(e=>e in r),...a],r);if(o!==void 0)throw new A(`nothing asks for it: no manifest, no package and no resolution`,M(``,o))}function Ne(e,t){let n=e.workspaces;if(n===void 0)return[];let r=M(t,`workspaces`),a=n;Array.isArray(n)||(_(n,r,[`packages`,`nohoist`]),x(n,`nohoist`,r,C),a=n.packages===void 0?[]:n.packages,r=M(r,`packages`));let o=C(a,r);if(o.length>0&&e.private!==!0)throw new A(`expected true, as yarn has workspaces in a private project alone`,M(t,`private`));return o.map((e,t)=>i(e.replace(/^(?:\.\/)+/u,``).replace(/(?<!\/)\/+$/u,``),`${r}[${t}]`))}var Pe={__proto__:null,depdenencies:`dependencies`,dependancies:`dependencies`,dependecies:`dependencies`,depends:`dependencies`,"dev-dependencies":`devDependencies`,devDependences:`devDependencies`,devDepenencies:`devDependencies`,devEependencies:`devDependencies`,devdependencies:`devDependencies`},Fe=/^[\s\dA-Za-z.+=-]{1,256}$/u;function Ie(e,t,n){let r=S(e,t);if(!Fe.test(r))throw new A(`${j(r)} is not a version`,t);if(n===void 0)return r;let i=n.clean(r,{loose:!0});if(i===null)throw new A(`${j(r)} is not a version semver reads`,t);return i}function Le(e,t,n,r,i){for(let e of Object.keys(Pe))if(Object.hasOwn(t,e))throw new A(`a field yarn does not read, for ${j(Pe[e])}`,M(n,e));if(l(e,n)===`.`)return;if(r.length===0)throw new A(`expected workspaces, as there are manifests of workspaces`,M(M(G,`.`),`workspaces`));if(e.split(`/`).includes(`node_modules`)||!r.some(t=>c(t,e)))throw new A("not a workspace the root's `workspaces` finds",n);if(t.resolutions!==void 0)throw new A(`a workspace's, which yarn does not read`,M(n,`resolutions`));let a=M(n,`name`),o=O(y(t.name,a),a);if(t.version===void 0)throw new A(`expected a version, without which yarn ignores the workspace`,M(n,`version`));return{name:o,dir:e,version:Ie(t.version,M(n,`version`),i)}}function Re(e,t,n,r){_(e,G);let i=M(G,`.`),a=e[`.`];if(a===void 0)throw new A(`expected the manifest beside the lockfile, "."`,G);let o=Ne(_(a,i),i),s=new Map;for(let[t,n,i]of v(e,G)){let e=Le(t,_(n,i),i,o,r);if(e!==void 0){if(s.has(e.name))throw new A(`the name of the workspace ${j(s.get(e.name).dir)} too`,M(i,`name`));s.set(e.name,e)}}for(let e of n)e.pattern in t&&q(e,s,r);Y(n,t,s,r);let c={packages:t,workspaces:s,semver:r},l=w(e,G,(e,t,n)=>Ae(e,n,t,c)),u=je(a.resolutions,M(i,`resolutions`),r);for(let e of u){if(!(e.pattern in t)&&!s.has(e.name))throw new A(`${j(e.pattern)} is not a pattern of the lockfile, where yarn records every resolution's`,e.where);e.target=X(e,c)}return Me(l,t,u),{importers:l,workspaces:s,rules:u,aggregated:Array.isArray(a.workspaces?.packages??a.workspaces)}}var ze=`workspace-aggregator-00000000-0000-0000-0000-000000000000`;function Be(t,{importers:n,workspaces:r,rules:i,aggregated:c},l){let u=i.map(e=>e.tests),d=(e,t)=>t.split(`/`).reduce((e,t)=>e.map((e,n)=>o(u[n],e,t)),e),f=e=>e.startsWith(`link:`)?n[e.slice(5)]:t[e],p=(e,t,r,i)=>{let a=e.patterns===void 0?M(G,Object.keys(n).find(t=>n[t]===e)):M(``,e.patterns[0]);return new A(`${j(e[t][r])} ${i}`,M(M(a,t),r))},m=new Map,h=[],g=new Set,_=new Map,v=(e,t,n,r)=>{let i=e[t][n],a=r===void 0||r.pattern===i,o=a?_.get(i):g.has(i)?r:void 0;if(o!==void 0)throw p(e,t,n,`is asked for both where the resolution ${j(o.path)} applies and where none does, and yarn writes one entry for both`);a?g.add(i):_.set(i,r)},y=new Set,x=(e,t)=>{if(y.has(e))return;let n=m.get(e)??new Set,r=t.join();n.has(r)||(m.set(e,n.add(r)),h.push([e,t]))},S=n[`.`],C=u.map(e=>a(e,1)),w=d(C,ze),T=new Map,E=[],D=(e,n)=>t[e.target]===n||l.get(n)?.sources[0]===e.target,O=(e,n,a,o)=>{let m=e[n][a],h=d(o,a),g=t[m],_=l.get(g),y=_===void 0?``:`the resolution ${j(_.rule.path)} resolves to`,b=e===S&&(!c||r.has(a)),C=e===S&&!b?d(w,a):h,O=i.find((e,t)=>e.name===a&&s(u[t],C[t]));if(b){if(_!==void 0)throw p(e,n,a,`is given what ${y}, which yarn applies to no dependency of the root's own`);if(O!==void 0&&!D(O,g))throw p(e,n,a,`is not given ${j(O.pattern)} as the resolution ${j(O.path)} says, which yarn ignores for the root's own dependencies`);return v(e,n,a,void 0),x(f(m),h)}if(O!==void 0&&!D(O,g))throw p(e,n,a,`is not given ${j(O.pattern)}, which the resolution ${j(O.path)} resolves it to`);if(_?.sources.includes(m))throw p(e,n,a,`asks for what ${y}, as a dependency of its own`);if(_!==void 0&&!_.sources.includes(O?.target))throw p(e,n,a,`is given what ${y}, which yarn does not apply to it here`);v(e,n,a,O),e===S&&O!==void 0&&T.set(m,O),O===void 0?x(f(m),h):O.target.startsWith(`link:`)&&E.push([e[n],a,O.target])},k=()=>{for(;h.length>0;){let[t,n]=h.pop();for(let r of e)for(let e of Object.keys(b(t[r])))O(t,r,e,n)}};for(let e of i)e.pattern in t&&(g.add(e.pattern),x(t[e.pattern],d(C,e.name)));k(),y=new Set(m.keys());for(let t of e)for(let e of Object.keys(S[t]))O(S,t,e,C);for(let[e,{dir:t}]of r)x(n[t],d(w,e));k();for(let[e,t,n]of E)e[t]=n;return{plain:g,own:T}}function Ve(e,t,n,r,i){for(let{key:a,range:o,source:s,alias:c}of t){let t=n?.own.get(a);if(s!==`registry`||t===void 0&&n?.plain.has(a)===!1)continue;let l=c?.range??o,{version:u}=e[a];if(l===``||r.satisfies(u,l)||r.validRange(l)===null)continue;let d=i?`and no resolution gives it`:`which only a resolution may excuse, as the manifests would say`;throw t!==void 0&&(d=`which the root asks for before the resolution ${j(t.path)} applies, so yarn takes it as outdated`),new A(`${u} does not satisfy ${j(l)}, ${d}`,M(``,a))}}function He(e,t,n){let r=t?.workspaces.get(e.name);if(r===void 0)return;let i=t.rules.find(e=>e.target===`link:${r.dir}`);if(i===void 0)return;let a=`than the workspace ${j(r.dir)}, which the resolution ${j(i.path)} gives it`;if(e.version!==r.version)throw new A(`another version ${a}, ${r.version}`,M(n,`version`));return W(e,t.importers[r.dir],a,n),i}function Ue({packages:e,patterns:t,mixed:n},r,i){let a=new Map;for(let{pkg:e,registry:t,sources:i,other:o}of n){let n=M(``,e.patterns[0]);if(i.length===0){let i=He(e,r,n);if(i===void 0)throw new A(`${j(t)} asks for the registry, and resolves to nothing, ${r===void 0?`which only a resolution to a workspace may, as the manifests would say`:`as for a directory`}`,n);a.set(e,{sources:[i.target],rule:i});continue}if(r===void 0)throw new A(`${j(t)} asks for the registry, and is given what ${j(i[0])} names, which only a resolution may, as the manifests would say`,n);let s=i.find(e=>!r.rules.some(t=>t.pattern===e));if(s!==void 0)throw new A(`${j(t)} asks for the registry, and is given what ${j(s)} names, which no resolution does`,n);let c=r.rules.find(e=>i.includes(e.pattern));if(o!==void 0)throw new A(`asks for what the resolution ${j(c.path)} resolves to, as a dependency of its own`,M(``,o.patterns[0]));a.set(e,{sources:i,rule:c})}let o=r!==void 0&&r.rules.length>0?Be(e,r,a):void 0;i!==void 0&&Ve(e,t,o,i,r!==void 0);for(let[t,{sources:n}]of a)n[0].startsWith(`link:`)&&delete e[t.patterns[0]]}var We=[`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.`,`# yarn lockfile v1`],Ge=/^# yarn lockfile v(\d+)$/u,Ke=/[:\s\\",[\]]/u,qe=e=>e.startsWith(`true`)||e.startsWith(`false`)||Ke.test(e)||!/^[A-Za-z]/u.test(e),Je=/[A-Za-z][^\s:\\",[\]]*/uy;function Ye(e,t,n){let[r,i]=oe(e,t,n);if(r.includes(`\\"`))throw N(`${j(r)} is a string yarn reads to another quote`,n);let a=P.exec(r)?.[0];if(a!==void 0)throw N(`an escape for ${ne(a)}, which is not allowed`,n);if(!qe(r))throw N(`${j(r)} is quoted, where yarn writes it bare`,n);return[r,i]}function Xe(e,t,n){if(e[t]===`"`)return Ye(e,t,n);Je.lastIndex=t;let r=Je.exec(e)?.[0];if(r===void 0)throw N(`expected a string, found ${ie(e,t)}`,n);if(qe(r))throw N(`${j(r)} is bare, where yarn quotes it`,n);return[r,t+r.length]}function Z(e,t,n){let[r,i]=Xe(e,t,n);if(r===``)throw N(`an empty key, which yarn does not read`,n);return[r,i]}function Ze(e,t,n){let[r,i]=Xe(e,t,n);if(r.startsWith(`null`)&&e[t]!==`"`)throw N(`${j(r)} is bare, and read as null by some readers`,n);return Q(e,i,n),r}function Q(e,t,n){if(t!==e.length)throw N(`expected the end of the line, found ${j(e.slice(t))}`,n)}function Qe(e,t){if(e.line!==t)throw N(`expected yarn's header, ${j(t)}`,e.number);I(e)}function $e(e){Qe(e,We[0]);let t=Ge.exec(e.line??``)?.[1];if(t!==void 0&&t!==`1`)throw N(`unsupported version: expected "1", found ${j(t)}`,e.number);for(Qe(e,We[1]);e.line?.startsWith(`#`);I(e)){if(/^yarn lockfile v\d+$/u.test(e.line.slice(1).trim()))throw N(`a second lockfile version`,e.number);if(e.line===`#`)throw N(`a comment of "#" alone, which @yarnpkg/parsers does not read`,e.number)}}function $(e,t,n,r,i){let a=Object.create(null);for(let n=e.line;n?.startsWith(` `)&&F(n)>t-2;n=e.line){if(F(n)!==t)throw N(`expected ${t} spaces of indentation, found ${F(n)}`,e.number);let[r,o]=Z(n,t,e.number);i(a,r,o,n,e.number)}if(Object.keys(a).length===0)throw N(n,r);return a}var et=(e,t,n)=>$(e,4,`expected what ${j(t)} holds below it`,n,(n,r,i,a,o)=>{if(a[i]!==` `)throw N(`expected a space and a range after ${j(r)}`,o);let s=Ze(a,i+1,o);if(r in n)throw N(`${j(r)} is in ${j(t)} twice`,o);n[r]=s,I(e)}),tt=(e,t)=>$(e,2,`expected the fields of the entry below it`,t,(t,n,r,i,a)=>{if(n in t)throw N(`the field ${j(n)} twice`,a);if(i[r]===`:`)Q(i,r+1,a),I(e),t[n]=et(e,n,a);else{if(i[r]!==` `)throw N(`expected a space and a value, or ":", after ${j(n)}`,a);t[n]=Ze(i,r+1,a),I(e)}});function nt(e,t){let{line:n,number:r}=e,i=[];for(let e=0;;){let[a,o]=Z(n,e,r);if(t.has(a))throw N(`${j(a)} is a key ${t.get(a)===r?`twice`:`at line ${t.get(a)+1} too`}`,r);if(t.set(a,r),i.push(a),n[o]===`:`){Q(n,o+1,r);break}if(!n.startsWith(`, `,o))throw N(`expected ", " and a pattern, or ":", after ${j(a)}`,r);e=o+2}return I(e),{keys:i,fields:tt(e,r)}}function rt(e){re(e,`yarn`);let t=ae(e,P);I(t),$e(t);let n=[],r=new Map,i;for(let e=t.line;e!==void 0;e=t.line)if(e===``)n.length>0&&(i??=t.number),I(t);else{if(e.startsWith(` `))throw i===void 0?N(`expected an entry, at column 0`,t.number):N(`a blank line within an entry`,i);if(e.startsWith(`#`))throw N(`a comment, which yarn writes in the header alone`,t.number);i=void 0,n.push(nt(t,r))}return n}var it=[`manifests`,`checkVersions`,`semver`],at=[`clean`,`satisfies`,`valid`,`validRange`];function ot(e,t){let n=t===void 0?()=>({dev:void 0,optional:void 0,devOptional:void 0}):r(e,t);for(let t of new Set(Object.values(e)))Object.assign(t,n(t))}function st(e,t={}){if(typeof e!=`string`)throw TypeError(`expected a string`);let{manifests:n,semver:r}=T(t,it);E(t,at);let i=De(rt(e),r),{packages:a,requests:o}=i;n===void 0&&Y(o,a);let s=n===void 0?void 0:Re(n,a,o,r);return Ue(i,s,r),ot(a,s?.importers),{packages:a,importers:s?.importers}}export{A as LockfileError,st as parseYarn1Lockfile};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./chunk-WCDYSIKG.js";import{a as t}from"./chunk-QI66YA4F.js";import{H as n,I as r,J as i,K as a,M as o,Q as s,b as c,h as l,m as u,n as d,s as f,u as ee}from"./chunk-LVW7WWV4.js";import{a as p}from"./chunk-DEVAORP2.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{d as m,h,i as g,j as _,p as te,r as ne,s as re}from"./chunk-7HP2VYIC.js";import"./chunk-OOJM4CTU.js";var v=[`PODS`,`DEPENDENCIES`,`SPEC REPOS`,`EXTERNAL SOURCES`,`CHECKOUT OPTIONS`,`SPEC CHECKSUMS`,`PODFILE CHECKSUM`,`COCOAPODS`],ie=e=>({yesNo:e>=10,dates:e>=13}),ae=new Set([`null`,`Null`,`NULL`,`~`,``,`true`,`True`,`TRUE`,`false`,`False`,`FALSE`]),oe=new Set([`yes`,`Yes`,`YES`,`no`,`No`,`NO`,`on`,`On`,`ON`,`off`,`Off`,`OFF`]),se=[/^[-+]?\d+$/u,/^00[0-7]+$/u,/^0x[\dA-Fa-f]+$/u,/^[-+]?(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][-+]?\d+)?$/u,/^[-+]?\.(?:inf|Inf|INF)$/u,/^\.(?:nan|NaN|NAN)$/u],ce=/^(?:\d{4}-\d\d-\d\d|\d{4}-\d\d?-\d\d?(?:[Tt]|[ \t]+)\d\d?:\d\d:\d\d(?:.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d\d)?))?)$/u,y=/^\w[\w/ ()~<>=.:`,-]*$/u,le=/^:[a-z_][a-z0-9_]*$/u;function ue(e,t){return ae.has(e)||se.some(t=>t.test(e))?!0:t.yesNo&&oe.has(e)||t.dates&&ce.test(e)}var b=e=>JSON.stringify(e).replace(/#(?=[{$@])/gu,`\\#`);function de(e,t){return ue(e,t)?`'${e}'`:y.test(e)&&!e.endsWith(`:`)?e:b(e)}var fe=e=>e.replaceAll(`Σ`,`σ`).toLowerCase();function pe(e){if(e.kind===`seq`)return e.items.length===0?``:pe(e.items[0]);if(e.kind===`map`)return e.entries.map(({key:e})=>fe(String(e.value))).sort(t)[0]??``;if(e.type===`boolean`){if(e.value)throw _(`true, which YAMLHelper fails to sort`,e.line);return``}return fe(e.value)}function me(e,n=e=>e){return e.map(e=>[pe(n(e)),e]).sort((e,n)=>t(e[0],n[0])).map(([,e])=>e)}function x(e,t){return e.type===`symbol`?`:${e.value}`:e.type===`boolean`?String(e.value):de(e.value,t)}var S=e=>e.kind!==`scalar`,he=e=>e.kind===`seq`?e.items.length:e.entries.length,C=e=>e.replaceAll(`
1
+ import{c as e}from"./chunk-WCDYSIKG.js";import{a as t}from"./chunk-QI66YA4F.js";import{H as n,I as r,J as i,K as a,M as o,Q as s,b as c,h as l,m as u,n as d,s as f,u as ee}from"./chunk-LVW7WWV4.js";import{a as p}from"./chunk-DEVAORP2.js";import"./chunk-ZQHLECTI.js";import{d as m,h,i as g,j as _,p as te,r as ne,s as re}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";var v=[`PODS`,`DEPENDENCIES`,`SPEC REPOS`,`EXTERNAL SOURCES`,`CHECKOUT OPTIONS`,`SPEC CHECKSUMS`,`PODFILE CHECKSUM`,`COCOAPODS`],ie=e=>({yesNo:e>=10,dates:e>=13}),ae=new Set([`null`,`Null`,`NULL`,`~`,``,`true`,`True`,`TRUE`,`false`,`False`,`FALSE`]),oe=new Set([`yes`,`Yes`,`YES`,`no`,`No`,`NO`,`on`,`On`,`ON`,`off`,`Off`,`OFF`]),se=[/^[-+]?\d+$/u,/^00[0-7]+$/u,/^0x[\dA-Fa-f]+$/u,/^[-+]?(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][-+]?\d+)?$/u,/^[-+]?\.(?:inf|Inf|INF)$/u,/^\.(?:nan|NaN|NAN)$/u],ce=/^(?:\d{4}-\d\d-\d\d|\d{4}-\d\d?-\d\d?(?:[Tt]|[ \t]+)\d\d?:\d\d:\d\d(?:.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d\d)?))?)$/u,y=/^\w[\w/ ()~<>=.:`,-]*$/u,le=/^:[a-z_][a-z0-9_]*$/u;function ue(e,t){return ae.has(e)||se.some(t=>t.test(e))?!0:t.yesNo&&oe.has(e)||t.dates&&ce.test(e)}var b=e=>JSON.stringify(e).replace(/#(?=[{$@])/gu,`\\#`);function de(e,t){return ue(e,t)?`'${e}'`:y.test(e)&&!e.endsWith(`:`)?e:b(e)}var fe=e=>e.replaceAll(`Σ`,`σ`).toLowerCase();function pe(e){if(e.kind===`seq`)return e.items.length===0?``:pe(e.items[0]);if(e.kind===`map`)return e.entries.map(({key:e})=>fe(String(e.value))).sort(t)[0]??``;if(e.type===`boolean`){if(e.value)throw _(`true, which YAMLHelper fails to sort`,e.line);return``}return fe(e.value)}function me(e,n=e=>e){return e.map(e=>[pe(n(e)),e]).sort((e,n)=>t(e[0],n[0])).map(([,e])=>e)}function x(e,t){return e.type===`symbol`?`:${e.value}`:e.type===`boolean`?String(e.value):de(e.value,t)}var S=e=>e.kind!==`scalar`,he=e=>e.kind===`seq`?e.items.length:e.entries.length,C=e=>e.replaceAll(`
2
2
  `,`
3
3
  `);function ge(e,t){return e.kind===`seq`?_e(e.items,t):e.kind===`map`?ve(e.entries,t):x(e,t)}function _e(e,t){return e.length===0?`[]`:`- ${me(e).map(e=>{let n=ge(e,t);return S(e)&&he(e)>1?C(n):n}).join(`
4
4
  - `)}`}function ve(e,t,n,r=`
@@ -1,4 +1,4 @@
1
- import{B as e,C as t,E as n,G as r,H as i,K as a,M as o,P as s,e as c,f as l,h as u,m as d,p as f,u as p}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{d as m,h,i as g,j as _,o as v,r as y,s as b,t as x}from"./chunk-7HP2VYIC.js";import"./chunk-OOJM4CTU.js";var S=new Set([` `,` `,`
1
+ import{B as e,C as t,E as n,G as r,H as i,K as a,M as o,P as s,e as c,f as l,h as u,m as d,p as f,u as p}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import{d as m,h,i as g,j as _,o as v,r as y,s as b,t as x}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";var S=new Set([` `,` `,`
2
2
  `,`\r`]),C=e=>/^[A-Za-z]$/u.test(e),w=e=>/^[\dA-Za-z-]$/u.test(e),T={__proto__:null,t:` `,b:`\b`,n:`
3
3
  `,"\\":`\\`,'"':`"`};function E(e,t){let n=0,r=0,i={at:0,eof:!1};return i.next=()=>{if(i.at=r,n>=e.length)return i.eof=!0,`
4
4
  `;let t=e[n++];return t===`\r`&&e[n]===`
@@ -1 +1 @@
1
- import{a as e,b as t,d as n,e as r,h as i,i as a,j as o,k as s,m as c,o as l,q as u,r as d,s as ee}from"./chunk-CU3FPB3P.js";import{a as f,c as p,e as m,f as h,h as te,j as g,k as _,l as v,m as ne,n as re,o as ie,p as ae}from"./chunk-GX5UXWT4.js";import{D as oe,H as y,M as se,l as ce,m as b,p as le,t as x}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{a as ue,c as de,e as fe,g as pe}from"./chunk-VYYUMYVW.js";import{d as S,e as me,h as C,i as w}from"./chunk-7HP2VYIC.js";import"./chunk-OOJM4CTU.js";function T(e,t,n=[`https:`,`http:`,`file:`]){let r=URL.parse(h(e,t));if(r===null||r.href!==e||!n.includes(r.protocol))throw new S(`${C(e)} is not a URL in normal form, of ${n.map(e=>e.slice(0,-1)).join(`, `)}`,t);if(r.username!==``||r.password!==``)throw new S(`${C(e)} has credentials in it, which uv does not write`,t);return r}var E=g(e=>/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,9})?Z$/u.test(e)&&de(e),`a UTC timestamp`),D=v(i),O=(e,t,n)=>re(e,t,i,n),he={__proto__:null,md5:32,sha256:64,sha384:96,sha512:128,blake2b:64};function k(e){return e.type===`url`?new URL(e.url).pathname:e.type===`path`||e.type===`git`?e.path:void 0}var A=e=>e===void 0?void 0:e.endsWith(`.whl`)?`wheel`:`sdist`;function ge(e,t){return e.type===`registry`?e.url===void 0?[`url`,`path`]:[`url`]:t?e.type===`url`?[`url`]:[`filename`]:[]}function j(e,t,n,r){let i=ge(n,r),a=n.type===`registry`;p(e,t,[...i,`hash`,...a?[`size`,`upload-time`,`upload_time`]:[]]);let o=i.filter(t=>e[t]!==void 0);if(i.length>0&&o.length!==1)throw new S(o.length===0?`expected ${i.join(` or `)}`:`a url and a path, of which uv reads the url alone`,t);if(e[`upload-time`]!==void 0&&e.upload_time!==void 0)throw new S(`upload-time and upload_time, which are one field to uv`,t);let s=b(e,`url`,t,T),c={url:s?.href,path:b(e,`path`,t,u),filename:b(e,`filename`,t,h),hash:b(e,`hash`,t,(e,t)=>l(e,t,he)),size:b(e,`size`,t,te),uploadTime:b(e,e.upload_time===void 0?`upload-time`:`upload_time`,t,E)};if(!a&&c.hash===void 0)throw new S(`expected a hash, which uv writes for a file of a ${n.type} source`,t);return{file:c,pathname:s?.pathname}}function _e(e,t,n){if(e===void 0)return;let r=A(k(n));if(n.type!==`registry`&&r!==`sdist`)throw new S(`an sdist, which a ${n.type} source${r===`wheel`?` of a wheel`:``} has none of`,t);let{url:i,path:a,hash:o,size:s,uploadTime:c}=j(e,t,n,!1).file;return{url:i,path:a,hash:o,size:s,uploadTime:c}}function ve(t,n,r){if(t===void 0)return[];let{source:i}=r,a=A(k(i)),o=m(t,n);if(i.type!==`registry`&&(a!==`wheel`||o.length!==1))throw new S(a===`wheel`?`expected the one wheel the source is`:`wheels, which a ${i.type} source${a===`sdist`?` of an sdist`:``} has none of`,n);let c=new Set;return o.map((t,a)=>{let o=`${n}[${a}]`,{file:l,pathname:u}=j(t,o,i,!0),d=ee({name:l.filename,path:l.path,pathname:u}),f=d===void 0?void 0:s(d);if(f===void 0)throw new S(`${C(String(d))} is not the name of a wheel`,o);if(c.has(d))throw new S(`${C(d)} is listed twice`,o);if(c.add(d),f.name!==r.name)throw new S(`${C(d)} is a wheel of ${C(f.name)}, not of ${C(r.name)}`,o);if(r.versionKey!==void 0&&r.versionKey!==e(f.version)&&r.versionKey!==e({...f.version,local:void 0}))throw new S(`${C(d)} is a wheel of another version than ${C(r.version)}`,o);if(i.type===`url`&&l.url!==i.url)throw new S(`${C(l.url)} is not the URL the source names`,w(o,`url`));return{...l,filename:d}})}var M=[`registry`,`git`,`url`,`path`,`directory`,`editable`,`virtual`],ye=new Set([`directory`,`editable`,`virtual`]),N=new Set([`branch`,`tag`,`rev`]),be=new Set([...N,`subdirectory`,`path`,`lfs`]),P=(e,t,n)=>new S(`${C(e)} is not a git source: ${t}`,n),F=`expected "#" and the full commit it resolved to`;function I(e,t){let n=T(se(e,t),t,[`https:`,`http:`,`ssh:`,`file:`]),r=[...n.searchParams],i=r.find(([e])=>!be.has(e));if(i!==void 0)throw P(e,`uv does not read ${C(i[0])}`,t);if(new Set(r.map(([e])=>e)).size!==r.length)throw P(e,`a key twice in the query`,t);let a=r.filter(([e])=>N.has(e));if(a.length>1)throw P(e,`more than one of branch=, tag= and rev=`,t);let o=Object.fromEntries(r);if(o.lfs!==void 0&&o.lfs!==`true`)throw P(e,`lfs= other than true, which uv does not write`,t);for(let e of[`subdirectory`,`path`])o[e]!==void 0&&oe(o[e],t);let s=n.hash===``?void 0:n.hash.slice(1);if(s!==void 0&&!y(s))throw P(e,F,t);let c=o.rev?.toLowerCase();if(c!==void 0&&s!==void 0&&y(c)&&c!==s)throw P(e,`rev= names another commit than the one it resolved to`,t);return n.search=``,n.hash=``,{type:`git`,url:e,repository:n.href,reference:a.length===0?void 0:{kind:a[0][0],name:a[0][1]},commit:s,subdirectory:o.subdirectory,path:o.path,lfs:o.lfs===`true`}}function xe(e,t){return/^[A-Za-z][\dA-Za-z+.-]+:/u.test(h(e,t))?{type:`registry`,url:T(e,t).href,path:void 0}:{type:`registry`,url:void 0,path:u(e,t)}}function Se(e,t,n,r){let i=w(r,e);if(e===`registry`)return xe(t,i);if(e===`git`){let e=I(t,i);if(e.commit===void 0)throw P(t,F,i);return e}if(e===`url`){if(T(t,i,[`https:`,`http:`]).hash!==``)throw new S(`${C(t)} has a fragment, which uv drops`,i);return{type:e,url:t,subdirectory:ce(d)(n,w(r,`subdirectory`))}}return{type:e,path:u(t,i)}}function L(e,t){p(e,t,[...M,`subdirectory`]);let n=ie(e,M,t);if(e.subdirectory!==void 0&&n!==`url`)throw new S(`a subdirectory, which uv reads of a URL alone`,w(t,`subdirectory`));let r=Se(n,e[n],e.subdirectory,t);return{...r,id:Ce(r)}}function Ce(e){return e.type===`registry`?`registry+${e.url??e.path}`:e.type===`git`?`git+${e.url}`:e.type===`url`?`direct+${e.url}${e.subdirectory===void 0?``:`#subdirectory=${e.subdirectory}`}`:`${e.type}+${e.path}`}var R=e=>ye.has(e.type);function z(e,t){if(p(e,t,[`package`,`extra`,`group`]),e.extra!==void 0&&e.group!==void 0)throw new S(`an extra and a group, of which uv takes one`,t);return{package:i(e.package,w(t,`package`)),extra:b(e,`extra`,t,i),group:b(e,`group`,t,i)}}var B=[`git`,`url`,`path`,`directory`,`editable`,`virtual`],V=[`specifier`,`index`,`conflict`],H=[`name`,`extras`,`groups`,`marker`,`subdirectory`,...B,...V];function we(e,t){let n=B.filter(t=>e[t]!==void 0),i=V.filter(t=>e[t]!==void 0);if(n.length+ +(i.length>0)>1)throw new S(`more than one source: ${[...n,...i].join(`, `)}`,t);if(e.subdirectory!==void 0&&n[0]!==`url`)throw new S(`a subdirectory, which uv reads of a URL alone`,w(t,`subdirectory`));let[a=`registry`]=n,o=w(t,a);return a===`registry`?{type:a,specifier:b(e,`specifier`,t,r),index:b(e,`index`,t,T)?.href,conflict:b(e,`conflict`,t,z)}:a===`git`?I(e.git,o):a===`url`?{type:a,url:T(e.url,o,[`https:`,`http:`]).href,subdirectory:b(e,`subdirectory`,t,d)}:{type:a,path:u(e[a],o)}}function U(e,t,n=H){p(e,t,n);let r=b(e,`extras`,t,D)??[],o=b(e,`groups`,t,D)??[];if(r.length>0&&o.length>0)throw new S(`extras and groups, of which uv takes one`,t);return{name:i(e.name,w(t,`name`)),extras:r,groups:o,marker:b(e,`marker`,t,a),source:we(e,t)}}function Te(e,t){return{...U(e,t,[...H,`hashes`]),hashes:b(e,`hashes`,t,v((e,t)=>l(e,t,c)))??[]}}var W=_(U),G=(e,t)=>O(e,t,W);function Ee(e,t){return p(e,t,[`name`,`version`,`requires-dist`,`requires-python`,`provides-extras`]),{name:i(e.name,w(t,`name`)),version:b(e,`version`,t,n),requiresDist:b(e,`requires-dist`,t,v(o))??[],requiresPython:b(e,`requires-python`,t,r),providesExtras:b(e,`provides-extras`,t,D)??[]}}var De=_((e,t)=>{if(fe(e)&&Object.hasOwn(e,`package`))throw new S(`an override of one package's dependencies, which is not read here`,t);return U(e,t)}),Oe=[`members`,`requirements`,`constraints`,`overrides`,`excludes`,`build-constraints`,`dependency-groups`,`dependency-metadata`];function ke(e=Object.create(null)){let t=`manifest`;p(e,t,Oe);let n=(n,r)=>b(e,n,t,r)??[];return{members:n(`members`,D),requirements:n(`requirements`,W),constraints:n(`constraints`,W),overrides:n(`overrides`,De),excludes:n(`excludes`,D),buildConstraints:n(`build-constraints`,_(Te)),dependencyGroups:G(e[`dependency-groups`],w(t,`dependency-groups`)),dependencyMetadata:n(`dependency-metadata`,_(Ee))}}function Ae(e=Object.create(null),t){return p(e,t,[`requires-dist`,`provides-extras`,`requires-dev`]),{requiresDist:b(e,`requires-dist`,t,W)??[],providesExtras:b(e,`provides-extras`,t,D)??[],requiresDev:G(e[`requires-dev`],w(t,`requires-dev`))}}var K=(...e)=>(t,n)=>{if(!e.includes(h(t,n)))throw new S(`expected one of ${e.join(`, `)}`,n);return t},q=K(`disallow`,`allow`,`if-necessary`,`explicit`,`if-necessary-or-explicit`),J=g(e=>/^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+W)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d{1,9})?S)?)?$/u.test(e),`an ISO 8601 duration`);function je(e,t){return e===!1?!1:typeof e==`string`?{timestamp:E(e,t),span:void 0}:(p(e,t,[`timestamp`,`span`]),{timestamp:E(e.timestamp,w(t,`timestamp`)),span:J(e.span,w(t,`span`))})}function Me(e,t){p(e,t,[`glibc`,`musl`]);let n=g(e=>/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/u.test(e),`a libc version`);return{glibc:b(e,`glibc`,t,n),musl:b(e,`musl`,t,n)}}var Ne=[`resolution-mode`,`prerelease-mode`,`fork-strategy`,`exclude-newer`,`exclude-newer-span`,`exclude-newer-package`,`prerelease-package`,`minimum-libc-version`];function Pe(e=Object.create(null)){let t=`options`;p(e,t,Ne);let n=b(e,`exclude-newer`,t,E);return{resolutionMode:b(e,`resolution-mode`,t,K(`highest`,`lowest`,`lowest-direct`))??`highest`,prereleaseMode:b(e,`prerelease-mode`,t,q)??`if-necessary-or-explicit`,forkStrategy:b(e,`fork-strategy`,t,K(`fewest`,`requires-python`))??`requires-python`,excludeNewer:e[`exclude-newer-span`]===void 0?n:void 0,excludeNewerSpan:b(e,`exclude-newer-span`,t,J),excludeNewerPackage:O(e[`exclude-newer-package`],w(t,`exclude-newer-package`),je),prereleasePackage:O(e[`prerelease-package`],w(t,`prerelease-package`),q),minimumLibcVersion:b(e,`minimum-libc-version`,t,Me)}}var Fe=_((e,t)=>{let n=_(z)(e,t);if(n.length<2)throw new S(`a set of conflicts of fewer than two, which uv refuses`,t);return n}),Ie=[`version`,`revision`,`requires-python`,`resolution-markers`,`supported-markers`,`required-markers`,`conflicts`,`options`,`manifest`,`package`],Le={distribution:"`distribution` is what uv 0.2 and older wrote for `package`, which is not read here"},Re=[`name`,`version`,`source`,`resolution-markers`,`dependencies`,`sdist`,`wheels`,`optional-dependencies`,`dev-dependencies`,`metadata`],ze={"dependency-groups":"`dependency-groups` is an older spelling of `dev-dependencies`, which uv no longer writes"},Be=[`name`,`version`,`source`,`extra`,`marker`];function Ve(e,t){if(e===void 0)return 0;if(e===1||e===2||e===3)return e;throw new S(`unsupported revision: expected 1, 2 or 3, found ${f(e)}`,t)}function He(e,t){if(e===1)return e;throw e===void 0?new S("no `version`: a lockfile of uv 0.2 or older, which is not read here",t):new S(`unsupported version: expected 1, found ${f(e)}`,t)}var Y=(e,t)=>e===void 0?[]:ne(e,t,a),X=(e,t,n)=>`${e}${t===void 0?``:`==${t}`} @ ${n}`;function Ue(e,t){p(e,t,Be);let r=b(e,`extra`,t,D)??[],o=x(r);if(o!==void 0)throw new S(`${C(o)} is listed twice`,w(t,`extra`));return{name:i(e.name,w(t,`name`)),version:b(e,`version`,t,n),source:b(e,`source`,t,L),extras:r,marker:b(e,`marker`,t,a),where:t}}var Z=(e,t)=>e===void 0?[]:m(e,t).map((e,n)=>Ue(e,`${t}[${n}]`));function We(e,r){p(e,r,Re,ze);let a=i(e.name,w(r,`name`)),o=L(e.source,w(r,`source`)),s=b(e,`version`,r,n);if(s===void 0&&!R(o))throw new S(`expected a version, which uv writes of any but a source tree's package`,r);let c={key:X(a,s,o.id),name:a,version:s,versionKey:s===void 0?void 0:t(s),source:o};return{...c,resolutionMarkers:Y(e[`resolution-markers`],w(r,`resolution-markers`)),sdist:_e(e.sdist,w(r,`sdist`),o),wheels:ve(e.wheels,w(r,`wheels`),c),edges:Z(e.dependencies,w(r,`dependencies`)),extraEdges:O(e[`optional-dependencies`],w(r,`optional-dependencies`),Z),groupEdges:O(e[`dev-dependencies`],w(r,`dev-dependencies`),Z),metadata:Ae(e.metadata,w(r,`metadata`))}}var Q=(e,t,n)=>`${e} ${t} ${n}`;function Ge(e,n){let r=t=>me(t,e.where),i=n.byName.get(e.name)??r(`${C(e.name)} names no package in the lockfile`),a=i.length===1?i[0]:void 0,o=e.source?.id??a?.source.id??r(`${C(e.name)} could be any of ${i.length} packages, and names no source`);e.version===void 0&&a===void 0&&!R(e.source)&&r(`${C(e.name)} could be any of ${i.length} versions, and names none`);let s=e.version===void 0?a?.versionKey:t(e.version),c=n.byId.get(Q(e.name,s,o))??r(`names a package the lockfile does not hold: ${C(X(e.name,e.version,o))}`);e.version!==void 0&&e.version!==c.version&&r(`${C(e.version)}, where the package is ${C(c.version)}`);for(let t of e.extras)t in c.extraEdges||r(`${C(t)}, an extra ${C(c.key)} has no dependencies for, which uv drops`);return{package:c.key,extras:e.extras,marker:e.marker}}function Ke(e,t,n){let r=e.map(e=>Ge(e,t)),i=x(r,e=>JSON.stringify([e.package,[...e.extras].sort(),e.marker]));if(i!==void 0)throw new S(`${C(i.package)} is listed twice alike`,n);return r}var $=(e,t,n)=>le(e,n,(e,n)=>Ke(e,t,n));function qe(e,t,n){return e.members.length===0?t.filter(e=>R(e.source)&&e.source.path===`.`).map(e=>e.key):e.members.map((e,t)=>{let r=(n.byName.get(e)??[]).filter(e=>R(e.source));if(r.length!==1)throw new S(`${C(e)} is ${r.length===0?`no package`:`more than one package`} of a directory in the lockfile`,`manifest.members[${t}]`);return r[0].key})}function Je(e){let t=p(pe(e),void 0,Ie,Le),n=He(t.version,`version`),i=Ve(t.revision,`revision`),a=r(t[`requires-python`],`requires-python`),o=m(t.package??[],`package`).map((e,t)=>We(e,`package[${t}]`)),s=ae(o,e=>Q(e.name,e.versionKey,e.source.id),e=>e.key),c={byName:Map.groupBy(o,e=>e.name),byId:new Map([...s].map(([e,t])=>[e,o[t]]))},l=Object.create(null);for(let[e,t]of o.entries()){let n=`package[${e}]`;l[t.key]={name:t.name,version:t.version,source:t.source,resolutionMarkers:t.resolutionMarkers,dependencies:Ke(t.edges,c,w(n,`dependencies`)),optionalDependencies:$(t.extraEdges,c,w(n,`optional-dependencies`)),devDependencies:$(t.groupEdges,c,w(n,`dev-dependencies`)),sdist:t.sdist,wheels:t.wheels,metadata:t.metadata}}let u=ke(t.manifest);return{version:n,revision:i,requiresPython:a,resolutionMarkers:Y(t[`resolution-markers`],`resolution-markers`),supportedMarkers:Y(t[`supported-markers`],`supported-markers`),requiredMarkers:Y(t[`required-markers`],`required-markers`),conflicts:b(t,`conflicts`,``,Fe)??[],options:Pe(t.options),manifest:u,members:qe(u,o,c),packages:l}}export{S as LockfileError,ue as TomlError,Je as parseUvLock};
1
+ import{a as e,b as t,d as n,e as r,h as i,i as a,j as o,k as s,m as c,o as l,q as u,r as d,s as ee}from"./chunk-CU3FPB3P.js";import{a as f,c as p,e as m,f as h,h as te,j as g,k as _,l as v,m as ne,n as re,o as ie,p as ae}from"./chunk-GX5UXWT4.js";import{D as oe,H as y,M as se,l as ce,m as b,p as le,t as x}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import{a as ue,c as de,e as fe,g as pe}from"./chunk-VYYUMYVW.js";import{d as S,e as me,h as C,i as w}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";function T(e,t,n=[`https:`,`http:`,`file:`]){let r=URL.parse(h(e,t));if(r===null||r.href!==e||!n.includes(r.protocol))throw new S(`${C(e)} is not a URL in normal form, of ${n.map(e=>e.slice(0,-1)).join(`, `)}`,t);if(r.username!==``||r.password!==``)throw new S(`${C(e)} has credentials in it, which uv does not write`,t);return r}var E=g(e=>/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,9})?Z$/u.test(e)&&de(e),`a UTC timestamp`),D=v(i),O=(e,t,n)=>re(e,t,i,n),he={__proto__:null,md5:32,sha256:64,sha384:96,sha512:128,blake2b:64};function k(e){return e.type===`url`?new URL(e.url).pathname:e.type===`path`||e.type===`git`?e.path:void 0}var A=e=>e===void 0?void 0:e.endsWith(`.whl`)?`wheel`:`sdist`;function ge(e,t){return e.type===`registry`?e.url===void 0?[`url`,`path`]:[`url`]:t?e.type===`url`?[`url`]:[`filename`]:[]}function j(e,t,n,r){let i=ge(n,r),a=n.type===`registry`;p(e,t,[...i,`hash`,...a?[`size`,`upload-time`,`upload_time`]:[]]);let o=i.filter(t=>e[t]!==void 0);if(i.length>0&&o.length!==1)throw new S(o.length===0?`expected ${i.join(` or `)}`:`a url and a path, of which uv reads the url alone`,t);if(e[`upload-time`]!==void 0&&e.upload_time!==void 0)throw new S(`upload-time and upload_time, which are one field to uv`,t);let s=b(e,`url`,t,T),c={url:s?.href,path:b(e,`path`,t,u),filename:b(e,`filename`,t,h),hash:b(e,`hash`,t,(e,t)=>l(e,t,he)),size:b(e,`size`,t,te),uploadTime:b(e,e.upload_time===void 0?`upload-time`:`upload_time`,t,E)};if(!a&&c.hash===void 0)throw new S(`expected a hash, which uv writes for a file of a ${n.type} source`,t);return{file:c,pathname:s?.pathname}}function _e(e,t,n){if(e===void 0)return;let r=A(k(n));if(n.type!==`registry`&&r!==`sdist`)throw new S(`an sdist, which a ${n.type} source${r===`wheel`?` of a wheel`:``} has none of`,t);let{url:i,path:a,hash:o,size:s,uploadTime:c}=j(e,t,n,!1).file;return{url:i,path:a,hash:o,size:s,uploadTime:c}}function ve(t,n,r){if(t===void 0)return[];let{source:i}=r,a=A(k(i)),o=m(t,n);if(i.type!==`registry`&&(a!==`wheel`||o.length!==1))throw new S(a===`wheel`?`expected the one wheel the source is`:`wheels, which a ${i.type} source${a===`sdist`?` of an sdist`:``} has none of`,n);let c=new Set;return o.map((t,a)=>{let o=`${n}[${a}]`,{file:l,pathname:u}=j(t,o,i,!0),d=ee({name:l.filename,path:l.path,pathname:u}),f=d===void 0?void 0:s(d);if(f===void 0)throw new S(`${C(String(d))} is not the name of a wheel`,o);if(c.has(d))throw new S(`${C(d)} is listed twice`,o);if(c.add(d),f.name!==r.name)throw new S(`${C(d)} is a wheel of ${C(f.name)}, not of ${C(r.name)}`,o);if(r.versionKey!==void 0&&r.versionKey!==e(f.version)&&r.versionKey!==e({...f.version,local:void 0}))throw new S(`${C(d)} is a wheel of another version than ${C(r.version)}`,o);if(i.type===`url`&&l.url!==i.url)throw new S(`${C(l.url)} is not the URL the source names`,w(o,`url`));return{...l,filename:d}})}var M=[`registry`,`git`,`url`,`path`,`directory`,`editable`,`virtual`],ye=new Set([`directory`,`editable`,`virtual`]),N=new Set([`branch`,`tag`,`rev`]),be=new Set([...N,`subdirectory`,`path`,`lfs`]),P=(e,t,n)=>new S(`${C(e)} is not a git source: ${t}`,n),F=`expected "#" and the full commit it resolved to`;function I(e,t){let n=T(se(e,t),t,[`https:`,`http:`,`ssh:`,`file:`]),r=[...n.searchParams],i=r.find(([e])=>!be.has(e));if(i!==void 0)throw P(e,`uv does not read ${C(i[0])}`,t);if(new Set(r.map(([e])=>e)).size!==r.length)throw P(e,`a key twice in the query`,t);let a=r.filter(([e])=>N.has(e));if(a.length>1)throw P(e,`more than one of branch=, tag= and rev=`,t);let o=Object.fromEntries(r);if(o.lfs!==void 0&&o.lfs!==`true`)throw P(e,`lfs= other than true, which uv does not write`,t);for(let e of[`subdirectory`,`path`])o[e]!==void 0&&oe(o[e],t);let s=n.hash===``?void 0:n.hash.slice(1);if(s!==void 0&&!y(s))throw P(e,F,t);let c=o.rev?.toLowerCase();if(c!==void 0&&s!==void 0&&y(c)&&c!==s)throw P(e,`rev= names another commit than the one it resolved to`,t);return n.search=``,n.hash=``,{type:`git`,url:e,repository:n.href,reference:a.length===0?void 0:{kind:a[0][0],name:a[0][1]},commit:s,subdirectory:o.subdirectory,path:o.path,lfs:o.lfs===`true`}}function xe(e,t){return/^[A-Za-z][\dA-Za-z+.-]+:/u.test(h(e,t))?{type:`registry`,url:T(e,t).href,path:void 0}:{type:`registry`,url:void 0,path:u(e,t)}}function Se(e,t,n,r){let i=w(r,e);if(e===`registry`)return xe(t,i);if(e===`git`){let e=I(t,i);if(e.commit===void 0)throw P(t,F,i);return e}if(e===`url`){if(T(t,i,[`https:`,`http:`]).hash!==``)throw new S(`${C(t)} has a fragment, which uv drops`,i);return{type:e,url:t,subdirectory:ce(d)(n,w(r,`subdirectory`))}}return{type:e,path:u(t,i)}}function L(e,t){p(e,t,[...M,`subdirectory`]);let n=ie(e,M,t);if(e.subdirectory!==void 0&&n!==`url`)throw new S(`a subdirectory, which uv reads of a URL alone`,w(t,`subdirectory`));let r=Se(n,e[n],e.subdirectory,t);return{...r,id:Ce(r)}}function Ce(e){return e.type===`registry`?`registry+${e.url??e.path}`:e.type===`git`?`git+${e.url}`:e.type===`url`?`direct+${e.url}${e.subdirectory===void 0?``:`#subdirectory=${e.subdirectory}`}`:`${e.type}+${e.path}`}var R=e=>ye.has(e.type);function z(e,t){if(p(e,t,[`package`,`extra`,`group`]),e.extra!==void 0&&e.group!==void 0)throw new S(`an extra and a group, of which uv takes one`,t);return{package:i(e.package,w(t,`package`)),extra:b(e,`extra`,t,i),group:b(e,`group`,t,i)}}var B=[`git`,`url`,`path`,`directory`,`editable`,`virtual`],V=[`specifier`,`index`,`conflict`],H=[`name`,`extras`,`groups`,`marker`,`subdirectory`,...B,...V];function we(e,t){let n=B.filter(t=>e[t]!==void 0),i=V.filter(t=>e[t]!==void 0);if(n.length+ +(i.length>0)>1)throw new S(`more than one source: ${[...n,...i].join(`, `)}`,t);if(e.subdirectory!==void 0&&n[0]!==`url`)throw new S(`a subdirectory, which uv reads of a URL alone`,w(t,`subdirectory`));let[a=`registry`]=n,o=w(t,a);return a===`registry`?{type:a,specifier:b(e,`specifier`,t,r),index:b(e,`index`,t,T)?.href,conflict:b(e,`conflict`,t,z)}:a===`git`?I(e.git,o):a===`url`?{type:a,url:T(e.url,o,[`https:`,`http:`]).href,subdirectory:b(e,`subdirectory`,t,d)}:{type:a,path:u(e[a],o)}}function U(e,t,n=H){p(e,t,n);let r=b(e,`extras`,t,D)??[],o=b(e,`groups`,t,D)??[];if(r.length>0&&o.length>0)throw new S(`extras and groups, of which uv takes one`,t);return{name:i(e.name,w(t,`name`)),extras:r,groups:o,marker:b(e,`marker`,t,a),source:we(e,t)}}function Te(e,t){return{...U(e,t,[...H,`hashes`]),hashes:b(e,`hashes`,t,v((e,t)=>l(e,t,c)))??[]}}var W=_(U),G=(e,t)=>O(e,t,W);function Ee(e,t){return p(e,t,[`name`,`version`,`requires-dist`,`requires-python`,`provides-extras`]),{name:i(e.name,w(t,`name`)),version:b(e,`version`,t,n),requiresDist:b(e,`requires-dist`,t,v(o))??[],requiresPython:b(e,`requires-python`,t,r),providesExtras:b(e,`provides-extras`,t,D)??[]}}var De=_((e,t)=>{if(fe(e)&&Object.hasOwn(e,`package`))throw new S(`an override of one package's dependencies, which is not read here`,t);return U(e,t)}),Oe=[`members`,`requirements`,`constraints`,`overrides`,`excludes`,`build-constraints`,`dependency-groups`,`dependency-metadata`];function ke(e=Object.create(null)){let t=`manifest`;p(e,t,Oe);let n=(n,r)=>b(e,n,t,r)??[];return{members:n(`members`,D),requirements:n(`requirements`,W),constraints:n(`constraints`,W),overrides:n(`overrides`,De),excludes:n(`excludes`,D),buildConstraints:n(`build-constraints`,_(Te)),dependencyGroups:G(e[`dependency-groups`],w(t,`dependency-groups`)),dependencyMetadata:n(`dependency-metadata`,_(Ee))}}function Ae(e=Object.create(null),t){return p(e,t,[`requires-dist`,`provides-extras`,`requires-dev`]),{requiresDist:b(e,`requires-dist`,t,W)??[],providesExtras:b(e,`provides-extras`,t,D)??[],requiresDev:G(e[`requires-dev`],w(t,`requires-dev`))}}var K=(...e)=>(t,n)=>{if(!e.includes(h(t,n)))throw new S(`expected one of ${e.join(`, `)}`,n);return t},q=K(`disallow`,`allow`,`if-necessary`,`explicit`,`if-necessary-or-explicit`),J=g(e=>/^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+W)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d{1,9})?S)?)?$/u.test(e),`an ISO 8601 duration`);function je(e,t){return e===!1?!1:typeof e==`string`?{timestamp:E(e,t),span:void 0}:(p(e,t,[`timestamp`,`span`]),{timestamp:E(e.timestamp,w(t,`timestamp`)),span:J(e.span,w(t,`span`))})}function Me(e,t){p(e,t,[`glibc`,`musl`]);let n=g(e=>/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/u.test(e),`a libc version`);return{glibc:b(e,`glibc`,t,n),musl:b(e,`musl`,t,n)}}var Ne=[`resolution-mode`,`prerelease-mode`,`fork-strategy`,`exclude-newer`,`exclude-newer-span`,`exclude-newer-package`,`prerelease-package`,`minimum-libc-version`];function Pe(e=Object.create(null)){let t=`options`;p(e,t,Ne);let n=b(e,`exclude-newer`,t,E);return{resolutionMode:b(e,`resolution-mode`,t,K(`highest`,`lowest`,`lowest-direct`))??`highest`,prereleaseMode:b(e,`prerelease-mode`,t,q)??`if-necessary-or-explicit`,forkStrategy:b(e,`fork-strategy`,t,K(`fewest`,`requires-python`))??`requires-python`,excludeNewer:e[`exclude-newer-span`]===void 0?n:void 0,excludeNewerSpan:b(e,`exclude-newer-span`,t,J),excludeNewerPackage:O(e[`exclude-newer-package`],w(t,`exclude-newer-package`),je),prereleasePackage:O(e[`prerelease-package`],w(t,`prerelease-package`),q),minimumLibcVersion:b(e,`minimum-libc-version`,t,Me)}}var Fe=_((e,t)=>{let n=_(z)(e,t);if(n.length<2)throw new S(`a set of conflicts of fewer than two, which uv refuses`,t);return n}),Ie=[`version`,`revision`,`requires-python`,`resolution-markers`,`supported-markers`,`required-markers`,`conflicts`,`options`,`manifest`,`package`],Le={distribution:"`distribution` is what uv 0.2 and older wrote for `package`, which is not read here"},Re=[`name`,`version`,`source`,`resolution-markers`,`dependencies`,`sdist`,`wheels`,`optional-dependencies`,`dev-dependencies`,`metadata`],ze={"dependency-groups":"`dependency-groups` is an older spelling of `dev-dependencies`, which uv no longer writes"},Be=[`name`,`version`,`source`,`extra`,`marker`];function Ve(e,t){if(e===void 0)return 0;if(e===1||e===2||e===3)return e;throw new S(`unsupported revision: expected 1, 2 or 3, found ${f(e)}`,t)}function He(e,t){if(e===1)return e;throw e===void 0?new S("no `version`: a lockfile of uv 0.2 or older, which is not read here",t):new S(`unsupported version: expected 1, found ${f(e)}`,t)}var Y=(e,t)=>e===void 0?[]:ne(e,t,a),X=(e,t,n)=>`${e}${t===void 0?``:`==${t}`} @ ${n}`;function Ue(e,t){p(e,t,Be);let r=b(e,`extra`,t,D)??[],o=x(r);if(o!==void 0)throw new S(`${C(o)} is listed twice`,w(t,`extra`));return{name:i(e.name,w(t,`name`)),version:b(e,`version`,t,n),source:b(e,`source`,t,L),extras:r,marker:b(e,`marker`,t,a),where:t}}var Z=(e,t)=>e===void 0?[]:m(e,t).map((e,n)=>Ue(e,`${t}[${n}]`));function We(e,r){p(e,r,Re,ze);let a=i(e.name,w(r,`name`)),o=L(e.source,w(r,`source`)),s=b(e,`version`,r,n);if(s===void 0&&!R(o))throw new S(`expected a version, which uv writes of any but a source tree's package`,r);let c={key:X(a,s,o.id),name:a,version:s,versionKey:s===void 0?void 0:t(s),source:o};return{...c,resolutionMarkers:Y(e[`resolution-markers`],w(r,`resolution-markers`)),sdist:_e(e.sdist,w(r,`sdist`),o),wheels:ve(e.wheels,w(r,`wheels`),c),edges:Z(e.dependencies,w(r,`dependencies`)),extraEdges:O(e[`optional-dependencies`],w(r,`optional-dependencies`),Z),groupEdges:O(e[`dev-dependencies`],w(r,`dev-dependencies`),Z),metadata:Ae(e.metadata,w(r,`metadata`))}}var Q=(e,t,n)=>`${e} ${t} ${n}`;function Ge(e,n){let r=t=>me(t,e.where),i=n.byName.get(e.name)??r(`${C(e.name)} names no package in the lockfile`),a=i.length===1?i[0]:void 0,o=e.source?.id??a?.source.id??r(`${C(e.name)} could be any of ${i.length} packages, and names no source`);e.version===void 0&&a===void 0&&!R(e.source)&&r(`${C(e.name)} could be any of ${i.length} versions, and names none`);let s=e.version===void 0?a?.versionKey:t(e.version),c=n.byId.get(Q(e.name,s,o))??r(`names a package the lockfile does not hold: ${C(X(e.name,e.version,o))}`);e.version!==void 0&&e.version!==c.version&&r(`${C(e.version)}, where the package is ${C(c.version)}`);for(let t of e.extras)t in c.extraEdges||r(`${C(t)}, an extra ${C(c.key)} has no dependencies for, which uv drops`);return{package:c.key,extras:e.extras,marker:e.marker}}function Ke(e,t,n){let r=e.map(e=>Ge(e,t)),i=x(r,e=>JSON.stringify([e.package,[...e.extras].sort(),e.marker]));if(i!==void 0)throw new S(`${C(i.package)} is listed twice alike`,n);return r}var $=(e,t,n)=>le(e,n,(e,n)=>Ke(e,t,n));function qe(e,t,n){return e.members.length===0?t.filter(e=>R(e.source)&&e.source.path===`.`).map(e=>e.key):e.members.map((e,t)=>{let r=(n.byName.get(e)??[]).filter(e=>R(e.source));if(r.length!==1)throw new S(`${C(e)} is ${r.length===0?`no package`:`more than one package`} of a directory in the lockfile`,`manifest.members[${t}]`);return r[0].key})}function Je(e){let t=p(pe(e),void 0,Ie,Le),n=He(t.version,`version`),i=Ve(t.revision,`revision`),a=r(t[`requires-python`],`requires-python`),o=m(t.package??[],`package`).map((e,t)=>We(e,`package[${t}]`)),s=ae(o,e=>Q(e.name,e.versionKey,e.source.id),e=>e.key),c={byName:Map.groupBy(o,e=>e.name),byId:new Map([...s].map(([e,t])=>[e,o[t]]))},l=Object.create(null);for(let[e,t]of o.entries()){let n=`package[${e}]`;l[t.key]={name:t.name,version:t.version,source:t.source,resolutionMarkers:t.resolutionMarkers,dependencies:Ke(t.edges,c,w(n,`dependencies`)),optionalDependencies:$(t.extraEdges,c,w(n,`optional-dependencies`)),devDependencies:$(t.groupEdges,c,w(n,`dev-dependencies`)),sdist:t.sdist,wheels:t.wheels,metadata:t.metadata}}let u=ke(t.manifest);return{version:n,revision:i,requiresPython:a,resolutionMarkers:Y(t[`resolution-markers`],`resolution-markers`),supportedMarkers:Y(t[`supported-markers`],`supported-markers`),requiredMarkers:Y(t[`required-markers`],`required-markers`),conflicts:b(t,`conflicts`,``,Fe)??[],options:Pe(t.options),manifest:u,members:qe(u,o,c),packages:l}}export{S as LockfileError,ue as TomlError,Je as parseUvLock};
@@ -1 +1 @@
1
- import{Mf as e,Of as t,Qf as n,oe as r,pe as i,qa as a}from"./chunk-Z6DL5PPO.js";import{a as o}from"./chunk-EMNIV37E.js";import{c as s,d as c,g as l}from"./chunk-2XUEZHIP.js";var u=e(c`<path d="M3.5 8.4l2.9 2.9 6.1-6.6"/>`),d=e(c`<circle class="fill" cx="8" cy="8" r="3"/>`),f=e(c`<path d="M4.2 4.2l7.6 7.6M11.8 4.2l-7.6 7.6"/>`),p=e(c`<circle class="dotted" cx="8" cy="8" r="5.5"/>`),m=e(c`<path d="M2.6 3.2h7.6v5.3H6.3L4 10.4V8.5H2.6z"/><path d="M12.2 6.2h1.2v5.3H12v1.9l-2.3-1.9H7"/>`),h={approved:[`approved`,n.approved[1],`Approved`],changes:[`changes`,n.changes[1],`Changes requested`],commented:[`commented`,t,`Commented`],dismissed:[`dismissed`,t,`Review dismissed`]},g={done:[`reviewed`,u,`Reviewed`],running:[`running`,d,`Reviewing`],failed:[`failed`,f,`Review failed`],requested:[`requested`,p,`Asked to review again`]},_=[`requested`,p,`Review requested`],v=e=>e.slice(0,7),y=e=>new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),b=(e,t,n=!1)=>`${e.toLocaleString(`en-US`)}${n?`+`:``} ${t}${e===1&&!n?``:`s`}`;function x(e){return e?e.failed?g.failed:e.requested?g.requested:g[e.code?.status]??null:null}function S(e){let t=x(e.codex),n=e.codex?.code?.commit??null;return[...t?[{who:a(e.codex.login,`Codex`),standing:t,commit:n,stale:n!==null&&n!==e.head}]:[],...e.reviewers.map(t=>({who:a(t.login,t.login??`someone`),standing:h[t.state]??_,requested:t.requested&&!!h[t.state],workflow:t.workflow??null,commit:t.commit,at:t.at,stale:t.commit!==null&&t.commit!==e.head}))]}var C=e=>(e.moreReviews??0)+(e.moreRequests??0),w=e=>[e.moreReviews>0?b(e.moreReviews,`more review`):null,e.moreRequests>0?b(e.moreRequests,`more review request`):null].filter(Boolean).join(` and `);function T(e){if(!e.head)return!0;let t=e.codex?.code;return t?.status===`done`&&t.commit===e.head||e.reviewers.some(t=>h[t.state]&&t.state!==`dismissed`&&t.commit===e.head)?!0:e.moreReviews>0&&null}var E=e=>e?s`<span class="${`review-severity is-${e}`}">${e.toUpperCase()}</span>`:l;function D(e){if(!e)return l;let t=S(e),{open:n,more:r,severity:i}=e.threads,a=n>0?`${b(n,`open review thread`,r)}${i?`, the gravest ${i.toUpperCase()}`:``}`:r?`No open review thread among those read; more on GitHub`:null,o=T(e);return s`<span class="issue-reviews">${t.map(({who:e,standing:[t,n,r],commit:i,stale:a,requested:o})=>{let c=`${r}${o?`, and requested again`:``}${a?`, on an earlier commit (${v(i)})`:i?`, on the latest commit`:``}`;return s`<span class="${`review-mark is-${t}${a?` is-stale`:``}`}"><span class="review-glyph" role="img" aria-label="${c}" data-tooltip="${c}">${n}</span><span class="review-who">${e}</span></span>`})} ${C(e)>0?s`<span class="review-more" data-tooltip="${`${w(e)}, on GitHub`}">+${C(e)}</span>`:l} ${a?s`<span class="review-threads" role="img" aria-label="${a}" data-tooltip="${a}">${m}<span>${n}${r?`+`:``}</span>${E(i)}</span>`:l} ${o===!1?s`<span class="review-unreviewed" data-tooltip="${t.length>0?`No review is on the latest commit`:`No reviews yet`}">Unreviewed</span>`:o===null?s`<span class="review-unreviewed" data-tooltip="No review read is on the latest commit; more on GitHub">Unreviewed?</span>`:l}</span>`}function O(e,t,n){if(!e)return l;let r=s`<code>${v(e)}</code>`;return s`<span class="review-on">on ${n?s`<a href="${`https://github.com/${n}/commit/${e}`}" target="_blank" rel="noopener noreferrer">${r}</a>`:r}${e===t?`, the latest commit`:`, an earlier commit`}</span>`}function k(e,t){if(!e)return l;let{head:n,codex:r}=e,i=(e,[i,o,c],l)=>s`<li class="review-row">${a(r.login,`Codex`)} <span class="${`review-state is-${i}`}">${o}${l}: ${c.toLowerCase()}</span>${O(e.commit,n,t)}</li>`,o=[...r?.code?[i(r.code,x(r)??g.done,`Code review`)]:[],...r?.security?[i(r.security,g[r.security.status]??g.done,`Security review`)]:[],...S({...e,codex:null}).map(({who:e,standing:[r,i,a],commit:o,at:c,requested:u,workflow:d})=>s`<li class="review-row">${e} <span class="${`review-state is-${r}`}">${i}${a}${u?`, requested again`:``}</span>${d?s`<span class="review-on">by the workflow <code>${d}</code></span>`:l}${O(o,n,t)}${c?s`<time datetime="${new Date(c).toISOString()}">${y(c)}</time>`:l}</li>`)],{open:c,resolved:u,more:d,list:f=[]}=e.threads;return s`<section class="repo-item-section"><h4>Reviews</h4>${o.length>0?s`<ul>${o}</ul>`:s`<p class="repo-item-quiet">No reviews yet.</p>`} ${C(e)>0?s`<p class="repo-item-quiet">And ${w(e)}, on GitHub.</p>`:l} ${T(e)===null?s`<p class="repo-item-quiet">No review read is on the latest commit, <code>${v(n)}</code>; one of those on GitHub may be.</p>`:o.length>0&&!T(e)?s`<p class="repo-item-quiet">No review is on the latest commit, <code>${v(n)}</code>.</p>`:l}</section>${c>0||u>0?s`<section class="repo-item-section"><h4>Open threads</h4>${f.length>0?s`<ul>${f.map(e=>s`<li><a class="repo-item-row review-thread" href="${e.url??l}" target="_blank" rel="noopener noreferrer">${E(e.severity)}<span class="repo-item-title">${e.title||`(no comment)`}</span> ${e.path?s`<code class="review-path">${e.path}${e.line?`:${e.line}`:``}</code>`:l} ${e.outdated?s`<span class="repo-item-quiet">outdated</span>`:l}</a></li>`)}</ul>`:s`<p class="repo-item-quiet">${d?`None open among those read.`:`None open.`}</p>`} ${u>0||d?s`<p class="repo-item-quiet">${u>0?`${b(u,`thread`)} resolved`:``}${d?`${u>0?`; `:``}more on GitHub`:``}.</p>`:l}</section>`:l}`}var A=o({items:new Map,changes:0}),j=i(A.items),M=(e,t,n)=>`${e}\0${t}\0${n}`,N=e=>Number.isSafeInteger(e?.readAt)&&e.readAt>0?e.readAt:Date.now();function P(e,t,n,i=null){j();let a=r(),o=!1;for(let r of t){let t=M(a,e,r.number),s=A.items.get(t);if(s&&s.readAt>n)continue;let c=s&&R(s.item),l=!c||c===R(r)?s?.moved??null:{from:c,before:s.readAt};A.items.set(t,{item:{...r,kind:r.kind??i??s?.item.kind??null},readAt:n,moved:l}),o=!0}o&&A.changes++}var F=(e,t)=>A.items.get(M(r(),e,t))??null;function I(e,t){let n=M(r(),e,``);return A.changes,[...A.items].flatMap(([e,r])=>e.startsWith(n)&&r.item.kind===t?[r]:[])}var L=()=>A.changes,R=e=>e.state===`open`?`open`:`closed`;function z(e,t){let n=R(e.item);if(e.readAt<=t||!e.moved)return n;if(e.moved.before>=t)return e.moved.from;let r=e.item.closedAt??e.item.mergedAt??null;return n===`closed`&&r!==null&&r>t?e.moved.from:n}export{D as a,k as b,N as c,P as d,F as e,I as f,L as g,R as h,z as i};
1
+ import{Tf as e,Vf as t,Xf as n,qa as r,qe as i,re as a}from"./chunk-NTJJIEHS.js";import{a as o}from"./chunk-EMNIV37E.js";import{c as s,d as c,g as l}from"./chunk-2XUEZHIP.js";var u=e(c`<path d="M3.5 8.4l2.9 2.9 6.1-6.6"/>`),d=e(c`<circle class="fill" cx="8" cy="8" r="3"/>`),f=e(c`<path d="M4.2 4.2l7.6 7.6M11.8 4.2l-7.6 7.6"/>`),p=e(c`<circle class="dotted" cx="8" cy="8" r="5.5"/>`),m=e(c`<path d="M2.6 3.2h7.6v5.3H6.3L4 10.4V8.5H2.6z"/><path d="M12.2 6.2h1.2v5.3H12v1.9l-2.3-1.9H7"/>`),h={approved:[`approved`,n.approved[1],`Approved`],changes:[`changes`,n.changes[1],`Changes requested`],commented:[`commented`,t,`Commented`],dismissed:[`dismissed`,t,`Review dismissed`]},g={done:[`reviewed`,u,`Reviewed`],running:[`running`,d,`Reviewing`],failed:[`failed`,f,`Review failed`],requested:[`requested`,p,`Asked to review again`]},_=[`requested`,p,`Review requested`],v=e=>e.slice(0,7),y=e=>new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),b=(e,t,n=!1)=>`${e.toLocaleString(`en-US`)}${n?`+`:``} ${t}${e===1&&!n?``:`s`}`;function x(e){return e?e.failed?g.failed:e.requested?g.requested:g[e.code?.status]??null:null}function S(e){let t=x(e.codex),n=e.codex?.code?.commit??null;return[...t?[{who:r(e.codex.login,`Codex`),standing:t,commit:n,stale:n!==null&&n!==e.head}]:[],...e.reviewers.map(t=>({who:r(t.login,t.login??`someone`),standing:h[t.state]??_,requested:t.requested&&!!h[t.state],workflow:t.workflow??null,commit:t.commit,at:t.at,stale:t.commit!==null&&t.commit!==e.head}))]}var C=e=>(e.moreReviews??0)+(e.moreRequests??0),w=e=>[e.moreReviews>0?b(e.moreReviews,`more review`):null,e.moreRequests>0?b(e.moreRequests,`more review request`):null].filter(Boolean).join(` and `);function T(e){if(!e.head)return!0;let t=e.codex?.code;return t?.status===`done`&&t.commit===e.head||e.reviewers.some(t=>h[t.state]&&t.state!==`dismissed`&&t.commit===e.head)?!0:e.moreReviews>0&&null}var E=e=>e?s`<span class="${`review-severity is-${e}`}">${e.toUpperCase()}</span>`:l;function D(e){if(!e)return l;let t=S(e),{open:n,more:r,severity:i}=e.threads,a=n>0?`${b(n,`open review thread`,r)}${i?`, the gravest ${i.toUpperCase()}`:``}`:r?`No open review thread among those read; more on GitHub`:null,o=T(e);return s`<span class="issue-reviews">${t.map(({who:e,standing:[t,n,r],commit:i,stale:a,requested:o})=>{let c=`${r}${o?`, and requested again`:``}${a?`, on an earlier commit (${v(i)})`:i?`, on the latest commit`:``}`;return s`<span class="${`review-mark is-${t}${a?` is-stale`:``}`}"><span class="review-glyph" role="img" aria-label="${c}" data-tooltip="${c}">${n}</span><span class="review-who">${e}</span></span>`})} ${C(e)>0?s`<span class="review-more" data-tooltip="${`${w(e)}, on GitHub`}">+${C(e)}</span>`:l} ${a?s`<span class="review-threads" role="img" aria-label="${a}" data-tooltip="${a}">${m}<span>${n}${r?`+`:``}</span>${E(i)}</span>`:l} ${o===!1?s`<span class="review-unreviewed" data-tooltip="${t.length>0?`No review is on the latest commit`:`No reviews yet`}">Unreviewed</span>`:o===null?s`<span class="review-unreviewed" data-tooltip="No review read is on the latest commit; more on GitHub">Unreviewed?</span>`:l}</span>`}function O(e,t,n){if(!e)return l;let r=s`<code>${v(e)}</code>`;return s`<span class="review-on">on ${n?s`<a href="${`https://github.com/${n}/commit/${e}`}" target="_blank" rel="noopener noreferrer">${r}</a>`:r}${e===t?`, the latest commit`:`, an earlier commit`}</span>`}function k(e,t){if(!e)return l;let{head:n,codex:i}=e,a=(e,[a,o,c],l)=>s`<li class="review-row">${r(i.login,`Codex`)} <span class="${`review-state is-${a}`}">${o}${l}: ${c.toLowerCase()}</span>${O(e.commit,n,t)}</li>`,o=[...i?.code?[a(i.code,x(i)??g.done,`Code review`)]:[],...i?.security?[a(i.security,g[i.security.status]??g.done,`Security review`)]:[],...S({...e,codex:null}).map(({who:e,standing:[r,i,a],commit:o,at:c,requested:u,workflow:d})=>s`<li class="review-row">${e} <span class="${`review-state is-${r}`}">${i}${a}${u?`, requested again`:``}</span>${d?s`<span class="review-on">by the workflow <code>${d}</code></span>`:l}${O(o,n,t)}${c?s`<time datetime="${new Date(c).toISOString()}">${y(c)}</time>`:l}</li>`)],{open:c,resolved:u,more:d,list:f=[]}=e.threads;return s`<section class="repo-item-section"><h4>Reviews</h4>${o.length>0?s`<ul>${o}</ul>`:s`<p class="repo-item-quiet">No reviews yet.</p>`} ${C(e)>0?s`<p class="repo-item-quiet">And ${w(e)}, on GitHub.</p>`:l} ${T(e)===null?s`<p class="repo-item-quiet">No review read is on the latest commit, <code>${v(n)}</code>; one of those on GitHub may be.</p>`:o.length>0&&!T(e)?s`<p class="repo-item-quiet">No review is on the latest commit, <code>${v(n)}</code>.</p>`:l}</section>${c>0||u>0?s`<section class="repo-item-section"><h4>Open threads</h4>${f.length>0?s`<ul>${f.map(e=>s`<li><a class="repo-item-row review-thread" href="${e.url??l}" target="_blank" rel="noopener noreferrer">${E(e.severity)}<span class="repo-item-title">${e.title||`(no comment)`}</span> ${e.path?s`<code class="review-path">${e.path}${e.line?`:${e.line}`:``}</code>`:l} ${e.outdated?s`<span class="repo-item-quiet">outdated</span>`:l}</a></li>`)}</ul>`:s`<p class="repo-item-quiet">${d?`None open among those read.`:`None open.`}</p>`} ${u>0||d?s`<p class="repo-item-quiet">${u>0?`${b(u,`thread`)} resolved`:``}${d?`${u>0?`; `:``}more on GitHub`:``}.</p>`:l}</section>`:l}`}var A=o({items:new Map,changes:0}),j=a(A.items),M=(e,t,n)=>`${e}\0${t}\0${n}`,N=e=>Number.isSafeInteger(e?.readAt)&&e.readAt>0?e.readAt:Date.now();function P(e,t,n,r=null){j();let a=i(),o=!1;for(let i of t){let t=M(a,e,i.number),s=A.items.get(t);if(s&&s.readAt>n)continue;let c=s&&R(s.item),l=!c||c===R(i)?s?.moved??null:{from:c,before:s.readAt};A.items.set(t,{item:{...i,kind:i.kind??r??s?.item.kind??null},readAt:n,moved:l}),o=!0}o&&A.changes++}var F=(e,t)=>A.items.get(M(i(),e,t))??null;function I(e,t){let n=M(i(),e,``);return A.changes,[...A.items].flatMap(([e,r])=>e.startsWith(n)&&r.item.kind===t?[r]:[])}var L=()=>A.changes,R=e=>e.state===`open`?`open`:`closed`;function z(e,t){let n=R(e.item);if(e.readAt<=t||!e.moved)return n;if(e.moved.before>=t)return e.moved.from;let r=e.item.closedAt??e.item.mergedAt??null;return n===`closed`&&r!==null&&r>t?e.moved.from:n}export{D as a,k as b,N as c,P as d,F as e,I as f,L as g,R as h,z as i};
@@ -1 +1 @@
1
- import{a as e,b as t,c as n,e as r,g as i,h as a,i as o,k as s,l as c,m as l,n as u,p as d,q as f,r as p,s as m}from"./chunk-CU3FPB3P.js";import{b as h,c as g,d as _,e as v,f as y,g as b,h as x,i as S,k as C,l as w}from"./chunk-GX5UXWT4.js";import{H as T,M as E,m as D}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{a as O,b as k,d as ee,e as A,g as j}from"./chunk-VYYUMYVW.js";import{d as M,h as N,i as P}from"./chunk-7HP2VYIC.js";import"./chunk-OOJM4CTU.js";var F=[`https:`,`http:`,`file:`];function I(e,t,n=F){let r=URL.parse(S(e,t));if(r===null||n!==null&&!n.includes(r.protocol))throw new M(`${N(e)} is not a URL${n===null?``:` of ${n.map(e=>e.slice(0,-1)).join(`, `)}`}`,t);return r}function L(e,t){let n=Object.create(null);for(let[r,i,a]of _(e,t)){if(!(r in l))throw new M(`${N(r)} is not a hash algorithm of hashlib's this reader knows`,a);n[r]=u(r,y(i,a),l[r],a)}if(Object.keys(n).length===0)throw new M(`expected a hash at least`,t);return n}function R(e,t){if(!(e instanceof k))throw h(`a date-time`,e,t);if(!/(?:Z|[+-]00:00)$/u.test(e.text))throw new M(`${e.text} is not in UTC`,t);return e.text}function z(e,t,n){if(g(e,t,[`url`,`path`,`size`,`upload-time`,`hashes`,...n]),e.url===void 0&&e.path===void 0)throw new M(`expected a url or a path`,t);let r=D(e,`url`,t,I);return{file:{url:e.url,path:D(e,`path`,t,f),size:D(e,`size`,t,x),uploadTime:D(e,`upload-time`,t,R),hashes:L(e.hashes,P(t,`hashes`))},pathname:r?.pathname}}function B(t,n,r,i){let a=D(t,`name`,n,S),{file:o,pathname:l}=z(t,n,[`name`]),u=m({name:a,path:o.path,pathname:l});if(u===void 0)throw new M(`${N(o.url)} names no file`,n);let d=i?s(u):c(u);if(d===void 0)throw new M(`${N(u)} is not the name of ${i?`a wheel`:`an sdist, .tar.gz or .zip`}`,n);if(d.name!==r.name)throw new M(`${N(u)} is not a file of ${N(r.name)}`,n);if(r.versionKey!==void 0&&e(d.version)!==r.versionKey)throw new M(`${N(u)} is not of version ${N(r.version)}`,n);return{name:u,...o}}var V=(e,t,n)=>e===void 0?void 0:B(e,t,n,!1);function H(e,t,n){if(e===void 0)return[];let r=new Set;return C((e,t)=>{let i=B(e,t,n,!0);if(r.has(i.name))throw new M(`${N(i.name)} is listed twice`,t);return r.add(i.name),i})(e,t)}var U=(e,t)=>({...z(e,t,[`subdirectory`]).file,subdirectory:D(e,`subdirectory`,t,p)});function W(e,t){return g(e,t,[`path`,`editable`,`subdirectory`]),{path:f(e.path,P(t,`path`)),editable:D(e,`editable`,t,b)??!1,subdirectory:D(e,`subdirectory`,t,p)}}var G=new Set([`git`,`hg`,`bzr`,`svn`]);function K(e,t){g(e,t,[`type`,`url`,`path`,`requested-revision`,`commit-id`,`subdirectory`]);let n=S(e.type,P(t,`type`));if(!G.has(n))throw new M(`expected one of ${[...G].join(`, `)}`,P(t,`type`));if(e.url===void 0&&e.path===void 0)throw new M(`expected a url or a path`,t);let r=S(e[`commit-id`],P(t,`commit-id`));if((n===`git`||n===`hg`)&&!T(r))throw new M(`${N(r)} is not a full commit hash, which the spec requires`,P(t,`commit-id`));return{type:n,url:D(e,`url`,t,(e,t)=>I(e,t,null)&&E(e,t)),path:D(e,`path`,t,f),requestedRevision:D(e,`requested-revision`,t,S),commitId:r,subdirectory:D(e,`subdirectory`,t,p)}}var q=C((e,t)=>(S(g(e,t).kind,P(t,`kind`)),e)),J=[`lock-version`,`environments`,`requires-python`,`extras`,`dependency-groups`,`default-groups`,`created-by`,`packages`,`tool`],Y=[`name`,`version`,`marker`,`requires-python`,`dependencies`,`vcs`,`directory`,`archive`,`index`,`sdist`,`wheels`,`attestation-identities`,`tool`];function X(e,t){if(!/^1\.\d+$/u.test(y(e,t)))throw new M(`unsupported lock-version: expected "1.0", found ${N(e)}`,t);return e}function Z(e,t,n){let r=[`vcs`,`directory`,`archive`].filter(t=>e[t]!==void 0),i=V(e.sdist,P(t,`sdist`),n),a=H(e.wheels,P(t,`wheels`),n),o=i!==void 0||a.length>0;if(o&&r.length>0)throw new M(`${r.join(` and `)} beside an sdist or wheels, which the spec forbids`,t);if(!o&&r.length!==1)throw new M(`expected one of vcs, directory and archive, or an sdist or wheels, found ${r.length===0?`none`:r.join(` and `)}`,t);return{vcs:D(e,`vcs`,t,K),directory:D(e,`directory`,t,W),archive:D(e,`archive`,t,U),index:D(e,`index`,t,d),sdist:i,wheels:a}}function Q(e,i){g(e,i,Y);let s=a(e.name,P(i,`name`)),c=D(e,`version`,i,n);return{name:s,version:c,marker:D(e,`marker`,i,o),requiresPython:D(e,`requires-python`,i,r),dependencies:[],...Z(e,i,{name:s,version:c,versionKey:c===void 0?void 0:t(c)}),attestationIdentities:D(e,`attestation-identities`,i,q)??[],tool:D(e,`tool`,i,g)}}function $(e,t){return e instanceof k||e instanceof ee?t instanceof e.constructor&&e.text===t.text:Array.isArray(e)?Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>$(e,t[n])):A(e)?A(t)&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every(([e,n])=>$(n,t[e])):e===t}function te(e,t,n,r){return e===void 0?[]:C((e,t)=>{if(g(e,t).name===void 0)throw new M(`expected a name`,t);let i=Object.entries(e),a=(r.get(e.name)??[]).filter(e=>i.every(([t,r])=>$(r,n[e][t])));if(a.length!==1)throw new M(a.length===0?`names no entry of packages`:`could be any of ${a.length} entries of packages`,t);return a[0]})(e,t)}function ne(e){let t=new Map;for(let[n,r]of e.entries())if(r.marker===void 0){if(t.has(r.name))throw new M(`${N(r.name)} is listed with no marker, as packages[${t.get(r.name)}] is, and both would be installed`,`packages[${n}]`);t.set(r.name,n)}}function re(e){let t=g(j(e),void 0,J),n=X(t[`lock-version`],`lock-version`),s=v(t.packages,`packages`),c=s.map((e,t)=>Q(e,`packages[${t}]`));ne(c);let l=Map.groupBy(c.keys(),e=>c[e].name);for(let[e,t]of c.entries())t.dependencies=te(s[e].dependencies,`packages[${e}].dependencies`,s,l);return{lockVersion:n,environments:D(t,`environments`,``,w(o)),requiresPython:D(t,`requires-python`,``,r),extras:D(t,`extras`,``,w(a))??[],dependencyGroups:D(t,`dependency-groups`,``,w(i))??[],defaultGroups:D(t,`default-groups`,``,w(i))??[],createdBy:S(t[`created-by`],`created-by`),packages:c,tool:D(t,`tool`,``,g)}}export{M as LockfileError,O as TomlError,re as parsePylock};
1
+ import{a as e,b as t,c as n,e as r,g as i,h as a,i as o,k as s,l as c,m as l,n as u,p as d,q as f,r as p,s as m}from"./chunk-CU3FPB3P.js";import{b as h,c as g,d as _,e as v,f as y,g as b,h as x,i as S,k as C,l as w}from"./chunk-GX5UXWT4.js";import{H as T,M as E,m as D}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import{a as O,b as k,d as ee,e as A,g as j}from"./chunk-VYYUMYVW.js";import{d as M,h as N,i as P}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";var F=[`https:`,`http:`,`file:`];function I(e,t,n=F){let r=URL.parse(S(e,t));if(r===null||n!==null&&!n.includes(r.protocol))throw new M(`${N(e)} is not a URL${n===null?``:` of ${n.map(e=>e.slice(0,-1)).join(`, `)}`}`,t);return r}function L(e,t){let n=Object.create(null);for(let[r,i,a]of _(e,t)){if(!(r in l))throw new M(`${N(r)} is not a hash algorithm of hashlib's this reader knows`,a);n[r]=u(r,y(i,a),l[r],a)}if(Object.keys(n).length===0)throw new M(`expected a hash at least`,t);return n}function R(e,t){if(!(e instanceof k))throw h(`a date-time`,e,t);if(!/(?:Z|[+-]00:00)$/u.test(e.text))throw new M(`${e.text} is not in UTC`,t);return e.text}function z(e,t,n){if(g(e,t,[`url`,`path`,`size`,`upload-time`,`hashes`,...n]),e.url===void 0&&e.path===void 0)throw new M(`expected a url or a path`,t);let r=D(e,`url`,t,I);return{file:{url:e.url,path:D(e,`path`,t,f),size:D(e,`size`,t,x),uploadTime:D(e,`upload-time`,t,R),hashes:L(e.hashes,P(t,`hashes`))},pathname:r?.pathname}}function B(t,n,r,i){let a=D(t,`name`,n,S),{file:o,pathname:l}=z(t,n,[`name`]),u=m({name:a,path:o.path,pathname:l});if(u===void 0)throw new M(`${N(o.url)} names no file`,n);let d=i?s(u):c(u);if(d===void 0)throw new M(`${N(u)} is not the name of ${i?`a wheel`:`an sdist, .tar.gz or .zip`}`,n);if(d.name!==r.name)throw new M(`${N(u)} is not a file of ${N(r.name)}`,n);if(r.versionKey!==void 0&&e(d.version)!==r.versionKey)throw new M(`${N(u)} is not of version ${N(r.version)}`,n);return{name:u,...o}}var V=(e,t,n)=>e===void 0?void 0:B(e,t,n,!1);function H(e,t,n){if(e===void 0)return[];let r=new Set;return C((e,t)=>{let i=B(e,t,n,!0);if(r.has(i.name))throw new M(`${N(i.name)} is listed twice`,t);return r.add(i.name),i})(e,t)}var U=(e,t)=>({...z(e,t,[`subdirectory`]).file,subdirectory:D(e,`subdirectory`,t,p)});function W(e,t){return g(e,t,[`path`,`editable`,`subdirectory`]),{path:f(e.path,P(t,`path`)),editable:D(e,`editable`,t,b)??!1,subdirectory:D(e,`subdirectory`,t,p)}}var G=new Set([`git`,`hg`,`bzr`,`svn`]);function K(e,t){g(e,t,[`type`,`url`,`path`,`requested-revision`,`commit-id`,`subdirectory`]);let n=S(e.type,P(t,`type`));if(!G.has(n))throw new M(`expected one of ${[...G].join(`, `)}`,P(t,`type`));if(e.url===void 0&&e.path===void 0)throw new M(`expected a url or a path`,t);let r=S(e[`commit-id`],P(t,`commit-id`));if((n===`git`||n===`hg`)&&!T(r))throw new M(`${N(r)} is not a full commit hash, which the spec requires`,P(t,`commit-id`));return{type:n,url:D(e,`url`,t,(e,t)=>I(e,t,null)&&E(e,t)),path:D(e,`path`,t,f),requestedRevision:D(e,`requested-revision`,t,S),commitId:r,subdirectory:D(e,`subdirectory`,t,p)}}var q=C((e,t)=>(S(g(e,t).kind,P(t,`kind`)),e)),J=[`lock-version`,`environments`,`requires-python`,`extras`,`dependency-groups`,`default-groups`,`created-by`,`packages`,`tool`],Y=[`name`,`version`,`marker`,`requires-python`,`dependencies`,`vcs`,`directory`,`archive`,`index`,`sdist`,`wheels`,`attestation-identities`,`tool`];function X(e,t){if(!/^1\.\d+$/u.test(y(e,t)))throw new M(`unsupported lock-version: expected "1.0", found ${N(e)}`,t);return e}function Z(e,t,n){let r=[`vcs`,`directory`,`archive`].filter(t=>e[t]!==void 0),i=V(e.sdist,P(t,`sdist`),n),a=H(e.wheels,P(t,`wheels`),n),o=i!==void 0||a.length>0;if(o&&r.length>0)throw new M(`${r.join(` and `)} beside an sdist or wheels, which the spec forbids`,t);if(!o&&r.length!==1)throw new M(`expected one of vcs, directory and archive, or an sdist or wheels, found ${r.length===0?`none`:r.join(` and `)}`,t);return{vcs:D(e,`vcs`,t,K),directory:D(e,`directory`,t,W),archive:D(e,`archive`,t,U),index:D(e,`index`,t,d),sdist:i,wheels:a}}function Q(e,i){g(e,i,Y);let s=a(e.name,P(i,`name`)),c=D(e,`version`,i,n);return{name:s,version:c,marker:D(e,`marker`,i,o),requiresPython:D(e,`requires-python`,i,r),dependencies:[],...Z(e,i,{name:s,version:c,versionKey:c===void 0?void 0:t(c)}),attestationIdentities:D(e,`attestation-identities`,i,q)??[],tool:D(e,`tool`,i,g)}}function $(e,t){return e instanceof k||e instanceof ee?t instanceof e.constructor&&e.text===t.text:Array.isArray(e)?Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>$(e,t[n])):A(e)?A(t)&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every(([e,n])=>$(n,t[e])):e===t}function te(e,t,n,r){return e===void 0?[]:C((e,t)=>{if(g(e,t).name===void 0)throw new M(`expected a name`,t);let i=Object.entries(e),a=(r.get(e.name)??[]).filter(e=>i.every(([t,r])=>$(r,n[e][t])));if(a.length!==1)throw new M(a.length===0?`names no entry of packages`:`could be any of ${a.length} entries of packages`,t);return a[0]})(e,t)}function ne(e){let t=new Map;for(let[n,r]of e.entries())if(r.marker===void 0){if(t.has(r.name))throw new M(`${N(r.name)} is listed with no marker, as packages[${t.get(r.name)}] is, and both would be installed`,`packages[${n}]`);t.set(r.name,n)}}function re(e){let t=g(j(e),void 0,J),n=X(t[`lock-version`],`lock-version`),s=v(t.packages,`packages`),c=s.map((e,t)=>Q(e,`packages[${t}]`));ne(c);let l=Map.groupBy(c.keys(),e=>c[e].name);for(let[e,t]of c.entries())t.dependencies=te(s[e].dependencies,`packages[${e}].dependencies`,s,l);return{lockVersion:n,environments:D(t,`environments`,``,w(o)),requiresPython:D(t,`requires-python`,``,r),extras:D(t,`extras`,``,w(a))??[],dependencyGroups:D(t,`dependency-groups`,``,w(i))??[],defaultGroups:D(t,`default-groups`,``,w(i))??[],createdBy:S(t[`created-by`],`created-by`),packages:c,tool:D(t,`tool`,``,g)}}export{M as LockfileError,O as TomlError,re as parsePylock};
@@ -1 +1 @@
1
- import{b as e}from"./chunk-NRPC74AM.js";import{a as t,d as n,f as r,h as i}from"./chunk-7C7DWL7I.js";import{d as a}from"./chunk-PNHBZGDD.js";import{a as o,b as s}from"./chunk-IVDE66N5.js";import{c}from"./chunk-WGQ7D5DB.js";import{C as l,D as u,G as d,J as f,K as p,L as m,O as h,q as g}from"./chunk-QRKFPLA4.js";import{a as _}from"./chunk-TUII34K2.js";function v(e,t){let n=s([{groups:[e],tree:t.tree,treeDependencies:t.treeDependencies}]);for(let r of e)l(r,t),r.isApp??=g(r,r.source??t.source),r._depsDirectory=n}function y(e,t){return!(e.isApp??g(e,e._source??e.source))&&o(e.file,e._depsDirectory??t??s([{groups:[[e]]}]))}function ee(e,n,r){let i=t(n);return i===`ignored`&&y(e,r)?void 0:i}function b(e,n,a,o){let s=n.id??String(n._id),c=n._reportName??``;y(n,o)&&(a===`ignored`||a===`untriaged`)?(t(e.get(s))!==`ignored`&&r(e,s,{triage:void 0}),i(e,s,c,a===`ignored`,!0)):(r(e,s,{triage:a===`untriaged`?void 0:a}),a!==`ignored`&&a!==`untriaged`&&i(e,s,c,!1))}function x(e,a){let o=new Set;for(let t of e.values()){let e=t?.ignoredReports;if(!e?.length)continue;let r=new Set(e).size!==e.length;for(let i of e)(r||!n(t,i))&&o.add(i)}if(o.size===0)return!1;let c=!1;for(let l of a){let a=(l.groups??[]).flat();if(!a.some(e=>o.has(e._reportName??l.name??l.fileName??``)))continue;let u=s([l]),d=e=>({...e,_source:e._source??e.source??l.source}),f=new Set(a.filter(e=>y(d(e),u)).map(e=>e.id??String(e._id)));for(let o of a){let a=o.id??String(o._id),s=o._reportName??l.name??l.fileName??``,p=e.get(a);p?.ignoredReports?.includes(s)&&(n(p,s)||y(d(o),u)||(t(p)||(c=r(e,a,{triage:`ignored`})||c),f.has(a)||(c=i(e,a,s,!1)||c)))}for(let t of a){if(!y(d(t),u))continue;let n=t.id??String(t._id),r=t._reportName??l.name??l.fileName??``;e.get(n)?.ignoredReports?.includes(r)&&(c=i(e,n,r,!0,!0)||c)}}return c}async function S(e,t){let r=new Set(Object.values(e??{}).flatMap(e=>Array.isArray(e?.ignoredReports)?e.ignoredReports.filter(t=>typeof t==`string`&&!n(e,t)):[])),i=[];for(let e of r){let n;try{let r=await t(e);if(typeof r!=`string`)continue;n=await h(r)}catch{continue}n&&i.push({...n.data,name:e,groups:[n.findings]})}return i}async function C(e,t){if(e!=null&&(typeof e!=`object`||Array.isArray(e)))return{entries:e,changed:!1};let n=new Map(Object.entries(e??{})),r=x(n,await S(e,t));return{entries:Object.fromEntries(n),changed:r}}var w=`links`;function T(e){if(typeof e==`string`)return e.length>0?e:null;if(!e||typeof e!=`object`||Array.isArray(e))return null;let{id:t}=e;return typeof t==`string`&&t.length>0?t:null}function E(e){if(typeof e==`string`&&!/^\s*\[/u.test(e))return null;let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t)||t.length===0)return null;let n=[],r=0;for(let e of t){if(!Array.isArray(e))return null;let t=new Set;for(let n of e){let e=T(n);if(e===null)return null;c(e)?t.add(e):r++}t.size>1&&n.push([...t])}return{groups:n,skipped:r}}function D(e){let t=new Set;for(let n of e)for(let e of n)t.add(e);return t.size}function te(e,t){for(let n of e)for(let e of n){let r=t.get(e);r||t.set(e,r=new Set);for(let t of n)t!==e&&r.add(t)}return t}var O=1,k=16,A=12,j=1+k+A+16,M=1+k+A;async function N(e,t){let n=await crypto.subtle.importKey(`raw`,_(e),`PBKDF2`,!1,[`deriveKey`]);return crypto.subtle.deriveKey({name:`PBKDF2`,hash:`SHA-256`,salt:t,iterations:3e6},n,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}function P(e){return!(e instanceof Uint8Array)||e.length<j?!1:e[0]===O}async function F(e,t){if(!(e instanceof Uint8Array))throw TypeError(`encryptWithPassword: plaintext Uint8Array required`);if(typeof t!=`string`||!t)throw TypeError(`encryptWithPassword: password required`);let n=new Uint8Array(M+e.length+16);n[0]=O,crypto.getRandomValues(n.subarray(1,1+k)),crypto.getRandomValues(n.subarray(1+k,M));let r=n.subarray(1,1+k),i=n.subarray(1+k,M),a=await N(t,r),o=new Uint8Array(await crypto.subtle.encrypt({name:`AES-GCM`,iv:i,additionalData:n.subarray(0,M)},a,e));return n.set(o,M),n}async function ne(e,t){if(typeof t!=`string`||!t)throw TypeError(`tryDecryptWithPassword: password required`);if(!(e instanceof Uint8Array)||e.length<j||e[0]!==O)return{ok:!1,reason:`malformed`};let n=e.subarray(1,1+k),r=e.subarray(1+k,M),i=e.subarray(M),a=await N(t,n),o;try{o=new Uint8Array(await crypto.subtle.decrypt({name:`AES-GCM`,iv:r,additionalData:e.subarray(0,M)},a,i))}catch{return{ok:!1,reason:`wrong-password`}}return{ok:!0,plaintext:o}}async function I(e,t,n){if(!n||typeof n.malformedMsg!=`string`||typeof n.wrongPasswordMsg!=`string`)throw TypeError(`decryptWithPasswordOrThrow: { malformedMsg, wrongPasswordMsg } strings required`);let r=await ne(e,t);if(r.ok)return r.plaintext;throw r.reason===`wrong-password`?Error(n.wrongPasswordMsg):Error(n.malformedMsg)}var L=P,R=F;function z(e,t){return I(e,t,{malformedMsg:`malformed encrypted bundle`,wrongPasswordMsg:`wrong password or corrupt bundle`})}var B=1,V=1024,H=1024,U=200,W=104857600,G=Math.ceil(W*4/3)+16,K=512,q=64;function J(e){if(!e||typeof e!=`object`)return`payload is not an object`;if(e.version!==B)return`unsupported export version: ${e.version}`;if(!e.workspace||typeof e.workspace!=`object`)return`workspace metadata missing`;if(typeof e.workspace.id!=`string`)return`workspace.id must be a string`;if(typeof e.workspace.name!=`string`)return`workspace.name must be a string`;if(typeof e.workspace.privateKey!=`string`)return`workspace.privateKey must be a string`;if(e.workspace.createdAt!==void 0&&!Number.isFinite(e.workspace.createdAt))return`workspace.createdAt must be a finite number or omitted`;if(!Array.isArray(e.reports))return`reports field must be an array`;if(e.reports.length>H)return`reports count (${e.reports.length}) exceeds cap (${H})`;if(e.bundles!==void 0){if(!Array.isArray(e.bundles))return`bundles field must be an array when present`;if(e.bundles.length>V)return`bundles count (${e.bundles.length}) exceeds cap (${V})`;for(let t of e.bundles){if(typeof t!=`string`)return`bundles entries must be strings`;if(t.length>U)return`bundle integrity exceeds per-entry length cap (${U})`}}if(e.bundleBlobs!==void 0){if(!Array.isArray(e.bundleBlobs))return`bundleBlobs field must be an array when present`;if(e.bundleBlobs.length>q)return`bundleBlobs count (${e.bundleBlobs.length}) exceeds cap (${q})`;for(let t of e.bundleBlobs){if(!t||typeof t!=`object`||Array.isArray(t))return`bundleBlobs entries must be objects`;if(typeof t.integrity!=`string`||t.integrity.length===0)return`bundleBlobs.integrity must be a non-empty string`;if(t.integrity.length>U)return`bundleBlobs.integrity exceeds per-entry length cap (${U})`;if(typeof t.name!=`string`||t.name.length===0)return`bundleBlobs.name must be a non-empty string`;if(t.name.length>K)return`bundleBlobs.name exceeds per-entry length cap (${K})`;if(t.name.includes(`\0`))return`bundleBlobs.name cannot contain NUL`;if(typeof t.data!=`string`)return`bundleBlobs.data must be a base64 string`;if(t.data.length>G)return`bundleBlobs.data exceeds per-blob size cap (${W} bytes raw)`}}return null}async function Y(e){return new Uint8Array(await e.arrayBuffer())}async function X(e,t){if(L(e)){if(typeof t!=`string`||!t)throw TypeError(`parseWorkspaceBundleBytes: password required for encrypted bundle`);let n=await z(e,t);try{return Z(await a(n))}catch(e){throw Error(`wrong password or corrupt bundle`,{cause:e})}}let n;try{n=await a(e)}catch(e){throw Error(`gzip decompression failed: ${e.message}`,{cause:e})}return Z(n)}function Z(e){let t;try{t=JSON.parse(e)}catch(e){throw Error(`payload is not JSON: ${e.message}`,{cause:e})}let n=J(t);if(n===null)return t;let r=n.includes(`exceeds cap`);throw Error(r?n:`not a deepview workspace export: ${n}`)}function Q(e,t){let n=e.trimStart().startsWith(`[`)?E(e):null;if(n)return{data:{source:`links`,findings:[],links:n.groups},format:`links`,reason:null};let r=m(e);if(r.data!=null||p(e,t)!==`codex`)return r;try{return{data:{type:`security`,source:`codex-security`,findings:d(e).flatMap(e=>e.data.findings)},format:`codex`,reason:null}}catch(e){return{data:null,format:null,reason:e instanceof Error?e.message:`Invalid Codex CSV`}}}function re(e,t){let n=Q(e,t);return n.data==null?Promise.resolve(null):h(JSON.stringify(n.data))}function ie(e){let t=new Set;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;typeof e.file==`string`&&e.file&&t.add(e.file);for(let n of Array.isArray(e.evidence)?e.evidence:[])typeof n?.file==`string`&&n.file&&t.add(n.file)}return t}function $(e){let t=(f(e)??[]).flat().filter(e=>typeof e==`object`&&!!e),n=s([{groups:[t],tree:e?.tree}]);return{directory:n,own:t.filter(e=>!o(e.file,n))}}function ae(e){let t=new Map;for(let n of $(e).own){let e=u(n);e&&t.set(e.toLowerCase(),e)}return t.size===1?[...t.values()][0]:null}function oe(t){let{directory:n,own:r}=$(t);return e([...ie(r)].filter(e=>!o(e,n)))}var se=[`inprogress`,`fixed`,`invalid`,`deleted`,`ignored`];function ce(e){return typeof e==`string`&&se.includes(e)}function le(e){if(e===null)return null;if(typeof e!=`object`||Array.isArray(e))return`invalid`;let t=e,n={},r=t.color;if(r!=null){if(typeof r!=`string`||r.length>50)return`invalid`;r!==``&&(n.color=r)}let i=t.triage;if(i!=null){if(!ce(i))return`invalid`;n.triage=i}for(let e of[`comment`,`fix`]){let r=t[e];if(r!=null){if(typeof r!=`string`||r.length>1e4)return`invalid`;r!==``&&(n[e]=r)}}let a=t.flagged;if(a!=null){if(typeof a!=`boolean`)return`invalid`;n.flagged=a}return n}export{v as a,y as b,ee as c,b as d,x as e,S as f,C as g,w as h,E as i,D as j,te as k,F as l,I as m,L as n,R as o,H as p,Y as q,X as r,Z as s,Q as t,re as u,ae as v,oe as w,le as x};
1
+ import{b as e}from"./chunk-NRPC74AM.js";import{a as t,d as n,f as r,h as i}from"./chunk-7C7DWL7I.js";import{d as a}from"./chunk-PNHBZGDD.js";import{a as o,b as s}from"./chunk-6VXEPL32.js";import{c}from"./chunk-XLX6XXJF.js";import{C as l,D as u,G as d,J as f,K as p,L as m,O as h,q as g}from"./chunk-QRKFPLA4.js";import{a as _}from"./chunk-TUII34K2.js";function v(e,t){let n=s([{groups:[e],tree:t.tree,treeDependencies:t.treeDependencies}]);for(let r of e)l(r,t),r.isApp??=g(r,r.source??t.source),r._depsDirectory=n}function y(e,t){return!(e.isApp??g(e,e._source??e.source))&&o(e.file,e._depsDirectory??t??s([{groups:[[e]]}]))}function ee(e,n,r){let i=t(n);return i===`ignored`&&y(e,r)?void 0:i}function b(e,n,a,o){let s=n.id??String(n._id),c=n._reportName??``;y(n,o)&&(a===`ignored`||a===`untriaged`)?(t(e.get(s))!==`ignored`&&r(e,s,{triage:void 0}),i(e,s,c,a===`ignored`,!0)):(r(e,s,{triage:a===`untriaged`?void 0:a}),a!==`ignored`&&a!==`untriaged`&&i(e,s,c,!1))}function x(e,a){let o=new Set;for(let t of e.values()){let e=t?.ignoredReports;if(!e?.length)continue;let r=new Set(e).size!==e.length;for(let i of e)(r||!n(t,i))&&o.add(i)}if(o.size===0)return!1;let c=!1;for(let l of a){let a=(l.groups??[]).flat();if(!a.some(e=>o.has(e._reportName??l.name??l.fileName??``)))continue;let u=s([l]),d=e=>({...e,_source:e._source??e.source??l.source}),f=new Set(a.filter(e=>y(d(e),u)).map(e=>e.id??String(e._id)));for(let o of a){let a=o.id??String(o._id),s=o._reportName??l.name??l.fileName??``,p=e.get(a);p?.ignoredReports?.includes(s)&&(n(p,s)||y(d(o),u)||(t(p)||(c=r(e,a,{triage:`ignored`})||c),f.has(a)||(c=i(e,a,s,!1)||c)))}for(let t of a){if(!y(d(t),u))continue;let n=t.id??String(t._id),r=t._reportName??l.name??l.fileName??``;e.get(n)?.ignoredReports?.includes(r)&&(c=i(e,n,r,!0,!0)||c)}}return c}async function S(e,t){let r=new Set(Object.values(e??{}).flatMap(e=>Array.isArray(e?.ignoredReports)?e.ignoredReports.filter(t=>typeof t==`string`&&!n(e,t)):[])),i=[];for(let e of r){let n;try{let r=await t(e);if(typeof r!=`string`)continue;n=await h(r)}catch{continue}n&&i.push({...n.data,name:e,groups:[n.findings]})}return i}async function C(e,t){if(e!=null&&(typeof e!=`object`||Array.isArray(e)))return{entries:e,changed:!1};let n=new Map(Object.entries(e??{})),r=x(n,await S(e,t));return{entries:Object.fromEntries(n),changed:r}}var w=`links`;function T(e){if(typeof e==`string`)return e.length>0?e:null;if(!e||typeof e!=`object`||Array.isArray(e))return null;let{id:t}=e;return typeof t==`string`&&t.length>0?t:null}function E(e){if(typeof e==`string`&&!/^\s*\[/u.test(e))return null;let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t)||t.length===0)return null;let n=[],r=0;for(let e of t){if(!Array.isArray(e))return null;let t=new Set;for(let n of e){let e=T(n);if(e===null)return null;c(e)?t.add(e):r++}t.size>1&&n.push([...t])}return{groups:n,skipped:r}}function D(e){let t=new Set;for(let n of e)for(let e of n)t.add(e);return t.size}function te(e,t){for(let n of e)for(let e of n){let r=t.get(e);r||t.set(e,r=new Set);for(let t of n)t!==e&&r.add(t)}return t}var O=1,k=16,A=12,j=1+k+A+16,M=1+k+A;async function N(e,t){let n=await crypto.subtle.importKey(`raw`,_(e),`PBKDF2`,!1,[`deriveKey`]);return crypto.subtle.deriveKey({name:`PBKDF2`,hash:`SHA-256`,salt:t,iterations:3e6},n,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}function P(e){return!(e instanceof Uint8Array)||e.length<j?!1:e[0]===O}async function F(e,t){if(!(e instanceof Uint8Array))throw TypeError(`encryptWithPassword: plaintext Uint8Array required`);if(typeof t!=`string`||!t)throw TypeError(`encryptWithPassword: password required`);let n=new Uint8Array(M+e.length+16);n[0]=O,crypto.getRandomValues(n.subarray(1,1+k)),crypto.getRandomValues(n.subarray(1+k,M));let r=n.subarray(1,1+k),i=n.subarray(1+k,M),a=await N(t,r),o=new Uint8Array(await crypto.subtle.encrypt({name:`AES-GCM`,iv:i,additionalData:n.subarray(0,M)},a,e));return n.set(o,M),n}async function ne(e,t){if(typeof t!=`string`||!t)throw TypeError(`tryDecryptWithPassword: password required`);if(!(e instanceof Uint8Array)||e.length<j||e[0]!==O)return{ok:!1,reason:`malformed`};let n=e.subarray(1,1+k),r=e.subarray(1+k,M),i=e.subarray(M),a=await N(t,n),o;try{o=new Uint8Array(await crypto.subtle.decrypt({name:`AES-GCM`,iv:r,additionalData:e.subarray(0,M)},a,i))}catch{return{ok:!1,reason:`wrong-password`}}return{ok:!0,plaintext:o}}async function I(e,t,n){if(!n||typeof n.malformedMsg!=`string`||typeof n.wrongPasswordMsg!=`string`)throw TypeError(`decryptWithPasswordOrThrow: { malformedMsg, wrongPasswordMsg } strings required`);let r=await ne(e,t);if(r.ok)return r.plaintext;throw r.reason===`wrong-password`?Error(n.wrongPasswordMsg):Error(n.malformedMsg)}var L=P,R=F;function z(e,t){return I(e,t,{malformedMsg:`malformed encrypted bundle`,wrongPasswordMsg:`wrong password or corrupt bundle`})}var B=1,V=1024,H=1024,U=200,W=104857600,G=Math.ceil(W*4/3)+16,K=512,q=64;function J(e){if(!e||typeof e!=`object`)return`payload is not an object`;if(e.version!==B)return`unsupported export version: ${e.version}`;if(!e.workspace||typeof e.workspace!=`object`)return`workspace metadata missing`;if(typeof e.workspace.id!=`string`)return`workspace.id must be a string`;if(typeof e.workspace.name!=`string`)return`workspace.name must be a string`;if(typeof e.workspace.privateKey!=`string`)return`workspace.privateKey must be a string`;if(e.workspace.createdAt!==void 0&&!Number.isFinite(e.workspace.createdAt))return`workspace.createdAt must be a finite number or omitted`;if(!Array.isArray(e.reports))return`reports field must be an array`;if(e.reports.length>H)return`reports count (${e.reports.length}) exceeds cap (${H})`;if(e.bundles!==void 0){if(!Array.isArray(e.bundles))return`bundles field must be an array when present`;if(e.bundles.length>V)return`bundles count (${e.bundles.length}) exceeds cap (${V})`;for(let t of e.bundles){if(typeof t!=`string`)return`bundles entries must be strings`;if(t.length>U)return`bundle integrity exceeds per-entry length cap (${U})`}}if(e.bundleBlobs!==void 0){if(!Array.isArray(e.bundleBlobs))return`bundleBlobs field must be an array when present`;if(e.bundleBlobs.length>q)return`bundleBlobs count (${e.bundleBlobs.length}) exceeds cap (${q})`;for(let t of e.bundleBlobs){if(!t||typeof t!=`object`||Array.isArray(t))return`bundleBlobs entries must be objects`;if(typeof t.integrity!=`string`||t.integrity.length===0)return`bundleBlobs.integrity must be a non-empty string`;if(t.integrity.length>U)return`bundleBlobs.integrity exceeds per-entry length cap (${U})`;if(typeof t.name!=`string`||t.name.length===0)return`bundleBlobs.name must be a non-empty string`;if(t.name.length>K)return`bundleBlobs.name exceeds per-entry length cap (${K})`;if(t.name.includes(`\0`))return`bundleBlobs.name cannot contain NUL`;if(typeof t.data!=`string`)return`bundleBlobs.data must be a base64 string`;if(t.data.length>G)return`bundleBlobs.data exceeds per-blob size cap (${W} bytes raw)`}}return null}async function Y(e){return new Uint8Array(await e.arrayBuffer())}async function X(e,t){if(L(e)){if(typeof t!=`string`||!t)throw TypeError(`parseWorkspaceBundleBytes: password required for encrypted bundle`);let n=await z(e,t);try{return Z(await a(n))}catch(e){throw Error(`wrong password or corrupt bundle`,{cause:e})}}let n;try{n=await a(e)}catch(e){throw Error(`gzip decompression failed: ${e.message}`,{cause:e})}return Z(n)}function Z(e){let t;try{t=JSON.parse(e)}catch(e){throw Error(`payload is not JSON: ${e.message}`,{cause:e})}let n=J(t);if(n===null)return t;let r=n.includes(`exceeds cap`);throw Error(r?n:`not a deepview workspace export: ${n}`)}function Q(e,t){let n=e.trimStart().startsWith(`[`)?E(e):null;if(n)return{data:{source:`links`,findings:[],links:n.groups},format:`links`,reason:null};let r=m(e);if(r.data!=null||p(e,t)!==`codex`)return r;try{return{data:{type:`security`,source:`codex-security`,findings:d(e).flatMap(e=>e.data.findings)},format:`codex`,reason:null}}catch(e){return{data:null,format:null,reason:e instanceof Error?e.message:`Invalid Codex CSV`}}}function re(e,t){let n=Q(e,t);return n.data==null?Promise.resolve(null):h(JSON.stringify(n.data))}function ie(e){let t=new Set;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;typeof e.file==`string`&&e.file&&t.add(e.file);for(let n of Array.isArray(e.evidence)?e.evidence:[])typeof n?.file==`string`&&n.file&&t.add(n.file)}return t}function $(e){let t=(f(e)??[]).flat().filter(e=>typeof e==`object`&&!!e),n=s([{groups:[t],tree:e?.tree}]);return{directory:n,own:t.filter(e=>!o(e.file,n))}}function ae(e){let t=new Map;for(let n of $(e).own){let e=u(n);e&&t.set(e.toLowerCase(),e)}return t.size===1?[...t.values()][0]:null}function oe(t){let{directory:n,own:r}=$(t);return e([...ie(r)].filter(e=>!o(e,n)))}var se=[`inprogress`,`fixed`,`invalid`,`deleted`,`ignored`];function ce(e){return typeof e==`string`&&se.includes(e)}function le(e){if(e===null)return null;if(typeof e!=`object`||Array.isArray(e))return`invalid`;let t=e,n={},r=t.color;if(r!=null){if(typeof r!=`string`||r.length>50)return`invalid`;r!==``&&(n.color=r)}let i=t.triage;if(i!=null){if(!ce(i))return`invalid`;n.triage=i}for(let e of[`comment`,`fix`]){let r=t[e];if(r!=null){if(typeof r!=`string`||r.length>1e4)return`invalid`;r!==``&&(n[e]=r)}}let a=t.flagged;if(a!=null){if(typeof a!=`boolean`)return`invalid`;n.flagged=a}return n}export{v as a,y as b,ee as c,b as d,x as e,S as f,C as g,w as h,E as i,D as j,te as k,F as l,I as m,L as n,R as o,H as p,Y as q,X as r,Z as s,Q as t,re as u,ae as v,oe as w,le as x};