forge-terminal 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -19
- package/dist/chunks/{about-credits-QMC5GQU2.js → about-credits-5UQU5WHE.js} +2 -2
- package/dist/chunks/args-QKAIL3E4.js +3 -0
- package/dist/chunks/{available-GYIHVSRX.js → available-M6Z62OWE.js} +1 -1
- package/dist/chunks/boot-MGR26CBU.js +3 -0
- package/dist/chunks/catalog-VPSTQTFD.js +3 -0
- package/dist/chunks/check-B6NP7BEM.js +3 -0
- package/dist/chunks/chunk-37P6QZ5Q.js +3 -0
- package/dist/chunks/chunk-3GJ7GV3V.js +19 -0
- package/dist/chunks/{chunk-EHARO6IS.js → chunk-57M4J2BR.js} +1 -1
- package/dist/chunks/chunk-63XCSYHM.js +3 -0
- package/dist/chunks/{chunk-JFJ3ZJQL.js → chunk-63ZK5SRQ.js} +1 -1
- package/dist/chunks/chunk-C4UCCBCX.js +3 -0
- package/dist/chunks/{chunk-DERIWZAT.js → chunk-CKZBBDAW.js} +1 -1
- package/dist/chunks/chunk-DZOBIUV6.js +3 -0
- package/dist/chunks/chunk-EKTUUKDP.js +80 -0
- package/dist/chunks/chunk-F34DPQFQ.js +63 -0
- package/dist/chunks/chunk-G46QQBT3.js +3 -0
- package/dist/chunks/chunk-GSK2A3TN.js +3 -0
- package/dist/chunks/chunk-H3DIRJFE.js +3 -0
- package/dist/chunks/chunk-HKINXTUW.js +3 -0
- package/dist/chunks/chunk-HOZ6XGQQ.js +6 -0
- package/dist/chunks/chunk-I6754KTB.js +36 -0
- package/dist/chunks/{chunk-YYB3TTGT.js → chunk-JMBEZPYC.js} +1 -1
- package/dist/chunks/chunk-K7KKCR7V.js +6 -0
- package/dist/chunks/chunk-KH5DHZ2U.js +8 -0
- package/dist/chunks/chunk-KXKQDFHX.js +3 -0
- package/dist/chunks/chunk-LVYQVJOF.js +3 -0
- package/dist/chunks/chunk-N6RCLJE6.js +4 -0
- package/dist/chunks/chunk-N72E43Z3.js +3 -0
- package/dist/chunks/chunk-NDECMPOM.js +3 -0
- package/dist/chunks/chunk-NXJGO66P.js +3 -0
- package/dist/chunks/chunk-OK7XOZFO.js +3 -0
- package/dist/chunks/chunk-P4RAYEM7.js +6 -0
- package/dist/chunks/{chunk-EX7KZBI6.js → chunk-PE5LAYGF.js} +1 -1
- package/dist/chunks/chunk-PPR7B5AR.js +3 -0
- package/dist/chunks/chunk-Q6KQWJ4J.js +3 -0
- package/dist/chunks/{chunk-GJ2GZHRI.js → chunk-RMD7F3QX.js} +1 -1
- package/dist/chunks/chunk-SK2UZ25Y.js +3 -0
- package/dist/chunks/chunk-SNDFMJIX.js +3 -0
- package/dist/chunks/{chunk-IGF6ZFTM.js → chunk-SZRSAL64.js} +1 -1
- package/dist/chunks/chunk-THDAQBQ3.js +3 -0
- package/dist/chunks/chunk-TL5MACSF.js +3 -0
- package/dist/chunks/chunk-V3I6DSF4.js +3 -0
- package/dist/chunks/{chunk-M7A55JKD.js → chunk-W6SY5PPG.js} +2 -2
- package/dist/chunks/chunk-WC6SJN5Y.js +3 -0
- package/dist/chunks/chunk-WE6KP4FR.js +3 -0
- package/dist/chunks/chunk-WIPP5TWQ.js +3 -0
- package/dist/chunks/{chunk-I2IATJNL.js → chunk-XBOMWF34.js} +1 -1
- package/dist/chunks/chunk-XRI5XKEB.js +66 -0
- package/dist/chunks/chunk-Y7LOIHFU.js +3 -0
- package/dist/chunks/chunk-YINYF6C7.js +3 -0
- package/dist/chunks/chunk-ZRHYGR2L.js +134 -0
- package/dist/chunks/chunk-ZZZAPVKM.js +3 -0
- package/dist/chunks/clip-command-R2NKW4TI.js +3 -0
- package/dist/chunks/clipboard-GICOXMMN.js +3 -0
- package/dist/chunks/colour-APVBMEJQ.js +3 -0
- package/dist/chunks/command-GYCYLUHN.js +3 -0
- package/dist/chunks/config-command-6YUMMZF3.js +3 -0
- package/dist/chunks/continue-editing-QE5RRIMG.js +3 -0
- package/dist/chunks/decoded-UNCEUPNW.js +3 -0
- package/dist/chunks/entry-TSLQHDP7.js +6 -0
- package/dist/chunks/execute-S5WN34PS.js +3 -0
- package/dist/chunks/extensions-XI5R74TS.js +3 -0
- package/dist/chunks/{extensions-command-L2AT6OVR.js → extensions-command-25JOL47P.js} +1 -1
- package/dist/chunks/ffmpeg-3CJ6C37W.js +3 -0
- package/dist/chunks/image-QSTDWHJ4.js +3 -0
- package/dist/chunks/install-IDUHZTTS.js +3 -0
- package/dist/chunks/{install-V62EEK54.js → install-L5C2UT6M.js} +1 -1
- package/dist/chunks/install-size-PZUFEDGI.js +3 -0
- package/dist/chunks/launch-LFFWVTFE.js +17 -0
- package/dist/chunks/libs-EK64ACG3.js +3 -0
- package/dist/chunks/lock-PTQUMNYX.js +3 -0
- package/dist/chunks/manager-CQ6NNQY4.js +4 -0
- package/dist/chunks/needed-MYXIUZI4.js +3 -0
- package/dist/chunks/own-WNA6BFYL.js +3 -0
- package/dist/chunks/{paths-5XI5L4KW.js → paths-EOYKOUBC.js} +1 -1
- package/dist/chunks/pdfium-WFGSET5S.js +3 -0
- package/dist/chunks/preferences-3P4V2EDX.js +3 -0
- package/dist/chunks/preset-command-HMOFTZSG.js +3 -0
- package/dist/chunks/registry-4IOXO6DT.js +3 -0
- package/dist/chunks/{reveal-L6TBFOMV.js → reveal-D5FCZYOA.js} +1 -1
- package/dist/chunks/run-HGZVOXRW.js +5 -0
- package/dist/chunks/{server-7PMVIYWQ.js → server-KKF3XBQG.js} +8 -8
- package/dist/chunks/text-layer-LHZNDMPZ.js +3 -0
- package/dist/chunks/{theme-Z6X54JY4.js → theme-NAWQ77WF.js} +1 -1
- package/dist/chunks/transcribe-Q5NLWSSR.js +3 -0
- package/dist/chunks/transcribe-command-2L7F7MCG.js +3 -0
- package/dist/chunks/{update-command-GMBG7BK6.js → update-command-JCTCRPCS.js} +1 -1
- package/dist/chunks/update-note-FRMHMUMD.js +3 -0
- package/dist/chunks/watch-command-XCCMIQIM.js +3 -0
- package/dist/fonts/NotoSans-Bold.ttf.gz +0 -0
- package/dist/fonts/NotoSans-Regular.ttf.gz +0 -0
- package/dist/fonts/OFL.txt +93 -0
- package/dist/helpers/forge-transcribe +0 -0
- package/dist/helpers/forge-transcribe-whisper.mjs +525 -0
- package/dist/index.js +8 -8
- package/dist/third-party-licenses.txt +98 -0
- package/package.json +45 -10
- package/dist/chunks/args-VPUOIDWE.js +0 -3
- package/dist/chunks/boot-FOKV7OHT.js +0 -3
- package/dist/chunks/catalog-YSMT3PXT.js +0 -3
- package/dist/chunks/check-KAR72Y4X.js +0 -3
- package/dist/chunks/chunk-3UEQ2OX6.js +0 -3
- package/dist/chunks/chunk-5B5XXH22.js +0 -3
- package/dist/chunks/chunk-5IS7O673.js +0 -6
- package/dist/chunks/chunk-5SMYDPVX.js +0 -63
- package/dist/chunks/chunk-6FUVEO3A.js +0 -78
- package/dist/chunks/chunk-6L6C3GJU.js +0 -3
- package/dist/chunks/chunk-AAXBN572.js +0 -4
- package/dist/chunks/chunk-BZXDNDPG.js +0 -3
- package/dist/chunks/chunk-DOWMSJ6R.js +0 -3
- package/dist/chunks/chunk-EXLXSKRH.js +0 -3
- package/dist/chunks/chunk-FH3R2YYD.js +0 -19
- package/dist/chunks/chunk-I63TO22X.js +0 -3
- package/dist/chunks/chunk-IWFVEMDN.js +0 -3
- package/dist/chunks/chunk-JSMGNA55.js +0 -3
- package/dist/chunks/chunk-KAHWYWNT.js +0 -3
- package/dist/chunks/chunk-LDKF7KIZ.js +0 -6
- package/dist/chunks/chunk-LNB5D67B.js +0 -3
- package/dist/chunks/chunk-M66BUNYO.js +0 -3
- package/dist/chunks/chunk-NWREILRP.js +0 -66
- package/dist/chunks/chunk-PSEIJXGT.js +0 -3
- package/dist/chunks/chunk-QR6QHTC3.js +0 -3
- package/dist/chunks/chunk-QXTXBMTM.js +0 -3
- package/dist/chunks/chunk-SMBK6BTC.js +0 -3
- package/dist/chunks/chunk-TDW6KQH6.js +0 -3
- package/dist/chunks/chunk-TMQDQLY7.js +0 -21
- package/dist/chunks/chunk-XEQVXPPY.js +0 -3
- package/dist/chunks/chunk-XSOCV3F2.js +0 -3
- package/dist/chunks/chunk-YWKMG5WO.js +0 -3
- package/dist/chunks/clip-command-SGB3B4OJ.js +0 -3
- package/dist/chunks/clipboard-CPHPA4FH.js +0 -3
- package/dist/chunks/colour-QMGYV6WQ.js +0 -3
- package/dist/chunks/command-I5M275ZV.js +0 -3
- package/dist/chunks/config-command-TYNYVUMP.js +0 -3
- package/dist/chunks/entry-3PEVSH2X.js +0 -6
- package/dist/chunks/execute-WQJ37VKD.js +0 -3
- package/dist/chunks/extensions-ZKOWPSLD.js +0 -3
- package/dist/chunks/ffmpeg-PF3VLTHK.js +0 -3
- package/dist/chunks/image-J4FT4ACZ.js +0 -3
- package/dist/chunks/install-2A5BGKQU.js +0 -3
- package/dist/chunks/launch-L5DKAUA3.js +0 -15
- package/dist/chunks/lock-KN7CF4YN.js +0 -3
- package/dist/chunks/manager-TEZ3V4L4.js +0 -4
- package/dist/chunks/preferences-4VETUGMN.js +0 -3
- package/dist/chunks/preset-command-HORY7KZQ.js +0 -3
- package/dist/chunks/run-6BK4REXK.js +0 -4
- package/dist/chunks/transcribe-command-YUSBCQEQ.js +0 -3
- package/dist/chunks/update-note-RQG2RZNR.js +0 -3
- package/dist/chunks/watch-command-DUHMTXQL.js +0 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Forge
|
|
2
2
|
|
|
3
|
-
**Convert** — a terminal-native file converter for macOS and
|
|
3
|
+
**Convert** — a terminal-native file converter for macOS, Windows and Linux. Command: `forge`.
|
|
4
4
|
|
|
5
5
|
## What it is
|
|
6
6
|
|
|
@@ -30,11 +30,18 @@ and arrow keys instead of flags. See [Interactive shell](#interactive-shell).
|
|
|
30
30
|
|
|
31
31
|
## Installation
|
|
32
32
|
|
|
33
|
-
**Requires macOS
|
|
33
|
+
**Requires macOS, Windows 10/11 or Linux, and Node 20 or newer** (developed and
|
|
34
34
|
tested on Node 24). Check with `node --version`; if you don't have it,
|
|
35
|
-
`brew install node` on a Mac,
|
|
35
|
+
`brew install node` on a Mac, the LTS installer from nodejs.org on Windows, or
|
|
36
|
+
your distro's package (or nodejs.org's build) on Linux.
|
|
36
37
|
On Windows, use Windows Terminal for the full experience.
|
|
37
38
|
|
|
39
|
+
Most features work on all three. The exceptions: transcript summaries and
|
|
40
|
+
notes need Apple Intelligence, so they are Mac-only; Boost has no Linux ARM
|
|
41
|
+
build (there it would run on the processor alone). Where a feature needs a
|
|
42
|
+
tool the OS does not have, it is a small optional extension
|
|
43
|
+
(`forge extensions`) or a common package, named in the error that asks for it.
|
|
44
|
+
|
|
38
45
|
```bash
|
|
39
46
|
npm install -g forge-terminal
|
|
40
47
|
```
|
|
@@ -43,7 +50,7 @@ That puts `forge` on your `PATH`, so it works from any directory. Verify:
|
|
|
43
50
|
|
|
44
51
|
```bash
|
|
45
52
|
forge --version
|
|
46
|
-
# 0.
|
|
53
|
+
# 0.5.0
|
|
47
54
|
|
|
48
55
|
forge photo.jpg --to webp
|
|
49
56
|
```
|
|
@@ -104,8 +111,8 @@ From source, `git pull && npm install && npm run build` updates and
|
|
|
104
111
|
|
|
105
112
|
## Right-click menu
|
|
106
113
|
|
|
107
|
-
On a Mac and on
|
|
108
|
-
time you run `forge`, and says so once:
|
|
114
|
+
On a Mac, on Windows and on Linux, Forge adds itself to the right-click menu
|
|
115
|
+
the first time you run `forge`, and says so once:
|
|
109
116
|
|
|
110
117
|
| Right-click | Items |
|
|
111
118
|
| --- | --- |
|
|
@@ -122,7 +129,10 @@ time you run `forge`, and says so once:
|
|
|
122
129
|
extension is installed (`forge extensions add boost`).
|
|
123
130
|
|
|
124
131
|
Forge opens in the terminal you last ran it in: Terminal, iTerm or Ghostty on
|
|
125
|
-
a Mac; Windows Terminal, or a console window, on Windows
|
|
132
|
+
a Mac; Windows Terminal, or a console window, on Windows; on Linux the one you
|
|
133
|
+
last ran it in if it is still installed, else your desktop's default
|
|
134
|
+
(xdg-terminal-exec, x-terminal-emulator, then GNOME Terminal, Konsole and the
|
|
135
|
+
other common ones). Each item's icon is
|
|
126
136
|
Forge's logo with the slashes in its mode's colour.
|
|
127
137
|
|
|
128
138
|
On a Mac the items are under **Quick Actions**, and Finder's own
|
|
@@ -132,6 +142,65 @@ image's and a folder's in a **Forge** submenu, a PDF's one item on its own. They
|
|
|
132
142
|
`npm install -g`; from a source checkout, `forge menu install` sets them up
|
|
133
143
|
by hand and `forge menu remove` takes them out.
|
|
134
144
|
|
|
145
|
+
On Linux, Forge writes entries for the common file managers, no dependencies
|
|
146
|
+
needed: GNOME Files (Nautilus) shows them under **Scripts › Forge**, and
|
|
147
|
+
Nemo, Dolphin and Thunar in a **Forge** submenu. Nautilus cannot limit a script
|
|
148
|
+
to some kinds of file, so there every item shows for every file, and Forge
|
|
149
|
+
says so when a file is not one it takes. Thunar's entries are merged into
|
|
150
|
+
`~/.config/Thunar/uca.xml` beside your own and removed without touching them.
|
|
151
|
+
Sharpen's notification uses `notify-send` (or D-Bus); without either, it is
|
|
152
|
+
silent.
|
|
153
|
+
|
|
154
|
+
## Transcribe on Windows, Linux and older Macs
|
|
155
|
+
|
|
156
|
+
On Apple-silicon Macs with macOS 26 or later, `forge transcribe` uses Apple's
|
|
157
|
+
speech recogniser. Everywhere else (Windows, Linux, Intel Macs, and Macs before
|
|
158
|
+
macOS 26) it uses [whisper.cpp](https://github.com/ggml-org/whisper.cpp)
|
|
159
|
+
instead. Everything stays on the machine. It needs ffmpeg and the whisper
|
|
160
|
+
extension (whisper.cpp's `whisper-cli` and its speech model, about 60 MB on
|
|
161
|
+
every OS):
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
forge extensions add whisper # every OS (Linux x64 needs AVX2)
|
|
165
|
+
winget install ffmpeg # Windows
|
|
166
|
+
sudo apt install ffmpeg # Linux, or your distro's ffmpeg
|
|
167
|
+
brew install ffmpeg # Mac
|
|
168
|
+
|
|
169
|
+
forge transcribe talk.mp4
|
|
170
|
+
forge transcribe "https://www.youtube.com/watch?v=..." --language en
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
- The speech model is ggml-base, multilingual, compressed to q5_1 (60 MB),
|
|
174
|
+
inside the extension. With a `whisper-cli` of your own instead, the first
|
|
175
|
+
run downloads the same model, checked against its sha256, into
|
|
176
|
+
`%LOCALAPPDATA%\forge\whisper`, `~/Library/Caches/forge/whisper` or
|
|
177
|
+
`~/.cache/forge/whisper`.
|
|
178
|
+
- Transcripts can be Markdown, Word, PDF or text everywhere. Forge writes the
|
|
179
|
+
Word and PDF itself where Apple's helper is not. The PDF is set in Noto Sans
|
|
180
|
+
for Latin, Greek and Cyrillic, and in the fonts your computer already has for
|
|
181
|
+
Chinese, Japanese, Korean, Arabic, Hebrew and Thai (Forge adds none). Writing
|
|
182
|
+
that has to be rearranged to be read, such as Hindi, is drawn as boxes in the
|
|
183
|
+
PDF; Markdown, Word and text have it.
|
|
184
|
+
- Reading the text of pictures and PDFs (`forge transcribe shot.png`) uses
|
|
185
|
+
Apple's reader on macOS 26. Everywhere else it uses the read-text extension
|
|
186
|
+
(`forge extensions add read-text`, about 45 MB): PaddleOCR's models for the
|
|
187
|
+
scripts Apple's reader reads (Latin, Chinese, Japanese, Korean, Cyrillic,
|
|
188
|
+
Arabic, Devanagari and Thai). Nothing asks which language a page is in: the
|
|
189
|
+
models say how sure they are, and the surest reads it. It does not read
|
|
190
|
+
vertical text, and leaves out Vietnamese's doubly-marked vowels. A PDF's own
|
|
191
|
+
text, when it has one, corrects words OCR splits at ligatures.
|
|
192
|
+
- Without `--language`, whisper detects the language itself.
|
|
193
|
+
- Summary and notes need Apple Intelligence, so off it Forge writes the
|
|
194
|
+
transcript. `--to notes` is refused; the default `--to all` gives the
|
|
195
|
+
transcript.
|
|
196
|
+
- On Windows the upstream whisper.cpp build needs the Microsoft Visual C++
|
|
197
|
+
Redistributable; if it is missing, Forge says so and links it.
|
|
198
|
+
- YouTube links need yt-dlp: `forge extensions add yt-dlp` installs upstream's
|
|
199
|
+
own build on every OS (and updates it when YouTube breaks it). A yt-dlp of
|
|
200
|
+
your own on PATH also works; Forge never updates that one.
|
|
201
|
+
- Overrides: `FORGE_WHISPER_CLI`, `FORGE_FFMPEG`, `FORGE_WHISPER_MODEL` (any
|
|
202
|
+
ggml `.bin`, e.g. a larger model for accuracy).
|
|
203
|
+
|
|
135
204
|
## Configuration
|
|
136
205
|
|
|
137
206
|
Forge stores preferences at `~/.config/forge/config.json`, or
|
|
@@ -296,6 +365,12 @@ back and `s` also saves the result to the default folder.
|
|
|
296
365
|
If your terminal sends nothing on ⌘V with only a picture copied, ctrl-v does
|
|
297
366
|
the same.
|
|
298
367
|
|
|
368
|
+
On Windows and Linux the same works with Ctrl+V, and the hint says so.
|
|
369
|
+
Windows uses its own clipboard through PowerShell. Linux needs a desktop
|
|
370
|
+
session and `wl-clipboard` (Wayland) or `xclip` (X11), and Forge names the one
|
|
371
|
+
to install if neither is there; on Linux a result goes back as image data
|
|
372
|
+
only. There is no clipboard over SSH on any system.
|
|
373
|
+
|
|
299
374
|
Forge never overwrites something you copied while it worked: the result is
|
|
300
375
|
saved to the default folder instead, and Done says so. A compression that
|
|
301
376
|
would come out larger is never put back.
|
|
@@ -385,16 +460,23 @@ zoom.
|
|
|
385
460
|
## Boost resolution and remove background
|
|
386
461
|
|
|
387
462
|
Two image operations that need a model, so they are optional extensions rather
|
|
388
|
-
than part of the install. On a Mac both need macOS 14 or later
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
463
|
+
than part of the install. On a Mac both need macOS 14 or later. Boost runs on
|
|
464
|
+
the graphics card: CoreML on Apple silicon, DirectML on Windows (any DirectX 12
|
|
465
|
+
graphics), WebGPU on Intel Macs (Metal) and on Linux x64 (Vulkan, so it needs a
|
|
466
|
+
Vulkan driver for the card). Where that would leave the processor to do it and
|
|
467
|
+
a photo would take over about three minutes, Boost stops and says so. Remove
|
|
468
|
+
background uses Apple Vision on a Mac, and on Windows and Linux a small model
|
|
469
|
+
(BiRefNet-lite, 54 MB, on the processor: about two seconds a photo and 2 GB of
|
|
470
|
+
memory at its peak). Windows and Linux also have a `heic` extension, because macOS opens
|
|
471
|
+
iPhone photos itself and they need a decoder. Nothing downloads until you ask:
|
|
392
472
|
|
|
393
473
|
```bash
|
|
394
474
|
forge extensions # list: installed or not, size, licence
|
|
395
|
-
forge extensions add boost # about 15 MB on Apple
|
|
396
|
-
forge extensions add remove-background #
|
|
397
|
-
forge extensions add heic # about 0.5 MB; Windows
|
|
475
|
+
forge extensions add boost # about 15 MB on Apple silicon, 16 MB on an Intel Mac, 17 MB on Linux x64, 23 MB on Windows
|
|
476
|
+
forge extensions add remove-background # 32 KB on a Mac (Apple Vision); 46 to 52 MB on Windows and Linux
|
|
477
|
+
forge extensions add heic # about 0.5 MB; Windows and Linux
|
|
478
|
+
forge extensions add whisper # transcribe where Apple's recogniser is not (see above)
|
|
479
|
+
forge extensions add yt-dlp # YouTube links for transcribe, every OS
|
|
398
480
|
forge extensions remove boost
|
|
399
481
|
```
|
|
400
482
|
|
|
@@ -1029,7 +1111,7 @@ photo.png · PNG · 122 KB · 2756×774
|
|
|
1029
1111
|
With `--json`:
|
|
1030
1112
|
|
|
1031
1113
|
```json
|
|
1032
|
-
{"forge":"0.
|
|
1114
|
+
{"forge":"0.5.0","ok":true,"probes":[{"path":"/Users/me/photo.png","kind":"image","format":"png","bytes":122449,"width":2756,"height":774,"targets":["jpeg","png","webp","avif","gif","tiff","pdf"],"actions":["convert"]}],"failures":[]}
|
|
1033
1115
|
```
|
|
1034
1116
|
|
|
1035
1117
|
`targets` and `actions` come from the engines' own capabilities, so they are
|
|
@@ -1055,7 +1137,7 @@ succeeded) and `failures`. A conversion, compression or page operation adds
|
|
|
1055
1137
|
|
|
1056
1138
|
```jsonc
|
|
1057
1139
|
{
|
|
1058
|
-
"forge": "0.
|
|
1140
|
+
"forge": "0.5.0",
|
|
1059
1141
|
"ok": false,
|
|
1060
1142
|
"results": [
|
|
1061
1143
|
{
|
|
@@ -1330,9 +1412,12 @@ in a patent pool, so upstream's position is that HEIC support requires a
|
|
|
1330
1412
|
globally installed libvips built against libheif, libde265 and x265 — AVIF
|
|
1331
1413
|
works in the same container only because AV1 is royalty-free.
|
|
1332
1414
|
|
|
1333
|
-
Forge decodes HEIC with `/usr/bin/sips` instead, which uses the
|
|
1334
|
-
codec Preview does. No install, no build step. If `sips` is
|
|
1335
|
-
conversion is the only thing that stops working.
|
|
1415
|
+
On a Mac, Forge decodes HEIC with `/usr/bin/sips` instead, which uses the
|
|
1416
|
+
same system codec Preview does. No install, no build step. If `sips` is
|
|
1417
|
+
missing, HEIC conversion is the only thing that stops working.
|
|
1418
|
+
|
|
1419
|
+
On Windows and Linux, `forge extensions add heic` installs libheif compiled to
|
|
1420
|
+
WebAssembly (about 0.5 MB, one build for any chip, LGPL-3.0 in its own files).
|
|
1336
1421
|
|
|
1337
1422
|
Writing HEIC is still unavailable: Sharp cannot encode HEVC at all.
|
|
1338
1423
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import"./chunk-TMUK2DD3.js";import{readFile as x}from"node:fs/promises";import{dirname as m,join as u}from"node:path";import{fileURLToPath as C}from"node:url";var c=[{name:"sharp \xB7 libvips",licence:"Apache-2.0 \xB7 LGPL-3.0",does:"images",packages:["sharp"]},{name:"PDFium",licence:"BSD-3-Clause",does:"PDF pages",packages:[]},{name:"pdf-lib",licence:"MIT",does:"writing PDFs",packages:["pdf-lib"]},{name:"mammoth \xB7 docx",licence:"BSD-2-Clause \xB7 MIT",does:"Word documents",packages:["mammoth","docx"]},{name:"Ink \xB7 React",licence:"MIT",does:"this screen",packages:["ink","react"]}],g=[{name:"@hyzyla/pdfium",licence:"MIT"}],h=[{name:"xkcd colour survey",licence:"CC0-1.0"}];function l(n){let t=[];for(let e of n.split(`
|
|
4
|
-
`)){let i=/^((?:@[^/\s]+\/)?[^@\s]+)@\S+ — (.+)$/.exec(e);i&&t.push({name:i[1],licence:i[2].replace(/^\((.*)\)$/,"$1")})}return t}var d=n=>n.name.replace(/^@/,"");function p({bundled:n,extensions:t}){let e=new Set(c.flatMap(s=>s.packages)),i=[...n.filter(s=>!e.has(s.name)),...g,...h].sort((s,r)=>d(s).localeCompare(d(r)));return[{title:"App",credits:c.map(({packages:s,...r})=>r)},...t.length>0?[{title:"Extensions",credits:t}]:[],{title:"Others",credits:i}]}var f="third-party-licenses.txt";function y(n){let t=[],e=m(n);for(let i=0;i<4;i++)t.push(u(e,f),u(e,"dist",f)),e=m(e);return t}async function k(n){for(let t of y(C(n))){let e=await x(t,"utf8").catch(()=>{});if(e!==void 0)return{path:t,text:e}}}async function
|
|
3
|
+
import"./chunk-TMUK2DD3.js";import{readFile as x}from"node:fs/promises";import{dirname as m,join as u}from"node:path";import{fileURLToPath as C}from"node:url";var c=[{name:"sharp \xB7 libvips",licence:"Apache-2.0 \xB7 LGPL-3.0",does:"images",packages:["sharp"]},{name:"PDFium",licence:"BSD-3-Clause",does:"PDF pages",packages:[]},{name:"pdf-lib",licence:"MIT",does:"writing PDFs",packages:["pdf-lib"]},{name:"mammoth \xB7 docx",licence:"BSD-2-Clause \xB7 MIT",does:"Word documents",packages:["mammoth","docx"]},{name:"Ink \xB7 React",licence:"MIT",does:"this screen",packages:["ink","react"]}],g=[{name:"@hyzyla/pdfium",licence:"MIT"}],h=[{name:"Noto Sans",licence:"OFL-1.1"},{name:"xkcd colour survey",licence:"CC0-1.0"}];function l(n){let t=[];for(let e of n.split(`
|
|
4
|
+
`)){let i=/^((?:@[^/\s]+\/)?[^@\s]+)@\S+ — (.+)$/.exec(e);i&&t.push({name:i[1],licence:i[2].replace(/^\((.*)\)$/,"$1")})}return t}var d=n=>n.name.replace(/^@/,"");function p({bundled:n,extensions:t}){let e=new Set(c.flatMap(s=>s.packages)),i=[...n.filter(s=>!e.has(s.name)),...g,...h].sort((s,r)=>d(s).localeCompare(d(r)));return[{title:"App",credits:c.map(({packages:s,...r})=>r)},...t.length>0?[{title:"Extensions",credits:t}]:[],{title:"Others",credits:i}]}var f="third-party-licenses.txt";function y(n){let t=[],e=m(n);for(let i=0;i<4;i++)t.push(u(e,f),u(e,"dist",f)),e=m(e);return t}async function k(n){for(let t of y(C(n))){let e=await x(t,"utf8").catch(()=>{});if(e!==void 0)return{path:t,text:e}}}async function F({from:n=import.meta.url,list:t=async()=>(await import("./manager-CQ6NNQY4.js")).listExtensions()}={}){let[e,i]=await Promise.all([k(n),t().catch(()=>[])]),{extensionCredits:s}=await import("./extensions-XI5R74TS.js"),r=i.filter(o=>o.installed!==void 0).flatMap(o=>s(o.entry)),a=p({bundled:l(e?.text??""),extensions:r});return e?{sections:a,file:e.path}:{sections:a}}export{F as loadCredits};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{a,b,c,d,e,f}from"./chunk-F34DPQFQ.js";import"./chunk-U5TEGDGH.js";import"./chunk-QVACE4IE.js";import"./chunk-HZDYZ5RD.js";import"./chunk-JMBEZPYC.js";import"./chunk-Y7LOIHFU.js";import"./chunk-PPR7B5AR.js";import"./chunk-XBOMWF34.js";import"./chunk-V3I6DSF4.js";import"./chunk-EEQSUBBL.js";import"./chunk-K7KKCR7V.js";import"./chunk-LVYQVJOF.js";import"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-SNDFMJIX.js";import"./chunk-THDAQBQ3.js";import"./chunk-DZOBIUV6.js";import"./chunk-TL5MACSF.js";import"./chunk-WIPP5TWQ.js";import"./chunk-J7FLFHQJ.js";import"./chunk-H3DIRJFE.js";import"./chunk-KXKQDFHX.js";import"./chunk-TMUK2DD3.js";export{b as COMMANDS_HELP,a as EXIT_CODES_HELP,d as colourUsage,c as commandsHelp,f as parseArgs,e as wantsJson};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{c as t}from"./chunk-
|
|
3
|
+
import{c as t}from"./chunk-PE5LAYGF.js";import{a as i}from"./chunk-HKINXTUW.js";import"./chunk-HON4OV7M.js";import"./chunk-TMUK2DD3.js";async function l(){let e=await Promise.all(i.map(async n=>await t(n.id)?n.id:null));return new Set(e.filter(n=>n!==null))}export{l as installedExtensionIds};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{r as a}from"./chunk-XBOMWF34.js";import{e as l}from"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-H3DIRJFE.js";import"./chunk-TMUK2DD3.js";var c={loadPreferences:l,loadShell:()=>import("./launch-LFFWVTFE.js")};async function f(e=c,n={}){let t=e.loadShell();t.catch(()=>{});let{prefs:o,warning:r}=await e.loadPreferences(),s=a(o.theme),{launchShell:i}=await t;await i({prefs:o,palette:s,...r===void 0?{}:{warning:r},...n})}export{f as bootShell};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{a,b,c,d,e,f,g,h}from"./chunk-HKINXTUW.js";import"./chunk-TMUK2DD3.js";export{a as CATALOG,d as EXTENSION_PLATFORMS,f as assetFor,e as catalogEntry,b as machineName,h as offeredHere,g as offeredOn,c as osName};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-SZRSAL64.js";import"./chunk-N6RCLJE6.js";import"./chunk-WE6KP4FR.js";import"./chunk-KH5DHZ2U.js";import"./chunk-HON4OV7M.js";import"./chunk-H3DIRJFE.js";import"./chunk-TMUK2DD3.js";export{b as CHECK_EVERY_MS,e as MAX_NOTES,g as NOTE_TEXT,f as NOTE_TITLE,a as REGISTRY_URL,o as availableUpdate,h as cachePath,m as checkNow,l as fetchLatest,c as isNewer,k as isStale,i as readCache,d as updateChecksEnabled,n as whatsNewFor,j as writeCache};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{a as w,b as I,d as k,e as m}from"./chunk-C4UCCBCX.js";import{a as $,c as O}from"./chunk-EKTUUKDP.js";import{b as h,d as P,e as R}from"./chunk-W6SY5PPG.js";import{e as x}from"./chunk-57M4J2BR.js";import{a as l}from"./chunk-XBOMWF34.js";import{j as B}from"./chunk-V3I6DSF4.js";import{$ as g,aa as C,b as p,ca as v}from"./chunk-WIPP5TWQ.js";import{a as f}from"./chunk-J7FLFHQJ.js";import{a as c}from"./chunk-H3DIRJFE.js";import{dirname as S,join as q}from"node:path";async function T(t){if(t.fallback!==void 0)return t.fallback;let{loadPreferences:r,expandTilde:e}=await import("./preferences-3P4V2EDX.js");return e((await r()).prefs.defaultOutput)}function F(t){if(t.pasteboard)return t.pasteboard;if(!$())throw C();return O()}function E(t,r,e,o){let a=q(r.outDir,`Copied image${c[o].extensions[0]}`),s={inputs:[r.source],output:a,force:!1,recursive:!1,debug:t.debug},n={background:"#ffffff",keepMetadata:!1,...t.quality===void 0?{}:{quality:t.quality}};return o===e?{kind:"compress",...s,options:n,...t.quality===void 0?{}:{quality:t.quality},...t.maxBytes===void 0?{}:{maxBytes:t.maxBytes}}:{kind:"convert",...s,target:o,options:n,...t.maxBytes===void 0?{}:{maxBytes:t.maxBytes}}}async function J(t,r={}){let e=r.clip??{},o=F(e),a=await w(o,e.root);if(!a)throw g((await o.peek()).text?"text":"nothing");let s=await B(a.source),n=t.target??s.format,b=E(t,a,s.format,n),i=await P(b,r),y=i.results[0];if(!y||i.failures.length>0)return{report:i,status:"failed"};let u=y.job.outputs[0],d={report:i,output:u,source:{format:s.format,bytes:s.bytes},target:n};if(await I(o,a,u,n)==="changed")return{...d,status:"changed",saved:await m(u,await T(e))};if(t.save===void 0)return{...d,status:"placed"};let j=t.save===!0?await T(e):t.save,{expandTilde:D}=await import("./preferences-3P4V2EDX.js");return{...d,status:"placed",saved:await m(u,D(j))}}function N(t){let r=t.target===t.source.format?"":` as ${c[t.target].label}`,e=` ${f(t.source.bytes)} \u2192 ${f(t.report.outputBytes)} \xB7 ${h(t.source.bytes,t.report.outputBytes)}`;if(t.status==="changed"){let a=t.target===t.source.format?"compressed":"converted";return[`\u2713 Copied image \u2192 ${p(t.saved)}${r}`,e,"","\u26A0 Clipboard changed"," The file you uploaded is no longer in the clipboard.",` The ${a} image is saved to ${p(S(t.saved))}.`]}let o=t.saved===void 0?"":` + ${p(t.saved)}`;return[`\u2713 Copied image \u2192 clipboard${r}${o}`,e]}async function U(t){if(!await k(F(t),t.root))throw v()}async function Z(t,r){if(t.undo)return await U(r.clip??{}),{exitCode:0,stdout:r.json?[JSON.stringify({forge:l,ok:!0,clipboard:"restored"})]:["\u2713 The original is back on the clipboard"],stderr:[]};let e=await J(t,r);if(e.status==="failed")return R(e.report,r);if(r.json){let o={...x(l,e.report),clipboard:e.status,...e.saved===void 0?{}:{saved:e.saved}};return{exitCode:0,stdout:[JSON.stringify(o)],stderr:[]}}return{exitCode:0,stdout:N(e),stderr:[]}}export{J as a,N as b,U as c,Z as d};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{a as $,h as at,i as _}from"./chunk-YINYF6C7.js";import{b as d,c as R,d as P,f as v,g as H,h as X}from"./chunk-QVACE4IE.js";import{j as st}from"./chunk-V3I6DSF4.js";import{g as ot}from"./chunk-TL5MACSF.js";import{d as tt,m as et,w as nt}from"./chunk-WIPP5TWQ.js";import{a as Z}from"./chunk-H3DIRJFE.js";import{b as rt}from"./chunk-KXKQDFHX.js";var xt=[[15,"rose"],[45,"red"],[70,"orange"],[95,"amber"],[120,"yellow"],[140,"lime"],[165,"green"],[185,"teal"],[215,"cyan"],[250,"sky"],[280,"blue"],[295,"indigo"],[315,"violet"],[340,"purple"],[355,"pink"],[360,"rose"]];function w(t){let{C:e,h:n}=v(R(t));return e<.03?"grey":D(n)}function D(t){let e=(t%360+360)%360;return(xt.find(([n])=>e<n)??[360,"rose"])[1]}var Ft=["full","mono","analogous","opposite","split","triad","pastel"],it={full:"Full set",mono:"Monochromatic",analogous:"Analogous",opposite:"Complementary",split:"Split complementary",triad:"Triadic",pastel:"Pastel"},B={brightness:0,saturation:0,hue:0,contrast:0},vt=t=>!!(t.brightness||t.saturation||t.hue||t.contrast),G=[{name:"red",hex:{r:251,g:44,b:54},role:"danger"},{name:"orange",hex:{r:255,g:105,b:0}},{name:"yellow",hex:{r:239,g:177,b:0},role:"warning"},{name:"green",hex:{r:0,g:201,b:80},role:"success"},{name:"teal",hex:{r:0,g:187,b:167}},{name:"blue",hex:{r:43,g:127,b:255},role:"info"},{name:"purple",hex:{r:173,g:70,b:255}},{name:"pink",hex:{r:246,g:51,b:154}}],bt={analogous:[-30,0,30],opposite:[0,180],split:[0,150,210],triad:[0,120,240]},dt=.553,$t=.024,b=t=>v(R(t)),C=(t,e,n)=>P(H({L:t,C:Math.max(0,e),h:(n+360)%360})),K=(t,e)=>(t-e+540)%360-180;function lt(t,e,n){let r=H({L:t,C:e,h:n}),o=R(P(r));return Math.hypot(o.L-r.L,o.a-r.a,o.b-r.b)<.003}function L(t,e){let n=0,r=.4;for(let o=0;o<30;o++){let a=(n+r)/2;lt(t,a,e)?n=a:r=a}return n}function W({L:t,C:e,h:n}){let r=L(t,n);return r>0?Math.min(1,e/r):0}var A=(t,e)=>e>=0?t+(.98-t)*(e/100):t+(t-.05)*(e/100),q=(t,e,n)=>n>=0?t+(Math.max(t,e)-t)*(n/100):t*(1+n/100);function T(t,e){if(!(e.brightness||e.saturation||e.hue))return t;let{L:n,C:r,h:o}=b(t),a=A(n,e.brightness),i=(o+e.hue+360)%360,l=q(r,L(a,i),e.saturation);for(let s=0;s<40&&l>0&&!lt(a,l,i);s++)l-=.005;return C(a,l,i)}function k(t,e,n,r){let o=A(t,r.brightness),a=(n+r.hue+360)%360,i=L(o,a);return C(o,Math.min(i,q(e,i,r.saturation)),a)}function Y(t,e,n){if(!e)return t;let r=b(t[n].rgb).L;return t.map((o,a)=>{if(a===n)return o;let i=b(o.rgb),l=Math.max(.02,Math.min(.995,r+(i.L-r)*(1+e/100))),s=C(l,Math.min(i.C,L(l,i.h)),i.h);return{...o,rgb:s,hex:d(s)}})}function Tt(t,e,n,r){return Y(t(T(e,n)),n.contrast,r)}function ct(t,e){let n=b(t),r=G.map(s=>b(s.hex)),o=0;r.forEach((s,c)=>{Math.abs(K(n.h,s.h))<Math.abs(K(n.h,r[o].h))&&(o=c)});let a=r[o],i=Math.max(-10,Math.min(10,K(n.h,a.h)/2)),l=W(n);return G.map((s,c)=>{if(c===o)return{name:s.name,role:s.role,rgb:T(t,e),yours:!0};let h=r[c],p=n.L>=a.L?h.L+(n.L-a.L)*(1-h.L)/(1-a.L):h.L*n.L/a.L,f=A(p,e.brightness),g=(h.h+i+e.hue+360)%360,x=L(f,g),u=Math.min(1,W(h)),S=Math.min(x,q(l*u*x,x,e.saturation));return{name:s.name,role:s.role,rgb:C(f,S,g),yours:!1}})}function wt(t,e,n){let r=b(t),o=w(t);if(e==="mono")return[{name:o,rgb:T(t,n),yours:!0},{name:`${o} soft`,rgb:k(r.L,r.C*.5,r.h,n),yours:!1},{name:`${o} dusty`,rgb:k(r.L,r.C*.22,r.h,n),yours:!1}];if(e==="pastel")return ct(t,B).map((l,s)=>{let c=b(l.rgb),h=c.C<.01?b(G[s].hex).h:c.h;return{...l,rgb:k(.86,Math.min(.1,L(.86,h))*.85,h,n)}});let a=W(r);return(bt[e]??[0]).map(l=>{if(l===0)return{name:o,rgb:T(t,n),yours:!0};let s=(r.h+l+360)%360,c=a*L(r.L,s);return{name:a>0?D(s):w(k(r.L,c,s,B)),rgb:k(r.L,c,s,n),yours:!1}}).sort((l,s)=>Number(s.yours)-Number(l.yours))}function yt(t,e,n){let r=b(t).h+e.hue,o=Math.max(0,$t*(1+e.saturation/100));return _(C(A(dt,e.brightness),o,r),n)}function At(t,e,n=B,r=$){let o=at(r);return{rows:(e==="full"?ct(t,n):wt(t,e,n)).map(({name:l,role:s,rgb:c,yours:h})=>({name:l,...s?{role:s}:{},steps:Y(_(c,r),n.contrast,o),yours:h})),neutral:Y(yt(t,n,r),n.contrast,o)}}var M=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),E=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"colour",y='font-family="Inter"',O=t=>`${t[0]?.toUpperCase()??""}${t.slice(1)}`;function ht(t){let e=t==="dark";return{ink:e?"#FAFAFA":"#111111",grey:e?"#A1A1AA":"#71717A",edge:e?"#FFFFFF":"#000000",paper:e?"#18181B":"#FFFFFF"}}var St=`<defs><pattern id="checker" width="16" height="16" patternUnits="userSpaceOnUse"><rect width="16" height="16" fill="#FFFFFF"/><rect width="8" height="8" fill="#E5E5E5"/><rect x="8" y="8" width="8" height="8" fill="#E5E5E5"/></pattern></defs>
|
|
4
|
+
`;function I(t,e,n,r="light"){let{ink:o,grey:a,edge:i,paper:l}=ht(r),s=n.length>8?64:104,c=10,h=48+n.length*s+Math.max(0,n.length-1)*c,p=84+s+56,f=s>80?12:10,g=`<text id="title" x="24" y="38" ${y} font-size="15" font-weight="600" fill="${o}">${M(t)}</text><text id="subtitle" x="24" y="58" ${y} font-size="12" fill="${a}">${M(e)}</text>`,x=n.map((u,S)=>`<g id="${E(u.id)}" transform="translate(${24+S*(s+c)} 80)">`+(u.alpha===void 0?"":`<rect id="checker" width="${s}" height="${s}" rx="${f}" fill="url(#checker)"/>`)+`<rect id="swatch" width="${s}" height="${s}" rx="${f}" fill="${u.hex}"`+(u.alpha===void 0?"":` fill-opacity="${u.alpha.toFixed(3)}"`)+` stroke="${i}" stroke-opacity="0.08"/><text id="name" x="1" y="${s+22}" ${y} font-size="13" font-weight="600" fill="${o}">${M(u.name)}</text><text id="value" x="1" y="${s+40}" ${y} font-size="11" fill="${a}">${M(u.value)}</text></g>`).join(`
|
|
5
|
+
`);return`<svg xmlns="http://www.w3.org/2000/svg" width="${h}" height="${p}" viewBox="0 0 ${h} ${p}">
|
|
6
|
+
`+(n.some(u=>u.alpha!==void 0)?St:"")+`<g id="${E(t)}">
|
|
7
|
+
<rect id="card" width="${h}" height="${p}" rx="0" fill="${l}"/>
|
|
8
|
+
${g}
|
|
9
|
+
${x}
|
|
10
|
+
</g>
|
|
11
|
+
</svg>`}function Ut(t,e,n="light",r){let o=t.replace(/\.[^.]+$/,""),a=e.length;return I(t,r?`${a} shade${a===1?"":"s"} of ${r}`:`${a} colour${a===1?"":"s"}, most of the image first`,e.map((i,l)=>({id:`${o}-${l+1}`,name:i.hex,value:X(i.rgb),hex:i.hex})),n)}function N(t){if(t.set==="radix")return"Radix 1\u201312";if(t.set==="even")return`${t.start}\u2013${t.end}, ${t.count} even steps`;let e=$;return t.start===e.start&&t.end===e.end?"50\u2013950":`Tailwind ${t.start}\u2013${t.end}`}function jt(t,e,n="light",r=$){let o=w(t);return I(O(o),`from ${d(t)} \xB7 ${N(r)} in OKLCH`,e.map(a=>({id:`${o}-${a.step}`,name:String(a.step),value:a.hex,hex:a.hex})),n)}function Pt(t,e,n,r=$,o="light"){let{ink:a,grey:i,edge:l,paper:s}=ht(o),c=`${O(w(t))} palette`,h=`from ${d(t)} \xB7 ${it[n]} \xB7 ${N(r)} in OKLCH`,p=[...e.rows.map(m=>({name:m.name,steps:m.steps})),{name:"neutral",steps:e.neutral}],f=p[0]?.steps.map(m=>m.step)??[],g=44,x=6,u=g+10,S=92,z=24+Math.max(92,...p.map(m=>m.name.length*8+12)),ut=z+f.length*g+Math.max(0,f.length-1)*x+24,U=Math.max(ut,48+Math.ceil(h.length*6.5)),j=S+p.length*u+24+10,mt=`<text id="title" x="24" y="38" ${y} font-size="15" font-weight="600" fill="${a}">${M(c)}</text><text id="subtitle" x="24" y="58" ${y} font-size="12" fill="${i}">${M(h)}</text>`,gt=f.map((m,F)=>`<text id="step-${m}" x="${z+F*(g+x)+1}" y="${S-10}" ${y} font-size="11" font-weight="600" fill="${i}">${m}</text>`).join(""),pt=p.map((m,F)=>{let J=S+F*u+(F===p.length-1?10:0),Q=E(m.name);return`<g id="${Q}"><text id="name" x="24" y="${J+g/2+4}" ${y} font-size="13" font-weight="600" fill="${a}">${M(m.name)}</text>`+m.steps.map((V,ft)=>`<g id="${Q}-${V.step}"><rect id="swatch" x="${z+ft*(g+x)}" y="${J}" width="${g}" height="${g}" rx="8" fill="${V.hex}" stroke="${l}" stroke-opacity="0.08"/></g>`).join("")+"</g>"}).join(`
|
|
12
|
+
`);return`<svg xmlns="http://www.w3.org/2000/svg" width="${U}" height="${j}" viewBox="0 0 ${U} ${j}">
|
|
13
|
+
<g id="${E(c)}">
|
|
14
|
+
<rect id="card" width="${U}" height="${j}" rx="0" fill="${s}"/>
|
|
15
|
+
${mt}
|
|
16
|
+
<g id="steps">${gt}</g>
|
|
17
|
+
${pt}
|
|
18
|
+
</g>
|
|
19
|
+
</svg>`}function Ht(t,e,n,r="light",o=$){return I(`${O(w(t))} neutral`,`from ${d(t)} \xB7 ${n} tint \xB7 ${N(o)} in OKLCH`,e.map(a=>({id:`neutral-${a.step}`,name:String(a.step),value:a.hex,hex:a.hex})),r)}function _t(t,e,n,r="light",o=$){let a=w(t);return I(`${O(a)} alpha`,`from ${d(t)} \xB7 over ${n} \xB7 ${N(o)}`,e.map(i=>({id:`${a}-alpha-${i.step}`,name:String(i.step),value:i.hex8,hex:d(i.rgb),alpha:i.a})),r)}async function qt(t,e=192){let n=await st(t);if(n.kind!=="image")throw et(t,`a ${Z[n.format].label}`);let r=await ot(t,n.format);try{let o=await rt(),{data:a,info:i}=await o(r.path,{animated:!1}).rotate().resize(e,e,{fit:"inside",withoutEnlargement:!0}).ensureAlpha().raw().toBuffer({resolveWithObject:!0});return{source:n,pixels:{width:i.width,height:i.height,rgba:new Uint8Array(a.buffer,a.byteOffset,a.length)}}}catch(o){throw tt(o)?o:nt(t,o)}finally{await r.cleanup()}}export{Ft as a,it as b,B as c,vt as d,Tt as e,At as f,I as g,Ut as h,jt as i,Pt as j,Ht as k,_t as l,qt as m};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as t}from"./chunk-
|
|
3
|
+
import{a as t}from"./chunk-63XCSYHM.js";import{resolve as s}from"node:path";function c(r,e){return{forge:r,ok:!0,palette:e,failures:[]}}function f(r,e){return{forge:r,ok:!0,scale:e,failures:[]}}function a(r){let e=t(r),n=e.sources.map(o=>s(o.path));return{op:r.job.op,source:n[0]??"",sources:n,outputs:e.outputs.map(o=>s(o)),inputBytes:e.sources.reduce((o,u)=>o+u.bytes,0),outputBytes:e.outputBytes,warnings:e.warnings.map(o=>({code:o.code,message:o.message}))}}function i(r){let{error:e}=r;return{...r.path?{path:s(r.path)}:{},code:e.code,title:e.title,detail:e.detail,...e.hint===void 0?{}:{hint:e.hint}}}function l(r,e){return{forge:r,ok:e.failures.length===0,results:e.results.map(a),failures:e.failures.map(i)}}function J(r,e){return l(r,{results:[],failures:[{error:e}]})}function m(r,e){return{forge:r,ok:!0,formats:e,failures:[]}}function b(r,e){return{forge:r,ok:e.failures.length===0,probes:e.probes,failures:e.failures.map(i)}}function x(r,e,n){return{forge:r,ok:!0,config:e,warnings:n.map(o=>({code:o.code,message:o.message})),failures:[]}}function d(r,e){return{forge:r,ok:!0,extensions:e.extensions,...e.changed?{changed:e.changed}:{},failures:[]}}export{c as a,f as b,a as c,i as d,l as e,J as f,m as g,b as h,x as i,d as j};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
function o(e){switch(e.op){case"convert":return e.options.crop&&e.options.resize?"cropped and resized":e.options.crop?"cropped":e.options.rotate?"rotated":e.options.trim&&e.options.resize?"trimmed and resized":e.options.resize?"resized":e.options.trim?"trimmed":e.target===e.sources[0].format?"compressed":"converted";case"merge":return"merged";case"split":return"split";case"extract":return"extracted";case"delete":return"deleted from";case"rotate":return"rotated";case"boost":return e.scale===1?"sharpened":"boosted";case"remove-background":return"cut out";default:{let t=e;throw new Error(`describeResult has no verb for ${JSON.stringify(t)}`)}}}function i(e){let{job:t}=e,r=t.sources.map(n=>({path:n.path,bytes:n.bytes})),s=r.length===1&&t.outputs.length===1?r[0]:void 0;return{verb:o(t),sources:r,outputs:[...t.outputs],outputBytes:e.outputBytes,...s?{size:{from:s.bytes,to:e.outputBytes}}:{},warnings:e.warnings}}export{i as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{
|
|
3
|
+
import{Q as a,R as u,S as l}from"./chunk-WIPP5TWQ.js";import{spawn as x}from"node:child_process";import{existsSync as c,realpathSync as b}from"node:fs";import{dirname as h,join as E,win32 as d}from"node:path";function f(n,t=process.platform,e=c){if(n===void 0)return!1;if(t==="win32"){let r=/^(.*)[\\/]node_modules[\\/]forge-terminal[\\/]/.exec(n)?.[1];return r!==void 0&&e(d.join(r,"forge.cmd"))}return/\/lib\/node_modules\/forge-terminal\//.test(n)&&!n.includes("/_npx/")}function m(n){if(n!==void 0)try{return b(n)}catch{return n}}function P(n,t=c){let e=E(h(n),"npm");return t(e)?e:"npm"}function R(n,t=c){let e=d.join(d.dirname(n),"node_modules","npm","bin","npm-cli.js");return t(e)?e:void 0}var g=(n,t,e)=>new Promise(r=>{let o="",s=x(n,t,{stdio:["ignore","pipe","pipe"],...e?{signal:e}:{}});s.stdout.setEncoding("utf8").on("data",i=>{o+=i}),s.stderr.setEncoding("utf8").on("data",i=>{o+=i}),s.on("error",i=>r({code:null,output:`${o}
|
|
4
4
|
${i.message}`})),s.on("close",i=>r({code:i,output:o}))});function w(n){return n.split(`
|
|
5
5
|
`).map(e=>e.replace(/^npm (error|ERR!)\s*/,"").trim()).filter(e=>e!==""&&!/^(code|errno|syscall|path|dest|A complete log)/.test(e)).at(-1)??"npm exited without saying why"}async function _(n,t={}){let e=t.platform??process.platform;if(e==="win32")return S(n,t);let r=t.script??m(process.argv[1]);if(!f(r,e))throw a(n);let o=t.npm??P(process.execPath),s=t.run??g,{code:i,output:p}=await s(o,["install","--global",`forge-terminal@${n}`],t.signal);if(i!==0)throw/EACCES|EPERM|permission denied/i.test(p)?u(n,e):l(n,w(p))}async function S(n,t){let e=t.script??m(process.argv[1]);if(!f(e,"win32",t.exists))throw a(n);let r=R(process.execPath,t.exists);if(r===void 0)throw l(n,"npm was not found beside Node");let o=t.run??g,{code:s,output:i}=await o(process.execPath,[r,"install","--global",`forge-terminal@${n}`],t.signal);if(s!==0)throw/EACCES|EPERM|EBUSY|permission denied/i.test(i)?u(n,"win32"):l(n,w(i))}export{f as a,m as b,P as c,R as d,w as e,_ as f};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{f as p,q as g,r as f}from"./chunk-DZOBIUV6.js";import{randomBytes as l}from"node:crypto";import{copyFile as P,mkdir as w,readdir as h,readFile as y,rename as C,rm as u,stat as k}from"node:fs/promises";import{tmpdir as x}from"node:os";import{extname as c,join as o}from"node:path";function m(){return o(x(),"forge-clip")}var v=5,d={".png":"png",".jpg":"jpeg",".jpeg":"jpeg",".webp":"webp",".heic":"heic",".avif":"avif",".gif":"gif",".tiff":"tiff"};async function O(e,a=m()){let t=`${Date.now().toString(36)}-${l(3).toString("hex")}`,i=o(a,t),r=await e.read(o(i,"in"));if(!r)return await u(i,{recursive:!0,force:!0}),null;let n=o(i,"out");await w(n,{recursive:!0}),await F(a,r.path);let s=o(i,"in","Copied image");return await C(r.path,s),await T(a,t),{source:s,outDir:n,changeCount:r.changeCount}}async function F(e,a){let t=o(e,"last"),i=`Copied image${c(a)}`,r=o(e,`.last-${l(4).toString("hex")}`);await w(r,{recursive:!0}),await P(a,o(r,i)),await u(t,{recursive:!0,force:!0}),await g(r,t)}async function T(e,a){let t=await h(e,{withFileTypes:!0}).catch(()=>[]),r=(await Promise.all(t.filter(n=>n.isDirectory()&&n.name!=="last"&&!n.name.startsWith(".")).map(async n=>({name:n.name,at:(await k(o(e,n.name)).catch(()=>null))?.mtimeMs??0})))).filter(n=>n.name!==a).sort((n,s)=>s.at-n.at).slice(v-1);await Promise.all(r.map(n=>u(o(e,n.name),{recursive:!0,force:!0})))}async function b(e=m()){let a=o(e,"last"),t=(await h(a).catch(()=>[])).find(i=>d[c(i).toLowerCase()]!==void 0);return t===void 0?null:{path:o(a,t),format:d[c(t).toLowerCase()]}}async function S(e,a,t,i){let{changeCount:r}=await e.peek();return r!==a.changeCount?"changed":(await e.write(t,i),"placed")}async function A(e,a,t,i){let{changeCount:r}=await e.peek();return r!==a.changeCount?"changed":(await e.writeText(t,i),"placed")}async function E(e,a=m()){let t=await b(a);return t?(await e.write(t.path,t.format),!0):!1}async function _(e,a){let t=p(o(a,`Copied image${c(e)}`));return await f(t,await y(e)),t}export{O as a,S as b,A as c,E as d,_ as e};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
-
import{i as Ht}from"./chunk-6L6C3GJU.js";import{E as Ot,d as Tt,e as gt}from"./chunk-3UEQ2OX6.js";import{a as wt}from"./chunk-M66BUNYO.js";import{c as et,e as xe}from"./chunk-TMUK2DD3.js";var it=et((zs,Qt)=>{"use strict";var Ut="[^\\\\/]",xr="(?=.)",Kt="[^/]",yt="(?:\\/|$)",Xt="(?:^|\\/)",Rt=`\\.{1,2}${yt}`,Cr="(?!\\.)",$r=`(?!${Xt}${Rt})`,Lr=`(?!\\.{0,1}${yt})`,vr=`(?!${Rt})`,wr="[^.\\/]",Tr=`${Kt}*?`,Or="/",jt={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:xr,QMARK:Kt,END_ANCHOR:yt,DOTS_SLASH:Rt,NO_DOT:Cr,NO_DOTS:$r,NO_DOT_SLASH:Lr,NO_DOTS_SLASH:vr,QMARK_NO_DOT:wr,STAR:Tr,START_ANCHOR:Xt,SEP:Or},Hr={...jt,SLASH_LITERAL:"[\\\\/]",QMARK:Ut,STAR:`${Ut}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},Ir={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Qt.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Ir,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Hr:jt}}});var ut=et(q=>{"use strict";var{REGEX_BACKSLASH:Pr,REGEX_REMOVE_BACKSLASH:kr,REGEX_SPECIAL_CHARS:Dr,REGEX_SPECIAL_CHARS_GLOBAL:Nr}=it();q.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);q.hasRegexChars=t=>Dr.test(t);q.isRegexChar=t=>t.length===1&&q.hasRegexChars(t);q.escapeRegex=t=>t.replace(Nr,"\\$1");q.toPosixSlashes=t=>t.replace(Pr,"/");q.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};q.removeBackslashes=t=>t.replace(kr,r=>r==="\\"?"":r);q.escapeLast=(t,r,e)=>{let s=t.lastIndexOf(r,e);return s===-1?t:t[s-1]==="\\"?q.escapeLast(t,r,s-1):`${t.slice(0,s)}\\${t.slice(s)}`};q.removePrefix=(t,r={})=>{let e=t;return e.startsWith("./")&&(e=e.slice(2),r.prefix="./"),e};q.wrapOutput=(t,r={},e={})=>{let s=e.contains?"":"^",n=e.contains?"":"$",o=`${s}(?:${t})${n}`;return r.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};q.basename=(t,{windows:r}={})=>{let e=t.split(r?/[\\/]/:"/"),s=e[e.length-1];return s===""?e[e.length-2]:s}});var re=et((Zs,ee)=>{"use strict";var zt=ut(),{CHAR_ASTERISK:St,CHAR_AT:Fr,CHAR_BACKWARD_SLASH:rt,CHAR_COMMA:Br,CHAR_DOT:_t,CHAR_EXCLAMATION_MARK:Et,CHAR_FORWARD_SLASH:te,CHAR_LEFT_CURLY_BRACE:bt,CHAR_LEFT_PARENTHESES:ft,CHAR_LEFT_SQUARE_BRACKET:Mr,CHAR_PLUS:Gr,CHAR_QUESTION_MARK:Yt,CHAR_RIGHT_CURLY_BRACE:Wr,CHAR_RIGHT_PARENTHESES:Zt,CHAR_RIGHT_SQUARE_BRACKET:qr}=it(),Vt=t=>t===te||t===rt,Jt=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Ur=(t,r)=>{let e=r||{},s=t.length-1,n=e.parts===!0||e.tokens===!0||e.scanToEnd===!0,o=[],i=[],l=[],h=t,d=-1,g=0,A=0,S=!1,x=!1,y=!1,C=!1,H=!1,G=!1,_=!1,B=!1,j=!1,I=!1,w=0,L,R,m={value:"",depth:0,isGlob:!1},u=()=>d>=s,M=()=>h.charCodeAt(d+1),D=()=>(L=R,h.charCodeAt(++d));for(;d<s;){R=D();let $;if(R===rt){_=m.backslashes=!0,R=D(),R===bt&&(G=!0);continue}if(G===!0||R===bt){for(w++;u()!==!0&&(R=D());){if(R===rt){_=m.backslashes=!0,D();continue}if(R===bt){w++;continue}if(G!==!0&&R===_t&&(R=D())===_t){if(S=m.isBrace=!0,y=m.isGlob=!0,I=!0,n===!0)continue;break}if(G!==!0&&R===Br){if(S=m.isBrace=!0,y=m.isGlob=!0,I=!0,n===!0)continue;break}if(R===Wr&&(w--,w===0)){G=!1,S=m.isBrace=!0,I=!0;break}}if(n===!0)continue;break}if(R===te){if(o.push(d),i.push(m),m={value:"",depth:0,isGlob:!1},I===!0)continue;if(L===_t&&d===g+1){g+=2;continue}A=d+1;continue}if(e.noext!==!0&&(R===Gr||R===Fr||R===St||R===Yt||R===Et)===!0&&M()===ft){if(y=m.isGlob=!0,C=m.isExtglob=!0,I=!0,R===Et&&d===g&&(j=!0),n===!0){let U=0;for(;u()!==!0&&(R=D());){if(R===rt){_=m.backslashes=!0,D();continue}if(R===ft){U++;continue}if(R===Zt&&--U===0){I=!0;break}}continue}break}if(R===St){if(L===St&&(H=m.isGlobstar=!0),y=m.isGlob=!0,I=!0,n===!0)continue;break}if(R===Yt){if(y=m.isGlob=!0,I=!0,n===!0)continue;break}if(R===Mr){for(;u()!==!0&&($=D());){if($===rt){_=m.backslashes=!0,D();continue}if($===qr){x=m.isBracket=!0,y=m.isGlob=!0,I=!0;break}}if(n===!0)continue;break}if(e.nonegate!==!0&&R===Et&&d===g){B=m.negated=!0,g++;continue}if(e.noparen!==!0&&R===ft){if(y=m.isGlob=!0,n===!0){let W=1;for(;u()!==!0&&(R=D());){if(R===rt){_=m.backslashes=!0,D();continue}if(R===ft){W++;continue}if(R===Zt&&--W===0){I=!0;break}}continue}break}if(y===!0){if(I=!0,n===!0)continue;break}}e.noext===!0&&(C=!1,y=!1);let P=h,c="",a="";g>0&&(c=h.slice(0,g),h=h.slice(g),A-=g),P&&y===!0&&A>0?(P=h.slice(0,A),a=h.slice(A)):y===!0?(P="",a=h):P=h,P&&P!==""&&P!=="/"&&P!==h&&Vt(P.charCodeAt(P.length-1))&&(P=P.slice(0,-1)),e.unescape===!0&&(a&&(a=zt.removeBackslashes(a)),P&&_===!0&&(P=zt.removeBackslashes(P)));let X={prefix:c,input:t,start:g,base:P,glob:a,isBrace:S,isBracket:x,isGlob:y,isExtglob:C,isGlobstar:H,negated:B,negatedExtglob:j};if(e.tokens===!0&&(X.maxDepth=0,Vt(R)||i.push(m),X.tokens=i),e.parts===!0||e.tokens===!0){let $;for(let N=0;N<o.length;N++){let J=$!==void 0?$+1:g,ot=o[N],Y=t.slice(J,ot);e.tokens&&(N===0&&g!==0?(i[N].isPrefix=!0,i[N].value=c):i[N].value=Y,Jt(i[N]),X.maxDepth+=i[N].depth),ot>=g&&(l.push(Y),$=ot)}let W=$!==void 0?$+1:g,U=t.slice(W);l.push(U),e.tokens&&$&&$+1<t.length&&(i[i.length-1].value=U,Jt(i[i.length-1]),X.maxDepth+=i[i.length-1].depth),X.slashes=o,X.parts=l}return X};ee.exports=Ur});var ie=et((Vs,oe)=>{"use strict";var at=it(),K=ut(),{MAX_LENGTH:ht,POSIX_REGEX_SOURCE:Kr,REGEX_NON_SPECIAL_CHARS:Xr,REGEX_SPECIAL_CHARS_BACKREF:jr,REPLACEMENTS:se}=at,Qr=(t,r)=>{if(typeof r.expandRange=="function")return r.expandRange(...t,r);t.sort();let e=`[${t.join("-")}]`;try{new RegExp(e)}catch{return t.map(n=>K.escapeRegex(n)).join("..")}return e},st=(t,r)=>`Missing ${t}: "${r}" - use "\\\\${r}" to match literal characters`,ne=t=>{let r=[],e=0,s=0,n=0,o="",i=!1;for(let l of t){if(i===!0){o+=l,i=!1;continue}if(l==="\\"){o+=l,i=!0;continue}if(l==='"'){n=n===1?0:1,o+=l;continue}if(n===0){if(l==="[")e++;else if(l==="]"&&e>0)e--;else if(e===0){if(l==="(")s++;else if(l===")"&&s>0)s--;else if(l==="|"&&s===0){r.push(o),o="";continue}}}o+=l}return r.push(o),r},zr=t=>{let r=!1;for(let e of t){if(r===!0){r=!1;continue}if(e==="\\"){r=!0;continue}if(/[?*+@!()[\]{}]/.test(e))return!1}return!0},xt=t=>{let r=t.trim(),e=!0;for(;e===!0;)e=!1,/^@\([^\\()[\]{}|]+\)$/.test(r)&&(r=r.slice(2,-1),e=!0);if(zr(r))return r.replace(/\\(.)/g,"$1")},Yr=t=>{let r=t.map(xt).filter(Boolean);for(let e=0;e<r.length;e++)for(let s=e+1;s<r.length;s++){let n=r[e],o=r[s],i=n[0];if(!(!i||n!==i.repeat(n.length)||o!==i.repeat(o.length))&&(n===o||n.startsWith(o)||o.startsWith(n)))return!0}return!1},mt=(t,r=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let e=0,s=0,n=0,o=!1;for(let i=1;i<t.length;i++){let l=t[i];if(o===!0){o=!1;continue}if(l==="\\"){o=!0;continue}if(l==='"'){n=n===1?0:1;continue}if(n!==1){if(l==="["){e++;continue}if(l==="]"&&e>0){e--;continue}if(!(e>0)){if(l==="("){s++;continue}if(l===")"&&(s--,s===0))return r===!0&&i!==t.length-1?void 0:{type:t[0],body:t.slice(2,i),end:i}}}}},Zr=t=>`${t.length===1?K.escapeRegex(t[0]):`[${t.map(e=>K.escapeRegex(e)).join("")}]`}*`,Vr=t=>{let r=0,e=[];for(;r<t.length;){let s=mt(t.slice(r),!1);if(!s||s.type!=="*")return;let n=ne(s.body).map(i=>i.trim());if(n.length!==1)return;let o=xt(n[0]);if(!o||o.length!==1)return;e.push(o),r+=s.end+1}if(!(e.length<1))return e},Jr=t=>{let r=0,e=t.trim(),s=mt(e);for(;s;)r++,e=s.body.trim(),s=mt(e);return r},ts=(t,r)=>{if(r.maxExtglobRecursion===!1)return{risky:!1};let e=typeof r.maxExtglobRecursion=="number"?r.maxExtglobRecursion:at.DEFAULT_MAX_EXTGLOB_RECURSION,s=ne(t).map(l=>l.trim());if(s.length>1&&(s.some(l=>l==="")||s.some(l=>/^[*?]+$/.test(l))||Yr(s)))return{risky:!0};let n=[],o=!1,i=!0;for(let l of s){let h=Vr(l);if(h){o=!0,n.push(...h);continue}let d=xt(l);if(d&&d.length===1){n.push(d);continue}if(i=!1,Jr(l)>e)return{risky:!0}}return o?i?{risky:!0,safeOutput:Zr([...new Set(n)])}:{risky:!0}:{risky:!1}},Ct=(t,r)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=se[t]||t;let e={...r},s=typeof e.maxLength=="number"?Math.min(ht,e.maxLength):ht,n=t.length;if(n>s)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${s}`);let o={type:"bos",value:"",output:e.prepend||""},i=[o],l=e.capture?"":"?:",h=at.globChars(e.windows),d=at.extglobChars(h),{DOT_LITERAL:g,PLUS_LITERAL:A,SLASH_LITERAL:S,ONE_CHAR:x,DOTS_SLASH:y,NO_DOT:C,NO_DOT_SLASH:H,NO_DOTS_SLASH:G,QMARK:_,QMARK_NO_DOT:B,STAR:j,START_ANCHOR:I}=h,w=f=>`(${l}(?:(?!${I}${f.dot?y:g}).)*?)`,L=e.dot?"":C,R=e.dot?_:B,m=e.bash===!0?w(e):j;e.capture&&(m=`(${m})`),typeof e.noext=="boolean"&&(e.noextglob=e.noext);let u={input:t,index:-1,start:0,dot:e.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=K.removePrefix(t,u),n=t.length;let M=[],D=[],P=[],c=o,a,X=()=>u.index===n-1,$=u.peek=(f=1)=>t[u.index+f],W=u.advance=()=>t[++u.index]||"",U=()=>t.slice(u.index+1),N=(f="",O=0)=>{u.consumed+=f,u.index+=O},J=f=>{u.output+=f.output!=null?f.output:f.value,N(f.value)},ot=()=>{let f=1;for(;$()==="!"&&($(2)!=="("||$(3)==="?");)W(),u.start++,f++;return f%2===0?!1:(u.negated=!0,u.start++,!0)},Y=f=>{u[f]++,P.push(f)},z=f=>{u[f]--,P.pop()},E=f=>{if(c.type==="globstar"){let O=u.braces>0&&(f.type==="comma"||f.type==="brace"),p=f.extglob===!0||M.length&&(f.type==="pipe"||f.type==="paren");f.type!=="slash"&&f.type!=="paren"&&!O&&!p&&(u.output=u.output.slice(0,-c.output.length),c.type="star",c.value="*",c.output=m,u.output+=c.output)}if(M.length&&f.type!=="paren"&&(M[M.length-1].inner+=f.value),(f.value||f.output)&&J(f),c&&c.type==="text"&&f.type==="text"){c.output=(c.output||c.value)+f.value,c.value+=f.value;return}f.prev=c,i.push(f),c=f},lt=(f,O)=>{let p={...d[O],conditions:1,inner:""};p.prev=c,p.parens=u.parens,p.output=u.output,p.startIndex=u.index,p.tokensIndex=i.length;let b=(e.capture?"(":"")+p.open;Y("parens"),E({type:f,value:O,output:u.output?"":x}),E({type:"paren",extglob:!0,value:W(),output:b}),M.push(p)},me=f=>{let O=t.slice(f.startIndex,u.index+1),p=t.slice(f.startIndex+2,u.index),b=ts(p,e);if((f.type==="plus"||f.type==="star")&&b.risky){let v=b.safeOutput?(f.output?"":x)+(e.capture?`(${b.safeOutput})`:b.safeOutput):void 0,Q=i[f.tokensIndex];Q.type="text",Q.value=O,Q.output=v||K.escapeRegex(O);for(let Z=f.tokensIndex+1;Z<i.length;Z++)i[Z].value="",i[Z].output="",delete i[Z].suffix;u.output=f.output+Q.output,u.backtrack=!0,E({type:"paren",extglob:!0,value:a,output:""}),z("parens");return}let T=f.close+(e.capture?")":""),F;if(f.type==="negate"){let v=m;if(f.inner&&f.inner.length>1&&f.inner.includes("/")&&(v=w(e)),(v!==m||X()||/^\)+$/.test(U()))&&(T=f.close=`)$))${v}`),f.inner.includes("*")&&(F=U())&&/^\.[^\\/.]+$/.test(F)){let Q=Ct(F,{...r,fastpaths:!1}).output;T=f.close=`)${Q})${v})`}f.prev.type==="bos"&&(u.negatedExtglob=!0)}E({type:"paren",extglob:!0,value:a,output:T}),z("parens")};if(e.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let f=!1,O=t.replace(jr,(p,b,T,F,v,Q)=>F==="\\"?(f=!0,p):F==="?"?b?b+F+(v?_.repeat(v.length):""):Q===0?R+(v?_.repeat(v.length):""):_.repeat(T.length):F==="."?g.repeat(T.length):F==="*"?b?b+F+(v?m:""):m:b?p:`\\${p}`);return f===!0&&(e.unescape===!0?O=O.replace(/\\/g,""):O=O.replace(/\\+/g,p=>p.length%2===0?"\\\\":p?"\\":"")),O===t&&e.contains===!0?(u.output=t,u):(u.output=K.wrapOutput(O,u,r),u)}for(;!X();){if(a=W(),a==="\0")continue;if(a==="\\"){let p=$();if(p==="/"&&e.bash!==!0||p==="."||p===";")continue;if(!p){a+="\\",E({type:"text",value:a});continue}let b=/^\\+/.exec(U()),T=0;if(b&&b[0].length>2&&(T=b[0].length,u.index+=T,T%2!==0&&(a+="\\")),e.unescape===!0?a=W():a+=W(),u.brackets===0){E({type:"text",value:a});continue}}if(u.brackets>0&&(a!=="]"||c.value==="["||c.value==="[^")){if(e.posix!==!1&&a===":"){let p=c.value.slice(1);if(p.includes("[")&&(c.posix=!0,p.includes(":"))){let b=c.value.lastIndexOf("["),T=c.value.slice(0,b),F=c.value.slice(b+2),v=Kr[F];if(v){c.value=T+v,u.backtrack=!0,W(),!o.output&&i.indexOf(c)===1&&(o.output=x);continue}}}(a==="["&&$()!==":"||a==="-"&&$()==="]")&&(a=`\\${a}`),a==="]"&&(c.value==="["||c.value==="[^")&&(a=`\\${a}`),e.posix===!0&&a==="!"&&c.value==="["&&(a="^"),c.value+=a,J({value:a});continue}if(u.quotes===1&&a!=='"'){a=K.escapeRegex(a),c.value+=a,J({value:a});continue}if(a==='"'){u.quotes=u.quotes===1?0:1,e.keepQuotes===!0&&E({type:"text",value:a});continue}if(a==="("){Y("parens"),E({type:"paren",value:a});continue}if(a===")"){if(u.parens===0&&e.strictBrackets===!0)throw new SyntaxError(st("opening","("));let p=M[M.length-1];if(p&&u.parens===p.parens+1){me(M.pop());continue}E({type:"paren",value:a,output:u.parens?")":"\\)"}),z("parens");continue}if(a==="["){if(e.nobracket===!0||!U().includes("]")){if(e.nobracket!==!0&&e.strictBrackets===!0)throw new SyntaxError(st("closing","]"));a=`\\${a}`}else Y("brackets");E({type:"bracket",value:a});continue}if(a==="]"){if(e.nobracket===!0||c&&c.type==="bracket"&&c.value.length===1){E({type:"text",value:a,output:`\\${a}`});continue}if(u.brackets===0){if(e.strictBrackets===!0)throw new SyntaxError(st("opening","["));E({type:"text",value:a,output:`\\${a}`});continue}z("brackets");let p=c.value.slice(1);if(c.posix!==!0&&p[0]==="^"&&!p.includes("/")&&(a=`/${a}`),c.value+=a,J({value:a}),e.literalBrackets===!1||K.hasRegexChars(p))continue;let b=K.escapeRegex(c.value);if(u.output=u.output.slice(0,-c.value.length),e.literalBrackets===!0){u.output+=b,c.value=b;continue}c.value=`(${l}${b}|${c.value})`,u.output+=c.value;continue}if(a==="{"&&e.nobrace!==!0){Y("braces");let p={type:"brace",value:a,output:"(",outputIndex:u.output.length,tokensIndex:u.tokens.length};D.push(p),E(p);continue}if(a==="}"){let p=D[D.length-1];if(e.nobrace===!0||!p){E({type:"text",value:a,output:a});continue}let b=")";if(p.dots===!0){let T=i.slice(),F=[];for(let v=T.length-1;v>=0&&(i.pop(),T[v].type!=="brace");v--)T[v].type!=="dots"&&F.unshift(T[v].value);b=Qr(F,e),u.backtrack=!0}if(p.comma!==!0&&p.dots!==!0){let T=u.output.slice(0,p.outputIndex),F=u.tokens.slice(p.tokensIndex);p.value=p.output="\\{",a=b="\\}",u.output=T;for(let v of F)u.output+=v.output||v.value}E({type:"brace",value:a,output:b}),z("braces"),D.pop();continue}if(a==="|"){M.length>0&&M[M.length-1].conditions++,E({type:"text",value:a});continue}if(a===","){let p=a,b=D[D.length-1];b&&P[P.length-1]==="braces"&&(b.comma=!0,p="|"),E({type:"comma",value:a,output:p});continue}if(a==="/"){if(c.type==="dot"&&u.index===u.start+1){u.start=u.index+1,u.consumed="",u.output="",i.pop(),c=o;continue}E({type:"slash",value:a,output:S});continue}if(a==="."){if(u.braces>0&&c.type==="dot"){c.value==="."&&(c.output=g);let p=D[D.length-1];c.type="dots",c.output+=a,c.value+=a,p.dots=!0;continue}if(u.braces+u.parens===0&&c.type!=="bos"&&c.type!=="slash"){E({type:"text",value:a,output:g});continue}E({type:"dot",value:a,output:g});continue}if(a==="?"){if(!(c&&c.value==="(")&&e.noextglob!==!0&&$()==="("&&$(2)!=="?"){lt("qmark",a);continue}if(c&&c.type==="paren"){let b=$(),T=a;(c.value==="("&&!/[!=<:]/.test(b)||b==="<"&&!/<([!=]|\w+>)/.test(U()))&&(T=`\\${a}`),E({type:"text",value:a,output:T});continue}if(e.dot!==!0&&(c.type==="slash"||c.type==="bos")){E({type:"qmark",value:a,output:B});continue}E({type:"qmark",value:a,output:_});continue}if(a==="!"){if(e.noextglob!==!0&&$()==="("&&($(2)!=="?"||!/[!=<:]/.test($(3)))){lt("negate",a);continue}if(e.nonegate!==!0&&u.index===0){ot();continue}}if(a==="+"){if(e.noextglob!==!0&&$()==="("&&$(2)!=="?"){lt("plus",a);continue}if(c&&c.value==="("||e.regex===!1){E({type:"plus",value:a,output:A});continue}if(c&&(c.type==="bracket"||c.type==="paren"||c.type==="brace")||u.parens>0){E({type:"plus",value:a});continue}E({type:"plus",value:A});continue}if(a==="@"){if(e.noextglob!==!0&&$()==="("&&$(2)!=="?"){E({type:"at",extglob:!0,value:a,output:""});continue}E({type:"text",value:a});continue}if(a!=="*"){(a==="$"||a==="^")&&(a=`\\${a}`);let p=Xr.exec(U());p&&(a+=p[0],u.index+=p[0].length),E({type:"text",value:a});continue}if(c&&(c.type==="globstar"||c.star===!0)){c.type="star",c.star=!0,c.value+=a,c.output=m,u.backtrack=!0,u.globstar=!0,N(a);continue}let f=U();if(e.noextglob!==!0&&/^\([^?]/.test(f)){lt("star",a);continue}if(c.type==="star"){if(e.noglobstar===!0){N(a);continue}let p=c.prev,b=p.prev,T=p.type==="slash"||p.type==="bos",F=b&&(b.type==="star"||b.type==="globstar");if(e.bash===!0&&(!T||f[0]&&f[0]!=="/")){E({type:"star",value:a,output:""});continue}let v=u.braces>0&&(p.type==="comma"||p.type==="brace"),Q=M.length&&(p.type==="pipe"||p.type==="paren");if(!T&&p.type!=="paren"&&!v&&!Q){E({type:"star",value:a,output:""});continue}for(;f.slice(0,3)==="/**";){let tt=t[u.index+4];if(tt&&tt!=="/")break;f=f.slice(3),N("/**",3)}let Z=X()||u.parens>0&&f===")".repeat(u.parens)&&!M.some(tt=>tt.type==="negate");if(p.type==="bos"&&X()){c.type="globstar",c.value+=a,c.output=w(e),u.output=c.output,u.globstar=!0,N(a);continue}if(p.type==="slash"&&p.prev.type!=="bos"&&!F&&Z){u.output=u.output.slice(0,-(p.output+c.output).length),p.output=`(?:${p.output}`,c.type="globstar",c.output=w(e)+(e.strictSlashes?")":"|$)"),c.value+=a,u.globstar=!0,u.output+=p.output+c.output,N(a);continue}if(p.type==="slash"&&p.prev.type!=="bos"&&f[0]==="/"){let tt=f[1]!==void 0?"|$":"";u.output=u.output.slice(0,-(p.output+c.output).length),p.output=`(?:${p.output}`,c.type="globstar",c.output=`${w(e)}${S}|${S}${tt})`,c.value+=a,u.output+=p.output+c.output,u.globstar=!0,N(a+W()),E({type:"slash",value:"/",output:""});continue}if(p.type==="bos"&&f[0]==="/"){c.type="globstar",c.value+=a,c.output=`(?:^|${S}|${w(e)}${S})`,u.output=c.output,u.globstar=!0,N(a+W()),E({type:"slash",value:"/",output:""});continue}u.output=u.output.slice(0,-c.output.length),c.type="globstar",c.output=w(e),c.value+=a,u.output+=c.output,u.globstar=!0,N(a);continue}let O={type:"star",value:a,output:m};if(e.bash===!0){O.output=".*?",(c.type==="bos"||c.type==="slash")&&(O.output=L+O.output),E(O);continue}if(c&&(c.type==="bracket"||c.type==="paren")&&e.regex===!0){O.output=a,E(O);continue}(u.index===u.start||c.type==="slash"||c.type==="dot")&&(c.type==="dot"?(u.output+=H,c.output+=H):e.dot===!0?(u.output+=G,c.output+=G):(u.output+=L,c.output+=L),$()!=="*"&&(u.output+=x,c.output+=x)),E(O)}for(;u.brackets>0;){if(e.strictBrackets===!0)throw new SyntaxError(st("closing","]"));u.output=K.escapeLast(u.output,"["),z("brackets")}for(;u.parens>0;){if(e.strictBrackets===!0)throw new SyntaxError(st("closing",")"));u.output=K.escapeLast(u.output,"("),z("parens")}for(;u.braces>0;){if(e.strictBrackets===!0)throw new SyntaxError(st("closing","}"));u.output=K.escapeLast(u.output,"{"),z("braces")}if(e.strictSlashes!==!0&&(c.type==="star"||c.type==="bracket")&&E({type:"maybe_slash",value:"",output:`${S}?`}),u.backtrack===!0){u.output="";for(let f of u.tokens)u.output+=f.output!=null?f.output:f.value,f.suffix&&(u.output+=f.suffix)}return u};Ct.fastpaths=(t,r)=>{let e={...r},s=typeof e.maxLength=="number"?Math.min(ht,e.maxLength):ht,n=t.length;if(n>s)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${s}`);t=se[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:i,ONE_CHAR:l,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:g,NO_DOTS_SLASH:A,STAR:S,START_ANCHOR:x}=at.globChars(e.windows),y=e.dot?g:d,C=e.dot?A:d,H=e.capture?"":"?:",G={negated:!1,prefix:""},_=e.bash===!0?".*?":S;e.capture&&(_=`(${_})`);let B=L=>L.noglobstar===!0?_:`(${H}(?:(?!${x}${L.dot?h:o}).)*?)`,j=L=>{switch(L){case"*":return`${y}${l}${_}`;case".*":return`${o}${l}${_}`;case"*.*":return`${y}${_}${o}${l}${_}`;case"*/*":return`${y}${_}${i}${l}${C}${_}`;case"**":return y+B(e);case"**/*":return`(?:${y}${B(e)}${i})?${C}${l}${_}`;case"**/*.*":return`(?:${y}${B(e)}${i})?${C}${_}${o}${l}${_}`;case"**/.*":return`(?:${y}${B(e)}${i})?${o}${l}${_}`;default:{let R=/^(.*?)\.(\w+)$/.exec(L);if(!R)return;let m=j(R[1]);return m?m+o+R[2]:void 0}}},I=K.removePrefix(t,G),w=j(I);return w&&e.strictSlashes!==!0&&(w+=`${i}?`),w};oe.exports=Ct});var ce=et((Js,ae)=>{"use strict";var es=re(),$t=ie(),ue=ut(),rs=it(),ss=t=>t&&typeof t=="object"&&!Array.isArray(t),k=(t,r,e=!1)=>{if(Array.isArray(t)){let g=t.map(S=>k(S,r,e));return S=>{for(let x of g){let y=x(S);if(y)return y}return!1}}let s=ss(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!s)throw new TypeError("Expected pattern to be a non-empty string");let n=r||{},o=n.windows,i=s?k.compileRe(t,r):k.makeRe(t,r,!1,!0),l=i.state;delete i.state;let h=()=>!1;if(n.ignore){let g={...r,ignore:null,onMatch:null,onResult:null};h=k(n.ignore,g,e)}let d=(g,A=!1)=>{let{isMatch:S,match:x,output:y}=k.test(g,i,r,{glob:t,posix:o}),C={glob:t,state:l,regex:i,posix:o,input:g,output:y,match:x,isMatch:S};return typeof n.onResult=="function"&&n.onResult(C),S===!1?(C.isMatch=!1,A?C:!1):h(g)?(typeof n.onIgnore=="function"&&n.onIgnore(C),C.isMatch=!1,A?C:!1):(typeof n.onMatch=="function"&&n.onMatch(C),A?C:!0)};return e&&(d.state=l),d};k.test=(t,r,e,{glob:s,posix:n}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=e||{},i=o.format||(n?ue.toPosixSlashes:null),l=t===s,h=l&&i?i(t):t;return l===!1&&(h=i?i(t):t,l=h===s),(l===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?l=k.matchBase(t,r,e,n):l=r.exec(h)),{isMatch:!!l,match:l,output:h}};k.matchBase=(t,r,e,s=e&&e.windows)=>(r instanceof RegExp?r:k.makeRe(r,e)).test(ue.basename(t,{windows:s}));k.isMatch=(t,r,e)=>k(r,e)(t);k.parse=(t,r)=>Array.isArray(t)?t.map(e=>k.parse(e,r)):$t(t,{...r,fastpaths:!1});k.scan=(t,r)=>es(t,r);k.compileRe=(t,r,e=!1,s=!1)=>{if(e===!0)return t.output;let n=r||{},o=n.contains?"":"^",i=n.contains?"":"$",l=`${o}(?:${t.output})${i}`;t&&t.negated===!0&&(l=`^(?!${l}).*$`);let h=k.toRegex(l,r);return s===!0&&(h.state=t),h};k.makeRe=(t,r={},e=!1,s=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return r.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(n.output=$t.fastpaths(t,r)),n.output||(n=$t(t,r)),k.compileRe(n,r,e,s)};k.toRegex=(t,r)=>{try{let e=r||{};return new RegExp(t,e.flags||(e.nocase?"i":""))}catch(e){if(r&&r.debug===!0)throw e;return/$^/}};k.constants=rs;ae.exports=k});var he=et((tn,fe)=>{"use strict";var le=ce(),ns=ut();function pe(t,r,e=!1){return r&&(r.windows===null||r.windows===void 0)&&(r={...r,windows:ns.isWindows()}),le(t,r,e)}Object.assign(pe,le);fe.exports=pe});import{existsSync as ks}from"node:fs";import{stat as Ds}from"node:fs/promises";import{resolve as Ee}from"node:path";import{readdir as os,readdirSync as is,realpath as us,realpathSync as as,stat as cs,statSync as ls}from"fs";import{isAbsolute as ps,posix as V,resolve as fs}from"path";import{fileURLToPath as hs}from"url";import{createRequire as Ce}from"module";import{basename as $e,dirname as dt,normalize as Le,relative as ve,resolve as we,sep as kt}from"path";import*as Te from"fs";var It=Ce(import.meta.url);function Oe(t){let r=Le(t);return r.length>1&&r[r.length-1]===kt&&(r=r.substring(0,r.length-1)),r}var He=/[\\/]/g;function Dt(t,r){return t.replace(He,r)}var Ie=/^[a-z]:[\\/]$/i;function Pe(t){return t==="/"||Ie.test(t)}function At(t,r){let{resolvePaths:e,normalizePath:s,pathSeparator:n}=r,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(e&&(t=we(t)),(s||o)&&(t=Oe(t)),t===".")return"";let i=t[t.length-1]!==n;return Dt(i?t+n:t,n)}function Nt(t,r){return r+t}function ke(t,r){return function(e,s){return s.startsWith(t)?s.slice(t.length)+e:Dt(ve(t,s),r.pathSeparator)+r.pathSeparator+e}}function De(t){return t}function Ne(t,r,e){return r+t+e}function Fe(t,r){let{relativePaths:e,includeBasePath:s}=r;return e&&t?ke(t,r):s?Nt:De}function Be(t){return function(r,e){e.push(r.substring(t.length)||".")}}function Me(t){return function(r,e,s){let n=r.substring(t.length)||".";s.every(o=>o(n,!0))&&e.push(n)}}var Ge=(t,r)=>{r.push(t||".")},We=(t,r,e)=>{let s=t||".";e.every(n=>n(s,!0))&&r.push(s)},qe=()=>{};function Ue(t,r){let{includeDirs:e,filters:s,relativePaths:n}=r;return e?n?s&&s.length?Me(t):Be(t):s&&s.length?We:Ge:qe}var Ke=(t,r,e,s)=>{s.every(n=>n(t,!1))&&e.files++},Xe=(t,r,e,s)=>{s.every(n=>n(t,!1))&&r.push(t)},je=(t,r,e,s)=>{e.files++},Qe=(t,r)=>{r.push(t)},ze=()=>{};function Ye(t){let{excludeFiles:r,filters:e,onlyCounts:s}=t;return r?ze:e&&e.length?s?Ke:Xe:s?je:Qe}var Ze=t=>t,Ve=()=>[""].slice(0,0);function Je(t){return t.group?Ve:Ze}var tr=(t,r,e)=>{t.push({directory:r,files:e,dir:r})},er=()=>{};function rr(t){return t.group?tr:er}var sr=function(t,r,e){let{queue:s,fs:n,options:{suppressErrors:o}}=r;s.enqueue(),n.realpath(t,(i,l)=>{if(i)return s.dequeue(o?null:i,r);n.stat(l,(h,d)=>{if(h)return s.dequeue(o?null:h,r);if(d.isDirectory()&&Ft(t,l,r))return s.dequeue(null,r);e(d,l),s.dequeue(null,r)})})},nr=function(t,r,e){let{queue:s,fs:n,options:{suppressErrors:o}}=r;s.enqueue();try{let i=n.realpathSync(t),l=n.statSync(i);if(l.isDirectory()&&Ft(t,i,r))return;e(l,i)}catch(i){if(!o)throw i}};function or(t,r){return!t.resolveSymlinks||t.excludeSymlinks?null:r?nr:sr}function Ft(t,r,e){if(e.options.useRealPaths)return ir(r,e);let s=dt(t),n=1;for(;s!==e.root&&n<2;){let o=e.symlinks.get(s);!!o&&(o===r||o.startsWith(r)||r.startsWith(o))?n++:s=dt(s)}return e.symlinks.set(t,r),n>1}function ir(t,r){return r.visited.includes(t+r.options.pathSeparator)}var ur=t=>t.counts,ar=t=>t.groups,cr=t=>t.paths,lr=t=>t.paths.slice(0,t.options.maxFiles),pr=(t,r,e)=>(pt(r,e,t.counts,t.options.suppressErrors),null),fr=(t,r,e)=>(pt(r,e,t.paths,t.options.suppressErrors),null),hr=(t,r,e)=>(pt(r,e,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),gr=(t,r,e)=>(pt(r,e,t.groups,t.options.suppressErrors),null);function pt(t,r,e,s){r(t&&!s?t:null,e)}function Ar(t,r){let{onlyCounts:e,group:s,maxFiles:n}=t;return e?r?ur:pr:s?r?ar:gr:n?r?lr:hr:r?cr:fr}var Bt={withFileTypes:!0},dr=(t,r,e,s,n)=>{if(t.queue.enqueue(),s<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(r),t.counts.directories++,o.readdir(r||".",Bt,(i,l=[])=>{n(l,e,s),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},yr=(t,r,e,s,n)=>{let{fs:o}=t;if(s<0)return;t.visited.push(r),t.counts.directories++;let i=[];try{i=o.readdirSync(r||".",Bt)}catch(l){if(!t.options.suppressErrors)throw l}n(i,e,s)};function Rr(t){return t?yr:dr}var Sr=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,r){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,r),t&&(r.controller.abort(),this.onQueueEmpty=void 0))}},_r=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},Er=class{aborted=!1;abort(){this.aborted=!0}},Mt=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,r,e){this.isSynchronous=!e,this.callbackInvoker=Ar(r,this.isSynchronous),this.root=At(t,r),this.state={root:Pe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new _r,options:r,queue:new Sr((s,n)=>this.callbackInvoker(n,s,e)),symlinks:new Map,visited:[""].slice(0,0),controller:new Er,fs:r.fs||Te},this.joinPath=Fe(this.root,r),this.pushDirectory=Ue(this.root,r),this.pushFile=Ye(r),this.getArray=Je(r),this.groupFiles=rr(r),this.resolveSymlink=or(r,this.isSynchronous),this.walkDirectory=Rr(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,r,e)=>{let{paths:s,options:{filters:n,resolveSymlinks:o,excludeSymlinks:i,exclude:l,maxFiles:h,signal:d,useRealPaths:g,pathSeparator:A},controller:S}=this.state;if(S.aborted||d&&d.aborted||h&&s.length>h)return;let x=this.getArray(this.state.paths);for(let y=0;y<t.length;++y){let C=t[y];if(C.isFile()||C.isSymbolicLink()&&!o&&!i){let H=this.joinPath(C.name,r);this.pushFile(H,x,this.state.counts,n)}else if(C.isDirectory()){let H=Ne(C.name,r,this.state.options.pathSeparator);if(l&&l(C.name,H))continue;this.pushDirectory(H,s,n),this.walkDirectory(this.state,H,H,e-1,this.walk)}else if(this.resolveSymlink&&C.isSymbolicLink()){let H=Nt(C.name,r);this.resolveSymlink(H,this.state,(G,_)=>{if(G.isDirectory()){if(_=At(_,this.state.options),l&&l(C.name,g?_:H+A))return;this.walkDirectory(this.state,_,g?_:H+A,e-1,this.walk)}else{_=g?_:H;let B=$e(_),j=At(dt(_),this.state.options);_=this.joinPath(B,j),this.pushFile(_,x,this.state.counts,n)}})}}this.groupFiles(this.state.groups,r,x)}};function br(t,r){return new Promise((e,s)=>{Gt(t,r,(n,o)=>{if(n)return s(n);e(o)})})}function Gt(t,r,e){new Mt(t,r,e).start()}function mr(t,r){return new Mt(t,r).start()}var Pt=class{constructor(t,r){this.root=t,this.options=r}withPromise(){return br(this.root,this.options)}withCallback(t){Gt(this.root,this.options,t)}sync(){return mr(this.root,this.options)}},Wt=null;try{It.resolve("picomatch"),Wt=It("picomatch")}catch{}var qt=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:kt,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Pt(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,r){return this.options={...this.options,...r},new Pt(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...r){let e=this.globFunction||Wt;if(!e)throw new Error("Please specify a glob function to use glob matching.");var s=this.globCache[t.join("\0")];return s||(s=e(t,...r),this.globCache[t.join("\0")]=s),this.options.filters.push(n=>s(n)),this}};var nt=xe(he(),1),gs=Array.isArray,ye=/\\/g,As=/^[A-Za-z]:$/,Re=process.platform==="win32",ds=/^(\/?\.\.)+$/;function ys(t,r={}){let e=t.length,s=Array(e),n=Array(e),o,i;for(o=0;o<e;o++){let l=Se(t[o]);s[o]=l;let h=l.length,d=Array(h);for(i=0;i<h;i++)d[i]=(0,nt.default)(l[i],r);n[o]=d}return l=>{let h=l.split("/");if(h[0]===".."&&ds.test(l))return!0;for(o=0;o<e;o++){let d=s[o],g=n[o],A=h.length,S=Math.min(A,d.length);for(i=0;i<S;){let x=d[i];if(x.includes("/"))return!0;if(!g[i](h[i]))break;if(!r.noglobstar&&x==="**")return!0;i++}if(i===A)return!0}return!1}}var Rs=/^[A-Z]:\/$/i,Ss=Re?t=>Rs.test(t):t=>t==="/";function ge(t,r,e){if(t===r||r.startsWith(`${t}/`)){if(e){let n=t.length+ +!Ss(t);return(o,i)=>o.slice(n,i?-1:void 0)||"."}let s=r.slice(t.length+1);return s?(n,o)=>{if(n===".")return s;let i=`${s}/${n}`;return o?i.slice(0,-1):i}:(n,o)=>o&&n!=="."?n.slice(0,-1):n}return e?s=>V.relative(t,s)||".":s=>V.relative(t,`${r}/${s}`)||"."}function _s(t,r){if(r.startsWith(`${t}/`)){let e=r.slice(t.length+1);return s=>`${e}/${s}`}return e=>{let s=V.relative(t,`${r}/${e}`);return e[e.length-1]==="/"&&s!==""?`${s}/`:s||"."}}function Ae(t){return t.replace(As,r=>`${r}/`)}var Es={parts:!0};function Se(t){var r;let e=nt.default.scan(t,Es);return!((r=e.parts)===null||r===void 0)&&r.length?e.parts:[t]}var bs=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,ms=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,xs=t=>t.replace(bs,"\\$&"),Cs=t=>t.replace(ms,"\\$&"),$s=Re?Cs:xs;function Ls(t,r){if(r?.caseSensitiveMatch===!1)return!0;let e=nt.default.scan(t);return e.isGlob||e.negated}function ct(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function _e(t){return typeof t=="string"?[t]:t??[]}var vs=/^(\/?\.\.)+/,ws=/\\(?=[()[\]{}!*+?@|])/g;function Lt(t,r,e,s){var n;let o=r.cwd,i=t;t[t.length-1]==="/"&&(i=t.slice(0,-1)),i[i.length-1]!=="*"&&r.expandDirectories&&(i+="/**");let l=$s(o);i=ps(i.replace(ws,""))?V.relative(l,i):V.normalize(i);let h=(n=vs.exec(i))===null||n===void 0?void 0:n[0],d=Se(i);if(h){let A=(h.length+1)/3,S=0,x=l.split("/");for(;S<A&&d[S+A]===x[x.length+S-A];)i=i.slice(0,(A-S-1)*3)+i.slice((A-S)*3+d[S+A].length+1)||".",S++;let y=V.join(o,h.slice(S*3));y[0]!=="."&&e.root.length>y.length&&(e.root=Ae(y),e.depthOffset=-A+S)}if(!s&&e.depthOffset>=0){var g;(g=e.commonPath)!==null&&g!==void 0||(e.commonPath=d);let A=[],S=Math.min(e.commonPath.length,d.length);for(let x=0;x<S;x++){let y=d[x];if(y==="**"&&!d[x+1]){A.pop();break}if(x===d.length-1||y!==e.commonPath[x]||Ls(y))break;A.push(y)}e.depthOffset=A.length,e.commonPath=A,e.root=Ae(A.length>0?V.join(o,...A):o)}return i}function Ts(t,r,e){let s=[],n=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&n.push(Lt(o,t,e,!0));for(let o of r)o&&(o[0]!=="!"||o[1]==="("?s.push(Lt(o,t,e,!1)):(o[1]!=="!"||o[2]==="(")&&n.push(Lt(o.slice(1),t,e,!0)));return{match:s,ignore:n}}function Os(t,r){let e=t.cwd,s={root:e,depthOffset:0},n=Ts(t,r,s);t.debug&&ct("internal processing patterns:",n);let{absolute:o,caseSensitiveMatch:i,debug:l,dot:h,followSymbolicLinks:d,onlyDirectories:g}=t,A=s.root.replace(ye,""),S={dot:h,nobrace:t.braceExpansion===!1,nocase:!i,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},x=(0,nt.default)(n.match,S),y=(0,nt.default)(n.ignore,S),C=ys(n.match,S),H=ge(e,A,o),G=o?H:ge(e,A,!0),_=(I,w)=>{let L=G(w,!0);return L!=="."&&!C(L)||y(L)},B;t.deep!==void 0&&(B=Math.round(t.deep-s.depthOffset));let j=new qt({filters:[l?(I,w)=>{let L=H(I,w),R=x(L)&&!y(L);return R&&ct(`matched ${L}`),R}:(I,w)=>{let L=H(I,w);return x(L)&&!y(L)}],exclude:l?(I,w)=>{let L=_(I,w);return ct(`${L?"skipped":"crawling"} ${w}`),L}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:d,excludeSymlinks:!d,excludeFiles:g,includeDirs:g||!t.onlyFiles,maxDepth:B,signal:t.signal}).crawl(A);return t.debug&&ct("internal properties:",{...s,root:A}),[j,e!==A&&!o&&_s(e,A)]}function Hs(t,r){if(r)for(let e=t.length-1;e>=0;e--)t[e]=r(t[e]);return t}var de={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Is(t){let r=Object.assign({},t);for(let e in de)r[e]===void 0&&Object.assign(r,{[e]:de[e]});return r.cwd=(r.cwd instanceof URL?hs(r.cwd):fs(r.cwd||process.cwd())).replace(ye,"/"),r.ignore=_e(r.ignore),r.fs&&(r.fs={readdir:r.fs.readdir||os,readdirSync:r.fs.readdirSync||is,realpath:r.fs.realpath||us,realpathSync:r.fs.realpathSync||as,stat:r.fs.stat||cs,statSync:r.fs.statSync||ls}),r.debug&&ct("globbing with options:",r),r}function Ps(t,r={}){var e;if(t&&r?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let s=gs(t)||typeof t=="string",n=_e((e=s?t:t.patterns)!==null&&e!==void 0?e:"**/*"),o=Is(s?r:t);return n.length>0?Os(o,n):[]}async function vt(t,r){let[e,s]=Ps(t,r);return e?Hs(await e.withPromise(),s):[]}var be=Object.values(wt).flatMap(t=>t.extensions).map(t=>t.slice(1));function Ns(t){return/[*?[\]{}]/.test(t)}async function Fs(t,r){let e=r?`**/*.{${be.join(",")}}`:`*.{${be.join(",")}}`;return(await vt([e],{cwd:t,absolute:!0,onlyFiles:!0,caseSensitiveMatch:!1})).sort()}async function Bs(t,r,e,s){let n=await Fs(t,r);if(n.length===0){e.push({path:t,error:Ot(t)});return}for(let o of n)await s(o,t,!1)}async function gn(t,r){let e=[],s=[],n=new Map,o=new Set,i=async(l,h,d)=>{let g=Ee(l);if(!o.has(g)){o.add(g);try{e.push(await Ht(g)),h&&n.set(g,h)}catch(A){if(Tt(A))s.push({path:g,error:A});else if(d)throw A}}};for(let l of t){let h=Ee(l);if(Ns(l)&&!ks(h)){let g=(r.platform??process.platform)==="win32"?l.replaceAll("\\","/"):l,A=await vt([g],{absolute:!0,onlyFiles:!0});A.length===0&&s.push({path:h,error:gt(h)});for(let S of A.sort())await i(S,void 0,!1);continue}let d;try{d=await Ds(h)}catch{s.push({path:h,error:gt(h)});continue}if(d.isDirectory()){await Bs(h,r.recursive,s,i);continue}await i(h,void 0,!0)}return{sources:e,failures:s,roots:n}}export{gn as a};
|
|
3
|
+
import{j as Ht}from"./chunk-V3I6DSF4.js";import{G as Ot,d as Tt,e as gt}from"./chunk-WIPP5TWQ.js";import{a as wt}from"./chunk-H3DIRJFE.js";import{c as et,e as xe}from"./chunk-TMUK2DD3.js";var it=et((zs,Qt)=>{"use strict";var Ut="[^\\\\/]",xr="(?=.)",Kt="[^/]",yt="(?:\\/|$)",Xt="(?:^|\\/)",Rt=`\\.{1,2}${yt}`,Cr="(?!\\.)",$r=`(?!${Xt}${Rt})`,Lr=`(?!\\.{0,1}${yt})`,vr=`(?!${Rt})`,wr="[^.\\/]",Tr=`${Kt}*?`,Or="/",jt={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:xr,QMARK:Kt,END_ANCHOR:yt,DOTS_SLASH:Rt,NO_DOT:Cr,NO_DOTS:$r,NO_DOT_SLASH:Lr,NO_DOTS_SLASH:vr,QMARK_NO_DOT:wr,STAR:Tr,START_ANCHOR:Xt,SEP:Or},Hr={...jt,SLASH_LITERAL:"[\\\\/]",QMARK:Ut,STAR:`${Ut}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},Ir={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Qt.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Ir,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Hr:jt}}});var ut=et(q=>{"use strict";var{REGEX_BACKSLASH:Pr,REGEX_REMOVE_BACKSLASH:kr,REGEX_SPECIAL_CHARS:Dr,REGEX_SPECIAL_CHARS_GLOBAL:Nr}=it();q.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);q.hasRegexChars=t=>Dr.test(t);q.isRegexChar=t=>t.length===1&&q.hasRegexChars(t);q.escapeRegex=t=>t.replace(Nr,"\\$1");q.toPosixSlashes=t=>t.replace(Pr,"/");q.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};q.removeBackslashes=t=>t.replace(kr,r=>r==="\\"?"":r);q.escapeLast=(t,r,e)=>{let s=t.lastIndexOf(r,e);return s===-1?t:t[s-1]==="\\"?q.escapeLast(t,r,s-1):`${t.slice(0,s)}\\${t.slice(s)}`};q.removePrefix=(t,r={})=>{let e=t;return e.startsWith("./")&&(e=e.slice(2),r.prefix="./"),e};q.wrapOutput=(t,r={},e={})=>{let s=e.contains?"":"^",n=e.contains?"":"$",o=`${s}(?:${t})${n}`;return r.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};q.basename=(t,{windows:r}={})=>{let e=t.split(r?/[\\/]/:"/"),s=e[e.length-1];return s===""?e[e.length-2]:s}});var re=et((Zs,ee)=>{"use strict";var zt=ut(),{CHAR_ASTERISK:St,CHAR_AT:Fr,CHAR_BACKWARD_SLASH:rt,CHAR_COMMA:Br,CHAR_DOT:_t,CHAR_EXCLAMATION_MARK:Et,CHAR_FORWARD_SLASH:te,CHAR_LEFT_CURLY_BRACE:bt,CHAR_LEFT_PARENTHESES:ft,CHAR_LEFT_SQUARE_BRACKET:Mr,CHAR_PLUS:Gr,CHAR_QUESTION_MARK:Yt,CHAR_RIGHT_CURLY_BRACE:Wr,CHAR_RIGHT_PARENTHESES:Zt,CHAR_RIGHT_SQUARE_BRACKET:qr}=it(),Vt=t=>t===te||t===rt,Jt=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Ur=(t,r)=>{let e=r||{},s=t.length-1,n=e.parts===!0||e.tokens===!0||e.scanToEnd===!0,o=[],i=[],l=[],h=t,d=-1,g=0,A=0,S=!1,x=!1,y=!1,C=!1,H=!1,G=!1,_=!1,B=!1,j=!1,I=!1,w=0,L,R,m={value:"",depth:0,isGlob:!1},u=()=>d>=s,M=()=>h.charCodeAt(d+1),D=()=>(L=R,h.charCodeAt(++d));for(;d<s;){R=D();let $;if(R===rt){_=m.backslashes=!0,R=D(),R===bt&&(G=!0);continue}if(G===!0||R===bt){for(w++;u()!==!0&&(R=D());){if(R===rt){_=m.backslashes=!0,D();continue}if(R===bt){w++;continue}if(G!==!0&&R===_t&&(R=D())===_t){if(S=m.isBrace=!0,y=m.isGlob=!0,I=!0,n===!0)continue;break}if(G!==!0&&R===Br){if(S=m.isBrace=!0,y=m.isGlob=!0,I=!0,n===!0)continue;break}if(R===Wr&&(w--,w===0)){G=!1,S=m.isBrace=!0,I=!0;break}}if(n===!0)continue;break}if(R===te){if(o.push(d),i.push(m),m={value:"",depth:0,isGlob:!1},I===!0)continue;if(L===_t&&d===g+1){g+=2;continue}A=d+1;continue}if(e.noext!==!0&&(R===Gr||R===Fr||R===St||R===Yt||R===Et)===!0&&M()===ft){if(y=m.isGlob=!0,C=m.isExtglob=!0,I=!0,R===Et&&d===g&&(j=!0),n===!0){let U=0;for(;u()!==!0&&(R=D());){if(R===rt){_=m.backslashes=!0,D();continue}if(R===ft){U++;continue}if(R===Zt&&--U===0){I=!0;break}}continue}break}if(R===St){if(L===St&&(H=m.isGlobstar=!0),y=m.isGlob=!0,I=!0,n===!0)continue;break}if(R===Yt){if(y=m.isGlob=!0,I=!0,n===!0)continue;break}if(R===Mr){for(;u()!==!0&&($=D());){if($===rt){_=m.backslashes=!0,D();continue}if($===qr){x=m.isBracket=!0,y=m.isGlob=!0,I=!0;break}}if(n===!0)continue;break}if(e.nonegate!==!0&&R===Et&&d===g){B=m.negated=!0,g++;continue}if(e.noparen!==!0&&R===ft){if(y=m.isGlob=!0,n===!0){let W=1;for(;u()!==!0&&(R=D());){if(R===rt){_=m.backslashes=!0,D();continue}if(R===ft){W++;continue}if(R===Zt&&--W===0){I=!0;break}}continue}break}if(y===!0){if(I=!0,n===!0)continue;break}}e.noext===!0&&(C=!1,y=!1);let P=h,c="",a="";g>0&&(c=h.slice(0,g),h=h.slice(g),A-=g),P&&y===!0&&A>0?(P=h.slice(0,A),a=h.slice(A)):y===!0?(P="",a=h):P=h,P&&P!==""&&P!=="/"&&P!==h&&Vt(P.charCodeAt(P.length-1))&&(P=P.slice(0,-1)),e.unescape===!0&&(a&&(a=zt.removeBackslashes(a)),P&&_===!0&&(P=zt.removeBackslashes(P)));let X={prefix:c,input:t,start:g,base:P,glob:a,isBrace:S,isBracket:x,isGlob:y,isExtglob:C,isGlobstar:H,negated:B,negatedExtglob:j};if(e.tokens===!0&&(X.maxDepth=0,Vt(R)||i.push(m),X.tokens=i),e.parts===!0||e.tokens===!0){let $;for(let N=0;N<o.length;N++){let J=$!==void 0?$+1:g,ot=o[N],Y=t.slice(J,ot);e.tokens&&(N===0&&g!==0?(i[N].isPrefix=!0,i[N].value=c):i[N].value=Y,Jt(i[N]),X.maxDepth+=i[N].depth),ot>=g&&(l.push(Y),$=ot)}let W=$!==void 0?$+1:g,U=t.slice(W);l.push(U),e.tokens&&$&&$+1<t.length&&(i[i.length-1].value=U,Jt(i[i.length-1]),X.maxDepth+=i[i.length-1].depth),X.slashes=o,X.parts=l}return X};ee.exports=Ur});var ie=et((Vs,oe)=>{"use strict";var at=it(),K=ut(),{MAX_LENGTH:ht,POSIX_REGEX_SOURCE:Kr,REGEX_NON_SPECIAL_CHARS:Xr,REGEX_SPECIAL_CHARS_BACKREF:jr,REPLACEMENTS:se}=at,Qr=(t,r)=>{if(typeof r.expandRange=="function")return r.expandRange(...t,r);t.sort();let e=`[${t.join("-")}]`;try{new RegExp(e)}catch{return t.map(n=>K.escapeRegex(n)).join("..")}return e},st=(t,r)=>`Missing ${t}: "${r}" - use "\\\\${r}" to match literal characters`,ne=t=>{let r=[],e=0,s=0,n=0,o="",i=!1;for(let l of t){if(i===!0){o+=l,i=!1;continue}if(l==="\\"){o+=l,i=!0;continue}if(l==='"'){n=n===1?0:1,o+=l;continue}if(n===0){if(l==="[")e++;else if(l==="]"&&e>0)e--;else if(e===0){if(l==="(")s++;else if(l===")"&&s>0)s--;else if(l==="|"&&s===0){r.push(o),o="";continue}}}o+=l}return r.push(o),r},zr=t=>{let r=!1;for(let e of t){if(r===!0){r=!1;continue}if(e==="\\"){r=!0;continue}if(/[?*+@!()[\]{}]/.test(e))return!1}return!0},xt=t=>{let r=t.trim(),e=!0;for(;e===!0;)e=!1,/^@\([^\\()[\]{}|]+\)$/.test(r)&&(r=r.slice(2,-1),e=!0);if(zr(r))return r.replace(/\\(.)/g,"$1")},Yr=t=>{let r=t.map(xt).filter(Boolean);for(let e=0;e<r.length;e++)for(let s=e+1;s<r.length;s++){let n=r[e],o=r[s],i=n[0];if(!(!i||n!==i.repeat(n.length)||o!==i.repeat(o.length))&&(n===o||n.startsWith(o)||o.startsWith(n)))return!0}return!1},mt=(t,r=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let e=0,s=0,n=0,o=!1;for(let i=1;i<t.length;i++){let l=t[i];if(o===!0){o=!1;continue}if(l==="\\"){o=!0;continue}if(l==='"'){n=n===1?0:1;continue}if(n!==1){if(l==="["){e++;continue}if(l==="]"&&e>0){e--;continue}if(!(e>0)){if(l==="("){s++;continue}if(l===")"&&(s--,s===0))return r===!0&&i!==t.length-1?void 0:{type:t[0],body:t.slice(2,i),end:i}}}}},Zr=t=>`${t.length===1?K.escapeRegex(t[0]):`[${t.map(e=>K.escapeRegex(e)).join("")}]`}*`,Vr=t=>{let r=0,e=[];for(;r<t.length;){let s=mt(t.slice(r),!1);if(!s||s.type!=="*")return;let n=ne(s.body).map(i=>i.trim());if(n.length!==1)return;let o=xt(n[0]);if(!o||o.length!==1)return;e.push(o),r+=s.end+1}if(!(e.length<1))return e},Jr=t=>{let r=0,e=t.trim(),s=mt(e);for(;s;)r++,e=s.body.trim(),s=mt(e);return r},ts=(t,r)=>{if(r.maxExtglobRecursion===!1)return{risky:!1};let e=typeof r.maxExtglobRecursion=="number"?r.maxExtglobRecursion:at.DEFAULT_MAX_EXTGLOB_RECURSION,s=ne(t).map(l=>l.trim());if(s.length>1&&(s.some(l=>l==="")||s.some(l=>/^[*?]+$/.test(l))||Yr(s)))return{risky:!0};let n=[],o=!1,i=!0;for(let l of s){let h=Vr(l);if(h){o=!0,n.push(...h);continue}let d=xt(l);if(d&&d.length===1){n.push(d);continue}if(i=!1,Jr(l)>e)return{risky:!0}}return o?i?{risky:!0,safeOutput:Zr([...new Set(n)])}:{risky:!0}:{risky:!1}},Ct=(t,r)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=se[t]||t;let e={...r},s=typeof e.maxLength=="number"?Math.min(ht,e.maxLength):ht,n=t.length;if(n>s)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${s}`);let o={type:"bos",value:"",output:e.prepend||""},i=[o],l=e.capture?"":"?:",h=at.globChars(e.windows),d=at.extglobChars(h),{DOT_LITERAL:g,PLUS_LITERAL:A,SLASH_LITERAL:S,ONE_CHAR:x,DOTS_SLASH:y,NO_DOT:C,NO_DOT_SLASH:H,NO_DOTS_SLASH:G,QMARK:_,QMARK_NO_DOT:B,STAR:j,START_ANCHOR:I}=h,w=f=>`(${l}(?:(?!${I}${f.dot?y:g}).)*?)`,L=e.dot?"":C,R=e.dot?_:B,m=e.bash===!0?w(e):j;e.capture&&(m=`(${m})`),typeof e.noext=="boolean"&&(e.noextglob=e.noext);let u={input:t,index:-1,start:0,dot:e.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=K.removePrefix(t,u),n=t.length;let M=[],D=[],P=[],c=o,a,X=()=>u.index===n-1,$=u.peek=(f=1)=>t[u.index+f],W=u.advance=()=>t[++u.index]||"",U=()=>t.slice(u.index+1),N=(f="",O=0)=>{u.consumed+=f,u.index+=O},J=f=>{u.output+=f.output!=null?f.output:f.value,N(f.value)},ot=()=>{let f=1;for(;$()==="!"&&($(2)!=="("||$(3)==="?");)W(),u.start++,f++;return f%2===0?!1:(u.negated=!0,u.start++,!0)},Y=f=>{u[f]++,P.push(f)},z=f=>{u[f]--,P.pop()},E=f=>{if(c.type==="globstar"){let O=u.braces>0&&(f.type==="comma"||f.type==="brace"),p=f.extglob===!0||M.length&&(f.type==="pipe"||f.type==="paren");f.type!=="slash"&&f.type!=="paren"&&!O&&!p&&(u.output=u.output.slice(0,-c.output.length),c.type="star",c.value="*",c.output=m,u.output+=c.output)}if(M.length&&f.type!=="paren"&&(M[M.length-1].inner+=f.value),(f.value||f.output)&&J(f),c&&c.type==="text"&&f.type==="text"){c.output=(c.output||c.value)+f.value,c.value+=f.value;return}f.prev=c,i.push(f),c=f},lt=(f,O)=>{let p={...d[O],conditions:1,inner:""};p.prev=c,p.parens=u.parens,p.output=u.output,p.startIndex=u.index,p.tokensIndex=i.length;let b=(e.capture?"(":"")+p.open;Y("parens"),E({type:f,value:O,output:u.output?"":x}),E({type:"paren",extglob:!0,value:W(),output:b}),M.push(p)},me=f=>{let O=t.slice(f.startIndex,u.index+1),p=t.slice(f.startIndex+2,u.index),b=ts(p,e);if((f.type==="plus"||f.type==="star")&&b.risky){let v=b.safeOutput?(f.output?"":x)+(e.capture?`(${b.safeOutput})`:b.safeOutput):void 0,Q=i[f.tokensIndex];Q.type="text",Q.value=O,Q.output=v||K.escapeRegex(O);for(let Z=f.tokensIndex+1;Z<i.length;Z++)i[Z].value="",i[Z].output="",delete i[Z].suffix;u.output=f.output+Q.output,u.backtrack=!0,E({type:"paren",extglob:!0,value:a,output:""}),z("parens");return}let T=f.close+(e.capture?")":""),F;if(f.type==="negate"){let v=m;if(f.inner&&f.inner.length>1&&f.inner.includes("/")&&(v=w(e)),(v!==m||X()||/^\)+$/.test(U()))&&(T=f.close=`)$))${v}`),f.inner.includes("*")&&(F=U())&&/^\.[^\\/.]+$/.test(F)){let Q=Ct(F,{...r,fastpaths:!1}).output;T=f.close=`)${Q})${v})`}f.prev.type==="bos"&&(u.negatedExtglob=!0)}E({type:"paren",extglob:!0,value:a,output:T}),z("parens")};if(e.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let f=!1,O=t.replace(jr,(p,b,T,F,v,Q)=>F==="\\"?(f=!0,p):F==="?"?b?b+F+(v?_.repeat(v.length):""):Q===0?R+(v?_.repeat(v.length):""):_.repeat(T.length):F==="."?g.repeat(T.length):F==="*"?b?b+F+(v?m:""):m:b?p:`\\${p}`);return f===!0&&(e.unescape===!0?O=O.replace(/\\/g,""):O=O.replace(/\\+/g,p=>p.length%2===0?"\\\\":p?"\\":"")),O===t&&e.contains===!0?(u.output=t,u):(u.output=K.wrapOutput(O,u,r),u)}for(;!X();){if(a=W(),a==="\0")continue;if(a==="\\"){let p=$();if(p==="/"&&e.bash!==!0||p==="."||p===";")continue;if(!p){a+="\\",E({type:"text",value:a});continue}let b=/^\\+/.exec(U()),T=0;if(b&&b[0].length>2&&(T=b[0].length,u.index+=T,T%2!==0&&(a+="\\")),e.unescape===!0?a=W():a+=W(),u.brackets===0){E({type:"text",value:a});continue}}if(u.brackets>0&&(a!=="]"||c.value==="["||c.value==="[^")){if(e.posix!==!1&&a===":"){let p=c.value.slice(1);if(p.includes("[")&&(c.posix=!0,p.includes(":"))){let b=c.value.lastIndexOf("["),T=c.value.slice(0,b),F=c.value.slice(b+2),v=Kr[F];if(v){c.value=T+v,u.backtrack=!0,W(),!o.output&&i.indexOf(c)===1&&(o.output=x);continue}}}(a==="["&&$()!==":"||a==="-"&&$()==="]")&&(a=`\\${a}`),a==="]"&&(c.value==="["||c.value==="[^")&&(a=`\\${a}`),e.posix===!0&&a==="!"&&c.value==="["&&(a="^"),c.value+=a,J({value:a});continue}if(u.quotes===1&&a!=='"'){a=K.escapeRegex(a),c.value+=a,J({value:a});continue}if(a==='"'){u.quotes=u.quotes===1?0:1,e.keepQuotes===!0&&E({type:"text",value:a});continue}if(a==="("){Y("parens"),E({type:"paren",value:a});continue}if(a===")"){if(u.parens===0&&e.strictBrackets===!0)throw new SyntaxError(st("opening","("));let p=M[M.length-1];if(p&&u.parens===p.parens+1){me(M.pop());continue}E({type:"paren",value:a,output:u.parens?")":"\\)"}),z("parens");continue}if(a==="["){if(e.nobracket===!0||!U().includes("]")){if(e.nobracket!==!0&&e.strictBrackets===!0)throw new SyntaxError(st("closing","]"));a=`\\${a}`}else Y("brackets");E({type:"bracket",value:a});continue}if(a==="]"){if(e.nobracket===!0||c&&c.type==="bracket"&&c.value.length===1){E({type:"text",value:a,output:`\\${a}`});continue}if(u.brackets===0){if(e.strictBrackets===!0)throw new SyntaxError(st("opening","["));E({type:"text",value:a,output:`\\${a}`});continue}z("brackets");let p=c.value.slice(1);if(c.posix!==!0&&p[0]==="^"&&!p.includes("/")&&(a=`/${a}`),c.value+=a,J({value:a}),e.literalBrackets===!1||K.hasRegexChars(p))continue;let b=K.escapeRegex(c.value);if(u.output=u.output.slice(0,-c.value.length),e.literalBrackets===!0){u.output+=b,c.value=b;continue}c.value=`(${l}${b}|${c.value})`,u.output+=c.value;continue}if(a==="{"&&e.nobrace!==!0){Y("braces");let p={type:"brace",value:a,output:"(",outputIndex:u.output.length,tokensIndex:u.tokens.length};D.push(p),E(p);continue}if(a==="}"){let p=D[D.length-1];if(e.nobrace===!0||!p){E({type:"text",value:a,output:a});continue}let b=")";if(p.dots===!0){let T=i.slice(),F=[];for(let v=T.length-1;v>=0&&(i.pop(),T[v].type!=="brace");v--)T[v].type!=="dots"&&F.unshift(T[v].value);b=Qr(F,e),u.backtrack=!0}if(p.comma!==!0&&p.dots!==!0){let T=u.output.slice(0,p.outputIndex),F=u.tokens.slice(p.tokensIndex);p.value=p.output="\\{",a=b="\\}",u.output=T;for(let v of F)u.output+=v.output||v.value}E({type:"brace",value:a,output:b}),z("braces"),D.pop();continue}if(a==="|"){M.length>0&&M[M.length-1].conditions++,E({type:"text",value:a});continue}if(a===","){let p=a,b=D[D.length-1];b&&P[P.length-1]==="braces"&&(b.comma=!0,p="|"),E({type:"comma",value:a,output:p});continue}if(a==="/"){if(c.type==="dot"&&u.index===u.start+1){u.start=u.index+1,u.consumed="",u.output="",i.pop(),c=o;continue}E({type:"slash",value:a,output:S});continue}if(a==="."){if(u.braces>0&&c.type==="dot"){c.value==="."&&(c.output=g);let p=D[D.length-1];c.type="dots",c.output+=a,c.value+=a,p.dots=!0;continue}if(u.braces+u.parens===0&&c.type!=="bos"&&c.type!=="slash"){E({type:"text",value:a,output:g});continue}E({type:"dot",value:a,output:g});continue}if(a==="?"){if(!(c&&c.value==="(")&&e.noextglob!==!0&&$()==="("&&$(2)!=="?"){lt("qmark",a);continue}if(c&&c.type==="paren"){let b=$(),T=a;(c.value==="("&&!/[!=<:]/.test(b)||b==="<"&&!/<([!=]|\w+>)/.test(U()))&&(T=`\\${a}`),E({type:"text",value:a,output:T});continue}if(e.dot!==!0&&(c.type==="slash"||c.type==="bos")){E({type:"qmark",value:a,output:B});continue}E({type:"qmark",value:a,output:_});continue}if(a==="!"){if(e.noextglob!==!0&&$()==="("&&($(2)!=="?"||!/[!=<:]/.test($(3)))){lt("negate",a);continue}if(e.nonegate!==!0&&u.index===0){ot();continue}}if(a==="+"){if(e.noextglob!==!0&&$()==="("&&$(2)!=="?"){lt("plus",a);continue}if(c&&c.value==="("||e.regex===!1){E({type:"plus",value:a,output:A});continue}if(c&&(c.type==="bracket"||c.type==="paren"||c.type==="brace")||u.parens>0){E({type:"plus",value:a});continue}E({type:"plus",value:A});continue}if(a==="@"){if(e.noextglob!==!0&&$()==="("&&$(2)!=="?"){E({type:"at",extglob:!0,value:a,output:""});continue}E({type:"text",value:a});continue}if(a!=="*"){(a==="$"||a==="^")&&(a=`\\${a}`);let p=Xr.exec(U());p&&(a+=p[0],u.index+=p[0].length),E({type:"text",value:a});continue}if(c&&(c.type==="globstar"||c.star===!0)){c.type="star",c.star=!0,c.value+=a,c.output=m,u.backtrack=!0,u.globstar=!0,N(a);continue}let f=U();if(e.noextglob!==!0&&/^\([^?]/.test(f)){lt("star",a);continue}if(c.type==="star"){if(e.noglobstar===!0){N(a);continue}let p=c.prev,b=p.prev,T=p.type==="slash"||p.type==="bos",F=b&&(b.type==="star"||b.type==="globstar");if(e.bash===!0&&(!T||f[0]&&f[0]!=="/")){E({type:"star",value:a,output:""});continue}let v=u.braces>0&&(p.type==="comma"||p.type==="brace"),Q=M.length&&(p.type==="pipe"||p.type==="paren");if(!T&&p.type!=="paren"&&!v&&!Q){E({type:"star",value:a,output:""});continue}for(;f.slice(0,3)==="/**";){let tt=t[u.index+4];if(tt&&tt!=="/")break;f=f.slice(3),N("/**",3)}let Z=X()||u.parens>0&&f===")".repeat(u.parens)&&!M.some(tt=>tt.type==="negate");if(p.type==="bos"&&X()){c.type="globstar",c.value+=a,c.output=w(e),u.output=c.output,u.globstar=!0,N(a);continue}if(p.type==="slash"&&p.prev.type!=="bos"&&!F&&Z){u.output=u.output.slice(0,-(p.output+c.output).length),p.output=`(?:${p.output}`,c.type="globstar",c.output=w(e)+(e.strictSlashes?")":"|$)"),c.value+=a,u.globstar=!0,u.output+=p.output+c.output,N(a);continue}if(p.type==="slash"&&p.prev.type!=="bos"&&f[0]==="/"){let tt=f[1]!==void 0?"|$":"";u.output=u.output.slice(0,-(p.output+c.output).length),p.output=`(?:${p.output}`,c.type="globstar",c.output=`${w(e)}${S}|${S}${tt})`,c.value+=a,u.output+=p.output+c.output,u.globstar=!0,N(a+W()),E({type:"slash",value:"/",output:""});continue}if(p.type==="bos"&&f[0]==="/"){c.type="globstar",c.value+=a,c.output=`(?:^|${S}|${w(e)}${S})`,u.output=c.output,u.globstar=!0,N(a+W()),E({type:"slash",value:"/",output:""});continue}u.output=u.output.slice(0,-c.output.length),c.type="globstar",c.output=w(e),c.value+=a,u.output+=c.output,u.globstar=!0,N(a);continue}let O={type:"star",value:a,output:m};if(e.bash===!0){O.output=".*?",(c.type==="bos"||c.type==="slash")&&(O.output=L+O.output),E(O);continue}if(c&&(c.type==="bracket"||c.type==="paren")&&e.regex===!0){O.output=a,E(O);continue}(u.index===u.start||c.type==="slash"||c.type==="dot")&&(c.type==="dot"?(u.output+=H,c.output+=H):e.dot===!0?(u.output+=G,c.output+=G):(u.output+=L,c.output+=L),$()!=="*"&&(u.output+=x,c.output+=x)),E(O)}for(;u.brackets>0;){if(e.strictBrackets===!0)throw new SyntaxError(st("closing","]"));u.output=K.escapeLast(u.output,"["),z("brackets")}for(;u.parens>0;){if(e.strictBrackets===!0)throw new SyntaxError(st("closing",")"));u.output=K.escapeLast(u.output,"("),z("parens")}for(;u.braces>0;){if(e.strictBrackets===!0)throw new SyntaxError(st("closing","}"));u.output=K.escapeLast(u.output,"{"),z("braces")}if(e.strictSlashes!==!0&&(c.type==="star"||c.type==="bracket")&&E({type:"maybe_slash",value:"",output:`${S}?`}),u.backtrack===!0){u.output="";for(let f of u.tokens)u.output+=f.output!=null?f.output:f.value,f.suffix&&(u.output+=f.suffix)}return u};Ct.fastpaths=(t,r)=>{let e={...r},s=typeof e.maxLength=="number"?Math.min(ht,e.maxLength):ht,n=t.length;if(n>s)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${s}`);t=se[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:i,ONE_CHAR:l,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:g,NO_DOTS_SLASH:A,STAR:S,START_ANCHOR:x}=at.globChars(e.windows),y=e.dot?g:d,C=e.dot?A:d,H=e.capture?"":"?:",G={negated:!1,prefix:""},_=e.bash===!0?".*?":S;e.capture&&(_=`(${_})`);let B=L=>L.noglobstar===!0?_:`(${H}(?:(?!${x}${L.dot?h:o}).)*?)`,j=L=>{switch(L){case"*":return`${y}${l}${_}`;case".*":return`${o}${l}${_}`;case"*.*":return`${y}${_}${o}${l}${_}`;case"*/*":return`${y}${_}${i}${l}${C}${_}`;case"**":return y+B(e);case"**/*":return`(?:${y}${B(e)}${i})?${C}${l}${_}`;case"**/*.*":return`(?:${y}${B(e)}${i})?${C}${_}${o}${l}${_}`;case"**/.*":return`(?:${y}${B(e)}${i})?${o}${l}${_}`;default:{let R=/^(.*?)\.(\w+)$/.exec(L);if(!R)return;let m=j(R[1]);return m?m+o+R[2]:void 0}}},I=K.removePrefix(t,G),w=j(I);return w&&e.strictSlashes!==!0&&(w+=`${i}?`),w};oe.exports=Ct});var ce=et((Js,ae)=>{"use strict";var es=re(),$t=ie(),ue=ut(),rs=it(),ss=t=>t&&typeof t=="object"&&!Array.isArray(t),k=(t,r,e=!1)=>{if(Array.isArray(t)){let g=t.map(S=>k(S,r,e));return S=>{for(let x of g){let y=x(S);if(y)return y}return!1}}let s=ss(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!s)throw new TypeError("Expected pattern to be a non-empty string");let n=r||{},o=n.windows,i=s?k.compileRe(t,r):k.makeRe(t,r,!1,!0),l=i.state;delete i.state;let h=()=>!1;if(n.ignore){let g={...r,ignore:null,onMatch:null,onResult:null};h=k(n.ignore,g,e)}let d=(g,A=!1)=>{let{isMatch:S,match:x,output:y}=k.test(g,i,r,{glob:t,posix:o}),C={glob:t,state:l,regex:i,posix:o,input:g,output:y,match:x,isMatch:S};return typeof n.onResult=="function"&&n.onResult(C),S===!1?(C.isMatch=!1,A?C:!1):h(g)?(typeof n.onIgnore=="function"&&n.onIgnore(C),C.isMatch=!1,A?C:!1):(typeof n.onMatch=="function"&&n.onMatch(C),A?C:!0)};return e&&(d.state=l),d};k.test=(t,r,e,{glob:s,posix:n}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=e||{},i=o.format||(n?ue.toPosixSlashes:null),l=t===s,h=l&&i?i(t):t;return l===!1&&(h=i?i(t):t,l=h===s),(l===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?l=k.matchBase(t,r,e,n):l=r.exec(h)),{isMatch:!!l,match:l,output:h}};k.matchBase=(t,r,e,s=e&&e.windows)=>(r instanceof RegExp?r:k.makeRe(r,e)).test(ue.basename(t,{windows:s}));k.isMatch=(t,r,e)=>k(r,e)(t);k.parse=(t,r)=>Array.isArray(t)?t.map(e=>k.parse(e,r)):$t(t,{...r,fastpaths:!1});k.scan=(t,r)=>es(t,r);k.compileRe=(t,r,e=!1,s=!1)=>{if(e===!0)return t.output;let n=r||{},o=n.contains?"":"^",i=n.contains?"":"$",l=`${o}(?:${t.output})${i}`;t&&t.negated===!0&&(l=`^(?!${l}).*$`);let h=k.toRegex(l,r);return s===!0&&(h.state=t),h};k.makeRe=(t,r={},e=!1,s=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return r.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(n.output=$t.fastpaths(t,r)),n.output||(n=$t(t,r)),k.compileRe(n,r,e,s)};k.toRegex=(t,r)=>{try{let e=r||{};return new RegExp(t,e.flags||(e.nocase?"i":""))}catch(e){if(r&&r.debug===!0)throw e;return/$^/}};k.constants=rs;ae.exports=k});var he=et((tn,fe)=>{"use strict";var le=ce(),ns=ut();function pe(t,r,e=!1){return r&&(r.windows===null||r.windows===void 0)&&(r={...r,windows:ns.isWindows()}),le(t,r,e)}Object.assign(pe,le);fe.exports=pe});import{existsSync as ks}from"node:fs";import{stat as Ds}from"node:fs/promises";import{resolve as Ee}from"node:path";import{readdir as os,readdirSync as is,realpath as us,realpathSync as as,stat as cs,statSync as ls}from"fs";import{isAbsolute as ps,posix as V,resolve as fs}from"path";import{fileURLToPath as hs}from"url";import{createRequire as Ce}from"module";import{basename as $e,dirname as dt,normalize as Le,relative as ve,resolve as we,sep as kt}from"path";import*as Te from"fs";var It=Ce(import.meta.url);function Oe(t){let r=Le(t);return r.length>1&&r[r.length-1]===kt&&(r=r.substring(0,r.length-1)),r}var He=/[\\/]/g;function Dt(t,r){return t.replace(He,r)}var Ie=/^[a-z]:[\\/]$/i;function Pe(t){return t==="/"||Ie.test(t)}function At(t,r){let{resolvePaths:e,normalizePath:s,pathSeparator:n}=r,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(e&&(t=we(t)),(s||o)&&(t=Oe(t)),t===".")return"";let i=t[t.length-1]!==n;return Dt(i?t+n:t,n)}function Nt(t,r){return r+t}function ke(t,r){return function(e,s){return s.startsWith(t)?s.slice(t.length)+e:Dt(ve(t,s),r.pathSeparator)+r.pathSeparator+e}}function De(t){return t}function Ne(t,r,e){return r+t+e}function Fe(t,r){let{relativePaths:e,includeBasePath:s}=r;return e&&t?ke(t,r):s?Nt:De}function Be(t){return function(r,e){e.push(r.substring(t.length)||".")}}function Me(t){return function(r,e,s){let n=r.substring(t.length)||".";s.every(o=>o(n,!0))&&e.push(n)}}var Ge=(t,r)=>{r.push(t||".")},We=(t,r,e)=>{let s=t||".";e.every(n=>n(s,!0))&&r.push(s)},qe=()=>{};function Ue(t,r){let{includeDirs:e,filters:s,relativePaths:n}=r;return e?n?s&&s.length?Me(t):Be(t):s&&s.length?We:Ge:qe}var Ke=(t,r,e,s)=>{s.every(n=>n(t,!1))&&e.files++},Xe=(t,r,e,s)=>{s.every(n=>n(t,!1))&&r.push(t)},je=(t,r,e,s)=>{e.files++},Qe=(t,r)=>{r.push(t)},ze=()=>{};function Ye(t){let{excludeFiles:r,filters:e,onlyCounts:s}=t;return r?ze:e&&e.length?s?Ke:Xe:s?je:Qe}var Ze=t=>t,Ve=()=>[""].slice(0,0);function Je(t){return t.group?Ve:Ze}var tr=(t,r,e)=>{t.push({directory:r,files:e,dir:r})},er=()=>{};function rr(t){return t.group?tr:er}var sr=function(t,r,e){let{queue:s,fs:n,options:{suppressErrors:o}}=r;s.enqueue(),n.realpath(t,(i,l)=>{if(i)return s.dequeue(o?null:i,r);n.stat(l,(h,d)=>{if(h)return s.dequeue(o?null:h,r);if(d.isDirectory()&&Ft(t,l,r))return s.dequeue(null,r);e(d,l),s.dequeue(null,r)})})},nr=function(t,r,e){let{queue:s,fs:n,options:{suppressErrors:o}}=r;s.enqueue();try{let i=n.realpathSync(t),l=n.statSync(i);if(l.isDirectory()&&Ft(t,i,r))return;e(l,i)}catch(i){if(!o)throw i}};function or(t,r){return!t.resolveSymlinks||t.excludeSymlinks?null:r?nr:sr}function Ft(t,r,e){if(e.options.useRealPaths)return ir(r,e);let s=dt(t),n=1;for(;s!==e.root&&n<2;){let o=e.symlinks.get(s);!!o&&(o===r||o.startsWith(r)||r.startsWith(o))?n++:s=dt(s)}return e.symlinks.set(t,r),n>1}function ir(t,r){return r.visited.includes(t+r.options.pathSeparator)}var ur=t=>t.counts,ar=t=>t.groups,cr=t=>t.paths,lr=t=>t.paths.slice(0,t.options.maxFiles),pr=(t,r,e)=>(pt(r,e,t.counts,t.options.suppressErrors),null),fr=(t,r,e)=>(pt(r,e,t.paths,t.options.suppressErrors),null),hr=(t,r,e)=>(pt(r,e,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),gr=(t,r,e)=>(pt(r,e,t.groups,t.options.suppressErrors),null);function pt(t,r,e,s){r(t&&!s?t:null,e)}function Ar(t,r){let{onlyCounts:e,group:s,maxFiles:n}=t;return e?r?ur:pr:s?r?ar:gr:n?r?lr:hr:r?cr:fr}var Bt={withFileTypes:!0},dr=(t,r,e,s,n)=>{if(t.queue.enqueue(),s<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(r),t.counts.directories++,o.readdir(r||".",Bt,(i,l=[])=>{n(l,e,s),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},yr=(t,r,e,s,n)=>{let{fs:o}=t;if(s<0)return;t.visited.push(r),t.counts.directories++;let i=[];try{i=o.readdirSync(r||".",Bt)}catch(l){if(!t.options.suppressErrors)throw l}n(i,e,s)};function Rr(t){return t?yr:dr}var Sr=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,r){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,r),t&&(r.controller.abort(),this.onQueueEmpty=void 0))}},_r=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},Er=class{aborted=!1;abort(){this.aborted=!0}},Mt=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,r,e){this.isSynchronous=!e,this.callbackInvoker=Ar(r,this.isSynchronous),this.root=At(t,r),this.state={root:Pe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new _r,options:r,queue:new Sr((s,n)=>this.callbackInvoker(n,s,e)),symlinks:new Map,visited:[""].slice(0,0),controller:new Er,fs:r.fs||Te},this.joinPath=Fe(this.root,r),this.pushDirectory=Ue(this.root,r),this.pushFile=Ye(r),this.getArray=Je(r),this.groupFiles=rr(r),this.resolveSymlink=or(r,this.isSynchronous),this.walkDirectory=Rr(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,r,e)=>{let{paths:s,options:{filters:n,resolveSymlinks:o,excludeSymlinks:i,exclude:l,maxFiles:h,signal:d,useRealPaths:g,pathSeparator:A},controller:S}=this.state;if(S.aborted||d&&d.aborted||h&&s.length>h)return;let x=this.getArray(this.state.paths);for(let y=0;y<t.length;++y){let C=t[y];if(C.isFile()||C.isSymbolicLink()&&!o&&!i){let H=this.joinPath(C.name,r);this.pushFile(H,x,this.state.counts,n)}else if(C.isDirectory()){let H=Ne(C.name,r,this.state.options.pathSeparator);if(l&&l(C.name,H))continue;this.pushDirectory(H,s,n),this.walkDirectory(this.state,H,H,e-1,this.walk)}else if(this.resolveSymlink&&C.isSymbolicLink()){let H=Nt(C.name,r);this.resolveSymlink(H,this.state,(G,_)=>{if(G.isDirectory()){if(_=At(_,this.state.options),l&&l(C.name,g?_:H+A))return;this.walkDirectory(this.state,_,g?_:H+A,e-1,this.walk)}else{_=g?_:H;let B=$e(_),j=At(dt(_),this.state.options);_=this.joinPath(B,j),this.pushFile(_,x,this.state.counts,n)}})}}this.groupFiles(this.state.groups,r,x)}};function br(t,r){return new Promise((e,s)=>{Gt(t,r,(n,o)=>{if(n)return s(n);e(o)})})}function Gt(t,r,e){new Mt(t,r,e).start()}function mr(t,r){return new Mt(t,r).start()}var Pt=class{constructor(t,r){this.root=t,this.options=r}withPromise(){return br(this.root,this.options)}withCallback(t){Gt(this.root,this.options,t)}sync(){return mr(this.root,this.options)}},Wt=null;try{It.resolve("picomatch"),Wt=It("picomatch")}catch{}var qt=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:kt,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Pt(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,r){return this.options={...this.options,...r},new Pt(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...r){let e=this.globFunction||Wt;if(!e)throw new Error("Please specify a glob function to use glob matching.");var s=this.globCache[t.join("\0")];return s||(s=e(t,...r),this.globCache[t.join("\0")]=s),this.options.filters.push(n=>s(n)),this}};var nt=xe(he(),1),gs=Array.isArray,ye=/\\/g,As=/^[A-Za-z]:$/,Re=process.platform==="win32",ds=/^(\/?\.\.)+$/;function ys(t,r={}){let e=t.length,s=Array(e),n=Array(e),o,i;for(o=0;o<e;o++){let l=Se(t[o]);s[o]=l;let h=l.length,d=Array(h);for(i=0;i<h;i++)d[i]=(0,nt.default)(l[i],r);n[o]=d}return l=>{let h=l.split("/");if(h[0]===".."&&ds.test(l))return!0;for(o=0;o<e;o++){let d=s[o],g=n[o],A=h.length,S=Math.min(A,d.length);for(i=0;i<S;){let x=d[i];if(x.includes("/"))return!0;if(!g[i](h[i]))break;if(!r.noglobstar&&x==="**")return!0;i++}if(i===A)return!0}return!1}}var Rs=/^[A-Z]:\/$/i,Ss=Re?t=>Rs.test(t):t=>t==="/";function ge(t,r,e){if(t===r||r.startsWith(`${t}/`)){if(e){let n=t.length+ +!Ss(t);return(o,i)=>o.slice(n,i?-1:void 0)||"."}let s=r.slice(t.length+1);return s?(n,o)=>{if(n===".")return s;let i=`${s}/${n}`;return o?i.slice(0,-1):i}:(n,o)=>o&&n!=="."?n.slice(0,-1):n}return e?s=>V.relative(t,s)||".":s=>V.relative(t,`${r}/${s}`)||"."}function _s(t,r){if(r.startsWith(`${t}/`)){let e=r.slice(t.length+1);return s=>`${e}/${s}`}return e=>{let s=V.relative(t,`${r}/${e}`);return e[e.length-1]==="/"&&s!==""?`${s}/`:s||"."}}function Ae(t){return t.replace(As,r=>`${r}/`)}var Es={parts:!0};function Se(t){var r;let e=nt.default.scan(t,Es);return!((r=e.parts)===null||r===void 0)&&r.length?e.parts:[t]}var bs=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,ms=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,xs=t=>t.replace(bs,"\\$&"),Cs=t=>t.replace(ms,"\\$&"),$s=Re?Cs:xs;function Ls(t,r){if(r?.caseSensitiveMatch===!1)return!0;let e=nt.default.scan(t);return e.isGlob||e.negated}function ct(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function _e(t){return typeof t=="string"?[t]:t??[]}var vs=/^(\/?\.\.)+/,ws=/\\(?=[()[\]{}!*+?@|])/g;function Lt(t,r,e,s){var n;let o=r.cwd,i=t;t[t.length-1]==="/"&&(i=t.slice(0,-1)),i[i.length-1]!=="*"&&r.expandDirectories&&(i+="/**");let l=$s(o);i=ps(i.replace(ws,""))?V.relative(l,i):V.normalize(i);let h=(n=vs.exec(i))===null||n===void 0?void 0:n[0],d=Se(i);if(h){let A=(h.length+1)/3,S=0,x=l.split("/");for(;S<A&&d[S+A]===x[x.length+S-A];)i=i.slice(0,(A-S-1)*3)+i.slice((A-S)*3+d[S+A].length+1)||".",S++;let y=V.join(o,h.slice(S*3));y[0]!=="."&&e.root.length>y.length&&(e.root=Ae(y),e.depthOffset=-A+S)}if(!s&&e.depthOffset>=0){var g;(g=e.commonPath)!==null&&g!==void 0||(e.commonPath=d);let A=[],S=Math.min(e.commonPath.length,d.length);for(let x=0;x<S;x++){let y=d[x];if(y==="**"&&!d[x+1]){A.pop();break}if(x===d.length-1||y!==e.commonPath[x]||Ls(y))break;A.push(y)}e.depthOffset=A.length,e.commonPath=A,e.root=Ae(A.length>0?V.join(o,...A):o)}return i}function Ts(t,r,e){let s=[],n=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&n.push(Lt(o,t,e,!0));for(let o of r)o&&(o[0]!=="!"||o[1]==="("?s.push(Lt(o,t,e,!1)):(o[1]!=="!"||o[2]==="(")&&n.push(Lt(o.slice(1),t,e,!0)));return{match:s,ignore:n}}function Os(t,r){let e=t.cwd,s={root:e,depthOffset:0},n=Ts(t,r,s);t.debug&&ct("internal processing patterns:",n);let{absolute:o,caseSensitiveMatch:i,debug:l,dot:h,followSymbolicLinks:d,onlyDirectories:g}=t,A=s.root.replace(ye,""),S={dot:h,nobrace:t.braceExpansion===!1,nocase:!i,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},x=(0,nt.default)(n.match,S),y=(0,nt.default)(n.ignore,S),C=ys(n.match,S),H=ge(e,A,o),G=o?H:ge(e,A,!0),_=(I,w)=>{let L=G(w,!0);return L!=="."&&!C(L)||y(L)},B;t.deep!==void 0&&(B=Math.round(t.deep-s.depthOffset));let j=new qt({filters:[l?(I,w)=>{let L=H(I,w),R=x(L)&&!y(L);return R&&ct(`matched ${L}`),R}:(I,w)=>{let L=H(I,w);return x(L)&&!y(L)}],exclude:l?(I,w)=>{let L=_(I,w);return ct(`${L?"skipped":"crawling"} ${w}`),L}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:d,excludeSymlinks:!d,excludeFiles:g,includeDirs:g||!t.onlyFiles,maxDepth:B,signal:t.signal}).crawl(A);return t.debug&&ct("internal properties:",{...s,root:A}),[j,e!==A&&!o&&_s(e,A)]}function Hs(t,r){if(r)for(let e=t.length-1;e>=0;e--)t[e]=r(t[e]);return t}var de={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Is(t){let r=Object.assign({},t);for(let e in de)r[e]===void 0&&Object.assign(r,{[e]:de[e]});return r.cwd=(r.cwd instanceof URL?hs(r.cwd):fs(r.cwd||process.cwd())).replace(ye,"/"),r.ignore=_e(r.ignore),r.fs&&(r.fs={readdir:r.fs.readdir||os,readdirSync:r.fs.readdirSync||is,realpath:r.fs.realpath||us,realpathSync:r.fs.realpathSync||as,stat:r.fs.stat||cs,statSync:r.fs.statSync||ls}),r.debug&&ct("globbing with options:",r),r}function Ps(t,r={}){var e;if(t&&r?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let s=gs(t)||typeof t=="string",n=_e((e=s?t:t.patterns)!==null&&e!==void 0?e:"**/*"),o=Is(s?r:t);return n.length>0?Os(o,n):[]}async function vt(t,r){let[e,s]=Ps(t,r);return e?Hs(await e.withPromise(),s):[]}var be=Object.values(wt).flatMap(t=>t.extensions).map(t=>t.slice(1));function Ns(t){return/[*?[\]{}]/.test(t)}async function Fs(t,r){let e=r?`**/*.{${be.join(",")}}`:`*.{${be.join(",")}}`;return(await vt([e],{cwd:t,absolute:!0,onlyFiles:!0,caseSensitiveMatch:!1})).sort()}async function Bs(t,r,e,s){let n=await Fs(t,r);if(n.length===0){e.push({path:t,error:Ot(t)});return}for(let o of n)await s(o,t,!1)}async function gn(t,r){let e=[],s=[],n=new Map,o=new Set,i=async(l,h,d)=>{let g=Ee(l);if(!o.has(g)){o.add(g);try{e.push(await Ht(g)),h&&n.set(g,h)}catch(A){if(Tt(A))s.push({path:g,error:A});else if(d)throw A}}};for(let l of t){let h=Ee(l);if(Ns(l)&&!ks(h)){let g=(r.platform??process.platform)==="win32"?l.replaceAll("\\","/"):l,A=await vt([g],{absolute:!0,onlyFiles:!0});A.length===0&&s.push({path:h,error:gt(h)});for(let S of A.sort())await i(S,void 0,!1);continue}let d;try{d=await Ds(h)}catch{s.push({path:h,error:gt(h)});continue}if(d.isDirectory()){await Bs(h,r.recursive,s,i);continue}await i(h,void 0,!0)}return{sources:e,failures:s,roots:n}}export{gn as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{D as E,E as l,F as S}from"./chunk-WIPP5TWQ.js";import{c as x}from"./chunk-H3DIRJFE.js";import{existsSync as h,statSync as w}from"node:fs";import{basename as f,dirname as T,extname as g,isAbsolute as _,join as c,relative as M,resolve as i,sep as D}from"node:path";function $(t){return t.endsWith("/")||t.endsWith(D)||h(t)&&w(t).isDirectory()?!0:g(t)===""}var O=255;function P(t,r){return r==="darwin"||r==="win32"?t.length:Buffer.byteLength(t)}function a(t,r,n=process.platform){if(P(t+r,n)<=O)return t+r;let e="";for(let s of t){if(P(e+s+r,n)>O)break;e+=s}return e+r}function nt(t,r){if(i(t)===i(r))return!0;try{let n=w(t),e=w(r);return n.dev===e.dev&&n.ino===e.ino}catch{return!1}}function L(t,r){let n=f(t),e=g(n),s=e?n.slice(0,-e.length):n;return a(s,x(r))}function b(t,r,n){if(!n)return t;let e=M(i(n),r);return!e||e.startsWith("..")?t:c(t,e)}function F(t){let r=i(t.sourcePath),n=L(r,t.target);if(!t.output)return c(i(r,".."),n);let e=_(t.output)?t.output:i(t.output);return $(t.output)?c(b(e,i(r,".."),t.sourceRoot),n):i(e)}function et(t){let r=F(t);if(t.output&&!$(t.output))return r;let n=g(r);return c(i(r,".."),a(f(r,n),`-${t.suffix}${n}`))}function it(t){if(!h(t))return t;let r=i(t,".."),n=f(t),e=g(n),s=e?n.slice(0,-e.length):n;for(let o=1;o<1e4;o++){let u=c(r,a(s,` (${o})${e}`));if(!h(u))return u}throw new Error(`no free name beside ${n}`)}function p(t){let r=i(t,".."),n=f(t),e=g(n);return{dir:r,stem:e?n.slice(0,-e.length):n,ext:e||".pdf"}}function A(t,r){let{dir:n,stem:e,ext:s}=p(i(t));return c(n,a(e,`-${r}${s}`))}function st(t,r){let{dir:n,stem:e,ext:s}=p(i(t)),o=String(r).length;return Array.from({length:r},(u,m)=>c(n,a(e,`-${String(m+1).padStart(o,"0")}${s}`)))}function ot(t,r,n,e,s){let{stem:o}=p(i(t)),u=e?b(i(e),i(t,".."),s):i(t,".."),m=x(n),I=String(Math.max(1,...r.map(d=>d+1))).length,W=r.map(d=>c(u,a(o,`-${String(d+1).padStart(I,"0")}${m}`))),[y,...R]=W;if(y===void 0)throw new Error("rasterOutputPaths requires at least one selected page");return[y,...R]}function ut(t,r,n){if(!n)return[A(t,"extract")];let{dir:e,stem:s,ext:o}=p(i(t));return r.map(u=>c(e,a(s,`-p${u+1}${o}`)))}function ct(t){let r=i(t[0]??"merged.pdf");if(new Set(t.map(e=>i(e,".."))).size===1){let e=i(r,"..");return c(e,a(f(e),"-merged.pdf"))}return A(r,"merged")}function k(t,r,n){let e=r?t.map(o=>c(r,f(o))):t,[s]=e;return!n||e.length!==1||s===void 0?e:[c(T(s),`${n}${g(s)}`)]}function at(t,r,n){return k([t],r,n)[0]??t}import{randomBytes as B}from"node:crypto";import{constants as J}from"node:fs";import{access as j,mkdir as C,rename as N,rm as U,writeFile as Y}from"node:fs/promises";import{basename as z,dirname as v,extname as G,join as K}from"node:path";function H(t,r=B(6).toString("hex")){let n=G(t);return K(v(t),a(`.forge-${r}-${z(t,n)}`,n))}async function Q(t){let r=v(t);try{await C(r,{recursive:!0})}catch(n){let e=l(t,n);throw e===n?S(t,n):e}try{await j(r,J.W_OK)}catch(n){throw E(t,n)}}var V=new Set(["EPERM","EBUSY","EACCES"]),X=5,ht=9;async function Z(t,r,n=process.platform,e=o=>new Promise(u=>setTimeout(u,o)),s=X){if(n!=="win32"){await N(t,r);return}for(let o=1;;o++)try{await N(t,r);return}catch(u){let m=u.code;if(o>=s||!m||!V.has(m))throw u;await e(Math.min(50*2**(o-1),1e3))}}async function wt(t,r){await Q(t);let n=H(t);try{return await Y(n,r),await Z(n,t),r.byteLength}catch(e){throw await U(n,{force:!0}).catch(()=>{}),l(t,e)}}export{$ as a,a as b,nt as c,F as d,et as e,it as f,A as g,st as h,ot as i,ut as j,ct as k,k as l,at as m,H as n,Q as o,ht as p,Z as q,wt as r};
|