chromatic
Version:
Automate visual testing across browsers. Gather UI feedback. Versioned documentation.
58 lines • 153 kB
JavaScript
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5e360b1f-2aeb-5c86-8b27-88851e96916e")}catch(e){}}();
const e=require(`./chunk-gGpyby2o.cjs`),t=require(`./icons-BshdA1Sq.cjs`),n=require(`./lib-BDYlwOHs.cjs`);let r=require(`fs`);r=e.a(r,1);let i=require(`path`);i=e.a(i,1);let a=require(`os`);a=e.a(a,1);let o=require(`tty`);o=e.a(o,1);let s=require(`events`);s=e.a(s,1);let c=require(`child_process`);c=e.a(c,1);let l=require(`node:util`),u=require(`node:child_process`);u=e.a(u,1);let d=require(`node:fs`);d=e.a(d,1);let f=require(`node:os`);f=e.a(f,1);let p=require(`node:path`);p=e.a(p,1);let m=require(`node:process`);m=e.a(m,1);let h=require(`node:fs/promises`);h=e.a(h,1);let g=require(`node:url`);g=e.a(g,1);let _=require(`node:buffer`),v=require(`node:timers/promises`),y=require(`stream`);y=e.a(y,1);let b=require(`fs/promises`);b=e.a(b,1);let ee=require(`readline`);ee=e.a(ee,1);const te=e=>e instanceof URL?(0,g.fileURLToPath)(e):e;async function ne(e,{cwd:t=m.default.cwd(),type:n=`file`,stopAt:r}={}){let i=p.default.resolve(te(t)??``),{root:a}=p.default.parse(i);r=p.default.resolve(i,te(r??a));let o=p.default.isAbsolute(e);for(;i;){let t=o?e:p.default.join(i,e);try{let e=await h.default.stat(t);if(n===`file`&&e.isFile()||n===`directory`&&e.isDirectory())return t}catch{}if(i===r||i===a)break;i=p.default.dirname(i)}}var re=n.t();const ie=({oneBased:e,oneBasedLine:t=e,oneBasedColumn:n=e}={})=>[+!!t,+!!n];function ae(e,t,n){let r=t===0?-1:e.lastIndexOf(`
`,t-1),[i,a]=ie(n);return{line:r===-1?i:e.slice(0,r+1).match(/\n/g).length+i,column:t-r-1+a}}function oe(e,t,n){if(typeof e!=`string`)throw TypeError(`Text parameter should be a string`);if(!Number.isInteger(t))throw TypeError(`Index parameter should be an integer`);if(t<0||t>e.length)throw RangeError(`Index out of bounds`);return ae(e,t,n)}const se=e=>`\\u{${e.codePointAt(0).toString(16)}}`;var ce=class e extends Error{name=`JSONError`;fileName;#e;#t;#n;#r;#i;constructor(t){if(typeof t==`string`)super(),this.#n=t;else{let{jsonParseError:e,fileName:n,input:r}=t;super(void 0,{cause:e}),this.#e=r,this.#t=e,this.fileName=n}Error.captureStackTrace?.(this,e)}get message(){this.#n??=`${ue(this.#t.message)}${this.#e===``?` while parsing empty string`:``}`;let{codeFrame:e}=this;return`${this.#n}${this.fileName?` in ${this.fileName}`:``}${e?`\n\n${e}\n`:``}`}set message(e){this.#n=e}#a(e){if(!this.#t)return;let t=this.#e,n=le(t,this.#t.message);if(n)return(0,re.codeFrameColumns)(t,{start:n},{highlightCode:e})}get codeFrame(){return this.#r??=this.#a(!0),this.#r}get rawCodeFrame(){return this.#i??=this.#a(!1),this.#i}};const le=(e,t)=>{let n=t.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!n)return;let{index:r,line:i,column:a}=n.groups;return i&&a?{line:Number(i),column:Number(a)}:oe(e,Number(r),{oneBased:!0})},ue=e=>e.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,t,n)=>`"${n}"(${se(n)})`);function de(e,t,n){typeof t==`string`&&(n=t,t=void 0);try{return JSON.parse(e,t)}catch(t){throw new ce({jsonParseError:t,fileName:n,input:e})}}var fe=e.t(((e,t)=>{t.exports=`0BSD,3D-Slicer-1.0,AAL,ADSL,AFL-1.1,AFL-1.2,AFL-2.0,AFL-2.1,AFL-3.0,AGPL-1.0-only,AGPL-1.0-or-later,AGPL-3.0-only,AGPL-3.0-or-later,ALGLIB-Documentation,AMD-newlib,AMDPLPA,AML,AML-glslang,AMPAS,ANTLR-PD,ANTLR-PD-fallback,APAFML,APL-1.0,APSL-1.0,APSL-1.1,APSL-1.2,APSL-2.0,ASWF-Digital-Assets-1.0,ASWF-Digital-Assets-1.1,Abstyles,AdaCore-doc,Adobe-2006,Adobe-Display-PostScript,Adobe-Glyph,Adobe-Utopia,Advanced-Cryptics-Dictionary,Afmparse,Aladdin,Apache-1.0,Apache-1.1,Apache-2.0,App-s2p,Arphic-1999,Artistic-1.0,Artistic-1.0-Perl,Artistic-1.0-cl8,Artistic-2.0,Artistic-dist,Aspell-RU,BOLA-1.1,BSD-1-Clause,BSD-2-Clause,BSD-2-Clause-Darwin,BSD-2-Clause-Patent,BSD-2-Clause-Views,BSD-2-Clause-first-lines,BSD-2-Clause-pkgconf-disclaimer,BSD-3-Clause,BSD-3-Clause-Attribution,BSD-3-Clause-Clear,BSD-3-Clause-HP,BSD-3-Clause-LBNL,BSD-3-Clause-Modification,BSD-3-Clause-No-Military-License,BSD-3-Clause-No-Nuclear-License,BSD-3-Clause-No-Nuclear-License-2014,BSD-3-Clause-No-Nuclear-Warranty,BSD-3-Clause-Open-MPI,BSD-3-Clause-Sun,BSD-3-Clause-Tso,BSD-3-Clause-acpica,BSD-3-Clause-flex,BSD-4-Clause,BSD-4-Clause-Shortened,BSD-4-Clause-UC,BSD-4.3RENO,BSD-4.3TAHOE,BSD-Advertising-Acknowledgement,BSD-Attribution-HPND-disclaimer,BSD-Inferno-Nettverk,BSD-Mark-Modifications,BSD-Protection,BSD-Source-Code,BSD-Source-beginning-file,BSD-Systemics,BSD-Systemics-W3Works,BSL-1.0,BUSL-1.1,Baekmuk,Bahyph,Barr,Beerware,BitTorrent-1.0,BitTorrent-1.1,Bitstream-Charter,Bitstream-Vera,BlueOak-1.0.0,Boehm-GC,Boehm-GC-without-fee,Borceux,Brian-Gladman-2-Clause,Brian-Gladman-3-Clause,Buddy,C-UDA-1.0,CAL-1.0,CAL-1.0-Combined-Work-Exception,CAPEC-tou,CATOSL-1.1,CC-BY-1.0,CC-BY-2.0,CC-BY-2.5,CC-BY-2.5-AU,CC-BY-3.0,CC-BY-3.0-AT,CC-BY-3.0-AU,CC-BY-3.0-DE,CC-BY-3.0-IGO,CC-BY-3.0-NL,CC-BY-3.0-US,CC-BY-4.0,CC-BY-NC-1.0,CC-BY-NC-2.0,CC-BY-NC-2.5,CC-BY-NC-3.0,CC-BY-NC-3.0-DE,CC-BY-NC-4.0,CC-BY-NC-ND-1.0,CC-BY-NC-ND-2.0,CC-BY-NC-ND-2.5,CC-BY-NC-ND-3.0,CC-BY-NC-ND-3.0-DE,CC-BY-NC-ND-3.0-IGO,CC-BY-NC-ND-4.0,CC-BY-NC-SA-1.0,CC-BY-NC-SA-2.0,CC-BY-NC-SA-2.0-DE,CC-BY-NC-SA-2.0-FR,CC-BY-NC-SA-2.0-UK,CC-BY-NC-SA-2.5,CC-BY-NC-SA-3.0,CC-BY-NC-SA-3.0-DE,CC-BY-NC-SA-3.0-IGO,CC-BY-NC-SA-4.0,CC-BY-ND-1.0,CC-BY-ND-2.0,CC-BY-ND-2.5,CC-BY-ND-3.0,CC-BY-ND-3.0-DE,CC-BY-ND-4.0,CC-BY-SA-1.0,CC-BY-SA-2.0,CC-BY-SA-2.0-UK,CC-BY-SA-2.1-JP,CC-BY-SA-2.5,CC-BY-SA-3.0,CC-BY-SA-3.0-AT,CC-BY-SA-3.0-DE,CC-BY-SA-3.0-IGO,CC-BY-SA-4.0,CC-PDDC,CC-PDM-1.0,CC-SA-1.0,CC0-1.0,CDDL-1.0,CDDL-1.1,CDL-1.0,CDLA-Permissive-1.0,CDLA-Permissive-2.0,CDLA-Sharing-1.0,CECILL-1.0,CECILL-1.1,CECILL-2.0,CECILL-2.1,CECILL-B,CECILL-C,CERN-OHL-1.1,CERN-OHL-1.2,CERN-OHL-P-2.0,CERN-OHL-S-2.0,CERN-OHL-W-2.0,CFITSIO,CMU-Mach,CMU-Mach-nodoc,CNRI-Jython,CNRI-Python,CNRI-Python-GPL-Compatible,COIL-1.0,CPAL-1.0,CPL-1.0,CPOL-1.02,CUA-OPL-1.0,Caldera,Caldera-no-preamble,Catharon,ClArtistic,Clips,Community-Spec-1.0,Condor-1.1,Cornell-Lossless-JPEG,Cronyx,Crossword,CryptoSwift,CrystalStacker,Cube,D-FSL-1.0,DEC-3-Clause,DL-DE-BY-2.0,DL-DE-ZERO-2.0,DOC,DRL-1.0,DRL-1.1,DSDP,DocBook-DTD,DocBook-Schema,DocBook-Stylesheet,DocBook-XML,Dotseqn,ECL-1.0,ECL-2.0,EFL-1.0,EFL-2.0,EPICS,EPL-1.0,EPL-2.0,ESA-PL-permissive-2.4,ESA-PL-strong-copyleft-2.4,ESA-PL-weak-copyleft-2.4,EUDatagrid,EUPL-1.0,EUPL-1.1,EUPL-1.2,Elastic-2.0,Entessa,ErlPL-1.1,Eurosym,FBM,FDK-AAC,FSFAP,FSFAP-no-warranty-disclaimer,FSFUL,FSFULLR,FSFULLRSD,FSFULLRWD,FSL-1.1-ALv2,FSL-1.1-MIT,FTL,Fair,Ferguson-Twofish,Frameworx-1.0,FreeBSD-DOC,FreeImage,Furuseth,GCR-docs,GD,GFDL-1.1-invariants-only,GFDL-1.1-invariants-or-later,GFDL-1.1-no-invariants-only,GFDL-1.1-no-invariants-or-later,GFDL-1.1-only,GFDL-1.1-or-later,GFDL-1.2-invariants-only,GFDL-1.2-invariants-or-later,GFDL-1.2-no-invariants-only,GFDL-1.2-no-invariants-or-later,GFDL-1.2-only,GFDL-1.2-or-later,GFDL-1.3-invariants-only,GFDL-1.3-invariants-or-later,GFDL-1.3-no-invariants-only,GFDL-1.3-no-invariants-or-later,GFDL-1.3-only,GFDL-1.3-or-later,GL2PS,GLWTPL,GPL-1.0-only,GPL-1.0-or-later,GPL-2.0-only,GPL-2.0-or-later,GPL-3.0-only,GPL-3.0-or-later,Game-Programming-Gems,Giftware,Glide,Glulxe,Graphics-Gems,Gutmann,HDF5,HIDAPI,HP-1986,HP-1989,HPND,HPND-DEC,HPND-Fenneberg-Livingston,HPND-INRIA-IMAG,HPND-Intel,HPND-Kevlin-Henney,HPND-MIT-disclaimer,HPND-Markus-Kuhn,HPND-Netrek,HPND-Pbmplus,HPND-SMC,HPND-UC,HPND-UC-export-US,HPND-doc,HPND-doc-sell,HPND-export-US,HPND-export-US-acknowledgement,HPND-export-US-modify,HPND-export2-US,HPND-merchantability-variant,HPND-sell-MIT-disclaimer-xserver,HPND-sell-regexpr,HPND-sell-variant,HPND-sell-variant-MIT-disclaimer,HPND-sell-variant-MIT-disclaimer-rev,HPND-sell-variant-critical-systems,HTMLTIDY,HaskellReport,Hippocratic-2.1,IBM-pibs,ICU,IEC-Code-Components-EULA,IJG,IJG-short,IPA,IPL-1.0,ISC,ISC-Veillard,ISO-permission,ImageMagick,Imlib2,Info-ZIP,Inner-Net-2.0,InnoSetup,Intel,Intel-ACPI,Interbase-1.0,JPL-image,JPNIC,JSON,Jam,JasPer-2.0,Kastrup,Kazlib,Knuth-CTAN,LAL-1.2,LAL-1.3,LGPL-2.0-only,LGPL-2.0-or-later,LGPL-2.1-only,LGPL-2.1-or-later,LGPL-3.0-only,LGPL-3.0-or-later,LGPLLR,LOOP,LPD-document,LPL-1.0,LPL-1.02,LPPL-1.0,LPPL-1.1,LPPL-1.2,LPPL-1.3a,LPPL-1.3c,LZMA-SDK-9.11-to-9.20,LZMA-SDK-9.22,Latex2e,Latex2e-translated-notice,Leptonica,LiLiQ-P-1.1,LiLiQ-R-1.1,LiLiQ-Rplus-1.1,Libpng,Linux-OpenIB,Linux-man-pages-1-para,Linux-man-pages-copyleft,Linux-man-pages-copyleft-2-para,Linux-man-pages-copyleft-var,Lucida-Bitmap-Fonts,MIPS,MIT,MIT-0,MIT-CMU,MIT-Click,MIT-Festival,MIT-Khronos-old,MIT-Modern-Variant,MIT-STK,MIT-Wu,MIT-advertising,MIT-enna,MIT-feh,MIT-open-group,MIT-testregex,MITNFA,MMIXware,MMPL-1.0.1,MPEG-SSG,MPL-1.0,MPL-1.1,MPL-2.0,MPL-2.0-no-copyleft-exception,MS-LPL,MS-PL,MS-RL,MTLL,Mackerras-3-Clause,Mackerras-3-Clause-acknowledgment,MakeIndex,Martin-Birgmeier,McPhee-slideshow,Minpack,MirOS,Motosoto,MulanPSL-1.0,MulanPSL-2.0,Multics,Mup,NAIST-2003,NASA-1.3,NBPL-1.0,NCBI-PD,NCGL-UK-2.0,NCL,NCSA,NGPL,NICTA-1.0,NIST-PD,NIST-PD-TNT,NIST-PD-fallback,NIST-Software,NLOD-1.0,NLOD-2.0,NLPL,NOSL,NPL-1.0,NPL-1.1,NPOSL-3.0,NRL,NTIA-PD,NTP,NTP-0,Naumen,NetCDF,Newsletr,Nokia,Noweb,O-UDA-1.0,OAR,OCCT-PL,OCLC-2.0,ODC-By-1.0,ODbL-1.0,OFFIS,OFL-1.0,OFL-1.0-RFN,OFL-1.0-no-RFN,OFL-1.1,OFL-1.1-RFN,OFL-1.1-no-RFN,OGC-1.0,OGDL-Taiwan-1.0,OGL-Canada-2.0,OGL-UK-1.0,OGL-UK-2.0,OGL-UK-3.0,OGTSL,OLDAP-1.1,OLDAP-1.2,OLDAP-1.3,OLDAP-1.4,OLDAP-2.0,OLDAP-2.0.1,OLDAP-2.1,OLDAP-2.2,OLDAP-2.2.1,OLDAP-2.2.2,OLDAP-2.3,OLDAP-2.4,OLDAP-2.5,OLDAP-2.6,OLDAP-2.7,OLDAP-2.8,OLFL-1.3,OML,OPL-1.0,OPL-UK-3.0,OPUBL-1.0,OSC-1.0,OSET-PL-2.1,OSL-1.0,OSL-1.1,OSL-2.0,OSL-2.1,OSL-3.0,OSSP,OpenMDW-1.0,OpenPBS-2.3,OpenSSL,OpenSSL-standalone,OpenVision,PADL,PDDL-1.0,PHP-3.0,PHP-3.01,PPL,PSF-2.0,ParaType-Free-Font-1.3,Parity-6.0.0,Parity-7.0.0,Pixar,Plexus,PolyForm-Noncommercial-1.0.0,PolyForm-Small-Business-1.0.0,PostgreSQL,Python-2.0,Python-2.0.1,QPL-1.0,QPL-1.0-INRIA-2004,Qhull,RHeCos-1.1,RPL-1.1,RPL-1.5,RPSL-1.0,RSA-MD,RSCPL,Rdisc,Ruby,Ruby-pty,SAX-PD,SAX-PD-2.0,SCEA,SGI-B-1.0,SGI-B-1.1,SGI-B-2.0,SGI-OpenGL,SGMLUG-PM,SGP4,SHL-0.5,SHL-0.51,SISSL,SISSL-1.2,SL,SMAIL-GPL,SMLNJ,SMPPL,SNIA,SOFA,SPL-1.0,SSH-OpenSSH,SSH-short,SSLeay-standalone,SSPL-1.0,SUL-1.0,SWL,Saxpath,SchemeReport,Sendmail,Sendmail-8.23,Sendmail-Open-Source-1.1,SimPL-2.0,Sleepycat,Soundex,Spencer-86,Spencer-94,Spencer-99,SugarCRM-1.1.3,Sun-PPP,Sun-PPP-2000,SunPro,Symlinks,TAPR-OHL-1.0,TCL,TCP-wrappers,TGPPL-1.0,TMate,TORQUE-1.1,TOSL,TPDL,TPL-1.0,TTWL,TTYP0,TU-Berlin-1.0,TU-Berlin-2.0,TekHVC,TermReadKey,ThirdEye,TrustedQSL,UCAR,UCL-1.0,UMich-Merit,UPL-1.0,URT-RLE,Ubuntu-font-1.0,UnRAR,Unicode-3.0,Unicode-DFS-2015,Unicode-DFS-2016,Unicode-TOU,UnixCrypt,Unlicense,Unlicense-libtelnet,Unlicense-libwhirlpool,VOSTROM,VSL-1.0,Vim,Vixie-Cron,W3C,W3C-19980720,W3C-20150513,WTFNMFPL,WTFPL,Watcom-1.0,Widget-Workshop,WordNet,Wsuipa,X11,X11-distribute-modifications-variant,X11-no-permit-persons,X11-swapped,XFree86-1.1,XSkat,Xdebug-1.03,Xerox,Xfig,Xnet,YPL-1.0,YPL-1.1,ZPL-1.1,ZPL-2.0,ZPL-2.1,Zed,Zeeff,Zend-2.0,Zimbra-1.3,Zimbra-1.4,Zlib,any-OSI,any-OSI-perl-modules,bcrypt-Solar-Designer,blessing,bzip2-1.0.6,check-cvs,checkmk,copyleft-next-0.3.0,copyleft-next-0.3.1,curl,cve-tou,diffmark,dtoa,dvipdfm,eGenix,etalab-2.0,fwlw,gSOAP-1.3b,generic-xts,gnuplot,gtkbook,hdparm,hyphen-bulgarian,iMatix,jove,libpng-1.6.35,libpng-2.0,libselinux-1.0,libtiff,libutil-David-Nugent,lsof,magaz,mailprio,man2html,metamail,mpi-permissive,mpich2,mplus,ngrep,pkgconf,pnmstitch,psfrag,psutils,python-ldap,radvd,snprintf,softSurfer,ssh-keyscan,swrule,threeparttable,ulem,w3m,wwl,xinetd,xkeyboard-config-Zinoviev,xlock,xpp,xzoom,zlib-acknowledgement`.split(`,`)})),pe=e.t(((e,t)=>{t.exports=`AGPL-1.0,AGPL-3.0,BSD-2-Clause-FreeBSD,BSD-2-Clause-NetBSD,GFDL-1.1,GFDL-1.2,GFDL-1.3,GPL-1.0,GPL-2.0,GPL-2.0-with-GCC-exception,GPL-2.0-with-autoconf-exception,GPL-2.0-with-bison-exception,GPL-2.0-with-classpath-exception,GPL-2.0-with-font-exception,GPL-3.0,GPL-3.0-with-GCC-exception,GPL-3.0-with-autoconf-exception,LGPL-2.0,LGPL-2.1,LGPL-3.0,Net-SNMP,Nunit,StandardML-NJ,bzip2-1.0.5,eCos-2.0,wxWindows`.split(`,`)})),me=e.t(((e,t)=>{t.exports=`389-exception,Asterisk-exception,Autoconf-exception-2.0,Autoconf-exception-3.0,Autoconf-exception-generic,Autoconf-exception-generic-3.0,Autoconf-exception-macro,Bison-exception-1.24,Bison-exception-2.2,Bootloader-exception,Classpath-exception-2.0,CLISP-exception-2.0,cryptsetup-OpenSSL-exception,DigiRule-FOSS-exception,eCos-exception-2.0,Fawkes-Runtime-exception,FLTK-exception,fmt-exception,Font-exception-2.0,freertos-exception-2.0,GCC-exception-2.0,GCC-exception-2.0-note,GCC-exception-3.1,Gmsh-exception,GNAT-exception,GNOME-examples-exception,GNU-compiler-exception,gnu-javamail-exception,GPL-3.0-interface-exception,GPL-3.0-linking-exception,GPL-3.0-linking-source-exception,GPL-CC-1.0,GStreamer-exception-2005,GStreamer-exception-2008,i2p-gpl-java-exception,KiCad-libraries-exception,LGPL-3.0-linking-exception,libpri-OpenH323-exception,Libtool-exception,Linux-syscall-note,LLGPL,LLVM-exception,LZMA-exception,mif-exception,OCaml-LGPL-linking-exception,OCCT-exception-1.0,OpenJDK-assembly-exception-1.0,openvpn-openssl-exception,PS-or-PDF-font-exception-20170817,QPL-1.0-INRIA-2004-exception,Qt-GPL-exception-1.0,Qt-LGPL-exception-1.1,Qwt-exception-1.0,SANE-exception,SHL-2.0,SHL-2.1,stunnel-exception,SWI-exception,Swift-exception,Texinfo-exception,u-boot-exception-2.0,UBDL-exception,Universal-FOSS-exception-1.0,vsftpd-openssl-exception,WxWindows-exception-3.1,x11vnc-openssl-exception`.split(`,`)})),he=e.t(((e,t)=>{var n=[].concat(fe(),pe()),r=me();t.exports=function(e){var t=0;function i(){return t<e.length}function a(n){if(n instanceof RegExp){var r=e.slice(t).match(n);if(r)return t+=r[0].length,r[0]}else if(e.indexOf(n,t)===t)return t+=n.length,n}function o(){a(/[ ]*/)}function s(){for(var n,r=[`WITH`,`AND`,`OR`,`(`,`)`,`:`,`+`],i=0;i<r.length&&(n=a(r[i]),!n);i++);if(n===`+`&&t>1&&e[t-2]===` `)throw Error("Space before `+`");return n&&{type:`OPERATOR`,string:n}}function c(){return a(/[A-Za-z0-9-.]+/)}function l(){var e=c();if(!e)throw Error(`Expected idstring at offset `+t);return e}function u(){if(a(`DocumentRef-`))return{type:`DOCUMENTREF`,string:l()}}function d(){if(a(`LicenseRef-`))return{type:`LICENSEREF`,string:l()}}function f(){var e=t,i=c();if(n.indexOf(i)!==-1)return{type:`LICENSE`,string:i};if(r.indexOf(i)!==-1)return{type:`EXCEPTION`,string:i};t=e}function p(){return s()||u()||d()||f()}for(var m=[];i()&&(o(),i());){var h=p();if(!h)throw Error("Unexpected `"+e[t]+"` at offset "+t);m.push(h)}return m}})),ge=e.t(((e,t)=>{t.exports=function(e){var t=0;function n(){return t<e.length}function r(){return n()?e[t]:null}function i(){if(!n())throw Error();t++}function a(e){var t=r();if(t&&t.type===`OPERATOR`&&e===t.string)return i(),t.string}function o(){if(a(`WITH`)){var e=r();if(e&&e.type===`EXCEPTION`)return i(),e.string;throw Error("Expected exception after `WITH`")}}function s(){var e=t,n=``,o=r();if(o.type===`DOCUMENTREF`&&(i(),n+=`DocumentRef-`+o.string+`:`,!a(`:`)))throw Error("Expected `:` after `DocumentRef-...`");if(o=r(),o.type===`LICENSEREF`)return i(),n+=`LicenseRef-`+o.string,{license:n};t=e}function c(){var e=r();if(e&&e.type===`LICENSE`){i();var t={license:e.string};a(`+`)&&(t.plus=!0);var n=o();return n&&(t.exception=n),t}}function l(){if(a(`(`)){var e=f();if(!a(`)`))throw Error("Expected `)`");return e}}function u(){return l()||s()||c()}function d(e,t){return function n(){var r=t();if(r){if(!a(e))return r;var i=n();if(!i)throw Error(`Expected expression`);return{left:r,conjunction:e.toLowerCase(),right:i}}}}var f=d(`OR`,d(`AND`,u)),p=f();if(!p||n())throw Error(`Syntax error`);return p}})),_e=e.t(((e,t)=>{var n=he(),r=ge();t.exports=function(e){return r(n(e))}})),ve=e.t(((e,t)=>{var n=_e(),r=fe();function i(e){try{return n(e),!0}catch{return!1}}function a(e,t){var n=t[0].length-e[0].length;return n===0?e[0].toUpperCase().localeCompare(t[0].toUpperCase()):n}var o=[[`APGL`,`AGPL`],[`Gpl`,`GPL`],[`GLP`,`GPL`],[`APL`,`Apache`],[`ISD`,`ISC`],[`GLP`,`GPL`],[`IST`,`ISC`],[`Claude`,`Clause`],[` or later`,`+`],[` International`,``],[`GNU`,`GPL`],[`GUN`,`GPL`],[`+`,``],[`GNU GPL`,`GPL`],[`GNU LGPL`,`LGPL`],[`GNU/GPL`,`GPL`],[`GNU GLP`,`GPL`],[`GNU LESSER GENERAL PUBLIC LICENSE`,`LGPL`],[`GNU Lesser General Public License`,`LGPL`],[`GNU LESSER GENERAL PUBLIC LICENSE`,`LGPL-2.1`],[`GNU Lesser General Public License`,`LGPL-2.1`],[`LESSER GENERAL PUBLIC LICENSE`,`LGPL`],[`Lesser General Public License`,`LGPL`],[`LESSER GENERAL PUBLIC LICENSE`,`LGPL-2.1`],[`Lesser General Public License`,`LGPL-2.1`],[`GNU General Public License`,`GPL`],[`Gnu public license`,`GPL`],[`GNU Public License`,`GPL`],[`GNU GENERAL PUBLIC LICENSE`,`GPL`],[`MTI`,`MIT`],[`Mozilla Public License`,`MPL`],[`Universal Permissive License`,`UPL`],[`WTH`,`WTF`],[`WTFGPL`,`WTFPL`],[`-License`,``]].sort(a),s=0,c=1,l=[function(e){return e.toUpperCase()},function(e){return e.trim()},function(e){return e.replace(/\./g,``)},function(e){return e.replace(/\s+/g,``)},function(e){return e.replace(/\s+/g,`-`)},function(e){return e.replace(`v`,`-`)},function(e){return e.replace(/,?\s*(\d)/,`-$1`)},function(e){return e.replace(/,?\s*(\d)/,`-$1.0`)},function(e){return e.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,`-$2`)},function(e){return e.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,`-$2.0`)},function(e){return e[0].toUpperCase()+e.slice(1)},function(e){return e.replace(`/`,`-`)},function(e){return e.replace(/\s*V\s*(\d)/,`-$1`).replace(/(\d)$/,`$1.0`)},function(e){return e.indexOf(`3.0`)===-1?e+`-only`:e+`-or-later`},function(e){return e+`only`},function(e){return e.replace(/(\d)$/,`-$1.0`)},function(e){return e.replace(/(-| )?(\d)$/,`-$2-Clause`)},function(e){return e.replace(/(-| )clause(-| )(\d)/,`-$3-Clause`)},function(e){return e.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,`BSD-3-Clause`)},function(e){return e.replace(/\bSimplified(-| )?BSD((-| )License)?/i,`BSD-2-Clause`)},function(e){return e.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,`BSD-2-Clause-$1BSD`)},function(e){return e.replace(/\bClear(-| )?BSD((-| )License)?/i,`BSD-3-Clause-Clear`)},function(e){return e.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,`BSD-4-Clause`)},function(e){return`CC-`+e},function(e){return`CC-`+e+`-4.0`},function(e){return e.replace(`Attribution`,`BY`).replace(`NonCommercial`,`NC`).replace(`NoDerivatives`,`ND`).replace(/ (\d)/,`-$1`).replace(/ ?International/,``)},function(e){return`CC-`+e.replace(`Attribution`,`BY`).replace(`NonCommercial`,`NC`).replace(`NoDerivatives`,`ND`).replace(/ (\d)/,`-$1`).replace(/ ?International/,``)+`-4.0`}],u=r.map(function(e){var t=/^(.*)-\d+\.\d+$/.exec(e);return t?[t[0],t[1]]:[e,null]}).reduce(function(e,t){var n=t[1];return e[n]=e[n]||[],e[n].push(t[0]),e},{}),d=Object.keys(u).map(function(e){return[e,u[e]]}).filter(function(e){return e[1].length===1&&e[0]!==null&&e[0]!==`APL`}).map(function(e){return[e[0],e[1][0]]});u=void 0;var f=[[`UNLI`,`Unlicense`],[`WTF`,`WTFPL`],[`2 CLAUSE`,`BSD-2-Clause`],[`2-CLAUSE`,`BSD-2-Clause`],[`3 CLAUSE`,`BSD-3-Clause`],[`3-CLAUSE`,`BSD-3-Clause`],[`AFFERO`,`AGPL-3.0-or-later`],[`AGPL`,`AGPL-3.0-or-later`],[`APACHE`,`Apache-2.0`],[`ARTISTIC`,`Artistic-2.0`],[`Affero`,`AGPL-3.0-or-later`],[`BEER`,`Beerware`],[`BOOST`,`BSL-1.0`],[`BSD`,`BSD-2-Clause`],[`CDDL`,`CDDL-1.1`],[`ECLIPSE`,`EPL-1.0`],[`FUCK`,`WTFPL`],[`GNU`,`GPL-3.0-or-later`],[`LGPL`,`LGPL-3.0-or-later`],[`GPLV1`,`GPL-1.0-only`],[`GPL-1`,`GPL-1.0-only`],[`GPLV2`,`GPL-2.0-only`],[`GPL-2`,`GPL-2.0-only`],[`GPL`,`GPL-3.0-or-later`],[`MIT +NO-FALSE-ATTRIBS`,`MITNFA`],[`MIT`,`MIT`],[`MPL`,`MPL-2.0`],[`X11`,`X11`],[`ZLIB`,`Zlib`]].concat(d).sort(a),p=0,m=1,h=function(e){for(var t=0;t<l.length;t++){var n=l[t](e).trim();if(n!==e&&i(n))return n}return null},g=function(e){for(var t=e.toUpperCase(),n=0;n<f.length;n++){var r=f[n];if(t.indexOf(r[p])>-1)return r[m]}return null},_=function(e,t){for(var n=0;n<o.length;n++){var r=o[n],i=r[s];if(e.indexOf(i)>-1){var a=t(e.replace(i,r[c]));if(a!==null)return a}}return null};t.exports=function(e,t){t||={};var n=t.upgrade===void 0?!0:!!t.upgrade;function r(e){return n?v(e):e}if(!(typeof e==`string`&&e.trim().length!==0))throw Error(`Invalid argument. Expected non-empty string.`);if(e=e.trim(),i(e))return r(e);var a=e.replace(/\+$/,``).trim();if(i(a))return r(a);var o=h(e);return o!==null||(o=_(e,function(e){return i(e)?e:h(e)}),o!==null)||(o=g(e),o!==null)||(o=_(e,g),o!==null)?r(o):null};function v(e){return[`GPL-1.0`,`LGPL-1.0`,`AGPL-1.0`,`GPL-2.0`,`LGPL-2.0`,`AGPL-2.0`,`LGPL-2.1`].indexOf(e)===-1?[`GPL-1.0+`,`GPL-2.0+`,`GPL-3.0+`,`LGPL-2.0+`,`LGPL-2.1+`,`LGPL-3.0+`,`AGPL-1.0+`,`AGPL-3.0+`].indexOf(e)===-1?[`GPL-3.0`,`LGPL-3.0`,`AGPL-3.0`].indexOf(e)===-1?e:e+`-or-later`:e.replace(/\+$/,`-or-later`):e+`-only`}})),ye=e.t(((e,t)=>{var n=_e(),r=ve(),i=`license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"`,a=/^SEE LICEN[CS]E IN (.+)$/;function o(e,t){return t.slice(0,e.length)===e}function s(e){if(e.hasOwnProperty(`license`)){var t=e.license;return o(`LicenseRef`,t)||o(`DocumentRef`,t)}else return s(e.left)||s(e.right)}t.exports=function(e){var t;try{t=n(e)}catch{var o;if(e===`UNLICENSED`||e===`UNLICENCED`)return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(o=a.exec(e))return{validForOldPackages:!0,validForNewPackages:!0,inFile:o[1]};var c={validForOldPackages:!1,validForNewPackages:!1,warnings:[i]};if(e.trim().length!==0){var l=r(e);l&&c.warnings.push(`license is similar to the valid expression "`+l+`"`)}return c}return s(t)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[i]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}}})),be=e.t((e=>{var t=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),n=t(e=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.tracing=e.metrics=void 0;var t=require(`node:diagnostics_channel`);e.metrics=(0,t.channel)(`lru-cache:metrics`),e.tracing=(0,t.tracingChannel)(`lru-cache`)}),r=t(e=>{"use strict";Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultPerf=void 0,e.defaultPerf=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date});Object.defineProperty(e,`__esModule`,{value:!0}),e.LRUCache=void 0;var i=n(),a=r(),o=()=>i.metrics.hasSubscribers||i.tracing.hasSubscribers,s=new Set,c=typeof process==`object`&&process?process:{},l=(e,t,n,r)=>{typeof c.emitWarning==`function`?c.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)},u=e=>!s.has(e),d=e=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),f=e=>d(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?p:null:null,p=class extends Array{constructor(e){super(e),this.fill(0)}},m=class e{heap;length;static#e=!1;static create(t){let n=f(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};e.LRUCache=class e{#e;#t;#n;#r;#i;#a;#o;#s;get perf(){return this.#s}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#x,autopurgeTimers:e.#S,sizes:e.#y,keyMap:e.#u,keyList:e.#d,valList:e.#f,next:e.#p,prev:e.#m,get head(){return e.#h},get tail(){return e.#g},free:e.#_,isBackgroundFetch:t=>e.#W(t),backgroundFetch:(t,n,r,i)=>e.#U(t,n,r,i),moveToTail:t=>e.#X(t),indexes:t=>e.#I(t),rindexes:t=>e.#L(t),isStale:t=>e.#j(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#l}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#o}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(t){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:o,updateAgeOnGet:c,updateAgeOnHas:p,allowStale:h,dispose:g,onInsert:_,disposeAfter:v,noDisposeOnSet:y,noUpdateTTL:b,maxSize:ee=0,maxEntrySize:te=0,sizeCalculation:ne,fetchMethod:re,memoMethod:ie,noDeleteOnFetchRejection:ae,noDeleteOnStaleGet:oe,allowStaleOnFetchRejection:se,allowStaleOnFetchAbort:ce,ignoreFetchAbort:le,backgroundFetchSize:ue=1,perf:de}=t;if(this.backgroundFetchSize=ue,de!==void 0&&typeof de?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(this.#s=de??a.defaultPerf,n!==0&&!d(n))throw TypeError(`max option must be a nonnegative integer`);let fe=n?f(n):Array;if(!fe)throw Error(`invalid max value: `+n);if(this.#e=n,this.#t=ee,this.maxEntrySize=te||this.#t,this.sizeCalculation=ne,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(ie!==void 0&&typeof ie!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#o=ie,re!==void 0&&typeof re!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#a=re,this.#w=!!re,this.#u=new Map,this.#d=Array.from({length:n}).fill(void 0),this.#f=Array.from({length:n}).fill(void 0),this.#p=new fe(n),this.#m=new fe(n),this.#h=0,this.#g=0,this.#_=m.create(n),this.#c=0,this.#l=0,typeof g==`function`&&(this.#n=g),typeof _==`function`&&(this.#r=_),typeof v==`function`?(this.#i=v,this.#v=[]):(this.#i=void 0,this.#v=void 0),this.#C=!!this.#n,this.#E=!!this.#r,this.#T=!!this.#i,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!ae,this.allowStaleOnFetchRejection=!!se,this.allowStaleOnFetchAbort=!!ce,this.ignoreFetchAbort=!!le,this.maxEntrySize!==0){if(this.#t!==0&&!d(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!d(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#M()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!oe,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!p,this.ttlResolution=d(i)||i===0?i:1,this.ttlAutopurge=!!o,this.ttl=r||0,this.ttl){if(!d(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#D()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;u(t)&&(s.add(t),l(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#D(){let e=new p(this.#e),t=new p(this.#e);this.#x=e,this.#b=t;let n=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#S=n,this.#A=(n,i,a=this.#s.now())=>{t[n]=i===0?0:a,e[n]=i,r(n,i)},this.#O=n=>{t[n]=e[n]===0?0:this.#s.now(),r(n,e[n])};let r=this.ttlAutopurge?(e,t)=>{if(n?.[e]&&(clearTimeout(n[e]),n[e]=void 0),t&&t!==0&&n){let i=setTimeout(()=>{this.#j(e)?(this.#Z(this.#d[e],`expire`),n[e]=void 0):r(e,o(e))},t+1);i.unref&&i.unref(),n[e]=i}}:()=>{};this.#k=(n,r)=>{if(e[r]){let o=e[r],s=t[r];if(!o||!s)return;n.ttl=o,n.start=s,n.now=i||a(),n.remainingTTL=o-(n.now-s)}};let i=0,a=()=>{let e=this.#s.now();if(this.ttlResolution>0){i=e;let t=setTimeout(()=>i=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=e=>{let t=this.#u.get(e);return t===void 0?0:o(t)};let o=n=>{let r=e[n],o=t[n];return!r||!o?1/0:r-((i||a())-o)};this.#j=n=>{let r=t[n],o=e[n];return!!o&&!!r&&(i||a())-r>o}}#O=()=>{};#k=()=>{};#A=()=>{};#j=()=>!1;#M(){let e=new p(this.#e);this.#l=0,this.#y=e,this.#N=t=>{this.#l-=e[t],e[t]=0},this.#F=(e,t,n,r)=>{if(!d(n)){if(this.#W(t))return this.backgroundFetchSize;if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!d(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`)}return n},this.#P=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#l>n;)this.#B(!0)}this.#l+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#l)}}#N=e=>{};#P=(e,t,n)=>{};#F=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#I({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#g;this.#R(t)&&((e||!this.#j(t))&&(yield t),t!==this.#h);)t=this.#m[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#h;this.#R(t)&&((e||!this.#j(t))&&(yield t),t!==this.#g);)t=this.#p[t]}#R(e){return e!==void 0&&this.#u.get(this.#d[e])===e}*entries(){for(let e of this.#I())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#W(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*rentries(){for(let e of this.#L())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#W(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*keys(){for(let e of this.#I()){let t=this.#d[e];t!==void 0&&!this.#W(this.#f[e])&&(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];t!==void 0&&!this.#W(this.#f[e])&&(yield t)}}*values(){for(let e of this.#I())this.#f[e]!==void 0&&!this.#W(this.#f[e])&&(yield this.#f[e])}*rvalues(){for(let e of this.#L())this.#f[e]!==void 0&&!this.#W(this.#f[e])&&(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#I()){let r=this.#f[n],i=this.#W(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#d[n],this))return this.#J(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#I()){let r=this.#f[n],i=this.#W(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#L()){let r=this.#f[n],i=this.#W(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#j(t)&&(this.#Z(this.#d[t],`expire`),e=!0);return e}info(e){let t=this.#u.get(e);if(t===void 0)return;let n=this.#f[t],r=this.#W(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#x&&this.#b){let e=this.#x[t],n=this.#b[t];e&&n&&(i.ttl=e-(this.#s.now()-n),i.start=Date.now())}return this.#y&&(i.size=this.#y[t]),i}dump(){let e=[];for(let t of this.#I({allowStale:!0})){let n=this.#d[t],r=this.#f[t],i=this.#W(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#x&&this.#b){a.ttl=this.#x[t];let e=this.#s.now()-this.#b[t];a.start=Math.floor(Date.now()-e)}this.#y&&(a.size=this.#y[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=this.#s.now()-e}this.#z(t,n.value,n)}}set(e,t,n={}){let{status:r=i.metrics.hasSubscribers?{}:void 0}=n;n.status=r,r&&(r.op=`set`,r.key=e,t!==void 0&&(r.value=t),r.cache=this);let a=this.#z(e,t,n);return r&&i.metrics.hasSubscribers&&i.metrics.publish(r),a}#z(e,t,n,r){let{ttl:i=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:c}=n,l=this.#W(t);if(t===void 0)return c&&(c.set=`deleted`),this.delete(e),this;let{noUpdateTTL:u=this.noUpdateTTL}=n;c&&!l&&(c.value=t);let d=this.#F(e,t,n.size||0,s,c);if(this.maxEntrySize&&d>this.maxEntrySize)return this.#Z(e,`set`),c&&(c.set=`miss`,c.maxEntrySizeExceeded=!0),this;let f=this.#c===0?void 0:this.#u.get(e);if(f===void 0)f=this.#c===0?this.#g:this.#_.length===0?this.#c===this.#e?this.#B(!1):this.#c:this.#_.pop(),this.#d[f]=e,this.#f[f]=t,this.#u.set(e,f),this.#p[this.#g]=f,this.#m[f]=this.#g,this.#g=f,this.#c++,this.#P(f,d,c),c&&(c.set=`add`),u=!1,this.#E&&!l&&this.#r?.(t,e,`add`);else{this.#X(f);let n=this.#f[f];if(t!==n){if(!o)if(this.#W(n)){n!==r&&n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:i}=n;i!==void 0&&i!==t&&(this.#C&&this.#n?.(i,e,`set`),this.#T&&this.#v?.push([i,e,`set`]))}else this.#C&&this.#n?.(n,e,`set`),this.#T&&this.#v?.push([n,e,`set`]);if(this.#N(f),this.#P(f,d,c),this.#f[f]=t,!l){let r=n&&this.#W(n)?n.__staleWhileFetching:n,i=r===void 0?`add`:t===r?`update`:`replace`;c&&(c.set=i,r!==void 0&&(c.oldValue=r)),this.#E&&this.onInsert?.(t,e,i)}}else l||(c&&(c.set=`update`),this.#E&&this.onInsert?.(t,e,`update`))}if(i!==0&&!this.#x&&this.#D(),this.#x&&(u||this.#A(f,i,a),c&&this.#k(c,f)),!o&&this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#c;){let e=this.#f[this.#h];if(this.#B(!0),this.#W(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}#B(e){let t=this.#h,n=this.#d[t],r=this.#f[t],i=this.#W(r);i&&r.__abortController.abort(Error(`evicted`));let a=i?r.__staleWhileFetching:r;return(this.#C||this.#T)&&a!==void 0&&(this.#C&&this.#n?.(a,n,`evict`),this.#T&&this.#v?.push([a,n,`evict`])),this.#N(t),this.#S?.[t]&&(clearTimeout(this.#S[t]),this.#S[t]=void 0),e&&(this.#d[t]=void 0,this.#f[t]=void 0,this.#_.push(t)),this.#c===1?(this.#h=this.#g=0,this.#_.length=0):this.#h=this.#p[t],this.#u.delete(n),this.#c--,t}has(e,t={}){let{status:n=i.metrics.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`has`,n.key=e,n.cache=this);let r=this.#V(e,t);return i.metrics.hasSubscribers&&i.metrics.publish(n),r}#V(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#u.get(e);if(i!==void 0){let e=this.#f[i];if(this.#W(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#j(i))r&&(r.has=`stale`,this.#k(r,i));else return n&&this.#O(i),r&&(r.has=`hit`,this.#k(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{status:n=o()?{}:void 0}=t;n&&(n.op=`peek`,n.key=e,n.cache=this),t.status=n;let r=this.#H(e,t);return i.metrics.hasSubscribers&&i.metrics.publish(n),r}#H(e,t){let{status:n,allowStale:r=this.allowStale}=t,i=this.#u.get(e);if(i===void 0||!r&&this.#j(i)){n&&(n.peek=i===void 0?`miss`:`stale`);return}let a=this.#f[i],o=this.#W(a)?a.__staleWhileFetching:a;return n&&(o===void 0?n.peek=`miss`:(n.peek=`hit`,n.value=o)),o}#U(e,t,n,r){let i=t===void 0?void 0:this.#f[t];if(this.#W(i))return i;let a=new AbortController,{signal:o}=n;o?.addEventListener(`abort`,()=>a.abort(o.reason),{signal:a.signal});let s={signal:a.signal,options:n,context:r},c=(r,i=!1)=>{let{aborted:o}=a.signal,c=n.ignoreFetchAbort&&r!==void 0,l=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&r!==void 0);if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(a.signal.reason,l);let d=f,p=this.#f[t];return(p===f||p===void 0&&c&&i)&&(r===void 0?d.__staleWhileFetching===void 0?this.#Z(e,`fetch`):this.#f[t]=d.__staleWhileFetching:(n.status&&(n.status.fetchUpdated=!0),this.#z(e,r,s.options,d))),r},l=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e,!1)),u=(r,i)=>{let{aborted:o}=a.signal,s=o&&n.allowStaleOnFetchAbort,c=s||n.allowStaleOnFetchRejection,l=c||n.noDeleteOnFetchRejection,u=f;if(this.#f[t]===f&&(!l||!i&&u.__staleWhileFetching===void 0?this.#Z(e,`fetch`):s||(this.#f[t]=u.__staleWhileFetching)),c)return n.status&&u.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw r},d=(t,r)=>{let o=this.#a?.(e,i,s);a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))}),o&&o instanceof Promise?o.then(e=>t(e===void 0?void 0:e),r):o!==void 0&&t(o)};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(d).then(c,l),p=Object.assign(f,{__abortController:a,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.#z(e,p,{...s.options,status:void 0}),t=this.#u.get(e)):this.#f[t]=p,p}#W(e){if(!this.#w)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=i.tracing.hasSubscribers,{status:r=o()?{}:void 0}=t;t.status=r,r&&t.context&&(r.context=t.context);let a=this.#G(e,t);return r&&n&&(r.trace=!0,i.tracing.tracePromise(()=>a,r).catch(()=>{})),a}async#G(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(g&&(g.op=`fetch`,g.key=e,h&&(g.forceRefresh=!0),g.cache=this),!this.#w)return g&&(g.fetch=`get`),this.#J(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},y=this.#u.get(e);if(y===void 0){g&&(g.fetch=`miss`);let t=this.#U(e,y,v,m);return t.__returned=t}else{let t=this.#f[y];if(this.#W(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#j(y);if(!h&&!i)return g&&(g.fetch=`hit`),this.#X(y),r&&this.#O(y),g&&this.#k(g,y),t;let a=this.#U(e,y,v,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}forceFetch(e,t={}){let n=i.tracing.hasSubscribers,{status:r=o()?{}:void 0}=t;t.status=r,r&&t.context&&(r.context=t.context);let a=this.#K(e,t);return r&&n&&(r.trace=!0,i.tracing.tracePromise(()=>a,r).catch(()=>{})),a}async#K(e,t={}){let n=await this.#G(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let{status:n=i.metrics.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`memo`,n.key=e,t.context&&(n.context=t.context),n.cache=this);let r=this.#q(e,t);return n&&(n.value=r),i.metrics.hasSubscribers&&i.metrics.publish(n),r}#q(e,t={}){let n=this.#o;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,status:i,forceRefresh:a,...o}=t;i&&a&&(i.forceRefresh=!0);let s=this.#J(e,o),c=a||s===void 0;if(i&&(i.memo=c?`miss`:`hit`,c||(i.value=s)),!c)return s;let l=n(e,s,{options:o,context:r});return i&&(i.value=l),this.#z(e,l,o),l}get(e,t={}){let{status:n=i.metrics.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`get`,n.key=e,n.cache=this);let r=this.#J(e,t);return n&&(r!==void 0&&(n.value=r),i.metrics.hasSubscribers&&i.metrics.publish(n)),r}#J(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#u.get(e);if(o===void 0){a&&(a.get=`miss`);return}let s=this.#f[o],c=this.#W(s);return a&&this.#k(a,o),this.#j(o)?c?(a&&(a.get=`stale-fetching`),n&&s.__staleWhileFetching!==void 0?(a&&(a.returnedStale=!0),s.__staleWhileFetching):void 0):(i||this.#Z(e,`expire`),a&&(a.get=`stale`),n?(a&&(a.returnedStale=!0),s):void 0):(a&&(a.get=c?`fetching`:`hit`),this.#X(o),r&&this.#O(o),c?s.__staleWhileFetching:s)}#Y(e,t){this.#m[t]=e,this.#p[e]=t}#X(e){e!==this.#g&&(e===this.#h?this.#h=this.#p[e]:this.#Y(this.#m[e],this.#p[e]),this.#Y(this.#g,e),this.#g=e)}delete(e){return this.#Z(e,`delete`)}#Z(e,t){i.metrics.hasSubscribers&&i.metrics.publish({op:`delete`,delete:t,key:e,cache:this});let n=!1;if(this.#c!==0){let r=this.#u.get(e);if(r!==void 0)if(this.#S?.[r]&&(clearTimeout(this.#S[r]),this.#S[r]=void 0),n=!0,this.#c===1)this.#Q(t);else{this.#N(r);let n=this.#f[r];if(this.#W(n)?n.__abortController.abort(Error(`deleted`)):(this.#C||this.#T)&&(this.#C&&this.#n?.(n,e,t),this.#T&&this.#v?.push([n,e,t])),this.#u.delete(e),this.#d[r]=void 0,this.#f[r]=void 0,r===this.#g)this.#g=this.#m[r];else if(r===this.#h)this.#h=this.#p[r];else{let e=this.#m[r];this.#p[e]=this.#p[r];let t=this.#p[r];this.#m[t]=this.#m[r]}this.#c--,this.#_.push(r)}}if(this.#T&&this.#v?.length){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return n}clear(){return this.#Q(`delete`)}#Q(e){for(let t of this.#L({allowStale:!0})){let n=this.#f[t];if(this.#W(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#d[t];this.#C&&this.#n?.(n,r,e),this.#T&&this.#v?.push([n,r,e])}}if(this.#u.clear(),this.#f.fill(void 0),this.#d.fill(void 0),this.#x&&this.#b){this.#x.fill(0),this.#b.fill(0);for(let e of this.#S??[])e!==void 0&&clearTimeout(e);this.#S?.fill(void 0)}if(this.#y&&this.#y.fill(0),this.#h=0,this.#g=0,this.#_.length=0,this.#l=0,this.#c=0,this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}})),xe=e.t(((e,t)=>{let n=(...e)=>e.every(e=>e)?e.join(``):``,r=e=>e?encodeURIComponent(e):``,i=e=>e.toLowerCase().replace(/^\W+/g,``).replace(/(?<!\W)\W+$/,``).replace(/\//g,``).replace(/\W+/g,`-`),a={sshtemplate:({domain:e,user:t,project:r,committish:i})=>`git@${e}:${t}/${r}.git${n(`#`,i)}`,sshurltemplate:({domain:e,user:t,project:r,committish:i})=>`git+ssh://git@${e}/${t}/${r}.git${n(`#`,i)}`,edittemplate:({domain:e,user:t,project:i,committish:a,editpath:o,path:s})=>`https://${e}/${t}/${i}${n(`/`,o,`/`,r(a||`HEAD`),`/`,s)}`,browsetemplate:({domain:e,user:t,project:i,committish:a,treepath:o})=>`https://${e}/${t}/${i}${n(`/`,o,`/`,r(a))}`,browsetreetemplate:({domain:e,user:t,project:i,committish:a,treepath:o,path:s,fragment:c,hashformat:l})=>`https://${e}/${t}/${i}/${o}/${r(a||`HEAD`)}/${s}${n(`#`,l(c||``))}`,browseblobtemplate:({domain:e,user:t,project:i,committish:a,blobpath:o,path:s,fragment:c,hashformat:l})=>`https://${e}/${t}/${i}/${o}/${r(a||`HEAD`)}/${s}${n(`#`,l(c||``))}`,docstemplate:({domain:e,user:t,project:i,treepath:a,committish:o})=>`https://${e}/${t}/${i}${n(`/`,a,`/`,r(o))}#readme`,httpstemplate:({auth:e,domain:t,user:r,project:i,committish:a})=>`git+https://${n(e,`@`)}${t}/${r}/${i}.git${n(`#`,a)}`,filetemplate:({domain:e,user:t,project:n,committish:i,path:a})=>`https://${e}/${t}/${n}/raw/${r(i||`HEAD`)}/${a}`,shortcuttemplate:({type:e,user:t,project:r,committish:i})=>`${e}:${t}/${r}${n(`#`,i)}`,pathtemplate:({user:e,project:t,committish:r})=>`${e}/${t}${n(`#`,r)}`,bugstemplate:({domain:e,user:t,project:n})=>`https://${e}/${t}/${n}/issues`,hashformat:i},o={};o.github={protocols:[`git:`,`http:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`github.com`,treepath:`tree`,blobpath:`blob`,editpath:`edit`,filetemplate:({auth:e,user:t,project:i,committish:a,path:o})=>`https://${n(e,`@`)}raw.githubusercontent.com/${t}/${i}/${r(a||`HEAD`)}/${o}`,gittemplate:({auth:e,domain:t,user:r,project:i,committish:a})=>`git://${n(e,`@`)}${t}/${r}/${i}.git${n(`#`,a)}`,tarballtemplate:({domain:e,user:t,project:n,committish:i})=>`https://codeload.${e}/${t}/${n}/tar.gz/${r(i||`HEAD`)}`,extract:e=>{let[,t,n,r,i]=e.pathname.split(`/`,5);if(!(r&&r!==`tree`)&&(r||(i=e.hash.slice(1)),n&&n.endsWith(`.git`)&&(n=n.slice(0,-4)),!(!t||!n)))return{user:t,project:n,committish:i}}},o.bitbucket={protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`bitbucket.org`,treepath:`src`,blobpath:`src`,editpath:`?mode=edit`,edittemplate:({domain:e,user:t,project:i,committish:a,treepath:o,path:s,editpath:c})=>`https://${e}/${t}/${i}${n(`/`,o,`/`,r(a||`HEAD`),`/`,s,c)}`,tarballtemplate:({domain:e,user:t,project:n,committish:i})=>`https://${e}/${t}/${n}/get/${r(i||`HEAD`)}.tar.gz`,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(![`get`].includes(r)&&(n&&n.endsWith(`.git`)&&(n=n.slice(0,-4)),!(!t||!n)))return{user:t,project:n,committish:e.hash.slice(1)}}},o.gitlab={protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gitlab.com`,treepath:`tree`,blobpath:`tree`,editpath:`-/edit`,tarballtemplate:({domain:e,user:t,project:n,committish:i})=>`https://${e}/api/v4/projects/${r(t+`/`+n)}/repository/archive.tar.gz?sha=${r(i||`HEAD`)}`,extract:e=>{let t=e.pathname.slice(1);if(t.includes(`/-/`)||t.includes(`/archive.tar.gz`))return;let n=t.split(`/`),r=n.pop();r.endsWith(`.git`)&&(r=r.slice(0,-4));let i=n.join(`/`);if(!(!i||!r))return{user:i,project:r,committish:e.hash.slice(1)}}},o.gist={protocols:[`git:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gist.github.com`,editpath:`edit`,sshtemplate:({domain:e,project:t,committish:r})=>`git@${e}:${t}.git${n(`#`,r)}`,sshurltemplate:({domain:e,project:t,committish:r})=>`git+ssh://git@${e}/${t}.git${n(`#`,r)}`,edittemplate:({domain:e,user:t,project:i,committish:a,editpath:o})=>`https://${e}/${t}/${i}${n(`/`,r(a))}/${o}`,browsetemplate:({domain:e,project:t,committish:i})=>`https://${e}/${t}${n(`/`,r(i))}`,browsetreetemplate:({domain:e,project:t,committish:i,path:a,hashformat:o})=>`https://${e}/${t}${n(`/`,r(i))}${n(`#`,o(a))}`,browseblobtemplate:({domain:e,project:t,committish:i,path:a,hashformat:o})=>`https://${e}/${t}${n(`/`,r(i))}${n(`#`,o(a))}`,docstemplate:({domain:e,project:t,committish:i})=>`https://${e}/${t}${n(`/`,r(i))}`,httpstemplate:({domain:e,project:t,committish:r})=>`git+https://${e}/${t}.git${n(`#`,r)}`,filetemplate:({user:e,project:t,committish:i,path:a})=>`https://gist.githubusercontent.com/${e}/${t}/raw${n(`/`,r(i))}/${a}`,shortcuttemplate:({type:e,project:t,committish:r})=>`${e}:${t}${n(`#`,r)}`,pathtemplate:({project:e,committish:t})=>`${e}${n(`#`,t)}`,bugstemplate:({domain:e,project:t})=>`https://${e}/${t}`,gittemplate:({domain:e,project:t,committish:r})=>`git://${e}/${t}.git${n(`#`,r)}`,tarballtemplate:({project:e,committish:t})=>`https://codeload.github.com/gist/${e}/tar.gz/${r(t||`HEAD`)}`,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(r!==`raw`){if(!n){if(!t)return;n=t,t=null}return n.endsWith(`.git`)&&(n=n.slice(0,-4)),{user:t,project:n,committish:e.hash.slice(1)}}},hashformat:function(e){return e&&`file-`+i(e)}},o.sourcehut={protocols:[`git+ssh:`,`https:`],domain:`git.sr.ht`,treepath:`tree`,blobpath:`tree`,filetemplate:({domain:e,user:t,project:n,committish:i,path:a})=>`https://${e}/${t}/${n}/blob/${r(i)||`HEAD`}/${a}`,httpstemplate:({domain:e,user:t,project:r,committish:i})=>`https://${e}/${t}/${r}${n(`#`,i)}`,tarballtemplate:({domain:e,user:t,project:n,committish:i})=>`https://${e}/${t}/${n}/archive/${r(i)||`HEAD`}.tar.gz`,bugstemplate:()=>null,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(![`archive`].includes(r)&&(n&&n.endsWith(`.git`)&&(n=n.slice(0,-4)),!(!t||!n)))return{user:t,project:n,committish:e.hash.slice(1)}}};for(let[e,t]of Object.entries(o))o[e]=Object.assign({},a,t);t.exports=o})),Se=e.t(((e,t)=>{let n=require(`url`),r=(e,t,n)=>{let r=e.indexOf(n);return e.lastIndexOf(t,r>-1?r:1/0)},i=e=>{try{return new n.URL(e)}catch{}},a=(e,t)=>{let n=e.indexOf(`:`),r=e.slice(0,n+1);if(Object.prototype.hasOwnProperty.call(t,r)||e.substr(n,3)===`://`)return e;let i=e.indexOf(`@`);return i>-1?i>n?`git+ssh://${e}`:e:`${e.slice(0,n+1)}//${e.slice(n+1)}`},o=e=>{let t=r(e,`@`,`#`),n=r(e,`:`,`#`);return n>t&&(e=e.slice(0,n)+`/`+e.slice(n+1)),r(e,`:`,`#`)===-1&&e.indexOf(`//`)===-1&&(e=`git+ssh://${e}`),e};t.exports=(e,t)=>{let n=t?a(e,t):e;return i(n)||i(o(n))}})),Ce=e.t(((e,t)=>{let n=Se(),r=e=>{let t=e.indexOf(`#`),n=e.indexOf(`/`),r=e.indexOf(`/`,n+1),i=e.indexOf(`:`),a=/\s/.exec(e),o=e.indexOf(`@`),s=!a||t>-1&&a.index>t,c=o===-1||t>-1&&o>t,l=i===-1||t>-1&&i>t,u=r===-1||t>-1&&r>t,d=n>0,f=t>-1?e[t-1]!==`/`:!e.endsWith(`/`),p=!e.startsWith(`.`);return s&&d&&f&&p&&c&&l&&u};t.exports=(e,t,{gitHosts:i,protocols:a})=>{if(!e)return;let o=n(r(e)?`github:${e}`:e,a);if(!o)return;let s=i.byShortcut[o.protocol],c=i.byDomain[o.hostname.startsWith(`www.`)?o.hostname.slice(4):o.hostname],l=s||c;if(!l)return;let u=i[s||c],d=null;a[o.protocol]?.auth&&(o.username||o.password)&&(d=`${o.username}${o.password?`:`+o.password:``}`);let f=null,p=null,m=null,h=null;try{if(s){let e=o.pathname.startsWith(`/`)?o.pathname.slice(1):o.pathname,t=e.indexOf(`@`);t>-1&&(e=e.slice(t+1));let n=e.lastIndexOf(`/`);n>-1?(p=decodeURIComponent(e.slice(0,n)),p||=null,m=decodeURIComponent(e.slice(n+1))):m=decodeURIComponent(e),m.endsWith(`.git`)&&(m=m.slice(0,-4)),o.hash&&(f=decodeURIComponent(o.hash.slice(1))),h=`shortcut`}else{if(!u.protocols.includes(o.protocol))return;let e=u.extract(o);if(!e)return;p=e.user&&decodeURIComponent(e.user),m=decodeURIComponent(e.project),f=decodeURIComponent(e.committish),h=a[o.protocol]?.name||o.protocol.slice(0,-1)}}catch(e){if(e instanceof URIError)return;throw e}return[l,p,d,m,f,h,t]}})),we=e.t(((e,t)=>{let{LRUCache:n}=be(),r=xe(),i=Ce(),a=Se(),o=new n({max:1e3});function s(e){try{let{protocol:t,hostname:n,pathname:r}=new URL(e);return n?`${/(?:git\+)http:$/.test(t)?`http:`:`https:`}//${n}${r.replace(/\.git$/,``)}`:null}catch{return null}}var c=class e{constructor(t,n,r,i,a,o,s={}){Object.assign(this,e.#e[t],{type:t,user:n,auth:r,project:i,committish:a,default:o,opts:s})}static#e={byShortcut:{},byDomain:{}};static#t={"git+ssh:":{name:`sshurl`},"ssh:":{name:`sshurl`},"git+https:":{name:`https`,auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(t,n){e.#e[t]=n,e.#e.byDomain[n.domain]=t,e.#e.byShortcut[`${t}:`]=t,e.#t[`${t}:`]={name:t}}static fromUrl(t,n){if(typeof t!=`string`)return;let r=t+JSON.stringify(n||{});if(!o.has(r)){let a=i(t,n,{gitHosts:e.#e,protocols:e.#t});o.set(r,a?new e(...a):void 0)}return o.get(r)}static fromManifest(t,n={}){if(!t||typeof t!=`object`)return;let r=t.repository,i=r&&(typeof r==`string`?r:typeof r==`object`&&typeof r.url==`string`?r.url:null);if(!i)throw Error(`no repository`);let a=i&&e.fromUrl(i.replace(/^git\+/,``),n)||null;if(a)return a;let o=s(i);return e.fromUrl(o,n)||o}static parseUrl(e){return a(e)}#n(e,t){if(typeof e!=`function`)return null;let n={...this,...this.opts,...t};n.path||=``,n.path.startsWith(`/`)&&(n.path=n.path.slice(1)),n.noCommittish&&(n.committish=null);let r=e(n);return n.noGitPlus&&r.startsWith(`git+`)?r.slice(4):r}hash(){return this.committish?`#${this.committish}`:``}ssh(e){return this.#n(this.sshtemplate,e)}sshurl(e){return this.#n(this.sshurltemplate,e)}browse(e,...t){return typeof e==`string`?typeof t[0]==`string`?this.#n(this.browsetreetemplate,{...t[1],fragment:t[0],path:e}):this.#n(this.browsetreetemplate,{...t[0],path:e}):this.#n(this.browsetemplate,e)}browseFile(e,...t){return typeof t[0]==`string`?this.#n(this.browseblobtemplate,{...t[1],fragment:t[0],path:e}):this.#n(this.browseblobtemplate,{...t[0],path:e})}docs(e){return this.#n(this.docstemplate,e)}bugs(e){return this.#n(this.bugstemplate,e)}https(e){return this.#n(this.httpstemplate,e)}git(e){return this.#n(this.gittemplate,e)}shortcut(e){return this.#n(this.shortcuttemplate,e)}path(e){return this.#n(this.pathtemplate,e)}tarball(e){return this.#n(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#n(this.filetemplate,{...t,path:e})}edit(e,t){return this.#n(this.edittemplate,{...t,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&typeof this[this.default]==`function`?this[this.default](e):this.sshurl(e)}};for(let[e,t]of Object.entries(r))c.addHost(e,t);t.exports=c})),Te=e.t(((e,t)=>{t.exports=n;function n(e){if(!e||e===`ERROR: No README data found!`)return;e=e.trim().split(`
`);let t=0;for(;e[t]&&e[t].trim().match(/^(#|$)/);)t++;let n=e.length,r=t+1;for(;r<n&&e[r].trim();)r++;return e.slice(t,r).join(` `).trim()}})),Ee=e.t(((e,t)=>{t.exports={topLevel:{dependancies:`dependencies`,dependecies:`dependencies`,depdenencies:`dependencies`,devEependencies:`devDependencies`,depends:`dependencies`,"dev-dependencies":`devDependencies`,devDependences:`devDependencies`,devDepenencies:`devDependencies`,devdependencies:`devDependencies`,repostitory:`repository`,repo:`repository`,prefereGlobal:`preferGlobal`,hompage:`homepage`,hampage:`homepage`,autohr:`author`,autor:`author`,contributers:`contributors`,publicationConfig:`publishConfig`,script:`scripts`},bugs:{web:`url`,name:`url`},script:{server:`start`,tests:`test`}}})),De=e.t(((e,t)=>{var{URL:n}=require(`node:url`),r=require(`semver/functions/valid.js`),i=require(`semver/functions/clean.js`),a=ye(),o=we(),{isBuiltin:s}=require(`node:module`),c=[`dependencies`,`devDependencies`,`optionalDependencies`],l=Te(),u=Ee(),d=e=>e.includes(`@`)&&e.indexOf(`@`)<e.lastIndexOf(`.`);t.exports={warn:function(){},fixRepositoryField:function(e){if(e.repositories&&(this.warn(`repositories`),e.repository=e.repositories[0]),!e.repository)return this.warn(`missingRepository`);typeof e.repository==`string`&&(e.repository={type:`git`,url:e.repository});var t=e.repository.url||``;if(t){var n=o.fromUrl(t);n&&(t=e.repository.url=n.getDefaultRepresentation()===`shortcut`?n.https():n.toString())}t.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn(`brokenGitUrl`,t)},fixTypos:function(e){Object.keys(u.topLevel).forEach(function(t){Object.prototype.hasOwnProperty.call(e,t)&&this.warn(`typo`,t,u.topLevel[t])},this)},fixScriptsField:function(e){if(e.scripts){if(typeof e.scripts!=`object`){this.warn(`nonObjectScripts`),delete e.scripts;return}Object.keys(e.scripts).forEach(function(t){typeof e.scripts[t]==`string`?u.script[t]&&!e.scripts[u.script[t]]&&this.warn(`typo`,t,u.script[t],`scripts`):(this.warn(`nonStringScript`),delete e.scripts[t])},this)}},fixFilesField:function(e){var t=e.files;t&&!Array.isArray(t)?(this.warn(`nonArrayFiles`),delete e.files):e.files&&=e.files.filter(function(e){return!e||typeof e!=`string`?(this.warn(`invalidFilename`,e),!1):!0},this)},fixBinField:function(e){if(e.bin&&typeof e.bin==`string`){var t={},n;(n=e.name.match(/^@[^/]+[/](.*)$/))?t[n[1]]=e.bin:t[e.name]=e.bin,e.bin=t}},fixManField:function(e){e.man&&typeof e.man==`string`&&(e.man=[e.man])},fixBundleDependenciesField:function(e){var t=`bundledDependencies`,n=`bundleDependencies`;e[t]&&!e[n]&&(e[n]=e[t],delete e[t]),e[n]&&!Array.isArray(e[n])?(this.warn(`nonArrayBundleDependencies`),delete e[n]):e[n]&&(e[n]=e[n].filter(function(t){return!t||typeof t!=`string`?(this.warn(`nonStringBundleDependency`,t),!1):(e.dependencies||={},Object.prototype.hasOwnProperty.call(e.dependencies,t)||(this.warn(`nonDependencyBundleDependency`,t),e.dependencies[t]=`*`),!0)},this))},fixDependencies:function(e){b(e,this.warn),v(e,this.warn),this.fixBundleDependenciesField(e),[`dependencies`,`devDependencies`].forEach(function(t){if(t in e){if(!e[t]||typeof e[t]!=`object`){this.warn(`nonObjectDependencies`,t),delete e[t];return}Object.keys(e[t]).forEach(function(n){var r=e[t][n];typeof r!=`string`&&(this.warn(`nonStringDependency`,n,JSON.stringify(r)),delete e[t][n]);var i=o.fromUrl(e[t][n]);i&&(e[t][n]=i.toString())},this)}},this)},fixModulesField:function(e){e.modules&&(this.warn(`deprecatedModules`),delete e.modules)},fixKeywordsField:function(e){typeof e.keywords==`string`&&(e.keywords=e.keywords.split(/,\s+/)),e.keywords&&!Array.isArray(e.keywords)?(delete e.keywords,this.warn(`nonArrayKeywords`)):e.keywords&&=e.keywords.filter(function(e){return typeof e!=`string`||!e?(this.warn(`nonStringKeyword`),!1):!0},this)},fixVersionField:function(e,t){var n=!t;if(!e.version)return e.version=``,!0;if(!r(e.version,n))throw Error(`Invalid version: "`+e.version+`"`);return e.version=i(e.version,n),!0},fixPeople:function(e){h(e,g),h(e,_)},fixNameField:function(e,t){typeof t==`boolean`?t={strict:t}:t===void 0&&(t={});var n=t.strict;if(!e.name&&!n){e.name=``;return}if(typeof e.name!=`string`)throw Error(`name field must be a string.`);n||(e.name=e.name.trim()),m(e.name,n,t.allowLegacyCase),s(e.name)&&this.warn(`conflictingName`,e.name)},fixDescriptionField:function(e){e.description&&typeof e.description!=`string`&&(this.warn(`nonStringDescription`),delete e.description),e.readme&&!e.description&&(e.description=l(e.readme)),e.description===void 0&&delete e.description,e.description||this.warn(`missingDescription`)},fixReadmeField:function(e){e.readme||=(this.warn(`missingReadme`),`ERROR: No README data found!`)},fixBugsField:function(e){if(!e.bugs&&e.repository&&e.repository.url){var t=o.fromUrl(e.repository.url);t&&t.bugs()&&(e.bugs={url:t.bugs()})}else if(e.bugs){if(typeof e.bugs==`string`)d(e.bugs)?e.bugs={email:e.bugs}:n.canParse(e.bugs)?e.bugs={url:e.bugs}:this.warn(`nonEmailUrlBugsString`);else{ee(e.bugs,this.warn);var r=e.bugs;e.bugs={},r.url&&(n.canParse(r.url)?e.bugs.url=r.url:this.warn(`nonUrlBugsUrlField`)),r.email&&(typeof r.email==`string`&&d(r.email)?e.bugs.email=r.email:this.warn(`nonEmailBugsEmailField`))}!e.bugs.email&&!e.bugs.url&&(delete e.bugs,this.warn(`emptyNormalizedBugs`))}},fixHomepageField:function(e){if(!e.homepage&&e.repository&&e.repository.url){var t=o.fromUrl(e.repository.url);t&&t.docs()&&(e.homepage=t.docs())}if(e.homepage){if(typeof e.homepage!=`string`)return this.warn(`nonUrlHomepage`),delete e.homepage;n.canParse(e.homepage)||(e.homepage=`http://`+e.homepage)}},fixLicenseField:function(e){let t=e.license||e.licence;if(!t)return this.warn(`missingLicense`);if(typeof t!=`string`||t.length<1||t.trim()===``||!a(t).validForNewPackages)return this.warn(`invalidLicense`)}};function f(e){if(e.charAt(0)!==`@`)return!1;var t=e.slice(1).split(`/`);return t.length===2?t[0]&&t[1]&&t[0]===encodeURIComponent(t[0])&&t[1]===encodeURIComponent(t[1]):!1}function p(e){return!e.match(/[/@\s+%:]/)&&e===encodeURIComponent(e)}function m(e,t,n){if(e.charAt(0)===`.`||!(f(e)||p(e))||t&&!n&&e!==e.toLowerCase()||e.toLowerCase()===`node_modules`||e.toLowerCase()===`favicon.ico`)throw Error(`Invalid name: `+JSON.stringify(e))}function h(e,t){return e.author&&=t(e.author),[`maintainers`,`contributors`].forEach(function(n){Array.isArray(e[n])&&(e[n]=e[n].map(t))}),e}function g(e){if(typeof e==`string`)return e;var t=e.name||``,n=e.url||e.web,r=n?` (`+n+`)`:``,i=e.email||e.mail;return t+(i?` <`+i+`>`:``)+r}function _(e){if(typeof e!=`string`)return e;var t=e.match(/^([^(<]+)/),n=e.match(/\(([^()]+)\)/),r=e.match(/<([^<>]+)>/),i={};return t&&t[0].trim()&&(i.name=t[0].trim()),r&&(i.email=r[1]),n&&(i.url=n[1]),i}function v(e){var t=e.optionalDependencies;if(t){var n=e.dependencies||{};Object.keys(t).forEach(function(e){n[e]=t[e]}),e.dependencies=n}}function y(e,t,n){if(!e)return{};if(typeof e==`string`&&(e=e.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(e))return e;n(`deprecatedArrayDependencies`,t);var r={};return e.filter(function(e){return typeof e==`string`}).forEach(function(e){e=e.trim().split(/(:?[@\s><=])/);var t=e.shift(),n=e.join(``);n=n.trim(),n=n.replace(/^@/,``),r[t]=n}),r}function b(e,t){c.forEach(function(n){e[n]&&(e[n]=y(e[n],n,t))})}function ee(e,t){e&&Object.keys(e).forEach(function(n){u.bugs[n]&&(t(`typo`,n,u.bugs[n],`bugs`),e[u.bugs[n]]=e[n],delete e[n])})}})),Oe=e.t(((e,t)=>{t.exports={repositories:`'repositories' (plural) Not supported. Please pick one as the 'repository' field`,missingRepository:`No repository field.`,brokenGitUrl:`Probably broken git url: %s`,nonObjectScripts:`scripts must be an object`,nonStringScript:`script values must be string commands`,nonArrayFiles:`Invalid 'files' member`,invalidFilename:`Invalid filename in 'files' list: %s`,nonArrayBundleDependencies:`Invalid 'bundleDependencies' list. Must be array of package names`,nonStringBundleDependency:`Invalid bundleDependencies member: %s`,nonDependencyBundleDependency:`Non-dependency in bundleDependencies: %s`,nonObjectDependencies:`%s field must be an object`,nonStringDependency:`Invalid dependency: %s %s`,deprecatedArrayDependencies:`specifying %s as array is deprecated`,deprecatedModules:`modules field is deprecated`,nonArrayKeywords:`keywords should be an array of strings`,nonStringKeyword:`keywords should be an array of strings`,conflictingName:`%s is also the name of a node core module.`,nonStringDescription:`'description' field should be a string`,missingDescription:`No description`,missingReadme:`No README data`,missingLicense:`No license field.`,nonEmailUrlBugsString:`Bug string field must be url, email, or {email,url}`,nonUrlBugsUrlField:`bugs.url field must be a string url. Deleted.`,nonEmailBugsEmailField:`bugs.email field must be a string email. Deleted.`,emptyNormalizedBugs:`Normalized value of bugs field is an empty object. Deleted.`,nonUrlHomepage:`homepage field must be a string url. Deleted.`,invalidLicense:`license should be a valid SPDX license expression`,typo:`%s should probably be %s.`}})),ke=e.t(((e,t)=>{var n=require(`util`),r=Oe();t.exports=function(){var e=Array.prototype.slice.call(arguments,0),t=e.shift();if(t===`typo`)return i.apply(null,e);var a=r[t]?r[t]:t+`: '%s'`;return e.unshift(a),n.format.apply(null,e)};function i(e,t,i){return i&&(e=i+`['`+e+`']`,t=i+`['`+t+`']`),n.format(r.typo,e,t)}})),Ae=e.t(((e,t)=>{t.exports=s;var n=De();s.fixer=n;var r=ke(),i=[`name`,`version`,`description`,`repository`,`modules`,`scripts`,`files`,`bin`,`man`,`bugs`,`keywords`,`readme`,`homepage`,`license`],a=[`dependencies`,`people`,`typos`],o=i.map(function(e){return c(e)+`Field`});o=o.concat(a);function s(e,t,i){t===!0&&(t=null,i=!0),i||=!1,(!t||e.private)&&(t=function(){}),e.scripts&&e.scripts.install===`node-gyp rebuild`&&!e.scripts.preinstall&&(e.gypfile=!0),n.warn=function(){t(r.apply(null,arguments))},o.forEach(function(t){n[`fix`+c(t)](e,i)}),e._id=e.name+`@`+e.version}function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}})),je=e.a(Ae(),1);(0,l.promisify)(u.execFile);function Me(e){return e instanceof URL?(0,g.fileURLToPath)(e):e}const Ne=e=>p.default.resolve(Me(e)??`.`,`package.json`),Pe=(e,t)=>{let n=typeof e==`string`?de(e):e;return t&&(0,je.default)(n),n};async function Fe({cwd:e,normalize:t=!0}={}){return Pe(await h.default.readFile(Ne(e),`utf8`),t)}async function Ie(e){let t=await ne(`package.json`,e);if(t)return{packageJson:await Fe({...e,cwd:p.default.dirname(t)}),path:t}}var Le=e.t(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}}));const Re=(e=0)=>t=>`\u001B[${t+e}m`,ze=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,Be=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,x={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(x.modifier);const Ve=Object.keys(x.color),He=Object.keys(x.bgColor);[...Ve,...He];function Ue(){let e=new Map;for(let[t,n]of Object.entries(x)){for(let[t,r]of Object.entries(n))x[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=x[t],e.set(r[0],r[1]);Object.defineProperty(x,t,{value:n,enumerable:!1})}return Object.defineProperty(x,`codes`,{value:e,enumerable:!1}),x.color.close=`\x1B[39m`,x.bgColor.close=`\x1B[49m`,x.color.ansi=Re(),x.color.ansi256=ze(),x.color.ansi16m=Be(),x.bgColor.ansi=Re(10),x.bgColor.ansi256=ze(10),x.bgColor.ansi16m=Be(10),Object.defineProperties(x,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>x.rgbToAnsi256(...x.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>x.ansi256ToAnsi(x.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>x.ansi256ToAnsi(x.hexToAnsi256(e)),enumerable:!1}}),x}const We=Ue();function Ge(e){return t=>t.length>1?`${e} run ${t[0]} -- ${t.slice(1).join(` `)}`:`${e} run ${t[0]}`}const Ke={agent:`yarn {0}`,run:`yarn run {0}`,install:`yarn install {0}`,frozen:`yarn install --frozen-lockfile`,global:`yarn global add {0}`,add:`yarn add {0}`,upgrade:`yarn upgrade {0}`,"upgrade-interactive":`yarn upgrade-interactive {0}`,execute:`npx {0}`,uninstall:`yarn remove {0}`,global_uninstall:`yarn global remove {0}`},qe={agent:`pnpm {0}`,run:`pnpm run {0}`,install:`pnpm i {0}`,frozen:`pnpm i --frozen-lockfile`,global:`pnpm add -g {0}`,add:`pnpm add {0}`,upgrade:`pnpm update {0}`,"upgrade-interactive":`pnpm update -i {0}`,execute:`pnpm dlx {0}`,uninstall:`pnpm remove {0}`,global_uninstall:`pnpm remove --global {0}`},Je={agent:`bun {0}`,run:`bun run {0}`,install:`bun install {0}`,frozen:`bun install --no-save`,global:`bun add -g {0}`,add:`bun add {0}`,upgrade:`bun update {0}`,"upgrade-interactive":`bun update {0}`,execute:`bunx {0}`,uninstall:`bun remove {0}`,global_uninstall:`bun remove -g {0}`},Ye={npm:{agent:`npm {0}`,run:Ge(`npm`),install:`npm i {0}`,frozen:`npm ci`,global:`npm i -g {0}`,add:`npm i {0}`,upgrade:`npm update {0}`,"upgrade-interactive":null,execute:`npx {0}`,uninstall:`npm uninstall {0}`,global_uninstall:`npm uninstall -g {0}`},yarn:Ke,"yarn@berry":{...Ke,frozen:`yarn install --immutable`,upgrade:`yarn up {0}`,"upgrade-interactive":`yarn up -i {0}`,execute:`yarn dlx {0}`,global:`npm i -g {0}`,global_uninstall:`npm uninstall -g {0}`},pnpm:qe,"pnpm@6":{...qe,run:Ge(`pnpm`)},bun:Je},Xe=Object.keys(Ye),Ze={"bun.lockb":`bun`,"pnpm-lock.yaml":`pnpm`,"yarn.lock":`yarn`,"package-lock.json":`npm`,"npm-shrinkwrap.json":`npm`},Qe={bun:`https://bun.sh`,pnpm:`https://pnpm.io/installation`,"pnpm@6":`https://pnpm.io/6.x/installation`,yarn:`https://classic.yarnpkg.com/en/docs/install`,"yarn@berry":`https://yarnpkg.com/getting-started/install`,npm:`https://docs.npmjs.com/cli/v8/configuring-npm/install`};var S=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function C(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}const{hasOwnProperty:$e}=Object.prototype,et=(e,t={})=>{typeof t==`string`&&(t={section:t}),t.align=t.align===!0,t.newline=t.newline===!0,t.sort=t.sort===!0,t.whitespace=t.whitespace===!0||t.align===!0,t.platform=t.platform||typeof process<`u`&&process.platform,t.bracketedArray=t.bracketedArray!==!1;let n=t.platform===`win32`?`\r
`:`
`,r=t.whitespace?` = `:`=`,i=[],a=t.sort?Object.keys(e).sort():Object.keys(e),o=0;t.align&&(o=w(a.filter(t=>e[t]===null||Array.isArray(e[t])||typeof e[t]!=`object`).map(t=>Array.isArray(e[t])?`${t}[]`:t).concat([``]).reduce((e,t)=>w(e).length>=w(t).length?e:t)).length);let s=``,c=t.bracketedArray?`[]`:``;for(let t of a){let a=e[t];if(a&&Array.isArray(a))for(let e of a)s+=w(`${t}${c}`).padEnd(o,` `)+r+w(e)+n;else a&&typeof a==`object`?i.push(t):s+=w(t).padEnd(o,` `)+r+w(a)+n}t.section&&s.length&&(s=`[`+w(t.section)+`]`+(t.newline?n+n:n)+s);for(let r of i){let i=tt(r,`.`).join(`\\.`),a=(t.section?t.section+`.`:``)+i,o=et(e[r],{...t,section:a});s.length&&o.length&&(s+=n),s+=o}return s};function tt(e,t){var n=0,r=0,i=0,a=[];do if(i=e.indexOf(t,n),i!==-1){if(n=i+t.length,i>0&&e[i-1]===`\\`)continue;a.push(e.slice(r,i)),r=i+t.length}while(i!==-1);return a.push(e.slice(r)),a}const nt=(e,t={})=>{t.bracketedArray=t.bracketedArray!==!1;let n=Object.create(null),r=n,i=null,a=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,o=e.split(/[\r\n]+/g),s={};for(let e of o){if(!e||e.match(/^\s*[;#]/)||e.match(/^\s*$/))continue;let o=e.match(a);if(!o)continue;if(o[1]!==void 0){if(i=it(o[1]),i===`__proto__`){r=Object.create(null);continue}r=n[i]=n[i]||Object.create(null);continue}let c=it(o[2]),l;t.bracketedArray?l=c.length>2&&c.slice(-2)===`[]`:(s[c]=(s?.[c]||0)+1,l=s[c]>1);let u=l?c.slice(0,-2):c;if(u===`__proto__`)continue;let d=o[3]?it(o[4]):!0,f=d===`true`||d===`false`||d===`null`?JSON.parse(d):d;l&&($e.call(r,u)?Array.isArray(r[u])||(r[u]=[r[u]]):r[u]=[]),Array.isArray(r[u])?r[u].push(f):r[u]=f}let c=[];for(let e of Object.keys(n)){if(!$e.call(n,e)||typeof n[e]!=`object`||Array.isArray(n[e]))continue;let t=tt(e,`.`);r=n;let i=t.pop(),a=i.replace(/\\\./g,`.`);for(let e of t)e!==`__proto__`&&((!$e.call(r,e)||typeof r[e]!=`object`)&&(r[e]=Object.create(null)),r=r[e]);r===n&&a===i||(r[a]=n[e],c.push(e))}for(let e of c)delete n[e];return n},rt=e=>e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`),w=e=>typeof e!=`string`||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&rt(e)||e!==e.trim()?JSON.stringify(e):e.split(`;`).join(`\\;`).split(`#`).join(`\\#`),it=(e,t)=>{if(e=(e||``).trim(),rt(e)){e.charAt(0)===`'`&&(e=e.slice(1,-1));try{e=JSON.parse(e)}catch{}}else{let t=!1,n=``;for(let r=0,i=e.length;r<i;r++){let i=e.charAt(r);if(t)`\\;#`.indexOf(i)===-1?n+=`\\`+i:n+=i,t=!1;else if(`;#`.indexOf(i)!==-1)break;else i===`\\`?t=!0:n+=i}return t&&(n+=`\\`),n.trim()}return e},at=C({parse:nt,decode:nt,stringify:et,encode:et,safe:w,unsafe:it});var T={exports:{}},ot,st;function ct(){if(st)return ot;st=1,ot=i,i.sync=a;var e=r.default;function t(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function n(e,n,r){return!e.isSymbolicLink()&&!e.isFile()?!1:t(n,r)}function i(t,r,i){e.stat(t,function(e,a){i(e,e?!1:n(a,t,r))})}function a(t,r){return n(e.statSync(t),t,r)}return ot}var lt,ut;function dt(){if(ut)return lt;ut=1,lt=t,t.sync=n;var e=r.default;function t(t,n,r){e.stat(t,function(e,t){r(e,e?!1:i(t,n))})}function n(t,n){return i(e.statSync(t),n)}function i(e,t){return e.isFile()&&a(e,t)}function a(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}return lt}var ft=process.platform===`win32`||S.TESTING_WINDOWS?ct():dt(),pt=mt;mt.sync=ht;function mt(e,t,n){if(typeof t==`function`&&(n=t,t={}),!n){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,r){mt(e,t||{},function(e,t){e?r(e):n(t)})})}ft(e,t||{},function(e,r){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)})}function ht(e,t){try{return ft.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}const E=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,gt=i.default,_t=E?`;`:`:`,vt=pt,yt=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),bt=(e,t)=>{let n=t.colon||_t,r=e.match(/\//)||E&&e.match(/\\/)?[``]:[...E?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(n)],i=E?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,a=E?i.split(n):[``];return E&&e.indexOf(`.`)!==-1&&a[0]!==``&&a.unshift(``),{pathEnv:r,pathExt:a,pathExtExe:i}},xt=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:r,pathExt:i,pathExtExe:a}=bt(e,t),o=[],s=n=>new Promise((i,a)=>{if(n===r.length)return t.all&&o.length?i(o):a(yt(e));let s=r[n],l=/^".*"$/.test(s)?s.slice(1,-1):s,u=gt.join(l,e);i(c(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u,n,0))}),c=(e,n,r)=>new Promise((l,u)=>{if(r===i.length)return l(s(n+1));let d=i[r];vt(e+d,{pathExt:a},(i,a)=>{if(!i&&a)if(t.all)o.push(e+d);else return l(e+d);return l(c(e,n,r+1))})});return n?s(0).then(e=>n(null,e),n):s(0)},St=(e,t)=>{t||={};let{pathEnv:n,pathExt:r,pathExtExe:i}=bt(e,t),a=[];for(let o=0;o<n.length;o++){let s=n[o],c=/^".*"$/.test(s)?s.slice(1,-1):s,l=gt.join(c,e),u=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let e=0;e<r.length;e++){let n=u+r[e];try{if(vt.sync(n,{pathExt:i}))if(t.all)a.push(n);else return n}catch{}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw yt(e)};var Ct=xt;xt.sync=St;var wt={exports:{}};const Tt=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};wt.exports=Tt,wt.exports.default=Tt;var Et=wt.exports;const Dt=i.default,Ot=Ct,kt=Et;function At(e,t){let n=e.options.env||process.env,r=process.cwd(),i=e.options.cwd!=null,a=i&&process.chdir!==void 0&&!process.chdir.disabled;if(a)try{process.chdir(e.options.cwd)}catch{}let o;try{o=Ot.sync(e.command,{path:n[kt({env:n})],pathExt:t?Dt.delimiter:void 0})}catch{}finally{a&&process.chdir(r)}return o&&=Dt.resolve(i?e.options.cwd:``,o),o}function jt(e){return At(e)||At(e,!0)}var Mt=jt,Nt={};const Pt=/([()\][%!^"`<>&|;, *?])/g;function Ft(e){return e=e.replace(Pt,`^$1`),e}function It(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,`$1$1\\"`),e=e.replace(/(\\*)$/,`$1$1`),e=`"${e}"`,e=e.replace(Pt,`^$1`),t&&(e=e.replace(Pt,`^$1`)),e}Nt.command=Ft,Nt.argument=It;const Lt=/^#!(.*)/;var Rt=(e=``)=>{let t=e.match(Lt);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,``).split(` `),i=n.split(`/`).pop();return i===`env`?r:r?`${i} ${r}`:i};const zt=r.default,Bt=Rt;function Vt(e){let t=Buffer.alloc(150),n;try{n=zt.openSync(e,`r`),zt.readSync(n,t,0,150,0),zt.closeSync(n)}catch{}return Bt(t.toString())}var Ht=Vt;const Ut=i.default,Wt=Mt,Gt=Nt,Kt=Ht,qt=process.platform===`win32`,Jt=/\.(?:com|exe)$/i,Yt=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Xt(e){e.file=Wt(e);let t=e.file&&Kt(e.file);return t?(e.args.unshift(e.file),e.command=t,Wt(e)):e.file}function Zt(e){if(!qt)return e;let t=Xt(e),n=!Jt.test(t);if(e.options.forceShell||n){let n=Yt.test(t);e.command=Ut.normalize(e.command),e.command=Gt.command(e.command),e.args=e.args.map(e=>Gt.argument(e,n)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function Qt(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Zt(r)}var $t=Qt;const en=process.platform===`win32`;function tn(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function nn(e,t){if(!en)return;let n=e.emit;e.emit=function(r,i){if(r===`exit`){let r=rn(i,t);if(r)return n.call(e,`error`,r)}return n.apply(e,arguments)}}function rn(e,t){return en&&e===1&&!t.file?tn(t.original,`spawn`):null}function an(e,t){return en&&e===1&&!t.file?tn(t.original,`spawnSync`):null}var on={hookChildProcess:nn,verifyENOENT:rn,verifyENOENTSync:an,notFoundError:tn};const sn=c.default,cn=$t,ln=on;function un(e,t,n){let r=cn(e,t,n),i=sn.spawn(r.command,r.args,r.options);return ln.hookChildProcess(i,r),i}function dn(e,t,n){let r=cn(e,t,n),i=sn.spawnSync(r.command,r.args,r.options);return i.error=i.error||ln.verifyENOENTSync(i.status,r),i}T.exports=un,T.exports.spawn=un,T.exports.sync=dn,T.exports._parse=cn,T.exports._enoent=ln;var fn=T.exports;const pn=C(fn);function mn(e){let t=typeof e==`string`?`
`:10,n=typeof e==`string`?`\r`:13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}function hn(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`}function gn(e={}){let{cwd:t=m.default.cwd(),path:n=m.default.env[hn()],execPath:r=m.default.execPath}=e,i,a=t instanceof URL?g.default.fileURLToPath(t):t,o=p.default.resolve(a),s=[];for(;i!==o;)s.push(p.default.join(o,`node_modules/.bin`)),i=o,o=p.default.resolve(o,`..`);return s.push(p.default.resolve(a,r,`..`)),[...s,n].join(p.default.delimiter)}function _n({env:e=m.default.env,...t}={}){e={...e};let n=hn({env:e});return t.path=e[n],e[n]=gn(t),e}const vn=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!yn(i,a)&&r||Object.defineProperty(e,n,a)},yn=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},bn=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},xn=(e,t)=>`/* Wrapped ${e}*/\n${t}`,Sn=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),Cn=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),wn=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=xn.bind(null,r,t.toString());Object.defineProperty(i,`name`,Cn),Object.defineProperty(e,`toString`,{...Sn,value:i})};function Tn(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))vn(e,t,r,n);return bn(e,t),wn(e,t,r),e}const En=new WeakMap,Dn=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected a function`);let n,r=0,i=e.displayName||e.name||`<anonymous>`,a=function(...o){if(En.set(a,++r),r===1)n=e.apply(this,o),e=null;else if(t.throw===!0)throw Error(`Function \`${i}\` can only be called once`);return n};return Tn(a,e),En.set(a,r),a};Dn.callCount=e=>{if(!En.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return En.get(e)};const On=()=>{let e=jn-An+1;return Array.from({length:e},kn)},kn=(e,t)=>({name:`SIGRT${t+1}`,number:An+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),An=34,jn=64,Mn=[{name:`SIGHUP`,number:1,action:`terminate`,description:`Terminal closed`,standard:`posix`},{name:`SIGINT`,number:2,action:`terminate`,description:`User interruption with CTRL-C`,standard:`ansi`},{name:`SIGQUIT`,number:3,action:`core`,description:`User interruption with CTRL-\\`,standard:`posix`},{name:`SIGILL`,number:4,action:`core`,description:`Invalid machine instruction`,standard:`ansi`},{name:`SIGTRAP`,number:5,action:`core`,description:`Debugger breakpoint`,standard:`posix`},{name:`SIGABRT`,number:6,action:`core`,description:`Aborted`,standard:`ansi`},{name:`SIGIOT`,number:6,action:`core`,description:`Aborted`,standard:`bsd`},{name:`SIGBUS`,number:7,action:`core`,description:`Bus error due to misaligned, non-existing address or paging error`,standard:`bsd`},{name:`SIGEMT`,number:7,action:`terminate`,description:`Command should be emulated but is not implemented`,standard:`other`},{name:`SIGFPE`,number:8,action:`core`,description:`Floating point arithmetic error`,standard:`ansi`},{name:`SIGKILL`,number:9,action:`terminate`,description:`Forced termination`,standard:`posix`,forced:!0},{name:`SIGUSR1`,number:10,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGSEGV`,number:11,action:`core`,description:`Segmentation fault`,standard:`ansi`},{name:`SIGUSR2`,number:12,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGPIPE`,number:13,action:`terminate`,description:`Broken pipe or socket`,standard:`posix`},{name:`SIGALRM`,number:14,action:`terminate`,description:`Timeout or timer`,standard:`posix`},{name:`SIGTERM`,number:15,action:`terminate`,description:`Termination`,standard:`ansi`},{name:`SIGSTKFLT`,number:16,action:`terminate`,description:`Stack is empty or overflowed`,standard:`other`},{name:`SIGCHLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`posix`},{name:`SIGCLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`other`},{name:`SIGCONT`,number:18,action:`unpause`,description:`Unpaused`,standard:`posix`,forced:!0},{name:`SIGSTOP`,number:19,action:`pause`,description:`Paused`,standard:`posix`,forced:!0},{name:`SIGTSTP`,number:20,action:`pause`,description:`Paused using CTRL-Z or "suspend"`,standard:`posix`},{name:`SIGTTIN`,number:21,action:`pause`,description:`Background process cannot read terminal input`,standard:`posix`},{name:`SIGBREAK`,number:21,action:`terminate`,description:`User interruption with CTRL-BREAK`,standard:`other`},{name:`SIGTTOU`,number:22,action:`pause`,description:`Background process cannot write to terminal output`,standard:`posix`},{name:`SIGURG`,number:23,action:`ignore`,description:`Socket received out-of-band data`,standard:`bsd`},{name:`SIGXCPU`,number:24,action:`core`,description:`Process timed out`,standard:`bsd`},{name:`SIGXFSZ`,number:25,action:`core`,description:`File too big`,standard:`bsd`},{name:`SIGVTALRM`,number:26,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGPROF`,number:27,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGWINCH`,number:28,action:`ignore`,description:`Terminal window size changed`,standard:`bsd`},{name:`SIGIO`,number:29,action:`terminate`,description:`I/O is available`,standard:`other`},{name:`SIGPOLL`,number:29,action:`terminate`,description:`Watched event`,standard:`other`},{name:`SIGINFO`,number:29,action:`ignore`,description:`Request for process information`,standard:`other`},{name:`SIGPWR`,number:30,action:`terminate`,description:`Device running out of power`,standard:`systemv`},{name:`SIGSYS`,number:31,action:`core`,description:`Invalid system call`,standard:`other`},{name:`SIGUNUSED`,number:31,action:`terminate`,description:`Invalid system call`,standard:`other`}],Nn=()=>{let e=On();return[...Mn,...e].map(Pn)},Pn=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=f.constants,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}},Fn=()=>{let e=Nn();return Object.fromEntries(e.map(In))},In=({name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o}],Ln=Fn(),Rn=()=>{let e=Nn(),t=Array.from({length:65},(t,n)=>zn(n,e));return Object.assign({},...t)},zn=(e,t)=>{let n=Bn(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:o,forced:s,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:c}}},Bn=(e,t)=>{let n=t.find(({name:t})=>f.constants.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n};Rn();const Vn=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?`was canceled`:n===void 0?r===void 0?a===void 0?`failed`:`failed with exit code ${a}`:`was killed with ${r} (${i})`:`failed with ${n}`,Hn=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:a,command:o,escapedCommand:s,timedOut:c,isCanceled:l,killed:u,parsed:{options:{timeout:d,cwd:f=m.default.cwd()}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;let p=i===void 0?void 0:Ln[i].description,h=`Command ${Vn({timedOut:c,timeout:d,errorCode:r&&r.code,signal:i,signalDescription:p,exitCode:a,isCanceled:l})}: ${o}`,g=Object.prototype.toString.call(r)===`[object Error]`,_=g?`${h}\n${r.message}`:h,v=[_,t,e].filter(Boolean).join(`
`);return g?(r.originalMessage=r.message,r.message=v):r=Error(v),r.shortMessage=_,r.command=o,r.escapedCommand=s,r.exitCode=a,r.signal=i,r.signalDescription=p,r.stdout=e,r.stderr=t,r.cwd=f,n!==void 0&&(r.all=n),`bufferedData`in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!c,r.isCanceled=l,r.killed=u&&!c,r},Un=[`stdin`,`stdout`,`stderr`],Wn=e=>Un.some(t=>e[t]!==void 0),Gn=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return Un.map(t=>e[t]);if(Wn(e))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${Un.map(e=>`\`${e}\``).join(`, `)}`);if(typeof t==`string`)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let n=Math.max(t.length,Un.length);return Array.from({length:n},(e,n)=>t[n])},D=[];D.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&D.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&D.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const Kn=e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,qn=Symbol.for(`signal-exit emitter`),Jn=globalThis,Yn=Object.defineProperty.bind(Object);var Xn=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Jn[qn])return Jn[qn];Yn(Jn,qn,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},Zn=class{};const Qn=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var $n=class extends Zn{onExit(){return()=>{}}load(){}unload(){}},er=class extends Zn{#e=tr.platform===`win32`?`SIGINT`:`SIGHUP`;#t=new Xn;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of D)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:r}=this.#t,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#t.emit(`exit`,null,t),r=t===`SIGHUP`?this.#e:t;n||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!Kn(this.#n))return()=>{};this.#o===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of D)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,D.forEach(e=>{let t=this.#a[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return Kn(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#r;if(e===`exit`&&Kn(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);let r=n.call(this.#n,e,...t);return this.#t.emit(`exit`,this.#n.exitCode,null),r}else return n.call(this.#n,e,...t)}};const tr=globalThis.process,{onExit:nr,load:rr,unload:ir}=Qn(Kn(tr)?new er(tr):new $n),ar=(e,t=`SIGTERM`,n={})=>{let r=e(t);return or(e,t,n,r),r},or=(e,t,n,r)=>{if(!sr(t,n,r))return;let i=lr(n),a=setTimeout(()=>{e(`SIGKILL`)},i);a.unref&&a.unref()},sr=(e,{forceKillAfterTimeout:t},n)=>cr(e)&&t!==!1&&n,cr=e=>e===f.default.constants.signals.SIGTERM||typeof e==`string`&&e.toUpperCase()===`SIGTERM`,lr=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},ur=(e,t)=>{e.kill()&&(t.isCanceled=!0)},dr=(e,t,n)=>{e.kill(t),n(Object.assign(Error(`Timed out`),{timedOut:!0,signal:t}))},fr=(e,{timeout:t,killSignal:n=`SIGTERM`},r)=>{if(t===0||t===void 0)return r;let i,a=new Promise((r,a)=>{i=setTimeout(()=>{dr(e,n,a)},t)}),o=r.finally(()=>{clearTimeout(i)});return Promise.race([a,o])},pr=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},mr=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;let i=nr(()=>{e.kill()});return r.finally(()=>{i()})};function hr(e){return typeof e==`object`&&!!e&&typeof e.pipe==`function`}function gr(e){return hr(e)&&e.writable!==!1&&typeof e._write==`function`&&typeof e._writableState==`object`}const _r=e=>e instanceof u.ChildProcess&&typeof e.then==`function`,vr=(e,t,n)=>{if(typeof n==`string`)return e[t].pipe((0,d.createWriteStream)(n)),e;if(gr(n))return e[t].pipe(n),e;if(!_r(n))throw TypeError(`The second argument must be a string, a stream or an Execa child process.`);if(!gr(n.stdin))throw TypeError(`The target child process's stdin must be available.`);return e[t].pipe(n.stdin),n},yr=e=>{e.stdout!==null&&(e.pipeStdout=vr.bind(void 0,e,`stdout`)),e.stderr!==null&&(e.pipeStderr=vr.bind(void 0,e,`stderr`)),e.all!==void 0&&(e.pipeAll=vr.bind(void 0,e,`all`))},br=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{if(!wr(e))throw Error(`The first argument must be a Readable, a ReadableStream, or an async iterable.`);let l=t();l.length=0;try{for await(let t of e)Sr({convertedChunk:n[Tr(t)](t,l),state:l,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c});return xr({state:l,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,maxBuffer:c}),s(l)}catch(e){throw e.bufferedData=s(l),e}},xr=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&Sr({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},Sr=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){Cr(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&Cr(c,t,i,a),new Dr},Cr=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},wr=e=>typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`,Tr=e=>{let t=typeof e;if(t===`string`)return`string`;if(t!==`object`||e===null)return`others`;if(globalThis.Buffer?.isBuffer(e))return`buffer`;let n=Er.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Er.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:Er}=Object.prototype;var Dr=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const Or=e=>e,kr=()=>void 0,Ar=({contents:e})=>e,jr=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},Mr=e=>e.length;async function Nr(e,t){return br(e,qr,t)}const Pr=()=>({contents:new ArrayBuffer(0)}),Fr=e=>Ir.encode(e),Ir=new TextEncoder,Lr=e=>new Uint8Array(e),Rr=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),zr=(e,t)=>e.slice(0,t),Br=(e,{contents:t,length:n},r)=>{let i=Kr()?Hr(t,r):Vr(t,r);return new Uint8Array(i).set(e,n),i},Vr=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(Ur(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Hr=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:Ur(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},Ur=e=>Wr**Math.ceil(Math.log(e)/Math.log(Wr)),Wr=2,Gr=({contents:e,length:t})=>Kr()?e:e.slice(0,t),Kr=()=>`resize`in ArrayBuffer.prototype,qr={init:Pr,convertChunk:{string:Fr,buffer:Lr,arrayBuffer:Lr,dataView:Rr,typedArray:Rr,others:jr},getSize:Mr,truncateChunk:zr,addChunk:Br,getFinalChunk:kr,finalize:Gr};async function Jr(e,t){if(!(`Buffer`in globalThis))throw Error(`getStreamAsBuffer() is only supported in Node.js`);try{return Yr(await Nr(e,t))}catch(e){throw e.bufferedData!==void 0&&(e.bufferedData=Yr(e.bufferedData)),e}}const Yr=e=>globalThis.Buffer.from(e);async function Xr(e,t){return br(e,$r,t)}const Zr=()=>({contents:``,textDecoder:new TextDecoder}),Qr=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),$r={init:Zr,convertChunk:{string:Or,buffer:Qr,arrayBuffer:Qr,dataView:Qr,typedArray:Qr,others:jr},getSize:Mr,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},finalize:Ar},{PassThrough:ei}=y.default,ti=C(function(){var e=[],t=new ei({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on(`unpipe`,i),Array.prototype.slice.call(arguments).forEach(n),t;function n(r){return Array.isArray(r)?(r.forEach(n),this):(e.push(r),r.once(`end`,i.bind(null,r)),r.once(`error`,t.emit.bind(t,`error`)),r.pipe(t,{end:!1}),this)}function r(){return e.length==0}function i(n){e=e.filter(function(e){return e!==n}),!e.length&&t.readable&&t.end()}}),ni=e=>{if(e!==void 0)throw TypeError("The `input` and `inputFile` options cannot be both set.")},ri=({input:e,inputFile:t})=>typeof t==`string`?(ni(e),(0,d.createReadStream)(t)):e,ii=(e,t)=>{let n=ri(t);n!==void 0&&(hr(n)?n.pipe(e.stdin):e.stdin.end(n))},ai=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=ti();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},oi=async(e,t)=>{if(!(!e||t===void 0)){await(0,v.setTimeout)(0),e.destroy();try{return await t}catch(e){return e.bufferedData}}},si=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t===`utf8`||t===`utf-8`?Xr(e,{maxBuffer:r}):t===null||t===`buffer`?Jr(e,{maxBuffer:r}):ci(e,r,t)},ci=async(e,t,n)=>(await Jr(e,{maxBuffer:t})).toString(n),li=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},o)=>{let s=si(e,{encoding:r,buffer:i,maxBuffer:a}),c=si(t,{encoding:r,buffer:i,maxBuffer:a}),l=si(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([o,s,c,l])}catch(r){return Promise.all([{error:r,signal:r.signal,timedOut:r.timedOut},oi(e,s),oi(t,c),oi(n,l)])}},ui=(async()=>{})().constructor.prototype,di=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(ui,e)]),fi=(e,t)=>{for(let[n,r]of di){let i=typeof t==`function`?(...e)=>Reflect.apply(r.value,t(),e):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},pi=e=>new Promise((t,n)=>{e.on(`exit`,(e,n)=>{t({exitCode:e,signal:n})}),e.on(`error`,e=>{n(e)}),e.stdin&&e.stdin.on(`error`,e=>{n(e)})}),mi=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],hi=/^[\w.-]+$/,gi=e=>typeof e!=`string`||hi.test(e)?e:`"${e.replaceAll(`"`,`\\"`)}"`,_i=(e,t)=>mi(e,t).join(` `),vi=(e,t)=>mi(e,t).map(e=>gi(e)).join(` `),yi=/ +/g,bi=e=>{let t=[];for(let n of e.trim().split(yi)){let e=t.at(-1);e&&e.endsWith(`\\`)?t[t.length-1]=`${e.slice(0,-1)} ${n}`:t.push(n)}return t},xi=(0,l.debuglog)(`execa`).enabled,Si=(e,t)=>String(e).padStart(t,`0`),Ci=()=>{let e=new Date;return`${Si(e.getHours(),2)}:${Si(e.getMinutes(),2)}:${Si(e.getSeconds(),2)}.${Si(e.getMilliseconds(),3)}`},wi=(e,{verbose:t})=>{t&&m.default.stderr.write(`[${Ci()}] ${e}\n`)},Ti=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{let a=t?{...m.default.env,...e}:e;return n?_n({env:a,cwd:r,execPath:i}):a},Ei=(e,t,n={})=>{let r=pn._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||m.default.cwd(),execPath:m.default.execPath,encoding:`utf8`,reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:xi,...n},n.env=Ti(n),n.stdio=Gn(n),m.default.platform===`win32`&&p.default.basename(e,`.exe`)===`cmd`&&t.unshift(`/q`),{file:e,args:t,options:n,parsed:r}},Di=(e,t,n)=>typeof t!=`string`&&!_.Buffer.isBuffer(t)?n===void 0?void 0:``:e.stripFinalNewline?mn(t):t;function Oi(e,t,n){let r=Ei(e,t,n),i=_i(e,t),a=vi(e,t);wi(a,r.options),pr(r.options);let o;try{o=u.default.spawn(r.file,r.args,r.options)}catch(e){let t=new u.default.ChildProcess;return fi(t,Promise.reject(Hn({error:e,stdout:``,stderr:``,all:``,command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}))),t}let s=pi(o),c=fr(o,r.options,s),l=mr(o,r.options,c);o.kill=ar.bind(null,o.kill.bind(o)),o.cancel=ur.bind(null,o,{isCanceled:!1});let d=Dn(async()=>{let[{error:e,exitCode:t,signal:n,timedOut:s},c,u,d]=await li(o,r.options,l),f=Di(r.options,c),p=Di(r.options,u),m=Di(r.options,d);if(e||t!==0||n!==null){let c=Hn({error:e,exitCode:t,signal:n,stdout:f,stderr:p,all:m,command:i,escapedCommand:a,parsed:r,timedOut:s,isCanceled:r.options.signal?r.options.signal.aborted:!1,killed:o.killed});if(!r.options.reject)return c;throw c}return{command:i,escapedCommand:a,exitCode:0,stdout:f,stderr:p,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return ii(o,r.options),o.all=ai(o,r.options),yr(o),fi(o,d),o}function ki(e,t){let[n,...r]=bi(e);return Oi(n,r,t)}var Ai=class{value;next;constructor(e){this.value=e}},ji=class{#e;#t;#n;constructor(){this.clear()}enqueue(e){let t=new Ai(e);this.#e?(this.#t.next=t,this.#t=t):(this.#e=t,this.#t=t),this.#n++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#n--,e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}};function Mi(e){if(!((Number.isInteger(e)||e===1/0)&&e>0))throw TypeError("Expected `concurrency` to be a number from 1 and up");let t=new ji,n=0,r=()=>{n--,t.size>0&&t.dequeue()()},i=async(e,t,i)=>{n++;let a=(async()=>e(...i))();t(a);try{await a}catch{}r()},a=(r,a,o)=>{t.enqueue(i.bind(void 0,r,a,o)),(async()=>{await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()})()},o=(e,...t)=>new Promise(n=>{a(e,n,t)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),o}var Ni=class extends Error{constructor(e){super(),this.value=e}};const Pi=async(e,t)=>t(await e),Fi=async e=>{let t=await Promise.all(e);if(t[1]===!0)throw new Ni(t[0]);return!1};async function Ii(e,t,{concurrency:n=1/0,preserveOrder:r=!0}={}){let i=Mi(n),a=[...e].map(e=>[e,i(Pi,e,t)]),o=Mi(r?1:1/0);try{await Promise.all(a.map(e=>o(Fi,e)))}catch(e){if(e instanceof Ni)return e.value;throw e}}const Li={directory:`isDirectory`,file:`isFile`};function Ri(e){if(!Object.hasOwnProperty.call(Li,e))throw Error(`Invalid type specified: ${e}`)}const zi=(e,t)=>t[Li[e]](),Bi=e=>e instanceof URL?(0,g.fileURLToPath)(e):e;async function Vi(e,{cwd:t=m.default.cwd(),type:n=`file`,allowSymlinks:r=!0,concurrency:i,preserveOrder:a}={}){Ri(n),t=Bi(t);let o=r?d.promises.stat:d.promises.lstat;return Ii(e,async e=>{try{return zi(n,await o(p.default.resolve(t,e)))}catch{return!1}},{concurrency:i,preserveOrder:a})}const Hi=e=>e instanceof URL?(0,g.fileURLToPath)(e):e,Ui=Symbol(`findUpStop`);async function Wi(e,t={}){let n=p.default.resolve(Hi(t.cwd)||``),{root:r}=p.default.parse(n),i=p.default.resolve(n,t.stopAt||r),a=t.limit||1/0,o=[e].flat(),s=async t=>{if(typeof e!=`function`)return Vi(o,t);let n=await e(t.cwd);return typeof n==`string`?Vi([n],t):n},c=[];for(;;){let e=await s({...t,cwd:n});if(e===Ui||(e&&c.push(p.default.resolve(n,e)),n===i||c.length>=a))break;n=p.default.dirname(n)}return c}async function Gi(e,t={}){return(await Wi(e,{...t,limit:1}))[0]}const Ki=process.env.TERM_PROGRAM===`Apple_Terminal`,O={};O.cursorTo=(e,t)=>{if(typeof e!=`number`)throw TypeError("The `x` argument is required");return typeof t==`number`?`\x1B[`+(t+1)+`;`+(e+1)+`H`:`\x1B[`+(e+1)+`G`},O.cursorMove=(e,t)=>{if(typeof e!=`number`)throw TypeError("The `x` argument is required");let n=``;return e<0?n+=`\x1B[`+-e+`D`:e>0&&(n+=`\x1B[`+e+`C`),t<0?n+=`\x1B[`+-t+`A`:t>0&&(n+=`\x1B[`+t+`B`),n},O.cursorUp=(e=1)=>`\x1B[`+e+`A`,O.cursorDown=(e=1)=>`\x1B[`+e+`B`,O.cursorForward=(e=1)=>`\x1B[`+e+`C`,O.cursorBackward=(e=1)=>`\x1B[`+e+`D`,O.cursorLeft=`\x1B[G`,O.cursorSavePosition=Ki?`\x1B7`:`\x1B[s`,O.cursorRestorePosition=Ki?`\x1B8`:`\x1B[u`,O.cursorGetPosition=`\x1B[6n`,O.cursorNextLine=`\x1B[E`,O.cursorPrevLine=`\x1B[F`,O.cursorHide=`\x1B[?25l`,O.cursorShow=`\x1B[?25h`,O.eraseLines=e=>{let t=``;for(let n=0;n<e;n++)t+=O.eraseLine+(n<e-1?O.cursorUp():``);return e&&(t+=O.cursorLeft),t},O.eraseEndLine=`\x1B[K`,O.eraseStartLine=`\x1B[1K`,O.eraseLine=`\x1B[2K`,O.eraseDown=`\x1B[J`,O.eraseUp=`\x1B[1J`,O.eraseScreen=`\x1B[2J`,O.scrollUp=`\x1B[S`,O.scrollDown=`\x1B[T`,O.clearScreen=`\x1Bc`,O.clearTerminal=process.platform===`win32`?`${O.eraseScreen}[0f`:`${O.eraseScreen}[3J[H`,O.beep=`\x07`,O.link=(e,t)=>[`\x1B]`,`8`,`;`,`;`,t,`\x07`,e,`\x1B]`,`8`,`;`,`;`,`\x07`].join(``),O.image=(e,t={})=>{let n=`\x1B]1337;File=inline=1`;return t.width&&(n+=`;width=${t.width}`),t.height&&(n+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(n+=`;preserveAspectRatio=0`),n+`:`+e.toString(`base64`)+`\x07`},O.iTerm={setCwd:(e=process.cwd())=>`]50;CurrentDir=${e}`,annotation:(e,t={})=>{let n=`\x1B]1337;`,r=t.x!==void 0,i=t.y!==void 0;if((r||i)&&!(r&&i&&t.length!==void 0))throw Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,``),n+=t.isHidden?`AddHiddenAnnotation=`:`AddAnnotation=`,t.length>0?n+=(r?[e,t.length,t.x,t.y]:[t.length,e]).join(`|`):n+=e,n+`\x07`}};var qi=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)};const Ji=a.default,Yi=o.default,k=qi,{env:A}=process;let j;k(`no-color`)||k(`no-colors`)||k(`color=false`)||k(`color=never`)?j=0:(k(`color`)||k(`colors`)||k(`color=true`)||k(`color=always`))&&(j=1),`FORCE_COLOR`in A&&(j=A.FORCE_COLOR===`true`?1:A.FORCE_COLOR===`false`?0:A.FORCE_COLOR.length===0?1:Math.min(parseInt(A.FORCE_COLOR,10),3));function Xi(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Zi(e,t){if(j===0)return 0;if(k(`color=16m`)||k(`color=full`)||k(`color=truecolor`))return 3;if(k(`color=256`))return 2;if(e&&!t&&j===void 0)return 0;let n=j||0;if(A.TERM===`dumb`)return n;if(process.platform===`win32`){let e=Ji.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in A)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in A)||A.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in A)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(A.TEAMCITY_VERSION);if(A.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in A){let e=parseInt((A.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(A.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(A.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(A.TERM)||`COLORTERM`in A?1:n}function Qi(e){return Xi(Zi(e,e&&e.isTTY))}const $i={supportsColor:Qi,stdout:Xi(Zi(!0,Yi.isatty(1))),stderr:Xi(Zi(!0,Yi.isatty(2)))},M=qi;function ea(e){if(/^\d{3,4}$/.test(e)){let t=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}let t=(e||``).split(`.`).map(e=>parseInt(e,10));return{major:t[0],minor:t[1],patch:t[2]}}function ta(e){let{env:t}=process;if(`FORCE_HYPERLINK`in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(M(`no-hyperlink`)||M(`no-hyperlinks`)||M(`hyperlink=false`)||M(`hyperlink=never`))return!1;if(M(`hyperlink=true`)||M(`hyperlink=always`))return!0;if(!$i.supportsColor(e)||e&&!e.isTTY||process.platform===`win32`)return!1;if(`NETLIFY`in t)return!0;if(`CI`in t||`TEAMCITY_VERSION`in t)return!1;if(`TERM_PROGRAM`in t){let e=ea(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case`iTerm.app`:return e.major===3?e.minor>=1:e.major>3}}if(`VTE_VERSION`in t){if(t.VTE_VERSION===`0.50.0`)return!1;let e=ea(t.VTE_VERSION);return e.major>0||e.minor>=50}return!1}const na=C({supportsHyperlink:ta,stdout:ta(process.stdout),stderr:ta(process.stderr)});function N(e,t,{target:n=`stdout`,...r}={}){return na[n]?O.link(e,t):r.fallback===!1?e:typeof r.fallback==`function`?r.fallback(e,t):`${e} (\u200B${t}\u200B)`}N.isSupported=na.stdout,N.stderr=(e,t,n={})=>N(e,t,{target:`stderr`,...n}),N.stderr.isSupported=na.stderr;var ra={};let ia,aa,oa,sa,ca=!0;typeof process<`u`&&({FORCE_COLOR:ia,NODE_DISABLE_COLORS:aa,NO_COLOR:oa,TERM:sa}=process.env||{},ca=process.stdout&&process.stdout.isTTY);const P={enabled:!aa&&oa==null&&sa!==`dumb`&&(ia!=null&&ia!==`0`||ca),reset:F(0,0),bold:F(1,22),dim:F(2,22),italic:F(3,23),underline:F(4,24),inverse:F(7,27),hidden:F(8,28),strikethrough:F(9,29),black:F(30,39),red:F(31,39),green:F(32,39),yellow:F(33,39),blue:F(34,39),magenta:F(35,39),cyan:F(36,39),white:F(37,39),gray:F(90,39),grey:F(90,39),bgBlack:F(40,49),bgRed:F(41,49),bgGreen:F(42,49),bgYellow:F(43,49),bgBlue:F(44,49),bgMagenta:F(45,49),bgCyan:F(46,49),bgWhite:F(47,49)};function la(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function ua(e,t){let n={has:e,keys:t};return n.reset=P.reset.bind(n),n.bold=P.bold.bind(n),n.dim=P.dim.bind(n),n.italic=P.italic.bind(n),n.underline=P.underline.bind(n),n.inverse=P.inverse.bind(n),n.hidden=P.hidden.bind(n),n.strikethrough=P.strikethrough.bind(n),n.black=P.black.bind(n),n.red=P.red.bind(n),n.green=P.green.bind(n),n.yellow=P.yellow.bind(n),n.blue=P.blue.bind(n),n.magenta=P.magenta.bind(n),n.cyan=P.cyan.bind(n),n.white=P.white.bind(n),n.gray=P.gray.bind(n),n.grey=P.grey.bind(n),n.bgBlack=P.bgBlack.bind(n),n.bgRed=P.bgRed.bind(n),n.bgGreen=P.bgGreen.bind(n),n.bgYellow=P.bgYellow.bind(n),n.bgBlue=P.bgBlue.bind(n),n.bgMagenta=P.bgMagenta.bind(n),n.bgCyan=P.bgCyan.bind(n),n.bgWhite=P.bgWhite.bind(n),n}function F(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:P.enabled?la(this.keys,t+``):t+``):t===void 0?ua([e],[n]):P.enabled?la([n],t+``):t+``}}var I=P,da=(e,t)=>{if(!(e.meta&&e.name!==`escape`)){if(e.ctrl)return e.name===`a`?`first`:e.name===`c`||e.name===`d`?`abort`:e.name===`e`?`last`:e.name===`g`?`reset`:e.name===`n`?`down`:e.name===`p`?`up`:void 0;if(t){if(e.name===`j`)return`down`;if(e.name===`k`)return`up`}return e.name===`return`||e.name===`enter`?`submit`:e.name===`backspace`?`delete`:e.name===`delete`?`deleteForward`:e.name===`abort`?`abort`:e.name===`escape`?`exit`:e.name===`tab`?`next`:e.name===`pagedown`?`nextPage`:e.name===`pageup`?`prevPage`:e.name===`home`?`home`:e.name===`end`?`end`:e.name===`up`?`up`:e.name===`down`?`down`:e.name===`right`?`right`:e.name===`left`?`left`:!1}},fa=e=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))`].join(`|`),n=new RegExp(t,`g`);return typeof e==`string`?e.replace(n,``):e};const pa={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};var L={cursor:pa,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let n=0;n<e;n++)t+=this.line+(n<e-1?pa.up():``);return e&&(t+=pa.left),t}},beep:`\x07`};const ma=fa,{erase:ha,cursor:ga}=L,_a=e=>[...ma(e)].length;var va=function(e,t){if(!t)return ha.line+ga.to(0);let n=0,r=e.split(/\r?\n/);for(let e of r)n+=1+Math.floor(Math.max(_a(e)-1,0)/t);return ha.lines(n)};const ya={arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,radioOn:`◉`,radioOff:`◯`,tick:`✔`,cross:`✖`,ellipsis:`…`,pointerSmall:`›`,line:`─`,pointer:`❯`},ba={arrowUp:ya.arrowUp,arrowDown:ya.arrowDown,arrowLeft:ya.arrowLeft,arrowRight:ya.arrowRight,radioOn:`(*)`,radioOff:`( )`,tick:`√`,cross:`×`,ellipsis:`...`,pointerSmall:`»`,line:`─`,pointer:`>`};var xa=process.platform===`win32`?ba:ya;const R=I,z=xa,Sa=Object.freeze({password:{scale:1,render:e=>`*`.repeat(e.length)},emoji:{scale:2,render:e=>`😃`.repeat(e.length)},invisible:{scale:0,render:e=>``},default:{scale:1,render:e=>`${e}`}}),Ca=e=>Sa[e]||Sa.default,wa=Object.freeze({aborted:R.red(z.cross),done:R.green(z.tick),exited:R.yellow(z.cross),default:R.cyan(`?`)});var Ta={styles:Sa,render:Ca,symbols:wa,symbol:(e,t,n)=>t?wa.aborted:n?wa.exited:e?wa.done:wa.default,delimiter:e=>R.gray(e?z.ellipsis:z.pointerSmall),item:(e,t)=>R.gray(e?t?z.pointerSmall:`+`:z.line)};const Ea=fa;var B={action:da,clear:va,style:Ta,strip:fa,figures:xa,lines:function(e,t){let n=String(Ea(e)||``).split(/\r?\n/);return t?n.map(e=>Math.ceil(e.length/t)).reduce((e,t)=>e+t):n.length},wrap:(e,t={})=>{let n=Number.isSafeInteger(parseInt(t.margin))?Array(parseInt(t.margin)).fill(` `).join(``):t.margin||``,r=t.width;return(e||``).split(/\r?\n/g).map(e=>e.split(/\s+/g).reduce((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1<r?e[e.length-1]+=` ${t}`:e.push(`${n}${t}`),e),[n]).join(`
`)).join(`
`)},entriesToDisplay:(e,t,n)=>{n||=t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let i=Math.min(r+n,t);return{startIndex:r,endIndex:i}}};const Da=ee.default,{action:Oa}=B,ka=s.default,{beep:Aa,cursor:ja}=L,Ma=I;var V=class extends ka{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>void 0)).bind(this);let t=Da.createInterface({input:this.in,escapeCodeTimeout:50});Da.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let n=[`SelectPrompt`,`MultiselectPrompt`].indexOf(this.constructor.name)>-1,r=(e,t)=>{let r=Oa(t,n);r===!1?this._&&this._(e,t):typeof this[r]==`function`?this[r](t):this.bell()};this.close=()=>{this.out.write(ja.show),this.in.removeListener(`keypress`,r),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?`abort`:this.exited?`exit`:`submit`,this.value),this.closed=!0},this.in.on(`keypress`,r)}fire(){this.emit(`state`,{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Aa)}render(){this.onRender(Ma),this.firstRender&&=!1}};const Na=I,Pa=V,{erase:Fa,cursor:Ia}=L,{style:La,clear:Ra,lines:za,figures:Ba}=B;var Va=class extends Pa{constructor(e={}){super(e),this.transform=La.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||``,this.validator=e.validate||(()=>!0),this.value=``,this.errorMsg=e.error||`Please Enter A Valid Value`,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=Ra(``,this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Na.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value=``,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor+=e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${n}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Ia.down(za(this.outputError,this.out.columns)-1)+Ra(this.outputError,this.out.columns)),this.out.write(Ra(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[La.symbol(this.done,this.aborted),Na.bold(this.msg),La.delimiter(this.done),this.red?Na.red(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,t,n)=>e+`\n${n?` `:Ba.pointerSmall} ${Na.red().italic(t)}`,``)),this.out.write(Fa.line+Ia.to(0)+this.outputText+Ia.save+this.outputError+Ia.restore+Ia.move(this.cursorOffset,0)))}};const H=I,Ha=V,{style:Ua,clear:Wa,figures:Ga,wrap:Ka,entriesToDisplay:qa}=B,{cursor:Ja}=L;var Ya=class extends Ha{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||`- Use arrow-keys. Return to submit.`,this.warn=e.warn||`- This option is disabled`,this.cursor=e.initial||0,this.choices=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Wa(``,this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===` `)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Ja.hide):this.out.write(Wa(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=qa(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[Ua.symbol(this.done,this.aborted),H.bold(this.msg),Ua.delimiter(!1),this.done?this.selection.title:this.selection.disabled?H.yellow(this.warn):H.gray(this.hint)].join(` `),!this.done){this.outputText+=`
`;for(let n=e;n<t;n++){let r,i,a=``,o=this.choices[n];i=n===e&&e>0?Ga.arrowUp:n===t-1&&t<this.choices.length?Ga.arrowDown:` `,o.disabled?(r=this.cursor===n?H.gray().underline(o.title):H.strikethrough().gray(o.title),i=(this.cursor===n?H.bold().gray(Ga.pointer)+` `:` `)+i):(r=this.cursor===n?H.cyan().underline(o.title):o.title,i=(this.cursor===n?H.cyan(Ga.pointer)+` `:` `)+i,o.description&&this.cursor===n&&(a=` - ${o.description}`,(i.length+r.length+a.length>=this.out.columns||o.description.split(/\r?\n/).length>1)&&(a=`
`+Ka(o.description,{margin:3,width:this.out.columns})))),this.outputText+=`${i} ${r}${H.gray(a)}\n`}}this.out.write(this.outputText)}};const Xa=I,Za=V,{style:Qa,clear:$a}=B,{cursor:eo,erase:to}=L;var no=class extends Za{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||`on`,this.inactive=e.inactive||`off`,this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===` `)this.value=!this.value;else if(e===`1`)this.value=!0;else if(e===`0`)this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(eo.hide):this.out.write($a(this.outputText,this.out.columns)),super.render(),this.outputText=[Qa.symbol(this.done,this.aborted),Xa.bold(this.msg),Qa.delimiter(this.done),this.value?this.inactive:Xa.cyan().underline(this.inactive),Xa.gray(`/`),this.value?Xa.cyan().underline(this.active):this.active].join(` `),this.out.write(to.line+eo.to(0)+this.outputText))}},U=class e{constructor({token:e,date:t,parts:n,locales:r}){this.token=e,this.date=t||new Date,this.parts=n||[this],this.locales=r||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((n,r)=>r>t&&n instanceof e)}setTo(e){}prev(){let t=[].concat(this.parts).reverse(),n=t.indexOf(this);return t.find((t,r)=>r>n&&t instanceof e)}toString(){return String(this.date)}};const ro=U;var io=class extends ro{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?`pm`:`am`;return/\A/.test(this.token)?e.toUpperCase():e}};const ao=U,oo=e=>(e%=10,e===1?`st`:e===2?`nd`:e===3?`rd`:`th`);var so=class extends ao{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token===`DD`?String(e).padStart(2,`0`):this.token===`Do`?e+oo(e):this.token===`d`?t+1:this.token===`ddd`?this.locales.weekdaysShort[t]:this.token===`dddd`?this.locales.weekdays[t]:e}};const co=U;var lo=class extends co{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,`0`):e}};const uo=U;var fo=class extends uo{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,`0`).substr(0,this.token.length)}};const po=U;var mo=class extends po{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,`0`):e}};const ho=U;var go=class extends ho{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,`0`):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};const _o=U;var vo=class extends _o{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,`0`):e}};const yo=U;var bo={DatePart:U,Meridiem:io,Day:so,Hours:lo,Milliseconds:fo,Minutes:mo,Month:go,Seconds:vo,Year:class extends yo{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,`0`);return this.token.length===2?e.substr(-2):e}}};const xo=I,So=V,{style:Co,clear:wo,figures:To}=B,{erase:Eo,cursor:Do}=L,{DatePart:Oo,Meridiem:ko,Day:Ao,Hours:jo,Milliseconds:Mo,Minutes:No,Month:Po,Seconds:Fo,Year:Io}=bo,Lo=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Ro={1:({token:e})=>e.replace(/\\(.)/g,`$1`),2:e=>new Ao(e),3:e=>new Po(e),4:e=>new Io(e),5:e=>new ko(e),6:e=>new jo(e),7:e=>new No(e),8:e=>new Fo(e),9:e=>new Mo(e)},zo={months:`January,February,March,April,May,June,July,August,September,October,November,December`.split(`,`),monthsShort:`Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec`.split(`,`),weekdays:`Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday`.split(`,`),weekdaysShort:`Sun,Mon,Tue,Wed,Thu,Fri,Sat`.split(`,`)};var Bo=class extends So{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed=``,this.locales=Object.assign(zo,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||`Please Enter A Valid Value`,this.validator=e.validate||(()=>!0),this.mask=e.mask||`YYYY-MM-DD HH:mm:ss`,this.clear=wo(``,this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=Lo.exec(e);){let e=t.shift(),n=t.findIndex(e=>e!=null);this.parts.push(n in Ro?Ro[n]({token:t[n]||e,date:this.date,parts:this.parts,locales:this.locales}):t[n]||e)}let n=this.parts.reduce((e,t)=>(typeof t==`string`&&typeof e[e.length-1]==`string`?e[e.length-1]+=t:e.push(t),e),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed=``,this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Oo)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color=`red`,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){this.typed=``,this.parts[this.cursor].up(),this.render()}down(){this.typed=``,this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(e=>e instanceof Oo)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Do.hide):this.out.write(wo(this.outputText,this.out.columns)),super.render(),this.outputText=[Co.symbol(this.done,this.aborted),xo.bold(this.msg),Co.delimiter(!1),this.parts.reduce((e,t,n)=>e.concat(n===this.cursor&&!this.done?xo.cyan().underline(t.toString()):t),[]).join(``)].join(` `),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((e,t,n)=>e+`\n${n?` `:To.pointerSmall} ${xo.red().italic(t)}`,``)),this.out.write(Eo.line+Do.to(0)+this.outputText))}};const Vo=I,Ho=V,{cursor:Uo,erase:Wo}=L,{style:Go,figures:Ko,clear:qo,lines:Jo}=B,Yo=/[0-9]/,Xo=e=>e!==void 0,Zo=(e,t)=>{let n=10**t;return Math.round(e*n)/n};var Qo=class extends Ho{constructor(e={}){super(e),this.transform=Go.render(e.style),this.msg=e.message,this.initial=Xo(e.initial)?e.initial:``,this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Xo(e.min)?e.min:-1/0,this.max=Xo(e.max)?e.max:1/0,this.errorMsg=e.error||`Please Enter A Valid Value`,this.validator=e.validate||(()=>!0),this.color=`cyan`,this.value=``,this.typed=``,this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Vo.gray(this.transform.render(`${this.initial}`)),this._value=``):(this.placeholder=!1,this.rendered=this.transform.render(`${Zo(e,this.round)}`),this._value=Zo(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e===`-`||e===`.`&&this.float||Yo.test(e)}reset(){this.typed=``,this.value=``,this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e===``?this.initial:e,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color=`red`,this.fire(),this.render();return}let e=this.value;this.value=e===``?this.initial:e,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){if(this.typed=``,this.value===``&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color=`cyan`,this.fire(),this.render()}down(){if(this.typed=``,this.value===``&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color=`cyan`,this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||``,this.value!==``&&this.value<this.min&&(this.value=this.min),this.color=`cyan`,this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=``),this.typed+=e,this.lastHit=n,this.color=`cyan`,e===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Uo.down(Jo(this.outputError,this.out.columns)-1)+qo(this.outputError,this.out.columns)),this.out.write(qo(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[Go.symbol(this.done,this.aborted),Vo.bold(this.msg),Go.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Vo[this.color]().underline(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,t,n)=>e+`\n${n?` `:Ko.pointerSmall} ${Vo.red().italic(t)}`,``)),this.out.write(Wo.line+Uo.to(0)+this.outputText+Uo.save+this.outputError+Uo.restore))}};const W=I,{cursor:$o}=L,es=V,{clear:ts,figures:G,style:ns,wrap:rs,entriesToDisplay:is}=B;var as=class extends es{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||``,this.warn=e.warn||`- This option is disabled -`,this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=ts(``,this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){let e=this.value.filter(e=>e.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===` `)this.handleSpaceToggle();else if(e===`a`)this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
Instructions:
${G.arrowUp}/${G.arrowDown}: Highlight option\n ${G.arrowLeft}/${G.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===void 0?` a: Toggle all
`:``)+` enter/return: Complete answer`:``}renderOption(e,t,n,r){let i=(t.selected?W.green(G.radioOn):G.radioOff)+` `+r+` `,a,o;return t.disabled?a=e===n?W.gray().underline(t.title):W.strikethrough().gray(t.title):(a=e===n?W.cyan().underline(t.title):t.title,e===n&&t.description&&(o=` - ${t.description}`,(i.length+a.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o=`
`+rs(t.description,{margin:i.length,width:this.out.columns})))),i+a+W.gray(o||``)}paginateOptions(e){if(e.length===0)return W.red(`No matches for this query.`);let{startIndex:t,endIndex:n}=is(this.cursor,e.length,this.optionsPerPage),r,i=[];for(let a=t;a<n;a++)r=a===t&&t>0?G.arrowUp:a===n-1&&n<e.length?G.arrowDown:` `,i.push(this.renderOption(this.cursor,e[a],a,r));return`
`+i.join(`
`)}renderOptions(e){return this.done?``:this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[W.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(W.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write($o.hide),super.render();let e=[ns.symbol(this.done,this.aborted),W.bold(this.msg),ns.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=W.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=ts(e,this.out.columns)}};const os=I,ss=V,{erase:cs,cursor:ls}=L,{style:us,clear:ds,figures:fs,wrap:ps,entriesToDisplay:ms}=B,hs=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),gs=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),_s=(e,t)=>{let n=e.findIndex(e=>e.value===t||e.title===t);return n>-1?n:void 0};var vs=class extends ss{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial==`number`?e.initial:_s(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||`no matches found`},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input=``,this.limit=e.limit||10,this.cursor=0,this.transform=us.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=ds(``,this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb==`number`?e=this.choices[this._fb]:typeof this._fb==`string`&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=hs(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),n=await t;if(this.completing!==t)return;this.suggestions=n.map((e,t,n)=>({title:gs(n,t),value:hs(n,t),description:e.description})),this.completing=!1;let r=Math.max(n.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}reset(){this.input=``,this.complete(()=>{this.moveSelect(this.initial===void 0?0:this.initial),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(e,t){let n=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${n}${e}${r}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),--this.cursor,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();--this.cursor,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor+=1,this.render()}renderOption(e,t,n,r){let i,a=n?fs.arrowUp:r?fs.arrowDown:` `,o=t?os.cyan().underline(e.title):e.title;return a=(t?os.cyan(fs.pointer)+` `:` `)+a,e.description&&(i=` - ${e.description}`,(a.length+o.length+i.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(i=`
`+ps(e.description,{margin:3,width:this.out.columns}))),a+` `+o+os.gray(i||``)}render(){if(this.closed)return;this.firstRender?this.out.write(ls.hide):this.out.write(ds(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=ms(this.select,this.choices.length,this.limit);if(this.outputText=[us.symbol(this.done,this.aborted,this.exited),os.bold(this.msg),us.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(` `),!this.done){let n=this.suggestions.slice(e,t).map((n,r)=>this.renderOption(n,this.select===r+e,r===0&&e>0,r+e===t-1&&t<this.choices.length)).join(`
`);this.outputText+=`
`+(n||os.gray(this.fallback.title))}this.out.write(cs.line+ls.to(0)+this.outputText)}};const K=I,{cursor:ys}=L,bs=as,{clear:xs,style:Ss,figures:q}=B;var Cs=class extends bs{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue=``,this.clear=xs(``,this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(e=>this.inputValue?!!(typeof e.title==`string`&&e.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof e.value==`string`&&e.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(t=>t===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}handleInputChange(e){this.inputValue+=e,this.updateFilteredOptions()}_(e,t){e===` `?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
Instructions:
${q.arrowUp}/${q.arrowDown}: Highlight option
${q.arrowLeft}/${q.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer
`:``}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:K.gray(`Enter something to filter`)}\n`}renderOption(e,t,n,r){let i=(t.selected?K.green(q.radioOn):q.radioOff)+` `+r+` `,a;return a=t.disabled?e===n?K.gray().underline(t.title):K.strikethrough().gray(t.title):e===n?K.cyan().underline(t.title):t.title,i+a}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[K.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(K.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(ys.hide),super.render();let e=[Ss.symbol(this.done,this.aborted),K.bold(this.msg),Ss.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=K.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=xs(e,this.out.columns)}};const ws=I,Ts=V,{style:Es,clear:Ds}=B,{erase:Os,cursor:ks}=L;var As={TextPrompt:Va,SelectPrompt:Ya,TogglePrompt:no,DatePrompt:Bo,NumberPrompt:Qo,MultiselectPrompt:as,AutocompletePrompt:vs,AutocompleteMultiselectPrompt:Cs,ConfirmPrompt:class extends Ts{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||`yes`,this.yesOption=e.yesOption||`(Y/n)`,this.noMsg=e.no||`no`,this.noOption=e.noOption||`(y/N)`,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(e,t){return e.toLowerCase()===`y`?(this.value=!0,this.submit()):e.toLowerCase()===`n`?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(ks.hide):this.out.write(Ds(this.outputText,this.out.columns)),super.render(),this.outputText=[Es.symbol(this.done,this.aborted),ws.bold(this.msg),Es.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:ws.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(Os.line+ks.to(0)+this.outputText))}}};(function(e){let t=e,n=As,r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};let a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))})(ra);const js=ra,Ms=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],Ns=()=>{};async function J(e=[],{onSubmit:t=Ns,onCancel:n=Ns}={}){let r={},i=J._override||{};e=[].concat(e);let a,o,s,c,l,u,d=async(e,t,n=!1)=>{if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?await e.format(t,r):t};for(o of e)if({name:c,type:l}=o,typeof l==`function`&&(l=await l(a,{...r},o),o.type=l),l){for(let e in o){if(Ms.includes(e))continue;let t=o[e];o[e]=typeof t==`function`?await t(a,{...r},u):t}if(u=o,typeof o.message!=`string`)throw Error(`prompt message is required`);if({name:c,type:l}=o,js[l]===void 0)throw Error(`prompt type (${l}) is not defined`);if(i[o.name]!==void 0&&(a=await d(o,i[o.name]),a!==void 0)){r[c]=a;continue}try{a=J._injected?Ps(J._injected,o.initial):await js[l](o),r[c]=a=await d(o,a,!0),s=await t(o,a,r)}catch{s=!await n(o,r)}if(s)return r}return r}function Ps(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function Fs(e){J._injected=(J._injected||[]).concat(e)}function Is(e){J._override=Object.assign({},e)}const Ls=C(Object.assign(J,{prompt:J,prompts:js,inject:Fs,override:Is}));var Rs={},Y={};Object.defineProperty(Y,`__esModule`,{value:!0}),Y.sync=Y.isexe=void 0;const zs=r.default,Bs=b.default;Y.isexe=async(e,t={})=>{let{ignoreErrors:n=!1}=t;try{return Vs(await(0,Bs.stat)(e),t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}},Y.sync=(e,t={})=>{let{ignoreErrors:n=!1}=t;try{return Vs((0,zs.statSync)(e),t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}};const Vs=(e,t)=>e.isFile()&&Hs(e,t),Hs=(e,t)=>{let n=t.uid??process.getuid?.(),r=t.groups??process.getgroups?.()??[],i=t.gid??process.getgid?.()??r[0];if(n===void 0||i===void 0)throw Error(`cannot get uid or gid`);let a=new Set([i,...r]),o=e.mode,s=e.uid,c=e.gid;return!!(o&1||o&8&&a.has(c)||o&64&&s===n||o&72&&n===0)};var X={};Object.defineProperty(X,`__esModule`,{value:!0}),X.sync=X.isexe=void 0;const Us=r.default,Ws=b.default;X.isexe=async(e,t={})=>{let{ignoreErrors:n=!1}=t;try{return Ks(await(0,Ws.stat)(e),e,t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}},X.sync=(e,t={})=>{let{ignoreErrors:n=!1}=t;try{return Ks((0,Us.statSync)(e),e,t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}};const Gs=(e,t)=>{let{pathExt:n=process.env.PATHEXT||``}=t,r=n.split(`;`);if(r.indexOf(``)!==-1)return!0;for(let t=0;t<r.length;t++){let n=r[t].toLowerCase(),i=e.substring(e.length-n.length).toLowerCase();if(n&&i===n)return!0}return!1},Ks=(e,t,n)=>e.isFile()&&Gs(t,n);var qs={};Object.defineProperty(qs,`__esModule`,{value:!0}),(function(e){var t=S&&S.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=S&&S.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=S&&S.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=S&&S.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.sync=e.isexe=e.posix=e.win32=void 0;let a=r(Y);e.posix=a;let o=r(X);e.win32=o,i(qs,e);let s=(process.env._ISEXE_TEST_PLATFORM_||process.platform)===`win32`?o:a;e.isexe=s.isexe,e.sync=s.sync})(Rs);const{isexe:Js,sync:Ys}=Rs,{join:Xs,delimiter:Zs,sep:Qs,posix:$s}=i.default,ec=process.platform===`win32`,tc=new RegExp(`[${$s.sep}${Qs===$s.sep?``:Qs}]`.replace(/(\\)/g,`\\$1`)),nc=RegExp(`^\\.${tc.source}`),rc=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),ic=(e,{path:t=process.env.PATH,pathExt:n=process.env.PATHEXT,delimiter:r=Zs})=>{let i=e.match(tc)?[``]:[...ec?[process.cwd()]:[],...(t||``).split(r)];if(ec){let t=n||[`.EXE`,`.CMD`,`.BAT`,`.COM`].join(r),a=t.split(r).flatMap(e=>[e,e.toLowerCase()]);return e.includes(`.`)&&a[0]!==``&&a.unshift(``),{pathEnv:i,pathExt:a,pathExtExe:t}}return{pathEnv:i,pathExt:[``]}},ac=(e,t)=>{let n=/^".*"$/.test(e)?e.slice(1,-1):e;return(!n&&nc.test(t)?t.slice(0,2):``)+Xs(n,t)},oc=async(e,t={})=>{let{pathEnv:n,pathExt:r,pathExtExe:i}=ic(e,t),a=[];for(let o of n){let n=ac(o,e);for(let e of r){let r=n+e;if(await Js(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;a.push(r)}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw rc(e)},sc=(e,t={})=>{let{pathEnv:n,pathExt:r,pathExtExe:i}=ic(e,t),a=[];for(let o of n){let n=ac(o,e);for(let e of r){let r=n+e;if(Ys(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;a.push(r)}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw rc(e)};var cc=oc;oc.sync=sc;const lc=C(cc);(0,p.join)(f.default.tmpdir(),`antfu-ni`);function uc(e,t){return e.slice().filter(e=>e!==t)}function dc(e){return lc.sync(e,{nothrow:!0})!==null}async function fc({autoInstall:e,programmatic:t,cwd:n}={}){let r=null,i=null,a=await Gi(Object.keys(Ze),{cwd:n}),o;if(o=a?p.default.resolve(a,`../package.json`):await Gi(`package.json`,{cwd:n}),o&&d.default.existsSync(o))try{let e=JSON.parse(d.default.readFileSync(o,`utf8`));if(typeof e.packageManager==`string`){let[n,a]=e.packageManager.replace(/^\^/,``).split(`@`);i=a,n===`yarn`&&Number.parseInt(a)>1?(r=`yarn@berry`,i=`berry`):n===`pnpm`&&Number.parseInt(a)<7?r=`pnpm@6`:n in Ye?r=n:t||console.warn(`[ni] Unknown packageManager:`,e.packageManager)}}catch{}if(!r&&a&&(r=Ze[p.default.basename(a)]),r&&!dc(r.split(`@`)[0])&&!t){if(!e){console.warn(`[ni] Detected ${r} but it doesn't seem to be installed.
`),m.default.env.CI&&m.default.exit(1);let{tryInstall:e}=await Ls({name:`tryInstall`,type:`confirm`,message:`Would you like to globally install ${N(r,Qe[r])}?`});e||m.default.exit(1)}await ki(`npm i -g ${r.split(`@`)[0]}${i?`@${i}`:``}`,{stdio:`inherit`,cwd:n})}return r}const pc=m.default.env.NI_CONFIG_FILE,mc=m.default.platform===`win32`?m.default.env.USERPROFILE:m.default.env.HOME,hc=p.default.join(mc||`~/`,`.nirc`),gc=pc||hc,_c={defaultAgent:`prompt`,globalAgent:`npm`};let vc;async function yc(){if(!vc){vc=Object.assign({},_c,d.default.existsSync(gc)?at.parse(d.default.readFileSync(gc,`utf-8`)):null);let e=await fc({programmatic:!0});e&&(vc.defaultAgent=e)}return vc}async function bc(e){let{defaultAgent:t}=await yc();return t===`prompt`&&(e||m.default.env.CI)?`npm`:t}async function xc(){let{globalAgent:e}=await yc();return e}var Sc=class extends Error{constructor({agent:e,command:t}){super(`Command "${t}" is not support by agent "${e}"`)}};function Z(e,t,n=[]){if(!(e in Ye))throw Error(`Unsupported agent "${e}"`);let r=Ye[e][t];if(typeof r==`function`)return r(n);if(!r)throw new Sc({agent:e,command:t});return r.replace(`{0}`,n.map(e=>!e.startsWith(`--`)&&e.includes(` `)?JSON.stringify(e):e).join(` `)).trim()}const Cc=(e,t,n)=>(e===`bun`&&(t=t.map(e=>e===`-D`?`-d`:e)),t.includes(`-g`)?Z(e,`global`,uc(t,`-g`)):t.includes(`--frozen-if-present`)?(t=uc(t,`--frozen-if-present`),Z(e,n?.hasLock?`frozen`:`install`,t)):t.includes(`--frozen`)?Z(e,`frozen`,uc(t,`--frozen`)):t.length===0||t.every(e=>e.startsWith(`-`))?Z(e,`install`,t):Z(e,`add`,t)),wc=(e,t)=>(t.length===0&&t.push(`start`),t.includes(`--if-present`)&&(t=uc(t,`--if-present`),t[0]=`--if-present ${t[0]}`),Z(e,`run`,t)),Tc=(e,t)=>Z(e,`agent`,t);let Ec,Dc,Oc,kc,Ac=!0;typeof process<`u`&&({FORCE_COLOR:Ec,NODE_DISABLE_COLORS:Dc,NO_COLOR:Oc,TERM:kc}=process.env||{},Ac=process.stdout&&process.stdout.isTTY);const Q={enabled:!Dc&&Oc==null&&kc!==`dumb`&&(Ec!=null&&Ec!==`0`||Ac),reset:$(0,0),bold:$(1,22),dim:$(2,22),italic:$(3,23),underline:$(4,24),inverse:$(7,27),hidden:$(8,28),strikethrough:$(9,29),black:$(30,39),red:$(31,39),green:$(32,39),yellow:$(33,39),blue:$(34,39),magenta:$(35,39),cyan:$(36,39),white:$(37,39),gray:$(90,39),grey:$(90,39),bgBlack:$(40,49),bgRed:$(41,49),bgGreen:$(42,49),bgYellow:$(43,49),bgBlue:$(44,49),bgMagenta:$(45,49),bgCyan:$(46,49),bgWhite:$(47,49)};function jc(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function Mc(e,t){let n={has:e,keys:t};return n.reset=Q.reset.bind(n),n.bold=Q.bold.bind(n),n.dim=Q.dim.bind(n),n.italic=Q.italic.bind(n),n.underline=Q.underline.bind(n),n.inverse=Q.inverse.bind(n),n.hidden=Q.hidden.bind(n),n.strikethrough=Q.strikethrough.bind(n),n.black=Q.black.bind(n),n.red=Q.red.bind(n),n.green=Q.green.bind(n),n.yellow=Q.yellow.bind(n),n.blue=Q.blue.bind(n),n.magenta=Q.magenta.bind(n),n.cyan=Q.cyan.bind(n),n.white=Q.white.bind(n),n.gray=Q.gray.bind(n),n.grey=Q.grey.bind(n),n.bgBlack=Q.bgBlack.bind(n),n.bgRed=Q.bgRed.bind(n),n.bgGreen=Q.bgGreen.bind(n),n.bgYellow=Q.bgYellow.bind(n),n.bgBlue=Q.bgBlue.bind(n),n.bgMagenta=Q.bgMagenta.bind(n),n.bgCyan=Q.bgCyan.bind(n),n.bgWhite=Q.bgWhite.bind(n),n}function $(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:Q.enabled?jc(this.keys,t+``):t+``):t===void 0?Mc([e],[n]):Q.enabled?jc([n],t+``):t+``}}async function Nc(e,t,n={},r=n.cwd??m.default.cwd()){if(t.includes(`-g`))return await e(await xc(),t);let i=await fc({...n,cwd:r})||await bc(n.programmatic);if(!(i===`prompt`&&(i=(await Ls({name:`agent`,type:`select`,message:`Choose the agent`,choices:Xe.filter(e=>!e.includes(`@`)).map(e=>({title:e,value:e}))})).agent,!i)))return await e(i,t,{programmatic:n.programmatic,hasLock:!!i,cwd:r})}var Pc=e.a(t.o()),Fc=t.a(),Ic=()=>(0,Fc.dedent)(Pc.default`
${t.t} {bold No package.json found}
Chromatic only works from inside a JavaScript project.
We expected to find a package.json somewhere up the directory tree.
Are you sure you're running from your project directory?
`);Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return wc}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Cc}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Nc}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Tc}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Ic}});
//# sourceMappingURL=noPackageJson-DgjI1-pu.cjs.map
//# debugId=5e360b1f-2aeb-5c86-8b27-88851e96916e